{"version":3,"sources":["../../index.ts","../../../src/resolvers.ts","../../../src/schemes.ts","routes/ScrollToTop.ts","components/ErrorBoundary.tsx","config/axios/index.ts","config/firebase/index.ts","utils/error/index.ts","components/LoadingLinearProgress.ts","contexts/RequestInterceptor.tsx","contexts/auth.tsx","utils/store/index.ts","hooks/useAppointment.ts","hooks/useCaregiver.ts","hooks/useEmergencyContacts.ts","hooks/useMeasurementSchedule.ts","hooks/useMedication.ts","hooks/useRoutine.ts","hooks/useShiftSchedule.ts","contexts/registrationDashboard.tsx","components/PendingRegistrationBanner/styles.ts","components/PendingRegistrationBanner/index.tsx","components/StyledFieldset.ts","components/StyledTabs.ts","contexts/permission.tsx","hooks/useCanAccess.ts","styles/theme.ts","styles/colorMapping.ts","components/StyledTextField/styles.ts","components/StyledTextField/index.tsx","components/Forms/FormikTextField.tsx","components/StyledButton.ts","components/PasswordRules/styles.ts","components/PasswordRules/index.tsx","pages/Account/ChangePassword/styles.ts","utils/inputs/index.tsx","pages/Account/ChangePassword/utils.ts","pages/Account/ChangePassword/ChangePassword.tsx","utils/math/index.ts","utils/date/index.ts","pages/Account/styles.ts","pages/Account/Payment/styles.ts","pages/Account/Payment/Payment.tsx","pages/Account/Personal/styles.ts","pages/Account/Personal/utils.ts","hooks/useGuardian.ts","pages/Account/Personal/Personal.tsx","assets/Elipseblue.svg","assets/Elipsegreen.svg","components/Header/styles.ts","components/Header/Header.tsx","hooks/usePatient.ts","hooks/useMedia.ts","components/PatientAvatar/PatientAvatar.tsx","hooks/useUser.ts","components/UserAvatar/UserAvatar.tsx","components/PageTitle/PageTitle.tsx","components/StyledIconButton/StyledIconButton.tsx","components/BackButton/BackButton.tsx","components/Icons/PscIcon.tsx","components/PscButton/PscButton.tsx","pages/Account/Account.tsx","components/StyledPaper.ts","components/AppointmentCard/styles.ts","webpack:///./src/assets/Icon-coloredCalendar.svg?2130","components/AppointmentCard/index.tsx","components/ButtonLink.tsx","components/Fab/styles.ts","components/Fab/index.tsx","components/ReportDownloadButton/styles.ts","components/ReportDownloadButton/index.tsx","pages/Appointments/styles.ts","pages/Appointments/Appointments.tsx","hooks/useSubCategory.ts","components/StyledSelectField/styles.ts","components/StyledSelectField/index.tsx","components/Forms/FormikSelect.tsx","components/StyledTextFieldWhite.ts","components/PasswordField/index.tsx","components/FormCardContainer.ts","assets/elderlyIcon.svg","components/MedicBalloon/styles.ts","components/MedicBalloon/index.tsx","components/StyledMenuItem.tsx","components/AppointmentsUpsertForm/styles.ts","components/AppointmentsUpsertForm/index.tsx","pages/Appointments/AppointmentsInsert/styles.ts","pages/Appointments/AppointmentsInsert/AppointmentsInsert.tsx","components/StyledSimpleDialog/styles.ts","components/StyledDialog/styles.ts","components/StyledDialog/index.tsx","components/StyledSimpleDialog/index.tsx","pages/Appointments/AppointmentsUpdate/styles.ts","components/RemoveButton/RemoveButton.tsx","pages/Appointments/AppointmentsUpdate/AppointmentsUpdate.tsx","assets/loginBackground.png","pages/AwaitingReview/styles.ts","pages/AwaitingReview/AwaitingReview.tsx","pages/BlockPages/styles.ts","components/LogoutDialog/styles.ts","components/LogoutDialog/index.tsx","pages/BlockPages/NoOrganizationIdBlock/NoOrganizationIdBlock.tsx","pages/BlockPages/NoPatientRelationsBlock/NoPatientRelationsBlock.tsx","assets/user.png","components/CardItem/styles.ts","components/CardItem/index.tsx","pages/Caregiver/styles.ts","pages/Caregiver/Caregiver.tsx","components/LoadingBackdrop/styles.ts","components/LoadingBackdrop/index.tsx","components/PendingRegistrationWarningBanner/styles.ts","components/PendingRegistrationWarningBanner/index.tsx","components/RoleApps/styles.ts","components/RoleApps/index.tsx","assets/logo-purple.png","hooks/useRoles.ts","pages/Caregiver/UserForm/styles.ts","pages/Caregiver/UserForm/CollapsibleCaption/styles.ts","pages/Caregiver/UserForm/CollapsibleCaption/index.tsx","pages/Caregiver/UserForm/RelateToPatientDialog/UserList/styles.ts","pages/Caregiver/UserForm/RelateToPatientDialog/UserList/index.tsx","pages/Caregiver/UserForm/RelateToPatientDialog/styles.ts","pages/Caregiver/UserForm/RelateToPatientDialog/index.tsx","pages/Caregiver/UserForm/ShareActivationLinkDialog/utils.ts","assets/copy-icon.svg","pages/Caregiver/UserForm/ShareActivationLinkDialog/styles.ts","pages/Caregiver/UserForm/ShareActivationLinkDialog/index.tsx","pages/Caregiver/UserForm/UnrelateFromOrganizationDialog/index.tsx","pages/Caregiver/UserForm/utils.ts","pages/Caregiver/UserForm/UserForm.tsx","components/StyledKeyboardDatePicker/styles.ts","components/StyledKeyboardDatePicker/index.tsx","pages/CompleteSignup/styles.ts","pages/CompleteSignup/utils.ts","pages/CompleteSignup/CompleteSignup.tsx","components/EmergencyContactCard/styles.ts","components/EmergencyContactCard/index.tsx","pages/Contacts/styles.ts","assets/burger-menu.svg","components/MenuButton/MenuButton.tsx","assets/sign-out-icon.svg","components/SideMenu/styles.ts","components/SideMenu/AppSchortcut/index.tsx","components/SideMenu/SideMenuIcons/userIcon.tsx","components/SideMenu/SideMenuIcons/fileIcon.tsx","components/SideMenu/SideMenuIcons/caseIcon.tsx","components/SideMenu/SideMenuIcons/handIcon.tsx","components/SideMenu/SideMenuIcons/shareIcon.tsx","components/SideMenu/SideMenu.tsx","pages/Contacts/Contacts.tsx","components/ContactsUpsertForm/styles.ts","components/ContactsUpsertForm/utils.ts","components/ContactsUpsertForm/index.tsx","pages/Contacts/ContactsInsert/styles.ts","pages/Contacts/ContactsInsert/ContactsInsert.tsx","pages/Contacts/ContactsUpdate/styles.ts","pages/Contacts/ContactsUpdate/ContactsUpdate.tsx","components/ShiftTimeContestationDateBlock/styles.ts","components/ShiftTimeContestationDateBlock/index.tsx","components/StyledFormControlLabel.ts","hooks/useShift.ts","hooks/useShiftExecutionTimeContestation.ts","pages/CreateTimeContestation/ConfirmSaveDialog/index.tsx","pages/CreateTimeContestation/styles.ts","pages/CreateTimeContestation/DateTimePickers/index.tsx","pages/CreateTimeContestation/CreateTimeContestation.tsx","pages/ExecutionHistoryContestation/utils.tsx","pages/ExecutionHistoryContestation/styles.ts","pages/ExecutionHistoryContestation/OriginalSchedules/index.tsx","pages/ExecutionHistoryContestation/AnnulledCard/index.tsx","pages/ExecutionHistoryContestation/TimeContestationCard/index.tsx","pages/ExecutionHistoryContestation/ExecutionHistoryContestation.tsx","hooks/useShiftReport.ts","components/StyledSimpleModal.tsx","components/ShiftsHistory/ExportModal/styles.ts","components/ShiftsHistory/ExportModal/utils.ts","components/ShiftsHistory/ExportModal/index.tsx","components/DropdownMenu/styles.ts","components/DropdownMenu/MenuItem/index.tsx","components/DropdownMenu/index.tsx","assets/Icon-user-expel.svg","components/ExpelCaregiverButton/styles.ts","components/ExpelCaregiverButton/index.tsx","components/ExpelCaregiverDialog/styles.ts","components/ExpelCaregiverDialog/index.tsx","components/ShiftsHistory/styles.ts","webpack:///./src/assets/Icon-user-expel.svg?6b6c","components/ShiftsHistory/ShiftCard/styles.ts","components/ShiftsHistory/utils.ts","components/ShiftsHistory/ShiftCard/ShiftCardMessage/index.tsx","components/ShiftsHistory/ShiftCard/ShiftInProgressIndicator/styles.ts","components/ShiftsHistory/ShiftCard/ShiftInProgressIndicator/index.tsx","components/ShiftsHistory/ShiftCard/ShiftTimeMessage/index.tsx","components/ShiftsHistory/ShiftCard/index.tsx","components/ShiftsHistory/ShiftReportListDialog/ShiftReportCard/styles.ts","components/ShiftsHistory/ShiftReportListDialog/ShiftReportCard/index.tsx","components/ShiftsHistory/ShiftReportListDialog/styles.ts","components/ShiftsHistory/ShiftReportListDialog/utils.tsx","components/ShiftsHistory/ShiftReportListDialog/index.tsx","components/ShiftsHistory/index.tsx","pages/Follow/History/styles.ts","pages/Follow/History/History.tsx","assets/Icon-filter.svg","assets/Icon-flat-accomplished.svg","assets/icon-flat-accomplished-warning.svg","assets/Icon-flat-appointment.svg","assets/Icon-flat-awaiting.svg","assets/Icon-flat-complication.svg","assets/Icon-flat-measurement.svg","assets/Icon-flat-medication.svg","assets/Icon-flat-not-accomplished.svg","assets/Icon-flat-routine.svg","assets/Icon-coloredCalendar.svg","assets/Icon-done.svg","assets/Icon-notdone.svg","assets/Icon-time-color.svg","components/ShiftEventList/LastShiftCards/styles.ts","components/ShiftEventList/LastShiftCards/AppointmentCard/styles.ts","components/ShiftEventList/LastShiftCards/AppointmentCard/index.tsx","assets/AlertIcon.svg","components/ShiftEventList/LastShiftCards/ComplicationCard/styles.ts","components/ShiftEventList/LastShiftCards/ComplicationCard/index.tsx","assets/Icon-medication.svg","components/ShiftEventList/LastShiftCards/MedicationCard/styles.ts","components/ShiftEventList/LastShiftCards/MedicationCard/index.tsx","components/ShiftEventList/LastShiftCards/MedicationCard/utils.ts","assets/Icon-mesurement.svg","components/ShiftEventList/LastShiftCards/MesurementCard/styles.ts","components/ShiftEventList/LastShiftCards/MesurementCard/index.tsx","assets/Icon-watch.svg","components/ShiftEventList/LastShiftCards/RoutineCard/styles.tsx","components/ShiftEventList/LastShiftCards/RoutineCard/index.tsx","components/ShiftEventList/utils.ts","components/ShiftEventList/LastShiftCards/ScheduledMeasurementCard/Measurement/styles.ts","components/ShiftEventList/LastShiftCards/ScheduledMeasurementCard/Measurement/index.tsx","components/ShiftEventList/LastShiftCards/ScheduledMeasurementCard/styles.ts","components/ShiftEventList/LastShiftCards/ScheduledMeasurementCard/index.tsx","components/ShiftEventList/styles.ts","components/ShiftEventList/index.tsx","hooks/useEventCareHistory/index.ts","contexts/CareHistoryFilter.tsx","assets/icon-accomplished-negative.svg","assets/icon-awaiting-negative.svg","assets/icon-not-accomplished-negative.svg","assets/icon-flat-accomplished-warning-white.svg","components/FilterChip/styles.ts","components/FilterChip/index.tsx","pages/Follow/CareHistory/styles.ts","pages/Follow/CareHistory/FilterDrawer/styles.ts","components/FilterChip/FilterChipMultiselect/styles.ts","components/FilterChip/FilterChipMultiselect/MultiselectModal.tsx","components/FilterChip/FilterChipMultiselect/index.tsx","pages/Follow/CareHistory/FilterDrawer/utils.ts","pages/Follow/CareHistory/FilterDrawer/MedicationFilterChipMultiselect.tsx","pages/Follow/CareHistory/FilterDrawer/MeasurementFilterChipMultiselect.tsx","pages/Follow/CareHistory/FilterDrawer/ComplicationFilterChipMultiselect.tsx","pages/Follow/CareHistory/FilterDrawer/AppointmentFilterChipMultiselect.tsx","pages/Follow/CareHistory/FilterDrawer/RoutineFilterChipMultiselect.tsx","pages/Follow/CareHistory/FilterDrawer/index.tsx","pages/Follow/CareHistory/ReportButton/styles.ts","pages/Follow/CareHistory/ReportButton/index.tsx","pages/Follow/CareHistory/EventHistory.tsx","pages/Follow/Reports/styles.ts","pages/Follow/Reports/Reports.tsx","components/CareCategoriesList/Card/styles.tsx","components/CareCategoriesList/Card/utils.tsx","components/CareCategoriesList/Card/index.tsx","components/CareCategoriesList/styles.ts","components/CareCategoriesList/utils.ts","components/CareCategoriesList/index.tsx","components/CollapsibleCardContent/styles.ts","components/CollapsibleCardContent/index.tsx","hooks/useOverflowDetector.ts","components/ExecutionMessageCard/styles.ts","components/ExecutionMessageCard/index.tsx","components/ShiftEventList/LastShiftCards/ScheduledMeasurementCard/utils.ts","pages/Follow/History/Shift/styles.ts","pages/Follow/styles.ts","pages/Follow/Shift/styles.ts","assets/Icon-check-circle.svg","pages/Follow/Shift/Shift.tsx","pages/Follow/Follow.tsx","pages/Follow/History/Shift/PreviousOrNextShift/styles.ts","pages/Follow/History/Shift/PreviousOrNextShift/index.tsx","pages/Follow/History/Shift/FollowShift.tsx","pages/ForgotPassword/utils.ts","pages/ForgotPassword/styles.ts","pages/ForgotPassword/ForgotPassword.tsx","hooks/usePlan.ts","pages/GuardianRegister/styles.ts","pages/GuardianRegister/utils.ts","pages/GuardianRegister/GuardianRegister.tsx","components/InterviewAnswerList/styles.ts","components/InterviewAnswerList/InterviewAnswer/InterviewAnswerOption/index.tsx","components/InterviewAnswerList/InterviewAnswer/index.tsx","components/InterviewAnswerList/index.tsx","hooks/useInterview.ts","pages/Interview/styles.ts","pages/Interview/utils.ts","pages/Interview/Interview.tsx","assets/logo-cuidador-inline.svg","components/MadeBy/styles.ts","components/MadeBy/index.tsx","assets/senior-background.png","pages/Login/styles.ts","pages/Login/utils.ts","pages/Login/Login.tsx","components/MeasurementScheduleCard/styles.ts","components/MeasurementScheduleCard/utils.tsx","components/MeasurementScheduleCard/index.tsx","pages/MeasurementSchedule/List/styles.ts","pages/MeasurementSchedule/List/MeasurementScheduleList.tsx","components/StyledWeekDaySelect.ts","components/Forms/styles.tsx","components/Forms/FormikWeekDaySelect.tsx","components/MeasurementScheduleForm/ErrorText/styles.ts","components/MeasurementScheduleForm/DaysSelector/index.tsx","components/MeasurementScheduleForm/ErrorText/index.tsx","components/MeasurementScheduleForm/InformativeText/styles.ts","components/MeasurementScheduleForm/InformativeText/index.tsx","hooks/useMeasurement.ts","components/MeasurementScheduleForm/MeasurementsSelector/styles.ts","components/MeasurementScheduleForm/MeasurementsSelector/index.tsx","components/MeasurementScheduleForm/MedicBalloon/styles.ts","components/MeasurementScheduleForm/MedicBalloon/index.tsx","components/MeasurementScheduleForm/PeriodSelector/styles.ts","components/MeasurementScheduleForm/PeriodSelector/index.tsx","components/MeasurementScheduleForm/schema.ts","components/MeasurementScheduleForm/styles.ts","components/MeasurementScheduleForm/SubmitButton/styles.ts","components/MeasurementScheduleForm/SubmitButton/index.tsx","components/MeasurementScheduleForm/TimeSelector/styles.ts","components/MeasurementScheduleForm/TimeSelector/index.tsx","components/MeasurementScheduleForm/index.tsx","components/MeasurementScheduleForm/utils/parseFormDataToModel.ts","pages/MeasurementSchedule/Register/styles.ts","pages/MeasurementSchedule/Register/MeasurementScheduleRegister.tsx","components/MeasurementScheduleForm/utils/parseModelToFormData.ts","pages/MeasurementSchedule/Update/styles.ts","pages/MeasurementSchedule/Update/index.tsx","components/BuyMedicationDialog/styles.ts","components/BuyMedicationDialog/index.tsx","assets/Icon-pills-noBackground.svg","components/MedicationCard/styles.ts","components/MedicationInsertForm/MedicationSecondStep/utils/index.ts","components/MedicationCard/utils.tsx","components/MedicationCard/index.tsx","pages/Medication/styles.ts","pages/Medication/utils.ts","hooks/useDoseCerta.ts","pages/Medication/Medication.tsx","components/AutocompleteTextField/index.tsx","components/MedicationUpsertForm/styles.ts","components/MedicationUpsertForm/utils.ts","components/MedicationUpsertForm/index.tsx","pages/Medication/MedicationInsert/styles.ts","pages/Medication/MedicationInsert/MedicationInsert.tsx","components/LoadingSimpleCircular/styles.ts","components/LoadingSimpleCircular/index.tsx","components/MedicationFirstStepCard/styles.ts","components/MedicationFirstStepCard/index.tsx","components/MedicationSearchBar/styles.ts","components/MedicationSearchBar/index.tsx","components/MedicationInsertForm/styles.ts","components/MedicationInsertForm/MedicationFirstStep/index.tsx","components/MedicationInsertForm/MedicationSecondStep/ErrorText/styles.ts","components/MedicationInsertForm/MedicationSecondStep/DaysSelector/index.tsx","components/MedicationInsertForm/MedicationSecondStep/ErrorText/index.tsx","components/MedicationInsertForm/MedicationSecondStep/PeriodSelector/styles.ts","components/MedicationInsertForm/MedicationSecondStep/PeriodSelector/index.tsx","components/MedicationInsertForm/schema.tsx","components/MedicationInsertForm/MedicationSecondStep/TimeSelector/styles.ts","components/MedicationInsertForm/MedicationSecondStep/TimeSelector/index.tsx","components/MedicationInsertForm/MedicationSecondStep/index.tsx","components/MedicationInsertForm/index.tsx","components/MedicationInsertForm/MedicationSecondStep/utils/parseFormDataToModel.ts","pages/Medication/MedicationInsertV2/MedicationInsertV2.tsx","pages/Medication/MedicationUpdate/styles.ts","pages/Medication/MedicationUpdate/MedicationUpdate.tsx","components/MedicationInsertForm/MedicationSecondStep/utils/parseModelToFormData.ts","pages/Medication/MedicationUpdateV2/MedicationUpdateV2.tsx","components/RegistrationOnboardingCard/styles.ts","components/RegistrationOnboardingCard/index.tsx","pages/Onboarding/styles.ts","pages/Onboarding/Onboarding.tsx","components/SelectCard/PatientRelationButton/styles.ts","assets/link-icon.svg","components/SelectCard/PatientRelationButton/index.tsx","assets/active-icon.svg","assets/pending-icon.svg","assets/disable-icon.svg","components/SelectCard/utils.tsx","components/SelectCard/Member/styles.ts","components/SelectCard/Member/index.tsx","pages/Organization/utils.ts","pages/Organization/Patient/styles.ts","components/SearchTextField/SearchTextField.tsx","pages/Organization/Patient/OrganizationPatient.tsx","pages/Organization/User/AutoRelateModal/styles.ts","pages/Organization/User/AutoRelateModal/index.tsx","pages/Organization/User/styles.ts","pages/Organization/User/OrganizationUser.tsx","hooks/useCEP.ts","components/ProfilePicture/styles.ts","components/ProfilePicture/index.tsx","components/RegistrationDashboardCard/styles.ts","components/RegistrationDashboardCard/renderStatusMessage.tsx","components/RegistrationDashboardCard/utils.ts","components/RegistrationDashboardCard/index.tsx","assets/EditIconBlack.svg","components/PatientUpsertForm/PatientStatus/styles.ts","components/PatientUpsertForm/PatientStatus/UpdateStatusModal/styles.ts","components/PatientUpsertForm/PatientStatus/UpdateStatusModal/index.tsx","components/PatientUpsertForm/PatientStatus/utils.ts","components/PatientUpsertForm/PatientStatus/index.tsx","components/PatientUpsertForm/styles.ts","components/PatientUpsertForm/utils.ts","components/PatientUpsertForm/index.tsx","components/PatientUpsertForm/MaxPatientModal/styles.ts","components/PatientUpsertForm/MaxPatientModal/index.tsx","pages/Patient/styles.ts","pages/Patient/PatientRegister/PatientRegister.tsx","pages/Patient/PatientUpdate/PatientUpdate.tsx","hooks/useSubscription.ts","pages/Plan/styles.ts","pages/Plan/utils.ts","pages/Plan/Plans.tsx","assets/hands.svg","components/AssignPlanCard/styles.ts","components/AssignPlanCard/index.tsx","pages/PlanList/styles.ts","pages/PlanList/PlanList.tsx","pages/PreInterview/styles.ts","pages/PreInterview/PatientPreInterview.tsx","pages/ProcessingPayment/styles.ts","pages/ProcessingPayment/ProcessingPayment.tsx","components/ProfessionalReportList/styles.ts","components/ProfessionalReportList/index.tsx","hooks/UseProfessionalReport.ts","pages/ProfessionalReport/styles.ts","pages/ProfessionalReport/ProfessionalReport.tsx","components/ViewProfessionalReportForm/styles.ts","components/ViewProfessionalReportForm/utils.ts","components/ViewProfessionalReportForm/index.tsx","pages/ProfessionalReport/ProfessionalReportItem/styles.ts","pages/ProfessionalReport/ProfessionalReportItem/utils.ts","pages/ProfessionalReport/ProfessionalReportItem/ProfessionalReportItem.tsx","pages/RegistrationDashboard/styles.ts","pages/RegistrationDashboard/utils.tsx","pages/RegistrationDashboard/RegistrationDashboard.tsx","hooks/useReport.ts","pages/ReportList/styles.ts","pages/ReportList/ReportListItem/index.tsx","pages/ReportList/utils.ts","pages/ReportList/ReportList.tsx","components/RoutineCard/styles.ts","assets/Icon-clock.svg","components/RoutinesUpsertForm/styles.ts","components/RoutinesUpsertForm/utils.ts","components/RoutinesUpsertForm/index.tsx","components/RoutineCard/index.tsx","pages/Routines/styles.ts","pages/Routines/Routines.tsx","pages/Routines/RoutinesInsert/styles.ts","pages/Routines/RoutinesInsert/RoutinesInsert.tsx","pages/Routines/RoutinesUpdate/styles.ts","pages/Routines/RoutinesUpdate/RoutinesUpdate.tsx","components/AnnullableShiftExecutionModal/styles.ts","components/AnnullableShiftExecutionModal/index.tsx","pages/ShiftExecution/utils.ts","pages/ShiftExecution/ExecutionTime/index.tsx","pages/ShiftExecution/ExecutionTimeline/styles.ts","pages/ShiftExecution/ExecutionTimeline/index.tsx","pages/ShiftExecution/styles.ts","pages/ShiftExecution/ExecutionTitle/index.tsx","pages/ShiftExecution/ExecutionUserName/index.tsx","pages/ShiftExecution/ShiftExecution.tsx","components/AdditionalCoverageCard/styles.ts","components/AdditionalCoverageCard/index.tsx","hooks/useAdditionalCoverage.ts","pages/ShiftSchedule/AdditionalCoverage/styles.ts","pages/ShiftSchedule/AdditionalCoverage/utils.ts","pages/ShiftSchedule/AdditionalCoverage/index.tsx","components/ShiftScheduleCard/styles.ts","components/ShiftScheduleUpsertForm/styles.ts","components/ShiftScheduleUpsertForm/utils.ts","components/ShiftScheduleUpsertForm/index.tsx","components/ShiftScheduleCard/index.tsx","pages/ShiftSchedule/styles.ts","pages/ShiftSchedule/NextShiftSchedules/index.tsx","pages/ShiftSchedule/utils.ts","pages/ShiftSchedule/ShiftSchedule.tsx","components/AdditionalCoverageForm/styles.ts","components/AdditionalCoverageForm/utils.ts","components/AdditionalCoverageForm/index.tsx","pages/ShiftSchedule/AdditionalCoverage/AdditionalCoverageInsert/styles.ts","pages/ShiftSchedule/AdditionalCoverage/AdditionalCoverageInsert/AdditionalCoverageInsert.tsx","pages/ShiftSchedule/AdditionalCoverage/AdditionalCoverageUpdate/styles.ts","pages/ShiftSchedule/AdditionalCoverage/AdditionalCoverageUpdate/AdditionalCoverageUpdate.tsx","pages/ShiftSchedule/NextShiftSchedules/ShiftScheduleInsert/styles.ts","pages/ShiftSchedule/NextShiftSchedules/ShiftScheduleInsert/ShiftScheduleInsert.tsx","pages/ShiftSchedule/NextShiftSchedules/ShiftScheduleUpdate/styles.ts","pages/ShiftSchedule/NextShiftSchedules/ShiftScheduleUpdate/ShiftScheduleUpdate.tsx","components/ShoppingListUpsertForm/styles.ts","components/ShoppingListUpsertForm/index.tsx","hooks/useShoppingList.ts","pages/ShoppingList/styles.ts","pages/ShoppingList/ShoppingList.tsx","pages/SubscriptionActivation/utils.ts","pages/SubscriptionActivation/styles.ts","pages/SubscriptionActivation/SubscriptionActivation.tsx","pages/SubscriptionCompany/styles.ts","pages/SubscriptionCompany/utils.ts","pages/SubscriptionCompany/SubscriptionCompany.tsx","assets/Icon-AccordionDone.svg","assets/Icon-AccordionError.svg","pages/SubscriptionPayment/styles.ts","pages/SubscriptionPayment/utils.ts","pages/SubscriptionPayment/SubscriptionPayment.tsx","routes/AuthenticatedRoute.tsx","config/googleAnalytics/index.ts","routes/RoutesAnalytics.tsx","routes/UnauthenticatedRoute.tsx","pages/DevelopmentInProgress/styles.ts","assets/development-in-progress.svg","pages/DevelopmentInProgress/DevelopmentInProgress.tsx","components/TabsBar/TabsBar.tsx","components/ToggleableChip/styles.ts","components/ToggleableChip/index.tsx","pages/Patient/PatientSelect/Patients/FilterChips/index.tsx","components/SelectCard/styles.ts","assets/icon-pill-outline.svg","assets/icon-switch.svg","assets/icon_graph.svg","assets/icon-time-filled.svg","components/SelectCard/Patient/ExpandedContent/styles.ts","components/SelectCard/Patient/ExpandedContent/EvolutionList.tsx","components/SelectCard/Patient/ExpandedContent/EvolutionContent.tsx","components/SelectCard/Patient/ExpandedContent/ExpandedContent.tsx","components/SelectCard/Patient/styles.ts","components/MedicationStatus/MedicationStatusCard.tsx","components/SelectCard/Patient/PatientSelectCard.tsx","pages/Patient/PatientSelect/utils.ts","components/FabStyled/FabStyled.tsx","utils/patients/filteretPatientList.ts","components/Pagination/Pagination.tsx","pages/OperationalManagement/PatientsList/PatientsList.tsx","pages/Patient/PatientSelect/OrganizationMembers/FilterChips/index.tsx","pages/OperationalManagement/OrganizationMembersList/OrganizationMembersList.tsx","pages/OperationalManagement/OperationalManagement.tsx","routes/Routes.tsx","components/Tabbar/MenuItem/styles.ts","components/Tabbar/MenuItem/index.tsx","assets/phone-icon.svg","components/Tabbar/styles.ts","components/Tabbar/index.tsx","components/Layout/styles.ts","components/Layout/index.tsx","components/Toast/styles.ts","components/Toast/index.tsx","config/hotjar/index.ts","styles/globalStyle.ts","App.tsx","reportWebVitals.ts","index.tsx"],"names":["default","schemeId","organizationName","organizationEmail","appFSubdomain","appCSubdomain","appFUrl","appCUrl","appFShortcutIconUrl","main","start_url","display","theme_color","background_color","dark","ScrollToTop","pathname","useLocation","useEffect","window","scrollTo","FallbackComponent","ErrorBoundary","children","fallback","defaultConfig","timeout","headers","Accept","paramsSerializer","params","qs","stringify","arrayFormat","axiosInstance","axios","create","baseURL","process","AMB","LOCAL_GATEWAY_URL","addGlobalRequestInterceptor","onFulfilled","onRejected","interceptors","request","use","removeGlobalRequestInterceptor","id","eject","addGlobalResponseInterceptor","response","removeGlobalResponseInterceptor","firebaseConfig","apiKey","authDomain","databaseURL","REACT_APP_FIREBASE_DATABASE_URL","projectId","storageBucket","messagingSenderId","appId","firebase","initializeApp","auth","authRequestInterceptor","config","a","currentUser","getIdToken","token","Authorization","console","log","resolveErrorMessage","error","displayMessage","data","getDisplayMessage","defaultStatusMessage","status","getStatusCodeMessage","resolveMessage","StyledLinearProgress","styled","LinearProgress","reducer","state","type","GlobalLoadingContext","createContext","GlobalLoadingProvider","useReducer","loadingCount","dispatch","requestInterceptor","incrementLoading","responseInterceptor","decrementLoading","location","toast","signOut","Promise","reject","firebaseAuthRequestInterceptor","useCallback","Provider","value","sendPasswordResetEmail","email","post","userProfile","changePassword","currentPassword","newPassword","resolve","getUserInfo","get","AuthContext","AuthProvider","useState","user","setUser","setError","loading","setLoading","userInfo","setUserInfo","promotionPlanId","setPromotionPlanId","companyPlanId","setCompanyPlanId","clientSideScheme","useContext","refreshUserInfo","guardianAccount","requestSignIn","cpf","password","signInWithCustomToken","signIn","unsubscribe","onIdTokenChanged","firebaseUser","uid","hasCompletedSignup","defaults","undefined","getIdTokenResult","claims","Sentry","Error","userRole","role","guardianAppAccess","caregiverAppAccess","replace","roleTitle","title","parse","search","apiAuthToken","decodedAuthToken","jwt","decode","localToken","localStorage","getItem","decodedLocalToken","JSON","isSameUser","userId","isRecent","differenceInHours","Date","date","String","username","name","getIdsAndContent","ids","byId","reduce","prev","cur","push","total","length","createReducer","action","payload","Array","from","Set","filter","results","endpoint","initialData","useAppointment","getAllByPatientId","patientId","getById","patch","remove","delete","createReportByPatientId","getReportDownloadLinkByPatientId","useCaregiver","getPaginated","useEmergencyContacts","useMeasurementSchedule","useMedication","getScheduledMedicationsByPatientId","useRoutine","useShiftSchedule","objectMap","object","callback","Object","fromEntries","entries","map","key","KEY_TO_HOOK","freeze","appointment","caregiver","emergencyContact","medication","routine","shiftSchedule","measurementSchedule","DEFAULT_COUNT","DEFAULT_IS_COUNTING","RegistrationDashboardContext","count","isCounting","triggerRefresh","RegistrationDashboardProvider","setCount","setIsCounting","activePatientId","getAllByPatientIdFunctions","useHook","assertedKey","newIsCounting","newCount","forEach","Container","div","theme","palette","extra","color","red","spacing","MessageContainer","ButtonContainer","MANDATORY_KEYS","PendingRegistrationBanner","history","useHistory","mandatoryIsCounting","mandatoryCounts","some","every","onClick","fontSize","StyledFieldset","fieldset","disabled","secondary","StyledTabs","Tabs","primary","common","black","DEFAULT_ROLES","PermissionContext","PermissionProvider","hasLoaded","setHasLoaded","permissions","setPermissions","refreshPermissions","axiosModule","useCanAccess","resource","allowedActions","useMemo","Boolean","isAllowedToCreate","includes","isAllowedToDelete","isAllowedToInvoke","isAllowedToRead","isAllowedToUpdate","resolveTheme","scheme","muiTheme","createMuiTheme","appFPalette","shape","borderRadius","typography","fontFamily","overrides","MuiButton","root","textTransform","MuiTab","styledTheme","colorMapping","white","text","grey","hexToRGBArray","hex","h","indexOf","TextField","MuiTextField","$color","StyledTextField","variant","props","FormikField","required","fullWidth","useFormikContext","errors","hasError","touched","autoComplete","as","helperText","StyledButton","Button","attrs","RuleContainer","Title","Typography","RuleText","isValid","submitError","green","passwordRules","test","PasswordRequirements","validationError","useTheme","rule","index","htmlColor","FooterContainer","cpfMask","numberMask","cepMask","phoneMask","numberOnly","startsWith","removeDDI","slice","validateCpf","rawCpf","add","i","parseInt","charAt","rev","validatePasswordStrength","formInitialValue","retypePassword","validationSchema","Yup","oneOf","ChangePassword","showNewPassword","setShowNewPassword","showRetypePassword","setShowRetypePassword","setValidationError","handleShowNewPassword","handleShowRetypePassword","initialValues","onSubmit","values","setFieldValue","then","success","catch","err","validateOnChange","formik","noValidate","FormikTextField","label","margin","inputProps","InputProps","endAdornment","InputAdornment","position","IconButton","aria-label","PasswordRules","isSubmitting","isEqual","size","mod","n","m","convertTimeToDate","timeString","split","hours","minutes","now","setUTCHours","Number","setUTCMinutes","convertLocalTimeToUTC","time","setHours","setMinutes","format","utcToZonedTime","formatTimeToAmericaSaoPauloTimezone","utcDatePtBr","subHours","timezoneUnawareDate","formatShortDateToAmericaSaoPauloTimezone","addMinutes","getTimezoneOffset","weekdayMap","mon","tue","wed","thu","fri","sat","sun","getUTCWeeklySchedule","localSchedule","localTime","convertTimeToUTCDate","modularDaysDifference","getUTCDay","getDay","utcSchedule","keys","day","getLocalWeeklySchedule","utcTime","elem","StyledTabItem","Tab","Backdrop","MaterialBackdrop","zIndex","drawer","light","BackdropCircularProgress","MaterialCircularProgress","SubTitleContainer","DateContainer","Payment","isAllowedToReadSubscription","patient","activePatient","to","open","data-testid","planExpirationDate","formatDate","min","phoneNumber","max","useGuardian","Personal","userData","formDataToGuardianModel","onChange","e","target","Toolbar","MaterialToolbar","AppBar","elevation","StyledElipseBlueTop","img","src","ElipseBlue","StyledElipseGreenTop","ElipseGreen","StyledElipseBlueBot","StyledElipseGreenBot","StyledDiv","StyledBlankDiv","Header","leftContent","centerContent","rightContent","PatientEventFilter","useMedia","getSignedUrl","contentType","method","url","uploadMedia","file","signedUrl","defaultAxios","getMedia","usePatient","uploadProfilePicture","getProfilePicture","getRelatedPatientsPaginated","getOrganizationPatientsPaginated","setActive","PatientAvatar","imageUrl","setImageUrl","handleGetProfilePicture","result","fetchPatientProfilePicture","Avatar","useUser","patchAutoPatientRelate","isAutoPatientRelateEnabled","findAvailableUsers","completeSignup","completeSignupToken","getOrganizationMembersPaginated","relateToPatient","patientToRelateId","relateToOrganization","unrelateFromPatient","patientToUnrelateId","unrelateAllPatients","unrelateFromOrganization","getPendingSignupToken","checkSignupStatus","UserAvatar","fetchUserProfilePicture","PageTitle","style","justifyContent","alignItems","marginInline","maxWidth","textAlign","marginLeft","maxLines","overflow","StyledIconButton","icon","backgroundColor","width","height","padding","BackButton","goBack","ChevronLeftRounded","PscIcon","pscIconColor","viewBox","fill","xmlns","stroke","d","strokeWidth","strokeLinecap","strokeLinejoin","PscButton","Account","currentTab","match","tabId","_","newValue","StyledPaper","Paper","CardBox","TypographyContainer","IconContainer","TimerContainer","TitleContainer","_extends","assign","arguments","source","prototype","hasOwnProperty","call","apply","this","_objectWithoutProperties","excluded","sourceKeys","_objectWithoutPropertiesLoose","getOwnPropertySymbols","sourceSymbolKeys","propertyIsEnumerable","clipPath","SvgIconColoredCalendar","_ref","svgRef","titleId","ref","ForwardRef","AppointmentCard","subCategory","description","eventHappensAt","formattedDate","formattedHour","trim","LinkForwardRef","React","forwardRef","innerRef","displayName","ButtonLink","rest","component","StyledFab","MuiFab","background","h2","ButtonLinkForwardRef","Fab","ReportButtonContainer","DownloadLink","ReportDownloadButton","onGenerateReportClick","downloadtitle","createTitle","downloadLink","href","CloudDownload","align","StyledLink","Link","StyledTypography","AppointmentCardItem","Appointments","eventsIds","isAllowedToReadAppointment","isAllowedToCreateAppointment","isAllowedToCreateAppointmentReport","isAllowedToReadAppointmentReport","setDownloadLink","handleCreateReportAndGetDownloadLink","createAppointmentReport","getAppointReportDownloadUrl","useSubCategory","getAll","getOnlyForRoutines","getOnlyForAppointments","getOnlyForMedication","categoryId","StyledFormControl","FormControl","StyledSelectField","formControlVariant","InputLabel","Select","labelId","FormHelperText","FormikSelect","StyledTextFieldWhite","PasswordTextField","showPassword","setShowPassword","FormCardContainer","StyledBoldTitle","NewStyledSelect","StyledSelect","StyledFormikTextField","StyledFormikTextPassword","StyledFormikSelect","HelperContainer","span","HelperText","xlinkHref","SvgElderlyIcon","xmlnsXlink","BalloonContainer","Balloon","Balloons","PointBalloon","marginTop","StyledText","MedicBalloon","isTextArray","isArray","balloonContainerAlignItems","pointBalloonMarginTop","t","MenuItem","MuiMenuItem","StyledMenuItem","Form","FormikForm","Centralizer","ContentContainer","appointmentModelToFormData","formattedTime","startDate","subCategoryId","formDataToAppointmentModel","isoDate","toISOString","AppointmentsUpsertForm","finalDate","SelectDisplayProps","item","placeholder","InputLabelProps","shrink","multiline","rows","AppointmentsInsert","DialogSubtitle","StyledMuiDialog","Dialog","StyledDialog","dialogProps","elipseBlue","elipseGreen","StyledSimpleDialog","handleNo","handleYes","subTitle","DialogContent","DialogTitle","DialogActions","RemoveButton","Delete","AppointmentsUpdate","useParams","dialogStatus","setDialogStatus","formikRef","useRef","current","handleDelete","Background","BackgroundImage","SuccessContainer","AwaitingReview","CardContainer","CardText","StyledWarningIcon","Warning","StyledDialogContainer","ReportProblemOutlined","StyledDialogContentText","DialogContentText","LogoutDialog","onClose","onConfirm","NoOrganizationIdBlock","signOutDialogOpen","setSignOutDialogOpen","userHasOrganizationId","organizationId","handleRefreshUserInfo","NoPatientRelationsBlock","userHasRelatedPatients","patients","CardContent","StyledImg","StyledLinkDiv","CardItem","isAllowedToReadProfilePicture","handleGetCaregiverProfilePicture","fetchCaregiverProfilePicture","isCareManager","isGuardian","resolveCaregiverStatusLabel","StyledCardContainer","Caregiver","isAllowedToRelateUser","caregiversIds","LoadingBackdrop","warning","PendingRegistrationWarningBanner","LogoImage","RoleApps","adminAppAccess","accessibleApps","appCShortcutIconUrl","apps","useRoles","AvatarContainer","StyledAvatar","Checkbox","FormControlLabel","AppContainer","RoleSelect","RoleMenuItem","getContrastText","RoleLabel","RoleDescription","CaptionButton","StyledArrowUp","KeyboardArrowUp","StyledArrowDown","KeyboardArrowDown","Description","p","CollapsibleCaption","roles","defaultVisibility","isVisibleCollapsibleCaption","setIsVisibleCollapsibleCaption","find","roleId","InnerContainer","StyledSelectButton","DisabledSelectButton","StyledTooltip","withStyles","tooltip","boxShadow","shadows","arrow","Tooltip","UserList","users","findAndReturnAvatarImage","allowedToRelateUserPatient","initialStateTooltipsStatus","isTooltipOpen","tooltipsStatus","setTooltipsStatus","TransitionComponent","Zoom","placement","disableHoverListener","userIndex","newStateTooltipsStatus","handleToggleTooltipsStatus","StyledTitle","StyledDialogActions","RelateToPatientDialog","handleCreateUserAndGenerateSignupUrl","newUserCpf","avatars","guardianOrganizationId","isAllowedToCreateUser","isUserFoundByCpf","found","avatar","image","userOrganizationId","yup","inviteLink","SvgCopyIcon","StytledDialogTitle","StyledInputAdornment","ShareActivationLinkDialog","userName","completeSignupUrl","navigator","clipboard","writeText","readOnly","UnrelateFromOrganizationDialog","formDataToUserModel","getShareMessage","caregiverName","shortUrl","UserForm","usersFound","setUsersFound","showUnrelateDialog","setShowUnrelateDialog","setCompleteSignupUrl","shareActivationUrl","setShareActivationUrl","showShareActivationLinkDialog","setShowShareActivationLinkDialog","setAvatars","userProfilePictureUrl","setName","userFormValues","setUserFormValues","loadingUser","getUserProfilePicture","loadingRoles","getAllRoles","rolesById","rolesIds","isAllowedToUpdateUser","isAllowedToUnrelateUser","isCreationPage","shouldRelatePatient","queryParams","URLSearchParams","toLowerCase","showShareDialog","show_share_dialog","systemRoles","isUserRoleVisible","isVisible","isFormDisabled","isLoading","isUserInfoFetched","userModelToFormData","handleShareActivationMessageOpen","handleGetUserProfilePicture","newAvatar","handleSubmit","available","createUser","fieldError","context","setFieldError","relateUserToPatient","message","relateUserToOrganization","enableReinitialize","alt","finally","formattedPhoneNumber","handleShareActivationMessageClick","$borderType","css","StyledKeyboardDatePicker","maxDate","inputVariant","onBlur","borderType","selectedDate","setSelectedDate","handleDateChange","utils","DateFnsUtils","invalidDateMessage","minDateMessage","maxDateMessage","clearable","Screen","Logo","logoLightUrl","LogoContainer","StyledFormControlLabel","$active","personalDataValidationSchema","gender","dateOfBirth","nullable","typeError","passwordValidationSchema","passwordConfirmation","termsAccepted","equals","genderOptions","resolveUserData","defaultValidationSchema","formInitialValues","picture","PersonalDataStepContainer","handleBlur","PasswordStepContainer","autocomplete","form","CompleteSignup","formikFormRef","signInError","completeSignupTokenPayload","resolvePendingSignupJWTData","userIdFromTokenPayload","handleSignIn","handleUploadProfilePicture","setTimeout","handleCompleteSignupSubmit","formData","control","rel","SubTitle","Instruction","ContactText","LinksContainer","StyledPhoneContainer","info","StyledOpenWhatsappContainer","StyledOpenLinkContainer","Contact","ContactsCard","relevantInformation","callingCondition","support","link","isWhatsapp","yellow","maskedPhoneNumber","Phone","Language","WhatsApp","Launch","rx","y","SvgBurgerMenu","MenuButton","SvgSignOutIcon","StyledDrawer","Drawer","StyledCloseIcon","Close","StyledLogoBlock","Person","FileIcon","Work","DrawerHeader","StyledList","List","StyledListItem","ListItem","StyledListItemText","ListItemText","defaultLink","StyledHrefLink","AppItemTitle","AppItemLabel","AppIcon","TextContainer","DrawerBody","DrawerFooter","DrawerButton","DrawerFooterText","AppShortcut","button","ListItemIcon","UserIcon","CaseIcon","HandIcon","ShareIcon","SideMenu","handleToggleSideMenu","isSideMenuOpen","isCaregiverAppAccess","isLogoutDialogOpen","setIsLogoutDialogOpen","handleToggleLogoutDialog","EmergencyContactsCard","contacts","Contacts","isMenuOpen","setMenuOpen","isAllowedToReadEmercencyContact","bottom","BlackTypography","StyledCheckbox","formDataToEmergencyContactsModel","handleNumberMask","urlMask","linkWithoutHttp","ContactsUpsertForm","formikHelpers","setSubmitting","handleChange","maxLength","checked","ContactsInsert","ContactsUpdate","HeaderContainer","TimerBox","HeaderSubtitle","ShiftTimeContestationDateBlock","startingDatetime","endingDatetime","startingLabel","endingLabel","responsibleName","getFormattedDate","dateTime","getFormattedTime","useShift","getLastShiftByPatientId","getByPatientIdPaginated","patchAnnulledShiftExecution","shiftExecutionId","body","expelCaregiver","shiftId","shouldKeepRecords","getTimeline","useShiftTimeContestation","endedAt","startedAt","justification","ConfirmSaveDialog","Body","TopGuidelineParagraph","StyledDatePicker","DatePicker","StyledTimePicker","TimePicker","StyledOptions","FormInnerContainer","DateTimePickersGroup","DateTimeCheckboxGroup","JustificationContainer","cancelLabel","startedAtDate","when","startedDatetimeEnabled","schema","startedAtTime","endedAtDate","endedDatetimeEnabled","endedAtTime","CreateTimeContestationForm","onCancel","minTimeContestationDatetime","maxTimeContestationDatetime","isSubmitConfirmationModalOpen","submitForm","validateForm","setFieldTouched","locale","ptBr","checkIfDatesDaysAreEqual","DialogProps","minDate","ampm","field","dateA","dateB","getDate","CreateTimeContestation","shift","setShift","postShiftTimeContestation","plannedToStartAt","plannedToEndAt","handleTimeContestationSubmitted","getHours","getMinutes","executions","currentExecutionIndex","orderBy","findIndex","execution","handleFormatDate","ptBrLocale","handleFormatTime","iconBaseStyles","OriginalSchedulesContainer","CardItemJustify","CardTimeText","CardTitle","fontWeightBold","StyledSubtitle","StyledCreatedBy","Divider","hr","NoRegistrationsText","StyledClockIcon","WatchLater","StyledCalendarIcon","DateRange","OriginalSchedules","shiftExecution","dateStartedAt","registeredStartedAt","timeStartedAt","dateEndedAt","registeredEndedAt","timeEndedAt","AnnulledCard","annullation","dateCreatedAt","createdAt","timeCreatedAt","executionType","isAnnulled","annulledBy","TimeContestationCard","timeContestation","contestationNumber","createdBy","ExecutionHistoryContestation","executionId","findExecutionByExecutionId","orderByCreatedAt","collection","sortBy","executionNumber","timeContestations","annullations","hasTimeContestations","hasAnnullations","reverse","ENDPOINT","useShiftReport","getAllFromPatient","getDownloadLink","reportId","requestReport","endDate","guardianId","StyledOptionsTypography","StyledPicker","StyledOkStep","StyledError","StyledParagraph","dateFrom","dateUntil","ExportModal","opened","okStep","setOkStep","StyledSimpleModal","getFullYear","getMonth","addDays","$isExpanded","handleClickItem","StyledMenu","paper","border","Menu","getContentAnchorEl","anchorOrigin","vertical","horizontal","transformOrigin","DropdownMenu","menuId","menuItems","anchorEl","setAnchorEl","isExpanded","setIsExpanded","aria-controls","aria-haspopup","event","currentTarget","keepMounted","ExpelCaregiverButton","ExpelUserIcon","CenterLayout","StyledDialogContent","StyledRadioGroup","RadioGroup","StyledRadio","Radio","ExpelCaregiverDialog","isOpen","currentOption","setCurrentOption","isExpelLoading","ContainerShifts","ContainerDayShifts","ShiftCardContainer","ShiftCardTitle","StyledYYYYMM","StyledDD","StyledName","ShiftBodyDetails","ShiftBodyText","TypographyWithIcon","SvgIconUserExpel","baseIconStyles","ShiftDetailsIcon","TimeCorrectionIcon","AccessTime","EndExecutionIcon","UserExpel","getShiftCardBackgroundColor","isAdditionalCoverage","getDayGroup","weekday","capitalizedWeekday","toUpperCase","month","isShiftMenuVisible","isShiftExpelCaregiverButtonVisible","isAllowedToExpel","isShiftWithContestation","isAnnullableShiftExecution","isAnnulledShiftExecution","getShiftExecutionRealTime","formattedString","start","parseISO","end","isShiftExecutionWithContestation","ShiftCardMessage","IndicatorLabel","weightBold","IndicatorCircle","ShiftInProgressIndicator","executionInProgress","ShiftTimeMessage","shiftHasNotStarted","handleFormatShiftExecutionTime","dateStringMessage","ShiftCard","onExpelCaregiver","isExpelDialogOpen","setIsExpelDialogOpen","caregiverLoading","caregiverId","menuItemsToBeRendered","shouldRender","handleExpelCaregiver","option","ColoredTypography","textColor","ColoredAnchor","underlineColor","ShiftReportCard","report","isAllowedToReadShiftReport","mounted","download","StyledDivider","LargeCloseIcon","CloseIcon","Transition","Slide","direction","ShiftReportListDialog","shiftReports","setShiftReports","fetchData","reports","fullScreen","ShiftsHistory","shifts","visibleModal","setVisibleModal","showShiftReportList","setShowShiftReportList","isAllowedToReadReport","isAllowedToCreateReport","mapKeyYYYYMM","innerMap","anyShift","mapKeyDD","History","page","setPage","limit","order","groupedShifts","Map","has","s","set","groupShiftsByDate","LeftContainer","DescriptionContainer","StatusContainer","RightContainer","CardFooter","footer","CaregiverTypography","comment","updatedTimeHappensAt","eventDate","CalendarIcon","TimeColorIcon","DoneIcon","NotDoneIcon","ComplicationCard","AlertIcon","MedicationCard","doseFormat","dosage","viaType","dosageQuantity","dosageFormat","administeredBy","medicalNotes","MedicationIcon","styledHighlight","getValueWithUnit","measurement","measurementValue","getConditionWithDetail","condition","foodCondition","getFormattedSymptoms","symptoms","symptom","symptomName","MeasurementCard","isDangerousComplication","Math","abs","complicationLevel","MesurementIcon","measurementDescription","additionalDetails","ocean","RoutineCard","ClockIcon","categoryIdMapper","subCategoryIdMapper","separateComplicationsFromActivities","shiftEvents","complicationEvents","eventsWithoutComplications","RealTimeContainer","Instructions","MeasurementInput","input","InformationContainer","NoteTypography","CloseIconContainer","isChecked","iconColor","borderColor","CheckIconContainer","StyledCheckIcon","CheckIcon","BoldText","Row","Measurement","eventId","measurementUnit","getMeasurementUnit","ScheduledMeasurementCard","scheduledMeasurements","eventScheduleId","hour","CardDiv","RenderActivityCardByEvent","isRoutine","readonly","ShiftEventList","events","isDeleted","categories","generateDefaultParams","todayMax","todayMin","subDays","timezone","Intl","DateTimeFormat","resolvedOptions","timeZone","hasComment","hasUpdated","category","medicationSubCategoryIds","measurementSubCategoryIds","complicationSubCategoryIds","appointmentSubCategoryIds","routineSubCategoryIds","useEventCareHistory","hasActiveFilters","setHasActiveFilters","eventHistory","setEventHistory","omit","parseBooleans","setAllParams","queryString","skipNull","skipEmptyString","createCareHistoryReport","getCareHistoryReportDownloadUrl","getEventSubCategoriesRelatedToPatientCategory","capitalize","setParams","paramName","paramValue","resetParams","urlPatientId","defaultParams","newUrl","stringifyUrl","query","CareHistoryFilterContext","CareHistoryFilterProvider","useEventCareHistoryHook","StyledChip","fontWeightRegular","StyledChipContent","ChipIcon","FilterChip","active","disableElevation","FloatingButton","FloatingButtonContainer","DayHistoryContainer","DayHistoryHeader","h6","DayHistoryBody","DateBox","PureParagraph","TimelineVerticalStroke","A100","EventListItem","li","EventTime","body1","EventTitle","Icon","isOddDayHistory","EventCategoryIcon","EventStatusIcon","DayMessage","CenteredLayout","EventCardPopUp","ActiveFilterIndicator","DrawerHeaderContent","StyledBackIcon","ChevronLeft","StyledFilterIcon","HeaderTitle","DrawerSection","SectionHeader","SectionContent","KeyboardDatePicker","isActive","CommentIcon","MessageIcon","AccomplishedFilter","NotAccomplishedFilter","AwaitingFilter","AlertFilter","ResetFiltersButton","makeBackgroundColorWithHover","CountMarker","FilterChipMultiselectContainer","MultiSelectButton","StyledFilterChip","StyledModal","Modal","MultiselectContainer","makeBackgroundAndColor","HeaderLeftIcon","SearchInput","Input","StyledSearchOutlined","SearchOutlined","OptionsSection","OptionContainer","FooterButton","Option","check","testid","MultiselectModal","close","options","toggleOption","onFinishOptionsSelection","searchInput","setSearchInput","fuse","Fuse","threshold","searchedOptions","searchResult","onBackdropClick","disableUnderline","startAdornment","FilterChipMultiselect","countMarkerAmount","isModalOpen","setIsModalOpen","formatGenericSubCategoriesIntoOptions","subCategories","MedicationFilterChipMultiselect","medicationOptions","setMedicationOptions","formattedOptions","medicationCatalogItem","appySelectionToQuery","selectedIds","IconMedication","MeasurementFilterChipMultiselect","measurementOptions","setMeasurementOptions","IconMeasurement","ComplicationFilterChipMultiselect","complicationOptions","setComplicationOptions","complication","IconComplication","AppointmentFilterChipMultiselect","appointmentOptions","setAppointmentOptions","IconAppointment","RoutineFilterChipMultiselect","routineOptions","setRoutineOptions","IconRoutine","FilterDrawer","isDrawerOpen","handleToggleDrawer","onChangeDate","handleToggleStatus","toggledStatus","xor","handleCategory","toggledCategory","isCategoryType","dismiss","anchor","SvgFilter","startIcon","ptBR","IconAlert","IconAccomplished","IconNotAccomplished","IconAwaiting","RoundButton","LoadingCircular","CircularProgress","CloudDownloadOutlined","PictureAsPdf","PictureAsPdfOutlined","ReportButton","createReport","getReportDownloadUrl","buttonState","setButtonState","setReportId","downloadUrl","setDownloadUrl","filename","fetch","blob","URL","createObjectURL","isAxiosError","resolveBackground","EventHistory","activePopUpEvent","setActivePopUpEvent","isFilterDrawerOpen","setIsFilterDrawerOpen","resolveCategoryIcon","resolveStatusIcon","IconAccomplishedWarning","formatTimelineDate","zonedDate","intlFormat","language","minute","toggleFilterDrawer","dayHistory","dayHistoryIndex","StyledCard","Card","Reports","isAllowedToReadMonthlyReports","isAllowedToReadProfessionalReports","menuList","subtitle","CardActionArea","CardHeader","titleTypographyProps","subheaderTypographyProps","subheader","AnswerLineTypography","MultiAnswerUl","ul","MultiAnswerLi","getAnswerContent","questionAnswerData","nav","checkedOption","o","nextAnswer","selectedOptions","v","needDescription","careQuestionAnswer","StyledSection","isDeeplyAnswered","countAnsweredShiftCareQuestions","careQuestionAnswers","currentCareQuestionAnswer","getCareCategoryCardStatusMessage","careQuestionCount","answered","CareCategoryList","questionsGroupedByCareCategory","groupBy","shiftCareQuestions","careCategoryId","shiftCareQuestionList","currentCareCategory","scq","careQuestion","careLine","careCategory","cq","filteredCareQuestions","cqa","careQuestionId","colorHexa","questions","lastOrFirstQuestionItemIndex","careQuestionText","CardActionAreaCentered","backgroundVariant","CollapseCentered","CardContentColorVariant","CollapsibleCardContent","hasPressedSeeMore","setHasPressedSeeMore","toggleCollapse","expanded","resetStateOnResize","useLayoutEffect","addEventListener","removeEventListener","setOverflow","updateState","newState","offsetWidth","scrollWidth","offsetHeight","scrollHeight","useResizeDetector","targetRef","onResize","useOverflowDetector","CardWithBackground","TypographyWhiteText","ExecutionMessageCard","executionMessage","formatEvents","measurements","filteredEvents","formattedMeasurements","group","concat","sort","event1","event2","dateEvent1","dateEvent2","StyledTypographyTitle","StyledTypographyAvatar","ShiftPatientContainer","StyledTypographyAdditionalCoverage","ExecutionMessagesContainer","TitleHeaderContainer","header","ExecutionMessageContainer","transform","SvgIconCheckCircle","Shift","lastShift","setLastShift","lastShiftEvents","setLastShiftEvents","lastShiftMessages","setLastShiftMessages","handleCareRegisterButton","loadPageData","lastShiftPatient","messages","formattedEventsWithoutComplications","Follow","isAllowedToReadShift","isAllowedToReadShiftTab","isAllowedToReadEvolutionTab","isAllowedToReadPatientReport","isAllowedToReadProfessionalReport","tabOptions","firstTab","tab","PreviousButton","ShiftDataContainer","PreviousOrNextShift","shiftIds","currentShiftId","isPreviousShiftButtonDisabled","isNextShiftButtonDisabled","previousShiftId","nextShiftId","FollowShift","patientPictureURL","setPatientPictureURL","setShiftIds","fetchShiftList","handleGetProfilePictureURL","sortedExecutions","executionMessages","originalValue","OutterContainer","TitleTypography","ForgotPassword","usePlan","getAvailablePlans","signAvailablePlan","planId","signCompanyPlan","signPromotionalPlan","TitleBold","VisibilityContainer","Line","TermsContainer","howMetUs","relationToPatient","howMetUsOptions","relationToPatientOptions","GuardianRegister","formikValuesRef","signInLoading","setSignInLoading","step","etapa","plan","formVisible","toString","isB2B","QuestionsWrapper","QuestionContainer","QuestionTitle","OptionsWrapper","OptionDescriptionContainer","StyledOptionDescriptionTextField","InterviewAnswerOption","memo","onOptionsChange","buildChangeOptions","optionId","changedData","optionToChange","op","InterviewAnswer","onAnswerChange","onAnswerChangeDebounce","debounced","useDebouncedCallback","handleOptionsChange","newAnswerData","InterviewAnswerList","careQuestionAnswerList","handleAnswerOnChange","debounceAnswerOnChange","orderedList","finishInterviewEndPoint","interviewId","careQuestionAnswerEndPoint","questionId","useInterview","getByPatientPaginated","deleteInterview","postFinishInterview","patchInterviewCareQuestionAnswer","NavigationButtonsContainer","StyledStepper","Stepper","EditButton","handleInterviewCareQuestionsAnswers","interview","answer","getScrollValueFromRatio","element","ratio","ActionType","MEDIC_BALLOON_TEXTS","Interview","currentIndex","setCurrentIndex","pageIndexes","setPageIndexes","loadingInterview","setLoadingInterview","popUpVisible","isPopUpVisible","patientInterview","setPatientInterview","answersGroupedByCareCategoryDictionary","setAnswersGroupedByCareCategoryDictionary","isAllowedToFinishInterview","actionType","isReadOnly","isEditing","edit","canEdit","loadInterview","currentPage","totalPages","handleGetPatientInterview","patientInterviewData","interviewCareQuestionAnswers","groupedAnswers","availableCareCategories","uniqueCareCategories","uniqBy","orderedCareCategories","availableCareCategoryIds","getLastPatientInterview","getLastDraftPatientInterview","isDraft","patientInterviews","lastPatientInterview","allInterviews","draftInterview","handleSubmitInterview","buildNewAnswerList","newQuestionAnswerData","currentCareQuestionAnswerList","careQuestionAnswerDictionary","careQuestionIdToMatch","careQuestionAnswersMap","getCurrentCareQuestionAnswerList","careQuestionAnswerToChange","newCareQuestionAnswerList","newCareQuestionAnswer","indexToReplace","buildNewCareQuestionAnswerList","stepperReference","RenderNavigationButtons","isFirstPage","isLastPage","scroll","interviewDate","updatedAt","activeStep","Step","StepLabel","getCurrentPageAnswers","className","SvgLogoCuidadorInline","Text","StyledFavorite","Favorite","StyledLogoInline","LogoInline","MadeBy","BackgroundOverlay","section","Login","handleShowPassword","formattedCpf","BoldTypography","TitleBox","MeasurementBox","StyledUl","DetailsBox","getDaysText","eventSchedule","areAllDaysSelected","areAllWeekDaysSelected","areSomeDaysSelected","frequencyRule","frequencyTimeString","getSelectedWeekdaysText","frequencyStartsAt","getUTCHours","padStart","getUTCMinutes","selectedWeekDays","accumulatorString","getIntervalText","frequencyEndsAt","formatedStartDate","formatedEndDate","getTimes","customTimes","renderCustomTimes","renderTimes","times","happensAt","subMinutes","renderTimesBox","doseTimes","startTime","frequency","formattedFrequency","doses","x","b","handleDoses","ReportContainer","MeasurementScheduleList","measurementScheduleIds","getMeasurementsByPatient","createMeasurementReport","getMeasurementReportDownloadUrl","MeasurementScheduleCard","StyledRow","StyledField","Field","StyledSpan","StyledFormHelperText","FormikWeekDaySelect","ptBrWeekDayName","FrequencyType","ErrorText","errorMessage","ErrorOutline","EVERYDAY","MONDAY_TO_FRIDAY","frequencyTimeOptions","DaysSelector","days","isEveryDay","isMondayToFriday","isSomeDays","dayOptions","Custom","EveryDay","MondayToFriday","SomeDays","handleSelectedDaysChange","rangeInDays","frequencyOption","customRangeInDays","InformativeText","useMeasurement","SelectMeasurementContainer","SaveControlOptionsButton","OpenModalButton","ControlOptionsModalHeader","ControlOptionsModalBody","ControlOptionsModalText","ControlOptionsModal","FormControlList","MeasurementListContainer","MeasurementRow","InstructionRow","RemoveButtonContainer","StyledRemoveButton","SelectMeasurementModal","defaultMeasurements","measurementsToBeConfimed","setMeasurementsToBeConfimed","isMeasurementChecked","measurementId","maxHeight","FormGroup","row","overflowY","newMeasurementsToBeConfimed","instruction","handleToggleMeasurementToBeConfirmed","MeasurementList","measurementsById","onMeasurementDelete","onMeasurementInstructionChange","onDelete","onInstructionChange","MeasurementListItem","measurementInstruction","setMeasurementInstruction","isRemoveButtonDisabled","debouncedOnInstructionChange","debounce","Clear","MeasurementsSelector","measurementIdToDelete","setMeasurementIdToDelete","isControlModalOptionsOpen","setIsControlModalOptionsOpen","isDeleteDialogOpen","handleRemoveMeasurement","newMeasurements","handleChangeMeasurementInstruction","handleMeasurementsConfirm","handleToggleControlModalOptions","MedicBalloonContainer","PeriodType","PeriodSelector","initialDate","periodType","DeterminedTime","timeSchedule","is","notRequired","otherwise","SubmitButton","TextRow","CustomTimeInputContainer","AddButtonContainer","StyledAddButton","scheduleOptions","getMeasurementTimes","TimeSelector","customTime","setCustomTime","customTimeToDelete","setCustomTimeToDelete","setIsDeleteDialogOpen","orderedCustomTimes","join","Add","filteredCustomTimes","handleRemoveCustomTime","MeasurementScheduleForm","formDataToEventScheduleModel","getUtcSchedule","getFrequencyRule","parseMeasurements","eventDescription","scheduleType","Continuously","Register","formattedData","eventScheduleModelToFormData","parseDates","formattedEndDate","parseCustomTimes","getSelectedWeekDays","getDayOptons","getRangesInDays","getPeriodType","validDifferencesInMinutes","differences","nextHour","difference","differenceInMinutes","isNaN","arr","timesInFrequency","UpdateMeasurementSchedule","measurementScheduleId","measurementScheduleData","defaultValues","handleFormValuesWithDefaultStartDate","fetchMeasurementSchedule","StyledTextButton","TextButton","StyledWhiteButton","BuyMedicationDialog","paragraph","SvgIconPillsNoBackground","CustomMedicationInterval","MedicationInsertFormStep","StyledAccordion","Accordion","StyledExpandMoreIcon","ExpandMoreIcon","StyledMedicationIcon","StyledAccordionDetails","AccordionDetails","dosesNames","administeredNames","getMedicationIntervalText","renderDoseTimes","medicationTime","renderAdministration","resolveDays","resolveDosage","ifNecessary","formattingSelectedWeekDays","grammaticallyFormattedDosage","route","AccordionSummary","expandIcon","AccordionActions","ListContainer","ListContainerWithBorder","StyledBuyButton","sortMedicationsByDoseTime","getFirstDoseTimeFromMedication","getFirstDoseTimeFromCustomTimeMedication","getFirstDoseTimeFromFixedTimeMedication","sortedHappensAt","useDoseCerta","patientName","createRequest","medications","medicationsList","medicationName","medicationDosage","medicationDailyDose","formattedPeriod","doseAndPeriod","textToSend","encodeURIComponent","focus","Medication","MEDICATION_ROUTE","finishedMedications","setFinishedMedications","totalFinishedMedications","setTotalFinishedMedications","getCurrentMedications","currentMedicationIds","getFinishedMedications","isAllowedToReadMedication","isAllowedToCreateMedication","isAllowedToCreateMedicationReport","isAllowedToReadMedicationReport","isBuyDialogOpen","setIsBuyDialogOpen","minFrequencyEndsAt","createMedicationReport","getMedicationReportDownloadUrl","buyMedications","AutocompleteTextField","getOptionLabel","getOptionSelected","onChangeDebounced","initialValue","testId","onValueChange","setData","inputText","newListValues","Autocomplete","defaultValue","onInputChange","textValue","renderInput","Fragment","needScheduleData","continuous","medicationModelToFormValues","formDataToMedicationModel","endIsoDate","startIsoDate","parseFloat","frequencyOptions","MedicationUpsertForm","handlePage","handleMedicationAutoCompleteOnChange","medicationAutoCompleteInitialValue","nextStepAllowed","MAX_DATE","MedicationInsert","SimpleCircularProgressContainer","SimpleCircularProgress","LoadingSimpleCircular","LeftSide","RightSide","StyledIcon","ChevronRightIcon","MedicationFirstStepCard","StyledInput","InputBase","overline","SearchTextField","fieldName","newSearch","Search","SearchContainer","DosageFormikTextField","MedicationFirstStep","handleChangeMedicationText","allMedication","handleSelectMedication","MedicationSearchBar","initialStartDate","isEdit","today","isDateDisabled","AsNeeded","MedicationTextRow","getMedicationTimes","setcustomTimeToDelete","MedicationSecondStep","MedicationInsertForm","confirmPatch","setConfirmPatch","patchValues","setPatchValues","disableButton","setDisableButton","handlePatchData","SelectMedication","FillDetails","renderStep","MedicationInsertV2","setAllMedication","setMedication","setStep","handleMedicationSearch","handleStepChange","q","MedicationUpdate","medicationModelToFormData","getDayOptions","MedicationUpdateV2","RegistrationOnboardingCard","registrationPSCRoute","Onboarding","buttonStyle","SvgLinkIcon","PatientRelationButton","cx","cy","r","SvgActiveIcon","SvgPendingIcon","SvgDisableIcon","resolvePatientStatusColor","resolveShiftStatusLabel","isBefore","resolveShiftStatusColor","resolveMemberStatusLabel","resolveMemberStatusIcon","UserInfoContainer","UserInfo","statusLabel","RoleTitle","RoleTitleContainer","ClickableArea","OrganizationMemberSelectCard","age","profilePictureURL","isPatientRelatedToUser","onRowClick","onRelationClick","getAge","differenceInYears","getProfilePictureFn","searchText","setSearchText","autoFocus","paddingLeft","paddingTop","paddingBottom","ClearRounded","marginBlock","alignSelf","OrganizationPatient","organizationMembers","setOrganizationMembers","patientIdToProfilePictureURL","setPatientIdToProfilePictureURL","loadingOrganizationMembers","loadingPatient","loadingUserInfo","isAllowedToReadOrganizationMembers","isAllowedToRelatePatient","isAllowedToUnrelatePatient","isAllowedToReadPatient","historyLocationSearch","getPatient","getOrganizationMembers","withRelatedPatientId","patientsToInsert","previousMap","newMap","handleRelateOrUnrelate","isUserRelatedToPatient","handleConfirmUnrelate","handleConfirmRelation","AutoRelateModal","AutoRelateContainer","RemoveRelationsContainer","OrganizationUser","setPatients","showAutoRelateDialog","setShowAutoRelateDialog","loadingOrganizationMember","loadingPatients","isAllowedToReadPatients","isAllowedToPatchAutoPatientRelate","isAllowedToReadUser","getUser","handleGetPatients","withRelatedUserId","handleAutoRelatePatientsToUser","autoRelatePatientsToUser","all","unrelateAllPatientsFromUser","aria-checked","Member","useCEP","getAddress","cep","json","erro","StyledEditor","AvatarEditor","ProfilePicture","initialImageUrl","editorImage","setEditorImage","openEditor","setOpenEditor","zoom","setZoom","editorRef","originalFile","rotate","scale","Slider","canvasScaled","getImageScaledToCanvas","croppedImg","toDataURL","toBlob","UserDefault","htmlFor","files","hidden","accept","StatusMessageContainer","StatusMessageIconContainer","AlertContainer","renderStatusMessage","registeredItemsQuantity","titleGender","statusTitleSingular","statusTitlePlural","amount","singularNoun","pluralNoun","nounGender","statusMessage","RegistrationDashboardCard","itemQuantity","creationRoute","visualizationRoute","mandatory","StatusLabelContainer","StatusDescriptionContainer","ButtonsContainer","disablingReasons","disablingReason","disablingReasonDescription","optional","UpdateStatusModal","onPatchStatus","onResetStatus","patientStatus","patientStatusDescription","patientStatusLabelAfterReset","reason","maxlength","getPatientStatus","patientIsNew","resolveStatusLabel","getStatusDescription","EditIcon","EditIconSvg","StatusLabel","fontWeight","PatientStatus","isDeleteModalOpen","setIsDeleteModalOpen","isNew","statusUpdatedAt","preventDefault","CustomLabel","PostalCodeContainer","InterviewCardContainer","nickname","Nickname","postalCode","province","city","district","streetName","streetNumber","streetComplement","provincesOptions","labelPreference","Name","formDataToPatientModel","PatientUpsertForm","initialPictureUrl","editingPatient","selectedCustomLabel","setSelectedCustomLabel","setIsAllowedToCreate","loadingAddressData","isMounted","handlePostalCodeChange","uf","localidade","bairro","logradouro","MaxPatientModal","maxPatients","PatientRegister","createInterview","isAllowedToReadInterview","isAllowedToCreateInterview","isAllowedToAnswerInterview","organization","subscription","maxAllowedPatients","interviewedAt","PatientUpdate","pictureUrl","setPictureUrl","loadUserImage","patientFormData","patientModelToFormData","useSubscription","IntervalOptions","SubscriptionStatusOptions","StyledDescriptionIcon","StyledPlan","StyledChangePlan","StyledLine","calculateSubscriptionTotalValue","totalInCentsValue","items","priceInCents","toFixed","Plans","setSubscription","subscriptionId","interval","nextBillingAt","startsAt","SvgHands","Titles","ValueTypography","DiscountContainer","DiscountTypography","DescriptionList","AssignPlanCardProps","intervalCount","discount","handleClick","isMonthly","TextTitleContainer","PlanList","plans","setPlans","AssignPlanCard","selectedPlan","planCardTitle","discountInPercentage","PatientPreInterview","patientReference","ProcessingPayment","setInterval","REFRESH_INTERVAL_IN_SECONDS","clearInterval","ReportCard","ProfessionalReportList","renderReportCard","useProfessionalReport","getByPatientId","ProfessionalReport","setPatient","professionalReports","setProfessionalReports","handlePatientName","loadProfessionalReports","loadedReports","guardianPatientes","TitleByOccupation","FormContainer","titleOptions","supervisor","doctor","nurse","nursingTechnician","physicalTherapist","psychologist","occupationalTherapist","physicalEducator","nutritionist","speechTherapist","dentist","another","ViewProfessionalReportForm","formValues","ProfessionalReportModelToFormValues","eventSubCategory","ProfessionalReportItem","setReport","reportFormData","setReporFormData","setSubCategories","handleProfessionalReport","CategoryTitle","getMedicBalloonText","mandatoryTotals","importantTotals","biggerThanZero","RegistrationDashboard","isAllowedToReadEmergencyContact","isAllowedToCreateEmergencyContact","isAllowedToReadCaregiver","isAllowedToReadMeasurement","isAllowedToCreateEvent","isAllowedToCreateShift","isAllowedToReadAdditionalShift","isAllowedToCreateAdditionalShift","isAllowedToCreateSomeShift","isShiftCardVisible","isOrganizationCardVisible","isMedicationCardVisible","isMeasurementCardVisible","isRoutineCardVisible","isAppointmentCardVisible","isEmergencyCardVisible","isImportantRegistersVisible","counting","useReport","getReportUrl","StyledRightTypography","ReportText","ReportListItem","handleViewReport","document","createElement","setAttribute","click","ReportList","WeekDayContainer","SvgIconClock","getSubCategories","subCategoryIds","loadingSubCategory","continuousAdd","setContinuousAdd","resetForm","customInterval","routineModelToFormValues","getCustomInterval","formDataToRoutineModel","freqRule","getWeekDay","routineEnded","fixedEventTimeLocal","RoutineCardItem","Routines","isAllowedToCreateRoutineReport","isAllowedToReadRoutineReport","createRoutineReport","getRoutineReportDownloadUrl","orderedRoutines","dateToCompare","eventAhappensAt","eventBhappensAt","RoutinesInsert","inserting","RoutinesUpsertForm","continuosAdd","postData","RoutinesUpdate","routineId","routineData","patchData","RestoreAnnulledShift","setIsSubmitting","submit","AnnullableShift","AnnullableShiftExecutionModal","isExecutionWithContestation","ExecutionTime","TimelineContainer","hasTimestamps","BoundaryTimestamps","Timestamp","ParentTimeline","ExecutionTimeSlotBlock","timeslot","startsAtPercentage","durationPercentage","LegendContainer","Legend","LegendLabel","LegendColor","ShiftExecutionTimeline","timeline","StyledExecutionCard","StyledExecutionTitle","StyledExecutionContainer","strikethrough","StyledHorizontalLine","ExecutionTitle","ExecutionUserName","executionUserName","ShiftExecution","executionTimeline","setExecutionTimeline","shiftExecutions","flat","isAnnullableShiftModalVisible","setIsAnnullableShiftModalVisible","annullableModalExecution","setAnullableModalExecution","openAnnulableModal","onSubmitAnnullShiftExecution","isAllowedToAnullShift","buildMenuItems","endOfMonth","StyledCardName","AdditionalCoverageCard","content","baseEndpoint","useAdditionalCoverage","getAllAvailable","getAdditionalCoverageCardContent","endTime","AdditionalCoverage","additionalCoverages","setAdditionalCoverages","durationOptions","k","durationInMinutes","hourValue","ceil","minuteValue","formDataToShiftScheduleModel","formattedWeekDays","formatWeekDaysFromFormValues","duration","startingTime","logoutUserOnFinishShift","ShiftScheduleUpsertForm","weeklySchedule","formatWeekDaysFromShiftSchedule","localWeeklySchedule","ShiftScheduleCard","endingTime","weekdaysLabel","ShiftScheduleCardItem","NextShiftSchedule","shiftSchedulesIds","permission","ShiftSchedule","isCreateButtonVisible","centered","wrapped","initialTime","AdditionalCoverageForm","isDisabled","validateAndSubmit","datePlusDuration","AdditionalCoverageInsert","dateTimePlannedToStart","dateTimePlannedToEnd","formDataToAdditionalCoverageModel","AdditionalCoverageUpdate","setValues","additionalCoverageDataToFormData","ShiftScheduleInsert","ShiftScheduleUpdate","shiftScheduleModelToFormData","ShoppingListUpsertForm","isAllowedToBuy","useShoppingList","getOneByPatientId","postBuyShoppingListById","ShoppingList","getOneShoppingListByPatientId","shoppingListItemIds","shoppingListItemById","loadingShoppingList","medicationById","loadingMedications","textItem","shoppingText","listId","promotionalCode","makeValidationSchema","requirePromotionalCode","LeftAlignedTypography","CardBody","RightAlignedTypography","StyledForm","StyledSubmitButton","InputRequired","PlanCard","isPromotional","round","trialPeriodDays","SubscriptionActivation","setPlan","StyledPrice","StyledPlanDescription","StyledLineSimple","StyledInfo","RowContainer","StyledFirstInRow","StyledPayButton","initialCompanyValues","cnpj","companyName","tradingName","initialAddressValues","country","address","addressNumber","additional","validationCompanySchema","tamanho","numeros","substring","digitos","soma","pos","resultado","validateCnpj","validationAddressSchema","unformattedCnpj","SubscriptionCompany","formikCompanyValuesRef","formikAddressValuesRef","setDistrict","qsPlanId","companyFormik","addressFormik","companyValues","addressValues","line1","zipCode","line2","formValuesToCompanySubscriptionRequest","SvgIconAccordionDone","SvgIconAccordionError","StyledInfoPrice","AccordionDone","AccordionError","initialCardValues","cardNumber","expiry","cvc","validationCardSchema","SubscriptionPayment","formikCardValuesRef","formikPromotionalCodeRef","cardFocus","setCardFocus","handleCardchange","cardMask","expiryMask","handleCardfocus","focused","number","valid","placeholders","onFocus","cardFormik","billingAddressFormik","promotinalCodeFormik","cardValues","billingAddressValues","promotionalCodeValues","expirationMonth","expirationYear","holderName","expMonth","expYear","cvv","billingAddress","formValuesToPostRequisitionBody","AuthenticatedRoute","Component","isUserOrganizationOwner","createdById","userOrganizationHasRelatedPatients","userOrganizationHasNoSubscription","userOrganizationSubscriptionStatus","userStatus","render","exact","analytics","pageview","pagePath","gtag","page_path","RouteAnalytics","UnauthenticatedRoute","MainContainer","ImageWithLeftMargin","DevelopmentInProgress","DevelopmentInProgressIcon","TabsBar","tabItems","selectedTab","redirectionPath","path","DefaultStyledChip","Chip","StyledBlueChip","StyledWhiteChip","ToggleableChip","chipItens","FilterChips","setCustomStatus","customStatus","ClampedText","PatientName","PatientOverview","statusColor","BorderedAvatar","StatusIndicator","badgeColor","SvgIconPillOutline","SvgIconSwitch","SvgIconGraph","SvgIconTimeFilled","ExpandedContentContainer","ShortcutsContainer","Shortcut","ShortcutIcon","ShortcutLabelContainer","ShortcutLabel","body2","CardSectionContainer","CardSectionHeader","CardSectionTitle","CardSectionContent","CardSectionFooter","year","getFilteredEventsByOccurrences","fromDate","toDate","eventsResult","occurrences","isAfter","startOfDay","EvolutionList","eventData","onOccurrencesUpdate","formattedEventData","setFormattedData","occurrencesFormatted","currEventData","val","idx","getFormattedEventDate","marginBottom","columnGap","whiteSpace","EvolutionContent","handleChangeActivePatient","onLoadChange","fromDateString","toDateString","endOfDay","getEvents","useAsync","ExpandedContent","hasCaregiverAppAccess","shiftStatusLabel","shiftStatus","resolveShiftStatus","shiftInExecution","incompleteShift","getShiftExecutions","shortcuts","AssignmentOutlined","pageRedirectRoute","isPatientActive","shortcut","GroupIcon","GraphIcon","ExpandButton","StyledArrow","MedicationStatusCard","isSmall","onFilter","filterType","selected","smallBoxCssStyle","gap","lineHeight","boxCssStyle","minWidth","cursor","PatientSelectCard","loadingOccurrences","occurrencesOfPatient","setOccurrencesOfPatient","patientStatusLabel","resolvePatientStatusLabel","minHeight","Occurrences","stopPropagation","FabStyled","right","marginRight","getFilteredPatientList","patientList","listResult","patientIds","occurrence","Pagination","pagesArr","visibleArr","halfMax","MAX_PAGES","paddingInline","floor","PatientsList","pageSize","setPageSize","patientListFilter","setPatientListFilter","allPatients","setAllPatients","patientQueryType","setPatientQueryType","isLoadingOccurrences","setIsLoadingOccurrences","genericOccurrences","setGenericOccurrences","setFromDate","setToDate","shouldUpdate","setShouldUpdate","patientOccurrencesList","setPatientOccurrencesList","canCreatePatient","isAllowedToReadRelatedPatient","isAllowedToReadOrganizationPatient","loadingAuth","makeFetchAllPatients","patientListTotalOccurrences","patientTotalOccurrencesList","patientTotalOccurrences","patientEventDates","isPatientQueryTypeToogleable","handleGetRelatedPatientsPaginated","handleGetPatientsOrganizationPaginated","makeFetchPatients","fetchFn","fullList","handleEventFilterChange","selectPatient","generateRandomKey","chars","random","handleTogglePatientQueryType","currentPatientQueryType","overflowX","boxSizing","code","Grid","container","xs","ev","randomKeyBefore","randomKeyAfter","prod","Today","setStatus","OrganizationMembersList","organiationMemberIdToProfilePictureURL","setOrganiationMemberToProfilePictureURL","canCreateUser","handleFetchOrganizationMembersPaginated","organizationMembersToInsert","organizationMember","onChangeParams","OperationalManagement","showOrganizationMembers","enabled","Routes","MeasurementScheduleRegister","Plan","SvgPhoneIcon","StyledPhoneIcon","PhoneIcon","Tabbar","isAllowedToReadShoppingList","isAllowedToReadEmergencyContacts","Content","withTabs","routesWithMenu","Layout","useRouteMatch","shouldRenderTabs","isExact","Toast","ToastContainer","ToastContainerCustom","autoClose","createGlobalStyle","App","appFFaviconUrl","appFJsonManifest","setFavicon","setManifest","StylesProvider","injectFirst","ThemeProvider","reportWebVitals","onPerfEntry","Function","getCLS","getFID","getFCP","getLCP","getTTFB","ReactDOM","StrictMode","getElementById"],"mappings":"w9BAAA,aAQS,gFAPP,sBAOyB,gFANzB,sBAM2C,0EAL3C,gBAKuD,2EAJvD,kB,uPCJF,aAEA,YAYa,mBAAmB,WAG5B,IAAI,EAwHR,WACE,IAAK,OACH,MAAM,IAAI,MAAM,iCAElB,OAAO,EA5HW,GACd,IACA,IAEE,EAAW,EAA2B,GAC5C,OAAO,UAAQ,IAMJ,mBAAmB,SAAC,GAC/B,IAAM,EAAW,EAAgC,GAC/C,OAAK,UAAQ,IAGJ,aAAa,SAAC,GACvB,IAAE,EAAyB,SAAS,cAAc,qBAE/C,KACH,EAAO,SAAS,cAAc,SAC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Ae,mCACf,cAAW,iBACX,cAAW,kBACX,QAAK,oDACL,QAAK,qDACL,oBACF,wEACE,oBACF,wEACE,eACF,8EACE,eACF,8EACE,YACF,kFACE,eACF,kFACE,aACF,mFACE,gBACF,mFACE,iBAAc,CACV,WAAM,gCACZ,KAAM,gCACN,MAAO,CACL,CACE,IACE,wEACF,MAAO,gCACC,KAAF,aAER,CACE,IACE,yEACM,KAAF,YACE,MAAD,WAET,CACE,IACE,yEACM,KAAF,YACE,MAAD,YAGLC,UAAK,IACLC,QAAG,aACHC,YAAO,UACPC,iBAAY,WAEhB,iBAAc,CACV,WAAM,gCACN,qCACA,MAAC,CACL,CACE,IACE,wEACF,MAAO,gCACP,KAAM,aAER,CACE,IACE,yEACF,KAAM,YACN,MAAO,WAET,CACE,IACE,yEACF,KAAM,YACN,MAAO,YAGL,UAAK,IACL,QAAG,aACH,YAAO,UACP,iBAAY,WAEhB,YAAS,CACL,QAAG,CACC,KAAF,WAEF,UAAK,CACD,KAAF,WAEF,MACI,KAAF,UACE,KAAF,WAEF,MAAC,CACL,MAAO,UACP,KAAM,WAEF,QAAG,CACP,KAAM,kBACN,MAAO,WAEH,QAAG,CACP,KAAM,qBAEF,MAAC,CACL,MAAO,CACL,KAAM,CACJ,KAAM,UACN,MAAO,UACP,KAAM,WAER,MAAO,UACP,IAAK,CACH,KAAM,UACN,MAAO,UACP,KAAM,WAEE,KAAJ,UACI,OAAF,UACE,MAAH,aAIT,YAAS,CACL,QAAG,CACC,KAAF,WAEF,UAAK,CACD,KAAF,WAEF,MACI,KAAF,WAER,MAAO,CACL,KAAM,UACN,KAAM,WAER,QAAS,CACP,KAAM,mBAER,QAAS,CACP,KAAM,WAER,MAAO,CACL,MAAO,CACL,KAAM,CACJ,KAAM,UACN,MAAO,UACP,KAAM,WAER,MAAO,UACP,IAAK,CACH,KAAM,UACN,MAAO,UACP,KAAM,WAER,KAAM,UACN,OAAQ,UACR,MAAO,aAIT,aAAU,CACN,QAAG,WAEP,cAAW,C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O,UACP,KAAM,WAER,KAAM,UACN,OAAQ,UACR,MAAO,aAIT,aAAU,CACN,QAAG,WAEP,cAAW,CACP,QAAG,UACH,UAAK,YAGb,aAAY,CACR,SAAM,eACN,eAAY,KACZ,iBAAc,iBACd,kBAAe,GACf,cAAW,uBACX,cAAW,wBACX,QAAK,0DACL,QAAK,2DACL,oBACF,iFACE,oBACF,iFACE,eACF,mFACE,eACF,mFACE,YACF,qFACE,eACF,qFACE,aACF,uFACE,gBACF,uFACE,iBAAc,CACV,WAAM,yCACN,8CACA,MAAC,CACL,CACE,IACE,2EACF,MAAO,gCACP,KAAM,aAER,CACE,IACE,wFACM,KAAF,YACE,MAAD,WAET,CACU,IACN,wFACM,KAAF,YACE,MAAD,YAGL,UAAK,IACL,QAAG,aACH,YAAO,UACP,iBAAY,WAEhB,iBAAc,CAChB,WAAY,yCACN,8CACA,MAAC,CACL,CACE,IACE,2EACF,MAAO,gCACP,KAAM,aAER,CACE,IACE,wFACF,KAAM,YACN,MAAO,WAET,CACE,IACE,wFACF,KAAM,YACN,MAAO,YAGL,UAAK,IACL,QAAG,aACH,YAAO,UACP,iBAAY,WAEhB,YAAS,CACL,QAAG,CACC,KAAF,WAEF,UAAK,CACD,KAAF,WAEF,MACI,KAAF,UACE,KAAF,WAER,MAAO,CACL,MAAO,UACP,KAAM,WAER,QAAS,CACP,KAAM,kBACN,MAAO,WAET,QAAS,CACP,KAAM,qBAER,MAAO,CACL,MAAO,CACL,KAAM,CACJ,KAAM,UACN,MAAO,UACP,KAAM,WAER,MAAO,UACP,IAAK,CACH,KAAM,UACN,MAAO,UACP,KAAM,WAER,KAAM,UACN,OAAQ,UACR,MAAO,aAIb,YAAa,CACX,QAAS,CACP,KAAM,WAER,UAAW,CACT,KAAM,WAER,KAAM,CACJ,KAAM,WAER,MAAO,CACL,KAAM,UACN,KAAM,WAER,QAAS,CACP,KAAM,mBAER,QAAS,CACP,KAAM,WAER,MAAO,CACL,MAAO,CACL,KAAM,CACJ,KAAM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AAqBvoF,MAAK,YAAkD,IAA/CwoF,EAA8C,EAA9CA,OAAQC,EAAsC,EAAtCA,OAAQC,EAA8B,EAA9BA,OAAQC,EAAsB,EAAtBA,OAAQC,EAAc,EAAdA,QAC3DJ,EAAOF,GACPG,EAAOH,GACPI,EAAOJ,GACPK,EAAOL,GACPM,EAAQN,OCLdO,IAASxO,OACP,cAAC,IAAMyO,WAAP,UACE,cAAC,GAAD,MAEFte,SAASue,eAAe,SAM1BV,O","file":"static/js/main.5a8bd7d8.chunk.js","sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.setManifest = exports.setFavicon = exports.serverSideScheme = exports.clientSideScheme = void 0;\nconst resolvers_1 = require(\"./src/resolvers\");\nObject.defineProperty(exports, \"clientSideScheme\", { enumerable: true, get: function () { return resolvers_1.clientSideScheme; } });\nObject.defineProperty(exports, \"serverSideScheme\", { enumerable: true, get: function () { return resolvers_1.serverSideScheme; } });\nObject.defineProperty(exports, \"setFavicon\", { enumerable: true, get: function () { return resolvers_1.setFavicon; } });\nObject.defineProperty(exports, \"setManifest\", { enumerable: true, get: function () { return resolvers_1.setManifest; } });\n//# sourceMappingURL=index.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.setManifest = exports.setFavicon = exports.serverSideScheme = exports.clientSideScheme = void 0;\nconst query_string_1 = require(\"query-string\");\nconst schemes_1 = __importDefault(require(\"./schemes\"));\n/**\n * This helper should be used on client-side only in order to resolve current Scheme\n * - If on production environment, it will take in consideration the client's subdomain\n * - Else, it will take in consideration the client's `schemeId` querystring\n */\nexports.clientSideScheme = () => {\n // If not on production, we'll allow query ?schemeId instead of subdomains\n // to make tests easier\n const subdomain = isProduction()\n ? extractAppSubdomain()\n : extractAppQuerystringOrLocalStorage();\n const schemeId = resolveSchemeIdBySubdomain(subdomain);\n return schemes_1.default[schemeId];\n};\n/**\n * This helper usually will be used on server-side in order to resolve current Scheme given organizationId\n */\nexports.serverSideScheme = (organizationId) => {\n const schemeId = resolveSchemeIdByOrganizationid(organizationId);\n return schemes_1.default[schemeId];\n};\nexports.setFavicon = (faviconUrl) => {\n let link = document.querySelector(\"link[rel~='icon']\");\n if (!link) {\n link = document.createElement(\"link\");\n link.rel = \"icon\";\n document.getElementsByTagName(\"head\")[0].appendChild(link);\n }\n link.href = faviconUrl;\n};\nexports.setManifest = (jsonManifest) => {\n let link = document.querySelector(\"link[rel~='manifest']\");\n const stringManifest = JSON.stringify(jsonManifest);\n const blob = new Blob([stringManifest], { type: \"application/json\" });\n const manifestUrl = URL.createObjectURL(blob);\n if (!link) {\n link = document.createElement(\"link\");\n link.rel = \"manifest\";\n document.getElementsByTagName(\"head\")[0].appendChild(link);\n }\n link.setAttribute(\"href\", manifestUrl);\n};\nconst extractAppSubdomain = () => {\n if (!window) {\n throw new Error(\"Not in a browser environment!\");\n }\n const subdomain = window.location.hostname.split(\".\")[0];\n return subdomain;\n};\nconst extractAppQuerystringOrLocalStorage = () => {\n const parsedQS = query_string_1.parse(window.location.search);\n if (parsedQS.schemeId == null) {\n return extractAppLocalStorage();\n }\n else {\n return extractAppQuerystring(parsedQS);\n }\n};\nconst extractAppLocalStorage = () => {\n const localStorageAppScheme = window.localStorage.getItem(\"cuidador-de-confianca-scheme\");\n return localStorageAppScheme || \"default\";\n};\nconst extractAppQuerystring = (parsedQS) => {\n let queryStringAppScheme;\n if (Array.isArray(parsedQS.schemeId)) {\n queryStringAppScheme = parsedQS.schemeId[0];\n }\n else {\n queryStringAppScheme = parsedQS.schemeId;\n }\n if (queryStringAppScheme) {\n window.localStorage.setItem(\"cuidador-de-confianca-scheme\", queryStringAppScheme);\n }\n return queryStringAppScheme;\n};\nconst resolveSchemeIdBySubdomain = (subdomain) => {\n if (!subdomain) {\n return \"default\";\n }\n const matchedScheme = Object.entries(schemes_1.default).find(([_, { appCSubdomain, appFSubdomain }]) => {\n return subdomain === appCSubdomain || subdomain === appFSubdomain;\n });\n if (matchedScheme) {\n return matchedScheme[0];\n }\n else {\n return \"default\";\n }\n};\nconst resolveSchemeIdByOrganizationid = (organizationId) => {\n if (organizationId === 123) {\n return \"ciacuidadores\";\n }\n else if (organizationId === 806) {\n return \"duarte\";\n }\n else if (organizationId === 1134) {\n return \"cmais\";\n }\n else if (organizationId === 1296) {\n return \"amor_cuidado\";\n }\n else {\n return \"default\";\n }\n};\nfunction isProduction() {\n if (!window) {\n throw new Error(\"Not in a browser environment!\");\n }\n return process.env.REACT_APP_ENV === 'production' || process.env.REACT_APP_ENV === 'qa';\n}\n//# sourceMappingURL=resolvers.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst schemes = {\n default: {\n schemeId: \"default\",\n organizationName: \"Cuidador de Confiança\",\n organizationEmail: \"contato@cuidadordeconfianca.com.br\",\n appFSubdomain: \"familia\",\n appCSubdomain: \"app\",\n appFUrl: \"https://familia.cuidadordeconfianca.com.br\",\n appCUrl: \"https://app.cuidadordeconfianca.com.br\",\n appFShortcutIconUrl: \"https://storage.googleapis.com/cuidador_white_label/default/logo-white.png\",\n appCShortcutIconUrl: \"https://storage.googleapis.com/cuidador_white_label/default/logo-blue.png\",\n appFFaviconUrl: \"https://storage.googleapis.com/cuidador_white_label/default/appF-favicon.ico\",\n appCFaviconUrl: \"https://storage.googleapis.com/cuidador_white_label/default/appC-favicon.ico\",\n logoDarkUrl: \"https://storage.googleapis.com/cuidador_white_label/default/logo-dark.svg\",\n logoDarkPngUrl: \"https://storage.googleapis.com/cuidador_white_label/default/logo-dark.png\",\n logoLightUrl: \"https://storage.googleapis.com/cuidador_white_label/default/logo-light.svg\",\n logoLightPngUrl: \"https://storage.googleapis.com/cuidador_white_label/default/logo-light.png\",\n appFJsonManifest: {\n short_name: \"Família - Cuidador de Confiança\",\n name: \"Família - Cuidador de Confiança\",\n icons: [\n {\n src: \"https://storage.googleapis.com/cuidador_white_label/default/logo-light-96.png\",\n sizes: \"96x96 64x64 32x32 24x24 16x16\",\n type: \"image/png\",\n },\n {\n src: \"https://storage.googleapis.com/cuidador_white_label/default/logo-light-192.png\",\n type: \"image/png\",\n sizes: \"192x192\",\n },\n {\n src: \"https://storage.googleapis.com/cuidador_white_label/default/logo-light-512.png\",\n type: \"image/png\",\n sizes: \"512x512\",\n },\n ],\n start_url: \"/\",\n display: \"standalone\",\n theme_color: \"#000000\",\n background_color: \"#ffffff\",\n },\n appCJsonManifest: {\n short_name: \"Cuidador de Confiança\",\n name: \"Cuidador de Confiança\",\n icons: [\n {\n src: \"https://storage.googleapis.com/cuidador_white_label/default/logo-dark-96.png\",\n sizes: \"96x96 64x64 32x32 24x24 16x16\",\n type: \"image/png\",\n },\n {\n src: \"https://storage.googleapis.com/cuidador_white_label/default/logo-dark-192.png\",\n type: \"image/png\",\n sizes: \"192x192\",\n },\n {\n src: \"https://storage.googleapis.com/cuidador_white_label/default/logo-dark-512.png\",\n type: \"image/png\",\n sizes: \"512x512\",\n },\n ],\n start_url: \"/\",\n display: \"standalone\",\n theme_color: \"#01B1EC\",\n background_color: \"#01B1EC\",\n },\n appCPalette: {\n primary: {\n main: \"#0088D3\",\n dark: \"#004063\",\n },\n secondary: {\n main: \"#2B999F\",\n dark: \"#1876a8\",\n },\n info: {\n main: \"#0088D3\",\n dark: \"#00234d\",\n },\n error: {\n light: \"#a71633\",\n main: \"#5c1221\",\n },\n warning: {\n main: \"rgb(254,206,60)\",\n light: \"#fff176\",\n },\n success: {\n main: \"rgb(52, 187, 102)\",\n },\n extra: {\n color: {\n grey: {\n main: \"#424242\",\n light: \"#f5f5f5\",\n dark: \"#212121\",\n },\n green: \"#34BB66\",\n red: {\n main: \"#9F0000\",\n light: \"#F36161\",\n dark: \"#5c1221\",\n },\n blue: \"#1876A8\",\n yellow: \"#f6af32\",\n ocean: \"#2B999F\",\n },\n },\n },\n appFPalette: {\n primary: {\n main: \"#2B999F\",\n light: \"#DEEBF7\",\n dark: \"#249196\",\n },\n secondary: {\n light: \"#81BEE0\",\n main: \"#1A5C5F\",\n dark: \"#38808f\",\n },\n info: {\n main: \"#0088D3\",\n },\n error: {\n main: \"#5c1221\",\n dark: \"#eb6441\",\n },\n warning: {\n main: \"rgb(254,206,60)\",\n },\n success: {\n main: \"#34BB66\",\n },\n extra: {\n color: {\n grey: {\n main: \"#424242\",\n light: \"#f5f5f5\",\n dark: \"#212121\",\n },\n green: \"#34BB66\",\n red: {\n main: \"#9F0000\",\n light: \"#F36161\",\n dark: \"#eb6441\",\n },\n blue: \"#1876A8\",\n yellow: \"#f6af32\",\n ocean: \"#2B999F\",\n },\n },\n },\n emailPalette: {\n primary: \"#0088D3\",\n },\n reportPalette: {\n primary: \"#0088D3\",\n secondary: \"#2B999F\",\n },\n },\n duarte: {\n schemeId: \"duarte\",\n organizationId: 806,\n organizationName: \"Duarte\",\n organizationEmail: \"financeiro@duartehomecare.com.br\",\n appFSubdomain: \"duarte-familia\",\n appCSubdomain: \"duarte-cuidador\",\n appFUrl: \"https://duarte-familia.cuidadordeconfianca.com.br\",\n appCUrl: \"https://duarte-cuidador.cuidadordeconfianca.com.br\",\n appFShortcutIconUrl: \"https://storage.googleapis.com/cuidador_white_label/duarte/29appF.png\",\n appCShortcutIconUrl: \"https://storage.googleapis.com/cuidador_white_label/duarte/29appC.png\",\n appFFaviconUrl: \"https://storage.googleapis.com/cuidador_white_label/duarte/appF-favicon.ico\",\n appCFaviconUrl: \"https://storage.googleapis.com/cuidador_white_label/duarte/appC-favicon.ico\",\n logoDarkUrl: \"https://storage.googleapis.com/cuidador_white_label/duarte/logo-dark-duarte.svg\",\n logoDarkPngUrl: \"https://storage.googleapis.com/cuidador_white_label/duarte/logo-dark-duarte.png\",\n logoLightUrl: \"https://storage.googleapis.com/cuidador_white_label/duarte/logo-white-duarte.svg\",\n logoLightPngUrl: \"https://storage.googleapis.com/cuidador_white_label/duarte/logo-white-duarte.png\",\n appFJsonManifest: {\n short_name: \"Duarte - Cuidadores de Idosos\",\n name: \"Duarte - Cuidadores de Idosos\",\n icons: [\n {\n src: \"https://storage.googleapis.com/cuidador_white_label/duarte/96appF.png\",\n sizes: \"96x96 64x64 32x32 24x24 16x16\",\n type: \"image/png\",\n },\n {\n src: \"https://storage.googleapis.com/cuidador_white_label/duarte/192appF.png\",\n type: \"image/png\",\n sizes: \"192x192\",\n },\n {\n src: \"https://storage.googleapis.com/cuidador_white_label/duarte/512appF.png\",\n type: \"image/png\",\n sizes: \"512x512\",\n },\n ],\n start_url: \"/\",\n display: \"standalone\",\n theme_color: \"#000000\",\n background_color: \"#ffffff\",\n },\n appCJsonManifest: {\n short_name: \"Duarte - Cuidadores de Idosos\",\n name: \"Duarte - Cuidadores de Idosos\",\n icons: [\n {\n src: \"https://storage.googleapis.com/cuidador_white_label/duarte/96appC.png\",\n sizes: \"96x96 64x64 32x32 24x24 16x16\",\n type: \"image/png\",\n },\n {\n src: \"https://storage.googleapis.com/cuidador_white_label/duarte/192appC.png\",\n type: \"image/png\",\n sizes: \"192x192\",\n },\n {\n src: \"https://storage.googleapis.com/cuidador_white_label/duarte/512appC.png\",\n type: \"image/png\",\n sizes: \"512x512\",\n },\n ],\n start_url: \"/\",\n display: \"standalone\",\n theme_color: \"#A362A5\",\n background_color: \"#A362A5\",\n },\n appCPalette: {\n primary: {\n main: \"#40847F\",\n },\n secondary: {\n main: \"#12B0A0\",\n },\n info: {\n main: \"#0088D3\",\n dark: \"#00234d\",\n },\n error: {\n light: \"#a71633\",\n main: \"#5c1221\",\n },\n warning: {\n main: \"rgb(254,206,60)\",\n light: \"#fff176\",\n },\n success: {\n main: \"rgb(52, 187, 102)\",\n },\n extra: {\n color: {\n grey: {\n main: \"#424242\",\n light: \"#f5f5f5\",\n dark: \"#212121\",\n },\n green: \"#34BB66\",\n red: {\n main: \"#9F0000\",\n light: \"#F36161\",\n dark: \"#5c1221\",\n },\n blue: \"#1876A8\",\n yellow: \"#f6af32\",\n ocean: \"#2B999F\",\n },\n },\n },\n appFPalette: {\n primary: {\n main: \"#725CA7\",\n },\n secondary: {\n main: \"#504075\",\n },\n info: {\n main: \"#0088D3\",\n },\n error: {\n main: \"#5c1221\",\n dark: \"#eb6441\",\n },\n warning: {\n main: \"rgb(254,206,60)\",\n },\n success: {\n main: \"#34BB66\",\n },\n extra: {\n color: {\n grey: {\n main: \"#424242\",\n light: \"#f5f5f5\",\n dark: \"#212121\",\n },\n green: \"#34BB66\",\n red: {\n main: \"#9F0000\",\n light: \"#F36161\",\n dark: \"#eb6441\",\n },\n blue: \"#1876A8\",\n yellow: \"#f6af32\",\n ocean: \"#2B999F\",\n },\n },\n },\n emailPalette: {\n primary: \"#6C5CA4\",\n },\n reportPalette: {\n primary: \"#40847F\",\n secondary: \"#6C5CA4\",\n },\n },\n ciacuidadores: {\n schemeId: \"ciacuidadores\",\n appFSubdomain: \"ciacuidadoresF\",\n appCSubdomain: \"ciacuidadoresC\",\n appFUrl: \"https://ciacuidadoresF.cuidadordeconfianca.com.br\",\n appCUrl: \"https://ciacuidadoresC.cuidadordeconfianca.com.br\",\n appFShortcutIconUrl: \"https://storage.googleapis.com/cuidador_white_label/ciacuidadores/cia_appF.png\",\n appCShortcutIconUrl: \"https://storage.googleapis.com/cuidador_white_label/ciacuidadores/cia_appC.png\",\n appFFaviconUrl: \"https://storage.googleapis.com/cuidador_white_label/ciacuidadores/appF-favicon.png\",\n appCFaviconUrl: \"https://storage.googleapis.com/cuidador_white_label/ciacuidadores/appC-favicon.png\",\n logoDarkUrl: \"https://storage.googleapis.com/cuidador_white_label/default/logo-dark.svg\",\n logoLightUrl: \"https://storage.googleapis.com/cuidador_white_label/default/logo-light.svg\",\n appFJsonManifest: {\n short_name: \"Família - Cia Cuidadores\",\n name: \"Família - Cia Cuidadores\",\n icons: [\n {\n src: \"https://storage.googleapis.com/cuidador_white_label/default/logo-light-96.png\",\n sizes: \"96x96 64x64 32x32 24x24 16x16\",\n type: \"image/png\",\n },\n {\n src: \"https://storage.googleapis.com/cuidador_white_label/default/logo-light-192.png\",\n type: \"image/png\",\n sizes: \"192x192\",\n },\n {\n src: \"https://storage.googleapis.com/cuidador_white_label/default/logo-light-512.png\",\n type: \"image/png\",\n sizes: \"512x512\",\n },\n ],\n start_url: \"/\",\n display: \"standalone\",\n theme_color: \"#000000\",\n background_color: \"#ffffff\",\n },\n appCJsonManifest: {\n short_name: \"Cia Cuidadores\",\n name: \"Cia Cuidadores\",\n icons: [\n {\n src: \"https://storage.googleapis.com/cuidador_white_label/default/logo-dark-96.png\",\n sizes: \"96x96 64x64 32x32 24x24 16x16\",\n type: \"image/png\",\n },\n {\n src: \"https://storage.googleapis.com/cuidador_white_label/default/logo-dark-192.png\",\n type: \"image/png\",\n sizes: \"192x192\",\n },\n {\n src: \"https://storage.googleapis.com/cuidador_white_label/default/logo-dark-512.png\",\n type: \"image/png\",\n sizes: \"512x512\",\n },\n ],\n start_url: \"/\",\n display: \"standalone\",\n theme_color: \"#000000\",\n background_color: \"#ffffff\",\n },\n appCPalette: {\n primary: {\n main: \"#0088D3\",\n dark: \"#00076D\",\n },\n secondary: {\n main: \"#2B999F\",\n dark: \"#1876a8\",\n },\n info: {\n main: \"#0088D3\",\n dark: \"#00234d\",\n },\n error: {\n light: \"#a71633\",\n main: \"#5c1221\",\n },\n warning: {\n main: \"rgb(254,206,60)\",\n light: \"#fff176\",\n },\n success: {\n main: \"rgb(52, 187, 102)\",\n },\n extra: {\n color: {\n grey: {\n main: \"#424242\",\n light: \"#f5f5f5\",\n dark: \"#212121\",\n },\n green: \"#25D366\",\n red: {\n main: \"#9F0000\",\n light: \"#F36161\",\n dark: \"#5c1221\",\n },\n blue: \"#1876A8\",\n yellow: \"#f6af32\",\n },\n },\n },\n appFPalette: {\n primary: {\n main: \"#2B999F\",\n light: \"#DEEBF7\",\n dark: \"#249196\",\n },\n secondary: {\n light: \"#81BEE0\",\n main: \"#00076D\",\n dark: \"#38808f\",\n },\n info: {\n main: \"#0088D3\",\n },\n error: {\n main: \"#5c1221\",\n dark: \"#eb6441\",\n },\n warning: {\n main: \"rgb(254,206,60)\",\n },\n success: {\n main: \"#34BB66\",\n },\n extra: {\n color: {\n grey: {\n main: \"#424242\",\n light: \"#f5f5f5\",\n dark: \"#212121\",\n },\n green: \"#25D366\",\n red: {\n main: \"#9F0000\",\n light: \"#F36161\",\n },\n blue: \"#1876A8\",\n yellow: \"#f6af32\",\n },\n },\n },\n },\n cmais: {\n schemeId: \"cmais\",\n organizationId: 1134,\n organizationName: \"CMais Saúde\",\n organizationEmail: \"contato@cmaissaude.com.br\",\n appFSubdomain: \"cmais-familia\",\n appCSubdomain: \"cmais-cuidador\",\n appFUrl: \"https://cmais-familia.cuidadordeconfianca.com.br\",\n appCUrl: \"https://cmais-cuidador.cuidadordeconfianca.com.br\",\n appFShortcutIconUrl: \"https://storage.googleapis.com/cuidador_white_label/cmais/appF_shortcut.png\",\n appCShortcutIconUrl: \"https://storage.googleapis.com/cuidador_white_label/cmais/appC_shortcut.png\",\n appFFaviconUrl: \"https://storage.googleapis.com/cuidador_white_label/cmais/appFfavicon.ico\",\n appCFaviconUrl: \"https://storage.googleapis.com/cuidador_white_label/cmais/appCfavicon.ico\",\n logoDarkUrl: \"https://storage.googleapis.com/cuidador_white_label/cmais/logo_dark.svg\",\n logoDarkPngUrl: \"https://storage.googleapis.com/cuidador_white_label/cmais/logo_dark.png\",\n logoLightUrl: \"https://storage.googleapis.com/cuidador_white_label/cmais/logo_white.svg\",\n logoLightPngUrl: \"https://storage.googleapis.com/cuidador_white_label/cmais/logo_white.png\",\n appFJsonManifest: {\n short_name: \"CMais Saúde - Cuidados Domiciliares\",\n name: \"CMais Saúde - Cuidados Domiciliares\",\n icons: [\n {\n src: \"https://storage.googleapis.com/cuidador_white_label/cmais/inconeAppF_96.png\",\n sizes: \"96x96 64x64 32x32 24x24 16x16\",\n type: \"image/png\",\n },\n {\n src: \"https://storage.googleapis.com/cuidador_white_label/cmais/inconeAppF_192.png\",\n type: \"image/png\",\n sizes: \"192x192\",\n },\n {\n src: \"https://storage.googleapis.com/cuidador_white_label/cmais/inconeAppF_512.png\",\n type: \"image/png\",\n sizes: \"512x512\",\n },\n ],\n start_url: \"/\",\n display: \"standalone\",\n theme_color: \"#000000\",\n background_color: \"#ffffff\",\n },\n appCJsonManifest: {\n short_name: \"CMais Saúde - Cuidados Domiciliares\",\n name: \"CMais Saúde - Cuidados Domiciliares\",\n icons: [\n {\n src: \"https://storage.googleapis.com/cuidador_white_label/cmais/inconeAppC_96.png\",\n sizes: \"96x96 64x64 32x32 24x24 16x16\",\n type: \"image/png\",\n },\n {\n src: \"https://storage.googleapis.com/cuidador_white_label/cmais/inconeAppC_192.png\",\n type: \"image/png\",\n sizes: \"192x192\",\n },\n {\n src: \"https://storage.googleapis.com/cuidador_white_label/cmais/inconeAppC_512.png\",\n type: \"image/png\",\n sizes: \"512x512\",\n },\n ],\n start_url: \"/\",\n display: \"standalone\",\n theme_color: \"#000000\",\n background_color: \"#ffffff\",\n },\n appCPalette: {\n primary: {\n main: \"#64436c\",\n },\n secondary: {\n main: \"#8F619B\",\n },\n info: {\n main: \"#0088D3\",\n dark: \"#00234d\",\n },\n error: {\n light: \"#a71633\",\n main: \"#5c1221\",\n },\n warning: {\n main: \"rgb(254,206,60)\",\n light: \"#fff176\",\n },\n success: {\n main: \"rgb(52, 187, 102)\",\n },\n extra: {\n color: {\n grey: {\n main: \"#424242\",\n light: \"#f5f5f5\",\n dark: \"#212121\",\n },\n green: \"#34BB66\",\n red: {\n main: \"#9F0000\",\n light: \"#F36161\",\n dark: \"#5c1221\",\n },\n blue: \"#1876A8\",\n yellow: \"#f6af32\",\n ocean: \"#2B999F\",\n },\n },\n },\n appFPalette: {\n primary: {\n main: \"#4E9672\",\n },\n secondary: {\n main: \"#376950\",\n },\n info: {\n main: \"#0088D3\",\n },\n error: {\n main: \"#5c1221\",\n dark: \"#eb6441\",\n },\n warning: {\n main: \"rgb(254,206,60)\",\n },\n success: {\n main: \"#34BB66\",\n },\n extra: {\n color: {\n grey: {\n main: \"#424242\",\n light: \"#f5f5f5\",\n dark: \"#212121\",\n },\n green: \"#34BB66\",\n red: {\n main: \"#9F0000\",\n light: \"#F36161\",\n dark: \"#eb6441\",\n },\n blue: \"#1876A8\",\n yellow: \"#f6af32\",\n ocean: \"#2B999F\",\n },\n },\n },\n emailPalette: {\n primary: \"#8F619B\",\n },\n reportPalette: {\n primary: \"#8F619B\",\n secondary: \"#4E9672\",\n },\n },\n amor_cuidado: {\n schemeId: \"amor_cuidado\",\n organizationId: 1296,\n organizationName: \"Amor & Cuidado\",\n organizationEmail: \"\",\n appFSubdomain: \"amor-cuidado-familia\",\n appCSubdomain: \"amor-cuidado-cuidador\",\n appFUrl: \"https://amor-cuidado-familia.cuidadordeconfianca.com.br\",\n appCUrl: \"https://amor-cuidado-cuidador.cuidadordeconfianca.com.br\",\n appFShortcutIconUrl: \"https://cuidadores-white-label.s3.sa-east-1.amazonaws.com/public/logoLinkF.png\",\n appCShortcutIconUrl: \"https://cuidadores-white-label.s3.sa-east-1.amazonaws.com/public/logoLinkC.png\",\n appFFaviconUrl: \"https://cuidadores-white-label.s3.sa-east-1.amazonaws.com/public/faviconAzul.ico\",\n appCFaviconUrl: \"https://cuidadores-white-label.s3.sa-east-1.amazonaws.com/public/faviconRoxo.ico\",\n logoDarkUrl: \"https://cuidadores-white-label.s3.sa-east-1.amazonaws.com/public/logoHorizDark.svg\",\n logoDarkPngUrl: \"https://cuidadores-white-label.s3.sa-east-1.amazonaws.com/public/logoHorizDark.png\",\n logoLightUrl: \"https://cuidadores-white-label.s3.sa-east-1.amazonaws.com/public/logoHorizBranco.svg\",\n logoLightPngUrl: \"https://cuidadores-white-label.s3.sa-east-1.amazonaws.com/public/logoHorizBranco.png\",\n appFJsonManifest: {\n short_name: \"Amor & Cuidado - Cuidados Domiciliares\",\n name: \"Amor & Cuidado - Cuidados Domiciliares\",\n icons: [\n {\n src: \"https://cuidadores-white-label.s3.sa-east-1.amazonaws.com/public/logo_96\",\n sizes: \"96x96 64x64 32x32 24x24 16x16\",\n type: \"image/png\",\n },\n {\n src: \"https://cuidadores-white-label.s3.sa-east-1.amazonaws.com/public/logoVertical_192.png\",\n type: \"image/png\",\n sizes: \"192x192\",\n },\n {\n src: \"https://cuidadores-white-label.s3.sa-east-1.amazonaws.com/public/logoVertical_512.png\",\n type: \"image/png\",\n sizes: \"512x512\",\n },\n ],\n start_url: \"/\",\n display: \"standalone\",\n theme_color: \"#000000\",\n background_color: \"#ffffff\",\n },\n appCJsonManifest: {\n short_name: \"Amor & Cuidado - Cuidados Domiciliares\",\n name: \"Amor & Cuidado - Cuidados Domiciliares\",\n icons: [\n {\n src: \"https://cuidadores-white-label.s3.sa-east-1.amazonaws.com/public/logo_96\",\n sizes: \"96x96 64x64 32x32 24x24 16x16\",\n type: \"image/png\",\n },\n {\n src: \"https://cuidadores-white-label.s3.sa-east-1.amazonaws.com/public/logoVertical_192.png\",\n type: \"image/png\",\n sizes: \"192x192\",\n },\n {\n src: \"https://cuidadores-white-label.s3.sa-east-1.amazonaws.com/public/logoVertical_512.png\",\n type: \"image/png\",\n sizes: \"512x512\",\n },\n ],\n start_url: \"/\",\n display: \"standalone\",\n theme_color: \"#000000\",\n background_color: \"#ffffff\",\n },\n appCPalette: {\n primary: {\n main: \"#b56ca5\",\n },\n secondary: {\n main: \"#965888\",\n },\n info: {\n main: \"#0088D3\",\n dark: \"#00234d\",\n },\n error: {\n light: \"#a71633\",\n main: \"#5c1221\",\n },\n warning: {\n main: \"rgb(254,206,60)\",\n light: \"#fff176\",\n },\n success: {\n main: \"rgb(52, 187, 102)\",\n },\n extra: {\n color: {\n grey: {\n main: \"#424242\",\n light: \"#f5f5f5\",\n dark: \"#212121\",\n },\n green: \"#34BB66\",\n red: {\n main: \"#9F0000\",\n light: \"#F36161\",\n dark: \"#5c1221\",\n },\n blue: \"#1876A8\",\n yellow: \"#f6af32\",\n ocean: \"#2B999F\",\n },\n },\n },\n appFPalette: {\n primary: {\n main: \"#4a77af\",\n },\n secondary: {\n main: \"#446D9E\",\n },\n info: {\n main: \"#0088D3\",\n },\n error: {\n main: \"#5c1221\",\n dark: \"#eb6441\",\n },\n warning: {\n main: \"rgb(254,206,60)\",\n },\n success: {\n main: \"#34BB66\",\n },\n extra: {\n color: {\n grey: {\n main: \"#424242\",\n light: \"#f5f5f5\",\n dark: \"#212121\",\n },\n green: \"#34BB66\",\n red: {\n main: \"#9F0000\",\n light: \"#F36161\",\n dark: \"#eb6441\",\n },\n blue: \"#1876A8\",\n yellow: \"#f6af32\",\n ocean: \"#2B999F\",\n },\n },\n },\n emailPalette: {\n primary: \"#4a77af\",\n },\n reportPalette: {\n primary: \"#4a77af\",\n secondary: \"#446D9E\",\n },\n },\n};\nexports.default = schemes;\n//# sourceMappingURL=schemes.js.map","import { useEffect } from 'react';\nimport { useLocation } from 'react-router-dom';\n\nexport default function ScrollToTop() {\n const { pathname } = useLocation();\n\n useEffect(() => {\n window.scrollTo(0, 0);\n }, [pathname]);\n\n return null;\n}\n","import React from 'react';\nimport * as Sentry from '@sentry/react';\n\nfunction FallbackComponent() {\n return
Ocorreu um erro
;\n}\n\nconst ErrorBoundary: React.FC = ({ children }) => {\n return (\n \n {children}\n \n );\n};\n\nexport default ErrorBoundary;\n","import axios, { AxiosRequestConfig, AxiosResponse } from 'axios';\nimport qs from 'query-string';\n\nconst defaultConfig: AxiosRequestConfig = {\n timeout: 600000,\n headers: {\n Accept: 'application/json;charset=UTF-8',\n 'Content-Type': 'application/json',\n },\n paramsSerializer: function (params) {\n // Important to ensure querystring array format to what API is expecting\n return qs.stringify(params, { arrayFormat: 'none' });\n },\n};\n\nexport const axiosInstance = axios.create({\n ...defaultConfig,\n baseURL: `${\n process.env.AMB === 'local'\n ? process.env.LOCAL_GATEWAY_URL\n : process.env.REACT_APP_GATEWAY_URL\n }/api/v1`,\n});\n\nexport const addGlobalRequestInterceptor = (\n onFulfilled: (\n config: AxiosRequestConfig\n ) => AxiosRequestConfig | Promise,\n onRejected?: () => void\n) => {\n const id = axiosInstance.interceptors.request.use(onFulfilled, onRejected);\n return id;\n};\n\nexport const removeGlobalRequestInterceptor = (id: number) => {\n axiosInstance.interceptors.request.eject(id);\n};\n\nexport const addGlobalResponseInterceptor = (\n onFulfilled?: (config: AxiosResponse) => AxiosResponse,\n // axios onRejected default type is any\n onRejected?: (error: any) => any // eslint-disable-line @typescript-eslint/no-explicit-any\n) => {\n const id = axiosInstance.interceptors.response.use(onFulfilled, onRejected);\n return id;\n};\n\nexport const removeGlobalResponseInterceptor = (id: number) => {\n axiosInstance.interceptors.response.eject(id);\n};\n\nexport default axiosInstance;\n","import { AxiosRequestConfig } from 'axios';\nimport firebase from 'firebase/compat/app';\nimport 'firebase/compat/auth';\nimport 'firebase/compat/database';\nimport 'firebase/compat/storage';\n\nconst firebaseConfig = {\n apiKey: process.env.REACT_APP_FIREBASE_API_KEY,\n authDomain: process.env.REACT_APP_FIREBASE_AUTH_DOMAIN,\n databaseURL: process.env.REACT_APP_FIREBASE_DATABASE_URL,\n projectId: process.env.REACT_APP_FIREBASE_PROJECT_ID,\n storageBucket: process.env.REACT_APP_FIREBASE_STORAGE_BUCKET,\n messagingSenderId: process.env.REACT_APP_FIREBASE_MESSAGING_SENDER_ID,\n appId: process.env.REACT_APP_FIREBASE_APP_ID,\n};\n\nfirebase.initializeApp(firebaseConfig);\n\nexport const auth = firebase.auth;\n\nexport const authRequestInterceptor = async (config: AxiosRequestConfig) => {\n try {\n const token = await auth().currentUser?.getIdToken();\n if (token) {\n config.headers.Authorization = `Bearer ${token}`;\n }\n } catch (err) {\n console.log(err);\n }\n return config;\n};\n\nexport default firebase;\n","import { APIError } from '@cuidador/lib';\nimport { AxiosError } from 'axios';\n/**\n * Error handler for cuidador de confianca API\n */\n\n// Returns a default message, give simple response's statusCode\nconst getStatusCodeMessage = (error: AxiosError) => {\n const httpStatusCode = error?.response?.status;\n\n switch (httpStatusCode) {\n case 400:\n return 'Um erro ocorreu! Se o problema persistir, contacte o suporte.';\n case 401:\n return 'Erro com as credenciais! Faça login novamente.';\n case 403:\n return 'Você não está autorizado a acessar essas informações! Se acredita que isto é um erro, por favor, contacte o suporte.';\n case 404:\n return 'As informações buscadas não foram encontradas! Se o problema persistir, contacte o suporte.';\n case 500:\n return 'Um problema na comunicação com o servidor ocorreu! Se o problema persistir, contacte o suporte.';\n case 503:\n return 'Esse serviço encontra-se temporariamente indisponível para manutenção! Se o problema persistir, contacte o suporte.';\n default:\n return 'Um erro ocorreu! Se o problema persistir, contacte o suporte.';\n }\n};\n\n// Extracts custom backend error displayMessage if provided\nconst getDisplayMessage = (error: AxiosError) => {\n const customErrorData = error?.response?.data.displayMessage;\n return customErrorData;\n};\n\nconst getConnectivityErrorMessage = () => {\n return 'Erro na conexão! Tente novamente.';\n};\n\n/*\nShows error message acoording to the folowing priority\n1- Network or unknown error\n2- Backend's custom code\n3- Default message, given statusCode\n*/\nexport const resolveErrorMessage = (error: AxiosError) => {\n const resolveMessage = (error: AxiosError) => {\n // nullish response means connectivity error\n if (!error.response) {\n const connectivityMessage = getConnectivityErrorMessage();\n return connectivityMessage;\n }\n\n // nullish response means connectivity error\n const displayMessage = getDisplayMessage(error);\n if (displayMessage) {\n return displayMessage;\n }\n\n const defaultStatusMessage = getStatusCodeMessage(error);\n if (defaultStatusMessage) {\n return defaultStatusMessage;\n }\n };\n // If backend sent a `displayMessage`, we use it\n // Else, show default message according to statusCode\n return resolveMessage(error);\n};\n","import styled from 'styled-components';\nimport LinearProgress from '@material-ui/core/LinearProgress';\n\nconst StyledLinearProgress = styled(LinearProgress)`\n position: fixed;\n width: 100%;\n z-index: 1;\n`;\n\nexport default StyledLinearProgress;\n","import React, {\n useEffect,\n useReducer,\n createContext,\n useCallback,\n} from 'react';\nimport { toast } from 'react-toastify';\n\nimport LoadingProgress from '../components/LoadingLinearProgress';\nimport { auth, authRequestInterceptor } from '../config/firebase';\nimport * as axios from '../config/axios';\n\nconst reducer = (state: number, { type }: { type: string }) => {\n switch (type) {\n case 'INCREMENT_LOADING':\n return state + 1;\n case 'DECREMENT_LOADING':\n return state - 1;\n default:\n return state;\n }\n};\n\ntype GlobalLoadingContextType = {\n incrementLoading: () => void;\n decrementLoading: () => void;\n};\n\nexport const GlobalLoadingContext = createContext(\n {} as GlobalLoadingContextType\n);\n\nexport const GlobalLoadingProvider: React.FC = ({ children }) => {\n const [loadingCount, dispatch] = useReducer(reducer, 0);\n\n useEffect(() => {\n const requestInterceptor = axios.addGlobalRequestInterceptor((config) => {\n incrementLoading();\n return config;\n });\n const responseInterceptor = axios.addGlobalResponseInterceptor(\n (config) => {\n decrementLoading();\n return config;\n },\n (error) => {\n decrementLoading();\n if (error.response?.status === 401 && location.pathname !== '/login') {\n toast.error('Erro com as credenciais! Faça login novamente.');\n auth().signOut();\n }\n return Promise.reject(error);\n }\n );\n\n const firebaseAuthRequestInterceptor = axios.addGlobalRequestInterceptor(\n authRequestInterceptor\n );\n\n return () => {\n axios.removeGlobalRequestInterceptor(requestInterceptor);\n axios.removeGlobalResponseInterceptor(responseInterceptor);\n axios.removeGlobalRequestInterceptor(firebaseAuthRequestInterceptor);\n };\n }, []);\n\n const incrementLoading = useCallback(() => {\n dispatch({ type: 'INCREMENT_LOADING' });\n }, []);\n\n const decrementLoading = useCallback(() => {\n dispatch({ type: 'DECREMENT_LOADING' });\n }, []);\n\n return (\n \n {loadingCount ? : null}\n {children}\n \n );\n};\n\nexport default GlobalLoadingProvider;\n","import { GuardianModel, UserModel } from '@cuidador/database';\nimport { APIError } from '@cuidador/lib';\nimport { clientSideScheme } from '@cuidador/whitelabel';\nimport * as Sentry from '@sentry/react';\nimport { AxiosError } from 'axios';\nimport qs from 'query-string';\nimport React, { createContext, useContext, useEffect, useState } from 'react';\nimport { useLocation } from 'react-router-dom';\nimport { toast } from 'react-toastify';\nimport axios from '../config/axios';\nimport firebase, { auth } from '../config/firebase';\nimport { resolveErrorMessage } from '../utils/error';\nimport { GlobalLoadingContext } from './RequestInterceptor';\nimport { differenceInHours } from 'date-fns'\nimport jwt from 'jsonwebtoken'\n\nexport interface ContextProps {\n user?: firebase.User | null;\n userInfo?: GuardianModel | null;\n loading?: boolean;\n error?: AxiosError | null;\n signIn(email: string, password: string): Promise;\n signOut?(): Promise;\n setUserInfo: React.Dispatch>;\n refreshUserInfo(): Promise;\n promotionPlanId?: string;\n setPromotionPlanId: React.Dispatch>;\n companyPlanId?: string;\n setCompanyPlanId: React.Dispatch>;\n}\n\nexport interface Props {\n children?: React.ReactNode;\n}\n\nexport interface FirebaseErrorType {\n code: string;\n message: string;\n}\n\nexport const sendPasswordResetEmail = async (email: string) => {\n const response = await axios.post(`/auth/password/recover-request`, {\n email,\n userProfile: 'guardian', // to guarantee the redirection after changing the password\n });\n return response;\n};\n\nexport const changePassword = async (\n currentPassword: string,\n newPassword: string\n) => {\n try {\n const response = await axios.post(`auth/password/change`, {\n currentPassword,\n newPassword,\n });\n return Promise.resolve(response);\n } catch (err) {\n return Promise.reject(err);\n }\n};\nconst getUserInfo = async () => axios.get('/user/me');\n\nexport const AuthContext = createContext({} as ContextProps);\n\nexport const AuthProvider: React.FC = ({ children }: Props) => {\n const [user, setUser] = useState(null);\n const [error, setError] = useState | null>(null);\n const [loading, setLoading] = useState(true);\n const [userInfo, setUserInfo] = useState();\n const [promotionPlanId, setPromotionPlanId] = useState('');\n const [companyPlanId, setCompanyPlanId] = useState('');\n const { appCUrl } = clientSideScheme();\n const location = useLocation();\n const { incrementLoading, decrementLoading } = useContext(\n GlobalLoadingContext\n );\n\n const refreshUserInfo = async () => {\n const response = await getUserInfo();\n setUserInfo(response.data.guardianAccount);\n };\n\n const requestSignIn = async (cpf: string, password: string) => {\n const response = await axios.post(`/auth/login`, {\n cpf,\n password,\n userProfile: 'guardian',\n });\n return auth().signInWithCustomToken(response.data.token);\n };\n\n const signIn = async (cpf: string, password: string) => {\n try {\n incrementLoading();\n await requestSignIn(cpf, password);\n setError(null);\n return Promise.resolve();\n } catch (err) {\n setError(err);\n } finally {\n decrementLoading();\n }\n };\n\n const signOut = () => {\n return auth().signOut();\n };\n\n useEffect(() => {\n const unsubscribe = auth().onIdTokenChanged(async (firebaseUser) => {\n if (firebaseUser) {\n const hasCompletedSignUp = (await axios.get(`/user/check-signup-status/${firebaseUser?.uid}`)).data.hasCompletedSignup\n if (!hasCompletedSignUp) return\n }\n const token = await firebaseUser?.getIdToken();\n axios.defaults.headers.Authorization = firebaseUser\n ? `Bearer ${token}`\n : undefined;\n\n if (firebaseUser) {\n try {\n const { claims } = await firebaseUser.getIdTokenResult();\n if (claims.auth !== 'guardian') {\n // On this case, user has logged in with a token registered with wrong role\n toast.error(\n 'As credenciais utilizadas não são válidas para este aplicativo. Entre em contato com o suporte'\n );\n Sentry.captureException(\n new Error(\n `User with firebaseUser.uid=${firebaseUser.uid} has logged in on appF using a token signed with role=${claims.auth}. This should never happen.`\n )\n );\n signOut();\n return;\n }\n\n const response = await getUserInfo();\n const userRole = response.data?.role;\n if (!userRole) {\n // On this case, user has no role and should not be allowed to use the app\n toast.error(\n `Você não possui um perfil de acesso configurado! Por favor, entre em contato com o suporte`\n );\n Sentry.captureException(\n new Error(\n `User with firebaseUser.uid=${firebaseUser.uid} has no assigned role. This should never happen.`\n )\n );\n signOut();\n return;\n }\n if (!userRole.guardianAppAccess && userRole.caregiverAppAccess) {\n // On this case, user role doesnt have access to guardian app, but have access to caregiver app; will be redirect to caregiver app\n await signOut();\n return window.location.replace(`${appCUrl}?token=${token}`);\n }\n if (!userRole.guardianAppAccess) {\n // On this case, user role doesnt have access to guardian app and should not be allowed to use the app\n const roleTitle = userRole.title;\n toast.error(\n `Você possui o perfil de acesso ${roleTitle}, que não te dá acesso ao aplicativo Família`\n );\n signOut();\n return;\n }\n setUserInfo(response.data.guardianAccount);\n } catch (err) {\n toast.error(resolveErrorMessage(err));\n }\n }\n\n setUser(firebaseUser);\n setLoading(false);\n });\n\n return () => {\n unsubscribe();\n };\n }, []);\n\n useEffect(() => {\n (async () => {\n const { token: apiAuthToken } = qs.parse(location.search);\n if (apiAuthToken) {\n try {\n setLoading(true);\n const response = await axios.post(\n '/auth/custom-token',\n { userProfile: 'guardian' },\n { headers: { Authorization: `Bearer ${apiAuthToken}` } }\n );\n const decodedAuthToken = jwt.decode(apiAuthToken as string) as any\n const localToken = window.localStorage.getItem('completeSignUp')\n\n if (localToken) {\n const decodedLocalToken = JSON.parse(localToken)\n console.log('decodedLocal', decodedAuthToken)\n\n const isSameUser = decodedLocalToken.userId === decodedAuthToken.id\n const isRecent = differenceInHours(new Date(), new Date(decodedLocalToken.date)) <= 1\n\n if (decodedAuthToken && isSameUser && isRecent) {\n await auth().signInWithCustomToken(response.data.token)\n }\n }\n } catch (err) {\n console.error(err);\n Sentry.captureException(err);\n toast.error(resolveErrorMessage(err));\n } finally {\n setLoading(false);\n }\n }\n })();\n }, []);\n\n useEffect(() => {\n if (userInfo) {\n Sentry.setUser({\n id: String(userInfo?.id),\n email: userInfo?.user?.email,\n username: userInfo?.user?.name,\n });\n } else {\n Sentry.setUser(null);\n }\n }, [userInfo]);\n\n if (loading) return null;\n\n return (\n \n {children}\n \n );\n};\n\nexport default AuthProvider;\n","export interface PaginatedRequestParams {\n limit?: number;\n page?: number;\n orderBy?: string;\n order?: string;\n}\n\nexport interface ReducerProps extends ReducerData {\n getById?: (id: Id) => Promise;\n getPaginated?: (params: PaginatedRequestParams) => Promise;\n post?: (body: Record) => Promise;\n patch?: (id: Id, body: Record>) => Promise;\n remove?: (id: Id) => Promise;\n}\n\nexport interface ReducerData {\n byId: Record>;\n ids: Array;\n total: number;\n loading: boolean;\n error: Error | null | unknown;\n}\n\nexport type Item = {\n id: Id;\n} & T;\n\ntype GET_BY_ID_TYPE = {\n type: 'GET_BY_ID';\n payload: Item;\n};\n\ntype GET_ALL_TYPE = {\n type: 'GET_ALL';\n payload: Item[];\n};\n\ntype CREATE_TYPE = {\n type: 'CREATE';\n payload: Item;\n};\n\ntype UPDATE_TYPE = {\n type: 'UPDATE';\n payload: Item;\n};\n\ntype REMOVE_TYPE = {\n type: 'REMOVE';\n payload: {\n id: Id;\n };\n};\n\ntype PAGINATION_TYPE = {\n type: 'PAGINATION';\n payload: {\n results: Item[];\n total: number;\n };\n};\n\ntype ERROR_TYPE = {\n type: 'ERROR';\n payload: Error | unknown;\n};\n\ntype SUCCESS_TYPE = {\n type: 'SUCCESS';\n};\n\ntype LOADING_TYPE = {\n type: 'LOADING';\n};\n\ntype ActionType =\n | GET_ALL_TYPE\n | GET_BY_ID_TYPE\n | CREATE_TYPE\n | UPDATE_TYPE\n | REMOVE_TYPE\n | PAGINATION_TYPE\n | ERROR_TYPE\n | LOADING_TYPE\n | SUCCESS_TYPE;\n\nfunction getIdsAndContent(data: Item[]) {\n const ids: Array = [];\n const byId = data.reduce>>((prev, cur) => {\n if (cur.id) {\n ids.push(cur.id);\n prev[cur.id] = cur;\n }\n return prev;\n }, {});\n return { byId, ids, total: ids.length };\n}\n\nexport const createReducer = () => (\n state: ReducerData,\n action: ActionType\n): ReducerProps => {\n switch (action.type) {\n case 'GET_ALL':\n return {\n ...state,\n ...getIdsAndContent(action.payload),\n loading: false,\n };\n case 'GET_BY_ID':\n return {\n ...state,\n ids: Array.from(new Set([...state.ids, action.payload.id])),\n byId: {\n ...state.byId,\n [action.payload.id]: action.payload,\n },\n loading: false,\n };\n case 'CREATE':\n return {\n ...state,\n ids: Array.from(new Set([...state.ids, action.payload.id])),\n byId: { ...state.byId, [action.payload.id]: action.payload },\n total: state.total + 1,\n loading: false,\n };\n case 'UPDATE':\n return {\n ...state,\n ids: Array.from(new Set([...state.ids, action.payload.id])),\n byId: { ...state.byId, [action.payload.id]: action.payload },\n loading: false,\n };\n case 'REMOVE':\n delete state.byId[action.payload.id];\n return {\n ...state,\n ids: state.ids.filter((id: Id) => id !== action.payload.id),\n // byId: { ...state.byId, [action.payload.id]: undefined },\n total: state.total - 1,\n loading: false,\n };\n case 'PAGINATION':\n return {\n ...state,\n ...getIdsAndContent(action.payload.results),\n total: action.payload.total,\n loading: false,\n };\n case 'SUCCESS':\n return { ...state, loading: false };\n case 'ERROR':\n return { ...state, error: action.payload, loading: false };\n case 'LOADING':\n return { ...state, loading: true };\n default:\n return state;\n }\n};\n","import { EventModel } from '@cuidador/database';\nimport { useCallback, useReducer } from 'react';\nimport axios from '../config/axios';\nimport { createReducer, Item, ReducerData } from '../utils/store/index';\n\nconst endpoint = '/care/event';\nconst reportEndpoint = '/report/appointment';\nconst makeDownloadReportEndpoint = (patientId: Id) =>\n `/media/patient/${patientId}/appointment-report`;\n\nconst initialData: ReducerData = {\n byId: {} as Record>,\n ids: [] as Array,\n total: 0,\n loading: false,\n error: null,\n};\n\nconst useAppointment = () => {\n const [state, dispatch] = useReducer(\n createReducer(),\n initialData\n );\n\n const getAllByPatientId = useCallback(async (patientId: Id) => {\n try {\n dispatch({ type: 'LOADING' });\n const response = await axios.get(\n `${endpoint}/appointment/by-patient/${patientId}?order=asc&orderBy=eventHappensAt`\n );\n dispatch({ type: 'GET_ALL', payload: response.data });\n } catch (err) {\n dispatch({ type: 'ERROR', payload: err });\n }\n }, []);\n\n const getById = useCallback(async (id: Id) => {\n try {\n dispatch({ type: 'LOADING' });\n const response = await axios.get(`${endpoint}/appointment/${id}`);\n dispatch({ type: 'GET_BY_ID', payload: response.data });\n } catch (err) {\n dispatch({ type: 'ERROR', payload: err });\n }\n }, []);\n\n const post = useCallback(async (data: Partial) => {\n try {\n dispatch({ type: 'LOADING' });\n const response = await axios.post(`${endpoint}/appointment`, data);\n dispatch({ type: 'CREATE', payload: response.data });\n } catch (err) {\n dispatch({ type: 'ERROR', payload: err });\n return Promise.reject(err);\n }\n }, []);\n\n const patch = useCallback(async (id: Id, data: Partial) => {\n try {\n dispatch({ type: 'LOADING' });\n const response = await axios.patch(`${endpoint}/appointment/${id}`, data);\n dispatch({ type: 'UPDATE', payload: response.data });\n } catch (err) {\n dispatch({ type: 'ERROR', payload: err });\n return Promise.reject(err);\n }\n }, []);\n\n const remove = useCallback(async (id: Id) => {\n try {\n dispatch({ type: 'LOADING' });\n const response = await axios.delete(`${endpoint}/appointment/${id}`);\n dispatch({ type: 'REMOVE', payload: response.data });\n } catch (err) {\n dispatch({ type: 'ERROR', payload: err });\n return Promise.reject(err);\n }\n }, []);\n\n const createReportByPatientId = useCallback(async (id: Id) => {\n try {\n dispatch({ type: 'LOADING' });\n await axios.post(`${reportEndpoint}/${id}`);\n dispatch({ type: 'SUCCESS' });\n } catch (err) {\n dispatch({ type: 'ERROR', payload: err });\n return Promise.reject(err);\n }\n }, []);\n\n const getReportDownloadLinkByPatientId = useCallback(async (id: Id) => {\n try {\n dispatch({ type: 'LOADING' });\n const response = await axios.get(makeDownloadReportEndpoint(id));\n dispatch({ type: 'SUCCESS' });\n return Promise.resolve(response.data);\n } catch (err) {\n dispatch({ type: 'ERROR', payload: err });\n return Promise.reject(err);\n }\n }, []);\n\n return {\n ...state,\n getAllByPatientId,\n getById,\n post,\n patch,\n remove,\n createReportByPatientId,\n getReportDownloadLinkByPatientId,\n };\n};\n\nexport default useAppointment;\n","import { CaregiverModel } from '@cuidador/database';\nimport { AxiosResponse } from 'axios';\nimport { useCallback, useReducer } from 'react';\nimport axios from '../config/axios';\nimport {\n createReducer,\n Item,\n PaginatedRequestParams,\n ReducerData,\n} from '../utils/store/index';\n\nconst endpoint = '/user/caregiver';\n\nconst initialData: ReducerData = {\n byId: {} as Record>,\n ids: [] as Array,\n total: 0,\n loading: false,\n error: null,\n};\n\nconst useCaregiver = () => {\n const [state, dispatch] = useReducer(\n createReducer(),\n initialData\n );\n\n const getAllByPatientId = useCallback(async (id: Id) => {\n try {\n dispatch({ type: 'LOADING' });\n const response = await axios.get(`${endpoint}/by-patient/${id}`);\n dispatch({ type: 'GET_ALL', payload: response.data });\n } catch (err) {\n dispatch({ type: 'ERROR', payload: err });\n }\n }, []);\n\n const getById = useCallback(async (id: Id) => {\n try {\n dispatch({ type: 'LOADING' });\n const response = await axios.get(`${endpoint}/${id}`);\n dispatch({ type: 'GET_BY_ID', payload: response.data });\n return Promise.resolve(response as AxiosResponse);\n } catch (err) {\n dispatch({ type: 'ERROR', payload: err });\n return Promise.reject(err);\n }\n }, []);\n\n const patch = useCallback(async (id: Id, data: CaregiverModel) => {\n try {\n dispatch({ type: 'LOADING' });\n const response = await axios.patch(`${endpoint}/${id}`, data);\n dispatch({ type: 'UPDATE', payload: response.data });\n } catch (err) {\n dispatch({ type: 'ERROR', payload: err });\n return Promise.reject(err);\n }\n }, []);\n\n // TODO: Ensure this endpoint is even used. Remove otherwise\n const remove = useCallback(async (id: Id) => {\n try {\n dispatch({ type: 'LOADING' });\n const response = await axios.delete(`${endpoint}/${id}`);\n dispatch({ type: 'REMOVE', payload: response.data });\n } catch (err) {\n dispatch({ type: 'ERROR', payload: err });\n }\n }, []);\n\n const getPaginated = useCallback(async (params: PaginatedRequestParams) => {\n try {\n dispatch({ type: 'LOADING' });\n const response = await axios.get(`${endpoint}`, { params });\n dispatch({ type: 'PAGINATION', payload: response.data });\n } catch (err) {\n dispatch({ type: 'ERROR', payload: err });\n }\n }, []);\n\n return {\n ...state,\n getAllByPatientId,\n getById,\n patch,\n remove,\n getPaginated,\n };\n};\n\nexport default useCaregiver;\n","import { useCallback, useReducer } from 'react';\nimport axios from '../config/axios';\nimport { EmergencyContactModel } from '@cuidador/database';\nimport { createReducer, ReducerData, Item } from '../utils/store/index';\n\nconst endpoint = 'care/emergency-contact';\n\nconst initialData: ReducerData = {\n byId: {} as Record>,\n ids: [] as Array,\n total: 0,\n loading: false,\n error: null,\n};\n\nconst useEmergencyContacts = () => {\n const [state, dispatch] = useReducer(\n createReducer(),\n initialData\n );\n\n const getAllByPatientId = useCallback(async (id: Id) => {\n try {\n dispatch({ type: 'LOADING' });\n const response = await axios.get(`${endpoint}/by-patient/${id}`);\n dispatch({ type: 'GET_ALL', payload: response.data });\n } catch (err) {\n dispatch({ type: 'ERROR', payload: err });\n }\n }, []);\n\n const getById = useCallback(async (id: Id) => {\n try {\n dispatch({ type: 'LOADING' });\n const response = await axios.get(`${endpoint}/${id}`);\n dispatch({ type: 'GET_BY_ID', payload: response.data });\n } catch (err) {\n dispatch({ type: 'ERROR', payload: err });\n }\n }, []);\n\n const post = useCallback(async (data: Partial) => {\n try {\n dispatch({ type: 'LOADING' });\n const response = await axios.post(`${endpoint}`, data);\n dispatch({ type: 'CREATE', payload: response.data });\n } catch (err) {\n dispatch({ type: 'ERROR', payload: err });\n return Promise.reject(err);\n }\n }, []);\n\n const patch = useCallback(\n async (id: Id, data: Partial) => {\n try {\n dispatch({ type: 'LOADING' });\n const response = await axios.patch(`${endpoint}/${id}`, data);\n dispatch({ type: 'UPDATE', payload: response.data });\n } catch (err) {\n dispatch({ type: 'ERROR', payload: err });\n return Promise.reject(err);\n }\n },\n []\n );\n\n const remove = useCallback(async (id: Id) => {\n try {\n dispatch({ type: 'LOADING' });\n const response = await axios.delete(`${endpoint}/${id}`);\n dispatch({ type: 'REMOVE', payload: response.data });\n } catch (err) {\n dispatch({ type: 'ERROR', payload: err });\n return Promise.reject(err);\n }\n }, []);\n\n return {\n ...state,\n post,\n getAllByPatientId,\n patch,\n getById,\n remove,\n };\n};\n\nexport default useEmergencyContacts;\n","import { EventScheduleModel } from '@cuidador/database';\nimport { useCallback, useReducer } from 'react';\nimport axios from '../config/axios';\nimport { createReducer, Item, ReducerData } from '../utils/store';\n\nconst endpoint = '/care/event/schedule';\nconst reportEndpoint = '/report/measurement/patient';\nconst makeDownloadReportEndpoint = (patientId: Id) =>\n `/media/patient/${patientId}/measurement-report`;\n\nconst initialData: ReducerData = {\n byId: {} as Record>,\n ids: [] as Array,\n total: 0,\n loading: false,\n error: null,\n};\n\nconst useMeasurementSchedule = () => {\n const [state, dispatch] = useReducer(\n createReducer(),\n initialData\n );\n\n const getAllByPatientId = useCallback(async (patientId: Id) => {\n try {\n dispatch({ type: 'LOADING' });\n const response = await axios.get(\n `${endpoint}/measurement/by-patient/${patientId}`\n );\n dispatch({ type: 'GET_ALL', payload: response.data });\n } catch (err) {\n dispatch({ type: 'ERROR', payload: err });\n }\n }, []);\n\n const remove = useCallback(async (id: Id) => {\n try {\n dispatch({ type: 'LOADING' });\n const response = await axios.delete(`${endpoint}/${id}`);\n dispatch({ type: 'REMOVE', payload: response.data });\n } catch (err) {\n dispatch({ type: 'ERROR', payload: err });\n return Promise.reject(err);\n }\n }, []);\n\n const createReportByPatientId = useCallback(async (id: Id) => {\n try {\n dispatch({ type: 'LOADING' });\n await axios.post(`${reportEndpoint}/${id}`);\n dispatch({ type: 'SUCCESS' });\n } catch (err) {\n dispatch({ type: 'ERROR', payload: err });\n return Promise.reject(err);\n }\n }, []);\n\n const getReportDownloadLinkByPatientId = useCallback(async (id: Id) => {\n try {\n dispatch({ type: 'LOADING' });\n const response = await axios.get(makeDownloadReportEndpoint(id));\n dispatch({ type: 'SUCCESS' });\n return Promise.resolve(response.data);\n } catch (err) {\n dispatch({ type: 'ERROR', payload: err });\n return Promise.reject(err);\n }\n }, []);\n\n return {\n ...state,\n remove,\n getAllByPatientId,\n getReportDownloadLinkByPatientId,\n createReportByPatientId,\n };\n};\n\nexport default useMeasurementSchedule;\n","import { MedicationModel } from '@cuidador/database';\nimport { useCallback, useReducer } from 'react';\nimport axios from '../config/axios';\nimport {\n createReducer,\n Item,\n PaginatedRequestParams,\n ReducerData,\n} from '../utils/store/index';\n\ninterface GetPatientMedicationParams extends PaginatedRequestParams {\n minFrequencyEndsAt?: string;\n [key: string]: string | number | undefined;\n}\n\nconst endpoint = '/care/medication';\nconst reportEndpoint = '/report/medication';\nconst makeDownloadReportEndpoint = (patientId: Id) =>\n `/media/patient/${patientId}/medication-report`;\n\nconst initialData: ReducerData = {\n byId: {} as Record>,\n ids: [] as Array,\n total: 0,\n loading: false,\n error: null,\n};\n\nconst useMedication = () => {\n const [state, dispatch] = useReducer(\n createReducer(),\n initialData\n );\n\n const getAllByPatientId = useCallback(\n async (id: Id, params?: GetPatientMedicationParams) => {\n try {\n dispatch({ type: 'LOADING' });\n const response = await axios.get(`${endpoint}/by-patient/${id}`, {\n params,\n });\n dispatch({ type: 'GET_ALL', payload: response.data });\n } catch (err) {\n dispatch({ type: 'ERROR', payload: err });\n }\n },\n []\n );\n\n const getScheduledMedicationsByPatientId = useCallback(\n async (id: Id, params?: GetPatientMedicationParams) => {\n try {\n dispatch({ type: 'LOADING' });\n const response = await axios.get(\n `${endpoint}/scheduled/by-patient/${id}`,\n { params }\n );\n dispatch({ type: 'SUCCESS' });\n return response.data;\n } catch (err) {\n dispatch({ type: 'ERROR', payload: err });\n }\n },\n []\n );\n\n const getById = useCallback(async (id: Id) => {\n try {\n dispatch({ type: 'LOADING' });\n const response = await axios.get(`${endpoint}/${id}`);\n dispatch({ type: 'GET_BY_ID', payload: response.data });\n } catch (err) {\n dispatch({ type: 'ERROR', payload: err });\n }\n }, []);\n\n const patch = useCallback(async (id: Id, data: Partial) => {\n try {\n dispatch({ type: 'LOADING' });\n const response = await axios.patch(`${endpoint}/${id}`, data);\n dispatch({ type: 'UPDATE', payload: response.data });\n } catch (err) {\n dispatch({ type: 'ERROR', payload: err });\n return Promise.reject(err);\n }\n }, []);\n\n const post = useCallback(async (data: Partial) => {\n try {\n dispatch({ type: 'LOADING' });\n const response = await axios.post(`${endpoint}`, data);\n dispatch({ type: 'CREATE', payload: response.data });\n } catch (err) {\n dispatch({ type: 'ERROR', payload: err });\n return Promise.reject(err);\n }\n }, []);\n\n const remove = useCallback(async (id: Id) => {\n try {\n dispatch({ type: 'LOADING' });\n const response = await axios.delete(`${endpoint}/${id}`);\n dispatch({ type: 'REMOVE', payload: response.data });\n } catch (err) {\n dispatch({ type: 'ERROR', payload: err });\n return Promise.reject(err);\n }\n }, []);\n\n const createReportByPatientId = useCallback(async (id: Id) => {\n try {\n dispatch({ type: 'LOADING' });\n const response = await axios.post(`${reportEndpoint}/${id}`);\n dispatch({ type: 'SUCCESS' });\n return Promise.resolve(response.data);\n } catch (err) {\n dispatch({ type: 'ERROR', payload: err });\n return Promise.reject(err);\n }\n }, []);\n\n const getReportDownloadLinkByPatientId = useCallback(async (id: Id) => {\n try {\n dispatch({ type: 'LOADING' });\n const response = await axios.get(makeDownloadReportEndpoint(id));\n dispatch({ type: 'SUCCESS' });\n return Promise.resolve(response.data);\n } catch (err) {\n dispatch({ type: 'ERROR', payload: err });\n return Promise.reject(err);\n }\n }, []);\n\n return {\n ...state,\n getAllByPatientId,\n getById,\n patch,\n post,\n remove,\n createReportByPatientId,\n getReportDownloadLinkByPatientId,\n getScheduledMedicationsByPatientId,\n };\n};\n\nexport default useMedication;\n","import { EventScheduleModel } from '@cuidador/database';\nimport { useCallback, useReducer } from 'react';\nimport axios from '../config/axios';\nimport { createReducer, Item, ReducerData } from '../utils/store/index';\n\nconst endpoint = '/care/event';\nconst reportEndpoint = '/report/routine/patient';\nconst makeDownloadReportEndpoint = (patientId: Id) =>\n `/media/patient/${patientId}/routine-report`;\n\nconst initialData: ReducerData = {\n byId: {} as Record>,\n ids: [] as Array,\n total: 0,\n loading: false,\n error: null,\n};\n\nconst useRoutine = () => {\n const [state, dispatch] = useReducer(\n createReducer(),\n initialData\n );\n\n const getAllByPatientId = useCallback(async (patientId: Id) => {\n try {\n dispatch({ type: 'LOADING' });\n const response = await axios.get(\n `${endpoint}/schedule/routine/by-patient/${patientId}`\n );\n dispatch({ type: 'GET_ALL', payload: response.data });\n } catch (err) {\n dispatch({ type: 'ERROR', payload: err });\n }\n }, []);\n\n const post = useCallback(async (data: Partial) => {\n try {\n dispatch({ type: 'LOADING' });\n const response = await axios.post(`${endpoint}/schedule`, data);\n dispatch({ type: 'CREATE', payload: response.data });\n } catch (err) {\n dispatch({ type: 'ERROR', payload: err });\n return Promise.reject(err);\n }\n }, []);\n\n const patch = useCallback(\n async (id: Id, data: Partial) => {\n try {\n dispatch({ type: 'LOADING' });\n const response = await axios.patch(`${endpoint}/schedule/${id}`, data);\n dispatch({ type: 'UPDATE', payload: response.data });\n } catch (err) {\n dispatch({ type: 'ERROR', payload: err });\n return Promise.reject(err);\n }\n },\n []\n );\n\n const getById = useCallback(async (id: Id) => {\n try {\n dispatch({ type: 'LOADING' });\n const response = await axios.get(`${endpoint}/schedule/routine/${id}`);\n dispatch({ type: 'GET_BY_ID', payload: response.data });\n } catch (err) {\n dispatch({ type: 'ERROR', payload: err });\n }\n }, []);\n\n const remove = useCallback(async (id: Id) => {\n try {\n dispatch({ type: 'LOADING' });\n const response = await axios.delete(`${endpoint}/schedule/${id}`);\n dispatch({ type: 'REMOVE', payload: response.data });\n } catch (err) {\n dispatch({ type: 'ERROR', payload: err });\n return Promise.reject(err);\n }\n }, []);\n\n const createReportByPatientId = useCallback(async (id: Id) => {\n try {\n dispatch({ type: 'LOADING' });\n await axios.post(`${reportEndpoint}/${id}`);\n dispatch({ type: 'SUCCESS' });\n } catch (err) {\n dispatch({ type: 'ERROR', payload: err });\n return Promise.reject(err);\n }\n }, []);\n\n const getReportDownloadLinkByPatientId = useCallback(async (id: Id) => {\n try {\n dispatch({ type: 'LOADING' });\n const response = await axios.get(makeDownloadReportEndpoint(id));\n dispatch({ type: 'SUCCESS' });\n return Promise.resolve(response.data);\n } catch (err) {\n dispatch({ type: 'ERROR', payload: err });\n return Promise.reject(err);\n }\n }, []);\n\n return {\n ...state,\n getAllByPatientId,\n post,\n patch,\n getById,\n remove,\n createReportByPatientId,\n getReportDownloadLinkByPatientId,\n };\n};\n\nexport default useRoutine;\n","import { useCallback, useReducer } from 'react';\nimport axios from '../config/axios';\nimport { ShiftScheduleModel } from '@cuidador/database';\nimport { createReducer, ReducerData, Item } from '../utils/store/index';\n\nconst endpoint = '/care/shiftschedule';\n\nconst initialData: ReducerData = {\n byId: {} as Record>,\n ids: [] as Array,\n total: 0,\n loading: false,\n error: null,\n};\n\nconst useShiftSchedule = () => {\n const [state, dispatch] = useReducer(\n createReducer(),\n initialData\n );\n\n const post = useCallback(\n async (id: Id, data: Partial) => {\n try {\n dispatch({ type: 'LOADING' });\n const response = await axios.post(`${endpoint}/${id}`, data);\n dispatch({ type: 'CREATE', payload: response.data });\n } catch (err) {\n dispatch({ type: 'ERROR', payload: err });\n return Promise.reject(err);\n }\n },\n []\n );\n\n const patch = useCallback(\n async (id: Id, data: Partial) => {\n try {\n dispatch({ type: 'LOADING' });\n const response = await axios.patch(`${endpoint}/${id}`, data);\n dispatch({ type: 'UPDATE', payload: response.data });\n } catch (err) {\n dispatch({ type: 'ERROR', payload: err });\n return Promise.reject(err);\n }\n },\n []\n );\n\n const remove = useCallback(async (id: Id) => {\n try {\n dispatch({ type: 'LOADING' });\n const response = await axios.delete(`${endpoint}/${id}`);\n dispatch({ type: 'REMOVE', payload: response.data });\n } catch (err) {\n dispatch({ type: 'ERROR', payload: err });\n return Promise.reject(err);\n }\n }, []);\n\n const getAllByPatientId = useCallback(async (patientId: Id) => {\n try {\n dispatch({ type: 'LOADING' });\n const response = await axios.get(`${endpoint}/by-patient/${patientId}`);\n dispatch({ type: 'GET_ALL', payload: response.data });\n } catch (err) {\n dispatch({ type: 'ERROR', payload: err });\n }\n }, []);\n\n const getById = useCallback(async (id: Id) => {\n try {\n dispatch({ type: 'LOADING' });\n const response = await axios.get(`${endpoint}/${id}`);\n dispatch({ type: 'GET_BY_ID', payload: response.data });\n } catch (err) {\n dispatch({ type: 'ERROR', payload: err });\n }\n }, []);\n\n return {\n ...state,\n post,\n patch,\n getAllByPatientId,\n getById,\n remove,\n };\n};\n\nexport default useShiftSchedule;\n","import React, { createContext, useContext, useEffect, useState } from 'react';\nimport useAppointment from '../hooks/useAppointment';\nimport useCaregiver from '../hooks/useCaregiver';\nimport useEmergencyContacts from '../hooks/useEmergencyContacts';\nimport useMeasurementSchedule from '../hooks/useMeasurementSchedule';\nimport useMedication from '../hooks/useMedication';\nimport useRoutine from '../hooks/useRoutine';\nimport useShiftSchedule from '../hooks/useShiftSchedule';\nimport { AuthContext } from './auth';\n\nconst objectMap = (\n object: Record,\n callback: (value: unknown) => unknown\n) =>\n Object.fromEntries(\n Object.entries(object).map(([key, value]) => [key, callback(value)])\n );\n\nconst KEY_TO_HOOK = Object.freeze({\n appointment: useAppointment,\n caregiver: useCaregiver,\n emergencyContact: useEmergencyContacts,\n medication: useMedication,\n routine: useRoutine,\n shiftSchedule: useShiftSchedule,\n measurementSchedule: useMeasurementSchedule,\n});\nexport const DEFAULT_COUNT = Object.freeze(\n objectMap(KEY_TO_HOOK, () => 0) as Record\n);\nexport const DEFAULT_IS_COUNTING = Object.freeze(\n objectMap(KEY_TO_HOOK, () => true) as Record<\n keyof typeof KEY_TO_HOOK,\n boolean\n >\n);\n\nexport type CountType = Record;\nexport type IsCountingType = Record;\n\ntype ContextProps = {\n count: CountType;\n isCounting: IsCountingType;\n triggerRefresh: () => void;\n};\n\nexport const RegistrationDashboardContext = createContext({\n count: DEFAULT_COUNT,\n isCounting: DEFAULT_IS_COUNTING,\n triggerRefresh: () => undefined,\n});\n\nconst RegistrationDashboardProvider: React.FC = ({ children }) => {\n const [count, setCount] = useState(DEFAULT_COUNT);\n const [isCounting, setIsCounting] = useState(\n DEFAULT_IS_COUNTING\n );\n\n const { userInfo } = useContext(AuthContext);\n\n const patientId = userInfo?.activePatientId;\n\n // since KEY_TO_HOOK object is const and frozen, and also Object.entries(KEY_TO_HOOK) preserves order\n // this will NOT break React's rule of hooks, all hooks are called the same amount of times and in the same order\n // that's because KEY_TO_HOOK behaves as a true constant, it can NEVER change in runtime, only in devtime\n // therefore, this block is equivalent to writing each useEffect for each entry of the KEY_TO_HOOK object\n const getAllByPatientIdFunctions: Array<\n (id: Id) => Promise\n > = Object.entries(KEY_TO_HOOK).map(([key, useHook]) => {\n const assertedKey = key as keyof typeof KEY_TO_HOOK;\n\n const { getAllByPatientId, loading, total } = useHook();\n\n useEffect(() => {\n const newIsCounting = { ...isCounting };\n newIsCounting[assertedKey] = loading;\n setIsCounting(newIsCounting);\n }, [loading]);\n\n useEffect(() => {\n const newCount = { ...count };\n newCount[assertedKey] = total;\n setCount(newCount);\n }, [total]);\n\n return getAllByPatientId;\n });\n\n const triggerRefresh = () => {\n if (!patientId) return;\n getAllByPatientIdFunctions.forEach((getAllByPatientId) => {\n getAllByPatientId(patientId);\n });\n setIsCounting(DEFAULT_IS_COUNTING);\n };\n\n useEffect(() => {\n triggerRefresh();\n }, [patientId]);\n\n return (\n \n {children}\n \n );\n};\n\nexport default RegistrationDashboardProvider;\n","import styled from 'styled-components';\n\nexport const Container = styled.div`\n background-color: ${({ theme }) => theme.palette.extra.color.red.main};\n color: white;\n width: 100%;\n height: ${({ theme }) => theme.spacing(8)}px;\n display: grid;\n grid-template-columns: 50% 50%;\n`;\n\nexport const MessageContainer = styled.div`\n font-size: ${({ theme }) => theme.spacing(1.75)}px;\n padding-left: ${({ theme }) => theme.spacing(2)}px;\n padding-right: ${({ theme }) => theme.spacing(2)}px;\n display: flex;\n align-items: center;\n`;\n\nexport const ButtonContainer = styled.div`\n display: flex;\n align-items: center;\n justify-content: flex-end;\n font-weight: bold;\n text-decoration: underline;\n font-size: ${({ theme }) => theme.spacing(1.75)}px;\n`;\n","import NavigateNextIcon from '@material-ui/icons/NavigateNext';\nimport React, { useContext, useEffect } from 'react';\nimport { useHistory } from 'react-router-dom';\nimport {\n CountType,\n IsCountingType,\n RegistrationDashboardContext,\n} from '../../contexts/registrationDashboard';\nimport { ButtonContainer, Container, MessageContainer } from './styles';\n\nexport const MANDATORY_KEYS = Object.freeze([\n 'shiftSchedule',\n 'medication',\n 'caregiver',\n]);\n\nexport default function PendingRegistrationBanner() {\n const { count, isCounting, triggerRefresh } = useContext(\n RegistrationDashboardContext\n );\n const history = useHistory();\n\n useEffect(() => {\n triggerRefresh?.();\n }, []);\n\n const mandatoryIsCounting = MANDATORY_KEYS.map(\n (key) => isCounting[key as keyof IsCountingType]\n );\n const mandatoryCounts = MANDATORY_KEYS.map(\n (key) => count[key as keyof CountType]\n );\n if (\n mandatoryIsCounting.some((isCounting) => isCounting === true) ||\n mandatoryCounts.every((count) => count > 0)\n )\n return null;\n\n return (\n \n Ainda existem cadastros pendentes.\n {\n history.push('/cadastros');\n }}\n >\n Finalizar cadastros\n \n \n \n );\n}\n","import styled from 'styled-components';\n\nexport const StyledFieldset = styled.fieldset`\n border: none;\n margin: 0;\n padding: 0;\n // !important flag is necessary to override color from StyledTextField and StyledSelectField\n & .MuiOutlinedInput-notchedOutline {\n border-color: ${({ theme, disabled }) =>\n disabled ? theme.palette.secondary.main + '!important' : ''};\n ${({ disabled }) => (disabled ? 'opacity: 65%' : '')};\n }\n & input {\n color: ${({ theme, disabled }) =>\n disabled ? theme.palette.secondary.main + '!important' : ''};\n ${({ disabled }) => (disabled ? 'opacity: 65%' : '')};\n }\n & .MuiSelect-nativeInput {\n ${({ disabled }) => (disabled ? 'opacity: 0' : '')};\n }\n & label {\n color: ${({ theme, disabled }) =>\n disabled ? theme.palette.secondary.main + '!important' : ''};\n ${({ disabled }) => (disabled ? 'opacity: 65%' : '')};\n }\n & .MuiSelect-root {\n ${({ disabled }) => (disabled ? 'opacity: 65%' : '')};\n }\n & .MuiIconButton-label input {\n ${({ disabled }) => (disabled ? 'opacity: 0' : '')};\n }\n`;\n","import { Tabs } from '@material-ui/core';\nimport styled from 'styled-components';\n\nconst StyledTabs = styled(Tabs)`\n & .PrivateTabIndicator-colorSecondary-11 {\n width: 120px;\n background-color: ${({ theme }) => theme.palette.primary.main};\n }\n & .MuiTabs-indicator {\n background-color: ${({ theme }) => theme.palette.primary.main};\n }\n color: ${({ theme }) => theme.palette.common.black};\n\n & .Mui-selected {\n color: ${({ theme }) => theme.palette.primary.main};\n }\n`;\n\nexport default StyledTabs;\n","/**\n *\n * This is a copy of caregiver/src/contexts/permission\n * Any change here might need be reflected there\n *\n */\n\nimport { PermissionModel, UserModel } from '@cuidador/database';\nimport * as Sentry from '@sentry/react';\nimport React, {\n createContext,\n useCallback,\n useContext,\n useEffect,\n useState,\n} from 'react';\nimport axios, * as axiosModule from '../config/axios';\nimport { AuthContext } from './auth';\n\ninterface UserPermissions {\n [resource: string]: PermissionModel[];\n}\n\nconst DEFAULT_ROLES = {\n guardian: 1,\n careManager: 8,\n};\n\nexport interface ContextProps {\n loading?: boolean;\n hasLoaded?: boolean;\n error?: Error | null;\n permissions?: UserPermissions;\n refreshPermissions?: () => Promise;\n}\n\nexport const PermissionContext = createContext(\n {} as ContextProps\n);\n\nexport const PermissionProvider: React.FC = ({ children }) => {\n const [loading, setLoading] = useState(false);\n const [hasLoaded, setHasLoaded] = useState(false);\n const [error, setError] = useState(null);\n const [permissions, setPermissions] = useState(\n {}\n );\n const { user } = useContext(AuthContext);\n\n useEffect(() => {\n refreshPermissions();\n }, [user]);\n\n useEffect(() => {\n refreshPermissions();\n\n const responseInterceptor = axiosModule.addGlobalResponseInterceptor(\n undefined,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (error: any) => {\n if (error.response?.status === 403) {\n // Force permissions refresh on 403 response\n refreshPermissions();\n }\n return Promise.reject(error);\n }\n );\n\n return () => {\n axiosModule.removeGlobalResponseInterceptor(responseInterceptor);\n };\n }, []);\n\n const refreshPermissions = useCallback(async (): Promise<\n UserPermissions | undefined\n > => {\n if (!user) {\n // User not logged in; Should not refresh permissions\n return undefined;\n }\n\n setLoading(true);\n try {\n const response = await axios.get(`auth/role/permission/me`);\n setPermissions(response.data);\n setHasLoaded(true);\n return response.data;\n } catch (err) {\n setError(err);\n // Will send to Sentry since Permissions fetch shouldn't fail\n Sentry.captureException(err);\n return Promise.reject(err);\n } finally {\n setLoading(false);\n }\n }, [user, setPermissions, setLoading]);\n\n if (user && !hasLoaded) return null;\n\n return (\n \n {children}\n \n );\n};\n\nexport const usePermission = () => useContext(PermissionContext);\n\nexport default PermissionProvider;\n\nexport const isCareManager = (user?: UserModel) => {\n return user?.role?.id === DEFAULT_ROLES.careManager;\n};\n\nexport const isGuardian = (user?: UserModel) => {\n return user?.role?.id === DEFAULT_ROLES.guardian;\n};\n","/**\n *\n * This is a copy of caregiver/src/hooks/useCanAccess\n * Any change here might need be reflected there\n *\n */\n\nimport { useMemo } from 'react';\nimport { PermissionAction, PermissionResource } from '@cuidador/database';\nimport { usePermission } from '../contexts/permission';\n\nconst useCanAccess = (resource: PermissionResource) => {\n const { loading, permissions } = usePermission();\n\n const allowedActions = useMemo(() => {\n if (!permissions) {\n return [];\n }\n\n const userCanAccessResource = Boolean(permissions[resource]);\n\n if (!userCanAccessResource) {\n return [];\n }\n\n const allowedActions = permissions[resource].map(\n ({ action }) => action as PermissionAction\n );\n return allowedActions;\n }, [permissions]);\n\n const isAllowedToCreate = useMemo(() => {\n return allowedActions.includes('create');\n }, allowedActions);\n\n const isAllowedToDelete = useMemo(() => {\n return allowedActions.includes('delete');\n }, allowedActions);\n\n const isAllowedToInvoke = useMemo(() => {\n return allowedActions.includes('invoke');\n }, allowedActions);\n\n const isAllowedToRead = useMemo(() => {\n return allowedActions.includes('read');\n }, allowedActions);\n\n const isAllowedToUpdate = useMemo(() => {\n return allowedActions.includes('update');\n }, allowedActions);\n\n return {\n loading,\n allowedActions,\n isAllowedToCreate,\n isAllowedToDelete,\n isAllowedToInvoke,\n isAllowedToRead,\n isAllowedToUpdate,\n };\n};\n\nexport default useCanAccess;\n","import { AppFPalette, clientSideScheme } from '@cuidador/whitelabel';\nimport { createMuiTheme, Theme } from '@material-ui/core/styles';\nimport { Palette } from '@material-ui/core/styles/createPalette';\n\ntype StyledTheme = Theme & {\n palette: AppFPalette;\n};\n\ndeclare module 'styled-components' {\n // eslint-disable-next-line @typescript-eslint/no-empty-interface\n export interface DefaultTheme extends Theme {\n palette: Palette & AppFPalette;\n }\n}\n\nexport const resolveTheme = () => {\n const scheme = clientSideScheme();\n\n const muiTheme = createMuiTheme({\n palette: scheme.appFPalette,\n shape: {\n borderRadius: 12,\n },\n typography: {\n fontFamily: 'Work Sans',\n fontSize: 14,\n },\n spacing: 8,\n overrides: {\n MuiButton: {\n root: {\n borderRadius: '9px',\n textTransform: 'unset',\n },\n },\n MuiTab: {\n root: {\n textTransform: 'unset',\n },\n },\n },\n });\n\n const styledTheme: StyledTheme = {\n ...muiTheme,\n palette: {\n ...muiTheme.palette,\n extra: scheme.appFPalette.extra,\n },\n };\n\n return {\n muiTheme,\n styledTheme,\n };\n};\n","export type ColorsType = 'primary' | 'secondary' | 'white' | 'text' | 'black';\nimport { resolveTheme } from './theme';\n\ntype ColorMappingType = Record;\n\nconst { muiTheme, styledTheme } = resolveTheme();\nexport const colorMapping: ColorMappingType = {\n primary: muiTheme.palette.primary.main,\n secondary: muiTheme.palette.secondary.main,\n white: muiTheme.palette.common.white,\n text: muiTheme.palette.secondary.main,\n black: styledTheme.palette.extra.color.grey.dark,\n};\n\nexport const hexToRGBArray = (hex: string): number[] => {\n const h = '0123456789ABCDEF';\n const r = h.indexOf(hex[1]) * 16 + h.indexOf(hex[2]);\n const g = h.indexOf(hex[3]) * 16 + h.indexOf(hex[4]);\n const b = h.indexOf(hex[5]) * 16 + h.indexOf(hex[6]);\n return [r, g, b];\n};\n","import MuiTextField from '@material-ui/core/TextField';\nimport styled from 'styled-components';\n\nimport { colorMapping, ColorsType } from '../../styles/colorMapping';\n\nexport const TextField = styled(MuiTextField)<{ $color: ColorsType }>`\n & label:not(.Mui-error, .Mui-disabled) {\n color: ${({ $color }) => colorMapping[$color]};\n }\n & input:not(.Mui-disabled) {\n color: ${({ $color }) => colorMapping[$color]};\n }\n & textarea:not(.Mui-disabled) {\n color: ${({ $color }) => colorMapping[$color]};\n }\n & .MuiInputAdornment-root .MuiIconButton-label:not(.Mui-disabled) {\n color: ${({ $color }) => colorMapping[$color]};\n }\n &\n .MuiInputAdornment-root:not(.Mui-disabled)\n .MuiIconButton-label:not(.Mui-disabled) {\n color: ${({ $color }) => colorMapping[$color]};\n }\n & .MuiOutlinedInput-root:not(.Mui-error, .Mui-disabled) {\n & fieldset,\n & textarea,\n &:hover fieldset,\n &.Mui-focused fieldset {\n border-color: ${({ $color }) => colorMapping[$color]};\n color: ${({ $color }) => colorMapping[$color]};\n }\n }\n & label.Mui-disabled,\n & .MuiInputBase-root.Mui-disabled,\n & .MuiOutlinedInput-root.Mui-disabled .MuiOutlinedInput-notchedOutline {\n color: ${({ theme }) => theme.palette.secondary.main};\n border-color: ${({ theme }) => theme.palette.secondary.main};\n opacity: 65%;\n }\n`;\n","import React from 'react';\nimport { TextFieldProps } from '@material-ui/core/TextField';\n\nimport { ColorsType } from '../../styles/colorMapping';\nimport { TextField } from './styles';\n\nexport type StyledTextFieldProps = Omit & {\n color?: ColorsType;\n};\n\nconst StyledTextField: React.FC = ({\n color = 'primary',\n variant = 'outlined',\n ...props\n}) => ;\n\nexport default StyledTextField;\n","import React from 'react';\nimport { ErrorMessage, Field, useFormikContext, FieldAttributes } from 'formik';\nimport StyledTextField from '../StyledTextField';\nimport { TextFieldProps } from '@material-ui/core/TextField';\n\nconst FormikField = (\n {\n name,\n required = false,\n fullWidth = true,\n ...props\n }: TextFieldProps & { name: string } & FieldAttributes // eslint-disable-line @typescript-eslint/no-explicit-any\n) => {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const { errors, touched } = useFormikContext();\n\n const hasError = touched[name] && errors[name];\n\n return (\n }\n fullWidth={fullWidth}\n {...props}\n />\n );\n};\n\nexport default FormikField;\n","import Button from '@material-ui/core/Button';\nimport styled from 'styled-components';\n\nconst StyledButton = styled(Button).attrs(({ variant }) => ({\n variant: variant || 'outlined',\n}))`\n &.Mui-disabled {\n color: ${({ theme }) => theme.palette.secondary.main};\n border-color: ${({ theme }) => theme.palette.secondary.main};\n opacity: 65%;\n }\n`;\n\nexport default StyledButton;\n","import { Typography } from '@material-ui/core';\nimport styled from 'styled-components';\n\nexport const RuleContainer = styled.div`\n display: flex;\n align-items: center;\n margin-top: ${({ theme }) => theme.spacing(1)}px;\n`;\n\ninterface RuleTextProps {\n isValid: boolean;\n submitError: boolean;\n}\n\nexport const Title = styled(Typography)`\n color: ${({ theme }) => theme.palette.extra.color.grey.main};\n font-weight: bold;\n margin-bottom: ${({ theme }) => theme.spacing(1)}px;\n`;\n\nexport const RuleText = styled(Typography)`\n color: ${({ isValid, submitError, theme }) =>\n isValid\n ? theme.palette.extra.color.green\n : submitError\n ? theme.palette.error.dark\n : theme.palette.extra.color.grey.main};\n margin-left: ${({ theme }) => theme.spacing(1)}px;\n font-weight: bold;\n`;\n","import CheckBoxIcon from '@material-ui/icons/CheckBox';\nimport CheckBoxOutlined from '@material-ui/icons/CheckBoxOutlined';\nimport CloseIcon from '@material-ui/icons/Close';\nimport React from 'react';\nimport { useTheme } from 'styled-components';\nimport { RuleContainer, RuleText, Title } from './styles';\n\ninterface passwordRule {\n text: string;\n isValid: (value: string) => boolean;\n}\n\nconst passwordRules: passwordRule[] = [\n {\n text: 'Pelo menos 8 caracteres',\n isValid: (password) => password.length >= 8,\n },\n {\n text: 'Uma letra maiúscula',\n isValid: (password) => /[A-Z]/.test(password),\n },\n {\n text: 'Uma letra minúscula',\n isValid: (password) => /[a-z]/.test(password),\n },\n {\n text: 'Um número',\n isValid: (password) => /[0-9]/.test(password),\n },\n {\n text: 'Um caractere especial (!, *, -, ?, @, /)',\n isValid: (password) => /[!@#$%&?.,;/\\* -]/.test(password),\n },\n];\n\ninterface PasswordRequirementsProps {\n password: string;\n validationError?: boolean;\n}\n\nconst PasswordRequirements = ({\n password,\n validationError = false,\n}: PasswordRequirementsProps) => {\n const styledTheme = useTheme();\n return (\n
\n Critérios para criar sua senha\n {passwordRules.map((rule, index) => {\n const isValid = rule.isValid(password);\n return (\n \n {isValid ? (\n \n ) : validationError ? (\n \n ) : (\n \n )}\n \n {rule.text}\n \n \n );\n })}\n
\n );\n};\n\nexport default PasswordRequirements;\n","import { Typography } from '@material-ui/core';\nimport styled from 'styled-components';\n\nexport const Container = styled.div`\n display: flex;\n flex: 1;\n flex-direction: column;\n color: ${({ theme }) => theme.palette.secondary.main};\n form {\n display: flex;\n flex: 1;\n flex-direction: column;\n }\n`;\n\nexport const PasswordInstructions = styled(Typography).attrs({\n variant: 'caption',\n})`\n margin: ${({ theme }) => theme.spacing(1)}px;\n`;\n\nexport const FooterContainer = styled.div`\n display: flex;\n justify-content: center;\n flex: 1;\n align-items: flex-end;\n`;\n","/**\n * https://medium.com/trainingcenter/mascara-de-cpf-com-react-javascript-a07719345c93\n * Will be of type ddd.ddd.ddd-dd\n */\nexport const cpfMask = (value: string) => {\n return value\n .replace(/\\D/g, '') // substitui qualquer caracter que nao seja numero por nada\n .replace(/(\\d{3})(\\d)/, '$1.$2') // captura 2 grupos de numero o primeiro de 3 e o segundo de 1, apos capturar o primeiro grupo ele adiciona um ponto antes do segundo grupo de numero\n .replace(/(\\d{3})(\\d)/, '$1.$2')\n .replace(/(\\d{3})(\\d{1,2})/, '$1-$2')\n .replace(/(-\\d{2})\\d+?$/, '$1'); // captura 2 numeros seguidos de um traço e não deixa ser digitado mais nada\n};\n\n/**\n * https://medium.com/reactbrasil/m%C3%A1scara-de-cnpj-com-react-regex-bafb58d2285e\n * Will be of type dd.ddd.ddd/dddd-dd\n */\nexport const cnpjMask = (value: string) => {\n return value\n .replace(/\\D+/g, '') // não deixa ser digitado nenhuma letra\n .replace(/(\\d{2})(\\d)/, '$1.$2') // captura 2 grupos de número o primeiro com 2 digitos e o segundo de com 3 digitos, apos capturar o primeiro grupo ele adiciona um ponto antes do segundo grupo de número\n .replace(/(\\d{3})(\\d)/, '$1.$2')\n .replace(/(\\d{3})(\\d)/, '$1/$2') // captura 2 grupos de número o primeiro e o segundo com 3 digitos, separados por /\n .replace(/(\\d{4})(\\d)/, '$1-$2')\n .replace(/(-\\d{2})\\d+?$/, '$1'); // captura os dois últimos 2 números, com um - antes dos dois números\n};\n\nexport const numberMask = (value: string) => {\n return value.replace(/\\D/g, ''); // substitui qualquer caracter que nao seja numero por nada\n};\n\nexport const floatMask = (value: string) => {\n return value.replace(/[^0-9.]/g, '').replace(/(\\..*)\\./g, '$1'); // substitui qualquer caracter que nao seja numero ou ponto por nada\n};\n\n// Will be of type ddddd-ddd\nexport const cepMask = (value: string) => {\n return value\n .replace(/\\D/g, '') // substitui qualquer caracter que nao seja numero por nada\n .replace(/(\\d{5})(\\d{1,3})/, '$1-$2')\n .replace(/(-\\d{3})\\d+?$/, '$1'); // captura 2 numeros seguidos de um traço e não deixa ser digitado mais nada\n};\n\n// Will be of type (dd) ddddd-dddd* or (dd) ddddd-dddd*\n// Or type 0800 ddd dddd\n// Warning: If first 2 digits are \"55\", they will be removed (brazil international code)\nexport const phoneMask = (value: string) => {\n let numberOnly = value.replace(/\\D/g, ''); // substitui qualquer caracter que nao seja numero por nada\n\n // Removes \"55\" if present\n if (value.startsWith('55') && value.length > 10) {\n numberOnly = removeDDI(numberOnly);\n }\n\n // Format 0800 xxx xxxx\n if (value.startsWith('08')) {\n return numberOnly.replace(/(\\d{4})(\\d{3})(\\d{1,4})(\\d*)/, '$1 $2 $3');\n } else if (value.length > 4) {\n return numberOnly\n .replace(/(\\d{2})(\\d{1,5})/, '($1) $2')\n .replace(/(\\d{4,5})(\\d{4})(\\d*)/, '$1-$2');\n }\n return numberOnly;\n};\n\nexport const removeDDI = (value: string) => {\n return value.slice(2);\n};\n\n/**\n * https://www.geradorcpf.com/javascript-validar-cpf.htm\n */\nexport function validateCpf(rawCpf = '') {\n const cpf = rawCpf.replace(/[^\\d]+/g, '');\n if (cpf === '') return true;\n // Elimina CPFs invalidos conhecidos\n if (\n cpf.length !== 11 ||\n cpf === '00000000000' ||\n cpf === '11111111111' ||\n cpf === '22222222222' ||\n cpf === '33333333333' ||\n cpf === '44444444444' ||\n cpf === '55555555555' ||\n cpf === '66666666666' ||\n cpf === '77777777777' ||\n cpf === '88888888888' ||\n cpf === '99999999999'\n )\n return false;\n // Valida 1o digito\n let add = 0;\n for (let i = 0; i < 9; i++) add += parseInt(cpf.charAt(i)) * (10 - i);\n let rev = 11 - (add % 11);\n if (rev === 10 || rev === 11) rev = 0;\n if (rev !== parseInt(cpf.charAt(9))) return false;\n // Valida 2o digito\n add = 0;\n for (let i = 0; i < 10; i++) add += parseInt(cpf.charAt(i)) * (11 - i);\n rev = 11 - (add % 11);\n if (rev === 10 || rev === 11) rev = 0;\n if (rev !== parseInt(cpf.charAt(10))) return false;\n return true;\n}\n\n/**\n * https://www.geradorcnpj.com/javascript-validar-cnpj.htm\n */\nexport function validateCnpj(rawCnpj = '') {\n const cnpj = rawCnpj.replace(/[^\\d]+/g, '');\n if (cnpj === '') return false;\n // Elimina CNPJs invalidos conhecidos\n if (\n cnpj.length !== 14 ||\n cnpj == '00000000000000' ||\n cnpj == '11111111111111' ||\n cnpj == '22222222222222' ||\n cnpj == '33333333333333' ||\n cnpj == '44444444444444' ||\n cnpj == '55555555555555' ||\n cnpj == '66666666666666' ||\n cnpj == '77777777777777' ||\n cnpj == '88888888888888' ||\n cnpj == '99999999999999'\n )\n return false;\n // Valida DVs\n let tamanho = cnpj.length - 2;\n let numeros = cnpj.substring(0, tamanho);\n const digitos = cnpj.substring(tamanho);\n let soma = 0;\n let pos = tamanho - 7;\n for (let i = tamanho; i >= 1; i--) {\n soma += parseInt(numeros.charAt(tamanho - i)) * pos--;\n if (pos < 2) pos = 9;\n }\n let resultado = soma % 11 < 2 ? 0 : 11 - (soma % 11);\n if (resultado !== parseInt(digitos.charAt(0))) return false;\n tamanho = tamanho + 1;\n numeros = cnpj.substring(0, tamanho);\n soma = 0;\n pos = tamanho - 7;\n for (let i = tamanho; i >= 1; i--) {\n soma += parseInt(numeros.charAt(tamanho - i)) * pos--;\n if (pos < 2) pos = 9;\n }\n resultado = soma % 11 < 2 ? 0 : 11 - (soma % 11);\n if (resultado !== parseInt(digitos.charAt(1))) return false;\n return true;\n}\n\nexport const nonAlphanumericString = (value: string) => {\n return value.replace(/[-|. ]/g, '');\n};\n\nexport const validatePasswordStrength = (value: string) => {\n // at least 8 characters\n // at least 1 number\n // at least 1 special character\n // at least 1 letter uppercase and 1 letter lowercase\n const regex = /(?=.*\\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[!@#$%&?.,;/\\* -])[\\da-zA-Z!@#$%&?.,;/\\* -]{8,}/;\n return regex.test(value);\n};\n\n// Will be of type \"d minutos\"\nexport const durationMask = (value: string) => {\n // Resolve for exception when value is 1\n if (value === '1') {\n return '1 minuto';\n }\n // Resolve for other values\n return value\n .replace(/\\D/g, '') // substitui qualquer caracter que nao seja numero por nada\n .replace(/(\\d*)/, '$1 minutos');\n};\n\nexport const cardMask = (value: string) => {\n return value\n .replace(/\\D/g, '') // substitui qualquer caracter que nao seja numero por nada\n .replace(/^(\\d{4})(\\d)/, '$1 $2')\n .replace(/^(\\d{4})\\s(\\d{4})(\\d)/, '$1 $2 $3')\n .replace(/(\\d{4})\\s(\\d{4})\\s(\\d{4})(\\d)/, '$1 $2 $3 $4')\n .replace(/(\\s\\d{7})\\d+?$/, '$1'); // captura 7 numeros seguidos de um espaço e não deixa ser digitado mais nada\n};\n\nexport const expiryMask = (value: string) => {\n return value\n .replace(/\\D/g, '') // substitui qualquer caracter que nao seja numero por nada\n .replace(/(\\d{2})(\\d)/, '$1/$2')\n .replace(/(\\/\\d{2})\\d+?$/, '$1');\n};\n\nexport const cvcMask = (value: string) => {\n return value\n .replace(/\\D/g, '') // substitui qualquer caracter que nao seja numero por nada\n .replace(/(\\d{3})\\d+?$/, '$1');\n};\n","import * as Yup from 'yup';\nimport { validatePasswordStrength } from '../../../utils/inputs';\n\nexport interface FormValues {\n currentPassword: string;\n newPassword: string;\n retypePassword: string;\n}\n\nexport const formInitialValue = {\n currentPassword: '',\n newPassword: '',\n retypePassword: '',\n};\n\nexport const validationSchema = Yup.object().shape({\n currentPassword: Yup.string().required('Por favor, insira a senha'),\n newPassword: Yup.string()\n .required('Por favor, insira a nova senha')\n .test(\n 'isValidPassword',\n 'Por favor, insira uma senha que atenda aos critérios listados abaixo',\n (value) => validatePasswordStrength(value || '')\n ),\n retypePassword: Yup.string()\n .required('Por favor, insira a confirmação da senha')\n .oneOf([Yup.ref('newPassword'), ''], 'As senhas devem ser iguais'),\n});\n","import { APIError } from '@cuidador/lib';\nimport IconButton from '@material-ui/core/IconButton';\nimport InputAdornment from '@material-ui/core/InputAdornment';\nimport Visibility from '@material-ui/icons/Visibility';\nimport VisibilityOff from '@material-ui/icons/VisibilityOff';\nimport { AxiosError } from 'axios';\nimport { Form, Formik, FormikHelpers } from 'formik';\nimport React, { useState } from 'react';\nimport { toast } from 'react-toastify';\nimport FormikTextField from '../../../components/Forms/FormikTextField';\nimport StyledButton from '../../../components/StyledButton';\nimport PasswordRules from '../../../components/PasswordRules';\nimport { changePassword } from '../../../contexts/auth';\nimport { resolveErrorMessage } from '../../../utils/error';\nimport { Container, FooterContainer } from './styles';\nimport { formInitialValue, FormValues, validationSchema } from './utils';\nimport { isEqual } from 'lodash';\n\nconst ChangePassword: React.FC = () => {\n const [showNewPassword, setShowNewPassword] = useState(false);\n const [showRetypePassword, setShowRetypePassword] = useState(false);\n\n const handleSubmit = (\n values: FormValues,\n { setFieldValue }: FormikHelpers\n ) => {\n changePassword(values.currentPassword, values.newPassword)\n .then(() => {\n toast.success('Senha alterada com sucesso');\n setFieldValue('currentPassword', '');\n setFieldValue('newPassword', '');\n setFieldValue('retypePassword', '');\n })\n .catch((err: AxiosError) => {\n const displayMessage = resolveErrorMessage(err);\n toast.error(displayMessage);\n });\n };\n const [validationError, setValidationError] = useState(false);\n\n const handleShowNewPassword = () => setShowNewPassword(!showNewPassword);\n const handleShowRetypePassword = () =>\n setShowRetypePassword(!showRetypePassword);\n\n return (\n <>\n \n \n {(formik) => (\n
\n \n \n \n {showNewPassword ? : }\n \n \n ),\n }}\n />\n \n \n {showRetypePassword ? (\n \n ) : (\n \n )}\n \n \n ),\n }}\n />\n \n \n setValidationError(true)}\n >\n Salvar\n \n \n \n )}\n \n
\n \n );\n};\n\nexport default ChangePassword;\n","export function mod(n: number, m: number) {\n return ((n % m) + m) % m;\n}\n","import { subHours } from 'date-fns';\nimport { format, utcToZonedTime } from 'date-fns-tz';\nimport addMinutes from 'date-fns/addMinutes';\nimport { mod } from '../math';\n\n/**\n * Receives a time e.g 10:00 and converts to Date\n * with the hour and minute provided: 2020-01-01T10:00:12.000Z\n */\nexport const convertTimeToDate = (timeString: string): Date => {\n const [hours, minutes] = timeString.split(':');\n const now = new Date();\n now.setUTCHours(Number(hours));\n now.setUTCMinutes(Number(minutes));\n return now;\n};\n\n/**\n * Receives a time e.g 10:00 and converts to UTC Date\n * with the hour and minute provided: 2020-01-01T07:00:12.000Z\n */\nexport const convertTimeToUTCDate = (timeString: string): Date => {\n const [hours, minutes] = timeString.split(':');\n const now = new Date();\n now.setHours(Number(hours));\n now.setMinutes(Number(minutes));\n return now;\n};\n\n/**\n * Receives a local browser time and converts it to UTC.\n * Example: 10:00 --> 13:00\n */\nexport const convertLocalTimeToUTC = (time: string): string => {\n const [hours, minutes] = time.split(':');\n const now = new Date();\n now.setHours(Number(hours));\n now.setMinutes(Number(minutes));\n return format(utcToZonedTime(now, 'UTC'), 'HH:mm');\n};\n\n/**\n * Receives a ISODateTime, and format to a time\n * with America/Sao_Paulo timezone (GMT -3),\n * e.g, 2022-06-06T13:00:00.000Z returns 10:00\n */\nexport const formatTimeToAmericaSaoPauloTimezone = (date: string): string => {\n /**\n * It removes 3 hours because the database holds the datetime as America/Sao_Paulo timezone.\n */\n const utcDatePtBr = subHours(new Date(date), 3);\n const formattedDate = format(\n // Removes timezone of the local machine that was introduced in Date instance above.\n timezoneUnawareDate(utcDatePtBr),\n 'HH:mm'\n );\n return formattedDate;\n};\n\n/**\n * Receives a ISODateTime, and format to a Date\n * with America/Sao_Paulo timezone (GMT -3),\n * e.g, 2022-06-06T12:24:45.255Z returns 06/06/2022\n */\nexport const formatShortDateToAmericaSaoPauloTimezone = (\n date: string\n): string => {\n /**\n * It removes 3 hours because the database holds the datetime as America/Sao_Paulo timezone.\n */\n const utcDatePtBr = subHours(new Date(date), 3);\n const formattedDate = format(\n // Removes timezone of the local machine that was introduced in Date instance above.\n timezoneUnawareDate(utcDatePtBr),\n 'dd/MM/yy'\n );\n return formattedDate;\n};\n\n/**\n * Checks wheter date is after than dateToCompare only comparing its HH:mm\n */\nexport const isTimeAfter = (date: Date, dateToCompare: Date): boolean => {\n if (date.getHours() > dateToCompare.getHours()) return true;\n if (\n date.getHours() === dateToCompare.getHours() &&\n date.getMinutes() > dateToCompare.getMinutes()\n ) {\n return true;\n }\n return false;\n};\n\n/**\n * This method will ignore time and timezone from a date, an use only the date\n * part, no matter the current local timezone for the machine running the code\n * Useful for \"fixed\" dates, like birthdates\n */\nexport const timezoneUnawareDate = (date: number | string | Date) =>\n addMinutes(new Date(date), new Date(date).getTimezoneOffset());\n\nexport const weekdayMap = Object.freeze({\n mon: 'Seg',\n tue: 'Ter',\n wed: 'Qua',\n thu: 'Qui',\n fri: 'Sex',\n sat: 'Sab',\n sun: 'Dom',\n});\n\nexport function getUTCWeeklySchedule(\n localSchedule: {\n mon?: boolean;\n tue?: boolean;\n wed?: boolean;\n thu?: boolean;\n fri?: boolean;\n sat?: boolean;\n sun?: boolean;\n },\n localTime: string\n) {\n const date = convertTimeToUTCDate(localTime);\n const utcWeekDay = date.getUTCDay();\n const localWeekDay = date.getDay();\n\n const daysDifference = utcWeekDay - localWeekDay;\n const modularDaysDifference = mod(daysDifference, 7);\n\n const utcSchedule = {\n mon: false,\n tue: false,\n wed: false,\n thu: false,\n fri: false,\n sat: false,\n sun: false,\n };\n\n const activeDays = (Object.keys(localSchedule) as Array<\n keyof typeof localSchedule\n >).filter((key) => localSchedule[key]);\n\n activeDays.forEach((day) => {\n if (day === 'sun') {\n if (modularDaysDifference > 0) {\n utcSchedule.mon = true;\n } else if (modularDaysDifference < 0) {\n utcSchedule.sat = true;\n } else {\n utcSchedule.sun = true;\n }\n }\n if (day === 'mon') {\n if (modularDaysDifference > 0) {\n utcSchedule.tue = true;\n } else if (modularDaysDifference < 0) {\n utcSchedule.sun = true;\n } else {\n utcSchedule.mon = true;\n }\n }\n if (day === 'tue') {\n if (modularDaysDifference > 0) {\n utcSchedule.wed = true;\n } else if (modularDaysDifference < 0) {\n utcSchedule.mon = true;\n } else {\n utcSchedule.tue = true;\n }\n }\n if (day === 'wed') {\n if (modularDaysDifference > 0) {\n utcSchedule.thu = true;\n } else if (modularDaysDifference < 0) {\n utcSchedule.tue = true;\n } else {\n utcSchedule.wed = true;\n }\n }\n if (day === 'thu') {\n if (modularDaysDifference > 0) {\n utcSchedule.fri = true;\n } else if (modularDaysDifference < 0) {\n utcSchedule.wed = true;\n } else {\n utcSchedule.thu = true;\n }\n }\n if (day === 'fri') {\n if (modularDaysDifference > 0) {\n utcSchedule.sat = true;\n } else if (modularDaysDifference < 0) {\n utcSchedule.thu = true;\n } else {\n utcSchedule.fri = true;\n }\n }\n if (day === 'sat') {\n if (modularDaysDifference > 0) {\n utcSchedule.sun = true;\n } else if (modularDaysDifference < 0) {\n utcSchedule.fri = true;\n } else {\n utcSchedule.sat = true;\n }\n }\n });\n\n return utcSchedule;\n}\n\nexport function getLocalWeeklySchedule(\n utcSchedule: {\n mon?: boolean;\n tue?: boolean;\n wed?: boolean;\n thu?: boolean;\n fri?: boolean;\n sat?: boolean;\n sun?: boolean;\n },\n utcTime: string\n) {\n const date = convertTimeToDate(utcTime);\n const utcWeekDay = date.getUTCDay();\n const localWeekDay = date.getDay();\n\n const daysDifference = utcWeekDay - localWeekDay;\n const modularDaysDifference = mod(daysDifference, 7);\n\n const localSchedule = {\n mon: false,\n tue: false,\n wed: false,\n thu: false,\n fri: false,\n sat: false,\n sun: false,\n };\n\n const activeDays = (Object.keys(utcSchedule) as Array<\n keyof typeof utcSchedule\n >).filter((elem) => utcSchedule[elem]);\n\n activeDays.forEach((day) => {\n if (day === 'sun') {\n if (modularDaysDifference < 0) {\n localSchedule.mon = true;\n } else if (modularDaysDifference > 0) {\n localSchedule.sat = true;\n } else {\n localSchedule.sun = true;\n }\n }\n if (day === 'mon') {\n if (modularDaysDifference < 0) {\n localSchedule.tue = true;\n } else if (modularDaysDifference > 0) {\n localSchedule.sun = true;\n } else {\n localSchedule.mon = true;\n }\n }\n if (day === 'tue') {\n if (modularDaysDifference < 0) {\n localSchedule.wed = true;\n } else if (modularDaysDifference > 0) {\n localSchedule.mon = true;\n } else {\n localSchedule.tue = true;\n }\n }\n if (day === 'wed') {\n if (modularDaysDifference < 0) {\n localSchedule.thu = true;\n } else if (modularDaysDifference > 0) {\n localSchedule.tue = true;\n } else {\n localSchedule.wed = true;\n }\n }\n if (day === 'thu') {\n if (modularDaysDifference < 0) {\n localSchedule.fri = true;\n } else if (modularDaysDifference > 0) {\n localSchedule.wed = true;\n } else {\n localSchedule.thu = true;\n }\n }\n if (day === 'fri') {\n if (modularDaysDifference < 0) {\n localSchedule.sat = true;\n } else if (modularDaysDifference > 0) {\n localSchedule.thu = true;\n } else {\n localSchedule.fri = true;\n }\n }\n if (day === 'sat') {\n if (modularDaysDifference < 0) {\n localSchedule.sun = true;\n } else if (modularDaysDifference > 0) {\n localSchedule.fri = true;\n } else {\n localSchedule.sat = true;\n }\n }\n });\n\n return localSchedule;\n}\n","import styled from 'styled-components';\nimport {\n Backdrop as MaterialBackdrop,\n CircularProgress as MaterialCircularProgress,\n} from '@material-ui/core';\nimport Tab from '@material-ui/core/Tab';\n\nexport const Container = styled.div`\n display: flex;\n flex-direction: column;\n flex: 1;\n padding: ${({ theme }) => theme.spacing(2, 2)};\n`;\n\nexport const ButtonContainer = styled.div`\n display: flex;\n flex-direction: row;\n justify-content: center;\n align-items: center;\n width: 100%;\n border-bottom: 1px solid;\n border-color: ${({ theme }) => theme.palette.primary.main};\n padding: ${({ theme }) => theme.spacing(0, 0, 2, 0)};\n`;\n\nexport const StyledTabItem = styled(Tab)`\n width: ${({ theme }) => theme.spacing(15)}px;\n color: ${({ theme }) => theme.palette.primary.main};\n font-size: ${({ theme }) => theme.spacing(2)}px;\n font-weight: 400;\n border-radius: 5px 5px 0 0;\n`;\n\nexport const Backdrop = styled(MaterialBackdrop)`\n z-index: ${({ theme }) => theme.zIndex.drawer + 1};\n color: ${({ theme }) => theme.palette.primary.light};\n position: absolute;\n`;\n\nexport const BackdropCircularProgress = styled(MaterialCircularProgress).attrs({\n color: 'inherit',\n})``;\n","import styled from 'styled-components';\n\nexport const Container = styled.div`\n display: flex;\n flex: 1;\n flex-direction: column;\n color: ${({ theme }) => theme.palette.secondary.main};\n`;\n\nexport const SubTitleContainer = styled.div`\n display: flex;\n color: ${({ theme }) => theme.palette.secondary.main};\n margin-top: ${({ theme }) => theme.spacing(9)}px;\n margin-bottom: ${({ theme }) => theme.spacing(9)}px;\n margin-left: auto;\n margin-right: auto;\n`;\n\nexport const DateContainer = styled.div`\n display: flex;\n color: ${({ theme }) => theme.palette.secondary.main};\n justify-content: center;\n`;\n\nexport const MessageContainer = styled.div`\n display: flex;\n color: ${({ theme }) => theme.palette.secondary.main};\n margin-top: auto;\n margin-bottom: auto;\n text-align: center;\n align-self: center;\n`;\n","import { Typography } from '@material-ui/core';\nimport formatDate from 'date-fns/format';\nimport React, { useContext, useEffect } from 'react';\nimport { Redirect } from 'react-router-dom';\nimport { AuthContext } from '../../../contexts/auth';\nimport useCanAccess from '../../../hooks/useCanAccess';\nimport { timezoneUnawareDate } from '../../../utils/date';\nimport { Backdrop, BackdropCircularProgress } from '../styles';\nimport {\n Container,\n DateContainer,\n MessageContainer,\n SubTitleContainer,\n} from './styles';\n\nconst Payment: React.FC = () => {\n const { isAllowedToRead: isAllowedToReadSubscription } = useCanAccess(\n 'user/subscription'\n );\n const { userInfo, loading, refreshUserInfo } = useContext(AuthContext);\n\n useEffect(() => {\n refreshUserInfo();\n }, []);\n\n const patient = userInfo?.activePatient;\n\n if (!isAllowedToReadSubscription) {\n return ;\n }\n\n if (loading) {\n return (\n \n {loading && (\n \n )}\n \n );\n }\n\n const hasPlanExpirationDate = () => {\n if (!patient || !patient.planExpirationDate) {\n return false;\n } else {\n return true;\n }\n };\n\n return (\n <>\n \n {hasPlanExpirationDate() ? (\n <>\n Seu plano vence no dia\n \n \n {formatDate(\n timezoneUnawareDate(patient!.planExpirationDate!),\n 'dd/MM/yyyy'\n )}\n \n \n \n ) : (\n \n Seu plano não tem data de vencimento configurada. Se tiver algum\n problema, contacte o suporte.\n \n )}\n \n \n );\n};\n\nexport default Payment;\n","import styled from 'styled-components';\n\nexport const Container = styled.div`\n display: flex;\n flex: 1;\n flex-direction: column;\n color: ${({ theme }) => theme.palette.secondary.main};\n form {\n display: flex;\n flex: 1;\n flex-direction: column;\n }\n`;\n\nexport const FooterContainer = styled.div`\n display: flex;\n justify-content: center;\n flex: 1;\n align-items: flex-end;\n`;\n","import * as Yup from 'yup';\nimport { UserModel, GuardianModel } from '@cuidador/database';\n\nimport { phoneMask, numberMask } from '../../../utils/inputs';\n\nexport interface FormValues {\n name: string;\n cpf: string;\n phoneNumber: string;\n email: string;\n}\n\nexport const userModelToFormData = (user: UserModel): FormValues => ({\n name: user?.name || '',\n cpf: user?.cpf || '',\n email: user?.email || '',\n phoneNumber: user?.phoneNumber ? phoneMask(user.phoneNumber) : '',\n});\n\nexport const formDataToGuardianModel = (values: FormValues) =>\n ({\n user: {\n name: values.name,\n phoneNumber: numberMask(`55${values.phoneNumber}`),\n },\n } as GuardianModel);\n\nexport const validationSchema = Yup.object().shape({\n name: Yup.string()\n .required('Por favor, insira o nome completo')\n .min(3, 'O nome deve conter ao menos 3 caracteres')\n .test(\n 'isFullName',\n 'Por favor, insira o nome completo',\n (value) => (value || '').split(' ').length > 1\n ),\n phoneNumber: Yup.string()\n .required('Por favor, insira um celular')\n .min(15, 'Por favor, insira um celular válido')\n .max(15, 'Por favor, insira um celular válido'),\n});\n","import { GuardianModel } from '@cuidador/database';\nimport { useCallback, useReducer } from 'react';\nimport axios from '../config/axios';\nimport { createReducer, Item, ReducerData } from '../utils/store/index';\n\nconst endpoint = '/user/guardian';\n\nconst initialData: ReducerData = {\n byId: {} as Record>,\n ids: [] as Array,\n total: 0,\n loading: false,\n error: null,\n};\n\nconst useGuardian = () => {\n const [state, dispatch] = useReducer(\n createReducer(),\n initialData\n );\n const post = useCallback(async (data: GuardianModel) => {\n try {\n dispatch({ type: 'LOADING' });\n const response = await axios.post(`${endpoint}`, data);\n dispatch({ type: 'CREATE', payload: response.data });\n return Promise.resolve(response);\n } catch (err) {\n dispatch({ type: 'ERROR', payload: err });\n return Promise.reject(err);\n }\n }, []);\n\n const patch = useCallback(async (data: Partial) => {\n try {\n dispatch({ type: 'LOADING' });\n const response = await axios.patch(`${endpoint}/me`, data);\n dispatch({ type: 'UPDATE', payload: response.data });\n } catch (err) {\n dispatch({ type: 'ERROR', payload: err });\n return Promise.reject(err);\n }\n }, []);\n\n return {\n ...state,\n post,\n patch,\n };\n};\n\nexport default useGuardian;\n","import React, { useContext, useEffect } from 'react';\nimport { AuthContext } from '../../../contexts/auth';\nimport { Container, FooterContainer } from './styles';\nimport { Backdrop, BackdropCircularProgress } from '../styles';\nimport { Formik, Form } from 'formik';\nimport {\n validationSchema,\n FormValues,\n userModelToFormData,\n formDataToGuardianModel,\n} from './utils';\nimport FormikTextField from '../../../components/Forms/FormikTextField';\nimport { cpfMask, phoneMask } from '../../../utils/inputs';\nimport StyledButton from '../../../components/StyledButton';\nimport useGuardian from '../../../hooks/useGuardian';\nimport { toast } from 'react-toastify';\nimport { AxiosError } from 'axios';\nimport { APIError } from '@cuidador/lib';\nimport { resolveErrorMessage } from '../../../utils/error';\nimport { isEqual } from 'lodash';\n\nconst Personal: React.FC = () => {\n const { userInfo, loading, refreshUserInfo } = useContext(AuthContext);\n const { patch } = useGuardian();\n\n useEffect(() => {\n refreshUserInfo();\n }, []);\n\n const userData = userInfo?.user;\n const formInitialValue = userModelToFormData(userData!);\n\n const handleSubmit = (values: FormValues) => {\n patch(formDataToGuardianModel(values))\n .then(() => {\n toast.success('Dados alterados com sucesso!');\n refreshUserInfo();\n })\n .catch((err: AxiosError) => {\n const displayMessage = resolveErrorMessage(err);\n toast.error(displayMessage);\n });\n };\n\n if (loading) {\n return (\n \n {loading && (\n \n )}\n \n );\n }\n\n return (\n <>\n \n \n {(formik) => (\n
\n \n \n ) => {\n formik.setFieldValue(\n 'phoneNumber',\n phoneMask(e.target.value)\n );\n }}\n />\n \n \n \n Salvar\n \n \n \n )}\n \n
\n \n );\n};\n\nexport default Personal;\n","export default __webpack_public_path__ + \"static/media/Elipseblue.d281caa2.svg\";","export default __webpack_public_path__ + \"static/media/Elipsegreen.56f01b17.svg\";","import { AppBar, Toolbar as MaterialToolbar } from '@material-ui/core';\nimport styled from 'styled-components';\nimport ElipseBlue from '../../assets/Elipseblue.svg';\nimport ElipseGreen from '../../assets/Elipsegreen.svg';\n\nexport const Toolbar = styled(MaterialToolbar)`\n justify-content: space-between;\n`;\n\nexport const Container = styled(AppBar).attrs({\n elevation: 0,\n position: 'sticky',\n})`\n & .MuiToolbar-root {\n height: 72px;\n z-index: 5;\n }\n`;\n\nexport const StyledElipseBlueTop = styled.img.attrs({\n src: ElipseBlue,\n})`\n width: 250px;\n height: 250px;\n top: -200px;\n right: 30px;\n position: absolute;\n z-index: 2;\n`;\n\nexport const StyledElipseGreenTop = styled.img.attrs({\n src: ElipseGreen,\n})`\n width: 250px;\n height: 250px;\n top: -180px;\n right: -80px;\n position: absolute;\n z-index: 1;\n`;\n\nexport const StyledElipseBlueBot = styled.img.attrs({\n src: ElipseBlue,\n})`\n width: 250px;\n height: 250px;\n bottom: -150px;\n left: -120px;\n position: absolute;\n z-index: 2;\n`;\n\nexport const StyledElipseGreenBot = styled.img.attrs({\n src: ElipseGreen,\n})`\n width: 250px;\n height: 250px;\n bottom: -220px;\n left: 0px;\n position: absolute;\n z-index: 1;\n`;\n\nexport const StyledDiv = styled.div`\n position: absolute;\n width: 100%;\n height: 100%;\n overflow: hidden;\n // [TODO]: change to the right images if necessary\n filter: brightness(0.1) opacity(0.1);\n`;\n\nexport const StyledBlankDiv = styled.div`\n height: 40px;\n width: 40px;\n`;\n","import React from 'react';\n\nimport {\n Container,\n StyledBlankDiv,\n StyledDiv,\n StyledElipseBlueBot,\n StyledElipseBlueTop,\n StyledElipseGreenBot,\n StyledElipseGreenTop,\n Toolbar,\n} from './styles';\n\nexport type HeaderProps = {\n leftContent?: React.ReactNode;\n centerContent?: React.ReactNode;\n rightContent?: React.ReactNode;\n};\n\nexport function Header(props: HeaderProps) {\n const { leftContent, centerContent, rightContent } = props;\n\n return (\n \n \n {leftContent ? leftContent : }\n {centerContent ? centerContent : }\n {rightContent ? rightContent : }\n \n \n \n \n \n \n \n \n );\n}\n","import { PatientModel } from '@cuidador/database';\nimport { AxiosResponse } from 'axios';\nimport { useCallback, useReducer } from 'react';\nimport axios from '../config/axios';\nimport {\n createReducer,\n Item,\n PaginatedRequestParams,\n ReducerData,\n} from '../utils/store/index';\nimport useMedia from './useMedia';\n\nexport enum PatientEventFilter {\n intercorrencia,\n med_fora_do_horario,\n med_alterada,\n plan_atrasado,\n compromisso\n}\n\nexport interface GetPatientPaginatedRequestParams\n extends PaginatedRequestParams {\n customStatus?: CustomStatus[];\n withRelatedUserId?: number;\n eventFilter?: PatientEventFilter\n}\n\nexport type CustomStatus = 'enabled' | 'disabled' | 'pending';\nexport type PatientQueryType = 'relatedPatients' | 'organizationPatients';\n\nconst endpoint = '/user/patient';\n\nconst initialData: ReducerData = {\n byId: {} as Record>,\n ids: [] as Array,\n total: 0,\n loading: false,\n error: null,\n};\n\nconst usePatient = () => {\n const { uploadMedia, getMedia } = useMedia();\n const [state, dispatch] = useReducer(\n createReducer(),\n initialData\n );\n\n const post = useCallback(async (data: PatientModel) => {\n try {\n dispatch({ type: 'LOADING' });\n const response = await axios.post(`${endpoint}`, data);\n dispatch({ type: 'CREATE', payload: response.data });\n return Promise.resolve(response);\n } catch (err) {\n dispatch({ type: 'ERROR', payload: err });\n return Promise.reject(err);\n }\n }, []);\n\n const patch = useCallback(async (id: Id, data: Partial) => {\n try {\n dispatch({ type: 'LOADING' });\n const response = await axios.patch(`${endpoint}/${id}`, data);\n dispatch({ type: 'UPDATE', payload: response.data });\n return Promise.resolve(response);\n } catch (err) {\n dispatch({ type: 'ERROR', payload: err });\n return Promise.reject(err);\n }\n }, []);\n\n const uploadProfilePicture = useCallback(\n async (file: File, patientId: Id) => {\n try {\n const response = await uploadMedia(\n `/media/profile-picture/patient/${patientId}`,\n file\n );\n return Promise.resolve(response);\n } catch (err) {\n return Promise.reject(err);\n }\n },\n []\n );\n\n const getProfilePicture = useCallback(async (id: number) => {\n try {\n const response = await getMedia(`/media/profile-picture/patient/${id}`);\n return Promise.resolve(response);\n } catch (err) {\n return Promise.reject(err);\n }\n }, []);\n\n const getRelatedPatientsPaginated = useCallback(\n async (params: GetPatientPaginatedRequestParams) => {\n try {\n dispatch({ type: 'LOADING' });\n const response = await axios.get<{\n results: Item[];\n total: number;\n }>(endpoint, { params });\n dispatch({ type: 'PAGINATION', payload: response.data });\n return Promise.resolve(response);\n } catch (err) {\n dispatch({ type: 'ERROR', payload: err });\n return Promise.reject(err);\n }\n },\n []\n );\n\n const getOrganizationPatientsPaginated = useCallback(\n async (params: GetPatientPaginatedRequestParams) => {\n try {\n dispatch({ type: 'LOADING' });\n const response = await axios.get<{\n results: Item[];\n total: number;\n }>(`${endpoint}/by-organization`, { params });\n dispatch({ type: 'PAGINATION', payload: response.data });\n return Promise.resolve(response);\n } catch (err) {\n dispatch({ type: 'ERROR', payload: err });\n return Promise.reject(err);\n }\n },\n []\n );\n\n const getById = useCallback(async (id: Id) => {\n try {\n dispatch({ type: 'LOADING' });\n const response = await axios.get(`${endpoint}/${id}`);\n dispatch({ type: 'GET_BY_ID', payload: response.data });\n return Promise.resolve(response as AxiosResponse);\n } catch (err) {\n dispatch({ type: 'ERROR', payload: err });\n return Promise.reject(err);\n }\n }, []);\n\n const setActive = useCallback(async (id: number) => {\n try {\n dispatch({ type: 'LOADING' });\n const response = await axios.patch(`${endpoint}/activate/${id}`);\n dispatch({ type: 'UPDATE', payload: response.data });\n return Promise.resolve(response);\n } catch (err) {\n dispatch({ type: 'ERROR', payload: err });\n return Promise.reject(err);\n }\n }, []);\n\n return {\n ...state,\n post,\n uploadProfilePicture,\n getProfilePicture,\n getRelatedPatientsPaginated,\n getOrganizationPatientsPaginated,\n getById,\n patch,\n setActive,\n };\n};\n\nexport default usePatient;\n","import defaultAxios from 'axios';\nimport { useCallback } from 'react';\nimport axios from '../config/axios';\n\nconst useMedia = () => {\n // Gets PUT signed url\n const getSignedUrl = useCallback(\n (endpoint: string, contentType: string) =>\n axios({\n method: 'put',\n url: endpoint,\n data: null,\n headers: {\n 'Content-Type': contentType,\n },\n }),\n []\n );\n\n // Puts file into Storage bucket\n const uploadMedia = useCallback(async (endpoint: string, file: File) => {\n const {\n data: { signedUrl },\n } = await getSignedUrl(endpoint, file.type);\n return defaultAxios({\n method: 'put',\n data: file,\n url: signedUrl,\n headers: {\n 'Content-Type': file.type,\n },\n });\n }, []);\n\n const getMedia = useCallback(\n (endpoint: string) =>\n axios.request<{ signedUrl: string }>({\n method: 'get',\n url: endpoint,\n data: null,\n }),\n []\n );\n\n return { uploadMedia, getMedia };\n};\n\nexport default useMedia;\n","import React from 'react'\nimport { useEffect, useState } from 'react'\nimport usePatient from '../../hooks/usePatient'\nimport { Avatar } from '@material-ui/core'\n\nexport type PatientAvatarProps = {\n patientId: number\n}\n\nexport function PatientAvatar(props: PatientAvatarProps) {\n const { patientId } = props\n const [imageUrl, setImageUrl] = useState('')\n const { getProfilePicture } = usePatient()\n\n const handleGetProfilePicture = async (id: number) => {\n try {\n return await getProfilePicture(id).then(({ data }) => data?.signedUrl)\n } catch (err) {\n console.log('error')\n }\n }\n async function fetchPatientProfilePicture() {\n if (!patientId) return\n const result = await handleGetProfilePicture(parseInt(`${patientId}`))\n if (result) {\n setImageUrl(result)\n }\n }\n\n useEffect(() => {\n fetchPatientProfilePicture()\n }, [])\n\n return \n}\n","import { CaregiverModel, SupporterModel, UserModel } from '@cuidador/database';\nimport { TokenProfile } from '@cuidador/lib';\nimport { AxiosResponse } from 'axios';\nimport { useCallback, useReducer } from 'react';\nimport axios from '../config/axios';\nimport {\n createReducer,\n Item,\n PaginatedRequestParams,\n ReducerData,\n} from '../utils/store/index';\nimport useMedia from './useMedia';\n\nexport type CompleteSignupBody = {\n userData: UserModel;\n caregiverData?: Omit;\n supporterData?: SupporterModel;\n};\n\nexport interface GetOrganizationMembersPaginatedRequestParams\n extends PaginatedRequestParams {\n status?: UserModel['status'][];\n withRelatedPatientId?: number;\n}\n\nconst endpoint = '/user';\n\nconst initialData: ReducerData = {\n byId: {} as Record>,\n ids: [] as Array,\n total: 0,\n loading: false,\n error: null,\n};\n\nconst useUser = () => {\n const { uploadMedia, getMedia } = useMedia();\n const [state, dispatch] = useReducer(createReducer(), initialData);\n\n const post = useCallback(async (data: UserModel) => {\n try {\n dispatch({ type: 'LOADING' });\n const response = await axios.post(`${endpoint}`, data);\n dispatch({ type: 'CREATE', payload: response.data });\n return Promise.resolve(response);\n } catch (err) {\n dispatch({ type: 'ERROR', payload: err });\n return Promise.reject(err);\n }\n }, []);\n\n const patchAutoPatientRelate = useCallback(\n async (\n id: Id,\n isAutoPatientRelateEnabled: UserModel['isAutoPatientRelateEnabled']\n ) => {\n try {\n dispatch({ type: 'LOADING' });\n const response = await axios.patch(\n `${endpoint}/${id}/auto-patient-relate`,\n { isAutoPatientRelateEnabled }\n );\n dispatch({ type: 'UPDATE', payload: response.data });\n return Promise.resolve(response as AxiosResponse);\n } catch (err) {\n dispatch({ type: 'ERROR', payload: err });\n return Promise.reject(err);\n }\n },\n []\n );\n\n const getById = useCallback(async (id: Id) => {\n try {\n dispatch({ type: 'LOADING' });\n const response = await axios.get(`${endpoint}/${id}`);\n dispatch({ type: 'GET_BY_ID', payload: response.data });\n return Promise.resolve(response as AxiosResponse);\n } catch (err) {\n dispatch({ type: 'ERROR', payload: err });\n return Promise.reject(err);\n }\n }, []);\n\n const findAvailableUsers = useCallback(async (values: UserModel) => {\n try {\n dispatch({ type: 'LOADING' });\n const response = await axios.post(`${endpoint}/available`, values);\n dispatch({ type: 'GET_BY_ID', payload: response.data });\n return Promise.resolve(response.data);\n } catch (err) {\n dispatch({ type: 'ERROR', payload: err });\n return Promise.reject(err);\n }\n }, []);\n\n const completeSignup = useCallback(\n async (data: CompleteSignupBody, completeSignupToken: string) => {\n try {\n const response = await axios.post(`${endpoint}/complete-signup`, data, {\n headers: {\n Authorization: `Bearer ${completeSignupToken}`,\n },\n });\n return Promise.resolve(response.data);\n } catch (err) {\n return Promise.reject(err);\n }\n },\n []\n );\n\n const uploadProfilePicture = useCallback(\n async (file: File, userId: number) => {\n try {\n const response = await uploadMedia(\n `/media/profile-picture/user/${userId}`,\n file\n );\n return Promise.resolve(response);\n } catch (err) {\n return Promise.reject(err);\n }\n },\n []\n );\n\n const getProfilePicture = useCallback(async (id: number) => {\n try {\n const response = await getMedia(`/media/profile-picture/user/${id}`);\n return Promise.resolve(response);\n } catch (err) {\n return Promise.reject(err);\n }\n }, []);\n\n const getOrganizationMembersPaginated = useCallback(\n async (params: GetOrganizationMembersPaginatedRequestParams) => {\n try {\n dispatch({ type: 'LOADING' });\n const response = await axios.get<{\n results: Item[];\n total: number;\n }>(`${endpoint}/by-organization`, { params });\n dispatch({ type: 'PAGINATION', payload: response.data });\n return Promise.resolve(response);\n } catch (err) {\n return Promise.reject(err);\n }\n },\n []\n );\n\n const relateToPatient = useCallback(\n async (userId: number, patientId: number) => {\n try {\n dispatch({ type: 'LOADING' });\n const response = await axios.post(\n `${endpoint}/${userId}/relate-to-patient`,\n { patientToRelateId: patientId }\n );\n dispatch({ type: 'GET_BY_ID', payload: response.data });\n return Promise.resolve(response);\n } catch (err) {\n dispatch({ type: 'ERROR', payload: err });\n return Promise.reject(err);\n }\n },\n []\n );\n\n const relateToOrganization = useCallback(async (userId: number) => {\n try {\n dispatch({ type: 'LOADING' });\n const response = await axios.post(\n `${endpoint}/${userId}/relate-to-organization`\n );\n dispatch({ type: 'SUCCESS' });\n return Promise.resolve(response);\n } catch (err) {\n dispatch({ type: 'ERROR', payload: err });\n return Promise.reject(err);\n }\n }, []);\n\n const unrelateFromPatient = useCallback(\n async (userId: number, patientId: number) => {\n try {\n dispatch({ type: 'LOADING' });\n const response = await axios.post(\n `${endpoint}/${userId}/unrelate-from-patient`,\n { patientToUnrelateId: patientId }\n );\n dispatch({ type: 'GET_BY_ID', payload: response.data });\n return Promise.resolve(response);\n } catch (err) {\n dispatch({ type: 'ERROR', payload: err });\n return Promise.reject(err);\n }\n },\n []\n );\n\n const unrelateAllPatients = useCallback(async (userId: Id) => {\n try {\n dispatch({ type: 'LOADING' });\n const response = await axios.post(\n `${endpoint}/${userId}/unrelate-from-patient/all`\n );\n dispatch({ type: 'SUCCESS' });\n return Promise.resolve(response);\n } catch (err) {\n dispatch({ type: 'ERROR', payload: err });\n return Promise.reject(err);\n }\n }, []);\n\n const unrelateFromOrganization = useCallback(async (userId: number) => {\n try {\n dispatch({ type: 'LOADING' });\n const response = await axios.post(\n `${endpoint}/${userId}/unrelate-from-organization`\n );\n dispatch({ type: 'SUCCESS' });\n return Promise.resolve(response);\n } catch (err) {\n dispatch({ type: 'ERROR', payload: err });\n return Promise.reject(err);\n }\n }, []);\n\n const getPendingSignupToken = useCallback(async (id: Id) => {\n try {\n const response = await axios.post(`/auth/pending-signup-token`, {\n userId: id,\n });\n return Promise.resolve(\n response as AxiosResponse<{\n id: UserModel['id'];\n userProfile: TokenProfile;\n /**\n * @deprecated will be removed. completeSignupUrl should be used\n */\n token: string;\n completeSignupUrl: string;\n }>\n );\n } catch (err) {\n return Promise.reject(err);\n }\n }, []);\n\n const checkSignupStatus = useCallback(async (id: Id) => {\n try {\n const response = await axios.get(`${endpoint}/check-signup-status/${id}`);\n return Promise.resolve(response.data);\n } catch (err) {\n return Promise.reject(err);\n }\n }, []);\n\n return {\n ...state,\n post,\n patchAutoPatientRelate,\n getById,\n findAvailableUsers,\n completeSignup,\n uploadProfilePicture,\n getProfilePicture,\n getOrganizationMembersPaginated,\n relateToPatient,\n relateToOrganization,\n unrelateFromPatient,\n unrelateAllPatients,\n unrelateFromOrganization,\n getPendingSignupToken,\n checkSignupStatus,\n };\n};\n\nexport default useUser;\n","import React from 'react'\nimport { useEffect, useState } from 'react'\nimport useUser from '../../hooks/useUser'\nimport { Avatar } from '@material-ui/core'\n\nexport type UserAvatarProps = {\n userId: number\n}\n\nexport function UserAvatar(props: UserAvatarProps) {\n const { userId } = props\n const [imageUrl, setImageUrl] = useState('')\n const { getProfilePicture } = useUser()\n\n const handleGetProfilePicture = async (id: number) => {\n try {\n return await getProfilePicture(id).then(({ data }) => data?.signedUrl)\n } catch (err) {\n console.log('error')\n }\n }\n async function fetchUserProfilePicture() {\n if (!userId) return\n const result = await handleGetProfilePicture(parseInt(`${userId}`))\n if (result) {\n setImageUrl(result)\n }\n }\n\n useEffect(() => {\n fetchUserProfilePicture()\n }, [])\n\n return \n}\n","import { Typography, useTheme } from '@material-ui/core'\nimport React from 'react'\nimport { PatientAvatar } from '../PatientAvatar'\nimport { UserAvatar } from '../UserAvatar'\n\nexport type PageTitleProps = {\n title: string\n userId?: number\n patientId?: number\n}\n\nexport function PageTitle(props: PageTitleProps) {\n const { title, userId, patientId } = props\n const theme = useTheme()\n\n return (\n
\n {patientId && }\n {userId && }\n \n {title}\n \n
\n )\n}\n","import { IconButton, useTheme } from '@material-ui/core'\nimport React from 'react'\n\nexport type StyledIconButtonProps = {\n icon: React.ReactNode\n action?: () => void\n backgroundColor?: string\n}\n\nexport function StyledIconButton (props: StyledIconButtonProps) {\n const { icon, action, backgroundColor } = props\n const theme = useTheme()\n\n return (\n \n {icon}\n \n )\n}\n","import React from 'react'\nimport { ChevronLeftRounded } from '@material-ui/icons'\nimport { StyledIconButton } from '../StyledIconButton'\nimport { useHistory } from 'react-router-dom'\n\nexport type BackButtonProps = {\n action?: () => void\n}\n\nexport function BackButton (props: BackButtonProps) {\n const history = useHistory()\n const { action = () => history.goBack() } = props\n\n return (\n \n }\n action={() => action()}\n />\n )\n}\n","import React from 'react'\nimport { useTheme } from '@material-ui/core'\n\nconst PscIcon: React.FC = () => {\n const theme = useTheme()\n const pscIconColor = theme.palette.primary.main\n\n return (\n \n \n \n \n \n \n \n )\n}\n\nexport default PscIcon\n","import React from 'react'\nimport PscIcon from '../Icons/PscIcon'\nimport { useHistory } from 'react-router-dom'\nimport { StyledIconButton } from '../StyledIconButton'\n\nexport function PscButton () {\n const history = useHistory()\n\n return (\n }\n action={() => history.push('/gestao/pacientes')}\n backgroundColor='white'\n />\n )\n}\n","import React from 'react';\nimport { RouteComponentProps } from 'react-router-dom';\nimport PendingRegistrationBanner from '../../components/PendingRegistrationBanner';\nimport { StyledFieldset } from '../../components/StyledFieldset';\nimport StyledTabs from '../../components/StyledTabs';\nimport useCanAccess from '../../hooks/useCanAccess';\nimport ChangePassword from './ChangePassword';\nimport Payment from './Payment';\nimport Personal from './Personal';\nimport { ButtonContainer, Container, StyledTabItem } from './styles';\nimport { Header } from '../../components/Header'\nimport { PageTitle } from '../../components/PageTitle'\nimport { BackButton } from '../../components/BackButton'\nimport { PscButton } from '../../components/PscButton'\n\nconst Account: React.FC> = (props) => {\n const currentTab = props.match.params.tabId;\n\n const { isAllowedToUpdate } = useCanAccess('user/guardian');\n const { isAllowedToRead: isAllowedToReadSubscription } = useCanAccess(\n 'user/subscription'\n );\n\n // eslint-disable-next-line @typescript-eslint/ban-types\n const handleChange = (_: React.ChangeEvent<{}>, newValue: string) => {\n props.history.replace(`/minha-conta/${newValue}`);\n };\n\n return (\n <>\n \n }\n centerContent={\n \n }\n rightContent={}\n />\n \n \n \n \n \n \n {isAllowedToReadSubscription && (\n \n )}\n \n \n \n {currentTab === 'pessoais' && }\n \n\n {currentTab === 'senha' && }\n {currentTab === 'pagamento' && }\n \n \n );\n};\n\nexport default Account;\n","import { Paper } from '@material-ui/core';\nimport styled from 'styled-components';\n\nconst StyledPaper = styled(Paper).attrs({ elevation: 0 })`\n color: ${({ theme }) => theme.palette.primary.main};\n padding: ${({ theme }) => theme.spacing(2)}px;\n border-radius: 21px;\n box-shadow: 0px 3px 6px #00000042;\n margin-top: ${({ theme }) => theme.spacing(2)}px;\n`;\n\nexport default StyledPaper;\n","import styled from 'styled-components';\nimport StyledPaper from '../StyledPaper';\n\nexport const CardBox = styled(StyledPaper)`\n width: 100%;\n display: flex;\n margin: 0;\n background-color: ${({ theme }) => theme.palette.success.main};\n padding: 0;\n`;\n\nexport const TypographyContainer = styled.div`\n color: ${({ theme }) => theme.palette.common.white};\n display: flex;\n flex-direction: column;\n margin-left: ${({ theme }) => theme.spacing(1)}px;\n width: 100%;\n margin-bottom: ${({ theme }) => theme.spacing(1)}px;\n word-wrap: break-word;\n`;\n\nexport const IconContainer = styled.div`\n display: flex;\n justify-content: space-between;\n flex-direction: column;\n padding: 0;\n`;\n\nexport const TimerContainer = styled.div`\n color: ${({ theme }) => theme.palette.common.white};\n margin-left: ${({ theme }) => theme.spacing(1)}px;\n align-self: center;\n`;\n\nexport const TitleContainer = styled.div`\n margin-bottom: ${({ theme }) => theme.spacing(-0.8)}px;\n`;\n","function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\nimport * as React from \"react\";\n\nvar _ref2 = /*#__PURE__*/React.createElement(\"g\", {\n clipPath: \"url(#clip0_5867_1078)\"\n}, /*#__PURE__*/React.createElement(\"path\", {\n d: \"M11.999 74.999C10.8352 74.9999 9.67738 74.8315 8.56203 74.499C6.47662 73.3269 4.49067 71.9861 2.62404 70.49C0.920862 68.3651 -0.00528289 65.7222 -0.000961508 62.999V12.175C8.50096 4.26545 19.7072 -0.0910887 31.319 -0.00101087C55.443 -0.00101087 75 17.992 75 40.189C75 55.063 66.218 68.049 53.165 74.999H11.999Z\",\n fill: \"#34BB66\"\n}), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M37.5 72.521C54.897 72.521 69 58.418 69 41.021C69 23.624 54.897 9.521 37.5 9.521C20.103 9.521 6 23.624 6 41.021C6 58.418 20.103 72.521 37.5 72.521Z\",\n fill: \"#85D6A3\"\n}), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M53.824 25.326L50.111 21.613L48.35 25.326L44.637 21.613L42.876 25.326L39.163 21.613L37.398 25.327L33.684 21.613L32.484 25.886L28.211 21.613L26.818 25.694L22.737 21.613L20.826 25.065V33.473L17.543 35.309L25.626 43.392L18.626 61.431L29.247 72.052C34.5176 73.5004 40.0734 73.5606 45.3742 72.2267C50.675 70.8929 55.5405 68.2103 59.4979 64.4397C63.4553 60.6692 66.3698 55.9389 67.9583 50.7088C69.5467 45.4786 69.755 39.9265 68.563 34.592L55.585 21.613L53.824 25.326Z\",\n fill: \"#34BB66\"\n}), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M37.663 61.431H18.626V30.563H37.663L50.18 45.171L37.663 61.431Z\",\n fill: \"#F9F9F9\"\n}), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M37.6631 30.563H56.7001V61.431H37.6631V30.563Z\",\n fill: \"#EFEFEF\"\n}), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M37.6639 35.309H17.5459V25.066H37.6639L51.2639 30.188L37.6639 35.309Z\",\n fill: \"#FFE48D\"\n}), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M37.6638 25.066H57.7818V35.309H37.6638V25.066Z\",\n fill: \"#FFDD55\"\n}), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M21.1001 37.783H31.0691V47.752H21.1001V37.783Z\",\n fill: \"#EFEFEF\"\n}), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M44.2571 37.783H54.2261V47.752H44.2571V37.783Z\",\n fill: \"#DFDFE5\"\n}), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M32.6799 37.783H42.6489V47.752H32.6799V37.783Z\",\n fill: \"#FFE2EB\"\n}), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M21.1001 48.988H31.0691V58.957H21.1001V48.988Z\",\n fill: \"#EFEFEF\"\n}), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M44.2571 48.988H54.2261V58.957H44.2571V48.988Z\",\n fill: \"#DFDFE5\"\n}), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M37.6619 47.752H32.6799V37.783H37.6639L41.0329 42.767L37.6619 47.752Z\",\n fill: \"#EFEFEF\"\n}), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M37.665 37.783H42.649V47.752H37.665V37.783Z\",\n fill: \"#DFDFE5\"\n}), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M37.663 58.957H32.678V48.988H37.662L41.031 53.972L37.663 58.957Z\",\n fill: \"#EFEFEF\"\n}), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M37.6631 48.988H42.6471V58.957H37.6631V48.988Z\",\n fill: \"#DFDFE5\"\n}), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M39.5839 50.926L37.6629 45.741L37.0309 45.109C36.2146 44.308 35.1151 43.8616 33.9714 43.867C32.8277 43.8724 31.7324 44.3291 30.9237 45.1378C30.115 45.9465 29.6583 47.0418 29.6529 48.1855C29.6475 49.3292 30.0939 50.4287 30.8949 51.245L31.5269 51.877L37.6629 58.013L39.5839 50.926Z\",\n fill: \"#FF5F96\"\n}), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M44.4318 45.108C43.6181 44.2944 42.5145 43.8373 41.3638 43.8373C40.2131 43.8373 39.1095 44.2944 38.2958 45.108L37.6638 45.74V58.017L43.8008 51.881L44.4328 51.249C44.8364 50.8459 45.1565 50.3673 45.3749 49.8404C45.5933 49.3135 45.7056 48.7487 45.7055 48.1783C45.7054 47.6079 45.5929 47.0432 45.3743 46.5164C45.1558 45.9895 44.8355 45.5109 44.4318 45.108V45.108Z\",\n fill: \"#D72878\"\n}), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M30.686 21.613H33.686V28.513H30.686V21.613Z\",\n fill: \"#606074\"\n}), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M25.2141 21.613H28.2141V28.513H25.2141V21.613Z\",\n fill: \"#606074\"\n}), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M19.74 21.613H22.74V28.513H19.74V21.613Z\",\n fill: \"#606074\"\n}), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M41.637 21.613H44.637V28.513H41.637V21.613Z\",\n fill: \"#454553\"\n}), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M47.1111 21.613H50.1111V28.513H47.1111V21.613Z\",\n fill: \"#454553\"\n}), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M52.584 21.613H55.584V28.513H52.584V21.613Z\",\n fill: \"#454553\"\n}), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M37.6631 28.518H36.1631V21.618H37.6631L38.6771 25.07L37.6631 28.518Z\",\n fill: \"#606074\"\n}), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M37.666 21.613H39.166V28.513H37.666V21.613Z\",\n fill: \"#454553\"\n}));\n\nvar _ref3 = /*#__PURE__*/React.createElement(\"defs\", null, /*#__PURE__*/React.createElement(\"clipPath\", {\n id: \"clip0_5867_1078\"\n}, /*#__PURE__*/React.createElement(\"rect\", {\n width: 75.001,\n height: 75,\n fill: \"white\"\n})));\n\nfunction SvgIconColoredCalendar(_ref, svgRef) {\n var title = _ref.title,\n titleId = _ref.titleId,\n props = _objectWithoutProperties(_ref, [\"title\", \"titleId\"]);\n\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n width: 75,\n height: 75,\n viewBox: \"0 0 75 75\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, _ref2, _ref3);\n}\n\nvar ForwardRef = /*#__PURE__*/React.forwardRef(SvgIconColoredCalendar);\nexport default __webpack_public_path__ + \"static/media/Icon-coloredCalendar.95678941.svg\";\nexport { ForwardRef as ReactComponent };","import React from 'react';\nimport {\n CardBox,\n TypographyContainer,\n IconContainer,\n TimerContainer,\n TitleContainer,\n} from './styles';\nimport Typography from '@material-ui/core/Typography';\nimport { ReactComponent as CalendarIcon } from '../../assets/Icon-coloredCalendar.svg';\nimport { format } from 'date-fns';\nimport { EventSubCategoryModel } from '@cuidador/database';\n\ninterface CardProps {\n id: number;\n subCategory?: EventSubCategoryModel;\n name?: string;\n eventHappensAt?: string;\n description?: string;\n}\n\nconst AppointmentCard: React.FC = ({\n id,\n subCategory,\n name,\n description,\n eventHappensAt,\n}) => {\n const formattedDate = format(new Date(`${eventHappensAt}`), 'dd/MM/yyyy');\n const formattedHour = format(new Date(`${eventHappensAt}`), 'HH:mm');\n\n return (\n \n \n \n {formattedHour}\n \n \n \n \n \n {subCategory?.name}\n \n {name?.trim()}\n {formattedDate}\n {description}\n \n \n );\n};\n\nexport default AppointmentCard;\n","import React from 'react';\nimport { Link, LinkProps } from 'react-router-dom';\nimport Button, { ButtonProps } from '@material-ui/core/Button';\nimport { LocationDescriptor } from 'history';\n\nexport interface ButtonLinkProps extends ButtonProps {\n to: LocationDescriptor;\n}\n\nconst LinkForwardRef = React.forwardRef(\n (props, ref) => \n);\nLinkForwardRef.displayName = 'LinkForwardRef';\n\nconst ButtonLink: React.FC = ({\n children,\n variant = 'outlined',\n ...rest\n}) => (\n // eslint-disable-next-line\n // @ts-ignore: see https://github.com/mui-org/material-ui/issues/7877\n \n);\n\nexport default ButtonLink;\n","import MuiFab from '@material-ui/core/Fab';\nimport styled from 'styled-components';\n\nexport const StyledFab = styled(MuiFab)`\n position: fixed;\n bottom: ${({ theme }) => theme.spacing(2)}px;\n right: ${({ theme }) => theme.spacing(2)}px;\n background-color: ${({ theme }) => theme.palette.background.default};\n color: ${({ theme }) => theme.palette.secondary.main};\n border: solid 1px ${({ theme }) => theme.palette.secondary.main};\n svg {\n font-size: ${({ theme }) => theme.typography.h2.fontSize};\n }\n`;\n","import React from 'react';\nimport { FabProps as MuiFabProps } from '@material-ui/core/Fab';\n\nimport ButtonLink, { ButtonLinkProps } from '../ButtonLink';\nimport { StyledFab } from './styles';\n\ntype FabProps = MuiFabProps & ButtonLinkProps;\n\nconst ButtonLinkForwardRef = React.forwardRef<\n HTMLAnchorElement,\n ButtonLinkProps\n>((props, ref) => );\nButtonLinkForwardRef.displayName = 'ButtonLinkForwardRef';\n\nconst Fab: React.FC = ({ children, ...rest }) => (\n // eslint-disable-next-line\n // @ts-ignore: see https://github.com/mui-org/material-ui/issues/7877\n \n {children}\n \n);\n\nexport default Fab;\n","import { Button } from '@material-ui/core';\nimport styled from 'styled-components';\n\nexport const ReportButtonContainer = styled.div`\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n width: 100%;\n border-bottom: 1px solid;\n border-top: 1px solid;\n border-color: ${({ theme }) => theme.palette.primary.main};\n padding: ${({ theme }) => theme.spacing(0, 0, 2, 0)};\n margin-bottom: ${({ theme }) => theme.spacing(1)}px;\n`;\n\nexport const StyledButton = styled(Button)`\n width: 100%;\n background-color: ${({ theme }) => theme.palette.primary.main};\n color: ${({ theme }) => theme.palette.common.white};\n margin: ${({ theme }) => theme.spacing(1.5, 2)};\n :hover {\n background-color: ${({ theme }) => theme.palette.primary.main};\n color: ${({ theme }) => theme.palette.common.white};\n }\n`;\n\nexport const DownloadLink = styled.a`\n width: 100%;\n color: ${({ theme }) => theme.palette.secondary.main};\n padding: ${({ theme }) => theme.spacing(1.5, 2)};\n margin: ${({ theme }) => theme.spacing(0, 2)};\n margin-top: ${({ theme }) => theme.spacing(1.5)}px;\n :hover {\n color: ${({ theme }) => theme.palette.secondary.main};\n }\n border-radius: ${({ theme }) => theme.spacing(1)}px;\n font-size: 0.875rem;\n font-weight: 500;\n text-align: center;\n display: flex;\n flex-direction: row;\n justify-content: center;\n align-items: center;\n svg {\n margin: 0 ${({ theme }) => theme.spacing(1)}px;\n }\n`;\n","import Typography from '@material-ui/core/Typography';\nimport { CloudDownload } from '@material-ui/icons';\nimport React from 'react';\nimport { DownloadLink, ReportButtonContainer, StyledButton } from './styles';\n\nconst ReportDownloadButton: React.FC<{\n onGenerateReportClick: () => Promise;\n downloadtitle: string;\n createTitle: string;\n downloadLink: string;\n}> = ({ onGenerateReportClick, downloadtitle, createTitle, downloadLink }) => {\n return (\n \n {downloadLink ? (\n \n \n {downloadtitle}\n \n ) : (\n <>\n \n {createTitle}\n \n \n Quando o relatório estiver pronto, o botão acima será substituído\n pelo link para baixar o arquivo.\n \n \n )}\n \n );\n};\n\nexport default ReportDownloadButton;\n","import {\n Backdrop as MaterialBackdrop,\n CircularProgress as MaterialCircularProgress,\n} from '@material-ui/core';\nimport Tab from '@material-ui/core/Tab';\nimport Typography from '@material-ui/core/Typography';\nimport { Link } from 'react-router-dom';\nimport styled from 'styled-components';\nimport Fab from '../../components/Fab';\n\nexport const Container = styled.div`\n display: flex;\n flex-direction: column;\n flex: 1;\n align-items: center;\n background-color: #fafafa;\n padding: ${({ theme }) => theme.spacing(2, 2)};\n`;\n\nexport const ButtonContainer = styled.div`\n display: flex;\n flex-direction: row;\n justify-content: center;\n align-items: center;\n width: 100%;\n border-bottom: 1px solid;\n border-color: ${({ theme }) => theme.palette.primary.main};\n padding: ${({ theme }) => theme.spacing(0, 0, 2, 0)};\n`;\n\nexport const StyledTabItem = styled(Tab)`\n width: 120px;\n color: ${({ theme }) => theme.palette.primary.main};\n font-size: 16px;\n font-weight: 400;\n border-radius: 5px 5px 0 0;\n`;\n\nexport const Backdrop = styled(MaterialBackdrop)`\n z-index: ${({ theme }) => theme.zIndex.drawer + 1};\n color: ${({ theme }) => theme.palette.primary.light};\n`;\n\nexport const BackdropCircularProgress = styled(MaterialCircularProgress).attrs({\n color: 'inherit',\n})``;\n\nexport const StyledLink = styled(Link)`\n text-decoration: none;\n width: 100%;\n display: flex;\n margin-top: ${({ theme }) => theme.spacing(2)}px;\n`;\n\nexport const StyledFab = styled(Fab)`\n bottom: ${({ theme }) => theme.spacing(8)}px;\n right: ${({ theme }) => theme.spacing(2)}px;\n margin-bottom: ${({ theme }) => theme.spacing(2)}px;\n`;\n\nexport const TypographyContainer = styled.div`\n width: 100%;\n text-align: center;\n color: ${({ theme }) => theme.palette.primary.main};\n`;\n\nexport const StyledTypography = styled(Typography)`\n color: ${({ theme }) => theme.palette.primary.dark};\n`;\n","import { EventModel } from '@cuidador/database';\nimport Typography from '@material-ui/core/Typography';\nimport AddIcon from '@material-ui/icons/AddRounded';\nimport React, { useContext, useEffect, useState } from 'react';\nimport { useHistory } from 'react-router-dom';\nimport { toast } from 'react-toastify';\nimport AppointmentCard from '../../components/AppointmentCard';\nimport Fab from '../../components/Fab';\nimport PendingRegistrationBanner from '../../components/PendingRegistrationBanner';\nimport ReportDownloadButton from '../../components/ReportDownloadButton';\nimport { AuthContext } from '../../contexts/auth';\nimport useAppointment from '../../hooks/useAppointment';\nimport useCanAccess from '../../hooks/useCanAccess';\nimport { Item } from '../../utils/store';\nimport {\n Backdrop,\n BackdropCircularProgress,\n Container,\n StyledLink,\n StyledTypography,\n TypographyContainer,\n} from './styles';\nimport { Header } from '../../components/Header'\nimport { PageTitle } from '../../components/PageTitle'\nimport { BackButton } from '../../components/BackButton'\nimport { PscButton } from '../../components/PscButton'\n\nconst AppointmentCardItem: React.FC<{\n appointment: Item;\n}> = ({ appointment }) => {\n return (\n \n \n \n );\n};\n\nconst Appointments: React.FC = () => {\n const { userInfo } = useContext(AuthContext);\n const {\n getAllByPatientId,\n byId,\n ids: eventsIds,\n loading,\n createReportByPatientId,\n getReportDownloadLinkByPatientId,\n } = useAppointment();\n const {\n isAllowedToRead: isAllowedToReadAppointment,\n isAllowedToCreate: isAllowedToCreateAppointment,\n } = useCanAccess('care/event/appointment');\n\n const {\n isAllowedToCreate: isAllowedToCreateAppointmentReport,\n } = useCanAccess('report/appointment');\n\n const { isAllowedToRead: isAllowedToReadAppointmentReport } = useCanAccess(\n 'media/patient/report/appointment'\n );\n\n const history = useHistory();\n\n const [downloadLink, setDownloadLink] = useState('');\n const patientId = userInfo?.activePatientId;\n\n useEffect(() => {\n if (!isAllowedToReadAppointment) {\n toast.error('Você não tem permissão para visualizar essa página');\n history.goBack();\n return;\n }\n\n if (!patientId) return;\n getAllByPatientId(patientId);\n }, [patientId]);\n\n const handleCreateReportAndGetDownloadLink = async () => {\n createAppointmentReport()\n .then(() => getAppointReportDownloadUrl())\n .then((signedUrl) => setDownloadLink(signedUrl));\n };\n\n const createAppointmentReport = async () => {\n try {\n await createReportByPatientId(Number(userInfo?.activePatientId));\n toast.success('Relátorio de compromissos gerado com sucesso');\n } catch (err) {\n toast.error('Erro ao gerar relatório de compromissos');\n }\n };\n\n const getAppointReportDownloadUrl = async (): Promise => {\n try {\n const { signedUrl } = await getReportDownloadLinkByPatientId(\n Number(userInfo?.activePatientId)\n );\n return signedUrl;\n } catch (err) {\n toast.error('Erro ao baixar relatório de compromissos');\n return '';\n }\n };\n\n return (\n <>\n \n }\n centerContent={\n \n }\n rightContent={}\n />\n \n {loading ? (\n \n {loading && (\n \n )}\n \n ) : (\n \n {eventsIds.length <= 0 ? (\n \n \n Não há compromissos cadastrados.\n \n \n Agende aqui os compromissos da pessoa sob cuidado.\n \n \n ) : (\n <>\n \n Lista de compromissos\n \n {isAllowedToReadAppointmentReport &&\n isAllowedToCreateAppointmentReport && (\n \n )}\n\n {eventsIds\n .map((id) => byId[id])\n .map((appointment) => (\n \n ))}\n \n )}\n {isAllowedToCreateAppointment && (\n \n \n \n )}\n \n )}\n \n );\n};\n\nexport default Appointments;\n","import { useCallback, useReducer } from 'react';\nimport axios from '../config/axios';\nimport { EventModel } from '@cuidador/database';\nimport {\n createReducer,\n ReducerData,\n Item,\n PaginatedRequestParams,\n} from '../utils/store/index';\n\nconst endpoint = '/care/event/category';\n\nconst initialData: ReducerData = {\n byId: {} as Record>,\n ids: [] as Array,\n total: 0,\n loading: false,\n error: null,\n};\n\nconst useSubCategory = () => {\n const [state, dispatch] = useReducer(\n createReducer(),\n initialData\n );\n\n const getAll = useCallback(async () => {\n try {\n dispatch({ type: 'LOADING' });\n const response = await axios.get(`${endpoint}/sub`);\n dispatch({ type: 'GET_ALL', payload: response.data });\n } catch (err) {\n dispatch({ type: 'ERROR', payload: err });\n }\n }, []);\n\n const getOnlyForRoutines = useCallback(async () => {\n try {\n dispatch({ type: 'LOADING' });\n const response = await axios.get(\n `${endpoint}/sub?isRoutine=1&orderBy=eventSubCategory.name&order=asc`\n );\n dispatch({ type: 'GET_ALL', payload: response.data });\n } catch (err) {\n dispatch({ type: 'ERROR', payload: err });\n }\n }, []);\n\n const getOnlyForAppointments = useCallback(async () => {\n try {\n dispatch({ type: 'LOADING' });\n const response = await axios.get(\n `${endpoint}/sub?isAppointment=1&orderBy=eventSubCategory.name&order=asc`\n );\n dispatch({ type: 'GET_ALL', payload: response.data });\n } catch (err) {\n dispatch({ type: 'ERROR', payload: err });\n }\n }, []);\n\n const getOnlyForMedication = useCallback(\n async (params: PaginatedRequestParams) => {\n try {\n dispatch({ type: 'LOADING' });\n const response = await axios.get(`${endpoint}/sub`, {\n params: {\n ...params,\n categoryId: 2, // CategoryId 2 = Medication Id\n },\n });\n dispatch({ type: 'PAGINATION', payload: response.data });\n return response.data.results;\n } catch (err) {\n dispatch({ type: 'ERROR', payload: err });\n }\n },\n []\n );\n\n return {\n ...state,\n getAll,\n getOnlyForRoutines,\n getOnlyForAppointments,\n getOnlyForMedication,\n };\n};\n\nexport default useSubCategory;\n","import { FormControl } from '@material-ui/core';\nimport styled from 'styled-components';\n\nimport { colorMapping, ColorsType } from '../../styles/colorMapping';\n\nexport const StyledFormControl = styled(FormControl).attrs(({ variant }) => ({\n variant: variant || 'outlined',\n}))<{\n $color: ColorsType;\n}>`\n & .MuiInputBase-root {\n color: ${({ $color }) => colorMapping[$color]};\n }\n & label:not(.Mui-error) {\n color: ${({ $color }) => colorMapping[$color]};\n }\n & label.Mui-disabled {\n color: ${({ $color }) => colorMapping[$color]};\n opacity: 65%;\n }\n & input:not(.Mui-disabled) {\n color: ${({ $color }) => colorMapping[$color]};\n }\n & textarea:not(.Mui-disabled) {\n color: ${({ $color }) => colorMapping[$color]};\n }\n &\n .MuiInputAdornment-root:not(.Mui-disabled)\n .MuiIconButton-label:not(.Mui-disabled) {\n color: ${({ $color }) => colorMapping[$color]};\n }\n & .MuiOutlinedInput-root:not(.Mui-error, .Mui-disabled) {\n & fieldset {\n border-color: ${({ $color }) => colorMapping[$color]};\n color: ${({ $color }) => colorMapping[$color]};\n }\n &:hover fieldset {\n border-color: ${({ $color }) => colorMapping[$color]};\n color: ${({ $color }) => colorMapping[$color]};\n }\n &.Mui-focused fieldset {\n border-color: ${({ $color }) => colorMapping[$color]};\n color: ${({ $color }) => colorMapping[$color]};\n }\n }\n & .MuiOutlinedInput-root.Mui-disabled {\n color: ${({ $color }) => colorMapping[$color]};\n opacity: 65%;\n cursor: default;\n\n & input:disabled {\n color: ${({ $color }) => colorMapping[$color]};\n }\n\n & fieldset {\n border-color: ${({ $color }) => colorMapping[$color]};\n opacity: 65%;\n }\n }\n\n margin-top: ${({ theme }) => theme.spacing(2)}px;\n margin-bottom: ${({ theme }) => theme.spacing(1)}px;\n`;\n","import React from 'react';\nimport InputLabel from '@material-ui/core/InputLabel';\nimport FormHelperText from '@material-ui/core/FormHelperText';\nimport Select from '@material-ui/core/Select';\nimport { StyledFormControl } from './styles';\nimport { ColorsType } from '../../styles/colorMapping';\n\nexport interface SelectProps {\n name?: string;\n label: string;\n value?: string;\n id: string;\n error?: boolean;\n disabled?: boolean;\n color?: ColorsType;\n size?: 'small';\n formControlVariant?: 'outlined' | 'filled' | 'standard';\n}\n\nconst StyledSelectField: React.FC = ({\n id,\n label,\n children,\n error,\n disabled,\n color = 'primary',\n size,\n formControlVariant = 'outlined',\n ...props\n}) => {\n return (\n \n {label}\n \n {children}\n \n {error && {error}}\n \n );\n};\n\nexport default StyledSelectField;\n","import React from 'react';\nimport { Field, FieldAttributes, useFormikContext } from 'formik';\nimport StyledSelectField from '../StyledSelectField';\nimport { SelectProps } from '@material-ui/core';\n\ninterface MySelectDisplayProps extends React.HTMLAttributes {\n 'data-testid'?: string;\n}\n\nconst FormikSelect = ({\n name,\n required = false,\n formControlVariant,\n ...props\n}: FieldAttributes & // eslint-disable-line @typescript-eslint/no-explicit-any\n SelectProps & {\n name: string;\n required?: boolean;\n SelectDisplayProps?: MySelectDisplayProps;\n formControlVariant?: 'standard' | 'outlined' | 'filled';\n }) => {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const { errors, touched } = useFormikContext();\n\n const hasError = touched[name] && errors[name];\n\n return (\n \n );\n};\n\nexport default FormikSelect;\n","import TextField from '@material-ui/core/TextField';\nimport styled from 'styled-components';\n\nconst StyledTextFieldWhite = styled(TextField).attrs({\n variant: 'outlined',\n})`\n & label:not(.Mui-error) {\n color: ${({ theme }) => theme.palette.common.white};\n }\n & input {\n color: ${({ theme }) => theme.palette.common.white};\n ::-webkit-calendar-picker-indicator {\n filter: invert(1);\n }\n }\n & textarea {\n color: ${({ theme }) => theme.palette.common.white};\n }\n & .MuiInputAdornment-root .MuiIconButton-label {\n color: ${({ theme }) => theme.palette.common.white};\n }\n & .MuiOutlinedInput-root:not(.Mui-error) {\n & fieldset {\n border-color: ${({ theme }) => theme.palette.common.white};\n color: ${({ theme }) => theme.palette.common.white};\n }\n &:hover fieldset {\n border-color: ${({ theme }) => theme.palette.common.white};\n color: ${({ theme }) => theme.palette.common.white};\n }\n &.Mui-focused fieldset {\n border-color: ${({ theme }) => theme.palette.common.white};\n color: ${({ theme }) => theme.palette.common.white};\n }\n }\n`;\n\nexport default StyledTextFieldWhite;\n","import { IconButton, InputAdornment } from '@material-ui/core';\nimport { Visibility, VisibilityOff } from '@material-ui/icons';\nimport React, { useState } from 'react';\nimport StyledTextFieldWhite from '../StyledTextFieldWhite';\n\nconst PasswordTextField: React.FC = (props) => {\n const [showPassword, setShowPassword] = useState(false);\n return (\n \n setShowPassword(!showPassword)}\n >\n {showPassword ? : }\n \n \n ),\n }}\n />\n );\n};\n\nexport default PasswordTextField;\n","import { Typography } from '@material-ui/core';\nimport styled from 'styled-components';\nimport {\n default as FormikSelect,\n default as StyledSelect,\n} from './Forms/FormikSelect';\nimport FormikTextField from './Forms/FormikTextField';\nimport PasswordTextField from './PasswordField';\n\nexport const FormCardContainer = styled.div`\n width: 80%;\n min-height: ${({ theme }) => theme.spacing(10)}px;\n background-color: ${({ theme }) => theme.palette.extra.color.grey.light};\n border-radius: ${({ theme }) => theme.spacing(1)}px;\n padding: ${({ theme }) => theme.spacing(2)}px;\n display: flex;\n align-items: flex-start;\n justify-content: flex-start;\n flex-direction: column;\n margin-bottom: ${({ theme }) => theme.spacing(2)}px;\n`;\n\nexport const StyledBoldTitle = styled(Typography)`\n color: ${({ theme }) => theme.palette.common.black};\n font-weight: bold;\n`;\n\nexport const NewStyledSelect = styled(StyledSelect)`\n background-color: ${({ theme }) => theme.palette.common.white};\n border-radius: ${({ theme }) => theme.spacing(0.7)}px;\n`;\n\ninterface TextFieldInterface {\n disabled?: boolean;\n}\n\nexport const StyledFormikTextField = styled(\n FormikTextField\n)`\n .MuiOutlinedInput-root {\n border-radius: ${({ theme }) => theme.spacing(0.7)}px;\n background-color: ${({ theme }) => theme.palette.common.white};\n }\n\n & .Mui-disabled,\n & label.Mui-disabled,\n & .MuiInputBase-root.Mui-disabled,\n & .MuiOutlinedInput-root.Mui-disabled .MuiOutlinedInput-notchedOutline {\n color: ${({ theme }) => theme.palette.secondary.main};\n border-color: ${({ theme }) => theme.palette.secondary.main};\n opacity: 65%;\n }\n`;\n\nexport const StyledFormikTextPassword = styled(PasswordTextField)`\n .MuiOutlinedInput-root {\n border-radius: ${({ theme }) => theme.spacing(0.7)}px;\n background-color: ${({ theme }) => theme.palette.common.white};\n }\n & label:not(.Mui-error) {\n color: ${({ theme }) => theme.palette.secondary.main};\n }\n & input {\n color: ${({ theme }) => theme.palette.secondary.main};\n ::-webkit-calendar-picker-indicator {\n filter: invert(1);\n }\n }\n & textarea {\n color: ${({ theme }) => theme.palette.secondary.main};\n }\n & .MuiInputAdornment-root .MuiIconButton-label {\n color: ${({ theme }) => theme.palette.secondary.main};\n }\n & .MuiOutlinedInput-root:not(.Mui-error) {\n & fieldset {\n border-color: ${({ theme }) => theme.palette.secondary.main};\n color: ${({ theme }) => theme.palette.secondary.main};\n }\n &:hover fieldset {\n border-color: ${({ theme }) => theme.palette.secondary.main};\n color: ${({ theme }) => theme.palette.secondary.main};\n }\n &.Mui-focused fieldset {\n border-color: ${({ theme }) => theme.palette.secondary.main};\n color: ${({ theme }) => theme.palette.secondary.main};\n }\n }\n`;\n\nexport const StyledFormikSelect = styled(FormikSelect)`\n border-radius: ${({ theme }) => theme.spacing(0.7)}px;\n background-color: ${({ theme }) => theme.palette.common.white};\n`;\n\nexport const HelperContainer = styled.span`\n display: flex;\n flex-direction: column;\n`;\n\nexport const HelperText = styled.span`\n color: ${({ theme }) => theme.palette.common.black};\n`;\n","function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\nimport * as React from \"react\";\n\nvar _ref2 = /*#__PURE__*/React.createElement(\"image\", {\n id: \"Ret\\\\xE2ngulo_1\",\n \"data-name\": \"Ret\\\\xE2ngulo 1\",\n width: 85,\n height: 90,\n xlinkHref: \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAgAAAAIACAYAAAD0eNT6AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEwAACxMBAJqcGAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAACAASURBVHic7N15nBxnfSbw533f6mtOHaN7dIxb9oyxPT4w2FxGXErAGOMs4cgSQyAhsAlJCIGw2SQbFhIS2HCEQBKIk9gbUDhCIOIUhxVsEsxhG/lQy/a4Laul0TWas6ePqnrf/WNGtiRrZnq6q/rtqn6+n48RkqarHkk9/f7qPYUxBkQUP7v37F0BYAjARgAb5v/beM6PvQCOARgFcOScH0////tv2LnDa3Z+IgqXYAFAFB+79+zdDOBGAK8E8HwATgCXHQfwNQBfBvDNG3buKAZwTSKyjAUAUcTt3rP3Usw1+K8E8PSQb1cG8B3MFQO7b9i543jI9yOikLAAIIqg3Xv2pgD8JoC3AchaiqEB/ADAn96wc8e3LGUgojqxACCKkN179koArwfwPgBbLMc503cBvPuGnTvuth2EiGrDAoAoInbv2fvzAP4CwLDtLAswAHYB+MMbdu7I2w5DRItjAUDU4nbv2Xs1gA8CeIHtLDWqAvgkgPffsHPHmO0wRHR+LACIWtTuPXsdAB/G3Fi/sBynHpMAbr5h545/tx2EiJ5K2g5ARE+1e8/elQC+AeDtiG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ZGBGACIiIgMxABARERkIAYAIiIiAzEAEBERGYgBgIiIyEAMAERERAZiACAiIjIQAwAREZGBGACIiIgMxABARERkIAYAIiIiAzEAEBERGYgBgIiIyEAMAERERAZiACAiIjIQAwAREZGBGACIiIgMxABARERkIAYAIiIiAzEAEBERGYgBgIiIyEAMAERERAZiACAiIjIQAwAREZGBGACIiIgMxABARERkIAYAIiIiAzEAEBERGYgBgIiIyEAMAERERAZiACAiIjIQAwAREZGBGACIiIgMxABARERkIAYAIiIiAzEAEBERGYgBgIiIyEAMAM3KepHuEoiICLBcu6K7hiRiAGhWKTequwQiIgKsvHdMdw1JxADQJJHLHNVdAxERATLv/kh3DUnEANAs3/2p7hKIiEwnBCAz7rd115FEDADN8r2vor/AcSciIo2ym4ov5fbfO6u7jiRiAGiS/MihebFt6IOw+BISEeng+Hbkbipfp7uOpOLdqwXyY3c/JXZuelJ3HUREphECyO0avI1P/81jAGhVOfdesWfLk+wJICLqDsuRqrh36N78l+5/UHctSWbrLiDp5EcORQDeEz1y8F3qpZF/wsRMTndNRERp5Q9kz2e29b85d+DwCd21JB0DQJvIj939VPTEoQHM1f4Gc/W3qsr8XkxVBlGtsWuAiKhJtmspJ+9WrLx30ipmfli4+4G7ddeUFv8PwhaT+YGKFbYAAAAASUVORK5CYII=\"\n});\n\nfunction SvgElderlyIcon(_ref, svgRef) {\n var title = _ref.title,\n titleId = _ref.titleId,\n props = _objectWithoutProperties(_ref, [\"title\", \"titleId\"]);\n\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n xmlns: \"http://www.w3.org/2000/svg\",\n xmlnsXlink: \"http://www.w3.org/1999/xlink\",\n width: 75,\n height: 90,\n viewBox: \"0 0 75 75\",\n fill: \"url(#pattern0)\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, _ref2);\n}\n\nvar ForwardRef = /*#__PURE__*/React.forwardRef(SvgElderlyIcon);\nexport default __webpack_public_path__ + \"static/media/elderlyIcon.da1af734.svg\";\nexport { ForwardRef as ReactComponent };","import { Typography } from '@material-ui/core';\nimport styled from 'styled-components';\n\nexport const BalloonContainer = styled.div<{ alignItems?: string }>`\n width: 100%;\n min-height: ${({ theme }) => theme.spacing(15)}px;\n display: flex;\n align-items: ${(props) => props.alignItems || 'center'};\n justify-content: center;\n flex-direction: row;\n`;\n\nexport const Balloon = styled.div`\n max-width: ${({ theme }) => theme.spacing(25)}px;\n min-height: ${({ theme }) => theme.spacing(11)}px;\n background-color: ${({ theme }) => theme.palette.extra.color.grey.light};\n border-radius: ${({ theme }) => theme.spacing(1)}px;\n display: flex;\n align-items: center;\n justify-content: center;\n padding: ${({ theme }) => theme.spacing(1.5)}px;\n word-break: break-word;\n margin-bottom: 10px;\n`;\n\nexport const Balloons = styled.div`\n flex-direction: column;\n`;\n\nexport const PointBalloon = styled.div<{ marginTop?: string }>`\n width: 0;\n height: 0;\n border-top: ${({ theme }) => theme.spacing(1)}px solid transparent;\n border-bottom: ${({ theme }) => theme.spacing(1)}px solid transparent;\n border-right: ${({ theme }) => theme.spacing(1)}px solid\n ${({ theme }) => theme.palette.extra.color.grey.light};\n margin-left: ${({ theme }) => theme.spacing(2)}px;\n margin-top: ${(props) => props.marginTop || '0'};\n`;\n\nexport const StyledText = styled(Typography)`\n color: ${({ theme }) => theme.palette.common.black};\n line-height: 1.2;\n white-space: pre-wrap;\n`;\n","import React from 'react';\nimport { ReactComponent as ElderlyIcon } from '../../assets/elderlyIcon.svg';\nimport {\n Balloon,\n BalloonContainer,\n Balloons,\n PointBalloon,\n StyledText,\n} from './styles';\n\ninterface Props {\n text?: string | string[];\n}\n\nconst MedicBalloon: React.FC = ({ text, children }) => {\n const isTextArray = Array.isArray(text);\n const balloonContainerAlignItems = isTextArray ? 'flex-start' : 'center';\n const pointBalloonMarginTop = isTextArray ? '35px' : '0';\n\n return (\n \n \n \n \n {Array.isArray(text) ? (\n text.map((t) => (\n \n {t}\n \n ))\n ) : (\n \n {text}\n {children}\n \n )}\n \n \n );\n};\n\nexport default MedicBalloon;\n","import React, { ForwardRefRenderFunction } from 'react';\nimport MuiMenuItem, { MenuItemProps } from '@material-ui/core/MenuItem';\nimport styled from 'styled-components';\n\nimport { ColorsType, colorMapping } from '../styles/colorMapping';\n\ntype StyledMenuItemProps = {\n color?: ColorsType;\n} & MenuItemProps;\n\nconst MenuItem = styled(MuiMenuItem)<{\n $color: ColorsType;\n}>`\n color: ${({ $color }) => colorMapping[$color]};\n` as React.FC<{\n $color: ColorsType;\n}>;\n\nconst StyledMenuItem: ForwardRefRenderFunction = (\n { color = 'primary', children, ...rest },\n ref\n) => (\n \n {children}\n \n);\n\nexport default React.forwardRef(StyledMenuItem);\n","import {\n Backdrop as MaterialBackdrop,\n CircularProgress as MaterialCircularProgress,\n} from '@material-ui/core';\nimport { Form as FormikForm } from 'formik';\nimport { Link } from 'react-router-dom';\nimport styled from 'styled-components';\n\nexport const Form = styled(FormikForm)`\n display: flex;\n flex: 1;\n flex-direction: column;\n width: 100%;\n color: ${({ theme }) => theme.palette.secondary.main};\n`;\n\nexport const TypographyContainer = styled.div`\n max-width: 100%;\n text-align: center;\n`;\n\nexport const StyledLink = styled(Link)`\n text-decoration: none;\n`;\n\nexport const Centralizer = styled.div`\n align-items: center;\n flex-direction: column;\n display: flex;\n flex: 1;\n justify-content: flex-end;\n`;\n\nexport const Backdrop = styled(MaterialBackdrop)`\n z-index: ${({ theme }) => theme.zIndex.drawer + 1};\n color: ${({ theme }) => theme.palette.primary.light};\n position: absolute;\n`;\n\nexport const BackdropCircularProgress = styled(MaterialCircularProgress).attrs({\n color: 'inherit',\n})``;\n\nexport const ContentContainer = styled.div`\n margin-top: ${({ theme }) => theme.spacing(3)}px;\n width: 100%;\n display: flex;\n align-items: center;\n flex-direction: column;\n`;\n","import { EventModel } from '@cuidador/database';\nimport { format, parse } from 'date-fns';\nimport { Formik, FormikHelpers, FormikProps } from 'formik';\nimport isEqual from 'lodash/isEqual';\nimport React, { useEffect } from 'react';\nimport * as Yup from 'yup';\nimport useSubCategory from '../../hooks/useSubCategory';\nimport {\n FormCardContainer,\n HelperContainer,\n HelperText,\n NewStyledSelect as StyledSelect,\n StyledBoldTitle,\n StyledFormikTextField as FormikTextField,\n} from '../FormCardContainer';\nimport MedicBalloon from '../MedicBalloon';\nimport StyledButton from '../StyledButton';\nimport StyledMenuItem from '../StyledMenuItem';\nimport {\n Backdrop,\n BackdropCircularProgress,\n Centralizer,\n ContentContainer,\n Form,\n} from './styles';\n\nexport interface FormValues {\n name?: string;\n description?: string;\n subCategoryId?: number;\n date?: string;\n time?: string;\n startDate?: string;\n}\n\nexport const appointmentModelToFormData = (data: EventModel) => {\n let formattedDate;\n let formattedTime;\n\n if (data.eventHappensAt) {\n formattedDate = format(new Date(data.eventHappensAt), 'yyyy-MM-dd');\n formattedTime = format(new Date(data.eventHappensAt), 'HH:mm');\n }\n\n const startDate = format(new Date(), 'yyyy-MM-dd');\n\n return {\n name: data.name ? data.name.trim() : '',\n description: data.description || '',\n subCategoryId: data.subCategoryId || '',\n time: formattedTime || '',\n date: formattedDate || '',\n startDate: startDate || '',\n } as FormValues;\n};\n\nexport const formDataToAppointmentModel = (\n data: FormValues,\n patientId: number\n) => {\n const isoDate = parse(\n `${data.date} ${data.time}`,\n 'yyyy-MM-dd HH:mm',\n new Date()\n ).toISOString();\n\n return {\n name: data.name ? data.name.trim() : '',\n description: data.description || '',\n subCategoryId: data.subCategoryId || '',\n eventHappensAt: isoDate || '',\n patientId: patientId || '',\n } as FormValues;\n};\n\nconst validationSchema = Yup.object().shape({\n name: Yup.string().required('Por favor, insira um nome.'),\n subCategoryId: Yup.string().required(\n 'Por favor, insira o tipo do compromisso.'\n ),\n date: Yup.string().required('Por favor, insira a data.'),\n time: Yup.string().required('Por favor, insira a hora.'),\n description: Yup.string().max(2000, 'Deve conter no máximo 2000 caracteres.'),\n});\n\nconst AppointmentsUpsertForm: React.FC<{\n initialValues: FormValues;\n innerRef?: React.Ref>;\n onSubmit: (\n values: FormValues,\n formikHelpers: FormikHelpers\n ) => void | Promise;\n disabled?: boolean;\n}> = ({ initialValues, innerRef, onSubmit, disabled }) => {\n const { getOnlyForAppointments, ids, byId, loading } = useSubCategory();\n\n useEffect(() => {\n getOnlyForAppointments();\n }, []);\n\n if (loading) {\n return (\n \n {loading && (\n \n )}\n \n );\n }\n\n const finalDate = format(new Date('12/31/9999'), 'yyyy-MM-dd');\n\n return (\n \n {({ values, isSubmitting, errors, touched }) => {\n return (\n \n \n \n \n \n Selecione o tipo do compromisso e dê um nome para ele\n \n\n \n {ids\n .map((id) => byId[id])\n .map((item) => (\n \n {item.name}\n \n ))}\n \n\n \n \n Exemplo: Dentista, Fisioterapeuta, etc.\n \n {touched.name && errors.name}\n \n }\n />\n \n \n \n Coloque a data e hora\n \n \n \n \n \n \n Instruções (Opcional)\n \n\n \n \n\n \n \n Salvar\n \n \n \n \n );\n }}\n \n );\n};\n\nexport default AppointmentsUpsertForm;\n","import styled from 'styled-components';\n\nexport const Container = styled.div`\n display: flex;\n flex: 1;\n background-color: ${({ theme }) => theme.palette.common.white};\n padding-top: ${({ theme }) => theme.spacing(2)}px;\n padding-bottom: ${({ theme }) => theme.spacing(2)}px;\n display: flex;\n flex-direction: column;\n color: ${({ theme }) => theme.palette.secondary.main};\n`;\n","import { APIError } from '@cuidador/lib';\nimport { AxiosError } from 'axios';\nimport { format } from 'date-fns';\nimport React, { useContext, useEffect } from 'react';\nimport { useHistory } from 'react-router-dom';\nimport { toast } from 'react-toastify';\nimport AppointmentsUpsertForm, {\n formDataToAppointmentModel,\n FormValues,\n} from '../../../components/AppointmentsUpsertForm';\nimport { AuthContext } from '../../../contexts/auth';\nimport useAppointment from '../../../hooks/useAppointment';\nimport useCanAccess from '../../../hooks/useCanAccess';\nimport { resolveErrorMessage } from '../../../utils/error';\nimport { Container } from './styles';\nimport { Header } from '../../../components/Header'\nimport { PageTitle } from '../../../components/PageTitle'\nimport { BackButton } from '../../../components/BackButton'\nimport { PscButton } from '../../../components/PscButton'\n\nconst startDate = format(new Date(), 'yyyy-MM-dd');\n\nconst formInitialValue = {\n name: '',\n description: '',\n subCategoryId: undefined,\n date: '',\n time: '',\n startDate: startDate,\n};\n\nconst AppointmentsInsert: React.FC = () => {\n const { isAllowedToCreate } = useCanAccess('care/event/appointment');\n const history = useHistory();\n\n const { userInfo } = useContext(AuthContext);\n const patientId = userInfo?.activePatientId;\n\n const { post } = useAppointment();\n\n const handleSubmit = (values: FormValues) => {\n return post(formDataToAppointmentModel(values, patientId!))\n .then(() => {\n history.replace('/agendar/compromisso');\n })\n .catch((err: AxiosError) => {\n const displayMessage = resolveErrorMessage(err);\n toast.error(displayMessage);\n });\n };\n\n useEffect(() => {\n if (!isAllowedToCreate) {\n toast.error('Você não tem permissão para visualizar essa página');\n history.goBack();\n }\n }, []);\n\n return (\n <>\n \n }\n centerContent={\n \n }\n rightContent={\n \n }\n />\n \n \n \n \n );\n};\n\nexport default AppointmentsInsert;\n","import styled from 'styled-components';\n\nexport const DialogSubtitle = styled.label`\n display: flex;\n width: 100%;\n align-self: center;\n text-align: center;\n`;\n","import Dialog from '@material-ui/core/Dialog';\nimport styled from 'styled-components';\n\nexport const StyledMuiDialog = styled(Dialog)`\n & .MuiPaper-root {\n margin: ${({ theme }) => theme.spacing(2)}px;\n background-color: ${({ theme }) => theme.palette.primary.main};\n border-radius: 21px;\n min-width: 300px;\n color: ${({ theme }) => theme.palette.common.white};\n max-width: 100%;\n }\n & .MuiDialogActions-root {\n justify-content: center;\n padding: ${({ theme }) => theme.spacing(2, 3)};\n }\n & .MuiDialogTitle-root {\n text-align: center;\n }\n & .MuiTypography-colorTextSecondary {\n color: ${({ theme }) => theme.palette.common.white};\n }\n & .MuiDialogTitle-root {\n z-index: 5;\n }\n & .MuiDialogContent-root {\n z-index: 5;\n }\n\n .MuiDialogContent-root {\n ::-webkit-scrollbar {\n width: 8px;\n }\n ::-webkit-scrollbar-track {\n box-shadow: inset 0 0 5px ${({ theme }) => theme.palette.secondary.dark};\n margin-block: 5px;\n }\n ::-webkit-scrollbar-thumb {\n background-color: ${({ theme }) => theme.palette.common.white};\n border-radius: 10px;\n\n &:hover {\n background-color: ${({ theme }) => theme.palette.grey[300]};\n }\n }\n }\n`;\n\nexport const StyledElipseBlueTop = styled.img`\n width: 250px;\n height: 250px;\n top: -190px;\n right: 30px;\n position: absolute;\n z-index: 2;\n`;\n\nexport const StyledElipseGreenTop = styled.img`\n width: 250px;\n height: 250px;\n top: -150px;\n right: -100px;\n position: absolute;\n z-index: 1;\n`;\n\nexport const StyledElipseBlueBot = styled.img`\n width: 250px;\n height: 250px;\n bottom: -150px;\n left: -120px;\n position: absolute;\n z-index: 2;\n`;\n\nexport const StyledElipseGreenBot = styled.img`\n width: 250px;\n height: 250px;\n bottom: -180px;\n left: 20px;\n position: absolute;\n z-index: 1;\n`;\n\nexport const StyledDiv = styled.div`\n position: absolute;\n width: 100%;\n height: 100%;\n overflow: hidden;\n // [TODO]: change to the right images if necessary\n filter: brightness(0.1) opacity(0.1);\n`;\n","import React from 'react';\nimport { DialogProps } from '@material-ui/core/Dialog';\n\nimport elipseBlue from '../../assets/Elipseblue.svg';\nimport elipseGreen from '../../assets/Elipsegreen.svg';\n\nimport {\n StyledMuiDialog,\n StyledElipseBlueTop,\n StyledElipseGreenTop,\n StyledElipseBlueBot,\n StyledElipseGreenBot,\n StyledDiv,\n} from './styles';\n\nconst StyledDialog: React.FC = ({ children, ...dialogProps }) => {\n return (\n \n \n \n \n \n \n \n {children}\n \n );\n};\n\nexport default StyledDialog;\n","import React from 'react';\nimport { DialogActions, DialogContent, DialogTitle } from '@material-ui/core';\nimport { DialogSubtitle } from './styles';\n\nimport StyledButton from '../StyledButton';\nimport StyledDialog from '../StyledDialog';\n\nexport type DialogProps = {\n open: boolean;\n handleNo: () => void;\n handleYes: () => void;\n title: string;\n subTitle: string;\n disabled?: boolean\n};\n\nconst StyledSimpleDialog: React.FC = ({\n open,\n handleNo,\n handleYes,\n title,\n subTitle,\n disabled,\n}) => {\n return (\n \n \n {title}\n {subTitle}\n \n \n Não\n \n \n Sim\n \n \n \n \n );\n};\n\nexport default StyledSimpleDialog;\n","import styled from 'styled-components';\n\nexport const Container = styled.div`\n display: flex;\n flex: 1;\n background-color: ${({ theme }) => theme.palette.common.white};\n padding-top: ${({ theme }) => theme.spacing(2)}px;\n padding-bottom: ${({ theme }) => theme.spacing(2)}px;\n display: flex;\n flex-direction: column;\n color: ${({ theme }) => theme.palette.secondary.main};\n`;\n","import { Delete } from '@material-ui/icons'\nimport { StyledIconButton } from '../StyledIconButton'\nimport React from 'react'\n\nexport type RemoveButtonProps = {\n action: () => void\n}\n\nexport function RemoveButton (props: RemoveButtonProps) {\n const { action } = props\n\n return (\n \n }\n action={action}\n />\n )\n}\n","import { APIError } from '@cuidador/lib';\nimport { AxiosError } from 'axios';\nimport { FormikProps } from 'formik';\nimport React, { useContext, useEffect, useRef, useState } from 'react';\nimport { useHistory, useParams } from 'react-router-dom';\nimport { toast } from 'react-toastify';\nimport AppointmentsUpsertForm, {\n appointmentModelToFormData,\n formDataToAppointmentModel,\n FormValues,\n} from '../../../components/AppointmentsUpsertForm';\nimport { StyledFieldset } from '../../../components/StyledFieldset';\nimport StyledSimpleDialog from '../../../components/StyledSimpleDialog';\nimport { AuthContext } from '../../../contexts/auth';\nimport useAppointment from '../../../hooks/useAppointment';\nimport useCanAccess from '../../../hooks/useCanAccess';\nimport { resolveErrorMessage } from '../../../utils/error';\nimport { Backdrop, BackdropCircularProgress } from '../styles';\nimport { Container } from './styles';\nimport { Header } from '../../../components/Header'\nimport { PageTitle } from '../../../components/PageTitle'\nimport { BackButton } from '../../../components/BackButton'\nimport { RemoveButton } from '../../../components/RemoveButton'\n\nconst AppointmentsUpdate: React.FC = () => {\n const params = useParams<{ id: string }>();\n const { getById, byId, loading, patch, remove } = useAppointment();\n const [dialogStatus, setDialogStatus] = useState(false);\n const formikRef = useRef | null>(null);\n const history = useHistory();\n const { isAllowedToDelete, isAllowedToUpdate } = useCanAccess(\n 'care/event/appointment'\n );\n const { userInfo } = useContext(AuthContext);\n const patientId = userInfo?.activePatientId;\n\n const id = parseInt(params.id);\n\n useEffect(\n function fetchInitialValues() {\n // If 'id' exists, it's an Update form.\n // Else, it's a creation\n if (id) {\n getById(id);\n }\n },\n [id]\n );\n\n if (loading) {\n return (\n \n {loading && (\n \n )}\n \n );\n }\n\n const appointment = byId[id];\n\n if (!appointment) {\n return null;\n }\n\n const handleSubmit = (values: FormValues) => {\n return patch(id!, formDataToAppointmentModel(values, patientId!))\n .then(() => {\n history.goBack();\n })\n .catch((err: AxiosError) => {\n const displayMessage = resolveErrorMessage(err);\n toast.error(displayMessage);\n });\n };\n\n const handleDelete = (id: number) => {\n setDialogStatus(false);\n remove(id)\n .then(() => {\n history.goBack();\n })\n .catch((err: AxiosError) => {\n const displayMessage = resolveErrorMessage(err);\n toast.error(displayMessage);\n });\n };\n\n return (\n <>\n \n }\n centerContent={\n \n }\n rightContent={\n isAllowedToDelete && (\n setDialogStatus(true)}\n />\n )\n }\n />\n \n \n (formikRef.current = ref)}\n initialValues={appointmentModelToFormData(appointment)}\n onSubmit={handleSubmit}\n disabled={!isAllowedToUpdate}\n />\n \n setDialogStatus(false)}\n handleYes={() => handleDelete(id!)}\n title=\"Excluir Compromisso\"\n subTitle=\"Tem certeza que deseja excluir o Compromisso?\"\n />\n \n \n );\n};\n\nexport default AppointmentsUpdate;\n","export default __webpack_public_path__ + \"static/media/loginBackground.a742a49c.png\";","import { Typography } from '@material-ui/core';\nimport styled from 'styled-components';\nimport BackgroundImage from '../../assets/loginBackground.png';\n\nexport const Background = styled.div`\n background-color: ${({ theme }) => theme.palette.secondary.dark};\n background-image: ${`url(${BackgroundImage})`};\n background-size: cover;\n background-position: center;\n padding: ${({ theme }) => theme.spacing(2)}px;\n display: flex;\n flex: 1;\n flex-direction: column;\n color: ${({ theme }) => theme.palette.common.white};\n`;\n\nexport const Title = styled(Typography).attrs({\n variant: 'h6',\n align: 'center',\n})`\n margin: ${({ theme }) => theme.spacing(2)}px;\n`;\n\nexport const ButtonContainer = styled.div`\n display: flex;\n button,\n a {\n flex: 1;\n margin: ${({ theme }) => theme.spacing(0, 1)};\n }\n`;\n\nexport const SuccessContainer = styled.div`\n flex: 1;\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n button {\n align-self: center;\n }\n`;\n\nexport const GrandparentsContainer = styled.div`\n display: flex;\n justify-content: center;\n align-items: flex-start;\n & img:last-child {\n margin: ${({ theme }) => theme.spacing(4, 0, 0, -1)};\n }\n`;\n","import React, { useContext, useEffect } from 'react';\nimport { toast } from 'react-toastify';\n\nimport { AuthContext } from '../../contexts/auth';\nimport StyledButton from '../../components/StyledButton';\n\nimport { Background, Title, ButtonContainer, SuccessContainer } from './styles';\n\nconst AwaitingReview: React.FC = () => {\n const { signOut, userInfo } = useContext(AuthContext);\n\n useEffect(function redirectIfGuardianIsNotAwaitingReview() {\n if (userInfo?.user?.status !== 'awaitingReview') {\n toast.success(\n 'Você foi ativado no sistema. Faça login novamente para começar a usar.'\n );\n signOut?.();\n }\n }, []);\n\n if (userInfo?.user?.status !== 'awaitingReview') {\n return null;\n }\n\n return (\n \n \n Pessoa sob cuidado cadastrada com sucesso!\n \n Agora, aguarde nosso contato para realização da entrevista e a\n liberação do seu acesso.\n \n\n \n \n Sair\n \n \n \n \n );\n};\n\nexport default AwaitingReview;\n","import styled from 'styled-components';\nimport { Typography } from '@material-ui/core';\nimport { Warning } from '@material-ui/icons';\n\nexport const Container = styled.div`\n display: flex;\n justify-content: center;\n margin: ${({ theme }) => theme.spacing(3)}px;\n`;\n\nexport const CardContainer = styled.div`\n display: flex;\n align-items: center;\n flex-direction: column;\n max-width: 500px;\n`;\n\nexport const CardText = styled(Typography)`\n text-align: center;\n margin-block: ${({ theme }) => theme.spacing(1)}px;\n`;\n\nexport const StyledWarningIcon = styled(Warning)`\n margin-bottom: ${({ theme }) => theme.spacing(3)}px;\n width: 60px;\n height: 60px;\n`;\n","import { DialogContentText } from '@material-ui/core';\nimport { ReportProblemOutlined } from '@material-ui/icons';\nimport styled from 'styled-components';\nimport StyledDialog from '../StyledDialog';\n\nexport const StyledDialogContainer = styled(StyledDialog)`\n .MuiDialogContent-root {\n background-color: ${({ theme }) => theme.palette.primary.main};\n }\n`;\n\nexport const StyledWarningIcon = styled(ReportProblemOutlined)`\n height: 50px;\n width: 50px;\n`;\n\nexport const StyledDialogContentText = styled(DialogContentText)`\n max-width: 380px;\n width: 100%;\n`;\n","import { DialogActions, DialogContent, DialogTitle } from '@material-ui/core';\nimport React from 'react';\nimport StyledButton from '../StyledButton';\nimport {\n StyledDialogContainer,\n StyledDialogContentText,\n StyledWarningIcon,\n} from './styles';\n\ninterface LogoutDialogProps {\n open: boolean;\n onConfirm: (() => void) | undefined;\n onClose: () => void;\n}\n\nconst LogoutDialog: React.FC = ({\n open,\n onClose,\n onConfirm,\n}) => {\n return (\n \n \n \n \n \n \n Tem certeza de que quer sair da sua conta? Será necessário fazer login\n novamente para acessá-la\n \n \n \n Voltar\n \n \n Sair\n \n \n \n \n );\n};\n\nexport default LogoutDialog;\n","import React, { useContext, useEffect, useState } from 'react';\nimport { useHistory } from 'react-router-dom';\nimport { AuthContext } from '../../../contexts/auth';\nimport {\n Container,\n CardContainer,\n CardText,\n StyledWarningIcon,\n} from '../styles';\nimport { Header } from '../../../components/Header'\nimport LogoutDialog from '../../../components/LogoutDialog'\nimport { BackButton } from '../../../components/BackButton'\nimport { PscButton } from '../../../components/PscButton'\n\nconst NoOrganizationIdBlock: React.FC = () => {\n const { userInfo, refreshUserInfo } = useContext(AuthContext);\n const history = useHistory();\n const [signOutDialogOpen, setSignOutDialogOpen] = useState(false);\n\n const { signOut } = useContext(AuthContext);\n\n const handleToggleDialog = () => {\n setSignOutDialogOpen(!signOutDialogOpen);\n };\n\n const userHasOrganizationId = userInfo?.user?.organizationId;\n\n const handleRefreshUserInfo = async () => {\n try {\n await refreshUserInfo();\n } catch (e) {\n console.log(e);\n }\n };\n\n useEffect(() => {\n handleRefreshUserInfo();\n\n if (userHasOrganizationId) {\n history.push('/');\n }\n }, []);\n\n return (\n <>\n setSignOutDialogOpen(true)}\n />\n }\n rightContent={}\n />\n \n \n \n \n \n Você não está vinculado(a) a nenhuma rede de cuidado.\n \n \n Para voltar a usar o aplicativo, solicite o vínculo a um paciente.\n \n \n \n \n );\n};\n\nexport default NoOrganizationIdBlock;\n","import React, { useContext, useEffect, useState } from 'react';\nimport { useHistory } from 'react-router-dom';\nimport { AuthContext } from '../../../contexts/auth';\nimport {\n Container,\n CardContainer,\n CardText,\n StyledWarningIcon,\n} from '../styles';\nimport { Header } from '../../../components/Header'\nimport LogoutDialog from '../../../components/LogoutDialog'\nimport { BackButton } from '../../../components/BackButton'\nimport { PscButton } from '../../../components/PscButton'\n\nconst NoPatientRelationsBlock: React.FC = () => {\n const { userInfo, refreshUserInfo } = useContext(AuthContext);\n const history = useHistory();\n const [signOutDialogOpen, setSignOutDialogOpen] = useState(false);\n\n const { signOut } = useContext(AuthContext);\n\n const handleToggleDialog = () => {\n setSignOutDialogOpen(!signOutDialogOpen);\n };\n\n const userHasRelatedPatients = Number(userInfo?.user?.patients?.length) > 0;\n\n const handleRefreshUserInfo = async () => {\n try {\n await refreshUserInfo();\n } catch (e) {\n console.log(e);\n }\n };\n\n useEffect(() => {\n handleRefreshUserInfo();\n\n if (userHasRelatedPatients) {\n history.push('/');\n }\n }, [userHasRelatedPatients]);\n\n return (\n <>\n setSignOutDialogOpen(true)}\n />\n }\n rightContent={}\n />\n \n \n \n \n \n Você não está vinculado a nenhuma rede de cuidado ainda.\n \n \n Para começar a usar o app, entre em contato com a pessoa que\n adicionou você e solicite o vínculo.\n \n \n \n \n );\n};\n\nexport default NoPatientRelationsBlock;\n","export default __webpack_public_path__ + \"static/media/user.e7ed929c.png\";","import { Link } from 'react-router-dom';\nimport styled from 'styled-components';\nimport StyledPaper from '../StyledPaper';\n\nexport const CardBox = styled(StyledPaper)`\n width: 100%;\n height: 100px;\n display: flex;\n align-items: center;\n margin-top: 0;\n`;\n\nexport const CardContent = styled.div`\n color: ${({ theme }) => theme.palette.secondary.main};\n display: flex;\n flex-direction: column;\n height: 100%;\n justify-content: space-around;\n word-break: break-word;\n\n span {\n font-size: 18px;\n font-weight: 500;\n }\n\n label {\n font-size: 14px;\n font-weight: 400;\n }\n`;\n\nexport const StyledImg = styled.img`\n width: 85px;\n height: 85px;\n border-radius: 100%;\n margin-right: ${({ theme }) => theme.spacing(2)}px;\n`;\n\nexport const StyledOrderlyDiv = styled.div`\n display: flex;\n flex-direction: column;\n`;\n\nexport const StyledLinkDiv = styled.div`\n display: flex;\n`;\n\nexport const StyledLink = styled(Link)`\n display: flex;\n align-items: center;\n color: ${({ theme }) => theme.palette.primary.main};\n`;\n","import { CaregiverModel } from '@cuidador/database';\nimport React, { useEffect, useState } from 'react';\nimport user from '../../assets/user.png';\nimport useCanAccess from '../../hooks/useCanAccess';\nimport useUser from '../../hooks/useUser';\nimport { isGuardian, isCareManager } from '../../contexts/permission';\nimport {\n CardBox,\n CardContent,\n StyledImg,\n StyledLink,\n StyledLinkDiv,\n} from './styles';\n\ninterface Props {\n caregiver?: CaregiverModel;\n id?: Id;\n}\n\nconst CardItem: React.FC = ({ caregiver, id }: Props) => {\n const [imageUrl, setImageUrl] = useState('');\n const { getProfilePicture } = useUser();\n const { isAllowedToRead: isAllowedToReadProfilePicture } = useCanAccess(\n 'media/profile-picture'\n );\n\n const resolveCaregiverStatusLabel = (status: string): string => {\n switch (status) {\n case 'disabled':\n return 'Desabilitado';\n default:\n return 'Pendente';\n }\n };\n\n const handleGetCaregiverProfilePicture = async (id: number) => {\n try {\n return await getProfilePicture(id).then(({ data }) => data?.signedUrl);\n } catch (err) {\n return '';\n }\n };\n\n useEffect(() => {\n async function fetchCaregiverProfilePicture() {\n const result = isAllowedToReadProfilePicture\n ? await handleGetCaregiverProfilePicture(parseInt(`${id}`))\n : false;\n if (result) {\n setImageUrl(result);\n } else {\n setImageUrl(user);\n }\n }\n fetchCaregiverProfilePicture();\n }, []);\n\n if (isCareManager(caregiver?.user) || isGuardian(caregiver?.user)) {\n return null;\n }\n\n return (\n \n \n \n {caregiver?.user?.name}\n \n {caregiver?.user?.status !== 'enabled' && (\n <>\n \n \n \n \n \n \n )}\n \n \n );\n};\n\nexport default CardItem;\n","import {\n Backdrop as MaterialBackdrop,\n CircularProgress as MaterialCircularProgress,\n} from '@material-ui/core';\nimport Typography from '@material-ui/core/Typography';\nimport styled from 'styled-components';\n\nexport const TypographyContainer = styled.div`\n width: 100%;\n text-align: center;\n color: ${({ theme }) => theme.palette.primary.main};\n margin-top: ${({ theme }) => theme.spacing(2)}px;\n margin-bottom: ${({ theme }) => theme.spacing(2)}px;\n`;\n\nexport const StyledTypography = styled(Typography)`\n color: ${({ theme }) => theme.palette.primary.dark};\n margin-bottom: ${({ theme }) => theme.spacing(2)} px;\n font-size: ${({ theme }) => theme.spacing(1.75)}px;\n`;\n\nexport const Container = styled.div`\n display: flex;\n flex-direction: column;\n align-items: center;\n flex: 1;\n padding: ${({ theme }) => theme.spacing(2)}px;\n display: flex;\n flex-direction: column;\n`;\n\nexport const Backdrop = styled(MaterialBackdrop)`\n z-index: ${({ theme }) => theme.zIndex.drawer + 1};\n color: ${({ theme }) => theme.palette.primary.light};\n position: absolute;\n`;\n\nexport const BackdropCircularProgress = styled(MaterialCircularProgress).attrs({\n color: 'inherit',\n})``;\n\nexport const StyledCardContainer = styled.div`\n width: 100%;\n display: flex;\n margin-bottom: ${({ theme }) => theme.spacing(2)}px;\n`;\n","import AddIcon from '@material-ui/icons/AddRounded'\nimport React, { useContext, useEffect } from 'react'\nimport { useHistory } from 'react-router-dom'\nimport CardItem from '../../components/CardItem'\nimport Fab from '../../components/Fab'\nimport PendingRegistrationBanner from '../../components/PendingRegistrationBanner'\nimport { AuthContext } from '../../contexts/auth'\nimport useCanAccess from '../../hooks/useCanAccess'\nimport useCaregiver from '../../hooks/useCaregiver'\nimport {\n Backdrop,\n BackdropCircularProgress,\n Container,\n StyledCardContainer,\n StyledTypography,\n TypographyContainer,\n} from './styles'\nimport { PageTitle } from '../../components/PageTitle'\nimport { Header } from '../../components/Header'\nimport { BackButton } from '../../components/BackButton'\nimport { PscButton } from '../../components/PscButton'\n\nconst Caregiver: React.FC = () => {\n const { userInfo } = useContext(AuthContext)\n const patientId = userInfo?.activePatientId\n const history = useHistory()\n\n const { isAllowedToInvoke: isAllowedToRelateUser } = useCanAccess('user/relate-to-patient')\n const { isAllowedToCreate } = useCanAccess('user')\n\n const {\n getAllByPatientId,\n byId,\n ids: caregiversIds,\n loading,\n } = useCaregiver()\n\n useEffect(() => {\n if (!patientId) return\n getAllByPatientId(patientId)\n }, [patientId])\n\n return (\n <>\n \n {loading && (\n \n )}\n \n history.push('/cadastros')}\n />\n }\n centerContent={\n \n }\n rightContent={\n \n }\n />\n \n \n \n \n Aqui você pode incluir ou excluir pessoas da rede de cuidados.\n \n \n Para inclusão, clique no botão (+).\n \n \n Para exclusão, clique na pessoa que gostaria de excluir e depois no\n ícone Lixeira no canto superior direito. Importante manter essa\n lista atualizada para que pessoas não autorizadas não tenham acesso\n aos dados.\n \n \n\n {caregiversIds.map((id) => (\n \n \n \n ))}\n \n {(isAllowedToCreate || isAllowedToRelateUser) && (\n \n \n \n )}\n \n )\n}\n\nexport default Caregiver\n","import {\n Backdrop as MaterialBackdrop,\n CircularProgress as MaterialCircularProgress,\n} from '@material-ui/core';\nimport styled from 'styled-components';\n\nexport const Backdrop = styled(MaterialBackdrop)`\n z-index: ${({ theme }) => theme.zIndex.drawer + 1};\n color: ${({ theme }) => theme.palette.primary.light};\n`;\n\nexport const BackdropCircularProgress = styled(MaterialCircularProgress).attrs({\n color: 'inherit',\n})``;\n","import React from 'react';\nimport { Backdrop, BackdropCircularProgress } from './styles';\n\nconst LoadingBackdrop: React.FC<{ loading: boolean }> = ({ loading }) => {\n return (\n \n {loading && (\n \n )}\n \n );\n};\n\nexport default LoadingBackdrop;\n","import styled from 'styled-components';\n\nexport const Container = styled.div`\n background-color: ${({ theme }) => theme.palette.warning.main};\n color: black;\n width: 100%;\n height: ${({ theme }) => theme.spacing(8)}px;\n display: grid;\n`;\n\nexport const MessageContainer = styled.div`\n font-size: ${({ theme }) => theme.spacing(1.75)}px;\n padding-left: ${({ theme }) => theme.spacing(2)}px;\n padding-right: ${({ theme }) => theme.spacing(2)}px;\n display: flex;\n text-align: center;\n align-items: center;\n`;\n","import React from 'react';\nimport { Container, MessageContainer } from './styles';\n\ntype PendingRegistrationWarningBannerProps = {\n onClick: () => void;\n};\n\nconst PendingRegistrationWarningBanner: React.FC = ({\n onClick,\n}) => {\n return (\n \n \n Este usuário ainda não completou o cadastro. Clique aqui para reenviar o\n convite.\n \n \n );\n};\n\nexport default PendingRegistrationWarningBanner;\n","import styled from 'styled-components';\n\nexport const Container = styled.div`\n white-space: nowrap;\n display: flex;\n\n svg {\n margin-left: ${({ theme }) => theme.spacing(0.5)}px;\n }\n`;\n\nexport const LogoImage = styled.img`\n height: 25px;\n width: 25px;\n margin: 2px;\n`;\n","import { clientSideScheme } from '@cuidador/whitelabel';\nimport React from 'react';\nimport LogoPurple from '../../assets/logo-purple.png';\nimport { Container, LogoImage } from './styles';\n\ninterface RoleAppsProps {\n guardianAppAccess?: boolean;\n caregiverAppAccess?: boolean;\n adminAppAccess?: boolean;\n}\n\nconst RoleApps: React.FC = ({\n guardianAppAccess,\n caregiverAppAccess,\n adminAppAccess,\n}) => {\n const accessibleApps = [];\n const { appCShortcutIconUrl, appFShortcutIconUrl } = clientSideScheme();\n\n if (guardianAppAccess) {\n accessibleApps.push(appFShortcutIconUrl);\n }\n if (caregiverAppAccess) {\n accessibleApps.push(appCShortcutIconUrl);\n }\n if (adminAppAccess) {\n accessibleApps.push(LogoPurple);\n }\n\n return (\n \n {accessibleApps.map((apps) => (\n <>\n \n \n ))}\n \n );\n};\n\nexport default RoleApps;\n","export default \"data:image/png;base64,i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"","import { RoleModel } from '@cuidador/database';\nimport { useCallback, useReducer } from 'react';\nimport axios from '../config/axios';\nimport { createReducer, Item, ReducerData } from '../utils/store/index';\n\nconst endpoint = '/auth/role';\n\nconst initialData: ReducerData = {\n byId: {} as Record>,\n ids: [] as Array,\n total: 0,\n loading: false,\n error: null,\n};\n\nconst useRoles = () => {\n const [state, dispatch] = useReducer(createReducer(), initialData);\n\n const getAll = useCallback(async () => {\n try {\n dispatch({ type: 'LOADING' });\n const response = await axios.get(`${endpoint}?orderBy=title`);\n dispatch({ type: 'GET_ALL', payload: response.data.results });\n } catch (err) {\n dispatch({ type: 'ERROR', payload: err });\n }\n }, []);\n\n const getById = useCallback(async (id: Id) => {\n try {\n const response = await axios.get(`${endpoint}/${id}`);\n dispatch({ type: 'GET_BY_ID', payload: response.data });\n } catch (err) {\n dispatch({ type: 'ERROR', payload: err });\n }\n }, []);\n\n return {\n ...state,\n getById,\n getAll,\n };\n};\n\nexport default useRoles;\n","import {\n Backdrop as MaterialBackdrop,\n Checkbox,\n CircularProgress as MaterialCircularProgress,\n FormControlLabel,\n Avatar,\n} from '@material-ui/core';\nimport styled from 'styled-components';\nimport { default as StyledSelect } from '../../../components/Forms/FormikSelect';\nimport StyledMenuItem from '../../../components/StyledMenuItem';\n\nexport const Container = styled.div`\n display: flex;\n flex-direction: column;\n flex: 1;\n padding-top: ${({ theme }) => theme.spacing(2)}px;\n padding-bottom: ${({ theme }) => theme.spacing(2)}px;\n display: flex;\n color: ${({ theme }) => theme.palette.secondary.main};\n flex-direction: column;\n form {\n display: flex;\n flex: 1;\n flex-direction: column;\n }\n`;\n\nexport const AvatarContainer = styled.div`\n display: flex;\n align-items: center;\n justify-content: center;\n`;\n\nexport const StyledAvatar = styled(Avatar)`\n width: 100%;\n height: 100%;\n max-width: 70px;\n max-height: 70px;\n\n .MuiAvatar-fallback {\n width: 100%;\n height: 100%;\n }\n`;\n\nexport const Backdrop = styled(MaterialBackdrop)`\n z-index: ${({ theme }) => theme.zIndex.drawer + 1};\n color: ${({ theme }) => theme.palette.primary.light};\n height: 100%;\n`;\n\nexport const BackdropCircularProgress = styled(MaterialCircularProgress).attrs({\n color: 'inherit',\n})``;\n\nexport const FooterContainer = styled.div`\n display: flex;\n justify-content: center;\n flex: 1;\n align-items: flex-end;\n margin-top: ${({ theme }) => theme.spacing(3)}px;\n`;\n\nexport const StyledCheckbox = styled(Checkbox).attrs({\n color: 'secondary',\n})`\n color: ${({ theme }) => theme.palette.secondary.main};\n`;\n\nexport const StyledFormControlLabel = styled(FormControlLabel)`\n margin-right: 0;\n color: ${({ theme }) => theme.palette.common.black};\n`;\n\nexport const ContentContainer = styled.div`\n margin-top: ${({ theme }) => theme.spacing(3)}px;\n width: 100%;\n display: flex;\n align-items: center;\n flex-direction: column;\n`;\n\nexport const FormGroupContainer = styled.div`\n padding-left: ${({ theme }) => theme.spacing(3)}px;\n padding-right: ${({ theme }) => theme.spacing(3)}px;\n`;\n\nexport const AppContainer = styled.div`\n display: flex;\n align-items: center;\n\n span {\n color: ${({ theme }) => theme.palette.extra.color.grey.dark};\n margin-left: ${({ theme }) => theme.spacing(1)}px;\n }\n`;\n\nexport const RoleSelect = styled(StyledSelect)`\n background-color: ${({ theme }) => theme.palette.common.white};\n border-radius: ${({ theme }) => theme.spacing(0.7)}px;\n\n & [role='button'] {\n div {\n color: inherit;\n font-weight: inherit;\n }\n span {\n display: none;\n }\n }\n`;\n\nexport const RoleMenuItem = styled(StyledMenuItem)`\n color: ${({ theme }) => theme.palette.getContrastText('#FFF')};\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n justify-content: center;\n margin-block: ${({ theme }) => theme.spacing(0.5)}px;\n`;\n\nexport const RoleLabel = styled.div`\n font-weight: 700;\n font-size: 18px;\n margin-inline: ${({ theme }) => theme.spacing(1)}px;\n display: flex;\n justify-content: space-between;\n align-items: center;\n width: 90%;\n white-space: break-spaces;\n`;\n\nexport const RoleDescription = styled.span`\n font-weight: 400;\n font-size: 14px;\n margin-inline: ${({ theme }) => theme.spacing(1)}px;\n margin-top: ${({ theme }) => theme.spacing(1)}px;\n width: 90%;\n text-align: justify;\n white-space: normal;\n`;\n","import { Button } from '@material-ui/core';\nimport { KeyboardArrowDown, KeyboardArrowUp } from '@material-ui/icons';\nimport styled from 'styled-components';\n\nexport const Container = styled.div`\n display: flex;\n flex-direction: column;\n width: 100%;\n`;\n\nexport const CaptionButton = styled(Button)`\n color: ${({ theme }) => theme.palette.extra.color.grey.dark};\n font-weight: 600;\n display: flex;\n align-items: center;\n align-self: flex-end;\n padding: ${({ theme }) => theme.spacing(0.5)}px;\n width: fit-content;\n\n & svg {\n margin-left: ${({ theme }) => theme.spacing(0.5)}px;\n }\n\n &:hover {\n background-color: transparent;\n }\n`;\n\nexport const StyledArrowUp = styled(KeyboardArrowUp)`\n color: ${({ theme }) => theme.palette.secondary.main};\n`;\n\nexport const StyledArrowDown = styled(KeyboardArrowDown)`\n color: ${({ theme }) => theme.palette.secondary.main};\n`;\n\nexport const Description = styled.p`\n color: ${({ theme }) => theme.palette.extra.color.grey.dark};\n`;\n","import { RoleModel } from '@cuidador/database';\nimport { clientSideScheme } from '@cuidador/whitelabel';\nimport React, { useState } from 'react';\nimport { StyledBoldTitle } from '../../../../components/FormCardContainer';\nimport { LogoImage } from '../../../../components/RoleApps/styles';\nimport { AppContainer } from '../styles';\nimport { FormValues } from '../utils';\nimport {\n CaptionButton,\n Container,\n Description,\n StyledArrowDown,\n StyledArrowUp,\n} from './styles';\n\ninterface CollapsibleCaptionProps {\n roles: RoleModel[];\n values: FormValues;\n defaultVisibility: boolean;\n}\n\nconst { appCShortcutIconUrl, appFShortcutIconUrl } = clientSideScheme();\n\nconst apps = [\n { label: 'Acessa o app de Gestão de cuidados', icon: appFShortcutIconUrl },\n { label: 'Acessa o app de Cuidados', icon: appCShortcutIconUrl },\n];\n\nconst CollapsibleCaption: React.FC = ({\n roles,\n values,\n defaultVisibility,\n}) => {\n const [\n isVisibleCollapsibleCaption,\n setIsVisibleCollapsibleCaption,\n ] = useState(defaultVisibility);\n\n const handleToggleCollapsibleCaption = () => {\n setIsVisibleCollapsibleCaption(!isVisibleCollapsibleCaption);\n };\n\n return (\n \n {\n handleToggleCollapsibleCaption();\n }}\n >\n Legenda\n {isVisibleCollapsibleCaption ? : }\n \n {isVisibleCollapsibleCaption && (\n <>\n \n Descrição do tipo de perfil\n \n \n {roles?.find((role) => role.id == values.roleId)?.description}\n \n {apps.map(({ label, icon }, index) => (\n \n \n {label}\n \n ))}\n \n )}\n \n );\n};\n\nexport default CollapsibleCaption;\n","import styled from 'styled-components';\nimport {\n Avatar,\n Button,\n Tooltip,\n Typography,\n withStyles,\n} from '@material-ui/core';\n\nexport const Container = styled.div`\n display: flex;\n flex: 1;\n align-items: center;\n justify-content: space-between;\n margin-bottom: ${({ theme }) => theme.spacing(1)}px;\n margin-top: ${({ theme }) => theme.spacing(0.5)}px;\n\n span {\n font-size: ${({ theme }) => theme.spacing(1.5)}px;\n }\n`;\n\nexport const InnerContainer = styled.div`\n display: flex;\n flex-direction: column;\n width: 100%;\n margin-left: ${({ theme }) => theme.spacing(1)}px;\n margin-right: ${({ theme }) => theme.spacing(1)}px;\n\n span {\n margin-top: ${({ theme }) => theme.spacing(0.5)}px;\n }\n`;\n\nexport const StyledAvatar = styled(Avatar)`\n align-self: center;\n height: ${({ theme }) => theme.spacing(4)}px;\n width: ${({ theme }) => theme.spacing(4)}px;\n margin: ${({ theme }) => theme.spacing(0, 0.5)};\n`;\n\nexport const StyledTypography = styled(Typography)`\n line-height: 1;\n font-size: ${({ theme }) => theme.spacing(2)}px;\n\n b {\n max-width: 50vw;\n word-wrap: break-word;\n overflow: hidden;\n text-overflow: ellipsis;\n display: -webkit-box;\n -webkit-line-clamp: 1; /* number of lines to show */\n -webkit-box-orient: vertical;\n }\n`;\n\nexport const StyledSelectButton = styled(Button)`\n background-color: ${({ theme }) => theme.palette.common.white};\n color: ${({ theme }) => theme.palette.primary.main};\n padding: ${({ theme }) => theme.spacing(0.75, 1.25)};\n min-width: unset;\n`;\n\nexport const DisabledSelectButton = styled(StyledSelectButton)`\n opacity: 65%;\n cursor: default;\n`;\n\nexport const StyledTooltip = withStyles((theme) => ({\n tooltip: {\n backgroundColor: theme.palette.common.white,\n color: theme.palette.primary.main,\n boxShadow: theme.shadows[1],\n borderRadius: '5px',\n maxWidth: '90px',\n textAlign: 'center',\n },\n arrow: {\n color: theme.palette.common.white,\n },\n}))(Tooltip);\n","import React, { useState } from 'react';\nimport { UserModel } from '@cuidador/database';\nimport { Zoom } from '@material-ui/core';\nimport {\n Container,\n InnerContainer,\n StyledAvatar,\n StyledTypography,\n StyledSelectButton,\n DisabledSelectButton,\n StyledTooltip,\n} from './styles';\n\ninterface UserListProps {\n users: (UserModel & { roleTitle?: string })[];\n findAndReturnAvatarImage: (id?: number) => string;\n allowedToRelateUserPatient: (userOrganizationId?: number | null) => boolean;\n onConfirm: (id?: number) => void;\n}\n\nconst UserList: React.FC = ({\n users,\n findAndReturnAvatarImage,\n allowedToRelateUserPatient,\n onConfirm,\n}) => {\n const initialStateTooltipsStatus = Array.from(\n { length: users.length },\n () => {\n return { isTooltipOpen: false };\n }\n );\n\n const [tooltipsStatus, setTooltipsStatus] = useState(\n initialStateTooltipsStatus\n );\n\n const handleToggleTooltipsStatus = (userIndex: number) => {\n const newStateTooltipsStatus = tooltipsStatus.map((tooltip, index) => {\n if (index === userIndex) {\n return { ...tooltip, isTooltipOpen: !tooltip.isTooltipOpen };\n }\n\n return tooltip;\n });\n\n setTooltipsStatus(newStateTooltipsStatus);\n };\n\n return (\n <>\n {users?.map((user, index) => (\n \n \n \n \n {user.name}\n \n \n {user.roleTitle}\n \n \n {allowedToRelateUserPatient(user.organizationId) ? (\n onConfirm(user.id)}\n variant=\"contained\"\n >\n Vincular\n \n ) : (\n setTooltipsStatus(initialStateTooltipsStatus)}\n title=\"Vinculado a outra organização. Contate o suporte\"\n TransitionComponent={Zoom}\n placement=\"left\"\n disableHoverListener\n arrow\n >\n handleToggleTooltipsStatus(index)}\n variant=\"contained\"\n >\n Vincular\n \n \n )}\n \n ))}\n \n );\n};\n\nexport default UserList;\n","import { Typography, DialogActions } from '@material-ui/core';\nimport styled from 'styled-components';\n\nexport const ButtonContainer = styled.div`\n margin-top: ${({ theme }) => theme.spacing(3)}px;\n\n div {\n margin-top: ${({ theme }) => theme.spacing(-1)}px;\n }\n`;\n\nexport const StyledTitle = styled(Typography).attrs({\n variant: 'h6',\n})`\n line-height: 1.3;\n margin-top: ${({ theme }) => theme.spacing(1.5)}px;\n margin-bottom: ${({ theme }) => theme.spacing(2)}px;\n font-size: ${({ theme }) => theme.spacing(2)}px;\n text-align: center;\n`;\n\nexport const StyledDialogActions = styled(DialogActions)`\n display: flex;\n flex-direction: column;\n\n & > button {\n margin-bottom: ${({ theme }) => theme.spacing(3)}px;\n }\n\n & > p {\n cursor: pointer;\n text-decoration: underline;\n }\n`;\n","import { UserModel } from '@cuidador/database';\nimport { DialogContent, Typography } from '@material-ui/core';\nimport React, { useContext } from 'react';\nimport StyledButton from '../../../../components/StyledButton';\nimport StyledDialog from '../../../../components/StyledDialog';\nimport UserList from './UserList';\nimport { AuthContext } from '../../../../contexts/auth';\nimport useCanAccess from '../../../../hooks/useCanAccess';\nimport { phoneMask, cpfMask } from '../../../../utils/inputs';\nimport { ButtonContainer, StyledTitle, StyledDialogActions } from './styles';\n\ntype RelateToPatientDialogProps = {\n onClose: () => void;\n onConfirm: (id?: number) => void;\n handleCreateUserAndGenerateSignupUrl: () => void;\n users: (UserModel & { roleTitle?: string })[];\n newUserCpf?: string;\n avatars?: { id: number; image: string }[];\n open: boolean;\n};\n\nconst RelateToPatientDialog: React.FC = ({\n onClose,\n onConfirm,\n handleCreateUserAndGenerateSignupUrl,\n users,\n newUserCpf,\n avatars,\n open,\n}) => {\n const { userInfo } = useContext(AuthContext);\n const guardianOrganizationId = userInfo?.user?.organizationId;\n const { isAllowedToCreate: isAllowedToCreateUser } = useCanAccess('user');\n const { isAllowedToInvoke: isAllowedToRelateUser } = useCanAccess(\n 'user/relate-to-patient'\n );\n\n const isUserFoundByCpf =\n !!newUserCpf &&\n users.some(({ cpf }) => cpfMask(String(cpf)) === newUserCpf);\n\n const findAndReturnAvatarImage = (id?: number) => {\n if (avatars) {\n const found = avatars.find((avatar) => avatar.id === id)?.image;\n if (found) {\n return found;\n }\n }\n return '';\n };\n\n const allowedToRelateUserPatient = (userOrganizationId?: number | null) => {\n const userHasNoOrganization = !userOrganizationId;\n const userIsInGuardianOrganization = !!(\n userOrganizationId === guardianOrganizationId\n );\n return userHasNoOrganization || userIsInGuardianOrganization;\n };\n\n return (\n <>\n \n {!!users.length && (\n \n {isAllowedToRelateUser && (\n <>\n {isUserFoundByCpf && (\n \n Encontramos este usuário com o CPF{' '}\n {cpfMask(String(users[0].cpf))}\n \n )}\n {!isUserFoundByCpf && (\n <>\n \n Encontramos {users?.length} usuário(s) com o número{' '}\n {!!users[0].phoneNumber &&\n phoneMask(users[0].phoneNumber)}\n \n Qual deles você está buscando?\n \n )}\n \n \n )}\n \n \n \n Voltar\n \n {isAllowedToRelateUser && isAllowedToCreateUser && (\n \n Não encontrei quem procuro\n \n )}\n \n \n \n )}\n \n \n );\n};\n\nexport default RelateToPatientDialog;\n","import * as yup from 'yup';\n\nexport const validationSchema = yup.object().shape({\n inviteLink: yup.string(),\n});\n\nexport type dialogPhoneFormValues = {\n phoneNumber?: string;\n inviteLink?: string;\n};\n","function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\nimport * as React from \"react\";\n\nvar _ref2 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M19 21H8V7H19M19 5H8C7.46957 5 6.96086 5.21071 6.58579 5.58579C6.21071 5.96086 6 6.46957 6 7V21C6 21.5304 6.21071 22.0391 6.58579 22.4142C6.96086 22.7893 7.46957 23 8 23H19C19.5304 23 20.0391 22.7893 20.4142 22.4142C20.7893 22.0391 21 21.5304 21 21V7C21 6.46957 20.7893 5.96086 20.4142 5.58579C20.0391 5.21071 19.5304 5 19 5ZM16 1H4C3.46957 1 2.96086 1.21071 2.58579 1.58579C2.21071 1.96086 2 2.46957 2 3V17H4V3H16V1Z\",\n fill: \"white\"\n});\n\nfunction SvgCopyIcon(_ref, svgRef) {\n var title = _ref.title,\n titleId = _ref.titleId,\n props = _objectWithoutProperties(_ref, [\"title\", \"titleId\"]);\n\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n width: 24,\n height: 24,\n viewBox: \"0 0 24 24\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, _ref2);\n}\n\nvar ForwardRef = /*#__PURE__*/React.forwardRef(SvgCopyIcon);\nexport default __webpack_public_path__ + \"static/media/copy-icon.c7308133.svg\";\nexport { ForwardRef as ReactComponent };","import styled from 'styled-components';\nimport { DialogTitle, Typography, InputAdornment } from '@material-ui/core';\n\nexport const StytledDialogTitle = styled(DialogTitle)`\n & > h2 {\n font-size: 1rem;\n }\n`;\n\nexport const StyledTypography = styled(Typography)`\n font-size: 0.95rem;\n margin-block: ${({ theme }) => theme.spacing(1)}px;\n`;\n\nexport const StyledInputAdornment = styled(InputAdornment)`\n cursor: pointer;\n\n & > div {\n display: flex;\n flex-direction: column;\n align-items: center;\n margin-top: ${({ theme }) => theme.spacing(0.5)}px;\n }\n\n & > div > span {\n color: ${({ theme }) => theme.palette.common.white};\n font-size: 0.65rem;\n }\n`;\n","import React from 'react';\nimport { toast } from 'react-toastify';\nimport { DialogActions, DialogContent } from '@material-ui/core';\n\nimport StyledButton from '../../../../components/StyledButton';\nimport StyledDialog from '../../../../components/StyledDialog';\nimport { Formik, Form } from 'formik';\nimport FormikTextField from '../../../../components/Forms/FormikTextField';\nimport { validationSchema, dialogPhoneFormValues } from './utils';\n\nimport { ReactComponent as CopyIcon } from '../../../../assets/copy-icon.svg';\n\nimport {\n StytledDialogTitle,\n StyledTypography,\n StyledInputAdornment,\n} from './styles';\n\ntype ShareActivationLinkDialogProps = {\n onClose: () => void;\n onConfirm: (values: dialogPhoneFormValues) => void;\n open: boolean;\n userName?: string;\n completeSignupUrl?: string;\n};\n\nconst ShareActivationLinkDialog: React.FC = ({\n onClose,\n onConfirm,\n open,\n userName,\n completeSignupUrl,\n}) => {\n const initialValues = {\n inviteLink: completeSignupUrl || '',\n };\n\n const handleCopyTextToClipboard = (text: string) => {\n navigator.clipboard.writeText(text);\n toast.success('Link copiado!');\n };\n\n return (\n \n \n Convite exclusivo gerado!\n \n Compartilhe o link com {userName}, para terminar o\n cadastro e acessar o aplicativo.\n \n \n Você pode copiar ou enviar pelo o WhatsApp\n \n \n {({ isSubmitting }) => (\n
\n \n handleCopyTextToClipboard(String(completeSignupUrl))\n }\n >\n
\n \n Copiar\n
\n \n ),\n readOnly: true,\n }}\n />\n\n \n \n Voltar\n \n \n Enviar pelo whatsapp\n \n \n \n )}\n \n
\n
\n );\n};\n\nexport default ShareActivationLinkDialog;\n","import {\n DialogActions,\n DialogContent,\n DialogTitle,\n Typography,\n} from '@material-ui/core';\nimport WarningIcon from '@material-ui/icons/Warning';\nimport React from 'react';\n\nimport StyledButton from '../../../../components/StyledButton';\nimport StyledDialog from '../../../../components/StyledDialog';\n\ntype UnrelateFromOrganizationDialogProps = {\n onClose: () => void;\n onConfirm: () => void;\n open: boolean;\n};\n\nconst UnrelateFromOrganizationDialog: React.FC = ({\n onClose,\n onConfirm,\n open,\n}) => {\n return (\n \n \n \n \n \n \n Tem certeza que deseja remover esse usuário?\n \n \n Ao confirmar, este usuário será desvinculado da sua organização e não\n terá mais acesso a nenhum paciente.\n \n \n \n Voltar\n \n \n Confirmar\n \n \n \n \n );\n};\n\nexport default UnrelateFromOrganizationDialog;\n","import { UserModel } from '@cuidador/database';\nimport * as yup from 'yup';\nimport {\n cpfMask,\n numberMask,\n phoneMask,\n validateCpf,\n} from '../../../utils/inputs';\n\nexport const validationSchema = yup.object().shape({\n name: yup\n .string()\n .required('Por favor, insira o nome')\n .min(3, 'O nome deve conter ao menos 3 caracteres'),\n cpf: yup\n .string()\n .test('isCpfValid', 'Por favor, insira um CPF válido', (value) =>\n value !== '' && value !== undefined ? validateCpf(value || '') : true\n ),\n phoneNumber: yup\n .string()\n .required('Por favor, insira um celular')\n .min(15, 'Por favor, insira um celular válido')\n .max(15, 'Por favor, insira um celular válido'),\n roleId: yup.number().required('Por favor, selecione um tipo de perfil'),\n});\n\nexport type FormValues = {\n name: string;\n cpf: string;\n phoneNumber: string;\n roleId?: number;\n email?: string;\n};\n\nexport const initialValues: FormValues = {\n name: '',\n cpf: '',\n phoneNumber: '',\n roleId: undefined,\n email: '',\n};\n\nexport const formDataToUserModel = (\n values: FormValues,\n patientId?: number | null\n) => {\n return {\n name: values.name,\n cpf: values.cpf !== '' ? numberMask(values.cpf) : undefined,\n phoneNumber: numberMask(`55${values.phoneNumber}`),\n roleId: Number(values.roleId),\n patientId,\n };\n};\n\nexport const userModelToFormData = (data: UserModel) =>\n ({\n name: data.name,\n cpf: cpfMask(data.cpf || ''),\n phoneNumber: phoneMask(data.phoneNumber || ''),\n roleId: data.role?.id,\n email: data.email,\n } as FormValues);\n\nexport const getShareMessage = (\n caregiverName: string,\n shortUrl: string\n) => `Olá, ${caregiverName}, você foi convidado(a) e agora faz parte do Cuidador de Confiança. Para começar, acesse o link e cadastre-se.\n\n${shortUrl}`;\n","import { RoleModel, UserModel } from '@cuidador/database';\nimport { APIError } from '@cuidador/lib';\nimport { AxiosError } from 'axios';\nimport { Form, Formik, FormikProps } from 'formik';\nimport qs from 'query-string';\nimport React, { useContext, useEffect, useMemo, useRef, useState } from 'react';\nimport { useHistory, useLocation, useParams } from 'react-router-dom';\nimport { toast } from 'react-toastify';\nimport {\n FormCardContainer,\n StyledBoldTitle,\n StyledFormikTextField as FormikTextField,\n} from '../../../components/FormCardContainer';\nimport LoadingBackdrop from '../../../components/LoadingBackdrop';\nimport MedicBalloon from '../../../components/MedicBalloon';\nimport PendingRegistrationWarningBanner from '../../../components/PendingRegistrationWarningBanner';\nimport RoleApps from '../../../components/RoleApps';\nimport StyledButton from '../../../components/StyledButton';\nimport { AuthContext } from '../../../contexts/auth';\nimport useCanAccess from '../../../hooks/useCanAccess';\nimport useRoles from '../../../hooks/useRoles';\nimport useUser from '../../../hooks/useUser';\nimport { resolveErrorMessage } from '../../../utils/error';\nimport { cpfMask, numberMask, phoneMask } from '../../../utils/inputs';\nimport { Item } from '../../../utils/store';\nimport CollapsibleCaption from './CollapsibleCaption';\nimport RelateToPatientDialog from './RelateToPatientDialog';\nimport ShareActivationLinkDialog from './ShareActivationLinkDialog';\nimport {\n AvatarContainer,\n Container,\n ContentContainer,\n FooterContainer,\n RoleDescription,\n RoleLabel,\n RoleMenuItem,\n RoleSelect,\n StyledAvatar,\n} from './styles';\nimport UnrelateFromOrganizationDialog from './UnrelateFromOrganizationDialog';\nimport {\n formDataToUserModel,\n FormValues,\n getShareMessage,\n initialValues,\n userModelToFormData,\n validationSchema,\n} from './utils';\nimport { RemoveButton } from '../../../components/RemoveButton'\nimport { PscButton } from '../../../components/PscButton'\nimport { BackButton } from '../../../components/BackButton'\nimport { Header } from '../../../components/Header'\nimport { PageTitle } from '../../../components/PageTitle'\n\ninterface RouteParams {\n id: string;\n}\n\nconst UserForm: React.FC = () => {\n const [loading, setLoading] = useState(false);\n const [usersFound, setUsersFound] = useState([]);\n const [showUnrelateDialog, setShowUnrelateDialog] = useState(false);\n const [completeSignupUrl, setCompleteSignupUrl] = useState('');\n const [shareActivationUrl, setShareActivationUrl] = useState<{\n message: string;\n } | null>(null);\n const [\n showShareActivationLinkDialog,\n setShowShareActivationLinkDialog,\n ] = useState(false);\n const [avatars, setAvatars] = useState<{ id: number; image: string }[]>([]);\n const [userProfilePictureUrl, setUserProfilePictureUrl] = useState('');\n const [, setName] = useState('');\n const [userFormValues, setUserFormValues] = useState(initialValues);\n const params = useParams();\n const {\n byId,\n getById,\n post,\n loading: loadingUser,\n findAvailableUsers,\n getProfilePicture: getUserProfilePicture,\n relateToPatient,\n relateToOrganization,\n unrelateFromOrganization,\n getPendingSignupToken,\n } = useUser();\n const {\n loading: loadingRoles,\n getAll: getAllRoles,\n byId: rolesById,\n ids: rolesIds,\n } = useRoles();\n const formikRef = useRef | null>();\n const { userInfo } = useContext(AuthContext);\n const history = useHistory();\n const { search } = useLocation();\n\n const {\n isAllowedToCreate: isAllowedToCreateUser,\n isAllowedToUpdate: isAllowedToUpdateUser,\n } = useCanAccess('user');\n const { isAllowedToInvoke: isAllowedToUnrelateUser } = useCanAccess(\n 'user/unrelate-from-organization'\n );\n const { isAllowedToRead: isAllowedToReadProfilePicture } = useCanAccess(\n 'media/profile-picture'\n );\n\n const id = parseInt(params.id);\n const isCreationPage = !id;\n const patientId = Number(userInfo?.activePatientId);\n const userName = byId[id]?.name;\n\n const shouldRelatePatient = useMemo(() => {\n const queryParams = new URLSearchParams(search);\n return Boolean(queryParams.get('relatePatient')?.toLowerCase() === 'true');\n }, [search]);\n\n const showShareDialog = useMemo(() => {\n const { show_share_dialog } = qs.parse(search);\n return show_share_dialog === 'true';\n }, [search]);\n\n const systemRoles = useMemo(() => {\n // If id is defined, is an update (or visualization)\n if (id) {\n const userRole = byId[id]?.role;\n const isUserRoleVisible = userRole?.isVisible;\n // If the user role is not visible, the only returned role are the user's role\n if (userRole && !isUserRoleVisible) {\n return [userRole as Item];\n }\n // If the user role is visible, all roles are returned\n }\n // If id is not defined, is a user creation, all roles should be returned\n return rolesIds.map((roleId) => rolesById[roleId]);\n }, [id, byId, rolesById, rolesIds]);\n\n const isFormDisabled =\n (Boolean(id) && !isAllowedToUpdateUser) || !isAllowedToCreateUser;\n const isLoading = loadingUser || loading || loadingRoles;\n const isUserInfoFetched = Boolean(id)\n ? initialValues != userFormValues\n : true;\n\n useEffect(() => {\n if (!isCreationPage) {\n async () => {\n const userProfilePictureUrl = await handleGetUserProfilePicture(id);\n setUserProfilePictureUrl(userProfilePictureUrl);\n };\n }\n }, [id]);\n\n useEffect(() => {\n getAllRoles();\n // if has id is an update, else is an insert\n if (id) {\n getById(id).then(({ data }) => {\n const userData = userModelToFormData(data);\n setUserFormValues(userData);\n\n if (data.status === 'awaitingSignupCompletion') {\n // User still awaiting for Signup Completion\n // Let's open \"Share Activation Dialog\"\n handleShareActivationMessageOpen(userData.name!).then(() => {\n if (showShareDialog) setShowShareActivationLinkDialog(true);\n });\n }\n });\n }\n }, [id, getById, getAllRoles]);\n\n const handleGetUserProfilePicture = async (id: number) => {\n try {\n return await getUserProfilePicture(id).then(\n ({ data }) => data?.signedUrl\n );\n } catch (err) {\n return '';\n }\n };\n\n async function fetchUserProfilePicture(id: number) {\n const result = isAllowedToReadProfilePicture\n ? await handleGetUserProfilePicture(parseInt(`${id}`))\n : false;\n const newAvatar = avatars;\n if (result) {\n newAvatar.push({ id, image: result });\n return setAvatars(newAvatar);\n }\n newAvatar.push({ id, image: '' });\n return setAvatars(newAvatar);\n }\n\n const handleSubmit = async (values: FormValues) => {\n const userData = formDataToUserModel(\n values,\n shouldRelatePatient ? patientId : undefined\n );\n const { available, user: usersFound } = await findAvailableUsers(userData);\n if (available) {\n return await createUser(userData);\n } else {\n setName(userData.name || '');\n setUsersFound(usersFound);\n setUserFormValues(values);\n usersFound.forEach((user: UserModel) =>\n fetchUserProfilePicture(Number(user.id))\n );\n }\n };\n\n const handleCreateUserAndGenerateSignupUrl = () => {\n setUsersFound([]);\n const userData = formDataToUserModel(\n userFormValues,\n shouldRelatePatient ? patientId : undefined\n );\n return post(userData)\n .then(async ({ data }) => {\n setLoading(true);\n const {\n data: { completeSignupUrl },\n } = await getPendingSignupToken(data.id);\n setCompleteSignupUrl(completeSignupUrl);\n const message = getShareMessage(data.name, completeSignupUrl);\n setShareActivationUrl({ message });\n setShowShareActivationLinkDialog(true);\n })\n .catch((err: AxiosError) => {\n const displayMessage = resolveErrorMessage(err);\n toast.error(displayMessage);\n })\n .finally(() => {\n setLoading(false);\n });\n };\n\n const createUser = async (userData: UserModel) => {\n return post(userData)\n .then(async ({ data }) =>\n history.replace(`/usuarios/${data.id}?show_share_dialog=true`)\n )\n .catch((err: AxiosError) => {\n const displayMessage = resolveErrorMessage(err);\n const fieldError = err.response?.data.context?.key;\n if (fieldError) {\n if (Object.keys(initialValues).includes(fieldError)) {\n formikRef.current?.setFieldError(fieldError, displayMessage || '');\n }\n } else {\n toast.error(displayMessage);\n }\n });\n };\n\n const handleConfirmRelation = (id?: number) => {\n if (id) {\n setUsersFound([]);\n setAvatars([]);\n shouldRelatePatient\n ? relateUserToPatient(id)\n : relateUserToOrganization(id);\n }\n };\n\n const relateUserToPatient = (id: number) => {\n relateToPatient(id, patientId!)\n .then(() => history.replace('/cuidadores'))\n .catch((err) => {\n const responseDataMessage = err.response.data.message;\n if (\n responseDataMessage === 'User is already related to given patient'\n ) {\n return toast.error('Este usuário já está vinculado ao paciente');\n }\n const displayMessage = resolveErrorMessage(err);\n toast.error(displayMessage);\n });\n };\n\n const relateUserToOrganization = (id: number) => {\n relateToOrganization(id)\n .then(() => history.goBack())\n .catch((err) => {\n const responseDataMessage = err.response?.data?.message;\n if (responseDataMessage === 'User already belongs to an organization') {\n return toast.error('Este usuário já pertence a uma organização');\n }\n const displayMessage = resolveErrorMessage(err);\n toast.error(displayMessage);\n });\n };\n\n const handleConfirmUnrelate = () => {\n setShowUnrelateDialog(false);\n unrelateFromOrganization(id)\n .then(() => history.goBack())\n .catch((err) => {\n const displayMessage = resolveErrorMessage(err);\n toast.error(displayMessage);\n });\n };\n\n const handleShareActivationMessageOpen = async (name: string) => {\n try {\n setLoading(true);\n const {\n data: { completeSignupUrl },\n } = await getPendingSignupToken(id);\n setCompleteSignupUrl(completeSignupUrl);\n const message = getShareMessage(name, completeSignupUrl);\n setShareActivationUrl({ message });\n } catch (_) {\n toast.error('Erro ao gerar o link de ativação');\n } finally {\n setLoading(false);\n }\n };\n\n const handleShareActivationMessageClick = (phoneNumber: string) => {\n // Universal links format\n // https://faq.whatsapp.com/425247423114725\n const formattedPhoneNumber = numberMask(`55${phoneNumber}`);\n const url = `https://wa.me/${formattedPhoneNumber}?${qs.stringify({\n text: shareActivationUrl?.message,\n })}`;\n window.open(url);\n setShareActivationUrl(null);\n history.goBack();\n };\n\n const resolveUserFormTitle = () => {\n if (isCreationPage) {\n return 'Adicionar rede de cuidado';\n } else {\n return 'Informações do usuário';\n }\n };\n\n const resolveRightButtonType = () => {\n if (!isCreationPage && isAllowedToUnrelateUser) {\n return 'remove';\n } else {\n return 'pscList';\n }\n };\n\n return (\n <>\n \n }\n centerContent={\n \n }\n rightContent={\n resolveRightButtonType() === 'remove'\n ? setShowUnrelateDialog(true)} />\n : \n }\n />\n \n {Boolean(shareActivationUrl) && (\n setShowShareActivationLinkDialog(true)}\n />\n )}\n {!loadingRoles && isUserInfoFetched && (\n \n (formikRef.current = ref)}\n initialValues={userFormValues}\n validationSchema={validationSchema}\n validateOnChange={false}\n onSubmit={handleSubmit}\n enableReinitialize={true}\n >\n {({ setFieldValue, values }) => {\n return (\n
\n {isCreationPage && (\n \n )}\n {!isCreationPage && (\n \n \n \n )}\n \n \n \n Informações pessoais\n \n \n ) => {\n setFieldValue(\n 'phoneNumber',\n phoneMask(e.target.value)\n );\n }}\n disabled={Boolean(id) || isFormDisabled}\n />\n ) => {\n setFieldValue('cpf', cpfMask(e.target.value));\n }}\n size=\"small\"\n disabled={Boolean(id) || isFormDisabled}\n />\n {!isCreationPage && (\n \n ) => {\n setFieldValue('email', e.target.value);\n }}\n size=\"small\"\n disabled={Boolean(id) || isFormDisabled}\n />\n )}\n \n \n \n Tipo de perfil\n \n ) =>\n setFieldValue('roleId', String(e.target.value))\n }\n value={values.roleId}\n >\n {systemRoles?.map((role) => (\n \n \n {role.title}\n \n \n \n {role.description}\n \n \n ))}\n \n \n \n {Boolean(isCreationPage) && (\n \n \n {isCreationPage ? 'Convidar' : 'Salvar'}\n \n \n )}\n \n \n );\n }}\n \n
\n )}\n {\n setUsersFound([]);\n }}\n handleCreateUserAndGenerateSignupUrl={\n handleCreateUserAndGenerateSignupUrl\n }\n onConfirm={handleConfirmRelation}\n />\n {\n setShowUnrelateDialog(false);\n }}\n onConfirm={handleConfirmUnrelate}\n />\n {\n setShowShareActivationLinkDialog(false);\n }}\n onConfirm={() =>\n handleShareActivationMessageClick(\n formikRef.current?.values.phoneNumber ?? ''\n )\n }\n userName={isCreationPage ? formikRef.current?.values.name : userName}\n completeSignupUrl={completeSignupUrl}\n />\n \n );\n};\n\nexport default UserForm;\n","import { FormControl } from '@material-ui/core';\nimport styled, { css } from 'styled-components';\n\nimport { colorMapping, ColorsType } from '../../styles/colorMapping';\nimport type { StyledKeyboardDatePickerProps } from './index';\n\nexport const StyledFormControl = styled(FormControl).attrs(({ variant }) => ({\n variant: variant || 'outlined',\n}))<{\n $color: ColorsType;\n $borderType: StyledKeyboardDatePickerProps['borderType'];\n}>`\n & .MuiInputBase-root {\n color: ${({ $color }) => colorMapping[$color]};\n ${({ $borderType, theme }) =>\n $borderType === 'flat'\n ? css`\n border-radius: ${theme.spacing(0.7)}px;\n `\n : ''}\n\n ${({ $color }) =>\n $color === 'secondary'\n ? css`\n background-color: white;\n `\n : ''}\n }\n & label:not(.Mui-error) {\n color: ${({ $color }) => colorMapping[$color]};\n }\n & input {\n color: ${({ $color }) => colorMapping[$color]};\n }\n & textarea {\n color: ${({ $color }) => colorMapping[$color]};\n }\n & .MuiInputAdornment-root .MuiIconButton-label {\n color: ${({ $color }) => colorMapping[$color]};\n }\n & .MuiOutlinedInput-root:not(.Mui-error) {\n & fieldset {\n border-color: ${({ $color }) => colorMapping[$color]};\n color: ${({ $color }) => colorMapping[$color]};\n }\n &:hover fieldset {\n border-color: ${({ $color }) => colorMapping[$color]};\n color: ${({ $color }) => colorMapping[$color]};\n }\n &.Mui-focused fieldset {\n border-color: ${({ $color }) => colorMapping[$color]};\n color: ${({ $color }) => colorMapping[$color]};\n }\n }\n margin-top: ${({ theme }) => theme.spacing(2)}px;\n margin-bottom: ${({ theme }) => theme.spacing(1)}px;\n`;\n","import DateFnsUtils from '@date-io/date-fns';\nimport { FormHelperText } from '@material-ui/core';\nimport {\n KeyboardDatePicker,\n MuiPickersUtilsProvider,\n} from '@material-ui/pickers';\nimport { KeyboardDatePickerProps } from '@material-ui/pickers/DatePicker';\nimport { useFormikContext } from 'formik';\nimport React from 'react';\nimport { ColorsType } from '../../styles/colorMapping';\nimport { StyledFormControl } from './styles';\n\nexport type StyledKeyboardDatePickerProps = Omit<\n KeyboardDatePickerProps,\n 'color'\n> & {\n color?: ColorsType;\n maxDate?: string;\n borderType?: 'flat' | 'round';\n};\n\nconst StyledKeyboardDatePicker: React.FC = ({\n name,\n label,\n disabled,\n maxDate,\n color = 'primary',\n inputVariant = 'outlined',\n margin = 'normal',\n size = 'small',\n value,\n onChange,\n onBlur,\n borderType = 'round',\n ...props\n}) => {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const { errors, touched } = useFormikContext();\n const hasError = touched[String(name)] && errors[String(name)];\n\n const [selectedDate, setSelectedDate] = React.useState(value || null);\n\n const handleDateChange = (date: Date | null) => {\n onChange(date);\n setSelectedDate(date);\n };\n\n return (\n \n \n <>\n handleDateChange(date)}\n onBlur={onBlur}\n error={Boolean(hasError)}\n size={size}\n {...props}\n maxDate={maxDate}\n disabled={disabled}\n />\n {Boolean(hasError) && (\n {errors[String(name)]}\n )}\n \n \n \n );\n};\n\nexport default StyledKeyboardDatePicker;\n","import { clientSideScheme } from '@cuidador/whitelabel';\nimport { FormControlLabel, Typography } from '@material-ui/core';\nimport styled from 'styled-components';\nimport PasswordTextField from '../../components/PasswordField';\n\nexport const Screen = styled.div`\n background-color: ${({ theme }) => theme.palette.common.white};\n background-size: cover;\n background-position: center;\n padding: ${({ theme }) => theme.spacing(2)}px;\n display: flex;\n flex: 1;\n flex-direction: column;\n button {\n align-self: center;\n }\n`;\n\nexport const Logo = styled.img.attrs(() => {\n const { logoLightUrl } = clientSideScheme();\n return { src: logoLightUrl };\n})`\n width: 100%;\n max-width: 500px;\n max-height: 45px;\n margin-top: ${({ theme }) => theme.spacing(0.5)}px;\n`;\n\nexport const LogoContainer = styled.div`\n display: flex;\n align-items: center;\n justify-content: center;\n width: 100%;\n`;\n\nexport const Header = styled.div`\n background-color: blue;\n`;\n\nexport const Container = styled.div`\n flex-direction: inherit;\n flex: inherit;\n form {\n flex: 1;\n flex-direction: inherit;\n flex: inherit;\n }\n`;\n\nexport const ProfileContainer = styled.div`\n display: flex;\n flex-direction: column;\n margin: ${({ theme }) => theme.spacing(0, 0, 3, 0)};\n`;\n\nexport const Title = styled(Typography).attrs({\n variant: 'h6',\n align: 'center',\n})`\n font-size: 16px;\n font-weight: 500;\n margin: ${({ theme }) => theme.spacing(1, 0)};\n color: ${({ theme }) => theme.palette.secondary.main};\n`;\n\nexport const Subtitle = styled(Typography).attrs({\n variant: 'body2',\n align: 'center',\n})`\n font-weight: bold;\n`;\n\nexport const VisibilityContainer = styled.div<{ $active?: boolean }>`\n display: ${({ $active }) => ($active ? 'inherit' : 'none')};\n flex-direction: inherit;\n flex: inherit;\n form {\n flex: 1;\n display: ${({ $active }) => ($active ? 'inherit' : 'none')};\n flex-direction: inherit;\n flex: inherit;\n }\n`;\n\nexport const StyledFormControlLabel = styled(FormControlLabel)`\n color: ${({ theme }) => theme.palette.secondary.main};\n & a,\n & .MuiIconButton-root {\n color: ${({ theme }) => theme.palette.secondary.main};\n }\n`;\n\nexport const PasswordInstructions = styled(Typography).attrs({\n variant: 'caption',\n})`\n margin: 0;\n & ul {\n margin: 0;\n padding-left: ${({ theme }) => theme.spacing(2)}px;\n list-style-position: inside;\n }\n`;\n\nexport const ButtonContainer = styled.div`\n text-align: center;\n button {\n margin: ${({ theme }) => theme.spacing(0, 1)};\n }\n margin: ${({ theme }) => theme.spacing(4)}px;\n`;\n\nexport const FooterContainer = styled.div`\n flex: 1;\n display: flex;\n flex-direction: column;\n justify-content: flex-end;\n padding: ${({ theme }) => theme.spacing(2)}px;\n`;\n\nexport const SuccessContainer = styled.div`\n flex: 1;\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n button {\n align-self: center;\n }\n`;\n\nexport const StyledFormikTextPassword = styled(PasswordTextField)`\n & label:not(.Mui-error) {\n color: grey;\n }\n & input {\n color: black;\n ::-webkit-calendar-picker-indicator {\n filter: invert(1);\n }\n }\n & textarea {\n color: black;\n }\n & .MuiInputAdornment-root .MuiIconButton-label {\n color: black;\n }\n & .MuiOutlinedInput-root:not(.Mui-error) {\n & fieldset {\n border-color: black;\n color: black;\n }\n &:hover fieldset {\n border-color: black;\n color: black;\n }\n &.Mui-focused fieldset {\n border-color: black;\n color: black;\n }\n }\n`;\n\nexport const StyledError = styled(Typography)`\n color: ${({ theme }) => theme.palette.error.main};\n font-size: 1em;\n`;\n\nexport const MessageContainer = styled.div`\n padding: ${({ theme }) => theme.spacing(0, 1)};\n`;\n\nexport const ContentContainer = styled.div`\n margin-top: ${({ theme }) => theme.spacing(3)}px;\n width: 100%;\n display: flex;\n align-items: center;\n flex-direction: column;\n`;\n","import { UserModel } from '@cuidador/database';\nimport * as Sentry from '@sentry/react';\nimport { format } from 'date-fns';\nimport jwt from 'jsonwebtoken';\nimport * as yup from 'yup';\nimport { CompleteSignupBody } from '../../hooks/useUser';\nimport {\n numberMask,\n phoneMask,\n validateCpf,\n validatePasswordStrength,\n} from '../../utils/inputs';\n\nexport type PersonalDataFormValues = typeof personalDataInitialValues;\n\nexport const resolveValidationSchema = () => {\n return defaultValidationSchema;\n};\n\nexport const personalDataInitialValues: {\n picture: File | null;\n name: UserModel['name'];\n cpf: NonNullable;\n email: UserModel['email'];\n phoneNumber: UserModel['phoneNumber'];\n gender: UserModel['gender'] | '';\n dateOfBirth: UserModel['dateOfBirth'];\n} = {\n picture: null,\n name: '',\n cpf: '',\n email: '',\n phoneNumber: '',\n gender: '',\n dateOfBirth: '',\n};\n\nconst personalDataValidationSchema = {\n name: yup\n .string()\n .required('Por favor, insira o nome completo')\n .min(3, 'O nome deve conter ao menos 3 caracteres')\n .test(\n 'isFullName',\n 'Por favor, insira o nome completo',\n (value) => (value || '').split(' ').length > 1\n ),\n cpf: yup\n .string()\n .required('Por favor, insira o CPF')\n .test('isCpfValid', 'Por favor, insira um CPF válido', (value) =>\n validateCpf(value || '')\n ),\n email: yup\n .string()\n .required('Por favor, insira um email')\n .email('Por favor, insira um e-mail válido'),\n phoneNumber: yup\n .string()\n .required('Por favor, insira um telefone')\n .min(14, 'Por favor, insira um telefone válido')\n .max(15, 'Por favor, insira um telefone válido'),\n gender: yup\n .string()\n .required('Por favor, insira o sexo')\n .oneOf(['male', 'female', 'other']),\n dateOfBirth: yup\n .date()\n .required('Por favor, insira a data de nascimento')\n .max(new Date(), 'Por favor, insira uma data anterior a hoje')\n .nullable()\n .typeError('Por favor, insira uma data válida'),\n};\n\nexport type PasswordFormValues = {\n password: string;\n passwordConfirmation: string;\n termsAccepted: boolean;\n};\n\nexport const passwordInitialValues = {\n password: '',\n passwordConfirmation: '',\n termsAccepted: false,\n};\n\nconst passwordValidationSchema = {\n password: yup\n .string()\n .required('Por favor, insira a senha')\n .test(\n 'isValidPassword',\n 'Por favor, insira uma senha que atenda aos critérios listados abaixo',\n (value) => validatePasswordStrength(value || '')\n ),\n passwordConfirmation: yup\n .string()\n .required('Por favor, insira a confirmação da senha')\n .oneOf([yup.ref('password'), ''], 'As senhas devem ser iguais'),\n termsAccepted: yup\n .boolean()\n .equals(\n [true],\n 'Por favor, leia e aceite nossos termos e políticas de privacidade'\n ),\n};\n\nexport const genderOptions = [\n { value: 'male', label: 'Masculino' },\n { value: 'female', label: 'Feminino' },\n { value: 'other', label: 'N/A' },\n];\n\nexport type FormValues = PersonalDataFormValues & PasswordFormValues;\n\nexport const formDataToCompleteSignupRequest = (\n values: FormValues\n): CompleteSignupBody => ({\n userData: resolveUserData(values),\n});\n\nconst resolveUserData = (values: FormValues): UserModel => {\n return {\n name: values.name,\n cpf: numberMask(values.cpf),\n email: values.email,\n phoneNumber: numberMask(`55${values.phoneNumber}`),\n password: values.password,\n gender: values.gender || 'other', // [TODO] Change 'other' to 'not-informed' when exists\n dateOfBirth: format(new Date(values.dateOfBirth || ''), 'yyyy-MM-dd'),\n };\n};\n\nexport type CompleteSignupTokenPayload = {\n id: number;\n roleId: number;\n name: UserModel['name'];\n cpf: NonNullable;\n phoneNumber: UserModel['phoneNumber'];\n email: UserModel['email'];\n};\n\nexport const resolvePendingSignupJWTData = (\n token: string\n): CompleteSignupTokenPayload | null => {\n try {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const payload = jwt.decode(token) as any;\n return {\n id: payload.id,\n roleId: payload.roleId,\n name: payload.name || '',\n cpf: payload.cpf || '',\n phoneNumber: phoneMask(payload.phoneNumber || ''),\n email: payload.email || '',\n };\n } catch (err) {\n Sentry.captureException(err);\n return null;\n }\n};\n\nconst defaultValidationSchema = yup.object().shape({\n ...personalDataValidationSchema,\n ...passwordValidationSchema,\n});\n\nexport const formInitialValues = {\n ...personalDataInitialValues,\n ...passwordInitialValues,\n};\n","import { APIError } from '@cuidador/lib';\nimport { Checkbox, FormHelperText } from '@material-ui/core';\nimport * as Sentry from '@sentry/react';\nimport { AxiosError } from 'axios';\nimport { format } from 'date-fns';\nimport { Form, Formik, FormikErrors, FormikProps } from 'formik';\nimport qs from 'query-string';\nimport React, { useContext, useEffect, useMemo, useRef, useState } from 'react';\nimport { useHistory, useLocation } from 'react-router-dom';\nimport { toast } from 'react-toastify';\nimport {\n FormCardContainer,\n StyledBoldTitle,\n StyledFormikSelect,\n StyledFormikTextField,\n StyledFormikTextPassword,\n} from '../../components/FormCardContainer';\nimport FormikSelectField from '../../components/Forms/FormikSelect';\nimport FormikTextField from '../../components/Forms/FormikTextField';\nimport MedicBalloon from '../../components/MedicBalloon';\nimport PasswordRules from '../../components/PasswordRules';\nimport StyledButton from '../../components/StyledButton';\nimport StyledKeyboardDatePicker from '../../components/StyledKeyboardDatePicker';\nimport StyledMenuItem from '../../components/StyledMenuItem';\nimport { AuthContext } from '../../contexts/auth';\nimport useUser from '../../hooks/useUser';\nimport { resolveErrorMessage } from '../../utils/error';\nimport { cpfMask, numberMask, phoneMask } from '../../utils/inputs';\nimport {\n ButtonContainer,\n Container,\n ContentContainer,\n FooterContainer,\n Logo,\n LogoContainer,\n MessageContainer,\n Screen,\n StyledFormControlLabel,\n} from './styles';\nimport {\n formDataToCompleteSignupRequest,\n formInitialValues,\n FormValues,\n genderOptions,\n resolvePendingSignupJWTData,\n resolveValidationSchema,\n} from './utils';\nimport { Header } from '../../components/Header'\nimport { PscButton } from '../../components/PscButton'\n\nconst CompleteSignup: React.FC = () => {\n const history = useHistory();\n const location = useLocation();\n const formikFormRef = useRef | null>(null);\n\n const { completeSignup, uploadProfilePicture, checkSignupStatus } = useUser();\n const { signIn, error: signInError } = useContext(AuthContext);\n const [loading, setLoading] = useState(false);\n const [validationError, setValidationError] = useState(false);\n\n const { token: completeSignupToken } = qs.parse(location.search);\n\n const completeSignupTokenPayload = useMemo(() => {\n // avoids access without valid token\n if (completeSignupToken == null) {\n redirectToHome();\n return;\n }\n\n const payload = resolvePendingSignupJWTData(String(completeSignupToken));\n\n if (!payload) {\n // Invalid token\n }\n\n return payload;\n }, [completeSignupToken]);\n\n const userIdFromTokenPayload = Number(completeSignupTokenPayload?.id);\n\n function redirectToHome() {\n history.replace('/');\n }\n\n useEffect(\n function removeLoadingOnSignInError() {\n if (signInError) {\n toast.error(resolveErrorMessage(signInError));\n setLoading(false);\n }\n },\n [signInError]\n );\n\n useEffect(() => {\n checkSignupStatus(userIdFromTokenPayload)\n .then(({ hasCompletedSignup }) => {\n if (hasCompletedSignup) history.replace('/login');\n })\n .catch(console.error);\n }, [userIdFromTokenPayload]);\n\n const handleSignIn = () => {\n const { cpf } = formikFormRef.current?.values as FormValues;\n const { password } = formikFormRef.current?.values as FormValues;\n return signIn(numberMask(cpf || ''), password);\n };\n\n const handleUploadProfilePicture = (picture: File, userId: number) => {\n return new Promise((resolve) => {\n setTimeout(async () => {\n try {\n await uploadProfilePicture(picture, userId);\n resolve();\n } catch (err) {\n toast.error(\n 'Houve um erro durante o envio de sua imagem, tente novamente acessando seu perfil'\n );\n Sentry.captureException(err);\n }\n }, 0);\n });\n };\n\n const handleCompleteSignupSubmit = async () => {\n setLoading(true)\n const formData = formikFormRef.current?.values as FormValues;\n\n return completeSignup(\n formDataToCompleteSignupRequest(formData),\n String(completeSignupToken)\n )\n .then(async (response) => {\n await handleSignIn();\n return response;\n })\n .then(async ({ data }) => {\n if (formData?.picture != null) {\n await handleUploadProfilePicture(formData.picture, data.id);\n }\n })\n .catch((err: AxiosError) => {\n const displayMessage = resolveErrorMessage(err);\n const fieldError = err.response?.data.context?.key;\n if (fieldError) {\n if (Object.keys(formInitialValues).includes(fieldError)) {\n formikFormRef.current?.setFieldError(\n fieldError,\n displayMessage || ''\n );\n }\n } else {\n toast.error(displayMessage);\n }\n })\n .finally(() => {\n setLoading(false);\n });\n };\n\n return (\n <>\n \n \n \n }\n rightContent={}\n />\n \n \n \n \n \n (formikFormRef.current = ref)}\n initialValues={{\n ...formInitialValues,\n ...completeSignupTokenPayload,\n }}\n validationSchema={resolveValidationSchema()}\n onSubmit={handleCompleteSignupSubmit}\n >\n {({ values, setFieldValue, errors, handleBlur }) => (\n
\n \n \n\n \n\n \n
\n \n setFieldValue(\n 'termsAccepted',\n !values.termsAccepted\n )\n }\n />\n }\n label={\n \n Eu li e aceito os Termos de Uso e Políticas de\n Privacidade\n \n }\n />\n {errors.termsAccepted && (\n \n {errors.termsAccepted}\n \n )}\n
\n\n \n setValidationError(true)}\n >\n Criar conta\n \n \n
\n
\n
\n )}\n \n
\n
\n \n );\n};\n\nconst PersonalDataStepContainer: React.FC<{\n setFieldValue: (field: string, value: string | File | Date | null) => void;\n values: FormValues;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n handleBlur: any;\n errors: FormikErrors;\n}> = ({ values, setFieldValue, handleBlur }) => {\n const finalDate = format(new Date('12/31/9999'), 'yyyy-MM-dd');\n\n return (\n <>\n {/* TODO: Add profile picture for appF? */}\n \n \n Informações pessoais\n \n\n \n \n \n ) => {\n setFieldValue('phoneNumber', phoneMask(e.target.value));\n }}\n />\n }\n name=\"gender\"\n label=\"Sexo\"\n color=\"secondary\"\n SelectDisplayProps={{\n 'data-testid': 'gender',\n }}\n >\n {genderOptions.map((item) => (\n \n {item.label}\n \n ))}\n \n {\n setFieldValue('dateOfBirth', date);\n }}\n placeholder=\"dd/mm/aaaa\"\n margin=\"normal\"\n size=\"medium\"\n inputProps={{\n 'data-testid': 'dateOfBirth',\n max: finalDate,\n }}\n onBlur={handleBlur}\n InputLabelProps={{ shrink: true }}\n borderType=\"flat\"\n />\n \n \n );\n};\n\nconst PasswordStepContainer: React.FC<{\n values: FormValues;\n validationError: boolean;\n}> = ({ values, validationError }) => {\n return (\n \n Crie sua senha\n\n \n \n \n \n );\n};\n\nexport default CompleteSignup;\n","import { Typography } from '@material-ui/core';\nimport Link from '@material-ui/core/Link';\nimport styled from 'styled-components';\nimport StyledPaper from '../StyledPaper';\n\nexport const CardBox = styled(StyledPaper)`\n display: flex;\n justify-content: space-between;\n margin: 0;\n padding: ${({ theme }) => theme.spacing(0, 0, 0, 2)};\n margin-bottom: ${({ theme }) => theme.spacing(2)}px;\n overflow: hidden;\n width: 100%;\n`;\n\nexport const TypographyContainer = styled.div`\n color: ${({ theme }) => theme.palette.extra.color.grey.dark};\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n overflow: hidden;\n padding-bottom: ${({ theme }) => theme.spacing(1)}px;\n`;\n\nexport const Title = styled(Typography)`\n margin: ${({ theme }) => theme.spacing(1, 0, 0.5, 0)};\n font-weight: bold;\n line-height: 1;\n`;\n\nexport const SubTitle = styled(Typography)`\n color: #696969;\n font-weight: bold;\n line-height: 1;\n`;\n\nexport const Instruction = styled(Typography)`\n line-height: 1;\n margin-bottom: ${({ theme }) => theme.spacing(1)}px;\n`;\n\nexport const ContactText = styled(Typography)`\n line-height: 1;\n font-weight: normal;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n`;\n\nexport const StyledLink = styled(Link)`\n color: ${({ theme }) => theme.palette.secondary.main};\n font-weight: bold;\n margin-top: ${({ theme }) => theme.spacing(1)}px;\n display: flex;\n align-items: center;\n\n & svg {\n margin-left: ${({ theme }) => theme.spacing(1)}px;\n }\n`;\nexport const LinksContainer = styled.div`\n display: flex;\n flex-direction: column;\n margin-left: ${({ theme }) => theme.spacing(2)}px;\n`;\n\nexport const StyledPhoneContainer = styled.a`\n display: flex;\n flex: 1;\n min-height: 0;\n flex-direction: column;\n text-decoration: none;\n background-color: ${({ theme }) => theme.palette.info.main};\n text-align: center;\n justify-content: center;\n align-items: center;\n padding: ${({ theme }) => theme.spacing(2, 1)};\n &:hover {\n cursor: pointer;\n }\n min-width: ${({ theme }) => theme.spacing(10)}px;\n color: ${({ theme }) => theme.palette.extra.color.grey.light};\n text-decoration: none;\n`;\n\nexport const StyledOpenWhatsappContainer = styled.div`\n display: flex;\n flex: 1;\n flex-basis: 0;\n min-height: 0;\n background-color: ${({ theme }) => theme.palette.extra.color.green};\n flex-direction: column;\n padding: ${({ theme }) => theme.spacing(2, 1)};\n justify-content: center;\n align-items: center;\n color: ${({ theme }) => theme.palette.extra.color.grey.light};\n &:hover {\n cursor: pointer;\n }\n min-width: ${({ theme }) => theme.spacing(10)}px;\n`;\n\nexport const StyledOpenLinkContainer = styled.div`\n display: flex;\n flex: 1;\n flex-basis: 0;\n min-height: 0;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n background-color: ${({ theme }) => theme.palette.secondary.main};\n color: ${({ theme }) => theme.palette.extra.color.grey.light};\n padding: ${({ theme }) => theme.spacing(2, 1)};\n white-space: nowrap;\n\n &:hover {\n cursor: pointer;\n }\n min-width: ${({ theme }) => theme.spacing(10)}px;\n`;\n\nexport const Contact = styled.div`\n display: flex;\n flex-direction: row;\n align-items: center;\n svg {\n width: 16px;\n height: 16px;\n margin-right: ${({ theme }) => theme.spacing(0.5)}px;\n }\n`;\n","import Typography from '@material-ui/core/Typography';\nimport { Language, Launch, Phone, WhatsApp } from '@material-ui/icons';\nimport EditIcon from '@material-ui/icons/Edit';\nimport React from 'react';\nimport { useTheme } from 'styled-components';\nimport { phoneMask } from '../../utils/inputs';\nimport {\n CardBox,\n Contact,\n ContactText,\n Instruction,\n LinksContainer,\n StyledLink,\n StyledOpenLinkContainer,\n StyledOpenWhatsappContainer,\n StyledPhoneContainer,\n SubTitle,\n Title,\n TypographyContainer,\n} from './styles';\n\ninterface CardProps {\n id?: Id;\n name?: string;\n relevantInformation?: string;\n callingCondition?: string;\n warning?: boolean;\n support?: boolean;\n phoneNumber?: string;\n link?: string;\n isWhatsapp?: boolean;\n}\n\nconst ContactsCard: React.FC = ({\n id,\n name,\n relevantInformation,\n callingCondition,\n warning,\n support,\n phoneNumber,\n link,\n isWhatsapp,\n}) => {\n const theme = useTheme();\n const color = warning\n ? `${theme.palette.extra.color.yellow}`\n : support\n ? `${theme.palette.primary.light}`\n : `${theme.palette.common.white}`;\n\n const maskedPhoneNumber = warning ? phoneNumber : phoneMask(`${phoneNumber}`);\n\n return (\n \n \n {name}\n {callingCondition && (\n
\n \n Em qual caso entrar em contato?\n \n {callingCondition}\n
\n )}\n {relevantInformation && (\n
\n Observação:\n {relevantInformation}\n
\n )}\n {phoneNumber && (\n \n \n {maskedPhoneNumber}\n \n )}\n {link && (\n \n \n \n {link.replace(/https?:\\/\\//, '') + '/consulta'}\n \n \n )}\n\n {id && (\n \n Editar contato \n \n )}\n
\n \n {phoneNumber && (\n <>\n \n \n {'Ligar'}\n \n\n {!!isWhatsapp && (\n \n window.open(\n `https://api.whatsapp.com/send/?phone=${phoneNumber}`\n )\n }\n >\n \n Whatsapp\n \n )}\n \n )}\n {link && (\n window.open(link, '_blank')}>\n \n Abrir Link\n \n )}\n \n \n );\n};\n\nexport default ContactsCard;\n","import styled from 'styled-components';\nimport {\n Backdrop as MaterialBackdrop,\n CircularProgress as MaterialCircularProgress,\n} from '@material-ui/core';\nimport Typography from '@material-ui/core/Typography';\nimport { Link } from 'react-router-dom';\n\nexport const Container = styled.div`\n display: flex;\n flex-direction: column;\n flex: 1;\n align-items: center;\n padding: ${({ theme }) => theme.spacing(2, 4)};\n`;\n\nexport const StyledLink = styled(Link)`\n text-decoration: none;\n width: 100%;\n display: flex;\n`;\n\nexport const StyledContainer = styled.div`\n text-decoration: none;\n width: 100%;\n display: flex;\n`;\n\nexport const Backdrop = styled(MaterialBackdrop)`\n z-index: ${({ theme }) => theme.zIndex.drawer + 1};\n color: ${({ theme }) => theme.palette.primary.light};\n position: absolute;\n`;\n\nexport const BackdropCircularProgress = styled(MaterialCircularProgress).attrs({\n color: 'inherit',\n})``;\n\nexport const TypographyContainer = styled.div`\n width: 100%;\n text-align: center;\n color: ${({ theme }) => theme.palette.primary.main};\n padding-bottom: ${({ theme }) => theme.spacing(3)}px;\n`;\n\nexport const StyledTypography = styled(Typography)`\n color: ${({ theme }) => theme.palette.primary.dark};\n`;\n","function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\nimport * as React from \"react\";\n\nvar _ref2 = /*#__PURE__*/React.createElement(\"rect\", {\n width: 21.4286,\n height: 5,\n rx: 2,\n fill: \"white\"\n});\n\nvar _ref3 = /*#__PURE__*/React.createElement(\"rect\", {\n y: 8,\n width: 21.4286,\n height: 5,\n rx: 2,\n fill: \"white\"\n});\n\nvar _ref4 = /*#__PURE__*/React.createElement(\"rect\", {\n y: 16,\n width: 21.4286,\n height: 5,\n rx: 2,\n fill: \"white\"\n});\n\nfunction SvgBurgerMenu(_ref, svgRef) {\n var title = _ref.title,\n titleId = _ref.titleId,\n props = _objectWithoutProperties(_ref, [\"title\", \"titleId\"]);\n\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n width: 22,\n height: 21,\n viewBox: \"0 0 22 21\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, _ref2, _ref3, _ref4);\n}\n\nvar ForwardRef = /*#__PURE__*/React.forwardRef(SvgBurgerMenu);\nexport default __webpack_public_path__ + \"static/media/burger-menu.a8176db9.svg\";\nexport { ForwardRef as ReactComponent };","import React from 'react'\nimport { StyledIconButton } from '../StyledIconButton'\nimport { ReactComponent as MenuIcon } from '../../assets/burger-menu.svg'\n\nexport type MenuButtonProps = {\n action: () => void\n}\n\nexport function MenuButton (props: MenuButtonProps) {\n const { action } = props\n\n return (\n \n }\n action={() => action()}\n />\n )\n}\n","function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\nimport * as React from \"react\";\n\nvar _ref2 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M3 2C3.26522 2 3.51957 1.89464 3.70711 1.70711C3.89464 1.51957 4 1.26522 4 1C4 0.734784 3.89464 0.48043 3.70711 0.292893C3.51957 0.105357 3.26522 0 3 0H1C0.734784 0 0.48043 0.105357 0.292893 0.292893C0.105357 0.48043 0 0.734784 0 1V15C0 15.2652 0.105357 15.5196 0.292893 15.7071C0.48043 15.8946 0.734784 16 1 16H3C3.26522 16 3.51957 15.8946 3.70711 15.7071C3.89464 15.5196 4 15.2652 4 15C4 14.7348 3.89464 14.4804 3.70711 14.2929C3.51957 14.1054 3.26522 14 3 14H2V2H3ZM16.82 7.42L14 3.42C13.8471 3.20441 13.615 3.05814 13.3545 3.01317C13.0941 2.9682 12.8264 3.02818 12.61 3.18C12.5018 3.25579 12.4098 3.35224 12.3391 3.46381C12.2684 3.57537 12.2206 3.69982 12.1982 3.82998C12.1759 3.96015 12.1796 4.09344 12.2091 4.22217C12.2386 4.3509 12.2933 4.47252 12.37 4.58L14.09 7H6C5.73478 7 5.48043 7.10536 5.29289 7.29289C5.10536 7.48043 5 7.73478 5 8C5 8.26522 5.10536 8.51957 5.29289 8.70711C5.48043 8.89464 5.73478 9 6 9H14L12.2 11.4C12.1212 11.5051 12.0639 11.6246 12.0313 11.7518C11.9987 11.879 11.9915 12.0114 12.01 12.1414C12.0286 12.2714 12.0726 12.3965 12.1395 12.5095C12.2064 12.6225 12.2949 12.7212 12.4 12.8C12.5731 12.9298 12.7836 13 13 13C13.1552 13 13.3084 12.9639 13.4472 12.8944C13.5861 12.825 13.7069 12.7242 13.8 12.6L16.8 8.6C16.9281 8.43087 16.999 8.22539 17.0026 8.01326C17.0062 7.80114 16.9423 7.59338 16.82 7.42Z\",\n fill: \"white\"\n});\n\nfunction SvgSignOutIcon(_ref, svgRef) {\n var title = _ref.title,\n titleId = _ref.titleId,\n props = _objectWithoutProperties(_ref, [\"title\", \"titleId\"]);\n\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n width: 18,\n height: 16,\n viewBox: \"0 0 18 16\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, _ref2);\n}\n\nvar ForwardRef = /*#__PURE__*/React.forwardRef(SvgSignOutIcon);\nexport default __webpack_public_path__ + \"static/media/sign-out-icon.d96f48c9.svg\";\nexport { ForwardRef as ReactComponent };","import { clientSideScheme } from '@cuidador/whitelabel';\nimport {\n Drawer,\n IconButton,\n Link,\n List,\n ListItem,\n ListItemText,\n} from '@material-ui/core';\nimport { Close, Person, Work } from '@material-ui/icons';\nimport FileIcon from '@material-ui/icons/InsertDriveFile';\nimport { Link as defaultLink } from 'react-router-dom';\nimport styled from 'styled-components';\n\nexport const StyledDrawer = styled(Drawer)`\n display: flex;\n\n .MuiDrawer-paper {\n max-width: 300px;\n width: 100%;\n }\n`;\n\nexport const StyledCloseIcon = styled(Close)`\n color: ${({ theme }) => theme.palette.common.white};\n`;\n\nexport const StyledPersonIcon = styled(Person)`\n color: ${({ theme }) => theme.palette.primary.main};\n`;\n\nexport const StyledFileIcon = styled(FileIcon)`\n color: ${({ theme }) => theme.palette.primary.main};\n`;\n\nexport const StyledWorkIcon = styled(Work)`\n color: ${({ theme }) => theme.palette.primary.main};\n`;\n\nexport const StyledLogoBlock = styled.img.attrs(() => {\n const { logoLightUrl } = clientSideScheme();\n return { src: logoLightUrl };\n})`\n max-width: 200px;\n max-height: 20px;\n margin-top: ${({ theme }) => theme.spacing(0.75)}px;\n width: 100%;\n margin-bottom: ${({ theme }) => theme.spacing(0.75)}px;\n`;\n\nexport const DrawerHeader = styled.div`\n background-color: ${({ theme }) => theme.palette.primary.main};\n display: flex;\n align-items: center;\n max-height: 72px;\n`;\n\nexport const StyledList = styled(List)`\n padding: 0;\n`;\n\nexport const StyledListItem = styled(ListItem)`\n &:hover {\n background-color: ${({ theme }) => theme.palette.primary.light};\n }\n`;\n\nexport const StyledListItemText = styled(ListItemText)`\n color: ${({ theme }) => theme.palette.primary.main};\n`;\n\nexport const StyledLink = styled(defaultLink)`\n text-decoration: none;\n`;\n\nexport const StyledHrefLink = styled(Link)`\n text-decoration: none;\n\n &:hover {\n text-decoration: none;\n }\n`;\n\nexport const AppItemTitle = styled.span`\n color: ${({ theme }) => theme.palette.primary.main};\n font-size: 16px;\n font-weight: 600;\n margin-bottom: ${({ theme }) => theme.spacing(0.5)}px;\n`;\n\nexport const AppItemLabel = styled.span`\n color: ${({ theme }) => theme.palette.primary.main};\n font-size: 12px;\n`;\n\nexport const AppIcon = styled.img`\n height: 25px;\n width: 25px;\n margin-left: ${({ theme }) => theme.spacing(0.2)}px;\n`;\n\nexport const TextContainer = styled.div`\n display: flex;\n flex-direction: column;\n margin-left: ${({ theme }) => theme.spacing(0.2)}px;\n`;\n\nexport const DrawerBody = styled.div`\n flex: 1;\n`;\n\nexport const DrawerFooter = styled.div`\n background-color: ${({ theme }) => theme.palette.primary.main};\n padding-inline: ${({ theme }) => theme.spacing(2)}px;\n`;\n\nexport const DrawerButton = styled(IconButton)`\n color: ${({ theme }) => theme.palette.common.white}f;\n border-radius: 0;\n font-size: 16px;\n display: flex;\n align-items: center;\n`;\n\nexport const DrawerFooterText = styled.span`\n margin-left: ${({ theme }) => theme.spacing(2)}px;\n`;\n\nexport const HealthProductsIconWithMargin = styled.img`\n margin-left: 5px;\n`;\n","import React from 'react';\nimport { ListItemIcon } from '@material-ui/core';\nimport {\n TextContainer,\n StyledListItem,\n AppItemTitle,\n AppItemLabel,\n} from '../styles';\n\ninterface AppShortcutProps {\n label: string;\n icon: JSX.Element;\n}\n\nconst AppShortcut: React.FC = ({ label, icon }) => {\n return (\n \n {icon}\n \n Trocar de app\n {label}\n \n \n );\n};\n\nexport default AppShortcut;\n","import React from 'react';\nimport SvgIcon, { SvgIconProps } from '@material-ui/core/SvgIcon/SvgIcon';\nimport { clientSideScheme } from '@cuidador/whitelabel';\n\nexport function UserIcon(props: SvgIconProps) {\n const scheme = clientSideScheme();\n\n return (\n \n \n \n \n \n \n );\n}\n","import React from 'react';\nimport SvgIcon, { SvgIconProps } from '@material-ui/core/SvgIcon/SvgIcon';\nimport { clientSideScheme } from '@cuidador/whitelabel';\n\nexport function FileIcon(props: SvgIconProps) {\n const scheme = clientSideScheme();\n\n return (\n \n \n \n \n \n \n );\n}\n","import React from 'react';\nimport SvgIcon, { SvgIconProps } from '@material-ui/core/SvgIcon/SvgIcon';\nimport { clientSideScheme } from '@cuidador/whitelabel';\n\nexport function CaseIcon(props: SvgIconProps) {\n const scheme = clientSideScheme();\n\n return (\n \n \n \n \n \n \n );\n}\n","import React from 'react';\nimport SvgIcon, { SvgIconProps } from '@material-ui/core/SvgIcon/SvgIcon';\nimport { clientSideScheme } from '@cuidador/whitelabel';\n\nexport function HandIcon(props: SvgIconProps) {\n const scheme = clientSideScheme();\n\n return (\n \n \n \n \n \n );\n}\n","import React from 'react';\nimport SvgIcon, { SvgIconProps } from '@material-ui/core/SvgIcon/SvgIcon';\nimport { clientSideScheme } from '@cuidador/whitelabel';\n\nexport function ShareIcon(props: SvgIconProps) {\n const scheme = clientSideScheme();\n\n return (\n \n \n \n \n \n \n \n \n \n );\n}\n","import { clientSideScheme } from '@cuidador/whitelabel';\nimport { IconButton, ListItemIcon } from '@material-ui/core';\nimport React, { useContext, useState } from 'react';\nimport { ReactComponent as SignOutIcon } from '../../assets/sign-out-icon.svg';\nimport AppShortcut from './AppSchortcut';\nimport {\n AppIcon,\n DrawerBody,\n DrawerButton,\n DrawerFooter,\n DrawerFooterText,\n DrawerHeader,\n StyledCloseIcon,\n StyledDrawer,\n StyledHrefLink,\n StyledLink,\n StyledList,\n StyledListItem,\n StyledListItemText,\n StyledLogoBlock,\n} from './styles';\nimport { UserIcon } from './SideMenuIcons/userIcon';\nimport { FileIcon } from './SideMenuIcons/fileIcon';\nimport { CaseIcon } from './SideMenuIcons/caseIcon';\nimport { HandIcon } from './SideMenuIcons/handIcon';\nimport { ShareIcon } from './SideMenuIcons/shareIcon';\nimport { AuthContext } from '../../contexts/auth';\nimport LogoutDialog from '../LogoutDialog';\nimport useCanAccess from '../../hooks/useCanAccess';\n\ninterface SideMenuProps {\n handleToggleSideMenu: () => void;\n isSideMenuOpen: boolean;\n}\n\nexport function SideMenu(props: SideMenuProps) {\n const { handleToggleSideMenu, isSideMenuOpen } = props;\n const { isAllowedToRead: isAllowedToReadSubscription } = useCanAccess(\n 'user/subscription'\n );\n const { signOut, userInfo } = useContext(AuthContext);\n const { appCShortcutIconUrl, appCUrl } = clientSideScheme();\n\n const isCaregiverAppAccess = userInfo?.user?.role?.caregiverAppAccess;\n const [isLogoutDialogOpen, setIsLogoutDialogOpen] = useState(false);\n\n const handleToggleLogoutDialog = () => {\n setIsLogoutDialogOpen(!isLogoutDialogOpen);\n };\n\n return (\n <>\n {\n handleToggleSideMenu();\n }}\n >\n \n {\n handleToggleSideMenu();\n }}\n >\n \n \n \n \n \n \n \n \n \n \n \n {'Minha conta'}\n \n \n \n \n \n \n \n {'Termos de uso'}\n \n \n {isAllowedToReadSubscription && (\n \n \n \n \n \n {'Plano'}\n \n \n )}\n \n \n \n \n \n {'Serviços de saúde'}\n \n \n \n \n \n \n \n {'Produtos de saúde'}\n \n \n {Boolean(isCaregiverAppAccess) && (\n \n }\n label={'Ir para o app de Cuidados'}\n />\n \n )}\n \n \n \n {\n handleToggleLogoutDialog();\n }}\n >\n \n Sair da conta\n \n \n \n \n \n );\n}\n\nexport default SideMenu;\n","import { EmergencyContactModel } from '@cuidador/database'\nimport AddIcon from '@material-ui/icons/AddRounded'\nimport React, { useContext, useEffect, useState } from 'react'\nimport { useHistory } from 'react-router-dom'\nimport { toast } from 'react-toastify'\nimport EmergencyContacts from '../../components/EmergencyContactCard'\nimport Fab from '../../components/Fab'\nimport MedicBalloon from '../../components/MedicBalloon'\nimport PendingRegistrationBanner from '../../components/PendingRegistrationBanner'\nimport { AuthContext } from '../../contexts/auth'\nimport useCanAccess from '../../hooks/useCanAccess'\nimport useEmergencyContacts from '../../hooks/useEmergencyContacts'\nimport { Backdrop, BackdropCircularProgress, Container } from './styles'\nimport { Header } from '../../components/Header'\nimport { PageTitle } from '../../components/PageTitle'\nimport { BackButton } from '../../components/BackButton'\nimport { PscButton } from '../../components/PscButton'\nimport { MenuButton } from '../../components/MenuButton'\nimport { SideMenu } from '../../components/SideMenu'\n\nconst EmergencyContactsCard: React.FC<{\n contacts: EmergencyContactModel\n}> = ({ contacts }) => {\n return \n}\n\nconst WHATSAPP_NUMBER = '5511919006699'\n\nconst Contacts: React.FC = () => {\n const [isMenuOpen, setMenuOpen] = useState(false)\n const { userInfo } = useContext(AuthContext)\n const { getAllByPatientId, byId, ids, loading } = useEmergencyContacts()\n const { isAllowedToCreate } = useCanAccess('care/emergency-contact')\n const history = useHistory()\n const FAQ_URL =\n 'https://www.cuidadordeconfianca.com.br/perguntas-frequentes-aplicativo'\n\n const patientId = userInfo?.activePatientId\n\n const { isAllowedToRead: isAllowedToReadEmercencyContact } = useCanAccess(\n 'care/emergency-contact'\n )\n\n useEffect(() => {\n if (!isAllowedToReadEmercencyContact) {\n toast.error('Você não tem permissão para visualizar essa página')\n history.goBack()\n return\n }\n if (!patientId) return\n getAllByPatientId(patientId)\n }, [patientId])\n\n if (loading) {\n return (\n \n {loading && (\n \n )}\n \n )\n }\n\n return (\n <>\n setMenuOpen(false)}\n />\n setMenuOpen(true)} />}\n centerContent={\n \n }\n rightContent={}\n />\n \n \n \n \n \n \n \n {ids\n .map((id) => byId[id])\n .map((contacts) => (\n \n ))}\n\n {isAllowedToCreate && (\n \n \n \n )}\n \n \n )\n}\n\nexport default Contacts\n","import { Checkbox, Typography } from '@material-ui/core';\nimport { Form as FormikForm } from 'formik';\nimport { Link } from 'react-router-dom';\nimport styled from 'styled-components';\n\nexport const Form = styled(FormikForm)`\n display: flex;\n flex: 1;\n flex-direction: column;\n width: 100%;\n color: ${({ theme }) => theme.palette.secondary.main};\n`;\n\nexport const TypographyContainer = styled.div`\n max-width: 100%;\n text-align: center;\n`;\n\nexport const StyledLink = styled(Link)`\n text-decoration: none;\n`;\n\nexport const Centralizer = styled.div`\n align-items: center;\n flex-direction: column;\n display: flex;\n flex: 1;\n justify-content: flex-end;\n`;\n\nexport const ContentContainer = styled.div`\n margin-top: ${({ theme }) => theme.spacing(3)}px;\n width: 100%;\n display: flex;\n align-items: center;\n flex-direction: column;\n`;\n\nexport const BlackTypography = styled(Typography)`\n color: ${({ theme }) => theme.palette.extra.color.grey.dark};\n`;\n\nexport const StyledCheckbox = styled(Checkbox)`\n color: ${(props) => props.theme.palette.secondary.main};\n`;\n","import * as Yup from 'yup';\nimport { numberMask, phoneMask } from '../../utils/inputs';\n\nexport interface FormValues {\n name?: string;\n phoneNumber?: string;\n callingCondition?: string;\n relevantInformation?: string;\n link?: string;\n isWhatsapp?: boolean;\n}\n\nexport const validationSchema = Yup.object().shape({\n name: Yup.string().required('Por favor, insira um nome do contato.'),\n phoneNumber: Yup.string(),\n callingCondition: Yup.string(),\n link: Yup.string()\n .max(255, 'O link não pode ter mais de 255 caracteres.')\n .nullable(),\n isWhatsapp: Yup.boolean(),\n});\n\nexport const formDataToEmergencyContactsModel = (\n values: FormValues,\n patientId: Id\n) => {\n return {\n name: values.name,\n phoneNumber: handleNumberMask(values.phoneNumber),\n callingCondition: values.callingCondition,\n relevantInformation: values.relevantInformation,\n patientId: patientId,\n link: values.link || '',\n isWhatsapp: values.phoneNumber ? !!values.isWhatsapp : false,\n } as FormValues;\n};\n\nexport const handleNumberMask = (phoneNumber?: string) => {\n // Numbers with the format 0800 ddd dddd\n if (phoneNumber && phoneNumber.startsWith('08'))\n return numberMask(phoneNumber);\n if (phoneNumber) return numberMask(`55${phoneNumber}`);\n return '';\n};\n\nexport const emergencyContactsModelToformData = (values: FormValues) => {\n return {\n name: values.name,\n phoneNumber: phoneMask(`${values.phoneNumber}`),\n callingCondition: values.callingCondition,\n relevantInformation: values.relevantInformation,\n link: values.link,\n isWhatsapp: values.isWhatsapp,\n } as FormValues;\n};\n\nexport const urlMask = (url?: string) => {\n if (!url) return '';\n if (url === 'https://') return;\n const linkWithoutHttp = url.replace(\n /^(?:https?:\\/\\/)?(?:http?:\\/\\/)?(?:www\\.)?/i,\n ''\n );\n const urlStartsWithHttp =\n url.startsWith('http://') || url.startsWith('https://');\n return urlStartsWithHttp ? url : `https://${linkWithoutHttp}`;\n};\n","import { FormControlLabel } from '@material-ui/core';\nimport { Formik, FormikHelpers, FormikProps } from 'formik';\nimport isEqual from 'lodash/isEqual';\nimport React from 'react';\nimport { toast } from 'react-toastify';\nimport { phoneMask } from '../../utils/inputs';\nimport {\n FormCardContainer,\n HelperContainer,\n HelperText,\n StyledBoldTitle,\n StyledFormikTextField as FormikTextField,\n} from '../FormCardContainer';\nimport MedicBalloon from '../MedicBalloon';\nimport StyledButton from '../StyledButton';\nimport {\n BlackTypography,\n Centralizer,\n ContentContainer,\n Form,\n StyledCheckbox,\n} from './styles';\nimport { FormValues, urlMask, validationSchema } from './utils';\n\nconst ContactsUpsertForm: React.FC<{\n initialValues: FormValues;\n innerRef?: React.Ref>;\n onSubmit: (\n values: FormValues,\n formikHelpers: FormikHelpers\n ) => void | Promise;\n}> = ({ initialValues, innerRef, onSubmit }) => {\n const validateAndSubmit = (\n values: FormValues,\n formikHelpers: FormikHelpers\n ) => {\n if (values.link || values.phoneNumber) {\n onSubmit(values, formikHelpers);\n } else {\n toast.error('Preencha o número de telefone ou link de contato');\n formikHelpers.setSubmitting(false);\n }\n };\n\n return (\n <>\n \n {({\n values,\n setFieldValue,\n isSubmitting,\n errors,\n touched,\n handleChange,\n }) => {\n return (\n \n \n \n \n \n Nome do contato\n \n\n \n Exemplo: Dr João, etc.\n {touched.name && errors.name}\n \n }\n />\n \n\n \n \n Adicione pelo menos uma das duas opções abaixo, ou,\n se preferir, pode adicionar as duas.\n \n\n ) => {\n setFieldValue('phoneNumber', phoneMask(e.target.value));\n }}\n />\n {!!values.phoneNumber && (\n \n }\n label=\"Whatsapp\"\n />\n )}\n\n \n {touched.link && errors.link}\n \n }\n onChange={(e: React.ChangeEvent) => {\n setFieldValue('link', urlMask(e.target.value));\n }}\n />\n \n\n \n \n Em qual caso entrar em contato?\n \n\n \n \n Exemplo: No caso de falta de remédio.\n \n {touched.callingCondition && errors.callingCondition}\n \n }\n />\n\n \n Instruções (opcional)\n \n\n \n \n\n \n \n Salvar\n \n \n \n \n );\n }}\n \n \n );\n};\n\nexport default ContactsUpsertForm;\n","import styled from 'styled-components';\n\nexport const Container = styled.div`\n display: flex;\n flex: 1;\n background-color: ${({ theme }) => theme.palette.common.white};\n padding-top: ${({ theme }) => theme.spacing(2)}px;\n padding-bottom: ${({ theme }) => theme.spacing(2)}px;\n display: flex;\n flex-direction: column;\n color: ${({ theme }) => theme.palette.secondary.main};\n`;\n","import { APIError } from '@cuidador/lib'\nimport { AxiosError } from 'axios'\nimport React, { useContext, useEffect } from 'react'\nimport { useHistory } from 'react-router-dom'\nimport { toast } from 'react-toastify'\nimport ContactsUpsertForm from '../../../components/ContactsUpsertForm'\nimport {\n formDataToEmergencyContactsModel,\n FormValues,\n} from '../../../components/ContactsUpsertForm/utils'\nimport { AuthContext } from '../../../contexts/auth'\nimport useCanAccess from '../../../hooks/useCanAccess'\nimport useEmergencyContacts from '../../../hooks/useEmergencyContacts'\nimport { resolveErrorMessage } from '../../../utils/error'\nimport { Container } from './styles'\nimport { Header } from '../../../components/Header'\nimport { PageTitle } from '../../../components/PageTitle'\nimport { BackButton } from '../../../components/BackButton'\nimport { PscButton } from '../../../components/PscButton'\n\nconst ContactsInsert: React.FC = () => {\n const { userInfo } = useContext(AuthContext)\n const patientId = userInfo?.activePatientId\n const { isAllowedToCreate } = useCanAccess('care/emergency-contact')\n\n const { post } = useEmergencyContacts()\n const history = useHistory()\n\n useEffect(() => {\n if (!isAllowedToCreate) {\n toast.error('Você não tem permissão para visualizar essa página')\n history.goBack()\n }\n }, [])\n\n const handleSubmit = (values: FormValues) => {\n return post(formDataToEmergencyContactsModel(values, patientId!))\n .then(() => {\n history.replace('/contatos')\n })\n .catch((err: AxiosError) => {\n const displayMessage = resolveErrorMessage(err)\n toast.error(displayMessage)\n })\n }\n\n const formInitialValue = {\n name: '',\n phoneNumber: '',\n callingCondition: '',\n relevantInformation: '',\n link: '',\n }\n\n return (\n <>\n }\n centerContent={}\n rightContent={}\n />\n \n \n \n \n )\n}\n\nexport default ContactsInsert\n","import {\n Backdrop as MaterialBackdrop,\n CircularProgress as MaterialCircularProgress,\n} from '@material-ui/core';\nimport styled from 'styled-components';\n\nexport const Container = styled.div`\n display: flex;\n flex: 1;\n background-color: ${({ theme }) => theme.palette.common.white};\n padding-top: ${({ theme }) => theme.spacing(2)}px;\n padding-bottom: ${({ theme }) => theme.spacing(2)}px;\n display: flex;\n flex-direction: column;\n color: ${({ theme }) => theme.palette.secondary.main};\n`;\n\nexport const Backdrop = styled(MaterialBackdrop)`\n z-index: ${({ theme }) => theme.zIndex.drawer + 1};\n color: ${({ theme }) => theme.palette.primary.light};\n position: absolute;\n`;\n\nexport const BackdropCircularProgress = styled(MaterialCircularProgress).attrs({\n color: 'inherit',\n})``;\n","import { APIError } from '@cuidador/lib';\nimport { AxiosError } from 'axios';\nimport React, { useContext, useEffect, useState } from 'react';\nimport { useHistory, useParams } from 'react-router-dom';\nimport { toast } from 'react-toastify';\nimport ContactsUpsertForm from '../../../components/ContactsUpsertForm';\nimport {\n emergencyContactsModelToformData,\n formDataToEmergencyContactsModel,\n FormValues,\n} from '../../../components/ContactsUpsertForm/utils';\nimport { StyledFieldset } from '../../../components/StyledFieldset';\nimport StyledSimpleDialog from '../../../components/StyledSimpleDialog';\nimport { AuthContext } from '../../../contexts/auth';\nimport useCanAccess from '../../../hooks/useCanAccess';\nimport useEmergencyContacts from '../../../hooks/useEmergencyContacts';\nimport { resolveErrorMessage } from '../../../utils/error';\nimport { Backdrop, BackdropCircularProgress, Container } from './styles';\nimport { Header } from '../../../components/Header'\nimport { PageTitle } from '../../../components/PageTitle'\nimport { BackButton } from '../../../components/BackButton'\nimport { RemoveButton } from '../../../components/RemoveButton'\n\nconst ContactsUpdate: React.FC = () => {\n const [dialogStatus, setDialogStatus] = useState(false);\n const params = useParams<{ id: string }>();\n const { getById, byId, loading, patch, remove } = useEmergencyContacts();\n const history = useHistory();\n const { isAllowedToDelete, isAllowedToUpdate } = useCanAccess(\n 'care/emergency-contact'\n );\n const { userInfo } = useContext(AuthContext);\n\n const id = parseInt(params.id);\n\n useEffect(\n function fetchInitialValues() {\n if (id) {\n getById(id);\n }\n },\n [id]\n );\n\n if (loading) {\n return (\n \n {loading && (\n \n )}\n \n );\n }\n\n const contacts = byId[id];\n\n if (!contacts) {\n return null;\n }\n\n const patientId = userInfo?.activePatientId;\n\n const handleSubmit = (values: FormValues) => {\n return patch(id!, formDataToEmergencyContactsModel(values, patientId!))\n .then(() => {\n history.goBack();\n })\n .catch((err: AxiosError) => {\n const displayMessage = resolveErrorMessage(err);\n toast.error(displayMessage);\n });\n };\n\n const handleDelete = (id: Id) => {\n setDialogStatus(false);\n remove(id)\n .then(() => {\n history.goBack();\n })\n .catch((err: AxiosError) => {\n const displayMessage = resolveErrorMessage(err);\n toast.error(displayMessage);\n });\n };\n\n return (\n <>\n \n }\n centerContent={\n \n }\n rightContent={\n isAllowedToDelete && (\n setDialogStatus(true)}\n />\n )\n }\n />\n \n \n \n \n setDialogStatus(false)}\n handleYes={() => handleDelete(id!)}\n title=\"Excluir contato de emergência\"\n subTitle=\"Tem certeza que deseja excluir o contato de emergência?\"\n />\n \n \n );\n};\n\nexport default ContactsUpdate;\n","import styled from 'styled-components';\n\nexport const HeaderContainer = styled.div`\n margin-bottom: ${({ theme }) => theme.spacing(2)}px;\n margin-top: ${({ theme }) => theme.spacing(1)}px;\n padding: 0 8px ${({ theme }) => theme.spacing(1)}px 8px;\n background-color: ${({ theme }) => theme.palette.extra.color.grey.light};\n\n h6 {\n color: ${({ theme }) => theme.palette.secondary.main};\n text-align: center;\n font-family: 'Work Sans';\n font-weight: bold;\n }\n`;\n\nexport const TimerContainer = styled.div`\n display: flex;\n align-items: center;\n justify-content: space-between;\n flex-direction: row;\n margin-bottom: ${({ theme }) => theme.spacing(1)}px;\n`;\n\nexport const TimerBox = styled.div`\n display: flex;\n align-items: flex-start;\n justify-content: center;\n flex-direction: column;\n margin: ${({ theme }) => theme.spacing(2, 2, 0, 2)};\n\n h6 {\n color: ${({ theme }) => theme.palette.primary.main};\n font-family: 'Work Sans';\n font-weight: bold;\n }\n\n p {\n display: flex;\n align-items: center;\n justify-content: center;\n margin-bottom: ${({ theme }) => theme.spacing(-0.1)}px;\n\n svg {\n margin-right: ${({ theme }) => theme.spacing(1)}px;\n color: ${({ theme }) => theme.palette.secondary.main};\n }\n }\n`;\n\nexport const HeaderSubtitle = styled.div`\n margin-left: ${({ theme }) => theme.spacing(2)}px;\n padding-bottom: ${({ theme }) => theme.spacing(2)}px;\n\n h6 {\n text-align: left;\n color: ${({ theme }) => theme.palette.primary.main};\n }\n\n p {\n margin: 0;\n }\n`;\n","import { Typography } from '@material-ui/core';\nimport TimerIcon from '@material-ui/icons/AccessTime';\nimport CalendarIcon from '@material-ui/icons/DateRange';\nimport { format } from 'date-fns';\nimport React from 'react';\nimport {\n HeaderContainer,\n HeaderSubtitle,\n TimerBox,\n TimerContainer,\n} from './styles';\n\ninterface ShiftTimeContestationDateBlockProps {\n startingDatetime?: Date;\n endingDatetime?: Date;\n startingLabel: string;\n endingLabel: string;\n responsibleName?: string;\n}\n\nconst ShiftTimeContestationDateBlock: React.FC = ({\n startingDatetime,\n endingDatetime,\n startingLabel,\n endingLabel,\n responsibleName,\n}) => {\n const getFormattedDate = (dateTime?: Date) => {\n if (dateTime) return format(dateTime, 'dd/MM/yyyy');\n return '';\n };\n\n const getFormattedTime = (dateTime?: Date) => {\n if (dateTime) return format(dateTime, 'HH:mm');\n return '';\n };\n\n return (\n \n \n \n \n {startingLabel}\n \n

\n \n {getFormattedDate(startingDatetime)}\n

\n

\n \n {getFormattedTime(startingDatetime)}\n

\n
\n \n \n {endingLabel}\n \n

\n \n {getFormattedDate(endingDatetime)}\n

\n

\n \n {getFormattedTime(endingDatetime)}\n

\n
\n
\n {responsibleName && (\n \n Responsável\n

{responsibleName}

\n
\n )}\n
\n );\n};\nexport default ShiftTimeContestationDateBlock;\n","import { FormControlLabel } from '@material-ui/core';\nimport styled from 'styled-components';\n\nconst StyledFormControlLabel = styled(FormControlLabel)`\n & .MuiRadio-root:not(.Mui-disabled) {\n color: ${({ theme }) => theme.palette.secondary.main};\n }\n & .MuiCheckbox-root:not(.Mui-disabled) {\n color: ${({ theme }) => theme.palette.secondary.main};\n }\n & .Mui-disabled {\n opacity: 65%;\n color: ${({ theme }) => theme.palette.secondary.main};\n }\n color: ${({ theme }) => theme.palette.extra.color.grey.dark};\n`;\n\nexport default StyledFormControlLabel;\n","import { ShiftAnnullationModel, ShiftModel } from '@cuidador/database';\nimport { useCallback, useReducer } from 'react';\nimport axios from '../config/axios';\nimport {\n createReducer,\n Item,\n PaginatedRequestParams,\n ReducerData,\n} from '../utils/store/index';\n\nconst endpoint = '/care';\n\nconst initialData: ReducerData = {\n byId: {} as Record>,\n ids: [] as Array,\n total: 0,\n loading: false,\n error: null,\n};\n\nconst useShift = () => {\n const [state, dispatch] = useReducer(\n createReducer(),\n initialData\n );\n\n const getLastShiftByPatientId = useCallback(async (id: Id) => {\n try {\n dispatch({ type: 'LOADING' });\n const response = await axios.get(\n `${endpoint}/lastshift/by-patient/${id}`\n );\n dispatch({ type: 'GET_BY_ID', payload: response.data });\n return response.data as ShiftModel;\n } catch (err) {\n dispatch({ type: 'ERROR', payload: err });\n return Promise.reject(err);\n }\n }, []);\n\n const getById = useCallback(async (id: Id) => {\n try {\n dispatch({ type: 'LOADING' });\n const response = await axios.get(`${endpoint}/shift/${id}`);\n dispatch({ type: 'GET_BY_ID', payload: response.data });\n return response.data as ShiftModel;\n } catch (err) {\n dispatch({ type: 'ERROR', payload: err });\n }\n }, []);\n\n const getByPatientIdPaginated = useCallback(\n async (patientId: number, params: PaginatedRequestParams) => {\n try {\n dispatch({ type: 'LOADING' });\n const response = await axios.get<{\n results: Item[];\n total: number;\n }>(`${endpoint}/shift/by-patient/${patientId}`, {\n params,\n });\n dispatch({ type: 'PAGINATION', payload: response.data });\n return Promise.resolve(response);\n } catch (err) {\n dispatch({ type: 'ERROR', payload: err });\n return Promise.reject(err);\n }\n },\n []\n );\n\n const patchAnnulledShiftExecution = useCallback(\n async (shiftExecutionId: Id, body: Partial) => {\n try {\n dispatch({ type: 'LOADING' });\n const response = await axios.patch(\n `${endpoint}/shift/execution/${shiftExecutionId}/annulled`,\n body\n );\n dispatch({ type: 'SUCCESS' });\n return response.data as ShiftAnnullationModel;\n } catch (err) {\n dispatch({ type: 'ERROR', payload: err });\n return Promise.reject(err);\n }\n },\n []\n );\n\n const expelCaregiver = useCallback(\n async (shiftId: number, shouldKeepRecords: boolean) => {\n try {\n dispatch({ type: 'LOADING' });\n const response = await axios.post(\n `${endpoint}/shift/expel/${shiftId}`,\n { shouldKeepRecords }\n );\n dispatch({ type: 'SUCCESS' });\n return response.data;\n } catch (err) {\n dispatch({ type: 'ERROR', payload: err });\n throw err;\n }\n },\n []\n );\n\n const getTimeline = useCallback(async (shiftId: number) => {\n try {\n dispatch({ type: 'LOADING' });\n const response = await axios.get(`${endpoint}/shift/timeline/${shiftId}`);\n dispatch({ type: 'SUCCESS' });\n return response.data;\n } catch (err) {\n dispatch({ type: 'ERROR', payload: err });\n throw err;\n }\n }, []);\n\n return {\n ...state,\n getLastShiftByPatientId,\n getById,\n expelCaregiver,\n getByPatientIdPaginated,\n patchAnnulledShiftExecution,\n getTimeline,\n };\n};\n\nexport default useShift;\n","import { useCallback } from 'react';\nimport axios from '../config/axios';\n\nconst useShiftTimeContestation = () => {\n const post = useCallback(\n async (shiftExecutionId: number, { endedAt, startedAt, justification }) => {\n try {\n await axios.post(\n `/care/shift/execution/${shiftExecutionId}/time-contestation`,\n {\n endedAt,\n startedAt,\n justification,\n }\n );\n } catch (err) {\n return Promise.reject(err);\n }\n },\n []\n );\n\n return { post };\n};\n\nexport default useShiftTimeContestation;\n","import React from 'react';\nimport { DialogActions, DialogContent, DialogTitle } from '@material-ui/core';\nimport { DialogProps } from '@material-ui/core/Dialog';\n\nimport StyledDialog from '../../../components/StyledDialog';\nimport StyledButton from '../../../components/StyledButton';\n\ninterface ConfirmSaveDialogProps extends DialogProps {\n onConfirm: (() => void) | undefined;\n onClose: () => void;\n}\n\nconst ConfirmSaveDialog: React.FC = ({\n open,\n onClose,\n onConfirm,\n}) => {\n return (\n \n \n Tem certeza que deseja salvar?\n \n \n Voltar\n \n \n Confirmar\n \n \n \n \n );\n};\n\nexport default ConfirmSaveDialog;\n","import { DatePicker, TimePicker } from '@material-ui/pickers';\nimport { Form as FormikForm } from 'formik';\nimport styled from 'styled-components';\nimport StyledButton from '../../components/StyledButton';\n\nexport const Container = styled.div`\n display: flex;\n flex-direction: column;\n align-items: center;\n`;\n\nexport const Body = styled.div`\n display: flex;\n flex: 1;\n background-color: ${({ theme }) => theme.palette.common.white};\n flex-direction: column;\n max-width: 600px;\n`;\n\nexport const TopGuidelineParagraph = styled.p`\n color: ${({ theme }) => theme.palette.primary.main};\n padding: 8px 24px 8px;\n text-align: center;\n`;\n\nexport const Form = styled(FormikForm)`\n display: flex;\n flex: 1;\n flex-direction: column;\n color: ${({ theme }) => theme.palette.extra.color.grey.light};\n width: 100%;\n height: 100%;\n justify-content: center;\n align-items: center;\n margin-top: ${({ theme }) => theme.spacing(-1)}px;\n`;\n\nexport const StyledDatePicker = styled(DatePicker)`\n width: 100%;\n & .MuiInputBase-root {\n color: ${({ theme }) => theme.palette.primary.main};\n }\n & .MuiOutlinedInput-input {\n padding: ${({ theme }) => theme.spacing(1.5)}px;\n border-radius: ${({ theme }) => theme.spacing(1)}px;\n }\n & .MuiOutlinedInput-root {\n border-radius: ${({ theme }) => theme.spacing(1)}px;\n }\n & .MuiOutlinedInput-notchedOutline {\n border-color: ${({ theme }) => theme.palette.primary.main};\n }\n`;\n\nexport const StyledTimePicker = styled(TimePicker)`\n width: 100%;\n & .MuiInputBase-root {\n color: ${({ theme }) => theme.palette.primary.main};\n }\n & .MuiOutlinedInput-input {\n padding: ${({ theme }) => theme.spacing(1.5)}px;\n border-radius: ${({ theme }) => theme.spacing(1)}px;\n }\n & .MuiOutlinedInput-root {\n border-radius: ${({ theme }) => theme.spacing(1)}px;\n }\n & .MuiOutlinedInput-notchedOutline {\n border-color: ${({ theme }) => theme.palette.primary.main};\n }\n`;\n\nexport const StyledOptions = styled.div`\n display: flex;\n flex: 1;\n flex-direction: row;\n justify-content: space-between;\n margin: ${({ theme }) => theme.spacing(2, 0)};\n`;\n\nexport const Button = styled(StyledButton)`\n width: 45%;\n`;\n\nexport const FormInnerContainer = styled.div`\n padding: 12px 24px 24px 24px;\n`;\n\nexport const DateTimePickersGroup = styled.div`\n display: grid;\n grid-template-columns: 1fr 1fr;\n gap: 0 16px;\n margin-block: 0 16px;\n margin-inline: 16px;\n\n svg {\n margin-right: ${({ theme }) => theme.spacing(1)}px;\n color: ${({ theme }) => theme.palette.primary.main};\n }\n\n > div {\n display: flex;\n flex-direction: row;\n align-items: center;\n img {\n margin-right: 8px;\n margin-top: 12px;\n }\n\n > div {\n margin-bottom: 0;\n > p {\n color: ${({ theme }) => theme.palette.error.main};\n }\n }\n }\n`;\n\nexport const DateTimeCheckboxGroup = styled.div`\n display: flex;\n flex-direction: row;\n align-items: center;\n span {\n color: ${({ theme }) => theme.palette.primary.main};\n font-weight: bold;\n }\n`;\n\nexport const JustificationContainer = styled.div`\n margin-top: ${({ theme }) => theme.spacing(4)}px;\n`;\n","import { DatePickerProps, TimePickerProps } from '@material-ui/pickers';\nimport { ErrorMessage } from 'formik';\nimport React from 'react';\nimport { StyledDatePicker, StyledTimePicker } from '../styles';\n\nexport const DatePicker: React.FC<\n Omit & {\n name: string;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n values: any;\n setFieldValue: (\n field: string,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n value: any,\n shouldValidate?: boolean | undefined\n ) => void;\n }\n> = ({ name, values, setFieldValue, ...rest }) => {\n return (\n {\n // Since it's a Date only picker, lets set hours, minutes, seconds and milliseconds to 0\n date?.setHours(0, 0, 0, 0);\n setFieldValue(name, date, true);\n }}\n inputVariant=\"outlined\"\n cancelLabel=\"Cancelar\"\n helperText={}\n />\n );\n};\n\nexport const TimePicker: React.FC<\n Omit & {\n name: string;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n values: any;\n setFieldValue: (\n field: string,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n value: any,\n shouldValidate?: boolean | undefined\n ) => void;\n }\n> = ({ name, values, setFieldValue, ...rest }) => {\n return (\n {\n setFieldValue(name, date, true);\n }}\n inputVariant=\"outlined\"\n cancelLabel=\"Cancelar\"\n helperText={}\n />\n );\n};\n","import { ShiftModel } from '@cuidador/database';\nimport DateFnsUtils from '@date-io/date-fns';\nimport { Checkbox } from '@material-ui/core';\nimport CalendarIcon from '@material-ui/icons/DateRange';\nimport TimeIcon from '@material-ui/icons/WatchLater';\nimport { MuiPickersUtilsProvider } from '@material-ui/pickers';\nimport ptBr from 'date-fns/locale/pt-BR';\nimport { Formik } from 'formik';\nimport { orderBy } from 'lodash';\nimport { default as React, useEffect, useMemo, useState } from 'react';\nimport { useHistory, useParams } from 'react-router-dom';\nimport { toast } from 'react-toastify';\nimport * as yup from 'yup';\nimport FormikTextField from '../../components/Forms/FormikTextField';\nimport LoadingBackdrop from '../../components/LoadingBackdrop';\nimport ShiftTimeContestationDateBlock from '../../components/ShiftTimeContestationDateBlock';\nimport StyledFormControlLabel from '../../components/StyledFormControlLabel';\nimport useShift from '../../hooks/useShift';\nimport useShiftTimeContestation from '../../hooks/useShiftExecutionTimeContestation';\nimport { resolveErrorMessage } from '../../utils/error';\nimport ConfirmSaveDialog from './ConfirmSaveDialog';\nimport { DatePicker, TimePicker } from './DateTimePickers';\nimport {\n Body,\n Button,\n Container,\n DateTimeCheckboxGroup,\n DateTimePickersGroup,\n Form,\n FormInnerContainer,\n JustificationContainer,\n StyledOptions,\n TopGuidelineParagraph,\n} from './styles';\nimport { Header } from '../../components/Header'\nimport { PageTitle } from '../../components/PageTitle'\nimport { BackButton } from '../../components/BackButton'\nimport { PscButton } from '../../components/PscButton'\n\nexport type FormValues = {\n startedAtDate: Date | null | undefined;\n startedAtTime: Date | null | undefined;\n endedAtDate: Date | null | undefined;\n endedAtTime: Date | null | undefined;\n justification: string;\n startedDatetimeEnabled: boolean;\n endedDatetimeEnabled: boolean;\n isSubmitConfirmationModalOpen: boolean;\n};\n\nconst validationSchema = yup.object().shape({\n startedAtDate: yup\n .date()\n .nullable()\n .typeError('Por favor, insira uma data válida')\n .when(\n 'startedDatetimeEnabled',\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (startedDatetimeEnabled: any, schema: any) =>\n startedDatetimeEnabled\n ? schema.required('Por favor, insira uma data de início')\n : schema\n ),\n startedAtTime: yup\n .date()\n .nullable()\n .typeError('Por favor, insira uma data válida')\n .when(\n 'startedDatetimeEnabled',\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (startedDatetimeEnabled: any, schema: any) =>\n startedDatetimeEnabled\n ? schema.required('Por favor, insira um horário de início')\n : schema\n ),\n endedAtDate: yup\n .date()\n .nullable()\n .typeError('Por favor, insira uma data válida')\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n .when('endedDatetimeEnabled', (endedDatetimeEnabled: any, schema: any) =>\n endedDatetimeEnabled\n ? schema.required('Por favor, insira uma data de fim')\n : schema\n ),\n endedAtTime: yup\n .date()\n .nullable()\n .typeError('Por favor, insira uma data válida')\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n .when('endedDatetimeEnabled', (endedDatetimeEnabled: any, schema: any) =>\n endedDatetimeEnabled\n ? schema.required('Por favor, insira um horário de fim')\n : schema\n ),\n justification: yup\n .string()\n .nullable()\n .typeError('Por favor, insira uma justificativa válida')\n .required('Por favor, insira uma justificativa'),\n});\n\nconst CreateTimeContestationForm: React.FC<{\n onSubmit: (values: FormValues) => void;\n onCancel: () => void;\n minTimeContestationDatetime?: Date;\n maxTimeContestationDatetime?: Date;\n}> = ({\n onSubmit,\n onCancel,\n minTimeContestationDatetime,\n maxTimeContestationDatetime,\n}) => {\n return (\n \n {({\n isSubmitting,\n values,\n setFieldValue,\n submitForm,\n validateForm,\n setFieldTouched,\n }) => {\n const handleStartedDatetimeToogle = () => {\n const newValue = !values.startedDatetimeEnabled;\n setFieldValue('startedDatetimeEnabled', newValue);\n if (\n newValue &&\n !values.startedAtDate &&\n minTimeContestationDatetime &&\n maxTimeContestationDatetime &&\n checkIfDatesDaysAreEqual(\n minTimeContestationDatetime,\n maxTimeContestationDatetime\n )\n ) {\n setFieldValue('startedAtDate', minTimeContestationDatetime);\n }\n };\n const handleEndedDatetimeToogle = () => {\n const newValue = !values.endedDatetimeEnabled;\n setFieldValue('endedDatetimeEnabled', newValue);\n if (\n newValue &&\n !values.endedAtDate &&\n minTimeContestationDatetime &&\n maxTimeContestationDatetime &&\n checkIfDatesDaysAreEqual(\n minTimeContestationDatetime,\n maxTimeContestationDatetime\n )\n ) {\n setFieldValue('endedAtDate', minTimeContestationDatetime);\n }\n };\n\n const handleSaveClick = () => {\n return validateForm().then((errors) => {\n const hasErrors = Object.keys(errors).length > 0;\n if (hasErrors) {\n // If errors exist, set all fields as \"touched\", so validation errors\n // are displayed\n Object.keys(values).forEach((field) => {\n setFieldTouched(field);\n });\n } else {\n // If no errors exist, open confirmation modal\n setFieldValue('isSubmitConfirmationModalOpen', true);\n }\n });\n };\n\n return (\n
\n \n \n
\n \n \n }\n label=\"Início da execução\"\n />\n \n \n
\n \n \n
\n
\n \n \n
\n
\n
\n
\n \n \n }\n label=\"Fim da execução\"\n />\n \n \n
\n \n \n
\n
\n \n \n
\n
\n
\n \n \n \n \n \n \n Salvar\n \n \n
\n
\n {\n setFieldValue('isSubmitConfirmationModalOpen', false);\n }}\n onConfirm={() => {\n setFieldValue('isSubmitConfirmationModalOpen', false);\n submitForm();\n }}\n />\n \n );\n }}\n \n );\n};\n\nconst checkIfDatesDaysAreEqual = (dateA: Date, dateB: Date) => {\n return dateA.getDate() === dateB.getDate();\n};\n\nconst CreateTimeContestation: React.FC = () => {\n const history = useHistory();\n const { shiftId, shiftExecutionId } = useParams<{\n shiftId: string;\n shiftExecutionId: string;\n }>();\n const [shift, setShift] = useState();\n const { getById, loading } = useShift();\n const { post: postShiftTimeContestation } = useShiftTimeContestation();\n\n useEffect(() => {\n if (shiftId) {\n getById(Number(shiftId)).then((shift) => {\n setShift(shift as ShiftModel);\n });\n }\n }, [shiftId]);\n\n const {\n minTimeContestationDatetime,\n maxTimeContestationDatetime,\n } = useMemo(() => {\n const minTimeContestationDatetime = shift?.plannedToStartAt\n ? new Date(shift.plannedToStartAt)\n : undefined;\n const maxTimeContestationDatetime = shift?.plannedToEndAt\n ? new Date(shift.plannedToEndAt)\n : undefined;\n\n return {\n minTimeContestationDatetime,\n maxTimeContestationDatetime,\n };\n }, [shift?.plannedToStartAt, shift?.plannedToEndAt]);\n\n const handleTimeContestationSubmitted = async (values: FormValues) => {\n let startedAt;\n if (\n values.startedDatetimeEnabled &&\n values.startedAtDate &&\n values.startedAtTime\n ) {\n startedAt = new Date(values.startedAtDate);\n startedAt.setHours(values.startedAtTime?.getHours());\n startedAt.setMinutes(values.startedAtTime?.getMinutes());\n }\n\n let endedAt;\n if (\n values.endedDatetimeEnabled &&\n values.endedAtDate &&\n values.endedAtTime\n ) {\n endedAt = new Date(values.endedAtDate);\n endedAt.setHours(values.endedAtTime?.getHours());\n endedAt.setMinutes(values.endedAtTime?.getMinutes());\n }\n\n const body: {\n justification: string;\n startedAt?: Date;\n endedAt?: Date;\n } = {\n justification: values.justification,\n };\n\n if (startedAt) {\n body.startedAt = startedAt;\n }\n\n if (endedAt) {\n body.endedAt = endedAt;\n }\n\n await postShiftTimeContestation(Number(shiftExecutionId), body)\n .then(() => {\n toast.success('Correção de horários feita com sucesso');\n history.goBack();\n })\n .catch((err) => {\n const displayMessage = resolveErrorMessage(err);\n toast.error(displayMessage);\n });\n };\n\n const onCancel = () => {\n history.goBack();\n };\n\n const title: string = useMemo(() => {\n if (!shift || !shift.executions || shift.executions.length === 0)\n return 'Correção de horários';\n\n const currentExecutionIndex = orderBy(\n shift.executions,\n 'createdAt'\n ).findIndex((execution) => execution.id === Number(shiftExecutionId));\n\n if (currentExecutionIndex < 0) return 'Correção de horários';\n\n return `Correção de horários da Execução ${currentExecutionIndex + 1}`;\n }, [shift]);\n\n if (loading) {\n return ;\n }\n\n if (!shift || !shift.executions || shift.executions.length === 0) {\n return null;\n }\n\n return (\n \n \n }\n centerContent={\n \n }\n rightContent={}\n />\n \n \n Selecione e preencha apenas o período (data e horário) que\n deseja corrigir.\n \n \n
\n \n
\n \n
\n );\n};\n\nexport default CreateTimeContestation;\n","import { format } from 'date-fns';\nimport ptBrLocale from 'date-fns/locale/pt-BR';\n\nexport const handleFormatDate = (date: string | null) => {\n if (!date) {\n return 'Sem alterações';\n }\n return format(new Date(date), 'MM/dd/yyyy', {\n locale: ptBrLocale,\n });\n};\nexport const handleFormatTime = (time: string | null) => {\n if (!time) {\n return 'Sem alterações';\n }\n return format(new Date(time), 'HH:mm');\n};\n","import styled, { css } from 'styled-components';\nimport { Typography } from '@material-ui/core';\nimport { WatchLater, DateRange } from '@material-ui/icons';\n\nconst iconBaseStyles = css`\n color: ${({ theme }) => theme.palette.secondary.main};\n height: 20px;\n width: 20px;\n`;\n\nexport const CardContainer = styled.div`\n box-sizing: border-box;\n display: flex;\n flex-direction: column;\n margin: 0 auto;\n padding-inline: ${({ theme }) => theme.spacing(2)}px;\n width: 100%;\n max-width: 800px;\n`;\n\nexport const HeaderContainer = styled(CardContainer)`\n margin-block: ${({ theme }) => theme.spacing(2, 1)};\n`;\n\nexport const OriginalSchedulesContainer = styled.div`\n background-color: ${({ theme }) => theme.palette.grey[100]};\n padding-block: ${({ theme }) => theme.spacing(2)}px;\n`;\n\nexport const CardItem = styled.div`\n display: flex;\n flex-direction: column;\n margin-bottom: ${({ theme }) => theme.spacing(0.5)}px;\n`;\n\nexport const CardItemJustify = styled.div`\n display: flex;\n justify-content: space-between;\n gap: ${({ theme }) => theme.spacing(0.5)}px;\n margin-bottom: ${({ theme }) => theme.spacing(0.5)}px;\n`;\n\nexport const CardTimeText = styled(Typography)`\n display: flex;\n align-items: center;\n gap: ${({ theme }) => theme.spacing(0.5)}px;\n margin-bottom: ${({ theme }) => theme.spacing(0.5)}px;\n`;\n\nexport const CardTitle = styled(Typography)`\n color: ${({ theme }) => theme.palette.secondary.main};\n font-size: 1rem;\n font-weight: ${({ theme }) => theme.typography.fontWeightBold};\n\n & ~ div {\n margin-left: ${({ theme }) => theme.spacing(1.5)}px;\n }\n`;\n\nexport const StyledTitle = styled(Typography)`\n color: ${({ theme }) => theme.palette.secondary.main};\n text-align: center;\n font-size: 1.2rem;\n font-weight: ${({ theme }) => theme.typography.fontWeightBold};\n margin-top: ${({ theme }) => theme.spacing(2)}px;\n margin-bottom: ${({ theme }) => theme.spacing(0.5)}px;\n`;\n\nexport const StyledSubtitle = styled(Typography)`\n color: ${({ theme }) => theme.palette.primary.main};\n font-weight: ${({ theme }) => theme.typography.fontWeightBold};\n margin-bottom: ${({ theme }) => theme.spacing(0.5)}px;\n`;\n\nexport const StyledTypography = styled(Typography)`\n font-size: 0.95rem;\n`;\n\nexport const StyledCreatedBy = styled(StyledTypography)`\n text-overflow: ellipsis;\n white-space: nowrap;\n overflow: hidden;\n`;\n\nexport const Divider = styled.hr`\n background-color: ${({ theme }) => theme.palette.secondary.main};\n border: 1px solid ${({ theme }) => theme.palette.secondary.main};\n margin: ${({ theme }) => theme.spacing(0.5)}px 0;\n height: 0.2px;\n`;\n\nexport const NoRegistrationsText = styled(Typography)`\n color: ${({ theme }) => theme.palette.primary.main};\n text-align: center;\n margin-block: ${({ theme }) => theme.spacing(1)}px;\n`;\n\nexport const StyledClockIcon = styled(WatchLater)`\n ${iconBaseStyles}\n`;\n\nexport const StyledCalendarIcon = styled(DateRange)`\n ${iconBaseStyles}\n`;\n","import React from 'react';\nimport { ShiftExecution } from '@cuidador/database';\nimport { handleFormatDate, handleFormatTime } from '../utils';\nimport {\n OriginalSchedulesContainer,\n CardContainer,\n CardItemJustify,\n CardItem,\n CardTimeText,\n StyledSubtitle,\n StyledCreatedBy,\n StyledCalendarIcon,\n StyledClockIcon,\n} from '../styles';\n\ninterface OriginalSchedulesProps {\n shiftExecution: ShiftExecution;\n}\n\nconst OriginalSchedules: React.FC = ({\n shiftExecution,\n}) => {\n const dateStartedAt = handleFormatDate(shiftExecution.registeredStartedAt!);\n const timeStartedAt = handleFormatTime(shiftExecution.registeredStartedAt!);\n\n const dateEndedAt = handleFormatDate(shiftExecution.registeredEndedAt!);\n const timeEndedAt = handleFormatTime(shiftExecution.registeredEndedAt!);\n\n return (\n \n \n \n \n Início registrado\n \n {dateStartedAt}\n \n \n {timeStartedAt}\n \n \n \n Fim registrado\n \n {dateEndedAt}\n \n \n {timeEndedAt}\n \n \n \n \n Responsável\n \n {shiftExecution?.caregiver?.user?.name}\n \n \n \n \n );\n};\n\nexport default OriginalSchedules;\n","import React from 'react';\nimport { handleFormatDate, handleFormatTime } from '../utils';\nimport {\n CardTitle,\n CardItem,\n StyledSubtitle,\n StyledCreatedBy,\n StyledTypography,\n} from '../styles';\nimport { ShiftAnnullation } from '@cuidador/database';\n\ninterface AnnulledCardProps {\n annullation: ShiftAnnullation;\n}\n\nconst AnnulledCard: React.FC = ({ annullation }) => {\n const dateCreatedAt = handleFormatDate(annullation.createdAt!);\n const timeCreatedAt = handleFormatTime(annullation.createdAt!);\n\n const executionType = annullation?.isAnnulled ? 'anulada' : 'restaurada';\n\n return (\n <>\n \n Execução {executionType} ({dateCreatedAt} - {timeCreatedAt})\n \n \n Responsável\n {annullation.annulledBy?.name}\n \n {!!annullation?.isAnnulled && (\n \n Justificativa\n {annullation.description}\n \n )}\n \n );\n};\n\nexport default AnnulledCard;\n","import React from 'react';\nimport { ShiftTimeContestation } from '@cuidador/database';\nimport { handleFormatDate, handleFormatTime } from '../utils';\nimport {\n CardItem,\n CardItemJustify,\n CardTimeText,\n CardTitle,\n StyledSubtitle,\n StyledTypography,\n StyledCreatedBy,\n StyledCalendarIcon,\n StyledClockIcon,\n} from '../styles';\n\ninterface TimeContestationCardProps {\n timeContestation: ShiftTimeContestation;\n contestationNumber: number;\n}\n\nconst TimeContestationCard: React.FC = ({\n timeContestation,\n contestationNumber,\n}) => {\n const dateStartedAt = handleFormatDate(timeContestation.startedAt!);\n const timeStartedAt = handleFormatTime(timeContestation.startedAt!);\n\n const dateEndedAt = handleFormatDate(timeContestation.endedAt!);\n const timeEndedAt = handleFormatTime(timeContestation.endedAt!);\n\n const dateCreatedAt = handleFormatDate(timeContestation.createdAt!);\n const timeCreatedAt = handleFormatTime(timeContestation.createdAt!);\n\n return (\n <>\n \n Correção {contestationNumber} - ({dateCreatedAt} - {timeCreatedAt})\n \n \n Responsável\n {timeContestation.createdBy?.name}\n \n \n \n Início\n \n {dateStartedAt}\n \n \n {timeStartedAt}\n \n \n \n Fim\n \n \n {dateEndedAt}\n \n \n {timeEndedAt}\n \n \n \n \n Justificativa\n {timeContestation.justification}\n \n \n );\n};\n\nexport default TimeContestationCard;\n","import React, { useEffect, useState } from 'react';\nimport { useParams } from 'react-router-dom';\nimport { sortBy } from 'lodash';\nimport { ShiftExecution, ShiftModel } from '@cuidador/database';\nimport useShift from '../../hooks/useShift';\nimport LoadingBackdrop from '../../components/LoadingBackdrop';\nimport OriginalSchedules from './OriginalSchedules';\nimport AnnulledCard from './AnnulledCard';\nimport TimeContestationCard from './TimeContestationCard';\nimport {\n HeaderContainer,\n CardContainer,\n CardItem,\n StyledTitle,\n Divider,\n NoRegistrationsText,\n StyledTypography,\n} from './styles';\nimport { Header } from '../../components/Header'\nimport { PageTitle } from '../../components/PageTitle'\nimport { BackButton } from '../../components/BackButton'\nimport { PscButton } from '../../components/PscButton'\n\ninterface RouteParams {\n shiftId: string;\n executionId: string;\n}\n\nconst ExecutionHistoryContestation: React.FC = () => {\n const [shift, setShift] = useState();\n\n const { shiftId, executionId } = useParams();\n const { getById, loading } = useShift();\n\n useEffect(() => {\n getById(shiftId).then((shift) => {\n setShift(shift as ShiftModel);\n });\n }, [shiftId]);\n\n const findExecutionByExecutionId = (execution: ShiftExecution) => {\n return execution.id === +executionId;\n };\n\n // eslint-disable-next-line\n const orderByCreatedAt = (collection?: any[]) => {\n return sortBy(collection, ({ createdAt }) => createdAt);\n };\n\n const shiftExecution = shift?.executions?.find(findExecutionByExecutionId);\n\n const executionNumber = shift?.executions?.findIndex(\n findExecutionByExecutionId\n );\n\n const timeContestations = orderByCreatedAt(shiftExecution?.timeContestations);\n\n const annullations = orderByCreatedAt(shiftExecution?.annullations);\n\n const hasTimeContestations = !!timeContestations.length;\n\n const hasAnnullations = !!annullations.length;\n\n if (loading) {\n return ;\n }\n\n return (\n <>\n \n }\n centerContent={\n \n }\n rightContent={}\n />\n {!hasTimeContestations && !hasAnnullations && (\n \n Ainda não foi cadastrada nenhuma correção de horários\n \n )}\n {(hasTimeContestations || hasAnnullations) && (\n <>\n \n \n \n Aqui você pode registrar a correção dos horários do início e\n final do plantão. Para inclusão, clique no botão (+).\n \n \n \n Registro original\n \n \n \n Histórico de correção de horários\n \n )}\n \n {hasAnnullations && (\n <>\n {annullations\n .map((annullation, index) => (\n <>\n \n {(index !== 0 || hasTimeContestations) && }\n \n ))\n .reverse()}\n \n )}\n {hasTimeContestations && (\n <>\n {timeContestations\n .map((timeContestation, index) => (\n <>\n \n {index !== 0 && }\n \n ))\n .reverse()}\n \n )}\n \n \n );\n};\n\nexport default ExecutionHistoryContestation;\n","import { ShiftReportModel } from '@cuidador/database';\nimport { useCallback, useReducer } from 'react';\nimport axios from '../config/axios';\nimport { createReducer, Item, ReducerData } from '../utils/store';\nimport useMedia from './useMedia';\n\nconst ENDPOINT = '/report/shift';\n\nconst initialData: ReducerData = {\n byId: {} as Record>,\n ids: [] as Array,\n total: 0,\n loading: false,\n error: null,\n};\n\nconst useShiftReport = () => {\n const [state, dispatch] = useReducer(\n createReducer(),\n initialData\n );\n const { getMedia } = useMedia();\n\n const getAllFromPatient = useCallback(async (patientId: number) => {\n try {\n dispatch({ type: 'LOADING' });\n const response = await axios.get[]>(\n `${ENDPOINT}/all-by-patient/${patientId}`\n );\n dispatch({ type: 'GET_ALL', payload: response.data });\n return response.data;\n } catch (error) {\n if (error instanceof Error) dispatch({ type: 'ERROR', payload: error });\n throw error;\n }\n }, []);\n\n //push production again.\n const getDownloadLink = useCallback(\n async (patientId: number, reportId: number) => {\n try {\n const { data } = await getMedia(\n `/media/patient/${patientId}/shift-report/${reportId}`\n );\n return data.signedUrl;\n } catch (error) {\n if (error instanceof Error) dispatch({ type: 'ERROR', payload: error });\n throw error;\n }\n },\n []\n );\n\n const requestReport = useCallback(\n async (patientId: number, startDate: string, endDate: string, guardianId: number) => {\n try {\n dispatch({ type: 'LOADING' });\n const response = await axios.post>(ENDPOINT, {\n patientId,\n startDate,\n endDate,\n name: `Gerado por ${guardianId}`\n });\n dispatch({ type: 'CREATE', payload: response.data });\n return response.data;\n } catch (error) {\n if (error instanceof Error) dispatch({ type: 'ERROR', payload: error });\n throw error;\n }\n },\n []\n );\n\n return {\n ...state,\n getAllFromPatient,\n getDownloadLink,\n requestReport,\n };\n};\n\nexport default useShiftReport;\n","import { DialogContent, DialogTitle } from '@material-ui/core';\nimport React from 'react';\nimport StyledDialog from './StyledDialog';\n\nexport type DialogProps = {\n open: boolean;\n title?: string;\n};\n\nconst StyledSimpleDialog: React.FC = ({\n open,\n title,\n children,\n}) => {\n return (\n \n {title && {title}}\n {children}\n \n );\n};\n\nexport default StyledSimpleDialog;\n","import { Typography } from '@material-ui/core';\nimport { DatePicker } from '@material-ui/pickers';\nimport { Form as FormikForm } from 'formik';\nimport styled from 'styled-components';\nimport StyledButton from '../../StyledButton';\n\nexport const Form = styled(FormikForm)`\n display: flex;\n flex: 1;\n flex-direction: column;\n color: ${({ theme }) => theme.palette.extra.color.grey.light};\n width: 100%;\n height: 100%;\n justify-content: center;\n align-items: center;\n margin-top: ${({ theme }) => theme.spacing(-1)}px;\n`;\n\nexport const Centralizer = styled.div`\n align-items: center;\n flex-direction: column;\n display: flex;\n flex: 1;\n justify-content: flex-end;\n margin-bottom: ${({ theme }) => theme.spacing(2)}px;\n`;\n\nexport const StyledBoldTitle = styled(Typography)`\n color: ${({ theme }) => theme.palette.common.black};\n`;\n\nexport const StyledDatePicker = styled(DatePicker)`\n width: 40%;\n margin-right: ${({ theme }) => theme.spacing(1)}px;\n margin-top: ${({ theme }) => theme.spacing(1)}px;\n & .MuiInputBase-root {\n color: ${({ theme }) => theme.palette.extra.color.grey.light};\n }\n & .MuiOutlinedInput-input {\n padding: ${({ theme }) => theme.spacing(1.5)}px;\n border-radius: ${({ theme }) => theme.spacing(1)}px;\n background-color: ${({ theme }) => theme.palette.common.white};\n color: ${({ theme }) => theme.palette.common.black};\n }\n & .MuiOutlinedInput-root {\n border-radius: ${({ theme }) => theme.spacing(1)}px;\n }\n & .MuiOutlinedInput-notchedOutline {\n border-color: ${({ theme }) => theme.palette.extra.color.grey.light};\n }\n`;\n\nexport const StyledOptions = styled.div`\n width: 80%;\n display: flex;\n flex: 1;\n flex-direction: row;\n justify-content: space-between;\n margin-bottom: ${({ theme }) => theme.spacing(2)}px;\n`;\n\nexport const StyledOptionsTypography = styled.div`\n width: 80%;\n display: flex;\n flex: 1;\n flex-direction: row;\n justify-content: space-between;\n margin-top: ${({ theme }) => theme.spacing(2)}px;\n`;\n\nexport const StyledPicker = styled(Typography)`\n width: 40%;\n`;\n\nexport const Button = styled(StyledButton)`\n width: 49%;\n`;\n\nexport const StyledOkStep = styled.div`\n padding: ${({ theme }) => theme.spacing(0, 2)};\n margin-bottom: ${({ theme }) => theme.spacing(4)}px;\n`;\n\nexport const StyledError = styled(Typography)`\n color: ${({ theme }) => theme.palette.extra.color.red.main};\n font-size: 1em;\n`;\n\nexport const StyledParagraph = styled(Typography)`\n margin-bottom: ${({ theme }) => theme.spacing(2)}px;\n`;\n","import * as yup from 'yup';\n\nexport const validationSchema = yup.object().shape({\n dateFrom: yup\n .date()\n .required('Por favor, insira uma data')\n .nullable()\n .typeError('Por favor, insira uma data válida'),\n dateUntil: yup\n .date()\n .required('Por favor, insira uma data')\n .nullable()\n .min(yup.ref('dateFrom'), 'A data final deve ser maior que a data inicial')\n .typeError('Por favor, insira uma data válida'),\n});\n\nexport type ModalProps = {\n onClose: () => void;\n opened: boolean;\n};\n\nexport type FormValues = {\n dateFrom: Date;\n dateUntil: Date;\n};\n\nexport const initialValues: FormValues = {\n dateFrom: new Date(),\n dateUntil: new Date(),\n};\n","import DateFnsUtils from '@date-io/date-fns';\nimport { Typography } from '@material-ui/core';\nimport { MuiPickersUtilsProvider } from '@material-ui/pickers';\nimport { addDays } from 'date-fns';\nimport ptBr from 'date-fns/locale/pt-BR';\nimport { Formik } from 'formik';\nimport React, { useContext, useState } from 'react';\nimport { toast } from 'react-toastify';\nimport { AuthContext } from '../../../contexts/auth';\nimport useShiftReport from '../../../hooks/useShiftReport';\nimport StyledSimpleModal from '../../StyledSimpleModal';\nimport {\n Button,\n Centralizer,\n Form,\n StyledDatePicker,\n StyledError,\n StyledOkStep,\n StyledOptions,\n StyledOptionsTypography,\n StyledParagraph,\n StyledPicker,\n} from './styles';\nimport {\n FormValues,\n initialValues,\n ModalProps,\n validationSchema,\n} from './utils';\n\nconst ExportModal: React.FC = ({ onClose, opened }) => {\n const [okStep, setOkStep] = useState(false);\n const { requestReport } = useShiftReport();\n const { userInfo } = useContext(AuthContext);\n\n const resetModal = () => {\n onClose();\n setOkStep(false);\n };\n\n const submitReportRequest = (values: FormValues) => {\n if (!userInfo?.activePatientId) return;\n\n const startDate = new Date(values.dateFrom.toISOString());\n startDate.setHours(0, 0, 0, 0);\n\n let endDate = new Date(values.dateUntil.toISOString());\n const now = new Date();\n if (\n values.dateUntil.getFullYear() !== now.getFullYear() ||\n values.dateUntil.getMonth() !== now.getMonth() ||\n values.dateUntil.getDate() !== now.getDate()\n ) {\n endDate = addDays(endDate, 1);\n endDate.setHours(0, 0, 0, 0);\n }\n\n setOkStep(true);\n requestReport(\n userInfo.activePatientId,\n startDate.toISOString(),\n endDate.toISOString(),\n userInfo.id!\n )\n .catch(() => {\n toast.error('Erro ao solicitar relatório');\n })\n .then(() => {\n toast.success('Relatório disponível para download');\n });\n };\n\n return (\n \n {!okStep && (\n \n {({ isSubmitting, values, setFieldValue, errors }) => {\n return (\n
\n Selecione o periodo desejado:\n \n De:\n Até:\n \n \n \n {errors.dateFrom}}\n onChange={(date: Date | null) => {\n setFieldValue('dateFrom', date, true);\n }}\n />\n\n {errors.dateUntil}}\n value={values.dateUntil}\n cancelLabel=\"Cancelar\"\n onChange={(date: Date | null) => {\n setFieldValue('dateUntil', date, true);\n }}\n />\n \n \n \n \n \n Exportar PDF\n \n \n
\n );\n }}\n \n )}\n\n {okStep && (\n <>\n \n \n O seu arquivo já está sendo gerado.\n \n \n Em instantes, você poderá acessá-lo através do botão [Consultar\n relatórios].\n \n \n \n \n \n \n )}\n
\n );\n};\n\nexport default ExportModal;\n","import styled from 'styled-components';\nimport { MenuItem } from '@material-ui/core';\n\nexport const StyledMenuItem = styled(MenuItem)`\n color: ${({ theme }) => theme.palette.common.white};\n background-color: ${({ theme }) => theme.palette.primary.main};\n background-image: linear-gradient(\n to bottom right,\n ${({ theme }) => theme.palette.primary.main},\n ${({ theme }) => theme.palette.secondary.dark}\n );\n display: flex;\n align-items: center;\n margin-bottom: ${({ theme }) => theme.spacing(0.75)}px;\n border-radius: ${({ theme }) => theme.spacing(1.5)}px;\n font-weight: 500;\n min-height: initial;\n\n &:hover {\n background-color: ${({ theme }) => theme.palette.primary.main};\n opacity: 0.7;\n }\n\n svg {\n margin-right: ${({ theme }) => theme.spacing(1)}px;\n }\n`;\n\nexport const ButtonContainer = styled.div<{ $isExpanded?: boolean }>`\n ${({ $isExpanded }) =>\n $isExpanded\n ? `\n &::before {\n content: '';\n position: fixed;\n top: 0; right: 0; bottom: 0; left: 0;\n background-color: black;\n opacity: 0.4; \n z-index: 2;\n }\n `\n : ''}\n\n button {\n background-image: linear-gradient(\n to bottom right,\n ${({ theme }) => theme.palette.primary.main},\n ${({ theme }) => theme.palette.secondary.dark}\n );\n padding: ${({ theme }) => theme.spacing(0.5, 0.1)};\n min-width: 40px;\n min-height: 40px;\n }\n`;\n","import React from 'react';\nimport { MenuItemProps } from '..';\nimport { StyledMenuItem } from '../styles';\n\nconst MenuItem: React.FC = ({\n label,\n icon,\n handleClickItem,\n}) => {\n return (\n \n {icon}\n {label}\n \n );\n};\n\nexport default MenuItem;\n","import React, { useState } from 'react';\nimport { Menu, Button, withStyles } from '@material-ui/core';\nimport { MenuProps } from '@material-ui/core/Menu';\nimport MenuIcon from '@material-ui/icons/MoreVert';\nimport MenuItem from './MenuItem';\nimport { ButtonContainer } from './styles';\n\nexport type MenuItemProps = {\n label: string;\n icon?: React.ReactNode;\n handleClickItem: (() => Promise) | (() => void);\n};\n\ninterface DropdownMenuProps {\n menuId?: number;\n menuItems: MenuItemProps[];\n}\n\nconst StyledMenu = withStyles({\n paper: {\n border: 'none',\n backgroundColor: 'transparent',\n },\n})((props: MenuProps) => (\n \n));\n\nconst DropdownMenu: React.FC = ({ menuId, menuItems }) => {\n const [anchorEl, setAnchorEl] = useState(null);\n const [isExpanded, setIsExpanded] = useState(false);\n\n const handleClick = (event: React.MouseEvent) => {\n setAnchorEl(event.currentTarget);\n setIsExpanded(true);\n };\n\n const handleClose = () => {\n setAnchorEl(null);\n setIsExpanded(false);\n };\n\n return (\n \n \n \n \n \n {menuItems.map(({ label, icon, handleClickItem }, index) => (\n \n ))}\n \n \n );\n};\n\nexport default DropdownMenu;\n","export default __webpack_public_path__ + \"static/media/Icon-user-expel.928af4fe.svg\";","import styled from 'styled-components';\nimport { Button } from '@material-ui/core';\n\nexport const StyledIconButton = styled(Button)`\n padding: ${({ theme }) => theme.spacing(1)}px;\n padding-right: 5px;\n background-color: ${({ theme }) => theme.palette.error.dark};\n border-radius: ${({ theme }) => theme.spacing(1)}px;\n min-width: 16px;\n\n &:hover {\n background-color: ${({ theme }) => theme.palette.error.dark};\n }\n`;\n","import React from 'react';\nimport ExpelUserIcon from '../../assets/Icon-user-expel.svg';\nimport { StyledIconButton } from './styles';\n\ninterface ExpelCaregiverButtonProps {\n onClick: () => void;\n}\n\nconst ExpelCaregiverButton: React.FC = (props) => {\n return (\n \n \n \n );\n};\n\nexport default ExpelCaregiverButton;\n","import {\n RadioGroup,\n Radio,\n DialogContent,\n FormControlLabel,\n} from '@material-ui/core';\nimport styled from 'styled-components';\n\nexport const CenterLayout = styled.div`\n margin-top: ${({ theme }) => theme.spacing(3)}px;\n display: flex;\n align-items: center;\n justify-content: space-around;\n`;\n\nexport const StyledDialogContent = styled(DialogContent)`\n padding: ${({ theme }) => theme.spacing(2)}px;\n`;\n\nexport const StyledRadioGroup = styled(RadioGroup)`\n width: fit-content;\n margin-left: auto;\n margin-right: auto;\n`;\n\nexport const StyledRadio = styled(Radio)`\n color: ${({ theme }) => theme.palette.common.white};\n`;\n\nexport const StyledFormControlLabel = styled(FormControlLabel)`\n & .MuiRadio-root:not(.Mui-disabled) {\n color: ${({ theme }) => theme.palette.common.white};\n }\n & .MuiCheckbox-root:not(.Mui-disabled) {\n color: ${({ theme }) => theme.palette.common.white};\n }\n & .Mui-disabled {\n opacity: 65%;\n color: ${({ theme }) => theme.palette.secondary.main};\n }\n\n color: ${({ theme }) => theme.palette.common.white};\n`;\n","import { CaregiverModel } from '@cuidador/database';\nimport { DialogTitle, Button as TextButton } from '@material-ui/core';\nimport React, { useState } from 'react';\nimport useShift from '../../hooks/useShift';\nimport StyledButton from '../StyledButton';\nimport StyledDialog from '../StyledDialog';\nimport {\n CenterLayout,\n StyledDialogContent,\n StyledRadio,\n StyledRadioGroup,\n StyledFormControlLabel,\n} from './styles';\ntype ExpelCaregiverDialogProps = {\n onClose: () => void;\n onConfirm: (option) => void;\n isOpen: boolean;\n isLoading: boolean;\n caregiver: CaregiverModel;\n};\n\nexport default function ExpelCaregiverDialog({\n isOpen,\n onConfirm,\n onClose,\n isLoading,\n caregiver,\n}: ExpelCaregiverDialogProps) {\n const [currentOption, setCurrentOption] = useState<\n 'keep' | 'erase' | undefined\n >();\n const { loading: isExpelLoading } = useShift();\n\n if (!caregiver) return null;\n\n return (\n \n \n \n Você está prestes a remover {caregiver.user?.name} do plantão\n \n setCurrentOption(e.target.value)}\n color=\"inherit\"\n >\n {/* TODO: enable this option when shift reopening is over */}\n {/* }\n label=\"Remover e limpar registros\"\n /> */}\n }\n label=\"Remover e manter registros\"\n />\n \n \n \n Voltar\n \n {\n onConfirm(currentOption);\n }}\n color=\"inherit\"\n data-testid=\"confirm-dialog\"\n disabled={isLoading || isExpelLoading || !currentOption}\n >\n Remover\n \n \n \n \n );\n}\n","import { Typography } from '@material-ui/core';\nimport Button from '@material-ui/core/Button';\nimport styled from 'styled-components';\n\nexport const ContainerShifts = styled.div`\n color: ${({ theme }) => theme.palette.extra.color.grey.dark};\n margin-bottom: ${({ theme }) => theme.spacing(2)}px;\n`;\n\nexport const ContainerDayShifts = styled.div`\n background-color: ${({ theme }) => theme.palette.extra.color.grey.light};\n margin: ${({ theme }) => theme.spacing(1.5, -2, 0)};\n padding: ${({ theme }) => theme.spacing(1, 2)};\n`;\n\nexport const ShiftCardContainer = styled.div<{ backgroundColor: string }>`\n border: 2px solid ${({ theme }) => theme.palette.extra.color.grey.light};\n border-radius: ${({ theme }) => theme.spacing(2)}px;\n background-color: ${({ backgroundColor }) => backgroundColor};\n padding: ${({ theme }) => theme.spacing(2)}px;\n margin-top: ${({ theme }) => theme.spacing(0.5)}px;\n`;\n\nexport const ShiftCardTitle = styled.div`\n border-bottom: 2px solid\n ${({ theme }) => theme.palette.extra.color.grey.light};\n margin-bottom: ${({ theme }) => theme.spacing(1)}px;\n margin-top: ${({ theme }) => theme.spacing(-1)}px;\n padding-bottom: ${({ theme }) => theme.spacing(1)}px;\n display: flex;\n align-items: center;\n justify-content: space-between;\n`;\n\nexport const ShiftCardTitleName = styled(Typography)`\n font-weight: bold;\n margin-left: ${({ theme }) => theme.spacing(2)}px;\n`;\n\nexport const StyledYYYYMM = styled(Typography)`\n font-weight: 600;\n color: ${({ theme }) => theme.palette.extra.color.grey.main};\n text-transform: capitalize;\n`;\n\nexport const StyledDD = styled(Typography)`\n color: ${({ theme }) => theme.palette.extra.color.grey.main};\n`;\n\nexport const StyledName = styled(Typography)`\n font-weight: 600;\n color: ${({ theme }) => theme.palette.extra.color.grey.main};\n`;\n\nexport const ShiftBodyDetails = styled.div`\n flex-direction: row;\n display: flex;\n align-items: center;\n justify-content: space-between;\n`;\n\nexport const ShiftBodyText = styled.div<{ isAnnulled?: boolean }>`\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n margin-block: ${({ theme }) => theme.spacing(0.5)}px;\n text-decoration: ${({ isAnnulled }) => (isAnnulled ? 'line-through' : '')};\n`;\n\nexport const TypographyWithIcon = styled(Typography)`\n display: flex;\n align-items: center;\n margin-right: ${({ theme }) => theme.spacing(0.5)}px;\n\n svg {\n margin-left: ${({ theme }) => theme.spacing(0.5)}px;\n }\n`;\n\nexport const ButtonContainer = styled.div`\n display: flex;\n flex-direction: row;\n justify-content: center;\n align-items: center;\n width: 100%;\n border-bottom: 1px solid;\n border-color: ${({ theme }) => theme.palette.primary.main};\n padding: ${({ theme }) => theme.spacing(0, 0, 2, 0)};\n margin-bottom: ${({ theme }) => theme.spacing(1)}px;\n`;\n\nexport const StyledButton = styled(Button)`\n width: 30%;\n background-color: ${({ theme }) => theme.palette.primary.main};\n color: ${({ theme }) => theme.palette.common.white};\n margin: ${({ theme }) => theme.spacing(0, 2)};\n :hover {\n background-color: ${({ theme }) => theme.palette.primary.main};\n color: ${({ theme }) => theme.palette.common.white};\n }\n`;\n","function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\nimport * as React from \"react\";\n\nvar _ref2 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M10.4 0C9.02087 0 7.69823 0.53849 6.72304 1.49701C5.74786 2.45553 5.2 3.75556 5.2 5.11111C5.2 6.46666 5.74786 7.76669 6.72304 8.72521C7.69823 9.68373 9.02087 10.2222 10.4 10.2222C11.7791 10.2222 13.1018 9.68373 14.077 8.72521C15.0521 7.76669 15.6 6.46666 15.6 5.11111C15.6 3.75556 15.0521 2.45553 14.077 1.49701C13.1018 0.53849 11.7791 0 10.4 0ZM20.15 11.5C16.9 11.5 14.3 14.0556 14.3 17.25C14.3 20.4444 16.9 23 20.15 23C23.4 23 26 20.4444 26 17.25C26 14.0556 23.4 11.5 20.15 11.5ZM10.4 12.7778C4.654 12.7778 0 15.065 0 17.8889V20.4444H12.35C11.9209 19.4322 11.7 18.3465 11.7 17.25C11.7056 15.735 12.1326 14.2503 12.935 12.9567C12.116 12.8544 11.284 12.7778 10.4 12.7778ZM20.15 13.4167C22.308 13.4167 24.05 15.1289 24.05 17.25C24.05 17.9656 23.855 18.63 23.504 19.1667L18.2 13.9533C18.746 13.6083 19.422 13.4167 20.15 13.4167ZM16.796 15.3333L22.1 20.5467C21.554 20.8917 20.878 21.0833 20.15 21.0833C17.992 21.0833 16.25 19.3711 16.25 17.25C16.25 16.5344 16.445 15.87 16.796 15.3333Z\",\n fill: \"white\"\n});\n\nfunction SvgIconUserExpel(_ref, svgRef) {\n var title = _ref.title,\n titleId = _ref.titleId,\n props = _objectWithoutProperties(_ref, [\"title\", \"titleId\"]);\n\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n width: 26,\n height: 23,\n viewBox: \"0 0 26 23\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, _ref2);\n}\n\nvar ForwardRef = /*#__PURE__*/React.forwardRef(SvgIconUserExpel);\nexport default __webpack_public_path__ + \"static/media/Icon-user-expel.928af4fe.svg\";\nexport { ForwardRef as ReactComponent };","import styled, { css } from 'styled-components';\nimport { List, AccessTime } from '@material-ui/icons';\nimport { ReactComponent as UserExpel } from '../../../assets/Icon-user-expel.svg';\n\nconst baseIconStyles = css`\n height: 20px;\n width: 20px;\n`;\n\nexport const ShiftDetailsIcon = styled(List)`\n ${baseIconStyles}\n`;\n\nexport const TimeCorrectionIcon = styled(AccessTime)`\n ${baseIconStyles}\n`;\n\nexport const EndExecutionIcon = styled(UserExpel)`\n ${baseIconStyles}\n margin-left: ${({ theme }) => theme.spacing(0.25)}px;\n`;\n","import { ShiftExecutionModel, ShiftModel } from '@cuidador/database';\nimport { format, parseISO } from 'date-fns';\nimport ptBrLocale from 'date-fns/locale/pt-BR';\n\nexport function getShiftCardBackgroundColor(shift: ShiftModel) {\n if (shift.status === 'not_done') return '#C0C0C0';\n if (shift.isAdditionalCoverage) return '#EFC1401A';\n return 'white';\n}\n\nexport function getDayGroup(date: Date) {\n const weekday = format(date, 'EEE', { locale: ptBrLocale });\n const capitalizedWeekday = weekday.charAt(0).toUpperCase() + weekday.slice(1);\n const day = format(date, 'dd', { locale: ptBrLocale });\n const month = format(date, 'MMMM', { locale: ptBrLocale });\n return `${capitalizedWeekday} ${day} de ${month}`;\n}\n\nexport function getShiftRealTime(shift: ShiftModel) {\n if (\n (shift.status !== 'done' && shift.status !== 'done_automatically') ||\n !shift.startedAt\n )\n return;\n const start = format(new Date(shift.startedAt), 'HH:mm');\n if (!shift.endedAt) return `Horário: ${start}`;\n const end = format(new Date(shift.endedAt), 'HH:mm');\n return `${start} às ${end}`;\n}\n\nexport const shiftHasNotStarted = (shift: ShiftModel) => {\n return (\n shift.status !== 'done' &&\n shift.status !== 'done_automatically' &&\n shift.status !== 'in_progress'\n );\n};\n\nexport const isShiftMenuVisible = (shift: ShiftModel) => {\n return shift.status === 'done' || shift.status === 'done_automatically';\n};\n\nexport const isShiftExpelCaregiverButtonVisible = (\n shift: ShiftModel,\n isAllowedToExpel: boolean\n) => {\n return shift.status === 'in_progress' && isAllowedToExpel;\n};\n\nexport const isShiftWithContestation = (shift: ShiftModel) => {\n return shift.timeContestations && shift.timeContestations.length > 0;\n};\n\nexport const shiftWasNotContestedYet = (shift: ShiftModel) => {\n return shift.timeContestations && shift.timeContestations.length === 0;\n};\n\nexport const isAnnullableShiftExecution = (execution: ShiftExecutionModel) => {\n return execution.status === 'done' && !isAnnulledShiftExecution(execution);\n};\n\nexport const isAnnulledShiftExecution = (execution: ShiftExecutionModel) => {\n return execution.isAnnulled;\n};\n\nexport function getShiftExecutionRealTime(\n execution: ShiftExecutionModel\n): string {\n let formattedString = '';\n\n if (!execution.startedAt) return formattedString;\n\n const start = format(parseISO(execution.startedAt), 'HH:mm');\n\n formattedString += `${start}`;\n\n if (!execution.endedAt) return formattedString;\n\n const end = format(parseISO(execution.endedAt), 'HH:mm');\n\n formattedString += ` até ${end}`;\n\n return formattedString;\n}\n\nexport const isShiftExecutionWithContestation = (\n execution: ShiftExecutionModel\n) => execution.timeContestations && execution.timeContestations.length > 0;\n","import React from 'react';\nimport { ShiftExecution, ShiftModel } from '@cuidador/database';\nimport { Typography } from '@material-ui/core';\n\ninterface ShiftCardMessageProps {\n shift: ShiftModel;\n execution: ShiftExecution;\n}\n\nconst ShiftCardMessage: React.FC = ({\n shift,\n execution,\n}) => {\n if (shift.status === 'not_done') {\n return Plantão não iniciado.;\n }\n\n return (\n <>\n {!!shift.isAnnulled && (\n \n | {execution.caregiver?.user?.name}\n \n )}\n {!shift.isAnnulled && (\n | {execution.caregiver?.user?.name}\n )}\n \n );\n};\n\nexport default ShiftCardMessage;\n","import styled from 'styled-components';\n\nexport const IndicatorLabel = styled.span`\n color: ${({ theme }) => theme.palette.extra.color.grey.dark};\n font-weight: ${({ theme }) => theme.typography.weightBold};\n margin: ${({ theme }) => theme.spacing(0, 1)};\n`;\n\nexport const IndicatorCircle = styled.div<{ color: string }>`\n content: '';\n width: 16px;\n height: 16px;\n display: inline-block;\n background-color: ${({ color }) => color};\n border-radius: 100vw;\n transform: 'translateY(-100%)';\n`;\n\nexport const Container = styled.div`\n display: flex;\n align-items: center;\n`;\n","import { ShiftModel } from '@cuidador/database';\nimport React from 'react';\nimport { useTheme } from 'styled-components';\nimport { Container, IndicatorCircle, IndicatorLabel } from './styles';\n\nconst ShiftInProgressIndicator: React.FC<{ shift: ShiftModel }> = ({\n shift,\n}) => {\n const theme = useTheme();\n\n return (\n \n \n \n {shift.executionInProgress ? (\n 'Plantão em andamento'\n ) : (\n {'Plantão incompleto'}\n )}\n \n \n );\n};\n\nexport default ShiftInProgressIndicator;\n","import React from 'react';\nimport { format } from 'date-fns';\nimport { ShiftExecution, ShiftModel } from '@cuidador/database';\nimport AccessTimeIcon from '@material-ui/icons/AccessTime';\nimport { TypographyWithIcon } from '../../styles';\nimport { shiftHasNotStarted, isShiftWithContestation } from '../../utils';\n\ninterface ShiftTimeMessageProps {\n shift: ShiftModel;\n execution: ShiftExecution;\n}\n\nconst ShiftTimeMessage: React.FC = ({\n shift,\n execution,\n}) => {\n if (shiftHasNotStarted(shift) || !shift.startedAt) return null;\n\n const handleFormatShiftExecutionTime = (execution: ShiftExecution) => {\n const start = format(new Date(String(execution.startedAt)), 'HH:mm');\n let dateStringMessage = `${start}`;\n\n if (execution.endedAt) {\n const end = format(new Date(execution.endedAt), 'HH:mm');\n dateStringMessage += ` até ${end}`;\n }\n\n return dateStringMessage;\n };\n\n return (\n \n {!!shift.isAnnulled && {handleFormatShiftExecutionTime(execution)}}\n {!shift.isAnnulled && {handleFormatShiftExecutionTime(execution)}}\n {!!isShiftWithContestation(shift) && }\n \n );\n};\n\nexport default ShiftTimeMessage;\n","import { ShiftModel } from '@cuidador/database';\nimport { format } from 'date-fns';\nimport { default as React, useEffect, useState } from 'react';\nimport { useHistory } from 'react-router-dom';\nimport { toast } from 'react-toastify';\nimport useCanAccess from '../../../hooks/useCanAccess';\nimport useCaregiver from '../../../hooks/useCaregiver';\nimport useShift from '../../../hooks/useShift';\nimport DropdownMenu from '../../DropdownMenu';\nimport ExpelCaregiverButton from '../../ExpelCaregiverButton';\nimport ExpelCaregiverDialog from '../../ExpelCaregiverDialog';\nimport {\n ShiftBodyDetails,\n ShiftBodyText,\n ShiftCardContainer,\n ShiftCardTitle,\n StyledName,\n} from '../styles';\nimport {\n ShiftDetailsIcon,\n TimeCorrectionIcon,\n EndExecutionIcon,\n} from './styles';\nimport {\n getShiftCardBackgroundColor,\n isShiftExpelCaregiverButtonVisible,\n isShiftMenuVisible,\n} from '../utils';\nimport ShiftCardMessage from './ShiftCardMessage';\nimport ShiftInProgressIndicator from './ShiftInProgressIndicator';\nimport ShiftTimeMessage from './ShiftTimeMessage';\nimport { sortBy } from 'lodash';\n\ninterface ShiftCardProps {\n shift: ShiftModel;\n onExpelCaregiver: () => void;\n}\n\nconst ShiftCard: React.FC = ({ shift, onExpelCaregiver }) => {\n const [isExpelDialogOpen, setIsExpelDialogOpen] = useState(false);\n const { expelCaregiver } = useShift();\n\n const { isAllowedToInvoke: isAllowedToExpel } = useCanAccess(\n 'care/shift.expel'\n );\n const { getById, byId, loading: caregiverLoading } = useCaregiver();\n\n useEffect(() => {\n if (!shift?.executionInProgress?.caregiverId) return;\n getById(shift.executionInProgress.caregiverId);\n }, [shift?.executionInProgress]);\n\n const history = useHistory();\n\n const redirectToShiftDetails = (shiftId?: number) => {\n history.push(`/historico/plantao/${shiftId}`);\n };\n\n const redirectToShiftExecutions = (shiftId?: number) => {\n history.push(`/correcao-de-horarios/plantao/${shiftId}`);\n };\n\n const menuItems = [\n {\n label: 'Detalhes do plantão',\n icon: ,\n handleClickItem: () => redirectToShiftDetails(shift?.id),\n shouldRender: true,\n },\n {\n label: 'Correção de horários',\n icon: ,\n handleClickItem: () => redirectToShiftExecutions(shift.id),\n shouldRender: true,\n },\n {\n label: 'Encerrar execução',\n icon: ,\n handleClickItem: () => null,\n shouldRender: !!shift.executionInProgress,\n },\n ];\n\n const menuItemsToBeRendered = menuItems.filter(\n ({ shouldRender }) => shouldRender\n );\n\n const handleExpelCaregiver = async (option: 'keep' | 'erase') => {\n setIsExpelDialogOpen(false);\n try {\n await expelCaregiver(shift.id!, option !== 'erase');\n toast.success('Usuário removido do plantão com sucesso');\n } catch {\n toast.error('Não foi possível remover usuário do plantão.');\n } finally {\n onExpelCaregiver();\n }\n };\n\n return (\n \n \n \n {`${format(new Date(shift.plannedToStartAt || ''), 'HH:mm')} ${\n shift.name || shift.shiftSchedule?.name || ''\n }`}\n \n {!!isShiftMenuVisible(shift) && (\n \n )}\n {isShiftExpelCaregiverButtonVisible(shift, isAllowedToExpel) &&\n shift?.executionInProgress?.caregiverId && (\n <>\n setIsExpelDialogOpen(true)}\n data-testid={`expel-button-${shift.id}`}\n />\n setIsExpelDialogOpen(false)}\n onConfirm={(option: 'keep' | 'erase') => {\n handleExpelCaregiver(option);\n }}\n isLoading={caregiverLoading}\n caregiver={byId[shift?.executionInProgress.caregiverId]}\n />\n \n )}\n \n \n
\n {sortBy(shift.executions, 'startedAt').map((execution, index) => (\n \n \n \n \n ))}\n {shift.status === 'in_progress' && (\n \n )}\n
\n
\n \n );\n};\n\nexport default ShiftCard;\n","import { Paper, Typography } from '@material-ui/core';\nimport styled from 'styled-components';\n\nexport const CardContainer = styled.div`\n width: 100%;\n margin-bottom: ${({ theme }) => theme.spacing(2)}px;\n`;\n\nexport const StyledPaper = styled(Paper)`\n border-radius: ${({ theme }) => theme.spacing(0.75)}px;\n padding: ${({ theme }) => theme.spacing(1, 2)};\n color: ${({ theme }) => theme.palette.extra.color.grey.dark};\n`;\n\nexport const ColoredTypography = styled(Typography)<{ textColor: string }>`\n color: ${(props) => props.textColor};\n`;\n\nexport const ColoredAnchor = styled.a<{ underlineColor: string }>`\n text-decoration: underline;\n text-decoration-color: ${(props) => props.underlineColor};\n`;\n","import { ShiftReportModel } from '@cuidador/database';\nimport { Typography, useTheme } from '@material-ui/core';\nimport { format } from 'date-fns';\nimport React, { useEffect, useState } from 'react';\nimport { toast } from 'react-toastify';\nimport useCanAccess from '../../../../hooks/useCanAccess';\nimport useShiftReport from '../../../../hooks/useShiftReport';\nimport {\n CardContainer,\n ColoredAnchor,\n ColoredTypography,\n StyledPaper,\n} from './styles';\n\nconst ShiftReportCard: React.FC<{ report: ShiftReportModel }> = ({\n report,\n}) => {\n const [downloadLink, setDownloadLink] = useState('');\n const { getDownloadLink, error } = useShiftReport();\n const { isAllowedToRead: isAllowedToReadShiftReport } = useCanAccess(\n 'media/patient/report/shift'\n );\n const theme = useTheme();\n useEffect(() => {\n if (!report.patientId || !report.id) return;\n let mounted = true;\n getDownloadLink(report.patientId, report.id)\n .then((link) => {\n if (mounted) setDownloadLink(link);\n })\n .catch(() => {\n if (mounted) toast.error('Erro ao solicitar o link de download.');\n });\n return () => {\n mounted = false;\n };\n }, [report.patientId, report.id]);\n\n const renderLink = () => {\n if (!isAllowedToReadShiftReport) return null;\n\n return error ? (\n \n Erro\n \n ) : downloadLink ? (\n \n \n Baixar PDF\n \n \n ) : (\n \n Processando\n \n );\n };\n\n return (\n \n \n \n PSC: {report.patient?.name}\n \n \n Período:{' '}\n {`${format(\n new Date(String(report.startDate)),\n 'dd/MM/yyyy'\n )} a ${format(new Date(String(report.endDate)), 'dd/MM/yyyy')}`}\n \n \n Solicitado em:{' '}\n {format(new Date(String(report.createdAt)), 'dd/MM/yyyy')}\n \n {renderLink()}\n \n \n );\n};\n\nexport default ShiftReportCard;\n","import { Divider, IconButton, Typography } from '@material-ui/core';\nimport CloseIcon from '@material-ui/icons/Close';\nimport styled from 'styled-components';\n\nexport const Container = styled.div`\n display: flex;\n flex-direction: column;\n flex: 1;\n align-items: center;\n padding: ${({ theme }) => theme.spacing(2, 4)};\n`;\n\nexport const Title = styled(Typography)`\n margin-top: ${({ theme }) => theme.spacing(2)}px;\n margin-right: auto;\n color: ${({ theme }) => theme.palette.extra.color.grey.dark};\n font-size: 1.25em;\n`;\n\nexport const StyledDivider = styled(Divider)`\n width: 100%;\n margin-bottom: ${({ theme }) => theme.spacing(4)}px;\n`;\n\nexport const StyledIconButton = styled(IconButton)`\n position: fixed;\n right: 0;\n top: 0;\n`;\n\nexport const LargeCloseIcon = styled(CloseIcon)`\n font-size: 2em;\n color: ${({ theme }) => theme.palette.extra.color.grey.dark};\n`;\n","import { Slide } from '@material-ui/core';\nimport { TransitionProps } from '@material-ui/core/transitions';\nimport React from 'react';\n\nexport type ShiftReportListDialogProps = {\n open: boolean;\n onClose: () => void;\n};\n\nexport const Transition = React.forwardRef(function Transition(\n props: TransitionProps & {\n // eslint-disable-next-line\n children?: React.ReactElement;\n },\n ref: React.Ref\n) {\n return ;\n});\n","import { ShiftReportModel } from '@cuidador/database';\nimport { Dialog } from '@material-ui/core';\nimport React, { useContext, useEffect, useState } from 'react';\nimport { toast } from 'react-toastify';\nimport { AuthContext } from '../../../contexts/auth';\nimport useShiftReport from '../../../hooks/useShiftReport';\nimport LoadingBackdrop from '../../LoadingBackdrop';\nimport ShiftReportCard from './ShiftReportCard';\nimport {\n Container,\n LargeCloseIcon,\n StyledDivider,\n StyledIconButton,\n Title,\n} from './styles';\nimport { ShiftReportListDialogProps, Transition } from './utils';\n\nconst ShiftReportListDialog: React.FC = ({\n open,\n onClose,\n}) => {\n const [shiftReports, setShiftReports] = useState([]);\n const { getAllFromPatient, loading } = useShiftReport();\n const { userInfo } = useContext(AuthContext);\n const patientId = userInfo?.activePatientId;\n\n const fetchData = async (id: number) => {\n try {\n const reports = await getAllFromPatient(id);\n setShiftReports(reports);\n } catch (error) {\n toast.error('Erro ao buscar relatórios');\n }\n };\n\n useEffect(() => {\n if (!patientId) return;\n let mounted = true;\n if (mounted) fetchData(patientId);\n return () => {\n mounted = false;\n };\n }, [patientId]);\n\n return (\n \n \n \n \n \n Download de arquivos\n \n {loading ? (\n \n ) : (\n shiftReports.map((report) => (\n \n ))\n )}\n \n \n );\n};\n\nexport default ShiftReportListDialog;\n","import { ShiftModel } from '@cuidador/database';\nimport { format } from 'date-fns';\nimport ptBrLocale from 'date-fns/locale/pt-BR';\nimport React, { useState } from 'react';\nimport useCanAccess from '../../hooks/useCanAccess';\nimport ExportModal from './ExportModal';\nimport ShiftCard from './ShiftCard';\nimport ShiftReportListDialog from './ShiftReportListDialog';\nimport {\n ButtonContainer,\n ContainerDayShifts,\n ContainerShifts,\n StyledButton,\n StyledDD,\n StyledYYYYMM,\n} from './styles';\nimport { getDayGroup } from './utils';\n\ninterface ShiftsHistoryProps {\n shifts?: Map>;\n onExpelCaregiver: () => void;\n}\n\nconst ShiftsHistory: React.FC = ({\n shifts,\n onExpelCaregiver,\n}) => {\n const [visibleModal, setVisibleModal] = useState(false);\n const [showShiftReportList, setShowShiftReportList] = useState(false);\n const {\n isAllowedToRead: isAllowedToReadReport,\n isAllowedToCreate: isAllowedToCreateReport,\n } = useCanAccess('report/shift');\n\n return (\n <>\n \n {isAllowedToCreateReport && (\n setVisibleModal(true)}>\n Gerar relatório\n \n )}\n\n {isAllowedToReadReport && (\n setShowShiftReportList(true)}>\n Consultar relatórios\n \n )}\n \n {Array.from(shifts?.entries() || []).map(([mapKeyYYYYMM, innerMap]) => {\n const anyShift = Array.from(innerMap.values())[0][0];\n const date = new Date(String(anyShift.plannedToStartAt));\n return (\n \n \n {format(date, 'MMMM, yyyy', { locale: ptBrLocale })}\n \n {Array.from(innerMap.entries()).map(([mapKeyDD, shifts]) => {\n const anyShift = shifts[0];\n const date = new Date(String(anyShift.plannedToStartAt));\n return (\n \n {getDayGroup(date)}\n {shifts.map((shift) => {\n return (\n \n );\n })}\n \n );\n })}\n \n );\n })}\n\n setVisibleModal(false)}\n opened={visibleModal}\n />\n\n {showShiftReportList && (\n setShowShiftReportList(false)}\n />\n )}\n \n );\n};\nexport default ShiftsHistory;\n","import styled from 'styled-components';\n\nexport const Container = styled.div`\n display: flex;\n flex: 1;\n background-color: ${({ theme }) => theme.palette.common.white};\n padding: ${({ theme }) => theme.spacing(2)}px;\n flex-direction: column;\n color: ${({ theme }) => theme.palette.secondary.main};\n width: 100%;\n box-sizing: border-box;\n`;\n","import { ShiftModel } from '@cuidador/database';\nimport format from 'date-fns/format';\nimport qs from 'query-string';\nimport React, { useContext, useEffect, useMemo, useState } from 'react';\nimport { useHistory } from 'react-router-dom';\nimport { toast } from 'react-toastify';\nimport LoadingBackdrop from '../../../components/LoadingBackdrop';\nimport ShiftsHistory from '../../../components/ShiftsHistory';\nimport StyledButton from '../../../components/StyledButton';\nimport { AuthContext } from '../../../contexts/auth';\nimport useShift from '../../../hooks/useShift';\nimport { Container } from './styles';\n\nconst History: React.FC = () => {\n const { getByPatientIdPaginated, total, loading, byId, ids } = useShift();\n const history = useHistory();\n\n const { userInfo } = useContext(AuthContext);\n const patientId = userInfo?.activePatientId;\n const [page, setPage] = useState(1);\n\n const fetchData = () => {\n const params = qs.parse(history.location.search);\n if (patientId) {\n getByPatientIdPaginated(patientId, {\n ...params,\n page: 0,\n limit: 50 * page,\n orderBy: 'plannedToStartAt', // nao seria por outra chave?\n order: 'DESC',\n }).catch((e) => {\n toast.error(e);\n });\n }\n };\n\n const groupShiftsByDate = (shifts: ShiftModel[]) => {\n /**\n * groupBy year + month, then group by day\n * Map<'YYYYMM', Map<'DD', ShiftModel>>\n */\n const map = new Map>();\n for (const shift of shifts) {\n const mapKeyYYYYMM = format(\n new Date(String(shift.plannedToStartAt)),\n 'yyyyMM'\n );\n const mapKeyDD = format(new Date(String(shift.plannedToStartAt)), 'dd');\n\n if (map.has(mapKeyYYYYMM)) {\n const innerMap = map.get(mapKeyYYYYMM)!;\n if (innerMap.has(mapKeyDD)) {\n const shifts = innerMap.get(mapKeyDD)!;\n if (!shifts.find((s) => s.id === shift.id)) {\n innerMap.set(mapKeyDD, [...shifts, shift]);\n }\n } else {\n innerMap.set(mapKeyDD, [shift]);\n }\n } else {\n map.set(\n mapKeyYYYYMM,\n new Map([[mapKeyDD, [shift]]])\n );\n }\n }\n return map;\n };\n\n const shifts = ids.map((id) => byId[id]);\n const groupedShifts = useMemo(() => groupShiftsByDate(shifts), [shifts]);\n\n useEffect(() => {\n fetchData();\n }, [page]);\n\n const pageIncrement = () => {\n setPage(page + 1);\n };\n\n return (\n <>\n \n \n {loading && }\n {shifts.length < total && (\n \n Ver mais\n \n )}\n \n \n );\n};\n\nexport default History;\n","export default __webpack_public_path__ + \"static/media/Icon-filter.bfc55fb6.svg\";","export default __webpack_public_path__ + \"static/media/Icon-flat-accomplished.f84ad879.svg\";","export default __webpack_public_path__ + \"static/media/icon-flat-accomplished-warning.d00fb606.svg\";","export default __webpack_public_path__ + \"static/media/Icon-flat-appointment.1c0f46ea.svg\";","export default __webpack_public_path__ + \"static/media/Icon-flat-awaiting.4695b402.svg\";","export default __webpack_public_path__ + \"static/media/Icon-flat-complication.887ea7d8.svg\";","export default __webpack_public_path__ + \"static/media/Icon-flat-measurement.fa526f6a.svg\";","export default __webpack_public_path__ + \"static/media/Icon-flat-medication.35b11528.svg\";","export default __webpack_public_path__ + \"static/media/Icon-flat-not-accomplished.89c6950f.svg\";","export default __webpack_public_path__ + \"static/media/Icon-flat-routine.a330411b.svg\";","export default __webpack_public_path__ + \"static/media/Icon-coloredCalendar.95678941.svg\";","export default __webpack_public_path__ + \"static/media/Icon-done.ebbd9c23.svg\";","export default __webpack_public_path__ + \"static/media/Icon-notdone.1855bbc2.svg\";","export default __webpack_public_path__ + \"static/media/Icon-time-color.5ae685b3.svg\";","import styled from 'styled-components';\n\nexport const TypographyContainer = styled.div`\n color: ${({ theme }) => theme.palette.common.white};\n flex-grow: 1;\n display: flex;\n flex-direction: column;\n word-wrap: break-word;\n margin: ${({ theme }) => theme.spacing(0, 2, 2, 2)};\n`;\n\nexport const TimerContainer = styled.div`\n color: ${({ theme }) => theme.palette.common.white};\n margin-left: ${({ theme }) => theme.spacing(1)}px;\n align-self: center;\n`;\n\nexport const LeftContainer = styled.div`\n display: flex;\n justify-content: space-between;\n flex-direction: column;\n padding: 0;\n`;\n\nexport const DescriptionContainer = styled.div`\n margin-top: ${({ theme }) => theme.spacing(1)}px;\n`;\n\nexport const StatusContainer = styled.div`\n flex-shrink: 0;\n margin-left: auto;\n\n & img {\n margin-left: ${({ theme }) => theme.spacing(2)}px;\n }\n`;\n\nexport const RightContainer = styled.div`\n display: flex;\n flex-direction: column;\n width: 100%;\n min-width: 0;\n`;\n\nexport const CardFooter = styled.footer`\n display: flex;\n justify-content: space-between;\n align-items: center;\n margin-left: ${({ theme }) => theme.spacing(2)}px;\n margin-right: ${({ theme }) => theme.spacing(2)}px;\n margin-bottom: ${({ theme }) => theme.spacing(1)}px;\n`;\n\nexport const CaregiverTypography = styled.div`\n color: ${({ theme }) => theme.palette.common.white};\n font-size: 15px;\n font-weight: 600;\n display: -webkit-box;\n -webkit-line-clamp: 2;\n -webkit-box-orient: vertical;\n overflow: hidden;\n text-overflow: ellipsis;\n\n &::before {\n content: 'por ';\n font-weight: 400;\n }\n`;\n","import styled from 'styled-components';\nimport StyledPaper from '../../../StyledPaper';\n\nexport const CardBox = styled(StyledPaper)`\n width: 100%;\n display: flex;\n margin: 0;\n min-height: 120px;\n background-color: ${({ theme }) => theme.palette.success.main};\n padding: 0;\n`;\n\nexport const TitleContainer = styled.div`\n margin-bottom: ${({ theme }) => theme.spacing(-0.8)}px;\n`;\n","import { EventSubCategoryModel } from '@cuidador/database';\nimport Typography from '@material-ui/core/Typography';\nimport { format } from 'date-fns';\nimport React from 'react';\nimport CalendarIcon from '../../../../assets/Icon-coloredCalendar.svg';\nimport DoneIcon from '../../../../assets/Icon-done.svg';\nimport NotDoneIcon from '../../../../assets/Icon-notdone.svg';\nimport TimeColorIcon from '../../../../assets/Icon-time-color.svg';\nimport {\n CardFooter,\n CaregiverTypography,\n DescriptionContainer,\n LeftContainer,\n RightContainer,\n StatusContainer,\n TimerContainer,\n TypographyContainer,\n} from '../styles';\nimport { CardBox, TitleContainer } from './styles';\n\ninterface CardProps {\n id?: Id;\n name?: string;\n subCategory?: EventSubCategoryModel;\n eventHappensAt?: string;\n description?: string;\n status?: string;\n comment?: string;\n updatedTimeHappensAt?: string | null;\n caregiverName?: string;\n}\n\nconst AppointmentCard: React.FC = ({\n id,\n name,\n subCategory,\n description,\n eventHappensAt,\n status,\n comment,\n updatedTimeHappensAt,\n caregiverName,\n}) => {\n const eventDate = updatedTimeHappensAt || eventHappensAt;\n const formattedDate = format(new Date(`${eventDate}`), 'HH:mm');\n return (\n \n \n \n {formattedDate}\n \n \n \n \n \n \n {subCategory?.name}\n \n {name?.trim()}\n \n {description}\n {comment && (\n Obs: {comment}\n )}\n \n \n \n {caregiverName && (\n {caregiverName}\n )}\n \n {updatedTimeHappensAt && status === 'accomplished' && (\n \n )}\n {status === 'awaiting' && <>}\n {status === 'accomplished' && }\n {status === 'not_accomplished' && }\n \n \n \n \n );\n};\n\nexport default AppointmentCard;\n","export default __webpack_public_path__ + \"static/media/AlertIcon.adcc333b.svg\";","import styled from 'styled-components';\nimport StyledPaper from '../../../StyledPaper';\n\nexport const CardBox = styled(StyledPaper)`\n width: 100%;\n display: flex;\n margin: 0;\n min-height: 120px;\n background-color: ${({ theme }) => theme.palette.error.dark};\n padding: 0;\n`;\n\nexport const CaregiverTypography = styled.div`\n color: ${({ theme }) => theme.palette.common.white};\n font-size: 15px;\n font-weight: 600;\n display: -webkit-box;\n -webkit-line-clamp: 2;\n -webkit-box-orient: vertical;\n overflow: hidden;\n text-overflow: ellipsis;\n margin-top: auto;\n\n &::before {\n content: 'por ';\n font-weight: 400;\n }\n`;\n","import { EventSubCategoryModel } from '@cuidador/database';\nimport Typography from '@material-ui/core/Typography';\nimport { format } from 'date-fns';\nimport React from 'react';\nimport AlertIcon from '../../../../assets/AlertIcon.svg';\nimport {\n DescriptionContainer,\n LeftContainer,\n TimerContainer,\n TypographyContainer,\n} from '../styles';\nimport { CardBox, CaregiverTypography } from './styles';\n\ninterface CardProps {\n id?: Id;\n name?: string;\n eventHappensAt?: string | null;\n description?: string;\n subCategory?: EventSubCategoryModel;\n comment?: string;\n caregiverName?: string;\n}\n\nconst ComplicationCard: React.FC = ({\n id,\n description,\n eventHappensAt,\n subCategory,\n comment,\n caregiverName,\n}) => {\n const formattedDate = format(new Date(`${eventHappensAt}`), 'HH:mm');\n return (\n \n \n \n {formattedDate}\n \n \n \n \n {subCategory?.name}\n \n {description}\n {comment && (\n Obs: {comment}\n )}\n \n {caregiverName && (\n {caregiverName}\n )}\n \n \n );\n};\n\nexport default ComplicationCard;\n","export default __webpack_public_path__ + \"static/media/Icon-medication.2f3fb281.svg\";","import styled from 'styled-components';\nimport StyledPaper from '../../../StyledPaper';\n\nexport const CardBox = styled(StyledPaper)`\n width: 100%;\n display: flex;\n margin: 0;\n min-height: 120px;\n background-color: ${({ theme }) => theme.palette.info.main};\n padding: 0;\n`;\n","import Typography from '@material-ui/core/Typography'\nimport { format } from 'date-fns'\nimport React from 'react'\nimport DoneIcon from '../../../../assets/Icon-done.svg'\nimport MedicationIcon from '../../../../assets/Icon-medication.svg'\nimport NotDoneIcon from '../../../../assets/Icon-notdone.svg'\nimport TimeColorIcon from '../../../../assets/Icon-time-color.svg'\nimport {\n CardFooter,\n CaregiverTypography,\n DescriptionContainer,\n LeftContainer,\n RightContainer,\n StatusContainer,\n TimerContainer,\n TypographyContainer,\n} from '../styles'\nimport { CardBox } from './styles'\nimport { handleDropsLabel } from './utils'\n\ninterface CardProps {\n id?: Id\n name?: string\n status?: string\n dosageQuantity?: number\n dosageFormat?: string\n administeredBy?: string\n medicalNotes?: string\n eventHappensAt?: string\n updatedTimeHappensAt?: string | null\n comment?: string\n caregiverName?: string\n}\n\nconst MedicationCard: React.FC = ({\n id,\n name,\n status,\n dosageQuantity,\n dosageFormat,\n administeredBy,\n medicalNotes,\n eventHappensAt,\n updatedTimeHappensAt,\n comment,\n caregiverName,\n}) => {\n const eventDate = updatedTimeHappensAt || eventHappensAt\n const formattedDate = format(new Date(`${eventDate}`), 'HH:mm')\n let doseFormat\n switch (dosageFormat) {\n case 'pill':\n doseFormat = dosageQuantity == 1 ? 'comprimido' : 'comprimidos'\n break\n\n case 'capsule':\n doseFormat = dosageQuantity == 1 ? 'cápsula' : 'cápsulas'\n break\n\n case 'sachet':\n doseFormat = dosageQuantity == 1 ? 'sachê' : 'sachês'\n break\n\n case 'drops':\n doseFormat = handleDropsLabel(dosageQuantity)\n break\n\n case 'ampoule':\n doseFormat = dosageQuantity == 1 ? 'ampola' : 'ampolas'\n break\n\n case 'suppository':\n doseFormat = dosageQuantity == 1 ? 'supositório' : 'supositórios'\n break\n\n case 'inhaled':\n doseFormat = dosageQuantity == 1 ? 'jato/puff' : 'jatos/puffs'\n break\n\n case 'unit':\n doseFormat =\n dosageQuantity == 1\n ? 'unidade internacional'\n : 'unidades internacionais'\n break\n\n case 'ml':\n doseFormat = 'ml'\n break\n\n case 'spoon':\n doseFormat = dosageQuantity == 1 ? 'colher' : 'colheres'\n break\n\n case 'grams':\n doseFormat = dosageQuantity == 1 ? 'grama' : 'gramas'\n break\n\n case 'strip':\n doseFormat =\n dosageQuantity == 1 ? 'placa/tira/fita' : 'placas/tiras/fitas'\n break\n\n case 'sticker':\n doseFormat = dosageQuantity == 1 ? 'adesivo' : 'adesivos'\n break\n\n default:\n break\n }\n\n let viaType\n switch (administeredBy) {\n case 'oral':\n viaType = 'Oral'\n break\n\n case 'sublingual':\n viaType = 'Sublingual'\n break\n\n case 'subcutaneous':\n viaType = 'Subcutânea'\n break\n\n case 'intravenous':\n viaType = 'Intravenosa'\n break\n\n case 'intramuscular':\n viaType = 'Intramuscular'\n break\n\n case 'tube':\n viaType = 'Sonda'\n break\n\n case 'rectal':\n viaType = 'Retal'\n break\n\n case 'inhalation':\n viaType = 'Inalatório'\n break\n\n case 'topic':\n viaType = 'Cutânea'\n break\n\n case 'ocular':\n viaType = 'Ocular'\n break\n\n case 'auricular':\n viaType = 'Auricular'\n break\n\n case 'vaginal':\n viaType = 'Vaginal'\n break\n\n default:\n break\n }\n\n return (\n \n \n \n {formattedDate}\n \n \n \n \n \n {name}\n \n {dosageQuantity} {doseFormat}\n \n Via: {viaType}\n {medicalNotes}\n \n {comment && (\n Obs: {comment}\n )}\n \n \n \n {caregiverName && (\n {caregiverName}\n )}\n \n {updatedTimeHappensAt && status === 'accomplished' && (\n \n )}\n {status === 'awaiting' && <>}\n {status === 'accomplished' && }\n {status === 'not_accomplished' && }\n \n \n \n \n )\n}\n\nexport default MedicationCard\n","export const handleDropsLabel = (dosage?: number) => {\n if (dosage) {\n return dosage <= 1 ? 'gota' : 'gotas';\n }\n return 'gota';\n};\n","export default __webpack_public_path__ + \"static/media/Icon-mesurement.91a35613.svg\";","import styled, { css } from 'styled-components';\nimport StyledPaper from '../../../StyledPaper';\n\nexport type HighlightVariants = 'red' | 'yellow' | undefined;\n\nexport const CardBox = styled(StyledPaper)<{\n styledHighlight?: HighlightVariants;\n}>`\n width: 100%;\n display: flex;\n margin: 0;\n min-height: 120px;\n background-color: ${({ theme }) => theme.palette.extra.color.yellow};\n padding: 0;\n\n ${({ theme, styledHighlight }) => {\n switch (styledHighlight) {\n case 'red':\n return css`\n outline: solid 3px ${theme.palette.extra.color.red.light};\n `;\n case 'yellow':\n return css`\n outline: solid 3px ${theme.palette.extra.color.yellow};\n `;\n }\n }}\n`;\n","import { EventSubCategoryModel, MeasurementModel, SymptomModel } from '@cuidador/database'\nimport Typography from '@material-ui/core/Typography'\nimport { format } from 'date-fns'\nimport React from 'react'\nimport DoneIcon from '../../../../assets/Icon-done.svg'\nimport MesurementIcon from '../../../../assets/Icon-mesurement.svg'\nimport NotDoneIcon from '../../../../assets/Icon-notdone.svg'\nimport {\n CardFooter,\n CaregiverTypography,\n DescriptionContainer,\n LeftContainer,\n RightContainer,\n StatusContainer,\n TimerContainer,\n TypographyContainer,\n} from '../styles'\nimport { CardBox } from './styles'\n\ninterface CardProps {\n id?: Id\n eventHappensAt?: string\n description?: string\n status?: string\n subCategory?: EventSubCategoryModel\n measurement?: MeasurementModel\n comment?: string\n caregiverName?: string\n}\n\nconst foodCondition = (condition: string) => {\n switch (condition) {\n case 'preprandial':\n return 'Condição alimentar: pré-refeição'\n case 'fasting':\n return 'Condição alimentar: jejum'\n case 'postprandial':\n return 'Condição alimentar: pós-refeição'\n case 'not_available':\n return 'Condição alimentar: não informado'\n default:\n return 'não informado'\n }\n}\n\nconst getValueWithUnit = (measurement?: MeasurementModel, subCategory?: EventSubCategoryModel) => {\n if (!measurement) return 'nenhum'\n switch (subCategory?.name) {\n case 'Glicemia':\n return measurement?.measurementValue + ' ml/dL'\n case 'Frequência cardíaca':\n return measurement?.measurementValue + ' bpm'\n case 'Frequência respiratória':\n return measurement?.measurementValue + ' mrm'\n case 'Oximetria':\n return measurement?.measurementValue + ' %SaO2'\n case 'Pressão arterial':\n return measurement?.measurementValue + ' mmHg'\n case 'Temperatura ':\n return measurement?.measurementValue + ' ºC'\n }\n return measurement?.measurementValue\n}\n\nexport const getConditionWithDetail = (condition: string, subCategory?: EventSubCategoryModel) => {\n switch (subCategory?.name) {\n case 'Glicemia':\n return foodCondition(condition)\n case 'Frequência cardíaca':\n return condition\n case 'Frequência respiratória':\n return condition\n case 'Oximetria':\n return condition\n case 'Pressão arterial':\n return condition\n case 'Temperatura ':\n return condition\n }\n return condition\n}\n\nexport const getFormattedSymptoms = (symptoms?: SymptomModel[]) => {\n let result = 'Sintomas: '\n\n symptoms?.forEach((symptom, index) => {\n if (symptoms && symptoms?.length > 1 && index > 0) {\n result += '; ' + symptom.symptomName\n } else {\n result += symptom.symptomName\n }\n })\n\n return result\n}\n\nconst MeasurementCard: React.FC = ({\n id,\n eventHappensAt,\n description,\n status,\n subCategory,\n measurement,\n comment,\n caregiverName,\n}) => {\n const formattedDate = format(new Date(`${eventHappensAt}`), 'HH:mm')\n return (\n \n \n \n {formattedDate}\n \n \n \n \n \n {subCategory?.name}\n {description && (\n Instruções: {description}\n )}\n \n Valores medidos: {getValueWithUnit(measurement, subCategory)}\n \n \n \n {measurement?.measurementDescription}\n \n \n {getConditionWithDetail(measurement?.additionalDetails || '', subCategory)}\n \n {measurement?.symptoms && measurement?.symptoms?.length > 0 && (\n {getFormattedSymptoms(measurement?.symptoms)}\n )}\n {comment && (\n Obs: {comment}\n )}\n \n \n \n {caregiverName && (\n {caregiverName}\n )}\n \n {status === 'awaiting' && <>}\n {status === 'accomplished' && }\n {status === 'not_accomplished' && }\n \n \n \n \n )\n}\n\nexport default MeasurementCard\n","export default __webpack_public_path__ + \"static/media/Icon-watch.ffb4561b.svg\";","import styled from 'styled-components';\nimport StyledPaper from '../../../StyledPaper';\n\nexport const CardBox = styled(StyledPaper)`\n width: 100%;\n display: flex;\n margin: 0;\n min-height: 120px;\n background-color: ${({ theme }) => theme.palette.extra.color.ocean};\n padding: 0;\n`;\n\nexport const TitleContainer = styled.div`\n margin-bottom: ${({ theme }) => theme.spacing(-0.8)}px;\n`;\n","import { EventSubCategoryModel } from '@cuidador/database';\nimport Typography from '@material-ui/core/Typography';\nimport { format } from 'date-fns';\nimport React from 'react';\nimport DoneIcon from '../../../../assets/Icon-done.svg';\nimport NotDoneIcon from '../../../../assets/Icon-notdone.svg';\nimport TimeColorIcon from '../../../../assets/Icon-time-color.svg';\nimport ClockIcon from '../../../../assets/Icon-watch.svg';\nimport {\n CaregiverTypography,\n CardFooter,\n DescriptionContainer,\n LeftContainer,\n RightContainer,\n StatusContainer,\n TimerContainer,\n TypographyContainer,\n} from '../styles';\nimport { CardBox, TitleContainer } from './styles';\n\ninterface CardProps {\n id?: Id;\n name?: string;\n subCategory?: EventSubCategoryModel;\n eventHappensAt?: string;\n description?: string;\n status?: string;\n comment?: string;\n updatedTimeHappensAt?: string | null;\n caregiverName?: string;\n}\n\nconst RoutineCard: React.FC = ({\n id,\n name,\n subCategory,\n description,\n eventHappensAt,\n status,\n comment,\n updatedTimeHappensAt,\n caregiverName,\n}) => {\n const eventDate = updatedTimeHappensAt || eventHappensAt;\n const formattedDate = format(new Date(`${eventDate}`), 'HH:mm');\n\n return (\n \n \n \n {formattedDate}\n \n \n \n \n \n \n {subCategory?.name}\n \n {name?.trim()}\n \n {description}\n {comment && (\n Obs: {comment}\n )}\n \n \n \n {caregiverName && (\n {caregiverName}\n )}\n \n {updatedTimeHappensAt && status === 'accomplished' && (\n \n )}\n {status === 'awaiting' && <>}\n {status === 'accomplished' && }\n {status === 'not_accomplished' && }\n \n \n \n \n );\n};\n\nexport default RoutineCard;\n","import { EventModel, EventSubCategoryModel } from '@cuidador/database';\n\nexport const categoryIdMapper = {\n GENERAL: 1,\n MEDICATION: 2,\n COMPLICATION: 3,\n MEASUREMENT: 4,\n};\n\nexport const subCategoryIdMapper = {\n BLOOD_PRESSURE: 35231,\n BODY_TEMPERATURE: 35237,\n BLOOD_GLYCEMIA: 35230,\n BREATH_RATE: 35236,\n HEART_RATE: 35235,\n OXIMETRY_RATE: 35232,\n WEIGHT_MEASURMENT: 35233,\n};\n\nexport const separateComplicationsFromActivities = (\n shiftEvents: EventModel[] | undefined\n) => {\n if (!shiftEvents || shiftEvents.length === 0)\n return {\n complicationEvents: [],\n eventsWithoutComplications: [],\n };\n\n const complicationEvents = shiftEvents.filter((event) => {\n const subCategory = event.subCategory as EventSubCategoryModel;\n return subCategory.categoryId === categoryIdMapper['COMPLICATION'];\n });\n const eventsWithoutComplications = shiftEvents.filter((event) => {\n const subCategory = event.subCategory as EventSubCategoryModel;\n return subCategory.categoryId !== categoryIdMapper['COMPLICATION'];\n });\n\n return { complicationEvents, eventsWithoutComplications };\n};\n\nexport const getMeasurementUnit = (subCategoryId?: number): string => {\n switch (subCategoryId) {\n case subCategoryIdMapper.BLOOD_GLYCEMIA:\n return 'mg/dL';\n case subCategoryIdMapper.BODY_TEMPERATURE:\n return '°C';\n case subCategoryIdMapper.BREATH_RATE:\n return 'mrm';\n case subCategoryIdMapper.HEART_RATE:\n return 'bpm';\n case subCategoryIdMapper.OXIMETRY_RATE:\n return '%SaO2';\n case subCategoryIdMapper.BLOOD_PRESSURE:\n return 'mmHg';\n case subCategoryIdMapper.WEIGHT_MEASURMENT:\n return 'Kg';\n default:\n return '';\n }\n};\n","import { Typography } from '@material-ui/core';\nimport { Close } from '@material-ui/icons';\nimport CheckIcon from '@material-ui/icons/Check';\nimport styled, { css } from 'styled-components';\n\ninterface StyleForComplication {\n styledHighlight: 'red' | 'orange' | undefined;\n}\n\nexport const Container = styled.div`\n display: flex;\n flex-direction: column;\n margin-bottom: ${({ theme }) => theme.spacing(1)}px;\n background-color: #fff;\n border-radius: 4px;\n ${({ theme, styledHighlight }) => {\n if (styledHighlight === 'red')\n return css`\n border: 5px solid ${theme.palette.extra.color.red.light};\n `;\n if (styledHighlight === 'orange')\n return css`\n border: 5px solid ${theme.palette.extra.color.yellow};\n `;\n }}\n padding-bottom: ${({ theme }) => theme.spacing(1)}px;\n`;\n\nexport const RealTimeContainer = styled.div`\n background-color: ${({ theme }) => theme.palette.extra.color.yellow};\n color: black;\n padding-left: ${({ theme }) => theme.spacing(1)}px;\n`;\n\nexport const StyledBoldTitle = styled(Typography)`\n padding: ${({ theme }) => theme.spacing(0, 1)};\n font-weight: bold;\n color: ${({ theme, styledHighlight }) =>\n styledHighlight === 'red'\n ? theme.palette.extra.color.red.light\n : theme.palette.extra.color.yellow};\n`;\n\nexport const Instructions = styled(Typography)`\n line-height: 14px;\n padding: ${({ theme }) => theme.spacing(0, 1)};\n`;\n\nexport const MeasurementInput = styled.input`\n border: 1px solid ${({ theme }) => theme.palette.extra.color.grey.main};\n padding: ${({ theme }) => theme.spacing(1)}px;\n border-radius: 4px;\n color: ${({ theme }) => theme.palette.extra.color.grey.dark};\n opacity: 1;\n width: 100%;\n`;\n\nexport const InformationContainer = styled.div`\n display: flex;\n justify-content: space-between;\n align-items: center;\n margin-block: ${({ theme }) => theme.spacing(0.5)}px;\n width: 100%;\n`;\n\nexport const NoteTypography = styled(Typography)`\n line-height: 1.2;\n overflow-wrap: break-word;\n`;\n\ninterface CheckButtonProps {\n isChecked: boolean;\n}\n\nexport const CloseIconContainer = styled.button`\n ${({ theme, isChecked }) => {\n const background = isChecked\n ? theme.palette.extra.color.red.main\n : theme.palette.common.white;\n\n const iconColor = isChecked\n ? theme.palette.primary.light\n : theme.palette.extra.color.grey.main;\n\n const borderColor = isChecked\n ? background\n : theme.palette.extra.color.grey.main;\n\n return css`\n display: flex;\n align-items: center;\n justify-content: center;\n width: 24px;\n height: 24px;\n border: 2px solid ${borderColor};\n color: ${iconColor};\n background-color: ${background};\n border-radius: 100%;\n `;\n }}\n`;\n\nexport const StyledCloseIcon = styled(Close)`\n width: 15px;\n height: 15px;\n`;\n\nexport const CheckIconContainer = styled.div`\n ${({ theme, isChecked }) => {\n const background = isChecked\n ? theme.palette.extra.color.green\n : theme.palette.common.white;\n\n const iconColor = isChecked\n ? theme.palette.primary.light\n : theme.palette.extra.color.grey.main;\n\n const borderColor = isChecked\n ? background\n : theme.palette.extra.color.grey.main;\n\n return css`\n display: flex;\n align-items: center;\n justify-content: center;\n min-width: 20px;\n width: 20px;\n height: 20px;\n border: 2px solid ${borderColor};\n color: ${iconColor};\n background-color: ${background};\n border-radius: 100%;\n `;\n }}\n`;\n\nexport const StyledCheckIcon = styled(CheckIcon)`\n width: 15px;\n height: 15px;\n`;\n\nexport const BoldText = styled.span`\n font-weight: bold;\n`;\n\nexport const CardFooter = styled.footer`\n display: flex;\n flex-direction: column;\n margin: ${({ theme }) => theme.spacing(1, 1, 0, 1)};\n`;\n\nexport const CaregiverTypography = styled.div`\n color: ${({ theme }) => theme.palette.text.secondary};\n font-weight: 600;\n font-size: 15px;\n display: -webkit-box;\n -webkit-line-clamp: 2;\n -webkit-box-orient: vertical;\n overflow: hidden;\n text-overflow: ellipsis;\n\n &::before {\n content: 'por ';\n font-weight: 400;\n }\n`;\n\nexport const Row = styled.div`\n display: flex;\n align-items: center;\n gap: ${({ theme }) => theme.spacing(1)}px;\n margin: ${({ theme }) => theme.spacing(1, 1, 0, 1)};\n`;\n","import { EventSubCategoryModel, MeasurementModel } from '@cuidador/database'\nimport { Typography } from '@material-ui/core'\nimport { format } from 'date-fns'\nimport React from 'react'\nimport { getMeasurementUnit } from '../../../utils'\n\nimport {\n CardFooter,\n CaregiverTypography,\n InformationContainer,\n BoldText,\n CheckIconContainer,\n CloseIconContainer,\n Container,\n Instructions,\n MeasurementInput,\n RealTimeContainer,\n StyledBoldTitle,\n StyledCheckIcon,\n StyledCloseIcon,\n NoteTypography,\n Row,\n} from './styles'\nimport { getConditionWithDetail, getFormattedSymptoms } from '../../MesurementCard'\n\ninterface MeasurementProps {\n id: number\n name?: string\n description?: string\n status?: string\n comment?: string\n measurement?: MeasurementModel\n updatedTimeHappensAt?: string | null\n subCategory?: EventSubCategoryModel\n caregiverName?: string\n}\n\nconst Measurement = ({\n id: eventId,\n status,\n comment,\n measurement,\n description,\n updatedTimeHappensAt,\n subCategory,\n caregiverName,\n}: MeasurementProps) => {\n const measurementValue = measurement?.measurementValue\n const measurementUnit = getMeasurementUnit(subCategory?.id)\n\n console.log(measurement?.symptoms)\n\n return (\n \n {updatedTimeHappensAt && (\n \n {`Realizado às ${format(\n new Date(updatedTimeHappensAt),\n 'HH:mm',\n )}`}\n \n )}\n \n {subCategory?.name?.trim()}\n \n {description}\n \n \n {subCategory?.id && measurementUnit && {measurementUnit}}\n \n \n \n {getConditionWithDetail(measurement?.additionalDetails || '', subCategory)}\n \n {measurement?.symptoms && measurement?.symptoms?.length > 0 && (\n {getFormattedSymptoms(measurement?.symptoms)}\n )}\n {!!comment && (\n \n Obs: {comment}\n \n )}\n \n {caregiverName && (\n {caregiverName}\n )}\n {status === 'not_accomplished' && (\n \n \n \n )}\n\n {status === 'accomplished' && (\n \n \n \n )}\n \n \n \n )\n}\n\nexport default Measurement\n","import styled from 'styled-components';\nimport StyledPaper from '../../../StyledPaper';\n\nexport const CardBox = styled(StyledPaper)`\n display: flex;\n min-height: 120px;\n padding: 0;\n color: ${({ theme }) => theme.palette.extra.color.grey.main};\n background-color: ${({ theme }) => theme.palette.extra.color.grey.light};\n margin-top: 0px;\n`;\n\nexport const LeftContainer = styled.div`\n background-color: ${({ theme }) => theme.palette.extra.color.yellow};\n display: flex;\n padding: ${({ theme }) => theme.spacing(2, 0, 0, 0)};\n flex-direction: column;\n\n img {\n width: 75px;\n height: 75px;\n }\n border-radius: 4px;\n`;\n\nexport const RightContainer = styled.div`\n display: flex;\n flex-direction: column;\n flex: 1;\n min-width: 0;\n padding: ${({ theme }) => theme.spacing(1, 1, 0, 1)};\n`;\n","import { EventModel } from '@cuidador/database'\nimport Typography from '@material-ui/core/Typography'\nimport { format } from 'date-fns'\nimport React from 'react'\nimport MesurementIcon from '../../../../assets/Icon-mesurement.svg'\nimport { TimerContainer } from '../styles'\nimport Measurement from './Measurement'\n\nimport { CardBox, LeftContainer, RightContainer } from './styles'\n\ninterface CardProps {\n scheduledMeasurements: EventModel[];\n readonly?: boolean;\n}\n\nconst ScheduledMeasurementCard: React.FC = ({\n scheduledMeasurements,\n}) => {\n const { eventScheduleId, eventHappensAt } = scheduledMeasurements[0]\n\n const hour = format(new Date(`${eventHappensAt}`), 'HH:mm')\n\n return (\n \n \n \n \n {hour}\n \n \n \n {scheduledMeasurements?.map((measurement) => {\n return (\n
\n \n
\n )\n })}\n
\n
\n )\n}\n\nexport default ScheduledMeasurementCard\n","import styled from 'styled-components';\n\nexport const Container = styled.div`\n padding: ${({ theme }) => theme.spacing(0, 1)};\n margin: ${({ theme }) => theme.spacing(1, 0)};\n display: flex;\n flex-direction: column;\n flex: 1;\n`;\n\nexport const SubTitleContainer = styled.div`\n display: flex;\n flex-direction: row;\n color: ${({ theme }) => theme.palette.primary.dark};\n`;\n\nexport const IconContainer = styled.div`\n display: flex;\n align-items: center;\n margin-right: ${({ theme }) => theme.spacing(2)}px;\n`;\n\nexport const CardDiv = styled.div`\n margin-top: ${({ theme }) => theme.spacing(1)}px;\n margin-bottom: ${({ theme }) => theme.spacing(1)}px;\n`;\n","import { EventModel, EventSubCategoryModel } from '@cuidador/database'\nimport { Typography } from '@material-ui/core'\nimport RightIcon from '@material-ui/icons/ChevronRight'\nimport React from 'react'\nimport AppointmentCard from './LastShiftCards/AppointmentCard'\nimport ComplicationCard from './LastShiftCards/ComplicationCard'\nimport MedicationCard from './LastShiftCards/MedicationCard'\nimport MeasurementCard from './LastShiftCards/MesurementCard'\nimport RoutineCard from './LastShiftCards/RoutineCard'\nimport ScheduledMeasurementCard from './LastShiftCards/ScheduledMeasurementCard'\nimport { CardDiv, Container, IconContainer, SubTitleContainer } from './styles'\nimport { categoryIdMapper } from './utils'\n\nexport type ShiftEventListProps = {\n events: EventModel[];\n title: string;\n};\n\nexport type FormattedEvents = EventModel & {\n scheduledMeasurements?: EventModel[];\n};\n\nexport const RenderActivityCardByEvent = (event: FormattedEvents) => {\n const subCategory = event.subCategory as EventSubCategoryModel\n switch (subCategory.categoryId) {\n case categoryIdMapper['MEDICATION']:\n return (\n \n \n \n )\n case categoryIdMapper['COMPLICATION']:\n return (\n \n \n \n )\n case categoryIdMapper['GENERAL']:\n if (subCategory.isRoutine) {\n return (\n \n \n \n )\n } else\n return (\n \n \n \n )\n case categoryIdMapper['MEASUREMENT']:\n if (event.scheduledMeasurements) {\n const key = `schedule-\n ${event.scheduledMeasurements[0]?.eventScheduleId}-${event.scheduledMeasurements?.[0]?.id}`\n return (\n \n \n \n )\n } else {\n return (\n \n \n \n )\n }\n default:\n return <>\n }\n}\n\nconst ShiftEventList: React.FC = ({ events, title }) => {\n return (\n \n {/* Activities */}\n {events.length > 0 && (\n <>\n \n \n \n \n {title}\n \n {events.map((event) => {\n if (event.isDeleted) return\n return RenderActivityCardByEvent(event)\n })}\n \n )}\n \n )\n}\n\nexport default ShiftEventList\n","import { Event, EventSubCategoryModel } from '@cuidador/database';\nimport { subDays } from 'date-fns';\nimport { capitalize, isEqual, omit } from 'lodash';\nimport qs from 'query-string';\nimport { useCallback, useContext, useEffect, useState } from 'react';\nimport { useHistory } from 'react-router-dom';\nimport { toast } from 'react-toastify';\nimport axios from '../../config/axios';\nimport { AuthContext } from '../../contexts/auth';\nimport { resolveErrorMessage } from '../../utils/error';\nimport useMedia from '../useMedia';\n\nconst endpoint = '/report/event/history';\n\nconst categories = [\n 'medication',\n 'measurement',\n 'appointment',\n 'routine',\n 'complication',\n] as const;\n\nconst subCategories = [\n 'medicationSubCategoryIds',\n 'measurementSubCategoryIds',\n 'appointmentSubCategoryIds',\n 'routineSubCategoryIds',\n 'complicationSubCategoryIds',\n] as const;\n\nexport type CategoryType = typeof categories[number];\nexport type SubCategoryType = typeof subCategories[number];\nexport const isCategoryType = (category: string): category is CategoryType => {\n return categories.includes(category as CategoryType);\n};\n\ninterface ParamsType {\n 'updatedTimeHappensAt[min]': string;\n 'updatedTimeHappensAt[max]': string;\n orderBy: string;\n order: 'asc' | 'desc';\n timezone: string;\n status: string[];\n hasComment: boolean;\n hasUpdated: boolean;\n category: CategoryType[];\n medicationSubCategoryIds: string[];\n measurementSubCategoryIds: string[];\n complicationSubCategoryIds: string[];\n appointmentSubCategoryIds: string[];\n routineSubCategoryIds: string[];\n patientId?: string;\n}\n\nconst generateDefaultParams = (\n patientId?: ParamsType['patientId']\n): ParamsType => {\n const todayMax = new Date();\n const todayMin = subDays(todayMax, 7);\n todayMax.setHours(23, 59, 59, 999);\n todayMin.setHours(0, 0, 0, 0);\n\n return {\n 'updatedTimeHappensAt[min]': todayMin.toISOString(),\n 'updatedTimeHappensAt[max]': todayMax.toISOString(),\n orderBy: 'updatedTimeHappensAt',\n order: 'desc',\n timezone: Intl.DateTimeFormat().resolvedOptions().timeZone,\n status: [],\n hasComment: false,\n hasUpdated: false,\n category: [],\n medicationSubCategoryIds: [],\n measurementSubCategoryIds: [],\n complicationSubCategoryIds: [],\n appointmentSubCategoryIds: [],\n routineSubCategoryIds: [],\n patientId,\n };\n};\n\nconst useEventCareHistory = () => {\n const history = useHistory();\n const { getMedia } = useMedia();\n const [loading, setLoading] = useState(false);\n const [hasActiveFilters, setHasActiveFilters] = useState(false);\n const [eventHistory, setEventHistory] = useState<\n { date: string; events: Event[] }[] | undefined\n >(undefined);\n const { userInfo } = useContext(AuthContext);\n const [params, setAllParams] = useState({\n ...generateDefaultParams(),\n ...omit(\n qs.parse(history.location.search, {\n parseBooleans: true,\n arrayFormat: 'bracket',\n }),\n 'patientId'\n ),\n });\n\n const getAll = useCallback(\n async (patientId: Id) => {\n try {\n setLoading(true);\n const queryString = qs.stringify(params, {\n skipNull: true,\n skipEmptyString: true,\n arrayFormat: 'bracket',\n });\n const response = await axios.get(\n `${endpoint}/${patientId}?${queryString}`\n );\n setEventHistory(response.data);\n } catch (err) {\n const message = resolveErrorMessage(err);\n toast.error(message);\n } finally {\n setLoading(false);\n }\n },\n [params, history]\n );\n\n const createCareHistoryReport = useCallback(\n async (patientId: Id) => {\n try {\n const { data } = await axios.post(\n `${endpoint}/${patientId}${history.location.search}`\n );\n return data as { reportId?: number };\n } catch (err) {\n console.error(err);\n throw err;\n }\n },\n [params, history]\n );\n\n const getCareHistoryReportDownloadUrl = useCallback(\n async (patientId: Id, reportId: Id) => {\n try {\n const { data } = await getMedia(\n `/media/patient/${patientId}/care-history-report/${reportId}`\n );\n return data as { signedUrl: string };\n } catch (err) {\n console.error(err);\n throw err;\n }\n },\n [params, history]\n );\n\n const getEventSubCategoriesRelatedToPatientCategory = async (\n patientId: Id,\n category: CategoryType\n ) => {\n try {\n const { data } = await axios.get(\n `/care/event/category/sub/patient/${patientId}?onlyPatientRelated${capitalize(\n category\n )}=true`\n );\n return data as EventSubCategoryModel[];\n } catch (err) {\n const message = resolveErrorMessage(err);\n toast.error(message);\n }\n };\n\n const setParams = (\n paramName: keyof ParamsType,\n paramValue: string | string[] | boolean\n ) => setAllParams((state) => ({ ...state, [paramName]: paramValue }));\n\n const resetParams = useCallback(() => {\n setAllParams(generateDefaultParams(String(userInfo?.activePatientId)));\n }, [setAllParams, userInfo?.activePatientId]);\n\n useEffect(() => {\n if (userInfo?.activePatientId) {\n const urlPatientId = qs.parse(history.location.search, {\n parseBooleans: true,\n arrayFormat: 'bracket',\n })?.patientId;\n\n if (\n userInfo.activePatientId &&\n userInfo?.activePatientId !== Number(urlPatientId)\n ) {\n resetParams();\n }\n\n setParams('patientId', String(userInfo.activePatientId));\n }\n }, [userInfo?.activePatientId, resetParams]);\n\n useEffect(() => {\n const defaultParams = generateDefaultParams();\n setHasActiveFilters(\n !isEqual(omit(defaultParams, 'patientId'), omit(params, 'patientId'))\n );\n\n const newUrl = qs.stringifyUrl(\n {\n url: history.location.pathname,\n query: params,\n },\n { skipNull: true, skipEmptyString: true, arrayFormat: 'bracket' }\n );\n history.push(newUrl);\n }, [params]);\n\n return {\n loading,\n getAll,\n createCareHistoryReport,\n getCareHistoryReportDownloadUrl,\n eventHistory,\n params,\n setParams,\n resetParams,\n hasActiveFilters,\n generateDefaultParams,\n getEventSubCategoriesRelatedToPatientCategory,\n };\n};\n\nexport default useEventCareHistory;\n","import React, { createContext } from 'react';\nimport useEventCareHistory from '../hooks/useEventCareHistory';\n\ntype FilterProps = {\n useEventCareHistory: ReturnType;\n};\n\nexport const CareHistoryFilterContext = createContext(\n {} as FilterProps\n);\n\nexport const CareHistoryFilterProvider: React.FC = ({ children }) => {\n const useEventCareHistoryHook = useEventCareHistory();\n\n return (\n \n {children}\n \n );\n};\n","export default __webpack_public_path__ + \"static/media/icon-accomplished-negative.bc655e07.svg\";","export default __webpack_public_path__ + \"static/media/icon-awaiting-negative.631dd386.svg\";","export default __webpack_public_path__ + \"static/media/icon-not-accomplished-negative.73110c0d.svg\";","export default __webpack_public_path__ + \"static/media/icon-flat-accomplished-warning-white.729bdf1d.svg\";","import { Button } from '@material-ui/core';\nimport styled, { css } from 'styled-components';\n\nexport type StyledChipProps = { $active?: boolean };\n\nexport const StyledChip = styled(Button)`\n border-radius: 4px;\n height: 25px;\n padding: ${({ theme }) => theme.spacing(0.25, 0.5)};\n font-weight: ${({ theme }) => theme.typography.fontWeightRegular};\n color: ${({ theme }) => theme.palette.background.paper};\n\n ${({ $active }) =>\n !$active &&\n css`\n filter: grayscale(0.45) opacity(0.9);\n `};\n`;\n\nexport const StyledChipContent = styled.div`\n display: flex;\n flex-wrap: no-wrap;\n gap: ${({ theme }) => theme.spacing(0.5)}px;\n align-items: center;\n justify-content: center;\n`;\n\nexport const ChipIcon = styled.img`\n width: 16px;\n height: 16px;\n`;\n","import React from 'react';\nimport { ChipIcon, StyledChip, StyledChipContent } from './styles';\n\nexport interface FilterChipProps {\n icon?: string;\n label: string;\n onClick: () => void;\n active?: boolean;\n}\n\nconst FilterChip: React.FC = ({\n icon,\n label,\n active,\n ...rest\n}) => {\n return (\n \n \n {!!icon && }\n {label}\n \n \n );\n};\n\nexport default FilterChip;\n","import { Button } from '@material-ui/core';\nimport Typography from '@material-ui/core/Typography';\nimport styled, { css } from 'styled-components';\n\nexport const StyledTypography = styled(Typography)`\n color: ${({ theme }) => theme.palette.primary.dark};\n text-align: center;\n`;\n\nexport const Container = styled.div`\n width: 100%;\n position: relative;\n`;\n\nexport const FloatingButton = styled(Button)`\n position: sticky;\n z-index: 1;\n top: calc(72px + ${({ theme }) => theme.spacing(2)}px);\n`;\n\nexport const FloatingButtonContainer = styled.div`\n position: absolute;\n height: 100%;\n right: ${({ theme }) => theme.spacing(2)}px;\n top: ${({ theme }) => theme.spacing(3)}px;\n`;\n\nexport const DayHistoryContainer = styled.div`\n padding-top: ${({ theme }) => theme.spacing(3)}px;\n padding-bottom: ${({ theme }) => theme.spacing(5)}px;\n\n &:nth-child(even) {\n background-color: ${({ theme }) => theme.palette.grey[200]};\n }\n`;\n\nexport const DayHistoryHeader = styled.div`\n display: flex;\n align-items: center;\n position: relative;\n z-index: 0;\n font-size: ${({ theme }) => theme.typography.h6.fontSize};\n font-weight: ${({ theme }) => theme.typography.fontWeightBold};\n color: ${({ theme }) => theme.palette.secondary.main};\n margin-left: ${({ theme }) => theme.spacing(6)}px;\n margin-bottom: ${({ theme }) => theme.spacing(2)}px;\n`;\n\nexport const DayHistoryBody = styled.div`\n position: relative;\n z-index: 0;\n margin: ${({ theme }) => theme.spacing(0, 1.5)};\n`;\n\nexport const DateBox = styled.div`\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n width: 60px;\n height: 60px;\n background-color: ${({ theme }) => theme.palette.secondary.main};\n color: ${({ theme }) => theme.palette.common.white};\n margin-right: ${({ theme }) => theme.spacing(2)}px;\n border-radius: ${({ theme }) => theme.spacing(1)}px;\n`;\n\nexport const PureParagraph = styled.p`\n margin: 0px;\n padding: 0px;\n`;\n\nexport const TimelineVerticalStroke = styled.div`\n position: absolute;\n height: 100%;\n width: 3px;\n top: 0px;\n background-color: ${({ theme }) => theme.palette.grey.A100};\n left: calc(${({ theme }) => theme.spacing(6)}px + 30px);\n transform: translateX(-50%);\n z-index: 0;\n`;\n\nexport const EventListItem = styled.li`\n display: flex;\n align-items: center;\n column-gap: ${({ theme }) => theme.spacing(1)}px;\n margin: ${({ theme }) => theme.spacing(1.5, 0)};\n list-style: none;\n\n &:last-child {\n margin: 0px;\n }\n`;\n\nexport const EventTime = styled.div`\n display: flex;\n justify-content: center;\n font-size: ${({ theme }) => theme.typography.body1.fontSize};\n min-width: calc(${({ theme }) => theme.spacing(5.5)}px);\n width: min-content;\n`;\n\nexport const EventTitle = styled(PureParagraph)`\n font-size: ${({ theme }) => theme.typography.body1.fontSize};\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap;\n`;\n\nexport const Icon = styled.img<{ isOddDayHistory: number }>`\n border-radius: 100vw;\n user-select: none;\n\n ${({ theme, isOddDayHistory }) =>\n isOddDayHistory\n ? css`\n border: 4px solid ${theme.palette.grey[200]};\n background-color: ${theme.palette.grey[200]};\n `\n : css`\n border: 4px solid #fafafa;\n background-color: #fafafa;\n `};\n`;\n\nexport const EventCategoryIcon = styled(Icon)`\n width: 30px;\n height: 30px;\n`;\n\nexport const EventStatusIcon = styled(Icon)`\n width: 20px;\n height: 20px;\n`;\n\nexport const DayMessage = styled(EventTitle)`\n margin-left: calc(${({ theme }) => theme.spacing(8)}px + 60px);\n font-style: italic;\n`;\n\nexport const CenteredLayout = styled.div`\n display: flex;\n flex-direction: column;\n flex-grow: 1;\n justify-content: center;\n align-items: center;\n text-align: center;\n`;\n\nexport const EventCardPopUp = styled.div`\n position: fixed;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n background: rgba(0, 0, 0, 0.5);\n z-index: 99999;\n\n > div {\n margin-right: ${({ theme }) => theme.spacing(2)}px;\n margin-left: ${({ theme }) => theme.spacing(2)}px;\n position: relative;\n top: 50%;\n transform: translateY(-50%);\n }\n`;\n\nexport const ActiveFilterIndicator = styled.div`\n position: absolute;\n top: 0px;\n right: 0px;\n z-index: 2;\n transform: translate(40%, -40%);\n width: 12px;\n height: 12px;\n border-radius: 100vw;\n background-color: ${({ theme }) => theme.palette.extra.color.red.light};\n`;\n","import { Button, Drawer } from '@material-ui/core'\nimport { AccessTime, ChevronLeft } from '@material-ui/icons'\nimport MessageIcon from '@material-ui/icons/Message'\nimport { KeyboardDatePicker } from '@material-ui/pickers'\nimport styled, { css } from 'styled-components'\nimport FilterChip from '../../../../components/FilterChip'\nimport { PureParagraph } from '../styles'\n\nexport const StyledDrawer = styled(Drawer)`\n display: flex;\n\n .MuiDrawer-paper {\n max-width: 300px;\n width: 100%;\n }\n`\n\nexport const DrawerHeader = styled.div`\n background-color: ${({ theme }) => theme.palette.primary.main};\n color: ${({ theme }) => theme.palette.common.white};\n display: flex;\n align-items: center;\n justify-content: space-between;\n max-height: 72px;\n`\n\nexport const DrawerHeaderContent = styled.div`\n display: flex;\n align-items: center;\n gap: ${({ theme }) => theme.spacing(1)}px;\n padding: ${({ theme }) => theme.spacing(2)}px;\n`\n\nexport const DrawerBody = styled.div`\n padding: ${({ theme }) => theme.spacing(2, 1)};\n`\n\nexport const StyledBackIcon = styled(ChevronLeft)`\n color: ${({ theme }) => theme.palette.common.white};\n`\n\nexport const StyledFilterIcon = styled.img`\n width: 12px;\n height: 12px;\n margin-left: auto;\n`\n\nexport const HeaderTitle = styled(PureParagraph)`\n font-weight: ${({ theme }) => theme.typography.fontWeightBold};\n`\n\nexport const DrawerSection = styled.div`\n width: 100%;\n margin-bottom: ${({ theme }) => theme.spacing(2)}px;\n margin-top: ${({ theme }) => theme.spacing(2)}px;\n`\n\nexport const SectionHeader = styled(PureParagraph)`\n color: ${({ theme }) => theme.palette.secondary.main};\n font-weight: ${({ theme }) => theme.typography.fontWeightBold};\n font-size: ${({ theme }) => theme.typography.h6.fontSize};\n text-align: right;\n width: 100%;\n border: 0px;\n border-bottom: 1px;\n border-style: solid;\n border-color: ${({ theme }) => theme.palette.primary.main};\n`\n\nexport const SectionContent = styled.div`\n display: flex;\n flex-direction: column;\n align-items: end;\n gap: ${({ theme }) => theme.spacing(1)}px;\n padding: ${({ theme }) => theme.spacing(1)}px;\n`\n\nexport const StyledDatePicker = styled(KeyboardDatePicker)`\n margin: ${({ theme }) => theme.spacing(1, 0, 0)};\n`\n\nexport const StyledButton = styled.button<{ isActive?: boolean }>`\n ${({ theme, isActive }) =>\n isActive\n ? css`\n border: 1.5px solid ${theme.palette.primary.main};\n background-color: ${theme.palette.primary.main};\n color: ${theme.palette.common.white};\n `\n : css`\n border: 1.5px solid ${theme.palette.primary.main};\n color: ${theme.palette.primary.main};\n background-color: ${theme.palette.common.white};\n `}\n\n border-radius: ${({ theme }) => theme.spacing(0.75)}px;\n display: flex;\n align-items: center;\n cursor: pointer;\n padding: ${({ theme }) => theme.spacing(0.5)}px;\n width: 135px;\n`\n\nexport const CommentIcon = styled(MessageIcon)`\n height: 16px;\n width: 16px;\n margin-right: ${({ theme }) => theme.spacing(0.25)}px;\n`\n\nexport const ClockIcon = styled(AccessTime)`\n height: 16px;\n width: 16px;\n margin-right: ${({ theme }) => theme.spacing(0.25)}px;\n`\n\nexport const Row = styled.div`\n display: flex;\n gap: ${({ theme }) => theme.spacing(1)}px;\n flex-wrap: wrap;\n justify-content: end;\n`\n\nexport const AccomplishedFilter = styled(FilterChip)`\n background-color: ${({ theme }) => theme.palette.success.main};\n\n &:hover {\n background-color: ${({ theme }) => theme.palette.success.main};\n }\n`\n\nexport const NotAccomplishedFilter = styled(FilterChip)`\n background-color: ${({ theme }) => theme.palette.extra.color.red.light};\n\n &:hover {\n background-color: ${({ theme }) => theme.palette.extra.color.red.light};\n }\n`\n\nexport const AwaitingFilter = styled(FilterChip)`\n background-color: ${({ theme }) => theme.palette.grey[600]};\n\n &:hover {\n background-color: ${({ theme }) => theme.palette.grey[600]};\n }\n`\n\nexport const AlertFilter = styled(FilterChip)`\n background-color: #f6af32;\n\n &:hover {\n background-color: #f6af32;\n }\n`\n\nexport const ResetFiltersButton = styled(Button)`\n font-weight: ${({ theme }) => theme.typography.fontWeightRegular};\n`\n","import styled, { css } from 'styled-components';\nimport { Button, Checkbox, Input, Modal, Typography } from '@material-ui/core';\nimport SearchOutlined from '@material-ui/icons/SearchOutlined';\nimport { FilterChipMultiselectProps } from '.';\nimport FilterChip from '..';\nimport { StyledChipProps } from '../styles';\n\ntype MultiselectContainerProps = Pick<\n FilterChipMultiselectProps,\n 'backgroundColor' | 'variant'\n> & { active?: boolean };\n\nconst makeBackgroundColorWithHover = (color: string) => css`\n background-color: ${color};\n &:hover {\n background-color: ${color};\n }\n`;\n\nexport const Container = styled.div`\n display: flex;\n flex-direction: row-reverse;\n`;\n\nexport const CountMarker = styled.span`\n position: relative;\n width: 12px;\n height: 12px;\n margin: -4px -6px;\n display: flex;\n align-items: center;\n justify-content: center;\n background-color: ${({ theme }) => theme.palette.error.dark};\n border-radius: 100%;\n & > p {\n font-family: ${({ theme }) => theme.typography.fontFamily};\n font-size: 10px;\n color: ${({ theme }) => theme.palette.background.paper};\n margin: 0;\n }\n`;\n\nexport const FilterChipMultiselectContainer = styled.div`\n border: 0;\n border-radius: 4px;\n display: flex;\n\n ${({ active }) =>\n !active &&\n css`\n filter: grayscale(0.45);\n `};\n\n ${({ theme, backgroundColor, variant }) => {\n if (!!backgroundColor) return makeBackgroundColorWithHover(backgroundColor);\n\n switch (variant) {\n case 'blue':\n return makeBackgroundColorWithHover(theme.palette.info.main);\n case 'orange':\n return makeBackgroundColorWithHover(theme.palette.extra.color.yellow);\n case 'red':\n return makeBackgroundColorWithHover(theme.palette.extra.color.red.dark);\n case 'green':\n return makeBackgroundColorWithHover(theme.palette.success.main);\n case 'lightblue':\n return makeBackgroundColorWithHover(theme.palette.extra.color.ocean);\n default:\n return makeBackgroundColorWithHover(theme.palette.primary.dark);\n }\n }};\n`;\n\nexport const MultiSelectButton = styled(Button)`\n width: 30px;\n min-width: auto;\n height: 100%;\n padding: 0;\n outline: none;\n border: 0;\n border-radius: 4px;\n display: flex;\n align-items: center;\n justify-content: center;\n background-color: transparent;\n color: ${({ theme }) => theme.palette.background.paper};\n`;\n\nexport const StyledFilterChip = styled(FilterChip)`\n background-color: transparent;\n\n &:hover {\n background-color: transparent;\n }\n`;\n\nexport const StyledModal = styled(Modal)`\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n`;\n\nexport const MultiselectContainer = styled.div`\n max-height: 80vh;\n width: 80vw;\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n background-color: ${({ theme }) => theme.palette.background.paper};\n border-radius: 10px;\n`;\n\nconst makeBackgroundAndColor = (background: string, color: string) => css`\n background-color: ${background};\n color: ${color};\n`;\n\nexport const Header = styled.div`\n display: flex;\n width: 100%;\n border-top-left-radius: 10px;\n border-top-right-radius: 9px;\n\n ${({ theme, backgroundColor, variant }) => {\n if (!!backgroundColor)\n return makeBackgroundAndColor(\n backgroundColor,\n theme.palette.text.primary\n );\n\n switch (variant) {\n case 'blue':\n return makeBackgroundAndColor(\n theme.palette.info.main,\n theme.palette.background.paper\n );\n case 'orange':\n return makeBackgroundAndColor(\n theme.palette.extra.color.yellow,\n theme.palette.background.paper\n );\n case 'red':\n return makeBackgroundAndColor(\n theme.palette.extra.color.red.dark,\n theme.palette.background.paper\n );\n case 'green':\n return makeBackgroundAndColor(\n theme.palette.success.main,\n theme.palette.background.paper\n );\n case 'lightblue':\n return makeBackgroundAndColor(\n theme.palette.extra.color.ocean,\n theme.palette.background.paper\n );\n default:\n return makeBackgroundAndColor(\n theme.palette.primary.dark,\n theme.palette.background.paper\n );\n }\n }};\n`;\n\nexport const HeaderLeftIcon = styled.div`\n display: flex;\n width: 60px;\n justify-content: center;\n align-items: center;\n\n & > svg {\n width: 100%;\n height: 36px;\n }\n`;\n\nexport const HeaderTitle = styled.div`\n display: flex;\n width: 100%;\n margin-right: 60px;\n height: 60px;\n align-items: center;\n justify-content: center;\n gap: ${({ theme }) => theme.spacing(0.5)}px;\n`;\n\nexport const SearchInput = styled(Input)`\n border-bottom: 2px solid ${({ theme }) => theme.palette.primary.dark};\n padding: ${({ theme }) => theme.spacing(0.25)}px\n ${({ theme }) => theme.spacing(0.5)}px\n ${({ theme }) => theme.spacing(0.15)}px;\n gap: ${({ theme }) => theme.spacing(0.5)}px;\n font-size: ${({ theme }) => theme.typography.fontSize}px;\n width: 85%;\n`;\n\nexport const StyledSearchOutlined = styled(SearchOutlined)`\n color: ${({ theme }) => theme.palette.primary.dark};\n`;\n\nexport const OptionsSection = styled.div`\n display: flex;\n flex-direction: column;\n overflow-y: scroll;\n width: 85%;\n`;\n\nexport const OptionContainer = styled.div`\n display: flex;\n align-items: center;\n width: 100%;\n gap: ${({ theme }) => theme.spacing(1)}px;\n margin-bottom: ${({ theme }) => theme.spacing(1)}px;\n`;\n\nexport const StyledTypography = styled(Typography)`\n text-overflow: clip;\n overflow-x: hidden;\n`;\n\nexport const StyledCheckbox = styled(Checkbox)`\n padding: 0;\n`;\n\nexport const FooterButton = styled(Button)`\n width: 100%;\n ${({ theme }) => makeBackgroundColorWithHover(theme.palette.primary.dark)};\n color: ${({ theme }) => theme.palette.background.paper};\n border-top-right-radius: 0;\n border-top-left-radius: 0;\n`;\n","import React, { useMemo, useState } from 'react';\nimport Fuse from 'fuse.js';\nimport { Typography } from '@material-ui/core';\nimport ChevronLeft from '@material-ui/icons/ChevronLeft';\nimport {\n MultiselectContainer,\n OptionContainer,\n SearchInput,\n StyledModal,\n StyledSearchOutlined,\n StyledCheckbox,\n StyledTypography,\n OptionsSection,\n HeaderTitle,\n Header,\n HeaderLeftIcon,\n FooterButton,\n} from './styles';\nimport LoadingBackdrop from '../../LoadingBackdrop';\n\ntype MultiselectModalOptionsType = {\n id: number | string;\n label: string;\n checked: boolean;\n};\n\nexport interface MultiselectModalProps {\n isOpen: boolean;\n close: () => void;\n options: MultiselectModalOptionsType[];\n toggleOption: (id: MultiselectModalOptionsType['id']) => void;\n title: string;\n backgroundColor?: string;\n variant?: 'blue' | 'orange' | 'red' | 'green' | 'lightblue';\n icon?: string;\n onFinishOptionsSelection: () => void;\n loading: boolean;\n}\n\ninterface OptionProps extends MultiselectModalOptionsType {\n check?: (id: MultiselectModalOptionsType['id']) => void;\n}\n\nconst Option: React.FC = ({\n id,\n label,\n checked,\n check,\n testid,\n}) => {\n return (\n !!check && check(id)} data-testid={testid}>\n \n {label}\n \n );\n};\n\nexport const MultiselectModal: React.FC = ({\n isOpen,\n close,\n options,\n title,\n toggleOption,\n variant,\n backgroundColor,\n icon,\n onFinishOptionsSelection,\n loading,\n}: MultiselectModalProps) => {\n const [searchInput, setSearchInput] = useState('');\n\n const fuse = useMemo(\n () =>\n new Fuse(options, {\n keys: ['label'],\n threshold: 0.4,\n }),\n [options]\n );\n\n const searchedOptions = useMemo(() => {\n if (searchInput.length < 2) return undefined;\n\n return fuse.search(searchInput).map((searchResult) => searchResult.item);\n }, [searchInput, options]);\n\n return (\n <>\n {loading && isOpen && }\n \n \n
\n close()}>\n \n \n \n {!!icon && }\n {title}\n \n
\n
\n ) =>\n setSearchInput(e.currentTarget.value)\n }\n startAdornment={}\n data-testid=\"multiselect-search-input\"\n />\n
\n \n {(searchedOptions || options).map((option, index) => (\n toggleOption(option.id)}\n key={`multiselect-option-${index}`}\n testid={`multiselect-option-${index}`}\n />\n ))}\n \n {\n onFinishOptionsSelection();\n close();\n }}\n >\n Selecionar\n \n
\n
\n \n );\n};\n","import React, { useState } from 'react';\nimport ExpandMoreOutlinedIcon from '@material-ui/icons/ExpandMoreOutlined';\nimport { MultiselectModal, MultiselectModalProps } from './MultiselectModal';\nimport {\n CountMarker,\n FilterChipMultiselectContainer,\n MultiSelectButton,\n StyledFilterChip,\n Container,\n} from './styles';\nimport { FilterChipProps } from '..';\n\nexport interface FilterChipMultiselectProps\n extends FilterChipProps,\n Omit {\n countMarkerAmount: number | undefined;\n testid: string;\n}\n\nexport const FilterChipMultiselect: React.FC = ({\n onClick,\n options,\n toggleOption,\n title,\n backgroundColor,\n variant,\n icon,\n onFinishOptionsSelection,\n loading,\n countMarkerAmount,\n testid,\n ...props\n}) => {\n const [isModalOpen, setIsModalOpen] = useState(false);\n\n const { active } = props;\n\n const closeModal = () => setIsModalOpen(false);\n\n return (\n \n {!!countMarkerAmount && (\n \n

{countMarkerAmount}

\n
\n )}\n \n \n {!!active && (\n setIsModalOpen(true)}\n data-testid=\"multiselect-open-modal\"\n >\n \n \n )}\n \n \n
\n );\n};\n","import { EventSubCategoryModel } from '@cuidador/database';\nimport * as Yup from 'yup';\n\nexport const validationSchema = Yup.object().shape({\n 'updatedTimeHappensAt[min]': Yup.date()\n .required('Por favor, insira uma data.')\n .typeError('Por favor, insira uma data válida'),\n 'updatedTimeHappensAt[max]': Yup.date()\n .required('Por favor, insira uma data.')\n .typeError('Por favor, insira uma data válida'),\n});\n\nexport const formatMedicationSubCategoriesIntoOptions = (\n subCategories: EventSubCategoryModel[]\n) =>\n subCategories.map((item) => ({\n id: Number(item.id),\n label: String(item.medicationCatalogItem?.name ?? item.name),\n checked: false,\n }));\n\nexport const formatGenericSubCategoriesIntoOptions = (\n subCategories: EventSubCategoryModel[]\n) =>\n subCategories.map((item) => ({\n id: Number(item.id),\n label: String(item.name ?? '-'),\n checked: false,\n }));\n","import React, { useCallback, useContext, useEffect, useState } from 'react';\nimport {\n FilterChipMultiselect,\n FilterChipMultiselectProps,\n} from '../../../../components/FilterChip/FilterChipMultiselect';\nimport IconMedication from '../../../../assets/Icon-flat-medication.svg';\nimport { CareHistoryFilterContext } from '../../../../contexts/CareHistoryFilter';\nimport { AuthContext } from '../../../../contexts/auth';\nimport { formatMedicationSubCategoriesIntoOptions } from './utils';\n\ntype MedicationFilterChipMultiselectProps = Pick<\n FilterChipMultiselectProps,\n 'active' | 'onClick'\n>;\n\nexport const MedicationFilterChipMultiselect = ({\n ...props\n}: MedicationFilterChipMultiselectProps) => {\n const [medicationOptions, setMedicationOptions] = useState<\n {\n id: number;\n label: string;\n checked: boolean;\n }[]\n >([]);\n\n const [loading, setLoading] = useState(false);\n\n const { useEventCareHistory } = useContext(CareHistoryFilterContext);\n const {\n params,\n setParams,\n getEventSubCategoriesRelatedToPatientCategory,\n } = useEventCareHistory;\n\n const { userInfo } = useContext(AuthContext);\n\n const patientId = userInfo?.activePatientId as number;\n\n useEffect(() => {\n setLoading(true);\n getEventSubCategoriesRelatedToPatientCategory(patientId, 'medication')\n .then((data) => {\n if (!data) return;\n const formattedOptions = formatMedicationSubCategoriesIntoOptions(data);\n\n const { medicationSubCategoryIds } = params;\n\n setMedicationOptions(\n formattedOptions.map((medication) => ({\n ...medication,\n checked: medicationSubCategoryIds.includes(String(medication.id)),\n }))\n );\n })\n .finally(() => setLoading(false));\n }, [setMedicationOptions]);\n\n const appySelectionToQuery = useCallback(() => {\n const selectedIds = medicationOptions\n .filter((option) => !!option.checked)\n .map((option) => String(option.id));\n\n setParams('medicationSubCategoryIds', selectedIds);\n }, [medicationOptions]);\n\n /**\n * Updates the whole state but now the option which id was informed\n * has a toggled `checked` property.\n */\n const toggleOption: FilterChipMultiselectProps['toggleOption'] = (id) => {\n setMedicationOptions((medicationOptions) =>\n medicationOptions.map(({ checked, ...option }) => ({\n ...option,\n checked: option.id === id ? !checked : checked,\n }))\n );\n };\n\n return (\n \n );\n};\n","import React, { useCallback, useContext, useEffect, useState } from 'react';\nimport {\n FilterChipMultiselect,\n FilterChipMultiselectProps,\n} from '../../../../components/FilterChip/FilterChipMultiselect';\nimport IconMeasurement from '../../../../assets/Icon-flat-measurement.svg';\nimport { CareHistoryFilterContext } from '../../../../contexts/CareHistoryFilter';\nimport { AuthContext } from '../../../../contexts/auth';\nimport { formatGenericSubCategoriesIntoOptions } from './utils';\n\ntype MeasurementFilterChipMultiselectProps = Pick<\n FilterChipMultiselectProps,\n 'active' | 'onClick'\n>;\n\nexport const MeasurementFilterChipMultiselect = ({\n ...props\n}: MeasurementFilterChipMultiselectProps) => {\n const [measurementOptions, setMeasurementOptions] = useState<\n {\n id: number;\n label: string;\n checked: boolean;\n }[]\n >([]);\n\n const [loading, setLoading] = useState(false);\n\n const { useEventCareHistory } = useContext(CareHistoryFilterContext);\n const {\n params,\n setParams,\n getEventSubCategoriesRelatedToPatientCategory,\n } = useEventCareHistory;\n\n const { userInfo } = useContext(AuthContext);\n\n const patientId = userInfo?.activePatientId as number;\n\n useEffect(() => {\n setLoading(true);\n getEventSubCategoriesRelatedToPatientCategory(patientId, 'measurement')\n .then((data) => {\n if (!data) return;\n const formattedOptions = formatGenericSubCategoriesIntoOptions(data);\n\n const { measurementSubCategoryIds } = params;\n\n setMeasurementOptions(\n formattedOptions.map((measurement) => ({\n ...measurement,\n checked: measurementSubCategoryIds.includes(String(measurement.id)),\n }))\n );\n })\n .finally(() => setLoading(false));\n }, [setMeasurementOptions]);\n\n const appySelectionToQuery = useCallback(() => {\n const selectedIds = measurementOptions\n .filter((option) => !!option.checked)\n .map((option) => String(option.id));\n\n setParams('measurementSubCategoryIds', selectedIds);\n }, [measurementOptions]);\n\n /**\n * Updates the whole state but now the option which id was informed\n * has a toggled `checked` property.\n */\n const toggleOption: FilterChipMultiselectProps['toggleOption'] = (id) => {\n setMeasurementOptions((measurementOptions) =>\n measurementOptions.map(({ checked, ...option }) => ({\n ...option,\n checked: option.id === id ? !checked : checked,\n }))\n );\n };\n\n return (\n \n );\n};\n","import React, { useCallback, useContext, useEffect, useState } from 'react';\nimport {\n FilterChipMultiselect,\n FilterChipMultiselectProps,\n} from '../../../../components/FilterChip/FilterChipMultiselect';\nimport IconComplication from '../../../../assets/Icon-flat-complication.svg';\nimport { CareHistoryFilterContext } from '../../../../contexts/CareHistoryFilter';\nimport { AuthContext } from '../../../../contexts/auth';\nimport { formatGenericSubCategoriesIntoOptions } from './utils';\n\ntype ComplicationFilterChipMultiselectProps = Pick<\n FilterChipMultiselectProps,\n 'active' | 'onClick'\n>;\n\nexport const ComplicationFilterChipMultiselect = ({\n ...props\n}: ComplicationFilterChipMultiselectProps) => {\n const [complicationOptions, setComplicationOptions] = useState<\n {\n id: number;\n label: string;\n checked: boolean;\n }[]\n >([]);\n\n const [loading, setLoading] = useState(false);\n\n const { useEventCareHistory } = useContext(CareHistoryFilterContext);\n const {\n params,\n setParams,\n getEventSubCategoriesRelatedToPatientCategory,\n } = useEventCareHistory;\n\n const { userInfo } = useContext(AuthContext);\n\n const patientId = userInfo?.activePatientId as number;\n\n useEffect(() => {\n setLoading(true);\n getEventSubCategoriesRelatedToPatientCategory(patientId, 'complication')\n .then((data) => {\n if (!data) return;\n const formattedOptions = formatGenericSubCategoriesIntoOptions(data);\n\n const { complicationSubCategoryIds } = params;\n\n setComplicationOptions(\n formattedOptions.map((complication) => ({\n ...complication,\n checked: complicationSubCategoryIds.includes(\n String(complication.id)\n ),\n }))\n );\n })\n .finally(() => setLoading(false));\n }, [setComplicationOptions]);\n\n const appySelectionToQuery = useCallback(() => {\n const selectedIds = complicationOptions\n .filter((option) => !!option.checked)\n .map((option) => String(option.id));\n\n setParams('complicationSubCategoryIds', selectedIds);\n }, [complicationOptions]);\n\n /**\n * Updates the whole state but now the option which id was informed\n * has a toggled `checked` property.\n */\n const toggleOption: FilterChipMultiselectProps['toggleOption'] = (id) => {\n setComplicationOptions((measurementOptions) =>\n measurementOptions.map(({ checked, ...option }) => ({\n ...option,\n checked: option.id === id ? !checked : checked,\n }))\n );\n };\n\n return (\n \n );\n};\n","import React, { useCallback, useContext, useEffect, useState } from 'react';\nimport {\n FilterChipMultiselect,\n FilterChipMultiselectProps,\n} from '../../../../components/FilterChip/FilterChipMultiselect';\nimport IconAppointment from '../../../../assets/Icon-flat-appointment.svg';\nimport { CareHistoryFilterContext } from '../../../../contexts/CareHistoryFilter';\nimport { AuthContext } from '../../../../contexts/auth';\nimport { formatGenericSubCategoriesIntoOptions } from './utils';\n\ntype AppointmentFilterChipMultiselectProps = Pick<\n FilterChipMultiselectProps,\n 'active' | 'onClick'\n>;\n\nexport const AppointmentFilterChipMultiselect = ({\n ...props\n}: AppointmentFilterChipMultiselectProps) => {\n const [appointmentOptions, setAppointmentOptions] = useState<\n {\n id: number;\n label: string;\n checked: boolean;\n }[]\n >([]);\n\n const [loading, setLoading] = useState(false);\n\n const { useEventCareHistory } = useContext(CareHistoryFilterContext);\n const {\n params,\n setParams,\n getEventSubCategoriesRelatedToPatientCategory,\n } = useEventCareHistory;\n\n const { userInfo } = useContext(AuthContext);\n\n const patientId = userInfo?.activePatientId as number;\n\n useEffect(() => {\n setLoading(true);\n getEventSubCategoriesRelatedToPatientCategory(patientId, 'appointment')\n .then((data) => {\n if (!data) return;\n const formattedOptions = formatGenericSubCategoriesIntoOptions(data);\n\n const { appointmentSubCategoryIds } = params;\n\n setAppointmentOptions(\n formattedOptions.map((appointment) => ({\n ...appointment,\n checked: appointmentSubCategoryIds.includes(String(appointment.id)),\n }))\n );\n })\n .finally(() => setLoading(false));\n }, [setAppointmentOptions]);\n\n const appySelectionToQuery = useCallback(() => {\n const selectedIds = appointmentOptions\n .filter((option) => !!option.checked)\n .map((option) => String(option.id));\n\n setParams('appointmentSubCategoryIds', selectedIds);\n }, [appointmentOptions]);\n\n /**\n * Updates the whole state but now the option which id was informed\n * has a toggled `checked` property.\n */\n const toggleOption: FilterChipMultiselectProps['toggleOption'] = (id) => {\n setAppointmentOptions((appointmentOptions) =>\n appointmentOptions.map(({ checked, ...option }) => ({\n ...option,\n checked: option.id === id ? !checked : checked,\n }))\n );\n };\n\n return (\n \n );\n};\n","import React, { useCallback, useContext, useEffect, useState } from 'react';\nimport {\n FilterChipMultiselect,\n FilterChipMultiselectProps,\n} from '../../../../components/FilterChip/FilterChipMultiselect';\nimport IconRoutine from '../../../../assets/Icon-flat-routine.svg';\nimport { CareHistoryFilterContext } from '../../../../contexts/CareHistoryFilter';\nimport { AuthContext } from '../../../../contexts/auth';\nimport { formatGenericSubCategoriesIntoOptions } from './utils';\n\ntype RoutineFilterChipMultiselectProps = Pick<\n FilterChipMultiselectProps,\n 'active' | 'onClick'\n>;\n\nexport const RoutineFilterChipMultiselect = ({\n ...props\n}: RoutineFilterChipMultiselectProps) => {\n const [routineOptions, setRoutineOptions] = useState<\n {\n id: number;\n label: string;\n checked: boolean;\n }[]\n >([]);\n\n const [loading, setLoading] = useState(false);\n\n const { useEventCareHistory } = useContext(CareHistoryFilterContext);\n const {\n params,\n setParams,\n getEventSubCategoriesRelatedToPatientCategory,\n } = useEventCareHistory;\n\n const { userInfo } = useContext(AuthContext);\n\n const patientId = userInfo?.activePatientId as number;\n\n useEffect(() => {\n setLoading(true);\n getEventSubCategoriesRelatedToPatientCategory(patientId, 'routine')\n .then((data) => {\n if (!data) return;\n const formattedOptions = formatGenericSubCategoriesIntoOptions(data);\n\n const { routineSubCategoryIds } = params;\n\n setRoutineOptions(\n formattedOptions.map((routine) => ({\n ...routine,\n checked: routineSubCategoryIds.includes(String(routine.id)),\n }))\n );\n })\n .finally(() => setLoading(false));\n }, [setRoutineOptions]);\n\n const appySelectionToQuery = useCallback(() => {\n const selectedIds = routineOptions\n .filter((option) => !!option.checked)\n .map((option) => String(option.id));\n\n setParams('routineSubCategoryIds', selectedIds);\n }, [routineOptions]);\n\n /**\n * Updates the whole state but now the option which id was informed\n * has a toggled `checked` property.\n */\n const toggleOption: FilterChipMultiselectProps['toggleOption'] = (id) => {\n setRoutineOptions((routineOptions) =>\n routineOptions.map(({ checked, ...option }) => ({\n ...option,\n checked: option.id === id ? !checked : checked,\n }))\n );\n };\n\n return (\n \n );\n};\n","import { EventModel } from '@cuidador/database';\nimport DateFnsUtils from '@date-io/date-fns';\nimport { IconButton } from '@material-ui/core';\nimport RefreshIcon from '@material-ui/icons/Refresh';\nimport { MuiPickersUtilsProvider } from '@material-ui/pickers';\nimport { MaterialUiPickersDate } from '@material-ui/pickers/typings/date';\nimport { isValid } from 'date-fns';\nimport ptBR from 'date-fns/locale/pt-BR';\nimport { xor } from 'lodash';\nimport React, { useCallback, useContext, useEffect } from 'react';\nimport { toast } from 'react-toastify';\nimport SvgFilter from '../../../../assets/Icon-filter.svg';\nimport IconAccomplished from '../../../../assets/icon-accomplished-negative.svg';\nimport IconAwaiting from '../../../../assets/icon-awaiting-negative.svg';\nimport IconNotAccomplished from '../../../../assets/icon-not-accomplished-negative.svg';\nimport IconAlert from '../../../../assets/icon-flat-accomplished-warning-white.svg';\nimport { CareHistoryFilterContext } from '../../../../contexts/CareHistoryFilter';\nimport {\n CategoryType,\n isCategoryType,\n SubCategoryType,\n} from '../../../../hooks/useEventCareHistory';\nimport {\n AccomplishedFilter,\n AlertFilter,\n AwaitingFilter,\n ClockIcon,\n CommentIcon,\n DrawerBody,\n DrawerHeader,\n DrawerHeaderContent,\n DrawerSection,\n HeaderTitle,\n NotAccomplishedFilter,\n ResetFiltersButton,\n Row,\n SectionContent,\n SectionHeader,\n StyledBackIcon,\n StyledButton,\n StyledDatePicker,\n StyledDrawer,\n StyledFilterIcon,\n} from './styles';\nimport { MedicationFilterChipMultiselect } from './MedicationFilterChipMultiselect';\nimport { MeasurementFilterChipMultiselect } from './MeasurementFilterChipMultiselect';\nimport { ComplicationFilterChipMultiselect } from './ComplicationFilterChipMultiselect';\nimport { AppointmentFilterChipMultiselect } from './AppointmentFilterChipMultiselect';\nimport { RoutineFilterChipMultiselect } from './RoutineFilterChipMultiselect';\n\ninterface DrawerProps {\n handleToggleDrawer: () => void;\n isDrawerOpen: boolean;\n}\n\nconst FilterDrawer: React.FC = ({\n isDrawerOpen,\n handleToggleDrawer,\n}) => {\n const { useEventCareHistory } = useContext(CareHistoryFilterContext);\n const {\n params,\n setParams,\n resetParams,\n generateDefaultParams,\n } = useEventCareHistory;\n\n const onChangeDate = useCallback(\n (\n paramName: 'updatedTimeHappensAt[min]' | 'updatedTimeHappensAt[max]',\n date: MaterialUiPickersDate\n ) => {\n if (!isValid(date)) return;\n\n setParams(paramName, (date as Date).toISOString());\n },\n []\n );\n\n const handleToggleStatus = (status: EventModel['status']) => {\n if (!status) return;\n\n const toggledStatus = xor(params.status, [status]);\n\n setParams('status', toggledStatus);\n };\n\n const handleCategory = (category: CategoryType) => {\n const toggledCategory = xor(params.category, [category]);\n setParams('category', toggledCategory);\n\n if (isCategoryType(category) && !toggledCategory.includes(category))\n setParams(`${category}SubCategoryIds` as SubCategoryType, []);\n };\n\n useEffect(() => {\n const initialDate = params['updatedTimeHappensAt[min]'];\n const finalDate = params['updatedTimeHappensAt[max]'];\n if (initialDate > finalDate) {\n toast.dismiss();\n toast.error('Data de início deve ser anterior ou igual a da data de fim');\n const defaultParams = generateDefaultParams();\n setParams(\n 'updatedTimeHappensAt[max]',\n defaultParams['updatedTimeHappensAt[max]']\n );\n setParams(\n 'updatedTimeHappensAt[min]',\n defaultParams['updatedTimeHappensAt[min]']\n );\n }\n }, [\n params['updatedTimeHappensAt[min]'],\n params['updatedTimeHappensAt[max]'],\n ]);\n\n return (\n \n \n \n \n \n \n \n Filtros\n \n \n \n \n }\n size=\"small\"\n onClick={resetParams}\n >\n Limpar filtros{' '}\n \n \n \n Período\n \n \n \n onChangeDate('updatedTimeHappensAt[min]', date)\n }\n size=\"small\"\n />\n \n onChangeDate('updatedTimeHappensAt[max]', date)\n }\n size=\"small\"\n />\n \n \n \n \n Resposta\n \n \n handleToggleStatus('alert')}\n active={params.status.includes('alert')}\n icon={IconAlert}\n />\n handleToggleStatus('accomplished')}\n icon={IconAccomplished}\n active={params.status.includes('accomplished')}\n />\n handleToggleStatus('not_accomplished')}\n icon={IconNotAccomplished}\n active={params.status.includes('not_accomplished')}\n />\n handleToggleStatus('awaiting')}\n icon={IconAwaiting}\n active={params.status.includes('awaiting')}\n />\n \n \n \n \n Tipo de evento\n \n \n handleCategory('measurement')}\n active={params.category?.includes('measurement')}\n />\n handleCategory('complication')}\n active={params.category?.includes('complication')}\n />\n handleCategory('medication')}\n active={params.category?.includes('medication')}\n />\n handleCategory('appointment')}\n active={params.category?.includes('appointment')}\n />\n handleCategory('routine')}\n active={params.category?.includes('routine')}\n />\n \n \n \n \n Extras\n \n setParams('hasUpdated', !params.hasUpdated)}\n isActive={params.hasUpdated}\n >\n Horário alterado\n \n\n setParams('hasComment', !params.hasComment)}\n isActive={params.hasComment}\n >\n Tem observação\n \n \n \n \n \n );\n};\n\nexport default FilterDrawer;\n","import { Backdrop, CircularProgress, Fab } from '@material-ui/core';\nimport CloudDownloadOutlined from '@material-ui/icons/CloudDownloadOutlined';\nimport PictureAsPdfOutlined from '@material-ui/icons/PictureAsPdfOutlined';\nimport styled from 'styled-components';\n\ninterface RoundButtonProps {\n background: 'dark' | 'light' | 'green';\n}\n\nexport const RoundButton = styled(Fab)`\n position: fixed;\n padding: ${({ theme }) => theme.spacing(1.5)}px;\n bottom: ${({ theme }) => theme.spacing(10)}px;\n right: ${({ theme }) => theme.spacing(2)}px;\n color: ${({ theme }) => theme.palette.background.paper};\n border-radius: ${({ theme }) => theme.spacing(1.125)}px;\n height: ${({ theme }) => theme.spacing(5)}px;\n background-color: ${({ theme, background }) => {\n if (background === 'green') {\n return theme.palette.success.main;\n } else {\n return theme.palette.secondary.main;\n }\n }} !important;\n & > span > a {\n color: inherit;\n text-decoration: inherit;\n }\n & span {\n text-transform: none;\n }\n`;\n\nexport const LoadingCircular = styled(CircularProgress)`\n color: ${({ theme }) => theme.palette.background.paper};\n height: 17px !important;\n width: 17px !important;\n margin-right: 5px !important;\n`;\n\nexport const LoadingBackdrop = styled(Backdrop)`\n z-index: ${({ theme }) => theme.zIndex.drawer + 1};\n color: ${({ theme }) => theme.palette.primary.light};\n position: absolute;\n`;\n\nexport const CloudDownload = styled(CloudDownloadOutlined)`\n margin-right: 5px;\n width: 17px;\n height: 17px;\n`;\n\nexport const PictureAsPdf = styled(PictureAsPdfOutlined)`\n margin-right: 5px;\n width: 17px;\n height: 17px;\n`;\n","import { Patient } from '@cuidador/database';\nimport axios from 'axios';\nimport { format } from 'date-fns';\nimport React, { useCallback, useMemo, useState } from 'react';\nimport { toast } from 'react-toastify';\nimport {\n CloudDownload,\n LoadingBackdrop,\n LoadingCircular,\n PictureAsPdf,\n RoundButton,\n} from './styles';\n\ninterface ReportButtonProps {\n createReport: (patientId: Id) => Promise<{ reportId?: number }>;\n getReportDownloadUrl: (\n patientId: Id,\n reportId: Id\n ) => Promise<{ signedUrl: string }>;\n patient?: Patient;\n}\n\ntype ButtonState = 'export' | 'loading' | 'download';\n\nexport const ReportButton: React.FC = ({\n createReport,\n getReportDownloadUrl,\n patient,\n}) => {\n const [buttonState, setButtonState] = useState('export');\n const [reportId, setReportId] = useState();\n const [downloadUrl, setDownloadUrl] = useState();\n\n const filename = useMemo(\n () =>\n `Relatório de Cuidados - ${patient?.name} - ${format(\n new Date(),\n 'yyyy-MM-yy_HH:mm'\n )}`,\n [patient, buttonState]\n );\n\n const onClick = useCallback(async () => {\n if (!patient?.id) return;\n\n if (buttonState === 'export') {\n setButtonState('loading');\n try {\n const { reportId } = await createReport(patient.id);\n if (!reportId) throw new Error();\n setReportId(reportId);\n const { signedUrl } = await getReportDownloadUrl(patient.id, reportId);\n const blob = await (await fetch(signedUrl)).blob();\n setDownloadUrl(URL.createObjectURL(blob));\n setButtonState('download');\n } catch (e) {\n if (axios.isAxiosError(e) && e.response?.status === 403) {\n toast.error(\n 'Usuário sem permissão para baixar relatório. Contate um administrador.'\n );\n } else if (\n (axios.isAxiosError(e) && e.response?.status === 504) ||\n e.message === 'Network Error'\n ) {\n toast.error(\n 'Houve uma indisponibilidade no momento. Tente novamente em alguns instantes.'\n );\n } else {\n toast.error(\n 'Houve um erro ao tentar gerar o relatório, tente novamente mais tarde ou contate um administrador do sistema.'\n );\n }\n setButtonState('export');\n console.error(e);\n }\n return;\n }\n\n if (buttonState === 'download' && !!reportId) {\n setTimeout(() => {\n setButtonState('export');\n setDownloadUrl(undefined);\n }, 100)\n return;\n }\n }, [buttonState, reportId, setButtonState, setDownloadUrl]);\n\n const resolveBackground = useCallback(() => {\n if (buttonState === 'download') return 'green';\n return 'dark';\n }, [buttonState]);\n\n return (\n <>\n {buttonState === 'loading' && (\n \n )}\n \n {/* Icon */}\n {buttonState === 'export' && }\n {buttonState === 'loading' && }\n {buttonState === 'download' && !downloadUrl && }\n {buttonState === 'download' && !!downloadUrl && }\n\n {/* Text/link */}\n {buttonState === 'export' && 'Exportar'}\n {buttonState === 'download' && !!downloadUrl && (\n \n Baixar\n \n )}\n \n \n );\n};\n","import { EventModel, EventSubCategoryModel } from '@cuidador/database'\nimport { intlFormat, parseISO } from 'date-fns'\nimport { capitalize } from 'lodash'\nimport React, { useContext, useEffect, useState } from 'react'\nimport SvgFilter from '../../../assets/Icon-filter.svg'\nimport IconAccomplished from '../../../assets/Icon-flat-accomplished.svg'\nimport IconAccomplishedWarning from '../../../assets/icon-flat-accomplished-warning.svg'\nimport IconAppointment from '../../../assets/Icon-flat-appointment.svg'\nimport IconAwaiting from '../../../assets/Icon-flat-awaiting.svg'\nimport IconComplication from '../../../assets/Icon-flat-complication.svg'\nimport IconMeasurement from '../../../assets/Icon-flat-measurement.svg'\nimport IconMedication from '../../../assets/Icon-flat-medication.svg'\nimport IconNotAccomplished from '../../../assets/Icon-flat-not-accomplished.svg'\nimport IconRoutine from '../../../assets/Icon-flat-routine.svg'\nimport LoadingBackdrop from '../../../components/LoadingBackdrop'\nimport { RenderActivityCardByEvent } from '../../../components/ShiftEventList'\nimport { categoryIdMapper } from '../../../components/ShiftEventList/utils'\nimport { CareHistoryFilterContext } from '../../../contexts/CareHistoryFilter'\nimport { AuthContext } from '../../../contexts/auth'\nimport FilterDrawer from './FilterDrawer'\nimport { ReportButton } from './ReportButton'\nimport {\n ActiveFilterIndicator,\n CenteredLayout,\n Container,\n DateBox,\n DayHistoryBody,\n DayHistoryContainer,\n DayHistoryHeader,\n DayMessage,\n EventCardPopUp,\n EventCategoryIcon,\n EventListItem,\n EventStatusIcon,\n EventTime,\n EventTitle,\n FloatingButton,\n FloatingButtonContainer,\n PureParagraph,\n TimelineVerticalStroke,\n} from './styles'\n\nconst EventHistory: React.FC = () => {\n const { userInfo } = useContext(AuthContext)\n const [activePopUpEvent, setActivePopUpEvent] = useState(\n null,\n )\n const { useEventCareHistory } = useContext(CareHistoryFilterContext)\n const {\n getAll,\n params,\n eventHistory,\n loading,\n hasActiveFilters,\n createCareHistoryReport,\n getCareHistoryReportDownloadUrl,\n } = useEventCareHistory\n\n const patient = userInfo?.activePatient\n\n const patientId = userInfo?.activePatientId\n\n const [isFilterDrawerOpen, setIsFilterDrawerOpen] = useState(false)\n\n useEffect(() => {\n if (\n !patientId ||\n !params.patientId ||\n params.patientId !== String(patientId)\n )\n return\n\n getAll(patientId)\n }, [patientId, params.patientId])\n\n const resolveCategoryIcon = (event: EventModel) => {\n const subCategory = event.subCategory as EventSubCategoryModel\n switch (subCategory.categoryId) {\n case categoryIdMapper.MEDICATION:\n return IconMedication\n case categoryIdMapper.MEASUREMENT:\n return IconMeasurement\n case categoryIdMapper.COMPLICATION:\n return IconComplication\n case categoryIdMapper.GENERAL:\n return subCategory.isRoutine ? IconRoutine : IconAppointment\n }\n }\n\n const resolveStatusIcon = (event: EventModel) => {\n const subCategory = event.subCategory as EventSubCategoryModel\n switch (event.status) {\n case 'accomplished':\n if (subCategory.categoryId === categoryIdMapper.COMPLICATION || event.measurement?.isDangerousComplication) {\n return IconAccomplishedWarning\n } else {\n return IconAccomplished\n }\n case 'not_accomplished':\n return IconNotAccomplished\n default:\n return IconAwaiting\n }\n }\n\n const formatTimelineDate = (\n date: string | null | undefined,\n format: 'weekday' | 'short_month' | 'day_number' | 'time',\n ) => {\n if (!date) return 'Data inválida'\n\n const zonedDate = parseISO(date)\n\n switch (format) {\n case 'weekday':\n return capitalize(\n intlFormat(\n zonedDate,\n { weekday: 'long' },\n { locale: navigator.language },\n ),\n )\n case 'short_month':\n return capitalize(\n intlFormat(\n zonedDate,\n { month: 'short' },\n { locale: navigator.language },\n ),\n )\n case 'day_number':\n return intlFormat(\n zonedDate,\n { day: '2-digit' },\n { locale: navigator.language },\n )\n case 'time':\n return intlFormat(\n zonedDate,\n { hour: '2-digit', minute: '2-digit' },\n { locale: navigator.language },\n )\n default:\n return 'Formato inválido'\n }\n }\n\n if (!loading && (!eventHistory || eventHistory.length === 0))\n return (\n \n \n Ainda não foram registrados dados de cuidado para esse paciente\n \n \n )\n\n const toggleFilterDrawer = () => {\n if (isFilterDrawerOpen) getAll(patientId!)\n setIsFilterDrawerOpen((state) => !state)\n }\n\n return (\n <>\n {!loading ? (\n \n \n }\n onClick={toggleFilterDrawer}\n >\n Filtros\n {hasActiveFilters && }\n \n \n \n {eventHistory?.map((dayHistory, dayHistoryIndex) => (\n \n \n \n \n {formatTimelineDate(dayHistory.date, 'day_number')}\n \n \n {formatTimelineDate(dayHistory.date, 'short_month')}\n \n \n \n {formatTimelineDate(dayHistory.date, 'weekday')}\n \n \n \n {dayHistory.events && dayHistory.events.length > 0 ? (\n dayHistory.events.map((event) => (\n setActivePopUpEvent(event)}\n >\n \n {formatTimelineDate(\n event.updatedTimeHappensAt || event.eventHappensAt,\n 'time',\n )}\n \n \n \n \n {event.subCategory?.name ?? ''}\n {event.subCategory?.categoryId ===\n categoryIdMapper.MEASUREMENT &&\n event.measurement?.measurementValue &&\n ` - (${event.measurement?.measurementValue})`}\n \n \n ))\n ) : (\n Sem registros\n )}\n \n \n ))}\n {activePopUpEvent && (\n setActivePopUpEvent(null)}\n data-testid={`eventCardPopUp-${activePopUpEvent.id}`}\n >\n {RenderActivityCardByEvent(activePopUpEvent)}\n \n )}\n \n ) : (\n \n )}\n \n \n \n )\n}\n\nexport default EventHistory\n","import Card from '@material-ui/core/Card';\nimport styled from 'styled-components';\n\nexport const Container = styled.div`\n width: 100%;\n color: ${({ theme }) => theme.palette.secondary.main};\n padding: ${({ theme }) => theme.spacing(2)}px;\n box-sizing: border-box;\n`;\n\nexport const StyledCard = styled(Card).attrs({ elevation: 3 })`\n margin-bottom: ${({ theme }) => theme.spacing(1)}px;\n margin-top: ${({ theme }) => theme.spacing(1)}px;\n & .MuiCardHeader-avatar {\n color: ${({ theme }) => theme.palette.info.main};\n width: 20px;\n }\n & .MuiCardHeader-action {\n margin: 0;\n align-self: center;\n }\n`;\n","import { CardActionArea, CardHeader } from '@material-ui/core';\nimport ChevronRightRoundedIcon from '@material-ui/icons/ChevronRightRounded';\nimport CollectionsBookmarkIcon from '@material-ui/icons/CollectionsBookmark';\nimport LibraryBooksIcon from '@material-ui/icons/LibraryBooks';\nimport React, { useContext } from 'react';\nimport { useHistory } from 'react-router-dom';\nimport { AuthContext } from '../../../contexts/auth';\nimport useCanAccess from '../../../hooks/useCanAccess';\nimport { Container, StyledCard } from './styles';\n\nconst reportsUrl = '/relatorio/paciente';\nconst professionalReportsUrl = '/avaliacao-multiprofissional/paciente';\n\ntype CardProps = {\n title: string;\n subtitle?: string;\n icon: JSX.Element;\n onClick?: () => void;\n 'data-testid'?: string;\n disabled: boolean;\n};\n\nconst renderCard = (data: CardProps) => {\n if (data.disabled) return null;\n\n return (\n \n \n }\n title={data.title}\n subheader={data.subtitle}\n />\n \n \n );\n};\n\nconst Reports: React.FC = () => {\n const history = useHistory();\n const { userInfo } = useContext(AuthContext);\n const patientId = userInfo?.activePatientId;\n const { isAllowedToRead: isAllowedToReadMonthlyReports } = useCanAccess(\n 'report/patient'\n );\n const { isAllowedToRead: isAllowedToReadProfessionalReports } = useCanAccess(\n 'report/professional'\n );\n\n const menuList: CardProps[] = [\n {\n title: 'Relatórios mensais',\n subtitle: 'Relatórios mensais de acompanhamento de cuidados e saúde',\n icon: ,\n 'data-testid': 'reports',\n onClick: () => history.push(`${reportsUrl}/${patientId}`),\n disabled: !isAllowedToReadMonthlyReports,\n },\n {\n title: 'Avaliações multiprofissionais',\n subtitle: 'Avaliações feitas por profissionais de saúde',\n icon: ,\n 'data-testid': 'professional-reports',\n onClick: () => history.push(`${professionalReportsUrl}/${patientId}`),\n disabled: !isAllowedToReadProfessionalReports,\n },\n ];\n\n return (\n <>\n {menuList.map((item) => renderCard(item))}\n \n );\n};\n\nexport default Reports;\n","import { Typography } from '@material-ui/core';\nimport styled from 'styled-components';\n\nexport const CardBox = styled.div`\n background-color: white;\n border-radius: ${({ theme }) => theme.spacing(1)}px;\n color: ${({ theme }) => theme.palette.extra.color.grey.main};\n padding: ${({ theme }) => theme.spacing(1)}px;\n margin: ${({ theme }) => theme.spacing(1)}px 0;\n`;\n\nexport const AnswerLineTypography = styled(Typography)`\n line-height: 1.3;\n`;\n\nexport const MultiAnswerUl = styled.ul`\n margin: 0;\n padding-left: ${({ theme }) => theme.spacing(3)}px;\n`;\n\nexport const MultiAnswerLi = styled(AnswerLineTypography)`\n list-style-type: disc;\n display: list-item;\n`;\n","import { AnswerType, QuestionAnswerOption } from '@cuidador/database';\nimport React from 'react';\nimport { AnswerLineTypography, MultiAnswerLi, MultiAnswerUl } from './styles';\n\nexport function getAnswerContent(questionAnswerData?: string | AnswerType) {\n if (!questionAnswerData || typeof questionAnswerData === 'string')\n return null;\n\n const values: QuestionAnswerOption[] = [];\n let nav: AnswerType = questionAnswerData;\n while (nav && nav.type !== 'multi') {\n const checkedOption = nav.options.find((o) => o.isChecked)!;\n values.push(checkedOption);\n if (checkedOption.nextAnswer) {\n nav = checkedOption.nextAnswer;\n } else {\n break;\n }\n }\n\n let selectedOptions: QuestionAnswerOption[] = [];\n if (nav && nav.type === 'multi') {\n selectedOptions = nav.options.filter((o) => o.isChecked);\n }\n\n return (\n <>\n {values.map((v) => (\n <>\n \n {v.value}\n \n {v.needDescription && v.description && (\n \n Observações: {v.description}\n \n )}\n \n ))}\n \n {selectedOptions.map((option) => (\n \n {option.value}\n \n ))}\n \n \n );\n}\n","import { CareQuestionAnswer } from '@cuidador/database';\nimport { Typography } from '@material-ui/core';\nimport React from 'react';\nimport { CardBox } from './styles';\nimport { getAnswerContent } from './utils';\n\ntype CardProps = {\n careQuestionAnswer?: CareQuestionAnswer;\n};\n\nconst Card: React.FC = ({ careQuestionAnswer }) => {\n return (\n \n {careQuestionAnswer ? (\n \n {getAnswerContent(careQuestionAnswer.questionAnswerData)}\n \n ) : (\n Não respondida.\n )}\n \n );\n};\n\nexport default Card;\n","import styled from 'styled-components';\n\nexport const Container = styled.div`\n display: flex;\n flex-direction: column;\n flex: 1;\n padding: ${({ theme }) => theme.spacing(2, 2)};\n color: black;\n`;\n\nexport const SubTitleContainer = styled.div`\n display: flex;\n flex-direction: row;\n color: ${({ theme }) => theme.palette.primary.dark};\n`;\n\nexport const IconContainer = styled.div`\n display: flex;\n align-items: center;\n margin-right: ${({ theme }) => theme.spacing(2)}px;\n`;\n\nexport const StyledSection = styled.div`\n background-color: ${({ theme }) => theme.palette.extra.color.grey.light};\n margin: ${({ theme }) => theme.spacing(1, -2)};\n padding: ${({ theme }) => theme.spacing(1, 2)};\n width: 100%;\n`;\n\nexport const CardDiv = styled.div<{ color?: string }>`\n margin-top: ${({ theme }) => theme.spacing(-1)}px;\n margin-bottom: ${({ theme }) => theme.spacing(2)}px;\n background-color: ${(props) => `#${props.color}` || 'inherit'};\n padding: ${({ theme }) => theme.spacing(1, 2)};\n border-radius: ${({ theme }) => theme.spacing(1)}px;\n color: ${({ theme }) => theme.palette.extra.color.grey.light};\n`;\n\nexport const HeaderContainer = styled.div`\n display: flex;\n flex-direction: column;\n margin-bottom: ${({ theme }) => theme.spacing(2)}px;\n`;\n\nexport const Divider = styled.hr`\n width: 100%;\n margin: ${({ theme }) => theme.spacing(2)}px 0;\n`;\n","import { AnswerType, CareQuestionAnswer } from '@cuidador/database';\n\nfunction isDeeplyAnswered(questionAnswerData: AnswerType): boolean {\n switch (questionAnswerData.type) {\n case 'multi':\n const isCheckedArray = questionAnswerData.options.map(\n (option) => option.isChecked\n );\n return isCheckedArray.some((value) => value);\n case 'single':\n const checkedOption = questionAnswerData.options.find((o) => o.isChecked);\n if (!checkedOption) return false;\n if (!checkedOption.nextAnswer) return true;\n return isDeeplyAnswered(checkedOption.nextAnswer);\n default:\n return false;\n }\n}\n\nfunction countAnsweredShiftCareQuestions(\n careQuestionAnswers: CareQuestionAnswer[]\n) {\n const answeredQuestionCount = careQuestionAnswers.reduce(\n (count, currentCareQuestionAnswer) => {\n const questionAnswerData = currentCareQuestionAnswer.questionAnswerData;\n if (!questionAnswerData || typeof questionAnswerData === 'string')\n return 0;\n\n return count + (isDeeplyAnswered(questionAnswerData) ? 1 : 0);\n },\n 0\n );\n\n return answeredQuestionCount;\n}\n\nexport function getCareCategoryCardStatusMessage(\n careQuestionAnswers: CareQuestionAnswer[],\n careQuestionCount: number\n) {\n const answered = countAnsweredShiftCareQuestions(careQuestionAnswers);\n return `${answered}/${careQuestionCount} perguntas respondidas`;\n}\n","import { ShiftModel } from '@cuidador/database';\nimport { Typography } from '@material-ui/core';\nimport RightIcon from '@material-ui/icons/ChevronRight';\nimport _ from 'lodash';\nimport React from 'react';\nimport Card from './Card';\nimport {\n CardDiv,\n Container,\n StyledSection,\n HeaderContainer,\n Divider,\n SubTitleContainer,\n IconContainer,\n} from './styles';\nimport { getCareCategoryCardStatusMessage } from './utils';\n\ninterface CareCategoryListProps {\n shift: ShiftModel;\n}\n\nconst CareCategoryList: React.FC = (\n props: CareCategoryListProps\n) => {\n const questionsGroupedByCareCategory = _.groupBy(\n props.shift.shiftCareQuestions || [],\n 'careQuestion.careLine.categoryId'\n );\n return (\n \n \n \n \n \n Cuidados\n \n \n {Object.entries(questionsGroupedByCareCategory).map(\n ([careCategoryId, shiftCareQuestionList]) => {\n const currentCareCategory = shiftCareQuestionList\n .map((scq) => scq.careQuestion?.careLine?.careCategory)\n .find((cq) => String(cq?.id) === careCategoryId);\n\n const filteredCareQuestions = (\n props.shift.careQuestionAnswers || []\n ).filter((cqa) => {\n return shiftCareQuestionList\n .map((scq) => scq.careQuestionId)\n .includes(cqa.careQuestionId);\n });\n\n return (\n \n \n \n {currentCareCategory?.name}\n \n \n {getCareCategoryCardStatusMessage(\n filteredCareQuestions,\n shiftCareQuestionList.length\n )}\n \n \n\n {shiftCareQuestionList.map((questions, index) => {\n const currentCareQuestionAnswer = props.shift.careQuestionAnswers?.find(\n (cqa) => cqa.careQuestionId === questions.careQuestionId\n );\n const lastOrFirstQuestionItemIndex = shiftCareQuestionList.indexOf(\n shiftCareQuestionList[shiftCareQuestionList.length - 1]\n );\n return (\n <>\n \n {questions.careQuestion?.careLine?.name}\n \n \n {questions?.careQuestion?.careQuestionText}\n \n \n {index !== lastOrFirstQuestionItemIndex && }\n \n );\n })}\n \n );\n }\n )}\n \n \n );\n};\n\nexport default CareCategoryList;\n","import { Button } from '@material-ui/core';\nimport styled from 'styled-components';\nimport { CollapsibleCardContentProps } from '.';\n\ntype BackgroundVariant = Pick;\n\ntype Content = BackgroundVariant & {\n maxLines?: number;\n};\n\nexport const CardActionAreaCentered = styled(Button)`\n display: flex;\n justify-content: center;\n align-items: center;\n text-align: center;\n width: 100%;\n color: ${({ theme, backgroundVariant }) =>\n backgroundVariant === 'primary'\n ? theme.palette.background.paper\n : theme.palette.grey[400]};\n background-color: ${({ theme, backgroundVariant }) =>\n backgroundVariant === 'primary'\n ? theme.palette.secondary.dark\n : 'transparent'};\n border-radius: ${({ theme }) => theme.spacing(1)}px;\n height: ${({ theme }) => theme.spacing(2)}px;\n font-size: 12px;\n`;\n\nexport const CollapseCentered = styled.div`\n display: flex;\n flex-direction: column;\n justify-content: center;\n margin-bottom: ${({ theme }) => theme.spacing(1)}px;\n`;\n\nexport const Divider = styled.div`\n border-top: 1px solid\n ${({ theme, backgroundVariant }) =>\n backgroundVariant === 'primary'\n ? theme.palette.background.paper\n : theme.palette.grey[400]};\n width: 90%;\n height: 0;\n margin: ${({ theme }) => theme.spacing(2)}px 0\n ${({ theme }) => theme.spacing(1)}px 5%;\n`;\n\nexport const CardContentColorVariant = styled.div`\n color: ${({ theme, backgroundVariant }) =>\n backgroundVariant === 'primary'\n ? theme.palette.background.paper\n : theme.palette.text.primary};\n word-wrap: break-word;\n overflow: hidden;\n text-overflow: ellipsis;\n display: -webkit-box;\n -webkit-box-orient: vertical;\n ${({ maxLines }) => (!maxLines ? '' : `-webkit-line-clamp: ${maxLines};`)}\n`;\n","import React, { useCallback, useLayoutEffect, useState } from 'react';\nimport ArrowDropDownOutlinedIcon from '@material-ui/icons/ArrowDropDownOutlined';\nimport ArrowDropUpOutlinedIcon from '@material-ui/icons/ArrowDropUpOutlined';\nimport {\n CardActionAreaCentered,\n CollapseCentered,\n Divider,\n CardContentColorVariant,\n} from './styles';\nimport { useOverflowDetector } from '../../hooks/useOverflowDetector';\n\nexport interface CollapsibleCardContentProps {\n text: string;\n maxLines?: number;\n backgroundVariant?: 'clear' | 'primary';\n}\n\nexport const CollapsibleCardContent: React.FC = ({\n text,\n backgroundVariant,\n maxLines,\n}) => {\n const [isExpanded, setIsExpanded] = useState(false);\n\n const [hasPressedSeeMore, setHasPressedSeeMore] = useState(false);\n\n const toggleCollapse = useCallback(() => {\n setIsExpanded((expanded) => !expanded);\n setHasPressedSeeMore((hasPressedSeeMore) => !hasPressedSeeMore);\n }, [setIsExpanded, setHasPressedSeeMore]);\n\n const resetStateOnResize = useCallback(() => {\n setIsExpanded(false);\n setHasPressedSeeMore(false);\n }, [setIsExpanded, setHasPressedSeeMore]);\n\n useLayoutEffect(() => {\n window.addEventListener('resize', resetStateOnResize);\n return () => window.removeEventListener('resize', resetStateOnResize);\n }, []);\n\n const { overflow, ref } = useOverflowDetector();\n\n return (\n <>\n \n {text}\n \n {!overflow && !hasPressedSeeMore &&
}\n {(!!overflow || !!hasPressedSeeMore) && (\n \n \n \n {!isExpanded && (\n <>\n Ver Mais \n \n )}\n {!!isExpanded && (\n <>\n Ver Menos \n \n )}\n \n \n )}\n \n );\n};\n\nexport default CollapsibleCardContent;\n","import { useCallback, useState, useRef, useEffect } from 'react';\nimport { useResizeDetector } from 'react-resize-detector';\n\nexport function useOverflowDetector(\n onChange?: (overflow: boolean) => void\n) {\n const [overflow, setOverflow] = useState(false);\n const ref = useRef(null);\n\n const updateState = useCallback(() => {\n if (ref.current == undefined) {\n return;\n }\n\n const newState =\n ref.current.offsetWidth < ref.current.scrollWidth ||\n ref.current.offsetHeight < ref.current.scrollHeight;\n\n if (newState === overflow) {\n return;\n }\n\n setOverflow(newState);\n\n if (onChange) {\n onChange(newState);\n }\n }, [ref.current, onChange, setOverflow, overflow]);\n\n useResizeDetector({\n targetRef: ref as React.MutableRefObject,\n onResize: updateState,\n });\n\n useEffect(() => {\n updateState();\n });\n\n return { overflow, ref };\n}\n","import { Typography } from '@material-ui/core';\nimport styled from 'styled-components';\n\nexport const CardWithBackground = styled.div`\n background-color: ${({ theme }) => theme.palette.secondary.dark};\n display: flex;\n flex-direction: column;\n border-radius: ${({ theme }) => theme.spacing(2)}px;\n padding: ${({ theme }) => theme.spacing(1)}px\n ${({ theme }) => theme.spacing(2)}px 0;\n margin: ${({ theme }) => theme.spacing(0)}px\n ${({ theme }) => theme.spacing(1)}px;\n box-shadow: 0px 3px 6px #00000042;\n`;\n\nexport const TypographyWhiteText = styled(Typography)`\n color: ${({ theme }) => theme.palette.background.paper};\n word-wrap: break-word;\n overflow: hidden;\n text-overflow: ellipsis;\n display: -webkit-box;\n -webkit-line-clamp: 2; /* number of lines to show */\n -webkit-box-orient: vertical;\n`;\n","import { ExecutionMessage } from '@cuidador/database';\nimport React from 'react';\nimport { CollapsibleCardContent } from '../CollapsibleCardContent';\nimport { CardWithBackground, TypographyWhiteText } from './styles';\n\ninterface ExecutionMessageCardProps {\n executionMessage: ExecutionMessage;\n 'data-testid'?: string;\n}\n\nexport const ExecutionMessageCard: React.FC = ({\n executionMessage,\n ...props\n}) => (\n \n \n por{' '}\n \n {executionMessage.caregiver?.user?.name ?? ''}\n \n \n
\n \n
\n);\n\nexport default ExecutionMessageCard;\n","import { EventModel, EventSubCategoryModel } from '@cuidador/database';\nimport _ from 'lodash';\nimport { categoryIdMapper } from '../../utils';\n\ntype GroupedMeasurements = {\n scheduledMeasurements: EventModel[];\n subCategory: EventSubCategoryModel | undefined;\n};\n\ntype FormattedEvent = GroupedMeasurements | EventModel;\n\nexport const formatEvents = (events: EventModel[]) => {\n const measurements = events.filter(\n (event) =>\n event.subCategory?.categoryId === categoryIdMapper['MEASUREMENT'] &&\n event.eventScheduleId\n );\n const filteredEvents = events.filter(\n (event) =>\n event.subCategory?.categoryId !== categoryIdMapper['MEASUREMENT'] ||\n !event.eventScheduleId\n );\n\n const groupedMeasurements = Object.values(\n _.groupBy(measurements, 'eventHappensAt')\n );\n\n const formattedMeasurements = groupedMeasurements.map((group) => {\n return {\n scheduledMeasurements: group,\n subCategory: group[0].subCategory,\n };\n });\n\n const formattedEvents: FormattedEvent[] = filteredEvents.concat(\n formattedMeasurements\n );\n\n const formattedSortedEvents = formattedEvents.sort((event1, event2) => {\n const dateEvent1 =\n 'scheduledMeasurements' in event1\n ? event1.scheduledMeasurements[0].eventHappensAt\n : event1.eventHappensAt;\n\n const dateEvent2 =\n 'scheduledMeasurements' in event2\n ? event2.scheduledMeasurements[0].eventHappensAt\n : event2.eventHappensAt;\n\n return new Date(dateEvent1 as string) > new Date(dateEvent2 as string)\n ? 1\n : -1;\n });\n\n return formattedSortedEvents;\n};\n","import {\n Backdrop as MaterialBackdrop,\n CircularProgress as MaterialCircularProgress,\n Typography,\n} from '@material-ui/core';\nimport styled from 'styled-components';\n\nexport const Container = styled.div`\n display: flex;\n flex: 1;\n background-color: ${({ theme }) => theme.palette.common.white};\n padding: ${({ theme }) => theme.spacing(2)}px;\n flex-direction: column;\n color: ${({ theme }) => theme.palette.secondary.main};\n`;\n\nexport const SubTitleContainer = styled.div`\n display: flex;\n flex-direction: row;\n color: ${({ theme }) => theme.palette.primary.dark};\n`;\n\nexport const IconContainer = styled.div`\n display: flex;\n align-items: center;\n margin-right: ${({ theme }) => theme.spacing(2)}px;\n`;\n\nexport const Backdrop = styled(MaterialBackdrop)`\n z-index: ${({ theme }) => theme.zIndex.drawer + 1};\n color: ${({ theme }) => theme.palette.primary.light};\n position: absolute;\n`;\n\nexport const BackdropCircularProgress = styled(MaterialCircularProgress).attrs({\n color: 'inherit',\n})``;\n\nexport const TitleContainer = styled.div`\n margin-left: ${({ theme }) => theme.spacing(1)}px;\n margin-bottom: ${({ theme }) => theme.spacing(1)}px;\n text-align: left;\n padding-bottom: ${({ theme }) => theme.spacing(2)}px;\n border-bottom: 1px solid ${({ theme }) => theme.palette.primary.main};\n`;\n\nexport const StyledTypographyTitle = styled(Typography)`\n color: ${({ theme }) => theme.palette.extra.color.grey.dark};\n font-weight: bold;\n`;\n\nexport const StyledTypographyAvatar = styled(Typography)`\n color: ${({ theme }) => theme.palette.extra.color.grey.dark};\n margin-left: ${({ theme }) => theme.spacing(2)}px;\n`;\n\nexport const StyledTypographySubTitle = styled(Typography)`\n color: ${({ theme }) => theme.palette.extra.color.grey.dark};\n`;\n\nexport const TypographyWithIcon = styled(Typography)`\n color: ${({ theme }) => theme.palette.extra.color.grey.dark};\n display: flex;\n align-items: center;\n\n del {\n display: flex;\n align-items: center;\n }\n\n div {\n margin: auto ${({ theme }) => theme.spacing(0.5)}px;\n }\n\n svg {\n margin-left: ${({ theme }) => theme.spacing(0.5)}px;\n }\n`;\n\nexport const ShiftPatientContainer = styled.div`\n display: flex;\n flex: 1;\n flex-direction: row;\n align-items: center;\n margin: ${({ theme }) => theme.spacing(1, 0)};\n`;\n\nexport const StyledTypographyAdditionalCoverage = styled(Typography)`\n color: ${({ theme }) => theme.palette.extra.color.yellow};\n`;\n\nexport const ExecutionMessagesContainer = styled.div`\n margin: ${({ theme }) => theme.spacing(3, 0)};\n`;\n","import {\n Backdrop as MaterialBackdrop,\n CircularProgress as MaterialCircularProgress,\n} from '@material-ui/core';\nimport Tab from '@material-ui/core/Tab';\nimport { Link } from 'react-router-dom';\nimport styled from 'styled-components';\nimport Fab from '../../components/Fab';\n\nexport const Container = styled.div`\n display: flex;\n flex-direction: column;\n flex: 1;\n align-items: center;\n background-color: #fafafa;\n`;\n\nexport const ButtonContainer = styled.div`\n display: flex;\n flex-direction: row;\n justify-content: center;\n align-items: center;\n width: 100%;\n border-bottom: 1px solid;\n border-color: ${({ theme }) => theme.palette.primary.main};\n padding: ${({ theme }) => theme.spacing(2)}px;\n box-sizing: border-box;\n`;\n\nexport const StyledTabItem = styled(Tab)`\n width: 100px;\n color: ${({ theme }) => theme.palette.primary.main};\n font-size: 16px;\n font-weight: 400;\n border-radius: 5px 5px 0 0;\n`;\n\nexport const Backdrop = styled(MaterialBackdrop)`\n z-index: ${({ theme }) => theme.zIndex.drawer + 1};\n color: ${({ theme }) => theme.palette.primary.light};\n position: absolute;\n`;\n\nexport const BackdropCircularProgress = styled(MaterialCircularProgress).attrs({\n color: 'inherit',\n})``;\n\nexport const StyledLink = styled(Link)`\n text-decoration: none;\n width: 100%;\n display: flex;\n margin-top: ${({ theme }) => theme.spacing(2)}px;\n`;\n\nexport const StyledFab = styled(Fab)`\n bottom: ${({ theme }) => theme.spacing(8)}px;\n right: ${({ theme }) => theme.spacing(2)}px;\n`;\n\nexport const TypographyContainer = styled.div`\n width: 300px;\n text-align: center;\n color: ${({ theme }) => theme.palette.primary.main};\n margin-top: ${({ theme }) => theme.spacing(4)}px;\n`;\n","import { Button } from '@material-ui/core';\nimport Typography from '@material-ui/core/Typography';\nimport styled from 'styled-components';\n\nexport const StyledTypographyTitle = styled(Typography)`\n color: ${({ theme }) => theme.palette.extra.color.grey.dark};\n font-weight: bold;\n font-family: Work Sans;\n`;\n\nexport const StyledTypographyAdditionalCoverage = styled(Typography)`\n color: ${({ theme }) => theme.palette.extra.color.yellow};\n`;\n\nexport const Container = styled.div`\n display: flex;\n flex: 1;\n background-color: ${({ theme }) => theme.palette.common.white};\n padding: ${({ theme }) => theme.spacing(2)}px;\n flex-direction: column;\n color: ${({ theme }) => theme.palette.secondary.main};\n width: 100%;\n box-sizing: border-box;\n`;\n\nexport const CardsContainer = styled.div`\n display: flex;\n flex: 1;\n flex-direction: column;\n color: ${({ theme }) => theme.palette.secondary.main};\n`;\n\nexport const TitleContainer = styled.div`\n margin-left: ${({ theme }) => theme.spacing(1)}px;\n margin-bottom: ${({ theme }) => theme.spacing(1)}px;\n text-align: center;\n padding-bottom: ${({ theme }) => theme.spacing(2)}px;\n border-bottom: 1px solid ${({ theme }) => theme.palette.primary.main};\n`;\n\nexport const TitleHeaderContainer = styled.header`\n display: flex;\n align-items: center;\n justify-content: space-between;\n`;\n\nexport const SubTitleContainer = styled.div`\n display: flex;\n flex-direction: row;\n`;\n\nexport const IconContainer = styled.div`\n display: flex;\n align-items: center;\n margin-right: ${({ theme }) => theme.spacing(2)}px;\n`;\n\nexport const ExecutionMessageContainer = styled(TitleContainer)`\n div {\n margin-top: ${({ theme }) => theme.spacing(1.5)}px;\n }\n`;\n\nexport const StyledButton = styled(Button)` \n flex-direction: column;\n align-items: center;\n justify-content: center;\n align-self: stretch;\n text-align: center;\n flex: 1; \n font-size: 0.875rem;\n font-weight: 500;\n text-decoration: none;\n max-width: 175px;\n min-width: 175px;\n height: 40x;\n padding-right: 5px;\n background-color: ${({ theme }) => theme.palette.primary.main};\n color: ${({ theme }) => theme.palette.common.white};\n margin: ${({ theme }) => theme.spacing(0, 2)};\n :hover {\n background-color: ${({ theme }) => theme.palette.primary.main};\n color: ${({ theme }) => theme.palette.common.white};\n }\n`;\n","function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\nimport * as React from \"react\";\n\nvar _ref2 = /*#__PURE__*/React.createElement(\"g\", {\n transform: \"translate(-1.998 -1.979)\"\n}, /*#__PURE__*/React.createElement(\"path\", {\n fill: \"none\",\n stroke: \"currentColor\",\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\",\n strokeWidth: 2,\n d: \"M22.932,12.046v.917a9.966,9.966,0,1,1-5.91-9.109\",\n transform: \"translate(0 0)\"\n}), /*#__PURE__*/React.createElement(\"path\", {\n fill: \"none\",\n stroke: \"currentColor\",\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\",\n strokeWidth: 2,\n d: \"M26.456,6,16.49,15.976l-2.99-2.99\",\n transform: \"translate(-3.524 -1.01)\"\n}));\n\nfunction SvgIconCheckCircle(_ref, svgRef) {\n var title = _ref.title,\n titleId = _ref.titleId,\n props = _objectWithoutProperties(_ref, [\"title\", \"titleId\"]);\n\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n xmlns: \"http://www.w3.org/2000/svg\",\n width: 22.348,\n height: 21.959,\n viewBox: \"0 0 22.348 21.959\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, _ref2);\n}\n\nvar ForwardRef = /*#__PURE__*/React.forwardRef(SvgIconCheckCircle);\nexport default __webpack_public_path__ + \"static/media/Icon-check-circle.8e454190.svg\";\nexport { ForwardRef as ReactComponent };","import {\n EventModel,\n ExecutionMessage,\n ExecutionMessageModel,\n ShiftModel,\n} from '@cuidador/database';\nimport { Typography } from '@material-ui/core';\nimport AccessTimeIcon from '@material-ui/icons/AccessTime';\nimport RightIcon from '@material-ui/icons/ChevronRight';\nimport { sortBy } from 'lodash';\nimport React, { useContext, useEffect, useMemo, useState } from 'react';\nimport { toast } from 'react-toastify';\nimport CareCategoryList from '../../../components/CareCategoriesList';\nimport ExecutionMessageCard from '../../../components/ExecutionMessageCard';\nimport ExpelCaregiverButton from '../../../components/ExpelCaregiverButton';\nimport ExpelCaregiverDialog from '../../../components/ExpelCaregiverDialog';\nimport ShiftEventList from '../../../components/ShiftEventList';\nimport { formatEvents } from '../../../components/ShiftEventList/LastShiftCards/ScheduledMeasurementCard/utils';\nimport { separateComplicationsFromActivities } from '../../../components/ShiftEventList/utils';\nimport ShiftInProgressIndicator from '../../../components/ShiftsHistory/ShiftCard/ShiftInProgressIndicator';\nimport {\n getShiftExecutionRealTime,\n isAnnulledShiftExecution,\n isShiftExecutionWithContestation,\n} from '../../../components/ShiftsHistory/utils';\nimport { AuthContext } from '../../../contexts/auth';\nimport useCanAccess from '../../../hooks/useCanAccess';\nimport useCaregiver from '../../../hooks/useCaregiver';\nimport useShift from '../../../hooks/useShift';\nimport { resolveErrorMessage } from '../../../utils/error';\nimport { TypographyWithIcon } from '../History/Shift/styles';\nimport { Backdrop, BackdropCircularProgress } from '../styles';\nimport {\n Container,\n ExecutionMessageContainer,\n IconContainer,\n StyledTypographyAdditionalCoverage,\n StyledTypographyTitle,\n SubTitleContainer,\n TitleContainer,\n TitleHeaderContainer,\n} from './styles';\nimport { ReactComponent as IconCheck } from '../../../assets/Icon-check-circle.svg';\nimport { StyledButton } from './styles';\n\nconst Shift: React.FC = () => {\n const { userInfo } = useContext(AuthContext);\n const patientId = userInfo?.activePatientId;\n const [lastShift, setLastShift] = useState();\n const [lastShiftEvents, setLastShiftEvents] = useState([]);\n const [lastShiftMessages, setLastShiftMessages] = useState<\n ExecutionMessageModel[]\n >([]);\n const [loading, setLoading] = useState(false);\n const [isExpelDialogOpen, setIsExpelDialogOpen] = useState(false);\n const { expelCaregiver, getLastShiftByPatientId } = useShift();\n const { getById, byId } = useCaregiver();\n const isCaregiverAppAccess = userInfo?.user?.role?.caregiverAppAccess;\n\n const { isAllowedToInvoke: isAllowedToExpel } = useCanAccess(\n 'care/shift.expel'\n );\n\n const handleCareRegisterButton = () => {\n const prod = process.env.REACT_APP_ENV === 'production';\n let url = ``;\n if (!prod) {\n url = `https://qa-caregiver.cuidadordeconfianca.com.br/agenda-de-plantoes/${patientId}`; \n } else {\n url = `https://app.cuidadordeconfianca.com.br/agenda-de-plantoes/${patientId}`;\n }\n \n window.location.href = url;\n };\n\n async function loadPageData() {\n if (!patientId) return;\n try {\n setLoading(true);\n const lastShiftPatient = await getLastShiftByPatientId(patientId);\n if (lastShiftPatient) {\n setLastShift(lastShiftPatient);\n setLastShiftEvents((lastShiftPatient.events as EventModel[]) || []);\n setLastShiftMessages(\n lastShiftPatient.messages as ExecutionMessageModel[]\n );\n }\n } catch (err) {\n /**\n * If shift not found do not show toast.\n * This means that there is no previous shift\n */\n if (err?.response?.status !== 404) {\n toast.error(resolveErrorMessage(err));\n }\n } finally {\n setLoading(false);\n }\n }\n\n useEffect(() => {\n loadPageData();\n }, []);\n\n useEffect(() => {\n if (!lastShift?.executionInProgress?.caregiverId) return;\n getById(lastShift.executionInProgress.caregiverId);\n }, [lastShift]);\n\n const {\n complicationEvents,\n eventsWithoutComplications,\n } = separateComplicationsFromActivities(lastShiftEvents);\n\n const formattedEventsWithoutComplications = useMemo(\n () => formatEvents(eventsWithoutComplications) ?? [],\n [lastShiftEvents]\n );\n\n const handleExpelCaregiver = async (option: 'keep' | 'erase') => {\n setIsExpelDialogOpen(false);\n if (!lastShift) {\n toast.error('Não foi possível remover usuário do plantão.');\n return;\n }\n\n try {\n await expelCaregiver(lastShift.id!, option !== 'erase');\n toast.success('Usuário removido do plantão com sucesso');\n } catch {\n toast.error('Não foi possível remover usuário do plantão.');\n } finally {\n loadPageData();\n }\n };\n\n if (loading)\n return (\n \n {loading && (\n \n )}\n \n );\n\n return (\n <>\n \n {lastShift?.status === 'in_progress' && (\n \n \n \n {lastShift.shiftSchedule?.name ?? lastShift.name ?? ''}\n \n {lastShift?.executionInProgress?.caregiverId && isAllowedToExpel && (\n <>\n \n {Boolean(isCaregiverAppAccess) && (\n \n \n  Registrar cuidados \n \n )}\n setIsExpelDialogOpen(true)}\n data-testid={`expel-button-${lastShift.id}`}\n />\n setIsExpelDialogOpen(false)}\n onConfirm={(option: 'keep' | 'erase') => {\n handleExpelCaregiver(option);\n }}\n isLoading={false}\n caregiver={byId[lastShift.executionInProgress.caregiverId]}\n />\n \n \n )}\n \n\n <>\n {/* It's necessary to sort it in here because executions\n could be loaded by backend in any order.\n Also, the order by query string is already filled. */}\n {sortBy(\n lastShift.executions,\n (item) => item.startedAt ?? item.createdAt\n ).map((execution, index) => (\n \n {isAnnulledShiftExecution(execution) ? (\n <>\n \n {getShiftExecutionRealTime(execution)}\n \n {!!isShiftExecutionWithContestation(execution) && (\n \n )}\n
|
\n {execution.caregiver?.user?.name}\n \n ) : (\n <>\n {getShiftExecutionRealTime(execution)}\n {!!isShiftExecutionWithContestation(execution) && (\n \n )}\n
|
\n {execution.caregiver?.user?.name}\n \n )}\n \n ))}\n \n \n {!!lastShift?.isAdditionalCoverage && (\n \n *Essa é uma hora-extra / cobertura.\n \n )}\n
\n )}\n\n {lastShift?.status !== 'in_progress' && (\n \n \n Não existe nenhum plantão em progresso no momento.\n \n
\n {Boolean(isCaregiverAppAccess) && (\n \n \n  Registrar cuidados \n \n )}\n
\n )}\n\n {lastShift?.status === 'in_progress' && (\n <>\n {lastShiftEvents?.length > 0 ? (\n <>\n {!!complicationEvents && complicationEvents.length > 0 && (\n \n )}\n {!!formattedEventsWithoutComplications &&\n formattedEventsWithoutComplications.length > 0 ? (\n \n ) : (\n \n \n Nenhum evento registrado no plantão.\n \n \n )}\n \n ) : (\n \n \n Nenhum evento registrado no último plantão.\n \n \n )}\n\n {lastShift?.careQuestionAnswers ? (\n <>\n \n \n ) : (\n \n \n Nenhuma pergunta de cuidado relacionada ao último plantão.\n \n \n )}\n\n {lastShiftMessages && lastShiftMessages.length > 0 && (\n <>\n \n \n \n \n \n \n Anotações e evolução do plantão\n \n \n {lastShiftMessages.map((message, index) => (\n \n ))}\n \n \n )}\n \n )}\n
\n \n );\n};\n\nexport default Shift;\n","import React, { useContext, useState } from 'react'\nimport { Redirect, RouteComponentProps, useHistory } from 'react-router-dom'\nimport PendingRegistrationBanner from '../../components/PendingRegistrationBanner'\nimport StyledTabs from '../../components/StyledTabs'\nimport useCanAccess from '../../hooks/useCanAccess'\nimport History from './History'\nimport EventHistory from './CareHistory'\nimport Reports from './Reports'\nimport Shift from './Shift'\nimport { ButtonContainer, Container, StyledTabItem } from './styles'\nimport { CareHistoryFilterProvider } from '../../contexts/CareHistoryFilter'\nimport { AuthContext } from '../../contexts/auth'\nimport { PageTitle } from '../../components/PageTitle'\nimport { Header } from '../../components/Header'\nimport { BackButton } from '../../components/BackButton'\nimport { PscButton } from '../../components/PscButton'\nimport { MenuButton } from '../../components/MenuButton'\nimport { SideMenu } from '../../components/SideMenu'\n\nconst Follow: React.FC> = (props) => {\n const currentTab = props.match.params.tabId\n const history = useHistory()\n const [isMenuOpen, setMenuOpen] = useState(false)\n // eslint-disable-next-line @typescript-eslint/ban-types\n const handleChange = (_: React.ChangeEvent<{}>, newValue: string) => {\n props.history.push(`/acompanhar/${newValue}`)\n }\n const { isAllowedToRead: isAllowedToReadShift } = useCanAccess('care/shift')\n const { isAllowedToRead: isAllowedToReadShiftTab } = useCanAccess('care/shift/event')\n const {\n isAllowedToRead: isAllowedToReadReport,\n isAllowedToCreate: isAllowedToCreateReport,\n } = useCanAccess('report/shift')\n\n const { isAllowedToRead: isAllowedToReadEvolutionTab } = useCanAccess('care/shift/event')\n\n const { isAllowedToRead: isAllowedToReadPatientReport } = useCanAccess('report/patient')\n const { isAllowedToRead: isAllowedToReadProfessionalReport } = useCanAccess('report/professional')\n\n const isHistoricTabDisabled = !isAllowedToReadShift && !isAllowedToReadReport && !isAllowedToCreateReport\n\n const isReportTabDisabled = !isAllowedToReadPatientReport && !isAllowedToReadProfessionalReport\n\n const tabOptions = [\n { key: 'plantao', label: 'Plantão', disabled: !isAllowedToReadShiftTab },\n { key: 'historico', label: 'Histórico', disabled: isHistoricTabDisabled },\n { key: 'evolucao', label: 'Evolução', disabled: !isAllowedToReadEvolutionTab },\n { key: 'relatorios', label: 'Relatórios', disabled: isReportTabDisabled },\n ]\n\n if (!currentTab) {\n const firstTab = tabOptions.find((tab) => !tab.disabled)\n return \n }\n\n const { userInfo } = useContext(AuthContext)\n\n const { name = '', id: patientId } = userInfo?.activePatient || {}\n\n return (\n <>\n setMenuOpen(false)}\n />\n setMenuOpen(true)} />}\n centerContent={}\n rightContent={}\n />\n \n \n \n \n {tabOptions.map(\n ({ key, label, disabled }) => disabled\n ? null\n : (\n ),\n )}\n \n \n {currentTab === 'plantao' && }\n {currentTab === 'historico' && }\n {currentTab === 'relatorios' && }\n\n {currentTab === 'evolucao' && (\n \n \n \n )}\n \n \n )\n}\n\nexport default Follow\n","import styled from 'styled-components';\n\nexport const Container = styled.div`\n position: fixed;\n bottom: 0;\n display: flex;\n justify-content: center;\n\n width: 100%;\n height: 73px;\n\n background-color: ${({ theme }) => theme.palette.primary.main};\n border-radius: 21px 21px 0 0;\n`;\n\nexport const PreviousButton = styled.button`\n border: 1px solid #ffffff;\n border-radius: 5px;\n background-color: ${({ theme }) => theme.palette.primary.main};\n color: #ffffff;\n height: 2.5rem;\n font-size: 12px;\n font-weight: bold;\n\n display: flex;\n align-items: center;\n\n svg {\n width: 2rem;\n }\n\n transition: 0.3s;\n\n &:hover {\n color: ${({ theme }) => theme.palette.primary.main};\n background-color: #ffffff;\n }\n\n &:disabled {\n cursor: not-allowed;\n opacity: 0.5;\n background-color: ${({ theme }) => theme.palette.primary.main};\n color: #ffffff;\n }\n`;\n\nexport const ButtonContainer = styled.div`\n display: flex;\n justify-content: center;\n align-items: center;\n`;\n\nexport const ShiftDataContainer = styled.div`\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n color: #ffffff;\n font-size: 18px;\n font-weight: bold;\n line-height: 1.2rem;\n padding: 0 0.5rem;\n width: 10rem;\n text-align: center;\n\n /* Medium screen */\n @media only screen and (min-width: 768px) {\n width: 30rem;\n }\n`;\n","import React, { useMemo } from 'react';\nimport { ChevronLeft, ChevronRight } from '@material-ui/icons';\nimport {\n ButtonContainer,\n Container,\n PreviousButton,\n ShiftDataContainer,\n} from './styles';\nimport { format } from 'date-fns';\nimport { useHistory, useParams } from 'react-router-dom';\n\ninterface PreviousOrNextShiftProps {\n plannedToStartAt?: string;\n shiftIds: number[];\n}\n\nconst PreviousOrNextShift: React.FC = ({\n plannedToStartAt,\n shiftIds,\n}) => {\n const params = useParams<{ id: string }>();\n const currentShiftId = parseInt(params.id);\n const history = useHistory();\n const getShiftPlannedStartDate = () => {\n const shiftPlannedStartDate = plannedToStartAt\n ? format(new Date(plannedToStartAt), 'dd/MM/yyyy')\n : '--/--/----';\n return shiftPlannedStartDate;\n };\n\n const goToPreviousShift = () => {\n const previousShiftId = shiftIds[shiftIds.indexOf(currentShiftId) + 1];\n history.push(`/historico/plantao/${previousShiftId}`);\n };\n\n const goToNextShift = () => {\n const nextShiftId = shiftIds[shiftIds.indexOf(currentShiftId) - 1];\n history.push(`/historico/plantao/${nextShiftId}`);\n };\n\n const isPreviousShiftButtonDisabled = useMemo(() => {\n const previousShiftId = shiftIds[shiftIds.indexOf(currentShiftId) + 1];\n if (!previousShiftId) {\n return true;\n }\n return false;\n }, [shiftIds, currentShiftId]);\n\n const isNextShiftButtonDisabled = useMemo(() => {\n const nextShiftId = shiftIds[shiftIds.indexOf(currentShiftId) - 1];\n if (!nextShiftId) {\n return true;\n }\n return false;\n }, [shiftIds, currentShiftId]);\n\n return (\n \n \n \n \n \n \n\n \n {getShiftPlannedStartDate()}\n \n\n \n \n \n \n \n \n );\n};\n\nexport default PreviousOrNextShift;\n","import { ExecutionMessage, ShiftModel } from '@cuidador/database';\nimport { Avatar, IconButton, Typography } from '@material-ui/core';\nimport AccessTimeIcon from '@material-ui/icons/AccessTime';\nimport RightIcon from '@material-ui/icons/ChevronRight';\nimport { format } from 'date-fns';\nimport { ptBR } from 'date-fns/locale';\nimport { sortBy } from 'lodash';\nimport React, { useContext, useEffect, useMemo, useState } from 'react';\nimport { useHistory, useParams } from 'react-router-dom';\nimport { toast } from 'react-toastify';\nimport CareCategoryList from '../../../../components/CareCategoriesList';\nimport ExecutionMessageCard from '../../../../components/ExecutionMessageCard';\nimport LoadingBackdrop from '../../../../components/LoadingBackdrop';\nimport ShiftEventList from '../../../../components/ShiftEventList';\nimport { formatEvents } from '../../../../components/ShiftEventList/LastShiftCards/ScheduledMeasurementCard/utils';\nimport { separateComplicationsFromActivities } from '../../../../components/ShiftEventList/utils';\nimport {\n getShiftExecutionRealTime,\n isAnnulledShiftExecution,\n isShiftExecutionWithContestation,\n} from '../../../../components/ShiftsHistory/utils';\nimport { AuthContext } from '../../../../contexts/auth';\nimport usePatient from '../../../../hooks/usePatient';\nimport useShift from '../../../../hooks/useShift';\nimport PreviousOrNextShift from './PreviousOrNextShift';\nimport {\n Container,\n ExecutionMessagesContainer,\n IconContainer,\n ShiftPatientContainer,\n StyledTypographyAdditionalCoverage,\n StyledTypographyAvatar,\n StyledTypographyTitle,\n SubTitleContainer,\n TitleContainer,\n TypographyWithIcon,\n} from './styles';\nimport { Header } from '../../../../components/Header'\nimport { PageTitle } from '../../../../components/PageTitle'\nimport { BackButton } from '../../../../components/BackButton'\nimport { PscButton } from '../../../../components/PscButton'\n\nconst FollowShift: React.FC = () => {\n const [patientPictureURL, setPatientPictureURL] = useState('');\n const [shiftIds, setShiftIds] = useState([]);\n const [shift, setShift] = useState();\n const { getById, getByPatientIdPaginated, loading } = useShift();\n const { userInfo } = useContext(AuthContext);\n const history = useHistory();\n const { getProfilePicture } = usePatient();\n\n const params = useParams<{ id: string }>();\n const id = parseInt(params.id);\n\n useEffect(() => {\n if (id && userInfo?.activePatientId) {\n if (shiftIds.length === 0)\n fetchShiftList(userInfo.activePatientId)\n .then(() => getById(id))\n .then((shift) => setShift(shift as ShiftModel));\n else getById(id).then((shift) => setShift(shift as ShiftModel));\n }\n }, [id, userInfo?.activePatientId]);\n\n useEffect(() => {\n if (shift) {\n handleGetProfilePictureURL(Number(shift?.patient?.id)).then((url) => {\n if (!url) return;\n setPatientPictureURL(url);\n });\n }\n }, [shift]);\n\n const handleGetProfilePictureURL = async (id: number) => {\n try {\n return await getProfilePicture(id).then(\n ({ data: { signedUrl } }) => signedUrl\n );\n } catch (err) {\n // ignore patient without profile picture error\n if (!String(err).includes('404')) toast.error(err);\n }\n };\n\n const fetchShiftList = async (patientId: number) => {\n getByPatientIdPaginated(patientId, {\n page: 0,\n limit: 100,\n orderBy: 'plannedToStartAt',\n order: 'DESC',\n }).then((response) => {\n const shifts = response.data.results;\n const startedShifts = shifts.filter((shift) => shift.startedAt);\n const shiftIds = startedShifts.map((shift) => shift.id);\n setShiftIds(shiftIds);\n });\n };\n\n const sortedExecutions = useMemo(() => {\n if (!shift) return [];\n\n return sortBy(shift.executions, (item) => item.startedAt ?? item.createdAt);\n }, [shift?.executions]);\n\n const executionMessages = useMemo(\n () =>\n sortedExecutions\n .map((execution) => execution.message)\n .filter(Boolean) as ExecutionMessage[],\n [sortedExecutions]\n );\n\n const {\n complicationEvents,\n eventsWithoutComplications,\n } = separateComplicationsFromActivities(shift?.events);\n\n const formattedEventsWithoutComplications = useMemo(\n () => formatEvents(eventsWithoutComplications),\n [shift?.events]\n );\n\n if (loading) {\n return ;\n }\n\n if (!shift) {\n return null;\n }\n\n return (\n <>\n history.push('/acompanhar/historico')}\n />\n }\n centerContent={\n \n }\n rightContent={}\n />\n \n \n \n {format(new Date(shift.plannedToStartAt || ''), 'dd/MM/yyyy')}\n {' - '}\n {format(new Date(shift.plannedToStartAt || ''), 'EEEE', {\n locale: ptBR,\n })}\n \n \n {shift.name || shift?.shiftSchedule?.name}\n \n \n \n \n {shift.patient?.name}\n \n \n <>\n {/* It's necessary to sort it in here because executions\n could be loaded by backend in any order.\n Also, the order by query string is already filled. */}\n {sortedExecutions.map((execution, index) => (\n \n {isAnnulledShiftExecution(execution) ? (\n <>\n \n {getShiftExecutionRealTime(execution)}\n \n {!!isShiftExecutionWithContestation(execution) && (\n \n )}\n
|
\n {execution.caregiver?.user?.name}\n \n ) : (\n <>\n {getShiftExecutionRealTime(execution)}\n {!!isShiftExecutionWithContestation(execution) && (\n \n )}\n
|
\n {execution.caregiver?.user?.name}\n \n )}\n \n ))}\n \n {!!shift.isAdditionalCoverage && (\n \n *Essa é uma hora-extra / cobertura.\n \n )}\n
\n\n {!!complicationEvents && complicationEvents.length > 0 && (\n \n )}\n\n {executionMessages && executionMessages.length > 0 && (\n \n \n \n \n \n \n Anotações e evolução do plantão\n \n \n {executionMessages.map((message, index) => (\n <>\n {index !== 0 &&

}\n \n \n ))}\n \n )}\n\n {!!formattedEventsWithoutComplications &&\n formattedEventsWithoutComplications.length > 0 ? (\n \n ) : (\n \n \n Nenhum evento registrado no plantão.\n \n \n )}\n\n {shift.careQuestionAnswers && shift.careQuestionAnswers.length > 0 ? (\n \n ) : (\n \n \n Nenhuma pergunta de cuidado relacionada ao plantão.\n \n \n )}\n \n \n \n );\n};\n\nexport default FollowShift;\n","import * as yup from 'yup';\n\nexport const validationSchema = yup.object().shape({\n email: yup\n .string()\n .email('Insira um e-mail válido')\n .transform((value, originalValue) => originalValue.trim())\n .required('E-mail é obrigatório'),\n});\n\nexport const formInitialValues = {\n email: '',\n};\n\nexport interface FormValues {\n email: string;\n}\n","import { clientSideScheme } from '@cuidador/whitelabel';\nimport styled from 'styled-components';\nimport BackgroundImage from '../../assets/loginBackground.png';\n\nexport const Background = styled.div`\n height: 100vh;\n background-color: ${({ theme }) => theme.palette.secondary.dark};\n background-image: ${`url(${BackgroundImage})`};\n background-size: cover;\n background-position: center;\n padding: 0px ${({ theme }) => theme.spacing(2)}px;\n display: flex;\n justify-content: center;\n align-items: center;\n`;\n\nexport const OutterContainer = styled.div`\n height: 100vh;\n width: 100%;\n display: flex;\n justify-content: center;\n align-items: center;\n`;\n\nexport const Container = styled.div`\n display: flex;\n flex-direction: column;\n align-items: center;\n height: 80%;\n max-width: 500px;\n color: white;\n padding: 0px ${({ theme }) => theme.spacing(2)}px;\n\n img {\n width: 100%;\n margin-bottom: ${({ theme }) => theme.spacing(6)}px;\n }\n\n form {\n display: flex;\n flex-direction: column;\n width: 100%;\n height: 100%;\n\n .MuiButton-root {\n margin-top: ${({ theme }) => theme.spacing(4)}px;\n }\n }\n\n a {\n font-size: ${({ theme }) => theme.spacing(2)}px;\n color: white;\n margin-bottom: ${({ theme }) => theme.spacing(6)}px;\n }\n`;\n\nexport const TypographyContainer = styled.div`\n max-width: 100%;\n text-align: center;\n margin-bottom: ${({ theme }) => theme.spacing(3)}px;\n`;\n\nexport const TitleTypography = styled.div`\n margin-bottom: ${({ theme }) => theme.spacing(3)}px;\n`;\n\nexport const Logo = styled.img.attrs(() => {\n const { logoLightUrl } = clientSideScheme();\n return { src: logoLightUrl };\n})`\n margin: ${({ theme }) => theme.spacing(0, 2, 0)};\n`;\n\nexport const ButtonContainer = styled.div`\n display: flex;\n justify-content: center;\n flex: 1;\n align-items: flex-end;\n`;\n\nexport const BackButton = styled.div`\n margin-right: ${({ theme }) => theme.spacing(2)}px;\n`;\n","import React, { useRef } from 'react';\nimport { useHistory } from 'react-router-dom';\nimport Typography from '@material-ui/core/Typography';\nimport { Formik, Form, FormikHelpers, FormikProps } from 'formik';\n\nimport StyledTextField from '../../components/StyledTextField';\n\nimport Button from '../../components/StyledButton';\nimport { sendPasswordResetEmail } from '../../contexts/auth';\nimport { toast } from 'react-toastify';\nimport { AxiosError } from 'axios';\nimport { APIError } from '@cuidador/lib';\nimport { resolveErrorMessage } from '../../utils/error';\n\nimport { validationSchema, formInitialValues, FormValues } from './utils';\n\nimport {\n Container,\n TypographyContainer,\n Background,\n OutterContainer,\n Logo,\n TitleTypography,\n ButtonContainer,\n BackButton,\n} from './styles';\n\nconst ForgotPassword: React.FC = () => {\n const formikRef = useRef | null>();\n const history = useHistory();\n\n const handleSubmit = (\n values: FormValues,\n { setSubmitting }: FormikHelpers\n ) => {\n setSubmitting(true);\n sendPasswordResetEmail(values.email)\n .then(() => {\n toast.info('E-mail de redefinição de senha enviado.');\n history.goBack();\n })\n .catch((err: AxiosError) => {\n if (err.response?.data.message === 'User not found.') {\n toast.error('E-mail não cadastrado');\n formikRef.current?.setFieldError('email', 'E-mail não cadastrado');\n } else {\n const displayMessage = resolveErrorMessage(err);\n toast.error(displayMessage);\n }\n })\n .finally(() => setSubmitting(false));\n };\n\n return (\n \n \n \n \n \n \n Recuperar senha\n \n \n Informe seu e-mail para que as instruções de recuperar a senha\n sejam enviadas\n \n \n (formikRef.current = ref)}\n initialValues={formInitialValues}\n validationSchema={validationSchema}\n onSubmit={handleSubmit}\n >\n {(formik) => (\n

\n \n \n \n history.goBack()}\n disabled={formik.isSubmitting}\n >\n Voltar\n \n \n \n Enviar\n \n \n \n )}\n \n
\n \n \n );\n};\n\nexport default ForgotPassword;\n","import { CardDataType, PlanModel } from '@cuidador/database';\nimport { CompanyDataType } from '@cuidador/database/src/types';\nimport { useCallback, useReducer } from 'react';\nimport axios from '../config/axios';\nimport { createReducer, Item, ReducerData } from '../utils/store/index';\n\nconst ENDPOINT = '/user/plan';\n\ntype PromotionalCode = {\n promotionalCode: string;\n};\n\nconst initialData: ReducerData = {\n byId: {} as Record>,\n ids: [] as Array,\n total: 0,\n loading: false,\n error: null,\n};\n\nconst usePlan = () => {\n const [state, dispatch] = useReducer(createReducer(), initialData);\n\n const getAvailablePlans = useCallback(async () => {\n try {\n dispatch({ type: 'LOADING' });\n const response = await axios.get[]>(\n `${ENDPOINT}/available`\n );\n dispatch({ type: 'GET_ALL', payload: response.data });\n return response.data;\n } catch (error) {\n if (error instanceof Error) {\n dispatch({ type: 'ERROR', payload: error });\n }\n throw error;\n }\n }, []);\n\n const getById = useCallback(async (id: Id) => {\n try {\n dispatch({ type: 'LOADING' });\n const response = await axios.get>(`${ENDPOINT}/${id}`);\n dispatch({ type: 'GET_BY_ID', payload: response.data });\n return response.data;\n } catch (error) {\n if (error instanceof Error) dispatch({ type: 'ERROR', payload: error });\n throw error;\n }\n }, []);\n\n const signAvailablePlan = useCallback(\n async (planId: string, body: CardDataType) => {\n try {\n dispatch({ type: 'LOADING' });\n const response = await axios.post(`${ENDPOINT}/${planId}/paid`, body);\n dispatch({ type: 'CREATE', payload: response.data });\n return response;\n } catch (error) {\n if (error instanceof Error) dispatch({ type: 'ERROR', payload: error });\n throw error;\n }\n },\n []\n );\n\n const signCompanyPlan = useCallback(\n async (planId: string, body: CompanyDataType) => {\n try {\n dispatch({ type: 'LOADING' });\n const response = await axios.post(\n `${ENDPOINT}/${planId}/company`,\n body\n );\n dispatch({ type: 'CREATE', payload: response.data });\n return response;\n } catch (error) {\n if (error instanceof Error) dispatch({ type: 'ERROR', payload: error });\n throw error;\n }\n },\n []\n );\n\n const signPromotionalPlan = useCallback(\n async (planId: Id, body?: PromotionalCode) => {\n try {\n dispatch({ type: 'LOADING' });\n const response = await axios.post>(\n `${ENDPOINT}/${planId}/promotional`,\n body\n );\n dispatch({ type: 'CREATE', payload: response.data });\n return response;\n } catch (err) {\n if (err instanceof Error) {\n dispatch({ type: 'ERROR', payload: err });\n }\n return Promise.reject(err);\n }\n },\n []\n );\n\n return {\n ...state,\n getAvailablePlans,\n getById,\n signAvailablePlan,\n signPromotionalPlan,\n signCompanyPlan,\n };\n};\n\nexport default usePlan;\n","import { clientSideScheme } from '@cuidador/whitelabel';\nimport { FormControlLabel, Typography } from '@material-ui/core';\nimport styled from 'styled-components';\n\nexport const Background = styled.div`\n background-color: ${({ theme }) => theme.palette.common.white};\n background-size: cover;\n background-position: center;\n padding: ${({ theme }) => theme.spacing(2)}px;\n display: flex;\n flex: 1;\n flex-direction: column;\n button {\n align-self: center;\n }\n`;\n\nexport const Logo = styled.img.attrs(() => {\n const { logoLightUrl } = clientSideScheme();\n return { src: logoLightUrl };\n})`\n width: 100%;\n max-width: 500px;\n max-height: 45px;\n margin-top: ${({ theme }) => theme.spacing(0.5)}px;\n`;\n\nexport const LogoContainer = styled.div`\n display: flex;\n align-items: center;\n justify-content: center;\n width: 100%;\n`;\n\nexport const Title = styled(Typography).attrs({\n align: 'center',\n})`\n margin: ${({ theme }) => theme.spacing(2, 0, 0, 0)}px;\n`;\n\nexport const TitleBold = styled(Typography).attrs({\n variant: 'h6',\n align: 'center',\n})`\n text-decoration: underline;\n cursor: pointer;\n`;\n\nexport const VisibilityContainer = styled.div<{ $active?: boolean }>`\n display: ${({ $active }) => ($active ? 'inherit' : 'none')};\n flex-direction: inherit;\n flex: inherit;\n form {\n flex: 1;\n display: ${({ $active }) => ($active ? 'inherit' : 'none')};\n flex-direction: inherit;\n flex: inherit;\n }\n`;\n\nexport const StyledFormControlLabel = styled(FormControlLabel)`\n color: ${({ theme }) => theme.palette.secondary.main};\n & a,\n & .MuiIconButton-root {\n color: ${({ theme }) => theme.palette.secondary.main};\n }\n`;\n\nexport const PasswordInstructions = styled(Typography).attrs({\n variant: 'caption',\n})`\n margin: ${({ theme }) => theme.spacing(1)}px;\n`;\n\nexport const Line = styled.div`\n align-self: center;\n width: 90%;\n height: 0px;\n border-bottom: 1px solid black;\n margin: ${({ theme }) => theme.spacing(5, 0)};\n`;\n\nexport const TermsContainer = styled.div`\n margin: ${({ theme }) => theme.spacing(0, 5, 5, 5)};\n`;\n\nexport const ButtonContainer = styled.div`\n text-align: center;\n button {\n margin: ${({ theme }) => theme.spacing(0, 1)};\n }\n`;\n\nexport const FooterContainer = styled.div`\n flex: 1;\n display: flex;\n flex-direction: column;\n justify-content: flex-end;\n`;\n\nexport const SuccessContainer = styled.div`\n flex: 1;\n display: flex;\n flex-direction: column;\n justify-content: center;\n`;\n\nexport const ContentContainer = styled.div`\n margin-top: ${({ theme }) => theme.spacing(3)}px;\n width: 100%;\n display: flex;\n align-items: center;\n flex-direction: column;\n`;\n","import { GuardianModel } from '@cuidador/database';\nimport * as yup from 'yup';\nimport {\n numberMask,\n validateCpf,\n validatePasswordStrength,\n} from '../../utils/inputs';\n\nexport type FormValues = {\n name: string;\n cpf: string;\n phoneNumber: string;\n email: string;\n howMetUs: string;\n relationToPatient: string;\n password: string;\n passwordConfirmation: string;\n termsAccepted: boolean;\n};\n\nexport const validationSchema = yup.object().shape({\n name: yup\n .string()\n .required('Por favor, insira o nome completo')\n .min(3, 'O nome deve conter ao menos 3 caracteres')\n .test(\n 'isFullName',\n 'Por favor, insira o nome completo',\n (value) => (value || '').split(' ').length > 1\n ),\n cpf: yup\n .string()\n .required('Por favor, insira o CPF')\n .test('isCpfValid', 'Por favor, insira um CPF válido', (value) =>\n validateCpf(value || '')\n ),\n phoneNumber: yup\n .string()\n .required('Por favor, insira um telefone')\n .min(14, 'Por favor, insira um telefone válido')\n .max(15, 'Por favor, insira um telefone válido'),\n email: yup\n .string()\n .required('Por favor, insira um email')\n .email('Por favor, insira um e-mail válido'),\n howMetUs: yup.string(),\n relationToPatient: yup.string(),\n password: yup\n .string()\n .required('Por favor, insira a senha')\n .test(\n 'isValidPassword',\n 'Por favor, insira uma senha que atenda aos critérios listados abaixo',\n (value) => validatePasswordStrength(value || '')\n ),\n passwordConfirmation: yup\n .string()\n .required('Por favor, insira a confirmação da senha')\n .oneOf([yup.ref('password'), ''], 'As senhas devem ser iguais'),\n termsAccepted: yup\n .boolean()\n .equals(\n [true],\n 'Por favor, leia e aceite nossos termos e políticas de privacidade'\n ),\n});\n\nexport const initialValues = {\n name: '',\n cpf: '',\n phoneNumber: '',\n email: '',\n howMetUs: '',\n relationToPatient: '',\n password: '',\n passwordConfirmation: '',\n termsAccepted: false,\n};\n\nexport const howMetUsOptions = [\n { value: 'friends', label: 'Indicação de amigos' },\n { value: 'whatsapp', label: 'Whatsapp' },\n { value: 'instagram', label: 'Instagram' },\n { value: 'facebook', label: 'Facebook' },\n { value: 'nestle', label: 'Parceria Nestlé' },\n { value: 'torrent', label: 'Parceria Torrent' },\n { value: 'professionalIndication', label: 'Indicação Profissional' },\n { value: 'google', label: 'Google' },\n { value: 'others', label: 'Outros' },\n];\n\nexport const relationToPatientOptions = [\n { value: 'son', label: 'Filho(a)' },\n { value: 'grandson', label: 'Neto(a)' },\n { value: 'sibling', label: 'Irmão(ã)' },\n { value: 'spouse', label: 'Cônjuge (Marido/Esposa)' },\n { value: 'friend', label: 'Amigo(a)' },\n { value: 'care-manager', label: 'Gestor de Cuidados' },\n { value: 'other', label: 'Outra' },\n];\n\nexport const formDataToGuardianModel = (values: FormValues) =>\n ({\n relationToPatient: values.relationToPatient || undefined,\n user: {\n name: values.name,\n cpf: numberMask(values.cpf),\n phoneNumber: numberMask(`55${values.phoneNumber}`),\n email: values.email || undefined,\n howMetUs: values.howMetUs || undefined,\n password: values.password,\n },\n } as GuardianModel);\n\nexport const passwordInitialValues = {\n password: '',\n passwordConfirmation: '',\n termsAccepted: false,\n};\n\nexport type PasswordFormValues = {\n password: string;\n passwordConfirmation: string;\n termsAccepted: boolean;\n};\n","import { APIError } from '@cuidador/lib';\nimport { Checkbox, FormHelperText } from '@material-ui/core';\nimport { AxiosError } from 'axios';\nimport { Form, Formik, FormikProps } from 'formik';\nimport qs from 'query-string';\nimport React, { useContext, useEffect, useRef, useState } from 'react';\nimport { useHistory, useLocation } from 'react-router-dom';\nimport { toast } from 'react-toastify';\nimport {\n FormCardContainer,\n StyledBoldTitle,\n StyledFormikSelect,\n StyledFormikTextField,\n StyledFormikTextPassword,\n} from '../../components/FormCardContainer';\nimport FormikTextField from '../../components/Forms/FormikTextField';\nimport MedicBalloon from '../../components/MedicBalloon';\nimport PasswordRules from '../../components/PasswordRules';\nimport StyledButton from '../../components/StyledButton';\nimport StyledMenuItem from '../../components/StyledMenuItem';\nimport { AuthContext } from '../../contexts/auth';\nimport useGuardian from '../../hooks/useGuardian';\nimport usePlan from '../../hooks/usePlan';\nimport { resolveErrorMessage } from '../../utils/error';\nimport { cpfMask, numberMask, phoneMask } from '../../utils/inputs';\nimport {\n Background,\n ContentContainer,\n Line,\n Logo,\n LogoContainer,\n StyledFormControlLabel,\n TermsContainer,\n Title,\n TitleBold,\n VisibilityContainer,\n} from './styles';\nimport {\n formDataToGuardianModel,\n FormValues,\n howMetUsOptions,\n initialValues,\n relationToPatientOptions,\n validationSchema,\n} from './utils';\nimport { Header } from '../../components/Header'\n\nconst GuardianRegister: React.FC = () => {\n const history = useHistory();\n const location = useLocation();\n const formikValuesRef = useRef | null>();\n const { post, ids } = useGuardian();\n const { getById } = usePlan();\n const {\n signIn,\n error: signInError,\n setPromotionPlanId,\n setCompanyPlanId,\n } = useContext(AuthContext);\n const [signInLoading, setSignInLoading] = useState(false);\n\n const { etapa: step } = qs.parse(location.search);\n const { plan: planId } = qs.parse(location.search);\n const successVisible = step === 'sucesso';\n const formVisible = !successVisible;\n const [validationError, setValidationError] = useState(false);\n\n useEffect(() => {\n if (planId) {\n getById(planId.toString())\n .then((plan) => {\n if (plan.isB2B) {\n toast.success('Plano empresarial aplicado!');\n setCompanyPlanId(planId as string);\n } else {\n toast.success('Plano promocional aplicado!');\n setPromotionPlanId(planId as string);\n }\n })\n .catch(() => toast.error('Erro ao obter plano - plano inválido!'));\n }\n\n // avoids direct access to success page\n if (step === 'sucesso' && !ids.length) {\n history.replace('/onboarding');\n return;\n }\n\n // avoids returning to any step after success\n if (step !== 'sucesso' && ids.length) {\n history.replace(`${location.pathname}?etapa=sucesso`);\n return;\n }\n }, [location.search]);\n\n useEffect(\n function removeLoadingOnSignInError() {\n if (signInError) {\n toast.error(resolveErrorMessage(signInError));\n setSignInLoading(false);\n }\n },\n [signInError]\n );\n\n const submitGuardianInfo = (values: FormValues) => {\n return post(formDataToGuardianModel({ ...values! }))\n .then(() => {\n handleSignIn();\n })\n .catch((err: AxiosError) => {\n const displayMessage = resolveErrorMessage(err);\n const fieldError = err.response?.data.context?.key;\n if (fieldError) {\n if (Object.keys(initialValues).includes(fieldError)) {\n formikValuesRef.current?.setFieldError(\n fieldError,\n displayMessage || ''\n );\n history.goBack();\n }\n } else {\n toast.error(displayMessage);\n }\n });\n };\n\n const handleSignIn = () => {\n setSignInLoading(true);\n const { cpf, password } = formikValuesRef.current?.values as FormValues;\n return signIn(numberMask(cpf), password);\n };\n\n return (\n <>\n \n \n \n }\n />\n \n \n \n\n (formikValuesRef.current = ref)}\n initialValues={initialValues}\n validationSchema={validationSchema}\n onSubmit={submitGuardianInfo}\n >\n {({ values, setFieldValue, errors }) => (\n
\n \n \n \n Informações pessoais\n \n\n \n \n ) => {\n setFieldValue('phoneNumber', phoneMask(e.target.value));\n }}\n />\n \n \n\n \n \n Outras informações\n \n\n \n {howMetUsOptions.map((item) => (\n \n {item.label}\n \n ))}\n \n \n {relationToPatientOptions.map((item) => (\n \n {item.label}\n \n ))}\n \n \n \n \n Crie sua senha\n \n \n \n \n \n \n\n \n \n setFieldValue('termsAccepted', !values.termsAccepted)\n }\n />\n }\n label={\n \n Eu li e aceito os Termos de Uso e Políticas de\n Privacidade\n \n }\n />\n {errors.termsAccepted && (\n \n {errors.termsAccepted}\n \n )}\n \n\n setValidationError(true)}\n >\n Criar conta\n \n \n )}\n \n\n \n Já tem uma conta?\n Entrar\n
\n
\n \n );\n};\n\nexport default GuardianRegister;\n","import { Typography } from '@material-ui/core';\nimport styled from 'styled-components';\nimport StyledTextField from '../../components/StyledTextField';\n\nexport const QuestionsWrapper = styled.div`\n margin-top: ${({ theme }) => theme.spacing(3)}px;\n margin-bottom: ${({ theme }) => theme.spacing(3)}px;\n width: 100%;\n`;\n\nexport const QuestionContainer = styled.div`\n background-color: ${({ theme }) => theme.palette.extra.color.grey.light};\n border-radius: ${({ theme }) => theme.spacing(1)}px;\n padding: ${({ theme }) => theme.spacing(2)}px;\n margin-bottom: ${({ theme }) => theme.spacing(2)}px;\n word-wrap: break-word;\n`;\n\nexport const QuestionTitle = styled(Typography)`\n color: black;\n font-weight: bold;\n`;\n\nexport const OptionsWrapper = styled.div`\n margin-top: ${({ theme }) => theme.spacing(1)}px;\n margin-bottom: ${({ theme }) => theme.spacing(1)}px;\n`;\n\nexport const OptionDescriptionContainer = styled.div``;\n\nexport const StyledOptionDescriptionTextField = styled(StyledTextField).attrs({\n placeholder: 'Descreva',\n color: 'secondary',\n fullWidth: true,\n multiline: true,\n inputProps: {\n maxLength: 200,\n 'data-testid': 'interviewOptionText',\n },\n})``;\n","import React from 'react';\nimport { Checkbox, Radio, RadioGroup } from '@material-ui/core';\nimport {\n OptionsWrapper,\n OptionDescriptionContainer,\n StyledOptionDescriptionTextField,\n} from '../../styles';\nimport { AnswerType, QuestionAnswerOption } from '@cuidador/database';\nimport StyledFormControlLabel from '../../../StyledFormControlLabel';\n\ntype FormProps = {\n readOnly?: boolean;\n type: AnswerType['type'];\n options: AnswerType['options'];\n onOptionsChange: (option: QuestionAnswerOption[]) => void;\n};\n\nconst InterviewAnswerOption: React.FC = React.memo(\n ({ type, options, readOnly, onOptionsChange }: FormProps) => {\n const buildChangeOptions = (\n optionId: string,\n changedData: Partial\n ): QuestionAnswerOption[] => {\n const optionToChange = options.find((op) => op.id === optionId);\n if (!optionToChange) return options;\n\n return options.map((option) => {\n if (option.id !== optionId) {\n /**\n * if changed option was single and checked,\n * the other options must have isChecked false\n * and must not have description.\n */\n if (type === 'single' && changedData?.isChecked) {\n return {\n ...option,\n isChecked: false,\n description: undefined,\n };\n }\n return option;\n }\n return {\n ...optionToChange,\n ...changedData,\n // if option to change is not checked, remove description\n description: optionToChange.isChecked\n ? changedData.description\n : undefined,\n };\n });\n };\n return (\n \n {type === 'multi' &&\n options.map((option) => {\n return (\n
\n \n onOptionsChange(\n buildChangeOptions(option.id, {\n isChecked: e.target.checked,\n })\n )\n }\n />\n }\n />\n {option.isChecked && (\n \n \n onOptionsChange(\n buildChangeOptions(option.id, {\n description: e.target.value,\n })\n )\n }\n />\n \n )}\n
\n );\n })}\n {type === 'single' && (\n \n onOptionsChange(\n buildChangeOptions(\n options.find((op) => op.id === e.target.value)!.id,\n {\n isChecked: true,\n }\n )\n )\n }\n >\n {options.map((option) => (\n
\n }\n label={option.value}\n checked={option.isChecked}\n disabled={readOnly}\n />\n {option.isChecked && (\n \n \n onOptionsChange(\n buildChangeOptions(option.id, {\n description: e.target.value,\n })\n )\n }\n />\n \n )}\n
\n ))}\n \n )}\n
\n );\n }\n);\nInterviewAnswerOption.displayName = 'InterviewAnswerOption';\n\nexport default InterviewAnswerOption;\n","import { AnswerType, QuestionAnswerOption } from '@cuidador/database';\nimport React, { useCallback } from 'react';\nimport { useDebouncedCallback } from 'use-debounce/lib';\nimport { QuestionContainer, QuestionTitle } from '../styles';\nimport InterviewAnswerOption from './InterviewAnswerOption';\n\ntype FormProps = {\n readOnly?: boolean;\n careQuestionId?: Id;\n name?: string;\n careQuestionText?: string;\n questionAnswerData: AnswerType;\n onAnswerChange: (careQuestionId: Id, questionAnswerData: AnswerType) => void;\n onAnswerChangeDebounce: (\n careQuestionId: number,\n questionAnswerData: AnswerType\n ) => void;\n};\n\nconst InterviewAnswer: React.FC = React.memo(\n ({\n careQuestionId,\n name,\n careQuestionText,\n questionAnswerData,\n readOnly,\n onAnswerChange,\n onAnswerChangeDebounce,\n }: FormProps) => {\n const debounced = useDebouncedCallback(\n (careQuestionId: number, questionAnswerData: AnswerType) =>\n onAnswerChangeDebounce(careQuestionId, questionAnswerData),\n 500\n );\n /**\n * Build new answer when any option changes\n */\n const handleOptionsChange = useCallback(\n (options: QuestionAnswerOption[]) => {\n const newAnswerData: AnswerType = {\n ...questionAnswerData,\n options,\n };\n onAnswerChange(careQuestionId!, newAnswerData);\n debounced.callback(Number(careQuestionId!), newAnswerData);\n },\n [careQuestionId, questionAnswerData]\n );\n return (\n \n \n {name}: {careQuestionText}\n \n \n \n );\n }\n);\nInterviewAnswer.displayName = 'InterviewAnswer';\n\nexport default InterviewAnswer;\n","import { AnswerType, CareQuestionAnswerModel } from '@cuidador/database';\nimport { orderBy } from 'lodash';\nimport React from 'react';\nimport InterviewAnswer from './InterviewAnswer';\nimport { QuestionsWrapper } from './styles';\n\ntype FormProps = {\n readOnly?: boolean;\n careQuestionAnswerList: CareQuestionAnswerModel[];\n handleAnswerOnChange: (\n careQuestionId: Id,\n questionAnswerData: AnswerType\n ) => void;\n debounceAnswerOnChange: (\n careQuestionId: number,\n questionAnswerData: AnswerType\n ) => void;\n};\n\nconst InterviewAnswerList: React.FC = ({\n readOnly,\n careQuestionAnswerList,\n handleAnswerOnChange,\n debounceAnswerOnChange,\n}: FormProps) => {\n const orderedList = orderBy(\n careQuestionAnswerList,\n 'careQuestion.orderNumber',\n 'asc'\n );\n return (\n \n {orderedList?.map((careQuestionAnswer, index) => {\n const careQuestion = careQuestionAnswer.careQuestion;\n return (\n \n );\n })}\n \n );\n};\n\nInterviewAnswerList.displayName = 'InterviewAnswerList';\n\nexport default InterviewAnswerList;\n","import {\n ActionModel,\n AnswerType,\n PatientInterviewModel,\n} from '@cuidador/database';\nimport { useCallback, useReducer } from 'react';\nimport axios from '../config/axios';\nimport {\n createReducer,\n Item,\n PaginatedRequestParams,\n ReducerData,\n} from '../utils/store/index';\n\nconst endpoint = '/care/interview';\n\nconst finishInterviewEndPoint = (interviewId: number) =>\n `care/interview/${interviewId}/finish`;\nconst careQuestionAnswerEndPoint = (interviewId: number, questionId: number) =>\n `care/interview/${interviewId}/answer-question/${questionId}`;\n\nconst initialData: ReducerData = {\n byId: {} as Record>,\n ids: [] as Array,\n total: 0,\n loading: false,\n error: null,\n};\n\nconst useInterview = () => {\n const [state, dispatch] = useReducer(\n createReducer(),\n initialData\n );\n\n const getByPatientPaginated = useCallback(\n async (\n patientId: Id,\n params: PaginatedRequestParams & Partial\n ) => {\n try {\n dispatch({ type: 'LOADING' });\n const response = await axios.get(\n `${endpoint}/by-patient/${patientId}`,\n { params: { orderBy: 'interviewedAt', order: 'desc', ...params } }\n );\n dispatch({ type: 'PAGINATION', payload: response.data });\n return response.data;\n } catch (err) {\n dispatch({ type: 'ERROR', payload: err });\n }\n },\n []\n );\n\n const getById = useCallback(async (id: Id) => {\n try {\n dispatch({ type: 'LOADING' });\n const response = await axios.get(`${endpoint}/${id}`);\n dispatch({ type: 'GET_BY_ID', payload: response.data });\n return Promise.resolve(response.data as PatientInterviewModel);\n } catch (err) {\n dispatch({ type: 'ERROR', payload: err });\n throw err;\n }\n }, []);\n\n const post = useCallback(async (data: PatientInterviewModel) => {\n try {\n dispatch({ type: 'LOADING' });\n const response = await axios.post(`${endpoint}`, data);\n dispatch({ type: 'CREATE', payload: response.data });\n return Promise.resolve(response);\n } catch (err) {\n dispatch({ type: 'ERROR', payload: err });\n return Promise.reject(err);\n }\n }, []);\n\n const patch = useCallback(async (id: Id) => {\n try {\n dispatch({ type: 'LOADING' });\n const response = await axios.patch(`${endpoint}/${id}`);\n dispatch({ type: 'UPDATE', payload: response.data });\n return Promise.resolve(response);\n } catch (err) {\n dispatch({ type: 'ERROR', payload: err });\n return Promise.reject(err);\n }\n }, []);\n\n const deleteInterview = useCallback(async (id: Id) => {\n try {\n dispatch({ type: 'LOADING' });\n const response = await axios.delete(`${endpoint}/${id}`);\n dispatch({ type: 'SUCCESS' });\n return Promise.resolve(response);\n } catch (err) {\n dispatch({ type: 'ERROR', payload: err });\n return Promise.reject(err);\n }\n }, []);\n\n const postFinishInterview = useCallback(async (interviewId: number) => {\n try {\n dispatch({ type: 'LOADING' });\n const response = await axios.post(finishInterviewEndPoint(interviewId));\n dispatch({ type: 'UPDATE', payload: response.data });\n return Promise.resolve(response);\n } catch (err) {\n dispatch({ type: 'ERROR', payload: err });\n return Promise.reject(err);\n }\n }, []);\n\n const patchInterviewCareQuestionAnswer = useCallback(\n async (interviewId: number, questionId: number, data: AnswerType) => {\n try {\n const response = await axios.patch(\n careQuestionAnswerEndPoint(interviewId, questionId),\n { questionAnswerData: { ...data } }\n );\n return Promise.resolve(response);\n } catch (err) {\n dispatch({ type: 'ERROR', payload: err });\n return Promise.reject(err);\n }\n },\n []\n );\n\n return {\n ...state,\n getByPatientPaginated,\n getById,\n post,\n patch,\n deleteInterview,\n postFinishInterview,\n patchInterviewCareQuestionAnswer,\n };\n};\n\nexport default useInterview;\n","import { Stepper } from '@material-ui/core';\nimport styled from 'styled-components';\n\nexport const ContentContainer = styled.div`\n display: flex;\n flex-direction: column;\n align-items: center;\n flex: 1;\n padding: ${({ theme }) => theme.spacing(2, 3)};\n`;\n\nexport const NavigationButtonsContainer = styled.div`\n display: flex;\n width: 100%;\n justify-content: space-evenly;\n`;\n\nexport const StyledStepper = styled(Stepper)`\n width: 100%;\n background-color: transparent;\n overflow: auto;\n`;\n\nexport const TextContainer = styled.div`\n margin-top: ${({ theme }) => theme.spacing(1)}px;\n\n p {\n color: ${({ theme }) => theme.palette.extra.color.grey.main};\n display: -webkit-box;\n -webkit-line-clamp: 2;\n -webkit-box-orient: vertical;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n`;\n\nexport const EditButton = styled.p`\n font-size: ${({ theme }) => theme.spacing(1.75)}px;\n background-color: ${({ theme }) => theme.palette.common.white};\n border-radius: ${({ theme }) => theme.spacing(0.7)}px;\n color: ${({ theme }) => theme.palette.primary.main};\n font-weight: bold;\n padding: ${({ theme }) => theme.spacing(0.4, 1)};\n`;\n","import {\n AnswerType,\n CareQuestionAnswerModel,\n CareQuestionModel,\n PatientInterviewModel,\n} from '@cuidador/database';\nimport { Dictionary } from 'lodash';\nimport { RefObject } from 'react';\n\nexport const generateAnswerDictionaryFromQuestionDictionary = (\n questionDictionary: Dictionary\n): Dictionary => {\n const answerDictionary: Dictionary = {};\n\n Object.keys(questionDictionary).map((key) => {\n const questions = questionDictionary[key];\n const answers = questions.map(\n (question) =>\n ({\n careQuestion: question,\n questionAnswerData: question.answerConfig,\n } as CareQuestionAnswerModel)\n );\n answerDictionary[key] = answers;\n });\n return answerDictionary;\n};\n\ntype GetCurrentCareQuestionAnswerParams = {\n careQuestionAnswerDictionary: Dictionary;\n careQuestionIdToMatch: number;\n};\nexport const getCurrentCareQuestionAnswerList = (\n params: GetCurrentCareQuestionAnswerParams\n) => {\n const { careQuestionAnswerDictionary, careQuestionIdToMatch } = params;\n const allCareQuestionAnswerList = Object.entries(\n careQuestionAnswerDictionary\n ).map((careQuestionAnswersMap) => {\n const careQuestionAnswerList = careQuestionAnswersMap[1];\n return careQuestionAnswerList;\n });\n const currentCareQuestionAnswerList = allCareQuestionAnswerList.find(\n (careQuestionAnswerList) =>\n careQuestionAnswerList.find(\n (answer) => answer.careQuestion?.id === careQuestionIdToMatch\n )\n );\n\n return currentCareQuestionAnswerList;\n};\n\ntype BuildNewCareQuestionAnswerListParams = {\n careQuestionAnswerToChange: CareQuestionAnswerModel;\n newQuestionAnswerData: AnswerType;\n careQuestionAnswerList: CareQuestionAnswerModel[];\n};\nexport const buildNewCareQuestionAnswerList = (\n params: BuildNewCareQuestionAnswerListParams\n) => {\n const {\n careQuestionAnswerToChange,\n newQuestionAnswerData,\n careQuestionAnswerList,\n } = params;\n const newCareQuestionAnswer: CareQuestionAnswerModel = {\n ...careQuestionAnswerToChange,\n questionAnswerData: newQuestionAnswerData,\n };\n const indexToReplace = careQuestionAnswerList.indexOf(\n careQuestionAnswerToChange\n );\n const newCareQuestionAnswerList = careQuestionAnswerList.map(\n (answer, index) => {\n if (index !== indexToReplace) return answer;\n return newCareQuestionAnswer;\n }\n );\n return newCareQuestionAnswerList;\n};\n\ntype BuildInterviewDataParams = {\n patientId: Id;\n interviewName: string;\n interviewDate: string;\n careQuestionAnswerDictionary: Dictionary;\n};\nexport const buildInterviewAnswerData = (\n params: BuildInterviewDataParams\n): PatientInterviewModel => {\n const {\n patientId,\n interviewName,\n interviewDate,\n careQuestionAnswerDictionary,\n } = params;\n\n const careQuestionAnswerList: CareQuestionAnswerModel[] = [];\n\n Object.entries(careQuestionAnswerDictionary)\n .map((careQuestionAnswersMap) => {\n const careQuestionAnswerList = careQuestionAnswersMap[1];\n return careQuestionAnswerList;\n })\n .forEach((list) => careQuestionAnswerList.push(...list));\n\n /**\n * Get only careQuestionId and questionAnswerData\n */\n const mappedCareQuestionAnswerList = careQuestionAnswerList.map(\n (careQuestionAnswer) =>\n ({\n careQuestionId: careQuestionAnswer.careQuestion?.id,\n questionAnswerData: careQuestionAnswer.questionAnswerData,\n } as CareQuestionAnswerModel)\n );\n\n const interviewAnswerData: PatientInterviewModel = {\n patientId: patientId as number,\n name: interviewName,\n interviewedAt: interviewDate,\n careQuestionAnswers: mappedCareQuestionAnswerList,\n };\n return interviewAnswerData;\n};\n\nexport const handleInterviewCareQuestionsAnswers = (\n interview: PatientInterviewModel,\n readOnly: boolean\n) => {\n if (readOnly) {\n return filterAnsweredOptionCareQuestions(\n interview.careQuestionAnswers || []\n );\n }\n return interview.careQuestionAnswers;\n};\n\n/**\n * Filter answered CareQuestionsAnswer with only checked Option.\n */\nexport function filterAnsweredOptionCareQuestions(\n careQuestionAnswers: CareQuestionAnswerModel[]\n) {\n return careQuestionAnswers\n .filter((careQuestionAnswer) => {\n const answer = careQuestionAnswer.questionAnswerData as AnswerType;\n const answered = answer.options.some((option) =>\n Boolean(option.isChecked)\n );\n return answered;\n })\n .map((careQuestionAnswer) => {\n const answer = careQuestionAnswer.questionAnswerData as AnswerType;\n return {\n ...careQuestionAnswer,\n questionAnswerData: {\n ...answer,\n options: answer.options.filter((option) => Boolean(option.isChecked)),\n },\n };\n });\n}\n\nexport function getScrollValueFromRatio(\n element: RefObject,\n ratio: number\n) {\n const scrollWidth = element.current?.scrollWidth || 0;\n\n return scrollWidth * ratio;\n}\n\nexport function getEveryPageQuestionAnswered(\n questions: CareQuestionAnswerModel[]\n) {\n function isAnswered(question: CareQuestionAnswerModel) {\n const options = (question.questionAnswerData as AnswerType).options;\n return options.some((option) => option.isChecked === true);\n }\n\n return questions.every(isAnswered);\n}\n\nexport const MEDIC_BALLOON_TEXTS = [\n 'As perguntas estão divididas por temas e você consegue acompanhar a evolução pela barra acima. Se precisar continuar mais tarde, não finalize... as informações ficarão salvas.',\n 'Conhecer os dados de saúde vai nos ajudar a antecipar riscos, atuar preventivamente e evitar agravamento de condições e problemas de saúde.',\n 'Ótimo, chegamos ao final do cadastro da pessoa sob cuidado. Agora falta pouco para começarmos a nossa jornada!',\n];\n\nexport function getMedicBalloonText(currentPage: number, totalPages: number) {\n if (currentPage === 0) return MEDIC_BALLOON_TEXTS[0];\n else if (currentPage === totalPages - 1) return MEDIC_BALLOON_TEXTS[2];\n else return MEDIC_BALLOON_TEXTS[1];\n}\n","import {\n AnswerType,\n CareCategoryModel,\n CareQuestionAnswerModel,\n PatientInterviewModel,\n} from '@cuidador/database';\nimport { APIError } from '@cuidador/lib';\nimport { IconButton, Step, StepLabel, Typography } from '@material-ui/core';\nimport * as Sentry from '@sentry/react';\nimport { AxiosError } from 'axios';\nimport { format } from 'date-fns';\nimport _, { Dictionary } from 'lodash';\nimport React, {\n useCallback,\n useContext,\n useEffect,\n useRef,\n useState,\n} from 'react';\nimport { useHistory, useParams } from 'react-router-dom';\nimport { toast } from 'react-toastify';\nimport InterviewAnswerList from '../../components/InterviewAnswerList';\nimport LoadingBackdrop from '../../components/LoadingBackdrop';\nimport MedicBalloon from '../../components/MedicBalloon';\nimport StyledButton from '../../components/StyledButton';\nimport StyledSimpleDialog from '../../components/StyledSimpleDialog';\nimport { AuthContext } from '../../contexts/auth';\nimport useCanAccess from '../../hooks/useCanAccess';\nimport useInterview from '../../hooks/useInterview';\nimport { resolveErrorMessage } from '../../utils/error';\nimport {\n ContentContainer,\n EditButton,\n NavigationButtonsContainer,\n StyledStepper,\n TextContainer,\n} from './styles';\nimport {\n buildNewCareQuestionAnswerList,\n getCurrentCareQuestionAnswerList,\n getMedicBalloonText,\n getScrollValueFromRatio,\n handleInterviewCareQuestionsAnswers,\n} from './utils';\nimport { PageTitle } from '../../components/PageTitle'\nimport { Header } from '../../components/Header'\nimport { BackButton } from '../../components/BackButton'\n\nenum ActionType {\n readOnly = 'visualizar',\n edit = 'editar',\n answer = 'responder',\n}\n\nconst Interview: React.FC = () => {\n const [currentIndex, setCurrentIndex] = useState(0);\n const [pageIndexes, setPageIndexes] = useState([]);\n const [loadingInterview, setLoadingInterview] = useState(false);\n const [popUpVisible, isPopUpVisible] = useState(false);\n const [\n patientInterview,\n setPatientInterview,\n ] = useState({});\n const [\n answersGroupedByCareCategoryDictionary,\n setAnswersGroupedByCareCategoryDictionary,\n ] = useState>();\n const { isAllowedToInvoke: isAllowedToFinishInterview } = useCanAccess(\n 'care/interview.finish'\n );\n const {\n loading,\n getById,\n getByPatientPaginated,\n patchInterviewCareQuestionAnswer,\n postFinishInterview,\n patch,\n deleteInterview,\n } = useInterview();\n const history = useHistory();\n const { userInfo } = useContext(AuthContext);\n const patientId = userInfo?.activePatientId;\n\n const { actionType } = useParams<{ actionType: string }>();\n const isReadOnly = actionType === ActionType.readOnly;\n const isEditing = actionType === ActionType.edit;\n const { isAllowedToUpdate: canEdit } = useCanAccess('care/interview')\n\n useEffect(() => {\n loadInterview();\n }, [isReadOnly, isEditing]);\n\n const loadInterview = async () => {\n try {\n setLoadingInterview(true);\n const patientInterview = await handleGetPatientInterview();\n\n const patientInterviewData = await getById(Number(patientInterview.id));\n setPatientInterview(patientInterviewData);\n\n const interviewCareQuestionAnswers = handleInterviewCareQuestionsAnswers(\n patientInterviewData,\n isReadOnly\n );\n\n const groupedAnswers = _.groupBy(\n interviewCareQuestionAnswers,\n 'careQuestion.careCategoryId'\n );\n setAnswersGroupedByCareCategoryDictionary(groupedAnswers);\n\n const availableCareCategories = interviewCareQuestionAnswers?.map(\n (answer) => answer?.careQuestion?.careCategory as CareCategoryModel\n );\n const uniqueCareCategories = _.uniqBy(availableCareCategories, 'id');\n const orderedCareCategories = _.orderBy(uniqueCareCategories, 'order');\n\n const availableCareCategoryIds = orderedCareCategories.map(\n (careCategory) => String(careCategory.id)\n );\n setCurrentIndex(0);\n setPageIndexes(availableCareCategoryIds);\n } catch (error) {\n console.log(error);\n toast.error(resolveErrorMessage(error));\n } finally {\n setLoadingInterview(false);\n }\n };\n\n const handleGetPatientInterview = async (): Promise => {\n if (isReadOnly) {\n return getLastPatientInterview();\n } else {\n return getLastDraftPatientInterview();\n }\n };\n\n const getLastPatientInterview = async (): Promise => {\n const patientInterviews = await getByPatientPaginated(Number(patientId), {\n limit: 1,\n page: 0,\n orderBy: 'updatedAt',\n order: 'desc',\n isDraft: false,\n });\n const lastPatientInterview = patientInterviews.results[0];\n if (!lastPatientInterview) {\n history.goBack();\n toast.error('Entrevista não encontrada');\n }\n return lastPatientInterview;\n };\n\n const getLastDraftPatientInterview = async (): Promise => {\n const allInterviews = await getByPatientPaginated(Number(patientId), {\n limit: 100,\n page: 0,\n });\n const draftInterview = allInterviews.results.find(\n (interview: PatientInterviewModel) => interview.isDraft\n );\n if (!draftInterview) {\n history.push('/cadastros');\n toast.error('Erro ao carregar entrevista. Tente novamente daqui a pouco');\n }\n return draftInterview;\n };\n\n const handleSubmitInterview = () => {\n postFinishInterview(Number(patientInterview.id))\n .then(() => {\n history.push('/cadastros');\n toast.info('Entrevista salva com sucesso');\n })\n .catch((err: AxiosError) => {\n const displayMessage = resolveErrorMessage(err);\n toast.error(displayMessage);\n });\n };\n\n const handlePatchInterview = () => {\n patch(Number(patientInterview.id))\n .then(() => history.push('/entrevista/editar'))\n .catch((err: AxiosError) => {\n const displayMessage = resolveErrorMessage(err);\n toast.error(displayMessage);\n });\n };\n\n const handleLeavePatchInterview = () => {\n isPopUpVisible(false);\n deleteInterview(patientInterview.id);\n return history.replace('/entrevista/visualizar');\n };\n\n const getCurrentPageAnswers = (): CareQuestionAnswerModel[] => {\n const careCategoryId = pageIndexes[currentIndex];\n if (!answersGroupedByCareCategoryDictionary) return [];\n return answersGroupedByCareCategoryDictionary[careCategoryId];\n };\n\n /**\n * Resets the interview answers dictionary given an careQuestionId\n * and the new CareQuestionAnswer.questionAnswerData.\n */\n type BuildNewAnswerListParams = {\n careQuestionId: Id;\n newQuestionAnswerData: AnswerType;\n };\n const buildNewAnswerList = useCallback(\n (params: BuildNewAnswerListParams) => {\n const { careQuestionId, newQuestionAnswerData } = params;\n setAnswersGroupedByCareCategoryDictionary(\n (answersGroupedByCareCategoryDictionary) => {\n if (!answersGroupedByCareCategoryDictionary) return;\n\n const currentCareQuestionAnswerList = getCurrentCareQuestionAnswerList(\n {\n careQuestionAnswerDictionary: answersGroupedByCareCategoryDictionary,\n careQuestionIdToMatch: careQuestionId as number,\n }\n );\n if (!currentCareQuestionAnswerList) return;\n\n const careQuestionAnswerToChange = currentCareQuestionAnswerList.find(\n (answer) => answer.careQuestion?.id === careQuestionId\n );\n if (!careQuestionAnswerToChange) return;\n\n const newCareQuestionAnswerList = buildNewCareQuestionAnswerList({\n careQuestionAnswerToChange,\n newQuestionAnswerData,\n careQuestionAnswerList: currentCareQuestionAnswerList,\n });\n\n const careCategoryId = Number(\n careQuestionAnswerToChange?.careQuestion?.careCategoryId\n );\n const newCareQuestionAnswerDictionary = {\n ...answersGroupedByCareCategoryDictionary,\n [`${careCategoryId}`]: newCareQuestionAnswerList,\n };\n return newCareQuestionAnswerDictionary;\n }\n );\n },\n [setAnswersGroupedByCareCategoryDictionary]\n );\n\n const handleAnswerOnChange = useCallback(\n (careQuestionId: Id, newQuestionAnswerData: AnswerType) => {\n buildNewAnswerList({ careQuestionId, newQuestionAnswerData });\n },\n [buildNewAnswerList]\n );\n\n const handleAnswerOnChangeDebounce = (\n careQuestionId: number,\n newQuestionAnswerData: AnswerType\n ) => {\n patchInterviewCareQuestionAnswer(\n Number(patientInterview.id),\n careQuestionId,\n newQuestionAnswerData\n ).catch((err) => {\n Sentry.captureException(err);\n return toast.error(\n 'Erro ao salvar resposta. Tente novamente daqui a pouco'\n );\n });\n };\n\n const stepperReference = useRef(null);\n\n const RenderNavigationButtons = () => {\n const isFirstPage = currentIndex === 0;\n const isLastPage = currentIndex === pageIndexes.length - 1;\n\n return (\n \n {!isFirstPage && (\n {\n window.scrollTo(0, 0);\n stepperReference.current?.scroll(\n getScrollValueFromRatio(\n stepperReference,\n (currentIndex - 3) / pageIndexes.length\n ),\n 0\n );\n setCurrentIndex(currentIndex - 1);\n }}\n >\n Voltar\n \n )}\n\n {!isLastPage && (\n {\n window.scrollTo(0, 0);\n stepperReference.current?.scroll(\n getScrollValueFromRatio(\n stepperReference,\n (currentIndex - 1) / pageIndexes.length\n ),\n 0\n );\n setCurrentIndex(currentIndex + 1);\n }}\n >\n Continuar\n \n )}\n\n {isLastPage && !isReadOnly && (\n \n Finalizar\n \n )}\n \n );\n };\n\n const interviewDate = patientInterview?.updatedAt\n ? format(new Date(patientInterview.updatedAt), 'dd/MM/yyyy')\n : '';\n\n return (\n <>\n \n isPopUpVisible(true)\n : undefined}\n />\n )\n }\n centerContent={\n \n }\n rightContent={\n !isEditing && canEdit && (\n \n Editar\n \n )\n }\n />\n \n \n {pageIndexes.map((_, index) => (\n \n \n \n ))}\n \n {!(isReadOnly || isEditing) && (\n \n )}\n {isReadOnly && (\n \n \n Atualizado em {interviewDate} por {patientInterview.user?.name}\n \n \n )}\n \n \n isPopUpVisible(false)}\n handleYes={handleLeavePatchInterview}\n title=\"Abandonar edição\"\n subTitle=\"As alterações não foram salvas. Tem certeza que deseja sair?\"\n />\n \n \n );\n};\n\nexport default Interview;\n","function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\nimport * as React from \"react\";\n\nvar _ref2 = /*#__PURE__*/React.createElement(\"defs\", null, /*#__PURE__*/React.createElement(\"style\", null, \".a{fill:none;}.b{clip-path:url(#a);}.c{fill:#fff;}\"), /*#__PURE__*/React.createElement(\"clipPath\", {\n id: \"a\"\n}, /*#__PURE__*/React.createElement(\"rect\", {\n className: \"a\",\n width: 578.875,\n height: 53.053\n})));\n\nvar _ref3 = /*#__PURE__*/React.createElement(\"g\", {\n transform: \"translate(0 0)\"\n}, /*#__PURE__*/React.createElement(\"g\", {\n className: \"b\",\n transform: \"translate(0 0)\"\n}, /*#__PURE__*/React.createElement(\"path\", {\n className: \"c\",\n d: \"M27.683,16.1l.059-2.43a8.618,8.618,0,0,0-2.7-6.817,10.125,10.125,0,0,0-7.261-2.667A10.771,10.771,0,0,0,8.625,8.717Q5.275,13.251,5.276,21.2q0,8.24,3.675,12.982a10.947,10.947,0,0,0,9.188,4.208,11.656,11.656,0,0,0,5.72-1.452,8.9,8.9,0,0,0,3.883-4.12,12.533,12.533,0,0,0,.83-4.86q.058-2.726,2.253-2.728,2.43,0,2.43,2.786a13.343,13.343,0,0,1-4.416,10.315,16.1,16.1,0,0,1-11.292,4.031A15.888,15.888,0,0,1,4.772,36.725Q0,31.1,0,21.669q0-9.661,4.89-15.56A15.927,15.927,0,0,1,17.783.21q6.342,0,9.9,4.032.118.178.83,1.007-.06-.71-.089-1.155c-.02-.3-.03-.484-.03-.563q-.119-.948-.119-1.246a1.7,1.7,0,0,1,1.9-1.955q2.015,0,2.015,2.43,0,.829-.237,2.9a38.133,38.133,0,0,0-.3,4.03q0,1.661.356,5.573a2.85,2.85,0,0,1,.059.652q0,2.609-2.193,2.608-2.253,0-2.193-2.43\",\n transform: \"translate(0 -0.033)\"\n}), /*#__PURE__*/React.createElement(\"path\", {\n className: \"c\",\n d: \"M68.485,41.606V39.769A11.056,11.056,0,0,1,59.179,44.1q-6.935,0-9.721-4.327a7,7,0,0,1-1.215-2.994,64.112,64.112,0,0,1-.207-6.669v-4.92a34.582,34.582,0,0,0-.474-6.935q-.3-1.185-1.186-1.186a6.827,6.827,0,0,0-1.186.148A6.68,6.68,0,0,1,44,17.362q-2.076,0-2.075-1.956,0-1.9,2.549-1.9.118,0,1.541.119t1.956.119a15.853,15.853,0,0,0,1.838-.178,8.462,8.462,0,0,1,1.126-.059q1.778,0,1.778,2.253,0,.06-.119,3.438t-.119,5.987V29.04q0,6.344,1.3,8.358,1.778,2.787,6.106,2.786a8.62,8.62,0,0,0,4.416-1.156,6.217,6.217,0,0,0,2.756-3.053q.889-2.134.889-8.714V20.148q-.3-2.9-1.482-2.9a7.9,7.9,0,0,0-.948.089,7.926,7.926,0,0,1-.948.089q-2.016,0-2.015-1.9,0-2.134,2.312-2.015l1.482.059q.356,0,1.008.059t.889.059q.474,0,1.393-.089t1.393-.089q1.778,0,1.778,1.9c0,.04-.04.5-.119,1.363q-.3,3.2-.3,6.58v9.129q0,3.557.059,4.031.3,3.143,1.66,3.142A7.734,7.734,0,0,0,75.3,39.5a7.848,7.848,0,0,1,1.245-.148A1.729,1.729,0,0,1,78.5,41.31q0,2.016-2.49,2.015a9.414,9.414,0,0,1-1.541-.119,15.065,15.065,0,0,0-1.838-.237,6.545,6.545,0,0,0-1.245.178,6.561,6.561,0,0,1-1.245.178q-1.66,0-1.66-1.719\",\n transform: \"translate(-6.423 -2.069)\"\n}), /*#__PURE__*/React.createElement(\"path\", {\n className: \"c\",\n d: \"M92.9,28.991v-9.84q-.3-3.912-1.719-3.912a14.686,14.686,0,0,0-1.541.237,4.112,4.112,0,0,1-1.186.178q-2.076,0-2.075-1.9,0-2.015,2.608-2.015.474,0,1.6.118,1.659.178,2.49.178a10.656,10.656,0,0,0,1.452-.147,10.68,10.68,0,0,1,1.452-.148q1.659,0,1.66,2.193,0,.889-.059,1.541-.238,2.609-.237,8.654v4.861a60.3,60.3,0,0,0,.267,7.5Q97.878,38,98.945,38q.118,0,1.541-.3a5.059,5.059,0,0,1,.948-.119q2.192,0,2.193,1.957a1.752,1.752,0,0,1-.771,1.423,2.846,2.846,0,0,1-1.778.593,23.821,23.821,0,0,1-2.9-.268,23.85,23.85,0,0,0-2.964-.266,24.521,24.521,0,0,0-3.32.236,25.588,25.588,0,0,1-3.26.3q-2.253,0-2.253-2.015a1.756,1.756,0,0,1,2.015-1.957,9.109,9.109,0,0,1,1.452.178,8.9,8.9,0,0,0,1.452.178q1.3,0,1.6-3.912ZM94.143,1.96a3.345,3.345,0,0,1,2.4,1.008A3.143,3.143,0,0,1,97.581,5.28,3.2,3.2,0,0,1,96.6,7.622a3.132,3.132,0,0,1-2.282.978A3.188,3.188,0,0,1,91.98,7.532,3.391,3.391,0,0,1,90.942,5.1a3.011,3.011,0,0,1,.948-2.194,3.081,3.081,0,0,1,2.253-.948\",\n transform: \"translate(-13.231 -0.301)\"\n}), /*#__PURE__*/React.createElement(\"path\", {\n className: \"c\",\n d: \"M130.549,15.068V9.08a20.371,20.371,0,0,0-.119-2.9q-.3-1.9-1.6-1.9-.059,0-1.718.3a4.089,4.089,0,0,1-1.009.119q-2.192,0-2.192-1.9,0-1.956,2.964-1.955.591,0,1.837.118t1.838.119q.889,0,1.482-.058Q133.276.9,133.632.9q1.659,0,1.66,2.43,0,1.661-.237,8.358-.119,3.322-.119,4.446V22q0,11.8.178,13.4.238,2.255,1.66,2.253c.158,0,.572-.038,1.245-.118s1.126-.119,1.363-.119q2.076,0,2.076,1.957,0,2.016-2.668,2.015a11.081,11.081,0,0,1-1.719-.178,11.326,11.326,0,0,0-1.838-.178,6.993,6.993,0,0,0-1.334.178,7.153,7.153,0,0,1-1.333.178q-1.721,0-1.6-2.193l.059-1.246q-3.143,4.21-9.129,4.21A12.074,12.074,0,0,1,112.2,37.77q-3.705-4.386-3.7-11.5t3.646-11.441a11.977,11.977,0,0,1,9.633-4.327,9.7,9.7,0,0,1,8.773,4.565m-8.357-.653a7.673,7.673,0,0,0-6.55,3.171q-2.342,3.172-2.341,8.743,0,5.454,2.46,8.684a7.877,7.877,0,0,0,6.609,3.231q5.1,0,7.053-3.972,1.067-2.191,1.067-7.943,0-6.224-1.482-8.417a7.736,7.736,0,0,0-6.816-3.5\",\n transform: \"translate(-16.62 -0.129)\"\n}), /*#__PURE__*/React.createElement(\"path\", {\n className: \"c\",\n d: \"M182.765,34.609l-.059,3.379q-.119,5.689-6.046,5.691-4.861,0-6.046-4.209-2.965,4.446-9.425,4.446a11.715,11.715,0,0,1-7.647-2.372,7.764,7.764,0,0,1-2.9-6.342,7.769,7.769,0,0,1,4.209-7.232,21.373,21.373,0,0,1,7.41-1.838q4.8-.535,6.106-1.246a3.76,3.76,0,0,0,1.838-3.615A4.549,4.549,0,0,0,167.946,17a8,8,0,0,0-4.09-1.067,9.178,9.178,0,0,0-4,.919q-1.927.92-1.927,1.867c0,.119.2.317.593.592a2.241,2.241,0,0,1,.83,1.957,2.472,2.472,0,0,1-.889,1.955,3.226,3.226,0,0,1-2.193.771,3.448,3.448,0,0,1-2.579-1.066,3.6,3.6,0,0,1-1.037-2.608,6.823,6.823,0,0,1,3.29-5.662,13.392,13.392,0,0,1,7.973-2.341q5.571,0,8.536,3.082,2.312,2.372,2.312,7.232V34.609q0,3.794.563,4.624a1.74,1.74,0,0,0,1.512.829q2.134,0,2.134-3.793v-2.9a1.677,1.677,0,0,1,1.9-1.9q1.9,0,1.9,2.844ZM170.08,31.882l.059-4.21q-1.956,1.956-8,2.549-6.7.654-6.7,4.861a4.373,4.373,0,0,0,1.63,3.617,6.876,6.876,0,0,0,4.416,1.3,8.719,8.719,0,0,0,6.254-2.164,8,8,0,0,0,2.341-5.957\",\n transform: \"translate(-23.075 -1.888)\"\n}), /*#__PURE__*/React.createElement(\"path\", {\n className: \"c\",\n d: \"M214.057,15.068V9.08a20.523,20.523,0,0,0-.118-2.9q-.3-1.9-1.6-1.9-.06,0-1.719.3a4.077,4.077,0,0,1-1.008.119q-2.194,0-2.193-1.9,0-1.956,2.964-1.955.592,0,1.838.118t1.837.119q.889,0,1.482-.058Q216.784.9,217.14.9q1.659,0,1.66,2.43,0,1.661-.237,8.358-.119,3.322-.119,4.446V22q0,11.8.178,13.4.236,2.255,1.66,2.253c.158,0,.572-.038,1.245-.118s1.126-.119,1.363-.119q2.074,0,2.075,1.957,0,2.016-2.667,2.015a11.07,11.07,0,0,1-1.719-.178,11.326,11.326,0,0,0-1.838-.178,6.993,6.993,0,0,0-1.334.178,7.151,7.151,0,0,1-1.334.178q-1.72,0-1.6-2.193l.059-1.246q-3.143,4.21-9.129,4.21a12.074,12.074,0,0,1-9.692-4.387q-3.705-4.386-3.7-11.5t3.646-11.441a11.974,11.974,0,0,1,9.633-4.327,9.7,9.7,0,0,1,8.773,4.565m-8.358-.653a7.675,7.675,0,0,0-6.55,3.171q-2.342,3.172-2.342,8.743,0,5.454,2.46,8.684a7.879,7.879,0,0,0,6.609,3.231q5.1,0,7.054-3.972Q214,32.081,214,26.329q0-6.224-1.482-8.417a7.738,7.738,0,0,0-6.817-3.5\",\n transform: \"translate(-29.412 -0.129)\"\n}), /*#__PURE__*/React.createElement(\"path\", {\n className: \"c\",\n d: \"M246.967,12.25q7.231,0,10.907,5.216A17.861,17.861,0,0,1,260.9,27.959q0,7.231-3.883,11.588A13.176,13.176,0,0,1,246.671,43.9a12.317,12.317,0,0,1-9.9-4.328Q233.1,35.25,233.1,27.9q0-7.052,3.794-11.352a12.78,12.78,0,0,1,10.077-4.3m.059,3.912a7.815,7.815,0,0,0-7.054,3.734,14.962,14.962,0,0,0-2.075,8.18q0,5.573,2.341,8.744a7.557,7.557,0,0,0,6.432,3.171,8.3,8.3,0,0,0,6.965-3.171q2.459-3.172,2.46-8.862a15.552,15.552,0,0,0-2.1-8.506q-2.1-3.291-6.965-3.291\",\n transform: \"translate(-35.706 -1.877)\"\n}), /*#__PURE__*/React.createElement(\"path\", {\n className: \"c\",\n d: \"M279.169,14.988v1.6a10.017,10.017,0,0,1,8.3-4.268,9.612,9.612,0,0,1,6.669,2.312,7.734,7.734,0,0,1,2.578,6.046,6.455,6.455,0,0,1-1.3,4.208,4.156,4.156,0,0,1-3.379,1.6,3.462,3.462,0,0,1-2.312-.8,2.5,2.5,0,0,1-.948-1.986,2.392,2.392,0,0,1,.682-1.719,2.178,2.178,0,0,1,1.63-.711c.039,0,.3.04.771.119a3.2,3.2,0,0,0,.415-1.3,3.5,3.5,0,0,0-1.541-2.845,5.947,5.947,0,0,0-3.734-1.186,6.192,6.192,0,0,0-5.809,3.259q-1.364,2.431-1.363,8.536v3.913q0,3.912.059,4.446.3,3.379,1.838,3.379a5.815,5.815,0,0,0,1.6-.237,4.373,4.373,0,0,1,1.126-.178,1.7,1.7,0,0,1,1.956,1.9,1.913,1.913,0,0,1-.682,1.452,2.336,2.336,0,0,1-1.63.622q-.356,0-2.964-.356a23.884,23.884,0,0,0-2.845-.119,32.483,32.483,0,0,0-3.735.178,32.844,32.844,0,0,1-3.438.3,2.4,2.4,0,0,1-1.63-.593,1.881,1.881,0,0,1-.682-1.482,1.71,1.71,0,0,1,.652-1.334,2.365,2.365,0,0,1,1.6-.563,6.491,6.491,0,0,1,1.3.207,6.418,6.418,0,0,0,1.3.207q1.363,0,1.541-2.075.178-1.9.178-7.41V26.191a68.2,68.2,0,0,0-.3-6.994q-.238-2.313-1.66-2.313a7.08,7.08,0,0,0-1.334.179,7.079,7.079,0,0,1-1.334.178,1.676,1.676,0,0,1-1.9-1.9q0-2.015,2.549-2.015.592,0,1.749.119t1.749.118q.474,0,1.541-.118t1.245-.119q1.481,0,1.482,1.66\",\n transform: \"translate(-41.174 -1.888)\"\n}), /*#__PURE__*/React.createElement(\"path\", {\n className: \"c\",\n d: \"M381.154,16.1l.058-2.43a8.617,8.617,0,0,0-2.7-6.817,10.125,10.125,0,0,0-7.261-2.667,10.773,10.773,0,0,0-9.159,4.535q-3.35,4.533-3.349,12.478,0,8.24,3.675,12.982a10.947,10.947,0,0,0,9.188,4.208,11.655,11.655,0,0,0,5.72-1.452,8.89,8.89,0,0,0,3.883-4.12,12.517,12.517,0,0,0,.83-4.86q.06-2.726,2.253-2.728,2.431,0,2.431,2.786a13.344,13.344,0,0,1-4.417,10.315,16.1,16.1,0,0,1-11.292,4.031,15.888,15.888,0,0,1-12.774-5.632q-4.771-5.63-4.771-15.056,0-9.661,4.89-15.56A15.93,15.93,0,0,1,371.254.21q6.342,0,9.9,4.032c.078.119.356.455.829,1.007-.039-.473-.069-.859-.088-1.155s-.03-.484-.03-.563a12.5,12.5,0,0,1-.119-1.246,1.7,1.7,0,0,1,1.9-1.955q2.014,0,2.015,2.43,0,.829-.237,2.9a38.165,38.165,0,0,0-.3,4.03q0,1.661.356,5.573a2.846,2.846,0,0,1,.06.652q0,2.609-2.193,2.608-2.255,0-2.193-2.43\",\n transform: \"translate(-54.145 -0.033)\"\n}), /*#__PURE__*/React.createElement(\"path\", {\n className: \"c\",\n d: \"M411.932,12.25q7.231,0,10.908,5.216a17.871,17.871,0,0,1,3.022,10.493q0,7.231-3.883,11.588A13.175,13.175,0,0,1,411.635,43.9a12.318,12.318,0,0,1-9.9-4.328Q398.06,35.25,398.061,27.9q0-7.052,3.793-11.352a12.782,12.782,0,0,1,10.078-4.3m.059,3.912a7.813,7.813,0,0,0-7.054,3.734,14.953,14.953,0,0,0-2.075,8.18q0,5.573,2.341,8.744a7.559,7.559,0,0,0,6.432,3.171,8.3,8.3,0,0,0,6.965-3.171q2.458-3.172,2.46-8.862a15.553,15.553,0,0,0-2.1-8.506q-2.1-3.291-6.965-3.291\",\n transform: \"translate(-60.975 -1.877)\"\n}), /*#__PURE__*/React.createElement(\"path\", {\n className: \"c\",\n d: \"M444.194,15.106v1.66a14.648,14.648,0,0,1,2.668-2.608,11.6,11.6,0,0,1,6.817-1.838,11.3,11.3,0,0,1,8.536,3.616q2.192,2.312,2.193,7.291V34.49q0,2.549.058,2.964.3,2.076,1.542,2.075a5.378,5.378,0,0,0,1.3-.178,12.684,12.684,0,0,1,1.3-.119,1.651,1.651,0,0,1,1.9,1.838,1.884,1.884,0,0,1-.682,1.482,2.487,2.487,0,0,1-1.69.593,31.07,31.07,0,0,1-3.171-.237,31.36,31.36,0,0,0-3.171-.237,25.49,25.49,0,0,0-2.845.237,25.308,25.308,0,0,1-2.845.237q-2.312,0-2.312-2.075,0-1.837,1.956-1.838a7.286,7.286,0,0,1,1.126.119l1.423.237q1.067,0,1.3-1.3a61.694,61.694,0,0,0,.356-8.6V25.183q0-4.386-1.068-6.165-1.777-2.963-5.986-2.964a7.347,7.347,0,0,0-6.7,3.379q-1.482,2.373-1.482,7.825v4.861q0,5.632.356,6.461.473,1.068,1.3,1.067a5.743,5.743,0,0,0,1.363-.237,5.784,5.784,0,0,1,1.364-.237q1.777,0,1.777,2.015,0,1.956-2.372,1.956a27.347,27.347,0,0,1-3.081-.356,20.048,20.048,0,0,0-2.906-.178,22.71,22.71,0,0,0-3.32.237,21.6,21.6,0,0,1-2.964.3q-2.49,0-2.49-2.015a1.677,1.677,0,0,1,1.9-1.9,6.252,6.252,0,0,1,1.1.178,7.231,7.231,0,0,0,1.571.178q1.6,0,1.838-2.667,0,.238.06-2.964t.059-4.327V24.887q0-3.437-.178-5.75t-1.778-2.312a10.714,10.714,0,0,0-1.482.178,2.517,2.517,0,0,1-.889.119q-2.194,0-2.193-1.956,0-1.9,2.608-1.9a2.843,2.843,0,0,1,.652.059l2.846.3a9.446,9.446,0,0,0,1.333-.148,9.594,9.594,0,0,1,1.392-.148q1.6,0,1.6,1.778\",\n transform: \"translate(-66.444 -1.888)\"\n}), /*#__PURE__*/React.createElement(\"path\", {\n className: \"c\",\n d: \"M485.178,10.788V9.662q0-4.624,2.49-7.143T494.781,0a10.314,10.314,0,0,1,5.928,1.541,4.69,4.69,0,0,1,2.253,4.031,2.949,2.949,0,0,1-.8,2.134,2.788,2.788,0,0,1-2.105.83,2.733,2.733,0,0,1-1.927-.741,2.37,2.37,0,0,1-.8-1.808,2.52,2.52,0,0,1,.532-1.541,4.084,4.084,0,0,0-2.9-.948,5.128,5.128,0,0,0-4.031,1.66,6.515,6.515,0,0,0-1.482,4.5v1.126a.681.681,0,0,0,.771.771H494.9q1.9,0,1.9,2.135,0,2.074-1.956,2.074h-4.327q-1.067,0-1.067,1.126v6.225q0,11.736.178,13.129t1.3,1.393c-.08,0,.435-.079,1.541-.236a5.189,5.189,0,0,1,1.245-.179,1.756,1.756,0,0,1,2.016,1.956q0,2.076-2.43,2.075a28.473,28.473,0,0,1-3.022-.237,28.914,28.914,0,0,0-3.083-.237,25.074,25.074,0,0,0-3.2.178q-2.313.3-3.024.3-2.55,0-2.548-2.075a1.835,1.835,0,0,1,.621-1.363,2.04,2.04,0,0,1,1.452-.593,5.508,5.508,0,0,1,1.422.207,5.155,5.155,0,0,0,1.3.207q.949,0,1.185-.533a11.314,11.314,0,0,0,.473-3.853q.119-2.548.12-10.433V16.894q0-1.125-1.067-1.126h-2.964a1.86,1.86,0,0,1-2.075-2.134,1.861,1.861,0,0,1,2.135-2.075h3.378a.681.681,0,0,0,.771-.771\",\n transform: \"translate(-73.285 0)\"\n}), /*#__PURE__*/React.createElement(\"path\", {\n className: \"c\",\n d: \"M509.091,28.991v-9.84q-.3-3.912-1.719-3.912a14.649,14.649,0,0,0-1.54.237,4.122,4.122,0,0,1-1.186.178q-2.076,0-2.075-1.9,0-2.015,2.608-2.015.472,0,1.6.118,1.659.178,2.489.178a10.67,10.67,0,0,0,1.453-.147,10.69,10.69,0,0,1,1.452-.148q1.659,0,1.66,2.193,0,.889-.059,1.541-.237,2.609-.237,8.654v4.861a60.244,60.244,0,0,0,.267,7.5Q514.071,38,515.137,38q.118,0,1.54-.3a5.076,5.076,0,0,1,.949-.119q2.192,0,2.193,1.957a1.752,1.752,0,0,1-.771,1.423,2.845,2.845,0,0,1-1.778.593,23.8,23.8,0,0,1-2.9-.268,23.85,23.85,0,0,0-2.964-.266,24.515,24.515,0,0,0-3.32.236,25.583,25.583,0,0,1-3.261.3q-2.252,0-2.251-2.015a1.756,1.756,0,0,1,2.015-1.957,9.108,9.108,0,0,1,1.452.178,8.9,8.9,0,0,0,1.452.178q1.3,0,1.6-3.912ZM510.335,1.96a3.344,3.344,0,0,1,2.4,1.008,3.144,3.144,0,0,1,1.037,2.313,3.2,3.2,0,0,1-.978,2.341,3.134,3.134,0,0,1-2.282.978,3.191,3.191,0,0,1-2.342-1.068,3.393,3.393,0,0,1-1.037-2.43,3.012,3.012,0,0,1,.948-2.194,3.083,3.083,0,0,1,2.253-.948\",\n transform: \"translate(-76.984 -0.301)\"\n}), /*#__PURE__*/React.createElement(\"path\", {\n className: \"c\",\n d: \"M558.008,34.609l-.06,3.379q-.119,5.689-6.046,5.691-4.861,0-6.047-4.209-2.964,4.446-9.425,4.446a11.715,11.715,0,0,1-7.647-2.372,7.766,7.766,0,0,1-2.9-6.342,7.767,7.767,0,0,1,4.209-7.232,21.365,21.365,0,0,1,7.409-1.838q4.8-.535,6.105-1.246a3.76,3.76,0,0,0,1.839-3.615A4.55,4.55,0,0,0,543.188,17a8,8,0,0,0-4.09-1.067,9.178,9.178,0,0,0-4,.919q-1.927.92-1.927,1.867c0,.119.2.317.593.592a2.241,2.241,0,0,1,.83,1.957,2.47,2.47,0,0,1-.89,1.955A3.223,3.223,0,0,1,531.51,24a3.449,3.449,0,0,1-2.578-1.066,3.6,3.6,0,0,1-1.037-2.608,6.824,6.824,0,0,1,3.29-5.662,13.393,13.393,0,0,1,7.973-2.341q5.57,0,8.536,3.082Q550,17.774,550,22.634V34.609q0,3.794.564,4.624a1.738,1.738,0,0,0,1.512.829q2.134,0,2.134-3.793v-2.9a1.676,1.676,0,0,1,1.9-1.9q1.9,0,1.9,2.844Zm-12.685-2.727.059-4.21q-1.957,1.956-8,2.549-6.7.654-6.7,4.861a4.375,4.375,0,0,0,1.63,3.617,6.876,6.876,0,0,0,4.416,1.3,8.714,8.714,0,0,0,6.253-2.164,8,8,0,0,0,2.342-5.957\",\n transform: \"translate(-80.555 -1.888)\"\n}), /*#__PURE__*/React.createElement(\"path\", {\n className: \"c\",\n d: \"M574.811,15.106v1.66a14.668,14.668,0,0,1,2.667-2.608A11.6,11.6,0,0,1,584.3,12.32a11.305,11.305,0,0,1,8.536,3.616q2.191,2.312,2.193,7.291V34.49q0,2.549.058,2.964.3,2.076,1.542,2.075a5.376,5.376,0,0,0,1.3-.178,12.7,12.7,0,0,1,1.3-.119,1.651,1.651,0,0,1,1.9,1.838,1.881,1.881,0,0,1-.682,1.482,2.484,2.484,0,0,1-1.688.593,31.085,31.085,0,0,1-3.172-.237,31.327,31.327,0,0,0-3.171-.237,25.471,25.471,0,0,0-2.845.237,25.327,25.327,0,0,1-2.846.237q-2.312,0-2.312-2.075,0-1.837,1.956-1.838a7.283,7.283,0,0,1,1.126.119l1.423.237q1.067,0,1.3-1.3a61.816,61.816,0,0,0,.356-8.6V25.183q0-4.386-1.068-6.165-1.777-2.963-5.986-2.964a7.347,7.347,0,0,0-6.7,3.379q-1.484,2.373-1.482,7.825v4.861q0,5.632.356,6.461.474,1.068,1.3,1.067a5.758,5.758,0,0,0,1.364-.237,5.774,5.774,0,0,1,1.363-.237q1.778,0,1.777,2.015,0,1.956-2.371,1.956a27.327,27.327,0,0,1-3.082-.356,20.033,20.033,0,0,0-2.9-.178,22.709,22.709,0,0,0-3.32.237,21.62,21.62,0,0,1-2.964.3q-2.491,0-2.49-2.015a1.676,1.676,0,0,1,1.9-1.9,6.223,6.223,0,0,1,1.1.178,7.229,7.229,0,0,0,1.571.178q1.6,0,1.837-2.667,0,.238.06-2.964t.06-4.327V24.887q0-3.437-.179-5.75t-1.778-2.312A10.723,10.723,0,0,0,567.46,17a2.514,2.514,0,0,1-.888.119q-2.195,0-2.193-1.956,0-1.9,2.608-1.9a2.856,2.856,0,0,1,.652.059l2.845.3a9.415,9.415,0,0,0,1.333-.148,9.6,9.6,0,0,1,1.393-.148q1.6,0,1.6,1.778\",\n transform: \"translate(-86.452 -1.888)\"\n}), /*#__PURE__*/React.createElement(\"path\", {\n className: \"c\",\n d: \"M620.654,47.224l1.423-3.439a13.2,13.2,0,0,1-5.039-1.777q-6.461-4.21-6.461-13.635,0-7.29,3.852-11.706a12.868,12.868,0,0,1,10.2-4.417,11.847,11.847,0,0,1,7.826,2.608,8.139,8.139,0,0,1,3.142,6.521,5.34,5.34,0,0,1-1.216,3.646,3.941,3.941,0,0,1-3.111,1.394,3.547,3.547,0,0,1-2.431-.889,2.812,2.812,0,0,1-1.007-2.193q0-2.37,2.964-2.728a4.026,4.026,0,0,0-1.008-2.489,7.13,7.13,0,0,0-5.276-1.957,7.888,7.888,0,0,0-6.639,3.32,14.369,14.369,0,0,0-2.49,8.833q0,5.395,2.4,8.536a7.742,7.742,0,0,0,6.492,3.142,7.219,7.219,0,0,0,4.534-1.482,7.432,7.432,0,0,0,2.638-4.032q.474-1.835.624-2.223a1.432,1.432,0,0,1,.444-.622,1.966,1.966,0,0,1,1.482-.711,2.23,2.23,0,0,1,2.312,2.311,9.089,9.089,0,0,1-.918,3.557,11.882,11.882,0,0,1-2.223,3.437,12.972,12.972,0,0,1-8.18,3.676l-.771,1.838a7.934,7.934,0,0,1,1.542-.178,5.242,5.242,0,0,1,3.586,1.333,4.1,4.1,0,0,1,1.511,3.171,4.172,4.172,0,0,1-1.9,3.469,7.7,7.7,0,0,1-4.683,1.393,8.675,8.675,0,0,1-4.328-1.067q-1.9-1.067-1.9-2.371,0-1.423,1.365-1.424.533,0,1.659,1.126a4.171,4.171,0,0,0,3.083,1.127,3.584,3.584,0,0,0,2.223-.652,1.955,1.955,0,0,0,.86-1.6q0-2.074-2.668-2.075a11.6,11.6,0,0,0-2.845.712,2.092,2.092,0,0,1-.653.119c-.473,0-.711-.218-.711-.652a3.255,3.255,0,0,1,.3-.948\",\n transform: \"translate(-93.529 -1.877)\"\n}), /*#__PURE__*/React.createElement(\"path\", {\n className: \"c\",\n d: \"M677.774,34.609l-.059,3.379q-.119,5.689-6.045,5.691-4.862,0-6.046-4.209-2.965,4.446-9.424,4.446a11.718,11.718,0,0,1-7.647-2.372,7.766,7.766,0,0,1-2.9-6.342,7.768,7.768,0,0,1,4.21-7.232,21.362,21.362,0,0,1,7.409-1.838q4.8-.535,6.1-1.246a3.761,3.761,0,0,0,1.838-3.615A4.548,4.548,0,0,0,662.955,17a7.994,7.994,0,0,0-4.09-1.067,9.182,9.182,0,0,0-4,.919q-1.927.92-1.926,1.867c0,.119.2.317.594.592a2.243,2.243,0,0,1,.83,1.957,2.473,2.473,0,0,1-.89,1.955,3.226,3.226,0,0,1-2.193.771,3.45,3.45,0,0,1-2.578-1.066,3.6,3.6,0,0,1-1.037-2.608q0-3.32,3.29-5.662a13.387,13.387,0,0,1,7.972-2.341q5.571,0,8.536,3.082,2.312,2.372,2.312,7.232V34.609q0,3.794.563,4.624a1.741,1.741,0,0,0,1.512.829q2.134,0,2.134-3.793v-2.9a1.676,1.676,0,0,1,1.9-1.9q1.9,0,1.9,2.844Zm-12.685-2.727.059-4.21q-1.955,1.956-8,2.549-6.7.654-6.7,4.861a4.373,4.373,0,0,0,1.631,3.617A6.875,6.875,0,0,0,656.5,40a8.719,8.719,0,0,0,6.253-2.164,8,8,0,0,0,2.34-5.957\",\n transform: \"translate(-98.901 -1.888)\"\n}), /*#__PURE__*/React.createElement(\"path\", {\n className: \"c\",\n d: \"M319.9,22.079V44.012h-2.1V41.725a7.851,7.851,0,0,1-5.828,2.6,7.408,7.408,0,0,1-5.577-2.35,8.228,8.228,0,0,1-2.225-5.8,8.1,8.1,0,0,1,2.225-5.766,7.327,7.327,0,0,1,5.577-2.38,7.573,7.573,0,0,1,5.828,2.6V22.079Zm-13.662,14.1a6.036,6.036,0,0,0,1.88,4.481,6.435,6.435,0,0,0,9.682-.753V32.419a6.424,6.424,0,0,0-11.562,3.76\",\n transform: \"translate(-46.593 -3.382)\"\n}), /*#__PURE__*/React.createElement(\"path\", {\n className: \"a\",\n d: \"M319.9,22.079V44.012h-2.1V41.725a7.851,7.851,0,0,1-5.828,2.6,7.408,7.408,0,0,1-5.577-2.35,8.228,8.228,0,0,1-2.225-5.8,8.1,8.1,0,0,1,2.225-5.766,7.327,7.327,0,0,1,5.577-2.38,7.573,7.573,0,0,1,5.828,2.6V22.079Zm-13.662,14.1a6.036,6.036,0,0,0,1.88,4.481,6.435,6.435,0,0,0,9.682-.753V32.419a6.424,6.424,0,0,0-11.562,3.76Z\",\n transform: \"translate(-46.593 -3.382)\"\n}), /*#__PURE__*/React.createElement(\"path\", {\n className: \"c\",\n d: \"M343.085,37.254v.69H329.11a5.952,5.952,0,0,0,1.943,4.2,6.165,6.165,0,0,0,4.325,1.692,7.306,7.306,0,0,0,5.327-2.162l1.159,1.034A9.254,9.254,0,0,1,335.22,45.4a8.13,8.13,0,0,1-8.147-8.147,8.021,8.021,0,0,1,2.319-5.765,7.623,7.623,0,0,1,5.671-2.381,7.711,7.711,0,0,1,8.022,8.146m-12.22-4.794a6.132,6.132,0,0,0-1.755,4.387h11.97c0-3.447-2.256-6.2-5.984-6.2a5.7,5.7,0,0,0-4.231,1.817\",\n transform: \"translate(-50.101 -4.459)\"\n}), /*#__PURE__*/React.createElement(\"path\", {\n className: \"a\",\n d: \"M343.085,37.254v.69H329.11a5.952,5.952,0,0,0,1.943,4.2,6.165,6.165,0,0,0,4.325,1.692,7.306,7.306,0,0,0,5.327-2.162l1.159,1.034A9.254,9.254,0,0,1,335.22,45.4a8.13,8.13,0,0,1-8.147-8.147,8.021,8.021,0,0,1,2.319-5.765,7.623,7.623,0,0,1,5.671-2.381A7.711,7.711,0,0,1,343.085,37.254Zm-12.22-4.794a6.132,6.132,0,0,0-1.755,4.387h11.97c0-3.447-2.256-6.2-5.984-6.2A5.7,5.7,0,0,0,330.864,32.461Z\",\n transform: \"translate(-50.101 -4.459)\"\n})));\n\nfunction SvgLogoCuidadorInline(_ref, svgRef) {\n var title = _ref.title,\n titleId = _ref.titleId,\n props = _objectWithoutProperties(_ref, [\"title\", \"titleId\"]);\n\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n xmlns: \"http://www.w3.org/2000/svg\",\n xmlnsXlink: \"http://www.w3.org/1999/xlink\",\n width: 578.875,\n height: 53.053,\n viewBox: \"0 0 578.875 53.053\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, _ref2, _ref3);\n}\n\nvar ForwardRef = /*#__PURE__*/React.forwardRef(SvgLogoCuidadorInline);\nexport default __webpack_public_path__ + \"static/media/logo-cuidador-inline.b16aae05.svg\";\nexport { ForwardRef as ReactComponent };","import styled from 'styled-components';\nimport { Typography } from '@material-ui/core';\nimport { Favorite } from '@material-ui/icons';\nimport { ReactComponent as LogoInline } from '../../assets/logo-cuidador-inline.svg';\n\nexport const Container = styled.div`\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: flex-end;\n height: 100%;\n`;\n\nexport const Text = styled(Typography)`\n color: ${({ theme }) => theme.palette.common.white};\n display: flex;\n align-items: center;\n justify-content: center;\n font-size: 14px;\n flex-wrap: wrap;\n left: 0;\n width: 100%;\n`;\n\nexport const StyledFavorite = styled(Favorite)`\n margin-inline: 5px;\n height: 15px;\n width: 15px;\n`;\n\nexport const StyledLogoInline = styled(LogoInline)`\n margin-top: 2.5px;\n margin-inline: 5px;\n height: 15px;\n width: auto;\n`;\n","import React from 'react';\nimport { clientSideScheme } from '@cuidador/whitelabel';\nimport { Text, StyledFavorite, StyledLogoInline, Container } from './styles';\n\nconst MadeBy: React.FC = () => {\n const { schemeId } = clientSideScheme();\n\n if (schemeId === 'default') return null;\n\n return (\n \n \n Feito com por \n \n \n );\n};\n\nexport default MadeBy;\n","export default __webpack_public_path__ + \"static/media/senior-background.2e80d736.png\";","import styled from 'styled-components';\n\nimport TextField from '../../components/StyledTextField';\nimport BackgroundImage from '../../assets/senior-background.png';\n\nexport const Background = styled.div`\n height: 100%;\n min-height: 100vh;\n width: 100vw;\n background-image: ${`url(${BackgroundImage})`};\n background-size: cover;\n background-position: center;\n padding: 0px ${({ theme }) => theme.spacing(2)}px;\n display: flex;\n justify-content: center;\n align-items: center;\n opacity: 0.13;\n`;\n\nexport const Container = styled.div`\n display: flex;\n flex-direction: column;\n align-items: center;\n height: 80%;\n max-width: 500px;\n color: white;\n padding: 0px ${({ theme }) => theme.spacing(2)}px;\n\n z-index: 10;\n\n img {\n width: 100%;\n margin-bottom: ${({ theme }) => theme.spacing(6)}px;\n }\n\n form {\n display: flex;\n flex-direction: column;\n align-items: center;\n max-width: 100%;\n text-align: center;\n justify-content: center;\n align-items: center;\n\n .MuiButton-root {\n margin-top: ${({ theme }) => theme.spacing(4)}px;\n margin-bottom: ${({ theme }) => theme.spacing(2)}px;\n }\n }\n\n a {\n font-size: 14px;\n color: white;\n margin-bottom: ${({ theme }) => theme.spacing(6)}px;\n }\n\n @media (max-height: 675px) {\n form {\n .MuiButton-root {\n margin-top: ${({ theme }) => theme.spacing(2)}px;\n }\n }\n\n a {\n margin-bottom: ${({ theme }) => theme.spacing(2)}px;\n }\n\n img {\n max-height: 95px;\n margin-bottom: ${({ theme }) => theme.spacing(2)}px;\n }\n\n p:last-child {\n position: inherit;\n }\n }\n`;\n\nexport const BackgroundOverlay = styled.section`\n height: 100vh;\n background: linear-gradient(\n 180deg,\n ${(props) => props.theme.palette.primary.main} 0%,\n ${(props) => props.theme.palette.secondary.main} 100%\n );\n display: flex;\n justify-content: center;\n position: absolute;\n z-index: 9;\n`;\n\nexport const OutterContainer = styled.div`\n height: 100vh;\n width: 100%;\n display: flex;\n justify-content: center;\n align-items: center;\n\n @media (max-height: 675px) {\n form {\n .MuiButton-root {\n margin-top: ${({ theme }) => theme.spacing(2)}px;\n }\n }\n\n a {\n margin-bottom: ${({ theme }) => theme.spacing(2)}px;\n }\n\n img {\n max-height: 95px;\n margin-bottom: ${({ theme }) => theme.spacing(2)}px;\n }\n\n p:last-child {\n position: inherit;\n }\n\n section {\n height: 200%;\n }\n\n section > div {\n height: 100%;\n }\n }\n`;\n\nexport const StyledTextField = styled(TextField).attrs({ variant: 'outlined' })`\n & label:not(.Mui-error) {\n color: ${({ theme }) => theme.palette.common.white};\n }\n & input:not(.Mui-disabled) {\n color: ${({ theme }) => theme.palette.common.white};\n }\n & input {\n color: ${({ theme }) => theme.palette.common.white};\n }\n & textarea {\n color: ${({ theme }) => theme.palette.common.white};\n }\n & .MuiInputAdornment-root .MuiIconButton-label {\n color: ${({ theme }) => theme.palette.common.white};\n }\n & .MuiOutlinedInput-root:not(.Mui-error) {\n & fieldset {\n border-color: ${({ theme }) => theme.palette.common.white};\n color: ${({ theme }) => theme.palette.common.white};\n }\n &:hover fieldset {\n border-color: ${({ theme }) => theme.palette.common.white};\n color: ${({ theme }) => theme.palette.common.white};\n }\n &.Mui-focused fieldset {\n border-color: ${({ theme }) => theme.palette.common.white};\n color: ${({ theme }) => theme.palette.common.white};\n }\n }\n & svg {\n color: ${({ theme }) => theme.palette.common.white};\n }\n`;\n\nexport const TypographyContainer = styled.div`\n max-width: 100%;\n text-align: center;\n`;\n","import * as yup from 'yup';\nimport { validateCpf } from '../../utils/inputs'\n\nexport const validationSchema = yup.object().shape({\n cpf: yup.string().required('CPF é obrigatório')\n .test('isCpfValid', 'Por favor, insira um CPF válido', (value) =>\n validateCpf(value || '')\n ),\n password: yup\n .string()\n .min(8, 'A senha deve conter pelo menos 8 caracteres')\n .required('Senha é obrigatória'),\n});\n\nexport const formInitialValues = {\n cpf: '',\n password: '',\n};\n\nexport interface FormValues {\n cpf: string;\n password: string;\n}\n","import { clientSideScheme } from '@cuidador/whitelabel';\nimport IconButton from '@material-ui/core/IconButton';\nimport InputAdornment from '@material-ui/core/InputAdornment';\nimport Typography from '@material-ui/core/Typography';\nimport Visibility from '@material-ui/icons/Visibility';\nimport VisibilityOff from '@material-ui/icons/VisibilityOff';\nimport { Form, Formik, FormikHelpers, FormikProps } from 'formik';\nimport React, { useContext, useEffect, useRef, useState } from 'react';\nimport { Link, useHistory } from 'react-router-dom';\nimport { toast } from 'react-toastify';\nimport ButtonLink from '../../components/ButtonLink';\nimport LoadingBackdrop from '../../components/LoadingBackdrop';\nimport MadeBy from '../../components/MadeBy';\nimport Button from '../../components/StyledButton';\nimport { AuthContext } from '../../contexts/auth';\nimport { resolveErrorMessage } from '../../utils/error';\nimport { cpfMask, nonAlphanumericString } from '../../utils/inputs';\nimport {\n Background,\n Container,\n OutterContainer,\n StyledTextField,\n TypographyContainer,\n BackgroundOverlay,\n} from './styles';\nimport { formInitialValues, FormValues, validationSchema } from './utils';\n\nconst Login: React.FC = () => {\n const { logoLightUrl } = clientSideScheme();\n const [showPassword, setShowPassword] = useState(false);\n const history = useHistory();\n const formikRef = useRef | null>();\n\n const { signIn, error, loading } = useContext(AuthContext);\n\n useEffect(() => {\n if (error) {\n if (error.response?.data.message === 'Wrong credentials') {\n toast.dismiss();\n toast.error(\n 'Identificação e/ou senha não reconhecidos. Se você for cuidador, verifique se o link está correto.'\n );\n } else {\n toast.error(resolveErrorMessage(error));\n }\n }\n }, [error]);\n\n const handleSubmit = (\n values: FormValues,\n { setSubmitting }: FormikHelpers\n ) => {\n const formattedCpf = nonAlphanumericString(values.cpf);\n setSubmitting(true);\n signIn(formattedCpf, values.password).then(() =>\n history.replace('/gestao/pacientes')\n );\n };\n\n const handleShowPassword = () => setShowPassword(!showPassword);\n\n return (\n \n \n \n \n \n Insira as informações para acessar sua conta!\n \n (formikRef.current = ref)}\n initialValues={formInitialValues}\n validationSchema={validationSchema}\n onSubmit={handleSubmit}\n >\n {(formik) => (\n
\n \n \n \n {showPassword ? : }\n \n \n ),\n }}\n />\n \n Entrar\n \n \n )}\n \n Esqueci minha senha\n \n Quero me Cadastrar\n \n \n
\n \n \n \n
\n );\n};\n\nexport default Login;\n","import { Typography } from '@material-ui/core';\nimport { Link } from 'react-router-dom';\nimport styled from 'styled-components';\nimport StyledPaper from '../StyledPaper';\n\nexport const StyledLink = styled(Link)`\n text-decoration: none;\n display: flex;\n width: 100%;\n flex-direction: column;\n color: ${({ theme }) => theme.palette.extra.color.grey.dark};\n`;\n\nexport const BoldTypography = styled(Typography)`\n font-weight: bold;\n`;\n\nexport const CardBox = styled(StyledPaper)`\n margin: ${({ theme }) => theme.spacing(2, 2, 2, 2)};\n display: flex;\n align-items: baseline;\n justify-content: space-between;\n`;\n\nexport const TitleBox = styled.div`\n display: flex;\n width: 100%;\n justify-content: space-between;\n border-bottom: 2px solid ${({ theme }) => theme.palette.extra.color.grey.main};\n padding-bottom: ${({ theme }) => theme.spacing(1)}px;\n`;\n\nexport const MeasurementBox = styled.div`\n padding-top: ${({ theme }) => theme.spacing(1)}px;\n border-bottom: 2px solid ${({ theme }) => theme.palette.extra.color.grey.main};\n`;\n\nexport const StyledUl = styled.ul`\n margin-top: ${({ theme }) => theme.spacing(0.5)}px;\n line-height: 1.5;\n`;\n\nexport const DetailsBox = styled.div`\n padding-top: ${({ theme }) => theme.spacing(1)}px;\n\n & p:nth-child(-n + 3) {\n line-height: 2;\n }\n & p {\n line-height: 1.75;\n }\n`;\n","import { EventScheduleModel } from '@cuidador/database';\nimport { Typography } from '@material-ui/core';\nimport { format, subMinutes } from 'date-fns';\nimport React from 'react';\nimport { getLocalWeeklySchedule, weekdayMap } from '../../utils/date';\n\nexport const getDaysText = (eventSchedule: EventScheduleModel) => {\n const { mon, tue, wed, thu, fri, sat, sun } = eventSchedule;\n const areAllDaysSelected = mon && tue && wed && thu && fri && sat && sun;\n const areAllWeekDaysSelected = mon && tue && wed && thu && fri;\n const areSomeDaysSelected = !areAllDaysSelected || !areAllWeekDaysSelected;\n\n if (eventSchedule?.frequencyRule === '1d') {\n if (areAllDaysSelected) {\n return 'Todos os dias';\n } else if (areAllWeekDaysSelected) {\n return 'Segunda a Sexta';\n } else if (areSomeDaysSelected) {\n return `Apenas alguns dias (${getSelectedWeekdaysText(eventSchedule)})`;\n }\n } else {\n const frequencyTimeString = eventSchedule?.frequencyRule?.replace(/.$/, '');\n return `A cada ${frequencyTimeString} dias`;\n }\n};\n\nconst getSelectedWeekdaysText = (eventSchedule: EventScheduleModel) => {\n const { mon, tue, wed, thu, fri, sat, sun } = eventSchedule;\n const utcSchedule = { mon, tue, wed, thu, fri, sat, sun };\n const date = new Date(eventSchedule.frequencyStartsAt || '');\n const utcTime = `${date\n .getUTCHours()\n .toString()\n .padStart(2, '0')}:${date.getUTCMinutes().toString().padStart(2, '0')}`;\n const localSchedule = getLocalWeeklySchedule(utcSchedule, utcTime);\n\n const selectedWeekDays: string[] = [];\n if (localSchedule.mon) selectedWeekDays.push(weekdayMap.mon);\n if (localSchedule.tue) selectedWeekDays.push(weekdayMap.tue);\n if (localSchedule.wed) selectedWeekDays.push(weekdayMap.wed);\n if (localSchedule.thu) selectedWeekDays.push(weekdayMap.thu);\n if (localSchedule.fri) selectedWeekDays.push(weekdayMap.fri);\n if (localSchedule.sat) selectedWeekDays.push(weekdayMap.sat);\n if (localSchedule.sun) selectedWeekDays.push(weekdayMap.sun);\n\n return selectedWeekDays.reduce(\n (accumulatorString, weekday, index) =>\n `${accumulatorString}${index > 0 ? ', ' : ''}${weekday.toLowerCase()}`,\n ''\n );\n};\n\nexport const getIntervalText = (eventSchedule: EventScheduleModel) => {\n const startDate = eventSchedule.frequencyStartsAt;\n const endDate = eventSchedule.frequencyEndsAt;\n\n if (startDate && endDate) {\n const formatedStartDate = format(new Date(startDate), 'dd/MM/yyyy');\n const formatedEndDate = format(new Date(endDate), 'dd/MM/yyyy');\n return `De ${formatedStartDate} até ${formatedEndDate}`;\n } else if (startDate) {\n const formatedStartDate = format(new Date(startDate), 'dd/MM/yyyy');\n return `Continuamente, com início em ${formatedStartDate}`;\n }\n};\n\nexport const getTimes = (eventSchedule: EventScheduleModel) => {\n if (eventSchedule.customTimes && eventSchedule.customTimes.length > 0) {\n return renderCustomTimes(eventSchedule);\n } else {\n return renderTimes(eventSchedule);\n }\n};\n\nconst renderCustomTimes = (eventSchedule: EventScheduleModel) => {\n const times = eventSchedule?.customTimes?.map((time) => {\n const now = new Date();\n const hours = Number(time.happensAt!.split(':')[0]);\n const minutes = Number(time.happensAt!.split(':')[1]);\n now.setHours(hours);\n now.setMinutes(minutes);\n return format(subMinutes(now, now.getTimezoneOffset()), 'HH:mm');\n });\n return renderTimesBox(times);\n};\n\nconst renderTimes = (eventSchedule: EventScheduleModel) => {\n const handleDoses = (startTime: string, frequency: string) => {\n const formattedFrequency = Number(frequency.replace('h', ''));\n const hour = startTime.split(':');\n const formattedHour = Number(hour[0]);\n\n const doses = [];\n for (let x = formattedHour; x >= 0; x -= formattedFrequency) {\n doses.push(x);\n }\n for (let x = formattedHour; x <= 23; x += formattedFrequency) {\n if (x != formattedHour) {\n doses.push(x);\n }\n }\n doses.sort((a, b) => a - b);\n\n const formattedDoses = doses.map((item) => {\n return item.toString().padStart(2, '0') + ':' + hour[1];\n });\n\n return formattedDoses;\n };\n\n if (!eventSchedule?.frequencyRule || !eventSchedule.frequencyStartsAt)\n return null;\n\n const startTime = format(new Date(eventSchedule.frequencyStartsAt), 'HH:mm');\n const doseTimes = handleDoses(startTime, eventSchedule.frequencyRule);\n\n return renderTimesBox(doseTimes);\n};\n\nconst renderTimesBox = (times?: string[]) => {\n return (\n <>\n {times?.map((time, index) => (\n \n {index + 1}ª medição: {time}\n \n ))}\n \n );\n};\n","import { EventScheduleModel } from '@cuidador/database';\nimport { Typography } from '@material-ui/core';\nimport EditIcon from '@material-ui/icons/Edit';\nimport React from 'react';\nimport { Item } from '../../utils/store';\nimport {\n BoldTypography,\n CardBox,\n DetailsBox,\n MeasurementBox,\n StyledLink,\n StyledUl,\n TitleBox,\n} from './styles';\nimport { getDaysText, getIntervalText, getTimes } from './utils';\n\nconst MeasurementCard: React.FC<{\n eventSchedule: Item;\n}> = ({ eventSchedule }) => {\n return (\n \n \n \n \n Controles e Sinais Vitais\n \n \n \n \n \n Medição(ões) agendada(s):\n \n \n {eventSchedule?.subCategory?.map((subCategory) => (\n
  • {subCategory.name}
  • \n ))}\n
    \n
    \n \n \n Detalhes do agendamento:\n \n {getDaysText(eventSchedule)}\n \n {getIntervalText(eventSchedule)}\n \n {getTimes(eventSchedule)}\n \n
    \n
    \n );\n};\n\nexport default MeasurementCard;\n","import {\n Backdrop as MaterialBackdrop,\n CircularProgress as MaterialCircularProgress,\n Typography,\n} from '@material-ui/core';\nimport styled from 'styled-components';\n\nexport const Container = styled.div``;\n\nexport const Backdrop = styled(MaterialBackdrop)`\n z-index: ${({ theme }) => theme.zIndex.drawer + 1};\n color: ${({ theme }) => theme.palette.primary.light};\n position: absolute;\n`;\n\nexport const BackdropCircularProgress = styled(MaterialCircularProgress).attrs({\n color: 'inherit',\n})``;\n\nexport const TypographyContainer = styled.div`\n width: 100%;\n text-align: center;\n color: ${({ theme }) => theme.palette.primary.main};\n margin-top: ${({ theme }) => theme.spacing(2)}px;\n`;\n\nexport const StyledTypography = styled(Typography)`\n color: ${({ theme }) => theme.palette.primary.dark};\n`;\n\nexport const ReportContainer = styled.div`\n text-align: center;\n color: ${({ theme }) => theme.palette.primary.main};\n padding: ${({ theme }) => theme.spacing(2, 2)};\n`;\n","import { AddRounded } from '@material-ui/icons'\nimport React, { useContext, useEffect, useState } from 'react'\nimport { useHistory } from 'react-router-dom'\nimport { toast } from 'react-toastify'\nimport Fab from '../../../components/Fab'\nimport MeasurementScheduleCard from '../../../components/MeasurementScheduleCard'\nimport ReportDownloadButton from '../../../components/ReportDownloadButton'\nimport { AuthContext } from '../../../contexts/auth'\nimport useCanAccess from '../../../hooks/useCanAccess'\nimport useMeasurementSchedule from '../../../hooks/useMeasurementSchedule'\nimport {\n Backdrop,\n BackdropCircularProgress,\n Container,\n ReportContainer,\n StyledTypography,\n TypographyContainer,\n} from './styles'\nimport { Header } from '../../../components/Header'\nimport { BackButton } from '../../../components/BackButton'\nimport { PageTitle } from '../../../components/PageTitle'\nimport { PscButton } from '../../../components/PscButton'\n\nconst MeasurementScheduleList: React.FC = () => {\n const history = useHistory()\n const { userInfo } = useContext(AuthContext)\n const [downloadLink, setDownloadLink] = useState('')\n const patientId = userInfo?.activePatientId\n\n const {\n loading,\n getAllByPatientId,\n ids: measurementScheduleIds,\n byId,\n createReportByPatientId,\n getReportDownloadLinkByPatientId,\n } = useMeasurementSchedule()\n\n useEffect(() => {\n getMeasurementsByPatient()\n }, [patientId])\n\n const getMeasurementsByPatient = () => {\n if (patientId) {\n getAllByPatientId(patientId)\n }\n }\n\n const { isAllowedToCreate } = useCanAccess('care/event/schedule')\n const { isAllowedToCreate: isAllowedToCreateReport } = useCanAccess('report/measurement')\n const { isAllowedToRead: isAllowedToReadReport } = useCanAccess('media/patient/report/measurement')\n const handleCreateReportAndGetDownloadLink = async () => {\n createMeasurementReport()\n .then(() => getMeasurementReportDownloadUrl())\n .then((signedUrl) => setDownloadLink(signedUrl))\n }\n\n const createMeasurementReport = async () => {\n try {\n await createReportByPatientId(Number(userInfo?.activePatientId))\n toast.success('Relátorio de controles gerado com sucesso')\n } catch (err) {\n toast.error('Erro ao gerar relatório de controles')\n }\n }\n\n const getMeasurementReportDownloadUrl = async (): Promise => {\n try {\n const { signedUrl } = await getReportDownloadLinkByPatientId(Number(userInfo?.activePatientId))\n return signedUrl\n } catch (err) {\n toast.error('Erro ao baixar relatório de controles')\n return ''\n }\n }\n\n return (\n <>\n history.push('/cadastros')} />\n }\n centerContent={\n \n }\n rightContent={\n \n }\n />\n {loading ? (\n \n \n \n ) : (\n <>\n \n {measurementScheduleIds.length <= 0 ? (\n \n \n Ainda não há agendamento de controles cadastrados.\n \n \n ) : (\n <>\n {isAllowedToReadReport && isAllowedToCreateReport && (\n \n \n \n )}\n {measurementScheduleIds\n .map((id) => byId[id])\n .map((measurementSchedule) => (\n \n ))}\n \n )}\n \n {isAllowedToCreate && (\n \n \n \n )}\n \n )}\n \n )\n}\n\nexport default MeasurementScheduleList\n","import { Field } from 'formik';\nimport styled from 'styled-components';\n\nexport const StyledRow = styled.div`\n width: 90%;\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n align-items: center;\n margin: 16px 5% 0 5%;\n`;\n\nexport const StyledField = styled(Field)`\n display: none;\n`;\n\ntype StyledSpanProps = {\n checked?: boolean;\n};\n\nexport const StyledSpan = styled.span`\n display: inline-block;\n border: 2px solid ${({ theme }) => theme.palette.secondary.main};\n border-radius: 50%;\n background: ${({ checked, theme }) =>\n checked ? theme.palette.secondary.main : 'white'};\n width: 24px;\n height: 24px;\n line-height: 24px;\n text-align: center;\n vertical-align: middle;\n color: ${({ checked, theme }) =>\n checked ? 'white' : theme.palette.secondary.main};\n`;\n","import styled from 'styled-components';\nimport { FormHelperText } from '@material-ui/core';\n\nexport const StyledFormHelperText = styled(FormHelperText)`\n margin-left: ${({ theme }) => theme.spacing(2)}px;\n`;\n","import React from 'react';\nimport { useFormikContext } from 'formik';\nimport { StyledField, StyledRow, StyledSpan } from '../StyledWeekDaySelect';\nimport { weekdayMap } from '../../utils/date';\nimport { StyledFormHelperText } from './styles';\n\ntype FormikWeekDaySelectProps = {\n name: string;\n};\n\nexport default function FormikWeekDaySelect({\n name,\n}: FormikWeekDaySelectProps) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const { errors, values, touched } = useFormikContext();\n\n return (\n <>\n \n {Object.entries(weekdayMap).map(([key, ptBrWeekDayName]) => (\n \n ))}\n \n {touched[name] && errors[name] && (\n {errors[name]}\n )}\n \n );\n}\n","import styled from 'styled-components';\n\nexport const Container = styled.div`\n display: flex;\n flex-direction: row;\n align-items: center;\n\n svg {\n color: ${({ theme }) => theme.palette.extra.color.red.main};\n font-size: ${({ theme }) => theme.typography.fontSize}px;\n margin-right: 0.3rem;\n }\n`;\n\nexport const StyledSpan = styled.span`\n color: ${({ theme }) => theme.palette.extra.color.red.main};\n font-size: ${({ theme }) => theme.typography.fontSize}px;\n`;\n","import { Radio, RadioGroup } from '@material-ui/core';\nimport { FormikErrors } from 'formik';\nimport React, { useEffect } from 'react';\nimport { FormValues } from '..';\nimport {\n FormCardContainer,\n NewStyledSelect as StyledSelect,\n StyledBoldTitle,\n StyledFormikTextField as FormikTextField,\n} from '../../FormCardContainer';\nimport FormikWeekDaySelect from '../../Forms/FormikWeekDaySelect';\nimport StyledFormControlLabel from '../../StyledFormControlLabel';\nimport StyledMenuItem from '../../StyledMenuItem';\nimport ErrorText from '../ErrorText';\n\nexport enum FrequencyType {\n EveryDay = 'Todos os dias',\n MondayToFriday = 'Segunda a sexta',\n SomeDays = 'Alguns dias da semana',\n Custom = 'Intervalos fixos',\n}\n\nexport const EVERYDAY = ['Seg', 'Ter', 'Qua', 'Qui', 'Sex', 'Sab', 'Dom'];\nexport const MONDAY_TO_FRIDAY = ['Seg', 'Ter', 'Qua', 'Qui', 'Sex'];\n\nexport const frequencyTimeOptions = [\n { value: '2d', label: 'A cada 2 dias' },\n { value: '3d', label: 'A cada 3 dias' },\n { value: '5d', label: 'A cada 5 dias' },\n { value: '7d', label: 'A cada 7 dias' },\n { value: '15d', label: 'A cada 15 dias' },\n { value: '30d', label: 'A cada 30 dias' },\n { value: 'custom', label: 'Incluir novo intervalo' },\n];\n\ninterface DaysSelectorProps {\n values: FormValues;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n setFieldValue: (field: string, value: any) => void;\n errors: FormikErrors;\n disabled?: boolean;\n}\n\nconst DaysSelector: React.FC = ({\n values,\n setFieldValue,\n errors,\n disabled,\n}) => {\n const handleSelectedCustomIntervalChange = (\n e: React.ChangeEvent\n ) => {\n switch (e.target.value as FrequencyType) {\n case FrequencyType.EveryDay:\n setFieldValue('dayOptions', FrequencyType.EveryDay);\n setFieldValue('days', EVERYDAY);\n break;\n case FrequencyType.MondayToFriday:\n setFieldValue('dayOptions', FrequencyType.MondayToFriday);\n setFieldValue('days', MONDAY_TO_FRIDAY);\n break;\n case FrequencyType.SomeDays:\n setFieldValue('dayOptions', FrequencyType.SomeDays);\n setFieldValue('days', []);\n break;\n case FrequencyType.Custom:\n setFieldValue('dayOptions', FrequencyType.Custom);\n setFieldValue('days', []);\n break;\n default:\n setFieldValue('dayOptions', FrequencyType.EveryDay);\n setFieldValue('days', EVERYDAY);\n break;\n }\n };\n\n const handleSelectedDaysChange = () => {\n if (!values.days) return;\n const isEveryDay =\n values.days.length === 7 &&\n values.days.every((day) => EVERYDAY.includes(day));\n\n const isMondayToFriday =\n values.days.length === 5 &&\n values.days.every((day) => MONDAY_TO_FRIDAY.includes(day));\n\n const isSomeDays = !isEveryDay && !isMondayToFriday;\n\n if (values.dayOptions !== FrequencyType.Custom) {\n if (isEveryDay) setFieldValue('dayOptions', FrequencyType.EveryDay);\n if (isMondayToFriday)\n setFieldValue('dayOptions', FrequencyType.MondayToFriday);\n if (isSomeDays) setFieldValue('dayOptions', FrequencyType.SomeDays);\n }\n };\n\n useEffect(() => {\n handleSelectedDaysChange();\n }, [values.days]);\n\n return (\n \n Dias\n \n {Object.values(FrequencyType).map((label, index) => (\n }\n label={label}\n disabled={disabled}\n />\n ))}\n \n {values.dayOptions === FrequencyType.Custom ? (\n <>\n \n {frequencyTimeOptions.map((frequencyOption, index) => (\n \n {frequencyOption.label}\n \n ))}\n \n {errors.rangeInDays && (\n \n )}\n {values.rangeInDays === 'custom' && (\n <>\n \n {errors.customRangeInDays && (\n \n )}\n \n )}\n \n ) : (\n \n )}\n \n );\n};\n\nexport default DaysSelector;\n","import React from 'react';\nimport { ErrorOutline } from '@material-ui/icons';\nimport { Container, StyledSpan } from './styles';\n\ninterface ErrorTextProps {\n errorMessage: string;\n}\n\nconst ErrorText: React.FC = ({ errorMessage }) => {\n return (\n \n {errorMessage && (\n <>\n \n {errorMessage}\n \n )}\n \n );\n};\n\nexport default ErrorText;\n","import styled from 'styled-components';\n\nexport const Container = styled.section`\n display: flex;\n flex-direction: column;\n justify-content: center;\n margin: ${({ theme }) => theme.spacing(2)}px;\n`;\n\nexport const StyledSpan = styled.span`\n color: ${({ theme }) => theme.palette.extra.color.grey.dark};\n font-weight: 700;\n text-align: center;\n margin-block: ${({ theme }) => theme.spacing(2)}px;\n`;\n","import React from 'react';\nimport { Container, StyledSpan } from './styles';\n\nconst InformativeText: React.FC = () => {\n return (\n \n \n Você pode agendar um ou mais controles e sinais vitais agrupados por\n horário.\n \n \n Comece escolhendo os horários e frequências para a realização das\n medições.\n \n \n );\n};\n\nexport default InformativeText;\n","import { EventScheduleModel } from '@cuidador/database';\nimport { useCallback, useReducer } from 'react';\nimport axios from '../config/axios';\nimport { createReducer, Item, ReducerData } from '../utils/store/index';\n\nconst endpoint = '/care/event';\n\nconst initialData: ReducerData = {\n byId: {} as Record>,\n ids: [] as Array,\n total: 0,\n loading: false,\n error: null,\n};\n\nexport interface MeasurementScheduleModelDTO extends EventScheduleModel {\n eventDescription?: {\n subCategoryId: string | number;\n description: string;\n }[];\n}\n\nconst useMeasurement = () => {\n const [state, dispatch] = useReducer(\n createReducer(),\n initialData\n );\n\n const getAllByPatientId = useCallback(async () => {\n try {\n dispatch({ type: 'LOADING' });\n const response = await axios.get(\n `${endpoint}/category/sub?categoryId=4&orderBy=eventSubCategory.name&order=asc`\n );\n dispatch({ type: 'GET_ALL', payload: response.data });\n } catch (err) {\n dispatch({ type: 'ERROR', payload: err });\n }\n }, []);\n\n const post = useCallback(async (data: MeasurementScheduleModelDTO) => {\n try {\n dispatch({ type: 'LOADING' });\n const response = await axios.post(`${endpoint}/schedule`, data);\n dispatch({ type: 'CREATE', payload: response.data });\n } catch (err) {\n dispatch({ type: 'ERROR', payload: err });\n return Promise.reject(err);\n }\n }, []);\n\n const patch = useCallback(\n async (id: Id, data: Partial) => {\n try {\n dispatch({ type: 'LOADING' });\n const response = await axios.patch(`${endpoint}/schedule/${id}`, data);\n dispatch({ type: 'UPDATE', payload: response.data });\n } catch (err) {\n dispatch({ type: 'ERROR', payload: err });\n return Promise.reject(err);\n }\n },\n []\n );\n\n const getById = useCallback(async (id: Id) => {\n try {\n dispatch({ type: 'LOADING' });\n const response = await axios.get(\n `${endpoint}/schedule/measurement/${id}`\n );\n dispatch({ type: 'GET_BY_ID', payload: response.data });\n } catch (err) {\n dispatch({ type: 'ERROR', payload: err });\n }\n }, []);\n\n const remove = useCallback(async (id: Id) => {\n try {\n dispatch({ type: 'LOADING' });\n const response = await axios.delete(`${endpoint}/schedule/${id}`);\n dispatch({ type: 'REMOVE', payload: response.data });\n } catch (err) {\n dispatch({ type: 'ERROR', payload: err });\n return Promise.reject(err);\n }\n }, []);\n\n return {\n ...state,\n getAllByPatientId,\n post,\n patch,\n getById,\n remove,\n };\n};\n\nexport default useMeasurement;\n","import {\n Backdrop as MaterialBackdrop,\n CircularProgress as MaterialCircularProgress,\n} from '@material-ui/core';\nimport ChevronLeftRounded from '@material-ui/icons/ChevronLeftRounded';\nimport styled from 'styled-components';\nimport StyledButton from '../../StyledButton';\nimport StyledFormControlLabel from '../../StyledFormControlLabel';\n\nexport const SelectMeasurementContainer = styled.div`\n display: flex;\n flex-direction: row;\n align-items: center;\n width: 100%;\n`;\n\nexport const AddButtonContainer = styled.div`\n width: 10%;\n`;\n\nexport const SaveControlOptionsButton = styled(StyledButton)`\n color: ${({ theme }) => theme.palette.extra.color.grey.light};\n background-color: ${({ theme }) => theme.palette.secondary.main};\n border-radius: 0;\n padding-block: ${({ theme }) => theme.spacing(1)}px;\n width: 100%;\n bottom: 0px;\n\n &:hover {\n color: ${({ theme }) => theme.palette.extra.color.grey.light};\n background-color: ${({ theme }) => theme.palette.secondary.main};\n }\n`;\n\nexport const OpenModalButton = styled(StyledButton)`\n color: ${({ theme }) => theme.palette.extra.color.grey.light};\n background-color: ${({ theme }) => theme.palette.secondary.main};\n border-radius: ${({ theme }) => theme.spacing(0.5)}px;\n font-weight: 600;\n margin-top: ${({ theme }) => theme.spacing(2)}px;\n margin-inline: auto;\n max-width: 350px;\n width: 100%;\n\n &:hover {\n color: ${({ theme }) => theme.palette.extra.color.grey.light};\n background-color: ${({ theme }) => theme.palette.secondary.main};\n }\n\n &.Mui-disabled {\n color: ${({ theme }) => theme.palette.common.white};\n }\n`;\n\nexport const StyledBackIcon = styled(ChevronLeftRounded)`\n color: ${({ theme }) => theme.palette.extra.color.grey.light};\n font-size: 40px;\n cursor: pointer;\n`;\n\nexport const StyledAddButton = styled(StyledButton)`\n color: ${({ theme }) => theme.palette.secondary.main};\n border: 1px solid ${({ theme }) => theme.palette.secondary.main};\n border-radius: 50%;\n min-width: 0px;\n align-self: flex-end;\n margin-left: ${({ theme }) => theme.spacing(2)}px;\n padding: 0;\n`;\n\nexport const ControlOptionsModalHeader = styled.div`\n background-color: ${({ theme }) => theme.palette.primary.main};\n display: flex;\n align-items: center;\n justify-content: flex-start;\n box-sizing: border-box;\n padding: ${({ theme }) => theme.spacing(1)}px;\n width: 100%;\n`;\n\nexport const ControlOptionsModalBody = styled.div`\n flex-direction: column;\n display: flex;\n height: 100%;\n justify-content: space-between;\n overflow-y: auto;\n`;\n\nexport const ControlOptionsModalText = styled.span`\n color: ${({ theme }) => theme.palette.extra.color.grey.light};\n font-weight: 400;\n margin-left: ${({ theme }) => theme.spacing(2)}px;\n`;\n\nexport const ControlOptionsModal = styled.div`\n background-color: ${({ theme }) => theme.palette.extra.color.grey.light};\n display: flex;\n flex-direction: column;\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n max-width: 500px;\n width: 100%;\n @media (max-width: 500px) {\n height: 100%;\n }\n`;\n\nexport const FormControlList = styled(StyledFormControlLabel)`\n padding-inline: ${({ theme }) => theme.spacing(2)}px;\n width: 100%;\n`;\n\nexport const MeasurementListContainer = styled.div`\n width: 90%;\n display: flex;\n flex-direction: column;\n`;\n\nexport const MeasurementRow = styled.div`\n display: flex;\n flex-direction: row;\n align-items: center;\n height: ${({ theme }) => theme.spacing(5)}px;\n`;\n\nexport const InstructionRow = styled.div``;\n\nexport const RemoveButtonContainer = styled.div``;\n\nexport const StyledRemoveButton = styled(StyledButton)`\n color: red;\n border: 1px solid red;\n border-radius: 50%;\n min-width: 0px;\n align-self: flex-end;\n margin-left: ${({ theme }) => theme.spacing(2)}px;\n padding: 0;\n`;\n\nexport const Backdrop = styled(MaterialBackdrop)`\n z-index: ${({ theme }) => theme.zIndex.drawer + 1};\n color: ${({ theme }) => theme.palette.primary.light};\n position: absolute;\n`;\n\nexport const BackdropCircularProgress = styled(MaterialCircularProgress).attrs({\n color: 'inherit',\n})``;\n\nexport const Divider = styled.div`\n width: 100%;\n height: 1px;\n margin: ${({ theme }) => theme.spacing(2, 0)};\n background-color: ${({ theme }) => theme.palette.grey[400]};\n`;\n","import { EventScheduleModel } from '@cuidador/database'\nimport { Checkbox, FormGroup, Modal } from '@material-ui/core'\nimport { Clear } from '@material-ui/icons'\nimport { FormikErrors, FormikTouched } from 'formik'\nimport { debounce } from 'lodash'\nimport React, { useCallback, useEffect, useMemo, useState } from 'react'\nimport { FormValues, Measurement } from '..'\nimport useMeasurement from '../../../hooks/useMeasurement'\nimport {\n FormCardContainer,\n StyledFormikTextField as FormikTextField,\n StyledBoldTitle,\n} from '../../FormCardContainer'\nimport StyledSimpleDialog from '../../StyledSimpleDialog'\nimport ErrorText from '../ErrorText'\nimport {\n Backdrop,\n BackdropCircularProgress,\n ControlOptionsModal,\n ControlOptionsModalBody,\n ControlOptionsModalHeader,\n ControlOptionsModalText,\n Divider,\n FormControlList,\n InstructionRow,\n MeasurementListContainer,\n MeasurementRow,\n OpenModalButton,\n RemoveButtonContainer,\n SaveControlOptionsButton,\n SelectMeasurementContainer,\n StyledBackIcon,\n StyledRemoveButton,\n} from './styles'\n\ninterface SelectMeasurementProps {\n values: FormValues;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n setFieldValue: (field: string, value: any) => void;\n errors: FormikErrors;\n touched: FormikTouched;\n disabled?: boolean;\n}\n\nconst MeasurementsSelector: React.FC = ({\n values,\n setFieldValue,\n errors,\n touched,\n disabled,\n}) => {\n const [measurementIdToDelete, setMeasurementIdToDelete] = useState<\n string | null\n >(null)\n const [isControlModalOptionsOpen, setIsControlModalOptionsOpen] = useState(\n false,\n )\n const { byId, ids: eventsIds, getAllByPatientId, loading } = useMeasurement()\n\n useEffect(() => {\n getAllByPatientId()\n }, [])\n\n const isDeleteDialogOpen = useMemo(() => measurementIdToDelete != null, [\n measurementIdToDelete,\n ])\n\n const handleRemoveMeasurement = useCallback(\n (id: string | null) => {\n if (!values.measurements || !id) {\n return\n }\n setMeasurementIdToDelete(null)\n const newMeasurements = values.measurements.filter(\n (measurement) => measurement.id !== id,\n )\n setFieldValue('measurements', newMeasurements)\n },\n [values.measurements, setFieldValue, setMeasurementIdToDelete],\n )\n\n const handleChangeMeasurementInstruction = useCallback(\n (id: string, value: string) => {\n if (!values.measurements) {\n return\n }\n const newMeasurements = values.measurements.map((measurement) => {\n if (measurement.id === id) {\n return {\n ...measurement,\n instruction: value,\n }\n }\n return measurement\n })\n setFieldValue('measurements', newMeasurements)\n },\n [values.measurements, setFieldValue],\n )\n\n const handleMeasurementsConfirm = useCallback(\n (newMeasurements: Measurement[]) => {\n setFieldValue('measurements', newMeasurements)\n setIsControlModalOptionsOpen(false)\n },\n [],\n )\n\n const handleToggleControlModalOptions = () =>\n setIsControlModalOptionsOpen(!isControlModalOptionsOpen)\n\n return (\n <>\n {loading ? (\n \n {loading && (\n \n )}\n \n ) : (\n \n \n Clique no botão abaixo para selecionar os controles e sinais vitais\n que serão medidos neste horário\n \n \n handleToggleControlModalOptions()}\n disabled={disabled}\n >\n Selecionar controles\n \n {isControlModalOptionsOpen && (\n byId[id])}\n onClose={handleToggleControlModalOptions}\n onConfirm={handleMeasurementsConfirm}\n />\n )}\n \n {errors.measurements && touched.measurements && (\n \n )}\n \n {\n setMeasurementIdToDelete(id)\n }}\n onMeasurementInstructionChange={(\n id: string,\n newValue: string,\n ) => {\n handleChangeMeasurementInstruction(id, newValue)\n }}\n disabled={disabled}\n />\n \n \n )}\n setMeasurementIdToDelete(null)}\n handleYes={() => handleRemoveMeasurement(measurementIdToDelete)}\n title='Remover controle'\n subTitle='Tem certeza de que deseja remover o controle?'\n />\n \n )\n}\n\nconst SelectMeasurementModal: React.FC<{\n open: boolean;\n events: EventScheduleModel[];\n defaultMeasurements: Measurement[];\n onClose: () => void;\n onConfirm: (measurements: Measurement[]) => void;\n}> = ({ open, events, defaultMeasurements, onClose, onConfirm }) => {\n const [measurementsToBeConfimed, setMeasurementsToBeConfimed] = useState<\n Measurement[]\n >(defaultMeasurements)\n\n const isMeasurementChecked = (measurementId: string) => {\n return measurementsToBeConfimed.some(({ id }) => id === measurementId)\n }\n\n const handleToggleMeasurementToBeConfirmed = (measurementId: string) => {\n if (isMeasurementChecked(measurementId)) {\n const newMeasurementsToBeConfimed = measurementsToBeConfimed.filter(\n ({ id }) => id !== measurementId,\n )\n setMeasurementsToBeConfimed(newMeasurementsToBeConfimed)\n } else {\n const newMeasurementsToBeConfimed = [\n ...measurementsToBeConfimed,\n {\n id: measurementId,\n instruction: '',\n },\n ]\n setMeasurementsToBeConfimed(newMeasurementsToBeConfimed)\n }\n }\n\n return (\n \n \n \n \n \n Selecione 1 ou mais controles e clique em “Selecionar”\n \n \n \n \n {events.map((item) => (\n \n }\n key={item.id}\n value={item.id}\n onClick={() =>\n handleToggleMeasurementToBeConfirmed(String(item.id))\n }\n color='secondary'\n label={item.name}\n />\n ))}\n \n onConfirm(measurementsToBeConfimed)}\n >\n Selecionar\n \n \n \n \n )\n}\n\nconst MeasurementList: React.FC<{\n measurements: Measurement[];\n measurementsById: Record;\n onMeasurementDelete: (id: string) => void;\n onMeasurementInstructionChange: (id: string, newValue: string) => void;\n disabled?: boolean;\n}> = ({\n measurements,\n measurementsById,\n onMeasurementDelete,\n onMeasurementInstructionChange,\n disabled,\n}) => {\n return (\n <>\n {measurements.map(\n (measurement, index) =>\n measurementsById[measurement.id] && (\n onMeasurementDelete(measurement.id)}\n onInstructionChange={(newValue) =>\n onMeasurementInstructionChange(measurement.id, newValue)\n }\n disabled={disabled}\n />\n ),\n )}\n \n )\n}\n\nconst MeasurementListItem: React.FC<{\n label: string;\n measurement: Measurement;\n onDelete: () => void;\n onInstructionChange: (newValue: string) => void;\n disabled?: boolean;\n}> = ({ label, measurement, onDelete, onInstructionChange, disabled }) => {\n const [measurementInstruction, setMeasurementInstruction] = useState(\n measurement.instruction,\n )\n const isRemoveButtonDisabled = !disabled\n\n useEffect(() => {\n debouncedOnInstructionChange(measurementInstruction)\n }, [measurementInstruction])\n\n const debouncedOnInstructionChange = useCallback(\n debounce(onInstructionChange, 200),\n [onInstructionChange],\n )\n\n return (\n <>\n \n \n {label}\n {isRemoveButtonDisabled && (\n \n \n \n \n \n )}\n \n \n ) =>\n setMeasurementInstruction(e.target.value)\n }\n multiline=\"true\"\n rows=\"5\"\n />\n \n \n )\n}\n\nexport default MeasurementsSelector\n","import styled from 'styled-components';\n\nexport const MedicBalloonContainer = styled.div`\n margin-top: 1rem;\n`;\n","import React from 'react';\nimport MedicBalloonComponent from '../../MedicBalloon';\nimport { MedicBalloonContainer } from './styles';\n\nconst MedicBalloon: React.FC = () => {\n return (\n \n \n \n );\n};\n\nexport default MedicBalloon;\n","import styled from 'styled-components';\n\nexport const StyledRow = styled.div`\n width: 100%;\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n align-items: flex-start;\n margin-top: ${({ theme }) => theme.spacing(2)}px;\n margin-bottom: ${({ theme }) => theme.spacing(1)}px;\n`;\n","import { Radio, RadioGroup } from '@material-ui/core';\nimport { format } from 'date-fns';\nimport React from 'react';\nimport { FormValues } from '..';\nimport {\n FormCardContainer,\n StyledBoldTitle,\n StyledFormikTextField as FormikTextField,\n} from '../../FormCardContainer';\nimport StyledFormControlLabel from '../../StyledFormControlLabel';\nimport { StyledRow } from './styles';\n\ninterface PeriodSelectorProps {\n id?: number;\n values: FormValues;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n setFieldValue: (field: string, value: any) => void;\n disabled?: boolean;\n}\n\nexport enum PeriodType {\n Continuously = 'Continuamente',\n DeterminedTime = 'Por tempo determinado',\n}\n\nconst PeriodSelector: React.FC = ({\n id,\n values,\n setFieldValue,\n disabled,\n}) => {\n const initialDate = format(new Date(), 'yyyy-MM-dd');\n const finalDate = format(new Date('12/31/9999'), 'yyyy-MM-dd');\n\n return (\n \n Período\n ) => {\n setFieldValue('periodType', e.target.value as PeriodType);\n }}\n >\n {Object.values(PeriodType).map((label, index) => (\n }\n label={label}\n disabled={disabled}\n />\n ))}\n \n {!id && (\n \n Data de início\n \n \n )}\n {values.periodType === PeriodType.DeterminedTime && (\n \n Data de fim\n \n \n )}\n \n );\n};\n\nexport default PeriodSelector;\n","import * as Yup from 'yup';\nimport { FrequencyType } from './DaysSelector';\nimport { PeriodType } from './PeriodSelector';\n\nexport const validationSchema = Yup.object().shape({\n measurements: Yup.array().min(\n 1,\n 'Por favor, insira pelo menos um tipo de controle.'\n ),\n timeSchedule: Yup.string().required('Por favor, insira uma frequência.'),\n time: Yup.string().when('timeSchedule', {\n is: 'custom',\n then: Yup.string().notRequired(),\n otherwise: Yup.string().required('Por favor, insira um horário.'),\n }),\n customTimes: Yup.array().when('timeSchedule', {\n is: 'custom',\n then: Yup.array().min(1, 'Por favor, insira pelo menos um horário.'),\n }),\n rangeInDays: Yup.string().when('dayOptions', {\n is: FrequencyType.Custom,\n then: Yup.string().required('Por favor, insira um intervalo.'),\n }),\n customRangeInDays: Yup.number().when('rangeInDays', {\n is: 'custom',\n then: Yup.number().required('Por favor, insira um intervalo.'),\n }),\n frequencyStartsAt: Yup.string().required(\n 'Por favor, insira uma data de início.'\n ),\n frequencyEndsAt: Yup.string().when('periodType', {\n is: PeriodType.DeterminedTime,\n then: Yup.string().required('Por favor, insira uma data de término.'),\n }),\n days: Yup.array().when('dayOptions', {\n is: FrequencyType.SomeDays,\n then: Yup.array().min(1, 'Por favor, insira pelo menos um dia.'),\n }),\n});\n","import styled from 'styled-components';\n\nexport const ContentContainer = styled.div`\n margin-top: ${({ theme }) => theme.spacing(3)}px;\n width: 100%;\n display: flex;\n align-items: center;\n flex-direction: column;\n`;\n","import styled from 'styled-components';\nimport StyledButton from '../../StyledButton';\n\nexport const Centralizer = styled.div`\n align-items: center;\n flex-direction: column;\n display: flex;\n flex: 1;\n justify-content: flex-end;\n width: 100%;\n`;\n\nexport const Button = styled(StyledButton)`\n margin-bottom: ${({ theme }) => theme.spacing(1.5)}px;\n`;\n","import React from 'react';\nimport { Centralizer, Button } from './styles';\n\ninterface SubmitButtonProps {\n disabled?: boolean;\n}\n\nconst SubmitButton: React.FC = ({ disabled }) => {\n return (\n \n \n Salvar\n \n \n );\n};\n\nexport default SubmitButton;\n","import styled from 'styled-components';\nimport { Typography } from '@material-ui/core';\nimport StyledButton from '../../StyledButton';\n\nexport const TextRow = styled.div`\n display: flex;\n flex-direction: row;\n width: 70%;\n justify-content: space-between;\n margin-top: ${({ theme }) => theme.spacing(1)}px;\n`;\n\nexport const StyledText = styled(Typography)`\n color: ${({ theme }) => theme.palette.common.black};\n`;\n\nexport const CustomTimeInputContainer = styled.div`\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n align-items: center;\n flex: 9;\n width: 100%;\n`;\n\nexport const AddButtonContainer = styled.div`\n margin-top: 16px;\n margin-bottom: 8px;\n display: flex;\n flex: 1;\n`;\n\nexport const StyledAddButton = styled(StyledButton)<{ disabled: boolean }>`\n color: ${({ theme }) => theme.palette.secondary.main};\n min-width: 0px;\n align-self: center;\n justify-self: flex-end;\n margin-left: ${({ theme }) => theme.spacing(1)}px;\n padding: 0;\n border: none !important;\n height: 100%;\n flex: 1;\n\n div {\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n\n svg {\n border: 1px solid\n ${({ theme, disabled }) =>\n disabled\n ? theme.palette.text.disabled\n : theme.palette.secondary.main};\n border-radius: 50%;\n }\n span {\n font-size: 10px;\n line-height: 1;\n margin-top: 4px;\n margin-bottom: 4px;\n }\n }\n`;\n\nexport const StyledRemoveButton = styled(StyledButton)`\n color: red;\n border: 1px solid red;\n border-radius: 50%;\n min-width: 0px;\n align-self: flex-end;\n margin-left: ${({ theme }) => theme.spacing(2)}px;\n padding: 0;\n`;\n","import { Add, Clear } from '@material-ui/icons';\nimport { FormikErrors, FormikTouched } from 'formik';\nimport React, { useState } from 'react';\nimport {\n FormCardContainer,\n NewStyledSelect as StyledSelect,\n StyledBoldTitle,\n StyledFormikTextField as FormikTextField,\n} from '../../FormCardContainer';\nimport StyledMenuItem from '../../StyledMenuItem';\nimport StyledSimpleDialog from '../../StyledSimpleDialog';\nimport ErrorText from '../ErrorText';\nimport { FormValues } from '../index';\nimport {\n AddButtonContainer,\n CustomTimeInputContainer,\n StyledAddButton,\n StyledRemoveButton,\n StyledText,\n TextRow,\n} from './styles';\n\nconst scheduleOptions = [\n { label: '2h/2h', value: '2h' },\n { label: '4h/4h', value: '4h' },\n { label: '6h/6h', value: '6h' },\n { label: '8h/8h', value: '8h' },\n { label: '12h/12h', value: '12h' },\n { label: '24h/24h', value: '24h' },\n { label: 'Intervalos irregulares', value: 'custom' },\n];\n\ninterface TimeSelectorProps {\n values: FormValues;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n setFieldValue: (field: string, value: any) => void;\n errors: FormikErrors;\n touched: FormikTouched;\n disabled?: boolean;\n}\n\nexport const getMeasurementTimes = (startTime: string, frequency: string) => {\n const formattedFrequency = Number(frequency.replace('h', ''));\n const [hour, minute] = startTime.split(':');\n const formattedHour = Number(hour);\n const doses = [];\n const firstTime = formattedHour % formattedFrequency;\n for (let time = firstTime; time <= 23; time += formattedFrequency) {\n doses.push(time);\n }\n\n const formattedDoses = doses.map((item) => {\n return item.toString().padStart(2, '0') + ':' + minute;\n });\n\n return formattedDoses;\n};\n\nconst TimeSelector: React.FC = ({\n values,\n setFieldValue,\n errors,\n touched,\n disabled,\n}) => {\n const [customTime, setCustomTime] = useState('');\n const [customTimeToDelete, setCustomTimeToDelete] = useState('');\n const [isDeleteDialogOpen, setIsDeleteDialogOpen] = useState(false);\n const handleAddCustomTime = () => {\n const customTimes = [...(values.customTimes || [])];\n if (values.customTimes?.includes(customTime)) return;\n setFieldValue('customTimes', [...customTimes, customTime]);\n setCustomTime('');\n };\n\n const handleRemoveCustomTime = (time: string) => {\n setIsDeleteDialogOpen(false);\n const customTimes = [...(values.customTimes || [])];\n const filteredCustomTimes = customTimes.filter(\n (customTime) => customTime !== time\n );\n setFieldValue('customTimes', filteredCustomTimes);\n };\n\n const orderedCustomTimes = values.customTimes?.sort((a, b) => {\n const fistHour = Number(a.split(':').join(''));\n const secondHour = Number(b.split(':').join(''));\n return fistHour - secondHour;\n });\n\n return (\n <>\n \n Horários\n \n {scheduleOptions.map((option) => (\n \n {option.label}\n \n ))}\n \n {errors.timeSchedule && touched.timeSchedule && (\n \n )}\n {values.timeSchedule && values.timeSchedule !== 'custom' ? (\n <>\n \n {values.time &&\n getMeasurementTimes(values.time, values.timeSchedule).map(\n (time, index) => (\n \n \n {index + 1}ª medição\n \n {time}\n \n )\n )}\n \n ) : (\n values.timeSchedule && (\n <>\n \n ) =>\n setCustomTime(e.target.value)\n }\n style={{ width: '90%' }}\n />\n \n \n
    \n \n Adicionar\n
    \n \n
    \n
    \n {errors.customTimes && touched.customTimes && (\n \n )}\n {orderedCustomTimes?.map((time, index) => (\n \n \n {index + 1}ª medição\n \n {time}\n {\n setCustomTimeToDelete(time);\n setIsDeleteDialogOpen(true);\n }}\n >\n \n \n \n ))}\n \n )\n )}\n
    \n setIsDeleteDialogOpen(false)}\n handleYes={() => handleRemoveCustomTime(customTimeToDelete)}\n title=\"Remover horário\"\n subTitle=\"Tem certeza de que deseja remover o horário?\"\n />\n \n );\n};\n\nexport default TimeSelector;\n","import { Form as FormikForm, Formik } from 'formik';\nimport { isEqual } from 'lodash';\nimport React from 'react';\nimport useCanAccess from '../../hooks/useCanAccess';\nimport DaysSelector, { FrequencyType } from './DaysSelector';\nimport InformativeText from './InformativeText';\nimport MeasurementsSelector from './MeasurementsSelector';\nimport MedicBalloon from './MedicBalloon';\nimport PeriodSelector, { PeriodType } from './PeriodSelector';\nimport { validationSchema } from './schema';\nimport { ContentContainer } from './styles';\nimport SubmitButton from './SubmitButton';\nimport TimeSelector from './TimeSelector';\n\nexport interface Measurement {\n id: string;\n instruction: string;\n}\n\nexport interface FormValues {\n measurements?: Measurement[];\n dayOptions?: FrequencyType;\n days?: string[];\n rangeInDays?: '2d' | '3d' | '5d' | '7d' | '15d' | '30d' | 'custom';\n customRangeInDays?: number;\n timeSchedule?: string;\n time?: string;\n customTimes?: string[];\n frequencyStartsAt?: string;\n frequencyEndsAt?: string;\n periodType?: PeriodType;\n}\n\ninterface MeasurementScheduleForm {\n id?: number;\n initialValues: FormValues;\n onSubmit: (values: FormValues) => Promise;\n}\n\nconst MeasurementScheduleForm: React.FC = ({\n id,\n initialValues,\n onSubmit,\n}) => {\n const { isAllowedToUpdate } = useCanAccess('care/event/schedule');\n return (\n <>\n \n \n \n {({ values, setFieldValue, isSubmitting, errors, touched }) => {\n return (\n \n \n \n \n \n \n \n \n \n );\n }}\n \n \n );\n};\n\nexport default MeasurementScheduleForm;\n","import { EventSubCategoryModel } from '@cuidador/database';\nimport { parse } from 'date-fns';\nimport { FormValues, Measurement } from '..';\nimport { MeasurementScheduleModelDTO } from '../../../hooks/useMeasurement';\nimport {\n convertLocalTimeToUTC,\n getUTCWeeklySchedule,\n weekdayMap,\n} from '../../../utils/date/index';\nimport { FrequencyType } from '../DaysSelector';\nimport { PeriodType } from '../PeriodSelector';\nimport { getMeasurementTimes } from '../TimeSelector';\n\nexport const formDataToEventScheduleModel = (\n formData: FormValues,\n patientId: number\n) => {\n const frequencyStartsAt = parse(\n `${formData.frequencyStartsAt} ${\n (formData.timeSchedule === 'custom'\n ? formData.customTimes && formData.customTimes[0]\n : formData.time) || '00:00'\n }`,\n 'yyyy-MM-dd HH:mm',\n new Date()\n ).toISOString();\n\n const frequencyEndsAt =\n formData.periodType === PeriodType.DeterminedTime\n ? parse(\n `${formData.frequencyEndsAt}`,\n 'yyyy-MM-dd',\n new Date()\n ).toISOString()\n : null;\n\n const utcSchedule = getUtcSchedule(formData.days!, formData.time!);\n\n const frequencyRule = getFrequencyRule(formData);\n\n const { subCategory, eventDescription } = parseMeasurements(\n formData.measurements!\n );\n\n const times = getTimes(formData);\n\n const customTimes = times.map((time) => ({\n happensAt: convertLocalTimeToUTC(time),\n }));\n\n const data: MeasurementScheduleModelDTO = {\n name: 'Controles e sinais vitais',\n scheduleType: 'custom_frequency',\n customTimes,\n frequencyStartsAt,\n frequencyEndsAt,\n ...utcSchedule,\n frequencyRule,\n subCategory,\n eventDescription,\n patientId,\n };\n\n return data;\n};\n\nconst getTimes = (formData: FormValues) => {\n let times;\n if (formData.timeSchedule === 'custom') {\n times = formData.customTimes;\n } else {\n times = getMeasurementTimes(formData.time!, formData.timeSchedule!);\n }\n return times || [];\n};\n\nconst getFrequencyRule = (formData: FormValues) => {\n if (formData.dayOptions !== FrequencyType.Custom) return '1d';\n if (formData.rangeInDays !== 'custom') return formData.rangeInDays;\n return `${formData.customRangeInDays}d`;\n};\n\nconst parseMeasurements = (measurements: Measurement[]) => {\n const subCategory = measurements.map((measurement) => {\n const subCategoryFormatted: EventSubCategoryModel = {\n id: Number(measurement.id),\n };\n return subCategoryFormatted;\n });\n\n const eventDescription = measurements.map((measurement) => ({\n subCategoryId: Number(measurement.id),\n description: measurement.instruction || '',\n }));\n\n return {\n subCategory,\n eventDescription,\n };\n};\n\nconst getUtcSchedule = (days: string[], time: string) => {\n const localSchedule = {\n mon: true,\n tue: true,\n wed: true,\n thu: true,\n fri: true,\n sat: true,\n sun: true,\n };\n\n if (days && days.length > 0) {\n localSchedule.mon = days.includes(weekdayMap.mon);\n localSchedule.tue = days.includes(weekdayMap.tue);\n localSchedule.wed = days.includes(weekdayMap.wed);\n localSchedule.thu = days.includes(weekdayMap.thu);\n localSchedule.fri = days.includes(weekdayMap.fri);\n localSchedule.sat = days.includes(weekdayMap.sat);\n localSchedule.sun = days.includes(weekdayMap.sun);\n }\n\n const utcSchedule = getUTCWeeklySchedule(localSchedule, time);\n return utcSchedule;\n};\n","import styled from 'styled-components';\nimport {\n Backdrop as MaterialBackdrop,\n CircularProgress as MaterialCircularProgress,\n} from '@material-ui/core';\n\nexport const Backdrop = styled(MaterialBackdrop)`\n z-index: ${({ theme }) => theme.zIndex.drawer + 1};\n color: ${({ theme }) => theme.palette.primary.light};\n position: absolute;\n`;\n\nexport const BackdropCircularProgress = styled(MaterialCircularProgress).attrs({\n color: 'inherit',\n})``;\n","import { APIError } from '@cuidador/lib'\nimport { AxiosError } from 'axios'\nimport { format } from 'date-fns'\nimport React, { useContext } from 'react'\nimport { useHistory, useParams } from 'react-router-dom'\nimport { toast } from 'react-toastify'\nimport MeasurementScheduleForm, {\n FormValues,\n} from '../../../components/MeasurementScheduleForm'\nimport { FrequencyType } from '../../../components/MeasurementScheduleForm/DaysSelector'\nimport { PeriodType } from '../../../components/MeasurementScheduleForm/PeriodSelector'\nimport { formDataToEventScheduleModel } from '../../../components/MeasurementScheduleForm/utils/parseFormDataToModel'\nimport { AuthContext } from '../../../contexts/auth'\nimport useMeasurement from '../../../hooks/useMeasurement'\nimport { resolveErrorMessage } from '../../../utils/error'\nimport { Backdrop, BackdropCircularProgress } from './styles'\nimport { Header } from '../../../components/Header'\nimport { BackButton } from '../../../components/BackButton'\nimport { PageTitle } from '../../../components/PageTitle'\nimport { RemoveButton } from '../../../components/RemoveButton'\nimport { PscButton } from '../../../components/PscButton'\n\nconst initialValues: FormValues = {\n measurements: [],\n dayOptions: FrequencyType.EveryDay,\n days: ['Seg', 'Ter', 'Qua', 'Qui', 'Sex', 'Sab', 'Dom'],\n time: '',\n customTimes: [],\n frequencyStartsAt: format(new Date(), 'yyyy-MM-dd'),\n frequencyEndsAt: '',\n periodType: PeriodType.Continuously,\n timeSchedule: '',\n}\n\nconst Register: React.FC = () => {\n const { userInfo } = useContext(AuthContext)\n const params = useParams<{ id: string }>()\n const history = useHistory()\n const { loading, post } = useMeasurement()\n\n const patientId = userInfo?.activePatientId\n\n const handleSubmit = async (values: FormValues) => {\n if (!patientId) return\n const formattedData = formDataToEventScheduleModel(values, patientId)\n return post(formattedData)\n .then(() => {\n toast.success('Medição adicionada com sucesso!')\n history.push('/controles')\n })\n .catch((err: AxiosError) => {\n const displayMessage = resolveErrorMessage(err)\n toast.error(displayMessage)\n })\n }\n\n return (\n <>\n \n }\n centerContent={\n \n }\n rightContent={\n params.id\n ? history.goBack()} />\n : \n }\n />\n {loading ? (\n \n {loading && (\n \n )}\n \n ) : (\n \n )}\n \n )\n}\n\nexport default Register\n","import {\n EventScheduleCustomTimeModel,\n EventScheduleModel,\n} from '@cuidador/database';\nimport { differenceInMinutes, format } from 'date-fns';\nimport _ from 'lodash';\nimport { FormValues, Measurement } from '..';\nimport { getLocalWeeklySchedule, weekdayMap } from '../../../utils/date';\nimport { convertTimeToDate } from '../../../utils/date/index';\nimport { EVERYDAY, FrequencyType, MONDAY_TO_FRIDAY } from '../DaysSelector';\nimport { PeriodType } from '../PeriodSelector';\n\nexport const eventScheduleModelToFormData = (\n eventSchedule: EventScheduleModel\n) => {\n const measurements = parseMeasurements(eventSchedule);\n\n const { formattedDate, formattedTime, formattedEndDate } = parseDates(\n eventSchedule\n );\n\n const timeSchedule = getFrequencyRule(eventSchedule.customTimes!);\n const customTimes = parseCustomTimes(eventSchedule);\n const days = getSelectedWeekDays(eventSchedule);\n const dayOptions = getDayOptons(days, eventSchedule.frequencyRule || '1d');\n const { rangeInDays, customRangeInDays } = getRangesInDays(\n eventSchedule.frequencyRule || ''\n );\n const periodType = getPeriodType(\n eventSchedule.frequencyStartsAt!,\n eventSchedule.frequencyEndsAt!\n );\n\n const data = {\n measurements,\n frequencyStartsAt: formattedDate || '',\n frequencyEndsAt: formattedEndDate || '',\n time: formattedTime || '',\n timeSchedule,\n customTimes,\n days,\n dayOptions,\n rangeInDays,\n customRangeInDays,\n periodType,\n } as FormValues;\n return data;\n};\n\nconst getPeriodType = (frequencyStartsAt: string, frequencyEndsAt: string) => {\n if (frequencyStartsAt && frequencyEndsAt) {\n return PeriodType.DeterminedTime;\n }\n return PeriodType.Continuously;\n};\n\nconst getRangesInDays = (frequencyRule: string) => {\n let rangeInDays;\n let customRangeInDays;\n const notCustomIntervalOptions = ['2d', '3d', '5d', '7d', '15d', '30d'];\n if (notCustomIntervalOptions.includes(frequencyRule)) {\n rangeInDays = frequencyRule;\n } else {\n rangeInDays = 'custom';\n customRangeInDays = Number(frequencyRule.split('d')[0]);\n }\n\n return {\n rangeInDays,\n customRangeInDays,\n };\n};\n\nconst getDayOptons = (days: string[], frequencyRule: string) => {\n const isEveryDay =\n days.length === 7 && days.every((day) => EVERYDAY.includes(day));\n const isMondayToFriday =\n days.length === 5 && days.every((day) => MONDAY_TO_FRIDAY.includes(day));\n const isSomeDays = !isEveryDay && !isMondayToFriday;\n if (frequencyRule === '1d') {\n if (isEveryDay) return FrequencyType.EveryDay;\n if (isMondayToFriday) return FrequencyType.MondayToFriday;\n if (isSomeDays) return FrequencyType.SomeDays;\n }\n return FrequencyType.Custom;\n};\n\nexport const getSelectedWeekDays = (eventSchedule: EventScheduleModel) => {\n const { mon, tue, wed, thu, fri, sat, sun } = eventSchedule || {};\n\n const utcSchedule = { mon, tue, wed, thu, fri, sat, sun };\n const date = new Date(eventSchedule?.frequencyStartsAt || '');\n const utcTime = `${date\n .getUTCHours()\n .toString()\n .padStart(2, '0')}:${date.getUTCMinutes().toString().padStart(2, '0')}`;\n const localSchedule = getLocalWeeklySchedule(utcSchedule, utcTime);\n\n const selectedWeekDays: string[] = [];\n if (localSchedule.mon) selectedWeekDays.push(weekdayMap.mon);\n if (localSchedule.tue) selectedWeekDays.push(weekdayMap.tue);\n if (localSchedule.wed) selectedWeekDays.push(weekdayMap.wed);\n if (localSchedule.thu) selectedWeekDays.push(weekdayMap.thu);\n if (localSchedule.fri) selectedWeekDays.push(weekdayMap.fri);\n if (localSchedule.sat) selectedWeekDays.push(weekdayMap.sat);\n if (localSchedule.sun) selectedWeekDays.push(weekdayMap.sun);\n\n return selectedWeekDays;\n};\n\n/**\n * calculates the difference in minutes between the times of the eventSchedule, to fill frequency field in medication form;\n * it doesn't make sense to calculate the differences between times, when there is only one time for the event/medication happen.\n * in this case, the frequency is 24 hours, when the event has only one time to happen in the day.\n */\nconst getFrequencyRule = (times: EventScheduleCustomTimeModel[]) => {\n const ONE_HOUR_IN_MINUTES = 60;\n const TWO_HOURS_IN_MINUTES = 120;\n const FOUR_HOURS_IN_MINUTES = 240;\n const SIX_HOURS_IN_MINUTES = 360;\n const EIGHT_HOURS_IN_MINUTES = 480;\n const TWELVE_HOURS_IN_MINUTES = 720;\n const TWENTY_FOUR_HOURS_IN_MINUTES = 1440;\n const validDifferencesInMinutes = [\n TWO_HOURS_IN_MINUTES,\n FOUR_HOURS_IN_MINUTES,\n SIX_HOURS_IN_MINUTES,\n EIGHT_HOURS_IN_MINUTES,\n TWELVE_HOURS_IN_MINUTES,\n TWENTY_FOUR_HOURS_IN_MINUTES,\n ];\n\n const customTimes = times.map((time) => time.happensAt).sort();\n const differences: number[] = [];\n customTimes.forEach((time, index) => {\n if (customTimes.length === 1) {\n differences.push(TWENTY_FOUR_HOURS_IN_MINUTES);\n } else {\n const hour = new Date(\n 2022,\n 1,\n 1,\n Number(customTimes[index]?.split(':')[0]),\n Number(customTimes[index]?.split(':')[1])\n );\n const nextHour = new Date(\n 2022,\n 1,\n 1,\n Number(customTimes[index + 1]?.split(':')[0]),\n Number(customTimes[index + 1]?.split(':')[1])\n );\n const difference = differenceInMinutes(nextHour, hour);\n if (!isNaN(difference)) {\n differences.push(Math.abs(difference));\n }\n }\n });\n\n const allEqualAndValid = (arr: number[]) =>\n arr.every((v) => v === arr[0] && validDifferencesInMinutes.includes(v));\n\n const firstDifference = differences[0] / ONE_HOUR_IN_MINUTES;\n\n const HOURS_IN_DAY = 24;\n const timesInFrequency = HOURS_IN_DAY / firstDifference;\n\n const isIrregular =\n times.length !== timesInFrequency || !allEqualAndValid(differences);\n\n const frequencyRule = isIrregular\n ? 'custom'\n : `${differences[0] / ONE_HOUR_IN_MINUTES}h`;\n\n return frequencyRule;\n};\n\nconst parseCustomTimes = (eventSchedule: EventScheduleModel) => {\n if (eventSchedule.scheduleType === 'custom_frequency') {\n const customTimes = eventSchedule.customTimes?.map((time) => {\n if (time.happensAt) {\n return format(convertTimeToDate(time.happensAt), 'HH:mm');\n }\n });\n return customTimes;\n }\n};\n\nconst parseMeasurements = (eventSchedule: EventScheduleModel) => {\n const events =\n eventSchedule.events &&\n eventSchedule.events.map((event) => ({\n id: String(event.subCategoryId),\n instruction: event.description,\n }));\n\n const measurements = _.uniqBy(events, 'id');\n return measurements as Measurement[];\n};\n\nconst parseDates = (eventSchedule: EventScheduleModel) => {\n let formattedDate;\n let formattedTime;\n let formattedEndDate;\n\n if (eventSchedule?.frequencyStartsAt) {\n formattedDate = format(\n new Date(eventSchedule?.frequencyStartsAt),\n 'yyyy-MM-dd'\n );\n formattedTime = format(new Date(eventSchedule?.frequencyStartsAt), 'HH:mm');\n if (eventSchedule?.frequencyEndsAt) {\n formattedEndDate = format(\n new Date(eventSchedule?.frequencyEndsAt),\n 'yyyy-MM-dd'\n );\n }\n }\n\n return {\n formattedDate,\n formattedTime,\n formattedEndDate,\n };\n};\n","import styled from 'styled-components';\nimport {\n Backdrop as MaterialBackdrop,\n CircularProgress as MaterialCircularProgress,\n} from '@material-ui/core';\n\nexport const Backdrop = styled(MaterialBackdrop)`\n z-index: ${({ theme }) => theme.zIndex.drawer + 1};\n color: ${({ theme }) => theme.palette.primary.light};\n position: absolute;\n`;\n\nexport const BackdropCircularProgress = styled(MaterialCircularProgress).attrs({\n color: 'inherit',\n})``;\n","import { APIError } from '@cuidador/lib';\nimport { AxiosError } from 'axios';\nimport { format } from 'date-fns';\nimport React, { useContext, useEffect, useState } from 'react';\nimport { useHistory, useParams } from 'react-router-dom';\nimport { toast } from 'react-toastify';\nimport MeasurementScheduleForm, {\n FormValues,\n} from '../../../components/MeasurementScheduleForm';\nimport { formDataToEventScheduleModel } from '../../../components/MeasurementScheduleForm/utils/parseFormDataToModel';\nimport { eventScheduleModelToFormData } from '../../../components/MeasurementScheduleForm/utils/parseModelToFormData';\nimport { StyledFieldset } from '../../../components/StyledFieldset';\nimport StyledSimpleDialog from '../../../components/StyledSimpleDialog';\nimport { AuthContext } from '../../../contexts/auth';\nimport useCanAccess from '../../../hooks/useCanAccess';\nimport useMeasurement from '../../../hooks/useMeasurement';\nimport { resolveErrorMessage } from '../../../utils/error';\nimport { Backdrop, BackdropCircularProgress } from './styles';\nimport { Header } from '../../../components/Header'\nimport { BackButton } from '../../../components/BackButton'\nimport { PageTitle } from '../../../components/PageTitle'\nimport { RemoveButton } from '../../../components/RemoveButton'\n\nconst UpdateMeasurementSchedule: React.FC = () => {\n const { userInfo } = useContext(AuthContext);\n const patientId = userInfo?.activePatientId;\n const params = useParams<{ id: string }>();\n const measurementScheduleId = parseInt(params.id);\n const history = useHistory();\n const { loading, patch, getById, byId, remove } = useMeasurement();\n const [isDeleteDialogOpen, setIsDeleteDialogOpen] = useState(false);\n const { isAllowedToDelete, isAllowedToUpdate } = useCanAccess(\n 'care/event/schedule'\n );\n\n const measurementScheduleData =\n measurementScheduleId != null ? byId[measurementScheduleId] : null;\n\n const handleSubmit = async (values: FormValues) => {\n if (!patientId) return;\n const defaultValues = handleFormValuesWithDefaultStartDate(values);\n const formattedData = formDataToEventScheduleModel(\n defaultValues,\n patientId\n );\n return patch(measurementScheduleId, formattedData)\n .then(() => {\n toast.success('Medição editada com sucesso!');\n history.push('/controles');\n })\n .catch((err: AxiosError) => {\n const displayMessage = resolveErrorMessage(err);\n toast.error(displayMessage);\n });\n };\n\n const handleFormValuesWithDefaultStartDate = (\n data: FormValues\n ): FormValues => {\n return { ...data, frequencyStartsAt: format(new Date(), 'yyyy-MM-dd') };\n };\n\n const handleDelete = (id: Id) => {\n setIsDeleteDialogOpen(false);\n remove(id)\n .then(() => {\n toast.success('Agendamento de controle excluída com sucesso!');\n history.push('/controles');\n })\n .catch((err: AxiosError) => {\n const displayMessage = resolveErrorMessage(err);\n toast.error(displayMessage);\n });\n };\n\n const fetchMeasurementSchedule = async () => {\n if (measurementScheduleId) {\n getById(measurementScheduleId);\n }\n };\n\n useEffect(() => {\n fetchMeasurementSchedule();\n }, []);\n\n return (\n <>\n history.push('/controles')} />\n }\n centerContent={\n \n }\n rightContent={\n params.id && isAllowedToDelete && (\n setIsDeleteDialogOpen(true)} />\n )\n }\n />\n {loading ? (\n \n {loading && (\n \n )}\n \n ) : (\n measurementScheduleData && (\n <>\n \n \n \n setIsDeleteDialogOpen(false)}\n handleYes={() => handleDelete(params.id!)}\n title=\"Remover agendamento de controle\"\n subTitle=\"Tem certeza que deseja remover este controle?\"\n />\n \n )\n )}\n \n );\n};\n\nexport default UpdateMeasurementSchedule;\n","import { Button as TextButton, DialogContent } from '@material-ui/core';\nimport styled from 'styled-components';\nimport StyledButton from '../StyledButton';\n\nexport const CenterLayout = styled.div`\n display: flex;\n flex-direction: column;\n align-items: center;\n`;\n\nexport const StyledDialogContent = styled(DialogContent)`\n padding: ${({ theme }) => theme.spacing(2)}px;\n`;\n\nexport const StyledTextButton = styled(TextButton)`\n margin-top: ${({ theme }) => theme.spacing(2)}px;\n`;\n\nexport const StyledWhiteButton = styled(StyledButton)`\n background-color: ${({ theme }) => theme.palette.common.white};\n color: ${({ theme }) => theme.palette.primary.main};\n border: none;\n\n &:hover {\n background-color: ${({ theme }) => theme.palette.common.white};\n color: ${({ theme }) => theme.palette.primary.main};\n opacity: 65%;\n transition: 0.3s;\n }\n`;\n","import { DialogTitle, Typography } from '@material-ui/core';\nimport React from 'react';\nimport StyledDialog from '../../components/StyledDialog';\nimport {\n CenterLayout,\n StyledDialogContent,\n StyledTextButton,\n StyledWhiteButton,\n} from './styles';\n\ntype BuyMedicationDialogProps = {\n onClose: () => void;\n onConfirm: () => void;\n isOpen: boolean;\n isLoading: boolean;\n};\n\nexport default function BuyMedicationDialog({\n isOpen,\n onConfirm,\n onClose,\n isLoading,\n}: BuyMedicationDialogProps) {\n return (\n \n \n \n Receba os medicamentos em casa pela parceria com a dose certa (Raia/Drogasil)\n \n \n Mande sua lista de medicamentos e a dose certa (Raia/Drogasil) entrará em contato com você em breve com o orçamento.\n \n \n \n Quero um orçamento\n \n \n Não, obrigado\n \n \n \n \n );\n}\n","function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\nimport * as React from \"react\";\n\nvar _ref2 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M2.46625 15.0884C1.10418 13.6838 1.10418 11.4065 2.46625 10.0019L6.07195 6.28371L11.0044 11.3701L7.39874 15.0884C6.03667 16.493 3.82832 16.493 2.46625 15.0884Z\",\n fill: \"#45F6FF\"\n});\n\nvar _ref3 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M14.6315 2.54321C15.9935 3.94779 15.9935 6.22506 14.6315 7.62964L11.0044 11.3699L6.07191 6.28346L9.69897 2.54321C11.061 1.13863 13.2694 1.13863 14.6315 2.54321Z\",\n fill: \"white\"\n});\n\nvar _ref4 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M2.5015 15.1072L8.56443 8.85502L11.0033 11.37L7.3793 15.1072C6.03233 16.4962 3.84846 16.4962 2.5015 15.1072Z\",\n fill: \"#5ECBF1\"\n});\n\nvar _ref5 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M8.56616 8.8562L14.6558 2.57647C16.0024 3.96502 16.0024 6.21631 14.6558 7.60486L11.0043 11.3704L8.56616 8.8562Z\",\n fill: \"#D1FEFB\"\n});\n\nvar _ref6 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M9.36854 21.4568C8.00647 20.0522 8.00647 17.7749 9.36854 16.3704L12.9743 12.6521L17.9067 17.7385L14.301 21.4568C12.939 22.8614 10.7306 22.8614 9.36854 21.4568Z\",\n fill: \"white\"\n});\n\nvar _ref7 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M21.5337 8.91186C22.8958 10.3164 22.8958 12.5937 21.5337 13.9983L17.9067 17.7385L12.9742 12.6521L16.6012 8.91186C17.9633 7.50728 20.1717 7.50728 21.5337 8.91186Z\",\n fill: \"#FF405C\"\n});\n\nvar _ref8 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M9.40378 21.4756L15.4667 15.2234L17.9056 17.7384L14.2816 21.4756C12.9346 22.8646 10.7507 22.8646 9.40378 21.4756Z\",\n fill: \"#D1FEFB\"\n});\n\nvar _ref9 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M15.4685 15.2244L21.5581 8.94463C22.9047 10.3332 22.9047 12.5845 21.5581 13.973L17.9066 17.7386L15.4685 15.2244Z\",\n fill: \"#D01273\"\n});\n\nfunction SvgIconPillsNoBackground(_ref, svgRef) {\n var title = _ref.title,\n titleId = _ref.titleId,\n props = _objectWithoutProperties(_ref, [\"title\", \"titleId\"]);\n\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n width: 24,\n height: 24,\n viewBox: \"0 0 24 24\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, _ref2, _ref3, _ref4, _ref5, _ref6, _ref7, _ref8, _ref9);\n}\n\nvar ForwardRef = /*#__PURE__*/React.forwardRef(SvgIconPillsNoBackground);\nexport default __webpack_public_path__ + \"static/media/Icon-pills-noBackground.3d6ea7b0.svg\";\nexport { ForwardRef as ReactComponent };","import { Accordion, AccordionDetails, Typography } from '@material-ui/core';\nimport ExpandMoreIcon from '@material-ui/icons/ExpandMore';\nimport styled from 'styled-components';\nimport { ReactComponent as MedicationIcon } from '../../assets/Icon-pills-noBackground.svg';\n\nexport const StyledAccordion = styled(Accordion)`\n background-color: ${({ theme }) => theme.palette.info.main};\n color: white;\n border-radius: 5px;\n width: 100%;\n margin-bottom: ${({ theme }) => theme.spacing(1.5)}px;\n`;\n\nexport const StyledExpandMoreIcon = styled(ExpandMoreIcon)`\n fill: white;\n`;\n\nexport const StyledTitle = styled(Typography)`\n font-size: 1.1em;\n font-weight: bold;\n margin-left: ${({ theme }) => theme.spacing(4)}px;\n`;\n\nexport const StyledMedicationIcon = styled(MedicationIcon)`\n width: 24px;\n height: 24px;\n min-width: 24px;\n min-height: 24px;\n`;\n\nexport const StyledAccordionDetails = styled(AccordionDetails)`\n display: block;\n`;\n\nexport const StyledTypography = styled(Typography)`\n margin-block: ${({ theme }) => theme.spacing(1)}px;\n`;\n\nexport const DoseTimesContainer = styled.div`\n margin-bottom: ${({ theme }) => theme.spacing(1)}px;\n`;\n","import {\n EventSchedule,\n EventSubCategoryModel,\n MedicationModel,\n} from '@cuidador/database';\nimport { FrequencyType } from '../DaysSelector';\nimport { PeriodType } from '../PeriodSelector';\n\nexport enum CustomMedicationInterval {\n WeekDays = 'Apenas alguns dias',\n Custom = 'Personalizado',\n}\n\nexport enum MedicationInsertFormStep {\n SelectMedication,\n FillDetails,\n}\n\nexport interface FormValues {\n dosageFormat: MedicationModel['dosageFormat'];\n dosageQuantity: number;\n administeredBy: MedicationModel['administeredBy'];\n subCategory?: EventSubCategoryModel;\n subCategoryId?: Id;\n name?: string;\n scheduleType?: EventSchedule['scheduleType'];\n frequencyRule?: string;\n ifNecessary?: boolean;\n medicalNotes?: string;\n eventScheduleId?: Id;\n dayOptions?: FrequencyType;\n days?: string[];\n rangeInDays?: '2d' | '3d' | '5d' | '7d' | '15d' | '30d' | 'custom';\n customRangeInDays?: number;\n timeSchedule?: string;\n time?: string;\n customTimes?: string[];\n frequencyStartsAt?: string;\n frequencyEndsAt?: string;\n periodType: PeriodType;\n}\n\nexport const dosesNames = [\n { id: 1, value: 'pill', name: 'Comprimido' },\n { id: 2, value: 'capsule', name: 'Cápsula' },\n { id: 3, value: 'sachet', name: 'Sachê' },\n { id: 4, value: 'drops', name: 'Gota' },\n { id: 5, value: 'ampoule', name: 'Ampola' },\n { id: 6, value: 'suppository', name: 'Supositório' },\n { id: 7, value: 'inhaled', name: 'Jato/Puff' },\n { id: 8, value: 'unit', name: 'Unidade internacional (UI)' },\n { id: 9, value: 'ml', name: 'ml' },\n { id: 10, value: 'spoon', name: 'Colher' },\n { id: 11, value: 'grams', name: 'Grama' },\n { id: 12, value: 'strip', name: 'Placa/Tira/Fita' },\n { id: 13, value: 'sticker', name: 'Adesivo' },\n];\n\nexport const administeredNames = [\n { id: 1, value: 'oral', name: 'Oral' },\n { id: 2, value: 'sublingual', name: 'Sublingual' },\n { id: 3, value: 'subcutaneous', name: 'Subcutânea' },\n { id: 4, value: 'intravenous', name: 'Intravenosa' },\n { id: 5, value: 'intramuscular', name: 'Intramuscular' },\n { id: 6, value: 'tube', name: 'Sonda' },\n { id: 7, value: 'rectal', name: 'Retal' },\n { id: 8, value: 'inhalation', name: 'Inalatório' },\n { id: 9, value: 'topic', name: 'Tópico (Cutânea)' },\n { id: 10, value: 'ocular', name: 'Ocular' },\n { id: 11, value: 'auricular', name: 'Auricular (Otológica)' },\n { id: 12, value: 'vaginal', name: 'Vaginal' },\n];\n\nexport const frequencyOptions = [\n { value: '2h', label: '2h/2h' },\n { value: '4h', label: '4h/4h' },\n { value: '6h', label: '6h/6h' },\n { value: '8h', label: '8h/8h' },\n { value: '12h', label: '12h/12h' },\n { value: '24h', label: '24h/24h (1 vez ao dia)' },\n { value: '48h', label: '48h/48h (a cada 2 dias)' },\n { value: '72h', label: '72h/72h (a cada 3 dias)' },\n { value: '1w', label: 'Semanal' },\n { value: '2w', label: 'Quinzenal' },\n { value: '1M', label: 'Mensal' },\n { value: '6M', label: 'Semestral' },\n];\n\nexport interface MedicationItem {\n description?: string;\n name: string;\n id: number;\n}\n","import { EventScheduleModel, MedicationModel } from '@cuidador/database';\nimport { Typography } from '@material-ui/core';\nimport { format, subMinutes } from 'date-fns';\nimport React from 'react';\nimport { getLocalWeeklySchedule, weekdayMap } from '../../utils/date';\nimport { administeredNames } from '../MedicationInsertForm/MedicationSecondStep/utils';\n\nexport function getSelectedWeekdaysText(medication: MedicationModel) {\n if (!medication.eventSchedule || !medication.eventSchedule.frequencyStartsAt)\n return '';\n\n const { mon, tue, wed, thu, fri, sat, sun } = medication.eventSchedule || {};\n const utcSchedule = { mon, tue, wed, thu, fri, sat, sun };\n const date = new Date(medication.eventSchedule.frequencyStartsAt);\n const utcTime = `${date\n .getUTCHours()\n .toString()\n .padStart(2, '0')}:${date.getUTCMinutes().toString().padStart(2, '0')}`;\n const localSchedule = getLocalWeeklySchedule(utcSchedule, utcTime);\n\n const selectedWeekDays: string[] = [];\n if (localSchedule.mon) selectedWeekDays.push(weekdayMap.mon);\n if (localSchedule.tue) selectedWeekDays.push(weekdayMap.tue);\n if (localSchedule.wed) selectedWeekDays.push(weekdayMap.wed);\n if (localSchedule.thu) selectedWeekDays.push(weekdayMap.thu);\n if (localSchedule.fri) selectedWeekDays.push(weekdayMap.fri);\n if (localSchedule.sat) selectedWeekDays.push(weekdayMap.sat);\n if (localSchedule.sun) selectedWeekDays.push(weekdayMap.sun);\n\n if (selectedWeekDays.length === 7) return 'todos os dias,';\n\n const formattingSelectedWeekDays = selectedWeekDays.reduce(\n (accumulatorString, weekday, index) =>\n `${accumulatorString}${index > 0 ? ' - ' : ''}${weekday.toLowerCase()}`,\n ''\n );\n\n return `${formattingSelectedWeekDays},`;\n}\n\nexport function getMedicationIntervalText(medication: MedicationModel) {\n const { eventSchedule } = medication;\n\n if (!eventSchedule) return null;\n\n const startDate = eventSchedule.frequencyStartsAt;\n const endDate = eventSchedule.frequencyEndsAt;\n\n if (startDate && endDate) {\n const formatedStartDate = format(new Date(startDate), 'dd/MM/yyyy');\n const formatedEndDate = format(new Date(endDate), 'dd/MM/yyyy');\n return (\n

    \n Início: {formatedStartDate}\n
    Fim: {formatedEndDate}\n

    \n );\n } else if (startDate) {\n const formatedStartDate = format(new Date(startDate), 'dd/MM/yyyy');\n return (\n

    \n Início: {formatedStartDate}\n

    \n );\n }\n}\n\nexport function getMedicationEndDateText(medication: MedicationModel) {\n if (!medication.eventSchedule?.frequencyEndsAt) return 'continuamente';\n\n const endDate = format(\n new Date(medication.eventSchedule.frequencyEndsAt),\n 'dd/MM/yyyy'\n );\n return `até ${endDate}`;\n}\n\nexport const renderDoseTimes = (medication: MedicationModel) => {\n const { eventSchedule } = medication;\n if (!eventSchedule) return null;\n\n if (eventSchedule.customTimes && eventSchedule.customTimes.length > 0) {\n return renderCustomTimes(eventSchedule);\n } else {\n return renderTimes(eventSchedule!);\n }\n};\n\nconst renderCustomTimes = (eventSchedule: EventScheduleModel) => {\n const times = eventSchedule?.customTimes?.map((time) => {\n const now = new Date();\n const hours = Number(time.happensAt!.split(':')[0]);\n const minutes = Number(time.happensAt!.split(':')[1]);\n now.setHours(hours);\n now.setMinutes(minutes);\n return format(subMinutes(now, now.getTimezoneOffset()), 'HH:mm');\n });\n return renderTimesBox(times);\n};\n\nconst renderTimes = (eventSchedule: EventScheduleModel) => {\n if (!eventSchedule?.frequencyRule || !eventSchedule.frequencyStartsAt)\n return null;\n\n const startTime = format(new Date(eventSchedule.frequencyStartsAt), 'HH:mm');\n const doseTimes = handleDoses(startTime, eventSchedule.frequencyRule);\n\n return renderTimesBox(doseTimes);\n};\n\nexport const handleDoses = (startTime: string, frequency: string) => {\n const formattedFrequency = Number(frequency.replace('h', ''));\n const [hour, minute] = startTime.split(':');\n const formattedHour = Number(hour);\n const doses: number[] = [];\n const firstMedicationTime = formattedHour % formattedFrequency;\n for (\n let medicationTime = firstMedicationTime;\n medicationTime <= 23;\n medicationTime += formattedFrequency\n ) {\n doses.push(medicationTime);\n }\n\n const formattedDoses = doses.map((item) => {\n return item.toString().padStart(2, '0') + ':' + minute;\n });\n\n return formattedDoses;\n};\n\nconst renderTimesBox = (times?: string[]) => {\n return (\n <>\n {times?.map((time, index) => (\n \n {index + 1}ª medicação: {time}\n \n ))}\n \n );\n};\n\nexport function renderAdministration(medication: MedicationModel) {\n const days = resolveDays(medication);\n\n const administeredBy = `via ${administeredNames\n .find((elem) => elem.value === medication.administeredBy)\n ?.name.toLowerCase()}`;\n\n const dosage = resolveDosage(\n medication.dosageQuantity,\n medication.dosageFormat\n );\n\n return `${days} ${dosage} ${administeredBy}`;\n}\n\nconst resolveDays = (medication: MedicationModel) => {\n if (medication.ifNecessary) {\n return 'se necessário,';\n } else if (medication.eventSchedule?.frequencyRule === '1d') {\n return getSelectedWeekdaysText(medication);\n } else {\n return `a cada ${medication?.eventSchedule?.frequencyRule?.slice(\n 0,\n -1\n )} dias,`;\n }\n};\n\nexport const resolveDosage = (\n dosageQuantity?: number,\n dosageFormat?: MedicationModel['dosageFormat']\n) => {\n let grammaticallyFormattedDosage;\n switch (dosageFormat) {\n case 'pill':\n grammaticallyFormattedDosage =\n dosageQuantity === 1 ? 'comprimido' : 'comprimidos';\n break;\n case 'capsule':\n grammaticallyFormattedDosage =\n dosageQuantity === 1 ? 'cápsula' : 'cápsulas';\n break;\n case 'sachet':\n grammaticallyFormattedDosage = dosageQuantity === 1 ? 'sachê' : 'sachês';\n break;\n case 'drops':\n grammaticallyFormattedDosage =\n Number(dosageQuantity) <= 1 ? 'gota' : 'gotas';\n break;\n case 'ampoule':\n grammaticallyFormattedDosage =\n dosageQuantity === 1 ? 'ampola' : 'ampolas';\n break;\n case 'suppository':\n grammaticallyFormattedDosage =\n dosageQuantity === 1 ? 'supositório' : 'supositórios';\n break;\n case 'inhaled':\n grammaticallyFormattedDosage =\n dosageQuantity === 1 ? 'jato/puff' : 'jatos/puffs';\n break;\n case 'unit':\n grammaticallyFormattedDosage =\n dosageQuantity === 1\n ? 'unidade internacional'\n : 'unidades internacionais';\n break;\n case 'ml':\n grammaticallyFormattedDosage = 'ml';\n break;\n case 'spoon':\n grammaticallyFormattedDosage =\n dosageQuantity === 1 ? 'colher' : 'colheres';\n break;\n case 'grams':\n grammaticallyFormattedDosage = dosageQuantity === 1 ? 'grama' : 'gramas';\n break;\n case 'strip':\n grammaticallyFormattedDosage =\n dosageQuantity === 1 ? 'placa/tira/fita' : 'placas/tiras/fitas';\n break;\n case 'sticker':\n grammaticallyFormattedDosage =\n dosageQuantity === 1 ? 'adesivo' : 'adesivos';\n break;\n }\n\n return `${dosageQuantity} ${grammaticallyFormattedDosage},`;\n};\n","import { MedicationModel } from '@cuidador/database';\nimport { AccordionActions, AccordionSummary, Divider } from '@material-ui/core';\nimport EditIcon from '@material-ui/icons/Edit';\nimport React from 'react';\nimport { useHistory } from 'react-router-dom';\nimport {\n StyledAccordion,\n StyledAccordionDetails,\n StyledExpandMoreIcon,\n StyledMedicationIcon,\n StyledTitle,\n StyledTypography,\n} from './styles';\nimport {\n getMedicationIntervalText,\n renderDoseTimes,\n renderAdministration,\n} from './utils';\n\ntype MedicationCardProps = {\n medication: MedicationModel;\n route?: string;\n};\n\nexport default function MedicationCard({\n medication,\n route,\n}: MedicationCardProps) {\n const history = useHistory();\n return (\n \n }>\n \n \n {medication.subCategory?.medicationCatalogItem?.name ||\n medication.subCategory?.name}\n \n \n\n \n\n \n {medication.subCategory?.medicationCatalogItem?.description && (\n \n {medication.subCategory?.medicationCatalogItem?.description}\n \n )}\n {getMedicationIntervalText(medication)}\n {renderDoseTimes(medication)}\n \n Administração: {renderAdministration(medication)}\n \n {medication.medicalNotes && medication.medicalNotes.length > 0 && (\n \n Recomendações: \n {medication.medicalNotes}\n \n )}\n \n\n \n {route && (\n {\n history.push(`${route}/${medication.id}`);\n }}\n />\n )}\n \n \n );\n}\n","import Accordion from '@material-ui/core/Accordion';\nimport Typography from '@material-ui/core/Typography';\nimport styled from 'styled-components';\nimport Fab from '../../components/Fab';\nimport StyledButton from '../../components/StyledButton';\n\nexport const Container = styled.div`\n display: flex;\n flex-direction: column;\n flex: 1;\n align-items: center;\n background-color: #fafafa;\n padding: ${({ theme }) => theme.spacing(2, 2)};\n`;\n\nexport const ListContainer = styled.div`\n width: 100%;\n`;\n\nexport const ListContainerWithBorder = styled(ListContainer)`\n border-top: 1px solid;\n border-color: ${({ theme }) => theme.palette.primary.main};\n margin-bottom: ${({ theme }) => theme.spacing(5)}px;\n`;\n\nexport const StyledAccordion = styled(Accordion)`\n box-shadow: none;\n background-color: inherit;\n\n > .MuiAccordionSummary-root {\n padding: 0px;\n }\n`;\n\nexport const StyledFab = styled(Fab)`\n bottom: ${({ theme }) => theme.spacing(2)}px;\n right: ${({ theme }) => theme.spacing(2)}px;\n`;\n\nexport const TypographyContainer = styled.div`\n width: 100%;\n text-align: center;\n color: ${({ theme }) => theme.palette.primary.main};\n margin: ${({ theme }) => theme.spacing(1, 0)};\n`;\n\nexport const StyledTypography = styled(Typography)`\n color: ${({ theme }) => theme.palette.primary.dark};\n margin: ${({ theme }) => theme.spacing(1, 0)};\n font-size: 18px;\n`;\n\nexport const ButtonContainer = styled.div`\n width: 100%;\n text-align: center;\n color: ${({ theme }) => theme.palette.primary.main};\n margin: ${({ theme }) => theme.spacing(1, 0)};\n`;\n\nexport const StyledBuyButton = styled(StyledButton)`\n margin: ${({ theme }) => theme.spacing(2)}px;\n`;\n","import { MedicationModel } from '@cuidador/database';\nimport { format } from 'date-fns';\nimport { handleDoses } from '../../components/MedicationCard/utils';\nimport { convertTimeToDate } from '../../utils/date';\n\n/**\n * sort medications by dose times putting ifNecessary medications in last indexes\n */\nexport const sortMedicationsByDoseTime = (\n a: MedicationModel,\n b: MedicationModel\n) => {\n if (a.ifNecessary) return 1;\n else if (b.ifNecessary) return -1;\n\n return getFirstDoseTimeFromMedication(a) < getFirstDoseTimeFromMedication(b)\n ? -1\n : 1;\n};\n\nconst getFirstDoseTimeFromMedication = (medication: MedicationModel) => {\n if (medication.eventSchedule?.scheduleType === 'custom_frequency') {\n return getFirstDoseTimeFromCustomTimeMedication(medication);\n } else {\n return getFirstDoseTimeFromFixedTimeMedication(medication);\n }\n};\n\nconst getFirstDoseTimeFromCustomTimeMedication = (\n medication: MedicationModel\n) => {\n const sortedHappensAt = medication.eventSchedule?.customTimes\n ?.map(({ happensAt }) =>\n format(new Date(convertTimeToDate(happensAt || '')), 'HH:mm')\n )\n ?.sort((a, b) => (String(a) < String(b) ? -1 : 1));\n return sortedHappensAt ? String(sortedHappensAt[0]) : '';\n};\n\nconst getFirstDoseTimeFromFixedTimeMedication = (\n medication: MedicationModel\n) => {\n if (\n !medication.eventSchedule?.frequencyRule ||\n !medication.eventSchedule.frequencyStartsAt\n )\n return '';\n\n const startTime = format(\n new Date(medication.eventSchedule.frequencyStartsAt),\n 'HH:mm'\n );\n\n const doseTimes = handleDoses(\n startTime,\n medication.eventSchedule.frequencyRule\n );\n return doseTimes[0];\n};\n","import { useContext } from 'react'\nimport { AuthContext } from '../contexts/auth'\nimport { MedicationModel } from '@cuidador/database'\nimport { toast } from 'react-toastify'\nimport { resolveDosage } from '../components/MedicationCard/utils'\nimport { format, formatISO } from 'date-fns'\nimport { ptBR } from 'date-fns/locale'\n\nexport function useDoseCerta () {\n const { userInfo } = useContext(AuthContext)\n\n const baseWhatsappUrl = 'https://api.whatsapp.com/send'\n const doseCertaPhone = '551142103937'\n const patientName = userInfo?.activePatient?.name\n\n const createRequest = (medications: MedicationModel[]) => {\n try {\n if (!userInfo?.user?.name) {\n toast.error('Não foi possível solicitar o orçamento dos medicamentos, tente mais tarde.')\n throw new Error('Error on dose certa(Raia/Drogasil) request handler - User without name')\n }\n\n if (!medications || medications?.length === 0) {\n toast.error('É necessário ao menos um medicamento em uso para solicitar o orçamento.')\n throw new Error('Error on dose certa(Raia/Drogasil) request handler - empty medication list')\n }\n\n const medicationsList = medications.map((medication, index) => {\n const medicationName = medication.subCategory?.name\n const medicationDosage = resolveDosage(medication.dosageQuantity, medication.dosageFormat).slice(0, -1)\n const medicationDailyDose = medication.eventSchedule?.customTimes?.length\n\n const startDate = medication.eventSchedule?.frequencyStartsAt\n const endDate = medication.eventSchedule?.frequencyEndsAt\n\n const formattedPeriod = endDate\n ? `de ${format(new Date(startDate!), 'P', { locale: ptBR })} até ${format(new Date(endDate), 'P', { locale: ptBR })}.`\n : 'todos os dias.'\n\n const doseAndPeriod = medication.ifNecessary\n ? 'apenas se necessário.'\n : `${medicationDailyDose} vezes por dia, ${formattedPeriod}`\n\n return `${index + 1}) ${medicationName} - ${medicationDosage} - ${doseAndPeriod}`\n })\n .join('\\n\\n')\n\n const textToSend = encodeURIComponent(\n `Olá, gostaria de comprar a medicação em uso para ${patientName}. Agradeço o envio do orçamento e condição de entrega!\\n\\n${medicationsList}`\n )\n\n const url = `${baseWhatsappUrl}?phone=${doseCertaPhone}&text=${textToSend}`\n\n window.open(url, '_blank', 'noreferrer')\n window.focus()\n\n toast.success('Orçamento solicitado.')\n } catch (err: any) {\n if (err instanceof Error && err.message === 'Network Error') {\n toast.error('Você está sem internet no momento, tente mais tarde.')\n } else {\n toast.error('Não foi possível solicitar o orçamento dos medicamentos, tente mais tarde.')\n }\n\n throw err;\n }\n }\n\n return {\n createRequest\n }\n}\n","import { MedicationModel } from '@cuidador/database'\nimport AccordionSummary from '@material-ui/core/AccordionSummary'\nimport Typography from '@material-ui/core/Typography'\nimport AddIcon from '@material-ui/icons/AddRounded'\nimport ExpandMoreIcon from '@material-ui/icons/ExpandMore'\nimport React, { useContext, useEffect, useState } from 'react'\nimport { useHistory } from 'react-router'\nimport { toast } from 'react-toastify'\nimport BuyMedicationDialog from '../../components/BuyMedicationDialog'\nimport LoadingBackdrop from '../../components/LoadingBackdrop'\nimport MedicationCard from '../../components/MedicationCard'\nimport PendingRegistrationBanner from '../../components/PendingRegistrationBanner'\nimport ReportDownloadButton from '../../components/ReportDownloadButton'\nimport StyledButton from '../../components/StyledButton'\nimport { AuthContext } from '../../contexts/auth'\nimport useCanAccess from '../../hooks/useCanAccess'\nimport useMedication from '../../hooks/useMedication'\nimport {\n ButtonContainer,\n Container,\n ListContainer,\n ListContainerWithBorder,\n StyledAccordion,\n StyledFab,\n StyledTypography,\n TypographyContainer,\n StyledBuyButton,\n} from './styles'\nimport { sortMedicationsByDoseTime } from './utils'\nimport { Header } from '../../components/Header'\nimport { BackButton } from '../../components/BackButton'\nimport { PageTitle } from '../../components/PageTitle'\nimport { PscButton } from '../../components/PscButton'\nimport { useDoseCerta } from '../../hooks/useDoseCerta'\n\nconst Medication: React.FC = () => {\n const MEDICATION_ROUTE = '/medicamentos_v2'\n const history = useHistory()\n const [finishedMedications, setFinishedMedications] = useState<\n MedicationModel[]\n >()\n const [totalFinishedMedications, setTotalFinishedMedications] = useState(0)\n const [page, setPage] = useState(0)\n const { userInfo } = useContext(AuthContext)\n const {\n getAllByPatientId: getCurrentMedications,\n byId,\n ids: currentMedicationIds,\n loading,\n createReportByPatientId,\n getReportDownloadLinkByPatientId,\n getScheduledMedicationsByPatientId: getFinishedMedications,\n } = useMedication()\n const {\n isAllowedToRead: isAllowedToReadMedication,\n isAllowedToCreate: isAllowedToCreateMedication,\n } = useCanAccess('care/medication')\n const { isAllowedToCreate: isAllowedToCreateMedicationReport } = useCanAccess(\n 'report/medication'\n )\n const { isAllowedToRead: isAllowedToReadMedicationReport } = useCanAccess(\n 'media/patient/report/medication'\n )\n const { createRequest } = useDoseCerta()\n const [downloadLink, setDownloadLink] = useState('')\n const [isBuyDialogOpen, setIsBuyDialogOpen] = useState(false)\n const patientId = userInfo?.activePatientId\n\n useEffect(() => {\n if (!isAllowedToReadMedication) {\n toast.error('Você não tem permissão para visualizar essa página')\n history.goBack()\n return\n }\n if (!patientId) return\n\n getCurrentMedications(patientId, {\n orderBy: 'eventSchedule.frequencyEndsAt',\n order: 'desc',\n minFrequencyEndsAt: new Date().toISOString(),\n })\n getFinishedMedications(patientId, {\n orderBy: 'eventSchedule.frequencyEndsAt',\n order: 'desc',\n page,\n 'eventSchedule.frequencyEndsAt(max)': new Date().toISOString(),\n }).then((response) => {\n if (response?.total > 0) {\n setTotalFinishedMedications(response.total)\n setFinishedMedications(\n finishedMedications\n ? [...finishedMedications, ...response.results]\n : [...response.results]\n )\n }\n })\n }, [patientId, page])\n\n const pageIncrement = () => {\n setPage(page + 1)\n }\n\n const handleCreateReportAndGetDownloadLink = async () => {\n createMedicationReport()\n .then(() => getMedicationReportDownloadUrl())\n .then((signedUrl) => setDownloadLink(signedUrl))\n }\n\n const createMedicationReport = async () => {\n try {\n await createReportByPatientId(Number(userInfo?.activePatientId))\n toast.success('Relátorio de medicamentos gerado com sucesso')\n } catch (err) {\n toast.error('Erro ao gerar relatório de medicamentos')\n }\n }\n\n const getMedicationReportDownloadUrl = async (): Promise => {\n try {\n const { signedUrl } = await getReportDownloadLinkByPatientId(\n Number(userInfo?.activePatientId)\n )\n return signedUrl\n } catch (err) {\n toast.error('Erro ao baixar relatório de medicamentos')\n return ''\n }\n }\n\n const buyMedications = async () => {\n const medications = currentMedicationIds.map((id) => byId[id])\n createRequest(medications)\n setIsBuyDialogOpen(false)\n }\n\n return (\n <>\n history.push('/cadastros')} />\n }\n centerContent={\n \n }\n rightContent={\n \n }\n />\n \n \n \n \n {currentMedicationIds.length <= 0 ? (\n \n Não há medicamentos em uso.\n \n Não existem medicamentos em uso cadastrados no momento.\n \n \n ) : (\n <>\n \n Lista de medicamentos\n \n {isAllowedToReadMedicationReport &&\n isAllowedToCreateMedicationReport && (\n \n )}\n \n {`Medicamentos em uso (${currentMedicationIds.length})`}\n \n {currentMedicationIds\n .map((id) => byId[id])\n .sort(sortMedicationsByDoseTime)\n .map((medication) => (\n \n ))}\n \n )}\n \n {currentMedicationIds.length > 0 && (\n setIsBuyDialogOpen(true)}\n color=\"secondary\"\n data-testid=\"buy-medications\"\n >\n Comprar medicamentos\n \n )}\n {finishedMedications && (\n \n \n }\n data-testid={'finished-medication-accordion'}\n >\n \n {`Medicamentos finalizados (${totalFinishedMedications})`}\n \n \n {finishedMedications.map((medication) => (\n \n ))}\n {finishedMedications.length < totalFinishedMedications && (\n \n \n Ver mais\n \n \n )}\n \n \n )}\n\n {isAllowedToCreateMedication && (\n \n \n \n )}\n \n setIsBuyDialogOpen(false)}\n onConfirm={buyMedications}\n isLoading={false}\n />\n \n )\n}\n\nexport default Medication\n","import React, { useState } from 'react';\nimport { useDebouncedCallback } from 'use-debounce';\nimport Autocomplete from '@material-ui/lab/Autocomplete';\n\nimport StyledTextField, { StyledTextFieldProps } from '../StyledTextField';\nimport { CircularProgress } from '@material-ui/core';\n\nexport type Option = {\n value: number;\n text: string;\n};\n\nexport type Value = Option | null;\n\ntype AutocompleteFieldProps = {\n initialValue?: Value;\n onChangeDebounced: (inputText: string) => Promise;\n onValueChange: (listValue: Value) => void;\n label?: string;\n testId?: string;\n getOptionLabel?: (option: Option) => string;\n getOptionSelected?: (option: Option, value: Value) => boolean;\n} & StyledTextFieldProps;\n\nconst AutocompleteTextField: React.FC = ({\n getOptionLabel = (option: Option) => option.text,\n getOptionSelected = (option: Option, value: Value) =>\n option?.value === value?.value,\n onChangeDebounced,\n initialValue,\n testId,\n color,\n label,\n onValueChange,\n margin,\n}) => {\n const [data, setData] = useState([]);\n const [loading, setLoading] = useState(false);\n\n const debounced = useDebouncedCallback(async (inputText) => {\n setLoading(true);\n const newListValues = await onChangeDebounced(inputText);\n setData(newListValues || []);\n setLoading(false);\n }, 1000);\n\n return (\n debounced.callback(textValue)}\n onChange={(e, value) => onValueChange(value)}\n getOptionSelected={getOptionSelected}\n renderInput={(params) => (\n \n {loading ? (\n \n ) : null}\n {params.InputProps.endAdornment}\n \n ),\n }}\n inputProps={{\n ...params.inputProps,\n 'data-testid': testId,\n }}\n />\n )}\n />\n );\n};\n\nexport default AutocompleteTextField;\n","import {\n Backdrop as MaterialBackdrop,\n Checkbox,\n CircularProgress as MaterialCircularProgress,\n} from '@material-ui/core';\nimport { Form as FormikForm } from 'formik';\nimport { Link } from 'react-router-dom';\nimport styled from 'styled-components';\n\nexport const Container = styled.div`\n display: flex;\n flex: 1;\n background-color: ${({ theme }) => theme.palette.common.white};\n padding: ${({ theme }) => theme.spacing(2)}px;\n display: flex;\n flex-direction: column;\n color: ${({ theme }) => theme.palette.secondary.main};\n`;\n\nexport const Form = styled(FormikForm)`\n display: flex;\n flex: 1;\n flex-direction: column;\n width: 100%;\n color: ${({ theme }) => theme.palette.secondary.main};\n`;\n\nexport const TypographyContainer = styled.div`\n max-width: 100%;\n text-align: center;\n`;\n\nexport const StyledLink = styled(Link)`\n text-decoration: none;\n`;\n\nexport const Centralizer = styled.div`\n align-items: center;\n flex-direction: column;\n display: flex;\n flex: 1;\n justify-content: flex-end;\n`;\n\nexport const Backdrop = styled(MaterialBackdrop)`\n z-index: ${({ theme }) => theme.zIndex.drawer + 1};\n color: ${({ theme }) => theme.palette.primary.light};\n position: absolute;\n`;\n\nexport const BackdropCircularProgress = styled(MaterialCircularProgress).attrs({\n color: 'inherit',\n})``;\n\nexport const StyledCheckbox = styled(Checkbox).attrs({\n color: 'secondary',\n})`\n color: ${({ theme }) => theme.palette.secondary.main};\n`;\n","import { format, parse } from 'date-fns';\nimport * as Yup from 'yup';\nimport {\n EventSchedule,\n EventSubCategoryModel,\n MedicationModel,\n} from '@cuidador/database';\n\nexport const needScheduleData = (values: FormValues): boolean => {\n return values.continuous || !values.ifNecessary;\n};\n\nexport interface FormValues {\n subCategory?: EventSubCategoryModel;\n subCategoryId?: Id;\n name?: string;\n dosageFormat?: MedicationModel['dosageFormat'];\n dosageQuantity?: string;\n administeredBy?: MedicationModel['administeredBy'];\n scheduleType?: EventSchedule['scheduleType'];\n frequencyRule: string;\n frequencyStartsAt: string;\n frequencyEndsAt: string;\n mon?: boolean;\n tue?: boolean;\n wed?: boolean;\n thu?: boolean;\n fri?: boolean;\n sat?: boolean;\n sun?: boolean;\n continuous?: boolean;\n ifNecessary?: boolean;\n startDate?: string;\n endDate?: string;\n time?: string;\n medicalNotes?: string;\n eventScheduleId?: Id;\n}\n\nexport const medicationModelToFormValues = (\n data: MedicationModel\n): FormValues => {\n let formattedDate;\n let formattedTime;\n let formattedEndDate;\n\n if (data?.eventSchedule?.frequencyStartsAt) {\n formattedDate = format(\n new Date(data?.eventSchedule?.frequencyStartsAt),\n 'yyyy-MM-dd'\n );\n formattedTime = format(\n new Date(data?.eventSchedule?.frequencyStartsAt),\n 'HH:mm'\n );\n\n if (data?.eventSchedule?.frequencyEndsAt) {\n formattedEndDate = format(\n new Date(data?.eventSchedule?.frequencyEndsAt),\n 'yyyy-MM-dd'\n );\n }\n }\n\n return {\n subCategory: data?.subCategory,\n subCategoryId: data?.subCategory?.id || undefined,\n name: data?.subCategory?.name || '',\n dosageFormat: data?.dosageFormat || undefined,\n dosageQuantity: data.dosageQuantity ? String(data.dosageQuantity) : '',\n administeredBy: data?.administeredBy || undefined,\n frequencyRule: data?.eventSchedule?.frequencyRule || '',\n time: formattedTime || '',\n startDate: formattedDate || format(new Date(), 'yyyy-MM-dd'),\n endDate: formattedEndDate || '',\n frequencyStartsAt: data?.eventSchedule?.frequencyStartsAt || '',\n frequencyEndsAt: data?.eventSchedule?.frequencyEndsAt || '',\n medicalNotes: data?.medicalNotes || undefined,\n eventScheduleId: data?.eventSchedule?.id || undefined,\n continuous:\n data?.eventSchedule?.frequencyEndsAt === undefined\n ? false\n : Boolean(!data?.eventSchedule?.frequencyEndsAt),\n ifNecessary: Boolean(data.ifNecessary),\n } as FormValues;\n};\n\nexport const formDataToMedicationModel = (\n data: FormValues,\n patientId: Id\n): MedicationModel => {\n const startIsoDate = needScheduleData(data)\n ? parse(\n `${data.startDate} ${data.time}`,\n 'yyyy-MM-dd HH:mm',\n new Date()\n ).toISOString()\n : '';\n\n let endIsoDate;\n if (data.endDate) {\n endIsoDate = needScheduleData(data)\n ? parse(\n `${data.endDate} ${data.time}`,\n 'yyyy-MM-dd HH:mm',\n new Date()\n ).toISOString()\n : '';\n }\n\n if (data.continuous) {\n endIsoDate = undefined;\n }\n\n return {\n dosageFormat: data?.dosageFormat || undefined,\n dosageQuantity: data.dosageQuantity\n ? parseFloat(data?.dosageQuantity)\n : undefined,\n administeredBy: data?.administeredBy || undefined,\n subCategoryId: (data?.subCategoryId as number) || undefined,\n patientId: (patientId as number) || undefined,\n medicalNotes: data?.medicalNotes || undefined,\n ifNecessary: Boolean(data?.ifNecessary),\n eventSchedule: needScheduleData(data)\n ? {\n id: (data?.eventScheduleId as number) || undefined,\n frequencyRule: data?.frequencyRule || '',\n frequencyStartsAt: startIsoDate || '',\n frequencyEndsAt: endIsoDate || undefined,\n mon: data?.mon || true,\n tue: data?.tue || true,\n wed: data?.wed || true,\n thu: data?.thu || true,\n fri: data?.fri || true,\n sat: data?.sat || true,\n sun: data?.sun || true,\n scheduleType: 'frequency',\n }\n : undefined,\n };\n};\n\nexport const validationSchema = Yup.object().shape({\n subCategoryId: Yup.number().required('Por favor, insira um medicamento.'),\n dosageFormat: Yup.string().required('Por favor, insira um formato de dose.'),\n dosageQuantity: Yup.string().required(\n 'Por favor, insira uma quantidade (em números) por dose.'\n ),\n administeredBy: Yup.string().required(\n 'Por favor, insira uma via de aplicação.'\n ),\n\n frequencyRule: Yup.string().when('ifNecessary', {\n is: true,\n otherwise: Yup.string().required('Por favor, insira uma frequência.'),\n then: Yup.string().when('continuous', {\n is: true,\n then: Yup.string().required('Por favor, insira uma frequência.'),\n }),\n }),\n startDate: Yup.string().when('ifNecessary', {\n is: true,\n otherwise: Yup.string().required('Por favor, insira uma data inicial.'),\n then: Yup.string().when('continuous', {\n is: true,\n then: Yup.string().required('Por favor, insira uma data inicial.'),\n }),\n }),\n endDate: Yup.string().when('continuous', {\n is: false,\n then: Yup.string().when('ifNecessary', {\n is: false,\n then: Yup.string().required('Por favor, insira uma data final.'),\n }),\n }),\n time: Yup.string().when('ifNecessary', {\n is: true,\n otherwise: Yup.string().required('Por favor, insira um horário.'),\n then: Yup.string().when('continuous', {\n is: true,\n then: Yup.string().required('Por favor, insira um horário.'),\n }),\n }),\n});\n\nexport const dosesNames = [\n { id: 1, value: 'pill', name: 'Comprimido' },\n { id: 2, value: 'capsule', name: 'Cápsula' },\n { id: 3, value: 'sachet', name: 'Sachê' },\n { id: 4, value: 'drops', name: 'Gota' },\n { id: 5, value: 'ampoule', name: 'Ampola' },\n { id: 6, value: 'suppository', name: 'Supositório' },\n { id: 7, value: 'inhaled', name: 'Jato' },\n { id: 8, value: 'unit', name: 'Unidade' },\n];\n\nexport const administeredNames = [\n { id: 1, value: 'oral', name: 'Oral' },\n { id: 2, value: 'sublingual', name: 'Sublingual' },\n { id: 3, value: 'subcutaneous', name: 'Subcutânea' },\n { id: 4, value: 'intravenous', name: 'Intravenosa' },\n { id: 5, value: 'intramuscular', name: 'Intramuscular' },\n { id: 6, value: 'tube', name: 'Sonda' },\n { id: 7, value: 'rectal', name: 'Retal' },\n { id: 8, value: 'inhalation', name: 'Inalatório' },\n { id: 9, value: 'vaginal', name: 'Vaginal' },\n];\n\nexport const frequencyOptions = [\n { id: 2, value: '2h', name: '2h/2h' },\n { id: 3, value: '4h', name: '4h/4h' },\n { id: 4, value: '6h', name: '6h/6h' },\n { id: 5, value: '8h', name: '8h/8h' },\n { id: 6, value: '12h', name: '12h/12h' },\n { id: 7, value: '24h', name: '1 vez ao dia' },\n { id: 8, value: '2d', name: 'A cada dois dias' },\n { id: 9, value: '3d', name: 'A cada três dias' },\n { id: 10, value: '4d', name: 'A cada quatro dias' },\n { id: 11, value: '5d', name: 'A cada cinco dias' },\n { id: 12, value: '6d', name: 'A cada seis dias' },\n { id: 13, value: '7d', name: 'Semanalmente' },\n { id: 14, value: '15d', name: 'Quinzenal' },\n { id: 15, value: '1M', name: 'Mensal' },\n { id: 16, value: '3M', name: 'Trimestral' },\n { id: 17, value: '6M', name: 'Semestral' },\n];\n","import { EventModel } from '@cuidador/database';\nimport { FormGroup, Typography } from '@material-ui/core';\nimport { format } from 'date-fns';\nimport { Formik, FormikProps } from 'formik';\nimport isEqual from 'lodash/isEqual';\nimport React from 'react';\nimport StyledFormControlLabel from '../StyledFormControlLabel';\n\nimport useSubCategory from '../../hooks/useSubCategory';\nimport { floatMask } from '../../utils/inputs';\nimport AutocompleteTextField, {\n Option as AutoCompleteOption,\n Value as AutoCompleteValue,\n} from '../AutocompleteTextField';\nimport StyledSelect from '../Forms/FormikSelect';\nimport FormikTextField from '../Forms/FormikTextField';\nimport StyledButton from '../StyledButton';\nimport StyledMenuItem from '../StyledMenuItem';\nimport {\n Centralizer,\n Form,\n StyledCheckbox,\n TypographyContainer,\n} from './styles';\nimport {\n administeredNames,\n dosesNames,\n FormValues,\n frequencyOptions,\n needScheduleData,\n validationSchema,\n} from './utils';\n\nexport interface Props {\n page?: number;\n handlePage: (page: number) => void;\n}\n\nconst MedicationUpsertForm: React.FC<\n {\n initialValues: FormValues;\n innerRef?: React.Ref>;\n onSubmit: (values: FormValues) => void;\n } & Props\n> = ({ initialValues, innerRef, onSubmit, page, handlePage }) => {\n const { getOnlyForMedication, byId } = useSubCategory();\n\n const handleMedicationAutoCompleteOnChange = async (\n textValue: string\n ): Promise => {\n const params = {\n 'eventSubCategory.name': `%${textValue}%`,\n };\n const data = await getOnlyForMedication({ ...params, limit: 20 });\n return data?.map((medication: EventModel) => ({\n text: medication.name,\n value: medication.id,\n })) as AutoCompleteOption[];\n };\n\n const medicationAutoCompleteInitialValue = initialValues.subCategory\n ? {\n text: `${initialValues.subCategory.name}`,\n value: Number(initialValues.subCategory.id),\n }\n : undefined;\n\n const nextStepAllowed = (values: FormValues) => {\n if (\n !values.subCategoryId ||\n !values.dosageFormat ||\n !values.dosageQuantity ||\n !values.administeredBy\n ) {\n return false;\n } else {\n return true;\n }\n };\n\n const now = format(new Date(), 'yyyy-MM-dd');\n const MAX_DATE = format(new Date('12/31/9999'), 'yyyy-MM-dd');\n\n return (\n <>\n \n {({ values, isSubmitting, setFieldValue }) => {\n return (\n \n {page === 1 ? (\n <>\n {\n setFieldValue('subCategoryId', item?.value);\n }}\n color=\"secondary\"\n margin=\"normal\"\n testId=\"subCategoryId\"\n name=\"subCategoryId\"\n />\n\n \n {dosesNames.map((item) => (\n \n {item.name}\n \n ))}\n \n ) => {\n setFieldValue(\n 'dosageQuantity',\n floatMask(e.target.value)\n );\n }}\n />\n \n {administeredNames.map((item) => (\n \n {item.name}\n \n ))}\n \n \n handlePage(2)}\n size=\"large\"\n color=\"inherit\"\n disabled={!nextStepAllowed(values)}\n >\n Próximo\n \n \n \n ) : (\n <>\n \n \n {values?.subCategoryId\n ? byId[values?.subCategoryId]?.name\n : ''}\n \n \n \n \n setFieldValue('continuous', e.target.checked)\n }\n />\n }\n label=\"Uso contínuo\"\n />\n \n \n \n setFieldValue('ifNecessary', e.target.checked)\n }\n />\n }\n label=\"Medicamento de uso apenas se necessário\"\n />\n \n {needScheduleData(values) && (\n <>\n \n {frequencyOptions.map((item) => (\n \n {item.name}\n \n ))}\n \n \n \n {!values?.continuous && (\n // If not continuous get endDate\n <>\n \n \n )}\n \n )}\n \n \n \n Salvar\n \n \n \n )}\n \n );\n }}\n \n \n );\n};\n\nexport default MedicationUpsertForm;\n","import styled from 'styled-components';\n\nexport const Container = styled.div`\n display: flex;\n flex: 1;\n background-color: ${({ theme }) => theme.palette.common.white};\n padding: ${({ theme }) => theme.spacing(2)}px;\n display: flex;\n flex-direction: column;\n color: ${({ theme }) => theme.palette.secondary.main};\n`;\n","import { APIError } from '@cuidador/lib';\nimport { AxiosError } from 'axios';\nimport React, { useContext, useState } from 'react';\nimport { useHistory } from 'react-router-dom';\nimport { toast } from 'react-toastify';\nimport MedicationUpsertForm from '../../../components/MedicationUpsertForm';\nimport {\n formDataToMedicationModel,\n FormValues,\n medicationModelToFormValues,\n} from '../../../components/MedicationUpsertForm/utils';\nimport { AuthContext } from '../../../contexts/auth';\nimport useMedication from '../../../hooks/useMedication';\nimport { resolveErrorMessage } from '../../../utils/error';\nimport { Container } from './styles';\nimport { Header } from '../../../components/Header'\nimport { BackButton } from '../../../components/BackButton'\nimport { PageTitle } from '../../../components/PageTitle'\nimport { PscButton } from '../../../components/PscButton'\n\nconst formInitialValue = {\n dosageFormat: undefined,\n dosageQuantity: undefined,\n administeredBy: undefined,\n subCategoryId: undefined,\n eventSchedule: {\n mon: true,\n tue: true,\n wed: true,\n thu: true,\n fri: true,\n sat: true,\n sun: true,\n frequencyRule: '',\n frequencyStartsAt: '',\n },\n};\n\nconst MedicationInsert: React.FC = () => {\n const [page, setPage] = useState(1);\n const { userInfo } = useContext(AuthContext);\n const patientId = userInfo?.activePatientId;\n\n const { post } = useMedication();\n const history = useHistory();\n\n const handleSubmit = (values: FormValues) => {\n return post(formDataToMedicationModel(values, patientId!))\n .then(() => {\n history.goBack();\n })\n .catch((err: AxiosError) => {\n const displayMessage = resolveErrorMessage(err);\n toast.error(displayMessage);\n });\n };\n\n const handlePage = (page: number) => {\n setPage(page);\n };\n\n return (\n <>\n handlePage(1)\n : undefined\n }\n />\n }\n centerContent={\n \n }\n rightContent={}\n />\n \n \n \n \n );\n};\n\nexport default MedicationInsert;\n","import styled from 'styled-components';\nimport { CircularProgress as MaterialCircularProgress } from '@material-ui/core';\n\nexport const SimpleCircularProgressContainer = styled.div`\n width: 100%;\n min-height: ${({ theme }) => theme.spacing(15)}px;\n display: flex;\n align-items: flex-start;\n justify-content: center;\n flex-direction: row;\n flex: 1;\n background-color: ${({ theme }) => theme.palette.common.white};\n`;\n\nexport const SimpleCircularProgress = styled(MaterialCircularProgress)`\n color: ${({ theme }) => theme.palette.primary.light};\n margin-top: 20px;\n`;\n","import React from 'react';\nimport {\n SimpleCircularProgress,\n SimpleCircularProgressContainer,\n} from './styles';\n\nconst LoadingSimpleCircular: React.FC<{ loading: boolean }> = ({ loading }) => {\n return (\n \n {loading && (\n \n )}\n \n );\n};\n\nexport default LoadingSimpleCircular;\n","import { Typography } from '@material-ui/core';\nimport ChevronRightIcon from '@material-ui/icons/ChevronRight';\nimport styled from 'styled-components';\n\nexport const Container = styled.button`\n display: flex;\n width: 100%;\n min-height: ${({ theme }) => theme.spacing(7)}px;\n border: none;\n background: none;\n border-bottom: 1px solid\n ${({ theme }) => theme.palette.extra.color.grey.light};\n padding: ${({ theme }) => theme.spacing(0, 2)};\n align-items: center;\n flex-direction: row;\n`;\n\nexport const LeftSide = styled.div`\n width: 90%;\n height: 100%;\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n justify-content: center;\n align-items: flex-start;\n text-align: left;\n word-break: break-word;\n`;\n\nexport const RightSide = styled.div`\n width: 10%;\n height: 100%;\n display: flex;\n flex-direction: column;\n align-items: flex-end;\n justify-content: center;\n`;\n\nexport const StyledTypography = styled(Typography)`\n color: ${({ theme }) => theme.palette.common.black};\n`;\n\nexport const StyledIcon = styled(ChevronRightIcon)`\n color: ${({ theme }) => theme.palette.primary.main};\n font-size: ${({ theme }) => theme.spacing(4)}px;\n`;\n","import React from 'react';\nimport {\n Container,\n LeftSide,\n RightSide,\n StyledTypography,\n StyledIcon,\n} from './styles';\n\ninterface Props {\n id: number;\n title: string;\n subTitle?: string;\n onClick: () => void;\n}\n\nconst MedicationFirstStepCard: React.FC = ({\n title,\n subTitle,\n id,\n onClick,\n}) => {\n return (\n onClick()}>\n \n {title}\n {subTitle}\n \n \n \n \n \n );\n};\n\nexport default MedicationFirstStepCard;\n","import styled from 'styled-components';\nimport { InputBase } from '@material-ui/core';\n\nexport const StyledInput = styled(InputBase)`\n margin-bottom: ${({ theme }) => theme.spacing(1)}px;\n color: ${({ theme }) => theme.palette.primary.main};\n background-color: ${({ theme }) => theme.palette.common.white};\n padding: ${({ theme }) => theme.spacing(1, 1)};\n border-radius: ${({ theme }) => theme.spacing(1)}px;\n border: 1px solid ${({ theme }) => theme.palette.primary.main};\n width: 90%;\n input {\n font-size: ${({ theme }) => theme.typography.overline.fontSize};\n width: 90%;\n padding: ${({ theme }) => theme.spacing(0, 1)};\n }\n .MuiInputAdornment-positionEnd {\n margin: 0;\n }\n`;\n","import React from 'react';\nimport { InputAdornment } from '@material-ui/core';\nimport { Search } from '@material-ui/icons';\nimport { useDebouncedCallback } from 'use-debounce';\nimport qs from 'query-string';\n\nimport { StyledInput } from './styles';\nimport { useHistory } from 'react-router-dom';\n\ntype SearchTextFieldProps = {\n fieldName: string;\n onChange?: (\n event: React.ChangeEvent\n ) => void;\n onChangeDebounced?: (value: string) => void;\n};\n\nconst getSearchValueFromUrl = (url: string) => url.replace(/^\\%|\\%$/g, '');\n\nconst SearchTextField: React.FC = ({\n fieldName,\n onChange,\n onChangeDebounced,\n}) => {\n const history = useHistory();\n const defaultValue = getSearchValueFromUrl(\n (qs.parse(history.location.search)[fieldName] as string) || ''\n );\n\n const debounced = useDebouncedCallback((value) => {\n const newSearch = {\n ...qs.parse(history.location.search),\n [fieldName]: value ? `%${value}%` : undefined,\n };\n const newUrl = qs.stringifyUrl({\n url: history.location.pathname,\n query: newSearch,\n });\n history.push(newUrl);\n if (onChangeDebounced) onChangeDebounced(value);\n }, 500);\n\n return (\n {\n debounced.callback(e.target.value);\n if (onChange) onChange(e);\n }}\n inputProps={{\n 'data-testid': 'searchField',\n }}\n endAdornment={\n \n \n \n }\n />\n );\n};\n\nexport default SearchTextField;\n","import { Typography } from '@material-ui/core';\nimport { Form as FormikForm } from 'formik';\nimport styled from 'styled-components';\nimport FormikTextField from '../Forms/FormikTextField';\n\nexport const Form = styled(FormikForm)`\n display: flex;\n flex: 1;\n flex-direction: column;\n width: 100%;\n color: ${({ theme }) => theme.palette.secondary.main};\n`;\n\nexport const Container = styled.div`\n display: flex;\n background-color: ${({ theme }) => theme.palette.common.white};\n display: flex;\n flex-direction: column;\n padding: ${({ theme }) => theme.spacing(2, 0)};\n color: ${({ theme }) => theme.palette.secondary.main};\n`;\n\nexport const SearchContainer = styled.div`\n width: 100%;\n min-height: ${({ theme }) => theme.spacing(5)}px;\n border: none;\n border-bottom: 1px solid\n ${({ theme }) => theme.palette.extra.color.grey.light};\n display: flex;\n justify-content: center;\n padding: ${({ theme }) => theme.spacing(1, 0)};\n`;\n\nexport const CardContainer = styled.div`\n width: 100%;\n`;\n\nexport const ContentContainer = styled.div`\n margin-top: ${({ theme }) => theme.spacing(3)}px;\n width: 100%;\n display: flex;\n align-items: center;\n flex-direction: column;\n`;\n\nexport const TypograpyContainer = styled.div`\n width: 100%;\n margin-top: ${({ theme }) => theme.spacing(1)}px;\n display: flex;\n align-items: center;\n justify-content: center;\n`;\n\nexport const StyledButton = styled.button`\n width: 90%;\n min-height: ${({ theme }) => theme.spacing(10)}px;\n padding: ${({ theme }) => theme.spacing(1.5, 2)};\n border-radius: 8px;\n border: none;\n color: ${({ theme }) => theme.palette.common.white};\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n align-items: flex-start;\n word-break: break-word;\n text-align: left;\n box-shadow: 0px 2px 4px 0px #00000040;\n`;\n\nexport const StyledButtonText = styled(Typography)`\n color: ${({ theme }) => theme.palette.common.white};\n`;\n\nexport const StyledText = styled(Typography)`\n color: ${({ theme }) => theme.palette.common.black};\n`;\n\nexport const StyledBoldTitle = styled(Typography)`\n color: ${({ theme }) => theme.palette.common.black};\n font-weight: bold;\n`;\n\nexport const StyledRow = styled.div`\n width: 100%;\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n align-items: flex-start;\n margin-top: ${({ theme }) => theme.spacing(2)}px;\n margin-bottom: ${({ theme }) => theme.spacing(1)}px;\n`;\n\nexport const Centralizer = styled.div`\n align-items: center;\n flex-direction: column;\n display: flex;\n flex: 1;\n justify-content: flex-end;\n`;\n\nexport const DoseTextRow = styled.div`\n display: flex;\n flex-direction: row;\n width: ${({ theme }) => theme.spacing(14)}px;\n justify-content: space-between;\n`;\n\nexport const DosageFormikTextField = styled(FormikTextField)`\n .MuiOutlinedInput-root {\n border-radius: ${({ theme }) => theme.spacing(0.7)}px;\n background-color: ${({ theme }) => theme.palette.common.white};\n }\n margin-top: 16px;\n width: ${({ theme }) => theme.spacing(15)}px;\n margin-right: ${({ theme }) => theme.spacing(2)}px;\n`;\n","import React from 'react';\nimport MedicationFirstStepCard from '../../MedicationFirstStepCard';\nimport MedicationSearchBar from '../../MedicationSearchBar';\nimport MedicBalloon from '../../MedicBalloon';\nimport { MedicationItem } from '../MedicationSecondStep/utils';\nimport { CardContainer, SearchContainer } from '../styles';\n\ninterface Props {\n handleChangeMedicationText?: (textValue: string) => void;\n handleSelectMedication?: (medication: MedicationItem) => void;\n allMedication?: MedicationItem[];\n}\n\nconst MedicationFirstStep: React.FC = ({\n handleChangeMedicationText,\n allMedication,\n handleSelectMedication,\n}) => {\n return (\n <>\n \n \n \n \n \n {allMedication &&\n allMedication.length > 0 &&\n allMedication?.map((item) => {\n return (\n handleSelectMedication?.(item)}\n />\n );\n })}\n \n \n );\n};\n\nexport default MedicationFirstStep;\n","import styled from 'styled-components';\n\nexport const Container = styled.div`\n display: flex;\n flex-direction: row;\n align-items: center;\n\n svg {\n color: ${({ theme }) => theme.palette.extra.color.red.main};\n font-size: ${({ theme }) => theme.typography.fontSize}px;\n margin-right: 0.3rem;\n }\n`;\n\nexport const StyledSpan = styled.span`\n color: ${({ theme }) => theme.palette.extra.color.red.main};\n font-size: ${({ theme }) => theme.typography.fontSize}px;\n`;\n","import { Radio, RadioGroup } from '@material-ui/core';\nimport { FormikErrors } from 'formik';\nimport React, { useEffect } from 'react';\nimport {\n FormCardContainer,\n NewStyledSelect as StyledSelect,\n StyledBoldTitle,\n StyledFormikTextField as FormikTextField,\n} from '../../../FormCardContainer';\nimport FormikWeekDaySelect from '../../../Forms/FormikWeekDaySelect';\nimport StyledFormControlLabel from '../../../StyledFormControlLabel';\nimport StyledMenuItem from '../../../StyledMenuItem';\nimport ErrorText from '../ErrorText';\nimport { FormValues } from '../utils';\n\nexport enum FrequencyType {\n EveryDay = 'Todos os dias',\n MondayToFriday = 'Segunda a sexta',\n SomeDays = 'Alguns dias da semana',\n Custom = 'Intervalos fixos',\n}\n\nexport const EVERYDAY = ['Seg', 'Ter', 'Qua', 'Qui', 'Sex', 'Sab', 'Dom'];\nexport const MONDAY_TO_FRIDAY = ['Seg', 'Ter', 'Qua', 'Qui', 'Sex'];\n\nexport const frequencyTimeOptions: {\n value: FormValues['rangeInDays'];\n label: string;\n}[] = [\n { value: '2d', label: 'A cada 2 dias' },\n { value: '3d', label: 'A cada 3 dias' },\n { value: '5d', label: 'A cada 5 dias' },\n { value: '7d', label: 'A cada 7 dias' },\n { value: '15d', label: 'A cada 15 dias' },\n { value: '30d', label: 'A cada 30 dias' },\n { value: 'custom', label: 'Incluir novo intervalo' },\n];\n\ninterface DaysSelectorProps {\n values: FormValues;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n setFieldValue: (field: string, value: any) => void;\n errors: FormikErrors;\n disabled?: boolean;\n}\n\nconst DaysSelector: React.FC = ({\n values,\n setFieldValue,\n errors,\n disabled,\n}) => {\n const handleSelectedCustomIntervalChange = (\n e: React.ChangeEvent\n ) => {\n switch (e.target.value as FrequencyType) {\n case FrequencyType.EveryDay:\n setFieldValue('dayOptions', FrequencyType.EveryDay);\n setFieldValue('days', EVERYDAY);\n break;\n case FrequencyType.MondayToFriday:\n setFieldValue('dayOptions', FrequencyType.MondayToFriday);\n setFieldValue('days', MONDAY_TO_FRIDAY);\n break;\n case FrequencyType.SomeDays:\n setFieldValue('dayOptions', FrequencyType.SomeDays);\n setFieldValue('days', []);\n break;\n case FrequencyType.Custom:\n setFieldValue('dayOptions', FrequencyType.Custom);\n setFieldValue('days', []);\n break;\n default:\n setFieldValue('dayOptions', FrequencyType.EveryDay);\n setFieldValue('days', EVERYDAY);\n break;\n }\n };\n\n const handleSelectedDaysChange = () => {\n if (!values.days) return;\n const isEveryDay =\n values.days.length === 7 &&\n values.days.every((day) => EVERYDAY.includes(day));\n\n const isMondayToFriday =\n values.days.length === 5 &&\n values.days.every((day) => MONDAY_TO_FRIDAY.includes(day));\n\n const isSomeDays = !isEveryDay && !isMondayToFriday;\n if (values.dayOptions !== FrequencyType.Custom) {\n if (isEveryDay) setFieldValue('dayOptions', FrequencyType.EveryDay);\n if (isMondayToFriday)\n setFieldValue('dayOptions', FrequencyType.MondayToFriday);\n if (isSomeDays) setFieldValue('dayOptions', FrequencyType.SomeDays);\n }\n };\n\n useEffect(() => {\n handleSelectedDaysChange();\n }, [values.days]);\n\n return (\n \n Dias\n \n {Object.values(FrequencyType).map((label, index) => (\n }\n label={label}\n disabled={disabled}\n />\n ))}\n \n {values.dayOptions === FrequencyType.Custom ? (\n <>\n \n {frequencyTimeOptions.map((frequencyOption, index) => (\n \n {frequencyOption.label}\n \n ))}\n \n {errors.rangeInDays && (\n \n )}\n {values.rangeInDays === 'custom' && (\n <>\n \n {errors.customRangeInDays && (\n \n )}\n \n )}\n \n ) : (\n \n )}\n \n );\n};\n\nexport default DaysSelector;\n","import React from 'react';\nimport { ErrorOutline } from '@material-ui/icons';\nimport { Container, StyledSpan } from './styles';\n\ninterface ErrorTextProps {\n errorMessage: string;\n}\n\nconst ErrorText: React.FC = ({ errorMessage }) => {\n return (\n \n {errorMessage && (\n <>\n \n {errorMessage}\n \n )}\n \n );\n};\n\nexport default ErrorText;\n","import styled from 'styled-components';\n\nexport const StyledRow = styled.div`\n width: 100%;\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n align-items: flex-start;\n margin-top: ${({ theme }) => theme.spacing(2)}px;\n margin-bottom: ${({ theme }) => theme.spacing(1)}px;\n`;\n","import { Radio, RadioGroup } from '@material-ui/core';\nimport { format, parse } from 'date-fns';\nimport React from 'react';\nimport {\n FormCardContainer,\n StyledBoldTitle,\n StyledFormikTextField as FormikTextField,\n} from '../../../FormCardContainer';\nimport StyledFormControlLabel from '../../../StyledFormControlLabel';\nimport { FormValues } from '../utils';\nimport { StyledRow } from './styles';\n\ninterface PeriodSelectorProps {\n id?: number;\n values: FormValues;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n setFieldValue: (field: string, value: any) => void;\n startDate?: string;\n disabled?: boolean;\n}\n\nexport enum PeriodType {\n Continuously = 'Continuamente',\n DeterminedTime = 'Por tempo determinado',\n AsNeeded = 'Apenas se necessário',\n}\n\nconst PeriodSelector: React.FC = ({\n id,\n values,\n setFieldValue,\n startDate: initialStartDate,\n disabled,\n}) => {\n const initialDate = format(new Date(), 'yyyy-MM-dd');\n const finalDate = format(new Date('12/31/9999'), 'yyyy-MM-dd');\n\n const isEdit = !!id;\n const today = new Date();\n const startDate = parse(\n `${initialStartDate} 00:00`,\n 'yyyy-MM-dd HH:mm',\n new Date()\n );\n\n const isDateDisabled = isEdit && today >= startDate;\n\n return (\n \n Período\n ) => {\n setFieldValue('periodType', e.target.value);\n\n setFieldValue('ifNecessary', e.target.value === PeriodType.AsNeeded);\n }}\n >\n {Object.values(PeriodType).map((label, index) => (\n }\n label={label}\n disabled={disabled}\n />\n ))}\n \n {values.periodType !== PeriodType?.AsNeeded && (\n \n Data de início\n \n \n )}\n {values.periodType === PeriodType?.DeterminedTime && (\n \n Data de fim\n \n \n )}\n \n );\n};\n\nexport default PeriodSelector;\n","import * as Yup from 'yup';\nimport { FrequencyType } from './MedicationSecondStep/DaysSelector';\nimport { PeriodType } from './MedicationSecondStep/PeriodSelector';\n\nexport const validationSchema = Yup.object().shape({\n dosageFormat: Yup.string().required('Insira um formato de dose.'),\n dosageQuantity: Yup.number().required('Insira a quantidade.'),\n administeredBy: Yup.string().required('Insira uma via de aplicação.'),\n medicalNotes: Yup.string().max(\n 2000,\n 'Deve conter no máximo 2000 caracteres.'\n ),\n timeSchedule: Yup.string().when('ifNecessary', {\n is: true,\n then: Yup.string().notRequired(),\n otherwise: Yup.string().required('Por favor, insira uma frequência.'),\n }),\n time: Yup.string().when(['timeSchedule', 'ifNecessary'], {\n is: (timeSchedule, ifNecessary) => timeSchedule === 'custom' || ifNecessary,\n then: Yup.string().notRequired(),\n otherwise: Yup.string().required('Por favor, insira um horário.'),\n }),\n customTimes: Yup.array().when(['timeSchedule', 'ifNecessary'], {\n is: (timeSchedule, ifNecessary) =>\n timeSchedule === 'custom' && !ifNecessary,\n then: Yup.array().min(1, 'Por favor, insira pelo menos um horário.'),\n }),\n\n customRangeInDays: Yup.string().when(['rangeInDays', 'ifNecessary'], {\n is: (rangeInDays, ifNecessary) => rangeInDays === 'custom' && !ifNecessary,\n then: Yup.string().required('Por favor, insira um intervalo.'),\n }),\n\n rangeInDays: Yup.string().when(['dayOptions', 'ifNecessary'], {\n is: (dayOptions, ifNecessary) =>\n dayOptions === FrequencyType.Custom && !ifNecessary,\n then: Yup.string().required('Por favor, insira um intervalo.'),\n }),\n\n frequencyStartsAt: Yup.string().when('ifNecessary', {\n is: true,\n then: Yup.string().notRequired(),\n otherwise: Yup.string().required('Por favor, insira uma data de início.'),\n }),\n\n frequencyEndsAt: Yup.string().when('periodType', {\n is: PeriodType.DeterminedTime,\n then: Yup.string().required('Por favor, insira uma data de término.'),\n }),\n\n days: Yup.array().when(['dayOptions', 'ifNecessary'], {\n is: (dayOptions, ifNecessary) =>\n dayOptions === FrequencyType.SomeDays && !ifNecessary,\n then: Yup.array().min(1, 'Por favor, insira um intervalo.'),\n }),\n});\n","import { Typography } from '@material-ui/core';\nimport styled from 'styled-components';\nimport StyledButton from '../../../StyledButton';\n\nexport const MedicationTextRow = styled.div`\n display: flex;\n flex-direction: row;\n width: ${({ theme }) => theme.spacing(20)}px;\n justify-content: space-between;\n margin-top: ${({ theme }) => theme.spacing(1)}px;\n`;\n\nexport const StyledText = styled(Typography)`\n color: ${({ theme }) => theme.palette.common.black};\n`;\n\nexport const CustomTimeInputContainer = styled.div`\n display: flex;\n flex-direction: row;\n justify-content: center;\n align-items: center;\n width: 90%;\n`;\n\nexport const AddButtonContainer = styled.div`\n width: 10%;\n`;\n\nexport const StyledAddButton = styled(StyledButton)`\n color: ${({ theme }) => theme.palette.secondary.main};\n border: 1px solid ${({ theme }) => theme.palette.secondary.main};\n border-radius: 50%;\n min-width: 0px;\n align-self: flex-end;\n margin-left: ${({ theme }) => theme.spacing(2)}px;\n padding: 0;\n`;\n\nexport const StyledRemoveButton = styled(StyledButton)`\n color: red;\n border: 1px solid red;\n border-radius: 50%;\n min-width: 0px;\n align-self: flex-end;\n margin-left: ${({ theme }) => theme.spacing(2)}px;\n padding: 0;\n`;\n","import { Add, Clear } from '@material-ui/icons';\nimport { FormikErrors, FormikTouched } from 'formik';\nimport React, { useState } from 'react';\nimport {\n FormCardContainer,\n NewStyledSelect as StyledSelect,\n StyledBoldTitle,\n StyledFormikTextField as FormikTextField,\n} from '../../../FormCardContainer';\nimport StyledMenuItem from '../../../StyledMenuItem';\nimport StyledSimpleDialog from '../../../StyledSimpleDialog';\nimport ErrorText from '../ErrorText';\nimport { FormValues } from '../utils';\nimport {\n AddButtonContainer,\n CustomTimeInputContainer,\n MedicationTextRow,\n StyledAddButton,\n StyledRemoveButton,\n StyledText,\n} from './styles';\n\nconst scheduleOptions = [\n { label: '2h/2h', value: '2h' },\n { label: '4h/4h', value: '4h' },\n { label: '6h/6h', value: '6h' },\n { label: '8h/8h', value: '8h' },\n { label: '12h/12h', value: '12h' },\n { label: '24h/24h', value: '24h' },\n { label: 'Intervalos irregulares', value: 'custom' },\n];\n\ninterface TimeSelectorProps {\n values: FormValues;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n setFieldValue: (field: string, value: any) => void;\n errors: FormikErrors;\n touched: FormikTouched;\n disabled?: boolean;\n}\n\nexport const getMedicationTimes = (startTime: string, frequency: string) => {\n const formattedFrequency = Number(frequency.replace('h', ''));\n const [hour, minute] = startTime.split(':');\n const formattedHour = Number(hour);\n const doses = [];\n const firstMedicationTime = formattedHour % formattedFrequency;\n for (\n let medicationTime = firstMedicationTime;\n medicationTime <= 23;\n medicationTime += formattedFrequency\n ) {\n doses.push(medicationTime);\n }\n\n const formattedDoses = doses.map((item) => {\n return item.toString().padStart(2, '0') + ':' + minute;\n });\n\n return formattedDoses;\n};\n\nconst TimeSelector: React.FC = ({\n values,\n setFieldValue,\n errors,\n touched,\n disabled,\n}) => {\n const [customTime, setCustomTime] = useState('');\n const [customTimeToDelete, setcustomTimeToDelete] = useState('');\n const [isDeleteDialogOpen, setIsDeleteDialogOpen] = useState(false);\n const handleAddCustomTime = () => {\n const customTimes = [...(values.customTimes || [])];\n if (values.customTimes?.includes(customTime)) return;\n setFieldValue('customTimes', [...customTimes, customTime]);\n setCustomTime('');\n };\n\n const handleRemoveCustomTime = (time: string) => {\n setIsDeleteDialogOpen(false);\n const customTimes = [...(values.customTimes || [])];\n const filteredCustomTimes = customTimes.filter(\n (customTime) => customTime !== time\n );\n setFieldValue('customTimes', filteredCustomTimes);\n };\n\n const orderedCustomTimes = values.customTimes?.sort((a, b) => {\n const fistHour = Number(a.split(':').join(''));\n const secondHour = Number(b.split(':').join(''));\n return fistHour - secondHour;\n });\n\n return (\n <>\n \n Horários\n \n {scheduleOptions.map((option) => (\n \n {option.label}\n \n ))}\n \n {errors.timeSchedule && touched.timeSchedule && (\n \n )}\n {values.timeSchedule && values.timeSchedule !== 'custom' ? (\n <>\n \n {values.time &&\n getMedicationTimes(values.time, values.timeSchedule).map(\n (time, index) => (\n \n \n {index + 1}ª medicação\n \n {time}\n \n )\n )}\n \n ) : (\n values.timeSchedule && (\n <>\n \n ) =>\n setCustomTime(e.target.value)\n }\n style={{ width: '90%' }}\n disabled={disabled}\n />\n \n \n \n \n \n \n {errors.customTimes && touched.customTimes && (\n \n )}\n {orderedCustomTimes?.map((time, index) => (\n \n \n {index + 1}ª medicação\n \n {time}\n \n {\n setcustomTimeToDelete(time);\n setIsDeleteDialogOpen(true);\n }}\n >\n \n \n \n \n ))}\n \n )\n )}\n \n setIsDeleteDialogOpen(false)}\n handleYes={() => handleRemoveCustomTime(customTimeToDelete)}\n title=\"Remover horário\"\n subTitle=\"Tem certeza de que deseja remover o horário?\"\n />\n \n );\n};\n\nexport default TimeSelector;\n","import { Formik, FormikHelpers, FormikProps } from 'formik';\nimport isEqual from 'lodash/isEqual';\nimport React from 'react';\nimport { toast } from 'react-toastify';\nimport {\n FormCardContainer,\n NewStyledSelect as StyledSelect,\n StyledBoldTitle,\n StyledFormikTextField as FormikTextField,\n} from '../../FormCardContainer';\nimport MedicBalloon from '../../MedicBalloon';\nimport StyledButton from '../../StyledButton';\nimport StyledMenuItem from '../../StyledMenuItem';\nimport {\n Centralizer,\n ContentContainer,\n DosageFormikTextField,\n Form,\n StyledRow,\n} from '../styles';\n\nimport { validationSchema } from '../schema';\nimport DaysSelector from './DaysSelector';\nimport PeriodSelector from './PeriodSelector';\nimport TimeSelector from './TimeSelector';\nimport { administeredNames, dosesNames, FormValues } from './utils';\n\nconst MedicationSecondStep: React.FC<{\n initialValues: FormValues;\n innerRef?: React.Ref>;\n onSubmit: (\n values: FormValues,\n formikHelpers: FormikHelpers\n ) => void | Promise;\n id?: number;\n disabled?: boolean;\n}> = ({ initialValues, innerRef, onSubmit, id, disabled }) => {\n return (\n {\n if (\n values.frequencyStartsAt &&\n values.frequencyEndsAt &&\n values.frequencyEndsAt < values.frequencyStartsAt\n ) {\n toast.error('Data de início não pode ser após a data de fim');\n formikHelpers.setSubmitting(false);\n } else return onSubmit(values, formikHelpers);\n }}\n validateOnChange={false}\n innerRef={innerRef}\n >\n {({ values, isSubmitting, setFieldValue, errors, touched }) => {\n return (\n \n <>\n \n \n \n {!values.ifNecessary && (\n <>\n \n \n \n )}\n\n \n \n Qual quantidade deve usar?\n \n \n \n \n {dosesNames.map((item) => (\n \n {item.name}\n \n ))}\n \n \n \n\n \n \n Qual a via de aplicação?\n \n \n {administeredNames.map((item) => (\n \n {item.name}\n \n ))}\n \n \n\n \n \n Recomendações médicas (opcional)\n \n \n \n \n \n Salvar\n \n \n \n \n \n );\n }}\n \n );\n};\n\nexport default MedicationSecondStep;\n","import React, { useState } from 'react';\nimport MedicationFirstStep from './MedicationFirstStep';\nimport MedicationSecondStep from './MedicationSecondStep';\nimport {\n FormValues,\n MedicationInsertFormStep,\n MedicationItem,\n} from './MedicationSecondStep/utils';\nimport { Container } from './styles';\nimport StyledSimpleDialog from '../StyledSimpleDialog'\nimport { FormikHelpers } from 'formik'\n\ninterface Props {\n step: MedicationInsertFormStep;\n initialValues: FormValues;\n handleSubmit: (values: FormValues) => void;\n // optional values, because this form is also used to update medication, and that does not require these parameters\n allMedication?: MedicationItem[];\n handleChangeMedicationText?: (textValue: string) => void;\n handleSelectMedication?: (medication: MedicationItem) => void;\n handleStepChange?: (step: MedicationInsertFormStep) => void;\n id?: number;\n disabled?: boolean;\n}\n\nconst MedicationInsertForm: React.FC = ({\n step,\n initialValues,\n handleSubmit,\n allMedication,\n handleChangeMedicationText,\n handleSelectMedication,\n id,\n disabled,\n}) => {\n const [confirmPatch, setConfirmPatch] = useState(false)\n const [patchValues, setPatchValues] = useState()\n const [disableButton, setDisableButton] = useState()\n\n function handlePatchData (values: FormValues, formikHelpers: FormikHelpers) {\n setConfirmPatch(true)\n setPatchValues(values)\n }\n\n function handleYes () {\n if (patchValues) {\n setDisableButton(true)\n handleSubmit(patchValues)\n }\n }\n\n const renderStep = (step: MedicationInsertFormStep) => {\n switch (step) {\n case MedicationInsertFormStep.SelectMedication:\n return (\n \n );\n case MedicationInsertFormStep.FillDetails:\n return (\n <>\n setConfirmPatch(false)}\n handleYes={handleYes}\n title=\"Salvar medicamento?\"\n subTitle=\"ATENÇÃO: se um plantão já estiver em andamento, as alterações no medicamento surtirão efeito apenas no próximo plantão\"\n disabled={disableButton}\n />\n \n \n );\n default:\n return null;\n }\n };\n\n return {renderStep(step)};\n};\n\nexport default MedicationInsertForm;\n","import { EventSchedule } from '@cuidador/database';\nimport { parse } from 'date-fns';\nimport {\n convertLocalTimeToUTC,\n getUTCWeeklySchedule,\n weekdayMap,\n} from '../../../../utils/date/index';\nimport { FrequencyType } from '../DaysSelector';\nimport { PeriodType } from '../PeriodSelector';\nimport { getMedicationTimes } from '../TimeSelector';\nimport { FormValues } from '../utils';\n\nexport const needScheduleData = (values: FormValues): boolean => {\n return values.periodType !== PeriodType.AsNeeded;\n};\n\nexport const needScheduleEndData = (values: FormValues): boolean => {\n return values.periodType === PeriodType.DeterminedTime;\n};\n\nexport const formDataToMedicationModel = (\n formData: FormValues,\n patientId: number,\n subCategoryId?: number\n) => {\n const frequencyStartsAt = !formData.ifNecessary\n ? parse(\n `${formData.frequencyStartsAt} ${\n (formData.timeSchedule === 'custom'\n ? formData.customTimes && formData.customTimes[0]\n : formData.time) || '00:00'\n }`,\n 'yyyy-MM-dd HH:mm',\n new Date()\n ).toISOString()\n : undefined;\n\n const frequencyEndsAt =\n formData.periodType === PeriodType.DeterminedTime\n ? parse(\n `${formData.frequencyEndsAt} 23:59`,\n 'yyyy-MM-dd HH:mm',\n new Date()\n ).toISOString()\n : undefined;\n\n const utcSchedule = !formData.ifNecessary\n ? getUtcSchedule(formData.days!, formData.time!)\n : {};\n\n const frequencyRule = !formData.ifNecessary\n ? getFrequencyRule(formData)\n : undefined;\n\n const times = !formData.ifNecessary ? getTimes(formData) : undefined;\n\n const customTimes = times?.map((time) => ({\n happensAt: convertLocalTimeToUTC(time),\n }));\n\n const data = {\n dosageFormat: formData?.dosageFormat || undefined,\n dosageQuantity: formData.dosageQuantity,\n administeredBy: formData?.administeredBy || undefined,\n subCategoryId,\n patientId: (patientId as number) || undefined,\n medicalNotes: formData?.medicalNotes || undefined,\n ifNecessary: Boolean(formData?.ifNecessary),\n eventSchedule: needScheduleData(formData)\n ? {\n id: (formData?.eventScheduleId as number) || undefined,\n frequencyRule: frequencyRule,\n frequencyStartsAt,\n frequencyEndsAt,\n ...utcSchedule,\n scheduleType: 'custom_frequency' as EventSchedule['scheduleType'],\n customTimes,\n }\n : undefined,\n };\n\n return data;\n};\n\nconst getTimes = (formData: FormValues) => {\n let times;\n if (formData.timeSchedule === 'custom') {\n times = formData.customTimes;\n } else {\n times = getMedicationTimes(formData.time!, formData.timeSchedule!);\n }\n return times || [];\n};\n\nconst getFrequencyRule = (formData: FormValues) => {\n if (formData.dayOptions !== FrequencyType.Custom) return '1d';\n if (formData.rangeInDays !== 'custom') return formData.rangeInDays;\n return `${formData.customRangeInDays}d`;\n};\n\nconst getUtcSchedule = (days: string[], time: string) => {\n const localSchedule = {\n mon: true,\n tue: true,\n wed: true,\n thu: true,\n fri: true,\n sat: true,\n sun: true,\n };\n\n if (days && days.length > 0) {\n localSchedule.mon = days.includes(weekdayMap.mon);\n localSchedule.tue = days.includes(weekdayMap.tue);\n localSchedule.wed = days.includes(weekdayMap.wed);\n localSchedule.thu = days.includes(weekdayMap.thu);\n localSchedule.fri = days.includes(weekdayMap.fri);\n localSchedule.sat = days.includes(weekdayMap.sat);\n localSchedule.sun = days.includes(weekdayMap.sun);\n }\n\n const utcSchedule = getUTCWeeklySchedule(localSchedule, time);\n return utcSchedule;\n};\n","import { EventSubCategoryModel, MedicationModel } from '@cuidador/database';\nimport { APIError } from '@cuidador/lib';\nimport { AxiosError } from 'axios';\nimport { format, parse } from 'date-fns';\nimport qs from 'query-string';\nimport React, { useContext, useEffect, useState } from 'react';\nimport { useHistory } from 'react-router-dom';\nimport { toast } from 'react-toastify';\nimport LoadingSimpleCircular from '../../../components/LoadingSimpleCircular';\nimport MedicationInsertForm from '../../../components/MedicationInsertForm';\nimport { FrequencyType } from '../../../components/MedicationInsertForm/MedicationSecondStep/DaysSelector';\n\nimport { PeriodType } from '../../../components/MedicationInsertForm/MedicationSecondStep/PeriodSelector';\nimport {\n MedicationInsertFormStep,\n FormValues,\n MedicationItem,\n} from '../../../components/MedicationInsertForm/MedicationSecondStep/utils';\nimport { formDataToMedicationModel } from '../../../components/MedicationInsertForm/MedicationSecondStep/utils/parseFormDataToModel';\nimport { AuthContext } from '../../../contexts/auth';\nimport useMedication from '../../../hooks/useMedication';\nimport useSubCategory from '../../../hooks/useSubCategory';\nimport { resolveErrorMessage } from '../../../utils/error';\nimport { Header } from '../../../components/Header'\nimport { BackButton } from '../../../components/BackButton'\nimport { PageTitle } from '../../../components/PageTitle'\nimport { PscButton } from '../../../components/PscButton'\n\nconst formInitialValue: FormValues = {\n dosageFormat: 'pill' as MedicationModel['dosageFormat'],\n dosageQuantity: 1,\n administeredBy: 'oral' as MedicationModel['administeredBy'],\n ifNecessary: false,\n time: '',\n days: ['Seg', 'Ter', 'Qua', 'Qui', 'Sex', 'Sab', 'Dom'],\n periodType: PeriodType.Continuously,\n frequencyStartsAt: format(new Date(), 'yyyy-MM-dd'),\n frequencyEndsAt: '',\n customTimes: [],\n scheduleType: 'custom_frequency',\n dayOptions: FrequencyType.EveryDay,\n timeSchedule: '',\n};\n\nconst MedicationInsertV2: React.FC = () => {\n const [allMedication, setAllMedication] = useState([]);\n const [medication, setMedication] = useState();\n const [step, setStep] = useState(\n MedicationInsertFormStep.SelectMedication\n );\n\n const { userInfo } = useContext(AuthContext);\n const patientId = userInfo?.activePatientId;\n\n const { post } = useMedication();\n\n const { getOnlyForMedication, loading } = useSubCategory();\n const history = useHistory();\n\n const handleMedicationSearch = async (textValue: string) => {\n if (textValue === '') return [];\n const params = {\n 'eventSubCategory.name': `%${textValue}%`,\n };\n const data = await getOnlyForMedication({ ...params, limit: 30 });\n return data?.map((medication: EventSubCategoryModel) => ({\n id: medication.id,\n name: medication.medicationCatalogItem?.name || medication.name,\n description: medication.medicationCatalogItem?.description,\n }));\n };\n\n const handleChangeMedicationText = (textValue: string) => {\n handleMedicationSearch(textValue).then((data) => {\n setAllMedication(data);\n });\n };\n\n const handleStepChange = (step: MedicationInsertFormStep) => {\n setStep(step);\n };\n\n const handleSelectMedication = (medication: MedicationItem) => {\n setMedication(medication);\n handleStepChange(MedicationInsertFormStep.FillDetails);\n };\n\n useEffect(() => {\n const params = qs.parse(history.location.search);\n handleChangeMedicationText(params.q ? `${params.q}` : '');\n }, []);\n\n const handleSubmit = (values: FormValues) => {\n const today = new Date();\n const date = !values.ifNecessary\n ? parse(\n `${values.frequencyStartsAt} 23:59`,\n 'yyyy-MM-dd HH:mm',\n new Date()\n )\n : '';\n\n if (!values.ifNecessary && today > date) {\n toast.error('Coloque a data de início hoje ou em um dia futuro');\n return false;\n }\n if (!patientId) return;\n return post(formDataToMedicationModel(values, patientId, medication!.id))\n .then(() => {\n history.replace('/medicamentos');\n })\n .catch((err: AxiosError) => {\n const displayMessage = resolveErrorMessage(err);\n toast.error(displayMessage);\n });\n };\n\n return (\n <>\n step === MedicationInsertFormStep.SelectMedication\n ? history.push('/medicamentos')\n : setStep(step - 1)\n }\n />\n }\n centerContent={\n \n }\n rightContent={\n \n }\n />\n \n {step === MedicationInsertFormStep.SelectMedication && (\n \n )}\n \n );\n};\n\nexport default MedicationInsertV2;\n","import {\n Backdrop as MaterialBackdrop,\n CircularProgress as MaterialCircularProgress,\n} from '@material-ui/core';\nimport styled from 'styled-components';\n\nexport const Container = styled.div`\n display: flex;\n flex: 1;\n background-color: ${({ theme }) => theme.palette.common.white};\n padding: ${({ theme }) => theme.spacing(2)}px;\n display: flex;\n flex-direction: column;\n color: ${({ theme }) => theme.palette.secondary.main};\n`;\n\nexport const Backdrop = styled(MaterialBackdrop)`\n z-index: ${({ theme }) => theme.zIndex.drawer + 1};\n color: ${({ theme }) => theme.palette.primary.light};\n position: absolute;\n`;\n\nexport const BackdropCircularProgress = styled(MaterialCircularProgress).attrs({\n color: 'inherit',\n})``;\n","import { APIError } from '@cuidador/lib';\nimport { AxiosError } from 'axios';\nimport { parse } from 'date-fns';\nimport React, { useContext, useEffect, useState } from 'react';\nimport { useHistory, useParams } from 'react-router-dom';\nimport { toast } from 'react-toastify';\nimport MedicationUpsertForm from '../../../components/MedicationUpsertForm';\nimport {\n formDataToMedicationModel,\n FormValues,\n medicationModelToFormValues,\n} from '../../../components/MedicationUpsertForm/utils';\nimport StyledSimpleDialog from '../../../components/StyledSimpleDialog';\nimport { AuthContext } from '../../../contexts/auth';\nimport useMedication from '../../../hooks/useMedication';\nimport { resolveErrorMessage } from '../../../utils/error';\nimport { Backdrop, BackdropCircularProgress, Container } from './styles';\nimport { Header } from '../../../components/Header'\nimport { PageTitle } from '../../../components/PageTitle'\nimport { RemoveButton } from '../../../components/RemoveButton'\nimport { BackButton } from '../../../components/BackButton'\n\nconst MedicationUpdate: React.FC = () => {\n const [dialogStatus, setDialogStatus] = useState(false);\n const [page, setPage] = useState(1);\n const params = useParams<{ id: string }>();\n const { getById, byId, loading, patch, remove } = useMedication();\n\n const { userInfo } = useContext(AuthContext);\n const patientId = userInfo?.activePatientId;\n\n const id = parseInt(params.id);\n const history = useHistory();\n\n useEffect(\n function fetchInitialValues() {\n // If 'id' exists, it's an Update form.\n // Else, it's a creation\n if (id) {\n getById(id);\n }\n },\n [id]\n );\n\n if (loading) {\n return (\n \n {loading && (\n \n )}\n \n );\n }\n\n const medication = byId[id];\n\n if (!medication) {\n return null;\n }\n\n const handleSubmit = (values: FormValues) => {\n const today = new Date();\n const date = !values.ifNecessary\n ? parse(\n `${values.frequencyStartsAt} 23:59`,\n 'yyyy-MM-dd HH:mm',\n new Date()\n )\n : '';\n\n if (!values.ifNecessary && today > date) {\n toast.error('Coloque a data de início hoje ou em um dia futuro');\n return false;\n }\n\n return patch(id!, formDataToMedicationModel(values, patientId!))\n .then(() => {\n history.goBack();\n })\n .catch((err: AxiosError) => {\n const displayMessage = resolveErrorMessage(err);\n toast.error(displayMessage);\n });\n };\n\n const handleDelete = (id: Id) => {\n setDialogStatus(false);\n remove(id)\n .then(() => {\n history.goBack();\n })\n .catch((err: AxiosError) => {\n const displayMessage = resolveErrorMessage(err);\n toast.error(displayMessage);\n });\n };\n\n const handlePage = (page: number) => {\n setPage(page);\n };\n\n return (\n <>\n handlePage(1)\n : undefined\n }\n />\n }\n centerContent={\n \n }\n rightContent={\n setDialogStatus(true)} />\n }\n />\n \n \n setDialogStatus(false)}\n handleYes={() => handleDelete(id!)}\n title=\"Excluir Medicamento\"\n subTitle=\"Tem certeza que deseja excluir o Medicamento?\"\n />\n \n \n );\n};\n\nexport default MedicationUpdate;\n","import {\n EventScheduleCustomTimeModel,\n EventScheduleModel,\n MedicationModel,\n} from '@cuidador/database';\nimport { differenceInMinutes, format } from 'date-fns';\nimport {\n convertTimeToDate,\n getLocalWeeklySchedule,\n weekdayMap,\n} from '../../../../utils/date';\nimport { EVERYDAY, FrequencyType, MONDAY_TO_FRIDAY } from '../DaysSelector';\nimport { PeriodType } from '../PeriodSelector';\nimport { FormValues } from '../utils';\n\nexport const medicationModelToFormData = (medication: MedicationModel) => {\n const eventSchedule = medication.eventSchedule as EventScheduleModel;\n const { formattedDate, formattedTime, formattedEndDate } = parseDates(\n eventSchedule\n );\n\n let timeSchedule;\n if (\n !medication.ifNecessary &&\n eventSchedule?.scheduleType === 'custom_frequency'\n ) {\n timeSchedule = getFrequencyRule(eventSchedule?.customTimes || []);\n } else if (\n !medication.ifNecessary &&\n eventSchedule?.scheduleType === 'frequency'\n ) {\n timeSchedule = eventSchedule?.frequencyRule;\n } else {\n timeSchedule = undefined;\n }\n\n const customTimes =\n !medication.ifNecessary && eventSchedule.customTimes\n ? parseCustomTimes(eventSchedule)\n : undefined;\n const days = !medication.ifNecessary\n ? getSelectedWeekDays(eventSchedule as EventScheduleModel)\n : undefined;\n const dayOptions = !medication.ifNecessary\n ? getDayOptions(days!, eventSchedule as EventScheduleModel)\n : undefined;\n\n const { rangeInDays, customRangeInDays } = getRangesInDays(\n eventSchedule?.frequencyRule || ''\n );\n\n const periodType = !medication.ifNecessary\n ? getPeriodType(\n eventSchedule.frequencyStartsAt!,\n eventSchedule.frequencyEndsAt!\n )\n : PeriodType.AsNeeded;\n\n const data = {\n dosageFormat: medication.dosageFormat,\n dosageQuantity: medication.dosageQuantity,\n administeredBy: medication.administeredBy,\n subCategory: medication.subCategory,\n subCategoryId: medication.subCategoryId,\n name: medication?.subCategory?.name || '',\n scheduleType: eventSchedule?.scheduleType || 'custom_frequency',\n frequencyRule: eventSchedule?.frequencyRule,\n ifNecessary: !!medication.ifNecessary,\n medicalNotes: medication.medicalNotes,\n eventScheduleId: medication.eventScheduleId,\n frequencyStartsAt: formattedDate || '',\n frequencyEndsAt: formattedEndDate || '',\n time: formattedTime || '',\n timeSchedule,\n customTimes,\n days,\n dayOptions,\n rangeInDays,\n customRangeInDays,\n periodType,\n } as FormValues;\n return data;\n};\n\nconst getPeriodType = (frequencyStartsAt: string, frequencyEndsAt: string) => {\n if (frequencyStartsAt && frequencyEndsAt) {\n return PeriodType.DeterminedTime;\n }\n return PeriodType.Continuously;\n};\n\nconst getRangesInDays = (frequencyRule: string) => {\n let rangeInDays;\n let customRangeInDays;\n const notCustomIntervalOptions = ['2d', '3d', '5d', '7d', '15d', '30d'];\n if (notCustomIntervalOptions.includes(frequencyRule)) {\n rangeInDays = frequencyRule;\n } else {\n rangeInDays = 'custom';\n customRangeInDays = Number(frequencyRule.split('d')[0]);\n }\n\n return {\n rangeInDays,\n customRangeInDays,\n };\n};\n\nconst getDayOptions = (days: string[], eventSchedule: EventScheduleModel) => {\n const frequencyRule = eventSchedule.frequencyRule || '1d';\n const scheduleType = eventSchedule.scheduleType || 'custom_frequency';\n\n const isEveryDay =\n days.length === 7 && days.every((day) => EVERYDAY.includes(day));\n const isMondayToFriday =\n days.length === 5 && days.every((day) => MONDAY_TO_FRIDAY.includes(day));\n const isSomeDays = !isEveryDay && !isMondayToFriday;\n if (\n (frequencyRule === '1d' && scheduleType === 'custom_frequency') ||\n scheduleType === 'frequency'\n ) {\n if (isEveryDay) return FrequencyType.EveryDay;\n if (isMondayToFriday) return FrequencyType.MondayToFriday;\n if (isSomeDays) return FrequencyType.SomeDays;\n }\n return FrequencyType.Custom;\n};\n\nexport const getSelectedWeekDays = (eventSchedule: EventScheduleModel) => {\n const { mon, tue, wed, thu, fri, sat, sun } = eventSchedule || {};\n\n const utcSchedule = { mon, tue, wed, thu, fri, sat, sun };\n const date = new Date(eventSchedule?.frequencyStartsAt || '');\n const utcTime = `${date\n .getUTCHours()\n .toString()\n .padStart(2, '0')}:${date.getUTCMinutes().toString().padStart(2, '0')}`;\n const localSchedule = getLocalWeeklySchedule(utcSchedule, utcTime);\n\n const days: string[] = [];\n if (localSchedule.mon) days.push(weekdayMap.mon);\n if (localSchedule.tue) days.push(weekdayMap.tue);\n if (localSchedule.wed) days.push(weekdayMap.wed);\n if (localSchedule.thu) days.push(weekdayMap.thu);\n if (localSchedule.fri) days.push(weekdayMap.fri);\n if (localSchedule.sat) days.push(weekdayMap.sat);\n if (localSchedule.sun) days.push(weekdayMap.sun);\n\n return days;\n};\n\n/**\n * calculates the difference in minutes between the times of the eventSchedule, to fill frequency field in medication form;\n * it doesn't make sense to calculate the differences between times, when there is only one time for the event/medication happen.\n * in this case, the frequency is 24 hours, when the event has only one time to happen in the day.\n */\nconst getFrequencyRule = (times: EventScheduleCustomTimeModel[]) => {\n const ONE_HOUR_IN_MINUTES = 60;\n const TWO_HOURS_IN_MINUTES = 120;\n const FOUR_HOURS_IN_MINUTES = 240;\n const SIX_HOURS_IN_MINUTES = 360;\n const EIGHT_HOURS_IN_MINUTES = 480;\n const TWELVE_HOURS_IN_MINUTES = 720;\n const TWENTY_FOUR_HOURS_IN_MINUTES = 1440;\n const validDifferencesInMinutes = [\n TWO_HOURS_IN_MINUTES,\n FOUR_HOURS_IN_MINUTES,\n SIX_HOURS_IN_MINUTES,\n EIGHT_HOURS_IN_MINUTES,\n TWELVE_HOURS_IN_MINUTES,\n TWENTY_FOUR_HOURS_IN_MINUTES,\n ];\n\n const customTimes = times.map((time) => time.happensAt).sort();\n const differences: number[] = [];\n customTimes.forEach((time, index) => {\n if (customTimes.length === 1) {\n differences.push(TWENTY_FOUR_HOURS_IN_MINUTES);\n } else {\n const hour = new Date(\n 2022,\n 1,\n 1,\n Number(customTimes[index]?.split(':')[0]),\n Number(customTimes[index]?.split(':')[1])\n );\n const nextHour = new Date(\n 2022,\n 1,\n 1,\n Number(customTimes[index + 1]?.split(':')[0]),\n Number(customTimes[index + 1]?.split(':')[1])\n );\n const difference = differenceInMinutes(nextHour, hour);\n if (!isNaN(difference)) {\n differences.push(Math.abs(difference));\n }\n }\n });\n\n const allEqualAndValid = (arr: number[]) =>\n arr.every((v) => v === arr[0] && validDifferencesInMinutes.includes(v));\n\n const firstDifference = differences[0] / ONE_HOUR_IN_MINUTES;\n\n const HOURS_IN_DAY = 24;\n const timesInFrequency = HOURS_IN_DAY / firstDifference;\n\n const isIrregular =\n times.length !== timesInFrequency || !allEqualAndValid(differences);\n const frequencyRule = isIrregular\n ? 'custom'\n : `${differences[0] / ONE_HOUR_IN_MINUTES}h`;\n\n return frequencyRule;\n};\n\nconst parseCustomTimes = (eventSchedule: EventScheduleModel) => {\n if (eventSchedule?.scheduleType === 'custom_frequency') {\n const customTimes = eventSchedule.customTimes?.map((time) => {\n if (time.happensAt) {\n return format(convertTimeToDate(time.happensAt), 'HH:mm');\n }\n });\n return customTimes;\n }\n};\n\nconst parseDates = (eventSchedule: EventScheduleModel) => {\n let formattedDate;\n let formattedTime;\n let formattedEndDate;\n\n if (eventSchedule?.frequencyStartsAt) {\n formattedDate = format(\n new Date(eventSchedule?.frequencyStartsAt),\n 'yyyy-MM-dd'\n );\n formattedTime = format(new Date(eventSchedule?.frequencyStartsAt), 'HH:mm');\n if (eventSchedule?.frequencyEndsAt) {\n formattedEndDate = format(\n new Date(eventSchedule?.frequencyEndsAt),\n 'yyyy-MM-dd'\n );\n }\n }\n\n return {\n formattedDate,\n formattedTime,\n formattedEndDate,\n };\n};\n","import { AxiosError } from 'axios';\nimport React, { useEffect, useState } from 'react';\nimport { useHistory, useParams } from 'react-router-dom';\nimport { toast } from 'react-toastify';\nimport { APIError } from '@cuidador/lib';\nimport MedicationInsertForm from '../../../components/MedicationInsertForm';\nimport {\n FormValues,\n MedicationInsertFormStep,\n} from '../../../components/MedicationInsertForm/MedicationSecondStep/utils';\nimport { formDataToMedicationModel } from '../../../components/MedicationInsertForm/MedicationSecondStep/utils/parseFormDataToModel';\nimport { medicationModelToFormData } from '../../../components/MedicationInsertForm/MedicationSecondStep/utils/parseModelToFormData';\nimport { StyledFieldset } from '../../../components/StyledFieldset';\nimport StyledSimpleDialog from '../../../components/StyledSimpleDialog';\nimport useCanAccess from '../../../hooks/useCanAccess';\nimport useMedication from '../../../hooks/useMedication';\nimport { resolveErrorMessage } from '../../../utils/error';\nimport { Header } from '../../../components/Header'\nimport { PageTitle } from '../../../components/PageTitle'\nimport { RemoveButton } from '../../../components/RemoveButton'\nimport { BackButton } from '../../../components/BackButton'\n\nfunction MedicationUpdateV2() {\n const [dialogStatus, setDialogStatus] = useState(false);\n\n const params = useParams<{ id: string }>();\n const { getById, byId, loading, patch, remove } = useMedication();\n const { isAllowedToUpdate, isAllowedToDelete } = useCanAccess(\n 'care/medication'\n );\n\n const id = parseInt(params.id);\n const medication = byId[id];\n const history = useHistory();\n\n useEffect(() => {\n getById(id);\n }, [id]);\n\n const handleSubmit = (values: FormValues) => {\n return patch(\n id,\n formDataToMedicationModel(\n values,\n medication.patientId!,\n medication.subCategoryId!\n )\n )\n .then(() => {\n history.goBack();\n })\n .catch((err: AxiosError) => {\n const displayMessage = resolveErrorMessage(err);\n toast.error(displayMessage);\n });\n };\n\n const handleDelete = (id: number) => {\n setDialogStatus(false);\n remove(id)\n .then(() => {\n history.goBack();\n })\n .catch((err: AxiosError) => {\n const displayMessage = resolveErrorMessage(err);\n toast.error(displayMessage);\n });\n };\n\n if (loading) {\n return null;\n }\n\n return (\n <>\n \n }\n centerContent={\n \n }\n rightContent={\n isAllowedToDelete && (\n setDialogStatus(true)} />\n )\n }\n />\n {medication && (\n <>\n \n \n \n setDialogStatus(false)}\n handleYes={() => handleDelete(id)} // since we have medication with truthy value, id definitely has a valid id\n title=\"Excluir medicamento\"\n subTitle=\"Tem certeza que deseja excluir o medicamento?\"\n />\n \n )}\n \n );\n}\n\nexport default MedicationUpdateV2;\n","import styled from 'styled-components';\nimport { CardBoxProps } from './utils';\n\nexport const CardBox = styled.div`\n position: relative;\n background-color: ${({ color }) => color};\n color: white;\n width: 100%;\n display: flex;\n align-items: center;\n border-radius: 0.5em;\n box-shadow: 0.1em 0.1em 0.2em gray;\n margin-bottom: 1em;\n margin-top: 2em;\n`;\n\nexport const TextContainer = styled.div`\n width: 85%;\n margin: 0.75em 0 0.75em 0.75em;\n`;\n\nexport const ButtonContainer = styled.div`\n width: 15%;\n display: flex;\n justify-content: flex-end;\n font-size: 3em;\n margin-right: 0.2em;\n`;\n\nexport const TitleContainer = styled.div`\n font-size: larger;\n font-weight: bold;\n margin-bottom: 0.25em;\n`;\n","import React from 'react';\nimport {\n ButtonContainer,\n CardBox,\n TextContainer,\n TitleContainer,\n} from './styles';\nimport ControlPointIcon from '@material-ui/icons/ControlPoint';\nimport { useHistory } from 'react-router-dom';\n\ntype RegistrationOnboardingCardProps = {\n color: string;\n title: string;\n subTitle: string;\n registrationPSCRoute: string;\n};\n\nexport default function RegistrationOnboardingCard({\n color,\n title,\n subTitle,\n registrationPSCRoute,\n}: RegistrationOnboardingCardProps) {\n const history = useHistory();\n\n return (\n {\n history.push(registrationPSCRoute);\n }}\n >\n \n {title}\n {subTitle}\n \n \n \n \n \n );\n}\n","import styled from 'styled-components';\n\nexport const Container = styled.div`\n display: flex;\n flex: 1;\n background-color: ${({ theme }) => theme.palette.common.white};\n padding: ${({ theme }) => theme.spacing(5)}px;\n display: flex;\n flex-direction: column;\n color: ${({ theme }) => theme.palette.secondary.main};\n`;\n","import React from 'react';\nimport MedicBalloon from '../../components/MedicBalloon';\nimport RegistrationOnboardingCard from '../../components/RegistrationOnboardingCard';\nimport { Container } from './styles';\nimport { Header } from '../../components/Header'\nimport { PageTitle } from '../../components/PageTitle'\nimport { PscButton } from '../../components/PscButton'\n\nconst Onboarding: React.FC = () => {\n return (\n <>\n \n }\n rightContent={}\n />\n \n \n \n \n \n );\n};\n\nexport default Onboarding;\n","import styled from 'styled-components';\n\ninterface ButtonContainerProps {\n buttonStyle: 'light' | 'dark';\n}\n\nexport const ButtonContainer = styled.div`\n button,\n button:hover {\n background: ${(props) =>\n props.buttonStyle === 'dark'\n ? ({ theme }) => theme.palette.primary.main\n : ({ theme }) => theme.palette.common.white};\n outline: 1px solid ${({ theme }) => theme.palette.primary.main};\n padding: ${({ theme }) => theme.spacing(0.5, 0.1)};\n min-width: 40px;\n min-height: 40px;\n\n svg path {\n stroke: ${(props) =>\n props.buttonStyle === 'dark'\n ? ({ theme }) => theme.palette.common.white\n : ({ theme }) => theme.palette.primary.main};\n }\n }\n`;\n","function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\nimport * as React from \"react\";\n\nvar _ref2 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M13.2213 9.77896C12.3082 8.86622 11.07 8.35348 9.77888 8.35348C8.4878 8.35348 7.24957 8.86622 6.33645 9.77896L2.8929 13.2214C1.97976 14.1345 1.46677 15.373 1.46677 16.6644C1.46677 17.9558 1.97976 19.1942 2.8929 20.1074C3.80604 21.0205 5.04452 21.5335 6.33589 21.5335C7.62726 21.5335 8.86574 21.0205 9.77888 20.1074L11.5001 18.3862\",\n stroke: \"white\",\n strokeWidth: 2,\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n});\n\nvar _ref3 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M9.77983 13.2212C10.693 14.134 11.9312 14.6467 13.2223 14.6467C14.5133 14.6467 15.7516 14.134 16.6647 13.2212L20.1082 9.77879C21.0214 8.86565 21.5344 7.62717 21.5344 6.3358C21.5344 5.04443 21.0214 3.80595 20.1082 2.89281C19.1951 1.97967 17.9566 1.46667 16.6653 1.46667C15.3739 1.46667 14.1354 1.97967 13.2223 2.89281L11.501 4.61402\",\n stroke: \"white\",\n strokeWidth: 2,\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n});\n\nfunction SvgLinkIcon(_ref, svgRef) {\n var title = _ref.title,\n titleId = _ref.titleId,\n props = _objectWithoutProperties(_ref, [\"title\", \"titleId\"]);\n\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n width: 23,\n height: 23,\n viewBox: \"0 0 23 23\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, _ref2, _ref3);\n}\n\nvar ForwardRef = /*#__PURE__*/React.forwardRef(SvgLinkIcon);\nexport default __webpack_public_path__ + \"static/media/link-icon.d3bf4beb.svg\";\nexport { ForwardRef as ReactComponent };","import React from 'react';\nimport { Button } from '@material-ui/core';\nimport { ButtonContainer } from './styles';\nimport { ReactComponent as LinkIcon } from '../../../assets/link-icon.svg';\n\ninterface PatientRelationButtonProps {\n buttonStyle: 'light' | 'dark';\n onClick?: () => void;\n}\n\nconst PatientRelationButton: React.FC = ({\n buttonStyle,\n onClick,\n}) => {\n return (\n \n \n \n \n \n );\n};\n\nexport default PatientRelationButton;\n","function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\nimport * as React from \"react\";\n\nvar _ref2 = /*#__PURE__*/React.createElement(\"circle\", {\n cx: 5,\n cy: 5,\n r: 5,\n fill: \"#5BD059\"\n});\n\nfunction SvgActiveIcon(_ref, svgRef) {\n var title = _ref.title,\n titleId = _ref.titleId,\n props = _objectWithoutProperties(_ref, [\"title\", \"titleId\"]);\n\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n width: 10,\n height: 10,\n viewBox: \"0 0 10 10\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, _ref2);\n}\n\nvar ForwardRef = /*#__PURE__*/React.forwardRef(SvgActiveIcon);\nexport default __webpack_public_path__ + \"static/media/active-icon.fdc711c1.svg\";\nexport { ForwardRef as ReactComponent };","function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\nimport * as React from \"react\";\n\nvar _ref2 = /*#__PURE__*/React.createElement(\"circle\", {\n cx: 5,\n cy: 5,\n r: 5,\n fill: \"#FDB62E\"\n});\n\nfunction SvgPendingIcon(_ref, svgRef) {\n var title = _ref.title,\n titleId = _ref.titleId,\n props = _objectWithoutProperties(_ref, [\"title\", \"titleId\"]);\n\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n width: 10,\n height: 10,\n viewBox: \"0 0 10 10\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, _ref2);\n}\n\nvar ForwardRef = /*#__PURE__*/React.forwardRef(SvgPendingIcon);\nexport default __webpack_public_path__ + \"static/media/pending-icon.b2b28063.svg\";\nexport { ForwardRef as ReactComponent };","function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\nimport * as React from \"react\";\n\nvar _ref2 = /*#__PURE__*/React.createElement(\"circle\", {\n cx: 5,\n cy: 5,\n r: 5,\n fill: \"#999999\"\n});\n\nfunction SvgDisableIcon(_ref, svgRef) {\n var title = _ref.title,\n titleId = _ref.titleId,\n props = _objectWithoutProperties(_ref, [\"title\", \"titleId\"]);\n\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n width: 10,\n height: 10,\n viewBox: \"0 0 10 10\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, _ref2);\n}\n\nvar ForwardRef = /*#__PURE__*/React.forwardRef(SvgDisableIcon);\nexport default __webpack_public_path__ + \"static/media/disable-icon.2a2774af.svg\";\nexport { ForwardRef as ReactComponent };","import React from 'react';\nimport { ReactComponent as ActiveIcon } from '../../assets/active-icon.svg';\nimport { ReactComponent as PendingIcon } from '../../assets/pending-icon.svg';\nimport { ReactComponent as InactiveIcon } from '../../assets/disable-icon.svg';\nimport { Shift, ShiftExecution } from '@cuidador/database';\nimport { addMinutes, isBefore } from 'date-fns'\n\nexport type StatusLabel = 'ATIVA' | 'PENDENTE' | 'INATIVA';\n\nexport type StatusColor = 'red' | 'yellow' | 'green' | 'gray' | 'orange'\n\nexport const resolvePatientStatusLabel = (\n status: string,\n isNew: number\n): StatusLabel => {\n if (status === 'disabled') return 'INATIVA';\n else if (status === 'enabled' && isNew === 1) return 'PENDENTE';\n else return 'ATIVA';\n};\n\nexport const resolvePatientStatusColor = (status: string): StatusColor => {\n switch (status) {\n case 'ATIVA':\n return 'green';\n case 'PENDENTE':\n return 'yellow';\n default:\n return 'gray';\n }\n};\n\nexport const resolveShiftStatusLabel = (shifts: Shift[] | undefined) => {\n if (!shifts || shifts.length === 0) return 'Sem plantão';\n\n if (shifts.some((shift) => shift.status === 'in_progress')) {\n if (!shifts.some((shift) => !!shift.executionInProgress))\n return 'Incompleto';\n\n return (\n shifts.find((shift) => !!shift.executionInProgress)?.executionInProgress\n ?.caregiver?.user?.name ?? ''\n );\n }\n\n if (shifts.some(shift =>\n shift.status === 'available'\n && isBefore(new Date(), addMinutes(new Date(shift.plannedToStartAt!), 30))\n )) return 'Não iniciado'\n\n if (shifts.some((shift) => shift.status === 'available')) return 'Atrasado';\n\n return '';\n};\n\nexport const resolveShiftStatus = (shifts: Shift[] | undefined) => {\n if (!shifts || shifts.length === 0) return 'Sem plantão';\n\n if (shifts.some((shift) => shift.status === 'in_progress')) {\n if (!shifts.some((shift) => !!shift.executionInProgress))\n return 'Incompleto';\n\n return 'Em andamento';\n }\n\n if (shifts.some(shift =>\n shift.status === 'available'\n && isBefore(new Date(), addMinutes(new Date(shift.plannedToStartAt!), 30))\n )) return 'Não iniciado'\n\n if (shifts.some((shift) => shift.status === 'available')) return 'Atrasado';\n\n return '';\n};\n\nexport const resolveShiftStatusColor = (\n status: ReturnType\n) => {\n switch (status) {\n case 'Sem plantão':\n return 'gray';\n case 'Incompleto':\n return 'yellow';\n case 'Atrasado':\n return 'red';\n case 'Não iniciado':\n return 'orange'\n default:\n return 'green';\n }\n};\n\nexport const resolveMemberStatusLabel = (status: string): StatusLabel => {\n switch (status) {\n case 'enabled':\n return 'ATIVA';\n case 'awaitingSignupCompletion':\n return 'PENDENTE';\n default:\n return 'INATIVA';\n }\n};\n\nexport const resolveMemberStatusIcon = (status: string): JSX.Element => {\n switch (resolveMemberStatusLabel(status)) {\n case 'ATIVA':\n return ;\n case 'PENDENTE':\n return ;\n default:\n return ;\n }\n};\n\nexport const getShiftExecutions = (\n shifts: Shift[] | undefined\n): ShiftExecution[] | undefined => {\n if (!shifts || shifts.length === 0) return undefined;\n\n if (shifts.length === 1) return shifts[0].executions;\n\n const shiftInExecution = shifts.find(\n (shift) => shift.status === 'in_progress' && !!shift.executionInProgress\n );\n if (!!shiftInExecution) return shiftInExecution.executions;\n\n const incompleteShift = shifts.find(\n (shift) => shift.status === 'in_progress' && !shift.executionInProgress\n );\n if (!!incompleteShift) return incompleteShift.executions;\n\n return undefined;\n};\n","import styled from 'styled-components';\nimport { IconButton, Typography } from '@material-ui/core';\n\ninterface CardBoxProps {\n isActive?: boolean;\n}\n\ninterface StyledTypographyProps {\n statusColor: string;\n}\n\ninterface StatusLabelProps {\n statusLabel: string;\n}\n\nexport const CardBox = styled.div`\n background-color: ${(props) =>\n props.isActive\n ? props.theme.palette.extra.color.grey.light\n : props.theme.palette.common.white};\n display: grid;\n grid-template-columns: 2fr auto;\n align-items: center;\n justify-content: space-between;\n min-height: ${({ theme }) => theme.spacing(8)}px;\n box-sizing: border-box;\n padding-inline: ${({ theme }) => theme.spacing(3)}px;\n width: 100%;\n`;\n\nexport const UserInfoContainer = styled.div`\n display: flex;\n flex-direction: column;\n margin-left: ${({ theme }) => theme.spacing(1.5)}px;\n margin-right: ${({ theme }) => theme.spacing(1.5)}px;\n width: 100%;\n`;\n\nexport const UserInfo = styled(Typography)`\n color: ${(props) =>\n props.statusLabel === 'INATIVA'\n ? ({ theme }) => theme.palette.extra.color.grey.main\n : ({ theme }) => theme.palette.extra.color.grey.dark};\n font-size: clamp(0.95rem, 75%, 2rem);\n overflow: hidden;\n text-overflow: ellipsis;\n display: -webkit-box;\n -webkit-line-clamp: 1;\n -webkit-box-orient: vertical;\n`;\n\nexport const RoleTitle = styled(Typography)`\n color: ${(props) =>\n props.statusLabel === 'INATIVA'\n ? ({ theme }) => theme.palette.extra.color.grey.main\n : ({ theme }) => theme.palette.extra.color.grey.dark};\n font-size: clamp(0.85rem, 75%, 2rem);\n display: -webkit-box;\n max-width: 350px;\n -webkit-line-clamp: 1;\n -webkit-box-orient: vertical;\n overflow: hidden;\n`;\n\nexport const RoleTitleContainer = styled.div`\n display: flex;\n align-items: center;\n gap: 10px;\n`;\n\nexport const ClickableArea = styled.div`\n cursor: pointer;\n max-width: 400px;\n width: 100%;\n display: flex;\n align-items: center;\n margin-right: ${({ theme }) => theme.spacing(2.5)}px;\n`;\n","import React from 'react';\nimport { Avatar } from '@material-ui/core';\nimport PatientRelationButton from '../PatientRelationButton';\nimport { resolveMemberStatusLabel, resolveMemberStatusIcon } from '../utils';\nimport {\n CardBox,\n ClickableArea,\n UserInfoContainer,\n UserInfo,\n RoleTitle,\n RoleTitleContainer,\n} from './styles';\n\ninterface OrganizationMemberSelectCardProps {\n id: number;\n name: string;\n age?: number;\n profilePictureURL?: string;\n status: string;\n roleTitle?: string;\n isPatientRelatedToUser?: boolean;\n onRowClick?: () => void;\n onRelationClick?: () => void;\n}\n\nconst OrganizationMemberSelectCard: React.FC = ({\n id,\n name,\n age,\n profilePictureURL,\n status,\n roleTitle,\n isPatientRelatedToUser = true,\n onRowClick,\n onRelationClick,\n}) => {\n const buttonStyle = isPatientRelatedToUser ? 'dark' : 'light';\n\n return (\n \n {\n if (onRowClick) {\n onRowClick();\n }\n }}\n >\n \n \n \n {name}\n \n {age != null && (\n \n {age} anos {resolveMemberStatusIcon(status)}\n \n )}\n {roleTitle && (\n \n \n {roleTitle}\n \n {resolveMemberStatusIcon(status)}\n \n )}\n \n \n \n \n );\n};\n\nexport default OrganizationMemberSelectCard;\n","import { differenceInYears } from 'date-fns'\nimport { AxiosResponse } from 'axios'\nimport { toast } from 'react-toastify'\n\nexport function getAge (dateOfBirth = '') {\n return differenceInYears(new Date(), new Date(dateOfBirth))\n}\n\nexport const handleGetProfilePictureURL = async (\n id: number,\n getProfilePictureFn: (\n id: number\n ) => Promise<\n AxiosResponse<{\n signedUrl: string\n }>\n >\n) => {\n if (process.env.REACT_APP_ENV === 'production') {\n try {\n return await getProfilePictureFn(id).then(\n ({ data: { signedUrl } }) => signedUrl\n )\n } catch (err) {\n // ignore patient without profile picture error\n if (!String(err).includes('404')) toast.error(err)\n }\n }\n}\n","import styled from 'styled-components';\n\nexport const Container = styled.div`\n display: flex;\n flex-direction: column;\n flex: 1;\n align-items: center;\n padding: ${({ theme }) => theme.spacing(2, 2)};\n`;\n","import React, { useState } from 'react'\nimport { useHistory } from 'react-router-dom'\nimport { IconButton, InputAdornment, TextField, useTheme } from '@material-ui/core'\nimport { ClearRounded, Search } from '@material-ui/icons'\nimport { useDebouncedCallback } from 'use-debounce'\nimport qs from 'query-string'\n\ntype SearchTextFieldProps = {\n fieldName: string\n onChangeDebounced?: (value: string) => void\n}\n\nconst getSearchValueFromUrl = (url: string) => url.replace(/^\\%|\\%$/g, '')\n\nexport function SearchTextField (props: SearchTextFieldProps) {\n const { fieldName, onChangeDebounced } = props\n const history = useHistory()\n const [searchText, setSearchText] = useState(getSearchValueFromUrl((qs.parse(history.location.search)[fieldName] as string) || ''))\n\n const theme = useTheme()\n\n const debounced = useDebouncedCallback((value: string) => {\n const newSearch = {\n ...qs.parse(history.location.search),\n [fieldName]: value ? `%${value}%` : undefined,\n }\n const newUrl = qs.stringifyUrl({\n url: history.location.pathname,\n query: newSearch,\n })\n history.push(newUrl)\n if (onChangeDebounced) onChangeDebounced(value)\n }, 500)\n\n return (\n {\n debounced.callback(e.target.value)\n setSearchText(e.target.value)\n }}\n InputProps={{\n style: {\n borderColor: theme.palette.primary.main,\n color: '#666666',\n paddingLeft: '14px',\n paddingTop: '10px',\n paddingBottom: '10px'\n },\n endAdornment: (\n \n {searchText.length === 0\n ? \n : (\n {\n setSearchText('')\n debounced.callback('')\n }}\n style={{ padding: 0 }}\n >\n \n \n )\n }\n \n ),\n }}\n style={{\n marginBlock: theme.spacing(2),\n marginInline: theme.spacing(3),\n padding: theme.spacing(1),\n maxWidth: '800px',\n alignSelf: 'center',\n }}\n />\n )\n}\n","import { UserModel } from '@cuidador/database'\nimport { APIError } from '@cuidador/lib'\nimport { AxiosError } from 'axios'\nimport React, { useContext, useEffect, useState } from 'react'\nimport qs from 'query-string'\nimport { useHistory, useParams } from 'react-router-dom'\nimport { toast } from 'react-toastify'\nimport LoadingBackdrop from '../../../components/LoadingBackdrop'\nimport OrganizationMember from '../../../components/SelectCard/Member'\nimport StyledButton from '../../../components/StyledButton'\nimport { AuthContext } from '../../../contexts/auth'\nimport useCanAccess from '../../../hooks/useCanAccess'\nimport usePatient from '../../../hooks/usePatient'\nimport useUser from '../../../hooks/useUser'\nimport { resolveErrorMessage } from '../../../utils/error'\nimport { handleGetProfilePictureURL } from '../utils'\nimport { Container } from './styles'\nimport { PageTitle } from '../../../components/PageTitle'\nimport { Header } from '../../../components/Header'\nimport { BackButton } from '../../../components/BackButton'\nimport { SearchTextField } from '../../../components/SearchTextField'\nimport { PscButton } from '../../../components/PscButton'\n\nconst OrganizationPatient: React.FC = () => {\n const [page, setPage] = useState(0)\n const [organizationMembers, setOrganizationMembers] = useState([])\n const [\n patientIdToProfilePictureURL,\n setPatientIdToProfilePictureURL,\n ] = useState>({})\n\n const {\n total,\n loading: loadingOrganizationMembers,\n getOrganizationMembersPaginated,\n getProfilePicture,\n relateToPatient,\n unrelateFromPatient,\n } = useUser()\n const { getById, byId, loading: loadingPatient } = usePatient()\n\n const { loading: loadingUserInfo, refreshUserInfo, userInfo } = useContext(AuthContext)\n\n const { isAllowedToRead: isAllowedToReadProfilePicture } = useCanAccess('media/profile-picture')\n const { isAllowedToRead: isAllowedToReadOrganizationMembers } = useCanAccess('user/user.by-organization')\n const { isAllowedToInvoke: isAllowedToRelatePatient } = useCanAccess('user/relate-to-patient')\n const { isAllowedToInvoke: isAllowedToUnrelatePatient } = useCanAccess('user/unrelate-from-patient')\n const { isAllowedToRead: isAllowedToReadPatient } = useCanAccess('user/patient')\n\n const history = useHistory()\n const params = useParams<{ id: string }>()\n const patientId = parseInt(params.id)\n const patient = patientId ? byId[patientId] : null\n const historyLocationSearch = history.location.search\n\n useEffect(() => {\n if (!isAllowedToReadOrganizationMembers || !isAllowedToReadPatient) {\n toast.error('Você não tem permissão para visualizar essa página')\n history.push('/cadastros')\n }\n }, [isAllowedToReadOrganizationMembers])\n\n useEffect(() => {\n getPatient()\n }, [patientId, isAllowedToReadPatient])\n\n useEffect(() => {\n getOrganizationMembers()\n }, [\n page,\n historyLocationSearch,\n patientId,\n isAllowedToReadOrganizationMembers,\n ])\n\n const getPatient = async () => {\n if (patientId && isAllowedToReadPatient) {\n getById(patientId).catch((err: AxiosError) => {\n const displayMessage = resolveErrorMessage(err)\n toast.error(displayMessage)\n })\n }\n }\n\n const getOrganizationMembers = () => {\n const params = qs.parse(historyLocationSearch)\n getOrganizationMembersPaginated({\n ...params,\n page,\n limit: 10,\n withRelatedPatientId: Number(patientId),\n })\n .then((response) => {\n const loadedPatients = response.data.results\n const patientsToInsert = loadedPatients\n for (const patient of patientsToInsert) {\n if (patient.id && isAllowedToReadProfilePicture) {\n handleGetProfilePictureURL(patient.id, getProfilePicture).then(\n (url) => {\n if (!url) return\n setPatientIdToProfilePictureURL((previousMap) => {\n if (!patient.id) return { ...previousMap }\n const newMap = { ...previousMap }\n newMap[patient.id] = url\n return newMap\n })\n },\n )\n }\n }\n\n if (page === 0) {\n setOrganizationMembers(patientsToInsert)\n } else {\n setOrganizationMembers([...organizationMembers, ...patientsToInsert])\n }\n })\n .catch((e) => {\n toast.error(e)\n })\n }\n\n const pageIncrement = () => {\n setPage(page + 1)\n }\n\n const onChangeParams = () => {\n if (page !== 0) {\n setPage(0)\n }\n }\n\n const handleRelateOrUnrelate = async (user: UserModel) => {\n if (user.isUserRelatedToPatient) {\n await handleConfirmUnrelate(user)\n } else {\n await handleConfirmRelation(user)\n }\n // refresh userInfo if patched patient<>user relation is about logged user\n if (user.id === userInfo?.id) await refreshUserInfo()\n\n // refresh organization members list from beginning (page 0)\n if (page === 0) {\n getOrganizationMembers()\n } else {\n setPage(0)\n }\n }\n\n const handleConfirmRelation = (user: UserModel) => {\n if (isAllowedToUnrelatePatient) {\n return relateToPatient(Number(user.id), patientId)\n .then(() => {\n toast.dismiss()\n toast.success('Paciente vinculado ao usuário')\n })\n .catch((err) => {\n toast.dismiss()\n const displayMessage = resolveErrorMessage(err)\n toast.error(displayMessage)\n })\n }\n }\n\n const handleConfirmUnrelate = (user: UserModel) => {\n if (isAllowedToRelatePatient) {\n return unrelateFromPatient(Number(user.id), patientId)\n .then(() => {\n toast.dismiss()\n toast.success('Vinculo com usuário removido')\n })\n .catch((err) => {\n toast.dismiss()\n const displayMessage = resolveErrorMessage(err)\n toast.error(displayMessage)\n })\n }\n }\n\n const isLoading =\n loadingPatient || loadingOrganizationMembers || Boolean(loadingUserInfo)\n\n return (\n <>\n \n {patient && (\n <>\n \n }\n centerContent={\n \n }\n rightContent={}\n />\n \n \n {organizationMembers.map((user) => (\n handleRelateOrUnrelate(user)}\n onRowClick={() =>\n history.push(`/pessoas/usuarios/${Number(user.id)}`)\n }\n />\n ))}\n {organizationMembers.length < total && (\n \n Ver mais\n \n )}\n \n \n )}\n \n )\n}\n\nexport default OrganizationPatient\n","import styled from 'styled-components';\n\nexport const Centralizer = styled.div`\n align-items: center;\n flex-direction: column;\n display: flex;\n flex: 1;\n justify-content: flex-end;\n padding: ${({ theme }) => theme.spacing(1)}px;\n\n svg {\n font-size: 4rem;\n }\n\n h6 {\n margin-top: ${({ theme }) => theme.spacing(1)}px;\n }\n\n h6 + div {\n margin-top: ${({ theme }) => theme.spacing(2)}px;\n }\n`;\n\nexport const ButtonContainer = styled.div`\n display: flex;\n flex-direction: row;\n width: 100%;\n\n button {\n width: 100%;\n color: ${({ theme }) => theme.palette.common.white};\n }\n\n button + button {\n margin-left: ${({ theme }) => theme.spacing(2)}px;\n border-color: ${({ theme }) => theme.palette.common.white};\n }\n\n button:nth-child(1) {\n border-color: transparent;\n }\n`;\n","import { Typography } from '@material-ui/core';\nimport WarningIcon from '@material-ui/icons/Warning';\nimport React from 'react';\nimport StyledButton from '../../../../components/StyledButton';\nimport StyledSimpleModal from '../../../../components/StyledSimpleModal';\nimport { ButtonContainer, Centralizer } from './styles';\n\ninterface ModalProps {\n onClose: () => void;\n opened: boolean;\n onConfirm: () => void;\n}\n\nconst AutoRelateModal: React.FC = ({\n onClose,\n opened,\n onConfirm,\n}) => {\n return (\n \n \n \n \n Ao confirmar, você estará{' '}\n \n vinculando automaticamente todos os pacientes cadastrados à essa\n pessoa.\n \n \n \n Tem certeza de que deseja continuar?\n \n \n \n Confirmar\n \n \n Voltar\n \n \n \n \n );\n};\n\nexport default AutoRelateModal;\n","import styled from 'styled-components';\n\nexport const Container = styled.div`\n display: flex;\n flex-direction: column;\n flex: 1;\n align-items: center;\n padding: ${({ theme }) => theme.spacing(2, 2)};\n`;\n\nexport const ButtonContainer = styled.div`\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n margin-bottom: ${({ theme }) => theme.spacing(2)}px;\n width: 100%;\n\n div + div {\n margin-left: ${({ theme }) => theme.spacing(0.75)}px;\n }\n`;\n\nexport const AutoRelateContainer = styled.div<{ isChecked?: boolean }>`\n background-color: ${({ theme, isChecked }) =>\n isChecked ? theme.palette.primary.main : theme.palette.common.white};\n\n padding-left: ${({ theme }) => theme.spacing(1)}px;\n border: 1px solid ${({ theme }) => theme.palette.primary.main};\n border-radius: ${({ theme }) => theme.spacing(1)}px;\n height: 100%;\n\n label {\n span {\n color: ${({ theme, isChecked }) =>\n isChecked ? theme.palette.common.white : theme.palette.primary.main};\n font-weight: bold;\n font-size: ${({ theme }) => theme.spacing(1.6)}px;\n }\n\n .Mui-disabled {\n color: ${({ theme, isChecked }) =>\n isChecked ? theme.palette.common.white : theme.palette.primary.main};\n }\n }\n`;\n\nexport const RemoveRelationsContainer = styled.div`\n border-radius: ${({ theme }) => theme.spacing(1)}px;\n background-color: ${({ theme }) => theme.palette.extra.color.red.dark};\n\n button {\n border: none;\n height: 100%;\n color: ${({ theme }) => theme.palette.common.white};\n\n .MuiButton-label {\n svg {\n margin-right: ${({ theme }) => theme.spacing(1.5)}px;\n }\n span {\n line-height: normal;\n font-size: ${({ theme }) => theme.spacing(1.6)}px;\n }\n }\n }\n`;\n","import { PatientModel } from '@cuidador/database'\nimport { APIError } from '@cuidador/lib'\nimport { Checkbox } from '@material-ui/core'\nimport * as Sentry from '@sentry/react'\nimport { AxiosError } from 'axios'\nimport qs from 'query-string'\nimport React, { useContext, useEffect, useState } from 'react'\nimport { useHistory, useParams } from 'react-router-dom'\nimport { toast } from 'react-toastify'\nimport { ReactComponent as LinkIcon } from '../../../assets/link-icon.svg'\nimport LoadingBackdrop from '../../../components/LoadingBackdrop'\nimport MemberPatients from '../../../components/SelectCard/Member'\nimport StyledButton from '../../../components/StyledButton'\nimport StyledFormControlLabel from '../../../components/StyledFormControlLabel'\nimport { AuthContext } from '../../../contexts/auth'\nimport useCanAccess from '../../../hooks/useCanAccess'\nimport usePatient from '../../../hooks/usePatient'\nimport useUser from '../../../hooks/useUser'\nimport { resolveErrorMessage } from '../../../utils/error'\nimport { getAge, handleGetProfilePictureURL } from '../utils'\nimport AutoRelateModal from './AutoRelateModal'\nimport {\n AutoRelateContainer,\n ButtonContainer,\n Container,\n RemoveRelationsContainer,\n} from './styles'\nimport { Header } from '../../../components/Header'\nimport { PageTitle } from '../../../components/PageTitle'\nimport { BackButton } from '../../../components/BackButton'\nimport { SearchTextField } from '../../../components/SearchTextField'\nimport { PscButton } from '../../../components/PscButton'\n\nconst OrganizationUser: React.FC = () => {\n const [page, setPage] = useState(0)\n const [patients, setPatients] = useState([])\n const [\n patientIdToProfilePictureURL,\n setPatientIdToProfilePictureURL,\n ] = useState>({})\n const [showAutoRelateDialog, setShowAutoRelateDialog] = useState(false)\n const {\n getById,\n byId,\n loading: loadingOrganizationMember,\n patchAutoPatientRelate,\n relateToPatient,\n unrelateFromPatient,\n unrelateAllPatients,\n } = useUser()\n const {\n loading: loadingPatients,\n total,\n getOrganizationPatientsPaginated,\n getProfilePicture,\n } = usePatient()\n\n const { loading: loadingUserInfo, refreshUserInfo, userInfo } = useContext(AuthContext)\n\n const { isAllowedToRead: isAllowedToReadProfilePicture } = useCanAccess('media/profile-picture')\n const { isAllowedToRead: isAllowedToReadPatients } = useCanAccess('user/patient.by-organization')\n const { isAllowedToUpdate: isAllowedToPatchAutoPatientRelate } = useCanAccess('user.auto-patient-relate')\n const { isAllowedToRead: isAllowedToReadUser } = useCanAccess('user')\n const { isAllowedToInvoke: isAllowedToRelatePatient } = useCanAccess('user/relate-to-patient')\n const { isAllowedToInvoke: isAllowedToUnrelatePatient } = useCanAccess('user/unrelate-from-patient')\n\n const history = useHistory()\n const params = useParams<{ id: string }>()\n const userId = parseInt(params.id)\n const user = userId ? byId[userId] : null\n const historyLocationSearch = history.location.search\n\n useEffect(() => {\n if (!isAllowedToReadPatients || !isAllowedToReadUser) {\n toast.error('Você não tem permissão para visualizar essa página')\n history.push('/cadastros')\n }\n }, [isAllowedToReadPatients])\n\n useEffect(() => {\n getUser()\n }, [userId, isAllowedToReadUser])\n\n useEffect(() => {\n handleGetPatients()\n }, [page, historyLocationSearch, userId, isAllowedToReadPatients])\n\n const getUser = async () => {\n if (userId && isAllowedToReadUser) {\n getById(userId).catch((err: AxiosError) => {\n const displayMessage = resolveErrorMessage(err)\n toast.error(displayMessage)\n })\n }\n }\n\n const handleGetPatients = () => {\n const params = qs.parse(historyLocationSearch)\n getOrganizationPatientsPaginated({\n ...params,\n page,\n limit: 10,\n withRelatedUserId: Number(userId),\n })\n .then((response) => {\n const patientsToInsert = response.data.results\n for (const patient of patientsToInsert) {\n if (patient.id && isAllowedToReadProfilePicture) {\n handleGetProfilePictureURL(patient.id, getProfilePicture).then(\n (url) => {\n if (!url) return\n setPatientIdToProfilePictureURL((previousMap) => {\n if (!patient.id) return { ...previousMap }\n const newMap = { ...previousMap }\n newMap[patient.id] = url\n return newMap\n })\n },\n )\n }\n }\n\n if (page === 0) {\n setPatients(patientsToInsert)\n } else {\n setPatients([...patients, ...patientsToInsert])\n }\n })\n .catch((e) => {\n toast.error(e)\n })\n }\n\n const handleConfirmRelation = (patient: PatientModel) => {\n if (isAllowedToUnrelatePatient) {\n return relateToPatient(userId, patient.id!)\n .then(() => {\n patient.isPatientRelatedToUser = !patient.isPatientRelatedToUser\n toast.dismiss()\n toast.success('Paciente vinculado ao usuário')\n return true\n })\n .catch((err) => {\n toast.dismiss()\n const displayMessage = resolveErrorMessage(err)\n toast.error(displayMessage)\n return false\n })\n }\n }\n\n const handleConfirmUnrelate = (patient: PatientModel) => {\n if (isAllowedToRelatePatient) {\n return unrelateFromPatient(userId, patient.id!)\n .then(() => {\n patient.isPatientRelatedToUser = !patient.isPatientRelatedToUser\n toast.dismiss()\n toast.success('Vinculo com paciente removido')\n return true\n })\n .catch((err) => {\n toast.dismiss()\n const displayMessage = resolveErrorMessage(err)\n toast.error(displayMessage)\n return false\n })\n }\n }\n\n const handleRelateOrUnrelate = async (patient: PatientModel) => {\n if (patient.isPatientRelatedToUser) {\n await handleConfirmUnrelate(patient)\n } else {\n await handleConfirmRelation(patient)\n }\n // refresh userInfo if patched patient<>user relation is about logged user\n if (userId === userInfo?.id) await refreshUserInfo()\n\n // refresh patients list from beginning (page 0)\n if (page === 0) {\n handleGetPatients()\n } else {\n setPage(0)\n }\n }\n\n const handleAutoRelatePatientsToUser = async () => {\n if (user?.isAutoPatientRelateEnabled) {\n await autoRelatePatientsToUser(false)\n } else {\n setShowAutoRelateDialog(true)\n }\n }\n\n const autoRelatePatientsToUser = async (isAutoPatientRelateEnabled: boolean) => {\n try {\n await patchAutoPatientRelate(\n Number(user?.id),\n isAutoPatientRelateEnabled,\n )\n if (isAutoPatientRelateEnabled) {\n toast.success('Vínculo automático ativado')\n } else {\n toast.success('Vínculo automático desativado')\n }\n await Promise.all([refreshUserInfo(), handleGetPatients()])\n } catch (err) {\n toast.error('Erro ao modificar vinculo automatico')\n Sentry.captureException(err)\n }\n setShowAutoRelateDialog(false)\n }\n\n const unrelateAllPatientsFromUser = async () => {\n try {\n await unrelateAllPatients(userId)\n toast.success('Todos os vínculos com pacientes foram removidos')\n getUser()\n handleGetPatients()\n } catch (err) {\n console.error(err)\n toast.error('Erro ao remover vínculos')\n Sentry.captureException(err)\n }\n }\n\n const pageIncrement = () => {\n setPage(page + 1)\n }\n\n const onChangeParams = () => {\n if (page !== 0) {\n setPage(0)\n }\n }\n\n const isLoading =\n loadingOrganizationMember || loadingPatients || Boolean(loadingUserInfo)\n\n return (\n <>\n {}\n {user && (\n <>\n \n }\n centerContent={\n \n }\n rightContent={}\n />\n \n \n \n \n \n }\n label='Vinculo automático'\n />\n \n \n \n Remover todos\n \n \n \n {patients.map((patient) => (\n handleRelateOrUnrelate(patient)}\n />\n ))}\n {patients.length < total && (\n \n Ver mais\n \n )}\n setShowAutoRelateDialog(false)}\n onConfirm={() => autoRelatePatientsToUser(true)}\n />\n \n \n )}\n \n )\n}\n\nexport default OrganizationUser\n","import { useCallback, useState } from 'react';\n\nexport type AddressData = {\n logradouro: string;\n complemento: string;\n bairro: string;\n localidade: string;\n uf: string;\n erro?: boolean;\n};\n\nconst useCEP = () => {\n const [loading, setLoading] = useState(false);\n const getAddress = useCallback(async (cep: string) => {\n try {\n setLoading(true);\n const response = await fetch(`https://viacep.com.br/ws/${cep}/json`);\n const data: AddressData = await response.json();\n if (data.erro) throw new Error('CEP Inválido');\n return data;\n } catch (_) {\n return Promise.reject(new Error('CEP Inválido'));\n } finally {\n setLoading(false);\n }\n }, []);\n\n return {\n loading,\n getAddress,\n };\n};\n\nexport default useCEP;\n","import styled from 'styled-components';\nimport MuiFab from '@material-ui/core/Fab';\nimport AvatarEditor from 'react-avatar-editor';\n\nimport { hexToRGBArray } from '../../styles/colorMapping';\n\nexport const Container = styled.div`\n display: flex;\n align-items: center;\n justify-content: center;\n position: relative;\n align-self: center;\n flex-direction: column;\n margin-bottom: 30px;\n\n img {\n height: 82px;\n width: 82px;\n border-radius: 50%;\n border: solid 1px ${({ theme }) => theme.palette.common.white};\n }\n\n label {\n text-decoration: underline;\n }\n`;\n\nexport const Fab = styled(MuiFab)`\n margin-left: 10px;\n margin-bottom: 2px;\n width: 25px;\n height: 25px;\n min-height: auto;\n border: solid 1px ${({ theme }) => theme.palette.common.white};\n svg {\n font-size: 15px;\n }\n background: ${({ theme }) => theme.palette.secondary.main};\n color: ${({ theme }) => theme.palette.common.white};\n`;\n\nexport const StyledEditor = styled(AvatarEditor).attrs((props) => ({\n width: 230,\n height: 230,\n borderRadius: 115, // totally round\n color: [...hexToRGBArray(props.theme.palette.primary.main), 0.8],\n}))``;\n","import React, { useRef, useState } from 'react';\nimport AddRoundedIcon from '@material-ui/icons/AddRounded';\nimport EditRoundedIcon from '@material-ui/icons/EditRounded';\nimport { DialogActions, DialogContent, Slider } from '@material-ui/core';\n\nimport StyledDialog from '../StyledDialog';\nimport StyledButton from '../StyledButton';\nimport UserDefault from '../../assets/user.png';\nimport { Container, Fab, StyledEditor } from './styles';\nimport useCanAccess from '../../hooks/useCanAccess';\n\ntype ProfilePictureProps = {\n onChange: (file: File) => void;\n initialImageUrl?: string;\n};\n\nconst ProfilePicture: React.FC = ({\n onChange,\n initialImageUrl,\n}) => {\n const [editorImage, setEditorImage] = useState('');\n const [openEditor, setOpenEditor] = useState(false);\n const [zoom, setZoom] = useState(1.2);\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const editorRef = useRef();\n const originalFile = useRef();\n const { isAllowedToUpdate } = useCanAccess('media/profile-picture');\n\n const chooseImage = (event: React.ChangeEvent) => {\n const file = event!.target!.files![0];\n if (!file) return;\n setEditorImage(URL.createObjectURL(file || ''));\n originalFile.current = file;\n setOpenEditor(true);\n };\n\n const handleZoomChange = (\n event: React.ChangeEvent,\n value: number | number[]\n ) => {\n setZoom(value as number);\n };\n\n const handleCancel = () => {\n setOpenEditor(false);\n setEditorImage('');\n };\n\n const handleConfirm = () => {\n const canvasScaled = editorRef.current.getImageScaledToCanvas();\n const croppedImg = canvasScaled.toDataURL();\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n canvasScaled.toBlob((blob: any) => {\n onChange(blob);\n setEditorImage(croppedImg);\n }, originalFile!.current!.type);\n setOpenEditor(false);\n };\n\n return (\n <>\n \n \n \n
    \n \n \n
    \n \n \n Cancelar\n \n \n Salvar\n \n \n
    \n
    \n \n \n\n {isAllowedToUpdate && (\n <>\n \n \n \n )}\n \n \n );\n};\n\nexport default ProfilePicture;\n","import styled from 'styled-components';\nimport { CardBoxProps, StatusMessageIconContainerProps } from './utils';\n\nexport const CardBox = styled.div`\n position: relative;\n background-color: ${({ color }) => color};\n color: white;\n width: 100%;\n display: flex;\n align-items: center;\n border-radius: 0.5em;\n box-shadow: 0.1em 0.1em 0.2em gray;\n margin-bottom: 1em;\n`;\n\nexport const TextContainer = styled.div`\n width: 85%;\n margin: 0.75em 0 0.75em 0.75em;\n`;\n\nexport const ButtonContainer = styled.div`\n width: 15%;\n display: flex;\n justify-content: center;\n font-size: 3em;\n margin-right: 0.2em;\n`;\n\nexport const TitleContainer = styled.div`\n font-size: larger;\n font-weight: bold;\n margin-bottom: 0.25em;\n`;\n\nexport const StatusMessageContainer = styled.div`\n font-size: smaller;\n`;\n\nexport const StatusMessageIconContainer = styled.span`\n border: 0.1em solid ${(props) => props.iconColor};\n color: ${(props) => props.iconColor};\n font-size: 1.25em;\n border-radius: 50%;\n display: inline-flex;\n vertical-align: middle;\n background-color: white;\n margin-right: 0.5em;\n`;\n\nexport const AlertContainer = styled.span`\n position: absolute;\n top: -10%;\n right: -2.5%;\n border-radius: 50%;\n background-color: ${({ theme }) => theme.palette.extra.color.red.main};\n width: 1.25em;\n height: 1.25em;\n line-height: 1.25em;\n text-align: center;\n font-weight: bold;\n`;\n","import React from 'react';\nimport { StatusMessageContainer, StatusMessageIconContainer } from './styles';\nimport ClearIcon from '@material-ui/icons/Clear';\nimport DoneIcon from '@material-ui/icons/Done';\nimport { getStatusMessage, NounGender } from './utils';\n\nexport function renderStatusMessage(\n registeredItemsQuantity: number,\n titleGender: NounGender,\n statusTitleSingular?: string,\n statusTitlePlural?: string,\n loading?: boolean\n) {\n const iconColor = registeredItemsQuantity > 0 ? 'green' : 'red';\n const icon =\n registeredItemsQuantity > 0 ? (\n \n ) : (\n \n );\n\n const statusMessage = getStatusMessage(\n registeredItemsQuantity,\n statusTitleSingular,\n statusTitlePlural,\n titleGender\n );\n\n return (\n \n {!loading &&\n <>\n \n {icon}\n \n {statusMessage}\n \n }\n {loading && 'Carregando...'}\n \n );\n}\n","export type CardBoxProps = {\n color: string;\n};\n\nexport type StatusMessageIconContainerProps = {\n iconColor: string;\n};\n\nexport type NounGender = 'male' | 'female';\n\nexport function getStatusMessage(\n amount: number,\n singularNoun?: string,\n pluralNoun?: string,\n nounGender?: NounGender\n) {\n if (!singularNoun || !pluralNoun || !nounGender) {\n return '';\n } else if (amount > 1) {\n return `${amount} ${pluralNoun} cadastrad${\n nounGender === 'male' ? 'o' : 'a'\n }s`;\n } else if (amount > 0) {\n return `${amount} ${singularNoun} cadastrad${\n nounGender === 'male' ? 'o' : 'a'\n }`;\n } else {\n return `sem ${pluralNoun} cadastrad${nounGender === 'male' ? 'o' : 'a'}s`;\n }\n}\n","import ControlPointIcon from '@material-ui/icons/ControlPoint';\nimport NavigateNextIcon from '@material-ui/icons/NavigateNext';\nimport React from 'react';\nimport { useHistory } from 'react-router-dom';\nimport { toast } from 'react-toastify';\nimport { renderStatusMessage } from './renderStatusMessage';\nimport {\n AlertContainer,\n ButtonContainer,\n CardBox,\n TextContainer,\n TitleContainer,\n} from './styles';\nimport { NounGender } from './utils';\n\ntype RegistrationDashboardCardProps = {\n color: string;\n title: string;\n statusTitleSingular?: string;\n statusTitlePlural?: string;\n itemQuantity: number;\n creationRoute: string;\n isAllowedToCreate: boolean;\n visualizationRoute: string;\n titleGender?: NounGender;\n mandatory?: boolean;\n statusMessage?: boolean;\n loading?: boolean\n};\n\nexport default function RegistrationDashboardCard({\n color,\n title,\n statusTitleSingular,\n statusTitlePlural,\n itemQuantity,\n creationRoute,\n isAllowedToCreate,\n visualizationRoute,\n titleGender = 'male',\n mandatory = false,\n statusMessage = true,\n loading\n}: RegistrationDashboardCardProps) {\n const history = useHistory();\n\n return (\n {\n if (itemQuantity > 0) {\n history.push(visualizationRoute);\n } else if (isAllowedToCreate) {\n history.push(creationRoute);\n } else {\n toast.error(\n 'Você não possui autorização para realizar este cadastro.'\n );\n }\n }}\n >\n \n {title}\n {statusMessage &&\n renderStatusMessage(\n itemQuantity,\n titleGender,\n statusTitleSingular,\n statusTitlePlural,\n loading\n )}\n \n \n {itemQuantity > 0 ? (\n \n ) : (\n isAllowedToCreate && (\n \n )\n )}\n \n {mandatory && itemQuantity === 0 && !}\n \n );\n}\n","export default __webpack_public_path__ + \"static/media/EditIconBlack.e88637d1.svg\";","import styled from 'styled-components';\n\nexport const StatusContainer = styled.div`\n width: 100%;\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: space-between;\n color: ${({ theme }) => theme.palette.extra.color.grey.dark};\n`;\n\nexport const StatusLabelContainer = styled.div`\n font-size: 14px;\n /* Medium screen */\n @media only screen and (min-width: 768px) {\n font-size: 1rem;\n }\n`;\n\nexport const ButtonContainer = styled.div`\n display: flex;\n flex-direction: column;\n align-items: center;\n font-size: 14px;\n\n img {\n width: 1.5rem;\n }\n\n button {\n margin: 0;\n padding: 0;\n border: none;\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n background-color: ${({ theme }) => theme.palette.extra.color.grey.light};\n\n &:hover {\n opacity: 0.8;\n }\n }\n\n /* Medium screen */\n @media only screen and (min-width: 768px) {\n font-size: 1rem;\n }\n`;\n\nexport const StatusDescriptionContainer = styled.div`\n color: ${({ theme }) => theme.palette.extra.color.grey.dark};\n font-size: 12px;\n\n /* Medium screen */\n @media only screen and (min-width: 768px) {\n font-size: 1rem;\n }\n`;\n","import { FormControlLabel } from '@material-ui/core';\nimport { Form as FormikForm } from 'formik';\nimport styled from 'styled-components';\nimport StyledButton from '../../../StyledButton';\n\nexport const Container = styled.div``;\n\nexport const Description = styled.div`\n /* Medium screen */\n @media only screen and (min-width: 768px) {\n max-width: 30rem;\n }\n line-height: 1.5;\n & p:nth-child(2) {\n text-align: center;\n }\n`;\n\nexport const ButtonsContainer = styled.div`\n display: flex;\n flex-direction: row;\n justify-content: space-around;\n margin: 1rem 0;\n`;\n\nexport const Button = styled(StyledButton)`\n border: 1px solid ${({ theme }) => theme.palette.common.white};\n color: ${({ theme }) => theme.palette.common.white};\n margin: 0 1rem;\n`;\n\nexport const Form = styled(FormikForm)`\n display: flex;\n flex: 1;\n flex-direction: column;\n color: ${({ theme }) => theme.palette.extra.color.grey.light};\n width: 100%;\n height: 100%;\n justify-content: center;\n align-items: center;\n`;\n\nexport const StyledFormControlLabel = styled(FormControlLabel)`\n color: ${({ theme }) => theme.palette.extra.color.grey.light};\n & .MuiRadio-root {\n color: ${({ theme }) => theme.palette.extra.color.grey.light};\n }\n & .MuiRadio-colorSecondary.Mui-checked {\n color: ${({ theme }) => theme.palette.extra.color.grey.light};\n }\n`;\n","import { PatientModel } from '@cuidador/database';\nimport { Radio, RadioGroup } from '@material-ui/core';\nimport { Formik } from 'formik';\nimport React from 'react';\nimport * as yup from 'yup';\nimport FormikTextField from '../../../Forms/FormikTextField';\nimport StyledSimpleModal from '../../../StyledSimpleModal';\nimport {\n Button,\n ButtonsContainer,\n Container,\n Description,\n Form,\n StyledFormControlLabel,\n} from './styles';\n\ninterface UpdateStatusModalProps {\n open: boolean;\n onClose: () => void;\n onPatchStatus: (values: FormValues) => Promise;\n onResetStatus: () => Promise;\n patientStatus?: PatientModel['status'];\n patientStatusDescription?: string;\n patientStatusLabelAfterReset?: string;\n}\n\ntype FormDisablingReason = {\n value: PatientModel['disablingReason'];\n label: string;\n};\n\nexport type FormValues = {\n disablingReason?: PatientModel['disablingReason'];\n disablingReasonDescription?: string;\n};\n\nconst disablingReasons: FormDisablingReason[] = [\n { value: 'death', label: 'Óbito' },\n { value: 'cancellation', label: 'Atendimento cancelado' },\n {\n value: 'temporary',\n label: 'Suspensão temporária (ex. internação viagem, etc)',\n },\n { value: 'other', label: 'Outro' },\n];\n\nconst validationSchema = yup.object().shape({\n disablingReason: yup\n .string()\n .required()\n .oneOf(['death', 'cancellation', 'temporary', 'other']),\n disablingReasonDescription: yup.string().when('disablingReason', {\n is: 'other',\n then: yup.string().max(255).required('Por favor, descreva o motivo'),\n otherwise: yup.string().optional(),\n }),\n});\n\nconst defaultValues: FormValues = {\n disablingReason: 'death',\n disablingReasonDescription: '',\n};\n\nconst UpdateStatusModal: React.FC = ({\n open,\n onClose,\n onPatchStatus,\n onResetStatus,\n patientStatus,\n patientStatusDescription,\n patientStatusLabelAfterReset,\n}) => {\n return (\n \n \n {patientStatus === 'disabled' ? (\n <>\n \n

    \n Você está prestes a restaurar o status. Ao restaurar o status\n desta pessoa sob cuidado será:\n

    \n

    \n {patientStatusLabelAfterReset}\n

    \n

    {patientStatusDescription}

    \n
    \n \n \n \n \n \n ) : (\n \n {({ isSubmitting, values, setFieldValue }) => {\n return (\n
    \n \n

    \n Ao confirmar a inativação, todos os plantões\n futuros para essa pessoa sob cuidado serão{' '}\n cancelados. Entretanto, as{' '}\n informações históricas permanecerão disponíveis{' '}\n para consulta e será possível também restaurar o status no\n futuro. Caso tenha certeza de que quer desativar,\n escolha a opção que melhor descreve o motivo:\n

    \n
    \n \n {disablingReasons.map((reason) => (\n }\n onChange={() =>\n setFieldValue('disablingReason', reason.value)\n }\n label={reason.label}\n />\n ))}\n \n {values.disablingReason === 'other' && (\n \n )}\n \n \n \n \n \n );\n }}\n \n )}\n
    \n
    \n );\n};\n\nexport default UpdateStatusModal;\n","import { PatientModel } from '@cuidador/database';\n\nexport type PatientStatusType = 'active' | 'inactive' | 'pending';\n\nexport const getPatientStatus = (\n patientStatus: PatientModel['status'],\n patientIsNew: boolean\n): PatientStatusType => {\n if (patientStatus === 'disabled') return 'inactive';\n if (patientStatus === 'enabled' && patientIsNew) return 'pending';\n return 'active';\n};\n\nexport const getPatientStatusLabelAfterReset = (\n patientIsNew: boolean\n): string => {\n return resolveStatusLabel(getPatientStatus('enabled', patientIsNew));\n};\n\nexport const resolveStatusLabel = (\n patientStatus: PatientStatusType\n): string => {\n if (patientStatus === 'pending') return 'PENDENTE';\n if (patientStatus === 'active') return 'ATIVO';\n return 'INATIVO';\n};\n\nexport const getStatusDescription = (status: PatientStatusType) => {\n switch (status) {\n case 'inactive':\n return 'Uso suspenso. Nesse status, não é possível registrar plantões.';\n case 'pending':\n return 'Ainda não foram iniciados plantões para monitoramento dos cuidados.';\n case 'active':\n return 'Uso iniciado.';\n default:\n return '-';\n }\n};\n","import * as Sentry from '@sentry/react';\nimport React, { useContext, useMemo, useState } from 'react';\nimport { toast } from 'react-toastify';\nimport { useTheme } from 'styled-components';\nimport EditIconSvg from '../../../assets/EditIconBlack.svg';\nimport { AuthContext } from '../../../contexts/auth';\nimport useCanAccess from '../../../hooks/useCanAccess';\nimport usePatient from '../../../hooks/usePatient';\nimport { FormCardContainer } from '../../FormCardContainer';\nimport {\n ButtonContainer,\n StatusContainer,\n StatusDescriptionContainer,\n StatusLabelContainer,\n} from './styles';\nimport UpdateStatusModal, { FormValues } from './UpdateStatusModal';\nimport {\n getPatientStatus,\n getPatientStatusLabelAfterReset,\n getStatusDescription,\n PatientStatusType,\n resolveStatusLabel,\n} from './utils';\n\nconst EditIcon = () => ;\n\nconst StatusLabel: React.FC<{ status: PatientStatusType }> = ({ status }) => {\n const styledTheme = useTheme();\n let textColor;\n if (status === 'inactive') {\n textColor = styledTheme.palette.extra.color.grey.main;\n }\n if (status === 'pending') {\n textColor = styledTheme.palette.extra.color.yellow;\n }\n if (status === 'active') {\n textColor = styledTheme.palette.extra.color.green;\n }\n return (\n \n {resolveStatusLabel(status)}\n \n );\n};\n\nconst PatientStatus: React.FC = () => {\n const { userInfo, refreshUserInfo } = useContext(AuthContext);\n const { patch } = usePatient();\n const patient = userInfo?.activePatient;\n const patientId = Number(patient?.id);\n const [isDeleteModalOpen, setIsDeleteModalOpen] = useState(false);\n const { isAllowedToUpdate } = useCanAccess('user/patient');\n\n const patientStatus = useMemo(() => {\n return getPatientStatus(patient?.status, Boolean(patient?.isNew));\n }, [patient?.status, patient?.isNew]);\n\n const onPatchStatus = async (values: FormValues) => {\n try {\n await patch(patientId, {\n ...values,\n status: 'disabled',\n statusUpdatedAt: new Date().toISOString(),\n });\n toast.success('Status do paciente modificado');\n setIsDeleteModalOpen(false);\n await refreshUserInfo();\n } catch (err) {\n Sentry.captureException(err);\n toast.error('Erro ao modificar status do paciente');\n }\n };\n\n const onResetStatus = async () => {\n try {\n await patch(patientId, {\n status: 'enabled',\n statusUpdatedAt: new Date().toISOString(),\n });\n setIsDeleteModalOpen(false);\n toast.success('Status do paciente restaurado');\n await refreshUserInfo();\n } catch (err) {\n Sentry.captureException(err);\n toast.error('Erro ao restaurar status do paciente');\n }\n };\n\n return (\n <>\n \n \n \n Status atual: \n \n \n \n ) => {\n e.preventDefault();\n setIsDeleteModalOpen(true);\n }}\n >\n \n {patientStatus === 'inactive' ? 'Restaurar Status' : 'Inativar'}\n \n \n \n\n \n

    {getStatusDescription(patientStatus)}

    \n
    \n
    \n {isDeleteModalOpen && (\n setIsDeleteModalOpen(false)}\n onPatchStatus={onPatchStatus}\n onResetStatus={onResetStatus}\n patientStatus={patient?.status}\n patientStatusLabelAfterReset={getPatientStatusLabelAfterReset(\n Boolean(patient?.isNew)\n )}\n patientStatusDescription={getStatusDescription(\n getPatientStatus('enabled', Boolean(patient?.isNew))\n )}\n />\n )}\n \n );\n};\n\nexport default PatientStatus;\n","import { Form as FormikForm } from 'formik';\nimport styled from 'styled-components';\n\nexport const Form = styled(FormikForm)`\n display: flex;\n flex: 1;\n flex-direction: column;\n width: 100%;\n color: ${({ theme }) => theme.palette.secondary.main};\n`;\n\nexport const ContentContainer = styled.div`\n margin-top: ${({ theme }) => theme.spacing(3)}px;\n width: 100%;\n display: flex;\n align-items: center;\n flex-direction: column;\n`;\n\nexport const PostalCodeContainer = styled.div`\n display: grid;\n grid-template-columns: 2fr 1fr;\n grid-template-rows: 1fr;\n grid-column-gap: 15px;\n grid-row-gap: 0;\n width: 100%;\n`;\n\nexport const Centralizer = styled.div`\n align-items: center;\n flex-direction: column;\n display: flex;\n flex: 1;\n justify-content: flex-end;\n`;\n\nexport const InterviewCardContainer = styled.div`\n width: 80%;\n\n div {\n padding-left: ${({ theme }) => theme.spacing(2)}px;\n padding-right: ${({ theme }) => theme.spacing(2)}px;\n margin-left: ${({ theme }) => theme.spacing(-2)}px;\n }\n`;\n","import { PatientModel } from '@cuidador/database';\nimport * as yup from 'yup';\nimport {\n cepMask,\n numberMask,\n phoneMask,\n validateCpf,\n} from '../../utils/inputs';\nimport { format } from 'date-fns';\n\nexport enum CustomLabel {\n Name = 'Pelo próprio nome',\n Nickname = 'Pelo apelido',\n}\n\nexport const validationSchema = yup.object().shape({\n name: yup\n .string()\n .required('Por favor, insira o nome completo')\n .min(3, 'O nome deve conter ao menos 3 caracteres')\n .test(\n 'isFullName',\n 'Por favor, insira o nome completo',\n (value) => (value || '').split(' ').length > 1\n ),\n cpf: yup\n .string()\n .test('isCpfValid', 'Por favor, insira um CPF válido', (value) =>\n validateCpf(value || '')\n ),\n gender: yup\n .string()\n .required('Por favor, insira o sexo')\n .oneOf(['male', 'female', 'other']),\n phoneNumber: yup\n .string()\n .min(14, 'Por favor, insira um telefone válido')\n .max(15, 'Por favor, insira um telefone válido'),\n dateOfBirth: yup\n .date()\n .required('Por favor, insira a data de nascimento')\n .max(new Date(), 'Por favor, insira uma data anterior a hoje')\n .nullable()\n .typeError('Por favor, insira uma data válida'),\n nickname: yup.string().when('labelPreference', {\n is: CustomLabel.Nickname,\n then: yup.string().max(124).required('Por favor, insira um apelido'),\n }),\n postalCode: yup.string(),\n province: yup.string(),\n city: yup.string(),\n district: yup.string(),\n streetName: yup.string(),\n streetNumber: yup.string(),\n streetComplement: yup.string(),\n});\n\nexport type FormValues = {\n picture: File | null;\n name: string;\n cpf: string;\n gender: '' | 'male' | 'female' | 'other';\n phoneNumber: string;\n dateOfBirth: string;\n nickname: string;\n labelPreference: CustomLabel;\n initialImageUrl?: string;\n postalCode?: string;\n province?: string;\n city?: string;\n district?: string;\n streetName?: string;\n streetNumber?: string;\n streetComplement?: string;\n};\n\nexport const provincesOptions = [\n 'AC',\n 'AL',\n 'AP',\n 'AM',\n 'BA',\n 'CE',\n 'DF',\n 'ES',\n 'GO',\n 'MA',\n 'MT',\n 'MS',\n 'MG',\n 'PA',\n 'PB',\n 'PR',\n 'PE',\n 'PI',\n 'RJ',\n 'RN',\n 'RS',\n 'RO',\n 'RR',\n 'SC',\n 'SP',\n 'SE',\n 'TO',\n];\n\nexport const genderOptions = [\n { value: 'male', label: 'Masculino' },\n { value: 'female', label: 'Feminino' },\n { value: 'other', label: 'N/A' },\n];\n\nexport const initialValues: FormValues = {\n picture: null,\n name: '',\n cpf: '',\n gender: '',\n phoneNumber: '',\n dateOfBirth: '',\n nickname: '',\n labelPreference: CustomLabel.Name,\n postalCode: '',\n province: '',\n city: '',\n district: '',\n streetName: '',\n streetNumber: '',\n streetComplement: '',\n};\n\nexport const formDataToPatientModel = (values: FormValues) =>\n ({\n name: values.name,\n cpf: numberMask(values.cpf),\n gender: values.gender,\n phoneNumber: values.phoneNumber\n ? numberMask(`55${values.phoneNumber}`)\n : undefined,\n dateOfBirth: format(new Date(values.dateOfBirth), 'yyyy-MM-dd'),\n nickname:\n values.labelPreference === CustomLabel.Nickname ? values.nickname : '',\n postalCode: values.postalCode ? cepMask(values.postalCode) : undefined,\n province: values.province,\n city: values.city,\n district: values.district,\n streetName: values.streetName,\n streetNumber: values.streetNumber,\n streetComplement: values.streetComplement,\n } as PatientModel);\n\nexport const patientModelToFormData = (patient: PatientModel): FormValues => {\n return {\n picture: null,\n name: patient.name || '',\n cpf: patient.cpf || '',\n gender: patient.gender || '',\n phoneNumber: phoneMask(patient?.phoneNumber?.slice(2) || ''),\n dateOfBirth: patient.dateOfBirth || '',\n nickname: patient.nickname || '',\n labelPreference: patient.nickname ? CustomLabel.Nickname : CustomLabel.Name,\n postalCode: patient.postalCode || '',\n province: patient.province || '',\n city: patient.city || '',\n district: patient.district || '',\n streetName: patient.streetName || '',\n streetNumber: patient.streetNumber || '',\n streetComplement: patient.streetComplement || '',\n };\n};\n","import { PatientInterviewModel } from '@cuidador/database';\nimport { clientSideScheme } from '@cuidador/whitelabel';\nimport { Radio, RadioGroup } from '@material-ui/core';\nimport { format } from 'date-fns';\nimport { Formik, FormikHelpers, FormikProps } from 'formik';\nimport React, { useContext, useEffect, useState } from 'react';\nimport { toast } from 'react-toastify';\nimport { AuthContext } from '../../contexts/auth';\nimport useCanAccess from '../../hooks/useCanAccess';\nimport useCEP from '../../hooks/useCEP';\nimport useInterview from '../../hooks/useInterview';\nimport { cepMask, cpfMask, phoneMask } from '../../utils/inputs';\nimport {\n FormCardContainer,\n NewStyledSelect as StyledSelect,\n StyledBoldTitle,\n StyledFormikTextField as FormikTextField,\n} from '../FormCardContainer';\nimport MedicBalloon from '../MedicBalloon';\nimport ProfilePicture from '../ProfilePicture';\nimport RegistrationDashboardCard from '../RegistrationDashboardCard';\nimport StyledButton from '../StyledButton';\nimport StyledFormControlLabel from '../StyledFormControlLabel';\nimport StyledKeyboardDatePicker from '../StyledKeyboardDatePicker';\nimport StyledMenuItem from '../StyledMenuItem';\nimport PatientStatus from './PatientStatus';\nimport {\n Centralizer,\n ContentContainer,\n Form,\n InterviewCardContainer,\n PostalCodeContainer,\n} from './styles';\nimport {\n CustomLabel,\n FormValues,\n genderOptions,\n provincesOptions,\n validationSchema,\n} from './utils';\n\nconst PatientUpsertForm: React.FC<{\n initialValues: FormValues;\n innerRef?: React.Ref>;\n // eslint-disable-next-line\n formikRef?: React.MutableRefObject | null | undefined>;\n onSubmit: (\n values: FormValues,\n formikHelpers: FormikHelpers\n ) => void | Promise;\n initialPictureUrl?: string;\n editingPatient?: boolean;\n disabled?: boolean;\n}> = ({\n initialValues,\n onSubmit,\n innerRef,\n formikRef,\n initialPictureUrl,\n editingPatient,\n disabled,\n}) => {\n const [selectedCustomLabel, setSelectedCustomLabel] = useState(\n initialValues.labelPreference || CustomLabel.Name\n );\n const { isAllowedToUpdate } = useCanAccess('user/patient');\n const [isAllowedToCreate, setIsAllowedToCreate] = useState(false);\n const { appFPalette } = clientSideScheme();\n const { loading: loadingAddressData, getAddress } = useCEP();\n const { getByPatientPaginated } = useInterview();\n const { userInfo } = useContext(AuthContext);\n const patientId = userInfo?.activePatientId;\n\n useEffect(() => {\n let isMounted = true;\n getByPatientPaginated(Number(patientId), {\n limit: 1,\n page: 0,\n orderBy: 'updatedAt',\n order: 'desc',\n isDraft: false,\n }).then((patientInterviews) => {\n if (isMounted) setIsAllowedToCreate(patientInterviews?.total > 0);\n });\n\n return () => (isMounted = false);\n }, []);\n\n const finalDate = format(new Date(), 'yyyy-MM-dd');\n\n const fetchAddress = (cep: string) => {\n if (!formikRef || !formikRef.current) return;\n getAddress(cep)\n .then((data) => {\n const { erro, uf, localidade, bairro, logradouro } = data;\n\n if (!erro && formikRef.current) {\n formikRef.current.setFieldValue('province', uf);\n formikRef.current.setFieldValue('city', localidade);\n formikRef.current.setFieldValue('district', bairro);\n formikRef.current.setFieldValue('streetName', logradouro);\n }\n })\n .catch(() => {\n toast.error('CEP inválido');\n });\n };\n\n // eslint-disable-next-line\n const handlePostalCodeChange = (e: React.ChangeEvent) => {\n if (!formikRef || !formikRef.current) return;\n formikRef.current.setFieldValue('postalCode', e.target.value);\n if (e.target.value.length === 9) {\n fetchAddress(e.target.value);\n }\n };\n\n return (\n \n {({ setFieldValue, values, isSubmitting }) => {\n const handleSelectedCustomLabelChange = (\n e: React.ChangeEvent\n ) => {\n setFieldValue('labelPreference', e.target.value as CustomLabel);\n setSelectedCustomLabel(e.target.value as CustomLabel);\n };\n return (\n
    \n \n \n setFieldValue('picture', file)}\n initialImageUrl={initialPictureUrl}\n />\n \n \n \n {!!editingPatient && }\n \n \n Dados de identificação\n \n \n \n {genderOptions.map((item) => (\n \n {item.label}\n \n ))}\n \n {\n setFieldValue('dateOfBirth', date, true);\n }}\n placeholder=\"dd/mm/aaaa\"\n color=\"secondary\"\n margin=\"none\"\n inputProps={{\n 'data-testid': 'dateOfBirth',\n }}\n InputLabelProps={{ shrink: true }}\n maxDate={finalDate}\n borderType=\"flat\"\n />\n \n ) => {\n setFieldValue('phoneNumber', phoneMask(e.target.value));\n }}\n />\n \n\n \n \n Endereço (opcional)\n \n \n \n \n {provincesOptions.map((province) => (\n \n {province}\n \n ))}\n \n \n \n \n \n \n \n \n\n \n \n Como gosta de ser chamado?\n \n \n {Object.values(CustomLabel).map((label, index) => (\n }\n label={label}\n />\n ))}\n \n {selectedCustomLabel === CustomLabel.Nickname && (\n \n )}\n \n\n \n \n Salvar\n \n \n \n \n );\n }}\n \n );\n};\n\nexport default PatientUpsertForm;\n","import { Typography } from '@material-ui/core';\nimport styled from 'styled-components';\nimport StyledButton from '../../StyledButton';\n\nexport const Centralizer = styled.div`\n align-items: center;\n flex-direction: column;\n display: flex;\n flex: 1;\n justify-content: flex-end;\n padding: ${({ theme }) => theme.spacing(1)}px;\n`;\n\nexport const StyledTypography = styled(Typography)`\n margin-bottom: ${({ theme }) => theme.spacing(2)}px;\n`;\n\nexport const Button = styled(StyledButton)`\n width: 40%;\n`;\n","import React from 'react';\nimport StyledSimpleModal from '../../StyledSimpleModal';\nimport { Button, Centralizer, StyledTypography } from './styles';\n\nexport type ModalProps = {\n onClose: () => void;\n opened: boolean;\n maxPatients: number;\n};\n\nconst MaxPatientModal: React.FC = ({\n opened,\n onClose,\n maxPatients,\n}) => {\n return (\n \n \n \n {`O seu plano atual permite o cadastro de ${maxPatients} pessoa(s).`}\n

    \n Para contratar um plano adicional, entre em contato conosco pelo\n WhatsApp (11) 96189 6764.\n

    \n
    \n \n
    \n
    \n );\n};\n\nexport default MaxPatientModal;\n","import {\n Backdrop as MaterialBackdrop,\n CircularProgress as MaterialCircularProgress,\n} from '@material-ui/core';\nimport styled from 'styled-components';\n\nexport const Container = styled.div`\n display: flex;\n flex: 1;\n background-color: ${({ theme }) => theme.palette.common.white};\n padding: ${({ theme }) => theme.spacing(2)}px;\n display: flex;\n flex-direction: column;\n color: ${({ theme }) => theme.palette.secondary.main};\n`;\n\nexport const Backdrop = styled(MaterialBackdrop)`\n z-index: ${({ theme }) => theme.zIndex.drawer + 1};\n color: ${({ theme }) => theme.palette.primary.light};\n`;\n\nexport const BackdropCircularProgress = styled(MaterialCircularProgress).attrs({\n color: 'inherit',\n})``;\n","import * as Sentry from '@sentry/react';\nimport { FormikProps } from 'formik';\nimport React, { useContext, useEffect, useRef, useState } from 'react';\nimport { useHistory } from 'react-router-dom';\nimport { toast } from 'react-toastify';\nimport PatientUpsertForm from '../../../components/PatientUpsertForm';\nimport MaxPatientModal from '../../../components/PatientUpsertForm/MaxPatientModal';\nimport {\n formDataToPatientModel,\n FormValues,\n initialValues,\n} from '../../../components/PatientUpsertForm/utils';\nimport { AuthContext } from '../../../contexts/auth';\nimport useCanAccess from '../../../hooks/useCanAccess';\nimport useInterview from '../../../hooks/useInterview';\nimport usePatient from '../../../hooks/usePatient';\nimport { resolveErrorMessage } from '../../../utils/error';\nimport { Container } from '../styles';\nimport { Header } from '../../../components/Header'\nimport { BackButton } from '../../../components/BackButton'\nimport { PageTitle } from '../../../components/PageTitle'\nimport { PscButton } from '../../../components/PscButton'\n\nconst PatientRegister: React.FC = () => {\n const history = useHistory();\n const formikRef = useRef | null>();\n const { post, uploadProfilePicture } = usePatient();\n const { post: createInterview } = useInterview();\n const { setActive } = usePatient();\n const { userInfo, refreshUserInfo } = useContext(AuthContext);\n const [visibleModal, setVisibleModal] = useState(true);\n\n const {\n isAllowedToRead: isAllowedToReadInterview,\n isAllowedToCreate: isAllowedToCreateInterview,\n } = useCanAccess('care/interview');\n\n const { isAllowedToUpdate: isAllowedToAnswerInterview } = useCanAccess(\n 'care/interview/answer'\n );\n\n useEffect(() => {\n const patients = userInfo?.user?.patients?.length || 0;\n const maxAllowedPatients =\n userInfo?.user?.organization?.subscription?.maxAllowedPatients || 0;\n // patients related to guardian user (of the organization) must be less than max Allowed Patients in the organization\n if (patients < maxAllowedPatients) {\n setVisibleModal(false);\n }\n }, []);\n\n const handleSubmit = async (values: FormValues) => {\n try {\n const response = await post(formDataToPatientModel(values));\n\n if (isAllowedToCreateInterview) {\n await createInterview({\n interviewedAt: new Date().toISOString(),\n name: 'Primeira Entrevista',\n patientId: response.data.id,\n });\n }\n await setActive(response.data.id);\n await refreshUserInfo();\n\n if (values.picture) {\n try {\n await uploadProfilePicture(values.picture, response.data.id);\n } catch (err) {\n toast.error(\n 'Houve um erro durante o envio de sua imagem, tente novamente acessando seu perfil'\n );\n Sentry.captureException(err);\n }\n }\n toast.success('Criado com sucesso!');\n\n if (\n isAllowedToReadInterview &&\n isAllowedToCreateInterview &&\n isAllowedToAnswerInterview\n ) {\n history.push('/pre-entrevista');\n } else {\n toast.error('Você não possui permissão para preencher a entrevista.');\n history.push('/cadastros');\n }\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n } catch (err: any) {\n const displayMessage = resolveErrorMessage(err);\n const fieldError = err.response?.data.context?.key;\n if (fieldError && Object.keys(initialValues).includes(fieldError)) {\n formikRef.current?.setFieldError(fieldError, displayMessage || '');\n } else {\n toast.error(displayMessage);\n }\n }\n };\n\n return (\n <>\n \n }\n centerContent={\n \n }\n rightContent={\n \n }\n />\n {visibleModal && (\n history.goBack()}\n opened={true}\n maxPatients={\n userInfo?.user?.organization?.subscription?.maxAllowedPatients || 0\n }\n />\n )}\n\n \n (formikRef.current = ref)}\n formikRef={formikRef}\n />\n \n \n );\n};\n\nexport default PatientRegister;\n","import * as Sentry from '@sentry/react';\nimport { FormikProps } from 'formik';\nimport React, { useContext, useEffect, useRef, useState } from 'react';\nimport { useHistory } from 'react-router-dom';\nimport { toast } from 'react-toastify';\nimport PatientUpsertForm from '../../../components/PatientUpsertForm';\nimport {\n formDataToPatientModel,\n FormValues,\n initialValues,\n patientModelToFormData,\n} from '../../../components/PatientUpsertForm/utils';\nimport { StyledFieldset } from '../../../components/StyledFieldset';\nimport { AuthContext } from '../../../contexts/auth';\nimport useCanAccess from '../../../hooks/useCanAccess';\nimport usePatient from '../../../hooks/usePatient';\nimport { resolveErrorMessage } from '../../../utils/error';\nimport { Backdrop, BackdropCircularProgress, Container } from '../styles';\nimport { Header } from '../../../components/Header'\nimport { BackButton } from '../../../components/BackButton'\nimport { PscButton } from '../../../components/PscButton'\nimport { PageTitle } from '../../../components/PageTitle'\n\nconst PatientUpdate: React.FC = () => {\n const history = useHistory();\n const formikRef = useRef | null>();\n const {\n patch,\n uploadProfilePicture,\n getProfilePicture,\n loading,\n } = usePatient();\n const { userInfo, refreshUserInfo } = useContext(AuthContext);\n const [pictureUrl, setPictureUrl] = useState('');\n const patientId = userInfo?.activePatientId;\n const { isAllowedToUpdate } = useCanAccess('user/patient');\n const { isAllowedToRead: isAllowedToReadProfilePicture } = useCanAccess(\n 'media/profile-picture'\n );\n\n const loadUserImage = async () => {\n if (!patientId) return;\n const response = isAllowedToReadProfilePicture\n ? await getProfilePicture(patientId)\n : null;\n setPictureUrl(response?.data?.signedUrl || '');\n };\n\n useEffect(() => {\n if (!patientId) history.replace('/');\n loadUserImage();\n }, []);\n\n const patientFormData = userInfo?.activePatient\n ? patientModelToFormData(userInfo.activePatient)\n : initialValues;\n\n const handleSubmit = async (values: FormValues) => {\n try {\n if (!patientId) return;\n await patch(patientId, formDataToPatientModel(values));\n if (values.picture) {\n try {\n await uploadProfilePicture(values.picture, patientId);\n } catch (err) {\n toast.error(\n 'Houve um erro durante o envio de sua imagem, tente novamente mais tarde'\n );\n Sentry.captureException(err);\n }\n }\n refreshUserInfo();\n toast.success('Cadastro da Pessoa Sob Cuidado atualizado');\n history.push('/cadastros');\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n } catch (err: any) {\n const displayMessage = resolveErrorMessage(err);\n const fieldError = err.response?.data.context?.key;\n if (fieldError && Object.keys(patientFormData).includes(fieldError)) {\n formikRef.current?.setFieldError(fieldError, displayMessage || '');\n } else {\n toast.error(displayMessage);\n }\n }\n };\n\n return (\n <>\n history.push('/cadastros')} />\n }\n centerContent={\n \n }\n rightContent={\n \n }\n />\n \n \n {loading && (\n \n )}\n \n \n (formikRef.current = ref)}\n formikRef={formikRef}\n initialPictureUrl={pictureUrl}\n editingPatient={true}\n disabled={!isAllowedToUpdate}\n />\n \n \n \n );\n};\n\nexport default PatientUpdate;\n","import { SubscriptionDetailModel } from '@cuidador/database';\nimport { useCallback, useReducer } from 'react';\nimport axios from '../config/axios';\nimport { createReducer, Item, ReducerData } from '../utils/store';\n\nconst ENDPOINT = 'user/subscription';\n\nconst initialData: ReducerData = {\n byId: {} as Record>,\n ids: [] as Array,\n total: 0,\n loading: false,\n error: null,\n};\n\nconst useSubscription = () => {\n const [state, dispatch] = useReducer(\n createReducer(),\n initialData\n );\n\n const getById = useCallback(async (id: string) => {\n try {\n dispatch({ type: 'LOADING' });\n const response = await axios.get>(\n `${ENDPOINT}/${id}`\n );\n dispatch({ type: 'GET_BY_ID', payload: response.data });\n return response.data;\n } catch (error) {\n if (error instanceof Error) dispatch({ type: 'ERROR', payload: error });\n throw error;\n }\n }, []);\n\n return {\n ...state,\n getById,\n };\n};\n\nexport default useSubscription;\n","import Typography from '@material-ui/core/Typography';\nimport styled from 'styled-components';\nimport StyledButton from '../../components/StyledButton';\n\nexport const Container = styled.div`\n display: flex;\n flex-direction: column;\n flex: 1;\n background-color: #fafafa;\n padding: ${({ theme }) => theme.spacing(2, 2)};\n`;\n\nexport const StyledIcon = styled.span`\n color: ${({ theme }) => theme.palette.primary.dark};\n margin-right: ${({ theme }) => theme.spacing(1)}px;\n vertical-align: sub;\n`;\n\nexport const StyledDescriptionIcon = styled(StyledIcon)`\n vertical-align: top;\n`;\n\nexport const TypographyContainer = styled.div`\n width: 100%;\n padding: ${({ theme }) => theme.spacing(2, 2)};\n margin-top: ${({ theme }) => theme.spacing(1)}px;\n`;\n\nexport const StyledTypography = styled(Typography)`\n color: ${({ theme }) => theme.palette.extra.color.grey.dark};\n margin-bottom: ${({ theme }) => theme.spacing(1)}px;\n`;\n\nexport const StyledTitle = styled(StyledTypography)`\n font-weight: 600;\n`;\n\nexport const StyledPlan = styled.div`\n padding: ${({ theme }) => theme.spacing(1)}px;\n margin: ${({ theme }) => theme.spacing(1)}px;\n background-color: #f3f3f3;\n border-radius: ${({ theme }) => theme.spacing(1)}px;\n`;\n\nexport const StyledChangePlan = styled(StyledButton)`\n float: right;\n color: ${({ theme }) => theme.palette.common.white};\n background-color: ${({ theme }) => theme.palette.primary.dark};\n`;\n\nexport const StyledText = styled.div`\n margin-left: ${({ theme }) => theme.spacing(2)}px;\n color: ${({ theme }) => theme.palette.extra.color.grey.main};\n`;\n\nexport const StyledLine = styled.div`\n border-bottom: 1px solid #cccccc;\n margin: ${({ theme }) => theme.spacing(2, 2)};\n`;\n\nexport const StyledPay = styled.div`\n padding: ${({ theme }) => theme.spacing(2)}px;\n margin: ${({ theme }) => theme.spacing(1)}px;\n border: 3px solid #cccccc;\n border-radius: ${({ theme }) => theme.spacing(2)}px;\n`;\n\nexport const StyledChangeCard = styled(StyledButton)`\n width: 30%;\n margin-left: 70%;\n color: ${({ theme }) => theme.palette.secondary.main};\n text-decoration: underline;\n border: none;\n`;\n\nexport const StyledChangeContract = styled(StyledButton)`\n align-self: center;\n color: ${({ theme }) => theme.palette.secondary.main};\n text-decoration: underline;\n border: none;\n`;\n","import { SubscriptionDetailModel } from '@cuidador/database';\n\nexport enum IntervalOptions {\n day = 'Diária',\n week = 'Semanal',\n month = 'Mensal',\n year = 'Anual',\n}\n\nexport enum SubscriptionStatusOptions {\n future = 'futura',\n active = 'ativa',\n canceled = 'cancelada',\n failed = 'com pagamento pendente',\n}\n\nexport const calculateSubscriptionTotalValue = (\n subscription: SubscriptionDetailModel\n) => {\n let totalInCentsValue = 0;\n subscription.items?.forEach(\n (item) => (totalInCentsValue += item.priceInCents || 0)\n );\n const fomatedTotalValueInReal = Number(totalInCentsValue / 100).toFixed(2);\n return fomatedTotalValueInReal;\n};\n","import { SubscriptionDetailModel } from '@cuidador/database';\nimport DateRangeIcon from '@material-ui/icons/DateRange';\nimport GroupIcon from '@material-ui/icons/Group';\nimport LocalAtmIcon from '@material-ui/icons/LocalAtm';\nimport LoyaltyIcon from '@material-ui/icons/Loyalty';\nimport StatusIcon from '@material-ui/icons/RemoveRedEye';\nimport format from 'date-fns/format';\nimport React, { useContext, useEffect, useState } from 'react';\nimport { useHistory } from 'react-router-dom';\nimport { toast } from 'react-toastify';\nimport LoadingBackdrop from '../../components/LoadingBackdrop';\nimport PendingRegistrationBanner from '../../components/PendingRegistrationBanner';\nimport { AuthContext } from '../../contexts/auth';\nimport useSubscription from '../../hooks/useSubscription';\nimport {\n Container,\n StyledChangePlan,\n StyledDescriptionIcon,\n StyledIcon,\n StyledLine,\n StyledPlan,\n StyledText,\n StyledTitle,\n StyledTypography,\n} from './styles';\nimport {\n calculateSubscriptionTotalValue,\n IntervalOptions,\n SubscriptionStatusOptions,\n} from './utils';\nimport { Header } from '../../components/Header'\nimport { BackButton } from '../../components/BackButton'\nimport { PageTitle } from '../../components/PageTitle'\nimport { PscButton } from '../../components/PscButton'\n\nconst Plans: React.FC = () => {\n const history = useHistory();\n const [subscription, setSubscription] = useState();\n\n const { userInfo } = useContext(AuthContext);\n const subscriptionId = userInfo?.user?.organization?.subscriptionId;\n const { getById, loading } = useSubscription();\n\n const fetchData = (id: string) => {\n getById(id)\n .then((subscription) => {\n setSubscription(subscription);\n })\n .catch(() => {\n toast.error('Erro ao buscar detalhes do contrato');\n });\n };\n\n useEffect(() => {\n if (!subscriptionId) return;\n fetchData(subscriptionId);\n }, [subscriptionId]);\n\n return (\n <>\n \n }\n centerContent={\n \n }\n rightContent={}\n />\n {loading ? (\n \n ) : (\n <>\n \n \n Detalhes do Plano\n \n \n \n \n \n Status: Cobrança{' '}\n {subscription?.status &&\n SubscriptionStatusOptions[subscription.status]}\n \n \n \n \n \n Pessoas sob cuidado: {subscription?.items?.length}\n \n \n \n \n \n Valor: R${' '}\n {subscription && calculateSubscriptionTotalValue(subscription)}\n \n \n \n \n \n Período de cobrança:{' '}\n {subscription?.interval &&\n IntervalOptions[subscription?.interval]}\n \n\n \n \n \n \n {subscription?.nextBillingAt ? (\n <>\n Data da próxima cobrança:{' '}\n {format(new Date(subscription.nextBillingAt), 'dd/MM/yyyy')}\n \n ) : (\n <>\n Data de início:{' '}\n {subscription?.startsAt &&\n format(new Date(subscription.startsAt), 'dd/MM/yyyy')}\n \n )}\n \n \n \n \n \n \n \n {subscription?.plan?.name}\n \n \n {subscription?.plan?.description}\n \n Trocar plano\n \n\n \n\n {/* \n Informações do pagamento\n \n \n A cobrança é realizada de maneira recorrente, de acordo com o tipo de\n cobrança.\n \n \n \n {payMethod.flag}\n \n \n •••• •••• •••• {payMethod.lastCardNumber}\n \n \n Trocar cartão\n Alterar contrato */}\n \n \n )}\n \n );\n};\n\nexport default Plans;\n","function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\nimport * as React from \"react\";\n\nvar _ref2 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M16.7716 2.04669C18.2758 0.868297 20.0206 0.279099 21.9911 0.279099C23.0741 0.279099 24.2624 0.590064 25.556 1.24473C26.8496 1.88303 27.8724 2.63589 28.6245 3.50332C30.1738 5.59825 30.8206 8.03687 30.595 10.8192C30.3543 13.6015 29.512 15.7783 28.0529 17.3167L16.6362 29.739C16.3504 30.05 15.9894 30.1973 15.5682 30.1973C15.1471 30.1973 14.8011 30.05 14.5153 29.739C14.3764 29.5899 14.2673 29.4112 14.1948 29.214C14.1223 29.0169 14.088 28.8056 14.0941 28.5933C14.0941 28.1351 14.2295 27.7423 14.5153 27.4313L21.4195 19.919C21.7955 19.559 21.7955 19.1825 21.4195 18.7734C21.0434 18.3642 20.6975 18.3642 20.3666 18.7734L13.4624 26.2856C13.3232 26.4382 13.1564 26.5577 12.9726 26.6366C12.7887 26.7155 12.5919 26.752 12.3944 26.7439C11.9732 26.7439 11.6273 26.5966 11.3415 26.2856C11.2026 26.1365 11.0934 25.9578 11.021 25.7607C10.9485 25.5635 10.9142 25.3522 10.9203 25.14C10.9203 24.6817 11.0557 24.2889 11.3415 23.978L18.2457 16.4657C18.6518 16.0565 18.6518 15.6473 18.2457 15.2382C17.8997 14.829 17.5688 14.829 17.1927 15.2382L10.2886 22.8323C10.1478 22.9825 9.98071 23.1005 9.79726 23.1792C9.61382 23.2579 9.41773 23.2958 9.2206 23.2906C8.79943 23.2906 8.43842 23.1433 8.12255 22.8323C7.82171 22.5213 7.67129 22.1449 7.67129 21.6866C7.67129 21.2284 7.83675 20.8192 8.16767 20.4591L15.0869 12.9305C15.4629 12.5213 15.4629 12.1449 15.0869 11.7848C14.7108 11.4248 14.3498 11.4248 14.0189 11.7848L7.03954 19.3298C6.70862 19.6572 6.36266 19.8372 5.98661 19.8372C5.56544 19.8372 5.20444 19.6735 4.93369 19.3298C4.64789 19.0025 4.49748 18.6097 4.49748 18.1514C4.49748 17.6932 4.64789 17.3167 4.93369 17.0058C9.53647 11.9649 12.3794 8.92067 13.4624 7.79137L18.8173 13.5524C19.4039 14.158 20.0808 14.469 20.9081 14.469C21.961 14.469 22.7883 14.0107 23.405 13.0942C23.8262 12.4231 23.9766 11.6866 23.8563 10.8683C23.7359 10.05 23.42 9.36257 22.9086 8.78974L16.7716 2.04669ZM19.8702 12.4068L13.4624 5.41821L2.8128 17.0058C1.54929 15.6146 0.82728 13.487 0.66182 10.5901C0.496361 7.70954 1.21837 5.20545 2.8128 3.11052C4.60277 1.17926 6.7387 0.197266 9.2206 0.197266C11.7175 0.197266 13.8384 1.17926 15.5682 3.11052L21.9911 10.0991C22.2769 10.41 22.4122 10.7865 22.4122 11.2447C22.4122 11.703 22.2769 12.0958 21.9911 12.4068C21.7053 12.7014 21.3593 12.865 20.9081 12.865C20.5019 12.865 20.156 12.7014 19.8702 12.4068Z\",\n fill: \"#65CAD0\"\n});\n\nfunction SvgHands(_ref, svgRef) {\n var title = _ref.title,\n titleId = _ref.titleId,\n props = _objectWithoutProperties(_ref, [\"title\", \"titleId\"]);\n\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n width: 31,\n height: 31,\n viewBox: \"0 0 31 31\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, _ref2);\n}\n\nvar ForwardRef = /*#__PURE__*/React.forwardRef(SvgHands);\nexport default __webpack_public_path__ + \"static/media/hands.e73a4471.svg\";\nexport { ForwardRef as ReactComponent };","import { Typography } from '@material-ui/core';\nimport styled from 'styled-components';\nimport StyledButton from '../StyledButton';\nimport StyledPaper from '../StyledPaper';\n\nexport const CardBox = styled(StyledPaper)`\n color: ${({ theme }) => theme.palette.extra.color.grey.main};\n width: 90%;\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n margin-bottom: ${({ theme }) => theme.spacing(1.5)}px;\n margin-top: 0;\n border-radius: ${({ theme }) => theme.spacing(1.5)}px;\n padding: ${({ theme }) => theme.spacing(2)}px;\n`;\n\nexport const TypographyContainer = styled.div`\n width: 100%;\n color: ${({ theme }) => theme.palette.common.black};\n display: flex;\n flex-direction: row;\n justify-content: space-around;\n padding-bottom: ${({ theme }) => theme.spacing(1)}px;\n margin-bottom: ${({ theme }) => theme.spacing(1)}px;\n border-bottom: 2px solid\n ${({ theme }) => theme.palette.extra.color.grey.light};\n`;\n\nexport const Titles = styled.div`\n width: 95%;\n display: flex;\n flex-direction: column;\n`;\n\nexport const ValueTypography = styled(Typography)`\n color: ${({ theme }) => theme.palette.primary.main};\n`;\n\nexport const DiscountContainer = styled.div`\n padding: ${({ theme }) => theme.spacing(1)}px;\n`;\n\nexport const DiscountTypography = styled(Typography)`\n color: white;\n font-weight: bold;\n text-align: center;\n background-color: ${({ theme }) => theme.palette.extra.color.red.main};\n border-radius: ${({ theme }) => theme.spacing(1)}px;\n`;\n\nexport const DescriptionList = styled.ul`\n margin-left: ${({ theme }) => theme.spacing(-1.5)}px;\n`;\n\nexport const ButtonContainer = styled.div`\n width: 100%;\n display: flex;\n justify-content: end;\n margin-top: ${({ theme }) => theme.spacing(1)}px;\n`;\n\nexport const Button = styled(StyledButton)`\n color: white;\n background-color: ${({ theme }) => theme.palette.primary.main};\n border: 1px solid ${({ theme }) => theme.palette.primary.main};\n font-weight: bold;\n`;\n","import { Typography } from '@material-ui/core';\nimport React from 'react';\nimport useCanAccess from '../../hooks/useCanAccess';\nimport {\n Button,\n ButtonContainer,\n CardBox,\n DescriptionList,\n DiscountContainer,\n DiscountTypography,\n Titles,\n TypographyContainer,\n ValueTypography,\n} from './styles';\nexport type AssignPlanCardProps = {\n name?: string;\n value?: number;\n discount?: number;\n interval?: string;\n intervalCount?: number;\n handleClick: () => void;\n};\n\nexport const AssignPlanCardProps: React.FC = ({\n name,\n value,\n interval,\n intervalCount,\n discount,\n handleClick,\n}) => {\n const isMonthly = () => interval === 'month' && intervalCount === 1;\n const { isAllowedToInvoke } = useCanAccess('user/plan/paid.subscribe');\n\n return (\n \n \n \n {name}\n {value && (\n \n R$ {(value / 100).toFixed(2)}\n \n )}\n \n {discount && (\n \n \n {discount * 100}% OFF\n \n \n )}\n \n \n
  • Acesso a todas as funcionalidades
  • \n
  • Plano de cuidado personalizado
  • \n
  • Cadastro de cuidadores ilimitado
  • \n {isMonthly() &&
  • Cancelamento a qualquer momento
  • }\n
  • \n A assinatura se inicia assim que for confirmado o pagamento\n {isMonthly() && ' e é renovada todo mês, de maneira recorrente'}\n
  • \n
    \n \n \n \n
    \n );\n};\n\nexport default AssignPlanCardProps;\n","import { Typography } from '@material-ui/core';\nimport styled from 'styled-components';\n\nexport const Container = styled.div`\n display: flex;\n flex-direction: column;\n align-items: center;\n flex: 1;\n padding: ${({ theme }) => theme.spacing(2)}px;\n`;\n\nexport const TitleContainer = styled.div`\n display: flex;\n flex-direction: row;\n align-items: flex-start;\n justify-content: space-between;\n margin: ${({ theme }) => theme.spacing(3)}px;\n padding-bottom: ${({ theme }) => theme.spacing(3)}px;\n border-bottom: 2px solid\n ${({ theme }) => theme.palette.extra.color.grey.light};\n`;\n\nexport const TextTitleContainer = styled.div`\n margin-top: ${({ theme }) => theme.spacing(-1)}px;\n width: 85%;\n`;\n\nexport const StyledTypography = styled(Typography)`\n font-size: 1.1em;\n font-weight: bold;\n margin-bottom: ${({ theme }) => theme.spacing(2)}px;\n font-family: Helvetica;\n`;\n","import { PlanModel } from '@cuidador/database';\nimport React, { useContext, useEffect, useState } from 'react';\nimport { useHistory } from 'react-router';\nimport { toast } from 'react-toastify';\nimport { ReactComponent as HandsIcon } from '../../assets/hands.svg';\nimport AssignPlanCardProps from '../../components/AssignPlanCard';\nimport LoadingBackdrop from '../../components/LoadingBackdrop';\nimport usePlan from '../../hooks/usePlan';\nimport {\n Container,\n StyledTypography,\n TextTitleContainer,\n TitleContainer,\n} from './styles';\nimport { Header } from '../../components/Header'\nimport { AuthContext } from '../../contexts/auth'\nimport LogoutDialog from '../../components/LogoutDialog'\nimport { BackButton } from '../../components/BackButton'\nimport { PageTitle } from '../../components/PageTitle'\nimport { PscButton } from '../../components/PscButton'\n\nconst PlanList: React.FC = () => {\n const [plans, setPlans] = useState([]);\n const { loading, getAvailablePlans } = usePlan();\n const history = useHistory();\n const [signOutDialogOpen, setSignOutDialogOpen] = useState(false);\n\n const { signOut } = useContext(AuthContext);\n\n const handleToggleDialog = () => {\n setSignOutDialogOpen(!signOutDialogOpen);\n };\n\n useEffect(() => {\n getAvailablePlans()\n .then((data) => {\n setPlans(data);\n })\n .catch(() => toast.error('Erro ao carregar planos.'));\n }, []);\n\n return (\n <>\n setSignOutDialogOpen(true)}\n />\n }\n centerContent={\n \n }\n rightContent={}\n />\n \n {loading ? (\n \n ) : (\n <>\n \n \n \n \n Contrate o plano que melhor se ajusta à sua necessidade.\n \n \n \n\n \n {plans.map((plan) => (\n \n history.push('/assinatura', { selectedPlan: plan })\n }\n name={plan.planCardTitle || plan.name}\n value={plan.priceInCents}\n discount={plan.discountInPercentage}\n interval={plan.interval}\n intervalCount={plan.intervalCount}\n key={plan.id}\n />\n ))}\n \n \n )}\n \n );\n};\n\nexport default PlanList;\n","import styled from 'styled-components';\n\nexport const Container = styled.div`\n display: flex;\n flex: 1;\n background-color: ${({ theme }) => theme.palette.common.white};\n padding: ${({ theme }) => theme.spacing(2)}px;\n display: flex;\n flex-direction: column;\n color: ${({ theme }) => theme.palette.secondary.main};\n`;\n\nexport const Centralizer = styled.div`\n margin-top: 50px;\n align-items: center;\n flex-direction: column;\n display: flex;\n flex: 1;\n justify-content: flex-start;\n`;\n","import React, { useContext } from 'react';\nimport { useHistory } from 'react-router-dom';\nimport MedicBalloon from '../../components/MedicBalloon';\nimport StyledButton from '../../components/StyledButton';\nimport { AuthContext } from '../../contexts/auth';\nimport { Centralizer, Container } from './styles';\nimport { Header } from '../../components/Header'\nimport { PageTitle } from '../../components/PageTitle'\nimport { PscButton } from '../../components/PscButton'\n\nconst PatientPreInterview: React.FC = () => {\n const history = useHistory();\n\n const { userInfo } = useContext(AuthContext);\n const patient = userInfo?.activePatient;\n\n const patientReference = patient?.nickname || patient?.name || '';\n\n // in the future, ballonTexts will be received from a fetch endpoint\n const MEDIC_BALLOON_TEXTS = [\n `Para que possamos criar um plano de cuidado que atenda às necessidades de forma específica, precisamos conhecer alguns dados de saúde de ${patientReference}.`,\n 'Tenha em mãos informações como: doenças e cirurgias prévias e atuais, alergias, mobilidade, quedas, restrição hídrica, etc.',\n ];\n\n return (\n <>\n \n }\n rightContent={}\n />\n \n \n \n history.push('/entrevista/responder')}\n >\n Continuar\n \n \n \n \n );\n};\n\nexport default PatientPreInterview;\n","import styled from 'styled-components';\n\nexport const Container = styled.div`\n display: flex;\n flex-direction: column;\n align-items: center;\n flex: 1;\n padding: ${({ theme }) => theme.spacing(2)}px;\n`;\n","import React, { useContext, useEffect } from 'react';\nimport MedicBalloon from '../../components/MedicBalloon';\nimport { AuthContext } from '../../contexts/auth';\nimport { Container } from './styles';\nimport { PageTitle } from '../../components/PageTitle'\nimport { Header } from '../../components/Header'\nimport { PscButton } from '../../components/PscButton'\n\nconst ProcessingPayment: React.FC = () => {\n const REFRESH_INTERVAL_IN_SECONDS = 15;\n const { refreshUserInfo } = useContext(AuthContext);\n\n useEffect(() => {\n const interval = setInterval(() => {\n refreshUserInfo();\n }, REFRESH_INTERVAL_IN_SECONDS * 1000);\n return () => clearInterval(interval);\n }, []);\n\n return (\n <>\n \n }\n rightContent={}\n />\n \n \n \n \n );\n};\n\nexport default ProcessingPayment;\n","import Card from '@material-ui/core/Card';\nimport styled from 'styled-components';\n\nexport const Container = styled.div`\n padding: ${({ theme }) => theme.spacing(0, 1)};\n display: flex;\n flex-direction: column;\n flex: 1;\n`;\n\nexport const TypographyContainer = styled.div`\n width: 100%;\n text-align: center;\n color: black;\n margin-top: ${({ theme }) => theme.spacing(6)}px;\n`;\n\nexport const ReportCard = styled(Card).attrs({ elevation: 3 })`\n margin-bottom: ${({ theme }) => theme.spacing(1)}px;\n margin-top: ${({ theme }) => theme.spacing(1)}px;\n & .MuiCardHeader-avatar {\n color: ${({ theme }) => theme.palette.info.main};\n width: 20px;\n }\n & .MuiCardHeader-action {\n margin: 0;\n align-self: center;\n }\n`;\n","import { ProfessionalReportModel } from '@cuidador/database';\nimport { CardActionArea, CardHeader, Typography } from '@material-ui/core';\nimport ChevronRightRoundedIcon from '@material-ui/icons/ChevronRightRounded';\nimport LibraryBooksIcon from '@material-ui/icons/LibraryBooks';\nimport { format } from 'date-fns';\nimport React from 'react';\nimport { useHistory } from 'react-router-dom';\nimport { Container, ReportCard, TypographyContainer } from './styles';\n\ninterface ProfessionalReportListProps {\n reports: ProfessionalReportModel[];\n}\n\nconst ProfessionalReportList: React.FC = ({\n reports,\n}) => {\n const history = useHistory();\n\n const renderReportCard = (report: ProfessionalReportModel) => {\n const formattedDate = format(new Date(report.date || ''), 'dd/MM/yy');\n const subTitle = `${formattedDate} ${report.caregiver?.user?.name}`;\n return (\n \n {\n history.push(`/avaliacao-multiprofissional/${report.id}`);\n }}\n >\n }\n action={}\n title={report.title}\n subheader={subTitle}\n />\n \n \n );\n };\n\n return (\n \n {reports.length > 0 ? (\n <>{reports.map((report) => renderReportCard(report))}\n ) : (\n \n \n Nenhuma avaliação multiprofissional encontrada.\n \n \n )}\n \n );\n};\n\nexport default ProfessionalReportList;\n","import { ProfessionalReportModel } from '@cuidador/database';\nimport { useCallback, useReducer } from 'react';\nimport axios from '../config/axios';\nimport { createReducer } from '../utils/store';\nimport {\n Item,\n PaginatedRequestParams,\n ReducerData,\n} from '../utils/store/index';\n\nconst endpoint = '/report/professional';\n\nconst initialData: ReducerData = {\n byId: {} as Record>,\n ids: [] as Array,\n total: 0,\n loading: false,\n error: null,\n};\n\nconst useProfessionalReport = () => {\n const [state, dispatch] = useReducer(\n createReducer(),\n initialData\n );\n\n const getByPatientId = useCallback(\n async (patientId, params: PaginatedRequestParams) => {\n try {\n dispatch({ type: 'LOADING' });\n const response = await axios.get<{\n results: Item[];\n total: number;\n }>(`${endpoint}/by-patient/${patientId}?isDraft=0`, {\n params,\n });\n dispatch({ type: 'PAGINATION', payload: response.data });\n return Promise.resolve(response.data);\n } catch (err) {\n dispatch({ type: 'ERROR', payload: err });\n return Promise.reject(err);\n }\n },\n []\n );\n\n const getById = useCallback(async (id: number) => {\n try {\n dispatch({ type: 'LOADING' });\n const response = await axios.get(`${endpoint}/${id}`);\n dispatch({ type: 'GET_BY_ID', payload: response.data });\n return Promise.resolve(response.data as ProfessionalReportModel);\n } catch (err) {\n dispatch({ type: 'ERROR', payload: err });\n return Promise.reject(err);\n }\n }, []);\n\n return {\n ...state,\n getByPatientId,\n getById,\n };\n};\n\nexport default useProfessionalReport;\n","import styled from 'styled-components';\n\nexport const Container = styled.div`\n padding: ${({ theme }) => theme.spacing(1, 1, 2, 1)};\n display: flex;\n flex-direction: column;\n flex: 1;\n`;\n","import { PatientModel, ProfessionalReportModel } from '@cuidador/database';\nimport React, { useContext, useEffect, useState } from 'react';\nimport { useParams } from 'react-router-dom';\nimport { toast } from 'react-toastify';\nimport LoadingBackdrop from '../../components/LoadingBackdrop';\nimport ProfessionalReportList from '../../components/ProfessionalReportList';\nimport StyledButton from '../../components/StyledButton';\nimport { AuthContext } from '../../contexts/auth';\nimport useProfessionalReport from '../../hooks/UseProfessionalReport';\nimport { Container } from './styles';\nimport { Header } from '../../components/Header'\nimport { BackButton } from '../../components/BackButton'\nimport { PageTitle } from '../../components/PageTitle'\nimport { PscButton } from '../../components/PscButton'\nconst ProfessionalReport: React.FC = () => {\n const { userInfo } = useContext(AuthContext);\n const { getByPatientId, loading, total } = useProfessionalReport();\n const params = useParams<{ patientId: string }>();\n const patientId = parseInt(params.patientId);\n const [patient, setPatient] = useState();\n const [page, setPage] = useState(0);\n const [professionalReports, setProfessionalReports] = useState<\n ProfessionalReportModel[]\n >([]);\n\n useEffect(() => {\n handlePatientName();\n }, []);\n\n useEffect(() => {\n loadProfessionalReports();\n }, [page]);\n\n const loadProfessionalReports = async () => {\n if (patientId) {\n getByPatientId(patientId, {\n page,\n limit: 10,\n orderBy: 'date',\n order: 'DESC',\n })\n .then((data) => {\n const loadedReports = data.results;\n if (page === 0) {\n setProfessionalReports(loadedReports);\n } else {\n setProfessionalReports([...professionalReports, ...loadedReports]);\n }\n })\n .catch(() =>\n toast.error('Erro ao carregar avaliações multiprofissional.')\n );\n }\n };\n\n const pageIncrement = () => {\n setPage(page + 1);\n };\n\n const handlePatientName = () => {\n const guardianPatientes = userInfo?.user?.patients;\n const patient = guardianPatientes?.find(\n (patient) => patient.id === patientId\n );\n setPatient(patient);\n };\n\n return (\n <>\n \n }\n centerContent={\n \n }\n rightContent={}\n />\n \n \n {loading && }\n {professionalReports.length < total && (\n \n Ver mais\n \n )}\n \n \n );\n};\n\nexport default ProfessionalReport;\n","import { Form as FormikForm } from 'formik';\nimport styled from 'styled-components';\nimport StyledButton from '../StyledButton';\nimport StyledKeyboardDatePicker from '../StyledKeyboardDatePicker';\nimport FormikTextField from '../Forms/FormikTextField';\n\nexport const Form = styled(FormikForm)`\n display: flex;\n flex: 1;\n flex-direction: column;\n color: #000000;\n`;\n\nexport const FormContainer = styled.div`\n margin: 0 ${({ theme }) => theme.spacing(3)}px; ;\n`;\n\nexport const Centralizer = styled.div`\n align-items: center;\n flex-direction: column;\n display: flex;\n flex: 1;\n justify-content: space-evenly;\n`;\n\nexport const OptionsButton = styled(StyledButton)`\n margin-bottom: ${({ theme }) => theme.spacing(2)}px;\n width: 100%;\n max-width: 220px;\n`;\n\nexport const DatePicker = styled(StyledKeyboardDatePicker)`\n input[type='text'][disabled] {\n color: #000000;\n opacity: 1;\n }\n`;\n\nexport const TextField = styled(FormikTextField)`\n input[type='text'][disabled] {\n color: #000000;\n opacity: 1;\n }\n textarea[disabled] {\n color: #000000;\n opacity: 1;\n }\n`;\n","import * as Yup from 'yup';\nimport { FormValues } from '.';\n\nexport const validationSchema = Yup.object().shape({\n title: Yup.string().required('Por favor, insira o título.'),\n description: Yup.string()\n .required('Por favor, insira a descrição.')\n .max(5000, 'A descrição deve conter no máximo 5000 caracteres.'),\n subCategoryId: Yup.string(),\n date: Yup.string().required('Por favor, insira a data.'),\n});\n\nexport enum TitleByOccupation {\n supervisor = 'Avaliação de supervisão',\n doctor = 'Avaliação de medicina',\n nurse = 'Avaliação de enfermagem',\n nursingTechnician = 'Avaliação de técnico em enfermagem',\n physicalTherapist = 'Avaliação de fisioterapia',\n psychologist = 'Avaliação de psicologia',\n occupationalTherapist = 'Avaliação de terapia ocupacional',\n physicalEducator = 'Avaliação de educação física',\n nutritionist = 'Avaliação de nutrição',\n speechTherapist = 'Avaliação de fonoaudiologia',\n dentist = 'Avaliação de odontologia',\n another = 'Outra',\n}\n\nexport const titleOptions = [\n {\n value: TitleByOccupation.supervisor,\n label: TitleByOccupation.supervisor\n },\n {\n value: TitleByOccupation.doctor,\n label: TitleByOccupation.doctor\n },\n {\n value: TitleByOccupation.nurse,\n label: TitleByOccupation.nurse\n },\n {\n value: TitleByOccupation.nursingTechnician,\n label: TitleByOccupation.nursingTechnician,\n },\n {\n value: TitleByOccupation.physicalTherapist,\n label: TitleByOccupation.physicalTherapist,\n },\n {\n value: TitleByOccupation.psychologist,\n label: TitleByOccupation.psychologist,\n },\n {\n value: TitleByOccupation.occupationalTherapist,\n label: TitleByOccupation.occupationalTherapist,\n },\n {\n value: TitleByOccupation.physicalEducator,\n label: TitleByOccupation.physicalEducator,\n },\n {\n value: TitleByOccupation.nutritionist,\n label: TitleByOccupation.nutritionist,\n },\n {\n value: TitleByOccupation.speechTherapist,\n label: TitleByOccupation.speechTherapist,\n },\n { value: TitleByOccupation.dentist, label: TitleByOccupation.dentist },\n { value: TitleByOccupation.another, label: TitleByOccupation.another },\n];\n\nexport const handleTitleByPatientOccupation = (\n occupation?: keyof typeof TitleByOccupation\n): string => {\n return occupation ? TitleByOccupation[occupation] : TitleByOccupation.another;\n};\n\nexport const initialValues: FormValues = {\n caregiver: '',\n date: '',\n title: '',\n description: '',\n subCategoryId: '',\n};\n","import { EventSubCategoryModel } from '@cuidador/database';\nimport DateFnsUtils from '@date-io/date-fns';\nimport { MuiPickersUtilsProvider } from '@material-ui/pickers';\nimport ptBr from 'date-fns/locale/pt-BR';\nimport { Formik } from 'formik';\nimport React from 'react';\nimport { format } from 'util';\nimport StyledSelect from '../Forms/FormikSelect';\nimport StyledMenuItem from '../StyledMenuItem';\nimport { Form, FormContainer, DatePicker, TextField } from './styles';\nimport { titleOptions, validationSchema } from './utils';\n\nexport interface Props {\n subCategories: EventSubCategoryModel[];\n formValues: FormValues;\n}\n\nexport interface FormValues {\n title: string;\n description: string;\n subCategoryId?: number | string;\n date: string;\n caregiver: string;\n}\n\nconst ViewProfessionalReportForm: React.FC = ({\n subCategories,\n formValues,\n}) => {\n const EMPTY_SUBCATEGORY_ID = 0;\n return (\n \n {\n return;\n }}\n validateOnChange={false}\n >\n {({ handleBlur, values, setFieldValue, errors }) => {\n return (\n
    \n \n {\n setFieldValue('date', date, true);\n }}\n placeholder=\"dd/mm/aaaa\"\n color=\"black\"\n margin=\"normal\"\n inputProps={{\n 'data-testid': 'date',\n disabled: true,\n }}\n helperText={errors.date}\n onBlur={handleBlur}\n InputLabelProps={{ shrink: true }}\n readOnly\n disabled\n variant=\"dialog\"\n inputVariant=\"standard\"\n />\n \n \n {titleOptions.map((item) => (\n \n {item.label}\n \n ))}\n \n \n \n {subCategories.map((item) => (\n \n {item.name}\n \n ))}\n \n \n \n );\n }}\n \n
    \n );\n};\n\nexport default ViewProfessionalReportForm;\n","import styled from 'styled-components';\n\nexport const Container = styled.div`\n padding: ${({ theme }) => theme.spacing(1, 1, 2, 1)};\n display: flex;\n flex-direction: column;\n flex: 1;\n`;\n","import { ProfessionalReportModel } from '@cuidador/database';\nimport { FormValues } from '../../../components/ViewProfessionalReportForm';\n\nexport const ProfessionalReportModelToFormValues = (\n report: ProfessionalReportModel\n): FormValues => {\n return {\n caregiver: report?.caregiver?.user?.name || '',\n title: report?.title || '',\n description: report?.description || '',\n date: report?.date || '',\n subCategoryId: report?.eventSubCategory?.id || '',\n };\n};\n","import {\n EventSubCategoryModel,\n ProfessionalReportModel,\n} from '@cuidador/database';\nimport { Typography } from '@material-ui/core';\nimport React, { useEffect, useState } from 'react';\nimport { useParams } from 'react-router-dom';\nimport { toast } from 'react-toastify';\nimport LoadingBackdrop from '../../../components/LoadingBackdrop';\nimport ViewProfessionalReportForm, {\n FormValues,\n} from '../../../components/ViewProfessionalReportForm';\nimport useProfessionalReport from '../../../hooks/UseProfessionalReport';\nimport { Container } from './styles';\nimport { ProfessionalReportModelToFormValues } from './utils';\nimport { Header } from '../../../components/Header'\nimport { BackButton } from '../../../components/BackButton'\nimport { PageTitle } from '../../../components/PageTitle'\nimport { PscButton } from '../../../components/PscButton'\n\nconst ProfessionalReportItem: React.FC = () => {\n const { getById, loading } = useProfessionalReport();\n const params = useParams<{ id: string }>();\n const reportId = parseInt(params.id);\n const [report, setReport] = useState();\n const [reportFormData, setReporFormData] = useState();\n const [subCategories, setSubCategories] = useState(\n []\n );\n\n useEffect(() => {\n handleProfessionalReport();\n }, []);\n\n const handleProfessionalReport = async () => {\n if (reportId) {\n getById(reportId)\n .then((data) => {\n setReport(data);\n setReporFormData(ProfessionalReportModelToFormValues(data));\n const noneOption: EventSubCategoryModel = {\n id: 0,\n name: 'Nenhuma',\n };\n const subCategory = data.eventSubCategory\n ? [data.eventSubCategory]\n : [noneOption];\n\n setSubCategories(subCategory);\n })\n .catch(() =>\n toast.error('Erro ao carregar avaliação multiprofissional.')\n );\n }\n };\n\n return (\n <>\n \n }\n centerContent={\n \n }\n rightContent={}\n />\n \n \n {reportFormData ? (\n \n ) : (\n \n Não foi possível carregar a avalição multiprofissional.\n \n )}\n \n \n );\n};\n\nexport default ProfessionalReportItem;\n","import { Typography } from '@material-ui/core';\nimport styled from 'styled-components';\n\nexport const Container = styled.div`\n display: flex;\n flex-direction: column;\n align-items: center;\n flex: 1;\n padding: ${({ theme }) => theme.spacing(2)}px;\n display: flex;\n flex-direction: column;\n`;\n\nexport const CategoryTitle = styled(Typography)`\n margin: 1.5em auto 0.5em 0;\n font-weight: bold;\n`;\n","import React from 'react';\n\nexport function getMedicBalloonText(\n mandatoryTotals: number[],\n importantTotals: number[]\n) {\n const biggerThanZero = (n: number) => n > 0;\n if (mandatoryTotals.every(biggerThanZero)) {\n if (importantTotals.every(biggerThanZero)) {\n return 'Muito bem! Você finalizou todos os cadastros essenciais e importantes.';\n }\n return 'Muito bem! Você finalizou os cadastros essenciais. Veja que existem outros cadastros importantes para fazer.';\n }\n return (\n \n Vamos agora cadastrar informações como o{' '}\n roteiro diário, rotinas, medicamentos e rede de cuidado, que serão\n essenciais para orientar o cuidado.\n \n );\n}\n","import React, { useContext, useEffect, useState } from 'react'\nimport { clientSideScheme } from '@cuidador/whitelabel'\nimport LoadingBackdrop from '../../components/LoadingBackdrop'\nimport MedicBalloon from '../../components/MedicBalloon'\nimport RegistrationDashboardCard from '../../components/RegistrationDashboardCard'\nimport { AuthContext } from '../../contexts/auth'\nimport { RegistrationDashboardContext } from '../../contexts/registrationDashboard'\nimport useCanAccess from '../../hooks/useCanAccess'\nimport { CategoryTitle, Container } from './styles'\nimport { getMedicBalloonText } from './utils'\nimport { Header } from '../../components/Header'\nimport { PageTitle } from '../../components/PageTitle'\nimport { PscButton } from '../../components/PscButton'\nimport { BackButton } from '../../components/BackButton'\nimport { MenuButton } from '../../components/MenuButton'\nimport { SideMenu } from '../../components/SideMenu'\n\nconst RegistrationDashboard: React.FC = () => {\n const [isMenuOpen, setMenuOpen] = useState(false)\n const { appFPalette } = clientSideScheme()\n const { userInfo } = useContext(AuthContext)\n const { count, isCounting, triggerRefresh } = useContext(\n RegistrationDashboardContext\n )\n const {\n isAllowedToRead: isAllowedToReadAppointment,\n isAllowedToCreate: isAllowedToCreateAppointment,\n } = useCanAccess('care/event/appointment')\n const {\n isAllowedToRead: isAllowedToReadEmergencyContact,\n isAllowedToCreate: isAllowedToCreateEmergencyContact,\n } = useCanAccess('care/emergency-contact')\n const {\n isAllowedToRead: isAllowedToReadMedication,\n isAllowedToCreate: isAllowedToCreateMedication,\n } = useCanAccess('care/medication')\n const { isAllowedToRead: isAllowedToReadCaregiver } = useCanAccess(\n 'user/caregiver'\n )\n const { isAllowedToInvoke: isAllowedToRelateUser } = useCanAccess(\n 'user/relate-to-patient'\n )\n const { isAllowedToCreate: isAllowedToCreateUser } = useCanAccess('user')\n const { isAllowedToRead: isAllowedToReadMeasurement } = useCanAccess(\n 'care/event/measurement'\n )\n const { isAllowedToCreate: isAllowedToCreateEvent } = useCanAccess(\n 'care/event/schedule'\n )\n const {\n isAllowedToRead: isAllowedToReadShift,\n isAllowedToCreate: isAllowedToCreateShift,\n } = useCanAccess('care/shiftschedule')\n const {\n isAllowedToRead: isAllowedToReadAdditionalShift,\n isAllowedToCreate: isAllowedToCreateAdditionalShift,\n } = useCanAccess('care/shift.additional-coverage')\n\n const isAllowedToReadSomeShift =\n isAllowedToReadShift || isAllowedToReadAdditionalShift\n const isAllowedToCreateSomeShift =\n isAllowedToCreateShift || isAllowedToCreateAdditionalShift\n\n const isShiftCardVisible = isAllowedToReadSomeShift\n const isOrganizationCardVisible = isAllowedToReadCaregiver\n const isMedicationCardVisible = isAllowedToReadMedication\n\n const isMeasurementCardVisible = isAllowedToReadMeasurement\n const isRoutineCardVisible = isAllowedToReadMeasurement\n const isAppointmentCardVisible = isAllowedToReadAppointment\n const isEmergencyCardVisible = isAllowedToReadEmergencyContact\n\n const isImportantRegistersVisible =\n isMeasurementCardVisible ||\n isRoutineCardVisible ||\n isAppointmentCardVisible ||\n isEmergencyCardVisible\n\n const { name = '', id: patientId } = userInfo?.activePatient || {}\n\n useEffect(() => {\n triggerRefresh()\n }, [])\n\n if (Object.values(isCounting).every((counting) => counting === true)) {\n return \n }\n\n return (\n <>\n setMenuOpen(false)}\n />\n setMenuOpen(true)} />}\n centerContent={\n \n }\n rightContent={\n \n }\n />\n \n \n {getMedicBalloonText(\n [count.shiftSchedule, count.medication, count.caregiver],\n [\n count.routine,\n count.appointment,\n count.emergencyContact,\n count.measurementSchedule,\n ]\n )}\n \n\n Cadastros essenciais\n \n {isShiftCardVisible && (\n \n )}\n {isOrganizationCardVisible && (\n \n )}\n {isMedicationCardVisible && (\n \n )}\n\n {isImportantRegistersVisible && (\n Cadastros importantes\n )}\n\n {isMeasurementCardVisible && (\n \n )}\n\n {isRoutineCardVisible && (\n \n )}\n {isAppointmentCardVisible && (\n \n )}\n {isEmergencyCardVisible && (\n \n )}\n \n \n )\n}\n\nexport default RegistrationDashboard\n","import { ReportModel } from '@cuidador/database';\nimport { useCallback, useReducer } from 'react';\nimport axios from '../config/axios';\nimport {\n createReducer,\n Item,\n PaginatedRequestParams,\n ReducerData,\n} from '../utils/store/index';\nimport useMedia from './useMedia';\n\nconst endpoint = '/report';\n\nconst initialData: ReducerData = {\n byId: {} as Record>,\n ids: [] as Array,\n total: 0,\n loading: false,\n error: null,\n};\n\nconst useReport = () => {\n const [state, dispatch] = useReducer(\n createReducer(),\n initialData\n );\n const { getMedia } = useMedia();\n\n const getByPatientPaginated = useCallback(\n async (patientId: Id, params: PaginatedRequestParams) => {\n try {\n dispatch({ type: 'LOADING' });\n const response = await axios.get(\n `${endpoint}/by-patient/${patientId}?isDraft=0`,\n {\n params: { ...params },\n }\n );\n dispatch({ type: 'PAGINATION', payload: response.data });\n } catch (err) {\n dispatch({ type: 'ERROR', payload: err });\n }\n },\n []\n );\n\n const getReportUrl = useCallback(\n (patientId: Id, reportId: Id) =>\n getMedia(`/media/patient/${patientId}/report/${reportId}`),\n []\n );\n\n return {\n ...state,\n getByPatientPaginated,\n getReportUrl,\n };\n};\n\nexport default useReport;\n","import Typography from '@material-ui/core/Typography';\nimport styled from 'styled-components';\nimport StyledPaper from '../../components/StyledPaper';\n\nexport const StyledTypography = styled(Typography)`\n color: ${({ theme }) => theme.palette.primary.dark};\n text-align: center;\n margin-top: ${({ theme }) => theme.spacing(1)}px;\n`;\n\nexport const StyledRightTypography = styled(Typography)`\n color: ${({ theme }) => theme.palette.primary.dark};\n text-align: right;\n margin-top: ${({ theme }) => theme.spacing(1)}px;\n`;\n\nexport const Container = styled.div`\n width: 92%;\n color: ${({ theme }) => theme.palette.secondary.main};\n padding: ${({ theme }) => theme.spacing(2)}px;\n`;\n\nexport const Card = styled(StyledPaper)`\n display: flex;\n flex-direction: column;\n border-radius: ${({ theme }) => theme.shape.borderRadius}px;\n color: ${({ theme }) => theme.palette.secondary.main};\n\n button {\n align-self: flex-end;\n color: ${({ theme }) => theme.palette.extra.color.green};\n text-decoration: underline;\n font-weight: normal;\n margin-top: ${({ theme }) => theme.spacing(1)}px;\n\n /* button is aligned to the right, keeping the shape during click effect */\n margin-right: ${({ theme }) => -theme.spacing(1)}px;\n }\n`;\n\nexport const CardHeader = styled.div`\n display: flex;\n justify-content: space-between;\n align-items: center;\n word-wrap: break-word;\n`;\n\nexport const TitleContainer = styled.div`\n width: 70%;\n word-wrap: break-word;\n`;\n\nexport const Title = styled(Typography).attrs({\n variant: 'subtitle1',\n})`\n text-align: center;\n font-weight: 500;\n`;\n\nexport const ReportText = styled(Typography).attrs({\n variant: 'subtitle1',\n})`\n font-weight: bold;\n line-height: normal;\n`;\n","import { ReportModel } from '@cuidador/database';\nimport React, { useState } from 'react';\nimport { toast } from 'react-toastify';\nimport StyledButton from '../../../components/StyledButton';\nimport useReport from '../../../hooks/useReport';\nimport { resolveErrorMessage } from '../../../utils/error';\nimport {\n Card,\n CardHeader,\n ReportText,\n StyledRightTypography,\n TitleContainer,\n} from '../styles';\nimport { formatReportDate } from '../utils';\n\nconst ReportListItem: React.FC = ({\n id,\n name,\n startDate,\n patientId,\n isDraft,\n}) => {\n const { getReportUrl } = useReport();\n const [loading, setLoading] = useState(false);\n\n const handleViewReport = async () => {\n try {\n setLoading(true);\n const {\n data: { signedUrl },\n } = await getReportUrl(patientId, id!);\n\n const blob = await (await fetch(signedUrl)).blob();\n const a = document.createElement('a');\n a.setAttribute('href', URL.createObjectURL(blob));\n a.setAttribute('target', '_blank');\n a.setAttribute('download', String(name));\n a.click();\n } catch (err) {\n toast.error(resolveErrorMessage(err));\n } finally {\n setLoading(false);\n }\n };\n\n return (\n \n \n \n {name}\n \n {formatReportDate(startDate!)}\n \n {!isDraft && (\n \n Baixar PDF\n \n )}\n {!!isDraft && (\n Aguardando finalização\n )}\n \n );\n};\n\nexport default ReportListItem;\n","import formatDate from 'date-fns/format';\nimport { timezoneUnawareDate } from '../../utils/date';\n\nexport const formatReportDate = (date: string) =>\n formatDate(timezoneUnawareDate(date), 'dd/MM/yy');\n","import { PatientModel } from '@cuidador/database';\nimport React, { useContext, useEffect, useState } from 'react';\nimport LoadingBackdrop from '../../components/LoadingBackdrop';\nimport StyledButton from '../../components/StyledButton';\nimport { AuthContext } from '../../contexts/auth';\nimport useReport from '../../hooks/useReport';\nimport ReportListItem from './ReportListItem';\nimport { Container, Title } from './styles';\nimport { Header } from '../../components/Header'\nimport { PageTitle } from '../../components/PageTitle'\nimport { BackButton } from '../../components/BackButton'\nimport { PscButton } from '../../components/PscButton'\n\nconst ReportList: React.FC = () => {\n const { userInfo } = useContext(AuthContext);\n const { getByPatientPaginated, loading, total, ids, byId } = useReport();\n const [patient, setPatient] = useState();\n const [page, setPage] = useState(0);\n\n const patientId = userInfo?.activePatientId;\n\n const onChangeParams = () => {\n if (!patientId) return;\n getByPatientPaginated(patientId, {\n page,\n limit: 10,\n orderBy: 'startDate',\n order: 'DESC',\n });\n };\n\n const handlePatientName = () => {\n const guardianPatientes = userInfo?.user?.patients;\n const patient = guardianPatientes?.find(\n (patient) => patient.id === patientId\n );\n setPatient(patient);\n };\n\n useEffect(() => {\n onChangeParams();\n handlePatientName();\n }, []);\n\n const pageIncrement = () => {\n setPage(page + 1);\n };\n\n return (\n <>\n \n \n }\n centerContent={\n \n }\n rightContent={}\n />\n \n \n Veja aqui o consolidado do mês. Você pode encaminhar para familiares e\n para médicos.\n \n {ids.length <= 0 ? (\n Não há nenhum relatório disponível.\n ) : (\n ids.map((id) => {\n const report = byId[id];\n return (\n \n );\n })\n )}\n {ids.length < total && (\n \n Ver mais\n \n )}\n \n \n );\n};\n\nexport default ReportList;\n","import styled from 'styled-components';\nimport StyledPaper from '../StyledPaper';\n\nexport const CardBox = styled(StyledPaper)`\n width: 100%;\n display: flex;\n margin: 0;\n background-color: ${({ theme }) => theme.palette.extra.color.ocean};\n padding: 0;\n`;\n\nexport const TypographyContainer = styled.div`\n color: ${({ theme }) => theme.palette.common.white};\n display: flex;\n flex-direction: column;\n margin-left: ${({ theme }) => theme.spacing(1)}px;\n width: 100%;\n word-wrap: break-word;\n margin-bottom: ${({ theme }) => theme.spacing(1)}px;\n`;\n\nexport const WeekDayContainer = styled.span`\n color: ${({ theme }) => theme.palette.common.white};\n`;\n\nexport const TimerContainer = styled.div`\n color: ${({ theme }) => theme.palette.common.white};\n margin-left: ${({ theme }) => theme.spacing(1)}px;\n align-self: center;\n`;\n\nexport const IconContainer = styled.div`\n display: flex;\n justify-content: space-between;\n flex-direction: column;\n padding: 0;\n`;\n\nexport const TitleContainer = styled.div`\n margin-bottom: ${({ theme }) => theme.spacing(-0.8)}px;\n`;\n","function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\nimport * as React from \"react\";\n\nvar _ref2 = /*#__PURE__*/React.createElement(\"g\", {\n clipPath: \"url(#clip0_5867_1001)\"\n}, /*#__PURE__*/React.createElement(\"path\", {\n d: \"M12 75C8.8174 75 5.76516 73.7357 3.51472 71.4853C1.26428 69.2349 0 66.1826 0 63L0 11.861C8.50243 4.14906 19.5934 -0.084653 31.072 2.54217e-05C55.333 2.54217e-05 75 18.117 75 40.467C75 55.081 66.59 67.887 53.984 75H12Z\",\n fill: \"#227A7F\"\n}), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M36.277 71.052C54.6211 71.052 69.492 57.3533 69.492 40.455C69.492 23.5568 54.6211 9.85803 36.277 9.85803C17.9329 9.85803 3.06201 23.5568 3.06201 40.455C3.06201 57.3533 17.9329 71.052 36.277 71.052Z\",\n fill: \"#2B999F\"\n}), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M31 70.5L21 60.5L53.5 20L69.5 41C69.5 64 46.5 73.5 31 70.5Z\",\n fill: \"#227A7F\"\n}), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M21.337 60.725L21.224 60.6631C21.0248 60.5633 20.8488 60.4228 20.7073 60.2507C20.5659 60.0786 20.4621 59.8787 20.4029 59.6639C20.3436 59.4492 20.33 59.2244 20.3631 59.0041C20.3962 58.7838 20.4752 58.5729 20.595 58.385L23.757 53.485L26.973 55.2451L23.811 60.1451C23.544 60.5314 23.143 60.8046 22.6858 60.9118C22.2286 61.019 21.7479 60.9524 21.337 60.725V60.725Z\",\n fill: \"white\"\n}), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M51.217 60.725L51.33 60.6631C51.5292 60.5633 51.7053 60.4228 51.8467 60.2507C51.9882 60.0786 52.0919 59.8787 52.1512 59.6639C52.2105 59.4492 52.224 59.2244 52.1909 59.0041C52.1578 58.7838 52.0788 58.5729 51.959 58.385L48.7971 53.485L45.5811 55.2451L48.743 60.1451C49.01 60.5314 49.4111 60.8046 49.8683 60.9118C50.3255 61.019 50.8062 60.9524 51.217 60.725Z\",\n fill: \"#FFF5CA\"\n}), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M27.239 28.83L23.837 30.7888L21.3928 27.1855L24.7948 25.2268L27.239 28.83Z\",\n fill: \"white\"\n}), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M29.583 22.4471C28.3524 20.8992 26.5928 19.8614 24.6428 19.5333C22.6928 19.2053 20.6904 19.6101 19.021 20.6701C18.2077 21.1339 17.5014 21.764 16.948 22.5192C16.3946 23.2744 16.0066 24.1378 15.8093 25.0531C15.612 25.9683 15.6098 26.9149 15.8029 27.831C15.996 28.7472 16.3801 29.6123 16.93 30.37C17.069 30.558 17.216 30.7361 17.371 30.9071L29.964 23.0201C29.8468 22.8228 29.7196 22.6315 29.583 22.4471V22.4471Z\",\n fill: \"#415BE9\"\n}), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M47.6745 25.3237L51.0765 27.2825L48.6348 30.8873L45.2298 28.9278L47.6745 25.3237Z\",\n fill: \"#FFF5CA\"\n}), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M42.9701 22.4471C44.2007 20.8992 45.9604 19.8614 47.9104 19.5333C49.8604 19.2053 51.8628 19.6101 53.5321 20.6701C54.3454 21.1339 55.0518 21.764 55.6052 22.5192C56.1586 23.2744 56.5466 24.1378 56.7439 25.0531C56.9412 25.9683 56.9433 26.9149 56.7502 27.831C56.5571 28.7472 56.1731 29.6123 55.6231 30.37C55.4851 30.558 55.3371 30.7361 55.1821 30.9071L42.5891 23.0201C42.7064 22.8228 42.8335 22.6315 42.9701 22.4471Z\",\n fill: \"#4358C4\"\n}), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M36.276 60.4971C45.8448 60.4971 53.602 52.2466 53.602 42.0691C53.602 31.8915 45.8448 23.6411 36.276 23.6411C26.7071 23.6411 18.95 31.8915 18.95 42.0691C18.95 52.2466 26.7071 60.4971 36.276 60.4971Z\",\n fill: \"#415BE9\"\n}), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M55.2419 42.069C55.2419 52.247 46.2859 60.497 35.2419 60.497V23.639C46.2899 23.639 55.2419 31.89 55.2419 42.069Z\",\n fill: \"#4358C4\"\n}), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M36.2771 56.5531C44.9182 56.5531 51.9231 50.1001 51.9231 42.1401C51.9231 34.18 44.9182 27.7271 36.2771 27.7271C27.6361 27.7271 20.6311 34.18 20.6311 42.1401C20.6311 50.1001 27.6361 56.5531 36.2771 56.5531Z\",\n fill: \"white\"\n}), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M51.176 42.139C51.176 50.099 44.176 56.552 35.53 56.552V27.726C44.171 27.726 51.176 34.179 51.176 42.139Z\",\n fill: \"#F8ECB0\"\n}), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M37.5589 31.226H34.9919V40.892H37.5589V31.226Z\",\n fill: \"#FF6A47\"\n}), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M37.139 31.1071H35.855V40.7731H37.139V31.1071Z\",\n fill: \"#C8483C\"\n}), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M45.6149 41.5151H37.1379V43.8801H45.6149V41.5151Z\",\n fill: \"#C8483C\"\n}), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M36.2769 44.872C37.8554 44.872 39.1349 43.6932 39.1349 42.239C39.1349 40.7849 37.8554 39.606 36.2769 39.606C34.6985 39.606 33.4189 40.7849 33.4189 42.239C33.4189 43.6932 34.6985 44.872 36.2769 44.872Z\",\n fill: \"#415BE9\"\n}), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M39.023 42.2391C38.9918 42.9665 38.6736 43.6519 38.1382 44.1452C37.6027 44.6385 36.8935 44.8995 36.166 44.8711V39.6051C36.6095 39.6036 37.0479 39.6999 37.45 39.8871C37.91 40.0872 38.3028 40.4153 38.5816 40.8322C38.8605 41.2492 39.0137 41.7375 39.023 42.2391V42.2391Z\",\n fill: \"#052AE3\"\n}));\n\nvar _ref3 = /*#__PURE__*/React.createElement(\"defs\", null, /*#__PURE__*/React.createElement(\"clipPath\", {\n id: \"clip0_5867_1001\"\n}, /*#__PURE__*/React.createElement(\"rect\", {\n width: 75.001,\n height: 75,\n fill: \"white\"\n})));\n\nfunction SvgIconClock(_ref, svgRef) {\n var title = _ref.title,\n titleId = _ref.titleId,\n props = _objectWithoutProperties(_ref, [\"title\", \"titleId\"]);\n\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n width: 75,\n height: 75,\n viewBox: \"0 0 75 75\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, _ref2, _ref3);\n}\n\nvar ForwardRef = /*#__PURE__*/React.forwardRef(SvgIconClock);\nexport default __webpack_public_path__ + \"static/media/Icon-clock.50f2643c.svg\";\nexport { ForwardRef as ReactComponent };","import {\n Backdrop as MaterialBackdrop,\n Checkbox,\n CircularProgress as MaterialCircularProgress,\n} from '@material-ui/core';\nimport { Form as FormikForm } from 'formik';\nimport styled from 'styled-components';\nimport StyledButton from '../StyledButton';\n\nexport const Form = styled(FormikForm)`\n display: flex;\n flex: 1;\n flex-direction: column;\n`;\n\nexport const Centralizer = styled.div`\n align-items: center;\n flex-direction: column;\n display: flex;\n flex: 1;\n justify-content: flex-end;\n`;\n\nexport const Backdrop = styled(MaterialBackdrop)`\n z-index: ${({ theme }) => theme.zIndex.drawer + 1};\n color: ${({ theme }) => theme.palette.primary.light};\n position: absolute;\n`;\n\nexport const BackdropCircularProgress = styled(MaterialCircularProgress).attrs({\n color: 'inherit',\n})``;\n\nexport const ContentContainer = styled.div`\n margin-top: ${({ theme }) => theme.spacing(3)}px;\n width: 100%;\n display: flex;\n align-items: center;\n flex-direction: column;\n`;\n\nexport const StyledCheckbox = styled(Checkbox)`\n color: ${(props) => props.theme.palette.secondary.main};\n`;\n\nexport const StyledRow = styled.div`\n width: 100%;\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n align-items: flex-start;\n margin-top: ${({ theme }) => theme.spacing(2)}px;\n margin-bottom: ${({ theme }) => theme.spacing(1)}px;\n`;\n\nexport const Button = styled(StyledButton)`\n margin-bottom: ${({ theme }) => theme.spacing(1.5)}px;\n`;\n","import { EventScheduleModel } from '@cuidador/database';\nimport { format, parse } from 'date-fns';\nimport * as Yup from 'yup';\nimport {\n getLocalWeeklySchedule,\n getUTCWeeklySchedule,\n weekdayMap,\n} from '../../utils/date';\nimport { EVERYDAY, FormValues, MONDAY_TO_FRIDAY } from './index';\n\nexport enum FrequencyType {\n EveryDay = 'Todos os dias',\n MondayToFriday = 'Segunda a sexta',\n SomeDays = 'Alguns dias da semana',\n Custom = 'Intervalos fixos',\n}\n\nexport const validationSchema = Yup.object().shape({\n name: Yup.string().optional(),\n subCategoryId: Yup.string().required('Por favor, insira o tipo da rotina.'),\n time: Yup.string().trim().required('Por favor, insira a hora.'),\n frequencyRule: Yup.string().when('controlFrequency', {\n is: FrequencyType.Custom,\n then: Yup.string().required('Por favor, insira uma frequência.'),\n }),\n frequencyStartsAt: Yup.string().required(\n 'Por favor, insira uma data inicial.'\n ),\n frequencyEndsAt: Yup.string().when('continuous', {\n is: false,\n then: Yup.string().required('Por favor, insira uma data final.'),\n }),\n days: Yup.array().when(['customInterval'], {\n is: (customInterval) => \n customInterval === FrequencyType.EveryDay || \n customInterval === FrequencyType.MondayToFriday || \n customInterval === FrequencyType.SomeDays,\n then: Yup.array().min(1, 'Por favor, selecione o(s) dia(s) da semana.'),\n }),\n description: Yup.string().max(2000, 'Deve conter no máximo 2000 caracteres.'),\n customRangeInDays: Yup.string().when(['rangeInDays','customInterval'], {\n is: (rangeInDays,customInterval) => rangeInDays === 'custom' && customInterval === FrequencyType.Custom,\n then: Yup.string().required('Por favor, insira um intervalo.'),\n }),\n rangeInDays: Yup.string().when(['customInterval'], {\n is: (customInterval) =>\n customInterval === FrequencyType.Custom,\n then: Yup.string().required('Por favor, insira um intervalo.'),\n }),\n});\n\nexport const frequencyOptions: {\n value: FormValues['rangeInDays'];\n name: string;\n}[] = [\n { value: '2d', name: 'A cada 2 dias' },\n { value: '3d', name: 'A cada 3 dias' },\n { value: '5d', name: 'A cada 5 dias' },\n { value: '7d', name: 'A cada 7 dias' },\n { value: '15d', name: 'A cada 15 dias' },\n { value: '30d', name: 'A cada 30 dias' },\n { value: 'custom', name: 'Incluir novo intervalo' },\n];\n\nexport const routineModelToFormValues = (\n routine: EventScheduleModel\n): FormValues => {\n let formattedDate;\n let formattedTime;\n let formattedEndDate;\n\n if (routine?.frequencyStartsAt) {\n formattedDate = format(new Date(routine?.frequencyStartsAt), 'yyyy-MM-dd');\n formattedTime = format(new Date(routine?.frequencyStartsAt), 'HH:mm');\n if (routine?.frequencyEndsAt) {\n formattedEndDate = format(\n new Date(routine?.frequencyEndsAt),\n 'yyyy-MM-dd'\n );\n }\n }\n\n const { rangeInDays, customRangeInDays } = getRangesInDays(\n routine?.frequencyRule || ''\n );\n\n const subCategoryId = routine.subCategory?.length\n ? routine?.subCategory[0]?.id\n : '';\n\n return {\n name: routine.name || '',\n description: routine.description || '',\n subCategoryId,\n time: formattedTime || '',\n frequencyStartsAt: formattedDate || format(new Date(), 'yyyy-MM-dd'),\n frequencyEndsAt: formattedEndDate || '',\n days: getSelectedWeekDays(routine),\n frequencyRule: routine?.frequencyRule || '',\n customInterval: getCustomInterval(getSelectedWeekDays(routine), routine?.frequencyRule),\n continuous: !formattedEndDate,\n rangeInDays: rangeInDays,\n customRangeInDays: customRangeInDays,\n } as FormValues;\n};\n\nexport const formDataToRoutineModel = (\n formData: FormValues,\n patientId: Id\n): EventScheduleModel => {\n const frequencyStartsAt = parse(\n `${formData.frequencyStartsAt} ${formData.time}`,\n 'yyyy-MM-dd HH:mm',\n new Date()\n ).toISOString();\n\n let frequencyEndsAt = undefined;\n if (formData.frequencyEndsAt) {\n frequencyEndsAt = parse(\n `${formData.frequencyEndsAt}`,\n 'yyyy-MM-dd',\n new Date()\n ).toISOString();\n }\n\n const localSchedule = {\n mon: true,\n tue: true,\n wed: true,\n thu: true,\n fri: true,\n sat: true,\n sun: true,\n };\n if (formData.days && formData.days.length > 0) {\n localSchedule.mon = formData.days.includes(weekdayMap.mon);\n localSchedule.tue = formData.days.includes(weekdayMap.tue);\n localSchedule.wed = formData.days.includes(weekdayMap.wed);\n localSchedule.thu = formData.days.includes(weekdayMap.thu);\n localSchedule.fri = formData.days.includes(weekdayMap.fri);\n localSchedule.sat = formData.days.includes(weekdayMap.sat);\n localSchedule.sun = formData.days.includes(weekdayMap.sun);\n }\n const utcSchedule = getUTCWeeklySchedule(\n localSchedule,\n String(formData.time)\n );\n\n const frequencyRule = getFrequencyRule(formData);\n\n return {\n scheduleType: 'frequency',\n name: formData.name,\n description: formData.description,\n subCategory: [{ id: Number(formData.subCategoryId) }],\n patientId: patientId as number,\n ...utcSchedule,\n frequencyStartsAt,\n frequencyRule: frequencyRule || '1d',\n frequencyEndsAt,\n };\n};\n\nconst getRangesInDays = (frequencyRule: string) => {\n let rangeInDays;\n let customRangeInDays;\n const notCustomIntervalOptions = ['1d', '2d', '3d', '5d', '7d', '15d', '30d'];\n if(notCustomIntervalOptions.includes(frequencyRule)) {\n rangeInDays = (frequencyRule === '1d') ? undefined : frequencyRule;\n } else {\n rangeInDays = 'custom';\n customRangeInDays = Number(frequencyRule.split('d')[0]);\n }\n\n return {\n rangeInDays,\n customRangeInDays,\n };\n};\n\nexport const getCustomInterval = (days: string[], freqRule: string | undefined) => {\n const frequencyRule = freqRule || '1d';\n \n const isEveryDay =\n days.length === 7 && days.every((day) => EVERYDAY.includes(day));\n const isMondayToFriday =\n days.length === 5 && days.every((day) => MONDAY_TO_FRIDAY.includes(day));\n const isSomeDays = !isEveryDay && !isMondayToFriday;\n if (frequencyRule === '1d') {\n if (isEveryDay) return FrequencyType.EveryDay;\n if (isMondayToFriday) return FrequencyType.MondayToFriday;\n if (isSomeDays) return FrequencyType.SomeDays;\n }\n return FrequencyType.Custom;\n};\n\nexport const getSelectedWeekDays = (routine: EventScheduleModel) => {\n var { mon, tue, wed, thu, fri, sat, sun } = routine || {};\n\n if(routine.id === null || routine.id === undefined) {\n mon = true;\n tue = true;\n wed = true;\n thu = true;\n fri = true;\n sat = true;\n sun = true;\n }\n\n const utcSchedule = { mon, tue, wed, thu, fri, sat, sun }; \n const date = new Date(routine?.frequencyStartsAt || '');\n const utcTime = `${date\n .getUTCHours()\n .toString()\n .padStart(2, '0')}:${date.getUTCMinutes().toString().padStart(2, '0')}`;\n const localSchedule = getLocalWeeklySchedule(utcSchedule, utcTime);\n\n const selectedWeekDays: string[] = [];\n if (localSchedule.mon) selectedWeekDays.push(weekdayMap.mon);\n if (localSchedule.tue) selectedWeekDays.push(weekdayMap.tue);\n if (localSchedule.wed) selectedWeekDays.push(weekdayMap.wed);\n if (localSchedule.thu) selectedWeekDays.push(weekdayMap.thu);\n if (localSchedule.fri) selectedWeekDays.push(weekdayMap.fri);\n if (localSchedule.sat) selectedWeekDays.push(weekdayMap.sat);\n if (localSchedule.sun) selectedWeekDays.push(weekdayMap.sun);\n\n return selectedWeekDays;\n};\n\nexport const getFrequencyRule = (formData: FormValues) => {\n if (formData.customInterval !== FrequencyType.Custom) return '1d';\n if (formData.rangeInDays !== 'custom') return formData.rangeInDays;\n return `${formData.customRangeInDays}d`;\n};\n","import { Radio, RadioGroup } from '@material-ui/core';\nimport { format } from 'date-fns';\nimport { Formik, FormikHelpers, FormikProps } from 'formik';\nimport isEqual from 'lodash/isEqual';\nimport React, { useEffect, useState } from 'react';\nimport useSubCategory from '../../hooks/useSubCategory';\nimport {\n FormCardContainer,\n HelperContainer,\n NewStyledSelect as StyledSelect,\n StyledBoldTitle,\n StyledFormikTextField as FormikTextField,\n} from '../FormCardContainer';\nimport FormikWeekDaySelect from '../Forms/FormikWeekDaySelect';\nimport MedicBalloon from '../MedicBalloon';\nimport StyledFormControlLabel from '../StyledFormControlLabel';\nimport StyledMenuItem from '../StyledMenuItem';\nimport {\n Backdrop,\n BackdropCircularProgress,\n Button,\n Centralizer,\n ContentContainer,\n Form,\n StyledCheckbox,\n StyledRow,\n} from './styles';\nimport { FrequencyType, frequencyOptions, validationSchema } from './utils';\nimport ErrorText from '../MedicationInsertForm/MedicationSecondStep/ErrorText';\n\nexport interface FormValues {\n name?: string;\n description?: string;\n subCategoryId?: Id;\n time?: string;\n days: string[];\n frequencyRule: string;\n frequencyStartsAt: string;\n frequencyEndsAt?: string;\n customInterval?: FrequencyType;\n continuous?: boolean;\n rangeInDays?: '2d' | '3d' | '5d' | '7d' | '15d' | '30d' | 'custom';\n customRangeInDays?: number;\n}\n\nexport const EVERYDAY = ['Seg', 'Ter', 'Qua', 'Qui', 'Sex', 'Sab', 'Dom'];\nexport const MONDAY_TO_FRIDAY = ['Seg', 'Ter', 'Qua', 'Qui', 'Sex'];\n\nconst AppointmentsUpsertForm: React.FC<{\n initialValues: FormValues;\n innerRef?: React.Ref>;\n onSubmit: (values: FormValues, continuousAdd?: boolean) => Promise;\n disabled?: boolean;\n}> = ({ initialValues, innerRef, onSubmit, disabled }) => {\n const {\n getOnlyForRoutines: getSubCategories,\n ids: subCategoryIds,\n byId,\n loading: loadingSubCategory,\n } = useSubCategory();\n\n const [continuousAdd, setContinuousAdd] = useState(false);\n\n useEffect(() => {\n getSubCategories();\n }, []);\n\n const handleSubmit = async (\n values: FormValues,\n { resetForm }: FormikHelpers\n ) => {\n await onSubmit(values, continuousAdd);\n resetForm();\n };\n\n if (loadingSubCategory) {\n return (\n \n {loadingSubCategory && (\n \n )}\n \n );\n }\n\n const finalDate = format(new Date('12/31/9999'), 'yyyy-MM-dd');\n const initialDate = format(new Date(), 'yyyy-MM-dd');\n\n return (\n <>\n \n {({\n values,\n isSubmitting,\n touched,\n errors,\n setFieldValue,\n handleChange,\n }) => {\n const handleSelectedCustomIntervalChange = (\n e: React.ChangeEvent\n ) => {\n switch (e.target.value as FrequencyType) {\n case FrequencyType.EveryDay:\n setFieldValue('customInterval', FrequencyType.EveryDay);\n setFieldValue('days', EVERYDAY);\n break;\n case FrequencyType.MondayToFriday:\n setFieldValue('customInterval', FrequencyType.MondayToFriday);\n setFieldValue('days', MONDAY_TO_FRIDAY);\n break;\n case FrequencyType.SomeDays:\n setFieldValue('customInterval', FrequencyType.SomeDays);\n setFieldValue('days', []);\n break;\n case FrequencyType.Custom:\n setFieldValue('customInterval', FrequencyType.Custom);\n setFieldValue('days', []);\n break;\n default:\n setFieldValue('customInterval', FrequencyType.EveryDay);\n setFieldValue('days', EVERYDAY);\n break;\n }\n };\n\n const handleSelectedDaysChange = () => { \n if (!values.days) return;\n const isEveryDay =\n values.days.length === 7 &&\n values.days.every((day) => EVERYDAY.includes(day));\n \n const isMondayToFriday =\n values.days.length === 5 &&\n values.days.every((day) => MONDAY_TO_FRIDAY.includes(day));\n\n const isSomeDays = !isEveryDay && !isMondayToFriday;\n if (values.customInterval !== FrequencyType.Custom) { \n if (isEveryDay) setFieldValue('customInterval', FrequencyType.EveryDay);\n if (isMondayToFriday)\n setFieldValue('customInterval', FrequencyType.MondayToFriday);\n if (isSomeDays) setFieldValue('customInterval', FrequencyType.SomeDays);\n }\n };\n\n useEffect(() => {\n handleSelectedDaysChange();\n }, [values.days]);\n\n return (\n \n \n \n \n \n Selecione o tipo da rotina, crie nome e horário para ela\n \n\n \n {subCategoryIds\n .map((id) => byId[id])\n .map((item) => (\n \n {item.name}\n \n ))}\n \n\n \n\n \n {touched.time && errors.time}\n \n }\n />\n \n\n \n \n Dias\n \n\n \n {Object.values(FrequencyType).map((label, index) => (\n }\n label={label}\n disabled={disabled}\n />\n ))}\n \n {values.customInterval === FrequencyType.Custom ? (\n <>\n \n {frequencyOptions.map((frequencyOption, index) => (\n \n {frequencyOption.name}\n \n ))}\n \n {errors.rangeInDays && (\n \n )}\n {values.rangeInDays === 'custom' && (\n <>\n \n {errors.customRangeInDays && (\n \n )}\n \n )}\n \n ) : (\n \n )}\n \n \n \n \n Por quanto tempo?\n \n\n \n }\n label=\"Continuamente\"\n />\n \n \n Data de início\n \n \n \n {!values.continuous && (\n \n \n Data de fim\n \n \n \n )}\n \n\n \n \n Instruções (opcional)\n \n\n \n \n\n \n setContinuousAdd(false)}\n >\n Salvar\n \n setContinuousAdd(true)}\n >\n Salvar e adicionar nova\n \n \n \n \n );\n }}\n \n \n );\n};\n\nexport default AppointmentsUpsertForm;\n","import React from 'react';\nimport {\n CardBox,\n TypographyContainer,\n IconContainer,\n WeekDayContainer,\n TimerContainer,\n TitleContainer,\n} from './styles';\nimport { EventSubCategoryModel } from '@cuidador/database';\nimport Typography from '@material-ui/core/Typography';\nimport { ReactComponent as ClockIcon } from '../../assets/Icon-clock.svg';\nimport format from 'date-fns/format';\nimport {\n frequencyOptions,\n getSelectedWeekDays,\n getCustomInterval,\n FrequencyType,\n} from '../RoutinesUpsertForm/utils';\nimport ptBrLocale from 'date-fns/locale/pt-BR';\nimport { getLocalWeeklySchedule, weekdayMap } from '../../utils/date';\n\ninterface CardProps {\n id: Id;\n subCategory?: EventSubCategoryModel[];\n name?: string;\n description?: string;\n mon?: boolean;\n tue?: boolean;\n wed?: boolean;\n thu?: boolean;\n fri?: boolean;\n sat?: boolean;\n sun?: boolean;\n frequencyRule?: string;\n frequencyStartsAt?: string;\n frequencyEndsAt?: string | undefined | null;\n}\n\nconst RoutineCard: React.FC = ({\n id,\n subCategory,\n name,\n description,\n mon,\n tue,\n wed,\n thu,\n fri,\n sat,\n sun,\n frequencyRule,\n frequencyStartsAt,\n frequencyEndsAt\n \n}) => {\n const frequency = frequencyOptions.find(\n (frequency) => frequency.value === frequencyRule\n );\n\n const getWeekDay = () => {\n const frequencyCardTypes = ['1w', '2w'];\n if (frequency && typeof frequency.value === 'string' &&frequencyCardTypes.includes(frequency.value))\n return format(new Date(frequencyStartsAt || ''), 'EEE', {\n locale: ptBrLocale,\n });\n return '';\n };\n\n const getDaysText = () => {\n const areAllDaysSelected = mon && tue && wed && thu && fri && sat && sun;\n const areAllWeekDaysSelected = mon && tue && wed && thu && fri;\n const areSomeDaysSelected = !areAllDaysSelected || !areAllWeekDaysSelected;\n \n if (frequencyRule === '1d') {\n if (areAllDaysSelected) {\n return 'Todos os dias';\n } else if (areAllWeekDaysSelected) {\n return 'Segunda a Sexta';\n } else if (areSomeDaysSelected) {\n return `Apenas alguns dias (${getSelectedWeekdaysText()})`;\n }\n } else {\n const frequencyTimeString = frequencyRule?.replace(/.$/, '');\n return `A cada ${frequencyTimeString} dias`;\n }\n };\n\n const getSelectedWeekdaysText = () => {\n const utcSchedule = { mon, tue, wed, thu, fri, sat, sun };\n const date = new Date(frequencyStartsAt || '');\n const utcTime = `${date\n .getUTCHours()\n .toString()\n .padStart(2, '0')}:${date.getUTCMinutes().toString().padStart(2, '0')}`;\n const localSchedule = getLocalWeeklySchedule(utcSchedule, utcTime);\n \n const selectedWeekDays: string[] = [];\n if (localSchedule.mon) selectedWeekDays.push(weekdayMap.mon);\n if (localSchedule.tue) selectedWeekDays.push(weekdayMap.tue);\n if (localSchedule.wed) selectedWeekDays.push(weekdayMap.wed);\n if (localSchedule.thu) selectedWeekDays.push(weekdayMap.thu);\n if (localSchedule.fri) selectedWeekDays.push(weekdayMap.fri);\n if (localSchedule.sat) selectedWeekDays.push(weekdayMap.sat);\n if (localSchedule.sun) selectedWeekDays.push(weekdayMap.sun);\n \n return selectedWeekDays.reduce(\n (accumulatorString, weekday, index) =>\n `${accumulatorString}${index > 0 ? ', ' : ''}${weekday.toLowerCase()}`,\n ''\n );\n };\n \n const routineEnded = new Date(frequencyEndsAt || '') < new Date()\n\n const fixedEventTimeLocal = format(new Date(frequencyStartsAt!), 'HH:mm');\n\n return (\n \n \n \n \n {frequency && getWeekDay() && `${getWeekDay()} - `}\n {fixedEventTimeLocal}\n \n \n\n \n \n\n \n \n \n {subCategory && subCategory.length > 0 && subCategory[0].name}\n \n \n\n \n {name?.trim()}\n \n\n \n \n {getDaysText()}\n \n \n\n \n {description}\n \n\n \n {routineEnded ? 'Rotina finalizada' : 'Rotina em andamento'}\n \n \n \n );\n};\n\nexport default RoutineCard;\n","import styled from 'styled-components';\nimport {\n Backdrop as MaterialBackdrop,\n CircularProgress as MaterialCircularProgress,\n} from '@material-ui/core';\nimport { Link } from 'react-router-dom';\nimport Tab from '@material-ui/core/Tab';\nimport Fab from '../../components/Fab';\nimport Typography from '@material-ui/core/Typography';\n\nexport const Container = styled.div`\n display: flex;\n flex-direction: column;\n flex: 1;\n align-items: center;\n background-color: #fafafa;\n padding: ${({ theme }) => theme.spacing(2, 2)};\n`;\n\nexport const ButtonContainer = styled.div`\n display: flex;\n flex-direction: row;\n justify-content: center;\n align-items: center;\n width: 100%;\n border-bottom: 1px solid;\n border-color: ${({ theme }) => theme.palette.primary.main};\n padding: ${({ theme }) => theme.spacing(0, 0, 2, 0)};\n`;\n\nexport const StyledTabItem = styled(Tab)`\n width: 120px;\n color: ${({ theme }) => theme.palette.primary.main};\n font-size: 16px;\n font-weight: 400;\n border-radius: 5px 5px 0 0;\n`;\n\nexport const Backdrop = styled(MaterialBackdrop)`\n z-index: ${({ theme }) => theme.zIndex.drawer + 1};\n color: ${({ theme }) => theme.palette.primary.light};\n`;\n\nexport const BackdropCircularProgress = styled(MaterialCircularProgress).attrs({\n color: 'inherit',\n})``;\n\nexport const StyledLink = styled(Link)`\n text-decoration: none;\n width: 100%;\n display: flex;\n margin-top: ${({ theme }) => theme.spacing(2)}px;\n`;\n\nexport const StyledFab = styled(Fab)`\n bottom: ${({ theme }) => theme.spacing(8)}px;\n right: ${({ theme }) => theme.spacing(2)}px;\n margin-bottom: ${({ theme }) => theme.spacing(2)}px;\n`;\n\nexport const TypographyContainer = styled.div`\n width: 100%;\n text-align: center;\n color: ${({ theme }) => theme.palette.primary.main};\n`;\n\nexport const StyledTypography = styled(Typography)`\n color: ${({ theme }) => theme.palette.primary.dark};\n`;\n","import { EventScheduleModel } from '@cuidador/database';\nimport Typography from '@material-ui/core/Typography';\nimport AddIcon from '@material-ui/icons/AddRounded';\nimport React, { useContext, useEffect, useState } from 'react';\nimport { toast } from 'react-toastify';\nimport Fab from '../../components/Fab';\nimport PendingRegistrationBanner from '../../components/PendingRegistrationBanner';\nimport ReportDownloadButton from '../../components/ReportDownloadButton';\nimport RoutineCard from '../../components/RoutineCard';\nimport { AuthContext } from '../../contexts/auth';\nimport useCanAccess from '../../hooks/useCanAccess';\nimport useRoutine from '../../hooks/useRoutine';\nimport { convertTimeToDate, isTimeAfter } from '../../utils/date';\nimport { Item } from '../../utils/store';\nimport {\n Backdrop,\n BackdropCircularProgress,\n Container,\n StyledLink,\n StyledTypography,\n TypographyContainer,\n} from './styles';\nimport { PscButton } from '../../components/PscButton'\nimport { PageTitle } from '../../components/PageTitle'\nimport { Header } from '../../components/Header'\nimport { BackButton } from '../../components/BackButton'\n\nconst RoutineCardItem: React.FC<{\n routine: Item;\n}> = ({ routine }) => {\n return (\n \n \n \n );\n};\n\nconst Routines: React.FC = () => {\n const { userInfo } = useContext(AuthContext);\n const {\n getAllByPatientId,\n byId,\n ids: eventsIds,\n loading,\n createReportByPatientId,\n getReportDownloadLinkByPatientId,\n } = useRoutine();\n const [downloadLink, setDownloadLink] = useState('');\n\n const { isAllowedToCreate } = useCanAccess('care/event/schedule');\n\n const { isAllowedToCreate: isAllowedToCreateRoutineReport } = useCanAccess(\n 'report/routine'\n );\n const { isAllowedToRead: isAllowedToReadRoutineReport } = useCanAccess(\n 'media/patient/report/routine'\n );\n\n const patientId = userInfo?.activePatientId;\n\n useEffect(() => {\n if (!patientId) return;\n getAllByPatientId(patientId);\n }, [patientId]);\n\n const handleCreateReportAndGetDownloadLink = async () => {\n createRoutineReport()\n .then(() => getRoutineReportDownloadUrl())\n .then((signedUrl) => setDownloadLink(signedUrl));\n };\n\n const createRoutineReport = async () => {\n try {\n await createReportByPatientId(Number(userInfo?.activePatientId));\n toast.success('Relátorio de rotinas gerado com sucesso');\n } catch (err) {\n toast.error('Erro ao gerar relatório de rotinas');\n }\n };\n\n const getRoutineReportDownloadUrl = async (): Promise => {\n try {\n const { signedUrl } = await getReportDownloadLinkByPatientId(\n Number(userInfo?.activePatientId)\n );\n return signedUrl;\n } catch (err) {\n toast.error('Erro ao baixar relatório de rotinas');\n return '';\n }\n };\n\n const orderedRoutines = eventsIds\n .map(id => byId[id])\n .sort((a, b): number => {\n const eventAhappensAt = new Date(a.frequencyStartsAt || '')\n const eventBhappensAt = new Date(b.frequencyStartsAt || '')\n return isTimeAfter(eventAhappensAt, eventBhappensAt) ? 1 : -1\n })\n\n return (\n <>\n \n }\n centerContent={\n \n }\n rightContent={\n \n }\n />\n \n {loading ? (\n \n {loading && (\n \n )}\n \n ) : (\n \n {eventsIds.length <= 0 ? (\n \n Não há rotinas cadastradas.\n \n Agende aqui tudo que não pode ser esquecido sobre as rotinas da\n pessoa sob cuidado.\n \n \n ) : (\n <>\n \n Lista de rotinas\n {isAllowedToReadRoutineReport &&\n isAllowedToCreateRoutineReport && (\n \n )}\n \n {orderedRoutines.map((routine) => (\n \n ))}\n \n )}\n {isAllowedToCreate && (\n \n \n \n )}\n \n )}\n \n );\n};\n\nexport default Routines;\n","import styled from 'styled-components';\n\nexport const Container = styled.div`\n display: flex;\n flex: 1;\n background-color: ${({ theme }) => theme.palette.common.white};\n padding-top: ${({ theme }) => theme.spacing(2)}px;\n padding-bottom: ${({ theme }) => theme.spacing(2)}px;\n display: flex;\n flex-direction: column;\n color: ${({ theme }) => theme.palette.secondary.main};\n`;\n","import { EventScheduleModel } from '@cuidador/database';\nimport { APIError } from '@cuidador/lib';\nimport { AxiosError } from 'axios';\nimport React, { useContext } from 'react';\nimport { useHistory } from 'react-router-dom';\nimport { toast } from 'react-toastify';\nimport RoutinesUpsertForm, {\n FormValues,\n} from '../../../components/RoutinesUpsertForm';\nimport {\n formDataToRoutineModel,\n routineModelToFormValues,\n} from '../../../components/RoutinesUpsertForm/utils';\nimport { AuthContext } from '../../../contexts/auth';\nimport useRoutine from '../../../hooks/useRoutine';\nimport { resolveErrorMessage } from '../../../utils/error';\nimport { Backdrop, BackdropCircularProgress } from '../styles';\nimport { Container } from './styles';\nimport { PscButton } from '../../../components/PscButton'\nimport { Header } from '../../../components/Header'\nimport { BackButton } from '../../../components/BackButton'\nimport { PageTitle } from '../../../components/PageTitle'\n\nconst formInitialValue: EventScheduleModel = {\n name: '',\n description: '',\n subCategory: [],\n mon: false,\n tue: false,\n wed: false,\n thu: false,\n fri: false,\n sat: false,\n sun: false,\n frequencyStartsAt: '',\n frequencyRule: '',\n};\n\nconst RoutinesInsert: React.FC = () => {\n const { userInfo } = useContext(AuthContext);\n const patientId = userInfo?.activePatientId;\n\n const { post, loading: inserting } = useRoutine();\n const history = useHistory();\n\n const handleSubmit = (values: FormValues, continuosAdd?: boolean) => {\n const postData = formDataToRoutineModel(values, patientId!);\n return post(postData)\n .then(() => {\n if (!continuosAdd) history.replace('/agendar/rotina');\n toast.success('Rotina adicionada com sucesso!');\n })\n .catch((err: AxiosError) => {\n const displayMessage = resolveErrorMessage(err);\n toast.error(displayMessage);\n });\n };\n\n return (\n <>\n \n }\n centerContent={\n \n }\n rightContent={\n \n }\n />\n \n \n \n\n {/* Loading while inserting */}\n {inserting && (\n \n {inserting && (\n \n )}\n \n )}\n \n );\n};\n\nexport default RoutinesInsert;\n","import styled from 'styled-components';\n\nexport const Container = styled.div`\n display: flex;\n flex: 1;\n background-color: ${({ theme }) => theme.palette.common.white};\n padding-top: ${({ theme }) => theme.spacing(2)}px;\n padding-bottom: ${({ theme }) => theme.spacing(2)}px;\n display: flex;\n flex-direction: column;\n color: ${({ theme }) => theme.palette.secondary.main};\n`;\n","import { APIError } from '@cuidador/lib';\nimport { AxiosError } from 'axios';\nimport { FormikProps } from 'formik';\nimport React, { useContext, useEffect, useRef, useState } from 'react';\nimport { useHistory, useParams } from 'react-router-dom';\nimport { toast } from 'react-toastify';\nimport RoutinesUpsertForm, {\n FormValues,\n} from '../../../components/RoutinesUpsertForm';\nimport {\n formDataToRoutineModel,\n routineModelToFormValues,\n} from '../../../components/RoutinesUpsertForm/utils';\nimport { StyledFieldset } from '../../../components/StyledFieldset';\nimport StyledSimpleDialog from '../../../components/StyledSimpleDialog';\nimport { AuthContext } from '../../../contexts/auth';\nimport useCanAccess from '../../../hooks/useCanAccess';\nimport useRoutine from '../../../hooks/useRoutine';\nimport { resolveErrorMessage } from '../../../utils/error';\nimport { Backdrop, BackdropCircularProgress } from '../styles';\nimport { Container } from './styles';\nimport { RemoveButton } from '../../../components/RemoveButton'\nimport { Header } from '../../../components/Header'\nimport { BackButton } from '../../../components/BackButton'\nimport { PageTitle } from '../../../components/PageTitle'\n\nconst RoutinesUpdate: React.FC = () => {\n const [dialogStatus, setDialogStatus] = useState(false);\n const params = useParams<{ id: string }>();\n const routineId = parseInt(params.id);\n const history = useHistory();\n const { isAllowedToDelete, isAllowedToUpdate } = useCanAccess(\n 'care/event/schedule'\n );\n\n const { byId, getById, remove, patch, loading } = useRoutine();\n const formikRef = useRef | null>(null);\n\n const routineData = routineId != null ? byId[routineId] : null;\n\n useEffect(\n function fetchRoutine() {\n if (routineId) {\n getById(routineId);\n }\n },\n [routineId]\n );\n\n const { userInfo } = useContext(AuthContext);\n const patientId = userInfo?.activePatientId;\n\n const handleSubmit = (values: FormValues) => {\n const patchData = formDataToRoutineModel(values, patientId!);\n return patch(routineId!, patchData)\n .then(() => {\n history.goBack();\n })\n .catch((err: AxiosError) => {\n const displayMessage = resolveErrorMessage(err);\n toast.error(displayMessage);\n });\n };\n\n const handleDelete = (id: Id) => {\n setDialogStatus(false);\n remove(id)\n .then(() => {\n history.goBack();\n })\n .catch((err: AxiosError) => {\n const displayMessage = resolveErrorMessage(err);\n toast.error(displayMessage);\n });\n };\n\n return (\n <>\n {loading && (\n \n {loading && (\n \n )}\n \n )}\n \n }\n centerContent={\n \n }\n rightContent={\n isAllowedToDelete && ( setDialogStatus(true)} />)\n }\n />\n {routineData && (\n \n \n (formikRef.current = ref)}\n initialValues={routineModelToFormValues(routineData)}\n onSubmit={handleSubmit}\n disabled={!isAllowedToUpdate}\n />\n \n setDialogStatus(false)}\n handleYes={() => handleDelete(routineId!)}\n title=\"Excluir Rotina\"\n subTitle=\"Tem certeza que deseja excluir a Rotina?\"\n />\n \n )}\n \n );\n};\n\nexport default RoutinesUpdate;\n","import { Form as FormikForm } from 'formik';\nimport styled from 'styled-components';\n\nexport const Centralizer = styled.div`\n align-items: center;\n flex-direction: column;\n display: flex;\n flex: 1;\n justify-content: flex-end;\n padding: ${({ theme }) => theme.spacing(1)}px;\n\n svg {\n font-size: 4rem;\n }\n\n h6 + div {\n margin-top: ${({ theme }) => theme.spacing(2)}px;\n }\n`;\n\nexport const Form = styled(FormikForm)`\n display: flex;\n flex: 1;\n flex-direction: column;\n width: 100%;\n color: ${({ theme }) => theme.palette.secondary.main};\n`;\n\nexport const ButtonContainer = styled.div`\n display: flex;\n flex-direction: row;\n\n width: 100%;\n\n button {\n width: 100%;\n color: ${({ theme }) => theme.palette.common.white};\n }\n\n button + button {\n margin-left: ${({ theme }) => theme.spacing(2)}px;\n border-color: ${({ theme }) => theme.palette.common.white};\n }\n\n button:nth-child(1) {\n border-color: transparent;\n }\n`;\n","import { ShiftAnnullationModel, ShiftExecutionModel } from '@cuidador/database';\nimport { APIError } from '@cuidador/lib';\nimport { Typography } from '@material-ui/core';\nimport WarningIcon from '@material-ui/icons/Warning';\nimport { AxiosError } from 'axios';\nimport { Formik } from 'formik';\nimport { isEqual } from 'lodash';\nimport React, { useState } from 'react';\nimport { toast } from 'react-toastify';\nimport * as Yup from 'yup';\nimport { resolveErrorMessage } from '../../utils/error';\nimport { StyledFormikTextField } from '../FormCardContainer';\nimport StyledButton from '../StyledButton';\nimport StyledSimpleModal from '../StyledSimpleModal';\nimport { ButtonContainer, Centralizer, Form } from './styles';\n\ntype ModalProps = {\n onClose: () => void;\n opened: boolean;\n execution: ShiftExecutionModel;\n onSubmit: (\n executionId: number,\n data: Partial\n ) => Promise;\n};\n\nconst RestoreAnnulledShift: React.FC = ({\n onClose,\n opened,\n execution,\n onSubmit,\n}) => {\n const [isSubmitting, setIsSubmitting] = useState(false);\n const submit = async () => {\n setIsSubmitting(true);\n return onSubmit(Number(execution.id), {\n isAnnulled: false,\n description: '',\n })\n .then(() => {\n toast.success('Execução restaurada com sucesso.');\n onClose();\n })\n .catch((err: AxiosError) => {\n toast.error(resolveErrorMessage(err));\n })\n .finally(() => {\n setIsSubmitting(false);\n });\n };\n\n return (\n \n \n \n \n Tem certeza que deseja restaurar esta execução?\n \n \n \n Voltar\n \n \n Confirmar\n \n \n \n \n );\n};\n\nconst AnnullableShift: React.FC = ({\n onClose,\n opened,\n execution,\n onSubmit,\n}) => {\n interface FormValues {\n description?: string;\n }\n\n const formInitialValues: FormValues = {\n description: '',\n };\n\n const validationSchema = Yup.object().shape({\n description: Yup.string()\n .required('Por favor, insira uma justificativa.')\n .max(4000, 'A justificativa não pode ter mais de 4000 caracteres.'),\n });\n\n const submit = async (values: FormValues) => {\n return onSubmit(Number(execution.id), {\n ...values,\n isAnnulled: true,\n })\n .then(() => {\n toast.success('Execução anulada com sucesso.');\n onClose();\n })\n .catch(() => {\n toast.error('Erro ao anular a execução.');\n });\n };\n\n return (\n \n \n \n \n Tem certeza que deseja anular esta execução?\n \n \n Para confirmar, digite a justificativa e clique em Confirmar\n \n \n {({ isSubmitting, values }) => (\n
    \n \n \n \n Voltar\n \n \n Confirmar\n \n \n \n )}\n \n
    \n
    \n );\n};\n\nconst AnnullableShiftExecutionModal: React.FC = ({\n opened,\n onClose,\n execution,\n onSubmit,\n}) => {\n return execution?.isAnnulled ? (\n \n ) : (\n \n );\n};\n\nexport default AnnullableShiftExecutionModal;\n","import { format } from 'date-fns';\nimport { ShiftExecution } from '@cuidador/database';\n\nexport const handleFormatShiftExecutionTime = (execution?: ShiftExecution) => {\n if (!execution || !execution.startedAt) return '';\n\n const startedAt = new Date(execution.startedAt);\n\n const start = format(startedAt, 'HH:mm');\n\n if (!execution.endedAt) return start;\n\n const endedAt = new Date(execution.endedAt);\n\n const end = format(endedAt, 'HH:mm');\n\n return `${start} até ${end}`;\n};\n\nexport const isExecutionWithContestation = (\n timeContestations: ShiftExecution['timeContestations']\n) => {\n return timeContestations && timeContestations.length > 0;\n};\n","import React from 'react';\nimport { ShiftExecution } from '@cuidador/database';\nimport { handleFormatShiftExecutionTime } from '../utils';\n\ninterface ExecutionTimeProps {\n execution: ShiftExecution;\n}\n\nconst ExecutionTime: React.FC = ({ execution }) => {\n return {handleFormatShiftExecutionTime(execution)} ;\n};\n\nexport default ExecutionTime;\n","import styled from 'styled-components';\nimport { ExecutionTimelineSlot } from '..';\n\nexport const TimelineContainer = styled.div<{ hasTimestamps: boolean }>`\n padding: ${({ theme, hasTimestamps }) =>\n theme.spacing(0, hasTimestamps ? 5 : 2, 2)};\n`;\n\nexport const BoundaryTimestamps = styled.div`\n display: flex;\n justify-content: space-between;\n padding: ${({ theme }) => theme.spacing(0, 2, 1)};\n`;\n\nexport const Timestamp = styled.div`\n display: flex;\n flex-direction: column;\n align-items: center;\n font-size: 12px;\n\n p {\n margin: 0;\n }\n`;\n\nexport const ParentTimeline = styled.div`\n position: relative;\n background-color: ${({ theme }) => theme.palette.grey[300]};\n height: 30px;\n width: 100%;\n overflow: hidden;\n`;\n\nexport const ExecutionTimeSlotBlock = styled.div<{\n timeslot: ExecutionTimelineSlot;\n}>`\n position: absolute;\n height: 100%;\n min-width: 2px;\n background-color: ${({ theme }) => theme.palette.primary.main};\n top: 0;\n\n left: ${({ timeslot }) => timeslot.startsAtPercentage}%;\n width: ${({ timeslot }) => timeslot.durationPercentage}%;\n`;\n\nexport const LegendContainer = styled.div`\n margin: ${({ theme }) => theme.spacing(2, 0)};\n display: flex;\n flex-wrap: wrap;\n justify-content: space-between;\n row-gap: ${({ theme }) => theme.spacing(1.5)}px;\n column-gap: ${({ theme }) => theme.spacing(2)}px;\n`;\n\nexport const Legend = styled.div`\n display: flex;\n`;\n\nexport const LegendLabel = styled.span``;\n\nexport const LegendColor = styled.div<{ color: string }>`\n width: 40px;\n height: 20px;\n background-color: ${({ color }) => color};\n margin-right: ${({ theme }) => theme.spacing(1)}px;\n`;\n","import React from 'react';\nimport { ShiftModel } from '@cuidador/database';\nimport {\n BoundaryTimestamps,\n ExecutionTimeSlotBlock,\n Legend,\n LegendColor,\n LegendContainer,\n LegendLabel,\n ParentTimeline,\n TimelineContainer,\n Timestamp,\n} from './styles';\nimport { useTheme } from 'styled-components';\nimport {\n formatShortDateToAmericaSaoPauloTimezone,\n formatTimeToAmericaSaoPauloTimezone,\n} from '../../../utils/date';\nimport { ExecutionTimeline } from '..';\n\ninterface ShiftExecutionTimelineProps {\n timeline: ExecutionTimeline | undefined;\n shift: ShiftModel;\n}\n\nconst ShiftExecutionTimeline: React.FC = ({\n timeline,\n shift,\n}) => {\n const theme = useTheme();\n\n if (!shift || !timeline) return null;\n\n return (\n <>\n \n {!!shift.plannedToStartAt && !!shift.plannedToEndAt && (\n <>\n \n

    \n {formatShortDateToAmericaSaoPauloTimezone(\n shift.plannedToStartAt\n )}\n

    \n

    \n {formatTimeToAmericaSaoPauloTimezone(shift.plannedToStartAt)}\n

    \n
    \n \n

    \n {formatShortDateToAmericaSaoPauloTimezone(shift.plannedToEndAt)}\n

    \n

    {formatTimeToAmericaSaoPauloTimezone(shift.plannedToEndAt)}

    \n
    \n \n )}\n
    \n \n \n {timeline.map((timeslot, index) => (\n \n ))}\n \n \n \n \n Livre\n \n \n \n Ocupado\n \n \n \n \n );\n};\n\nexport default ShiftExecutionTimeline;\n","import styled from 'styled-components';\nimport { Typography } from '@material-ui/core';\n\nexport const Container = styled.div`\n margin-top: ${({ theme }) => theme.spacing(1)}px;\n`;\n\nexport const StyledExecutionCard = styled.div`\n display: flex;\n justify-content: space-between;\n align-items: center;\n padding: ${({ theme }) => theme.spacing(1, 2)};\n`;\n\nexport const StyledExecutionTitle = styled(Typography)`\n color: ${({ theme }) => theme.palette.secondary.main};\n font-weight: 700;\n display: flex;\n align-items: center;\n margin-bottom: ${({ theme }) => theme.spacing(0.5)}px;\n\n svg {\n margin-left: ${({ theme }) => theme.spacing(1)}px;\n }\n`;\n\nexport const StyledExecutionContainer = styled.p<{ strikethrough?: boolean }>`\n font-size: 1rem;\n font-family: 'Work sans';\n display: inline-block;\n text-overflow: ellipsis;\n word-wrap: break-word;\n overflow: hidden;\n white-space: nowrap;\n margin-block: 0;\n max-width: 80vw;\n ${({ strikethrough }) => !!strikethrough && 'text-decoration: line-through;'}\n`;\n\nexport const StyledHorizontalLine = styled.hr`\n background-color: ${({ theme }) => theme.palette.common.black};\n border-width: 1px;\n margin: 0 ${({ theme }) => theme.spacing(2)}px;\n`;\n","import React from 'react';\nimport { ShiftExecution } from '@cuidador/database';\nimport { AccessTime } from '@material-ui/icons';\nimport { isExecutionWithContestation } from '../utils';\nimport { StyledExecutionTitle } from '../styles';\n\ninterface ExecutionTitleProps {\n executionNumber: number;\n timeContestations: ShiftExecution['timeContestations'];\n}\n\nconst ExecutionTitle: React.FC = ({\n executionNumber,\n timeContestations,\n}) => {\n return (\n \n Execução {executionNumber}\n {!!isExecutionWithContestation(timeContestations) && }\n \n );\n};\n\nexport default ExecutionTitle;\n","import React from 'react';\n\ninterface ExecutionUserNameProps {\n executionUserName: string;\n}\n\nconst ExecutionUserName: React.FC = ({\n executionUserName,\n}) => {\n return <>| {executionUserName};\n};\n\nexport default ExecutionUserName;\n","import { ShiftAnnullationModel, ShiftExecutionModel } from '@cuidador/database';\nimport { addDays, endOfMonth, isBefore } from 'date-fns';\nimport { sortBy } from 'lodash';\nimport React, { useEffect, useState } from 'react';\nimport { useHistory } from 'react-router-dom';\nimport { useParams } from 'react-router-dom';\nimport AnnullableShiftExecutionModal from '../../components/AnnullableShiftExecutionModal';\nimport DropdownMenu from '../../components/DropdownMenu';\nimport LoadingBackdrop from '../../components/LoadingBackdrop';\nimport {\n isAnnullableShiftExecution,\n isAnnulledShiftExecution,\n} from '../../components/ShiftsHistory/utils';\nimport useCanAccess from '../../hooks/useCanAccess';\nimport useShift from '../../hooks/useShift';\nimport ExecutionTime from './ExecutionTime';\nimport ShiftExecutionTimeline from './ExecutionTimeline';\nimport ExecutionTitle from './ExecutionTitle';\nimport ExecutionUserName from './ExecutionUserName';\nimport {\n Container,\n StyledExecutionCard,\n StyledExecutionContainer,\n StyledHorizontalLine,\n} from './styles';\nimport { Header } from '../../components/Header'\nimport { BackButton } from '../../components/BackButton'\nimport { PageTitle } from '../../components/PageTitle'\nimport { PscButton } from '../../components/PscButton'\n\ninterface RouteParams {\n id: string;\n}\n\nexport interface ExecutionTimelineSlot {\n status: 'occupied' | 'in_another_shift';\n startsAtPercentage: number;\n durationPercentage: number;\n}\n\nexport type ExecutionTimeline = ExecutionTimelineSlot[];\n\nconst ShiftExecution: React.FC = () => {\n const {\n getById,\n loading,\n ids,\n byId,\n patchAnnulledShiftExecution,\n getTimeline,\n } = useShift();\n const [executionTimeline, setExecutionTimeline] = useState<\n ExecutionTimeline | undefined\n >(undefined);\n const { id } = useParams();\n const history = useHistory();\n\n useEffect(() => {\n getById(id);\n getTimeline(Number(id)).then((data) => {\n setExecutionTimeline(data);\n });\n }, [id]);\n\n const shiftExecutions = ids.map((id) => byId[id].executions).flat(1);\n\n useEffect(() => {\n getTimeline(Number(id)).then((data) => {\n setExecutionTimeline(data);\n });\n }, [byId]);\n\n const [\n isAnnullableShiftModalVisible,\n setIsAnnullableShiftModalVisible,\n ] = useState(false);\n\n const [\n annullableModalExecution,\n setAnullableModalExecution,\n ] = useState({});\n\n const openAnnulableModal = (execution: ShiftExecutionModel) => {\n setAnullableModalExecution(execution);\n setIsAnnullableShiftModalVisible(true);\n };\n\n const closeAnnulableModal = () => {\n setAnullableModalExecution({});\n setIsAnnullableShiftModalVisible(false);\n };\n\n const onSubmitAnnullShiftExecution = async (\n executionId: number,\n data: Partial\n ): Promise => {\n await patchAnnulledShiftExecution(executionId, data);\n await getById(id);\n };\n\n const handleRedirectToExecutionHistoryContestation = (\n shiftId: number,\n executionId: number\n ) => {\n history.push(\n `/correcao-de-horarios/historico/plantao/${shiftId}/execucao/${executionId}`\n );\n };\n\n const { isAllowedToUpdate: isAllowedToAnullShift } = useCanAccess(\n 'care/shift/annullation'\n );\n\n const buildMenuItems = (execution: ShiftExecutionModel) => {\n const menuItems = [\n {\n label: 'Corrigir horários',\n handleClickItem: () =>\n history.push(\n `/correcao-de-horarios/plantao/${execution.shiftId}/execucao/${execution.id}/novo`\n ),\n shouldRender:\n !execution.isAnnulled &&\n !!execution.createdAt &&\n isBefore(\n new Date(),\n addDays(endOfMonth(new Date(execution.createdAt)), 1)\n ),\n },\n {\n label: 'Anular',\n handleClickItem: () => openAnnulableModal(execution),\n shouldRender:\n isAllowedToAnullShift && isAnnullableShiftExecution(execution),\n },\n {\n label: 'Restaurar',\n handleClickItem: () => openAnnulableModal(execution),\n shouldRender:\n isAllowedToAnullShift && isAnnulledShiftExecution(execution),\n },\n {\n label: 'Histórico',\n handleClickItem: () =>\n handleRedirectToExecutionHistoryContestation(\n Number(id),\n Number(execution.id)\n ),\n shouldRender: true,\n },\n ];\n return menuItems.filter(({ shouldRender }) => shouldRender);\n };\n\n return (\n <>\n \n history.push('/acompanhar/historico/')} />\n }\n centerContent={\n \n }\n rightContent={}\n />\n \n \n {sortBy(shiftExecutions, (item) => item?.startedAt).map(\n (execution, index) => (\n <>\n {index !== 0 && }\n \n
    \n \n \n \n \n \n
    \n \n
    \n \n )\n )}\n \n
    \n \n );\n};\n\nexport default ShiftExecution;\n","import { Typography } from '@material-ui/core';\nimport styled from 'styled-components';\nimport StyledPaper from '../StyledPaper';\n\nexport const CardBox = styled(StyledPaper)`\n display: flex;\n justify-content: center;\n flex-direction: column;\n border-radius: ${({ theme }) => theme.spacing(1)}px;\n box-sizing: border-box;\n width: 100%;\n color: ${({ theme }) => theme.palette.extra.color.grey.dark};\n`;\n\nexport const StyledCardName = styled(Typography)`\n font-weight: bold;\n`;\n","import { Typography } from '@material-ui/core';\nimport React from 'react';\nimport { CardBox, StyledCardName } from './styles';\n\ntype AdditionalCoverageCardProps = {\n id?: number;\n name?: string;\n content?: string;\n};\n\nconst AdditionalCoverageCard: React.FC = ({\n id,\n name,\n content,\n}) => {\n return (\n \n {name}\n {content}\n \n );\n};\n\nexport default AdditionalCoverageCard;\n","import { ShiftModel } from '@cuidador/database';\nimport { useCallback, useReducer } from 'react';\nimport axios from '../config/axios';\nimport { createReducer, Item, ReducerData } from '../utils/store/index';\n\nconst baseEndpoint = '/care/shift';\nconst endpoint = `${baseEndpoint}/additional-coverage`;\n\nconst initialData: ReducerData = {\n byId: {} as Record>,\n ids: [] as Array,\n total: 0,\n loading: false,\n error: null,\n};\n\nconst useAdditionalCoverage = () => {\n const [state, dispatch] = useReducer(\n createReducer(),\n initialData\n );\n\n const post = useCallback(async (id: Id, data: Partial) => {\n try {\n dispatch({ type: 'LOADING' });\n const response = await axios.post(endpoint, data);\n dispatch({ type: 'CREATE', payload: response.data });\n } catch (err) {\n dispatch({ type: 'ERROR', payload: err });\n return Promise.reject(err);\n }\n }, []);\n\n const getAllAvailable = useCallback(async (patientId: number) => {\n try {\n dispatch({ type: 'LOADING' });\n const response = await axios.get[]>(\n `${endpoint}/by-patient/${patientId}`\n );\n dispatch({ type: 'GET_ALL', payload: response.data });\n return Promise.resolve(response);\n } catch (err) {\n if (err instanceof Error) {\n dispatch({ type: 'ERROR', payload: err });\n }\n return Promise.reject(err);\n }\n }, []);\n\n const remove = useCallback(async (id: Id) => {\n try {\n dispatch({ type: 'LOADING' });\n const response = await axios.delete(`${endpoint}/${id}`);\n dispatch({ type: 'REMOVE', payload: response.data });\n } catch (err) {\n dispatch({ type: 'ERROR', payload: err });\n return Promise.reject(err);\n }\n }, []);\n\n const getById = useCallback(async (id: Id) => {\n try {\n dispatch({ type: 'LOADING' });\n const response = await axios.get(`${baseEndpoint}/${id}`);\n dispatch({ type: 'GET_BY_ID', payload: response.data });\n return Promise.resolve(response.data as ShiftModel);\n } catch (err) {\n dispatch({ type: 'ERROR', payload: err });\n }\n }, []);\n\n return {\n ...state,\n post,\n getAllAvailable,\n remove,\n getById,\n };\n};\n\nexport default useAdditionalCoverage;\n","import { Link } from 'react-router-dom';\nimport styled from 'styled-components';\n\nexport const StyledLink = styled(Link)`\n text-decoration: none;\n width: 100%;\n display: flex;\n margin-top: ${({ theme }) => theme.spacing(2)}px;\n`;\n\nexport const Container = styled.div`\n display: flex;\n flex-direction: column;\n align-items: center;\n flex: 1;\n background-color: ${({ theme }) => theme.palette.common.white};\n padding: ${({ theme }) => theme.spacing(2, 2)};\n`;\n","import { format } from 'date-fns';\nimport ptBrLocale from 'date-fns/locale/pt-BR';\n\nexport function getAdditionalCoverageCardContent(\n plannedToStartAt?: string,\n plannedToEndAt?: string\n) {\n if (!plannedToStartAt || !plannedToEndAt) return;\n\n const start = new Date(plannedToStartAt);\n const end = new Date(plannedToEndAt);\n\n const weekday = format(start, 'EEE', { locale: ptBrLocale });\n const capitalizedWeekday = weekday.charAt(0).toUpperCase() + weekday.slice(1);\n const startTime = format(start, 'HH:mm', { locale: ptBrLocale });\n const endTime = format(end, 'HH:mm', { locale: ptBrLocale });\n\n return `${capitalizedWeekday} - ${startTime} às ${endTime}`;\n}\n","import { ShiftModel } from '@cuidador/database';\nimport React, { useContext, useEffect, useState } from 'react';\nimport { toast } from 'react-toastify';\nimport AdditionalCoverageCard from '../../../components/AdditionalCoverageCard';\nimport LoadingBackdrop from '../../../components/LoadingBackdrop';\nimport MedicBalloon from '../../../components/MedicBalloon';\nimport { AuthContext } from '../../../contexts/auth';\nimport useAdditionalCoverage from '../../../hooks/useAdditionalCoverage';\nimport { Container, StyledLink } from './styles';\nimport { getAdditionalCoverageCardContent } from './utils';\n\nconst AdditionalCoverage: React.FC = () => {\n const [additionalCoverages, setAdditionalCoverages] = useState(\n []\n );\n\n const { userInfo } = useContext(AuthContext);\n const patientId = userInfo?.activePatientId;\n\n const { getAllAvailable, loading } = useAdditionalCoverage();\n\n useEffect(() => {\n if (!patientId) return;\n\n getAllAvailable(patientId)\n .then(({ data }) => {\n setAdditionalCoverages([...data]);\n })\n .catch(() => {\n toast.error('Erro ao solicitar as coberturas adicionais.');\n });\n }, [patientId]);\n\n return (\n \n \n {loading ? (\n \n ) : (\n additionalCoverages.map((shift) => (\n \n \n \n ))\n )}\n \n );\n};\n\nexport default AdditionalCoverage;\n","import styled from 'styled-components';\nimport StyledPaper from '../StyledPaper';\n\nexport const CardBox = styled(StyledPaper)`\n width: 100%;\n display: flex;\n align-items: center;\n margin: 0;\n`;\n\nexport const TypographyContainer = styled.div`\n color: ${({ theme }) => theme.palette.secondary.main};\n display: flex;\n flex-direction: column;\n justify-content: space-around;\n`;\n","import { Form as FormikForm } from 'formik';\nimport { Link } from 'react-router-dom';\nimport styled from 'styled-components';\n\nexport const Container = styled.div`\n display: flex;\n flex: 1;\n background-color: ${({ theme }) => theme.palette.common.white};\n padding: ${({ theme }) => theme.spacing(2)}px;\n display: flex;\n flex-direction: column;\n color: ${({ theme }) => theme.palette.secondary.main};\n`;\n\nexport const ContentContainer = styled.div`\n margin-top: ${({ theme }) => theme.spacing(3)}px;\n width: 100%;\n display: flex;\n align-items: center;\n flex-direction: column;\n`;\n\nexport const Form = styled(FormikForm)`\n display: flex;\n flex: 1;\n flex-direction: column;\n`;\n\nexport const TypographyContainer = styled.div`\n max-width: 100%;\n text-align: center;\n`;\n\nexport const StyledLink = styled(Link)`\n text-decoration: none;\n`;\n\nexport const Centralizer = styled.div`\n align-items: center;\n flex-direction: column;\n display: flex;\n flex: 1;\n justify-content: flex-end;\n`;\n","import { ShiftScheduleModel } from '@cuidador/database';\nimport { getLocalWeeklySchedule, getUTCWeeklySchedule } from '../../utils/date';\nimport { FormValues } from './';\nimport { EVERYDAY, MONDAY_TO_FRIDAY } from './index';\n\nexport type WeekDays = Pick<\n ShiftScheduleModel,\n 'mon' | 'tue' | 'wed' | 'thu' | 'fri' | 'sat' | 'sun'\n>;\n\nexport enum FrequencyType {\n EveryDay = 'Todos os dias',\n MondayToFriday = 'Segunda a sexta',\n SomeDays = 'Alguns dias da semana'\n}\n\n/**\n * Format week days from FormValues according to the UTC and local date time.\n */\nexport const formatWeekDaysFromFormValues = (\n formValues: FormValues\n): WeekDays => {\n const weeklySchedule = {\n mon: false,\n tue: false,\n wed: false,\n thu: false,\n fri: false,\n sat: false,\n sun: false,\n };\n const time = formValues.startingTime;\n\n formValues.days.forEach((day) => {\n if (day === 'Dom') {\n weeklySchedule.sun = true;\n }\n if (day === 'Seg') {\n weeklySchedule.mon = true;\n }\n if (day === 'Ter') {\n weeklySchedule.tue = true;\n }\n if (day === 'Qua') {\n weeklySchedule.wed = true;\n }\n if (day === 'Qui') {\n weeklySchedule.thu = true;\n }\n if (day === 'Sex') {\n weeklySchedule.fri = true;\n }\n if (day === 'Sab') {\n weeklySchedule.sat = true;\n }\n });\n\n return getUTCWeeklySchedule(weeklySchedule, time);\n};\n\nexport const getCustomInterval = (days: string[]) => { \n const isEveryDay =\n days.length === 7 && days.every((day) => EVERYDAY.includes(day));\n const isMondayToFriday =\n days.length === 5 && days.every((day) => MONDAY_TO_FRIDAY.includes(day));\n const isSomeDays = !isEveryDay && !isMondayToFriday;\n if (isEveryDay) return FrequencyType.EveryDay;\n if (isMondayToFriday) return FrequencyType.MondayToFriday;\n if (isSomeDays) return FrequencyType.SomeDays;\n};\n\n\n/**\n * Format week days from ShiftScheduleModel according to the UTC and local date time.\n */\nexport const formatWeekDaysFromShiftSchedule = (\n shiftSchedule: Partial\n): FormValues['days'] => {\n const days: FormValues['days'] = [];\n const time = shiftSchedule.startingTime!;\n\n const localWeeklySchedule = getLocalWeeklySchedule(shiftSchedule, time);\n\n if (localWeeklySchedule.sun) {\n days.push('Dom');\n }\n if (localWeeklySchedule.mon) {\n days.push('Seg');\n }\n if (localWeeklySchedule.tue) {\n days.push('Ter');\n }\n if (localWeeklySchedule.wed) {\n days.push('Qua');\n }\n if (localWeeklySchedule.thu) {\n days.push('Qui');\n }\n if (localWeeklySchedule.fri) {\n days.push('Sex');\n }\n if (localWeeklySchedule.sat) {\n days.push('Sab');\n }\n\n return days;\n};\n","import {\n PtBrWeekdayEnum,\n ShiftScheduleModel,\n WeekdayEnum,\n} from '@cuidador/database';\nimport { format } from 'date-fns';\nimport { Formik, FormikHelpers, FormikProps } from 'formik';\nimport isEqual from 'lodash/isEqual';\nimport React, { useEffect } from 'react';\nimport * as Yup from 'yup';\nimport { convertLocalTimeToUTC, convertTimeToDate } from '../../utils/date';\nimport {\n FormCardContainer,\n HelperContainer,\n HelperText,\n NewStyledSelect as StyledSelect,\n StyledBoldTitle,\n StyledFormikTextField,\n} from '../FormCardContainer';\nimport FormikWeekDaySelect from '../Forms/FormikWeekDaySelect';\nimport MedicBalloon from '../MedicBalloon';\nimport StyledButton from '../StyledButton';\nimport StyledMenuItem from '../StyledMenuItem';\nimport { Centralizer, ContentContainer, Form } from './styles';\nimport {\n formatWeekDaysFromFormValues,\n formatWeekDaysFromShiftSchedule,\n FrequencyType,\n getCustomInterval,\n} from './utils';\nimport { Checkbox, Radio, RadioGroup } from '@material-ui/core';\nimport StyledFormControlLabel from '../StyledFormControlLabel';\n\nexport interface FormValues {\n name: string;\n startingTime: string;\n duration: string;\n days: PtBrWeekdayEnum[];\n customInterval?: FrequencyType; \n logoutUserOnFinishShift: boolean; \n}\n\nexport const EVERYDAY = ['Seg', 'Ter', 'Qua', 'Qui', 'Sex', 'Sab', 'Dom'];\nexport const MONDAY_TO_FRIDAY = ['Seg', 'Ter', 'Qua', 'Qui', 'Sex'];\n\nexport const durationOptions = Array.from({ length: 24 * 2 - 1 }, (_, k) => {\n const durationInMinutes = 60 + 30 * k;\n const hourValue = Math.ceil((k + 1) / 2);\n const minuteValue = k % 2 ? ' e 30 minutos' : '';\n\n return {\n durationInMinutes: durationInMinutes.toString(),\n label: `${hourValue} ${hourValue > 1 ? 'horas' : 'hora'}${minuteValue}`,\n };\n});\n\nexport const days: {\n id: WeekdayEnum;\n name: PtBrWeekdayEnum;\n}[] = [\n { id: 'mon', name: 'Seg' },\n { id: 'tue', name: 'Ter' },\n { id: 'wed', name: 'Qua' },\n { id: 'thu', name: 'Qui' },\n { id: 'fri', name: 'Sex' },\n { id: 'sat', name: 'Sab' },\n { id: 'sun', name: 'Dom' },\n];\n\nexport const formDataToShiftScheduleModel = (data: FormValues) => {\n // convert days to check UTC date and time\n const formattedWeekDays = formatWeekDaysFromFormValues(data);\n\n const duration = parseInt(data!.duration!);\n const shiftScheduleData = {\n name: data.name,\n // converts to UTC before send to backend\n startingTime: convertLocalTimeToUTC(data.startingTime),\n duration: duration,\n logoutUserOnFinishShift: data.logoutUserOnFinishShift,\n ...formattedWeekDays,\n };\n return shiftScheduleData;\n};\n\nexport const shiftScheduleModelToFormData = (data: ShiftScheduleModel) => {\n const days = formatWeekDaysFromShiftSchedule(data);\n\n // format UTC to local time for correct rendering\n const formattedTime = data?.startingTime\n ? format(convertTimeToDate(data.startingTime), 'HH:mm')\n : '';\n return {\n name: data.name || '',\n startingTime: formattedTime,\n duration: String(data.duration) || '',\n days, \n customInterval: getCustomInterval(days),\n logoutUserOnFinishShift: Boolean(data.logoutUserOnFinishShift) \n } as FormValues;\n};\n\nconst validationSchema = Yup.object().shape({\n name: Yup.string().required('Por favor, insira um nome'),\n startingTime: Yup.string().required('Por favor, insira o horário'),\n duration: Yup.string().required('Por favor, insira a duração'),\n days: Yup.array().min(1, 'Por favor, escolha pelo menos 1 dia'),\n});\n\nconst ShiftScheduleUpsertForm: React.FC<{\n initialValues: FormValues;\n innerRef?: React.Ref>;\n onSubmit: (\n values: FormValues,\n formikHelpers: FormikHelpers\n ) => void | Promise;\n isAllowedToUpdate?: boolean;\n}> = ({ initialValues, innerRef, onSubmit, isAllowedToUpdate = true }) => {\n return (\n \n {({ \n values, \n isSubmitting, \n setFieldValue \n }) => {\n const handleSelectedCustomIntervalChange = (\n e: React.ChangeEvent\n ) => {\n switch (e.target.value as FrequencyType) {\n case FrequencyType.EveryDay:\n setFieldValue('customInterval', FrequencyType.EveryDay);\n setFieldValue('days', EVERYDAY);\n break;\n case FrequencyType.MondayToFriday:\n setFieldValue('customInterval', FrequencyType.MondayToFriday);\n setFieldValue('days', MONDAY_TO_FRIDAY);\n break;\n case FrequencyType.SomeDays:\n setFieldValue('customInterval', FrequencyType.SomeDays);\n setFieldValue('days', []);\n break; \n default:\n setFieldValue('customInterval', FrequencyType.EveryDay);\n setFieldValue('days', EVERYDAY);\n break;\n }\n };\n\n const handleCheckBoxLogoutUserOnFinishShift = (\n e: React.ChangeEvent\n ) => {\n setFieldValue('logoutUserOnFinishShift',e.target.checked);\n }\n\n const handleSelectedDaysChange = () => { \n if (!values.days) return;\n const isEveryDay =\n values.days.length === 7 &&\n values.days.every((day) => EVERYDAY.includes(day));\n \n const isMondayToFriday =\n values.days.length === 5 &&\n values.days.every((day) => MONDAY_TO_FRIDAY.includes(day));\n\n const isSomeDays = !isEveryDay && !isMondayToFriday; \n if (isEveryDay) setFieldValue('customInterval', FrequencyType.EveryDay);\n if (isMondayToFriday)\n setFieldValue('customInterval', FrequencyType.MondayToFriday);\n if (isSomeDays) setFieldValue('customInterval', FrequencyType.SomeDays);\n };\n\n useEffect(() => {\n handleSelectedDaysChange();\n }, [values.days]);\n\n return (\n \n \n\n \n \n Nome do plantão\n\n \n \n Exemplo: Plantão Diurno, Plantão Noturno, etc\n \n \n }\n size=\"small\"\n />\n \n\n \n Horário de início e duração\n\n \n\n \n {durationOptions\n .slice()\n .reverse()\n .map((item, index) => (\n \n {item.label}\n \n ))}\n \n \n\n \n \n Dias\n \n \n {Object.values(FrequencyType).map((label, index) => (\n }\n label={label}\n disabled={!isAllowedToUpdate}\n />\n ))}\n \n \n \n\n \n \n Ação ao finalizar plantão\n \n \n }\n label=\"Ao finalizar o plantão, desconectar usuário automaticamente (ideal para equipes com uso de um dispositivo em comum)\"\n /> \n \n\n \n \n Salvar\n \n \n \n \n );\n }}\n \n );\n};\n\nexport default ShiftScheduleUpsertForm;\n","import React from 'react';\nimport { CardBox, TypographyContainer } from './styles';\nimport Typography from '@material-ui/core/Typography';\nimport format from 'date-fns/format';\nimport { ShiftScheduleModel } from '@cuidador/database';\nimport { convertTimeToDate } from '../../utils/date';\nimport { formatWeekDaysFromShiftSchedule } from '../ShiftScheduleUpsertForm/utils';\n\nconst ShiftScheduleCard: React.FC = ({\n name,\n id,\n startingTime,\n endingTime,\n mon,\n tue,\n wed,\n thu,\n fri,\n sat,\n sun,\n}) => {\n // Builds active weekdays array\n const weekDays = formatWeekDaysFromShiftSchedule({\n mon,\n tue,\n wed,\n thu,\n fri,\n sat,\n sun,\n startingTime,\n });\n\n const weekdaysLabel = weekDays.join(' - ');\n\n return (\n \n \n {name}\n {weekdaysLabel}\n \n {/* Format from UTC to local time for correct rendering */}\n {format(convertTimeToDate(String(startingTime)), 'HH:mm')} às{' '}\n {format(convertTimeToDate(String(endingTime)), 'HH:mm')}\n \n \n \n );\n};\n\nexport default ShiftScheduleCard;\n","import styled from 'styled-components';\nimport {\n Backdrop as MaterialBackdrop,\n CircularProgress as MaterialCircularProgress,\n} from '@material-ui/core';\nimport { Link } from 'react-router-dom';\nimport Tab from '@material-ui/core/Tab';\nimport Typography from '@material-ui/core/Typography';\n\nexport const Container = styled.div`\n display: flex;\n flex-direction: column;\n align-items: center;\n flex: 1;\n background-color: ${({ theme }) => theme.palette.common.white};\n padding: ${({ theme }) => theme.spacing(0, 2)};\n`;\n\nexport const ButtonContainer = styled.div`\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: center;\n width: 100%;\n border-bottom: 1px solid;\n border-color: ${({ theme }) => theme.palette.primary.main};\n padding: ${({ theme }) => theme.spacing(2, 0)};\n`;\n\nexport const StyledTabItem = styled(Tab)`\n max-width: 205px;\n color: ${({ theme }) => theme.palette.primary.main};\n font-size: ${({ theme }) => theme.typography.body1.fontSize};\n font-weight: 400;\n border-radius: 5px 5px 0 0;\n`;\n\nexport const Backdrop = styled(MaterialBackdrop)`\n z-index: ${({ theme }) => theme.zIndex.drawer + 1};\n color: ${({ theme }) => theme.palette.primary.light};\n position: absolute;\n`;\n\nexport const BackdropCircularProgress = styled(MaterialCircularProgress).attrs({\n color: 'inherit',\n})``;\n\nexport const StyledLink = styled(Link)`\n text-decoration: none;\n width: 100%;\n display: flex;\n margin-top: ${({ theme }) => theme.spacing(2)}px;\n`;\n\nexport const CardContainer = styled.div`\n width: 100%;\n display: flex;\n margin-top: ${({ theme }) => theme.spacing(2)}px;\n`;\n\nexport const TypographyContainer = styled.div`\n width: 100%;\n text-align: center;\n color: ${({ theme }) => theme.palette.primary.main};\n margin-top: ${({ theme }) => theme.spacing(2)}px;\n`;\n\nexport const StyledTypography = styled(Typography)`\n color: ${({ theme }) => theme.palette.primary.dark};\n`;\n","import { ShiftScheduleModel } from '@cuidador/database';\nimport React, { useContext, useEffect } from 'react';\nimport ShiftScheduleCard from '../../../components/ShiftScheduleCard';\nimport { AuthContext } from '../../../contexts/auth';\nimport useShiftSchedule from '../../../hooks/useShiftSchedule';\nimport { Item } from '../../../utils/store';\nimport {\n Backdrop,\n BackdropCircularProgress,\n StyledLink,\n StyledTypography,\n TypographyContainer,\n} from '../styles';\n\nconst ShiftScheduleCardItem: React.FC<{\n shiftSchedule: Item;\n}> = ({ shiftSchedule }) => {\n return (\n \n \n \n );\n};\n\nconst NextShiftSchedule: React.FC = () => {\n const { userInfo } = useContext(AuthContext);\n const {\n getAllByPatientId,\n byId,\n ids: shiftSchedulesIds,\n loading,\n } = useShiftSchedule();\n\n const patientId = userInfo?.activePatientId;\n\n useEffect(() => {\n if (!patientId) return;\n getAllByPatientId(patientId);\n }, [patientId]);\n\n if (loading) {\n return (\n \n {loading && (\n \n )}\n \n );\n }\n\n return (\n <>\n {shiftSchedulesIds.length <= 0 ? (\n \n \n Planeje uma única vez e cadastre aqui os plantões do(a) cuidador(a)\n ou da equipe de cuidadores, clicando no "+" abaixo.\n \n \n ) : (\n shiftSchedulesIds\n .map((id) => byId[id])\n .map((shiftSchedule) => (\n \n ))\n )}\n \n );\n};\n\nexport default NextShiftSchedule;\n","export interface TabOptions {\n key: 'proximos' | 'cobertura-adicional';\n label: 'Plantões' | 'Hora-extra / Cobertura';\n permission: 'isAllowedToReadShift' | 'isAllowedToReadAdditionalShift';\n}\n\nexport const tabOptions: TabOptions[] = [\n { key: 'proximos', label: 'Plantões', permission: 'isAllowedToReadShift' },\n {\n key: 'cobertura-adicional',\n label: 'Hora-extra / Cobertura',\n permission: 'isAllowedToReadAdditionalShift',\n },\n];\n\nexport type RouteParams = {\n tab?: 'cobertura-adicional' | 'proximos';\n};\n","import AddIcon from '@material-ui/icons/AddRounded';\nimport React, { useCallback } from 'react';\nimport { Redirect, useHistory, useParams } from 'react-router';\nimport Fab from '../../components/Fab';\nimport PendingRegistrationBanner from '../../components/PendingRegistrationBanner';\nimport StyledTabs from '../../components/StyledTabs';\nimport useCanAccess from '../../hooks/useCanAccess';\nimport AdditionalCoverage from './AdditionalCoverage';\nimport NextShiftSchedule from './NextShiftSchedules';\nimport { ButtonContainer, Container, StyledTabItem } from './styles';\nimport { RouteParams, TabOptions, tabOptions } from './utils';\nimport { Header } from '../../components/Header'\nimport { PscButton } from '../../components/PscButton'\nimport { BackButton } from '../../components/BackButton'\nimport { PageTitle } from '../../components/PageTitle'\n\nconst ShiftSchedule: React.FC = () => {\n const history = useHistory();\n const { tab } = useParams();\n\n const {\n isAllowedToRead: isAllowedToReadShift,\n isAllowedToCreate: isAllowedToCreateShift,\n } = useCanAccess('care/shiftschedule');\n const {\n isAllowedToRead: isAllowedToReadAdditionalShift,\n isAllowedToCreate: isAllowedToCreateAdditionalShift,\n } = useCanAccess('care/shift.additional-coverage');\n\n const permissions: Record = {\n isAllowedToReadShift,\n isAllowedToReadAdditionalShift,\n };\n\n const isCreateButtonVisible =\n (tab === 'proximos' && isAllowedToCreateShift) ||\n (tab === 'cobertura-adicional' && isAllowedToCreateAdditionalShift);\n\n const handleChange = useCallback((_, value) => {\n history.replace(`/plantoes/${value}`);\n }, []);\n\n if (!tab || !tabOptions.some((item) => item.key === tab)) {\n return (\n \n );\n }\n\n return (\n <>\n \n }\n centerContent={\n \n }\n rightContent={\n \n }\n />\n \n \n \n \n {tabOptions.map(\n (option) =>\n permissions[option.permission] && (\n \n )\n )}\n \n \n {tab == 'proximos' && }\n {tab == 'cobertura-adicional' && }\n \n\n {isCreateButtonVisible && (\n \n \n \n )}\n \n );\n};\n\nexport default ShiftSchedule;\n","import { Form as FormikForm } from 'formik';\nimport styled from 'styled-components';\n\nexport const Form = styled(FormikForm)`\n display: flex;\n flex: 1;\n flex-direction: column;\n`;\n\nexport const ContentContainer = styled.div`\n margin-top: ${({ theme }) => theme.spacing(3)}px;\n width: 100%;\n display: flex;\n align-items: center;\n flex-direction: column;\n`;\n\nexport const Container = styled.div`\n display: flex;\n flex: 1;\n background-color: ${({ theme }) => theme.palette.common.white};\n padding: ${({ theme }) => theme.spacing(2)}px;\n flex-direction: column;\n color: ${({ theme }) => theme.palette.secondary.main};\n`;\n","import { ShiftModel } from '@cuidador/database';\nimport { addMinutes, format, subDays } from 'date-fns';\nimport differenceInMinutes from 'date-fns/differenceInMinutes';\nimport * as Yup from 'yup';\nimport { FormValues } from '.';\n\nexport const durationOptions = Array.from({ length: 24 * 2 - 1 }, (_, k) => {\n const durationInMinutes = 60 + 30 * k;\n const hourValue = Math.ceil((k + 1) / 2);\n const minuteValue = k % 2 ? ' e 30 minutos' : '';\n\n return {\n durationInMinutes: durationInMinutes.toString(),\n label: `${hourValue} ${hourValue > 1 ? 'horas' : 'hora'}${minuteValue}`,\n };\n});\n\nexport const validationSchema = Yup.object().shape({\n name: Yup.string().required('Por favor, insira um nome'),\n date: Yup.string().required('Por favor, insira a data'),\n time: Yup.string().required('Por favor, insira o horário'),\n duration: Yup.string().required('Por favor, insira a duração'),\n});\n\nexport const initialDate = format(subDays(new Date(), 1), 'yyyy-MM-dd');\nexport const initialTime = format(new Date(), 'HH:mm');\n\nexport const formDataToAdditionalCoverageModel = (\n data: FormValues,\n patientId: number\n) => {\n const dateTimePlannedToStart = new Date(data?.date?.replace(/-/g, '/') || '');\n dateTimePlannedToStart.setHours(Number(data.time?.split(':')[0]) || 0);\n dateTimePlannedToStart.setMinutes(Number(data.time?.split(':')[1]) || 0);\n\n const dateTimePlannedToEnd = addMinutes(\n dateTimePlannedToStart,\n Number(data.duration)\n );\n\n return {\n name: data.name,\n plannedToStartAt: dateTimePlannedToStart.toISOString(),\n plannedToEndAt: dateTimePlannedToEnd.toISOString(),\n patientId,\n };\n};\n\nexport const additionalCoverageDataToFormData = (\n data: ShiftModel\n): FormValues => {\n const plannedToStartAt = new Date(data.plannedToStartAt || '');\n const plannedToEndAt = new Date(data.plannedToEndAt || '');\n return {\n name: data.name || '',\n date: format(new Date(data.plannedToStartAt || ''), 'yyyy-MM-dd'),\n duration: differenceInMinutes(plannedToEndAt, plannedToStartAt).toString(),\n time: format(new Date(data.plannedToStartAt || ''), 'HH:mm'),\n };\n};\n","import { addMinutes, isBefore } from 'date-fns';\nimport { Formik, FormikHelpers, FormikProps } from 'formik';\nimport { isEqual } from 'lodash';\nimport React from 'react';\nimport { toast } from 'react-toastify';\nimport {\n FormCardContainer,\n HelperContainer,\n HelperText,\n NewStyledSelect as StyledSelect,\n StyledBoldTitle,\n StyledFormikTextField,\n} from '../FormCardContainer';\nimport MedicBalloon from '../MedicBalloon';\nimport { Centralizer } from '../ShiftScheduleUpsertForm/styles';\nimport StyledButton from '../StyledButton';\nimport StyledMenuItem from '../StyledMenuItem';\nimport { ContentContainer, Form } from './styles';\nimport {\n durationOptions,\n initialDate,\n initialTime,\n validationSchema,\n} from './utils';\n\nexport interface FormValues {\n name?: string;\n date?: string;\n time?: string;\n duration?: string;\n}\n\nconst AdditionalCoverageForm: React.FC<{\n isDisabled?: boolean;\n initialValues: FormValues;\n innerRef?: React.Ref>;\n onSubmit: (\n values: FormValues,\n formikHelpers: FormikHelpers\n ) => void | Promise;\n}> = ({ initialValues, innerRef, onSubmit, isDisabled }) => {\n const validateAndSubmit = async (\n values: FormValues,\n formikHelpers: FormikHelpers\n ) => {\n const date = new Date(values.date?.replace(/-/g, '/') || '');\n date.setHours(Number(values.time?.split(':')[0]) || 0);\n date.setMinutes(Number(values.time?.split(':')[1]) || 0);\n const datePlusDuration = addMinutes(date, Number(values.duration));\n const isInThePast = isBefore(datePlusDuration, new Date());\n\n if (isInThePast) {\n toast.dismiss();\n toast.error('O plantão deve terminar em um horário futuro.');\n formikHelpers.setSubmitting(false);\n } else {\n return await onSubmit(values, formikHelpers);\n }\n };\n\n return (\n \n {({ values, isSubmitting, errors, touched }) => {\n return (\n \n \n\n \n \n \n Nome da hora-extra / cobertura\n \n\n \n \n Exemplo: Hora-extra sexta-feira, etc\n \n {touched.name && errors.name}\n \n }\n size=\"small\"\n />\n \n\n \n Data e horário de início\n\n \n\n \n \n\n \n Duração\n \n {durationOptions.slice().map((item, index) => (\n \n {item.label}\n \n ))}\n \n \n\n \n \n Salvar\n \n \n \n \n );\n }}\n \n );\n};\n\nexport default AdditionalCoverageForm;\n","import styled from 'styled-components';\n\nexport const Container = styled.div`\n display: flex;\n flex: 1;\n background-color: ${({ theme }) => theme.palette.common.white};\n padding-top: ${({ theme }) => theme.spacing(2)}px;\n padding-bottom: ${({ theme }) => theme.spacing(2)}px;\n flex-direction: column;\n color: ${({ theme }) => theme.palette.secondary.main};\n`;\n","import { APIError } from '@cuidador/lib';\nimport { AxiosError } from 'axios';\nimport React, { useContext } from 'react';\nimport { useHistory } from 'react-router-dom';\nimport { toast } from 'react-toastify';\nimport AdditionalCoverageForm, {\n FormValues,\n} from '../../../../components/AdditionalCoverageForm';\nimport { formDataToAdditionalCoverageModel } from '../../../../components/AdditionalCoverageForm/utils';\nimport { AuthContext } from '../../../../contexts/auth';\nimport useAdditionalCoverage from '../../../../hooks/useAdditionalCoverage';\nimport { resolveErrorMessage } from '../../../../utils/error';\nimport { Container } from './styles';\nimport { Header } from '../../../../components/Header'\nimport { BackButton } from '../../../../components/BackButton'\nimport { PageTitle } from '../../../../components/PageTitle'\n\nconst formInitialValues = {\n name: '',\n date: '',\n time: '',\n duration: '',\n};\n\nconst AdditionalCoverageInsert: React.FC = () => {\n const { post } = useAdditionalCoverage();\n const { userInfo } = useContext(AuthContext);\n const patientId = userInfo?.activePatientId;\n\n const history = useHistory();\n\n const handleSubmit = (values: FormValues) => {\n if (!patientId) return;\n return post(patientId, formDataToAdditionalCoverageModel(values, patientId))\n .then(() => {\n toast.success('A hora-extra / cobertura foi adicionada com sucesso!');\n history.replace('/plantoes/cobertura-adicional');\n })\n .catch((err: AxiosError) => {\n const displayMessage = resolveErrorMessage(err);\n toast.error(displayMessage);\n });\n };\n\n return (\n <>\n \n }\n centerContent={\n \n }\n />\n \n \n \n \n );\n};\n\nexport default AdditionalCoverageInsert;\n","import styled from 'styled-components';\n\nexport const Container = styled.div`\n display: flex;\n flex: 1;\n background-color: ${({ theme }) => theme.palette.common.white};\n padding-top: ${({ theme }) => theme.spacing(2)}px;\n padding-bottom: ${({ theme }) => theme.spacing(2)}px;\n flex-direction: column;\n color: ${({ theme }) => theme.palette.secondary.main};\n`;\n","import { APIError } from '@cuidador/lib';\nimport { AxiosError } from 'axios';\nimport { FormikProps } from 'formik';\nimport React, { useEffect, useRef, useState } from 'react';\nimport { useHistory, useParams } from 'react-router-dom';\nimport { toast } from 'react-toastify';\nimport AdditionalCoverageForm, {\n FormValues,\n} from '../../../../components/AdditionalCoverageForm';\nimport { additionalCoverageDataToFormData } from '../../../../components/AdditionalCoverageForm/utils';\nimport LoadingBackdrop from '../../../../components/LoadingBackdrop';\nimport { StyledFieldset } from '../../../../components/StyledFieldset';\nimport StyledSimpleDialog from '../../../../components/StyledSimpleDialog';\nimport useAdditionalCoverage from '../../../../hooks/useAdditionalCoverage';\nimport useCanAccess from '../../../../hooks/useCanAccess';\nimport { resolveErrorMessage } from '../../../../utils/error';\nimport { Container } from './styles';\nimport { Header } from '../../../../components/Header'\nimport { RemoveButton } from '../../../../components/RemoveButton'\nimport { BackButton } from '../../../../components/BackButton'\nimport { PageTitle } from '../../../../components/PageTitle'\n\nconst AdditionalCoverageUpdate: React.FC = () => {\n const initialValues = {\n name: '',\n date: '',\n time: '',\n duration: '',\n };\n\n const [dialogStatus, setDialogStatus] = useState(false);\n const { remove, getById, loading } = useAdditionalCoverage();\n\n const { isAllowedToUpdate, isAllowedToDelete } = useCanAccess(\n 'care/shift.additional-coverage'\n );\n const formikRef = useRef | null>(null);\n\n const history = useHistory();\n const params = useParams<{ id: string }>();\n const id = parseInt(params.id);\n\n useEffect(() => {\n if (id) {\n getById(id)\n .then((data) => {\n if (data)\n formikRef.current?.setValues(\n additionalCoverageDataToFormData(data)\n );\n })\n .catch((err: AxiosError) => {\n history.replace('/plantoes/cobertura-adicional');\n const displayMessage = resolveErrorMessage(err);\n toast.error(displayMessage);\n });\n }\n }, [id]);\n\n const handleDelete = (id: Id) => {\n setDialogStatus(false);\n remove(id)\n .then(() => {\n history.replace('/plantoes/cobertura-adicional');\n toast.success('Hora-extra / cobertura removida');\n })\n .catch((err: AxiosError) => {\n const displayMessage = resolveErrorMessage(err);\n toast.error(displayMessage);\n });\n };\n\n return (\n <>\n \n }\n centerContent={\n \n }\n rightContent={\n isAllowedToDelete && ( setDialogStatus(true)} />)\n }\n />\n {loading ? (\n \n ) : (\n \n \n (formikRef.current = ref)}\n initialValues={initialValues}\n onSubmit={() => {\n return;\n }}\n isDisabled\n />\n \n setDialogStatus(false)}\n handleYes={() => handleDelete(id!)}\n title=\"Excluir hora-extra / cobertura?\"\n subTitle=\"Tem certeza que deseja excluir a hora-extra / cobertura?\"\n />\n \n )}\n \n );\n};\n\nexport default AdditionalCoverageUpdate;\n","import styled from 'styled-components';\n\nexport const Container = styled.div`\n display: flex;\n flex: 1;\n background-color: ${({ theme }) => theme.palette.common.white};\n padding-top: ${({ theme }) => theme.spacing(2)}px;\n padding-bottom: ${({ theme }) => theme.spacing(2)}px;\n display: flex;\n flex-direction: column;\n color: ${({ theme }) => theme.palette.secondary.main};\n`;\n","import { APIError } from '@cuidador/lib';\nimport { AxiosError } from 'axios';\nimport React, { useContext } from 'react';\nimport { useHistory } from 'react-router-dom';\nimport { toast } from 'react-toastify';\nimport ShiftScheduleUpsertForm, {\n EVERYDAY,\n formDataToShiftScheduleModel,\n FormValues,\n} from '../../../../components/ShiftScheduleUpsertForm';\nimport { AuthContext } from '../../../../contexts/auth';\nimport useShiftSchedule from '../../../../hooks/useShiftSchedule';\nimport { resolveErrorMessage } from '../../../../utils/error';\nimport { Container } from './styles';\nimport { Header } from '../../../../components/Header'\nimport { PageTitle } from '../../../../components/PageTitle'\nimport { BackButton } from '../../../../components/BackButton'\nimport { PscButton } from '../../../../components/PscButton'\n\nconst formInitialValue = {\n name: '',\n startingTime: '',\n duration: '',\n days: EVERYDAY\n};\n\nconst ShiftScheduleInsert: React.FC = () => {\n const { userInfo } = useContext(AuthContext);\n const { post } = useShiftSchedule();\n\n const patientId = userInfo?.activePatientId;\n\n const history = useHistory();\n const handleSubmit = (values: FormValues) => {\n if (!patientId) return;\n return post(patientId, formDataToShiftScheduleModel(values))\n .then(() => {\n history.replace('/plantoes/proximos');\n })\n .catch((err: AxiosError) => {\n const displayMessage = resolveErrorMessage(err);\n toast.error(displayMessage);\n });\n };\n\n return (\n <>\n history.push('/cadastros')} />\n }\n centerContent={\n \n }\n rightContent={}\n />\n \n \n \n \n );\n};\n\nexport default ShiftScheduleInsert;\n","import {\n Backdrop as MaterialBackdrop,\n CircularProgress as MaterialCircularProgress,\n} from '@material-ui/core';\nimport { Form as FormikForm } from 'formik';\nimport { Link } from 'react-router-dom';\nimport styled from 'styled-components';\n\nexport const Container = styled.div`\n display: flex;\n flex: 1;\n background-color: ${({ theme }) => theme.palette.common.white};\n padding-top: ${({ theme }) => theme.spacing(2)}px;\n padding-bottom: ${({ theme }) => theme.spacing(2)}px;\n display: flex;\n flex-direction: column;\n color: ${({ theme }) => theme.palette.secondary.main};\n`;\n\nexport const Form = styled(FormikForm)`\n display: flex;\n flex: 1;\n flex-direction: column;\n`;\n\nexport const TypographyContainer = styled.div`\n max-width: 100%;\n text-align: center;\n`;\n\nexport const StyledLink = styled(Link)`\n text-decoration: none;\n`;\n\nexport const Centralizer = styled.div`\n align-items: center;\n flex-direction: column;\n display: flex;\n flex: 1;\n justify-content: flex-end;\n`;\n\nexport const Backdrop = styled(MaterialBackdrop)`\n z-index: ${({ theme }) => theme.zIndex.drawer + 1};\n color: ${({ theme }) => theme.palette.primary.light};\n position: absolute;\n`;\n\nexport const BackdropCircularProgress = styled(MaterialCircularProgress).attrs({\n color: 'inherit',\n})``;\n","import { APIError } from '@cuidador/lib';\nimport { AxiosError } from 'axios';\nimport { FormikProps } from 'formik';\nimport React, { useEffect, useRef, useState } from 'react';\nimport { useHistory, useParams } from 'react-router-dom';\nimport { toast } from 'react-toastify';\nimport StyledSimpleDialog from '../../../../components/StyledSimpleDialog';\nimport useShiftSchedule from '../../../../hooks/useShiftSchedule';\nimport { resolveErrorMessage } from '../../../../utils/error';\nimport { Backdrop, BackdropCircularProgress, Container } from './styles';\n\nimport { PtBrWeekdayEnum } from '@cuidador/database';\nimport ShiftScheduleUpsertForm, {\n formDataToShiftScheduleModel,\n FormValues,\n shiftScheduleModelToFormData,\n} from '../../../../components/ShiftScheduleUpsertForm';\nimport { StyledFieldset } from '../../../../components/StyledFieldset';\nimport useCanAccess from '../../../../hooks/useCanAccess';\nimport { RemoveButton } from '../../../../components/RemoveButton'\nimport { Header } from '../../../../components/Header'\nimport { BackButton } from '../../../../components/BackButton'\nimport { PageTitle } from '../../../../components/PageTitle'\n\nconst formInitialValue = {\n name: '',\n startingTime: '',\n duration: '',\n days: [] as PtBrWeekdayEnum[],\n};\n\nconst ShiftScheduleUpdate: React.FC = () => {\n const params = useParams<{ id: string }>();\n const { patch, remove, getById, byId, loading } = useShiftSchedule();\n const [dialogStatus, setDialogStatus] = useState(false);\n const formikRef = useRef | null>(null);\n const history = useHistory();\n\n const { isAllowedToUpdate, isAllowedToDelete } = useCanAccess(\n 'care/shiftschedule'\n );\n\n const id = parseInt(params.id);\n const shiftSchedule = id != null ? byId[id] : null;\n\n useEffect(\n function fetchInitialValues() {\n // If 'id' exists, it's an Update form.\n // Else, it's a creation\n if (id) {\n getById(id);\n }\n },\n [id]\n );\n\n useEffect(\n function setInitialValues() {\n if (shiftSchedule) {\n formikRef.current?.setValues(\n shiftScheduleModelToFormData(shiftSchedule)\n );\n }\n },\n [shiftSchedule]\n );\n\n const handleSubmit = (values: FormValues) => {\n return patch(id!, formDataToShiftScheduleModel(values))\n .then(() => {\n history.goBack();\n })\n .catch((err: AxiosError) => {\n formikRef.current?.setValues(values);\n const displayMessage = resolveErrorMessage(err);\n toast.error(displayMessage);\n });\n };\n\n const handleDelete = (id: Id) => {\n setDialogStatus(false);\n remove(id)\n .then(() => {\n history.goBack();\n })\n .catch((err: AxiosError) => {\n const displayMessage = resolveErrorMessage(err);\n toast.error(displayMessage);\n });\n };\n\n if (loading) {\n return (\n \n {loading && (\n \n )}\n \n );\n }\n\n return (\n <>\n \n }\n centerContent={\n \n }\n rightContent={\n setDialogStatus(true)} />\n }\n />\n \n \n (formikRef.current = ref)}\n initialValues={formInitialValue}\n onSubmit={handleSubmit}\n isAllowedToUpdate={isAllowedToUpdate}\n />\n \n setDialogStatus(false)}\n handleYes={() => handleDelete(id!)}\n title=\"Excluir Plantão?\"\n subTitle=\"Tem certeza que deseja excluir o plantão?\"\n />\n \n \n );\n};\n\nexport default ShiftScheduleUpdate;\n","import { Form as FormikForm } from 'formik';\nimport styled from 'styled-components';\n\nexport const Form = styled(FormikForm)`\n display: flex;\n flex-direction: column;\n width: 100%;\n color: ${({ theme }) => theme.palette.secondary.main};\n`;\n\nexport const Centralizer = styled.div`\n margin-left: auto;\n margin-right: auto;\n`;\n","import React from 'react';\nimport { Centralizer, Form } from './styles';\n\nimport { Formik, FormikHelpers, FormikProps } from 'formik';\nimport { FormValues } from './utils';\n\nimport useCanAccess from '../../hooks/useCanAccess';\nimport FormikTextField from '../Forms/FormikTextField';\nimport StyledButton from '../StyledButton';\n\nconst ShoppingListUpsertForm: React.FC<{\n initialValues: FormValues;\n innerRef?: React.Ref>;\n onSubmit: (\n values: FormValues,\n formikHelpers: FormikHelpers\n ) => void | Promise;\n}> = ({ initialValues, innerRef, onSubmit }) => {\n const { isAllowedToInvoke: isAllowedToBuy } = useCanAccess(\n 'care/shopping-list.buy'\n );\n\n return (\n \n {() => {\n return (\n \n \n {isAllowedToBuy && (\n \n \n Comprado\n \n \n )}\n \n );\n }}\n \n );\n};\n\nexport default ShoppingListUpsertForm;\n","import { useCallback, useReducer } from 'react';\nimport axios from '../config/axios';\nimport { ShoppingListModel } from '@cuidador/database';\nimport { createReducer, ReducerData, Item } from '../utils/store/index';\nimport { AxiosResponse } from 'axios';\n\nconst endpoint = '/care/shopping-list';\n\nconst initialData: ReducerData = {\n byId: {} as Record>,\n ids: [] as Array,\n total: 0,\n loading: false,\n error: null,\n};\n\nconst useShoppingList = () => {\n const [state, dispatch] = useReducer(\n createReducer(),\n initialData\n );\n\n const getOneByPatientId = useCallback(async (id: Id) => {\n try {\n dispatch({ type: 'LOADING' });\n const response = await axios.get(`${endpoint}/by-patient/${id}`);\n dispatch({ type: 'GET_BY_ID', payload: response.data });\n return Promise.resolve(response as AxiosResponse);\n } catch (err) {\n dispatch({ type: 'ERROR', payload: err });\n }\n }, []);\n\n const postBuyShoppingListById = useCallback(async (id: Id) => {\n try {\n dispatch({ type: 'LOADING' });\n const response = await axios.post(`${endpoint}/${id}/buy`);\n dispatch({ type: 'CREATE', payload: response.data });\n } catch (err) {\n dispatch({ type: 'ERROR', payload: err });\n return Promise.reject(err);\n }\n }, []);\n\n return {\n ...state,\n getOneByPatientId,\n postBuyShoppingListById,\n };\n};\n\nexport default useShoppingList;\n","import styled from 'styled-components';\nimport StyledButton from '../../components/StyledButton';\n\nexport const Container = styled.div`\n display: flex;\n flex-direction: column;\n flex: 1;\n align-items: center;\n padding: ${({ theme }) => theme.spacing(2, 2, 0, 2)};\n color: ${({ theme }) => theme.palette.secondary.main};\n`;\n\nexport const StyledBuyButton = styled(StyledButton)`\n margin: ${({ theme }) => theme.spacing(2)}px;\n`;\n","import { APIError } from '@cuidador/lib'\nimport { Typography } from '@material-ui/core'\nimport { AxiosError } from 'axios'\nimport React, { useContext, useEffect, useState } from 'react'\nimport { toast } from 'react-toastify'\nimport LoadingBackdrop from '../../components/LoadingBackdrop'\nimport PendingRegistrationBanner from '../../components/PendingRegistrationBanner'\nimport ShoppingListUpsertForm from '../../components/ShoppingListUpsertForm'\nimport { AuthContext } from '../../contexts/auth'\nimport useMedication from '../../hooks/useMedication'\nimport useShoppingList from '../../hooks/useShoppingList'\nimport { resolveErrorMessage } from '../../utils/error'\nimport { Container, StyledBuyButton } from './styles'\nimport BuyMedicationDialog from '../../components/BuyMedicationDialog'\nimport { Header } from '../../components/Header'\nimport { PageTitle } from '../../components/PageTitle'\nimport { PscButton } from '../../components/PscButton'\nimport { MenuButton } from '../../components/MenuButton'\nimport { SideMenu } from '../../components/SideMenu'\nimport { useDoseCerta } from '../../hooks/useDoseCerta'\n\nconst ShoppingList: React.FC = () => {\n const [isMenuOpen, setMenuOpen] = useState(false)\n const { userInfo } = useContext(AuthContext)\n const {\n getOneByPatientId: getOneShoppingListByPatientId,\n ids: shoppingListItemIds,\n byId: shoppingListItemById,\n loading: loadingShoppingList,\n postBuyShoppingListById,\n } = useShoppingList()\n\n const {\n getAllByPatientId: getCurrentMedications,\n byId: medicationById,\n ids: currentMedicationIds,\n loading: loadingMedications,\n } = useMedication()\n const { createRequest } = useDoseCerta()\n\n const [isBuyDialogOpen, setIsBuyDialogOpen] = useState(false)\n\n const { name = '', id: patientId } = userInfo?.activePatient || {}\n\n useEffect(() => {\n if (!patientId) return\n getOneShoppingListByPatientId(patientId)\n\n getCurrentMedications(patientId, {\n orderBy: 'eventSchedule.frequencyEndsAt',\n order: 'desc',\n minFrequencyEndsAt: new Date().toISOString(),\n })\n }, [patientId])\n\n const data = shoppingListItemIds.map((id) => shoppingListItemById[id])\n const textItem = {\n shoppingText: `${data[0]?.shoppingText || ''}`,\n }\n\n const listId = data[0]?.id\n const handleSubmit = () => {\n return postBuyShoppingListById(listId!)\n .then(() => {\n toast.success('Lista marcada como comprada com sucesso!')\n })\n .catch((err: AxiosError) => {\n const displayMessage = resolveErrorMessage(err)\n toast.error(displayMessage)\n })\n }\n\n const buyMedications = async () => {\n const medications = currentMedicationIds.map((id) => medicationById[id])\n createRequest(medications)\n setIsBuyDialogOpen(false)\n }\n\n if (loadingMedications || loadingShoppingList) {\n return (\n \n )\n }\n\n return (\n <>\n setMenuOpen(false)}\n />\n setMenuOpen(true)} />}\n centerContent={\n \n }\n rightContent={\n \n }\n />\n \n \n Lista de compras\n \n Acompanhe aqui a lista de itens indicados para compra pelo(a)\n cuidador(a).\n \n \n {currentMedicationIds.length > 0 && (\n setIsBuyDialogOpen(true)}\n color=\"inherit\"\n data-testid=\"buy-medications\"\n >\n Comprar medicamentos\n \n )}\n \n setIsBuyDialogOpen(false)}\n onConfirm={buyMedications}\n isLoading={false}\n />\n \n )\n}\n\nexport default ShoppingList\n","import * as yup from 'yup';\n\nexport type FormValues = {\n promotionalCode: string;\n};\n\nexport const initialValues: FormValues = {\n promotionalCode: '',\n};\n\nconst validationSchema = yup.object().shape({\n promotionalCode: yup.string(),\n});\n\nexport const makeValidationSchema = (\n requirePromotionalCode: boolean,\n message?: string\n) => {\n if (!requirePromotionalCode) {\n return validationSchema;\n } else {\n return validationSchema.shape({\n promotionalCode: yup\n .string()\n .required(message || 'Por favor, informe um cupom'),\n });\n }\n};\n","import styled from 'styled-components';\nimport { Typography } from '@material-ui/core';\nimport { Form } from 'formik';\nimport StyledButton from '../../components/StyledButton';\n\nexport const ContentContainer = styled.div`\n display: flex;\n flex-direction: column;\n flex: 1;\n align-items: center;\n padding: ${({ theme }) => theme.spacing(2)}px;\n`;\n\nexport const LeftAlignedTypography = styled(Typography)`\n margin-top: ${({ theme }) => theme.spacing(2)}px;\n margin-right: auto;\n font-weight: bold;\n color: ${({ theme }) => theme.palette.extra.color.grey.dark};\n`;\n\nexport const CardBody = styled.div`\n background-color: ${({ theme }) => theme.palette.extra.color.grey.light};\n width: 100%;\n min-height: ${({ theme }) => theme.spacing(15)}px;\n border-radius: ${({ theme }) => theme.spacing(2)}px;\n margin: ${({ theme }) => theme.spacing(3, 0)};\n padding: ${({ theme }) => theme.spacing(2)}px;\n box-sizing: border-box;\n`;\n\nexport const CardHeader = styled.div`\n display: flex;\n align-items: center;\n`;\n\nexport const RightAlignedTypography = styled(Typography)`\n margin-left: auto;\n font-weight: bold;\n`;\n\nexport const BoldTypography = styled(Typography)`\n font-weight: bold;\n`;\n\nexport const CardContent = styled.div`\n font-size: 0.9em;\n`;\n\nexport const StyledForm = styled(Form)`\n display: flex;\n flex-direction: column;\n width: 100%;\n`;\n\nexport const StyledSubmitButton = styled(StyledButton)`\n margin-top: ${({ theme }) => theme.spacing(3)}px;\n margin-inline: auto;\n`;\n\nexport const InputLabel = styled.label`\n font-size: 0.95rem;\n font-weight: 700;\n`;\n\nexport const InputRequired = styled.span`\n font-size: 0.8rem;\n margin-left: ${({ theme }) => theme.spacing(1)}px;\n`;\n","import { PlanModel } from '@cuidador/database';\nimport { APIError } from '@cuidador/lib/error/error';\nimport PlanIcon from '@material-ui/icons/FavoriteBorder';\nimport { AxiosError } from 'axios';\nimport React, { useContext, useEffect, useRef, useState } from 'react';\nimport { useHistory } from 'react-router-dom';\nimport { toast } from 'react-toastify';\nimport { Formik, FormikProps } from 'formik';\nimport { StyledFormikTextField } from '../../components/FormCardContainer';\nimport LoadingBackdrop from '../../components/LoadingBackdrop';\nimport MedicBalloon from '../../components/MedicBalloon';\nimport { AuthContext } from '../../contexts/auth';\nimport useCanAccess from '../../hooks/useCanAccess';\nimport usePlan from '../../hooks/usePlan';\nimport { initialValues, makeValidationSchema, FormValues } from './utils';\nimport { resolveErrorMessage } from '../../utils/error';\nimport {\n BoldTypography,\n CardBody,\n CardContent,\n CardHeader,\n ContentContainer,\n LeftAlignedTypography,\n RightAlignedTypography,\n StyledForm,\n StyledSubmitButton,\n InputLabel,\n InputRequired,\n} from './styles';\nimport { Header } from '../../components/Header'\nimport { PageTitle } from '../../components/PageTitle'\nimport { PscButton } from '../../components/PscButton'\n\nconst PlanCard: React.FC<{ plan: PlanModel }> = ({ plan }) => {\n return (\n \n \n \n {plan.planCardTitle}\n {plan.isPromotional && (\n \n Grátis\n \n )}\n \n \n
      \n
    • Limite de uma Pessoa Sob Cuidado cadastrada
    • \n
    • Acesso ilimitado a todas funcionalidades
    • \n
    • Cadastro ilimitado de cuidadores
    • \n
    • \n \n Válido por: {Math.round(Number(plan.trialPeriodDays) / 30)} meses\n \n
    • \n
    \n
    \n
    \n );\n};\n\nconst SubscriptionActivation: React.FC = () => {\n const [plan, setPlan] = useState();\n const formikRef = useRef | null>();\n const { getById, signPromotionalPlan, loading } = usePlan();\n const { refreshUserInfo, promotionPlanId } = useContext(AuthContext);\n const history = useHistory();\n const { isAllowedToInvoke } = useCanAccess('user/plan/promotional.subscribe');\n\n const handleStartWithPlan = (values: FormValues) => {\n if (!promotionPlanId) return;\n signPromotionalPlan(promotionPlanId, {\n promotionalCode: values.promotionalCode,\n })\n .then(refreshUserInfo)\n .then(() => {\n toast.success('Plano assinado!');\n history.push('/onboarding');\n })\n .catch((err: AxiosError) => {\n const displayMessage = resolveErrorMessage(err);\n toast.error(displayMessage);\n });\n };\n\n useEffect(() => {\n if (!promotionPlanId) {\n toast.error('Não há ID do plano');\n return;\n }\n\n getById(promotionPlanId)\n .then((data) => {\n setPlan(data);\n })\n .catch((err: AxiosError) => {\n const displayMessage = resolveErrorMessage(err);\n toast.error(displayMessage);\n });\n }, []);\n\n if (loading) {\n return ;\n }\n\n return (\n <>\n \n }\n rightContent={}\n />\n {plan && (\n <>\n \n \n Informações do Plano\n \n (formikRef.current = ref)}\n initialValues={initialValues}\n validationSchema={makeValidationSchema(\n Boolean(plan?.requirePromotionalCode)\n )}\n onSubmit={handleStartWithPlan}\n >\n {(formik) => (\n \n \n Cupom promocional\n {plan.requirePromotionalCode && (\n (obrigatório)\n )}\n \n \n \n Começar Agora\n \n \n )}\n \n \n \n )}\n \n );\n};\n\nexport default SubscriptionActivation;\n","import { Accordion, Typography } from '@material-ui/core';\nimport ExpandMoreIcon from '@material-ui/icons/ExpandMore';\nimport styled from 'styled-components';\nimport { StyledFormikTextField } from '../../components/FormCardContainer';\nimport StyledButton from '../../components/StyledButton';\n\nexport const Container = styled.div`\n display: flex;\n flex-direction: column;\n flex: 1;\n background-color: #fafafa;\n padding: ${({ theme }) => theme.spacing(2, 2)};\n`;\n\nexport const StyledIcon = styled.span`\n color: ${({ theme }) => theme.palette.primary.dark};\n margin-right: ${({ theme }) => theme.spacing(1)}px;\n vertical-align: sub;\n`;\n\nexport const StyledPrice = styled.span`\n color: ${({ theme }) => theme.palette.primary.dark};\n`;\n\nexport const StyledTypography = styled(Typography)`\n color: ${({ theme }) => theme.palette.extra.color.grey.dark};\n margin-bottom: ${({ theme }) => theme.spacing(1)}px;\n`;\n\nexport const StyledTitle = styled(StyledTypography)`\n font-weight: 550;\n`;\n\nexport const StyledPlan = styled.div`\n padding: ${({ theme }) => theme.spacing(1)}px;\n margin: ${({ theme }) => theme.spacing(1)}px;\n background-color: ${({ theme }) => theme.palette.extra.color.grey.light};\n border-radius: ${({ theme }) => theme.spacing(1)}px;\n`;\n\nexport const StyledPlanDescription = styled.div`\n margin-left: ${({ theme }) => theme.spacing(-2)}px;\n & ul {\n color: ${({ theme }) => theme.palette.extra.color.grey.main};\n }\n`;\n\nexport const StyledLineSimple = styled.hr`\n color: ${({ theme }) => theme.palette.extra.color.grey.light};\n`;\n\nexport const StyledAccordion = styled(Accordion)`\n background-color: ${({ theme }) => theme.palette.grey[200]};\n border-radius: 5px;\n width: 90%;\n margin: ${({ theme }) => theme.spacing(1.5, 0)};\n padding: ${({ theme }) => theme.spacing(2)}px;\n`;\n\nexport const StyledInfo = styled.div`\n width: 90%;\n padding: ${({ theme }) => theme.spacing(2)}px;\n text-decoration: none;\n vertical-align: text-bottom;\n & h6 ul {\n color: ${({ theme }) => theme.palette.extra.color.grey.main};\n margin-left: ${({ theme }) => theme.spacing(-3)}px;\n }\n`;\n\nexport const RowContainer = styled.div`\n display: flex;\n`;\n\nexport const StyledFirstInRow = styled(StyledFormikTextField)`\n margin-right: ${({ theme }) => theme.spacing(2)}px;\n`;\n\nexport const StyledPayButton = styled(StyledButton)`\n width: 50%;\n align-self: center;\n`;\n\nexport const StyledInfoPrice = styled.span`\n float: right;\n margin-right: ${({ theme }) => theme.spacing(2)}px;\n`;\n\nexport const StyledExpandMoreIcon = styled(ExpandMoreIcon)`\n fill: ${({ theme }) => theme.palette.primary.main};\n`;\n","import { CompanyDataType } from '@cuidador/database/src/types';\nimport * as yup from 'yup';\nimport { validateCnpj } from '../../utils/inputs';\n\nexport const initialCompanyValues = {\n cnpj: '',\n companyName: '',\n tradingName: '',\n};\n\nexport const initialAddressValues = {\n postalCode: '',\n country: '',\n province: '',\n city: '',\n address: '',\n addressNumber: '',\n additional: '',\n};\n\nexport type FormCompanyValues = {\n cnpj: string;\n companyName: string;\n tradingName: string;\n};\n\nexport type FormAddressValues = {\n postalCode: string;\n country: string;\n province: string;\n city: string;\n address: string;\n addressNumber: string;\n additional: string;\n};\n\nexport const validationCompanySchema = yup.object().shape({\n companyName: yup\n .string()\n .required('Por favor, insira o nome')\n .min(3, 'O nome deve conter ao menos 3 caracteres'),\n tradingName: yup\n .string()\n .required('Por favor, insira o nome')\n .min(3, 'O nome deve conter ao menos 3 caracteres'),\n cnpj: yup\n .string()\n .required('Por favor, insira o CNPJ')\n .test('isCnpjValid', 'Por favor, insira um CNPJ válido', (value) =>\n validateCnpj(value || '')\n ),\n});\n\nexport const validationAddressSchema = yup.object().shape({\n postalCode: yup\n .string()\n .required('Por favor, insira o CEP')\n .min(9, 'Por favor, insira um CEP válido')\n .max(10, 'Por favor, insira um CEP válido'),\n country: yup.string().required('Por favor, insira o país'),\n province: yup\n .string()\n .required('Por favor, insira a UF')\n .min(2, 'Por favor, insira uma UF válida')\n .max(3, 'Por favor, insira uma UF válida'),\n city: yup.string().required('Por favor, insira a cidade'),\n address: yup\n .string()\n .required('Por favor, insira o endereço')\n .min(3, 'Por favor, insira um endereço válido'),\n addressNumber: yup.string().required('Por favor, insira o número'),\n});\n\nexport const formValuesToCompanySubscriptionRequest = (\n companyValues: FormCompanyValues,\n addressValues: FormAddressValues,\n district: string\n) => {\n const postalCode = addressValues.postalCode.replace('-', '');\n const cnpj = unformattedCnpj(companyValues.cnpj);\n\n const body: CompanyDataType = {\n cnpj,\n companyName: companyValues.companyName,\n tradingName: companyValues.tradingName,\n address: {\n line1: `${addressValues.addressNumber}, ${addressValues.address}, ${district}`,\n zipCode: postalCode,\n city: addressValues.city,\n state: addressValues.province,\n country: 'BR',\n },\n };\n if (addressValues.additional) body.address.line2 = addressValues.additional;\n return body;\n};\n\nconst unformattedCnpj = (cnpj: string) =>\n cnpj.replace('-', '').replace('/', '').split('.').join('');\n","import { PlanModel } from '@cuidador/database';\nimport { APIError } from '@cuidador/lib/error/error';\nimport { AccordionSummary } from '@material-ui/core';\nimport Typography from '@material-ui/core/Typography';\nimport LoyaltyIcon from '@material-ui/icons/Loyalty';\nimport { AxiosError } from 'axios';\nimport { Form, Formik, FormikProps } from 'formik';\nimport qs from 'query-string';\nimport React, { useContext, useEffect, useRef, useState } from 'react';\nimport 'react-credit-cards/es/styles-compiled.css';\nimport { useLocation } from 'react-router-dom';\nimport { toast } from 'react-toastify';\nimport { StyledFormikTextField } from '../../components/FormCardContainer';\nimport LoadingBackdrop from '../../components/LoadingBackdrop';\nimport { StyledFieldset } from '../../components/StyledFieldset';\nimport { AuthContext } from '../../contexts/auth';\nimport useCanAccess from '../../hooks/useCanAccess';\nimport useCEP from '../../hooks/useCEP';\nimport usePlan from '../../hooks/usePlan';\nimport { resolveErrorMessage } from '../../utils/error';\nimport { cepMask, cnpjMask } from '../../utils/inputs';\nimport {\n Container,\n RowContainer,\n StyledAccordion,\n StyledExpandMoreIcon,\n StyledFirstInRow,\n StyledIcon,\n StyledInfo,\n StyledLineSimple,\n StyledPayButton,\n StyledPlan,\n StyledPlanDescription,\n StyledPrice,\n StyledTitle,\n StyledTypography,\n} from './styles';\nimport {\n FormAddressValues,\n FormCompanyValues,\n formValuesToCompanySubscriptionRequest,\n initialAddressValues,\n initialCompanyValues,\n validationAddressSchema,\n validationCompanySchema,\n} from './utils';\nimport { Header } from '../../components/Header'\nimport { PageTitle } from '../../components/PageTitle'\nimport { PscButton } from '../../components/PscButton'\n\nconst SubscriptionCompany: React.FC = () => {\n const formikCompanyValuesRef = useRef | null>();\n const formikAddressValuesRef = useRef | null>();\n const { getAddress } = useCEP();\n const location = useLocation();\n const { refreshUserInfo, companyPlanId } = useContext(AuthContext);\n const { signCompanyPlan, getById, loading } = usePlan();\n const [district, setDistrict] = useState('');\n const [plan, setPlan] = useState();\n const { plan: qsPlanId } = qs.parse(location.search);\n\n const { isAllowedToInvoke } = useCanAccess('user/plan/company.subscribe');\n\n const submitCompanyInfo = () => {\n // se remover essa funcao a validacao do formik para de funcionar\n };\n\n const submitAddressInfo = () => {\n // se remover essa funcao a validacao do formik para de funcionar\n };\n\n const fetchAddress = (cep: string) => {\n if (!formikAddressValuesRef || !formikAddressValuesRef.current) return;\n getAddress(cep)\n .then((data) => {\n const { erro, uf, localidade, bairro, logradouro } = data;\n\n if (!erro && formikAddressValuesRef.current) {\n formikAddressValuesRef.current.setFieldValue('country', 'Brasil');\n formikAddressValuesRef.current.setFieldValue('province', uf);\n formikAddressValuesRef.current.setFieldValue('city', localidade);\n formikAddressValuesRef.current.setFieldValue('address', logradouro);\n setDistrict(bairro);\n }\n })\n .catch(() => {\n toast.error('CEP inválido');\n });\n };\n\n // eslint-disable-next-line\n const handlePostalCodeChange = (e: React.ChangeEvent) => {\n if (!formikAddressValuesRef || !formikAddressValuesRef.current) return;\n formikAddressValuesRef.current.setFieldValue('postalCode', e.target.value);\n if (e.target.value.length === 9) {\n fetchAddress(e.target.value);\n }\n };\n\n const handleSubmit = () => {\n if (!formikAddressValuesRef.current || !formikCompanyValuesRef.current)\n return;\n\n const companyFormik = formikCompanyValuesRef.current;\n const addressFormik = formikAddressValuesRef.current;\n\n if (!companyFormik.isValid || !addressFormik.isValid) {\n companyFormik.submitForm();\n addressFormik.submitForm();\n return;\n }\n if (!plan?.id) return;\n\n const body = formValuesToCompanySubscriptionRequest(\n companyFormik.values,\n addressFormik.values,\n district\n );\n\n signCompanyPlan(plan.id, body)\n .then(() => {\n refreshUserInfo();\n toast.success('Processando...');\n })\n .catch((error) => {\n const displayMessage = resolveErrorMessage(error);\n toast.error(displayMessage);\n });\n };\n\n useEffect(() => {\n if (!companyPlanId && !qsPlanId) {\n toast.error('Não há ID do plano');\n return;\n }\n const planId = companyPlanId || qsPlanId?.toString() || '';\n getById(planId)\n .then((data) => {\n setPlan(data);\n })\n .catch((err: AxiosError) => {\n const displayMessage = resolveErrorMessage(err);\n toast.error(displayMessage);\n });\n }, []);\n\n if (loading) return ;\n\n return (\n <>\n \n }\n rightContent={}\n />\n \n \n \n \n \n \n \n {plan?.name}\n \n \n \n \n
      \n
    • \n Valor por PSC:{' '}\n \n R$ {(Number(plan?.priceInCents) / 100).toFixed(2)}\n {' '}\n
    • \n
    • Limite de PSCs cadastradas: {plan?.maxAllowedPatients}
    • \n
    • Cadastro ilimitado de cuidadores
    • \n
    \n
    \n
    \n
    \n\n \n }>\n Dados da contratante\n \n \n (formikCompanyValuesRef.current = ref)}\n initialValues={initialCompanyValues}\n validationSchema={validationCompanySchema}\n onSubmit={submitCompanyInfo}\n >\n {({ values }) => {\n return (\n
    \n \n \n \n \n \n
    \n );\n }}\n \n
    \n\n \n }>\n Endereço da contratante\n \n \n (formikAddressValuesRef.current = ref)}\n initialValues={initialAddressValues}\n validationSchema={validationAddressSchema}\n onSubmit={submitAddressInfo}\n >\n {({ values }) => (\n
    \n \n \n \n \n \n \n \n \n \n \n \n \n \n
    \n )}\n \n
    \n\n \n Informações da assinatura\n \n
      \n
    • A cobrança será mensal
    • \n
    • \n Todo dia 2 será gerado o boleto de pagamento e será enviado para\n o e-mail cadastrado\n
    • \n
    • \n O valor do boleto será calculado com base na quantidade de PSCs\n ativas no sistema no mês de referência\n
    • \n
    \n
    \n
    \n \n Começar Agora\n \n
    \n \n );\n};\n\nexport default SubscriptionCompany;\n","function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\nimport * as React from \"react\";\n\nvar _ref2 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M7.6665 11.9795L10.5415 14.8545L15.3332 9.10449\",\n stroke: \"#999999\",\n strokeWidth: 2,\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n});\n\nvar _ref3 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M11.4998 21.0837C16.7926 21.0837 21.0832 16.7931 21.0832 11.5003C21.0832 6.2076 16.7926 1.91699 11.4998 1.91699C6.20711 1.91699 1.9165 6.2076 1.9165 11.5003C1.9165 16.7931 6.20711 21.0837 11.4998 21.0837Z\",\n stroke: \"#999999\",\n strokeWidth: 2\n});\n\nfunction SvgIconAccordionDone(_ref, svgRef) {\n var title = _ref.title,\n titleId = _ref.titleId,\n props = _objectWithoutProperties(_ref, [\"title\", \"titleId\"]);\n\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n width: 23,\n height: 23,\n viewBox: \"0 0 23 23\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, _ref2, _ref3);\n}\n\nvar ForwardRef = /*#__PURE__*/React.forwardRef(SvgIconAccordionDone);\nexport default __webpack_public_path__ + \"static/media/Icon-AccordionDone.833540fa.svg\";\nexport { ForwardRef as ReactComponent };","function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\nimport * as React from \"react\";\n\nvar _ref2 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M10.5415 15.3337C10.5415 14.8044 10.9706 14.3753 11.4998 14.3753V14.3753C12.0291 14.3753 12.4582 14.8044 12.4582 15.3337V15.3337C12.4582 15.8629 12.0291 16.292 11.4998 16.292V16.292C10.9706 16.292 10.5415 15.8629 10.5415 15.3337V15.3337ZM10.5415 7.66699C10.5415 7.13772 10.9706 6.70866 11.4998 6.70866V6.70866C12.0291 6.70866 12.4582 7.13772 12.4582 7.66699V11.5003C12.4582 12.0296 12.0291 12.4587 11.4998 12.4587V12.4587C10.9706 12.4587 10.5415 12.0296 10.5415 11.5003V7.66699ZM11.4903 1.91699C6.20025 1.91699 1.9165 6.21033 1.9165 11.5003C1.9165 16.7903 6.20025 21.0837 11.4903 21.0837C16.7898 21.0837 21.0832 16.7903 21.0832 11.5003C21.0832 6.21033 16.7898 1.91699 11.4903 1.91699ZM11.4998 19.167C7.264 19.167 3.83317 15.7362 3.83317 11.5003C3.83317 7.26449 7.264 3.83366 11.4998 3.83366C15.7357 3.83366 19.1665 7.26449 19.1665 11.5003C19.1665 15.7362 15.7357 19.167 11.4998 19.167Z\",\n fill: \"#D20000\"\n});\n\nfunction SvgIconAccordionError(_ref, svgRef) {\n var title = _ref.title,\n titleId = _ref.titleId,\n props = _objectWithoutProperties(_ref, [\"title\", \"titleId\"]);\n\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n width: 23,\n height: 23,\n viewBox: \"0 0 23 23\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, _ref2);\n}\n\nvar ForwardRef = /*#__PURE__*/React.forwardRef(SvgIconAccordionError);\nexport default __webpack_public_path__ + \"static/media/Icon-AccordionError.f72d8df5.svg\";\nexport { ForwardRef as ReactComponent };","import { Accordion, Typography } from '@material-ui/core';\nimport ExpandMoreIcon from '@material-ui/icons/ExpandMore';\nimport styled from 'styled-components';\nimport { ReactComponent as AccordionDone } from '../../assets/Icon-AccordionDone.svg';\nimport { ReactComponent as AccordionError } from '../../assets/Icon-AccordionError.svg';\nimport { StyledFormikTextField } from '../../components/FormCardContainer';\nimport StyledButton from '../../components/StyledButton';\n\nexport const Container = styled.div`\n display: flex;\n flex-direction: column;\n flex: 1;\n background-color: #fafafa;\n padding: ${({ theme }) => theme.spacing(2, 2)};\n`;\n\nexport const StyledIcon = styled.span`\n color: ${({ theme }) => theme.palette.primary.dark};\n margin-right: ${({ theme }) => theme.spacing(1)}px;\n vertical-align: middle;\n`;\n\nexport const StyledPrice = styled.span`\n margin-right: ${({ theme }) => theme.spacing(1)}px;\n margin-top: ${({ theme }) => theme.spacing(0.5)}px;\n float: right;\n color: ${({ theme }) => theme.palette.primary.dark};\n`;\n\nexport const TypographyContainer = styled.div`\n width: 100%;\n padding: ${({ theme }) => theme.spacing(2, 2)};\n margin-top: ${({ theme }) => theme.spacing(1)}px;\n`;\n\nexport const StyledTypography = styled(Typography)`\n color: ${({ theme }) => theme.palette.extra.color.grey.dark};\n margin-bottom: ${({ theme }) => theme.spacing(1)}px;\n`;\n\nexport const StyledTitle = styled(StyledTypography)`\n font-weight: 550;\n`;\n\nexport const StyledPlan = styled.div`\n padding: ${({ theme }) => theme.spacing(1)}px;\n margin: ${({ theme }) => theme.spacing(1)}px;\n background-color: #f3f3f3;\n border-radius: ${({ theme }) => theme.spacing(1)}px;\n`;\n\nexport const StyledChangePlan = styled(StyledButton)`\n float: right;\n color: ${({ theme }) => theme.palette.common.white};\n background-color: ${({ theme }) => theme.palette.primary.dark};\n`;\n\nexport const StyledPlanDescription = styled.div`\n margin-left: ${({ theme }) => theme.spacing(5)}px;\n`;\n\nexport const StyledLine = styled.hr`\n width: 85%;\n color: #cccccc;\n margin: ${({ theme }) => theme.spacing(3)}px;\n`;\n\nexport const StyledLineSimple = styled.hr`\n width: 85%;\n color: #cccccc;\n`;\n\nexport const StyledPay = styled.div`\n padding: ${({ theme }) => theme.spacing(2)}px;\n margin: ${({ theme }) => theme.spacing(1)}px;\n border: 3px solid #cccccc;\n border-radius: ${({ theme }) => theme.spacing(2)}px;\n`;\n\nexport const StyledChangeCard = styled(StyledButton)`\n width: 30%;\n margin-left: 70%;\n color: ${({ theme }) => theme.palette.secondary.main};\n text-decoration: underline;\n border: none;\n`;\n\nexport const StyledChangeContract = styled(StyledButton)`\n align-self: center;\n color: ${({ theme }) => theme.palette.secondary.main};\n text-decoration: underline;\n border: none;\n`;\n\nexport const StyledAccordion = styled(Accordion)`\n background-color: ${({ theme }) => theme.palette.grey[200]};\n border-radius: 5px;\n width: 90%;\n margin-bottom: ${({ theme }) => theme.spacing(1.5)}px;\n padding: ${({ theme }) => theme.spacing(2)}px;\n`;\n\nexport const StyledCoupun = styled.div`\n width: 90%;\n padding: ${({ theme }) => theme.spacing(2)}px;\n /* margin: ${({ theme }) => theme.spacing(2)}px; */\n background-color: ${({ theme }) => theme.palette.grey[200]};\n border-radius: 5px;\n`;\n\nexport const StyledInfo = styled.div`\n width: 90%;\n padding: ${({ theme }) => theme.spacing(2)}px;\n background-color: ${({ theme }) => theme.palette.grey[200]};\n border-radius: 5px;\n margin-bottom: ${({ theme }) => theme.spacing(2)}px;\n text-decoration: none;\n list-style: none;\n vertical-align: text-bottom;\n`;\n\nexport const StyledFirstInRow = styled(StyledFormikTextField)`\n margin-right: ${({ theme }) => theme.spacing(2)}px;\n`;\n\nexport const RowContainer = styled.div`\n display: flex;\n`;\n\nexport const StyledPayButton = styled(StyledButton)`\n width: 50%;\n align-self: center;\n`;\n\nexport const StyledInfoPrice = styled.span`\n float: right;\n margin-right: ${({ theme }) => theme.spacing(2)}px;\n`;\n\nexport const AccordionDoneIcon = styled(AccordionDone)`\n margin-left: ${({ theme }) => theme.spacing(2)}px;\n color: ${({ theme }) => theme.palette.extra.color.green};\n`;\n\nexport const AccordionNotDoneIcon = styled(AccordionDone)`\n margin-left: ${({ theme }) => theme.spacing(2)}px;\n`;\n\nexport const AccordionErrorIcon = styled(AccordionError)`\n margin-left: ${({ theme }) => theme.spacing(2)}px;\n`;\n\nexport const StyledExpandMoreIcon = styled(ExpandMoreIcon)`\n fill: ${({ theme }) => theme.palette.primary.main};\n`;\n","import { CardDataType, PlanModel } from '@cuidador/database';\nimport * as yup from 'yup';\nimport { validateCpf } from '../../utils/inputs';\nimport { FormValues } from '../SubscriptionActivation/utils';\n\nexport const initialCardValues = {\n name: '',\n cardNumber: '',\n expiry: '',\n cvc: '',\n cpf: '',\n};\n\nexport type FormCardValues = {\n name: string;\n cardNumber: string;\n expiry: string;\n cvc: string;\n cpf: string;\n};\n\nexport const initialAddressValues = {\n postalCode: '',\n country: '',\n province: '',\n city: '',\n address: '',\n addressNumber: '',\n additional: '',\n};\n\nexport type FormAddressValues = {\n postalCode: string;\n country: string;\n province: string;\n city: string;\n address: string;\n addressNumber: string;\n additional: string;\n};\n\nexport const validationCardSchema = yup.object().shape({\n name: yup\n .string()\n .required('Por favor, insira o nome completo')\n .min(3, 'O nome deve conter ao menos 3 caracteres')\n .test(\n 'isFullName',\n 'Por favor, insira o nome completo',\n (value) => (value || '').split(' ').length > 1\n ),\n cpf: yup\n .string()\n .required('Por favor, insira o CPF')\n .test('isCpfValid', 'Por favor, insira um CPF válido', (value) =>\n validateCpf(value || '')\n ),\n cardNumber: yup\n .string()\n .required('Por favor, insira um número de cartão')\n .min(14, 'Por favor, insira um número de cartão válido')\n .max(22, 'Por favor, insira um número de cartão válido'),\n expiry: yup\n .string()\n .required('Por favor, insira a validade do cartão')\n .min(5, 'Por favor, insira a data no formato MM/AA')\n .max(6, 'Por favor, insira a data no formato MM/AA'),\n cvc: yup\n .string()\n .required('Por favor, insira o código de verificação do cartão')\n .min(3, 'Por favor, insira um código de verificação do cartão válido')\n .max(4, 'Por favor, insira um código de verificação do cartão válido'),\n});\n\nexport const validationAddressSchema = yup.object().shape({\n postalCode: yup\n .string()\n .required('Por favor, insira o CEP')\n .min(9, 'Por favor, insira um CEP válido')\n .max(10, 'Por favor, insira um CEP válido'),\n country: yup.string().required('Por favor, insira o país'),\n province: yup\n .string()\n .required('Por favor, insira a UF')\n .min(2, 'Por favor, insira uma UF válida')\n .max(3, 'Por favor, insira uma UF válida'),\n city: yup.string().required('Por favor, insira a cidade'),\n address: yup\n .string()\n .required('Por favor, insira o endereço')\n .min(3, 'Por favor, insira um endereço válido'),\n addressNumber: yup.string().required('Por favor, insira o número'),\n});\n\nexport const getPlanName = (plan: PlanModel) => {\n const getPlanFrequency = (interval: string, intervalCount: number) => {\n if (interval === 'year') return 'Anual';\n if (interval === 'month' && intervalCount === 6) return 'Semestral';\n if (interval === 'month' && intervalCount === 1) return 'Mensal';\n return '';\n };\n\n return `${plan.name} ${getPlanFrequency(\n String(plan.interval),\n Number(plan.intervalCount)\n )}`;\n};\n\nexport const formValuesToPostRequisitionBody = (\n cardValues: FormCardValues,\n billingAddressValues: FormAddressValues,\n district: string,\n promotionalCodeValues?: FormValues\n) => {\n const [expirationMonth, expirationYear] = cardValues.expiry.split('/');\n const cardNumber = cardValues.cardNumber.replace(/\\s/g, '');\n const postalCode = billingAddressValues.postalCode.replace('-', '');\n const cpf = cardValues.cpf.replace('-', '').split('.').join('');\n\n const body: CardDataType = {\n promotionalCode: promotionalCodeValues?.promotionalCode,\n holderName: cardValues.name,\n number: cardNumber,\n expMonth: Number(expirationMonth),\n expYear: Number(expirationYear),\n cvv: cardValues.cvc,\n cpf: cpf,\n billingAddress: {\n line1: `${billingAddressValues.addressNumber}, ${billingAddressValues.address}, ${district}`,\n zipCode: postalCode,\n city: billingAddressValues.city,\n state: billingAddressValues.province,\n country: 'BR',\n },\n };\n if (billingAddressValues.additional)\n body.billingAddress.line2 = billingAddressValues.additional;\n\n return body;\n};\n","import { PlanModel } from '@cuidador/database';\nimport {\n AccordionSummary,\n FormControlLabel,\n Radio,\n RadioGroup,\n} from '@material-ui/core';\nimport Typography from '@material-ui/core/Typography';\nimport LoyaltyIcon from '@material-ui/icons/Loyalty';\nimport { Form, Formik, FormikProps } from 'formik';\nimport React, { useContext, useRef, useState } from 'react';\nimport Cards, { Focused } from 'react-credit-cards';\nimport 'react-credit-cards/es/styles-compiled.css';\nimport { useHistory, useLocation } from 'react-router-dom';\nimport { toast } from 'react-toastify';\nimport { StyledFormikTextField } from '../../components/FormCardContainer';\nimport LoadingBackdrop from '../../components/LoadingBackdrop';\nimport { AuthContext } from '../../contexts/auth';\nimport useCEP from '../../hooks/useCEP';\nimport usePlan from '../../hooks/usePlan';\nimport { resolveErrorMessage } from '../../utils/error';\nimport {\n cardMask,\n cepMask,\n cpfMask,\n cvcMask,\n expiryMask,\n numberMask,\n} from '../../utils/inputs';\nimport {\n FormValues,\n initialValues,\n makeValidationSchema,\n} from '../SubscriptionActivation/utils';\nimport {\n Container,\n RowContainer,\n StyledAccordion,\n StyledExpandMoreIcon,\n StyledFirstInRow,\n StyledIcon,\n StyledInfo,\n StyledInfoPrice,\n StyledLine,\n StyledLineSimple,\n StyledPayButton,\n StyledPlan,\n StyledPlanDescription,\n StyledPrice,\n StyledTitle,\n StyledTypography,\n} from './styles';\nimport {\n FormAddressValues,\n FormCardValues,\n formValuesToPostRequisitionBody,\n initialAddressValues,\n initialCardValues,\n validationAddressSchema,\n validationCardSchema,\n} from './utils';\nimport { PageTitle } from '../../components/PageTitle'\nimport { Header } from '../../components/Header'\nimport { BackButton } from '../../components/BackButton'\nimport { PscButton } from '../../components/PscButton'\n\nconst SubscriptionPayment: React.FC = () => {\n const history = useHistory();\n const formikCardValuesRef = useRef | null>();\n const formikAddressValuesRef = useRef | null>();\n const formikPromotionalCodeRef = useRef | null>();\n const { getAddress } = useCEP();\n const { state } = useLocation<{ selectedPlan: PlanModel }>();\n const plan = state.selectedPlan;\n const { signAvailablePlan, loading } = usePlan();\n const { refreshUserInfo } = useContext(AuthContext);\n const [district, setDistrict] = useState('');\n const [cardFocus, setCardFocus] = useState('name');\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const handleCardchange = (e: React.ChangeEvent) => {\n if (!formikCardValuesRef || !formikCardValuesRef.current) return;\n\n switch (e.target.name) {\n case 'cvc':\n formikCardValuesRef.current.setFieldValue(\n e.target.name,\n cvcMask(e.target.value)\n );\n break;\n\n case 'cardNumber':\n formikCardValuesRef.current.setFieldValue(\n e.target.name,\n cardMask(e.target.value)\n );\n break;\n\n case 'expiry':\n formikCardValuesRef.current.setFieldValue(\n e.target.name,\n expiryMask(e.target.value)\n );\n break;\n case 'cpf':\n formikCardValuesRef.current.setFieldValue(\n e.target.name,\n cpfMask(e.target.value)\n );\n break;\n default:\n formikCardValuesRef.current.setFieldValue(\n e.target.name,\n e.target.value\n );\n }\n };\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const handleCardfocus = (e: React.ChangeEvent) => {\n setCardFocus(e.target.name);\n };\n\n const submitCardInfo = () => {\n // se remover essa funcao a validacao do formik para de funcionar\n };\n\n const submitAddressInfo = () => {\n // se remover essa funcao a validacao do formik para de funcionar\n };\n\n const fetchAddress = (cep: string) => {\n if (!formikAddressValuesRef || !formikAddressValuesRef.current) return;\n getAddress(cep)\n .then((data) => {\n const { erro, uf, localidade, bairro, logradouro } = data;\n\n if (!erro && formikAddressValuesRef.current) {\n formikAddressValuesRef.current.setFieldValue('country', 'Brasil');\n formikAddressValuesRef.current.setFieldValue('province', uf);\n formikAddressValuesRef.current.setFieldValue('city', localidade);\n formikAddressValuesRef.current.setFieldValue('address', logradouro);\n setDistrict(bairro);\n }\n })\n .catch(() => {\n toast.error('CEP inválido');\n });\n };\n\n // eslint-disable-next-line\n const handlePostalCodeChange = (e: React.ChangeEvent) => {\n if (!formikAddressValuesRef || !formikAddressValuesRef.current) return;\n formikAddressValuesRef.current.setFieldValue('postalCode', e.target.value);\n if (e.target.value.length === 9) {\n fetchAddress(e.target.value);\n }\n };\n\n const pay = () => {\n if (\n !formikAddressValuesRef.current ||\n !formikCardValuesRef.current ||\n (plan.requirePromotionalCode && !formikPromotionalCodeRef?.current)\n )\n return;\n\n const cardFormik = formikCardValuesRef.current;\n const billingAddressFormik = formikAddressValuesRef.current;\n const promotinalCodeFormik = formikPromotionalCodeRef?.current;\n\n if (\n !cardFormik.isValid ||\n !billingAddressFormik.isValid ||\n (plan.requirePromotionalCode && !promotinalCodeFormik?.isValid)\n ) {\n cardFormik.submitForm();\n billingAddressFormik.submitForm();\n promotinalCodeFormik?.submitForm();\n return;\n }\n if (!plan.id) return;\n\n const body = formValuesToPostRequisitionBody(\n cardFormik.values,\n billingAddressFormik.values,\n district,\n promotinalCodeFormik?.values\n );\n\n signAvailablePlan(plan.id, body)\n .then(() => {\n refreshUserInfo();\n toast.success('Processando pagamento');\n })\n .catch((error) => {\n const displayMessage = resolveErrorMessage(error);\n toast.error(displayMessage);\n });\n };\n\n if (loading) return ;\n\n return (\n <>\n history.push('/menu')}\n />\n }\n centerContent={\n \n }\n rightContent={}\n />\n \n \n \n \n \n \n \n {plan.name}\n \n R$ {(Number(plan.priceInCents) / 100).toFixed(2)}\n \n \n \n \n \n
      \n
    • Limite de uma Pessoa Sob Cuidado cadastrada;
    • \n
    • Acesso a todas as funcionalidades.
    • \n
    \n
    \n
    \n {/* Trocar plano */}\n
    \n\n \n\n Informações de Pagamento\n\n \n }>\n Informações do cartão\n \n\n \n\n (formikCardValuesRef.current = ref)}\n initialValues={initialCardValues}\n validationSchema={validationCardSchema}\n onSubmit={submitCardInfo}\n >\n {({ values }) => {\n return (\n
    \n \n\n \n \n \n \n \n \n \n \n Qual o tipo do cartão?\n \n \n }\n label=\"Crédito\"\n />\n }\n label=\"Débito\"\n />\n \n \n );\n }}\n \n
    \n\n \n }>\n Endereço de cobrança\n \n\n \n\n (formikAddressValuesRef.current = ref)}\n initialValues={initialAddressValues}\n validationSchema={validationAddressSchema}\n onSubmit={submitAddressInfo}\n >\n {({ values }) => (\n
    \n \n \n \n \n \n \n \n \n \n \n \n \n )}\n \n
    \n\n
    \n {plan?.requirePromotionalCode && (\n (formikPromotionalCodeRef.current = ref)}\n initialValues={initialValues}\n validationSchema={makeValidationSchema(\n Boolean(plan?.requirePromotionalCode),\n 'Por favor, informe o número da carteirinha ou crachá'\n )}\n onSubmit={() => {\n return;\n }}\n >\n {({ values }) => (\n
    \n ) =>\n formikPromotionalCodeRef.current?.setFieldValue(\n e.target.name,\n numberMask(e.target.value)\n )\n }\n placeholder=\"obrigatório\"\n label=\"Número Carteirinha ou Crachá\"\n type=\"tel\"\n />\n \n )}\n \n )}\n
    \n\n \n\n \n Informações da compra\n \n
  • \n Valor:{' '}\n \n {' '}\n R${(Number(plan.priceInCents) / 100).toFixed(2)}{' '}\n \n
  • \n
  • \n Desconto: R$--,-- \n
  • \n
    \n \n \n Total:{' '}\n \n R${(Number(plan.priceInCents) / 100).toFixed(2)}\n \n \n
    \n\n \n Realizar Pagamento\n \n
    \n \n );\n};\n\nexport default SubscriptionPayment;\n","import qs from 'query-string';\nimport React, { useContext } from 'react';\nimport {\n Redirect,\n Route,\n RouteComponentProps,\n RouteProps,\n useLocation,\n} from 'react-router-dom';\nimport { toast } from 'react-toastify';\nimport { AuthContext } from '../contexts/auth';\n\ninterface AuthenticatedRouteProps extends RouteProps {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n component: React.FC>;\n}\n\nconst AuthenticatedRoute = ({\n component: Component,\n ...rest\n}: AuthenticatedRouteProps): JSX.Element => {\n const { user, userInfo, promotionPlanId, companyPlanId } = useContext(\n AuthContext\n );\n const { state, search } = useLocation<{ selectedPlan: string }>();\n const { plan: qsPlanId } = qs.parse(search);\n\n const isUserOrganizationOwner =\n userInfo?.id === userInfo?.user?.organization?.createdById;\n const userHasOrganizationId = userInfo?.user?.organizationId;\n const userHasRelatedPatients = Number(userInfo?.user?.patients?.length) > 0;\n const userOrganizationHasRelatedPatients =\n Number(userInfo?.user?.organization?.patients?.length) > 0;\n const userOrganizationHasNoSubscription =\n userInfo?.user?.organization?.subscriptionId == null;\n const userOrganizationSubscriptionStatus =\n userInfo?.user?.organization?.subscription?.status;\n const userStatus = userInfo?.user?.status;\n\n return (\n {\n // redirect unauthenticated user to login\n if (!user)\n return (\n \n );\n\n // redirect users with promotional plan, without company plan and without subscription to /subscription-activation\n if (\n promotionPlanId &&\n !companyPlanId &&\n userOrganizationHasNoSubscription &&\n props.location.pathname !== '/subscription-activation'\n ) {\n return ;\n }\n\n // redirect users with company plan, without promotional plan and without subscription to /company\n if (\n (companyPlanId || qsPlanId) &&\n !promotionPlanId &&\n userOrganizationHasNoSubscription &&\n props.location.pathname !== '/company'\n ) {\n return ;\n }\n\n // redirect user who do not have an organization_id\n if (\n !userHasOrganizationId &&\n props.location.pathname !== '/usuario-sem-organizacao'\n ) {\n return ;\n }\n\n // redirect users without promotional plan, without company plan and without subscription to /planos\n if (\n !promotionPlanId &&\n !companyPlanId &&\n !state &&\n userOrganizationHasNoSubscription &&\n userHasOrganizationId &&\n props.location.pathname !== '/planos' &&\n props.location.pathname !== '/company' &&\n props.location.pathname !== '/usuario-sem-organizacao'\n ) {\n return ;\n }\n\n // redirect users without promotional plan, without company plan and without subscription who already selected their plan to /assinatura\n if (\n !promotionPlanId &&\n !companyPlanId &&\n userOrganizationHasNoSubscription &&\n state &&\n state.selectedPlan &&\n props.location.pathname !== '/assinatura'\n ) {\n return ;\n }\n\n // redirect users with a subscription with null status to the awaiting payment page\n if (\n userOrganizationSubscriptionStatus === null &&\n props.location.pathname !== '/processando-pagamento'\n ) {\n return ;\n }\n\n // redirect user who own an organization, are not related to any patients and have more than one patient in your organization\n if (\n !userHasRelatedPatients &&\n userOrganizationHasRelatedPatients &&\n isUserOrganizationOwner &&\n props.location.pathname !== `/organizacao/usuario/${userInfo?.id}`\n ) {\n toast.warning(\n 'Você precisa estar vinculado à pelo menos 1 paciente para usar o app'\n );\n // Note that `push` props is important to avoid user being thrown out of the\n // application on \"goBack\" click after this condition is no longer satisfied\n return (\n \n );\n }\n\n // redirect users who do not own an organization and are not related to any patients\n if (\n !userHasRelatedPatients &&\n !isUserOrganizationOwner &&\n props.location.pathname !== '/usuario-sem-vinculo'\n ) {\n return ;\n }\n\n // redirect to onboarding if user hasn't any patient registered\n if (\n !userHasRelatedPatients &&\n !userOrganizationHasRelatedPatients &&\n (userOrganizationSubscriptionStatus === 'active' ||\n userOrganizationSubscriptionStatus === 'future') &&\n props.location.pathname !== '/onboarding' &&\n props.location.pathname !== '/cadastro-psc'\n )\n return ;\n\n // redirect to awaiting review\n if (\n userHasRelatedPatients &&\n (userOrganizationSubscriptionStatus === 'active' ||\n userOrganizationSubscriptionStatus === 'future') &&\n userStatus === 'awaitingReview' &&\n props.location.pathname !== '/aguardando-revisao'\n )\n return ;\n\n return ;\n }}\n />\n );\n};\n\nexport default AuthenticatedRoute;\n","const sendPageView = (pagePath: string) => {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (window as any).gtag('event', 'page_view', {\n page_path: pagePath,\n });\n};\n\nconst analytics = {\n pageview: sendPageView,\n};\n\nexport default analytics;\n","import React, { useEffect } from 'react';\nimport { useLocation } from 'react-router-dom';\nimport analytics from '../config/googleAnalytics';\n\nconst RouteAnalytics: React.FC = () => {\n const location = useLocation();\n\n useEffect(() => {\n const dev = process.env.REACT_APP_ENV !== 'production';\n if (!dev) {\n analytics.pageview(location.pathname);\n }\n }, [location]);\n\n return <>;\n};\n\nexport default RouteAnalytics;\n","import React, { useContext } from 'react';\nimport {\n Route,\n Redirect,\n RouteComponentProps,\n RouteProps,\n useLocation,\n} from 'react-router-dom';\n\nimport { AuthContext } from '../contexts/auth';\n\ninterface UnauthenticatedRouteProps extends RouteProps {\n component: React.FC;\n}\n\ninterface LocationType {\n from: { pathname: string };\n}\n\nconst UnauthenticatedRoute = ({\n component: Component,\n ...rest\n}: UnauthenticatedRouteProps): JSX.Element => {\n const { user } = useContext(AuthContext);\n const { state } = useLocation();\n return (\n \n !Boolean(user) ? (\n \n ) : (\n \n )\n }\n />\n );\n};\n\nexport default UnauthenticatedRoute;\n","import styled from 'styled-components';\n\nexport const MainContainer = styled.div`\n display: flex;\n flex-direction: column;\n align-items: center;\n padding: ${({ theme }) => theme.spacing(2)}px;\n`;\n\nexport const ImageWithLeftMargin = styled.img`\n margin-left: 23px;\n`;\n","export default __webpack_public_path__ + \"static/media/development-in-progress.77d2804b.svg\";","import React, { useMemo } from 'react';\nimport { Typography } from '@material-ui/core';\nimport { ImageWithLeftMargin, MainContainer } from './styles';\nimport DevelopmentInProgressIcon from '../../assets/development-in-progress.svg';\nimport { useHistory, useParams } from 'react-router-dom';\nimport { Header } from '../../components/Header'\nimport { PageTitle } from '../../components/PageTitle'\nimport { BackButton } from '../../components/BackButton'\nimport { PscButton } from '../../components/PscButton'\n\ntype DevelopmentInProgressPageType = 'produtos-de-saude' | 'servicos-de-saude';\n\nconst DevelopmentInProgress: React.FC = () => {\n const params: { page: DevelopmentInProgressPageType } = useParams();\n const history = useHistory();\n\n const page: DevelopmentInProgressPageType = params.page;\n\n const title = useMemo(\n () =>\n page === 'produtos-de-saude' ? 'Produtos de saúde' : 'Serviços de saúde',\n [page]\n );\n\n return (\n <>\n \n }\n centerContent={\n \n }\n rightContent={}\n />\n \n
    \n \n
    \n Esta página está em contrução.\n
    \n
    \n \n Em breve você encontrará aqui o acesso fácil a{' '}\n {page === 'produtos-de-saude' ? 'produtos' : 'serviços'} de saúde para\n quando precisar.\n \n
    \n \n );\n};\n\nexport default DevelopmentInProgress;\n","import React from 'react'\nimport { Redirect, useHistory } from 'react-router-dom'\n\nimport { Tab, Tabs, useTheme } from '@material-ui/core'\n\nexport type TabsBarProps = {\n tabItems: {\n path: string,\n label: string,\n enabled: boolean,\n }[]\n selectedTab: string\n redirectionPath: string\n}\n\nexport function TabsBar (props: TabsBarProps) {\n const { tabItems, selectedTab, redirectionPath } = props\n const history = useHistory()\n const theme = useTheme()\n\n function handleChange (path: string): void {\n history.replace(path)\n }\n\n if (!selectedTab || !tabItems.some((item) => item.path === selectedTab)) {\n return \n }\n\n return (\n
    \n handleChange(value)}>\n {tabItems.map((item, index) => (\n \n ))}\n \n
    \n )\n}\n","import { Chip } from '@material-ui/core';\nimport styled from 'styled-components';\n\nexport const Container = styled.div`\n display: flex;\n justify-content: center;\n flex-wrap: wrap;\n margin-bottom: ${({ theme }) => theme.spacing(2)}px;\n`;\n\nexport const DefaultStyledChip = styled(Chip)`\n margin-inline: ${({ theme }) => theme.spacing(0.5)}px;\n margin-block: ${({ theme }) => theme.spacing(0.5)}px;\n cursor: pointer;\n`;\n\nexport const StyledBlueChip = styled(DefaultStyledChip)`\n color: ${({ theme }) => theme.palette.common.white};\n background-color: ${({ theme }) => theme.palette.primary.dark};\n\n & svg path {\n stroke: ${({ theme }) => theme.palette.common.white};\n }\n`;\n\nexport const StyledWhiteChip = styled(DefaultStyledChip)`\n color: ${({ theme }) => theme.palette.primary.dark};\n background-color: ${({ theme }) => theme.palette.common.white};\n border: 1px solid ${({ theme }) => theme.palette.primary.dark};\n`;\n","import React from 'react';\nimport { StyledBlueChip, StyledWhiteChip } from './styles';\n\nconst ToggleableChip: React.FC<{\n label: string;\n onClick: () => void;\n icon?: JSX.Element;\n value?: string;\n isActive: boolean;\n}> = ({ label, onClick, icon, value, isActive }) => {\n const StyledChip = isActive ? StyledBlueChip : StyledWhiteChip;\n\n return (\n \n );\n};\n\nexport default ToggleableChip;\n","import React from 'react'\nimport {\n CustomStatus,\n PatientQueryType,\n} from '../../../../../hooks/usePatient'\nimport ToggleableChip from '../../../../../components/ToggleableChip'\nimport { Container } from '../../../../../components/ToggleableChip/styles'\nimport { ReactComponent as ActiveIcon } from '../../../../../assets/active-icon.svg'\nimport { ReactComponent as InactiveIcon } from '../../../../../assets/disable-icon.svg'\nimport { ReactComponent as PendingIcon } from '../../../../../assets/pending-icon.svg'\n\nexport const chipItens: Array<{\n label: string\n value: CustomStatus\n icon?: JSX.Element\n}> = [\n { label: 'Ativos', value: 'enabled', icon: },\n { label: 'Pendentes', value: 'pending', icon: },\n { label: 'Inativos', value: 'disabled', icon: },\n ]\n\ninterface FilterChipsProps {\n setCustomStatus: (customStatus: CustomStatus[]) => void\n customStatus: CustomStatus[]\n isPatientQueryTypeToogleable: boolean\n handleTogglePatientQueryType: () => void\n patientQueryType?: PatientQueryType\n}\n\nconst FilterChips: React.FC = ({\n setCustomStatus,\n customStatus,\n}) => {\n const handleToggleStatus = (value: CustomStatus, isActive: boolean) => {\n if (isActive) {\n setCustomStatus(customStatus.filter((status) => status !== value))\n } else {\n setCustomStatus([...customStatus, value])\n }\n }\n\n return (\n \n {chipItens.map(({ label, value, icon }) => {\n const isActive = customStatus.includes(value)\n return (\n {\n handleToggleStatus(value, isActive)\n }}\n icon={icon}\n />\n )\n })}\n \n )\n}\n\nexport default FilterChips\n","import styled, { css } from 'styled-components';\nimport { Avatar, IconButton, Typography } from '@material-ui/core';\nimport { StatusColor } from './utils';\n\ninterface StyledTypographyProps {\n statusColor: string;\n}\n\ninterface StatusLabelProps {\n statusLabel: string;\n bold?: boolean;\n}\n\nexport const CardBox = styled.div<{ open: boolean }>`\n padding: ${({ theme }) => theme.spacing(2, 1, 2)};\n /* 25 is the hexadecimal opacity level */\n border-bottom: 2px solid ${({ theme }) => theme.palette.secondary.main}25;\n transition: 0.5s all ease-in-out;\n overflow: hidden;\n\n ${({ open }) =>\n open\n ? css`\n max-height: 2000px;\n background-color: ${({ theme }) =>\n theme.palette.extra.color.grey.light};\n `\n : css`\n max-height: 60px;\n background-color: ${({ theme }) => theme.palette.common.white};\n `}\n`;\n\nexport const UserInfoContainer = styled.div`\n display: flex;\n flex-direction: column;\n`;\n\nexport const ClampedText = styled(Typography)`\n overflow: hidden;\n text-overflow: ellipsis;\n display: -webkit-box;\n -webkit-line-clamp: 1;\n -webkit-box-orient: vertical;\n font-size: clamp(0.95rem, 75%, 2rem);\n`;\n\nexport const UserInfo = styled(ClampedText)`\n color: ${(props) =>\n props.statusLabel === 'INATIVA'\n ? ({ theme }) => theme.palette.extra.color.grey.main\n : ({ theme }) => theme.palette.extra.color.grey.dark};\n`;\n\nexport const PatientName = styled(UserInfo)`\n font-weight: 600;\n`;\n\nexport const RoleTitle = styled(Typography)`\n color: ${(props) =>\n props.statusLabel === 'INATIVA'\n ? ({ theme }) => theme.palette.extra.color.grey.main\n : ({ theme }) => theme.palette.extra.color.grey.dark};\n font-size: clamp(0.85rem, 75%, 2rem);\n display: -webkit-box;\n max-width: 350px;\n -webkit-line-clamp: 1;\n -webkit-box-orient: vertical;\n overflow: hidden;\n`;\n\nexport const RoleTitleContainer = styled.div`\n display: flex;\n align-items: center;\n gap: 10px;\n`;\n\nexport const PatientOverview = styled.div`\n display: flex;\n width: 100%;\n\n &:hover {\n cursor: pointer;\n }\n`;\n\nexport const StyledIconBackground = styled(IconButton)`\n background-color: ${({ theme }) => theme.palette.primary.dark};\n padding: ${({ theme }) => theme.spacing(1)}px;\n border-radius: 10px;\n box-shadow: 0 4px 5px 0.5px\n ${({ theme }) => theme.palette.extra.color.grey.main};\n height: 40px;\n width: 40px;\n\n &:hover {\n background-color: ${({ theme }) => theme.palette.primary.dark};\n }\n`;\n\nexport const StyledTypography = styled(Typography)`\n color: ${(props) => props.statusColor};\n font-size: clamp(0.8rem, 75%, 2rem);\n text-align: right;\n font-weight: 500;\n padding-right: ${({ theme }) => theme.spacing(2)}px;\n`;\n\nexport const AvatarContainer = styled.div`\n display: flex;\n flex-direction: column;\n align-items: center;\n margin-right: ${({ theme }) => theme.spacing(1.5)}px;\n width: 75px;\n`;\n\nexport const BorderedAvatar = styled(Avatar)<{\n borderColor: StatusColor;\n}>`\n box-shadow: 0px 4px 4px rgba(0, 0, 0, 0.25);\n border: 4px solid\n ${({ borderColor }) => {\n switch (borderColor) {\n case 'red':\n return '#f54141';\n case 'yellow':\n return '#fdb62e';\n case 'green':\n return '#1cbc86';\n case 'gray':\n return '#999999';\n }\n }};\n`;\n\nexport const StatusIndicator = styled(ClampedText)<{ badgeColor: StatusColor }>`\n &::before {\n content: '';\n display: inline-block;\n width: 10px;\n height: 10px;\n border-radius: 10px;\n margin-right: ${({ theme }) => theme.spacing(1)}px;\n background-color: ${({ badgeColor }) => {\n switch (badgeColor) {\n case 'red':\n return '#f54141';\n case 'yellow':\n return '#fdb62e';\n case 'orange':\n return '#FF7518'\n case 'green':\n return '#1cbc86';\n case 'gray':\n return '#999999';\n }\n }};\n }\n`;\n","function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\nimport * as React from \"react\";\n\nvar _ref2 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M13.645 1.3551C13.2157 0.925491 12.7059 0.584698 12.1448 0.352186C11.5837 0.119675 10.9823 0 10.375 0C9.76762 0 9.16623 0.119675 8.60514 0.352186C8.04405 0.584698 7.53426 0.925491 7.1049 1.3551L1.35496 7.10563C0.708043 7.75231 0.267451 8.57636 0.0889252 9.47352C-0.0896003 10.3707 0.00196279 11.3006 0.35203 12.1458C0.702098 12.9909 1.29494 13.7131 2.05555 14.2212C2.81616 14.7293 3.71037 15.0003 4.62503 15C5.85097 14.9982 7.02646 14.5116 7.8951 13.6464L13.645 7.89591C14.0746 7.4665 14.4154 6.95667 14.6479 6.39552C14.8803 5.83437 15 5.23291 15 4.6255C15 4.01809 14.8803 3.41663 14.6479 2.85548C14.4154 2.29434 14.0746 1.7845 13.645 1.3551ZM13.0482 7.29899L10.1732 10.1743L4.82678 4.82727L7.70175 1.95117C8.23027 1.42324 8.90325 1.06362 9.63583 0.917651C10.3684 0.771678 11.1278 0.845884 11.8183 1.13091C12.5088 1.41595 13.0994 1.89904 13.5158 2.51929C13.9321 3.13955 14.1555 3.8692 14.1578 4.61625C14.1619 5.11495 14.0658 5.60939 13.8752 6.07024C13.6846 6.53108 13.4034 6.94893 13.0482 7.29899Z\",\n fill: \"white\"\n});\n\nfunction SvgIconPillOutline(_ref, svgRef) {\n var title = _ref.title,\n titleId = _ref.titleId,\n props = _objectWithoutProperties(_ref, [\"title\", \"titleId\"]);\n\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n width: 15,\n height: 15,\n viewBox: \"0 0 15 15\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, _ref2);\n}\n\nvar ForwardRef = /*#__PURE__*/React.forwardRef(SvgIconPillOutline);\nexport default __webpack_public_path__ + \"static/media/icon-pill-outline.43940838.svg\";\nexport { ForwardRef as ReactComponent };","function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\nimport * as React from \"react\";\n\nvar _ref2 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M14.2998 9.27505C14.1165 9.09171 14.0248 8.85838 14.0248 8.57505C14.0248 8.29172 14.1165 8.05838 14.2998 7.87505L16.1748 6.00005H9.99984C9.71651 6.00005 9.47884 5.90405 9.28684 5.71205C9.09484 5.52005 8.99918 5.28272 8.99984 5.00005C8.99984 4.71672 9.09584 4.47905 9.28784 4.28705C9.47984 4.09505 9.71718 3.99938 9.99984 4.00005H16.1748L14.2998 2.12505C14.1165 1.94172 14.0248 1.70405 14.0248 1.41205C14.0248 1.12005 14.1165 0.882715 14.2998 0.700048C14.4832 0.516715 14.7165 0.425049 14.9998 0.425049C15.2832 0.425049 15.5165 0.516715 15.6998 0.700048L19.2998 4.30005C19.3998 4.40005 19.4708 4.50838 19.5128 4.62505C19.5548 4.74172 19.5755 4.86672 19.5748 5.00005C19.5748 5.13338 19.5538 5.25838 19.5118 5.37505C19.4698 5.49172 19.3992 5.60005 19.2998 5.70005L15.6998 9.30005C15.5165 9.48338 15.2832 9.57105 14.9998 9.56305C14.7165 9.55505 14.4832 9.45905 14.2998 9.27505ZM4.29984 15.3L0.699843 11.7C0.599843 11.6 0.528843 11.4917 0.486843 11.375C0.444843 11.2584 0.424509 11.1334 0.425843 11C0.425843 10.8667 0.446843 10.7417 0.488843 10.625C0.530843 10.5084 0.601176 10.4 0.699843 10.3L4.29984 6.70005C4.48318 6.51672 4.71651 6.42505 4.99984 6.42505C5.28318 6.42505 5.51651 6.51672 5.69984 6.70005C5.88318 6.88338 5.97484 7.12105 5.97484 7.41305C5.97484 7.70505 5.88318 7.94238 5.69984 8.12505L3.82484 10H9.99984C10.2832 10 10.5208 10.096 10.7128 10.288C10.9048 10.48 11.0005 10.7174 10.9998 11C10.9998 11.2834 10.9038 11.521 10.7118 11.713C10.5198 11.905 10.2825 12.0007 9.99984 12H3.82484L5.69984 13.875C5.88318 14.0584 5.97484 14.2917 5.97484 14.575C5.97484 14.8584 5.88318 15.0917 5.69984 15.275C5.51651 15.4584 5.28318 15.5544 4.99984 15.563C4.71651 15.5717 4.48318 15.484 4.29984 15.3Z\",\n fill: \"white\"\n});\n\nfunction SvgIconSwitch(_ref, svgRef) {\n var title = _ref.title,\n titleId = _ref.titleId,\n props = _objectWithoutProperties(_ref, [\"title\", \"titleId\"]);\n\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n width: 20,\n height: 16,\n viewBox: \"0 0 20 16\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, _ref2);\n}\n\nvar ForwardRef = /*#__PURE__*/React.forwardRef(SvgIconSwitch);\nexport default __webpack_public_path__ + \"static/media/icon-switch.0124aa2e.svg\";\nexport { ForwardRef as ReactComponent };","function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\nimport * as React from \"react\";\n\nvar _ref2 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M131 131H8V8\",\n stroke: \"white\",\n strokeWidth: 15,\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n});\n\nvar _ref3 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M8 104.094L69.5 46.4375L92.5625 69.5L127.156 34.9062\",\n stroke: \"white\",\n strokeWidth: 15,\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n});\n\nfunction SvgIconGraph(_ref, svgRef) {\n var title = _ref.title,\n titleId = _ref.titleId,\n props = _objectWithoutProperties(_ref, [\"title\", \"titleId\"]);\n\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n width: 139,\n height: 139,\n viewBox: \"0 0 139 139\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, _ref2, _ref3);\n}\n\nvar ForwardRef = /*#__PURE__*/React.forwardRef(SvgIconGraph);\nexport default __webpack_public_path__ + \"static/media/icon_graph.4008da16.svg\";\nexport { ForwardRef as ReactComponent };","function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\nimport * as React from \"react\";\n\nvar _ref2 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M8 0C3.6 0 0 3.6 0 8C0 12.4 3.6 16 8 16C12.4 16 16 12.4 16 8C16 3.6 12.4 0 8 0ZM11.44 10.56L7.2 8.24V4H8.4V7.52L12 9.52L11.44 10.56Z\",\n fill: \"white\"\n});\n\nfunction SvgIconTimeFilled(_ref, svgRef) {\n var title = _ref.title,\n titleId = _ref.titleId,\n props = _objectWithoutProperties(_ref, [\"title\", \"titleId\"]);\n\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n width: 16,\n height: 16,\n viewBox: \"0 0 16 16\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, _ref2);\n}\n\nvar ForwardRef = /*#__PURE__*/React.forwardRef(SvgIconTimeFilled);\nexport default __webpack_public_path__ + \"static/media/icon-time-filled.b6cb2bf5.svg\";\nexport { ForwardRef as ReactComponent };","import { Button, Typography } from '@material-ui/core';\nimport styled from 'styled-components';\nimport { StatusColor } from '../../utils';\n\nexport const ExpandedContentContainer = styled.div`\n margin-top: ${({ theme }) => theme.spacing(1)}px;\n`;\n\nexport const ShortcutsContainer = styled.div`\n display: flex;\n flex-wrap: nowrap;\n overflow-x: auto;\n gap: ${({ theme }) => theme.spacing(1)}px;\n padding-bottom: ${({ theme }) => theme.spacing(1)}px;\n`;\n\nexport const Shortcut = styled(Button)`\n background-color: ${({ theme }) => theme.palette.primary.dark};\n color: ${({ theme }) =>\n theme.palette.getContrastText(theme.palette.primary.dark)};\n min-width: 100px;\n width: fit-content;\n max-width: 120px;\n min-height: 100%;\n padding: ${({ theme }) => theme.spacing(1.5, 1, 1)};\n align-items: inherit;\n\n &:hover {\n background-color: ${({ theme }) => theme.palette.primary.main};\n }\n\n & > .MuiButton-label {\n display: flex;\n flex-direction: column;\n justify-content: start;\n }\n`;\n\nexport const ShortcutIcon = styled.div`\n & > * {\n width: 18px;\n height: 18px;\n }\n`;\n\nexport const ShortcutLabelContainer = styled.div`\n display: flex;\n height: 100%;\n align-items: center;\n`;\n\nexport const ShortcutLabel = styled(Typography)`\n white-space: break-spaces;\n overflow: hidden;\n text-overflow: ellipsis;\n text-align: center;\n display: -webkit-box;\n -webkit-line-clamp: 2;\n -webkit-box-orient: vertical;\n width: 100%;\n word-wrap: break-word;\n hyphens: auto;\n font-size: ${({ theme }) => theme.typography.body2.fontSize};\n`;\n\nexport const CardSectionContainer = styled.div`\n border-radius: 10px;\n overflow: hidden;\n`;\n\nexport const CardSectionHeader = styled.div`\n background-color: ${({ theme }) => theme.palette.primary.dark};\n display: flex;\n justify-content: space-between;\n padding: ${({ theme }) => theme.spacing(0, 2)};\n`;\n\nexport const CardSectionTitle = styled(Typography)`\n font-weight: ${({ theme }) => theme.typography.fontWeightBold};\n font-size: ${({ theme }) => theme.typography.body1.fontSize};\n color: ${({ theme }) =>\n theme.palette.getContrastText(theme.palette.primary.dark)};\n`;\n\nexport const CardSectionContent = styled.div`\n background-color: ${({ theme }) => theme.palette.background.paper};\n padding: ${({ theme }) => theme.spacing(1, 2)};\n`;\n\nexport const CardSectionFooter = styled.div`\n display: flex;\n justify-content: center;\n background-color: ${({ theme }) => theme.palette.background.paper};\n padding: ${({ theme }) => theme.spacing(0, 2)};\n border-top: solid 1px ${({ theme }) => theme.palette.primary.dark}55;\n`;\n\nexport const StatusIndicator = styled(Typography)<{ badgeColor: StatusColor }>`\n font-weight: ${({ theme }) => theme.typography.fontWeightBold};\n font-size: ${({ theme }) => theme.typography.body2.fontSize};\n color: ${({ theme }) =>\n theme.palette.getContrastText(theme.palette.primary.dark)};\n display: flex;\n align-items: center;\n\n &::before {\n content: '';\n display: inline-block;\n width: 10px;\n height: 10px;\n border-radius: 10px;\n margin-right: ${({ theme }) => theme.spacing(1)}px;\n\n background-color: ${({ badgeColor }) => {\n switch (badgeColor) {\n case 'red':\n return '#f54141';\n case 'yellow':\n return '#fdb62e';\n case 'green':\n return '#1cbc86';\n case 'gray':\n return '#999999';\n }\n }};\n }\n`;\n","import React, { useEffect, useState } from 'react'\nimport { DayHistoryContainer, DayHistoryHeader, DayHistoryBody, EventListItem, EventTime, EventStatusIcon, EventCategoryIcon, EventTitle, DayMessage, EventCardPopUp } from '../../../../pages/Follow/CareHistory/styles'\nimport { categoryIdMapper } from '../../../ShiftEventList/utils'\nimport { EventModel, EventSubCategoryModel } from '@cuidador/database'\nimport { parseISO, intlFormat, isBefore, isAfter, startOfDay } from 'date-fns'\nimport { capitalize } from 'lodash'\n\nimport IconAccomplished from '../../../../assets/Icon-flat-accomplished.svg'\nimport IconAccomplishedWarning from '../../../../assets/icon-flat-accomplished-warning.svg'\nimport IconAppointment from '../../../../assets/Icon-flat-appointment.svg'\nimport IconAwaiting from '../../../../assets/Icon-flat-awaiting.svg'\nimport IconComplication from '../../../../assets/Icon-flat-complication.svg'\nimport IconMeasurement from '../../../../assets/Icon-flat-measurement.svg'\nimport IconMedication from '../../../../assets/Icon-flat-medication.svg'\nimport IconNotAccomplished from '../../../../assets/Icon-flat-not-accomplished.svg'\nimport IconRoutine from '../../../../assets/Icon-flat-routine.svg'\nimport { RenderActivityCardByEvent } from '../../../ShiftEventList'\n\nconst resolveCategoryIcon = (event: EventModel) => {\n const subCategory = event.subCategory as EventSubCategoryModel\n switch (subCategory.categoryId) {\n case categoryIdMapper.MEDICATION:\n return IconMedication\n case categoryIdMapper.MEASUREMENT:\n return IconMeasurement\n case categoryIdMapper.COMPLICATION:\n return IconComplication\n case categoryIdMapper.GENERAL:\n return subCategory.isRoutine ? IconRoutine : IconAppointment\n }\n}\n\nconst resolveStatusIcon = (event: EventModel) => {\n const subCategory = event.subCategory as EventSubCategoryModel\n switch (event.status) {\n case 'accomplished':\n if (subCategory.categoryId === categoryIdMapper.COMPLICATION || event.measurement?.isDangerousComplication) {\n return IconAccomplishedWarning\n } else {\n return IconAccomplished\n }\n case 'not_accomplished':\n return IconNotAccomplished\n default:\n return IconAwaiting\n }\n}\n\nconst formatTimelineDate = (\n date: string | null | undefined,\n format: 'weekday' | 'month' | 'day_number' | 'time' | 'year',\n) => {\n if (!date) return 'Data inválida'\n\n const zonedDate = parseISO(date)\n\n switch (format) {\n case 'weekday':\n return capitalize(\n intlFormat(\n zonedDate,\n { weekday: 'long' },\n { locale: navigator.language },\n ),\n )\n case 'month':\n return capitalize(\n intlFormat(\n zonedDate,\n { month: '2-digit' },\n { locale: navigator.language },\n ),\n )\n case 'year':\n return capitalize(\n intlFormat(\n zonedDate,\n { year: 'numeric' },\n { locale: navigator.language },\n ),\n )\n case 'day_number':\n return intlFormat(\n zonedDate,\n { day: '2-digit' },\n { locale: navigator.language },\n )\n case 'time':\n return intlFormat(\n zonedDate,\n { hour: '2-digit', minute: '2-digit' },\n { locale: navigator.language },\n )\n default:\n return 'Formato inválido'\n }\n}\n\nexport type EventDate = {\n date: string\n events: Event[]\n}\n\ntype Event = {\n id: number\n name: string\n description: string\n eventHappensAt: string\n eventNotifiedAt: any\n status: string\n subCategoryId: number\n patientId: number\n eventScheduleId: number\n shiftId: any\n isDeleted: number\n createdAt: string\n updatedAt: string\n medicationId?: number\n measurementId: any\n isResolved: number\n startingSoonNotificationSent: number\n updatedTimeHappensAt: any\n comment: any\n shiftExecutionId: any\n caregiverId: any\n categoryId?: number\n category: any\n measurement: any\n caregiver: any\n subCategory: SubCategory\n medication?: Medication\n}\n\ntype SubCategory = {\n id: number\n categoryId: number\n name: string\n isRoutine: number\n isAppointment: number\n isDeleted: number\n createdAt: string\n updatedAt: string\n isEditDisabled: number\n medicationCatalogItem?: MedicationCatalogItem\n}\n\ntype MedicationCatalogItem = {\n eventSubCategoryId: number\n barcode: string\n name: string\n description: string\n}\n\ntype Medication = {\n id: number\n dosageDescription: any\n medicalNotes: string\n dosageQuantity: number\n dosageFormat: string\n administeredBy: string\n subCategoryId: number\n isDeleted: number\n createdAt: string\n updatedAt: string\n eventScheduleId: number\n patientId: number\n ifNecessary: number\n previousId: number\n updatedBy: any\n}\n\n\ntype EvolutionListProps = {\n eventData: EventDate[]\n onOccurrencesUpdate?: (occurrencesOfPatient?: number[]) => void\n fromDate: Date\n toDate: Date\n}\n\nexport const getFilteredEventsByOccurrences = (events: Event[], fromDate: Date , toDate: Date) => {\n const eventsResult: Event[] = []\n const occurrences = [0, 0, 0, 0, 0]\n\n events.forEach(event => {\n if (event.subCategory.categoryId === 3) {\n eventsResult.push(event)\n occurrences[0] += 1\n }\n if (event.medication) {\n if (event.status === 'not_accomplished') {\n eventsResult.push(event)\n occurrences[1] += 1\n } else if (event.status === 'awaiting' && (isBefore(parseISO(event.eventHappensAt), new Date()) && isAfter(parseISO(event.eventHappensAt), startOfDay(fromDate)))) {\n eventsResult.push(event)\n occurrences[1] += 1\n } else if (event.status === 'accomplished' && isBefore(parseISO(event.eventHappensAt), parseISO(event.updatedTimeHappensAt))) {\n eventsResult.push(event)\n occurrences[1] += 1\n }\n }\n if (event.measurement?.complicationLevel && Math.abs(event.measurement?.complicationLevel) > 1) {\n eventsResult.push(event)\n occurrences[2] += 1\n }\n if (event.subCategory.categoryId === 1 && !event.subCategory.isRoutine) {\n eventsResult.push(event)\n occurrences[4] += 1\n }\n })\n\n return { eventsResult, occurrences }\n}\n\nexport const getFormattedEventDate = (eventData: EventDate[], fromDate: Date , toDate: Date): { formattedEventData: EventDate[], occurrencesFormatted: number[] } => {\n const formattedEventData: EventDate[] = []\n let occurrencesFormatted: number[] = [0, 0, 0, 0, 0]\n\n if (eventData) {\n for (var i = 0; i < eventData.length; i++) {\n const currEventData = eventData[i]\n const { eventsResult, occurrences } = getFilteredEventsByOccurrences(currEventData.events, fromDate, toDate)\n\n occurrencesFormatted.forEach((val, idx) => {\n occurrencesFormatted[idx] = val + occurrences[idx]\n })\n formattedEventData.push({ date: currEventData.date, events: eventsResult })\n }\n }\n\n return { formattedEventData, occurrencesFormatted }\n}\n\nexport function EvolutionList (props: EvolutionListProps) {\n const { eventData, onOccurrencesUpdate, fromDate, toDate } = props\n const [formattedEventData, setFormattedData] = useState([])\n const [activePopUpEvent, setActivePopUpEvent] = useState(\n null,\n )\n\n\n useEffect(() => {\n const { formattedEventData, occurrencesFormatted } = getFormattedEventDate(eventData, fromDate, toDate)\n setFormattedData(formattedEventData)\n onOccurrencesUpdate?.(occurrencesFormatted)\n }, [])\n\n return (\n
    \n {formattedEventData?.map((dayHistory: any, dayHistoryIndex: number) => (\n \n \n\n {formatTimelineDate(dayHistory.date, 'day_number')}/{formatTimelineDate(dayHistory.date, 'month')}/{formatTimelineDate(dayHistory.date, 'year')}\n \n \n {dayHistory.events && dayHistory.events.length > 0 ? (\n dayHistory.events.map((event: any) => (\n setActivePopUpEvent(event)}\n style={{ marginBlock: '8px', columnGap: '2px' }}\n >\n \n {formatTimelineDate(\n event.updatedTimeHappensAt || event.eventHappensAt,\n 'time',\n )}\n \n \n \n \n {event.subCategory?.name ?? ''}\n {event.subCategory?.categoryId ===\n categoryIdMapper.MEASUREMENT &&\n event.measurement?.measurementValue &&\n ` - (${event.measurement?.measurementValue})`}\n \n \n ))\n ) : (\n Sem registros\n )}\n \n \n ))}\n {activePopUpEvent && (\n setActivePopUpEvent(null)}\n data-testid={`eventCardPopUp-${activePopUpEvent.id}`}\n >\n {RenderActivityCardByEvent(activePopUpEvent)}\n \n )}\n
    \n )\n}\n","import { Button, CircularProgress, Typography } from '@material-ui/core'\nimport React, { useEffect } from 'react'\nimport { CardSectionContainer, CardSectionHeader, CardSectionTitle, CardSectionContent, CardSectionFooter } from './styles'\nimport { Shift } from '@cuidador/database'\nimport { useAsync } from 'react-async-hook'\nimport axios from '../../../../config/axios'\nimport { EvolutionList } from './EvolutionList'\nimport { endOfDay, startOfDay } from 'date-fns'\n\ntype EvolutionContentProps = {\n id: number\n active: boolean | undefined\n shifts: Shift[] | undefined\n handleChangeActivePatient: (patientId: number, pageRedirectRoute: string, isPatientActive?: boolean) => Promise\n fromDate?: Date\n toDate?: Date\n isLoading?: boolean\n onOccurrencesUpdate?: (occurrencesOfPatient?: number[]) => void\n onLoadChange?: (isLoading: boolean) => void\n}\n\nexport function EvolutionContent (props: EvolutionContentProps) {\n const { id, active, shifts, handleChangeActivePatient, fromDate, toDate, isLoading, onOccurrencesUpdate, onLoadChange } = props\n\n const fromDateString = fromDate\n ? 'updatedTimeHappensAt[min]=' + startOfDay(fromDate)?.toISOString()\n : ''\n const toDateString = toDate\n ? 'updatedTimeHappensAt[max]=' + endOfDay(toDate)?.toISOString()\n : ''\n\n const getEvents = useAsync(async () => {\n return await axios.get(\n `${process.env.REACT_APP_GATEWAY_URL}/api/v1/report/event/history/${id}?${fromDateString}&${toDateString}`\n )\n }, [fromDate, toDate])\n\n useEffect(() => {\n onLoadChange?.(getEvents.loading)\n }, [getEvents.loading])\n\n return (\n
    \n \n \n Painel de ocorrências\n \n \n {(getEvents.result?.data.length > 0 && !getEvents.loading) && fromDate && toDate &&\n \n }\n {getEvents.result?.data.length === 0 && Sem eventos para o período selecionado}\n {(getEvents.loading) && }\n {getEvents.error && Não foi possível carregar os dados}\n \n \n \n \n \n
    \n )\n}\n","import React, { useContext } from 'react'\nimport { ReactComponent as IconCheck } from '../../../../assets/Icon-check-circle.svg'\nimport { ReactComponent as IconPill } from '../../../../assets/icon-pill-outline.svg'\nimport { ReactComponent as IconSwitch } from '../../../../assets/icon-switch.svg'\nimport { ReactComponent as IconGraph } from '../../../../assets/icon_graph.svg'\nimport { ReactComponent as IconLink } from '../../../../assets/link-icon.svg'\nimport { ReactComponent as IconClock } from '../../../../assets/icon-time-filled.svg'\nimport usePatient from '../../../../hooks/usePatient'\nimport { AuthContext } from '../../../../contexts/auth'\nimport {\n ShortcutLabelContainer,\n ExpandedContentContainer,\n Shortcut,\n ShortcutIcon,\n ShortcutLabel,\n ShortcutsContainer,\n CardSectionContainer,\n CardSectionTitle,\n CardSectionHeader,\n CardSectionContent,\n StatusIndicator,\n CardSectionFooter,\n} from './styles'\nimport { toast } from 'react-toastify'\nimport { useHistory } from 'react-router-dom'\nimport { AssignmentOutlined } from '@material-ui/icons'\nimport { clientSideScheme } from '@cuidador/whitelabel'\nimport { Shift } from '@cuidador/database'\nimport {\n getShiftExecutions,\n resolveShiftStatus,\n resolveShiftStatusColor,\n resolveShiftStatusLabel,\n} from '../../utils'\nimport { getShiftExecutionRealTime } from '../../../ShiftsHistory/utils'\nimport { sortBy } from 'lodash'\nimport { Button, Typography } from '@material-ui/core'\nimport { StyledHrefLink } from '../../../SideMenu/styles'\nimport { EvolutionContent } from './EvolutionContent'\n\ninterface ShortcutProps {\n label: string\n icon: JSX.Element\n handleClickItem: () => void\n}\n\ninterface ExpandedContentProps {\n id: number\n active: boolean | undefined\n shifts: Shift[] | undefined\n fromDate?: Date\n toDate?: Date\n isLoading?: boolean\n onOccurrencesUpdate?: (occurrencesOfPatient?: number[]) => void\n onLoadChange?: (isLoading: boolean) => void\n}\n\nconst ExpandedContent: React.FC = ({\n id,\n active,\n shifts,\n fromDate,\n toDate,\n isLoading,\n onOccurrencesUpdate,\n onLoadChange\n}: ExpandedContentProps) => {\n const { setActive } = usePatient()\n const { userInfo, refreshUserInfo } = useContext(AuthContext)\n const history = useHistory()\n const { appCUrl } = clientSideScheme()\n const hasCaregiverAppAccess = userInfo?.user?.role?.caregiverAppAccess\n\n const shiftStatusLabel = resolveShiftStatusLabel(shifts)\n const shiftStatus = resolveShiftStatus(shifts)\n const shiftExecutions = getShiftExecutions(shifts)\n\n const shortcuts: ShortcutProps[] = [\n {\n label: 'Cuidados',\n icon: ,\n handleClickItem: () => handleChangeActivePatient(id, '/acompanhar', active),\n },\n\n {\n label: 'Cadastros',\n icon: ,\n handleClickItem: () => handleChangeActivePatient(id, '/cadastros', active),\n },\n {\n label: 'Medica-mentos',\n icon: ,\n handleClickItem: () => handleChangeActivePatient(id, '/medicamentos', active),\n },\n {\n label: 'Evolução',\n icon: ,\n handleClickItem: () => handleChangeActivePatient(id, '/acompanhar/evolucao', active),\n },\n {\n label: 'Vincular',\n icon: ,\n handleClickItem: () => handleChangeActivePatient(id, `/organizacao/paciente/${id}`, active),\n },\n {\n label: 'Relatórios',\n icon: ,\n handleClickItem: () => handleChangeActivePatient(id, '/acompanhar/relatorios', active),\n },\n ]\n\n const handleChangeActivePatient = async (\n patientId: number,\n pageRedirectRoute: string,\n isPatientActive?: boolean,\n ) => {\n try {\n if (!isPatientActive) {\n await setActive(patientId)\n await refreshUserInfo()\n }\n history.push(pageRedirectRoute)\n } catch (err) {\n toast.error(err)\n }\n }\n\n return (\n \n \n {shortcuts.map((shortcut) => (\n \n {shortcut.icon}\n \n {shortcut.label}\n \n \n ))}\n {Boolean(hasCaregiverAppAccess) && (\n \n \n \n \n \n \n Trocar de app\n \n \n \n )}\n \n \n \n Plantão\n \n {shiftStatus}\n \n \n \n {!!shiftExecutions && shiftExecutions.length > 0 ? (\n sortBy(\n shiftExecutions,\n (item) => item.startedAt ?? item.createdAt,\n ).map((execution) => (\n \n {getShiftExecutionRealTime(execution)}\n {' | '}\n {execution.caregiver?.user?.name}\n \n ))\n ) : (\n \n {shiftStatus === 'Atrasado' &&\n 'Este plantão ainda não foi iniciado'}\n {shiftStatus === 'Sem plantão' &&\n 'Não há nenhum plantão cadastrado para este horário'}\n \n )}\n \n \n {['Sem plantão', 'Atrasado'].includes(shiftStatus) ? (\n \n ) : (\n \n )}\n \n \n \n \n )\n}\n\nexport default ExpandedContent\n","import { IconButton } from '@material-ui/core';\nimport { Group as GroupIcon, KeyboardArrowDown } from '@material-ui/icons';\nimport styled, { css } from 'styled-components';\nimport { ReactComponent as GraphIcon } from '../../../assets/icon_graph.svg';\n\nexport const StyledGroupIcon = styled(GroupIcon)`\n width: 20px;\n height: 20px;\n`;\n\nexport const StyledGraphIcon = styled(GraphIcon)`\n width: 15px;\n height: 15px;\n`;\n\nexport const ExpandButton = styled(IconButton)`\n width: 70px;\n height: 70px;\n`;\n\nexport const StyledArrow = styled(KeyboardArrowDown)<{ isExpanded: boolean }>`\n width: 100%;\n height: 40px;\n transition: all 0.25s ease-in-out;\n\n ${({ isExpanded }) =>\n isExpanded\n ? css`\n transform: rotate(180deg);\n `\n : css`\n transform: rotate(0deg);\n `}\n`;\n\nexport const Row = styled.div`\n display: flex;\n`;\n","import { CircularProgress } from '@material-ui/core'\nimport React from 'react'\nimport { PatientEventFilter } from '../../hooks/usePatient'\n\nexport type MedicationStaturCardProps = {\n icon: string\n title?: string\n color: string\n value?: number\n isSmall?: boolean\n isLoading?: boolean\n onFilter?: (value?: string) => void\n filterType?: PatientEventFilter\n selected?: boolean\n}\n\nexport default function MedicationStatusCard(props: MedicationStaturCardProps) {\n const { icon, title, color, value, isSmall, isLoading, onFilter, filterType, selected } = props\n\n if (isSmall) {\n const smallBoxCssStyle = {\n display: 'flex',\n width: '56px',\n height: '24px',\n backgroundColor: color,\n gap: '8px',\n justifyContent: 'center',\n alignItems: 'center',\n color: 'white',\n fontFamily: 'Work Sans',\n borderRadius: 'var(--sm, 8px)',\n }\n\n return (\n
    \n
    \n
    \n \n \n {isLoading && }\n {!isLoading && (value !== undefined ? value : '-')}\n
    \n
    \n
    \n \n )\n } else {\n const boxCssStyle = {\n display: 'flex',\n width: '88px',\n minWidth: '88px',\n height: '76px',\n padding: '8px',\n backgroundColor: color,\n gap: '8px',\n color: 'white',\n fontFamily: 'Work Sans',\n borderRadius: 'var(--sm, 8px)',\n cursor: isLoading ? 'wait' : 'pointer',\n }\n\n return (\n
    onFilter?.(String(filterType))}>\n
    \n \n
    \n \n \n {isLoading && }\n {!isLoading && (value !== undefined ? value : '-')}\n
    \n
    \n {selected && }\n
    \n \n {title}\n \n \n \n )\n }\n}\n","import { Shift } from '@cuidador/database'\nimport React, { useEffect, useState } from 'react'\nimport {\n AvatarContainer,\n BorderedAvatar,\n CardBox,\n PatientOverview,\n StatusIndicator,\n PatientName,\n UserInfoContainer,\n ClampedText,\n} from '../styles'\nimport {\n resolvePatientStatusColor,\n resolvePatientStatusLabel,\n resolveShiftStatusColor,\n resolveShiftStatusLabel,\n} from '../utils'\nimport ExpandedContent from './ExpandedContent'\nimport { ExpandButton, Row, StyledArrow } from './styles'\nimport MedicationStatusCard from '../../MedicationStatus'\nimport Occurrences from '../../../assets/Occurrences.json'\n\nexport type PatientSelectCardProps = {\n id: number\n name: string\n age: number\n profilePictureURL?: string\n status: string\n isNew: number\n shifts?: Shift[]\n active?: boolean\n handleClick?: (id: number) => void\n loadingOccurrences?: boolean\n fromDate?: Date\n toDate?: Date\n onOccurrencesUpdate?: (occurrencesOfPatient: number[]) => void\n onLoadChange?: (isLoading: boolean) => void\n}\n\nexport function PatientSelectCard (props: PatientSelectCardProps) {\n const { id, name, age, profilePictureURL, status, isNew, active, shifts, handleClick, loadingOccurrences, fromDate, toDate, onOccurrencesUpdate, onLoadChange } = props\n const [isExpanded, setIsExpanded] = useState(false)\n const [occurrencesOfPatient, setOccurrencesOfPatient] = useState([0, 0, 0, 0, 0])\n\n const handleExpand = (e: React.MouseEvent) => {\n e.stopPropagation()\n setIsExpanded((state) => !state)\n }\n\n const patientStatusLabel = resolvePatientStatusLabel(status, isNew)\n const shiftStatusLabel = resolveShiftStatusLabel(shifts)\n\n const handleOccurrences = (occurrences?: number[] | undefined) => {\n if (occurrences) {\n setOccurrencesOfPatient(occurrences)\n onOccurrencesUpdate?.(occurrences)\n }\n }\n\n return (\n \n \n {\n if (handleClick) handleClick(id)\n }}\n >\n \n \n {age} anos\n \n \n \n {name}\n \n\n {patientStatusLabel !== 'INATIVA' && (\n \n {shiftStatusLabel}\n \n )}\n \n {Occurrences.map((item, index) =>\n (index != 3 && Boolean(occurrencesOfPatient?.[index] || loadingOccurrences) && ),\n )}\n \n \n \n \n \n \n \n \n \n )\n}\n","import { toast } from 'react-toastify';\nimport { differenceInYears } from 'date-fns';\nimport { AxiosResponse } from 'axios';\n\nexport function getAge(dateOfBirth = '') {\n return differenceInYears(new Date(), new Date(dateOfBirth));\n}\n\nexport const handleGetProfilePictureURL = async (\n id: number,\n getProfilePictureFn: (\n id: number\n ) => Promise<\n AxiosResponse<{\n signedUrl: string;\n }>\n >\n) => {\n try {\n return await getProfilePictureFn(id).then(\n ({ data: { signedUrl } }) => signedUrl\n );\n } catch (err) {\n // ignore patient without profile picture error\n if (!String(err).includes('404')) toast.error(err);\n }\n};\n","import React from 'react'\nimport { Fab, useTheme } from '@material-ui/core'\n\ntype FabStyledProps = {\n children: JSX.Element\n onClick: () => void\n color?: string\n backgroundColor?: string\n borderColor?: string\n bottom?: number\n}\n\nexport function FabStyled (props: FabStyledProps) {\n const { children, onClick, color, backgroundColor, borderColor, bottom = 10 } = props\n const theme = useTheme()\n\n return (\n \n {children}\n \n )\n}\n","import { PatientModel } from '@cuidador/database'\nimport { resolveShiftStatusLabel } from '../../components/SelectCard/utils'\n\nexport type PatientListOccurrences = { patientId: number; occurrencesOfPatient: number[] }[]\n\nexport function getFilteredPatientList (patientList: PatientModel[], occurrences: PatientListOccurrences, filter: string | null): PatientModel[] {\n let listResult: PatientModel[] = []\n\n switch(filter){\n case 'plan_atrasado': {\n listResult = patientList.filter(patient => resolveShiftStatusLabel(patient.shifts) === 'Atrasado' && patient.status === 'enabled')\n break\n }\n case 'intercorrencia': {\n const patientIds = occurrences.filter(occurrence => occurrence.occurrencesOfPatient[0]).map(item => item.patientId)\n listResult = patientList.filter(patient => patientIds.find(patientId => patientId === patient.id))\n break\n }\n case 'med_fora_do_horario': {\n const patientIds = occurrences.filter(occurrence => occurrence.occurrencesOfPatient[1]).map(item => item.patientId)\n listResult = patientList.filter(patient => patientIds.find(patientId => patientId === patient.id))\n break\n }\n case 'med_alterada': {\n const patientIds = occurrences.filter(occurrence => occurrence.occurrencesOfPatient[2]).map(item => item.patientId)\n listResult = patientList.filter(patient => patientIds.find(patientId => patientId === patient.id))\n break\n }\n case 'compromisso': {\n const patientIds = occurrences.filter(occurrence => occurrence.occurrencesOfPatient[4]).map(item => item.patientId)\n listResult = patientList.filter(patient => patientIds.find(patientId => patientId === patient.id))\n break\n }\n default:\n listResult = patientList\n break\n }\n return listResult\n}\n","import { Button } from '@material-ui/core'\nimport React from 'react'\n\ntype PaginationProps = {\n count: number\n page: number\n onChange: (newPage: number) => void\n}\n\nconst MAX_PAGES = 3\n\nexport function Pagination (props: PaginationProps) {\n const { count, page, onChange } = props\n const pagesArr = Array.from(Array(count), (_, i) => i + 1)\n let visibleArr: number[] = []\n const halfMax = MAX_PAGES / 2\n\n if (page === 1) {\n visibleArr = pagesArr.filter(n => n <= MAX_PAGES)\n } else if (page === count) {\n visibleArr = pagesArr.filter(n => n > count - MAX_PAGES)\n } else {\n visibleArr = pagesArr.filter(n => n >= page - halfMax && n < page + halfMax)\n }\n\n\n return (\n
    \n {count > MAX_PAGES && page > Math.ceil(halfMax) &&\n onChange(page - Math.ceil(halfMax))}\n >\n ...\n \n }\n {visibleArr.map((n) => (\n onChange(n)} variant={page === n ? 'outlined' : 'text'}\n >\n {n}\n \n ))}\n {count > MAX_PAGES && page < (count - Math.floor(halfMax))&&\n onChange(page + Math.ceil(halfMax))}\n >\n ...\n \n }\n
    \n )\n}\n","import React, { useContext, useEffect, useMemo, useState } from 'react'\nimport { useHistory } from 'react-router-dom'\nimport { toast } from 'react-toastify'\nimport qs from 'query-string'\nimport { AxiosResponse } from 'axios'\nimport { PatientModel } from '@cuidador/database'\nimport { AddRounded, Today } from '@material-ui/icons'\nimport usePatient, { CustomStatus, GetPatientPaginatedRequestParams, PatientEventFilter, PatientQueryType } from '../../../hooks/usePatient'\nimport useCanAccess from '../../../hooks/useCanAccess'\nimport { AuthContext } from '../../../contexts/auth'\nimport { Item } from '../../../utils/store'\nimport { handleGetProfilePictureURL } from '../../Organization/utils'\nimport LoadingBackdrop from '../../../components/LoadingBackdrop'\nimport FilterChips from '../../Patient/PatientSelect/Patients/FilterChips'\nimport { Container, FormControl, Grid, MenuItem, Select, Typography, useTheme } from '@material-ui/core'\nimport { PatientSelectCard } from '../../../components/SelectCard/Patient'\nimport { getAge } from '../../Patient/PatientSelect/utils'\nimport { FabStyled } from '../../../components/FabStyled'\nimport { SearchTextField } from '../../../components/SearchTextField'\nimport MedicationStatusCard from '../../../components/MedicationStatus/MedicationStatusCard'\nimport Occurrences from '../../../assets/Occurrences.json'\nimport { endOfDay, startOfDay } from 'date-fns'\nimport axios from '../../../config/axios'\nimport { DatePicker } from '@material-ui/pickers'\nimport { resolveShiftStatusLabel } from '../../../components/SelectCard/utils'\nimport { PatientListOccurrences, getFilteredPatientList } from '../../../utils/patients/filteretPatientList'\nimport { Pagination } from '../../../components/Pagination'\nimport { EventDate, getFilteredEventsByOccurrences } from '../../../components/SelectCard/Patient/ExpandedContent/EvolutionList'\nimport { useAsync } from 'react-async-hook'\nimport { auth } from '../../../config/firebase';\n\nexport function PatientsList () {\n const [page, setPage] = useState(1)\n const [pageSize, setPageSize] = useState(10)\n const [patientListFilter, setPatientListFilter] = useState('all')\n const [patients, setPatients] = useState([])\n const [allPatients, setAllPatients] = useState([])\n const [patientIdToProfilePictureURL, setPatientIdToProfilePictureURL] = useState>({})\n const [customStatus, setCustomStatus] = useState(['enabled', 'pending'])\n const [patientQueryType, setPatientQueryType] = useState(undefined)\n const [isLoadingOccurrences, setIsLoadingOccurrences] = useState(false)\n const [genericOccurrences, setGenericOccurrences] = useState([0, 0, 0, 0, 0])\n const [fromDate, setFromDate] = useState(new Date())\n const [toDate, setToDate] = useState(new Date())\n const [shouldUpdate, setShouldUpdate] = useState(false)\n const [patientOccurrencesList, setPatientOccurrencesList] = useState([])\n\n const history = useHistory()\n const theme = useTheme()\n const { getRelatedPatientsPaginated, getOrganizationPatientsPaginated, getProfilePicture, loading: loadingPatient, total, setActive } = usePatient()\n const { isAllowedToRead: isAllowedToReadProfilePicture } = useCanAccess('media/profile-picture')\n const { isAllowedToCreate: canCreatePatient, isAllowedToRead: isAllowedToReadRelatedPatient } = useCanAccess('user/patient')\n const { isAllowedToRead: isAllowedToReadOrganizationPatient } = useCanAccess('user/patient.by-organization')\n const { userInfo, refreshUserInfo, loading: loadingAuth } = useContext(AuthContext)\n\n const activePatient = userInfo?.activePatient\n const historyLocationSearch = history.location.search\n\n useEffect(() => {\n if (!isAllowedToReadRelatedPatient) {\n if (!isAllowedToReadOrganizationPatient) {\n toast.error('Você não tem permissão para visualizar essa página')\n history.push('/cadastros')\n return\n } else {\n // Forces query type to organization (which is enabled by isAllowedToReadOrganizationPatient)\n setPatientQueryType('organizationPatients')\n }\n } else {\n setPatientQueryType('relatedPatients')\n }\n makeFetchAllPatients(getRelatedPatientsPaginated)\n }, [])\n\n useEffect(() => {\n handleGetPatients()\n refreshUserInfo()\n }, [page, customStatus, patientQueryType, historyLocationSearch, patientListFilter, shouldUpdate])\n\n useEffect(() => {\n if (page !== 1) {\n setPage(1)\n } else {\n setShouldUpdate(!shouldUpdate)\n }\n }, [fromDate, toDate, pageSize])\n\n useEffect(() => {\n setPatientOccurrencesList([])\n setGenericOccurrences([0, 0, 0, 0, 0])\n }, [fromDate, toDate, allPatients, patients])\n\n useAsync(async () => {\n if (patients.length > 0) {\n setIsLoadingOccurrences(true)\n const patientListTotalOccurrences = [0, 0, 0, 0, 0]\n const patientTotalOccurrencesList: PatientListOccurrences = []\n await Promise.all(patients.map(async (patient) => {\n const fromDateString = fromDate\n ? 'updatedTimeHappensAt[min]=' + startOfDay(fromDate)?.toISOString()\n : ''\n const toDateString = toDate\n ? 'updatedTimeHappensAt[max]=' + endOfDay(toDate)?.toISOString()\n : ''\n const patientTotalOccurrences = [0, 0, 0, 0, 0]\n\n const patientEventDates: EventDate[] = (await axios.get(`${process.env.REACT_APP_GATEWAY_URL}/api/v1/report/event/history/${patient.id}?${fromDateString}&${toDateString}`))?.data\n for (let i = 0; i < patientEventDates.length; i++) {\n const patientOccurrences = getFilteredEventsByOccurrences(patientEventDates[i].events, fromDate, toDate).occurrences\n patientOccurrences.forEach((val, idx) => {\n patientTotalOccurrences[idx] += val\n })\n }\n\n patientTotalOccurrences.forEach((val, idx) => {\n patientListTotalOccurrences[idx] += Number(Boolean(val))\n })\n\n patientTotalOccurrencesList.push({ patientId: patient.id!, occurrencesOfPatient: patientTotalOccurrences})\n }))\n\n setPatientOccurrencesList(patientTotalOccurrencesList)\n console.log(patientOccurrencesList)\n setGenericOccurrences(patientListTotalOccurrences)\n setIsLoadingOccurrences(false)\n }\n }, [fromDate, toDate, patients])\n\n const isPatientQueryTypeToogleable = useMemo(() => {\n return isAllowedToReadOrganizationPatient && isAllowedToReadRelatedPatient\n }, [isAllowedToReadOrganizationPatient, isAllowedToReadRelatedPatient])\n\n const handleGetPatients = () => {\n if (patientQueryType === undefined) {\n // Not ready yet\n return\n }\n if (patientQueryType === 'relatedPatients') {\n return handleGetRelatedPatientsPaginated()\n } else {\n return handleGetPatientsOrganizationPaginated()\n }\n }\n\n const handleTogglePatientQueryType = () => {\n if (!isPatientQueryTypeToogleable) {\n return\n }\n setPatientQueryType((currentPatientQueryType) =>\n currentPatientQueryType === 'organizationPatients'\n ? 'relatedPatients'\n : 'organizationPatients',\n )\n }\n\n const makeFetchPatients = (\n fetchFn: (\n params: GetPatientPaginatedRequestParams\n ) => Promise[]\n total: number\n }>>,\n ) => {\n const params = qs.parse(historyLocationSearch)\n fetchFn({ ...params, customStatus, page: 0, orderBy: 'name', limit: 999999 })\n .then(async (response) => {\n const patientsToInsert = response.data.results\n for (const patient of patientsToInsert) {\n if (!patient.id || !isAllowedToReadProfilePicture) return\n handleGetProfilePictureURL(patient.id, getProfilePicture).then(\n (url) => {\n if (!url) return\n setPatientIdToProfilePictureURL((previousMap) => {\n if (!patient.id) return { ...previousMap }\n const newMap = { ...previousMap }\n newMap[patient.id] = url\n return newMap\n })\n },\n )\n }\n\n const fullList = getFilteredPatientList(patientsToInsert, patientOccurrencesList, patientListFilter)\n setPatients(fullList)\n })\n .catch((e) => {\n toast.error(e)\n })\n }\n\n const makeFetchAllPatients = (\n fetchFn: (\n params: GetPatientPaginatedRequestParams\n ) => Promise[]\n total: number\n }>>,\n ) => {\n const params = qs.parse(historyLocationSearch)\n fetchFn({ ...params, customStatus, orderBy: 'name', limit: pageSize, page: page - 1 })\n .then((response) => {\n const patientsToInsert = response.data.results\n for (const patient of patientsToInsert) {\n if (!patient.id || !isAllowedToReadProfilePicture) return\n handleGetProfilePictureURL(patient.id, getProfilePicture).then(\n (url) => {\n if (!url) return\n setPatientIdToProfilePictureURL((previousMap) => {\n if (!patient.id) return { ...previousMap }\n const newMap = { ...previousMap }\n newMap[patient.id] = url\n return newMap\n })\n },\n )\n }\n setAllPatients(patientsToInsert)\n })\n .catch((e) => {\n toast.error(e)\n })\n }\n\n const handleGetPatientsOrganizationPaginated = () => {\n makeFetchPatients(getOrganizationPatientsPaginated)\n }\n\n const handleGetRelatedPatientsPaginated = () => {\n makeFetchPatients(getRelatedPatientsPaginated)\n }\n\n const onChangeParams = () => {\n if (page !== 1) {\n setPage(1)\n }\n }\n\n const handleEventFilterChange = (value?: string) => {\n if (value) {\n value === patientListFilter ? setPatientListFilter('all') : setPatientListFilter(value)\n }\n setPage(1)\n }\n\n const isLoading =\n loadingAuth || loadingPatient || patientQueryType === undefined\n\n if (isLoading && patients.length === 0) {\n return \n }\n\n const selectPatient = async (id: number) => {\n try {\n await setActive(Number(id))\n await refreshUserInfo()\n history.push('/acompanhar/plantao')\n } catch (err) {\n toast.error(err)\n }\n }\n\n const generateRandomKey = (length:number) => {\n const chars = 'abcdefghijklmnopqrstuvwxyz0123456789';\n let result = '';\n for (let i = 0; i < length; i++) {\n result += chars.charAt(Math.floor(Math.random() * chars.length));\n }\n return result;\n };\n\n return (\n \n
    \n \n
    \n \n
    \n {Occurrences.map((item, index) =>\n index !== 3\n ? (\n \n )\n : (\n resolveShiftStatusLabel(patient.shifts) === 'Atrasado' && patient.status === 'enabled').length}\n isLoading={isLoadingOccurrences}\n filterType={PatientEventFilter[index] as unknown as PatientEventFilter}\n onFilter={handleEventFilterChange}\n selected={patientListFilter === item.code}\n />\n\n ))}\n
    \n\n \n \n \n \n Período\n \n \n \n De\n \n \n \n value && setFromDate(value)}\n />\n \n \n \n Até\n \n \n \n value && setToDate(value)}\n />\n \n \n {activePatient && patientListFilter === 'all' && (\n selectPatient(activePatient.id!)}\n loadingOccurrences={isLoadingOccurrences}\n fromDate={fromDate}\n toDate={toDate}\n />\n )}\n {patients.filter((_, idx) => (idx < (pageSize * page)) && (idx + 1 > (pageSize * (page - 1)))).map((patient) => {\n if (patient.id === activePatient?.id && patientListFilter === 'all') return null\n return (\n selectPatient(patient.id!)}\n loadingOccurrences={isLoadingOccurrences}\n fromDate={fromDate}\n toDate={toDate}\n />\n )\n })}\n \n {(loadingAuth || loadingPatient) && (\n \n )}\n \n setPage(p)}\n />\n \n {\n setPageSize(Number(ev.target.value))\n setPage(1)\n }}\n >\n 10 por página\n 25 por página\n 100 por página\n \n \n \n \n {\n canCreatePatient && (\n <>\n {\n const randomKeyBefore = generateRandomKey(13); // Gera 13 caracteres antes\n const randomKeyAfter = generateRandomKey(19); // Gera 19 caracteres depois\n const prod = process.env.REACT_APP_ENV === 'production';\n try {\n const token = await auth().currentUser?.getIdToken();\n \n let url = ``; \n if (!prod) {\n url = `https://qa-schedule.cuidadordeconfianca.com.br/?key=${randomKeyBefore}${userInfo?.id}${randomKeyAfter}&token=${token}`;\n } else {\n url = `https://schedule.cuidadordeconfianca.com.br/?key=${randomKeyBefore}${userInfo?.id}${randomKeyAfter}&token=${token}`;\n } \n window.open(url, '_blank');\n } catch (error) {\n console.error('Erro ao obter o token:', error);\n }\n }}\n color={theme.palette.secondary.main}\n backgroundColor={theme.palette.background.default}\n borderColor={theme.palette.secondary.main}\n bottom={80}\n >\n \n \n\n history.push('/cadastro-psc')}\n color={theme.palette.secondary.main}\n backgroundColor={theme.palette.background.default}\n borderColor={theme.palette.secondary.main}\n >\n \n \n \n )\n }\n
    \n )\n}\n","import React from 'react';\nimport { UserModel } from '@cuidador/database';\nimport ToggleableChip from '../../../../../components/ToggleableChip';\nimport { Container } from '../../../../../components/ToggleableChip/styles';\nimport { ReactComponent as ActiveIcon } from '../../../../../assets/active-icon.svg';\nimport { ReactComponent as InactiveIcon } from '../../../../../assets/disable-icon.svg';\nimport { ReactComponent as PendingIcon } from '../../../../../assets/pending-icon.svg';\n\nexport const chipItens: Array<{\n label: string;\n value: UserModel['status'];\n icon?: JSX.Element;\n}> = [\n { label: 'Ativos', value: 'enabled', icon: },\n {\n label: 'Pendentes',\n value: 'awaitingSignupCompletion',\n icon: ,\n },\n { label: 'Inativos', value: 'disabled', icon: },\n];\n\ninterface FilterChipsProps {\n setStatus: (status: UserModel['status'][]) => void;\n status: UserModel['status'][];\n}\n\nconst FilterChips: React.FC = ({ setStatus, status }) => {\n const handleToggleStatus = (\n value: UserModel['status'],\n isActive: boolean\n ) => {\n if (isActive) {\n setStatus(status.filter((status) => status !== value));\n } else {\n setStatus([...status, value]);\n }\n };\n\n return (\n \n {chipItens.map(({ label, value, icon }) => {\n const isActive = status.includes(value);\n return (\n {\n handleToggleStatus(value, isActive);\n }}\n icon={icon}\n />\n );\n })}\n \n );\n};\n\nexport default FilterChips;\n","import React, { useEffect, useState } from 'react'\nimport { useHistory } from 'react-router-dom'\nimport { UserModel } from '@cuidador/database'\nimport qs from 'query-string'\n\nimport { AddRounded } from '@material-ui/icons'\nimport { toast } from 'react-toastify'\nimport useUser from '../../../hooks/useUser'\nimport useCanAccess from '../../../hooks/useCanAccess'\nimport { handleGetProfilePictureURL } from '../../Patient/PatientSelect/utils'\nimport FilterChips from '../../Patient/PatientSelect/OrganizationMembers/FilterChips'\nimport { Container, FormControl, MenuItem, Select, useTheme } from '@material-ui/core'\nimport LoadingBackdrop from '../../../components/LoadingBackdrop'\nimport OrganizationMemberSelectCard from '../../../components/SelectCard/Member'\nimport { SearchTextField } from '../../../components/SearchTextField'\nimport { FabStyled } from '../../../components/FabStyled'\nimport { Pagination } from '../../../components/Pagination'\n\nexport function OrganizationMembersList () {\n const [page, setPage] = useState(0)\n const [pageSize, setPageSize] = useState(10)\n const [organizationMembers, setOrganizationMembers] = useState([])\n const [\n organiationMemberIdToProfilePictureURL,\n setOrganiationMemberToProfilePictureURL,\n ] = useState>({})\n const [status, setStatus] = useState([\n 'enabled',\n 'awaitingSignupCompletion',\n ])\n\n const history = useHistory()\n const theme = useTheme()\n const {\n getOrganizationMembersPaginated,\n getProfilePicture,\n loading: loadingOrganizationMembers,\n total,\n } = useUser()\n const { isAllowedToRead: isAllowedToReadProfilePicture } = useCanAccess('media/profile-picture')\n const { isAllowedToRead: isAllowedToReadOrganizationMembers } = useCanAccess('user/user.by-organization')\n const { isAllowedToCreate: canCreateUser } = useCanAccess('user')\n\n const historyLocationSearch = history.location.search\n\n useEffect(() => {\n if (!isAllowedToReadOrganizationMembers) {\n toast.error('Você não tem permissão para visualizar essa página')\n history.push('/cadastros')\n }\n }, [])\n\n useEffect(() => {\n handleFetchOrganizationMembersPaginated()\n }, [page, pageSize, status, historyLocationSearch])\n\n const handleRedirectToPatientRelatedToUser = (userId: number) => {\n history.push(`/organizacao/usuario/${userId}`)\n }\n\n const handleFetchOrganizationMembersPaginated = () => {\n const params = qs.parse(historyLocationSearch)\n getOrganizationMembersPaginated({\n ...params,\n page,\n status,\n orderBy: 'name',\n limit: pageSize\n })\n .then((response) => {\n const loadedOrganizationMembers = response.data.results\n const organizationMembersToInsert = loadedOrganizationMembers\n for (const organizationMember of organizationMembersToInsert) {\n if (!organizationMember.id || !isAllowedToReadProfilePicture) return\n handleGetProfilePictureURL(organizationMember.id, getProfilePicture)\n .then((url) => {\n if (!url) return\n setOrganiationMemberToProfilePictureURL((previousMap) => {\n if (!organizationMember.id) return { ...previousMap }\n const newMap = { ...previousMap }\n newMap[organizationMember.id] = url\n return newMap\n })\n })\n }\n\n setOrganizationMembers(organizationMembersToInsert)\n })\n .catch((e) => {\n toast.error(e)\n })\n }\n\n const onChangeParams = () => {\n if (page !== 0) {\n setPage(0)\n }\n }\n\n if (loadingOrganizationMembers && organizationMembers.length === 0) {\n return \n }\n\n return (\n <>\n
    \n \n
    \n \n \n {organizationMembers.map(({ id, name, status, role }) => {\n if (!id) return null\n return (\n handleRedirectToPatientRelatedToUser(id)}\n onRowClick={() => history.push(`/pessoas/usuarios/${id}`)}\n />\n )\n })}\n {loadingOrganizationMembers && (\n \n )}\n \n setPage(p - 1)}\n />\n \n {\n setPageSize(Number(ev.target.value))\n onChangeParams()\n }}\n >\n 10 por página\n 25 por página\n 100 por página\n \n \n \n \n {canCreateUser && (\n history.push('/usuarios/novo')}\n color={theme.palette.secondary.main}\n backgroundColor={theme.palette.background.default}\n borderColor={theme.palette.secondary.main}\n >\n \n \n )}\n \n )\n}\n","import React, { useState } from 'react'\nimport { useParams } from 'react-router-dom'\n\nimport useCanAccess from '../../hooks/useCanAccess'\n\nimport { Header } from '../../components/Header'\nimport { MenuButton } from '../../components/MenuButton'\nimport { PageTitle } from '../../components/PageTitle'\nimport { PscButton } from '../../components/PscButton'\nimport { SideMenu } from '../../components/SideMenu'\nimport { TabsBar } from '../../components/TabsBar'\n\nimport { PatientsList } from './PatientsList'\nimport { OrganizationMembersList } from './OrganizationMembersList'\n\nexport type OperationalManagementRouteParams = {\n tab: 'pacientes' | 'usuarios'\n}\n\nexport function OperationalManagement () {\n const { tab } = useParams()\n const [isMenuOpen, setMenuOpen] = useState(false)\n\n const { isAllowedToRead: showOrganizationMembers } = useCanAccess('user/user.by-organization')\n\n return (\n <>\n setMenuOpen(true)} />\n }\n centerContent={\n \n }\n rightContent={\n \n }\n />\n setMenuOpen(false)}\n />\n\n \n\n {tab === 'pacientes' && }\n {tab === 'usuarios' && }\n \n )\n}\n","import React from 'react'\nimport { Redirect, Route, Switch } from 'react-router-dom'\nimport Account from '../pages/Account'\nimport Appointments from '../pages/Appointments'\nimport AppointmentsInsert from '../pages/Appointments/AppointmentsInsert'\nimport AppointmentsUpdate from '../pages/Appointments/AppointmentsUpdate'\nimport AwaitingReview from '../pages/AwaitingReview'\nimport NoOrganizationIdBlock from '../pages/BlockPages/NoOrganizationIdBlock'\nimport NoPatientRelationsBlock from '../pages/BlockPages/NoPatientRelationsBlock'\nimport Caregiver from '../pages/Caregiver'\nimport { default as UserForm } from '../pages/Caregiver/UserForm'\nimport CompleteSignup from '../pages/CompleteSignup'\nimport Contacts from '../pages/Contacts'\nimport ContactsInsert from '../pages/Contacts/ContactsInsert'\nimport ContactsUpdate from '../pages/Contacts/ContactsUpdate'\nimport CreateTimeContestation from '../pages/CreateTimeContestation'\nimport ExecutionHistoryContestation from '../pages/ExecutionHistoryContestation'\nimport Follow from '../pages/Follow'\nimport FollowShift from '../pages/Follow/History/Shift'\nimport ForgotPassword from '../pages/ForgotPassword'\nimport GuardianRegister from '../pages/GuardianRegister'\nimport Interview from '../pages/Interview'\nimport Login from '../pages/Login'\nimport MeasurementScheduleList from '../pages/MeasurementSchedule/List'\nimport MeasurementScheduleRegister from '../pages/MeasurementSchedule/Register'\nimport UpdateMeasurementSchedule from '../pages/MeasurementSchedule/Update'\nimport Medication from '../pages/Medication'\nimport MedicationInsert from '../pages/Medication/MedicationInsert'\nimport MedicationInsertV2 from '../pages/Medication/MedicationInsertV2'\nimport MedicationUpdate from '../pages/Medication/MedicationUpdate'\nimport MedicationUpdateV2 from '../pages/Medication/MedicationUpdateV2'\nimport Onboarding from '../pages/Onboarding'\nimport OrganizationPatient from '../pages/Organization/Patient'\nimport OrganizationUser from '../pages/Organization/User'\nimport PatientRegister from '../pages/Patient/PatientRegister'\nimport PatientUpdate from '../pages/Patient/PatientUpdate'\nimport Plan from '../pages/Plan'\nimport PlanList from '../pages/PlanList'\nimport PatientPreInterview from '../pages/PreInterview'\nimport ProcessingPayment from '../pages/ProcessingPayment'\nimport ProfessionalReport from '../pages/ProfessionalReport'\nimport ProfessionalReportItem from '../pages/ProfessionalReport/ProfessionalReportItem'\nimport RegistrationDashboard from '../pages/RegistrationDashboard'\nimport ReportList from '../pages/ReportList'\nimport Routines from '../pages/Routines'\nimport RoutinesInsert from '../pages/Routines/RoutinesInsert'\nimport RoutinesUpdate from '../pages/Routines/RoutinesUpdate'\nimport ShiftExecution from '../pages/ShiftExecution'\nimport ShiftSchedule from '../pages/ShiftSchedule'\nimport AdditionalCoverageInsert from '../pages/ShiftSchedule/AdditionalCoverage/AdditionalCoverageInsert'\nimport AdditionalCoverageUpdate from '../pages/ShiftSchedule/AdditionalCoverage/AdditionalCoverageUpdate'\nimport ShiftScheduleInsert from '../pages/ShiftSchedule/NextShiftSchedules/ShiftScheduleInsert'\nimport ShiftScheduleUpdate from '../pages/ShiftSchedule/NextShiftSchedules/ShiftScheduleUpdate'\nimport ShoppingList from '../pages/ShoppingList'\nimport SubscriptionActivation from '../pages/SubscriptionActivation'\nimport SubscriptionCompany from '../pages/SubscriptionCompany'\nimport SubscriptionPayment from '../pages/SubscriptionPayment'\nimport AuthenticatedRoute from './AuthenticatedRoute'\nimport RouteAnalytics from './RoutesAnalytics'\nimport UnauthenticatedRoute from './UnauthenticatedRoute'\nimport DevelopmentInProgress from '../pages/DevelopmentInProgress'\nimport { OperationalManagement } from '../pages/OperationalManagement'\n\nexport function Routes () {\n return (\n <>\n \n \n \n \n \n \n\n }\n />\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n )\n}\n\nexport default Routes\n","import styled from 'styled-components';\nimport { Link } from 'react-router-dom';\n\nimport { MenuItemProps } from './';\n\nexport const StyledLink = styled(Link)`\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n align-self: stretch;\n flex: 1;\n font-size: 10px;\n text-decoration: none;\n padding: ${({ theme }) => theme.spacing(1, 0)};\n background-color: ${({ $active, theme }) =>\n $active ? theme.palette.secondary.main : theme.palette.primary.main};\n color: ${({ theme }) => theme.palette.common.white};\n height: 100%;\n\n svg {\n height: 24px;\n margin-bottom: ${({ theme }) => theme.spacing(0.5)}px;\n }\n\n &:first-child {\n border-top-left-radius: 24px;\n }\n\n &:last-child {\n border-top-right-radius: 24px;\n }\n`;\n","import React, { useMemo } from 'react';\nimport { LinkProps, useLocation } from 'react-router-dom';\nimport { StyledLink } from './styles';\n\nexport interface MenuItemProps extends LinkProps {\n $active?: boolean;\n to: string;\n exact?: boolean;\n}\n\nconst MenuItem: React.FC = ({ to, children, exact }) => {\n const location = useLocation();\n\n const isActive = useMemo(() => {\n if (exact) return location.pathname === to;\n return location.pathname.startsWith(to);\n }, [location.pathname]);\n\n return (\n \n {children}\n \n );\n};\n\nexport default MenuItem;\n","function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\nimport * as React from \"react\";\n\nvar _ref2 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M17.9736 13.605L17.1561 17.1486C17.0413 17.6495 16.6009 18 16.0852 18C7.21475 17.9993 0 10.7856 0 1.91613C0 1.40076 0.350506 0.959924 0.851565 0.845672L4.39565 0.0283305C4.91179 -0.091265 5.43919 0.176612 5.65366 0.66533L7.28928 4.47959C7.48048 4.92886 7.35152 5.45231 6.97355 5.76097L5.08056 7.2807C6.27528 9.71409 8.25406 11.6926 10.6885 12.8878L12.2383 10.9965C12.5438 10.6176 13.0713 10.4864 13.5206 10.681L17.3354 12.316C17.7943 12.5574 18.0931 13.0917 17.9736 13.605Z\",\n fill: \"white\"\n});\n\nfunction SvgPhoneIcon(_ref, svgRef) {\n var title = _ref.title,\n titleId = _ref.titleId,\n props = _objectWithoutProperties(_ref, [\"title\", \"titleId\"]);\n\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n width: 18,\n height: 18,\n viewBox: \"0 0 18 18\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, _ref2);\n}\n\nvar ForwardRef = /*#__PURE__*/React.forwardRef(SvgPhoneIcon);\nexport default __webpack_public_path__ + \"static/media/phone-icon.8083d8d6.svg\";\nexport { ForwardRef as ReactComponent };","import styled from 'styled-components';\nimport { ReactComponent as PhoneIcon } from '../../assets/phone-icon.svg';\n\nexport const Container = styled.nav`\n display: flex;\n align-items: center;\n justify-content: center;\n position: fixed;\n bottom: 0px;\n width: 100%;\n height: ${({ theme }) => theme.spacing(7)}px;\n padding-bottom: ${({ theme }) => theme.spacing(1.5)}px;\n color: ${({ theme }) => theme.palette.common.white};\n`;\n\nexport const LogoContainer = styled.div`\n padding: ${({ theme }) => theme.spacing(8)}px\n ${({ theme }) => theme.spacing(4)}px;\n img {\n width: 100%;\n }\n`;\n\nexport const LogoutContainer = styled.div`\n margin: ${({ theme }) => theme.spacing(4)}px;\n`;\n\nexport const StyledPhoneIcon = styled(PhoneIcon)`\n color: ${({ theme }) => theme.palette.primary.main};\n`;\n","import ShoppingCartIcon from '@material-ui/icons/ShoppingCart';\nimport WatchLaterIcon from '@material-ui/icons/WatchLater';\nimport React from 'react';\n\nimport { ReactComponent as IconCheck } from '../../assets/Icon-check-circle.svg';\nimport useCanAccess from '../../hooks/useCanAccess';\nimport MenuItem from './MenuItem';\nimport { Container, StyledPhoneIcon } from './styles';\n\nconst Tabbar: React.FC = () => {\n const { isAllowedToRead: isAllowedToReadShoppingList } = useCanAccess(\n 'care/shopping-list'\n );\n const { isAllowedToRead: isAllowedToReadEmergencyContacts } = useCanAccess(\n 'care/emergency-contact'\n );\n return (\n \n \n \n Cuidados\n \n \n Cadastros\n \n {isAllowedToReadShoppingList && (\n \n Compras\n \n )}\n {isAllowedToReadEmergencyContacts && (\n \n Me ajuda\n \n )}\n \n );\n};\n\nexport default Tabbar;\n","import styled from 'styled-components';\nimport { ContentProps } from '.';\n\nexport const Container = styled.div`\n display: flex;\n flex-direction: column;\n min-height: 100vh;\n`;\n\nexport const Content = styled.div`\n display: flex;\n flex-direction: column;\n flex: 1;\n padding-bottom: ${({ withTabs }) =>\n withTabs ? '56px' : '0px'}; // 56 = Tabbar height\n background-color: ${({ theme }) => theme.palette.common.white};\n`;\n","import React, { useContext, useMemo } from 'react';\nimport { useRouteMatch } from 'react-router-dom';\nimport { AuthContext } from '../../contexts/auth';\nimport Routes from '../../routes/Routes';\nimport Tabbar from '../Tabbar';\nimport { Container, Content } from './styles';\n\nexport interface ContentProps {\n withTabs: boolean;\n}\n\nconst routesWithMenu = ['/compras', '/menu', '/acompanhar/:id', '/cadastros', '/contatos'];\n\nconst Layout: React.FC = () => {\n const { user } = useContext(AuthContext);\n const match = useRouteMatch(routesWithMenu);\n\n const shouldRenderTabs = useMemo(() => {\n return Boolean(user) && Boolean(match?.isExact);\n }, [user, match]);\n\n return (\n \n \n \n \n {shouldRenderTabs && }\n \n );\n};\n\nexport default Layout;\n","import { ToastContainer } from 'react-toastify';\nimport 'react-toastify/dist/ReactToastify.css';\nimport styled from 'styled-components';\n\nexport const Toast = styled(ToastContainer)`\n .Toastify__toast--info {\n background: ${({ theme }) => theme.palette.info.main};\n .Toastify__progress-bar {\n background-color: ${({ theme }) => theme.palette.primary.light};\n }\n }\n .Toastify__toast--success {\n background: ${({ theme }) => theme.palette.success.main};\n }\n .Toastify__toast--warning {\n background: ${({ theme }) => theme.palette.warning.main};\n color: #000000;\n }\n .Toastify__toast--error {\n background: ${({ theme }) => theme.palette.error.main};\n .Toastify__progress-bar {\n background-color: ${({ theme }) => theme.palette.extra.color.red.main};\n }\n }\n`;\n","import React from 'react';\n\nimport { Toast } from './styles';\n\nfunction ToastContainerCustom() {\n return ;\n}\n\nexport default ToastContainerCustom;\n","import { hotjar } from 'react-hotjar';\n\nconst dev = process.env.REACT_APP_ENV !== 'production';\nif (!dev) {\n // hotjar.initialize(2488114, 6);\n}\nexport default hotjar;\n","import { createGlobalStyle } from 'styled-components';\n\nexport default createGlobalStyle`\n body, #root {\n min-height: 100vh;\n margin: 0px;\n font-family: 'Work Sans', 'Helvetica';\n }\n\n input:-webkit-autofill,\n input:-webkit-autofill:hover,\n input:-webkit-autofill:focus,\n input:-webkit-autofill:active {\n transition: background-color 5000s ease-in-out 0s,\n color 5000s ease-in-out 0s;\n transition-delay: background-color 5000s, color 5000s;\n }\n`;\n","import { StylesProvider, ThemeProvider } from '@material-ui/core/styles'\nimport {\n clientSideScheme,\n setFavicon,\n setManifest,\n} from '@cuidador/whitelabel'\nimport React, { useEffect } from 'react'\nimport { BrowserRouter } from 'react-router-dom'\nimport { ThemeProvider as StyledThemeProvider } from 'styled-components'\nimport ScrollToTop from './routes/ScrollToTop'\n\nimport ErrorBoundary from './components/ErrorBoundary'\nimport Layout from './components/Layout'\nimport Toast from './components/Toast'\nimport './config/hotjar'\nimport './config/sentry'\nimport { AuthProvider } from './contexts/auth'\nimport { PermissionProvider } from './contexts/permission'\nimport RegistrationDashboardProvider from './contexts/registrationDashboard'\nimport { GlobalLoadingProvider } from './contexts/RequestInterceptor'\nimport GlobalStyle from './styles/globalStyle'\nimport { resolveTheme } from './styles/theme'\nimport { MuiPickersUtilsProvider } from '@material-ui/pickers'\nimport DateFnsUtils from '@date-io/date-fns'\nimport ptBr from 'date-fns/locale/pt-BR'\n\nconst App: React.FC = () => {\n const { muiTheme, styledTheme } = resolveTheme()\n const { appFFaviconUrl, appFJsonManifest } = clientSideScheme()\n\n useEffect(() => {\n setFavicon(appFFaviconUrl)\n setManifest(appFJsonManifest)\n }, [])\n\n return (\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n )\n}\nexport default App\n","/* eslint-disable @typescript-eslint/explicit-module-boundary-types */\nimport { ReportHandler } from 'web-vitals';\n\nconst reportWebVitals = (onPerfEntry?: ReportHandler) => {\n if (onPerfEntry && onPerfEntry instanceof Function) {\n import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {\n getCLS(onPerfEntry);\n getFID(onPerfEntry);\n getFCP(onPerfEntry);\n getLCP(onPerfEntry);\n getTTFB(onPerfEntry);\n });\n }\n};\n\nexport default reportWebVitals;\n/* eslint-enable @typescript-eslint/explicit-module-boundary-types */\n","import React from 'react';\nimport ReactDOM from 'react-dom';\nimport App from './App';\nimport reportWebVitals from './reportWebVitals';\n\nReactDOM.render(\n \n \n ,\n document.getElementById('root')\n);\n\n// If you want to start measuring performance in your app, pass a function\n// to log results (for example: reportWebVitals(console.log))\n// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals\nreportWebVitals();\n"],"sourceRoot":""}