{"version":3,"sources":["reportWebVitals.ts","components/Legal/CopyRight.tsx","components/Legal/TOS.tsx","components/Legal/PrivacyPolicy.tsx","storage/LogInPortals.ts","actions/WorkforceClinicAction.ts","storage/CompanySelection.ts","storage/AuthToken.ts","storage/UserId.ts","actions/WorkforceOneLoginActions.ts","AppState.ts","authentication/isAdminRole.ts","authentication/BuildUserAccess.ts","authentication/SelectedCompany/CompanySelectionDrivenSelectors.ts","authentication/BuildUserState.ts","config/Routes.ts","components/ActionButton.tsx","api/ApiUrl.ts","api/BuildFetchRequest.ts","reducers/Defaults/CurrentUserPermissions.ts","actions/WorkforceOnePermissionActions.ts","reducers/Workforce1User.ts","reducers/Workforce1Companies.ts","reducers/index.ts","authentication/BuildAuthRequestInterface.ts","epics/WorkforceOneUserAccess.ts","config/Constants.ts","epics/WorkforceOneUserLoginEpic.ts","epics/WorkforceOneUserPortalPermission.ts","epics/WorkforceOneUserAutoCompanySelectionEpic.ts","actions/WorkforceOnePageActions.ts","epics/WorkforceOneLoginPageReturn.ts","epics/WorkforceOneCompanySelectPageReturn.ts","epics/WorkforceOneLogOutFromPasswordReset.ts","epics/WorkforceOnePasswordResetRequest.ts","epics/WorkforceOneSSOUserLoginEpic.ts","epics/WorkforceOneSSOTokenUserLoginEpic.ts","epics/index.ts","AppStore.ts","BaseUrl.ts","configureStore.ts","api/ObservableFromFetch.ts","api/Administration/UserPasswordReset.ts","components/Accounts/ChangePassword.tsx","components/NavMenu/NavDropdownHover.tsx","authentication/hasAccessToRoute.ts","components/NavMenu/NavMenuLink.tsx","components/NavMenu/PortalCompanySearch.tsx","api/Portals/PortalCompaniesGet.ts","components/NavMenu/NavMenu.tsx","components/AppNotice/AppNotice.tsx","components/MouseDetectionLogoutTimer.tsx","components/NavMenu/SupportedBrowsers.tsx","assets/images/logo.png","components/Legal/EmailSupport.tsx","components/NavMenu/AppPageWrapper.tsx","components/TablePagination.tsx","assets/images/clear-filters.png","components/Checkbox.tsx","components/ColumnHeaderFilter.tsx","components/SearchBar.tsx","api/Randoms/LabAccountsGet.ts","api/Randoms/LabPanelsGet.ts","api/Randoms/SelectionIntervalsGet.ts","api/LabService/LabServiceRegulatoryModesGet.ts","api/Companies/GetAccountsByName.ts","components/FormattedInputs/CompanyInput.tsx","api/Randoms/PoolSave.ts","api/PrimaryIDTypes/PrimaryIDTypesGet.ts","components/LoadingIndicatorWrapper.tsx","components/Randomization/AddPoolModal.tsx","api/Randoms/PoolStatisticsDetailsGet.ts","formatters/FormatTimestampFileName.ts","api/Randoms/RandomSelectionListGet.ts","api/Randoms/RandomSelectionListCsvGet.ts","api/Randoms/RandomSelectionListPrintGet.ts","api/Randoms/RandomSelectionListPrintLettersGet.ts","formatters/FormatError.ts","components/ConfirmationModal.tsx","assets/images/warning.png","api/Randoms/GovPoolCheckTestsExist.ts","components/Randomization/GovPools/RandomSchedulingExclusionsModal.tsx","utils/handleAPIError.ts","components/LoadingTableBodyWrapper.tsx","components/LoadingTableWrapper.tsx","formatters/FormatDate.ts","components/Randomization/Pools/CompletedTests.tsx","api/Randoms/PoolSelectionActions.ts","components/Randomization/Pools/CompleteRandomSelection.tsx","formatters/RenderDonorID.ts","components/Randomization/RandomSelectionList.tsx","api/Randoms/PoolSelectionListGet.ts","components/Randomization/Pools/PoolSelectionRerunModal.tsx","components/Randomization/Pools/PoolSelectionActionButtons.tsx","api/Randoms/RandomsModel/PoolCriteria.ts","components/Randomization/Pools/TestingPeriodBreakdownGrid.tsx","api/Reports/WorkforceReport.ts","formatters/FormatBase64.ts","utils/printPdf.ts","components/FormattedInputs/BirthdayInput.tsx","components/Reports/FromToDates.tsx","components/Randomization/Pools/AuditPoolModal.tsx","components/Randomization/Pools/PoolStatistics.tsx","api/Randoms/CloseProgramInterval.ts","api/Randoms/PoolGeneralInfoGet.ts","components/Randomization/Pools/PoolGeneralInfo.tsx","components/Randomization/Pools/MissedPeriodsModal.tsx","api/Randoms/Import/MappingFieldsGet.ts","api/Randoms/Import/ImportJobCreate.ts","api/Randoms/Import/ImportJobMappingSet.ts","api/Randoms/Import/ImportJobValidate.ts","api/Randoms/Import/ImportJobStart.ts","api/Randoms/Import/ImportJobCancel.ts","api/Randoms/Import/ImportJobValidationResultGet.ts","api/Companies/AutoFilterCompaniesGet.ts","components/Randomization/ImportErrorDetails.tsx","components/Randomization/Pools/ImportPoolMembers.tsx","api/Randoms/RunRandomSelectionMessagesGet.ts","api/Randoms/RandomSelectionRun.ts","components/Randomization/Pools/RunRandom.tsx","api/Randoms/CloseProgramIntervalGet.ts","components/Randomization/Pools/CloseProgramInterval.tsx","api/Randoms/PoolMembersGridGet.ts","components/Randomization/RandomPersonnelCheckbox.tsx","components/ColumnsCustomizeModal/Column.tsx","components/ColumnsCustomizeModal/Container.tsx","components/ColumnsCustomizeModal/ColumnsCustomizeModal.tsx","api/OrderResults/GeneralInformationGet.ts","formatters/FormatPhone.ts","formatters/FormatSSN.ts","formatters/FormatZipCode.ts","components/FormattedInputs/PhoneNumberMaskedInput.tsx","api/Location/AutoFilterLocationsGet.ts","components/FormattedInputs/StateSelect.tsx","api/OrderRequests/OrderRequestsConstraintGet.ts","api/LabService/EmployeeCategoriesGet.ts","components/OrderResults/EmployeeDetails/EmployeeRegModeModal.tsx","components/OrderResults/EmployeeDetails/SupervisorsModal.tsx","components/OrderResults/EmployeeDetails/GeneralInfo.tsx","api/PhoneType.ts","api/OrderResults/CurrentServiceDetails.ts","components/OrderResults/EventDetails/Cards/AccordionCard.tsx","formatters/FormatTime.ts","components/OrderResults/EventDetails/Cards/CardRow.tsx","api/Randoms/RandomsModel/ExcuseReason.ts","components/OrderResults/EventDetails/Cards/SchedulingCard.tsx","components/OrderResults/EventDetails/Cards/CollectionCard.tsx","components/OrderResults/EventDetails/Cards/ExamDetailCard.tsx","components/OrderResults/EventDetails/Cards/ExamResultDetailCard.tsx","components/OrderResults/EventDetails/Cards/BATAlcoholTestCard.tsx","components/OrderResults/EventDetails/Cards/BATResultCard.tsx","components/OrderResults/EventDetails/Cards/TestingCard.tsx","components/OrderResults/EventDetails/Cards/ReviewCard.tsx","components/OrderResults/EventDetails/Cards/TestScreeningCard.tsx","components/OrderResults/EventDetails/TestSteps.tsx","components/OrderResults/EmployeeDetails/CurrentService.tsx","api/OrderResults/CurrentServiceHistory.ts","components/OrderResults/EventDetails/Cards/PhoneNumberCard.tsx","components/OrderResults/EventDetails/Cards/PhoneNumbers.tsx","api/CachedCollectionTest.ts","api/Randoms/GovPerformCollection.ts","components/GovPerformCollection/RecordTemperature.tsx","components/GovPerformCollection/DonorInfo.tsx","utils/hooks.ts","api/GovPerformCollection/PanelResult.ts","components/FormattedInputs/SpecimenIdInput.tsx","components/GovPerformCollection/InputSpecimenId.tsx","components/GovPerformCollection/CollectorNotes.tsx","components/GovPerformCollection/AdditionalPanels.tsx","components/GovPerformCollection/MainPanelRow.tsx","components/GovPerformCollection/MainPanels.tsx","api/Randoms/GovGetPanels.ts","components/GovPerformCollection/Panels.tsx","components/OrderRequests/GovPerformCollection.tsx","components/OrderResults/RandomTestCard.tsx","components/OrderResults/EventDetails/DrugTestInfo.tsx","components/OrderResults/EventDetailsModal.tsx","components/OrderResults/EmployeeDetails/CurrentServiceHistory.tsx","api/OrderResults/SearchEmployesToMerge.ts","components/OrderResults/EmployeeDetails/EmployeeToMergeInfo.tsx","components/OrderResults/EmployeeDetails/EmployesToMergeGrid.tsx","components/OrderResults/EmployeeDetails/MergeEmployee.tsx","components/OrderResults/EmployeeDetailsModal.tsx","components/Randomization/PoolMembersFiltersModal.tsx","components/Randomization/QueryNameModal.tsx","components/Administration/DualListBox.tsx","components/Randomization/RegulatoryModeSelection.tsx","assets/images/delete_query.png","components/Randomization/SavedQueriesModal.tsx","components/Randomization/LocationSelection.tsx","api/Randoms/ConsortiumData.ts","components/Randomization/CompanySelection.tsx","components/Randomization/PoolMembersCriteriaModal.tsx","api/Randoms/PoolMemberProcess.ts","api/Regions/AutoFilterRegionsGet.ts","components/Randomization/Pools/PoolMembersGrid.tsx","components/Randomization/AddPoolMemberModal.tsx","components/Randomization/Pools/SelectionHistoryGrid.tsx","api/Randoms/PoolSelectionHistoryGet.ts","api/Randoms/RandomsModel/PoolSelectionHistoryRow.ts","components/Randomization/Pools/PoolHistory.tsx","api/Randoms/Notification/NotificationContactsProcess.ts","api/Randoms/Notification/useNotificationAction.ts","api/Randoms/Notification/useNotificationContactsDelete.ts","api/Randoms/Notification/useNotificationContactsLoad.ts","api/Randoms/Notification/useNotificationsSend.ts","components/Randomization/Notification/NotificationContactsProvider.tsx","components/Randomization/Notification/NotificationApplicationUserInfo.tsx","components/Randomization/Notification/NotificationNameCell.tsx","components/Randomization/Notification/NotificationApplicationUsersGridRow.tsx","api/Randoms/Notification/useNotificationApplicationUsersLoad.ts","components/Randomization/Notification/NotificationApplicationUsersGrid.tsx","components/Randomization/Notification/NotificationEditTabTitle.tsx","components/FormattedInputs/ToggleSwitch.tsx","components/Randomization/Notification/NotificationEventsTab.tsx","components/Randomization/Notification/NotificationMethodsTab.tsx","api/Randoms/Notification/NotificationMode.ts","api/Randoms/Notification/useNotificationContacts.ts","api/Randoms/Notification/useNotificationContactsActions.ts","api/Randoms/Notification/useNotificationContactSave.ts","api/Randoms/Notification/useNotificationEvents.ts","api/Randoms/Notification/useNotificationMethods.ts","components/Randomization/Notification/NotificationEditModal.tsx","components/ActionIconButton.tsx","components/Randomization/Notification/NotificationActionCell.tsx","components/Randomization/Notification/NotificationEventsCell.tsx","components/Randomization/Notification/NotificationMethodsCell.tsx","components/Randomization/Notification/NotificationGridRow.tsx","components/Randomization/Notification/NotificationGrid.tsx","components/ActionButtonWithIcon.tsx","components/Randomization/Notification/NotificationDetails.tsx","components/Randomization/Notification/PoolNotifications.tsx","components/Randomization/Pools/PoolDetailsModal.tsx","api/Randoms/PoolGridGet.ts","api/Randoms/PoolReadyToRunUpdate.ts","components/Randomization/RandomNav.tsx","components/Randomization/Pools/RunCancelNotificationModal.tsx","components/Randomization/Pools/RunCancelModal.tsx","api/Randoms/ImportPersonnelTemplate.ts","components/Randomization/RandomPools.tsx","api/Randoms/GovPoolCreate.ts","api/Randoms/GovPoolModel/DayOfWeek.ts","components/OrderRequests/DeviceSampleType.ts","components/Randomization/GovPools/WeekdaysToExclude.tsx","api/Randoms/GovGetCollectionTypes.ts","api/LabService/LabAccountsGet.ts","api/Randoms/GovDevicesGet.ts","components/OrderRequests/GovCollection.tsx","api/Randoms/GovDaysToExclude.ts","components/Randomization/GovPools/DatesToExclude.tsx","components/Randomization/GovPools/DatesToExcludeModal.tsx","components/Randomization/GovPools/AddGovPoolModal.tsx","api/Randoms/SelectionReportPrint.ts","components/Randomization/GovPools/PoolStatistics.tsx","api/Randoms/GovPoolStatisticsDetailsGet.ts","api/Randoms/GovPoolUpdate.ts","components/Randomization/GovPools/PoolGeneralInfo.tsx","components/Randomization/GovPools/PoolDetailsModal.tsx","api/Randoms/GovPoolSelectioUpdate.ts","components/Randomization/GovPools/GovPoolDateSelectedModal.tsx","api/Randoms/GovPoolSelectionGet.ts","components/Randomization/GovPools/RandomGovPools.tsx","api/Randoms/GovPoolGridGet.ts","api/Randoms/GovPoolGet.ts","api/GovDonor/GovDonorAddObservable.ts","api/GovDonor/GovDonorEditObservable.ts","components/GovDonor/EditGovDonorForm.tsx","components/GovDonor/AddGovDonorModal.tsx","components/GovDonor/IVRLogForm.tsx","api/GovDonor/IVRCallLogObservable.ts","components/GovDonor/GovDonorDetailsModal.tsx","components/GovDonor/GovDonorGrid.tsx","api/GovDonor/GovDonorGridGetObservable.ts","api/Administration/Model/ServiceType.ts","components/OrderRequests/TogglePanel.tsx","components/OrderRequests/OrderServices/SelectServiceTogglePanel.tsx","api/LookupCodes/ServiceCode.ts","components/OrderRequests/OrderModels.ts","assets/images/dot-img.png","components/OrderRequests/OrderServices/SelectService.tsx","api/LabService/TestToBePerformGet.ts","api/Administration/Model/Service.ts","api/LookupCodes/SampleType.ts","api/Administration/Model/AccountService.ts","components/OrderRequests/OrderServices/SelectSpecimenCollection.tsx","components/OrderRequests/OrderServices/SelectObserved.tsx","api/LookupCodes/DefaultLookupCode.ts","components/OrderRequests/RegulatoryModeControl.tsx","api/Administration/DrugService.ts","components/OrderRequests/OrderServices/DrugServicesPanel.tsx","utils/useStateWithCallback.ts","components/OrderRequests/OrderServices/SelectDrugTest.tsx","components/OrderRequests/OrderServices/SelectAlcoholTest.tsx","components/OrderRequests/OrderServices/SelectPhysicalExam.tsx","components/OrderRequests/OrderServices/SelectOHS.tsx","components/OrderRequests/OrderServices/CHS/CHSService.tsx","components/OrderRequests/OrderServices/CHS/CHSServices.tsx","components/OrderRequests/OrderServices/CHS/CHSTests.tsx","components/OrderRequests/OrderServices/SelectCHS.tsx","components/OrderRequests/ServicesSelection.tsx","components/OrderRequests/TextFormControl.tsx","api/OrderRequests/SearchDonorGet.ts","components/OrderRequests/DonorInformation.tsx","api/Location/LocationModel/CommonWealthStateTextMapping.ts","api/Location/LocationModel/CommonWealthState.ts","components/OrderRequests/CalculateDateStrings.ts","components/ExpirationDate.tsx","components/OrderRequests/Schedule.tsx","api/Location/LocationQueryGet.ts","components/SiteSearch/AddressSearch.tsx","components/SiteSearch/Filter.tsx","components/SiteSearch/SiteCard.tsx","assets/images/seal-icons_silver.png","assets/images/seal-icons_gold.png","assets/images/seal-icons_platinum.png","assets/images/seal-icons_goldplus.png","assets/images/clinic-icons_formfox-enabled.png","assets/images/clinic-icons_not-formfox-enabled.png","assets/images/clinic-icons_marketplace.png","assets/images/price-icons_3-star.png","assets/images/price-icons_4-star.png","assets/images/price-icons_5-star.png","api/Administration/OrderableServices.ts","components/SiteSearch/SiteServices.tsx","components/SiteSearch/MapContainer.tsx","api/Clinics/ClinicOptionsGet.ts","api/OrderRequests/SSOOrderRequest.ts","components/SiteSearch/SiteSearch.tsx","api/Location/LocationsListGet.ts","assets/images/shopping-cart.png","components/OrderRequests/OrderServices/OrderedServices.tsx","components/OrderRequests/OrderRequestsHeader.tsx","api/OrderRequests/OrderSubmit.ts","components/OrderRequests/PotentialDonorMatchModal.tsx","api/Administration/OrderDefaults.ts","components/FormattedInputs/LocationInput.tsx","components/OrderRequests/OrderRequest.tsx","api/OrderResults/AuthForm.ts","components/OrderRequests/OrderFinish.tsx","api/OrderRequests/OrderReportPrint.ts","api/OrderRequests/SendEmail.ts","api/OrderRequests/SendMessage.ts","api/OrderResults/OrderResultsListGet.ts","api/OrderResults/ResultsWatch.ts","api/OrderResults/SearchFieldsGet.ts","api/OrderResults/CompleteTest.ts","api/OrderResults/OrderResultModel/Status.ts","components/OrderResults/CompleteModal.tsx","api/OrderResults/CompanyPoolsGet.ts","assets/images/order-expired.png","components/OrderResults/GridStatusInfo.tsx","api/OrderResults/GenerateCCFImage.ts","api/Administration/Model/TestType.ts","components/OrderResults/ModalStatusInfo.tsx","assets/images/CCF.png","assets/images/MRO.png","assets/images/OHS.png","api/OrderResults/ResultsResolve.ts","components/OrderResults/OrderTrackingCheckbox.tsx","components/OrderResults/AuthFormModal.tsx","api/OrderRequests/OrderCancel.ts","api/OrderRequests/OrderUpdate.ts","components/ProcessingModal.tsx","components/sso/SiteSearchPage.tsx","components/OrderResults/OrderEditModal.tsx","api/Vendor/CollectionSiteInfoGet.ts","api/OrderResults/SendClinicSelectLink.ts","components/OrderResults/SendSelectClinicLink.tsx","assets/images/alert.png","assets/images/alert-resolved.png","components/OrderResults/EventDetails/DrugTestCompare.tsx","components/OrderResults/EventDetailsCompare.tsx","components/OrderResults/SearchTestToMerge.tsx","components/OrderResults/PrintFormModal.tsx","api/OrderResults/TestToMergeGet.ts","components/OrderResults/ReasonForTestCell.tsx","utils/exportCsv.ts","components/OrderResults/ExportCSVModal.tsx","components/OrderResults/WatchCell.tsx","assets/images/watch.png","assets/images/watch-resolved.png","components/HorizontalScrollWrapper.tsx","components/OrderResults/FormFoxTestANColumn.tsx","components/OrderResults/OrderTracking.tsx","components/SiteSearch/SiteSearchPage.tsx","components/Secuirty/ForgotPassword.tsx","components/NavMenu/LoginNavMenu.tsx","components/Notification/NotificationCard.tsx","components/Notification/NotificationPanel.tsx","api/Notifications/CustomerNotificationsGet.ts","authentication/Workforce1Login.tsx","components/PageLoading.tsx","config/Identity.ts","authentication/AuthService.ts","authentication/SSOWorkforce1Login.tsx","components/Administration/ClinicSearchOptions/ForcePrimaryClinicOptions.tsx","components/Draggable/DraggableItem.tsx","components/Draggable/DroppableContainer.tsx","components/Administration/ClinicSearchOptions/AdditionalOptions.tsx","components/Administration/ClinicSearchOptions/DefaultOptions.tsx","components/Administration/ClinicSearchOptions/OwnedPrimarySites.tsx","components/Administration/ClinicSearchOptions/ListOptions.tsx","components/Administration/ClinicSearchOptions/ExcludeClinicGroup/FFClinicGroupRow.tsx","components/Administration/ClinicSearchOptions/ExcludeClinicGroup/ClinicGroupsFFModal.tsx","api/Clinics/ClinicGroupsGet.ts","components/Administration/ClinicSearchOptions/ExcludeClinicGroup/ExcludeClinicGroupRow.tsx","components/Administration/ClinicSearchOptions/ExcludeClinicGroup/ExcludeClinicGroupTable.tsx","components/Administration/ClinicSearchOptions/ExcludeClinicGroup/ExcludeClinicGroup.tsx","components/Administration/ClinicSearchOptions.tsx","components/Companies/CompanySelection.tsx","api/Randoms/RandomPersonnelListGet.ts","api/Randoms/RandomPersonnelRemove.ts","components/Randomization/AdvancedFiltersModal.tsx","api/Randoms/RandomPersonnelAdd.ts","components/EmploymentDetails.tsx","components/Randomization/AddIndividualModal.tsx","api/Randoms/Import/ImportJobCreateAndPerform.ts","components/Randomization/ImportErrorDetailsModal.tsx","components/Randomization/ConsortiumMembershipModal.tsx","components/Randomization/RandomPersonnelGrid.tsx","api/Randoms/RandomPersonnelSearchFieldsGet.ts","assets/images/download-csv.png","api/Randoms/SelectionInboxGrid.ts","api/Randoms/EventExcuse.ts","components/Randomization/ExcuseEventModal.tsx","components/Randomization/UnexcuseEventModal.tsx","api/Randoms/SelectionInboxPending.ts","components/Randomization/SelectionInbox.tsx","api/Administration/UserInformationGet.ts","api/Administration/UserNotificationInfoUpdate.ts","api/Administration/CreateUser.ts","api/Administration/UserRevoke.ts","api/Roles/RoleOrderSecurityCheck.ts","components/Administration/Notification/NotificationOptions.tsx","components/Administration/Notification/NotificationEventSelection.tsx","api/Notifications/NotificationDetailGet.ts","components/Administration/Notification/NotificationMethodSelection.tsx","components/Administration/Notification/NotificationServiceSelection.tsx","components/Administration/Notification/NotificationSelection.tsx","components/Administration/AdditionalAssociatedDataModal.tsx","components/CheckboxList.tsx","components/Administration/AdditionalRoleModal.tsx","api/Roles/GetAdditionalRole.ts","api/Administration/OrderSecurityOverrideUpdate.ts","components/Administration/SetDatePeriod.tsx","components/Administration/OrderSecurityOverride.tsx","api/Administration/OrderSecurityOverrideGet.ts","components/Administration/UserInfo.tsx","api/Administration/TimeZoneListGet.ts","api/Roles/UserRolesGet.ts","api/Invitation/CheckExistingUser.ts","api/Administration/ResetLoginAttempts.ts","api/Administration/RemoveDuplicateRoles.ts","api/Administration/DeleteUser.ts","components/Accounts/MyInformation.tsx","api/Administration/GetUserDetails.ts","api/Implementations/ImplementationsGet.ts","api/Invitation/Model/InvitationStatus.ts","components/Invitation/CSVUploadModal.tsx","api/Invitation/InvitationCreate.ts","components/Administration/UserProfileStatuses.tsx","components/Administration/UserDetailsGrid.tsx","api/Administration/ActivationProcess.ts","components/Administration/UserActivation.tsx","api/Administration/GetRegulatoryModeDonorByID.ts","api/Administration/InsertRegulatoryModeDonor.ts","components/Administration/EntityActivation.tsx","components/Accounts/RegulatoryMode/PersonnelRegulatoryModes.tsx","components/Accounts/RegulatoryMode/RegulatoryModeNumberSelect.tsx","components/Accounts/RegulatoryMode/RegulatoryModeForm.tsx","api/Invitation/InformationGet.ts","components/Administration/CompanyActivation.tsx","components/Administration/PortalActivation.tsx","api/BusinessTypes/BusinessTypesGet.ts","api/Companies/CompanyInactivate.ts","api/Companies/CompanyUpdate.ts","api/Companies/CompaniesGet.ts","components/FormattedInputs/AddressInput.tsx","components/AddressMatchModal.tsx","components/Invitation/OrderSecurity.tsx","api/Roles/RoleOrderSecurityProcess.ts","api/LabService/LabAccountCreate.ts","components/Invitation/LabAccountSelection.tsx","api/Administration/LabAccountListGet.ts","api/Administration/ActivateAndInActiveLabAccount.ts","components/Administration/LabAccountSelection.tsx","api/Administration/GetSubscriptionPlans.ts","components/Administration/SubscriptionModal.tsx","api/Portals/AutoFilterPortalsGet.ts","api/Portals/PortalsGet.ts","api/Portals/PortalUpdate.ts","api/Portals/PortalInactivate.ts","api/Administration/GetAllImplementationImageByImplementationID.ts","api/Administration/UpdateBrandingImage.ts","components/Administration/EditActiveImageDate.tsx","api/Invitation/PortalLogoInsert.ts","components/Administration/ManageImages.tsx","api/Administration/CompanyImport/ImportJobCreate.ts","api/Administration/CompanyImport/ImportJobValidate.ts","api/Administration/CompanyImport/ImportJobStart.ts","api/Administration/CompanyImport/ImportJobCancel.ts","components/Administration/CompanyImport.tsx","components/Invitation/Portal/PortalFields.tsx","api/Location/LocationUpdate.ts","api/Location/LocationCreate.ts","components/Administration/AddLocationModal.tsx","components/Administration/LocationInformationForm.tsx","api/Location/LocationsGet.ts","api/Location/CheckLocation.ts","components/Administration/EditLocationInformation.tsx","components/Administration/DeviceModal.tsx","components/Administration/DeviceSelection.tsx","components/Administration/LocationImport.tsx","api/Administration/AdditionalTests.ts","components/Administration/CompanyInformation.tsx","components/Administration/CompanyInformation/AdditionalTesting.tsx","components/Administration/LocationInformation.tsx","components/Administration/MyOrganization.tsx","api/OrphanedResults/OrphanedProcess.ts","components/OrphanedResults/DonorNotFoundError/DonorIdsCell.tsx","components/OrphanedResults/DonorNotFoundError/DonorRow.tsx","api/OrphanedResults/Models/NoMatchingErrorType.ts","api/OrphanedResults/ResultExceptionsProcess.ts","components/OrphanedResults/DonorNotFoundError/DonorGrid.tsx","components/OrphanedResults/PendingDrugTests/PendingDrugTestRow.tsx","components/OrphanedResults/PendingDrugTests/PendingDrugTests.tsx","components/OrphanedResults/PendingDrugTests/PendingDrugTestsButtons.tsx","api/OrphanedResults/Models/ImportExceptionSubType.ts","components/OrphanedResults/DonorNotFoundError/DonorNotFoundError.tsx","components/OrphanedResults/NoMatchingRandomError/NoMatchingRandomError.tsx","components/OrphanedResults/PendingClinicalTests/PendingClinicalTestRow.tsx","components/OrphanedResults/PendingClinicalTests/PendingClinicalTests.tsx","components/OrphanedResults/PendingClinicalTests/PendingClinicalTestsButtons.tsx","components/OrphanedResults/NoMatchingTestError/NoMatchingTestError.tsx","components/OrphanedResults/AccountNotFoundError/AccountNotFoundError.tsx","components/OrphanedResults/OrphanedResults.tsx","api/InvitationStatus/InvitationStatusListGet.ts","api/InvitationStatus/ResendInvitation.ts","api/InvitationStatus/DeleteInvitation.ts","components/InvitationStatus/ResendInvitationModal.tsx","components/Invitation/AdminSetupModal.tsx","components/InvitationStatus/InvitationStatusGrid.tsx","api/Administration/GlobalParameter.ts","api/Administration/ParameterType.ts","components/Administration/ParameterTypeModal.tsx","components/Administration/GlobalParameter.tsx","components/Administration/OrderableServicesModal.tsx","api/Administration/Model/ComapnyUserCode.ts","api/Administration/CompanyUserCodes.ts","components/Administration/CompanyUserCodeModal.tsx","components/Administration/UserCodesModal.tsx","api/Administration/ImplementationAliasFields.ts","api/Administration/ImplementationUserLabels.ts","components/Administration/UserLabelsModal.tsx","api/Administration/Model/ImplementationUserLabels.ts","api/Implementations/ImplementationLabResultsReporting.ts","api/Companies/AccountLabResultsReporting.ts","components/Administration/LabResultsReportingModal.tsx","api/Invitation/Model/InvitationType.ts","api/Invitation/GetOneTimePIN.ts","components/Invitation/CalculatePasswordScore.ts","components/Invitation/ValidatePIN.tsx","api/Invitation/ValidateOneTimePIN.ts","api/Invitation/GetInvitationStatus.ts","components/Invitation/ValidateIdentity.tsx","components/Invitation/SetupComplete.tsx","assets/images/img_status_exceed.png","assets/images/img_status_pass.png","assets/images/img_status_warn.png","assets/images/img_status_fail.png","api/Invitation/PasswordSet.ts","components/Invitation/InvitationProcess.tsx","components/Invitation/SetPassword.tsx","api/Invitation/CheckInactiveURL.ts","components/Secuirty/InvalidPasswordReset.tsx","api/Secuirty/UpdatedUserPasswordToken.ts","components/Secuirty/RequestPhonePin.tsx","components/Secuirty/NoPin.tsx","components/Secuirty/EnterPhonePin.tsx","components/Secuirty/CalculatePasswordScore.ts","components/Secuirty/PasswordInputs/PasswordCheckStatusImage.tsx","components/Secuirty/PasswordInputs/PasswordDeductions.tsx","components/Secuirty/PasswordInputs/PasswordScoreAdditions.tsx","components/Secuirty/PasswordInputs/NewPassword.tsx","api/Secuirty/UpdateUserPassword.ts","components/Secuirty/PasswordResetLanding.tsx","api/Administration/Permissions.ts","api/Administration/SubscriptionPlanCreate.ts","components/Administration/RolesPermissions/PermissionsSubscriptionModal.tsx","components/Administration/DualTableBox.tsx","components/Administration/Permissions.tsx","components/Administration/RolesPermissions/ApproveNewPermissionsModal.tsx","components/Administration/RolesPermissions/PermissionsRoleModal.tsx","components/Administration/RolesPermissions/ApproveRolePermissionsModal.tsx","components/Administration/RolesPermissions/ApproveSubscriptionRelationshipsModal.tsx","components/ProtectedRoute.tsx","authentication/GetUserDefaultRoute.ts","components/OrderRequests/GovOrderedService.tsx","formatters/FormatGender.ts","components/OrderRequests/GovOrderDonorInfo.tsx","components/OrderRequests/GovOrderRequest.tsx","components/sso/GetAuthFormPage.tsx","authentication/SSOCallback.tsx","api/GovReports/OnTrackReport.ts","api/GovReports/GovReportsObservable.ts","components/Reports/ReportParameters.tsx","components/Invitation/Portal/AddNewAdminModal.tsx","components/Invitation/Portal/PortalGrid.tsx","api/Invitation/Portal/PortalGridGetObservable.ts","components/Invitation/Portal/AddNewPortal.tsx","components/FormattedInputs/AccountInput.tsx","api/Reports/DriverCertificationReportGet.ts","components/Reports/WorkforceReportParameters.tsx","api/Reports/SummaryReportGet.ts","components/Reports/SummaryReport/IncludeArchivedOrders.tsx","components/Reports/SummaryReport/SummaryReport.tsx","components/Administration/OrderDefaults.tsx","components/Companies/PortalSelectionModal.tsx","components/Invitation/AddNewCompany.tsx","components/Invitation/RequireCompleteSetupModal.tsx","api/Logging/LogErrorToServer.ts","api/Administration/SendingFacilities.ts","api/Reports/UnmergedRandomResultsReport/DateType.ts","components/Administration/SendingFacilityModal.tsx","components/Administration/SendingFacilityPage.tsx","components/Randomization/ConsortiumPools.tsx","components/Randomization/ConsortiumPersonnel.tsx","components/Reports/PositiveReport.tsx","components/Reports/UnmergedRandomResultsReport/DateTypeSelection.tsx","components/Reports/UnmergedRandomResultsReport/UnmergedRandomResultsReport.tsx","api/Reports/UnmergedRandomResultsReportGet.ts","App.tsx","index.tsx"],"names":["reportWebVitals","onPerfEntry","Function","then","getCLS","getFID","getFCP","getLCP","getTTFB","CopyRight","state","buildVersion","packageJson","version","fetch","response","json","build","setState","Date","getFullYear","location","host","includes","this","Component","TOS","className","href","target","PrivacyPolicy","SetLoginPortals","Clinics","sessionStorage","setItem","JSON","stringify","setOrphanedResultsCount","orphanedResultsCount","toString","window","dispatchEvent","Event","getOrphanedResultsCount","getItem","result","parseInt","isNaN","COMPANY_SELECTED","COMPANY_UPDATED","CLINIC_LIST_UPDATED","ALLOW_COMPANY_SELECTION","SelectCompany","participationId","logInLink","company","loginLink","type","payload","Link","GetAuthToken","ClearAuth","localStorage","removeItem","clear","SetSSOToken","token","GetSSOToken","v","SetSiteSearchMode","SetEmbeddedOrderMode","SiteSearchModeEnabled","GetSSOAction","GetUserId","userIdText","userIdNumber","USER_LOGIN","SSO_USER_LOGIN","SSO_TOKEN_USER_LOGIN","doNotTrustClientIps","USER_LOGGED_IN","WorkforceOneUserHasLoggedIn","webToken","userId","ssoToken","loginDetail","id","console","log","toast","success","Portal","Clinic","AuthToken","UserId","USER_LOGGED_IN_FAILED","WorkforceOneUserLoginFailed","message","error","USER_LOGGED_IN_WRONG_URL","USER_LOGGED_OUT","WorkforceOneUserLogOut","skipRedirect","USER_P_RESET","SiteAdminRole","CompanyRole","PortalAdmin","LocationAdmin","NoAdminRole","isAdminRole","roleSearchFor","Workforce1State","role","isSiteAdmin","isCompanyAdmin","isPortalAdmin","isLocationAdmin","isUser","defaultMenuSetting","authenticated","canShowNotification","canShowOrphanedResults","canShowRolePermissionSubscription","superUser","canManageTeam","canViewOrder","canViewSiteSearch","canViewOrderTrackingGrid","canViewPersonnel","canEditPersonnel","canManagePools","canManagePersonnel","canManageSelectionInbox","canShowInvitationStatus","canInviteClientUser","canCreateClient","canManageClient","canShowPortal","canSearchDefaults","CanManageGovPools","CanManageConsortiumPools","CanManageGovDonors","CanOrderGovServices","canCompleteEvents","canVieweCCFCopy2PreMRO","canViewMISReports","canEditPendingOrders","canMergeTests","canMatchTests","BuildUserAccess","menuSetting","isLoggedIn","currentUserPermissions","perm","CanShowNotification","CanShowPortal","currentCompanyPermissions","CanViewOrder","CanViewSiteSearch","CanViewOrderTrackingGrid","CanViewPersonnel","CanEditPersonnel","CanManagePools","CanManagePersonnel","CanManageSelectionInbox","CanShowInvitationStatus","CanInviteClientUser","CanCreateClient","CanManageClient","CanShowRolePermissionSubscription","CanManageOrphanResults","CanSearchDefaults","CanCompleteEvents","CanVieweCCFCopy2PreMRO","CanViewMISReports","CanEditPendingOrders","CanMergeTests","CanMatchTests","isSiteAdminVal","isCompAdminVal","isPortalAdminVal","isLocationAdminVal","GetSelectedAssignedClinic","companyIdToSearchFor","selectedCompany","clinicFound","Workforce1Companies","visibleCompanies","portal","AssignedClientDetailsOfClinic","clinic","ParticipationID","GetSelectedPortal","find","item","undefined","noUserNameFound","getUserNameForSelectedCompany","clinicPicked","UserName","RoleIdForSelectedCompany","RoleID","SelectedCompanyName","Name","SelectedAccountName","assignedClinic","LocationID","LocationName","CompareAccounts","a","b","localeCompare","SelectedPortalName","ImplementationName","getLoggedInUserName","userName","BuildUserState","selectedPortal","Home","SSOHome","OrderRoute","OrderFinishRoute","SiteSearchRoute","SiteSearchOptionsRoute","OrdersRoute","GovDonorRoute","RandomsRoute","RandomsGovRoute","ConsortiumsRoute","GovOrderRoute","RandomsPersonnelRoute","ConsortiumPersonnelRoute","SelectionInboxRoute","OurTeamStatusRoute","MyInformationRoute","MyOrganizationRoute","BaseAdministrationRoute","MyOrganizationNameRoute","AddNewPortalRoute","PortalDetailsRoute","name","PortalAdministrationRoute","CompanyInformationRoute","CompanyInformationNameRoute","CompanyDetailsRoute","AddNewCompanyRoute","AddNewCompanyNameRoute","AddCompanyForPortalRoute","LocationInformationRoute","ActivateUserRoute","ActivateCompanyRoute","ActivatePortalRoute","GlobalParameterRoute","OrderableServicesRoute","UserCodesRoute","UserLabelsRoute","RegulatoryModeRoute","OrphanedResultsRoute","PermissionsRoute","InviteStatusRoute","SSOOrderRoute","SSOOrderFinishRoute","SSOSiteSearchRoute","ReportPositiveRoute","SSOGetAuthFormRoute","ReportTestingSummaryRoute","ReportSpecimenPositivityRoute","ReportDrugDetailRoute","ReportDailySummaryRoute","ReportIvrCallInComplianceRoute","ReportNoShowRoute","ReportCertificationRenewalRoute","ReportCertificationStatusRoute","ReportManagementSummaryRoute","ReportMISRoute","ReportSelectedNotTestedRoute","ReportSummaryRoute","ReportUnmergedRandomResultsRoute","ConfigureOrderDefaultsRoute","SendingFacilityRoute","LabResultsReportingRoute","ActionButton","props","spin","disableOnSpin","disabled","children","buttonProps","actualDisabled","actualClassName","Button","Spinner","animation","size","variant","React","ApiHostName","baseDomain","hostname","firstDotIndex","indexOf","domain","substring","protocol","port","ApiUrl","ApiRootUrl","FullBaseUrl","origin","PortalSource","BuildFetchRequest","body","method","authDetails","api_version","Agent","IsMarketPlace","auth_token","credentials","headers","Headers","defaultCurrentUserPermissions","COMPANY_PERMISSION","USER_PERMISSION_CHANGED","WorkforcePermissionChanged","userPermissionData","userPermission","getCleanUserState","isLoading","loadedSelectedCompanyPermission","requireCompleteSetup","showCompanySelection","Workforce1User","action","loginResultMessage","Message","loadingCompany","link","companyPermission","createRootReducer","history","combineReducers","router","connectRouter","BuildAuthRequestFromAppState","StorageKey","EventType","ClinicStatus","ScheduleStatus","AccountType","WorkforceOneUserAccess","action$","states$","pipe","ofType","mergeMap","value","loginDetailFromAction","fromFetch","switchMap","ok","Promise","resolve","map","data","WorkforceOneUserLoginEpic","state$","catchError","err","UserLoginID","ImportCSVMaxFileSize","MaxImageFileSize","MaxFileNameLength","EmailRegexp","PhoneRegexp","NameRegexp","CompanyNameRegexp","MaxDonorIdLength","InvalidDonorIdLength","DonorIdRegexp","InvalidDonorId","SiteDomain","ProtectedSites","ReCaptchaSiteKey","IpifyUrl","InvalidNameMessage","DisabledDefaultOrderableService","ImplementationTypeGovt","MaxDateMonthly","defaultCompanyPerms","CanShowClinicAdminSetup","CanShowInvitation","CanShowClientInvitationStatus","CanShowUserInvitationStatus","CanViewTracking","CanViewCompleted","CanCreateInstance","CanViewRandomTesting","CanManageClientUser","CanManageInstanceUser","CanManageServiceEvent","CanViewOrderSummary","CanUploadImages","CanViewAddressAlert","CanGroupInclude","MapApiResponseToAction","apiResponse","logoImage","LogoImage","implementationType","ImplementationType","OrphanedResultsCount","processResponseData","responseModel","adminRoleType","IsClinic","IsClient","IsSiteAdmin","IsLocation","companyResponse","UserAccessViewModel","WorkforceOneUserCompanyPermissionChange","WorkforceOneUserPortalPermission","EMPTY","Status","Completed","ClinicConfigured","UserConfigured","ClientConfigured","of","WorkforceOneUserAutoCompanySelectionEpic","selectedLoggedInUser","length","allCompanies","companies","filter","showSelection","PAGE_LOADED","WorkforceOneLoginPageReturn","loginToken","loginId","portalsInformation","storageForPortals","parse","GetLoginPortals","loginPayload","WorkforceOneCompanySelectPageReturn","companySelection","WorkforceOneLogOutFromPasswordReset","WorkforceOnePasswordResetRequest","WorkforceOneSSOUserLoginEpic","RequestToken","WorkforceOneSSOTokenUserLoginEpic","rootEpic","combineEpics","ForceReload","baseUrl","getBaseUrl","store","initialState","epicMiddleware","createEpicMiddleware","middleware","routerMiddleware","enhancers","windowIfDefined","__REDUX_DEVTOOLS_EXTENSION__","push","createStore","compose","applyMiddleware","run","configureStore","createBrowserHistory","basename","LogOut","dispatch","HttpStatusCode","APIError","errorData","Error","ObservableFromFetch","url","Observable","observer","controller","AbortController","init","signal","text","statusText","status","UNAUTHORIZED","code","next","complete","catch","abort","UserPasswordReset","email","isForgot","requestBody","InvitationLink","IsForgotPassword","ChangePasswordModal","emptyState","loginName","isEmailValid","dataSaving","userPasswordResetSubscription","handleAPIError","handleCancel","onCancel","handleSubmit","unsubscribe","subscribe","onSubmit","test","handleEmailChange","LoginName","Modal","backdrop","dialogClassName","show","Header","Title","Body","Form","Container","fluid","Row","Col","Control","maxLength","onChange","e","Footer","onClick","NavDropdownHover","isOpen","handleOpen","handleClose","NavDropdown","title","alignRight","onMouseEnter","onMouseLeave","HasAccessToRoute","route","userAccess","userState","ssoRoutes","isSiteSearchMode","isGetAuthFormMode","isLocation","IsOnTrack","NavMenuLink","Nav","NavMenuLinkWithNumber","count","style","color","PortalCompanySearch","loading","companies$","companiesSubscription","companyRef","createRef","current","query","locationsOnly","accountID","Subject","debounceTime","distinctUntilChanged","params","trim","concat","AccountID","toLowerCase","o","switchCompany","showCompaniesSearch","showLocations","some","emptyLabel","placeholder","labelKey","minLength","maxResults","paginate","useCache","inputProps","autoComplete","onBlur","clearResult","onSearch","searchCompanies","selected","options","positionFixed","ref","option","NavMenu","showChangePassword","buildUrl","dropMenuItem","bypassPermissionsCheck","key","Item","dropMenu","items","menuItems","i","render","onStorageChanged","selectCompany","routeToHome","performChangePassword","logoutClick","hideChangePassword","showChangePasswordClick","hash","logout","addEventListener","removeEventListener","Navbar","bg","expand","Toggle","Collapse","isShowPortals","getPortalsMenu","Text","portalItems","sort","reduce","acc","portalIndex","portalItem","parentCompany","assignedClinics","parentCompanyItem","Fragment","clinicItems","permissions","portals","ConnectedNavMenu","connect","companyLink","AppNotice","configure","sixtyMinutesInMilliSeconds","MouseDetectionLogoutTimer","mouseMoveTimeOut","timerRanOut","loggedIn","logOut","mouseMoved","clearTimeout","setTimeout","onMouseMove","connector","ChromeBrowser","browserFound","navigator","userAgent","appVersion","chrome","opera","detectBrowser","SupportedBrowsers","browserClass","src","ChromeImage","alt","width","EmailSupport","AppPageWrapper","logoSrc","portalImage","encodeURI","getPortalLogoImageSrc","embedingMode","showNav","hideLogo","lg","span","order","showSupportedBrowsers","FIRST","PREVIOUS","NEXT","LAST","TablePagination","pageChanged","page","innerText","pageNumber","pages","getPaginationItem","label","active","Pagination","getPagination","startIndex","endIndex","currentPageNumber","displayCount","Math","ceil","min","Checkbox","Check","FilterItem","checked","ColumnHeaderFilter","open","searchText","nameInput","toggleElement","listElement","toggleDialog","closeDialog","changeTextFilter","checkboxChange","index","findIndex","String","prevState","newItems","slice","every","forceUpdateGrid","getFilteredItems","setFilter","filtered","onFilter","handleSort","onSort","rowRenderer","resetFilterItems","prevProps","arraysEqual","a1","a2","a1Sorted","a2Sorted","filteredItems","checkedValues","checkAll","itemValueLabels","unshift","uppercase","hidden","Overlay","container","placement","rootClose","onHide","popperConfig","modifiers","offset","offsetLeft","offsetTop","arrowProps","popper","clearFilter","clearFilters","height","autoFocus","tabIndex","input","focus","rowCount","rowHeight","defaultProps","SearchBar","selectedField","defaultField","setSearchField","field","handleSearchTextChange","formatValue","ID","handleKeyDown","resetSearch","allowBlank","searchFields","searchAllowed","searchField","InputGroup","Prepend","Dropdown","Menu","as","eventKey","onKeyDown","Append","resetButton","md","LabAccountListGetObservable","DOT","RegionID","SearchBy","SearchFor","LabPanelsGetObservable","labAccount","vendorID","IsDOT","IsPoct","LabAccountNumber","VendorID","SelectionIntervalsGetObservable","LabServiceRegulatoryModesGetObservable","isDOT","GetAccountsByNameObservable","showInactive","accountType","Company","request","AccountTypeID","Limit","ImplementationGroupID","ShowInactive","GetAllAccountsByNameObservable","CompanyInput","companyAsyncTypeahead","companyTypeahead","subscription","defaultCompanyName","defaultValue","getCompanyName","subcribeCompanies","onInputChange","pathname","participation","p","c","filteredCompanies","allowedCompanies","Array","isArray","merged","forceEdit","filterBy","toggleMenu","withRouter","PoolUpdateObservable","IsConsortium","RegulatoryModeID","SelectionInterval","DrugTarget","DrugSampleSize","AlcoholTarget","AlcoholSampleSize","ProviderMappingID","PanelID","PoolCalculationType","FixedOrRate","Code","PoolID","PoolName","UseFileImportForPoolMembership","DateFrom","format","parseISO","ProgramIntervalStartDate","DateTo","ProgramIntervalEndDate","PrimaryIDType","IncludeCompaniesWithNoSelections","PanelCode","RegulatoryModes","RunOnlyByPortalAdmin","PoolCreateObservable","PrimaryIDTypesGetObservable","PoolPrimaryIDTypesGetObservable","LoadingIndicatorWrapper","AddPoolModal","companiesLoading","regulatoryModesLoading","selectionIntervalsLoading","labAccountLoading","panelsLoading","primaryIDTypesLoading","poolName","poolNameValid","poolID","federallyRegulated","regulatoryModeId","selectionInterval","calcType","drugPoolSize","alcoholPoolSize","panelID","useFileImportForPoolMembership","primaryIDType","saving","currentCompany","includeCompaniesWithNoSelections","panelCode","panelCodeValid","selectedRegulatoryModes","availableToSelectRegModes","regulatoryModesSubscription","intervalsSubscription","labAccountsSubscription","primaryIDTypesSubscription","account$","labAccountSubscription","saveSubscription","checkPoolSize","handlePoolNameChange","event","handlePanelCodeChange","handlePoolIDChange","handleFederallyRegulatedChange","regulatoryModes","handleIntervalChange","handleCalcTypeChange","handleDrugChange","drug","handleAlcoholChange","alcohol","handleLabChange","labPanels","currentAccount","labAccounts","account","LabAccount","handlePanelChange","handlePoolMembershipTypeChange","handlePrimaryIDTypeChange","isValid","performSave","pool","IsNonDOT","AccountId","PoolCode","Number","onSuccess","onRegulatoryModeChange","selectedRegModes","availableRegModes","is_selected","availRegMode","j","selectedRegMode","handleRunOnlyByCompanyAdminChange","handleRunOnlyByPortalAdminChange","selectionIntervals","primaryIDTypes","filteredLabs","LabCode","LabClientMemberId","isOnTrack","availableRegulatoryModes","regulatoryModeDisabled","runOnlyByPortalAdmin","calcTypeMark","primaryIdType","companyName","centered","closeButton","Label","column","sm","htmlFor","isInvalid","Feedback","multiple","interval","Description","labPanel","xs","ConnectedAddPoolModal","companyAdmin","PoolStatisticsDetailsGetObservable","poolId","companyId","URLSearchParams","FormatTimestampFileName","subject","extension","date","getMonth","getDate","getHours","getMinutes","getSeconds","join","RandomSelectionListGetObservable","poolSelectionId","Extra","PageSize","PoolMembersID","PoolSelectionID","ProfileAccountTypeID","RandomSelectionListCsvGetObservable","accountId","RandomSelectionListPrintGetObservable","ClientDetails","GetRandomSelectionList","ProfileAccountID","RandomSelectionListPrintLettersGetObservable","CompanyID","SpecificAccount","FormatError","ConfirmationModal","showImage","textTitle","cancelButtonText","confirmButtonText","disableConfirmButton","spinConfirmButton","disableConfirmOnSpin","showCancelButton","showCloseButton","onConfirm","whiteSpace","GovPoolCheckTestsExistObservable","DraggableModalDialog","handle","ModalDialog","buildDaysToExcludeList","daysToExclude","parseISODate","parsed","DateExcludeDt","DateExclude","getTime","buildWeekdaysToExcludeList","DayOfWeekID","removed","RandomSchedulingExclusionsModal","weekdaysToExclude","showRemoveExistingEventsConfirmation","showAllGroupsConfirmation","dateCheckInProgress","dateToAdd","checkTestEventSubscription","handleExclusionDateDescriptionChange","selectedDayToExclude","selectedDayDescription","handleExclusionDateGenderChange","Gender","selectedDayGender","handleExclusionDateAllGroupsChange","setAllGroups","selectedDayPoolID","handleDateEvent","nativeEvent","KeyboardEvent","toggleDayExclusion","dayToExclude","getDayToExclude","selectedDate","getDay","addDayToExclude","DaysToExcludeID","ImplementationID","dateSeconds","datesExcluded","Object","assign","x","onSave","classNameDisabled","dialogAs","inline","peekNextMonth","adjustDateOnChange","allowSameDay","minDate","enableTabLoop","dayClassName","excludedDate","LoadingTableBodyWrapper","recordsCount","columnsCount","noDataText","colSpan","LoadingTableWrapper","hideContent","withBorder","withHeader","cssClasses","FormatDate","delimiter","CompletedTests","search","testDetailID","testTypeID","poolSelectionID","selectedTest","showTitle","onSelectTest","useState","Records","Pages","Total","gridData","setGridData","loadingTests","setLoadingTests","page$","useMemo","BehaviorSubject","TestDetailID","TestTypeID","PageNumber","useEffect","handleSelectTest","testId","t","readOnly","onChangeCapture","Reason","ReasonDescription","SampleID","Regulated","SampleType","DateOrdered","CCFLastName","CCFFirstName","CCFID","Location","el","CompleteRandomSelection","onClose","Search","setSearch","setSelectedTest","acceptProc","setAcceptProc","confirmSave","setConfirmSave","ModalHeader","ModalTitle","ModalBody","poolSelectionMatch","acceptOptions","CompletedTestDetailID","HasError","finalize","GetDonorID","donorId","mockDonorId","unmaskDonorId","GetDonorIDTitle","RandomSelectionList","loadingCsv","loadingPrint","loadingPrintLetter","showCompleteModal","listSubscription","csvSubscription","printSubscription","printLetterSubscription","refreshGrid","RandomSelectionListGet","poolSelection","row","TestFor","handleExportClick","RandomSelectionListCsvGet","export","csv","csvData","Blob","FileSaver","saveAs","handlePrintClick","RandomSelectionListPrintGet","print","base64pdf","pdfWindow","document","write","handlePrintLettersClick","RandomSelectionListPrintLettersGet","drugButton","testData","testID","DrugTestDetailID","alcoholButton","AlcoholTestDetailID","generateTestForContent","results","split","DrugIsCompleted","AlcoholIsCompleted","onCloseCompleteModal","withUpdate","TimePeriod","Table","responsive","DonorID","DonorSelectedAt","TestCompletedAt","ConnectedRandomSelectionList","PoolSelectionListGetObservable","pageSize","PoolSelectionRerunModal","onRefresh","running","setRunning","statistic","setStatistic","loadingStatistic","setLoadingStatistic","actualToSelectDrug","setActualToSelectDrug","actualToSelectAlcohol","setActualToSelectAlcohol","alternateDrug","setAlternateDrug","alternateAlcohol","setAlternateAlcohol","subs","DrugRequired","AlcoholRequired","validateSizeValue","CurrentPoolSize","isActualToSelectDrugValid","isAlternateDrugValid","isActualToSelectAlcoholValid","isAlternateAlcoholValid","GenerateAlternates","Period","xl","replace","RequiredDrug","RequiredAlcohol","AlternateDrug","AlternateAlcohol","ExtraDrug","ExtraAlcohol","PoolSelectionRerunObservable","PoolSelectionActionButtons","FilterDataModule","FilterCriteriaCode","FilterSaveResult","canceling","setCanceling","showCancelConfirmation","setShowCancelConfirmation","showRerunModal","setShowRerunModal","IsActive","PoolSelectionCancelObservable","TestingPeriodBreakdownGrid","selectionListModal","pageSubscription","convertDate","renderRows","showRandomSelectionLink","showSelectionList","PoolSize","SelectionDate","DrugSelected","AlcoholSelected","DrugExtra","AlcoholExtra","DrugCompleted","AlcoholCompleted","hideSelectionList","PoolSelectionListGet","newState","WorkforceReportType","EmptyPoolCriteria","FilterModuleID","RandomModule","FilterDataID","SaveAs","ForceOverride","IsFilter","SaveResultCode","SuccessfullySaved","SaveResultText","Items","EmptyPoolCriteriaItem","FilterCriteriaID","FilterCriteriaName","Values","CopyFilterDataName","CopyFilterDataNames","GetPoolCriteriaItemByCode","criteria","add","newItem","GetCompanyPoolCriteriaItem","GetRegulatoryModePoolCriteriaItem","RegulatoryMode","GetPoolCriteriaItemStringValues","val","StringValue","GetFilterDataNameIndexByID","filterDataId","CreateEmptyPoolCriteria","FilterDataToPoolCriteria","filterData","skipCompany","filterDataItem","poolCriteriaItem","FilterDataItemToPoolCriteriaItem","poolCriteriaValue","FilterDataValueToPoolCriteriaValue","IntValue","StringValue2","StringValue3","BoolValue","CopyPoolCriteriaValue","CopyPoolCriteriaItem","CopyPoolCriteriaValues","CopyPoolCriteria","CopyPoolCriteriaItems","GetPoolCriteria","SavePoolCriteria","poolCriteria","GetSavedQuery","filterDataID","DeleteSavedQuery","SaveQueryAs","getWorkforceReport","report","CertificationRenewal","CertificationStatus","ManagementSummary","MIS","SelectedNotTested","Summary","ManagementSummaryReportGenerate","parameters","MISReportGenerate","ExcusedReportGenerate","SelectedNotTestedReportGenerate","PositiveReportExport","FormatData","byteCharacters","atob","byteNumbers","k","charCodeAt","Uint8Array","printPdf","fileData","fileURL","URL","createObjectURL","showPdf","BirthdayInput","mask","required","MaskedInput","FromToDates","onFromSelect","onChangeFrom","onToSelect","onChangeTo","from","to","showMonthDropdown","showYearDropdown","dropdownMode","maxDate","customInput","AuditPoolModal","generating","setGenerating","setFrom","setTo","includeAllDates","setIncludeAllDates","handleCancelClick","AllDates","maintainAspectRatio","layout","padding","right","legend","position","labels","usePointStyle","boxWidth","fontSize","plugins","datalabels","display","scales","yAxes","ticks","xAxes","defaults","global","defaultFontFamily","defaultFontColor","PoolStatistics","statisticsLoading","criteriaLoading","showAuditPoolOptions","subscriptions","Subscription","company$","onCompanySelect","runExcusedReport","PoolStatisticsDetailsGet","statistics","isConsortium","CompanyName","CompanyCode","dataDrug","TotalTestsRequiredDrug","TotalTestsCompletedDrug","TotalTestsPendingDrug","dataAlco","TotalTestsRequiredAlcohol","TotalTestsCompletedAlcohol","TotalTestsPendingAlcohol","datasets","backgroundColor","borderColor","borderWidth","align","anchor","barPercentage","categoryPercentage","allowExcusedReport","allowAuditReport","TargetDrug","RateOrFixed","TargetAlcohol","AveragePoolSize","CloseProgramIntervalObservable","PoolGeneralInfoGetObservable","SetMissingPeriods","PoolVariant","MissedPeriodsModal","MakeUp","TotalCompletedDrug","TotalCompletedAlcohol","stateChanges","handleSelect","PoolProgramID","details","changeInput","fieldName","enteredValue","disable","inputValue","validForm","calcTypePercentage","calcTypeFixed","poolMembershipTypeFileImport","poolMembershipTypeCriteria","yes","no","calcTypes","ShortCode","PoolGeneralInfo","positiveValidity","isPoolNameValid","isFederallyRegulatedValid","isRegulatoryModeValid","isSelectionIntervalValid","isCalcTypeValid","isDrugSampleSizeValid","isAlcoholSampleSizeValid","isLabAccountValid","isLabPanelValid","isPoolMembershipTypeValid","isPrimaryIDTypeValid","isPanelCodeValid","editing","edit","showSaveConfirmModal","poolLoading","labAccountsLoading","labPanelsLoading","startInEditMode","CloseProgramYear","showMissingModal","regulatoryModeTypeahead","federallyRegulatedTypeahead","selectionIntervalTypeahead","calcTypeTypeahead","labAccountTypeahead","panelTypeahead","poolMembershipTypeTypeahead","labAccount$","selectionIntervalsSubscription","updateSubscription","closeProgramIntervalSubscription","loadPoolData","initial","onPoolUpdate","poolData","editData","handleToggleEditMode","loadRegulatoryModes","dt","rm","loadSelectionIntervals","createPanelsSubscription","availableLabPanels","selectedLabPanel","loadLabAccounts","selectedLabAccount","loadPrimaryIDTypes","selectedCalcType","handleLabPanelChange","handleRegulatoryModeChange","handleSelectionIntervalChange","calcTypeCode","handleDateChange","toISOString","parsePoolSize","handleSampleSizeChangeChange","what","validityField","numberValue","handleLabAccountChange","Panel","handleNoSelectionChange","ind","sampleSizeValid","primary_id_type_ind","changes","values","valid","startDate","endDate","startDatePlusYear","setFullYear","performCloseProgramYearSave","fixedOrRate","valueText","rowClassName","editable","openMissingPeriodsModal","onSaveMissingPeriods","margin","dataCalcType","dataCalcTypeMark","editingAndNoRun","IsRunRandom","editingAndNoRunNonClosePY","programInterval","regulated","regulatoryMode","panel","membershipType","includeCompanies","startDateStr","endDateStr","regModes","IsMissingPeriodTests","popperPlacement","MappingFieldsGetObservable","importJobID","ImportJobID","ImportJobCreateObservable","csvBase64","fileName","hasHeaderRow","companyID","isGovtPersonnel","multiplePools","CSVFileBase64String","FileName","HasHeaderRow","UseTemplate","GovtPersonnel","WorkforcePersonnel","MultiplePools","ImportJobMappingSetObservable","selectedFields","SelectedFields","ImportJobValidateObservable","ImportJobStartObservable","ImportJobCancelObservable","ImportJobValidationResultGetObservable","AutoFilterCompaniesGetObservable","IsFilters","AutoFilterValue","IncludeCompany","IncludeLocation","IncludeMaster","IncludeParent","IncludeRegion","ImportErrorDetails","errors","TableHeaderItems","TableRows","TitleMessage","CanBeImported","importErrors","setImportErrors","prev","errorMessage","renderImportCells","Cells","cell","dangerouslySetInnerHTML","__html","bordered","ImportPoolMembers","emptyData","step","fileInputKey","fileContent","fileHasHeaderRow","importData","mappingFields","mapping","validationResult","isCompaniesLoading","isSaving","isCancelling","showCancelConfirmModal","showImportConfirmModal","unfilteredCompanies","searchCompany$","companiesListSubscription","searchCompanySubscription","importJobCreateSubscription","mappingFieldsGetSubscription","importJobValidateSubscription","importJobValidationResultGetSubscription","importJobMappingSetSubscription","importJobStartSubscription","importJobCancelSubscription","poolCriteriaSubscription","createMapping","colsCount","max","HeaderItems","_","handleApiError","handleFileStepNext","isGovt","getMappingFields","importJobData","handleMappingValidate","selectedMappingFields","mappingField","UniqueName","mappingResult","startImportValidation","getImportValidationResults","validationErrors","performImport","Result","ErrorsData","onUpdate","resetState","performCancel","random","handleHandleFileUpload","file","files","ext","lastIndexOf","reader","FileReader","self","onload","stringLength","onerror","readAsDataURL","handleFieldMappingChange","mappings","valueKeys","fieldGroup","handleCompanyChange","comp","usedMappingFields","poolPrimaryIDType","companyPrimaryIDType","accept","selectedValue","keys","group","optGroupName","CancelImportMessage","ImportMessage","RunRandomSelectionMessagesGetObservable","RandomSelectionRunObservable","RunCancelPoolsObservable","cancel","selectedPools","Cancel","SelectedPools","RunRandom","messagesLoading","poolSelectionLoading","showRunConfirmation","handleSizeChange","handleFormSubmit","preventDefault","validity","runSelection","ContactId","UpdateMethodID","PoolId","runResults","sizeRowItem","valueField","valueValidityField","invalidMessage","sizeRow","statRequiredValue","alternateValueField","alternateValueValidityField","showAlternates","alternateInvalidMessage","messages","allowRun","disableForm","IsRunRandomSelection","SkipPeriodMessage","RunningPeriodMessage","RandomSelectionMessage","Companies","Email","Fax","FormFox","CISNET","LastUpdate","onRunFinish","CloseProgramYearIntervalObservable","CloseProgramInterval","showConfirmationModal","showEditPool","poolSaving","currentIntervalStartDate","currentIntervalEndDate","programIntervalStartDate","programIntervalEndDate","loadPoolDataSubscription","closeSubscription","currentStartDate","currentEndDate","nextStartDate","nextEndDate","handleProgramIntervalStartDateChange","handleProgramIntervalEndDateChange","showConfirmation","hideConfirmation","closeProgram","isIntervalValid","validateInterval","startYear","currYear","validationStatus","filters","ActiveSince","Occupation","Category","Supervisor1","Supervisor2","HireDate","TerminationDate","PreEmploymentTestOnFile","DateOfBirth","AddressLine1","City","State","Zip","WorkPhone","CellPhone","User1","User2","User3","User4","User5","User6","User7","User8","User9","User10","Manager","ReasonForInactivation","PoolMembersGridObservable","RandomSelection","Inactive","inactive","RpAccountType","PersonID","SortGrid","SortColumn","SortOrder","toUpperCase","Filters","columnFilters","GridFilters","gridParams","PoolMembersExportCsv","PoolMembersPrint","printParams","RandomPersonnelCheckbox","person","DraggableTypeColumn","Column","handleVisibilityChange","onVisibilityChange","isDragging","connectDragSource","connectDropTarget","defaultChecked","visible","DropTarget","canDrop","hover","monitor","draggedId","overIndex","findColumn","moveColumn","dropTarget","DragSource","beginDrag","originalIndex","endDrag","droppedId","didDrop","dragSource","DroppableContainer","atIndex","newColumns","columns","prevItem","splice","onChangeColumnsList","col","customize","ColumnsCustomizeModal","handleChangeColumnsList","handleSave","saveCustomized","storeKey","DndProvider","backend","HTML5Backend","datStr","loadCustomized","defaultColumns","savedColumns","columnNames","columLabels","validate","GeneralInformationGet","GeneralInformationSave","loginID","updateMethodID","UpdatePersonDemographic","regionID","locationID","SaveRegulatoryMode","RegEmpCatList","FormatPhone","compareValue","r","FormatSSN","FormatZipCode","ValidZipCode","postalCode","us","RegExp","ca","PhoneNumberMaskedInput","msk","intl11","formatCharacters","char","allowNotProvided","AutoFilterLocationsGetObservable","region","hideInactive","ParentAccountID","HideInactive","AutoFilterLocationsGet","GetUserLocationsAdministrators","userID","ApplicationUserID","AutoFilterLocationWithRegionGetObservable","regionId","StateSelect","typeahead","isDisabled","selectedCode","states","Abbreviation","FullName","dropButtonIfInvalid","TestReasonsObservable","StateObservable","RegulatoryModeObservable","regModeId","EmployeeCategoriesGetObservable","regModeID","createRegulatoryModes","items_count","selectedLength","copyRegMode","createEmptyRegMode","EmpCat","EmployeeCategoryID","PersonRegModeEmpCatID","Primary","RegMode","createEmptyEmployeeCategory","BeginEffectiveDate","EndEffectiveDate","UserLogin","UpdateDate","EmployeeRegModeModal","ITEMS_COUNT","isRegulatoryModesLoading","isCategoriesLoading","regulatoryModeTypeaheads","categoryTypeaheads","isRegulatoryModesEqual","items1","items2","itemsString","handleChangeRegulatoryMode","inputIndex","handleChangeCategory","handleChangePrimary","createRow","itemIndex","allRegulatoryModes","categoryTypeahead","regMode","regulatoryModeIndex","employeeCategories","availableCategories","employeeCategoryId","employeeCategoryIndex","employeeCategory","createTypeaheads","rows","Supervisor1FirstName","FirstName","Supervisor1LastName","LastName","Supervisor1ContactPhone","ContactPhone","Supervisor2FirstName","Supervisor2LastName","Supervisor2ContactPhone","isPhoneValid","SuperVisor1","SuperVisor2","requiredSup1Data","requiredSup2Data","validContactPhone1","validContactPhone2","validSup1FirstName","validSup1LastName","validSup2FirstName","validSup2LastName","regulatoryModeValue","primary","otherRegModes","HeaderRow","HeaderRowWithSwitchMode","showEditButton","InfoRow","UserRow","caption","empty","InfoRowWithInput","genders","GeneralInfo","isGeneralInfoLoading","isPersonDemographicsDetailLoading","isStatesLoading","isLocationsLoading","isSupervisorsLoading","selectedRegulatoryMode","locations","isSupervisorsLoaded","isStatesLoaded","isRegulatoryModesLoaded","isCompaniesLoaded","personDemographicRecords","userDefinedRecords","implementationAliasRecords","personDemographicObject","showEmployeeRegModes","showSupervisors","generalInfoSubscription","personDemographicsDetailSubscription","statesSubscription","supervisorsSubscription","locationsSubscription","generalInfoSaveSubscription","personDemographicsSaveSubscription","saveRegulatoryModeSubscription","locationTypeahead","genderTypeahead","hiredate","birthdate","terminationDate","occupationTypeahead","user1Typeahead","user2Typeahead","user3Typeahead","user4Typeahead","user5Typeahead","user6Typeahead","user7Typeahead","user8Typeahead","loadGeneralInfo","loadPersonDemographicsDetail","selectedLocation","loadStates","loadAllCompanies","initialCompanyChange","AutoFilterCompaniesGet","loadAllLocations","handleLocationChange","initialLoad","currentLocation","loc","RegModeEmpCat","Driver","DriverLICStateOfIssue","personID","pdo","OccupationCode","User1Code","User2Code","User3Code","User4Code","User5Code","User6Code","User7Code","User8Code","RegModCatList","ssnRequired","CompanyPrimaryID","employerIDRequired","driverIDRequired","alternateIDRequired","showDriverState","checkIsPhoneValid","checkIsNotEmpty","checkIsSSNValid","checkIsEmailValid","createFirstNameRow","isFirstNameValid","handleFirstNameChange","createLastNameRow","isLastNameValid","handleLastNameChange","createEmployerIdRow","Employer","isEmployerIdValid","handleEmployerIdChange","createAlternateIdRow","Alternate","isAlternateIdValid","handleAlternateIdChange","createSSNRow","SSN","isSSNValid","handleSSNChange","createDriverStateRow","handleDriverStateChange","createDriverIdRow","isDriverIdValid","handleDriverIdChange","createOccupationRow","ImplementationAlias","PersonDemographicObj","occupationTitle","occupation","Key","Value","handleOccupationChange","isOccupationValid","createRegulatoryModeRow","handleRegulatoryModeClick","handleRegulatoryModeSave","handleSupervisorsSave","Supervisor1Data","Supervisor2Data","handleRegulatoryModeClose","handleSupervisorsClose","createHireDateRow","setOpen","handleHireDateChange","isHireDateValid","createTerminationDateRow","handleTerminationDateChange","isTerminationDateValid","createDateOfBirthRow","DOB","handleDateOfBirthChange","isDateOfBirthValid","createAddress1Row","Address1","isAddress1Valid","handleAddress1Change","createCityRow","isCityValid","handleCityChange","createInactiveRow","handleInactiveChange","createReasonForInactiveRow","handleReasonForInactiveChange","createPreEmploymentTestOnFileRow","handlePreEmploymentTestOnFileChange","isPreEmploymentTestOnFileValid","createManagerRow","handleManagerChange","isManagerValid","supervisorInfo","createSupervisorRow","handleSupervisorsClick","isSupervisor1Valid","isSupervisor2Valid","createGenderRow","handleGenderChange","isGenderValid","createStateRow","statetID","StateID","statetCode","StateProvinceTerritoryID","handleStateChange","createCompanyRow","isCompanyValid","createLocationRow","isStateValid","createZipRow","zipValid","handleZipChange","createWorkPhoneRow","WPhone","isWorkPhoneValid","handleWorkPhoneChange","createMobilePhoneRow","isGov","CPhone","HPhone","isMobilePhoneValid","handleMobilePhoneChange","phone","createEmailRow","handleInputChange","createInfoRows","firstNameRow","lastNameRow","employerIdRow","driverIdRow","driverStateRow","ssnRow","alternateIdRow","companyRow","locationRow","occupationRow","regulatoryModeRow","superVisorRow","hireDateRow","terminationDateRow","preEmploymentTestOnFileRow","managerRow","activeRow","reasonForInactivation","genderRow","dateOfBirthRow","streeAddressRow","cityRow","stateRow","zipRow","workPhoneRow","mobilePhoneRow","emailRow","createUser1Row","demographicLabels","demographicInfo","User1Label","handleUser1Change","isUser1Valid","createUser2Row","User2Label","handleUser2Change","isUser2Valid","createUser3Row","User3Label","handleUser3Change","isUser3Valid","createUser4Row","User4Label","handleUser4Change","isUser4Valid","createUser5Row","User5Label","handleUser5Change","isUser5Valid","createUser6Row","User6Label","handleUser6Change","isUser6Valid","createUser7Row","User7Label","handleUser7Change","isUser7Valid","createUser8Row","User8Label","handleUser8Change","isUser8Valid","createUser9TextRow","User9Label","isUser9TextValid","handleUser9TextChange","createUser10TextRow","User10Label","isUser10TextValid","handleUser10TextChange","createUserRows","userRow1","userRow2","userRow3","userRow4","userRow5","userRow6","userRow7","userRow8","userRow9","userRow10","GetPersonDemographicsDetail","PersonDemographicRecords","UserDefinedRecords","ImplementationAliasRecords","canEdit","userPermissions","infoRows","userRows","PhoneType","ConnectedGeneralInfo","CurrentServiceDetails","TestDetailClinicalID","CompareMode","CurrentServiceDetailsForCompare","UpdateServiceData","TestEventID","FormFoxTestAN","PersonnelID","IDType","HomePhone","Phones","number","Work","Cell","ResolveAlert","TestEventAlertID","AccordionCard","Card","Accordion","FormatTime","CardRow","time","bool","titleBr","titleBreakpoints","valueBr","valueBreakpoints","titleXs","titleMd","valueXs","valueMd","ALT_OTHER_CODE","AlternateExcuseReasons","IsAltOtherExcuseReason","CollectionCard","EventData","schedulingResult","schedulingStatus","schedulingDate","DateScheduled","ScheduleStatusDescription","DateNotified","getSchedulingData","schedulingNotes","SchedulingNotes","excuseReasonCode","ExcuseReasonCode","excuseReasonText","AltReasonDescriptionByCode","excuseComment","ExcuseComment","isAltOtherExcuseReason","showSchedulingNotes","showExcuseReason","startsWith","showExcuseComment","DateCollected","CollectionStatusDescription","CollectorVendorName","CollectedBy","SplitSpecimen","DateArrived","ExamDetailCard","TestDetailPhysicals","Examiner","ExamResultDetailCard","ExamResult","ExpirationDate","BATAlcoholTestCard","BATResultCard","showConfirm","ConfirmLevel","scope","ScreenDeviceDescription","ConfirmDeviceDescription","ScreenDeviceSerialNumber","ConfirmDeviceSerialNumber","ScreenSequence","ConfirmSequence","ScreenLevel","TestingCard","isCovid","testingResult","testingText","testingStatus","testingDate","ReleaseStatus","LabReportDate","resultStatusCode","LabResultDescription","testingClassName","getTestingResult","LaboratoryVendorName","LabAccessionNumber","LabReceivedDate","ClinicalLabNotes","ReviewCard","MROVendorName","MROName","MROCopyCCF2Date","MROReceivedDate","MROReportDate","TestScreeningCard","ScreenResultDescription","ConfirmResultDescription","ScreenSampleTypeDescription","ScreenDeviceCode","ScreenDeviceExpirationDate","ConfirmSampleTypeDescription","ConfirmDeviceCode","ConfirmDeviceExpirationDate","TestSteps","currentRowInfo","currentServiceInfo","isCollection","TestType","IsClinical","isExamDetail","isAlcohol","isTesting","TestTypeDescription","isReview","isTestScreening","CurrentService","TestReleaseStatusDescription","MROResultDescription","TestReasonDescription","SampleTypeDescription","RegulatoryModeName","GetCurrentServiceHistory","PhoneNumberCard","readonly","isRequired","phoneNumber","PhoneNumbers","phones","ProcessingCollectionLabel","getCachedCollectionTests","CachedCollectionTests","getProcessingCollectionTests","timestamp","now","setProcessingCollectionTests","tests","isProcessingCollection","GovSendToLab","GovMarkAsComplete","Temperature","DonorInfo","setLoading","setPerson","sub","Subscriber","firstName","lastName","dateOfBirth","gender","formatGender","useEffectAfterMount","effect","dependencies","mounted","useRef","PanelResult","RecordTemperature","setIsValid","temperature","setTemperature","refObj","refInput","isRangeSelected","useCallback","NOT_SELECTED","IN_RANGE","OUT_OF_RANGE","SpecimenIdInput","InputSpecimenId","sampleId","setId","idRepeat","setIdRepeat","isIdValid","setIdValid","isIdRepeatValid","setIdRepeatValid","isIdFormatValid","alowEmpty","CollectorNotes","notes","AdditionalPanels","panels","setPanels","formatDrugLabel","forEach","m","onSelect","SendToLab","striped","MainPanelRow","onUpdatePanel","newPanel","SelectedStatus","POSITIVE","INCONCLUSIVE","ExternalID","InternalCode","NEGATIVE","MainPanels","isAllPanelSelected","isAllPanelDisabled","onSelectAllPanels","uncheckLabOnNegative","selectedPanels","entries","isAllSendToLabSelected","GetPanels","labAccountCode","DeviceID","Panels","labCode","sampleTypeCode","onLoading","deviceID","loadingPanels","setLoadingPanels","mainPanels","setMainPanels","additionalPanels","setAdditionalPanels","isLabSample","populatePanels","sampleType","SampleTypeID","GovGetLabDeviceDrugs","GovPerformCollection","collected","sendingToLab","markingAsComplete","isTempRangeValid","tempInRange","isSampleIdValid","TestDetailIDHash","testDetailIDHash","ReferenceID","referenceID","SampleTypeCode","sampleTypeID","TempInRange","sampleID","collectorNotes","SelectedPanels","markAsCompleteSubscription","sendToLabSubscription","withoutNotAvailable","isAllMainPanelsSelected","isAdditional","isUrineSample","isPOCTSample","hasSendToLabPanels","isCanMarkAsComplete","isCanSendToLab","showMarkAsComplete","showCanSendToLab","resultProcessing","Success","ImageData","onMarkAsComplete","validateForm","onSendToLab","onChangeTemperature","onChangeSpecimenId","onChangeCollectorNotes","onUpdatePanels","onSetLoading","validateTemp","testName","PureComponent","RandomTestCard","description","useIcon","TestReleaseStatusID","DrugTestInfo","testEventData","CCFPersonnelID","baseNameState","ccfName","CCFName","ccfFirstName","ccfLastName","showPerformCollection","ccfPersonnelID","closePerformCollection","isEditNow","editModeChanged","selectedCategory","loadCategories","handleDonorIdChange","updateFields","handleCcfFirstNameChange","handleCcfLastNameChange","handleCategoryChange","createGovPerformCollectionProps","TemperatureInRange","TestDetailDocument","onPhoneNumberChange","categories","curCat","modes","curMode","panelInfo","isPending","PendingCollection","isProcessing","CollectionInProcess","PendingLaboratoryTesting","isProcessingTest","isDrug","isEditable","performCollectionProps","regEl","validCategory","catEl","ScreenDeviceID","IsRandom","OverlayTrigger","delay","hide","overlay","Popover","EmployeeCategoryName","onMerge","PanelDescription","ConnectedDrugTestInfo","EventDetailsModal","editMode","updated","showConfirmSave","handleEditModeChanged","regulatoryModeID","employeeCategoryID","oldRegulatoryModeID","oldEmployeeCategoryID","handleUpdateFields","saveChanges","handleSaveChanges","onRefreshGrid","handleConfirmSave","handleConfirmClose","isPhonesValid","CurrentServiceHistory","detailsModal","handlePageChange","showDetailsModal","isOntrack","Service","EventDate","ReportDate","SearchEmployeesToMerge","personId","implementationId","searchBy","searchFor","MergeEmployees","originalPersonId","mergePersonId","OriginalPersonID","MergePersonID","EmployeeToMergeInfo","loadSubscription","mergePersonID","createDonorIdTypeRow","createDonorIdRow","PrimaryIDValue","donorIdTypeRow","donorIdRow","DefaultSearchFields","EmployesToMergeGrid","showEmployeeToMergeInfo","showEmployeeToMerge","hideEmployeeToMerge","ConnectedEmployesToMergeGrid","MergeEmployee","ConnectedMergeEmployee","GeneralInfoKey","TestingHistoryKey","EmployeeDetailsModal","currentTab","showService","modalHeader","Tabs","defaultActiveKey","activeKey","Tab","tabClassName","PoolMembersFiltersModal","selectedLocations","isLocationsEqual","handleClearAll","handleAddLocation","handleRemoveLocation","handleAddRegulatoryMode","handleRemoveRegulatoryMode","availableLocations","hasChanges","canClearAll","QueryNameModal","comment","handleConfirm","DualListBox","mapOptions","selectionLeft","selectionRight","idKey","DisableMessage","_lodash","isEqual","selection","mapOption","dir","all","newSelection","disabledOption","availableOptions","selectedOptions","availableTitle","selectedTitle","optionTitle","optionLabel","move","disabledkeys","RegulatoryModeSelection","SavedQueriesModal","idToDelete","handleSelectQuery","handleDeleteQuery","savedQueries","deleteSelectedQuery","onDelete","closeConfirmation","savedQuery","DeleteQueryImg","LocationSelection","ValidateConsortiumCompanyObservable","CompanySelection","selectedCompanies","validations","validating","showModal","validationMessage","validateSubscription","diff","vs","cs","n","PoolMembersCriteriaModal","saveAsSubscription","loadSavedQuerySubscription","availableCompanies","loadingLocations","isPoolCriteriaLoading","isSavedQueriesLoading","isSavedQueryLoading","showRegulatoryModes","showCompanies","showSavedQueries","showQueryName","criteriaSaving","querySaving","querySavingAs","saveQueryMode","originalCompanies","originalLocations","confirmSaveText","locationSubscription","deletedCompanies","getDeletedCompanies","getConfirmText","companyCriteria","handleSaveQuery","handleQueryNameSave","handleSaveQueryAs","save_mode","save_query_mode","newFilterDataItem","loadedPoolCriteria","getSelectedLocations","handleQueryNameClose","handleClearFilter","locationCriteria","handleSelectSavedQuery","companyItem","handleDeleteSavedQuery","handleShowSavedQueries","setRegulatorModes","handleEditRegulatoryMode","handleEdiLocation","handleEditCompany","getSelectedRegulatoryModeModes","PoolCriteriaID","PoolCriteriaIntID","PoolOptionID","getCompanyNames","names","getRegulatoryModeNames","locationIds","getSelectedCompanies","companyIds","getLocationNames","creatCompanyRow","creatCompanyRows","implementationID","companyNames","companyRows","regulatoryModeNamesStr","locationNames","savedQueriesPresent","isShowSaveQueryAs","PoolMemberCheck","Mask","PoolMemberAdd","AutoFilterRegionsGetObservable","RandomPersonnelGridMode","StatusOptions","AddPoolMemberModal","stateCode","personnelCheckEmptyData","idType","isPersonnelFound","checkMember","showAddPersonnelPanel","isRegionsLoading","regions","statesLoading","idTypes","regionTypeahead","loadAllRegions","AutoFilterRegionsGet","savePoolMember","selectedRegion","Region","ConsortiumPoolCode","IsConsortiumPool","EmployeeCategory","searchString","poolCompanyData","onAdd","validateState","handleAddMember","handleMemberSearch","formatSearchString","handleRegionChange","CompanyList","HasRegModeBlock","User9Alias","PoolMembersGrid","importing","removing","PoolMembersGridColumns","customizeModal","advancedFiltersModal","addPoolMember","selectedPrintRowIDs","selectedChangeStatusRowIDs","selectedRegions","selectedCategories","Active","employeeDetails","showPoolMembersCriteriaModal","visibleColumns","renderCell","colName","idValue","showEmployeeDetails","handlePrintSelectAllRowsChange","PrimaryID","changePersonRowSelection","stateFieldName","selectedRows","handlePrintSelectRowChange","handleChangePersonStatusSelectRowChange","handleSearch","handlePoolMembersCriteriaSave","closeModal","handleAdvancedFiltersSave","handleAddIndividualSave","dateString","personIDs","toogleMode","PersonIDs","ToogleMode","All","limitedAccess","headerColumns","columnFilterValues","sortGrid","filterGridColumn","allPrintChecked","manageIndividual","close","handleChangeStatusFilter","handleChangePersonsStatusClick","handleChangePage","ConnectedPoolMembersGrid","SelectionHistoryGrid","DrugPending","AlcoholPending","DrugNotComplete","AlcoholNotComplete","poolProgramId","hstRow","PoolHistory","poolProgramsLoading","poolProgramsYear","selectedPoolProgramId","selectedPoolYear","historyLoading","selectionHistory","poolProgramsSubscription","poolStatisticSubscription","loadPoolProgramsYear","startLoading","poolYear","Year","loadPoolStatistics","PoolStatisticsDetailsByProgram","poolYearItem","totalTestsRequired","totalEstimatedComplete","TotalEstimatedCompleteDrug","TotalEstimatedCompleteAlcohol","targetDrug","targetAlcohol","actualDrug","ActualDrug","actualAlcohol","ActualAlcohol","onPoolProgramSelect","DeleteNotificationContactsObservable","SendNotificationsObservable","GetNotificationMethodsObservable","GetNotificationEventsObservable","useNotificationAction","actionObservable","callback","processing","setProcessing","contacts","contactIds","ContactID","ContactIds","useNotificationContactsDelete","deletingContacts","deleteContacts","useNotificationContactsLoad","loadingContacts","setLoadingContacts","initialParams","GetNotificationContactsObservable","parsedRecords","record","reloadContacts","selectContacts","selectedContacts","useNotificationsSend","sendingNotifications","sendNotifications","NotificationContactsContext","createContext","NotificationContactsActionsContext","NotificationContactsProvider","actions","Provider","NotificationApplicationUserInfo","Phone","INFO_FIELDS","NotificationNameCell","maxWidth","overflow","textOverflow","NotificationApplicationUsersGridRow","user","selectUser","handleChange","formattedPhone","memo","useNotificationApplicationUsersLoad","loadingApplicationUsers","setLoadingApplicationUsers","initialSearchParams","handleApiResponse","GetNotificationApplicationUsersObservable","updateSearchParams","updates","setPage","searchApplicationUsers","reloadApplicationUsers","updateSelectedUsers","userIds","isSingleSelect","selectApplicationUsers","selectOneApplicationUser","selectedApplicationUsers","NotificationApplicationUsersGrid","onSelectUser","DEFAULT_SEARCH_FIELDS","NotificationEditTabTitle","icon","selectedCount","badgeVariant","badgeTitle","badgeContent","Badge","ToggleSwitch","onCheck","on","off","NotificationEventsTab","events","DisplayOrder","Group","NotificationMethodsTab","NotificationMode","methods","contact","disableMethod","methodText","EMAIL","TEXT","muted","top","NotificationModes","useNotificationContacts","notificationContactsContext","useContext","useNotificationContactsActions","notificationContactsActionsContext","useNotificationContactSave","setSaving","setError","setResult","submitContact","observable","parsedParams","NotificationMethodIDs","NotificationMethods","NotificationMethodID","NotificationEventsIDs","NotificationEvents","RandomNotificationEventID","SaveNotificationContactObservable","res","useNotificationEvents","selectedEvents","setEvents","resetEventsSelection","useNotificationMethods","TabKey","selectedMethods","setMethods","methodMap","selectedMethod","resetMethodsSelection","NotificationContactEditModal","initialContact","AUTOMATIC","notificationContact","setNotificationContact","Mode","Methods","Events","loadingMethods","loadingEvents","MANUAL","METHODS","EVENTS","tabKey","setTabKey","showAlert","setShowAlert","onContactSavedSuccessfully","savingContact","isMethodsValid","isEventsValid","shouldShowAlert","handleSelectApplicationUser","handleChangeNotificationMethods","handleChangeNotificationEvents","handleChangeNotificationMode","notificationModeValue","MANUAL_ROSTER_REMINDER","newEvents","Alert","transition","dismissible","mode","modeValue","ActionIconButton","NotificationActionCell","showDeleteConfirmation","setShowDeleteConfirmation","showNotificationConfirmation","setShowNotificationConfirmation","showContactForm","setShowContactForm","handleDelete","handleSend","NotificationEventsCell","types","ListGroup","NotificationMethodCell","getIconByCode","horizontal","NotificationGridRow","NotificationGrid","isAllContactSelected","ActionButtonWithIcon","NotificationDetails","showSendNotificationConfirmation","setSendNotificationConfirmation","handleDeleteContacts","handleSendNotifications","PoolNotifications","StatisticsKey","HistoryKey","GeneralInformationKey","PoolMembersKey","RunRandomKey","CloseProgramIntervalKey","NotificationKey","PoolDetailsModal","handleRunFinish","onPoolDetailsUpdate","limitedCons","showRunRandom","showPersonnelImport","ConnectedPoolDetailsModal","UnmaskDonorID","PoolGridCsvGet","BatchPool","BySel","LastMemberImport","LastSelection","ReadyToRun","MatchSel","SrchFor","TypeSel","PoolReadyToRunUpdateObservable","list","ReadyToRunList","RandomLink","path","RandomNav","TabContainer","canManageConsortiumPools","RunCancelNotificationModal","confirmationText","showNotes","overflowY","overflowX","note","messageRow","RunCancelModal","selectAll","handleCheckPool","executeRunCancel","poolsData","DrugRateOrFixed","AlcoholRateOrFixed","poolRow","csvHeader","RandomPools","updatingReadyToRun","modal","readyToRunChanges","runPools","cancelPools","updateReadyToRunSubscription","changePrintRowSelection","renderHeaderColumn","columnName","filterGrid","renderReadyToRunHeaderColumn","isReadyToRun","setAscSort","handleReadyToRunClick","strokeWidth","Selection","LastSelectionStatus","ReadyToRunDate","RequireManualVerify","handleChangeReadyToRunChange","hideDetailsModal","reload","hideModal","handleCreateSuccessful","onRun","onExportClick","downloadTemplate","PoolGridGetObservable","newSort","PoolGridPrint","AllPools","parentClassName","ConnectedRandomPools","Day","DayMap","Map","SUN","MON","TUE","WED","THU","FRI","SAT","getDayName","get","DeviceSampleType","WeekDays","Id","WeekdaysToExclude","day","today","handlerChange","GovGetCollectionTypes","LabAccountsGetObservable","LabAccountLookup","lab","dot","Laboratory","GovDeviceGetObservable","DevicesGetObservable","GovDeviceModifyObservable","getLabType","isUrineLab","isSalivaLab","isUrinePOCT","isSalivaPOCT","showLabForSelectedCollectionType","collectionType","GovCollection","devices","sampleTypes","isPOCTDevice","defaultSampleTypeID","defaultLabAccount","defaultPanel","defaultDevice","device","labAccountRef","panelSubscription","deviceSubscription","loadSampleTypes","labAccountNode","getInput","selectedSampleType","onTypeChange","loadPanels","loadDevices","onLabChange","filterSampleTypes","selectedPanel","onPanelChange","GovGetPanels","selectedDevice","onDeviceChange","handleSampleTypeChange","sampleTypeId","selectedLab","panelId","handleDeviceChange","deviceCode","d","populateSelectedOptions","uniqKey","optionValue","formChanged","showHeading","labelClassName","sampleTypeDisabled","labAccountDisabled","panelsDisabled","devicesDisabled","GetDaysToExclude","pendingRandom","DatesToExclude","datesToExclude","suppressCurrentYear","toLocaleDateString","year","month","FormatShortDate","toExclude","DatesToExcludeModal","daysExcluded","classNameButton","setShow","AddGovPoolModal","groupName","selectionFrom","selectionTo","groupNameValid","loadingAllGroupsExclusions","isAccountServiceAvailable","minSelectionFrom","maxSelectionFrom","minSelectionTo","maxSelectionTo","groupName$","groupNameSubscription","allGroupsExclusionsLoadSubscription","handleGroupNameChange","days","handleNumberOfSelectionChange","handleMaxNumberSelections","handleWeekdayToExcludeChange","putDaysToExcludeToState","handleDaysToExcludeChange","activeDaysToExclude","calcIntervalValue","currentValue","NumberOfSelections","MaxNumberSelections","LaboratoryAccount","DefaultPanel","DefaultDevice","DaysExcluded","rest","DoRemove","GovPoolCreateObservable","daysToExcludeWithoutRemoved","NumericInput","strict","serviceDOT","ConnectedAddGovPoolModal","SelectionReportPrint","statisticsSubscription","handleGroupSelectionClick","GroupSize","TestsCompleted","NoShow","govPoolId","GovPoolGeneralInfo","loadingDaysExcluded","loadDaysExcludedSubscription","handleTypeChange","addedAndRemovedDays","GovPoolUpdateObservable","GovPoolSelectionUpdate","DateSelected","DaysSelectedID","GovPoolDateSelected","govPoolSelection","dateSelected","govPoolSelectionSubcription","govSelectionSubcriptionUpdate","dateValid","dateSelectedID","loadGovPoolSelection","SelectionPeriod","calcDateRange","setDate","dateEnd","selectionDays","addDays","weekdaysExcluded","filterDate","RandomGovPools","dateSelectedModal","Type","Count","intersperse","arr","sep","formatDaysSelected","daysSelected","DaysSelected","DayOfWeek","elem","showChangeDateModal","DaysToSelect","GendersInfo","hasUpdates","hideDateSelectedModal","handleUpdateSuccessful","ConnectedRandomGovPools","GovPoolsObservable","GovDonorAddObservable","GovDonorEditObservable","EditGovDonorForm","donor","DonorId","GovPoolId","GroupAssignment","IntakeDate","Birthday","MobilePhone","l","defaultState","GroupAssignmentName","govPools","isDonorIdValid","isGroupAssignmentValid","isGovPoolsLoading","isNameValid","handleStreetAddressChange","stateKey","stateValidKey","emailValid","handleGroupAssignmentChange","GovPoolGet","selectedState","StateCode","loadPersonData","EmployerID","GovPoolID","GovPoolName","Address","donorInfoLabel","gp","ConnectedEditGovDonor","AddGovDonorModal","IVRLogForm","PersonId","FromDate","toDateString","ToDate","applyFilter","CallDate","PhoneNumber","IVRLogKey","GeneralInformation","ServiceKey","GovDonorDetailsModal","handleSuccessful","GovAccessCode","formData","DefaultColumns","GovDonorGrid","addDonorModal","showAddDonor","hideAddDonor","renderHeader","LastTestDate","SearchText","GovDonorGridGetObservable","ServiceTypeCode","ConnectedGovDonor","canManageGovDonors","TogglePanel","collapsibleId","header","onHeaderClick","in","SelectServiceTogglePanel","onCloseClick","onValidate","ServiceCode","emptyServiceType","ServiceTypeID","ServiceTypeName","ServiceTypeByCode","IsServiceTypeCodeDrug","Drug","IsServiceTypeCodeAlcohol","Alcohol","IsServiceTypeCodePhysical","Physical","ServiceTypeOld","OTHER_REASON_TEXT","EmptyServiceData","serviceTypeCode","None","serviceCode","isMarketplace","testToPerform","testToPerformObj","labAccountObj","reqSpecimenCollection","observedCollection","regulatoryModeObj","category","categoryObj","selectedTests","selectedServices","selectedTestType","isValidMode","SelectService","isAllServicesDisabled","shouldResetDOT","canAddDOT","canAddNonDOT","TestToBePerformGetObservable","emptyService","ServiceID","ServiceName","ServiceDescription","ActiveWorkForce","ActivateAll","Marketplace","FFServiceCode","MPSku","ServiceByCode","ServicesByServiceTypeId","serviceTypeId","AccountsForServices","services","accountServices","service","accounts","serviceId","AccountServicesByServiceId","IsServiceActive","activeItems","IsDefault","ActiveAccountServicesByServiceId","HasActiveAccountServicesByServiceId","IsServiceCodePOCT","POCT","IsServiceCodeWellness","Wellness","SelectSpecimenCollection","SelectObserved","DefaultLookupCode","RegulatoryModeControl","categoriesLoading","filteredModes","regulatoryMode$","onCategoryChange","isValidSelection","filterFields","modeDefaults","LookupCode","defaultMode","Show","def","FieldName","filteredCategories","FAADefaults","FAAEmployee","defaultFAA","IsServiceDrug","DrugDOTUrine","DrugDOTOral","DrugNonDOTUrine","DrugNonDOTOral","IsServicePOCT","IsServiceFLEX","FLEX","DrugService","serviceTests","orderableAccountServices","isDOTUrine","IsServiceDrugDOTUrine","isDOTSalive","IsServiceDrugDOTSaliva","isNonDOTUrine","IsServiceDrugNonDOTUrine","isNonDOTSaliva","IsServiceDrugNonDOTSaliva","isFlex","isPOCT","isActive","hasTests","DrugServicesPanel","orderableServices","selectedServiceCode","canAddPOCT","canAddFLEX","notMarketplaceServicesCount","marketplaceServicesCount","onChangeTestType","onUpdateTests","setAllServicesDisabled","callbackRef","handleSetState","updatedState","useStateWithCallback","setServices","canAddTests","disabledRegulatedSalivaService","isSalivaPanelsAvailable","disabledRegulatedUrineService","isUrinePanelsAvailable","disabledIfTestPresent","disabledIfFlexPresent","disabledMarketplaceService","disabledNotMarketplaceService","drugServices","serviceDrug","newServices","testsForEnabledServices","s","SelectDrugTest","defaultService","testsLoading","availableTests","isDot","setInitialState","labAccountCompanyName","filterTests","selectedService","isPoct","filteredTests","NDOT","groupTestsByService","testSampleType","SD","SLD","onChangeLab","UR","onChangeTest","selectedServiceEntry","shouldUpdateServiceCode","newServiceCode","newTests","onServiceAdd","isObservedMandatory","onPanelClose","setDefaultTests","denyAddService","hasAvailableTests","showSelectSampleTestType","showSpecimenCollection","showObserved","showDOTRelatedControls","selectServiceByDefault","getDefaultServiceByTest","getDefaultService","sampleTypeCodeValue","dotValue","serviceTestsEntries","getDefaultNonDOTServiceCode","getDefaultDOTServiceCode","getDefaultSampleType","lookupCode","hasDrugDOTOral","hasDrugDOTUrine","defaultDOTSampleType","DOTSampleType","hasDrugNonDOTOral","hasDrugNonDOTUrine","defaultNonDOTSampleType","NonDOTSampleType","labAccountNumber","newLabAccount","newLabAccountsArray","observedCheckedDisabled","dotImage","cat","SelectAlcoholTest","onChangeTestToPerform","availableAlcoholTestSampleTypes","selectedTestCode","AlcoholBreath","Breath","AlcoholBreathDOT","Saliva","AlcoholSalivaDOT","AlcoholSaliva","orderableServiceType","getServicesComponents","ServicesByServiceSampleType","canAddMarketplace","canAddNotMarketplace","servicesComponents","orderableService","serviceActive","item_id","item_value","item_disabled","item_checked","serviceComponent","SelectPhysicalExam","SelectOHS","OHS","service$","showPanels","alreadySelected","CHSService","onSelectService","CHSServices","isSelected","Clinical","CHSTests","SelectCHS","CHS","serviceData","onClinicalTestToBePerformedChange","showNoServicesFound","ServicesSelection","onAddService","completingPendingOrders","drugTestData","alcoholTestData","hasServices","PhysicalDOT","filterServicesByType","filterServicesByMarketplace","marketplace","canAddDrugDOT","canAddDrugNonDOT","canAddAlcoholService","maximumAlcoholTests","canAddPhysicalService","maximumPhysicalTests","reason","orderableServiceTypes","drugServiceType","alcoholServiceType","GetAlcoholServiceType","physicalServiceType","GetPhysicalServiceType","ohsServiceType","GetOHSServiceType","chsServiceType","GetCHSServiceType","alcoholServices","physicalServices","ohsServices","chsServices","drugAccountServices","alcoholAccountServices","physicalAccountServices","ohsAccountServices","chsAccountServices","showDrugSection","showAlcoholSection","showPhysicalSection","denyAddServices","eventType","showOHSSection","showCHSSection","formatFunction","changeHandler","blurHandler","enterTapHandler","keyCode","SearchDonorGetObservable","AdvanceSearchDonorGetObservable","DonorInformation","idTypeObj","Rank","birthDateInput","isDonorInfoSuccess","lastSearch","populateSSODonorData","SSODonorData","handleIdTypeChange","DonorIDType","idReadOnly","DonorFirstName","DonorLastName","DonorDOB","daytimePhone","DonorPhone","DonorEmail","address","Line1","Address2","Line2","onDonorSearch","idTypeObject","displayState","updateState","handleBirthDateChange","require","identifier","Identifier","IdentifierType","getDonorInfoSuccess","getDonorError","firstNameReadOnly","middleInitialReadOnly","lastNameReadOnly","homePhoneReadOnly","workPhoneReadOnly","stateReadOnly","genderReadOnly","middleInitial","eveningPhone","accessCode","fetchedDate","validDate","newData","noValueOrEmpty","MiddleInitial","eveningPhoneField","daytimePhoneField","isReadOnly","allowEdit","sendDonorInformation","info","validateDonorIdFormat","isFormValid","daytimePhoneRequired","isBirthDateRequired","showGenderField","onDonorChange","obj1","obj2","orderFormData","fillPendingFormData","MockDonorID","newInfo","showIdType","showMiddleInitial","eveningPhoneLabel","daytimePhoneLabel","validDonorIdFormat","TextFormControl","maxDonorIdLength","stateAbbreviationsToCommonWealthState","StateToTimeZone","Alabama","Alaska","Arizona","Arkansas","California","Colorado","Connecticut","Delaware","Florida","Georgia","Hawaii","Idaho","Illinois","Indiana","Iowa","Kansas","Kentucky","Louisiana","Maine","Maryland","Massachusetts","Michigan","Minnesota","Mississippi","Missouri","Montana","Nebraska","Nevada","NewHampshire","NewJersey","NewMexico","NewYork","NorthCarolina","NorthDakota","Ohio","Oklahoma","Oregon","Pennsylvania","RhodeIsland","SouthCarolina","SouthDakota","Tennessee","Texas","Utah","Vermont","Virginia","Washington","WestVirginia","Wisconsin","Wyoming","TimeZoneMapping","CalculateDateStrings","timezoneCode","formattedDate","gmtFullDate","gmtShortDate","timezone","timezoneDateString","toLocaleString","timeZone","timezoneDate","round","localOffset","getTimezoneOffset","sign","abs","padStart","userDate","hour","minute","shortDate","expirationDate","datePickerRef","addHoursToCurrentDate","hours","newDate","setHours","onChangeDate","timeInputLabel","dateFormat","showTimeInput","DefaultExtendExpirationMS","DefaultExtendExpirationHours","ExpirationDateChangeMarker","Schedule","schedule","handleOverrideAllowedChange","overrideAllowed","extendExpirationHours","handleHoursToExpireChange","hoursUntilExpires","sendSchedule","onScheduleChange","calculateExpirationDate","prevExpirationDate","expirationHours","estimatedExpiration","expirationMS","formattedExpirationDate","displayExpirationDate","dateStrings","initializeTimezone","updateTimeZone","TimeZone","proceedImmediatelyChange","enabled","proceedImmediately","defaultExpirationHours","defaultExpiration","DefaultValue","OrderDefaultID","allowDonorSelect","LocationQueryGetObservable","AutoCompleteString","AddressSearch","isOptionsLoading","defaultAddressInitialized","defaultAddress","searchQuery","addressesQuery$","addressesSubscription","performSearch","skipOnSearch","selectedPrediction","selectedOption","blur","activeItem","LocationQueryGet","defaultSearchCompleted","isSSO","promptText","disableSuggestions","isSearching","disabledSearch","Filter","handleRadiusChange","onRadiusChanged","sites","site","GroupName","newSite","PriceTier","priceTiers","pt","DisplayName","minRadius","clinicSearchOptions","SearchRadius1","maxRadius","SearchRadius2","getFilters","radius","onFilterChanged","clearFiltersIcon","PRICE_TIER_IMAGES","SiteCard","isMP","imageSrc","displayName","PriceTierDisplayName","FFEnabled","Distance","toFixed","HoursOfOperation","SiteRating","SiteServices","getServiceItem","onSiteSelected","ServicesGet","ServiceTypesGet","AccountServicesGet","AccountServicesSave","loadingServices","serviceGroups","loadAccountServicesSubscription","loadAccountServices","AccountServiceID","populateServiceData","populateServices","typeID","checkEnabled","serviceID","relatedService","accService","companyMode","enabledForPortal","enabledForCompany","loadInitialData","forkJoin","serviceGroup","ConnectedSiteServices","getInfoWindowString","VendorService","MapContainer","mapReactKey","bootstrapURLKeys","language","defaultCenter","center","defaultZoom","zoom","mapTypeControl","yesIWantToUseGoogleMapApiInternals","onGoogleApiLoaded","maps","markers","infoWindows","Marker","lat","Latitude","lng","Longitude","InfoWindow","content","bounds","google","LatLngBounds","marker","addListener","infoWindow","extend","fitBounds","handleApiLoaded","ClinicSearchPriceSetObservable","counter","ClinicSearchPriceTiers","ClinicSearchOptionsSetObservable","radius1","radius2","mpSitesOnly","ClinicSearchOptionsGetObservable","ClinicSearchListRemoveObservable","clinicSearchListTypeID","clinicSearchListIDs","clinicSearchListID","isRemove","ClinicSearchListAddObservable","RetrieveOwnedSitesObservable","UpdateOwnedSitesObservable","EmptySSOOrderRequestData","OrderRequest","Password","CustomerId","ExternalUserName","WFUserName","ClientID","CompanyAccount","ReferenceTestId","PostBackURL","Donor","Donoremail","GetEmbededTestEventWithDetail","formFoxTestAN","SetTestDetailVendor","SetFFTestDetailVendor","GetOrderRequest","requestToken","SiteSearch","isFilterShown","isMapShown","siteServices","filteredSites","isLocationsSearching","ssoOrderRequest","dataLoaded","customRadius","geolocation","available","priceTiersLoaded","embeddedTestEventLoaded","locationsQuery$","radius$","radiusOptionsSubscription","testEventSubscription","ssoOrderSubscription","priceTierSubscription","buildSearchCriteria","Radius","IsObserved","Codes","IsSSO","ReferenceTestID","IsFFOrder","PriceTierOverride","isFFOrder","referenceTestID","priceTiersOverride","latitude","longitude","Observed","embeddedTestsCodes","codes","FFCode","SampleTypeIsPoct","HR","Hair","isSearchAllowed","handleSearchCompleted","handleFilterChange","handleCustomRadiusChange","handleSiteSelection","onSiteSelect","сallbackLink","handleGeoLocationChange","getCurrentPosition","setPosition","coords","PERMISSION_DENIED","POSITION_UNAVAILABLE","TIMEOUT","dataCanBeLoaded","isPageLoading","handleAddressSearch","combineLatest","GetFFTestData","CallbackLink","DefaultAddress","showFilter","forceShowFilter","OrderedServices","showRemoveConfirmation","closeRemoveConfirmation","idToRemove","performRemove","canRemove","onRemoveService","canConfirm","trs","steps","OrderSubmitObservable","PotentialDonorMatchModal","selectedDonorMatch","selectDonorMatch","donorMatch","potentialDonorMatchList","Match","OrderDefaultsGet","OrderDefaultsSave","OrderDefaultsReset","LocationInput","locationAsyncTypeahead","locations$","defaultLocationName","getLocationName","subscribeLocations","RandomReason","emptyDonor","emptySchedule","issuerType","reasonObj","reasonOther","buildOrderRequestData","orderRequestToken","donorData","advanceSearchDonorSubscription","loaInitialDataSubscription","loadLocationsSubscription","parseOrderRequest","formatAddress","loadAllDefaults","defaultsLoading","populateDefaults","loadPendingDefaults","pendingDefaults","populateDefaultExpTime","defaultExpTime","ExpTime","Disable","reasonsDefaults","TestReason","filteredReasons","defaultReason","reasons","onReasonChange","defaultExpirationTime","isServicesConfirmed","loadLocations","locationName","resetForm","formKey","showSiteSearch","showPotentialMatches","nextServiceID","isDonorValid","submittedOrder","orderSubmitting","onCompanyChange","onLocationChange","reasonObject","hasDragService","newServiceID","showDrugWarning","modeObj","catObj","onConfirmServices","SavedOrderData","CanViewOrderFinish","goBack","handleAllowDonorClinicSelect","lastValue","allowDonorClinicSelect","donor_email","getIdTypes","regulatoryModeFromServices","onGoToStep1","onGoToStep2","saveOrder","DayTimePhone","EveningPhone","Mobile","categoryFromServices","saveSuccess","orderFinishData","ProfileNumber","FFresult","normalizeOrderedServices","FromSelectionInbox","OrderDonorSiteSelect","testToPerformDesc","labAccountDesc","closePotentialDonorMatchModal","submitPotentialDonorMatchModal","newDonor","closeDrugWarning","Urine","reasonsLoading","RequestText","formatPhone","MultipleDrug","MultipleAlcohol","MultiplePOCT","MultipleClinical","MultiplePhysical","POCTCount","CollectionVendorID","FormFoxVendorAN","Collector","ParentVendorID","FFID","Private","UseDOTForm","OutOfNetwork","iVendorID","SiteID","CollectorPhone","ConfirmDeviceID","CompanyFullName","PrimaryIDRank","RegionName","AllowDonorClinicSelect","ProceedImmediately","ExtendExpirationHours","UpdateMethod","IsAlcohol","IsAssociatedWithPool","IsCompleted","IsDrug","IsBackground","IsNew","IsPhysical","IsAudiogram","IsReleased","LaboratoryVendorCode","LaboratoryVendorID","LabPanelID","TestReasonID","Labbased","OrderComment","Normal","PersonDetail","AlternateID","DriverID","MockCCFPersonnelID","DriverLicStateOfIssue","MockAlcoholTestDetailID","MockDrugTestDetailID","SSOToken","BaseUrl","is_poct","is_flex","IsFlex","IsServiceTypeCodeCHS","ClinicalTestType","isIssuerValid","canGoToOrderFeatures","isStep2Available","allowClinicSelectValid","isOrderCanBeSubmitted","Background","disableReason","headerSteps","OrderRequestsHeader","maximumDrugTests","ConnectedOrderRequest","AuthFormProcessObservable","SendToEmail","SendText","EmailAddress","AuthFormByToken","OrderFinish","orderObj","TestDetailIDs","TestDetailClinicalIDs","authorizationID","servicesOrderedList","siteSelected","XMLFile","OrderReportPrintObservable","OrderXML","addEmail","emailItems","removeEmail","array","changeEmail","sendEmail","Boolean","Set","PhysicalTestDetailID","POCTTestDetailID","sendingEmail","SendEmailObservable","canAddEmail","addMobile","mobileItems","removeMobile","changeMobile","sendText","sendingText","SendMessageObservable","canAddMobile","mobile","finishOrder","sendLink","SendSelectClinicLink","OrderFinishObservable","ApiRequestToken","MarketplaceAuthNum","returnToStart","returnToSelectionInbox","getSavedOrder","orderDonorSiteSelect","savedOrderData","AlcoholTestDetailIDList","DrugTestDetailIDList","POCTTestDetailIDList","ClinicalTestDetailIDList","savedServices","serviceTypesList","serviceTypesString","AuthorizationID","CollectionTime","IDNumber","OrderDate","OrderedBy","OrderUpdatedAt","OrderUpdatedBy","RAImageID","MarketPlaceOrderNum","accountTypeID","ColumnFilters","ExportDateFrom","exportDateFrom","ExportDateTo","exportDateTo","Exact","DateRange","DateType","EndDate","StartDate","InProcessStatus","IsReviewed","IncludeArchived","includeArchived","Pending","IsSearch","SearchString","TrackPersonID","OrderResultsPrint","ResultsWatchObservable","testEventIDs","modifiedBy","TestEventIDS","testEventID","ModifiedBy","SearchFieldsGet","CompleteTest","Images","UnarchiveTest","CompleteModal","pools","hireDate","didHire","currentTest","currentDonorIndex","showHireModal","testsToProcess","processedTests","poolSubscription","handlePoolChange","onCancelHireModal","onSubmitHireModal","completeAllTests","completeTest","testToComplete","currentIndex","unarchive","newDonorIndex","newDonorTest","testForSameDonor","testEventId","stepStatusColor","stage","showCompleteOrders","InProcess","Cancelled","NoStatus","GridStatusInfo","TestTypes","statusDetail","stages","Stages","ScheduleStatusID","TestEventStatus","IsExpired","ColStatus","showEventStatus","collect","StatusDetail","collectDetail","CollectionStatus","extraStatus","shownStage","IsStatusVisible","Sequence","Detail","Content","stageStatus","ModalStatusInfo","fields","detail","DateOrder","ProcessedBy","SiteName","SiteAddress","CollectionDate","NotificationDate","Recipient","Method","LaboratoryName","DateReceived","MROStatus","renderStatus","ImageGet","GenerateMROReport","ReportKey","PrintRecords","GetMROLetter","ResultsResolveObservable","testsData","OrderTrackingCheckbox","idPrefix","Archived","AuthFormModal","isAfterUpdate","onEdit","ConnectedAuthFormModal","OrderCancel","testDetailClinicalID","MockTestDetailID","MockTestDetailClinicalID","OrderUpdate","ProcessingModal","SiteSearchPage","sendCallback","showFinish","spinnerMessage","retrieveFFTestAN","SendLink","SendCallback","updateOrder","serviceTiers","ServicePriceTier","collectionVendorID","formFoxVendorAN","FFVendorCode","collectorVendorName","servicePriceTiers","ClinicWasUpdated","callbackAction","OrderEditModal","clinicLoading","cancelling","showConfirmCancelOrderModal","showConfirmSaveModal","selectedExpirationDate","loadClinicSubscription","cancelSubscription","onClinicChange","calculateTimezone","newClinic","stateAbbr","performCancelOrder","onOrderUpdated","timeZoneName","extendHours","toggle","newExpirationDate","handleChangeExtendExpirationHours","currentExpirationDate","handleChangeExpirationDate","CollectionSiteInfoGet","clinicToDisplay","FormLabel","SendSelectClinicLinkObservable","DrugTestCompare","currentServiceInfoNew","currentServiceInfoOld","panelInfoNew","panelInfoOld","EventDataNew","EventDataOld","primaryIdNew","personelIdNew","testTypeOrSampleIDChanged","dataRow","newValue","oldValue","ignoreChanges","EventDetailsCompare","subscriptionNew","subscriptionOld","dataNew","dataOld","loadingNew","loadingOld","MergeFrom","PrintMode","SearchTestToMerge","mergeSubscription","showMergeFullCopyConfirmation","showMergeUpdateEmptyConfirmation","confirmMergeFullCopy","onMergeFullCopy","mergeTest","confirmMergeUpdateEmpty","onMergeUpdateEmpty","filterItems","selectTest","TestReasonCode","EventResultCode","EventStatusCode","testType","TestToMergeGetObservable","mergeMode","MergeTestDetailID","MergeMode","KeepReleased","updateData","createMergeParams","Dialog","PrintFormModal","REPORTS","printMode","setPrintMode","showPrintModal","setShowPrintModal","printing","hasReports","onPrintRecords","hidePrintForm","RECORDS","onPrintReports","onPrint","ReasonForTestCell","exportCsv","ExportCSVModal","searchParams","generatingCsv","setGeneratingCsv","includeArchivedOrders","setIncludeArchivedOrders","includeActiveOrders","setIncludeActiveOrders","OrderResultsExportCsv","WatchCell","TestEventAlert","Watch","WatchResolved","HorizontalScrollWrapper","gridRef","recalculateWidth","offsetVertical","gridWidth","setGridWidth","scrollWrapper","gridWrapper","updateWidth","clientWidth","verticalScrollBoxWidth","offsetWidth","onSyncScroll","scrollLeft","resizeSubscription","fromEvent","scrollSubscription","visibility","scrollWidth","visibleHorizontalScroll","FormFoxTestANColumn","prevRow","showAuthFormModal","isShowValue","GridIDNumber","idTitle","idRow","OrderTracking","searchFieldsSubscription","loadImageSubscription","loadReportSubscription","watchSubscription","resolveSubscription","OrderTrackingGridColumns","showStatusModal","showArchivedOrders","showExportOptions","completeModal","statusInfo","eventDetails","updatingWatchList","resolving","showResendAuth","showOrderEditModal","eventCompare","showMergeEvent","showSelectClinicEmail","generateCCFImage","image","canDownload","TestImageID","TestDescription","processCCF","isMroLetter","isMroLetterRow","RAImage","isMroCopy","isMroCopyRow","mroImages","printMROReport","processReport","Base64String","currentDate","ImageType","Base64Strings","handleTestDetailChange","selectedReports","selectedResults","iconsVisibility","MROReport","onCloseResend","onCloseResendEmail","handleWatchClick","handleResolveClick","AlertResolved","TimingAlertResolved","ResultsAcknowledged","showEventDetailsModal","showEventDetailsCompareModal","isFirstRow","isLastRow","showImageAlert","MockMergeFrom","MockTestEventAlertID","showImageAlertResolved","ImageAlert","ImageAlertResolved","canView","mapCCFImages","mapMROReport","MROStage","getResultText","MROResultID","LaboratoryTestingComplete","LaboratoryTestingCompleteReleased","LabResultID","MRONonDOTNeg","MRONonDOTPos","IsPOCT","IsFLEX","PoctComplete","PoctCompleteReleased","CRLCovidClearAntibody","CRLRapidResponseCovid","ccfImageDescription","isPositiveFlexInstantReport","imgSrc","ImageOHS","ImageCCF","ImageMRO","selectedIdentifierByRow","flattenResults","hideMergeEvent","onMergeEvent","ResultsGridObservable","Reviewed","testsSelected","firstSelectedArchived","dataColumns","printCell","justifyContent","alignItems","verticalAlign","dataRows","emptyRow","checkArchivedOrders","DonorName","handleAllTestDetailChange","groupedRows","ForgotPassword","userNameValid","handleShow","submitPasswordReset","controlId","LoginNavMenu","linkTo","bsPrefix","NotificationCard","notification","NotificationTitle","NotificationDescription","Subtitle","NotificationExpirationDate","NotificationPanel","pinnedNotifications","unpinnedNotifications","ShowOnClinicPortal","Pinned","notifications","Workforce1Login","username","password","showPass","inputType","login","toggleShowPass","colProps","block","foundToken","requestedUri","sourceIp","loginToWorkforce","PageLoading","delayedVisibility","IDENTITY_CONFIG","authority","client_id","redirect_uri","response_type","post_logout_redirect_uri","AuthService","userManager","signinRedirectCallback","getUser","signinRedirect","provider","UserManager","SSOWorkforce1Login","base64String","signIn","siteSearch","embeddedOrder","SetSSOPayload","isSiteSearch","isEmbeddedOrder","EmbeddedOrderModeEnabled","ForcePrimaryClinic","ssoTokenLoginToWorkforce","DraggableTypeItem","DraggableItem","exclude","excludeItem","findItem","moveItem","onChangeItemsList","AdditionalOptionsType","ForcePrimaryClinicOptions","FORCE_PRIMARY_CLINIC","IF_AVAILABLE","ONLY","AdditionalOptions","update","setOptions","OptionTypeID","ClinicSearchOptionTypeID","OptionValue","ClinicSearchAdditionalOptionsSetObservable","onUpdateOption","optionType","obj","getOptionValue","isPortal","DefaultOptions","mpSitesOnlyPortalAdmin","loadingOptions","loadingPrice","savingOptions","savingPrice","savingAdditionalOptions","updateAdditionalOptions","loadOptionsSubscription","loadPriceSubscription","saveOptionsSubscription","savePriceSubscription","digits","handleChangePriceItemsList","prices","newPrices","price","PriceTierID","Exclude","handleUpdate","handleSaveAdditionalOptions","validationErrorsRadius1","minValue","minRadius1Value","maxValue","maxRadius1Value","validationErrorsRadius2","maxRadius2Value","ParentRadius1","ParentRadius2","MaximumRadius","radius1Errors","radius2Errors","radius1Entered","radius2Entered","OwnedPrimarySites","clinics","primarySitesOnly","handleRetrieve","UsePrimarySitesOnly","ClinicSearchListID","borderless","ListOptions","adding","showSiteSearchModal","clinicSearchListTypeID$","addSubscription","removeSubscription","handleClinicClick","handleRemove","ids","handleAdd","userInfo","headerText","disableRemove","isCompany","IsPrimary","FFClinicGroupRow","handleExcludeGroup","excluded","ClinicGroupsFFModal","excludedGroups","groups","setGroups","loadingGroups","setLoadingGroups","savingGroups","setSavingGroups","subsRef","SearchRestrictID","RestrictCode","SearchRestrictId","handleHide","SetExcludedClinicGroupsObservable","ExcludeClinicGroupRow","ExcludeClinicGroupTable","onSelectGroup","ExcludeClinicGroup","TabName","refresh","setRefresh","setLoadingGroup","removingGroups","setRemovingGroups","handleHideClinicGroupsFFModal","handleGroupClick","handleRemoveGroup","DeleteExcludedClinicGroupsObservable","g","LISTS","tabName","BLACKLIST","ClinicSearchOptions","DEFAULT","lists","appState","buildVisibleLists","listTypes","listType","ClinicSearchListTypeID","Pane","ConnectedClinicSearchOptions","selectPortal","selectableCompanies","childCompanies","clinicIndex","Reg","UpdateConsortiumsMembership","Members","RandomPersonnelGridObservable","WithInactive","forceReload","RandomPersonnelExportCsv","RandomPersonnelPrint","RandomPersonnelAddPersonObservable","IsAddIndividualSearch","RandomPersonnelRemoveObservable","persons","force","AdvancedFiltersModal","companyTypeaheadKey","regionTypeaheadKey","unfilteredRegions","locationTypeaheadKey","unfilteredLocations","canEditCompanies","canEditRegions","canEditLocations","searchRegion$","searchLocation$","selectedCompanies$","selectedRegions$","isCompaniesEqual","isRegionsEqual","isCategoriesEqual","handleAddCompany","handleRemoveCompany","handleAddRegion","handleRemoveRegion","handleAddCategory","handleRemoveCategory","startWith","pairwise","prevCompanies","prevFilter","companiesAllowed","prevC","filterLength","companyChanged","shouldRequestApi","shouldSetEmptyResult","shouldUpdateUnfilteredList","shouldFillFromUnfilteredResult","isFirstTimeLoad","prevRegions","regionsAllowed","prevR","cAllowed","rAllowed","XrefAccountMapping","regionChanged","showRegions","accountName","RandomPersonnelAdd","EmploymentDetails","nonRegionLocations","companiesDetails","isEmployerIDValid","isDriverIDValid","isAlternateIDValid","isHomePhoneValid","isCategoryValid","Province","loadLocationsWithRegion","isNotEmpty","handlePhoneChange","convertedRegs","ssn","ConnectedEmploymentDetails","AddIndividualModal","addPersonnel","phoneString","primaryIDKeys","Supervisor1ID","selectedSupervisor1","Supervisor2ID","selectedSupervisor2","PreEmploymentTest","RegModeID","EmpCatID","ImportJobCreateAndPerformObservable","base64string","isCompanyCodeRequired","CompanyCodeRequired","ImportErrorDetailsModal","setShowModal","ConsortiumMembershipModal","save","DataRow","PersonAssignedToPoolID","toggleActive","cons","CSV_FILE_NOT_CORRECT_FORMAT_CODE","SEARCH_FIELD_NAME_SSN","RandomPersonnelGrid","RandomPersonnelGridColumns","removeConfirmModal","forceRemoveConfirmModal","removePersonMessage","addIndividualModal","showConsortiumsModal","selectedRemoveRowIDs","jobResult","importSubscription","RandomPersonnelRemove","handleRemoveSelectRowChange","handleActivateInactivateClick","ImportJobCreateAndPerform","click","handleRemoveClick","ConnectedRandomPersonnelGrid","Pool","Site","CRMUniqueID","RetireDate","Country","StateName","SelectionInboxGridCsv","EventExcuseObservable","generateReplacement","GenerateReplacement","UpdateExcuseNotesObservable","EventUnexcuseObservable","ExcuseEventModal","canExcuse","excuseMode","excuseSubscription","canExcuseSubscription","excuse","excuseDetails","toggleAlternateExcuseOption","onAltReasonChange","isAltOtherReasonSelectd","disableExcuse","disableAltrnate","disableExcuseButton","disableExcuseAnAlternateButton","exceuseButtonText","exceuseAndAlternateButtonText","paddingTop","UnexcuseEventModalModal","unexcuse","updateComment","disableUpdateButton","UpdateStatusToPending","SelectionInbox","SelectionInboxGridColumns","mapManager","records","element","handleExcuseModalClose","excuseRow","handleUnexcuseModalClose","unexcuseRow","isCanExcuse","isCanUnexcuse","statusButton","setPending","updateToPending","createdDateButton","manager","downloadCsv","ConnectedSelectionInbox","UserInformationObservable","IsOrderSecurityOverride","UserNotificationInformationObservable","ActiveUserInformationGetObservable","isActivateUser","IsActivateUser","UserNotificationInfoUpdate","EmailAddressList","ContactDetail","DeliveryType","IsNotificationEnabled","IsUser","NotificationEventIDs","NotificationServiceIDs","PhoneNumberList","RoleList","RoleTitle","Locations","timeZoneID","isCollectorActive","CreateUser","UserRevoke","applicationUserId","RoleOrderSecurityCheckObservable","roleID","NotificationOptions","selectedIDs","NotificationEventSelection","notificationEvents","setNotificationEvents","NotificationEventID","NotificationMethodSelection","notificationMethods","setNotificationMethods","NotificationServiceSelection","notificationServices","setNotificationServices","ParticipationId","NotificationServicesGet","NotificationSelection","showNotifications","checkedNotificationServiceIDs","checkedNotificationEventIDs","checkedNotificationMethodIDs","onCheckNotificationService","onCheckNotificationEvent","onCheckNotificationMethod","onCheckShowNotifications","AssociatedDataType","EmptyAssociatedData","CreatedBy","CreatedOn","ModifiedOn","saved","AdditionalAssociatedDataModal","onlyOneCanBeActive","showConfirmText","selectedIndex","emptyAssociatedData","hasActive","isUniq","itemsOnInit","resetAttributes","relatedItem","prevValue","deactivateItems","activeIndex","itemsToValidate","isNeedConfirmText","saveData","itemsToSave","addRow","removeRow","removedData","canAddRow","validData","changeContactDetail","toggleTextVoiceOption","setTextVoiceOption","textConfirmed","textNotConfirmed","verified","noInactive","CheckboxList","setData","selectedValues","LocationAdministrator","AdditionalRoleModal","roles","timeZoneId","mapRolesToRoleData","existData","Level","locationRole","handleCloseLocations","onSaveTimeZoneId","timeZones","TimeZoneID","handleTimeZoneChange","updatedRole","tz","OrderSecurityOverrideUpdateObservable","orderSecurityException","MockApplicationUserIDFrom","OrderSecurityException","SetDatePeriod","updateStateWithItems","parseDate","extItems","fromDate","toDate","setValidity","stringKey","OrderSecurityOverride","roleChecking","loadingOverrides","showSetDates","whoCanViewMyOrders","whoCannotViewMyOrders","loadUserSubscription","roleSecurityCheckSubscription","loadOrderSecurityOverrideSubscription","loginName$","roleCheck$","override$","handleLoginNameChange","OrderSecurityOverrideUpdate","MockApplicationUserID","handleRightItemClick","handleSetDatesUpdate","datePeriodItems","datePeriodItem","RoleOrderSecurityCheck","ApplicationUserIDFrom","WhoCanViewMyOrders","WhoCannotViewMyOrders","canFinish","RoleDescription","UserInfoMode","ConnectedOrderSecurityOverride","TimeZoneListGet","UserRolesGetObservable","GetRoles","requestParams","CheckExistingUser","ResetLoginAttempts","RemoveDuplicateRoles","DeleteUser","DeleteRole","applicationUserID","participationID","UserInfo","roleId","lastNameValid","firstNameValid","phoneValid","roleValid","companyValid","showRevokeConfirmation","showResetPasswordConfirmation","showResetLoginAttemptsConfirmation","showRemoveDuplicateRolesConfirmation","showDeleteUserConfirmation","showDeleteRoleConfirmation","canShowDetailsToPerson","showOrderSecurityOverride","revoking","resettingPassword","performingResetLoginAttempts","performingRemoveDuplicateRoles","performingDeleteUser","performingDeleteRole","showAdditionalPhone","showAdditionalRoles","emailChecked","emailAvailable","rolesTypeahead","userRevokeSubscription","userRolesSubscription","existSubscription","removeRoleSubscription","roleID$","timeZoneSubscription","performResetLoginAttempts","performRemoveDuplicateRoles","performDeleteUser","performDeleteRole","mapUserInfo","AssociatedEmail","AssociatedPhone","handleRoleChange","phoneIndex","newPhoneArray","handlePhoneChangeByEditModal","newActivePhone","isLocationAdministrator","handleEmailBlur","showNewUser","existingUser","emailExists","AssociatedRole","emailData","phoneData","roleData","Personal","SaveMethod","performRevoke","performPasswordReset","performClose","handleChangeNotificationService","notificationServiceId","handleChangeNotificationEvent","notificationEventId","handleChangeNotificationMethod","notificationMethodId","handleChangeShowNotifications","disableButtons","isPersonal","readonlyUserName","locationRequired","isShowAdditionalRole","disableSaveButton","formRows","LoginAttempts","modalContent","Team","ConnectedUserInfo","PrimaryRoleID","MyInformation","AssignedClinic","locationId","ConnectedMyInformation","Account","InActive","LastLogin","Role","ProfileStatuses","SendingFacility","InvitationSent","EnrollmentStarted","ImplementationsGetObservable","ReturnAll","InvitationStatus","CSVUploadModal","isFileNameValid","isFileSizeValid","uploadPercentage","uploading","fileUploadProgressSubscription","fileUploadSubscription","fileUploadProgress$","handleFileSelect","uploadStatus","handleUpload","onStartUpload","onUploaded","timer","scan","curr","takeWhile","disableUpload","templateCSVUrl","ProgressBar","CreateSiteAdministrator","UserUploadV2","PortalInvitation","UserProfileStatuses","statuses","AdditionalInfo","InvitationStatusMap","INVITATION_REQUESTED","INVITATION_STILL_IN_PROCESS","TOO_MANY_ATTEMPT","INVALID_URL","PENDING","EXPIRED","STARTED","PASSWORD_SET","USER_CONFIGURED","CLINIC_CONFIGURED","CLIENT_CONFIGURED","COMPLETED","InvitationInverseMap","entry","getStatusLabelByKey","getStatusKeyByLabel","DEFAULT_COLUMNS","SEARCH_FIELDS","UserDetailsGrid","showUploadSpreadsheet","loadAll","currentIP","implementationsSubscription","exportToCSVSubscription","implementationsTypeahead","UserIPGet","ip","getValue","showTeamInfoModal","showUserInfoFor","loginAttempts","showNewTeamInfoModal","handleInvitationSetupModalClose","handleImplementationChange","selectedImplementation","handleOpenUpload","handleStartUploading","IPAddress","handleBulkUploaded","LoadAll","onGoToInvitationLink","visibleGridColumns","IsQuickStart","UserDetailsObservable","inactiveString","implementations","UserDetailsCSVObservable","exportToCSV","LastLoginDate","siteAdminEmptyRow","ConnectedUserDetailsGrid","UserActivationObservable","ApplicationUserId","CompanyActivationObservable","PortalActivationObservable","UserActivation","selectedUser","saveUserSubscription","handleActivate","GetRegulatoryModeDonorByID","InsertRegulatoryModeDonor","ActivationType","PersonnelRegulatoryMode","RegulatoryModeNumberSelect","FormGroup","DropdownButton","ButtonGroup","DefaultRegulatoryModeOrder","SSNRank","SSNDescription","EmployerIDRank","EmployerDescription","AlternateIDRank","AltDescription","CommercialLicenseRank","CommercialLicenseDescription","DisplayState","RegulatoryModeForm","changeRegulatoryMode","checkAssignedRank","handleRankSelect","foundEntry","RegulatoryField","CompanyDataObservable","clientName","isActivateClient","IsActivateClient","ImplementationSearchObservable","isActivateClinic","IsActivateClinic","EmailCheck","CompanyNameCheck","isClient","InstanceName","CompanyCodeCheck","UrlCheck","EntityActivation","itemSaving","itemLoading","instanceName","selectedItem","CompanyActivation","PortalActivation","BusinessTypesGetObservable","CompanyInactivateObservable","CompanyUpdateObservable","CompanyCreateObservable","CompaniesGetObservable","ClientName","CompaniesDetailsExportCsv","AddressInput","onAddressChange","AddressMatchModal","addresses","selectedID","subTitle","onAddressSelect","OrderSecurity","overrideOrderSecurity","override","showOrderSecurityForm","onPrev","updateOrderSecurity","showSecurityForm","onNext","primaryRoleID","clientRoleID","ClientRoleID","GetRoleOrderSecurity","currentURL","CanOnlySeeOrdersTheyHavePlacedRole","CanSeeOrdersAnyUserHasPlacedRole","SetRoleOrderSecurity","cancelVariant","cancelText","submitText","invitationMode","ConnectedOrderSecurity","LabAccountCreate","LabAccountUpload","LabAccountSelection","checking","checkSubscription","handleLabCheck","handleNext","ImplementationClientFlag","isClinic","isLabSet","LabAccountListGet","ActivateAndInActiveLabAccountObservable","activeLabAccounts","inactiveLabAccounts","ActiveLabAccount","InActiveLabAccount","addNewLabAccountSelection","leftItems","rightItems","HideOnOrder","inActiveLabAccounts","handleLeftItemClick","shiftKey","ctrlKey","itemsTable","isLeft","userSelect","handleHideOnOrderChange","itemId","locationMode","portalMode","moveLeftToRight","moveRightToLeft","GetSubscriptionPlans","SubscriptionModal","subscriptionPlanID","availableSubscriptionPlans","loadSubscriptionPlans","selectedPlan","plan","SubscriptionPlanID","currentPlan","AutoFilterPortalsGetObservable","PortalsGetObservable","ShowAll","PortalUpdateObservable","PortalInactivateObservable","GetAllImplementationImageByImplementationID","UpdateBrandingImage","implementationImageID","activeDate","inactiveDate","ImplementationImageID","ActiveDate","InActiveDate","EditActiveImageDate","validActiveDate","validInactiveDate","canSave","PortalLogoInsert","logo","ManageImages","editActiveDate","progressBarKey","isFileTypeValid","isLogoSizeValid","uploadError","activeDateCanShowInvalid","inactiveDateCanShowInvalid","activeImages","inactiveImages","uploadSubscription","fileUploadSimulationSubscription","fileUploadSimulation$","loadImplementationImages","ImplementationActiveImages","ImplementationInActiveImages","fileType","img","Image","createImageBitmap","activeImage","handleUploading","ImageName","setActiveImage","newActive","allImages","newActiveImages","newInactiveImages","handleActiveImageDatesUpdate","activeDateString","inactiveDateString","canUpload","imageTable","LocationImportJobCreateObservable","WorkforceLocation","CompanyImport","portalID","handleStartImportValidation","calcColspan","tableColsCount","previewTableColsCount","TotalRowsCount","ValidRowsCount","Rows","RowNum","Errors","Warnings","OriginalString","PortalFields","nameValid","nameChecking","nameAvailable","emailChecking","rolesLoading","checkName$","checkEmail$","nameExistsSubscription","emailExistsSubscription","isRoleValid","isFieldsValid","handleNameChange","onNameChange","IsEmailExists","ConnectedPortalFields","LocationUpdateObservable","LocationCreateObservable","AddLocationModal","LocationInformationForm","streetAddress1","streetAddress2","city","zip","officePhone","fax","locationData","retrievedLocations","timeZonesLoading","showAddLocation","codeChecking","codeAvailable","inactivating","activating","showInactivateConfirmation","showLabAccountSelection","locationName$","checkCode$","searchLocationsSubscription","codeExistsSubscription","inactivateSubscription","mapState","mapLocationData","province","country","webSiteURL","WebsiteURL","handleRetrievedCompanyAddressSelect","handleAddressSelect","StreetLine","performInactivate","CompanyInactivate","performActivate","LocationCreate","LocationUpdate","handleHideAddLocation","handleLocationAddSuccess","isNameTextValid","isNameLengthValid","len","isCodeValid","LocationsGet","CheckLocationName","CheckLocationCode","validName","validCode","validStreetAddress1","validCity","validState","validZip","validPhone","validFax","formValid","saveButtonName","adminMode","EditLocationInformation","DeviceModal","deviceTypeahead","DeviceLabAccountXrefID","Delete","defaultStateFromProps","filterDevices","filteredDevices","currentDevices","addNew","Manufacturer","DeviceSelection","deleteSubscription","addNewDevice","deviceDetails","confirmModal","confirmDelete","showDeviceDetailsModal","devicePanelCodes","create","LocationImport","GetAdditionalTests","UpdateAdditionalTests","AdditionalTesting","loadLabAccountsSubscription","loadPanelSubscription","labAccountSelection","panelSelection","st","loadAdditionalTests","newPanelSelection","disableSave","ImplementationTypes","CompanyInformation","contactDerPhone","contactDerFirstName","contactDerLastName","contactPhone","contactFirstName","contactLastName","businessTypeId","portalAdminRoleID","companyData","isTPA","subscriptionPlan","NonTPA","portalData","portalAdminData","labAcctRequired","unmaskDonorID","showSubscriptions","showManageImages","formValidated","businessTypesLoading","businessTypes","subscriptionPlansLoading","subscriptionPlans","retrievedCompanies","showOrderSecurity","showDevices","showCompanyImport","showLocationImport","match","activeLabAccountsCount","showLocation","showAdditionalTesting","isStreetAddress1Valid","isPortalFieldsValid","isZipValid","isBusinessTypeValid","urlValid","urlChecking","isNameChecking","isCodeChecking","mroFileName","isMROFileSizeValid","showNewCompanyModal","searchPortalsSubscription","searchCompaniesSubscription","searchPortalsInitialSubscription","businessTypesSubscription","subscriptionPlansSubscription","loadCompaniesSubscription","urlExistsSubscription","companyName$","implementationName$","searchImplementation$","checkUrl$","mroFile","implementationName","load","mapSubscriptionPlan","retrievedPortalPredictions","retrievedPortals","mapPortalData","portalName","isUrlValid","urlAvailable","urlCheckMessage","BusinessTypesGet","UserRolesGet","mapRole","PrimaryIDTypesGet","mapPrimaryIDType","CompaniesGet","isNameAvailable","isCodeAvailable","mapCompanyData","isCompanyNameValid","ParentID","isSiteAdminOrPortalAdmin","isNew","commonFormValid","disableCodeEdit","isUrlAllowed","isUrlMaxLengthValid","prepareUrl","changeUrlStatePart","ContactDerPhone","ContactDerFirstName","ContactDerLastName","ContactFirstName","ContactLastName","BusinessTypeID","LabAcctRequired","TPA","SubDomain","PortalAdditionalRoleID","PrimaryTypeID","plans","street","handlePortalNameChange","handleCompanyNameTyping","handlePortalNameTyping","handleRetrievedPortalAddressSelect","handleRetrievedObjectChoose","updatePortal","createPortal","updateCompany","handlePortalFieldsValidation","codeValue","IsRandomization","NonRegulated","UpdateAdditionalFields","showAdditionalFields","observ","IsGOVTPortal","IsExistingUser","OfficePhone","mroFileContent","SubscriptionPlan","MROLogoFile","PortalUpdate","updateSeletectPortal","handleLabAccountsSelectionModalClose","handleLabAccountsNotRequiredChange","handleCompanyNameChange","handleCompanyNameBlur","handleCodeChange","handleCompanyCodeBlur","handleCompaniesExport","handleUnmackDonorIDChange","disableCheckUrl","allowAdditionalRole","AllowAdditionalRole","validContactPhone","validContactFirstName","validContactLastName","validContactDerPhone","validContactDerFirstName","validContactDerLastName","labAccountsCountValid","canImport","canImportLocation","showActivateButton","isIntl11","isFaxIntl11","businessTypeID","ConnectedCompanyInformation","WorkforceReloadPortalsCompanies","LocationInformation","MyOrganization","OrphanedDelete","DonorIdsCell","DonorRow","ImportErrorType","onSelectDonor","NoMatchingCreateNewObservable","importTestDetail","ImportTestDetailID","TestDetailImportID","TestImportExceptionID","DonorGrid","setDonorID","handleSelectDonor","donorID","PendingDrugTestRow","hideCheckbox","highlighted","isNotWithinCurrentProgramYear","currentProgramYear","testProgramYear","ProgramStartDate","classes","notCurrentYear","createdDate","timeDiff","isLess90Days","PendingDrugTests","importTest","ProgramEndDate","PendingDrugTestsButtons","ImportExceptionSubType","selectedDonor","acceptSpin","createNewSpin","onCreateNew","onAccept","DonorNotFoundError","errorRow","AddNew","setAddNew","modalTite","donorNotFound","ImportException","importExceptionSubType","ImportExceptionSubTypeID","TestDoesNotExist","MoreThanOneTestMatch","ReasonCode","dialogTitle","PendingTestDetailID","PendingClinicalTestDetailID","NoMatchingRandomError","createNewProc","setCreateNewProc","showDonorNotFound","setDonorNotFound","setHideModal","pendingTestDetail","KeepTestReason","NoMatchingRandom","PendingClinicalTestRow","PendingClinicalTests","PendingClinicalTestsButtons","DRUG_TESTS_TAB","CLINICAL_TESTS_TAB","NoMatchingTestError","selectedClinicalTest","setSelectedClinicalTest","acceptClinicalProc","setAcceptClinicalProc","createNewClinicalProc","setCreateNewClinicalProc","setCurrentTab","showDrugTestsTab","showClinicalTestsTab","NoMatchingTest","PendingTestDetailClinicalID","AccountNotFoundError","setAccountID","testDetailImportID","testImportExceptionID","OrphanedResults","selectedList","recordCount","showDonorNotFoundError","showNoMatchingRandomError","showNoMatchingTestError","showAccountNotFoundError","actionsSubscription","handleAllTestDetailCheck","handleTestDetailCheck","isClinical","deleteRecords","renderColumns","testDetailSelected","clinicalId","linkVisible","isShowErrorDialog","showErrorDialog","renderException","onCloseDonorNotFoundError","onCloseAccountNotFoundError","onCloseNoMatchingRandomError","onCloseNoMatchingTestError","isShowDonorNotFoundError","DonorDoesNotExist","MoreThanOneDonorMatch","isShowNoMatchingRandomError","isShowNoMatchingTestError","isShowAccountNotFoundError","LabAccountNotFoundorNotAssignedtoaCompany","LabAccountAssignedMorethanOneCompany","mapCCFImage","space","marginLeft","OrphanedGridGet","ConnectedOrphanedResults","InvitationStatusGrid","TimeZoneOffset","ResendInvitation","resend","DeleteInvitation","deleteModel","ResendInvitationModal","resendInvitationSubscription","deleteInvitationSubscription","deletingInvitation","resendingtInvitation","populateContacts","modalData","resendInvitation","onResendInvitation","deleteInvitation","onDeleteInvitation","AdminSetupModal","handleCreateClick","GetRoleDroplist","ConnectedAdminSetupModal","ShowModalForStatus","showAdminInvitation","InvitationStatusGridColumns","getUserName","keyCell","renderDataColumns","InvitationStatusListGet","ConnectedInvitationStatusGrid","GetGlobalParameter","parameterTitle","GlobalParameterUpdate","ParameterID","ParameterTitle","ParameterDescription","ParameterType","ParameterValue","ParameterTypeUpdate","ParameterTypeDescription","GetParameterType","parameterType","GetParameterTypes","ParameterTypeModal","parameterTypeID","parameterTypeDescription","isTypeValid","isDescriptionValid","dataLoading","handleDescriptionChange","ParameterTypeID","stateToData","GlobalParameter","parameterID","parameterDescription","parameterValue","createdBy","isTitleValid","isValueValid","parameterTypesLoading","parameterTypes","showAddParameterType","parameterTypesSubmitted","loadParameterTypeSubscription","handleExit","clearData","handleTitleChange","handleValueChange","handleParameterTypeChange","isParameterTypeValid","handleAddParameterType","addParameterType","closeParameterType","loadParameterTypes","isDataValid","isLoadingOrSaving","ConnectedGlobalParameter","OrderableServicesModal","portalServices","selectedCompanyID","portalTypeahead","loadPortalsSubscription","loadCompanyServicesSubscription","mapServiceToServiceData","mapAccountServiceToServiceData","mappedServices","accountService","portalAccountService","Disabled","saveObj","Services","AccountServices","toggleDefault","toggleActivate","handlePortalChange","handleEmptyPortal","selectedPortalID","disableDefaultTooltip","showDefault","ConnectedOrderableServicesModal","CopyCompanyUserCode","CopyCompanyUserCodes","GetCompanyUserCodes","userFieldType","UserFieldType","SaveCompanyUserCode","companyUserCode","DeleteCompanyUserCode","CompanyUserCodeModal","selectedUserCode","showConfirmUpdate","UserDefinedCodeID","ErrorMessage","disableEditCode","UserCodesModal","implementationFields","implementationFieldsLoading","companyUserCodes","companyUserCodesLoading","showCompanyUserCodeEditor","Dependents","showOnDeleteConfirmation","deletingUserCode","loadImplementationFieldsSubscription","loadCompanyCodesSubscription","getItemForEdit","handleImplementationFieldChange","userCodeClick","userCodeDeleteClick","handleCompanyUserCodeSave","userDefinedCodeID","handleCompanyUserCodeClose","handleDeleteCompanyUserCode","emptyUserCode","handleCloseDeleteConfirmation","keyValue","ConnectedUserCodesModal","SaveImplementationUserLabels","userLabels","UserLabelsModal","onDataLoaded","dataFromState","inProgress","SetImplementationLabResultsReporting","AccountLabResultsReportingGet","SetAccountLabResultsReporting","LabResultsReportingModal","POCTRequireLab","POCTRequireMRO","loadPortalSubscription","loadCompaniesData","UpdateUserLoginID","mroNonDOTNeg","mroNonDOTPos","poctRequireLab","poctRequireMRO","handleEmptyCompany","toggleMRONONDOTNeg","toggleMRONONDOTPos","togglePOCTReqLabConf","togglePOCTReqMRO","implementationGroupId","InvitationType","ConnectedLabResultsReportingModal","GetOneTimePIN","ScoreStatus","ValidatePIN","currentPin","showValidatePIN","didNotReceivePIN","pinDidNotMatch","requestNewPIN","validCaptcha","showTooManyAttempts","outboxAN","enteredPIN","OneTimePin","OutboxAN","validateOneTimePinSuccess","sendOneTimePINSuccess","onKeyUp","validatePIN","onBack","goToLogin","sitekey","onErrored","onExpired","hl","InvitationPage","ValidateIdentity","userMobileNumber","userPhoneNumber","currentOutboxAN","INVITATION_IN_USE","showSendPin","VALIDATE_PIN","showLinkExpired","getOneTimePIN","getOneTimePinSuccess","getOneTimePinError","setMethod","showByVoice","userEmail","pin","SetupComplete","CalculatePasswordScore","pwd","calculatedScore","numOfMidChar","noOfSymBonus","lcImgStatus","fail","ucImgStatus","numImgStatus","symImgStatus","midImgStatus","reqImgStatus","pwdLenImgStatus","pwdLength","noOfLC","noOfUC","noOfNum","noOfSym","numOfRequirements","noOfCharBonus","noOfLCBonus","noOfUCBonus","noOfNumBonus","noOfMidBonus","noOfRequirementsBonus","noOfAlphasOnly","noOfNumbersOnly","noOfRepChar","noOfConsecAlphaUC","noOfConsecAlphaLC","noOfConsecNumber","noOfSeqAlpha","noOfSeqNumber","noOfSeqSymbol","alphasOnlyImgStatus","pass","numbersOnlyImgStatus","repCharImgStatus","consecAlphaUCImgStatus","consecAlphaLCImgStatus","consecNumberImgStatus","seqAlphaImgStatus","seqNumberImgStatus","seqSymbolImgStatus","noOfAlphasOnlyBonus","noOfNumbersOnlyBonus","noOfRepCharBonus","noOfConsecAlphaUCBonus","noOfConsecAlphaLCBonus","noOfConsecNumberBonus","noOfSeqAlphaBonus","noOfSeqNumberBonus","noOfSeqSymbolBonus","nConsecSymbol","nConsecCharType","nSeqChar","reverse","str","nScore","nAlphaUC","nAlphaLC","nNumber","nSymbol","nMidChar","nRequirements","nAlphasOnly","nNumbersOnly","nUnqChar","nRepChar","nRepInc","nConsecAlphaUC","nConsecAlphaLC","nConsecNumber","nSeqAlpha","nSeqNumber","nSeqSymbol","nReqChar","nTmpAlphaUC","nTmpAlphaLC","nTmpNumber","nTmpSymbol","sAlphaUC","sAlphaLC","sNumber","sSymbol","sMidChar","sRequirements","sAlphasOnly","sNumbersOnly","sRepChar","sConsecAlphaUC","sConsecAlphaLC","sConsecNumber","sSeqAlpha","sSeqNumber","sSeqSymbol","arrPwd","arrPwdLen","charValue","bCharExists","repeatedChar","sequentialAlpha","sFwd","sRev","sequentialNumeric","sequentialSymbol","exceed","nMinReqChars","warn","SetPassword","InvitationStep","passwordScore","showPassword","statusImages","passwordStatus_Exceed","passwordStatus_Pass","passwordStatus_Warn","passwordStatus_Fail","handlePasswordChange","handleSetPasswordClick","PIN","PasswordSet","passwordComplexity","score","statusImage","scoreValue","scoreSign","requirements","totalScore","backgroundPositionX","InvitationProcess","checkInactiveSubscription","navigateNotFound","getInvitationStatus","invitationType","mapInvitationType","invitationStep","mapStep","User","IsConfigurePassword","ConfigurePassword","Unknown","setPassword","validateIdentity","setupComplete","handleNextUser","handleNextConfigurePassword","setupCompleteTitle","InvalidPasswordReset","goHome","Jumbotron","buildFetchRequest","apiAuth","defaultTokens","RequestEmail","Forgot","RequestVoice","GetRefreshTypeForApi","RefreshType","UpdateUserPasswordToken","errorHandling","Source","RequestPhonePin","requestingPhone","requestText","requestNewPhonePin","requestNewPhonePinVoice","requestNewPhonePinText","requestedPhone","skinny","NoPin","EnterPhonePin","doesPinLookValid","pinNumberFound","submitPin","FormText","changePin","PassScoreStatus","FailScoreStatus","ExceedScoreStatus","DefaultFailRequirement","DefaultPassedRequirement","DefaultPasswordScore","calculatedAsANumber","passwordScoreMultipliers","allUpperCaseLettersRegex","allLowerCaseLettersRegex","allNumbersRegex","allSymbolsRegex","CheckForSequentialPatterns","pattern","sizeOfPatternToCheck","sequenceCount","decimalNumberRadix","passwordScoreAsNumber","passwordCardinality","cardinality","lastUpperCaseLetterCharValue","lastLowerCaseLetterCharValue","lastNumberCharValue","lastSymbolCharValue","ConsecutiveSymbolCount","UpperCaseLetterCount","ConsecutiveUpperCaseLetterCount","ConsecutiveLowerCaseLetterCount","LowerCaseLetterCount","ConsecutiveNumberCount","ConsecutiveCount","middleCharacterCount","numberCount","symbolCount","repetitionIncrement","repetitionCharacter","passwordLength","stringArrayOfPassword","indexOfCharValue","repeatCharacterExists","numberForUniqueCharacters","determineCardinalityOfPassword","sequenceChecksResults","currentPasswordScore","AlphaSequenceDuplicates","NumericSequenceDuplicates","SequenceSymbolDuplicates","requirementsMet","neededRequirements","checkIfPasswordMissesRequirements","SequenceCount","RunSequenceChecks","initialScore","currentScore","determinePasswordScoreFromPasswordCardinality","PasswordCheckStatusImage","PasswordDeductions","requirementsTableRow","requirement","otherRows","PasswordScoreAdditions","NewPassword","showPasswordText","passwordAppearsValid","submitPassword","changePassword","UpdateUserPassword","EmailSecret","Pin","OldPassword","PasswordResetLanding","requestedPhonePinSend","changingPassword","isPasswordTimeInvalid","linkTime","linkCreatedEpochTimeMS","getUTCMilliseconds","pinRequested","pinChanged","pinSubmitted","requestPasswordChange","newPassword","linkId","validLinkTime","UnassignedSubscriptionPermissionsGet","PermissionsOfSubscriptionPlanGet","subscriptionPlanTitle","NotAssignedPermissionsOfSubscriptionPlanGet","SubscriptionPlanPermissionSave","AssignedPermission","PendingPermissionsGet","InactivePermissionsGet","PermissionsApprove","approvedBy","ApprovePermission","ApprovedBy","RolesGet","PermissionsOfRoleGet","roleTitle","NotAssignedPermissionsOfRoleGet","RoleCreate","PermissionInRoleSave","PendingSubscriptionsPermissionsMappingGet","InactiveSubscriptionsPermissionsMappingGet","SubscriptionsPermissionsMappingApprove","ApproveSubscriptionPlanPermission","PendingRolePermissionsGet","InactiveRolePermissionsGet","RolePermissionsApprove","ApproveRolePermission","SubscriptionPlanCreate","PermissionsSubscriptionModal","selectedSubscription","editPermission","unassigned","assigned","notassigned","showAddNewModal","showEditModal","newSubscription","initialLoadSubscriptions","activedate","inactivedate","selectSubscription","handleAddNewCancel","handleEditCancel","subscriptionPlanDescription","handleAddNewSubmit","handleEditSubmit","relatedPermission","PermissionID","InactiveDate","handleAddNew","handleEdit","permission","addNewValid","editValid","validSubmit","handleActiveDateChange","dateiInPast","allowChange","handleInActiveDateChange","left","boxShadow","RecordStatusType","DualTableBox","optionsAtRight","columnValue","columnFn","handleItemClick","clicked","table","selectionFieldName","showHeader","leftTitle","rightTitle","leftColumns","hideLeftHeader","rightColumns","hideRightHeader","PermissionSelectionType","ApproveNewPermissionsModal","selectedPermissions","showInactivePermissions$","handleApprove","PermissionsRoleModalModal","selectedRole","newRole","titleDuplicated","roleActivedate","roleInactivedate","newRoleActivedate","newRoleInactivedate","selectRole","handleNewTitleChange","validateTitle","handleRoleActiveDateChange","handleRoleInActiveDateChange","ApproveRolePermissionsModal","ApproveSubscriptionRelationshipsModal","PermissionsSelection","NoSelection","showPermissionsSubscriptionModal","showPermissionsRoleModal","showApproveNewPermissionsModal","showApproveSubscriptionsModal","showApproveRolesModal","PermissionsSubscription","PermissionsRole","ApproveNewPermissions","ApproveSubscriptions","ApproveRoles","handleModalCancel","ConnectedPermissionsSelection","ProtectedRoute","routes","HasAccessToAtLeastOneRoute","GetUserDefaultRoute","GovOrderedServices","serviceType","FormatGender","GovOrderDonorInfo","GovOrderRequest","infoHtml","onInfoHtmlChange","getSampleTypeCode","UrinePOCT","SalivaDrugPOCT","SalivaDrug","performCollection","orderString","orderData","Device","panelSelected","isPanelValid","panelDescription","labClientMemberId","GetAuthFormPage","loadAuthFormPdf","SSOCallback","bytes","TextDecoder","decode","parsePayload","Target","access_token","OnTrackReportType","GovReportsObservable","getOnTrackReport","TestSummary","SpecimenPositivity","DrugDetail","DailySummary","IVRCallInCompliance","ReportParameters","locationsLoading","groupLoading","donorLoading","regulatoryModeLoading","companyChecked","groupChecked","donorChecked","typeaheadGroup","donorSubscription","handleGroupChange","selectedGroup","handleCompanyChecked","handleGroupChecked","handleDonorChecked","handleGenerateReportClick","reportType","groupID","validateDonorFormat","isParamsValid","ConnectedReportParameters","AddNewAdminModal","implementationValid","implementationsLoading","getPortalSetupModalValidity","subdomain","isImplementationsLoading","disableCreate","ConnectedPortalSetupModal","PortalGrid","showUserInfo","showAddAdmin","handleAddPortal","hideUserInfo","handleAddAdminModalClose","implementationGroupID","ConnectedPortalGrid","AddNewPortal","AccountInput","accountAsyncTypeahead","accountTypeahead","accounts$","defaultAccountName","getAccountName","subcribeAccounts","DriverCertificationReportGet","reportID","donorStatus","ReportID","DonorStatus","BreakByCompanies","WorkforceReportParameters","ranges","years","selectedStatus","selectedRange","yearsLoading","includeAlcohol","rangeChecked","yearChecked","allCompaniesChecked","poolChecked","allPoolsChecked","typeaheadPool","selectedPool","handleDonorStatusChange","handleRegModeChange","selectedMode","handleYearChange","selectedYear","handleDateRangeChange","switchRadioButton","handlePoolChecked","handleAllPoolsChecked","handleAllCompaniesChecked","handleAccountTypeChanged","at","MasterAccount","handleYearChecked","handleRangeChecked","handleClearClick","currentYear","generateDriverCertification","generateManagementSummary","generateMIS","generateSNTPDF","generateCertificationStatus","isAccountType","BreakByLocations","IncludeAlcoholTests","DtFromDate","DtToDate","ReportMode","generateSNT","generateSNTCSV","outputFormat","OutputFormat","isReportParametersValid","companiesSelected","showDonorStatusSection","showDonorSelector","showSummarySection","showDatesSection","showMISSection","showSNTSection","showAcountInput","needLoadCompanies","loadCompanies","showCompanyLabel","showFilterByCompany","showFilterByMasterAccount","isSNT","showAllCompanies","showAllPools","y","ConnectedWorkforceReportParameters","mapParams","IncludeArchivedOrders","DateTypeLabel","EVENTED","REVIEWED","ORDERED","TESTED","SCHEDULED","SummaryReport","portalAdmin","useSelector","useHistory","generatingPdf","setGeneratingPdf","setCompanies","setSelectedCompanies","selectedDateType","setDateType","CUSTOM_FILTER","selectedDateRange","setDateRange","toDay","currentMonth","CURRENT_MONTH","PREVIOUS_MONTH","FROM_BEGINNING_OF_YEAR","LAST_30_DAYS","getReportParams","LookupMap","IsInput","IsNumeric","OrderDefaults","resetting","loadingDefaults","portalDefaults","selectedLookup","showWarning","loadCompanyDefaultsSubscription","loadPortalDefaultsSubscription","loadDefaults","lookup","requestData","remapToOrderDefault","reasonDefaults","timeDefaults","singleDefault","categoryDefaults","sampleDefaults","createOrderDefaultElement","existingDefault","elementVisibleOnPortalLevel","relatedDefault","savedDefault","savedDefaults","objects","newEl","Defaults","handleReset","toggleShow","handleEmpty","handleLookupChange","handleDefaultValueChange","isAnyShowSelected","showSaveWarning","ConnectedOrderDefaults","PortalSelectionModal","AddNewCompany","RequireCompleteSetupModal","openInvitation","PostLogData","Url","Exception","Stack","stack","ComponentStack","componentStack","WindowWidth","screen","availWidth","WindowHeight","availHeight","source","lineno","colno","WS_Url","Namespace","SendingFacility_Code","SaveSendingFacilityObservable","model","SendingFacilityModal","isSendingFacilityValid","loadPortalNameSubscription","timezoneTypeahead","SendingFacilityAN","SOAPVersion","TimeZoneAN","WSUserName","WSPassword","MaskPos","SendImages","CRMUpdates","InstallationId","timezoneValue","timezones","zone","currentPortal","initialPortalData","handleSendingFacilityChange","SendingFacilityPage","commonSubscription","sendingFacilityDetails","showSendingFacilityDetailsModal","SendingFacilityObservable","ConsortiumPools","ConsortiumPersonnel","PositiveReport","loadingCSV","exportSubscription","handleLoadClick","CompanyIds","renderRow","ResultDescription","PositiveDrugList","COLLECTED","MRO_REPORTED","LAB_REPORTED","DateTypeSelection","selectedType","UnmergedRandomResultsReport","install","handleUncaughtExceptions","App","checkAppVersionAndReload","meta","latestVersion","currentVersion","appVerGreaterThan","loadNewAppVersion","versionsA","versionsB","shift","caches","delete","pageLoaded","LogErrorToServer","wrongUrl","authenticatedAndCompanySelected","authenticatedAndSelectedAndUserAccessLoaded","loadedUserPermission","exact","component","ConnectedSSOWorkforce1Login","LegacyWorkforceUserInvitationRoute","LegacyWorkforceCompanyInvitationRoute","LegacyWorkforcePortalInvitationRoute","WorkforceOnePswConfigureRoute","WorkforceOnePswUpdate","OrderResults","Permissions","GovDonor","SSOSiteSearchP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E5D,QADkB,OAALA,QAAK,IAALA,GAAA,UAAAA,EAAOrQ,gBAAP,eAAiB8yB,WAAY,IACjCy7C,WAAW,kBACX,cAAC,GAAD,eAAiBl+D,IAEjB,cAAC,IAAD,CAAUwjC,GAAIxnC,IAExB,WA3GE,cAAC,GAAD,CAAgBkd,SAAS,EAAzB,SACL,cAAC,GAAD,CAAiB3kB,QAAQ,gBA+G9B,KA5KH,GAAyBxE,aAmMzB,IACeuoN,GADMxhM,aArBrB,SAAyB9nB,GAAuC,IAAD,EAC7D,MAAO,CACL2lJ,YAAW,UAAE3lJ,EAAMqG,gBAAgByN,iBAAxB,SACX00M,qBAAsBxoN,EAAMqG,gBAAgB0N,gCAC5CjJ,kBAAmB9K,EAAMqG,gBAAgByE,gBACzCjE,gBAAiB7G,EAAMqG,iBAAmBrG,EAAMqG,gBAAgBwC,WAChEmL,uBAAwBhU,EAAMqG,gBAAgB2N,qBAC9CO,KAAMvU,EAAMqG,gBAAgBkO,MAAQ,GACpCoN,WAAYhZ,GAAgB3I,GAC5B4hB,UAAW9U,GAAe9M,GAC1BiU,qBAAsBjU,EAAMqG,gBAAgB4N,qBAC5CK,eAAgBtU,EAAMqG,gBAAgBiO,eACtC+zM,WAAYroN,EAAMqG,gBAAgB+N,mBAErC,IACD,SAA0B8I,GACxB,MAAO,CACLirM,WAAY,kBAAMjrM,EzlB/VX,CACHna,KAAM4X,IylB8VE,EAEf,GAEoBmN,CAAqGy/L,IClW1HgC,IAAS3jM,OACL,cAAC,IAAD,CAAU5J,MAAOA,GAAjB,SACI,cAAC,GAAD,MAEJgtB,SAASwgL,eAAe,SAM5BlqN,G","file":"static/js/main.9dd22045.chunk.js","sourcesContent":["import { ReportHandler } from 'web-vitals';\r\n\r\nconst reportWebVitals = (onPerfEntry?: ReportHandler) => {\r\n  if (onPerfEntry && onPerfEntry instanceof Function) {\r\n    import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {\r\n      getCLS(onPerfEntry);\r\n      getFID(onPerfEntry);\r\n      getFCP(onPerfEntry);\r\n      getLCP(onPerfEntry);\r\n      getTTFB(onPerfEntry);\r\n    });\r\n  }\r\n};\r\n\r\nexport default reportWebVitals;\r\n","import { Component } from \"react\"\r\nimport packageJson from '../../../package.json'\r\n\r\ninterface CopyRightState {\r\n  buildVersion: string;\r\n}\r\n\r\nexport default class CopyRight extends Component<{}, CopyRightState> {\r\n\r\n  state: CopyRightState = {\r\n    buildVersion: packageJson.version\r\n  };\r\n\r\n  componentDidMount() {\r\n    fetch('build.json')\r\n      .then((response) => response.json())\r\n      .then((build) => {\r\n        this.setState({ buildVersion: build.version })\r\n      })\r\n  }\r\n\r\n  render() {\r\n    return (\r\n      <>\r\n        &copy; {new Date().getFullYear()},  Clinical Reference Laboratory, Inc.\r\n        {!location.host.includes(\"ontrack\")  && <p>V {this.state.buildVersion}</p>}\r\n      </>\r\n    )\r\n  }\r\n}","import React from \"react\";\r\n\r\nexport default function TOS(){\r\n    return (\r\n        <>\r\n            <a className=\"text-dark\" href='https://www.crlcorp.com/terms-of-use/' target=\"_blank\">\r\n                <strong>Terms of Use</strong>\r\n            </a>\r\n        </>\r\n    )\r\n}\r\n","import React from \"react\";\r\n\r\nexport default function PrivacyPolicy(){\r\n    return (\r\n        <>\r\n            <a className=\"text-dark\" href='https://www.crlcorp.com/notice-of-privacy-practices/' target=\"_blank\">\r\n                <strong>Privacy Policy</strong>\r\n            </a>\r\n        </>\r\n    )\r\n}\r\n","// portals really should not be cached, and rather refreshed with the token but no real choice right now..\r\nimport {WorkforceClinicPortal} from \"../AppState\";\r\n\r\nexport function SetLoginPortals(Clinics: WorkforceClinicPortal[]){\r\n    sessionStorage.setItem(\"wf2-STRY0045127-portals\", JSON.stringify(Clinics));\r\n}\r\nexport function GetLoginPortals(): WorkforceClinicPortal[] | null {\r\n    const storageForPortals = sessionStorage.getItem(\"wf2-STRY0045127-portals\")\r\n    if(!storageForPortals){\r\n        return null;\r\n    }\r\n    return JSON.parse(storageForPortals);\r\n}\r\n\r\nexport function setOrphanedResultsCount(orphanedResultsCount: number) {\r\n    sessionStorage.setItem(\"OrphanedResultsCount\", orphanedResultsCount.toString());\r\n    window.dispatchEvent(new Event('storage'));\r\n}\r\n\r\nexport function getOrphanedResultsCount(): number {\r\n    const orphanedResultsCount = sessionStorage.getItem(\"OrphanedResultsCount\")\r\n    let result = -1\r\n    if (orphanedResultsCount) {\r\n        result = parseInt(orphanedResultsCount)\r\n        if (isNaN(result)) {\r\n            result = -1\r\n        }\r\n    }\r\n    return result\r\n}","import {SetCompanySelection} from \"../storage/CompanySelection\";\r\nimport { SetLoginPortals } from \"../storage/LogInPortals\";\r\nimport { WorkforceClinicPortal } from \"../AppState\";\r\n\r\nexport interface CompanySelectedPayload{\r\n    participationId: string,\r\n    Link: string\r\n}\r\n\r\nexport interface CompanyUpdatePayload{\r\n  ForceReload: boolean\r\n}\r\n\r\nexport interface AllowCompanySelectionPayload{\r\n  showSelection: boolean\r\n}\r\n\r\nexport type COMPANY_SELECTED_TYPE = 'COMPANY_SELECTED';\r\nexport const COMPANY_SELECTED = 'COMPANY_SELECTED';\r\n\r\nexport type COMPANY_UPDATED_TYPE = 'COMPANY_UPDATED';\r\nexport const COMPANY_UPDATED = 'COMPANY_UPDATED';\r\n\r\nexport type CLINIC_LIST_UPDATED_TYPE = 'CLINIC_LIST_UPDATED';\r\nexport const CLINIC_LIST_UPDATED = 'CLINIC_LIST_UPDATED';\r\n\r\nexport type ALLOW_COMPANY_SELECTION_TYPE = 'ALLOW_COMPANY_SELECTION';\r\nexport const ALLOW_COMPANY_SELECTION = 'ALLOW_COMPANY_SELECTION';\r\n\r\nexport interface CompanySelectedAction{\r\n    type: COMPANY_SELECTED_TYPE\r\n    payload: CompanySelectedPayload\r\n}\r\n\r\nexport interface CompanyUpdateAction{\r\n  type: COMPANY_UPDATED_TYPE\r\n  payload: CompanyUpdatePayload\r\n}\r\n\r\nexport interface ClinicListUpdatedPayload{\r\n  Clinic: WorkforceClinicPortal[]\r\n}\r\n\r\ninterface ClinicListUpdatedAction {\r\n  type: CLINIC_LIST_UPDATED_TYPE\r\n  payload: ClinicListUpdatedPayload\r\n}\r\n\r\nexport interface AllowCompanySelectionAction{\r\n  type: ALLOW_COMPANY_SELECTION_TYPE\r\n  payload: AllowCompanySelectionPayload\r\n}\r\n\r\nexport function WorkforceReloadPortalsCompanies(forceReload: boolean = false): CompanyUpdateAction {\r\n  return {\r\n      type: COMPANY_UPDATED,\r\n      payload: { ForceReload: forceReload }\r\n  }\r\n}\r\n\r\nexport function CompanyUpdated(data: ClinicListUpdatedPayload | null): ClinicListUpdatedAction {\r\n  if(data && data.Clinic){\r\n    SetLoginPortals(data.Clinic)\r\n  }\r\n  return {\r\n    type: CLINIC_LIST_UPDATED,\r\n    payload: {Clinic: data?.Clinic || []}\r\n  }\r\n}\r\n\r\nexport function SelectCompany(participationId: string, logInLink: string): CompanySelectedAction{\r\n    SetCompanySelection(participationId, logInLink);\r\n    return {\r\n        type: COMPANY_SELECTED,\r\n        payload: {\r\n            participationId,\r\n            Link: logInLink\r\n        }\r\n    };\r\n}\r\n\r\nexport function AllowSelectCompany(): AllowCompanySelectionAction{\r\n  return {\r\n      type: ALLOW_COMPANY_SELECTION,\r\n      payload: {\r\n          showSelection: true\r\n      }\r\n  };\r\n}\r\n\r\nexport type WorkforceClinicActions = | CompanySelectedAction | AllowCompanySelectionAction | CompanyUpdateAction | ClinicListUpdatedAction;\r\n","\r\n//we should really just be setting the company id/name here,but for now, and because we have STRY0045127,\r\n// just going to set the link as well, rather then looking up the story\r\n\r\nexport function SetCompanySelection(company: string, loginLink: string){\r\n    sessionStorage.setItem(\"company-selection\", company);\r\n    sessionStorage.setItem(\"company-selection-link\", loginLink);\r\n}\r\nexport function getCompanySelection(): {company: string | null, loginLink: string | null}{\r\n    const company = sessionStorage.getItem(\"company-selection\");\r\n    const loginLink = sessionStorage.getItem(\"company-selection-link\");\r\n    return {\r\n        company,\r\n        loginLink\r\n    };\r\n}","//should be moved to the epic or action by STRY0045127, use connect with redux rather then then this function\r\n\r\nexport function SetAuthToken(token: string){\r\n    sessionStorage.setItem(\"wf2-STRY0045127\", token);\r\n}\r\nexport function GetAuthToken(): string | null {\r\n    return sessionStorage.getItem(\"wf2-STRY0045127\");\r\n}\r\nexport function ClearAuth(){\r\n    localStorage.removeItem(\"portalImage\");\r\n    //this assumes everything in the session is sensitive..\r\n    sessionStorage.clear()\r\n}\r\n\r\nexport function SetSSOToken(token: string){\r\n    sessionStorage.setItem(\"SSOToken\", token);\r\n}\r\nexport function GetSSOToken(): string {\r\n    const v = sessionStorage.getItem(\"SSOToken\");\r\n    if(v){\r\n        return v;\r\n    }\r\n    return \"\";\r\n}\r\n\r\nexport function SetSiteSearchMode(){\r\n  sessionStorage.setItem(\"SiteSearch\", \"true\");\r\n}\r\n\r\nexport function SetEmbeddedOrderMode(){\r\n  sessionStorage.setItem(\"EmbeddedOrder\", \"true\");\r\n}\r\n\r\nexport function SiteSearchModeEnabled(): boolean {\r\n  const v = sessionStorage.getItem(\"SiteSearch\");\r\n  if(v){\r\n      return v == \"true\";\r\n  }\r\n  return false;\r\n}\r\n\r\nexport function EmbeddedOrderModeEnabled(): boolean {\r\n  const v = sessionStorage.getItem(\"EmbeddedOrder\");\r\n  if(v){\r\n      return v == \"true\";\r\n  }\r\n  return false;\r\n}\r\n\r\nexport function SetSSOPayload(data: string){\r\n  sessionStorage.setItem(\"SSOPayload\", data);\r\n}\r\nexport function GetSSOPayload(): string {\r\n  const v = sessionStorage.getItem(\"SSOPayload\");\r\n  if(v){\r\n      return v;\r\n  }\r\n  return \"\";\r\n}\r\n\r\nexport function SetSSOAction(data: string){\r\n  sessionStorage.setItem(\"SSOAction\", data || \"\");\r\n}\r\n\r\nexport function GetSSOAction(): string {\r\n  const v = sessionStorage.getItem(\"SSOAction\");\r\n  if(v){\r\n      return v;\r\n  }\r\n  return \"\";\r\n}","export function SetUserId(id: string | number){\r\n    if(id){\r\n        sessionStorage.setItem(\"wf2-STRY0045127-id\", id.toString());\r\n    }else {\r\n        console.log(\"Impossible Error, User ID should not be empty! \");\r\n    }\r\n}\r\nexport function GetUserId(): string | number | null {\r\n    const userIdText = sessionStorage.getItem(\"wf2-STRY0045127-id\");\r\n    if(!userIdText){\r\n        return null;\r\n    }\r\n    const userIdNumber = parseInt(userIdText);\r\n    return !!userIdNumber? userIdNumber : (userIdText || \"\");\r\n}","import {ClearAuth, SetAuthToken, SetSSOToken} from \"../storage/AuthToken\";\r\nimport {WorkforceClinicPortal} from \"../AppState\";\r\nimport {SetLoginPortals} from \"../storage/LogInPortals\";\r\nimport {SetUserId} from \"../storage/UserId\";\r\nimport {toast} from \"react-toastify\";\r\nimport {GetUrlLocation} from \"../BaseUrl\";\r\n\r\nexport type USER_LOGIN_TYPE = 'WORKFORCE_ONE_LOGIN';\r\nexport type SSO_USER_LOGIN_TYPE = 'SSO_WORKFORCE_ONE_LOGIN';\r\nexport type SSO_TOKEN_USER_LOGIN_TYPE = 'SSO_TOKEN_WORKFORCE_ONE_LOGIN';\r\nexport const USER_LOGIN = 'WORKFORCE_ONE_LOGIN';\r\nexport const SSO_USER_LOGIN = 'SSO_WORKFORCE_ONE_LOGIN';\r\nexport const SSO_TOKEN_USER_LOGIN = 'SSO_TOKEN_WORKFORCE_ONE_LOGIN';\r\nexport interface WorkforceOneLoginPayload{\r\n    userName:string\r\n    password: string\r\n    requestedUri: string\r\n    sourceIp: string\r\n}\r\nexport interface SSOWorkforceOneLoginPayload{\r\n  requestedUri: string\r\n  sourceIp: string\r\n  ssoToken: string\r\n  data?: string\r\n}\r\nexport interface SSOTokenWorkforceOneLoginPayload{\r\n  requestedUri: string\r\n  sourceIp: string\r\n  ssoToken: string\r\n  isSiteSearch: boolean\r\n  isEmbeddedOrder: boolean\r\n  action:string\r\n}\r\nconst doNotTrustClientIps = \"127.0.0.1\";\r\nexport function loginToWorkforce(userName: string, password: string): WorkforceOneLoginAction{\r\n    return {\r\n        type: USER_LOGIN,\r\n        payload: {\r\n            userName,\r\n            password,\r\n            requestedUri: `${window.location.protocol}//${window.location.hostname}/clinicportal/#/workforce-login`,\r\n            sourceIp: doNotTrustClientIps\r\n        }\r\n    }\r\n}\r\n\r\nexport function ssoOrderRequest(ssoToken: string, data?: string): SSOWorkforceOneLoginAction{\r\n  return {\r\n      type: SSO_USER_LOGIN,\r\n      payload: {\r\n          requestedUri: `${window.location.protocol}//${window.location.hostname}/clinicportal/#/workforce-login`,\r\n          sourceIp: doNotTrustClientIps,\r\n          ssoToken: ssoToken,\r\n          data: data\r\n      }\r\n  }\r\n}\r\nexport function ssoTokenLoginToWorkforce(ssoToken: string, isSiteSearch: boolean, isEmbeddedOrder: boolean, action:string): SSOTokenWorkforceOneLoginAction{\r\n  return {\r\n      type: SSO_TOKEN_USER_LOGIN,\r\n      payload: {\r\n          requestedUri: `${window.location.protocol}//${window.location.hostname}/clinicportal/#/workforce-login`,\r\n          sourceIp: doNotTrustClientIps,\r\n          ssoToken: ssoToken,\r\n          isSiteSearch: isSiteSearch,\r\n          isEmbeddedOrder: isEmbeddedOrder,\r\n          action:action\r\n      }\r\n  }\r\n}\r\nexport interface WorkforceOneLoginAction{\r\n    type: USER_LOGIN_TYPE\r\n    payload: WorkforceOneLoginPayload\r\n}\r\nexport interface SSOWorkforceOneLoginAction{\r\n  type: SSO_USER_LOGIN_TYPE\r\n  payload: SSOWorkforceOneLoginPayload\r\n}\r\nexport interface SSOTokenWorkforceOneLoginAction{\r\n  type: SSO_TOKEN_USER_LOGIN_TYPE\r\n  payload: SSOTokenWorkforceOneLoginPayload\r\n}\r\ninterface ClinicPortals {\r\n    Clinic: WorkforceClinicPortal[]\r\n}\r\nexport interface WorkforceOneLoggedInPayload{\r\n    Portal: ClinicPortals\r\n    AuthToken: string\r\n    UserId: number | string\r\n    UserName?:string\r\n}\r\nexport type USER_LOGGED_IN_TYPE = 'WORKFORCE_ONE_LOGGED_IN';\r\nexport const USER_LOGGED_IN = 'WORKFORCE_ONE_LOGGED_IN';\r\nexport interface WorkforceOneLoggedInAction {\r\n    type: USER_LOGGED_IN_TYPE\r\n    payload: WorkforceOneLoggedInPayload\r\n}\r\nexport function WorkforceOneUserHasLoggedIn(webToken: string, userId: number| string, ssoToken: string, loginDetail: WorkforceOneLoggedInPayload) : WorkforceOneLoggedInAction {\r\n    SetAuthToken(webToken);\r\n    SetSSOToken(ssoToken);\r\n    SetUserId(userId);\r\n    toast.success('Log In Completed')\r\n    if(loginDetail && loginDetail.Portal && loginDetail.Portal.Clinic){\r\n        SetLoginPortals(loginDetail.Portal.Clinic);\r\n    }\r\n    loginDetail.AuthToken = webToken;\r\n    loginDetail.UserId = userId;\r\n    return {\r\n        type: USER_LOGGED_IN,\r\n        payload: loginDetail\r\n    }\r\n}\r\n\r\nexport type USER_LOGGED_IN_FAILED_TYPE = 'WORKFORCE_ONE_LOGGED_IN_FAILED';\r\nexport const USER_LOGGED_IN_FAILED = 'WORKFORCE_ONE_LOGGED_IN_FAILED';\r\nexport interface WorkforceOneLoggedInFailedAction{\r\n    type: USER_LOGGED_IN_FAILED_TYPE\r\n}\r\nexport function WorkforceOneUserLoginFailed(message?: string): WorkforceOneLoggedInFailedAction {\r\n  toast.error(message || 'Log In Failed')\r\n  return {\r\n      type: USER_LOGGED_IN_FAILED,\r\n  }\r\n}\r\n\r\nexport interface WorkforceOneLoggedInWrongUrlPayload{\r\n  Portal: ClinicPortals\r\n  Message?: string\r\n}\r\nexport type USER_LOGGED_IN_WRONG_URL_TYPE = 'WORKFORCE_ONE_LOGGED_IN_WRONG_URL';\r\nexport const USER_LOGGED_IN_WRONG_URL = 'WORKFORCE_ONE_LOGGED_IN_WRONG_URL';\r\nexport interface WorkforceOneLoggedInWrongUrlAction{\r\n    type: USER_LOGGED_IN_WRONG_URL_TYPE\r\n    payload: WorkforceOneLoggedInWrongUrlPayload\r\n}\r\nexport function WorkforceOneLoggedInWrongUrl(loginDetail: WorkforceOneLoggedInWrongUrlPayload): WorkforceOneLoggedInWrongUrlAction {\r\n    return {\r\n        type: USER_LOGGED_IN_WRONG_URL,\r\n        payload: loginDetail\r\n    }\r\n}\r\n\r\nexport interface WorkforceOneUserLogOutPayload{\r\n  skipRedirect: boolean\r\n}\r\nexport type USER_LOGGED_OUT_TYPE = 'WORKFORCE_ONE_USER_LOGGED_OUT';\r\nexport const USER_LOGGED_OUT = 'WORKFORCE_ONE_USER_LOGGED_OUT';\r\nexport interface WorkforceOneLogOutAction{\r\n    type: USER_LOGGED_OUT_TYPE,\r\n    payload: WorkforceOneUserLogOutPayload\r\n}\r\nexport function WorkforceOneUserLogOut(skipRedirect: boolean = false): WorkforceOneLogOutAction {\r\n    ClearAuth();\r\n    return {\r\n        type: USER_LOGGED_OUT,\r\n        payload: { skipRedirect }\r\n    }\r\n}\r\n\r\nexport interface WorkforceOnePasswordResetPayload{\r\n    userName: string\r\n    invitationLink: string\r\n    isForgotPassword: boolean,\r\n}\r\nexport type USER_P_RESET_TYPE = 'WORKFORCE_ONE_USER_P_RESET';\r\nexport const USER_P_RESET = 'WORKFORCE_ONE_USER_P_RESET';\r\nexport interface WorkforceOnePasswordResetAction{\r\n    type: USER_P_RESET_TYPE\r\n    payload: WorkforceOnePasswordResetPayload\r\n}\r\nexport function WorkforceOneUserPasswordReset(userName: string, loggedIn: boolean): WorkforceOnePasswordResetAction {\r\n    return {\r\n        type: USER_P_RESET,\r\n        payload:{\r\n            userName,\r\n            invitationLink: loggedIn ? GetUrlLocation() : '',\r\n            isForgotPassword: !loggedIn\r\n        }\r\n    }\r\n}\r\n\r\nexport type WorkforceOneLoginActions = |  WorkforceOneLoginAction | SSOWorkforceOneLoginAction | SSOTokenWorkforceOneLoginAction | WorkforceOneLoggedInAction | WorkforceOneLoggedInFailedAction | WorkforceOneLogOutAction | WorkforceOnePasswordResetAction | WorkforceOneLoggedInWrongUrlAction\r\n","import {RouterState} from \"connected-react-router\";\r\nimport {LocationState} from \"history\";\r\n\r\nexport type WorkforceRoute = LocationState;\r\n\r\nexport interface CurrentUserPermissions {\r\n    \"CanShowClinicAdminSetup\": boolean,\r\n    \"CanShowInvitation\": boolean,\r\n    \"CanShowRolePermissionSubscription\": boolean,\r\n    \"CanShowNotification\": boolean,\r\n    \"CanShowClientInvitationStatus\": boolean,\r\n    \"CanShowUserInvitationStatus\": boolean,\r\n    \"CanShowPortal\": boolean,\r\n    \"CanShowInvitationStatus\": boolean,\r\n    \"CanViewSiteSearch\": boolean,\r\n    \"CanViewOrder\": boolean,\r\n    \"CanViewTracking\": boolean,\r\n    \"CanViewCompleted\": boolean,\r\n    \"CanInviteClientUser\": boolean,\r\n    \"CanManageClient\": boolean,\r\n    \"CanCreateClient\": boolean,\r\n    \"CanCreateInstance\": boolean,\r\n    \"CanEditPendingOrders\": boolean,\r\n    \"CanViewRandomTesting\": boolean,\r\n    \"CanManageClientUser\": boolean,\r\n    \"CanManageInstanceUser\": boolean,\r\n    \"CanViewPersonnel\": boolean,\r\n    \"CanViewOrderTrackingGrid\": boolean,\r\n    \"CanManageServiceEvent\": boolean,\r\n    \"CanVieweCCFCopy2PreMRO\": boolean,\r\n    \"CanViewOrderSummary\": boolean,\r\n    \"CanManagePersonnel\": boolean,\r\n    \"CanManagePools\": boolean,\r\n    \"CanCompleteEvents\": boolean,\r\n    \"CanUploadImages\": boolean,\r\n    \"CanViewAddressAlert\": boolean,\r\n    \"CanSearchDefaults\": boolean,\r\n    \"CanGroupInclude\": boolean,\r\n    \"CanManageOrphanResults\": boolean,\r\n    \"CanEditPersonnel\": boolean,\r\n    \"CanManageSelectionInbox\": boolean,\r\n    \"CanManageGovDonors\": boolean,\r\n    \"CanManageGovPools\": boolean,\r\n    \"CanManageConsortiumPools\": boolean,\r\n    \"CanOrderGovServices\": boolean,\r\n    \"CanViewMISReports\": boolean,\r\n    \"CanMergeTests\": boolean,\r\n    \"CanMatchTests\": boolean\r\n}\r\nexport interface CurrentSelectedCompanyPermissions{\r\n    \"CanShowClinicAdminSetup\": boolean,\r\n    \"CanShowInvitation\": boolean,\r\n    \"CanShowRolePermissionSubscription\": boolean,\r\n    \"CanShowNotification\": boolean,\r\n    \"CanShowClientInvitationStatus\": boolean,\r\n    \"CanShowUserInvitationStatus\": boolean,\r\n    \"CanShowPortal\": boolean,\r\n    \"CanShowInvitationStatus\": boolean,\r\n    \"CanViewSiteSearch\": boolean,\r\n    \"CanViewOrder\": boolean,\r\n    \"CanViewTracking\": boolean,\r\n    \"CanViewCompleted\": boolean,\r\n    \"CanInviteClientUser\": boolean,\r\n    \"CanManageClient\": boolean,\r\n    \"CanCreateClient\": boolean,\r\n    \"CanCreateInstance\": boolean,\r\n    \"CanEditPendingOrders\": boolean,\r\n    \"CanViewRandomTesting\": boolean,\r\n    \"CanManageClientUser\": boolean,\r\n    \"CanManageInstanceUser\": boolean,\r\n    \"CanViewPersonnel\": boolean,\r\n    \"CanViewOrderTrackingGrid\": boolean,\r\n    \"CanManageServiceEvent\": boolean,\r\n    \"CanVieweCCFCopy2PreMRO\": boolean,\r\n    \"CanViewOrderSummary\": boolean,\r\n    \"CanManagePersonnel\": boolean,\r\n    \"CanManagePools\": boolean,\r\n    \"CanCompleteEvents\": boolean,\r\n    \"CanUploadImages\": boolean,\r\n    \"CanViewAddressAlert\": boolean,\r\n    \"CanSearchDefaults\": boolean,\r\n    \"CanGroupInclude\": boolean,\r\n    \"CanManageOrphanResults\": boolean,\r\n    \"CanEditPersonnel\": boolean,\r\n    \"CanManageSelectionInbox\": boolean,\r\n    \"CanManageGovDonors\": boolean,\r\n    \"CanManageGovPools\": boolean,\r\n    \"CanManageConsortiumPools\": boolean,\r\n    \"CanOrderGovServices\": boolean,\r\n    \"CanViewMISReports\": boolean,\r\n    \"CanMergeTests\": boolean,\r\n    \"CanMatchTests\": boolean\r\n}\r\nexport const SiteAdminRole = 'SiteAdmin'\r\nexport const CompanyRole = 'CompanyAdmin'\r\nexport const PortalAdmin = 'PortalAdmin'\r\nexport const LocationAdmin = 'LocationAdmin'\r\nexport const NoAdminRole = 'None'\r\nexport type adminRoleType = 'None' |'SiteAdmin' | 'CompanyAdmin' |'PortalAdmin' | 'LocationAdmin'\r\nexport interface UserState{\r\n    webToken?: string\r\n    userName?: string\r\n    isLoading: boolean\r\n    isLoggedIn: boolean\r\n    showCompanySelection: boolean\r\n    loadedSelectedCompanyPermission: boolean\r\n    role: adminRoleType\r\n    currentUserPermissions: CurrentUserPermissions\r\n    loadingCompany?: string\r\n    selectedCompany?: string\r\n    requireCompleteSetup?: boolean\r\n    link?: string\r\n    currentCompanyPermissions?: CurrentSelectedCompanyPermissions\r\n    loginResultMessage?: string\r\n}\r\nexport interface AssignedClinic {\r\n    ParticipationID: string\r\n    Link: string\r\n    ImplementationName?: string\r\n    Name: string\r\n    RoleID: number\r\n    UserName: string\r\n    AccountID?: number\r\n    LocationID?: number\r\n    LocationName?: string\r\n}\r\nexport interface WorkforceClinicPortal {\r\n    ParticipationID?: string\r\n    Link?: string\r\n    Title?: string\r\n    ImplementationName?: string\r\n    RoleID?: number\r\n    AssignedClientDetailsOfClinic: AssignedClinic[]\r\n    ImplementationID?: number\r\n    UnmaskDonorID: number\r\n}\r\nexport interface CompaniesState {\r\n    visibleCompanies: WorkforceClinicPortal[]\r\n}\r\nexport interface AppState {\r\n    Workforce1State: UserState,\r\n    Workforce1Companies: CompaniesState,\r\n    router: RouterState<WorkforceRoute>,\r\n}\r\n","import { adminRoleType, AppState, CompanyRole, NoAdminRole, PortalAdmin, SiteAdminRole, LocationAdmin } from \"../AppState\"\r\n\r\nfunction isAdminRole(roleSearchFor: adminRoleType, state?: AppState): boolean{\r\n    return state?.Workforce1State.role == roleSearchFor;\r\n}\r\n\r\nexport function isSiteAdmin(state?: AppState): boolean{\r\n    return isAdminRole(SiteAdminRole, state);\r\n}\r\n//in workforce 1 this was called, isClient\r\nexport function isCompanyAdmin(state?: AppState): boolean{\r\n    return isAdminRole(CompanyRole, state);\r\n}\r\n//in workforce 1 this was called, isClinic\r\nexport function isPortalAdmin(state?: AppState): boolean{\r\n    return isAdminRole(PortalAdmin, state);\r\n}\r\n\r\nexport function isLocationAdmin(state?: AppState): boolean {\r\n  return isAdminRole(LocationAdmin, state)\r\n}\r\n\r\n// honestly, using this is bad practice, I added this function though upon request from Kyle on 6/7 made via web-x..\r\n// but truthfully my understanding of this field alarms me A LOT, but I made my concerns known to kyle..\r\nexport function isUser(state?: AppState): boolean{\r\n    return isAdminRole(NoAdminRole, state);\r\n}\r\n","import { AppState } from \"../AppState\";\r\nimport { isCompanyAdmin, isLocationAdmin, isPortalAdmin, isSiteAdmin } from \"./isAdminRole\";\r\nimport UserAccessSettings from \"./UserAccessSettings\";\r\n\r\nconst defaultMenuSetting: UserAccessSettings = {\r\n  authenticated: false,\r\n  canShowNotification: false,\r\n  canShowOrphanedResults: false,\r\n  canShowRolePermissionSubscription: false,\r\n  isCompanyAdmin: false,\r\n  isLocationAdmin: false,\r\n  isPortalAdmin: false,\r\n  isSiteAdmin: false,\r\n  superUser: false,\r\n  canManageTeam: false,//isClient || isClinic || isSiteAdmin... isClinic = portaladmin, isClient= company admin\r\n  canViewOrder: false,\r\n  canViewSiteSearch: false,\r\n  canViewOrderTrackingGrid: false,\r\n  canViewPersonnel: false,\r\n  canEditPersonnel: false,\r\n  canManagePools: false,\r\n  canManagePersonnel: false,\r\n  canManageSelectionInbox: false,\r\n  canShowInvitationStatus: false,\r\n  canInviteClientUser: false,\r\n  canCreateClient: false,\r\n  canManageClient: false,\r\n  canShowPortal: false,\r\n  canSearchDefaults: false,\r\n  CanManageGovPools: false,\r\n  CanManageConsortiumPools: false,\r\n  CanManageGovDonors: false,\r\n  CanOrderGovServices: false,\r\n  canCompleteEvents: false,\r\n  canVieweCCFCopy2PreMRO: false,\r\n  canViewMISReports: false,\r\n  canEditPendingOrders: false,\r\n  canMergeTests: false,\r\n  canMatchTests: false\r\n}\r\n\r\nexport function BuildUserAccess(state?: AppState): UserAccessSettings {\r\n  const menuSetting: UserAccessSettings = { ...defaultMenuSetting }\r\n\r\n  menuSetting.authenticated = state?.Workforce1State?.isLoggedIn === true\r\n\r\n  if (state?.Workforce1State.currentUserPermissions) {\r\n    const perm = state.Workforce1State.currentUserPermissions;\r\n    menuSetting.canShowNotification = perm.CanShowNotification;\r\n    menuSetting.canShowPortal = perm.CanShowPortal;\r\n  }\r\n\r\n  if (state?.Workforce1State.currentCompanyPermissions) {\r\n    menuSetting.canShowNotification = state.Workforce1State.currentCompanyPermissions.CanShowNotification;\r\n    menuSetting.canViewOrder = state.Workforce1State.currentCompanyPermissions.CanViewOrder;\r\n    menuSetting.canViewSiteSearch = state.Workforce1State.currentCompanyPermissions.CanViewSiteSearch;\r\n    menuSetting.canViewOrderTrackingGrid = state.Workforce1State.currentCompanyPermissions.CanViewOrderTrackingGrid;\r\n    menuSetting.canViewPersonnel = state.Workforce1State.currentCompanyPermissions.CanViewPersonnel;\r\n    menuSetting.canEditPersonnel = state.Workforce1State.currentCompanyPermissions.CanEditPersonnel;\r\n    menuSetting.canManagePools = state.Workforce1State.currentCompanyPermissions.CanManagePools;\r\n    menuSetting.canManagePersonnel = state.Workforce1State.currentCompanyPermissions.CanManagePersonnel;\r\n    menuSetting.canManageSelectionInbox = state.Workforce1State.currentCompanyPermissions.CanManageSelectionInbox;\r\n    menuSetting.canShowInvitationStatus = state.Workforce1State.currentCompanyPermissions.CanShowInvitationStatus;\r\n    menuSetting.canInviteClientUser = state.Workforce1State.currentCompanyPermissions.CanInviteClientUser;\r\n    menuSetting.canCreateClient = state.Workforce1State.currentCompanyPermissions.CanCreateClient;\r\n    menuSetting.canManageClient = state.Workforce1State.currentCompanyPermissions.CanManageClient;\r\n    menuSetting.canShowRolePermissionSubscription = state.Workforce1State.currentCompanyPermissions.CanShowRolePermissionSubscription;\r\n    menuSetting.canShowOrphanedResults = state.Workforce1State.currentCompanyPermissions.CanManageOrphanResults;\r\n    menuSetting.canShowPortal = state.Workforce1State.currentCompanyPermissions.CanShowPortal;\r\n    menuSetting.canSearchDefaults = state.Workforce1State.currentCompanyPermissions.CanSearchDefaults;\r\n    menuSetting.CanManageGovPools = state.Workforce1State.currentCompanyPermissions.CanManageGovPools;\r\n    menuSetting.CanManageConsortiumPools = state.Workforce1State.currentCompanyPermissions.CanManageConsortiumPools;\r\n    menuSetting.CanManageGovDonors = state.Workforce1State.currentCompanyPermissions.CanManageGovDonors;\r\n    menuSetting.CanOrderGovServices = state.Workforce1State.currentCompanyPermissions.CanOrderGovServices;\r\n    menuSetting.canCompleteEvents = state.Workforce1State.currentCompanyPermissions.CanCompleteEvents;\r\n    menuSetting.canVieweCCFCopy2PreMRO = state.Workforce1State.currentCompanyPermissions.CanVieweCCFCopy2PreMRO;\r\n    menuSetting.canViewMISReports = state.Workforce1State.currentCompanyPermissions.CanViewMISReports;\r\n    menuSetting.canEditPendingOrders = state.Workforce1State.currentCompanyPermissions.CanEditPendingOrders;\r\n    menuSetting.canMergeTests = state.Workforce1State.currentCompanyPermissions.CanMergeTests;\r\n    menuSetting.canMatchTests = state.Workforce1State.currentCompanyPermissions.CanMatchTests;\r\n  }\r\n\r\n  if (state?.Workforce1State.role) {\r\n    const isSiteAdminVal = isSiteAdmin(state);\r\n    const isCompAdminVal = isCompanyAdmin(state);\r\n    const isPortalAdminVal = isPortalAdmin(state);\r\n    const isLocationAdminVal = isLocationAdmin(state)\r\n\r\n    menuSetting.isSiteAdmin = isSiteAdminVal;\r\n    menuSetting.canManageTeam = isSiteAdminVal || isCompAdminVal || isPortalAdminVal || isLocationAdminVal;\r\n    menuSetting.isCompanyAdmin = isCompAdminVal;\r\n    menuSetting.isPortalAdmin = isPortalAdminVal;\r\n    menuSetting.isLocationAdmin = isLocationAdminVal\r\n  }\r\n\r\n  return menuSetting;\r\n}\r\n","import {AppState, AssignedClinic, WorkforceClinicPortal} from \"../../AppState\";\r\n\r\n//do not export this unless there is no other choice, i.e. its easy to add a new selector..the AssignedClinic has some bad constructs we don't want to propagate\r\n//we also likely would be better off adding an interface(/generic..) in a new file to reduce the looping, but memoization should make that a bad idea..\r\nexport function GetSelectedAssignedClinic(state?: AppState): AssignedClinic | null{\r\n    if(!state){\r\n        return null;\r\n    }\r\n    const companyIdToSearchFor = state?.Workforce1State.selectedCompany;\r\n    if(!companyIdToSearchFor){\r\n        return null;\r\n    }\r\n    let clinicFound: AssignedClinic | null = null;\r\n    for (const portal of state?.Workforce1Companies.visibleCompanies) {\r\n        for(const clinic of  portal.AssignedClientDetailsOfClinic){\r\n            if(clinic.ParticipationID == companyIdToSearchFor){\r\n                clinicFound = clinic;\r\n            }\r\n        }\r\n        if(clinicFound){\r\n            break;\r\n        }\r\n    }\r\n    return clinicFound;\r\n}\r\n\r\nexport function GetSelectedPortal(state?: AppState): WorkforceClinicPortal | undefined {\r\n  // Matching as strings because both Workforce1State.selectedCompany and ParticipationID can either be number or string in different situations\r\n  const companyIdToSearchFor = `${state?.Workforce1State.selectedCompany}`\r\n  return companyIdToSearchFor ? state?.Workforce1Companies.visibleCompanies.find(item => `${item.ParticipationID}` === companyIdToSearchFor) : undefined\r\n}\r\n\r\nconst noUserNameFound: string = \"company-to-username-mapping-error@crlcorp.com\";\r\nexport function getUserNameForSelectedCompany(state?: AppState): string{\r\n    const clinicPicked = GetSelectedAssignedClinic(state);\r\n    return clinicPicked?.UserName || noUserNameFound;\r\n}\r\nexport function EmailOfUserForSelectedCompany(state?: AppState): string{\r\n    return getUserNameForSelectedCompany(state);\r\n}\r\nconst noRole: number = -1;\r\nexport function RoleIdForSelectedCompany(state?: AppState): number{\r\n    const clinicPicked = GetSelectedAssignedClinic(state);\r\n    return clinicPicked?.RoleID || noRole;\r\n}\r\nconst noCompanyName = 'Unnamed Company'\r\nexport function SelectedCompanyName(state?: AppState): string{\r\n    const clinicPicked = GetSelectedAssignedClinic(state);\r\n    return clinicPicked?.Name || noCompanyName;\r\n}\r\n\r\nexport function SelectedAccountName(assignedClinic?: AssignedClinic | null) {\r\n  if (!assignedClinic) {\r\n    return undefined\r\n  }\r\n\r\n  if (assignedClinic.LocationID || 0 > 0) {\r\n    return `${assignedClinic.Name} / ${assignedClinic.LocationName}`\r\n  }\r\n\r\n  return assignedClinic.Name\r\n}\r\n\r\nexport function CompareAccounts(a: AssignedClinic, b: AssignedClinic) {\r\n  return (a.Name).localeCompare(b.Name) || (a.LocationName || \"\").localeCompare(b.LocationName || \"\")\r\n}\r\n\r\nexport function SelectedPortalName(state?: AppState): string | undefined {\r\n    return GetSelectedPortal(state)?.ImplementationName\r\n}\r\nexport function getLoggedInUserName(state?: AppState): string  {\r\n    let userName = getUserNameForSelectedCompany(state)\r\n    if(userName === noUserNameFound){\r\n        userName = `${state?.Workforce1State.userName}`\r\n    }\r\n    return userName || noUserNameFound\r\n}\r\n\r\nexport function isInPortal(state?: AppState): boolean {\r\n    let userName = getUserNameForSelectedCompany(state)\r\n    if (userName === noUserNameFound) {\r\n        userName = `${state?.Workforce1State.userName}`\r\n        if (userName) {\r\n            return true\r\n        }\r\n    }\r\n    return false\r\n}\r\n","import { AppState } from \"../AppState\"\r\nimport UserState from \"./UserState\"\r\nimport {GetSSOToken} from \"../storage/AuthToken\";\r\nimport { GetSelectedPortal, GetSelectedAssignedClinic } from \"./SelectedCompany/CompanySelectionDrivenSelectors\"\r\n\r\nexport function BuildUserState(state?: AppState): UserState {\r\n  return {\r\n    selectedPortal: GetSelectedPortal(state) ?? undefined,\r\n    selectedCompany: GetSelectedAssignedClinic(state) ?? undefined,\r\n    ssoToken: GetSSOToken()\r\n  }\r\n}\r\n","export const Home = \"/\";\r\nexport const SSOHome = \"/sso/auth\";\r\nexport const SSOCallbackRoute = \"/sso/callback\";\r\nexport const AboutRoute = \"/about\";\r\nexport const OrderRoute = \"/order\";\r\nexport const OrderFinishRoute = OrderRoute+ \"/finish\";\r\nexport const SiteSearchRoute = \"/site-search\";\r\nexport const SiteSearchOptionsRoute = \"/clinic-search-options\";\r\nexport const OrdersRoute = \"/orders\";\r\nexport const GovDonorRoute = \"/gov-donor\";\r\nexport const RandomsRoute = \"/random\";\r\nexport const RandomsGovRoute = \"/random-gov\";\r\nexport const ConsortiumsRoute = \"/consortiums\";\r\nexport const GovOrderRoute = \"/gov-order\";\r\nexport const RandomsPersonnelRoute = RandomsRoute+ \"/personnel\";\r\nexport const ConsortiumPersonnelRoute = \"/consortium-personnel\";\r\nexport const SelectionInboxRoute = \"/selection-inbox\";\r\nexport const OurTeamStatusRoute = \"/our-team-status\";\r\nexport const MyInformationRoute = \"/account/my-information\";\r\nexport const BaseAdministrationRoute = \"/administration\";\r\nexport const MyOrganizationRoute = BaseAdministrationRoute+\"/my-organization/\";\r\nexport const MyOrganizationNameRoute = BaseAdministrationRoute+\"/my-organization/:name\";\r\nexport const AddNewPortalRoute = BaseAdministrationRoute+\"/add-new-portal/\";\r\nexport const PortalDetailsRoute = (name?: string) => BaseAdministrationRoute+\"/my-organization/\"+name;\r\nexport const PortalAdministrationRoute = BaseAdministrationRoute+\"/portal-administration\";\r\nexport const CompanyInformationRoute = BaseAdministrationRoute+\"/company-information\";\r\nexport const CompanyInformationNameRoute = BaseAdministrationRoute+\"/company-information/:companyName\";\r\nexport const CompanyDetailsRoute = (name?: string) => BaseAdministrationRoute+\"/company-information/\"+name;\r\nexport const AddNewCompanyRoute = BaseAdministrationRoute+\"/add-new-company/\";\r\nexport const AddNewCompanyNameRoute = BaseAdministrationRoute+\"/add-new-company/:name\";\r\nexport const AddCompanyForPortalRoute = (name?: string) => BaseAdministrationRoute+\"/add-new-company/\"+name;\r\nexport const LocationInformationRoute = BaseAdministrationRoute+\"/location-information\"\r\nexport const ActivateUserRoute = BaseAdministrationRoute+\"/user-activation\";\r\nexport const ActivateCompanyRoute = BaseAdministrationRoute+\"/company-activation\";\r\nexport const ActivatePortalRoute = BaseAdministrationRoute+\"/portal-activation\";\r\nexport const GlobalParameterRoute = BaseAdministrationRoute+\"/global-parameter\";\r\nexport const OrderableServicesRoute = BaseAdministrationRoute+\"/orderable-services\";\r\nexport const UserCodesRoute = BaseAdministrationRoute+\"/user-codes\";\r\nexport const UserLabelsRoute = BaseAdministrationRoute+\"/user-labels\";\r\nexport const RegulatoryModeRoute = \"/regulatory-mode\";\r\nexport const OrphanedResultsRoute = \"/orphaned-results\";\r\nexport const PermissionsRoute = \"/roles-permissions\";\r\nexport const InviteStatusRoute = \"/invitation-status\";\r\nexport const BaseInviteRoute = \"/invitation\";\r\nexport const InviteSiteAdmininstratorRoute = BaseInviteRoute+\"/site-administrator\";\r\nexport const LegacyWorkforceClientRoute = \"/client\";\r\nconst LegacyWorkforceUserRoute = \"/user\";\r\nexport const LegacyWorkforceInvitationRoute = LegacyWorkforceClientRoute + \"/initial-setup\";\r\nexport const LegacyWorkforceUserInvitationRoute = LegacyWorkforceUserRoute + \"/initial-setup\";\r\nexport const LegacyWorkforceCompanyInvitationRoute = LegacyWorkforceClientRoute + \"/initial-setup\";\r\nexport const LegacyWorkforcePortalInvitationRoute = \"/initial-setup\";\r\nexport const WorkforceOnePswUpdate = \"/update-password\";\r\nexport const WorkforceOnePswConfigureRoute = \"/configure-password\";\r\nexport const SSOOrderRoute = \"/sso/order\";\r\nexport const SSOOrderFinishRoute = SSOOrderRoute + \"/finish\";\r\nexport const SSOSiteSearchRoute = \"/sso/site-search\";\r\nexport const ReportPositiveRoute = \"/report/positive\";\r\nexport const SSOGetAuthFormRoute = \"/sso/getauthform\";\r\nexport const ReportTestingSummaryRoute = \"/report/testing-summary\";\r\nexport const ReportSpecimenPositivityRoute = \"/report/specimen-positivity\";\r\nexport const ReportDrugDetailRoute = \"/report/drug-detail\";\r\nexport const ReportDailySummaryRoute = \"/report/daily-summary\";\r\nexport const ReportIvrCallInComplianceRoute = \"/report/ivr-call-in-compliance\";\r\nexport const ReportNoShowRoute = \"/report/no-show\";\r\nexport const ReportCertificationRenewalRoute = \"/report/cert-renewal\";\r\nexport const ReportCertificationStatusRoute = \"/report/cert-status\";\r\nexport const ReportManagementSummaryRoute = \"/report/management-summary\";\r\nexport const ReportMISRoute = \"/report/mis\";\r\nexport const ReportSelectedNotTestedRoute = \"/report/selected-not-tested\";\r\nexport const ReportSummaryRoute = \"/report/summary\";\r\nexport const ReportUnmergedRandomResultsRoute = \"/report/unmerged_random_results\";\r\nexport const ConfigureOrderDefaultsRoute = BaseAdministrationRoute+\"/order-defaults\";\r\nexport const SendingFacilityRoute = \"/sending-facilities\";\r\nexport const LabResultsReportingRoute = BaseAdministrationRoute+\"/lab-results-reporting\";\r\nexport const ReportUnmergedRandomResults = \"/report/unmerged-random-results\";\r\n\r\nexport const LegacyWorkforceLogInRoute = \"/workforce-login\";\r\nexport type ParameterFreeRouteType = '/'| '/order'| '/order/finish' | '/site-search' | '/orders' | '/random' |  '/random/personnel' | '/consortiums' | '/consortium-personnel' | '/selection-inbox' | '/clinic-search-options';\r\nexport default ParameterFreeRouteType;\r\n","import * as React from \"react\"\r\nimport { Button, Spinner, ButtonProps } from \"react-bootstrap\"\r\n\r\ninterface ActionButtonProps extends ButtonProps {\r\n  spin?: boolean\r\n  disableOnSpin?: boolean\r\n  children?: React.ReactNode\r\n}\r\n\r\nexport default class ActionButton extends React.PureComponent<ActionButtonProps> {\r\n  render() {\r\n    const { spin, disableOnSpin, disabled, className, children, ...buttonProps } = this.props\r\n    const actualDisabled = disabled || (disableOnSpin && spin)\r\n    const actualClassName = `${className || \"\"} btn-icon`\r\n    return (\r\n      <Button {...buttonProps} className={actualClassName} disabled={actualDisabled}>\r\n        {children}\r\n        {spin && <Spinner animation=\"border\" size=\"sm\" variant={this.props.variant} className=\"ml-1\" />}\r\n      </Button>)\r\n  }\r\n}\r\n","export function baseUrl(): string {\r\n    return `/clinicportal/ng/`;\r\n}\r\nexport function ApiHostName(): string {\r\n    //return 'http://workforce-test.formfox.com';\r\n    const baseDomain = window.location.hostname;\r\n    const firstDotIndex = baseDomain.indexOf('.');\r\n    const domain = baseDomain.substring(firstDotIndex + 1);\r\n    return (`${window.location.protocol}//${domain}${window.location.port ? `:${window.location.port}` : \"\"}`);\r\n    //return \"http://localhost:49924\";\r\n}\r\n\r\nexport default function ApiUrl(): string {\r\n    //return 'http://workforce-test.formfox.com/mcpwebapi/api/';\r\n    return (`${ApiHostName()}/mcpwebapi/api/`);\r\n    //return `${ApiHostName()}/api/`;\r\n}\r\n\r\nexport function ApiRootUrl(): string {\r\n    //return 'http://workforce-test.formfox.com/mcpwebapi/';\r\n    return (`${ApiHostName()}/mcpwebapi`);\r\n    //return `${ApiHostName()}`;\r\n}\r\n\r\nexport function FullBaseUrl(): string {\r\n    const baseDomain = window.location.origin;\r\n    return `${baseDomain}${baseUrl()}#`;\r\n}\r\n\r\nexport function PortalSource(): string{\r\n    const baseDomain = window.location.hostname;\r\n    const firstDotIndex = baseDomain.indexOf('.');\r\n    return baseDomain.substring(0, firstDotIndex);\r\n}\r\n","import {ApiAuthRequestInterface} from \"../authentication/BuildAuthRequestInterface\"\r\nimport {GetAuthToken} from \"../storage/AuthToken\";\r\n\r\n\r\nfunction AsyncProblemAuthBuilder(): ApiAuthRequestInterface{\r\n  return {\r\n    api_version: '1.0',\r\n    Agent: 'Chrome',\r\n    IsMarketPlace: 'true',\r\n    auth_token: GetAuthToken() || \"\",\r\n  };\r\n}\r\nexport function BuildFetchRequest(body?: string, method?: string): RequestInit {\r\n  const authDetails = AsyncProblemAuthBuilder();\r\n  return {\r\n    method: method ? method : body ? 'post' : 'get',\r\n    credentials: 'omit',\r\n    headers: new Headers({\r\n      'auth_token': authDetails?.auth_token,\r\n      'IsMarketPlace': authDetails.IsMarketPlace,\r\n      'Agent': authDetails.Agent,\r\n      'api_version' :authDetails.api_version,\r\n\r\n      'Accept': 'application/json',\r\n      'Content-Type': 'application/json',\r\n  }),\r\n  body\r\n}}\r\n","import {CurrentUserPermissions} from \"../../AppState\";\r\n\r\nexport const defaultCurrentUserPermissions: CurrentUserPermissions  = {\r\n    \"CanShowClinicAdminSetup\": false,\r\n    \"CanShowInvitation\": false,\r\n    \"CanShowRolePermissionSubscription\": false,\r\n    \"CanShowNotification\": false,\r\n    \"CanShowClientInvitationStatus\": false,\r\n    \"CanShowUserInvitationStatus\": false,\r\n    \"CanShowPortal\": false,\r\n    \"CanShowInvitationStatus\": false,\r\n    \"CanViewSiteSearch\": false,\r\n    \"CanViewOrder\": false,\r\n    \"CanViewTracking\": false,\r\n    \"CanViewCompleted\": false,\r\n    \"CanInviteClientUser\": false,\r\n    \"CanManageClient\": false,\r\n    \"CanCreateClient\": false,\r\n    \"CanCreateInstance\": false,\r\n    \"CanEditPendingOrders\": false,\r\n    \"CanViewRandomTesting\": false,\r\n    \"CanManageClientUser\": false,\r\n    \"CanManageInstanceUser\": false,\r\n    \"CanViewPersonnel\": false,\r\n    \"CanViewOrderTrackingGrid\": false,\r\n    \"CanManageServiceEvent\": false,\r\n    \"CanVieweCCFCopy2PreMRO\": false,\r\n    \"CanViewOrderSummary\": false,\r\n    \"CanManagePersonnel\": false,\r\n    \"CanManagePools\": false,\r\n    \"CanCompleteEvents\": false,\r\n    \"CanUploadImages\": false,\r\n    \"CanViewAddressAlert\": false,\r\n    \"CanSearchDefaults\": false,\r\n    \"CanGroupInclude\": false,\r\n    \"CanManageOrphanResults\": false,\r\n    \"CanEditPersonnel\": false,\r\n    \"CanManageSelectionInbox\": false,\r\n    \"CanManageGovDonors\": false,\r\n    \"CanManageGovPools\": false,\r\n    \"CanManageConsortiumPools\": false,\r\n    \"CanOrderGovServices\": false,\r\n    \"CanViewMISReports\": false,\r\n    \"CanMergeTests\": false,\r\n    \"CanMatchTests\": false\r\n}\r\n","import {\r\n    CurrentSelectedCompanyPermissions,\r\n    CurrentUserPermissions,\r\n    adminRoleType\r\n} from \"../AppState\";\r\nimport {defaultCurrentUserPermissions} from \"../reducers/Defaults/CurrentUserPermissions\";\r\n\r\nexport interface WorkforceOneCompanyPermissionPayload{\r\n    companyPermission: CurrentSelectedCompanyPermissions\r\n    role: adminRoleType\r\n    selectedCompany: string,\r\n    requireCompleteSetup: boolean,\r\n    link: string\r\n}\r\nexport type COMPANY_PERMISSION_TYPE = 'WORKFORCE_ONE_COMPANY_PERMISSION_CHANGED';\r\nexport const COMPANY_PERMISSION = 'WORKFORCE_ONE_COMPANY_PERMISSION_CHANGED';\r\nexport interface WorkforceOneCompanyPermissionAction {\r\n    type: COMPANY_PERMISSION_TYPE\r\n    payload: WorkforceOneCompanyPermissionPayload\r\n}\r\nexport function WorkforceOneUserCompanyPermissionChange(role: adminRoleType, companyPermission: CurrentSelectedCompanyPermissions, selectedCompany: string, requireCompleteSetup: boolean, link: string) : WorkforceOneCompanyPermissionAction {\r\n    return {\r\n        type: COMPANY_PERMISSION,\r\n        payload: {\r\n            companyPermission,\r\n            role,\r\n            selectedCompany,\r\n            requireCompleteSetup,\r\n            link\r\n        }\r\n    }\r\n}\r\n\r\nexport interface WorkforceOneUserPermissionPayload{\r\n    userPermission: CurrentUserPermissions\r\n}\r\nexport type USER_PERMISSION_CHANGED_TYPE = 'WORKFORCE_ONE_PERMISSION_CHANGED';\r\nexport const USER_PERMISSION_CHANGED = 'WORKFORCE_ONE_PERMISSION_CHANGED';\r\nexport interface WorkforcePermissionChangedAction{\r\n    type: USER_PERMISSION_CHANGED_TYPE,\r\n    payload: WorkforceOneUserPermissionPayload\r\n}\r\nexport function WorkforcePermissionChanged(userPermissionData: CurrentUserPermissions | null): WorkforcePermissionChangedAction {\r\n    const userPermission = userPermissionData || defaultCurrentUserPermissions\r\n    return {\r\n        type: USER_PERMISSION_CHANGED,\r\n        payload: {\r\n            userPermission\r\n        }\r\n    }\r\n}\r\nexport type WorkforceOnePermissionAction = |  WorkforceOneCompanyPermissionAction | WorkforcePermissionChangedAction\r\n","import {NoAdminRole, UserState} from \"../AppState\";\r\nimport {AppActions} from \"../actions\";\r\nimport {ALLOW_COMPANY_SELECTION, COMPANY_SELECTED} from \"../actions/WorkforceClinicAction\";\r\nimport { USER_LOGGED_IN, USER_LOGGED_IN_FAILED, USER_LOGGED_OUT, USER_LOGIN, SSO_USER_LOGIN, SSO_TOKEN_USER_LOGIN, USER_LOGGED_IN_WRONG_URL } from \"../actions/WorkforceOneLoginActions\"\r\nimport {COMPANY_PERMISSION, USER_PERMISSION_CHANGED} from \"../actions/WorkforceOnePermissionActions\";\r\nimport {defaultCurrentUserPermissions} from \"./Defaults/CurrentUserPermissions\";\r\n\r\nfunction getCleanUserState(): UserState{\r\n    return {\r\n        isLoading: false,\r\n        isLoggedIn: false,\r\n        loadedSelectedCompanyPermission: false,\r\n        requireCompleteSetup: false,\r\n        showCompanySelection: false,\r\n        role: NoAdminRole,\r\n        currentUserPermissions: defaultCurrentUserPermissions,\r\n    };\r\n}\r\nexport default function Workforce1User(state = getCleanUserState(), action: AppActions) : UserState {\r\n    switch (action.type) {\r\n        case USER_LOGIN:{\r\n            return {\r\n                ...state,\r\n                isLoading: true,\r\n                userName: action.payload.userName,\r\n                requireCompleteSetup: false,\r\n                loginResultMessage: undefined\r\n            };\r\n        }\r\n        case USER_LOGGED_IN:{\r\n            return {\r\n                ...state,\r\n                isLoggedIn: true,\r\n                webToken:action.payload.AuthToken,\r\n                isLoading: false,\r\n                userName: action.payload.UserName,\r\n            };\r\n        }\r\n        case USER_LOGGED_IN_WRONG_URL:{\r\n            return {\r\n                ...state,\r\n                isLoggedIn: true,\r\n                isLoading: false,\r\n                loginResultMessage: action.payload.Message,\r\n            };\r\n        }\r\n        case USER_LOGGED_IN_FAILED:{\r\n            return {\r\n                ...state,\r\n                isLoading: false,\r\n                userName: undefined,\r\n            };\r\n        }\r\n        case USER_LOGGED_OUT:{\r\n            return {\r\n                ...state,\r\n                loadedSelectedCompanyPermission: false,\r\n                showCompanySelection: false,\r\n                isLoggedIn: false,\r\n                webToken: undefined,\r\n                userName: undefined,\r\n                isLoading: false,\r\n                selectedCompany: undefined,\r\n                requireCompleteSetup: false,\r\n                loginResultMessage: undefined\r\n            };\r\n        }\r\n        case USER_PERMISSION_CHANGED: {\r\n\r\n            return {\r\n                ...state,\r\n                isLoading: false,\r\n                currentUserPermissions:{\r\n                    ...action.payload.userPermission\r\n                }\r\n            };\r\n        }\r\n        case COMPANY_SELECTED: {\r\n            return {\r\n                ...state,\r\n                loadingCompany: action.payload.participationId,\r\n                requireCompleteSetup: false,\r\n                showCompanySelection: false\r\n            };\r\n        }\r\n        case ALLOW_COMPANY_SELECTION: {\r\n          return {\r\n              ...state,\r\n              showCompanySelection: true\r\n          };\r\n      }\r\n        case COMPANY_PERMISSION: { // COMPANY_SELECTION_SUCCESSFUL\r\n            return {\r\n                ...state,\r\n                loadedSelectedCompanyPermission: true,\r\n                loadingCompany: undefined,\r\n                selectedCompany: action.payload.selectedCompany,\r\n                requireCompleteSetup: action.payload.requireCompleteSetup,\r\n                link: action.payload.link,\r\n                role: action.payload.role,\r\n                currentCompanyPermissions: {...action.payload.companyPermission}\r\n            };\r\n        }\r\n        case SSO_USER_LOGIN:\r\n        case SSO_TOKEN_USER_LOGIN: {\r\n          return {\r\n            ...state,\r\n            isLoading: true\r\n          }\r\n        }\r\n        default:\r\n            return state\r\n    }\r\n}\r\n","import {CompaniesState} from \"../AppState\";\r\nimport {AppActions} from \"../actions\";\r\nimport { CLINIC_LIST_UPDATED } from \"../actions/WorkforceClinicAction\";\r\nimport {USER_LOGGED_IN, USER_LOGGED_IN_WRONG_URL} from \"../actions/WorkforceOneLoginActions\";\r\n\r\nfunction getCleanUserState(): CompaniesState{\r\n    return {\r\n        visibleCompanies: []\r\n    };\r\n}\r\n\r\nexport default function Workforce1Companies(state = getCleanUserState(), action: AppActions) : CompaniesState {\r\n    switch (action.type) {\r\n        case USER_LOGGED_IN:{\r\n            return {\r\n                ...state,\r\n                visibleCompanies: action.payload.Portal.Clinic\r\n            };\r\n        }\r\n        case CLINIC_LIST_UPDATED:{\r\n          return {\r\n              ...state,\r\n              visibleCompanies: action.payload.Clinic\r\n          };\r\n      }\r\n        case USER_LOGGED_IN_WRONG_URL:{\r\n            return {\r\n                ...state,\r\n                visibleCompanies: action.payload.Portal.Clinic\r\n            };\r\n        }\r\n        default:\r\n            return state\r\n    }\r\n}\r\n","import {Action, combineReducers, Reducer} from \"redux\";\r\nimport {History} from \"history\";\r\nimport {connectRouter} from \"connected-react-router\";\r\nimport {AppState, WorkforceRoute} from \"../AppState\";\r\nimport Workforce1User from \"./Workforce1User\";\r\nimport Workforce1Companies from \"./Workforce1Companies\";\r\n\r\n\r\nexport interface RootReduceType extends Reducer<AppState, Action> {\r\n\r\n}\r\n\r\nconst createRootReducer = (history: History<WorkforceRoute>): RootReduceType => {\r\n    return combineReducers(\r\n        {\r\n            router: connectRouter(history),\r\n            Workforce1State: Workforce1User,\r\n            Workforce1Companies: Workforce1Companies,\r\n        }\r\n    );\r\n};\r\nexport default createRootReducer;\r\n","import {AppState} from \"../AppState\"\r\n\r\nexport interface ApiAuthRequestInterface {\r\n    auth_token: string\r\n    Agent: 'Chrome'\r\n    IsMarketPlace: 'true'\r\n    api_version :'1.0'\r\n}\r\n\r\nexport function BuildAuthRequestFromAppState(state?: AppState): ApiAuthRequestInterface {\r\n    return {\r\n        api_version: '1.0',\r\n        Agent: 'Chrome',\r\n        IsMarketPlace: 'true',\r\n        auth_token: state?.Workforce1State.webToken || \"\",\r\n    }\r\n}\r\n","import {Epic, ofType} from \"redux-observable\";\r\nimport {AppActions} from \"../actions\";\r\nimport {AppState, CurrentSelectedCompanyPermissions} from \"../AppState\";\r\nimport {map, mergeMap, switchMap} from \"rxjs/operators\";\r\nimport {fromFetch} from \"rxjs/fetch\";\r\nimport ApiUrl from \"../api/ApiUrl\";\r\nimport {BuildAuthRequestFromAppState} from \"../authentication/BuildAuthRequestInterface\";\r\nimport {WorkforcePermissionChanged} from \"../actions/WorkforceOnePermissionActions\";\r\nimport {USER_LOGGED_IN, WorkforceOneLoggedInAction} from \"../actions/WorkforceOneLoginActions\";\r\nimport ApiResponse from \"../api/ApiResponse\";\r\n\r\nconst WorkforceOneUserAccess:  Epic<AppActions, AppActions, AppState> = (action$, states$) => {\r\n    return action$.pipe(\r\n        ofType(USER_LOGGED_IN),\r\n        mergeMap((action: AppActions) => {\r\n                const authDetails = BuildAuthRequestFromAppState(states$.value);\r\n                const loginDetailFromAction = action as WorkforceOneLoggedInAction;\r\n                return fromFetch(`${ApiUrl()}FFOrderAccount/GetUserAccess`,\r\n                    {\r\n                        method: 'GET',\r\n                        credentials: 'omit',\r\n                        headers: new Headers({\r\n                            'auth_token': loginDetailFromAction.payload.AuthToken,\r\n                            'IsMarketPlace': authDetails.IsMarketPlace,\r\n                            'Agent': authDetails.Agent,\r\n                            'api_version': authDetails.api_version,\r\n                            'Accept': 'application/json',\r\n                            'Content-Type': 'application/json',\r\n                        }),\r\n                    })\r\n                    .pipe(switchMap(response => response.ok ?\r\n                        response.json() :\r\n                        Promise.resolve(null)))\r\n                    .pipe(map((json: ApiResponse<CurrentSelectedCompanyPermissions> | null) => {\r\n                        if(json){\r\n                            return WorkforcePermissionChanged(json.data)\r\n                        }else{\r\n                            return WorkforcePermissionChanged(json)\r\n                        }\r\n                    }))\r\n            }\r\n        )\r\n    );\r\n};\r\nexport default WorkforceOneUserAccess;\r\n","export const ImportCSVMaxFileSize = 25000000\r\nexport const MaxImageFileSize = 1024000\r\nexport const MaxFileNameLength = 200\r\nexport const MaxLogoImageWidth = 200\r\nexport const MaxLogoImageHeight = 100\r\nexport const MaxInvitationAttempts = 5\r\nexport const MaxFailedLoginAttempts = 4\r\nexport const AccountLimit = 10\r\nexport const EmailRegexp = /^(([^<>()[\\]\\\\.,;:\\s@\"]+(\\.[^<>()[\\]\\\\.,;:\\s@\"]+)*)|(\".+\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$/\r\nexport const PhoneRegexp = /^[0-9]{3}-[0-9]{3}-[0-9]{4}$/\r\nexport const NameRegexp = /^[a-zA-Z0-9 '.-]*$/\r\nexport const CompanyNameRegexp = \"^[a-zA-Z0-9-.,' ]*$\"\r\nexport const MaxDonorIdLength = 25\r\nexport const InvalidDonorIdLength = `Donor ID should contain 1 - ${MaxDonorIdLength} characters.`\r\nexport const DonorIdRegexp = /^[^ '-]*$/\r\nexport const InvalidDonorId = \"Spaces, apostrophes and hyphens are not allowed.\"\r\nexport const IntlPhoneRegexp11 = /^[0-9]{1}-[0-9]{3}-[0-9]{3}-[0-9]{4}$/\r\nexport const ZipRegexp = /^[0-9]{5}$/\r\nexport const CamelCaseRegexp = /([a-z])([A-Z])/g\r\nexport const SiteDomain = \"workforce-stage.clinholdco.com\"\r\nexport const ProtectedSites = [\"aol\", \"att\", \"bellsouth\", \"comcast\", \"earthlink\", \"frontier\", \"gmail\", \"hotmail\", \"imail\", \"mail\", \"msn\", \"outlook\", \"qwestoffice\", \"sbcglobal\", \"windstream\", \"yahoo\"]\r\nexport const ReCaptchaSiteKey = \"6LdVBnAUAAAAAOqWTjak57WEmTJb6-rELjtqT4nr\"  // TODO: Workforce 1.0 production\r\nexport const GMapApiKey = \"AIzaSyBk9jTuJa7GYll5lkPO5xYbM8TkxKvab2A\"\r\nexport const DefaultMapLatitude = 40.4402885\r\nexport const DefaultMapLongitude = -99.36982169999999\r\nexport const UpdateMethodID = 1 // Kyle: This turned out to be hardcoded as a 1.\r\nexport const AccountTypeID = 2\r\nexport const RpAccountType = 2\r\nexport const ImplementationGroupID_Workforce = 3\r\nexport const IpifyUrl = \"https://api.ipify.org?format=json\"\r\nexport const WorkForceLogo = \"/images/Logo/formfox.png\"\r\nexport const QuickStartLogo = \"/images/Logo/quickstart.png\"\r\nexport const LabAccountMaxLength = 30\r\nexport const InvalidNameMessage = \"Only letters, digits, spaces, dots, apostrophes and hyphens are allowed.\"\r\nexport const DisabledDefaultOrderableService = \"This is default service and cannot be removed for Company. Please remove this service as a default for Portal to allow editing on Company level.\"\r\nexport const ImplementationTypeGovt = \"GOVT\"\r\nexport const MinDate = 1\r\nexport const MaxDateWeekly = 7\r\nexport const MaxDateMonthly = 31\r\nexport enum StorageKey {\r\n  SavedOrderData = \"savedOrderData\",\r\n  OrderedServices = \"servicesBeingOrdered\",\r\n  OrderDonorSiteSelect = \"orderDonorSiteSelect\",\r\n  CanViewOrderFinish = \"canViewOrderFinish\",\r\n  FromSelectionInbox = \"fromSelectionInbox\",\r\n  OrderTrackingGridColumns = \"orderTrackingGridColumns\",\r\n  PoolMembersGridColumns = \"poolMembersGridColumns\",\r\n  RandomPersonnelGridColumns = \"randomPersonnelGridColumns\",\r\n  SelectionInboxGridColumns = \"selectionInboxGridColumns\",\r\n  ImplementationType = \"implementationType\",\r\n  CachedCollectionTests = \"cachedCollectionTests\",\r\n  InvitationStatusGridColumns = \"invitationStatusGridColumns\"\r\n}\r\nexport enum EventType {\r\n  Breath = \"BR\",\r\n  Saliva = \"SL\",\r\n  Urine = \"UR\",\r\n  UrinePOCT = \"QT\",\r\n  SalivaDrug = \"SLD\",\r\n  SalivaDrugPOCT = \"QTS\",\r\n}\r\nexport enum ClinicStatus {\r\n  UserConfigured = 9,\r\n  ClinicConfigured = 10,\r\n  ClientConfigured = 11,\r\n  Completed = 12\r\n}\r\n\r\nexport enum ScheduleStatus {\r\n  Cancelled = 11\r\n}\r\n\r\nexport enum AccountType {\r\n  MasterAccount = 1,\r\n  Company = 2,\r\n  Region = 3,\r\n  Location = 4\r\n}","import {Epic, ofType} from \"redux-observable\";\r\nimport {AppActions} from \"../actions\";\r\nimport {AppState} from \"../AppState\";\r\nimport {catchError, map, mergeMap, switchMap} from \"rxjs/operators\";\r\nimport {fromFetch} from \"rxjs/fetch\";\r\nimport ApiUrl from \"../api/ApiUrl\";\r\nimport {\r\n    USER_LOGIN,\r\n    WorkforceOneLoggedInWrongUrl,\r\n    WorkforceOneLoginAction,\r\n    WorkforceOneUserHasLoggedIn,\r\n    WorkforceOneUserLoginFailed\r\n} from \"../actions/WorkforceOneLoginActions\";\r\n\r\nconst WorkforceOneUserLoginEpic:  Epic<AppActions, AppActions, AppState> = (action$, state$ ) => {\r\n    return action$.pipe(\r\n        ofType(USER_LOGIN),\r\n        mergeMap((action:AppActions) => {\r\n                const loginDetailFromAction = action as WorkforceOneLoginAction;\r\n                return fromFetch(`${ApiUrl()}FFOrderAccount/Login`,\r\n                    {\r\n                        method: 'POST',\r\n                        credentials: 'omit',\r\n                        body: JSON.stringify(loginDetailFromAction.payload),\r\n                        headers: {\r\n                            'IsMarketPlace':\"true\",\r\n                            'Agent': 'Chrome',\r\n                            'api_version':'1.0',\r\n                            'Accept': 'application/json',\r\n                            'Content-Type': 'application/json'\r\n                        },\r\n                    })\r\n                    .pipe(switchMap(response => response.ok ?\r\n                        response.json() : Promise.resolve(response.json())),\r\n                        catchError(err => {\r\n                            console.error(err);\r\n                            return Promise.resolve(null);\r\n                        })\r\n                        )\r\n                    .pipe(map(json => json != null && (json.data != null || json.error != null)\r\n                        ? json.error != null\r\n                          ? WorkforceOneUserLoginFailed(json.error.message)\r\n                          : json.data.Message != null\r\n                            ? WorkforceOneLoggedInWrongUrl(json.data)\r\n                            : WorkforceOneUserHasLoggedIn(json.data.AuthToken, json.data.UserLoginID, \"\", json.data)\r\n                        : WorkforceOneUserLoginFailed()))\r\n            }\r\n        )\r\n    );\r\n};\r\nexport default WorkforceOneUserLoginEpic;\r\n","import { Epic, ofType } from \"redux-observable\";\r\nimport { AppActions } from \"../actions\";\r\nimport {\r\n  adminRoleType,\r\n  AppState,\r\n  CompanyRole,\r\n  CurrentSelectedCompanyPermissions,\r\n  NoAdminRole,\r\n  PortalAdmin, SiteAdminRole, LocationAdmin\r\n} from \"../AppState\";\r\nimport { mergeMap, switchMap } from \"rxjs/operators\";\r\nimport { fromFetch } from \"rxjs/fetch\";\r\nimport ApiUrl from \"../api/ApiUrl\";\r\nimport { BuildAuthRequestFromAppState } from \"../authentication/BuildAuthRequestInterface\";\r\nimport { COMPANY_SELECTED, COMPANY_UPDATED, CompanySelectedAction, CompanySelectedPayload, CompanyUpdateAction, CompanyUpdated } from \"../actions/WorkforceClinicAction\";\r\nimport {\r\n  WorkforceOneCompanyPermissionAction,\r\n  WorkforceOneUserCompanyPermissionChange\r\n} from \"../actions/WorkforceOnePermissionActions\";\r\nimport { EMPTY, of } from \"rxjs\";\r\nimport { ClinicStatus } from \"../config/Constants\";\r\nimport { setOrphanedResultsCount } from \"../storage/LogInPortals\";\r\n\r\ninterface ApiResponseModel {\r\n  data: {\r\n    IsClinic: boolean\r\n    IsClient: boolean\r\n    IsSiteAdmin: boolean\r\n    IsLocation: boolean\r\n    Status: number\r\n    UserAccessViewModel: CurrentSelectedCompanyPermissions\r\n  }\r\n}\r\nfunction MapRoleFromApiResponse(responseModel?: ApiResponseModel): adminRoleType {\r\n  if (!responseModel) {\r\n    return NoAdminRole;\r\n  }\r\n  if (responseModel.data.IsClinic) {\r\n    return PortalAdmin;\r\n  }\r\n  if (responseModel.data.IsClient) {\r\n    return CompanyRole;\r\n  }\r\n  if (responseModel.data.IsSiteAdmin) {\r\n    return SiteAdminRole;\r\n  }\r\n  if (responseModel.data.IsLocation) {\r\n    return LocationAdmin\r\n  }\r\n  return NoAdminRole;\r\n}\r\nconst defaultCompanyPerms: CurrentSelectedCompanyPermissions = {\r\n  CanShowClinicAdminSetup: false,\r\n  CanShowInvitation: false,\r\n  CanShowRolePermissionSubscription: false,\r\n  CanShowNotification: false,\r\n  CanShowClientInvitationStatus: false,\r\n  CanShowUserInvitationStatus: false,\r\n  CanShowPortal: false,\r\n  CanShowInvitationStatus: false,\r\n  CanViewSiteSearch: false,\r\n  CanViewOrder: false,\r\n  CanViewTracking: false,\r\n  CanViewCompleted: false,\r\n  CanInviteClientUser: false,\r\n  CanManageClient: false,\r\n  CanCreateClient: false,\r\n  CanCreateInstance: false,\r\n  CanEditPendingOrders: false,\r\n  CanViewRandomTesting: false,\r\n  CanManageClientUser: false,\r\n  CanManageInstanceUser: false,\r\n  CanViewPersonnel: false,\r\n  CanViewOrderTrackingGrid: false,\r\n  CanManageServiceEvent: false,\r\n  CanVieweCCFCopy2PreMRO: false,\r\n  CanViewOrderSummary: false,\r\n  CanManagePersonnel: false,\r\n  CanManagePools: false,\r\n  CanCompleteEvents: false,\r\n  CanUploadImages: false,\r\n  CanViewAddressAlert: false,\r\n  CanSearchDefaults: false,\r\n  CanGroupInclude: false,\r\n  CanManageOrphanResults: false,\r\n  CanEditPersonnel: false,\r\n  CanManageSelectionInbox: false,\r\n  CanManageGovDonors: false,\r\n  CanManageGovPools: false,\r\n  CanManageConsortiumPools: false,\r\n  CanOrderGovServices: false,\r\n  CanViewMISReports: false,\r\n  CanMergeTests: false,\r\n  CanMatchTests: false\r\n};\r\nfunction MapApiResponseToAction(apiResponse?: ApiResponseModel, selectedCompany?: CompanySelectedPayload, requireCompleteSetup?: boolean): WorkforceOneCompanyPermissionAction {\r\n    processResponseData(apiResponse?.data);\r\n    const adminRoleType = MapRoleFromApiResponse(apiResponse);\r\n    const companyResponse = apiResponse?.data.UserAccessViewModel || defaultCompanyPerms;\r\n    const link = selectedCompany?.Link\r\n    return WorkforceOneUserCompanyPermissionChange(adminRoleType, companyResponse, selectedCompany?.participationId || \"\", !!requireCompleteSetup, link || \"\");\r\n}\r\n\r\nfunction processResponseData(data: any) {\r\n    if (!data) {\r\n        return;\r\n    }\r\n    setPortalLogoImageUrl(data.LogoImage)\r\n    setImplementationType(data.ImplementationType)\r\n  setOrphanedResultsCount(data.OrphanedResultsCount)\r\n\r\n}\r\nfunction setPortalLogoImageUrl(logoImage: string) {\r\n  localStorage.removeItem(\"portalImage\");\r\n  if (!!logoImage) {\r\n    localStorage.setItem(\"portalImage\", logoImage);\r\n  }\r\n\r\n\r\n}\r\nfunction setImplementationType(implementationType: string) {\r\n  sessionStorage.removeItem(\"implementationType\");\r\n  if (!!implementationType) {\r\n    sessionStorage.setItem(\"implementationType\", implementationType);\r\n  }\r\n}\r\n\r\nexport const WorkforceOneUpdateUserPortalPermission: Epic<AppActions, AppActions, AppState> = (action$, states$) => {\r\n  return action$.pipe(\r\n    ofType(COMPANY_UPDATED),\r\n    mergeMap((action: AppActions) => {\r\n            const updateAction = action as CompanyUpdateAction\r\n            if (!updateAction.payload.ForceReload) return EMPTY\r\n            const authDetails = BuildAuthRequestFromAppState(states$.value);\r\n            return fromFetch(`${ApiUrl()}FFOrderAccount/GetPortalsCompaniesData`,\r\n                {\r\n                  method: 'GET',\r\n                  credentials: 'omit',\r\n                  headers: new Headers({\r\n                      'auth_token': authDetails.auth_token,\r\n                      'IsMarketPlace': authDetails.IsMarketPlace,\r\n                      'Agent': authDetails.Agent,\r\n                      'api_version': authDetails.api_version,\r\n                      'Accept': 'application/json',\r\n                      'Content-Type': 'application/json',\r\n                  }),\r\n                })\r\n                .pipe(switchMap(response => response.ok ?\r\n                  response.json() :\r\n                  Promise.resolve(null)))\r\n                .pipe(mergeMap(json => {\r\n                  if (!json?.data) {\r\n                    return EMPTY\r\n                  }\r\n                  return of(CompanyUpdated(json.data))\r\n                }))\r\n        }\r\n    )\r\n  );\r\n};\r\n\r\nconst WorkforceOneUserPortalPermission: Epic<AppActions, AppActions, AppState> = (action$, states$) => {\r\n  return action$.pipe(\r\n    ofType(COMPANY_SELECTED),\r\n    mergeMap((action: AppActions) => {\r\n      const selectedCompany = action as CompanySelectedAction;\r\n      const authDetails = BuildAuthRequestFromAppState(states$.value);\r\n      return fromFetch(`${ApiUrl()}FFOrderClinicStatus/GetStatus`,\r\n        {\r\n          method: 'POST',\r\n          credentials: 'omit',\r\n          body: JSON.stringify(selectedCompany.payload),\r\n          headers: new Headers({\r\n            'auth_token': authDetails?.auth_token,\r\n            'IsMarketPlace': authDetails.IsMarketPlace,\r\n            'Agent': authDetails.Agent,\r\n            'api_version': authDetails.api_version,\r\n            'Accept': 'application/json',\r\n            'Content-Type': 'application/json',\r\n          }),\r\n        })\r\n        .pipe(switchMap(response => response.ok ?\r\n          response.json() :\r\n          Promise.resolve(null)))\r\n        .pipe(mergeMap(json => {\r\n          if (!json?.data) {\r\n            return EMPTY\r\n          }\r\n          const requireCompleteSetup = !(json.data.IsSiteAdmin || json.data.Status === ClinicStatus.Completed || (json.data.IsClinic && json.data.Status === ClinicStatus.ClinicConfigured) || ((json.data.IsClient || json.data.IsLocation) && (json.data.Status === ClinicStatus.UserConfigured || json.data.Status === ClinicStatus.ClientConfigured)))\r\n          return of(MapApiResponseToAction(json, selectedCompany.payload, requireCompleteSetup))\r\n        }))\r\n    }\r\n    )\r\n  );\r\n};\r\nexport default WorkforceOneUserPortalPermission;\r\n","import {Epic, ofType} from \"redux-observable\";\r\nimport {AppActions} from \"../actions\";\r\nimport {AppState} from \"../AppState\";\r\nimport {mergeMap} from \"rxjs/operators\";\r\nimport {of} from \"rxjs\";\r\nimport {\r\n    USER_LOGGED_IN,\r\n    WorkforceOneLoggedInAction,\r\n} from \"../actions/WorkforceOneLoginActions\";\r\nimport {AllowSelectCompany, SelectCompany} from \"../actions/WorkforceClinicAction\";\r\n\r\nconst WorkforceOneUserAutoCompanySelectionEpic:  Epic<AppActions, AppActions, AppState> = (action$, states$) => {\r\n    return action$.pipe(\r\n        ofType(USER_LOGGED_IN),\r\n        mergeMap((action: AppActions) => {\r\n                const selectedLoggedInUser = action as WorkforceOneLoggedInAction;\r\n                if(selectedLoggedInUser.payload.Portal.Clinic.length === 1) {\r\n                    const portal = selectedLoggedInUser.payload.Portal.Clinic[0]\r\n                    if (portal.ParticipationID || 0 > 0 && portal.Link?.length || 0 > 0) {\r\n                      return of (SelectCompany(portal.ParticipationID || \"\", portal.Link || \"\"))\r\n                    }\r\n                    const allCompanies = selectedLoggedInUser.payload.Portal.Clinic[0].AssignedClientDetailsOfClinic\r\n                    const companies = allCompanies.filter(item => !item.LocationID)\r\n                    if (companies.length === 1) {\r\n                      return of (SelectCompany(companies[0].ParticipationID, companies[0].Link))\r\n                    }\r\n                    if (allCompanies.length === 1) {\r\n                      return of (SelectCompany(allCompanies[0].ParticipationID, allCompanies[0].Link))\r\n                    }\r\n                }\r\n                return of(AllowSelectCompany());\r\n            }\r\n        )\r\n    );\r\n};\r\nexport default WorkforceOneUserAutoCompanySelectionEpic;\r\n","\r\nexport type PAGE_LOADED_TYPE = 'WORKFORCE_PAGE_LOADED';\r\nexport const PAGE_LOADED = 'WORKFORCE_PAGE_LOADED';\r\nexport interface WorkforceOnePageLoadedAction{\r\n    type: PAGE_LOADED_TYPE\r\n}\r\nexport function PageLoaded(): WorkforceOnePageLoadedAction{\r\n    return {\r\n        type: PAGE_LOADED,\r\n    }\r\n}\r\n\r\n\r\nexport type WorkforceOnePageActions = | WorkforceOnePageLoadedAction;\r\n\r\n","import {Epic, ofType} from \"redux-observable\";\r\nimport {AppActions} from \"../actions\";\r\nimport {AppState} from \"../AppState\";\r\nimport {PAGE_LOADED} from \"../actions/WorkforceOnePageActions\";\r\nimport {mergeMap} from \"rxjs/operators\";\r\nimport {EMPTY, of} from \"rxjs\";\r\nimport {WorkforceOneLoggedInPayload, WorkforceOneUserHasLoggedIn} from \"../actions/WorkforceOneLoginActions\";\r\nimport {GetAuthToken, GetSSOToken, SetSSOToken} from \"../storage/AuthToken\";\r\nimport {GetLoginPortals} from \"../storage/LogInPortals\";\r\nimport {GetUserId} from \"../storage/UserId\";\r\n\r\nconst WorkforceOneLoginPageReturn:  Epic<AppActions, AppActions, AppState> = (action$, states$) => {\r\n    return action$.pipe(\r\n        ofType(PAGE_LOADED),\r\n        mergeMap((action: AppActions) => {\r\n                const loginToken = GetAuthToken();\r\n                const loginId = GetUserId();\r\n                const ssoToken = GetSSOToken();\r\n                const portalsInformation = GetLoginPortals();\r\n                if(loginToken && portalsInformation && portalsInformation.length > 0 && loginId){\r\n                    const loginPayload : WorkforceOneLoggedInPayload = {\r\n                        UserId: loginId,\r\n                        AuthToken: loginToken,\r\n                        Portal: {Clinic: portalsInformation},\r\n                    };\r\n                    return of(WorkforceOneUserHasLoggedIn(loginToken, loginId, ssoToken, loginPayload));\r\n                }\r\n                SetSSOToken(\"\");\r\n                return EMPTY;\r\n            }\r\n        )\r\n    );\r\n};\r\nexport default WorkforceOneLoginPageReturn;\r\n","import {Epic, ofType} from \"redux-observable\";\r\nimport {AppActions} from \"../actions\";\r\nimport {AppState} from \"../AppState\";\r\nimport {mergeMap} from \"rxjs/operators\";\r\nimport {EMPTY, of} from \"rxjs\";\r\nimport {SelectCompany} from \"../actions/WorkforceClinicAction\";\r\nimport {getCompanySelection} from \"../storage/CompanySelection\";\r\nimport {USER_LOGGED_IN} from \"../actions/WorkforceOneLoginActions\";\r\n\r\nconst WorkforceOneCompanySelectPageReturn:  Epic<AppActions, AppActions, AppState> = (action$, states$) => {\r\n    return action$.pipe(\r\n        ofType(USER_LOGGED_IN),\r\n        mergeMap((action: AppActions) => {\r\n                const companySelection = getCompanySelection();\r\n                if(companySelection.company && companySelection.loginLink){\r\n                    return of(SelectCompany(companySelection.company, companySelection.loginLink));\r\n                }\r\n                return EMPTY;\r\n            }\r\n        )\r\n    );\r\n};\r\nexport default WorkforceOneCompanySelectPageReturn;","import {Epic, ofType} from \"redux-observable\";\r\nimport {AppActions} from \"../actions\";\r\nimport {AppState} from \"../AppState\";\r\nimport {mergeMap} from \"rxjs/operators\";\r\nimport {\r\n    USER_P_RESET,\r\n    WorkforceOneUserLogOut\r\n} from \"../actions/WorkforceOneLoginActions\";\r\nimport {EMPTY, of} from \"rxjs\";\r\nimport {SetSSOToken} from \"../storage/AuthToken\";\r\n\r\nconst WorkforceOneLogOutFromPasswordReset:  Epic<AppActions, AppActions, AppState> = (action$, states$) => {\r\n    return action$.pipe(\r\n        ofType(USER_P_RESET),\r\n        mergeMap((action: AppActions) => {\r\n                if(states$.value.Workforce1State.isLoggedIn){\r\n                    return of (WorkforceOneUserLogOut());\r\n                }\r\n                SetSSOToken(\"\");\r\n                return EMPTY;\r\n            }\r\n        )\r\n    );\r\n};\r\nexport default WorkforceOneLogOutFromPasswordReset;\r\n","import {Epic, ofType} from \"redux-observable\";\r\nimport {AppActions} from \"../actions\";\r\nimport {AppState} from \"../AppState\";\r\nimport {mergeMap, switchMap} from \"rxjs/operators\";\r\nimport {BuildAuthRequestFromAppState} from \"../authentication/BuildAuthRequestInterface\";\r\nimport {fromFetch} from \"rxjs/fetch\";\r\nimport ApiUrl from \"../api/ApiUrl\";\r\nimport {USER_P_RESET, WorkforceOnePasswordResetAction} from \"../actions/WorkforceOneLoginActions\";\r\nimport {EMPTY} from \"rxjs\";\r\n\r\n\r\nconst WorkforceOnePasswordResetRequest:  Epic<AppActions, never, AppState> = (action$, states$) => {\r\n    return action$.pipe(\r\n        ofType(USER_P_RESET),\r\n        mergeMap((action: AppActions) => {\r\n                const selectedCompany = action as WorkforceOnePasswordResetAction;\r\n                const authDetails = BuildAuthRequestFromAppState(states$.value);\r\n                return fromFetch(`${ApiUrl()}FFOrderClinicStatus/GetStatus`,\r\n                    {\r\n                        method: 'POST',\r\n                        credentials: 'omit',\r\n                        body: JSON.stringify(selectedCompany.payload),\r\n                        headers: new Headers({\r\n                            'auth_token': authDetails?.auth_token,\r\n                            'IsMarketPlace': authDetails.IsMarketPlace,\r\n                            'Agent': authDetails.Agent,\r\n                            'api_version': authDetails.api_version,\r\n                            'Accept': 'application/json',\r\n                            'Content-Type': 'application/json',\r\n                        }),\r\n                    })\r\n                    .pipe(switchMap(response => response.ok ?\r\n                        response.json() :\r\n                        Promise.resolve(null)))\r\n                    .pipe(switchMap(() => {\r\n                        // it may be a good idea to toast.. api response..\r\n                        return EMPTY;\r\n                    }))\r\n            }\r\n        )\r\n    );\r\n};\r\nexport default WorkforceOnePasswordResetRequest;\r\n","import {Epic, ofType} from \"redux-observable\";\r\nimport {AppActions} from \"../actions\";\r\nimport {AppState} from \"../AppState\";\r\nimport {catchError, map, mergeMap, switchMap} from \"rxjs/operators\";\r\nimport {fromFetch} from \"rxjs/fetch\";\r\nimport ApiUrl from \"../api/ApiUrl\";\r\nimport {\r\n    SSO_USER_LOGIN,\r\n    SSOWorkforceOneLoginAction,\r\n    WorkforceOneUserHasLoggedIn,\r\n    WorkforceOneUserLoginFailed\r\n} from \"../actions/WorkforceOneLoginActions\";\r\n\r\nconst WorkforceOneSSOUserLoginEpic:  Epic<AppActions, AppActions, AppState> = (action$, state$ ) => {\r\n    return action$.pipe(\r\n        ofType(SSO_USER_LOGIN),\r\n        mergeMap((action:AppActions) => {\r\n                const loginDetailFromAction = action as SSOWorkforceOneLoginAction\r\n                const { ssoToken, ...payload } =  loginDetailFromAction.payload\r\n                const body = JSON.stringify(payload)\r\n                return fromFetch(`${ApiUrl()}FFOrderAccount/SSORequest`,\r\n                    {\r\n                        method: 'POST',\r\n                        credentials: 'omit',\r\n                        body: body,\r\n                        headers: {\r\n                            \"IsMarketPlace\": \"true\",\r\n                            'Agent': 'Chrome',\r\n                            \"api_version\": \"1.0\",\r\n                            \"Accept\": \"application/json\",\r\n                            \"Content-Type\": \"application/json\",\r\n                            \"Authorization\": `Bearer ${ssoToken}`\r\n                        },\r\n                    })\r\n                    .pipe(switchMap(response => response.ok ?\r\n                        response.json():\r\n                        Promise.resolve(null)),\r\n                        catchError(err => {\r\n                            console.error(err);\r\n                            return Promise.resolve(null);\r\n                        })\r\n                        )\r\n                    .pipe(map(json => json != null ?\r\n                        WorkforceOneUserHasLoggedIn(json.data.AuthToken, json.data.UserLoginID, json.data.RequestToken, json.data) :\r\n                        WorkforceOneUserLoginFailed()))\r\n            }\r\n        )\r\n    );\r\n};\r\nexport default WorkforceOneSSOUserLoginEpic;\r\n","import {Epic, ofType} from \"redux-observable\";\r\nimport {AppActions} from \"../actions\";\r\nimport {AppState} from \"../AppState\";\r\nimport {catchError, map, mergeMap, switchMap} from \"rxjs/operators\";\r\nimport {fromFetch} from \"rxjs/fetch\";\r\nimport ApiUrl from \"../api/ApiUrl\";\r\nimport {\r\n    SSO_TOKEN_USER_LOGIN,\r\n    SSOTokenWorkforceOneLoginAction,\r\n    WorkforceOneUserHasLoggedIn,\r\n    WorkforceOneUserLoginFailed,\r\n} from \"../actions/WorkforceOneLoginActions\";\r\n\r\nconst WorkforceOneSSOTokenUserLoginEpic:  Epic<AppActions, AppActions, AppState> = (action$, state$ ) => {\r\n    return action$.pipe(\r\n        ofType(SSO_TOKEN_USER_LOGIN),\r\n        mergeMap((action:AppActions) => {\r\n                const loginDetailFromAction = action as SSOTokenWorkforceOneLoginAction\r\n                const { ssoToken } =  loginDetailFromAction.payload\r\n                const body = JSON.stringify(loginDetailFromAction.payload)\r\n                return fromFetch(`${ApiUrl()}FFOrderAccount/SSOTokenLogin`,\r\n                    {\r\n                        method: 'POST',\r\n                        credentials: 'omit',\r\n                        body: body,\r\n                        headers: {\r\n                            \"IsMarketPlace\": \"true\",\r\n                            'Agent': 'Chrome',\r\n                            \"api_version\": \"1.0\",\r\n                            \"Accept\": \"application/json\",\r\n                            \"Content-Type\": \"application/json\"\r\n                        },\r\n                    })\r\n                    .pipe(switchMap(response => response.ok ?\r\n                        response.json():\r\n                        Promise.resolve(null)),\r\n                        catchError(err => {\r\n                            console.error(err);\r\n                            return Promise.resolve(null);\r\n                        })\r\n                        )\r\n                    .pipe(map(json => json != null ?\r\n                        WorkforceOneUserHasLoggedIn(json.data.AuthToken, json.data.UserLoginID, ssoToken, json.data) :\r\n                        WorkforceOneUserLoginFailed()))\r\n            }\r\n        )\r\n    );\r\n};\r\nexport default WorkforceOneSSOTokenUserLoginEpic;\r\n","import {combineEpics, Epic} from \"redux-observable\";\r\nimport {Action} from \"redux\";\r\nimport WorkforceOneUserAccess from \"./WorkforceOneUserAccess\";\r\nimport WorkforceOneUserLoginEpic from \"./WorkforceOneUserLoginEpic\";\r\nimport WorkforceOneUserPortalPermission, { WorkforceOneUpdateUserPortalPermission } from \"./WorkforceOneUserPortalPermission\";\r\nimport WorkforceOneUserAutoCompanySelectionEpic from \"./WorkforceOneUserAutoCompanySelectionEpic\";\r\nimport WorkforceOneLoginPageReturn from \"./WorkforceOneLoginPageReturn\";\r\nimport WorkforceOneCompanySelectPageReturn from \"./WorkforceOneCompanySelectPageReturn\";\r\nimport WorkforceOneLogOutFromPasswordReset from \"./WorkforceOneLogOutFromPasswordReset\";\r\nimport WorkforceOnePasswordResetRequest from \"./WorkforceOnePasswordResetRequest\";\r\nimport WorkforceOneSSOUserLoginEpic from \"./WorkforceOneSSOUserLoginEpic\";\r\nimport WorkforceOneSSOTokenUserLoginEpic from \"./WorkforceOneSSOTokenUserLoginEpic\";\r\n\r\nexport const rootEpic: Epic<Action> = combineEpics(\r\n    WorkforceOneUserAccess,\r\n    WorkforceOneUserLoginEpic,\r\n    WorkforceOneSSOUserLoginEpic,\r\n    WorkforceOneSSOTokenUserLoginEpic,\r\n    WorkforceOneUserPortalPermission,\r\n    WorkforceOneUserAutoCompanySelectionEpic,\r\n    WorkforceOneLoginPageReturn,\r\n    WorkforceOneLogOutFromPasswordReset,\r\n    WorkforceOneCompanySelectPageReturn,\r\n    WorkforceOnePasswordResetRequest,\r\n    WorkforceOneUpdateUserPortalPermission\r\n) ;\r\n\r\n","import { createBrowserHistory, History } from 'history';\r\nimport configureStore from './configureStore';\r\nimport { getBaseUrl } from \"./BaseUrl\";\r\nimport { WorkforceRoute } from \"./AppState\";\r\nimport { WorkforceOneUserLogOut } from './actions/WorkforceOneLoginActions';\r\n\r\nconst baseUrl = getBaseUrl();\r\nconst history: History<WorkforceRoute> = createBrowserHistory({ basename: baseUrl });\r\nconst store = configureStore(history);\r\n\r\nexport function LogOut() {\r\n  store.dispatch(WorkforceOneUserLogOut())\r\n}\r\n\r\nexport default store\r\n","export function GetSinglePageAppPath(){\r\n    return \"/clinicportal/ng/\";\r\n}\r\n\r\nexport function getBaseUrl(): string {\r\n    const baseDomain = window.location.hostname;\r\n    const firstDotIndex = baseDomain.indexOf('.');\r\n    const domain = baseDomain.substring(firstDotIndex + 1);\r\n    return (`${window.location.protocol}//${domain}${window.location.port ? `:${window.location.port}` : \"\"}`);\r\n}\r\n\r\nexport function GetUrlLocation(): string {\r\n    return `${window.location.origin}${GetSinglePageAppPath()}`;\r\n}\r\n","import { applyMiddleware, compose, createStore } from 'redux';\r\nimport { routerMiddleware } from 'connected-react-router';\r\nimport { History } from 'history';\r\nimport {createEpicMiddleware} from \"redux-observable\";\r\nimport createRootReducer from \"./reducers\";\r\nimport {rootEpic} from \"./epics\";\r\nimport {AppState, WorkforceRoute} from \"./AppState\";\r\n\r\nexport default function configureStore(history: History<WorkforceRoute>, initialState?: AppState) {\r\n    const epicMiddleware = createEpicMiddleware();\r\n    const middleware = [routerMiddleware(history), epicMiddleware];\r\n    const enhancers = [];\r\n    const windowIfDefined = typeof window === 'undefined' ? null : window as any;\r\n    if (windowIfDefined && windowIfDefined.__REDUX_DEVTOOLS_EXTENSION__) {\r\n        enhancers.push(windowIfDefined.__REDUX_DEVTOOLS_EXTENSION__());\r\n    }\r\n    const store =  createStore(\r\n        createRootReducer(history),\r\n        // TODO: Type 'unknown' is not assignable to type 'never'// initialState,\r\n        compose(applyMiddleware(...middleware), ...enhancers)\r\n    );\r\n    epicMiddleware.run(rootEpic);\r\n    return store;\r\n}\r\n","import { Observable } from \"rxjs\"\r\nimport ApiUrl from \"./ApiUrl\"\r\nimport ApiResponse from \"./ApiResponse\"\r\nimport { BuildFetchRequest } from \"./BuildFetchRequest\"\r\nimport { LogOut } from \"../AppStore\"\r\n\r\nenum HttpStatusCode {\r\n  UNAUTHORIZED = 401\r\n}\r\n\r\nexport class APIError extends Error {\r\n  errorData?: { code: string, message: string }\r\n  constructor(message: string, errorData?: { code: string, message: string }) {\r\n    super(message);\r\n    this.name = \"APIError\"\r\n    this.errorData = errorData\r\n  }\r\n}\r\n\r\nexport function ObservableFromFetch<T>(url: string, body?: string, method?: string): Observable<T> {\r\n  return new Observable<T>(observer => {\r\n    const controller = new AbortController()\r\n\r\n    let init = BuildFetchRequest(body, method)\r\n    init.signal = controller.signal\r\n\r\n    fetch(ApiUrl() + url, init)\r\n      .then((response: Response) => {\r\n        if (response.ok) {\r\n          return response.json()\r\n        } else {\r\n          return response.text()\r\n            .then(data => data ? JSON.parse(data) : {})\r\n            .then(json => {\r\n              throw json.error\r\n                ? new APIError(response.statusText, json.error)\r\n                : response.status === HttpStatusCode.UNAUTHORIZED\r\n                  ? new APIError(response.statusText, { code: response.status.toString(), message: response.statusText })\r\n                  : new Error(response.statusText)\r\n            })\r\n        }\r\n      })\r\n      .then((result: ApiResponse<T>) => {\r\n        observer.next(result.data)\r\n        observer.complete()\r\n      })\r\n      .catch(err => {\r\n        observer.error(err)\r\n        if (err.errorData?.code === HttpStatusCode.UNAUTHORIZED.toString()) {\r\n          LogOut()\r\n        }\r\n      })\r\n\r\n    return () => {\r\n      controller.abort()\r\n    }\r\n  })\r\n}\r\n\r\n// When async Task is missing in the code (RandomTest/RandomSelectionMessage)\r\nexport function ObservableFromFetchWithTaskData<T>(url: string, body?: string): Observable<T> {\r\n  return new Observable<T>(observer => ObservableFromFetch<{ Result: T }>(url, body).subscribe(\r\n    data => observer.next(data.Result),\r\n    error => observer.error(error)\r\n  ))\r\n}\r\n","import { ObservableFromFetch } from \"../ObservableFromFetch\"\r\n\r\nexport default function UserPasswordReset(email: string, link: string, isForgot: boolean = true) {\r\n  const requestBody: string = JSON.stringify({\r\n    InvitationLink: link,\r\n    IsForgotPassword: isForgot,\r\n    UserName: email\r\n  })\r\n  return ObservableFromFetch<string>(\"FFOrderAccount/ChangeUserPassword\", requestBody)\r\n}","import React from \"react\"\r\nimport { Container, Button, Modal, Form, Col, InputGroup, Row, Spinner } from \"react-bootstrap\"\r\nimport { toast } from \"react-toastify\"\r\nimport { Subscription } from \"rxjs\"\r\nimport ActionButton from \"../ActionButton\"\r\nimport { RouteComponentProps } from \"react-router\"\r\nimport { Home } from \"../../config/Routes\"\r\nimport { AppPageWrapper } from \"../NavMenu/AppPageWrapper\"\r\nimport UserPasswordReset from \"../../api/Administration/UserPasswordReset\"\r\nimport { APIError } from \"../../api/ObservableFromFetch\"\r\nimport { EmailRegexp } from \"../../config/Constants\"\r\nimport { getLoggedInUserName } from \"../../authentication/SelectedCompany/CompanySelectionDrivenSelectors\"\r\n\r\n\r\ninterface ChangePasswordModalProps {\r\n  LoginName: string\r\n  show: boolean\r\n  onCancel: () => void\r\n  onSubmit: () => void\r\n}\r\n\r\ninterface ChangePasswordModalState {\r\n  loginName: string\r\n  isEmailValid: boolean\r\n  dataSaving: boolean\r\n}\r\n\r\n\r\nexport class ChangePasswordModal extends React.Component<ChangePasswordModalProps, ChangePasswordModalState> {\r\n\r\n  emptyState: ChangePasswordModalState = {\r\n    loginName: \"\",\r\n    isEmailValid: false,\r\n    dataSaving: false\r\n  }\r\n\r\n  state: ChangePasswordModalState = { ...this.emptyState }\r\n\r\n  userPasswordResetSubscription?: Subscription\r\n\r\n\r\n  componentWillUnmount() {\r\n    this.userPasswordResetSubscription && this.userPasswordResetSubscription.unsubscribe()\r\n  }\r\n  handleAPIError = (error: Error | APIError) => {\r\n    error && toast.error((error as APIError)?.errorData?.message || error.message)\r\n  }\r\n\r\n  handleCancel = () => {\r\n    this.props.onCancel()\r\n  }\r\n  handleSubmit = () => {\r\n    const loginName = this.state.loginName;\r\n    this.setState({ dataSaving: true })\r\n    this.userPasswordResetSubscription && this.userPasswordResetSubscription.unsubscribe()\r\n\r\n    this.userPasswordResetSubscription = UserPasswordReset(loginName, window.location.href, false).subscribe(\r\n      data => {\r\n        toast.success(data);\r\n        this.setState({ dataSaving: false });\r\n        this.props.onSubmit();\r\n      },\r\n      (error) => {\r\n        this.handleAPIError(error);\r\n        this.setState({ dataSaving: false });\r\n      }\r\n    )\r\n\r\n  }\r\n\r\n  isEmailValid = (value: string) => {\r\n    if (value.length === 0) {\r\n      return false\r\n    }\r\n    return EmailRegexp.test(value)\r\n  }\r\n\r\n  handleEmailChange = (value: string) => {\r\n    this.setState(\r\n      {\r\n        loginName: value,\r\n        isEmailValid: this.isEmailValid(value)\r\n      })\r\n  }\r\n\r\n\r\n\r\n  render() {\r\n    this.state.loginName = this.props.LoginName;\r\n    this.state.isEmailValid = this.isEmailValid(this.props.LoginName);\r\n    const { loginName, isEmailValid, dataSaving } = this.state;\r\n\r\n    return (\r\n\r\n      <Modal backdrop=\"static\" size=\"lg\" dialogClassName=\"dark\" show={this.props.show}>\r\n        <Modal.Header>\r\n          <Modal.Title className=\"text-uppercase\">CHANGE PASSWORD</Modal.Title>\r\n        </Modal.Header>\r\n        <Modal.Body>\r\n          <Form>\r\n            <Container fluid>\r\n              <Row>\r\n                <Col>\r\n                  <p>Please enter your email address, click Submit and we will send you an email that contains a link to click on that requests a PIN number to change your password.</p>\r\n                </Col>\r\n              </Row>\r\n              <Row>\r\n                <Col>\r\n                  <Form.Control\r\n                    id=\"parameterTitle\"\r\n                    className=\"bg-white\"\r\n                    type=\"text\"\r\n                    maxLength={50}\r\n                    value={loginName}\r\n                    onChange={e => this.handleEmailChange(e.target.value)}\r\n                    disabled={dataSaving || true}\r\n                  />\r\n                </Col>\r\n              </Row>\r\n            </Container>\r\n          </Form>\r\n        </Modal.Body>\r\n        <Modal.Footer>\r\n          <Button variant=\"secondary\" onClick={this.handleCancel} disabled={dataSaving} className=\"mr-auto\">Cancel</Button>\r\n          <ActionButton\r\n            variant=\"primary\"\r\n            onClick={this.handleSubmit}\r\n            disabled={dataSaving || !isEmailValid} spin={dataSaving} disableOnSpin>Submit</ActionButton>\r\n        </Modal.Footer>\r\n      </Modal>\r\n\r\n    )\r\n  }\r\n\r\n}\r\n\r\n","import React, { Component } from \"react\"\r\nimport { NavDropdown } from \"react-bootstrap\"\r\n\r\nexport interface NavDropdownHoverProps {\r\n  title: React.ReactNode\r\n  id: string\r\n  className?: string\r\n  alignRight?: boolean\r\n}\r\n\r\nexport interface NavDropdownHoverState {\r\n  isOpen: boolean\r\n}\r\n\r\nexport class NavDropdownHover extends Component<NavDropdownHoverProps, NavDropdownHoverState> {\r\n  state: NavDropdownHoverState = {\r\n    isOpen: false\r\n  }\r\n\r\n  handleOpen = () => this.setState({ isOpen: true })\r\n  handleClose = () => this.setState({ isOpen: false })\r\n\r\n  render() {\r\n    return <NavDropdown title={this.props.title}\r\n      alignRight={this.props.alignRight}\r\n      onMouseEnter={this.handleOpen}\r\n      onMouseLeave={this.handleClose}\r\n      show={this.state.isOpen}\r\n      id={this.props.id} className={this.props.className}>\r\n      {this.props.children}\r\n    </NavDropdown>\r\n  }\r\n}\r\n","import { IsOnTrack } from \"../App\"\r\nimport {\r\n  Home,\r\n  OrderFinishRoute,\r\n  OrderRoute,\r\n  OrdersRoute,\r\n  RandomsPersonnelRoute,\r\n  RandomsRoute,\r\n  SelectionInboxRoute,\r\n  SiteSearchOptionsRoute,\r\n  SiteSearchRoute,\r\n  ActivateCompanyRoute,\r\n  ActivatePortalRoute,\r\n  MyOrganizationRoute,\r\n  MyOrganizationNameRoute,\r\n  CompanyInformationRoute,\r\n  InviteStatusRoute,\r\n  MyInformationRoute,\r\n  OrphanedResultsRoute,\r\n  OurTeamStatusRoute,\r\n  RegulatoryModeRoute,\r\n  PermissionsRoute,\r\n  GlobalParameterRoute,\r\n  OrderableServicesRoute,\r\n  UserCodesRoute,\r\n  GovDonorRoute,\r\n  RandomsGovRoute,\r\n  ConsortiumsRoute,\r\n  GovOrderRoute,\r\n  SSOOrderRoute,\r\n  SSOOrderFinishRoute,\r\n  SSOSiteSearchRoute,\r\n  SSOHome,\r\n  ReportPositiveRoute,\r\n  ReportSpecimenPositivityRoute,\r\n  ReportDrugDetailRoute,\r\n  ReportDailySummaryRoute,\r\n  ReportIvrCallInComplianceRoute,\r\n  ReportNoShowRoute,\r\n  ReportTestingSummaryRoute,\r\n  UserLabelsRoute,\r\n  ReportCertificationRenewalRoute,\r\n  ReportCertificationStatusRoute,\r\n  ReportManagementSummaryRoute,\r\n  ReportMISRoute,\r\n  ReportSummaryRoute,\r\n  LocationInformationRoute,\r\n  PortalAdministrationRoute,\r\n  AddNewPortalRoute,\r\n  ActivateUserRoute,\r\n  ConfigureOrderDefaultsRoute,\r\n  AddNewCompanyRoute,\r\n  AddNewCompanyNameRoute,\r\n  SendingFacilityRoute,\r\n  ConsortiumPersonnelRoute,\r\n  CompanyInformationNameRoute,\r\n  ReportSelectedNotTestedRoute,\r\n  SSOGetAuthFormRoute,\r\n  LabResultsReportingRoute,\r\n  ReportUnmergedRandomResultsRoute\r\n} from \"../config/Routes\"\r\nimport { GetSSOAction, SiteSearchModeEnabled } from \"../storage/AuthToken\"\r\nimport UserAccessSettings from \"./UserAccessSettings\"\r\nimport UserState from \"./UserState\"\r\n\r\nexport function HasAccessToAtLeastOneRoute(routes: string[], userAccess: UserAccessSettings, userState: UserState): boolean {\r\n  return routes.some(route => HasAccessToRoute(route, userAccess, userState))\r\n}\r\n\r\nexport default function HasAccessToRoute(route: string | undefined, userAccess: UserAccessSettings, userState: UserState): boolean {\r\n  if (route === undefined || (!userState.selectedCompany && !userState.selectedPortal)) {\r\n    return false\r\n  }\r\n  const ssoRoutes = [SSOOrderRoute, SSOOrderFinishRoute, SSOSiteSearchRoute, SSOGetAuthFormRoute]\r\n  const isSiteSearchMode = SiteSearchModeEnabled()\r\n  const isGetAuthFormMode = GetSSOAction() === \"getauthform\"\r\n  const isLocation = (userState.selectedCompany?.LocationID || 0) > 0\r\n  if (userState.ssoToken !== \"\" && !ssoRoutes.includes(route) || userState.ssoToken === \"\" && ssoRoutes.includes(route)) {\r\n    return false\r\n  }\r\n\r\n  switch (route) {\r\n    case InviteStatusRoute: return userAccess.canShowInvitationStatus\r\n    case RandomsRoute: return userAccess.canManagePools && !isLocation\r\n    case RandomsRoute: return userAccess.canManagePools\r\n    case RandomsPersonnelRoute: return userAccess.canManagePersonnel\r\n    case SelectionInboxRoute: return userAccess.canManageSelectionInbox\r\n    case OrderRoute: return userAccess.canViewOrder\r\n    case OrderFinishRoute: return userAccess.canViewOrder\r\n    case SiteSearchRoute: return userAccess.canViewSiteSearch\r\n    case OrdersRoute: return userAccess.canViewOrderTrackingGrid\r\n    case OurTeamStatusRoute: return userAccess.isSiteAdmin || userAccess.isPortalAdmin || userAccess.isCompanyAdmin || userAccess.isLocationAdmin\r\n    case CompanyInformationRoute: return (userAccess.isSiteAdmin || userAccess.isPortalAdmin || userAccess.isCompanyAdmin) && userAccess.canManageClient\r\n    case LocationInformationRoute: return userAccess.isLocationAdmin\r\n    case ActivateUserRoute: return userAccess.isSiteAdmin || userAccess.isPortalAdmin || userAccess.isCompanyAdmin || userAccess.isLocationAdmin\r\n    case OrphanedResultsRoute: return userAccess.canShowOrphanedResults && (userAccess.isSiteAdmin || userAccess.isPortalAdmin || userAccess.isCompanyAdmin)\r\n    case MyOrganizationRoute: return userAccess.isPortalAdmin\r\n    case AddNewCompanyRoute: return userAccess.isPortalAdmin && userAccess.canCreateClient\r\n    case CompanyInformationNameRoute: return userAccess.isSiteAdmin || userAccess.isPortalAdmin || userAccess.isCompanyAdmin\r\n    case AddNewCompanyNameRoute: return userAccess.isSiteAdmin\r\n    case MyOrganizationNameRoute: return userAccess.isSiteAdmin\r\n    case PortalAdministrationRoute: return userAccess.isSiteAdmin\r\n    case AddNewPortalRoute: return userAccess.isSiteAdmin\r\n    case ActivateCompanyRoute: return userAccess.isSiteAdmin || userAccess.isPortalAdmin\r\n    case SiteSearchOptionsRoute: return userAccess.canSearchDefaults\r\n    case GlobalParameterRoute: return userAccess.isSiteAdmin\r\n    case ActivatePortalRoute: return userAccess.isSiteAdmin\r\n    case RegulatoryModeRoute: return userAccess.isSiteAdmin\r\n    case PermissionsRoute: return userAccess.isSiteAdmin && userAccess.canShowRolePermissionSubscription\r\n    case MyInformationRoute: return true\r\n    case OrderableServicesRoute: return userAccess.isSiteAdmin || userAccess.isPortalAdmin\r\n    case UserCodesRoute: return !IsOnTrack() && (userAccess.isPortalAdmin || userAccess.isCompanyAdmin)\r\n    case RandomsGovRoute: return userAccess.CanManageGovPools\r\n    case ConsortiumsRoute: return (userAccess.CanManageConsortiumPools || userAccess.canManagePools) && !userAccess.isLocationAdmin\r\n    case ConsortiumPersonnelRoute: return userAccess.CanManageConsortiumPools && userAccess.isPortalAdmin\r\n    case GovDonorRoute: return userAccess.CanManageGovDonors\r\n    case GovOrderRoute: return userAccess.CanOrderGovServices\r\n    case SSOOrderRoute: return userAccess.canViewOrder && !isGetAuthFormMode\r\n    case SSOOrderFinishRoute: return userAccess.canViewOrder && !isGetAuthFormMode\r\n    case SSOSiteSearchRoute: return userAccess.canViewOrder && isSiteSearchMode \r\n    case SSOGetAuthFormRoute: return userAccess.canViewOrder && isGetAuthFormMode\r\n    case SendingFacilityRoute: return userAccess.isSiteAdmin\r\n    case Home: return true\r\n    case SSOHome: return true\r\n    case ReportPositiveRoute: return userAccess.isPortalAdmin\r\n    case ReportTestingSummaryRoute: return userAccess.isPortalAdmin || userAccess.isCompanyAdmin || userAccess.isLocationAdmin\r\n    case ReportSpecimenPositivityRoute: return userAccess.isPortalAdmin || userAccess.isCompanyAdmin || userAccess.isLocationAdmin\r\n    case ReportDrugDetailRoute: return userAccess.isPortalAdmin || userAccess.isCompanyAdmin || userAccess.isLocationAdmin\r\n    case ReportDailySummaryRoute: return userAccess.isPortalAdmin || userAccess.isCompanyAdmin || userAccess.isLocationAdmin\r\n    case ReportIvrCallInComplianceRoute: return userAccess.isPortalAdmin || userAccess.isCompanyAdmin || userAccess.isLocationAdmin\r\n    case ReportNoShowRoute: return userAccess.isPortalAdmin || userAccess.isCompanyAdmin || userAccess.isLocationAdmin\r\n    case UserLabelsRoute: return userAccess.isPortalAdmin\r\n    case ReportCertificationRenewalRoute: return userAccess.canViewMISReports\r\n    case ReportCertificationStatusRoute: return userAccess.canViewMISReports\r\n    case ReportManagementSummaryRoute: return userAccess.canViewMISReports\r\n    case ReportMISRoute: return userAccess.canViewMISReports\r\n    case ReportSelectedNotTestedRoute: return userAccess.isPortalAdmin || userAccess.isCompanyAdmin\r\n    case ReportSummaryRoute: return userAccess.isPortalAdmin || userAccess.isCompanyAdmin\r\n    case ConfigureOrderDefaultsRoute: return (!IsOnTrack() && userAccess.isPortalAdmin) || userAccess.isSiteAdmin\r\n    case LabResultsReportingRoute: return userAccess.isSiteAdmin || userAccess.isPortalAdmin\r\n    case ReportUnmergedRandomResultsRoute: return userAccess.isPortalAdmin || userAccess.isCompanyAdmin\r\n    default: return false\r\n  }\r\n}\r\n","import { ReactNode } from \"react\"\r\nimport { Nav } from \"react-bootstrap\"\r\nimport HasAccessToRoute from \"../../authentication/hasAccessToRoute\"\r\nimport UserAccessSettings from \"../../authentication/UserAccessSettings\"\r\nimport UserState from \"../../authentication/UserState\"\r\nimport { GetSinglePageAppPath } from \"../../BaseUrl\"\r\n\r\nexport interface NavMenuLinkProps {\r\n  title: ReactNode\r\n  route: string\r\n  userAccess: UserAccessSettings\r\n  userState: UserState\r\n}\r\nexport interface NavMenuLinkPropsWithNumber {\r\n  title: ReactNode\r\n  route: string\r\n  userAccess: UserAccessSettings\r\n  userState: UserState\r\n  count: number\r\n}\r\n\r\nexport default function NavMenuLink(props: NavMenuLinkProps) {\r\n  if (!HasAccessToRoute(props.route, props.userAccess, props.userState)) {\r\n    return <></>\r\n  }\r\n  return <Nav.Link href={`${GetSinglePageAppPath()}#${props.route}`}>{props.title}</Nav.Link>\r\n}\r\nexport function NavMenuLinkWithNumber(props: NavMenuLinkPropsWithNumber) {\r\n  if (!HasAccessToRoute(props.route, props.userAccess, props.userState)) {\r\n    return <></>\r\n  }\r\n  if (props.count > 0) {\r\n    return <Nav.Link href={`${GetSinglePageAppPath()}#${props.route}`}>{props.title} <span style={{ color: 'red' }}>{props.count}</span></Nav.Link>\r\n  }\r\n  return <Nav.Link href={`${GetSinglePageAppPath()}#${props.route}`}>{props.title}</Nav.Link>\r\n\r\n}\r\n","import React, { Component, createRef } from \"react\"\r\nimport { concat, of, Subject, Subscription } from \"rxjs\"\r\nimport { catchError, debounceTime, distinctUntilChanged, filter, map, switchMap } from \"rxjs/operators\"\r\nimport { AssignedClinic, WorkforceClinicPortal } from \"../../AppState\"\r\nimport { AsyncTypeahead } from \"react-bootstrap-typeahead\"\r\nimport CompaniesGetObservable, { CompaniesFilterParams } from \"../../api/Portals/PortalCompaniesGet\"\r\nimport { AccountLimit } from \"../../config/Constants\"\r\nimport { Form, Row } from \"react-bootstrap\"\r\nimport UserAccessSettings from \"../../authentication/UserAccessSettings\"\r\nimport UserState from \"../../authentication/UserState\"\r\n\r\ninterface PortalCompanySearchProps {\r\n  id?: string\r\n  portal: WorkforceClinicPortal\r\n  switchCompany(company: AssignedClinic): void\r\n  showCompaniesSearch: boolean\r\n  userAccess: UserAccessSettings\r\n  userState: UserState\r\n}\r\n\r\ninterface PortalCompanySearchState {\r\n  loading: boolean\r\n  companies?: AssignedClinic[]\r\n}\r\n\r\nexport class PortalCompanySearch extends Component<PortalCompanySearchProps, PortalCompanySearchState> {\r\n  state: PortalCompanySearchState = { loading: false, companies: [] }\r\n  companies$?: Subject<CompaniesFilterParams>;\r\n  companiesSubscription?: Subscription;\r\n  companyRef = createRef<AsyncTypeahead<AssignedClinic>>()\r\n\r\n  clearResult() {\r\n    this.companyRef?.current?.clear();\r\n    this.setState({ companies: [] });\r\n  }\r\n\r\n  searchCompanies(query: string, locationsOnly: boolean = false, accountID: number = 0) {\r\n    this.companies$?.next({ portal: this.props.portal, query: query, locationsOnly: locationsOnly, accountID: accountID })\r\n  }\r\n\r\n  componentDidMount() {\r\n    this.companies$ = new Subject<CompaniesFilterParams>();\r\n    this.companiesSubscription = this.companies$.pipe(\r\n      debounceTime(400),\r\n      distinctUntilChanged(),\r\n      filter(params => (params.query ?? \"\").trim().length > 0),\r\n      switchMap((params) => concat(\r\n        of({ loading: true }),\r\n        CompaniesGetObservable(params).pipe(\r\n          map((companies) => ({ loading: false, companies: companies })),\r\n          catchError(() => of({ loading: false }))\r\n        )\r\n      ))\r\n    ).subscribe(\r\n      (o: { loading: boolean, companies?: AssignedClinic[] }) => {\r\n        this.setState({ loading: o.loading, companies: o.companies })\r\n      },\r\n      () => this.setState({ loading: false, companies: [] })\r\n    )\r\n  }\r\n\r\n  componentWillUnmount() {\r\n    this.companiesSubscription?.unsubscribe()\r\n  }\r\n\r\n  render() {\r\n    const { loading, companies } = this.state\r\n    const { id, switchCompany, userAccess, userState, portal, showCompaniesSearch } = this.props\r\n    const accountID = userAccess.isCompanyAdmin || userAccess.isLocationAdmin ? userState.selectedCompany?.AccountID : 0\r\n    const showLocations = (userAccess.isCompanyAdmin && portal.AssignedClientDetailsOfClinic.some(company => company.AccountID === accountID && !!company.LocationName)) ||\r\n                          (userAccess.isLocationAdmin && portal.AssignedClientDetailsOfClinic.some(company => company.AccountID === accountID && !!company.LocationName && company.LocationID !== userState.selectedCompany?.LocationID))\r\n\r\n    return (\r\n      <Form>\r\n          {!userAccess.isLocationAdmin && showCompaniesSearch && <Row className=\"mb-2\">\r\n            <AsyncTypeahead\r\n              id={id}\r\n              emptyLabel=\"No Companies Found\"\r\n              placeholder=\"Enter the Company name\"\r\n              labelKey=\"Name\"\r\n              minLength={0}\r\n              maxResults={AccountLimit}\r\n              paginate={false}\r\n              useCache={false}\r\n              isLoading={loading}\r\n              inputProps={{ style: { 'width': '250px', 'margin': '0 15px' }, autoComplete: \"chrome-off\" }}\r\n              onBlur={() => this.clearResult()}\r\n              onSearch={query => this.searchCompanies(query)}\r\n              onChange={(selected: AssignedClinic[]) => switchCompany(selected[0])}\r\n              options={companies || []}\r\n              positionFixed\r\n              ref={this.companyRef}\r\n              selected={[]}>\r\n          </AsyncTypeahead>\r\n        </Row>}\r\n        {showLocations && <Row>\r\n          <AsyncTypeahead\r\n            id={id}\r\n            emptyLabel=\"No Locations Found\"\r\n            placeholder=\"Enter the Location name\"\r\n            labelKey={(option) => `${option.LocationName}`}\r\n            minLength={0}\r\n            maxResults={AccountLimit}\r\n            paginate={false}\r\n            useCache={false}\r\n            isLoading={loading}\r\n            inputProps={{ style: { 'width': '250px', 'margin': '0 15px' }, autoComplete: \"chrome-off\" }}\r\n            onBlur={() => this.clearResult()}\r\n            onSearch={query => this.searchCompanies(query, true, accountID)}\r\n            onChange={(selected: AssignedClinic[]) => switchCompany(selected[0])}\r\n            options={companies || []}\r\n            positionFixed\r\n            ref={this.companyRef}\r\n            selected={[]}>\r\n          </AsyncTypeahead>\r\n        </Row>}\r\n      </Form>\r\n    )\r\n  }\r\n}\r\n","import { Observable } from \"rxjs\"\r\nimport { AssignedClinic, WorkforceClinicPortal } from \"../../AppState\"\r\n\r\nexport interface CompaniesFilterParams {\r\n  portal: WorkforceClinicPortal\r\n  query: string\r\n  locationsOnly: boolean\r\n  accountID: number\r\n}\r\n\r\nexport default function CompaniesGetObservable(filter: CompaniesFilterParams): Observable<AssignedClinic[]> {\r\n  return new Observable<AssignedClinic[]>(observer => {\r\n    if (filter.locationsOnly) {\r\n      observer.next(filter.portal.AssignedClientDetailsOfClinic\r\n        .filter(company => !!company.LocationName && company.AccountID === filter.accountID && company.LocationName.toLowerCase().indexOf(filter.query.toLowerCase()) !== -1)\r\n      )\r\n    }\r\n    else {\r\n      observer.next(filter.portal.AssignedClientDetailsOfClinic\r\n        .filter(company => (company.Name.toLowerCase().indexOf(filter.query.toLowerCase()) !== -1 && company.LocationID == 0))\r\n      )\r\n    }\r\n    observer.complete()\r\n  })\r\n}\r\n","import React, { Component } from \"react\"\r\nimport { Nav, Navbar, NavDropdown } from \"react-bootstrap\"\r\nimport { FaHome, FaUser } from \"react-icons/fa\"\r\nimport { connect } from \"react-redux\"\r\n//import { toast } from \"react-toastify\"\r\nimport { Action, Dispatch } from \"redux\"\r\nimport { SelectCompany } from \"../../actions/WorkforceClinicAction\"\r\nimport { WorkforceOneUserLogOut } from \"../../actions/WorkforceOneLoginActions\"\r\nimport { AppState, AssignedClinic, WorkforceClinicPortal } from \"../../AppState\"\r\nimport UserAccessSettings from \"../../authentication/UserAccessSettings\"\r\nimport { BuildUserAccess } from \"../../authentication/BuildUserAccess\"\r\nimport UserState from \"../../authentication/UserState\"\r\nimport { BuildUserState } from \"../../authentication/BuildUserState\"\r\nimport { getLoggedInUserName, GetSelectedAssignedClinic, isInPortal, SelectedAccountName, SelectedPortalName } from \"../../authentication/SelectedCompany/CompanySelectionDrivenSelectors\"\r\nimport { GetSinglePageAppPath } from \"../../BaseUrl\"\r\nimport { getOrphanedResultsCount} from \"../../storage/LogInPortals\"\r\n\r\nimport {\r\n  ActivateCompanyRoute,\r\n  ActivatePortalRoute,\r\n  CompanyInformationRoute,\r\n  GlobalParameterRoute,\r\n  Home,\r\n  InviteStatusRoute,\r\n  MyInformationRoute,\r\n  MyOrganizationRoute,\r\n  OrderRoute,\r\n  OrderableServicesRoute,\r\n  OrdersRoute,\r\n  OrphanedResultsRoute,\r\n  OurTeamStatusRoute,\r\n  PermissionsRoute,\r\n  RandomsPersonnelRoute,\r\n  RandomsRoute,\r\n  RegulatoryModeRoute,\r\n  SelectionInboxRoute,\r\n  SiteSearchOptionsRoute,\r\n  SiteSearchRoute,\r\n  GovDonorRoute,\r\n  RandomsGovRoute,\r\n  GovOrderRoute,\r\n  ReportPositiveRoute,\r\n  ReportTestingSummaryRoute,\r\n  ReportSpecimenPositivityRoute,\r\n  ReportDrugDetailRoute,\r\n  ReportDailySummaryRoute,\r\n  ReportIvrCallInComplianceRoute,\r\n  ReportNoShowRoute,\r\n  UserCodesRoute,\r\n  UserLabelsRoute,\r\n  ReportCertificationRenewalRoute,\r\n  ReportCertificationStatusRoute,\r\n  ReportManagementSummaryRoute,\r\n  ReportMISRoute,\r\n  ReportSummaryRoute,\r\n  LocationInformationRoute,\r\n  PortalAdministrationRoute,\r\n  ConfigureOrderDefaultsRoute,\r\n  SendingFacilityRoute,\r\n  ConsortiumsRoute,\r\n  ReportSelectedNotTestedRoute,\r\n  LabResultsReportingRoute,\r\n  ReportUnmergedRandomResultsRoute\r\n} from \"../../config/Routes\"\r\nimport { ChangePasswordModal } from \"../Accounts/ChangePassword\"\r\nimport { NavDropdownHover } from \"./NavDropdownHover\"\r\nimport HasAccessToRoute from \"../../authentication/hasAccessToRoute\"\r\nimport NavMenuLink, {NavMenuLinkWithNumber} from \"./NavMenuLink\"\r\nimport { IsOnTrack } from \"../../App\";\r\nimport { PortalCompanySearch } from \"./PortalCompanySearch\"\r\n\r\nexport interface NavMenuProps {\r\n  userAccess: UserAccessSettings\r\n  userState: UserState\r\n  selectedCompany?: string\r\n  visibleCompanies?: WorkforceClinicPortal[]\r\n  LoginName: string\r\n}\r\nexport interface NavMenuDispatchProps {\r\n  logout: () => void\r\n  selectCompany: (company: string, companyLink: string) => void\r\n}\r\nexport interface NavMenuState {\r\n  showChangePassword: boolean\r\n  orphanedResultsCount: number\r\n}\r\n\r\ninterface MenuItemSpecification { title: string | React.ReactElement, route: string, render?: (() => React.ReactElement | null | undefined) }\r\n\r\nexport class NavMenu extends Component<NavMenuProps & NavMenuDispatchProps, NavMenuState> {\r\n  public state: NavMenuState = { showChangePassword: false, orphanedResultsCount: getOrphanedResultsCount() }\r\n  baseUrl = GetSinglePageAppPath()\r\n\r\n  buildUrl = (route: string) => `${this.baseUrl}#${route}`\r\n  dropMenuItem = (title: string | React.ReactElement, route: string, bypassPermissionsCheck?: boolean, key?: string) => bypassPermissionsCheck || HasAccessToRoute(route, this.props.userAccess, this.props.userState) ? <NavDropdown.Item key={key} href={this.buildUrl(route)}>{title}</NavDropdown.Item> : null\r\n  dropMenu = (title: string | React.ReactElement, id: string, items?: MenuItemSpecification[], children?: React.ReactFragment, alignRight?: boolean) => {\r\n    const menuItems = items?.map((item, i) => item.render ? item.render() : this.dropMenuItem(item.title, item.route, false, `${item.route}_${i}`)).filter(item => !!item) as React.ReactElement[]\r\n    return (children || menuItems?.length) ? <NavDropdownHover title={title} id={id} alignRight={alignRight}>{menuItems}{children}</NavDropdownHover> : <></>\r\n  }\r\n\r\n  onStorageChanged = () => {\r\n    this.setState({ orphanedResultsCount: getOrphanedResultsCount() })\r\n  }\r\n\r\n  componentDidMount() {\r\n    window.addEventListener('storage', this.onStorageChanged)\r\n  }\r\n\r\n  componentWillUnmount() {\r\n    window.removeEventListener('storage', this.onStorageChanged)\r\n  }\r\n\r\n  render() {\r\n    const { userAccess, userState } = this.props\r\n    const { orphanedResultsCount } = this.state || 0\r\n    return (<>\r\n      <Navbar bg=\"dark\" variant=\"dark\" expand=\"lg\" id=\"workforce-navbar\" className=\"workforce-navbar\">\r\n        <Navbar.Toggle aria-controls=\"basic-navbar-nav\" />\r\n        <Navbar.Collapse id=\"basic-navbar-nav\">\r\n          <Nav className=\"mr-auto\">\r\n            <NavMenuLink title={<><FaHome /> Home</>} route={Home} userAccess={userAccess} userState={userState} />\r\n            <NavMenuLinkWithNumber title={\"Result Exceptions\"} route={OrphanedResultsRoute} userAccess={userAccess} userState={userState} count={orphanedResultsCount} />\r\n            <NavMenuLink title=\"Donor\" route={GovDonorRoute} userAccess={userAccess} userState={userState} />\r\n            {this.dropMenu(\"Randomization\", \"randomization-nav-dropdown\", [\r\n              { title: \"Random Testing\", route: RandomsRoute },\r\n              { render: () => HasAccessToRoute(RandomsRoute, userAccess, userState) ? undefined : this.dropMenuItem(\"Random Testing\", RandomsPersonnelRoute, false, \"Personnel_key\"), title: \"\", route: \"\" },\r\n              { title: \"Random Donor Testing\", route: RandomsGovRoute },\r\n              { title: \"Selection Inbox\", route: SelectionInboxRoute },\r\n              { title: \"Consortiums\", route: ConsortiumsRoute },\r\n            ])}\r\n            {this.isShowPortals(this.props) && this.getPortalsMenu(this.props)}\r\n            {!IsOnTrack() && <NavMenuLink title=\"Order\" route={OrderRoute} userAccess={userAccess} userState={userState} />}\r\n            {IsOnTrack() && <NavMenuLink title=\"Order\" route={GovOrderRoute} userAccess={userAccess} userState={userState} />}\r\n            <NavMenuLink title=\"Site Search\" route={SiteSearchRoute} userAccess={userAccess} userState={userState} />\r\n            <NavMenuLink title=\"Results\" route={OrdersRoute} userAccess={userAccess} userState={userState} />\r\n            {IsOnTrack() && this.dropMenu(\"Reports\", \"reports-nav-dropdown\", [\r\n              { title: \"Testing Summary\", route: ReportTestingSummaryRoute },\r\n              { title: \"Specimen Positivity\", route: ReportSpecimenPositivityRoute },\r\n              { title: \"Drug Detail\", route: ReportDrugDetailRoute },\r\n              { title: \"Daily Summary\", route: ReportDailySummaryRoute },\r\n              { title: \"IVR Call-In Compliance\", route: ReportIvrCallInComplianceRoute },\r\n              { title: \"No Show\", route: ReportNoShowRoute }\r\n            ])}\r\n            {!IsOnTrack() && this.dropMenu(\"Reports\", \"reports-nav-dropdown\", [\r\n              { title: \"Positive Only Report\", route: ReportPositiveRoute },\r\n              { title: \"Management Summary Report\", route: ReportManagementSummaryRoute },\r\n              { title: \"MIS Report\", route: ReportMISRoute },\r\n              { title: \"Selected Not Tested Report\", route: ReportSelectedNotTestedRoute },\r\n              { title: \"Summary Report\", route: ReportSummaryRoute },\r\n              //{ title: \"Unmerged Random Results\", route: ReportUnmergedRandomResultsRoute },\r\n            ])}\r\n            {this.dropMenu(\"Administration\", \"administration-nav-dropdown\", [\r\n              { title: \"User Information\", route: OurTeamStatusRoute },\r\n              { title: \"Portal Information\", route: MyOrganizationRoute },\r\n              { title: \"Portal Administration\", route: PortalAdministrationRoute },\r\n              { title: \"Company Information\", route: CompanyInformationRoute },\r\n              { title: \"Location Information\", route: LocationInformationRoute },\r\n              { title: \"Invite Status\", route: InviteStatusRoute },\r\n              { title: \"Permissions\", route: PermissionsRoute },\r\n              { title: \"Clinic Search Options\", route: SiteSearchOptionsRoute },\r\n              { title: \"Global Parameters\", route: GlobalParameterRoute },\r\n              { title: \"Regulatory Modes\", route: RegulatoryModeRoute },\r\n              { title: \"Orderable Services\", route: OrderableServicesRoute },\r\n              { title: \"User Codes\", route: UserCodesRoute },\r\n              { title: \"User Code Labels\", route: UserLabelsRoute },\r\n              { title: \"Order Defaults\", route: ConfigureOrderDefaultsRoute },\r\n              { title: \"Sending Facilities\", route: SendingFacilityRoute },\r\n              { title: \"Lab Results Reporting\", route: LabResultsReportingRoute },\r\n            ])}\r\n          </Nav>\r\n          <Nav className=\"flex-row\">\r\n            <Navbar.Text>{this.props.selectedCompany}</Navbar.Text>\r\n            {this.dropMenu(<><FaUser /> Account</>, \"account-nav-dropdown\", undefined, <>\r\n              {this.dropMenuItem(\"My Information\", MyInformationRoute, false, \"MyInformation_key\")}\r\n              <NavDropdown.Item onClick={() => this.showChangePasswordClick()}>Change Password</NavDropdown.Item>\r\n              <NavDropdown.Item onClick={() => this.logoutClick()}>Log Out</NavDropdown.Item>\r\n            </>, true)}\r\n          </Nav>\r\n        </Navbar.Collapse>\r\n      </Navbar>\r\n      <ChangePasswordModal\r\n        show={this.state.showChangePassword}\r\n        LoginName={this.props.LoginName}\r\n        onSubmit={this.performChangePassword}\r\n        onCancel={this.hideChangePassword} />\r\n    </>)\r\n  }\r\n\r\n  getPortalsMenu(props: NavMenuProps & NavMenuDispatchProps) {\r\n    const portals = props.visibleCompanies?.sort((a, b) => (a.ImplementationName || \"\").localeCompare(b.ImplementationName || \"\")) || []\r\n    const portalItems = portals.reduce<React.ReactElement[]>((acc, portal, portalIndex) => {\r\n\r\n      const portalItem = <NavDropdown.Item\r\n        key={`${portal.ParticipationID}-${portalIndex}`}\r\n        disabled={!portal.Link || portal.ParticipationID === props.userState.selectedPortal?.ParticipationID}\r\n        onClick={() => {\r\n          props.selectCompany(portal.ParticipationID || \"\", portal.Link || \"\")\r\n          routeToHome()\r\n        }}>\r\n        {portal.ImplementationName}\r\n      </NavDropdown.Item>\r\n\r\n      const accountID = props.userState.selectedCompany?.AccountID || 0\r\n      const parentCompany = portal.AssignedClientDetailsOfClinic.find(item => item.AccountID === accountID && !item.LocationID)\r\n      const assignedClinics = portal.AssignedClientDetailsOfClinic.filter(item => !item.LocationID)\r\n      const showCompaniesSearch = (props.userAccess.isPortalAdmin && assignedClinics.length > 0)  || (assignedClinics.length > 1 && !props.userAccess.isLocationAdmin)\r\n      const key = `${parentCompany?.ParticipationID || \"\"}`\r\n      const parentCompanyItem = !!parentCompany && !showCompaniesSearch ? <NavDropdown.Item\r\n        key={key}\r\n        disabled={!parentCompany.Link || parentCompany.ParticipationID === props.userState.selectedCompany?.ParticipationID}\r\n        onClick={() => {\r\n          props.selectCompany(parentCompany.ParticipationID || \"\", parentCompany.Link || \"\")\r\n          routeToHome()\r\n        }}>\r\n        {parentCompany.ImplementationName} / {parentCompany.Name}\r\n      </NavDropdown.Item> : <React.Fragment key={key}></React.Fragment>\r\n\r\n      const clinicItems =\r\n        <NavDropdown.Header key=\"switch-company-typeahead\">\r\n          <PortalCompanySearch\r\n            id={`select-switch-company-${portalIndex}`}\r\n            portal={portal}\r\n            switchCompany={(company) => this.switchCompany(company)}\r\n            showCompaniesSearch={showCompaniesSearch}\r\n            userAccess={props.userAccess}\r\n            userState={props.userState}\r\n          />\r\n        </NavDropdown.Header>\r\n\r\n      return acc.concat(portalItem).concat(parentCompanyItem).concat(clinicItems)\r\n    }, [])\r\n    return <NavDropdownHover title=\"Portals\" id=\"portal-nav-dropdown\">{portalItems}</NavDropdownHover>\r\n  }\r\n\r\n  switchCompany = (company: AssignedClinic) => {\r\n    this.props.selectCompany(company.ParticipationID, company.Link)\r\n    routeToHome()\r\n  }\r\n\r\n  isShowPortals(props: NavMenuProps & NavMenuDispatchProps) {\r\n    const permissions = props.userAccess\r\n    //TODO: 2021-06-19. Yanek Dogel. Research is need check caShowPortal permissions to show portal menu\r\n    if (!permissions.canShowPortal) {\r\n      //return false\r\n    }\r\n    if (permissions.isSiteAdmin) {\r\n      return false\r\n    }\r\n    const portals = props.visibleCompanies || []\r\n    if (portals.length == 0) {\r\n      return false\r\n    }\r\n    if (portals.length > 0) {\r\n      return true\r\n    }\r\n    for (let i = 0; i < portals.length; i++) {\r\n      const portal = portals[i]\r\n      const clinics = portal.AssignedClientDetailsOfClinic || []\r\n      if (clinics.length > 0) {\r\n        return true\r\n      }\r\n    }\r\n    return false\r\n\r\n  }\r\n\r\n  performChangePassword = () => {\r\n    this.setState({ showChangePassword: false })\r\n    this.logoutClick()\r\n  }\r\n\r\n  hideChangePassword = () => {\r\n    this.setState({ showChangePassword: false })\r\n  }\r\n\r\n  showChangePasswordClick = () => {\r\n    this.setState({ showChangePassword: true })\r\n  }\r\n\r\n  logoutClick = () => {\r\n    window.location.hash = \"#/\"\r\n    //window.location.search = \"\"\r\n    this.props.logout()\r\n\r\n  }\r\n}\r\n\r\nfunction routeToHome() {\r\n  const baseUrl = GetSinglePageAppPath()\r\n  const redirectUrl = baseUrl + \"#\"\r\n  window.location.href = redirectUrl\r\n}\r\n\r\nfunction mapStateToProps(state: AppState): NavMenuProps {\r\n  const company = GetSelectedAssignedClinic(state)\r\n  return {\r\n    userAccess: BuildUserAccess(state),\r\n    userState: BuildUserState(state),\r\n    selectedCompany: SelectedPortalName(state) || SelectedAccountName(company) || company?.ImplementationName,\r\n    visibleCompanies: state.Workforce1Companies.visibleCompanies,\r\n    LoginName: getLoggedInUserName(state)\r\n  }\r\n}\r\n\r\nfunction mapDispatchProps(dispatch: Dispatch<Action>): NavMenuDispatchProps {\r\n  return {\r\n    logout: () => (dispatch(WorkforceOneUserLogOut())),\r\n    selectCompany: (company: string, companyLink: string) => {\r\n      dispatch(SelectCompany(company, companyLink))\r\n      // toast.success(\"Logged in successfully\")\r\n    },\r\n  }\r\n}\r\n\r\nconst ConnectedNavMenu = connect<NavMenuProps, NavMenuDispatchProps, {}, AppState>(mapStateToProps, mapDispatchProps)(NavMenu)\r\nexport default ConnectedNavMenu\r\n","import React,{Component} from \"react\";\r\nimport {toast} from \"react-toastify\";\r\nimport \"react-toastify/dist/ReactToastify.css\";\r\n\r\nexport class AppNotice extends Component{\r\n\r\n    componentDidMount() {\r\n        toast.configure();\r\n    }\r\n\r\n    render(){\r\n        return <>\r\n\r\n        </>\r\n    }\r\n}\r\n","import {Component, MouseEvent} from \"react\";\r\nimport {AppState} from \"../AppState\";\r\nimport {Action, Dispatch} from \"redux\";\r\nimport {WorkforceOneUserLogOut} from \"../actions/WorkforceOneLoginActions\";\r\nimport {connect} from \"react-redux\";\r\n\r\nexport interface MouseDetectionLogoutTimerDispatchProps{\r\n    logOut: () => void\r\n}\r\nexport interface MouseDetectionLogoutTimerAppStateProps{\r\n    loggedIn: boolean\r\n}\r\nexport interface MouseDetectionLogoutTimerProps{\r\n\r\n}\r\n\r\nconst sixtyMinutesInMilliSeconds = 3600000;\r\nexport class MouseDetectionLogoutTimer extends Component<MouseDetectionLogoutTimerDispatchProps & MouseDetectionLogoutTimerAppStateProps & MouseDetectionLogoutTimerProps>{\r\n\r\n    mouseMoveTimeOut: NodeJS.Timeout | undefined;\r\n\r\n    componentDidMount() {\r\n        if(this.props.loggedIn){\r\n            this.mouseMoveTimeOut = setTimeout(() => this.timerRanOut(), sixtyMinutesInMilliSeconds);\r\n        }\r\n    }\r\n    componentWillUnmount() {\r\n        if(this.mouseMoveTimeOut) {\r\n            clearTimeout(this.mouseMoveTimeOut);\r\n        }\r\n    }\r\n    timerRanOut = () => {\r\n        if(this.props.loggedIn){\r\n            this.props.logOut();\r\n        }\r\n    }\r\n    mouseMoved = (e: MouseEvent) => {\r\n        if(this.mouseMoveTimeOut) {\r\n            clearTimeout(this.mouseMoveTimeOut);\r\n        }\r\n        if(this.props.loggedIn){\r\n            this.mouseMoveTimeOut = setTimeout(() => this.timerRanOut(), sixtyMinutesInMilliSeconds);\r\n        }\r\n    }\r\n\r\n    render() {\r\n        return (<div onMouseMove={e => this.mouseMoved(e)}>\r\n            {this.props.children}\r\n        </div>);\r\n    }\r\n}\r\nfunction mapStateToProps(state: AppState): MouseDetectionLogoutTimerAppStateProps {\r\n    return {\r\n        loggedIn: state.Workforce1State.isLoggedIn\r\n    }\r\n}\r\nfunction mapDispatchProps(dispatch: Dispatch<Action>): MouseDetectionLogoutTimerDispatchProps {\r\n    return {\r\n        logOut: () => dispatch(WorkforceOneUserLogOut()),\r\n    }\r\n}\r\nconst connector = connect<MouseDetectionLogoutTimerAppStateProps, MouseDetectionLogoutTimerDispatchProps, MouseDetectionLogoutTimerProps, AppState>(\r\n    mapStateToProps, mapDispatchProps)(MouseDetectionLogoutTimer);\r\nexport default connector;\r\n","import {Component} from \"react\";\r\nimport ChromeImage from \"@browser-logos/chrome/chrome.png\";\r\nimport * as React from \"react\";\r\nimport './SupportedBrowser.css';\r\n\r\ntype browserDetected = 'Safari' | 'Opera' | 'Chrome' | 'IE' | 'Firefox' | 'Edge' | 'Unknown';\r\nconst ChromeBrowser = 'Chrome';\r\nconst UnknownBrowser = 'Unknown';\r\nconst browserFound = detectBrowser();\r\nfunction detectBrowser(): browserDetected {\r\n    if(navigator.userAgent.indexOf('MSIE') > -1){\r\n        return 'IE';\r\n    }\r\n    if(navigator.userAgent.indexOf('Firefox') > -1){\r\n        return 'Firefox';\r\n    }\r\n    if(navigator.appVersion.indexOf('Edge') > -1){\r\n        return 'Edge';\r\n    }\r\n    let chrome = navigator.userAgent.indexOf('Chrome') > -1;\r\n    const opera = navigator.userAgent.toLowerCase().indexOf(\"op\") > -1;\r\n    if ((chrome) && (opera)){\r\n        return 'Opera'\r\n    }\r\n    if(chrome){\r\n        return ChromeBrowser;\r\n    }\r\n    return UnknownBrowser;\r\n}\r\n\r\nexport class SupportedBrowsers extends Component {\r\n\r\n    render() {\r\n        const isSupportedBrowser = browserFound == ChromeBrowser;\r\n        const browserClass = 'browser-icon' + (isSupportedBrowser ? ' ' : ' gray-img');\r\n        return <>\r\n                <span>\r\n                    Supported Browsers :&nbsp;\r\n                </span>\r\n                <span>\r\n                    <img className={browserClass} src={ChromeImage} alt=\"Chrome\" width=\"50\"/>\r\n                </span>\r\n        </>\r\n    }\r\n}\r\n","export default __webpack_public_path__ + \"static/media/logo.35e4e3f8.png\";","import React from \"react\"\r\nimport { IsOnTrack } from \"../../App\"\r\n\r\nexport default function EmailSupport() {\r\n  return (\r\n    <span>Need help? Email&nbsp;\r\n      {location.host.includes(\"ontrack\")  && <a href=\"mailto:ontracksupport@crlcorp.com\">ontracksupport@crlcorp.com</a>}\r\n      {!location.host.includes(\"ontrack\")  && <a href=\"mailto:workforcesupport@crlcorp.com\">workforcesupport@crlcorp.com</a>}\r\n    </span>\r\n  )\r\n}\r\n","import React, {Component} from \"react\";\r\nimport {Col, Container, Row, Image} from \"react-bootstrap\";\r\nimport CopyRight from \"../Legal/CopyRight\";\r\nimport TOS from \"../Legal/TOS\";\r\nimport PrivacyPolicy from \"../Legal/PrivacyPolicy\";\r\nimport \"./AppPageWrapper.css\"\r\nimport ConnectedNavMenu from \"./NavMenu\";\r\nimport {AppNotice} from \"../AppNotice/AppNotice\";\r\nimport MouseDetectionLogoutTimer from \"../MouseDetectionLogoutTimer\";\r\nimport {SupportedBrowsers} from \"./SupportedBrowsers\";\r\nimport logoImage from \"../../assets/images/logo.png\";\r\nimport {ApiHostName} from \"../../api/ApiUrl\";\r\nimport EmailSupport from \"../Legal/EmailSupport\"\r\nimport { GetSSOToken } from \"../../storage/AuthToken\";\r\n\r\nexport interface AppPageWrapperProps{\r\n  parentClassName?: string\r\n  showNav?: boolean\r\n  showSupportedBrowsers?: boolean\r\n  hideLogo?: boolean\r\n  embedingMode?: boolean\r\n}\r\nexport class AppPageWrapper extends Component<AppPageWrapperProps> {\r\n\r\n  render() {\r\n    const logoSrc = getPortalLogoImageSrc();\r\n    const ssoToken = GetSSOToken()\r\n    const embedingMode = ssoToken !== \"\" || !!this.props.embedingMode\r\n    if (!embedingMode) {\r\n      return <div id=\"app-root\" className={'bg-white' || this.props.parentClassName || ''} >\r\n            { (this.props.hideLogo !== true) &&\r\n          <div id=\"portal-logo-container\">\r\n                <img id=\"portal-logo-image\"  src={logoSrc}  />\r\n          </div>\r\n        }\r\n        <MouseDetectionLogoutTimer>\r\n          <>\r\n            {this.props.showNav && (<>\r\n              <ConnectedNavMenu />\r\n              <Container fluid={true} >\r\n                <div className=\"m-2\">\r\n                                {this.props.children }\r\n                </div>\r\n              </Container>\r\n            </>)}\r\n            <Container fluid={true}>\r\n                      {!this.props.showNav && <>{this.props.children }</> }\r\n              <hr />\r\n              <Row>\r\n                        <Col lg={{span: 4, order: 2} }>\r\n                  <div className=\"text-center\">\r\n                    <strong><CopyRight /></strong>\r\n                  </div>\r\n                </Col>\r\n                        <Col lg={{span: 4, order: 3}} className=\"text-right\">\r\n                  <EmailSupport />{' | '}<TOS />{' | '}<PrivacyPolicy />\r\n                </Col>\r\n                        <Col lg={{span: 4, order: 1} }>\r\n                          {!!this.props.showSupportedBrowsers && <SupportedBrowsers /> }\r\n                </Col>\r\n              </Row>\r\n            </Container>\r\n          </>\r\n          <AppNotice />\r\n        </MouseDetectionLogoutTimer>\r\n      </div>\r\n    }\r\n    return  <div id=\"app-root\" className={'bg-white' || this.props.parentClassName || ''} >\r\n       <MouseDetectionLogoutTimer>\r\n          <>\r\n            {this.props.showNav && (<>\r\n              <Container fluid={true} >\r\n                <div className=\"m-2\">\r\n                  {this.props.children}\r\n                </div>\r\n              </Container>\r\n            </>)}\r\n          </>\r\n          <AppNotice />\r\n        </MouseDetectionLogoutTimer>\r\n    </div>\r\n  }\r\n}\r\nfunction getPortalLogoImageSrc(): string {\r\n\r\n  const portalImage = localStorage.getItem(\"portalImage\");\r\n    if(!portalImage){\r\n    const defaultSrc = logoImage;\r\n    return defaultSrc;\r\n  }\r\n  const result = 'data:image/png;base64, ' + encodeURI(portalImage);\r\n  return result;\r\n}\r\n","import * as React from \"react\"\r\nimport { Pagination } from \"react-bootstrap\"\r\n\r\ninterface TablePaginationProps {\r\n  pageNumber: number\r\n  pages: number\r\n  displayCount?: number\r\n  className?: string\r\n  onChange(pageNumber: number): void\r\n}\r\n\r\nconst FIRST = \"First\"\r\nconst PREVIOUS = \"Previous\"\r\nconst NEXT = \"Next\"\r\nconst LAST = \"Last\"\r\n\r\nconst DisplayCount = 3\r\n\r\nexport default class TablePagination extends React.PureComponent<TablePaginationProps, {}> {\r\n  pageChanged = (e: React.MouseEvent<HTMLElement>) => {\r\n    const page = (e.target as HTMLElement).innerText\r\n    let pageNumber = 1\r\n    switch (page) {\r\n      case FIRST:\r\n        break\r\n      case PREVIOUS:\r\n        pageNumber = this.props.pageNumber - 1\r\n        break\r\n      case NEXT:\r\n        pageNumber = this.props.pageNumber + 1\r\n        break\r\n      case LAST:\r\n        pageNumber = this.props.pages\r\n        break\r\n      default:\r\n        pageNumber = +page\r\n    }\r\n    if (pageNumber < 1) {\r\n      pageNumber = 1\r\n    }\r\n    if (pageNumber > this.props.pages) {\r\n      pageNumber = this.props.pages\r\n    }\r\n\r\n    this.props.onChange(pageNumber)\r\n  }\r\n\r\n  getPaginationItem = (label: string, active: boolean, disabled: boolean, onClick: ((e: React.MouseEvent<HTMLElement>) => void)) => {\r\n    return <Pagination.Item\r\n      key={label}\r\n      active={active}\r\n      onClick={!active ? onClick : undefined}\r\n      disabled={disabled}>\r\n      {label}\r\n    </Pagination.Item>\r\n  }\r\n\r\n  getPagination = () => {\r\n    let items = []\r\n    const currentPageNumber = this.props.pageNumber\r\n    const displayCount = this.props.displayCount || DisplayCount\r\n\r\n    items.push(this.getPaginationItem(FIRST, false, currentPageNumber === 1, this.pageChanged))\r\n    items.push(this.getPaginationItem(PREVIOUS, false, currentPageNumber === 1, this.pageChanged))\r\n\r\n    let startIndex\r\n    let endIndex\r\n\r\n    if (displayCount === 3) {\r\n      if (this.props.pages <= 3) {\r\n        startIndex = 1\r\n        endIndex = this.props.pages\r\n      } else {\r\n        if (currentPageNumber <= 2) {\r\n          startIndex = 1\r\n          endIndex = 3\r\n        } else if (currentPageNumber + 2 >= this.props.pages) {\r\n          startIndex = this.props.pages - 2\r\n          endIndex = this.props.pages\r\n        } else {\r\n          startIndex = currentPageNumber - 1\r\n          endIndex = currentPageNumber + 1\r\n        }\r\n      }\r\n    } else {\r\n      startIndex = (Math.ceil(currentPageNumber / displayCount) - 1) * displayCount + 1\r\n      endIndex = Math.min(startIndex + displayCount - 1, this.props.pages)\r\n    }\r\n\r\n    for (let i = startIndex; i <= endIndex; i++) {\r\n      items.push(this.getPaginationItem(i.toString(), currentPageNumber === i, false, this.pageChanged))\r\n    }\r\n\r\n    items.push(this.getPaginationItem(NEXT, false, currentPageNumber === this.props.pages, this.pageChanged))\r\n    items.push(this.getPaginationItem(LAST, false, currentPageNumber === this.props.pages, this.pageChanged))\r\n\r\n    return items\r\n  }\r\n\r\n  render() {\r\n    if (this.props.pages <= 1) {\r\n      return <></>\r\n    }\r\n    return (<Pagination className={`float-right ${this.props.className || \"\"}`}>{this.getPagination()}</Pagination>)\r\n  }\r\n}\r\n","export default \"data:image/png;base64,iVBORw0KGgoAAAANSUhE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ijXwDgGqWAAAAAElFTkSuQmCC\"","import * as React from \"react\"\r\nimport { Form } from \"react-bootstrap\"\r\n\r\ninterface CheckboxProps {\r\n  id: string\r\n  checked?: boolean\r\n  className?: string\r\n  defaultChecked?: boolean\r\n  disabled?: boolean\r\n  label?: string\r\n  name?: string\r\n  style?: React.CSSProperties\r\n  value?: string\r\n  inline?: boolean\r\n  title?: string\r\n  onChange?: (e: React.ChangeEvent<HTMLInputElement>) => void\r\n}\r\n\r\nexport default function Checkbox(props: CheckboxProps) {\r\n  return (\r\n    <Form.Check\r\n      {...props}\r\n      type=\"checkbox\"\r\n      className={`abc-checkbox abc-checkbox-primary ${props.className || \"\"}`}\r\n      label={props.label || \"\"}\r\n    />\r\n  )\r\n}\r\n","import React, { Component } from \"react\"\r\nimport { Button, Form, Overlay } from \"react-bootstrap\"\r\nimport { FaArrowDown, FaArrowUp, FaCaretDown, FaFilter, FaSearch, FaSortAlphaDown, FaSortAlphaDownAlt } from \"react-icons/fa\"\r\nimport { List, ListRowProps } from \"react-virtualized\"\r\nimport clearFilters from \"../assets/images/clear-filters.png\"\r\nimport Checkbox from \"./Checkbox\"\r\n\r\nexport type ValueLabels = { [key: string]: string }\r\n\r\nclass FilterItem {\r\n  constructor(options: { value: string | boolean, checked: boolean, label?: string }) {\r\n    if (typeof options.value === \"boolean\") {\r\n      this.value = options.value.toString()\r\n      this.label = options.value ? \"Yes\" : \"No\"\r\n    } else {\r\n      this.value = options.value || \"\"\r\n      this.label = options.label || options.value || \"(Blank)\"\r\n    }\r\n    this.checked = options.checked\r\n  }\r\n  value: string\r\n  checked: boolean\r\n  label: string\r\n}\r\n\r\ninterface ColumnHeaderFilterProps {\r\n  title: string,\r\n  items: string[],\r\n  filteredItems?: string[],\r\n  message?: React.ReactNode,\r\n  children?: React.ReactNode,\r\n  sort?: \"asc\" | \"desc\",\r\n  filtered?: boolean,\r\n  uppercase: boolean,\r\n  offsetLeft?: number,\r\n  offsetTop?: number,\r\n  itemValueLabels?: ValueLabels,\r\n  onFilter?: (items: string[]) => void,\r\n  onSort?: (order?: string) => void\r\n}\r\n\r\ninterface ColumnHeaderFilterState {\r\n  sort?: \"asc\" | \"desc\",\r\n  open: boolean,\r\n  searchText: string,\r\n  items: FilterItem[],\r\n  filtered?: boolean\r\n}\r\n\r\nexport default class ColumnHeaderFilter extends Component<ColumnHeaderFilterProps, ColumnHeaderFilterState> {\r\n  state: ColumnHeaderFilterState = { open: false, sort: this.props.sort, items: [], searchText: \"\" }\r\n  nameInput: HTMLInputElement | undefined\r\n  toggleElement = React.createRef<HTMLDivElement>()\r\n  listElement = React.createRef<List>()\r\n\r\n  componentDidMount() {\r\n    this.resetFilterItems([])\r\n  }\r\n\r\n  componentDidUpdate(prevProps: ColumnHeaderFilterProps) {\r\n    const arraysEqual = (a1: string[], a2: string[]): boolean => {\r\n      if (a1.length !== a2.length) {\r\n        return false\r\n      }\r\n      const a1Sorted = [...a1].filter(item => !!item).map(item => item.toString().toLowerCase()).sort()\r\n      const a2Sorted = [...a2].filter(item => !!item).map(item => item.toString().toLowerCase()).sort()\r\n      return a1Sorted.every((value, index) => value === a2Sorted[index])\r\n    }\r\n\r\n    if (this.props.title !== prevProps.title) {\r\n      this.resetFilterItems([])\r\n    } else {\r\n      if (!!this.props.filteredItems) {\r\n        if (!arraysEqual(this.props.filteredItems || [], prevProps.filteredItems || []) || !arraysEqual(this.props.items || [], prevProps.items || [])) {\r\n          this.resetFilterItems(this.props.filteredItems || [])\r\n        }\r\n      } else {\r\n        if (!arraysEqual(this.props.items, prevProps.items)) {\r\n          this.resetFilterItems(this.state.items.filter(item => item.checked).map(item => item.value))\r\n        }\r\n      }\r\n    }\r\n    if (this.props.filtered !== prevProps.filtered) {\r\n      this.setState({ filtered: this.props.filtered })\r\n    }\r\n    if (this.props.sort !== prevProps.sort) {\r\n      this.setState({ sort: this.props.sort })\r\n    }\r\n  }\r\n\r\n  resetFilterItems(checkedValues: string[]) {\r\n    const checkAll = checkedValues.length === 0\r\n    const itemValueLabels = this.props.itemValueLabels\r\n    let items = this.props.items ? this.props.items\r\n      .filter((item, index) => this.props.items.indexOf(item) === index)\r\n      .map(item => new FilterItem({\r\n        value: item,\r\n        checked: checkAll || checkedValues.includes(item),\r\n        label: itemValueLabels ? itemValueLabels[item] : undefined\r\n      }))\r\n      : []\r\n    items.unshift(new FilterItem({ value: \"#ALL#\", checked: checkAll || items.every(item => item.checked), label: \"(Select All)\" }))\r\n    this.setState({ items: items })\r\n  }\r\n\r\n  clearFilter() {\r\n    this.setState({ open: false, filtered: false })\r\n    this.resetFilterItems([])\r\n    this.props.onFilter && this.props.onFilter([])\r\n  }\r\n\r\n  toggleDialog = () => this.setState({ open: !this.state.open })\r\n  closeDialog = () => this.setState({ open: false })\r\n  changeTextFilter = (value: string) => this.setState({ searchText: value })\r\n  checkboxChange = (e: React.ChangeEvent<HTMLInputElement>) => {\r\n    const value = e.target.value\r\n    const checked = e.target.checked\r\n    const index = this.state.items.findIndex(item => String(item.value) === value)\r\n    if (index === 0) {\r\n      this.setState(prevState => {\r\n        let newItems = [...prevState.items]\r\n        newItems.map(item => item.checked = checked)\r\n        return { items: newItems }\r\n      })\r\n    } else {\r\n      this.setState(prevState => {\r\n        const newItems = [...prevState.items]\r\n        newItems[index].checked = checked\r\n        newItems[0].checked = newItems.slice(1).every((item) => item.checked)\r\n        return { items: newItems }\r\n      })\r\n    }\r\n    this.listElement.current && this.listElement.current.forceUpdateGrid()\r\n  }\r\n\r\n  getFilteredItems = () => {\r\n    const { items, searchText } = this.state\r\n    if (searchText.length > 0) {\r\n      return items.filter((item) => item.value && item.value.toString().toLowerCase().includes(searchText.toLowerCase()))\r\n    }\r\n    return items\r\n  }\r\n\r\n  setFilter = () => {\r\n    const items = this.state.items[0]?.checked ? [] : this.state.items.filter((item) => item.checked).map(item => item.value)\r\n    this.setState({ open: false, filtered: items.length > 0 })\r\n    this.props.onFilter && this.props.onFilter(items)\r\n  }\r\n\r\n  handleSort = (order?: \"asc\" | \"desc\") => {\r\n    this.setState({ sort: order, open: false })\r\n    this.props.onSort && this.props.onSort(order)\r\n  }\r\n\r\n  rowRenderer = (props: ListRowProps) => {\r\n    const item = this.getFilteredItems()[props.index]\r\n    return (\r\n      <Checkbox id={`${this.props.title}-${item.value}`} label={item.label} value={item.value.toString()} key={item.label} checked={item.checked} onChange={this.checkboxChange} style={props.style} />\r\n    )\r\n  }\r\n\r\n  render() {\r\n    return (\r\n      <>\r\n        <div onClick={this.toggleDialog} className=\"filter-toggle\" ref={this.toggleElement}>\r\n          <span className={`column-header-title ${this.props.uppercase ? \"text-uppercase\" : \"\"}`}>{this.props.title}</span>\r\n          <span className=\"column-header-caret\"><FaCaretDown /></span>\r\n          <span hidden={this.state.sort !== \"asc\"}><FaArrowUp /></span>\r\n          <span hidden={this.state.sort !== \"desc\"}><FaArrowDown /></span>\r\n          <span hidden={!this.state.filtered}><FaFilter /></span>\r\n          {this.props.children}\r\n        </div>\r\n        <Overlay container={this.toggleElement} target={this.toggleElement.current} show={this.state.open} placement=\"bottom-start\" rootClose onHide={this.closeDialog} popperConfig={{modifiers:[{name:\"offset\", options:{offset:[this.props.offsetLeft, this.props.offsetTop]}}]}}>\r\n          {({ arrowProps, show: _show, popper, ...props }) => (\r\n            <div id=\"columnFilter\" className=\"filter-section\" {...props}>\r\n              <ul>\r\n                <li onClick={() => this.handleSort(\"asc\")} className={this.state.sort === \"asc\" ? \"highlight\" : \"\"}><FaSortAlphaDown />Sort Smallest to Largest</li>\r\n                <li onClick={() => this.handleSort(\"desc\")} className={this.state.sort === \"desc\" ? \"highlight\" : \"\"}><FaSortAlphaDownAlt />Sort Largest to Smallest</li>\r\n                <li hidden={!this.state.filtered} onClick={() => this.clearFilter()}><img src={clearFilters} alt=\"\" width={16} height={16} />Clear Filter From \"{this.props.title}\"</li>\r\n              </ul>\r\n              <hr />\r\n              <div className=\"search-box\">\r\n                <Form.Control autoFocus tabIndex={0} type=\"text\" size=\"sm\" placeholder=\"Search\" value={this.state.searchText} onChange={(e) => this.changeTextFilter(e.target.value)} ref={(input: HTMLInputElement) => input && input.focus()} />\r\n                <FaSearch className=\"search-icon\" />\r\n                <div className=\"search-box-items\">\r\n                  <List ref={this.listElement} width={300} height={100} rowCount={this.getFilteredItems().length} rowHeight={20} rowRenderer={this.rowRenderer} />\r\n                </div>\r\n                {this.props.message && (<small>{this.props.message}</small>)}\r\n                <div className=\"pt-1\">\r\n                  <Button size=\"sm\" variant=\"secondary\" className=\"float-right ml-1\" onClick={this.closeDialog}>CANCEL</Button>\r\n                  <Button size=\"sm\" variant=\"secondary\" className=\"float-right\" disabled={this.state.items.every((item) => !item.checked)} onClick={this.setFilter}>OK</Button>\r\n                </div>\r\n              </div>\r\n            </div>\r\n          )}\r\n        </Overlay>\r\n      </>\r\n    )\r\n  }\r\n\r\n  static defaultProps = { uppercase: true, offsetLeft: -13, offsetTop: 12 }\r\n}\r\n","import * as React from \"react\"\r\nimport { Button, Form, InputGroup, Dropdown, Row, Col, Spinner } from \"react-bootstrap\"\r\nimport { FaSearch } from \"react-icons/fa\"\r\nimport SearchField from \"../api/SearchField\"\r\n\r\ninterface SearchBarProps {\r\n  searchFields: SearchField[]\r\n  defaultField?: SearchField\r\n  allowBlank?: boolean\r\n  resetButton?: boolean\r\n  placeholder?: string\r\n  loading?: boolean\r\n  variant?: string\r\n  onSearch: (searchField: string, searchText: string) => void,\r\n  formatValue?: (ID: string, value: string) => string\r\n}\r\n\r\ninterface SearchBarState {\r\n  selectedField?: SearchField\r\n  searchText: string\r\n}\r\n\r\nexport default class SearchBar extends React.PureComponent<SearchBarProps, SearchBarState> {\r\n  state: SearchBarState = {\r\n    selectedField: this.props.defaultField,\r\n    searchText: \"\"\r\n  }\r\n\r\n  componentDidMount() {\r\n    if (!this.props.allowBlank && this.props.searchFields.length) {\r\n      this.setState({ selectedField: this.props.defaultField || this.props.searchFields[0] })\r\n    }\r\n  }\r\n\r\n  componentDidUpdate(prevProps: SearchBarProps) {\r\n    if (!this.props.allowBlank && prevProps.searchFields !== this.props.searchFields) {\r\n      this.setState({ selectedField: this.props.defaultField || this.props.searchFields[0] })\r\n    }\r\n  }\r\n\r\n  setSearchField = (field: SearchField) => {\r\n    this.setState({ selectedField: field, searchText: \"\" })\r\n  }\r\n\r\n  handleSearchTextChange = (e: React.ChangeEvent<HTMLInputElement>) => {\r\n    let value: string = e.target.value\r\n\r\n    if (this.props.formatValue && this.state.selectedField) {\r\n      value = this.props.formatValue(this.state.selectedField.ID, value)\r\n    }\r\n\r\n    this.setState({ searchText: value })\r\n  }\r\n\r\n  handleKeyDown = (e: React.KeyboardEvent<HTMLInputElement>) => {\r\n    if (e.key === 'Enter' && this.state.searchText.length > 0) {\r\n      this.onSearch()\r\n    }\r\n  }\r\n\r\n  resetSearch = () => {\r\n    const field = this.props.defaultField || this.props.allowBlank ? undefined : this.props.searchFields[0]\r\n    this.setState({\r\n      selectedField: field,\r\n      searchText: \"\"\r\n    })\r\n    this.props.onSearch(field?.ID || \"\", \"\")\r\n  }\r\n\r\n  searchAllowed = () => this.state.searchText && this.props.searchFields.length\r\n\r\n  onSearch = () => {\r\n    if (this.searchAllowed()) {\r\n      const searchField = this.state.selectedField ? this.state.selectedField.ID : \"\"\r\n      this.props.onSearch(searchField, this.state.searchText)\r\n    }\r\n  }\r\n\r\n  render = () => {\r\n    return (\r\n      <Row className=\"search-bar\">\r\n        <Col>\r\n          <InputGroup size=\"sm\">\r\n            <InputGroup.Prepend>\r\n              <Dropdown>\r\n                <Dropdown.Toggle size=\"sm\" variant=\"secondary\">{this.state.selectedField ? this.state.selectedField.Name : this.props.placeholder || \"Select\"}</Dropdown.Toggle>\r\n                <Dropdown.Menu className=\"secondary\">\r\n                  {this.props.searchFields.length > 0 ?\r\n                    this.props.searchFields.map((item: SearchField, key: number) => <Dropdown.Item as={Button} onClick={() => this.setSearchField(item)} key={key} eventKey={item.ID} variant=\"menu-item\">{item.Name}</Dropdown.Item>) :\r\n                    <Dropdown.Item as={Button} variant=\"menu-item\">No data found</Dropdown.Item>}\r\n                </Dropdown.Menu>\r\n              </Dropdown>\r\n            </InputGroup.Prepend>\r\n            <Form.Control type=\"text\" placeholder=\"Search\" value={this.state.searchText} onKeyDown={this.handleKeyDown} onChange={this.handleSearchTextChange} className=\"input-text\" />\r\n            <InputGroup.Append>\r\n              <Button size=\"sm\" variant=\"secondary\" className=\"btn-rounded-right\" disabled={!this.searchAllowed() || this.props.loading} onClick={this.onSearch}>\r\n                {this.props.loading ? <Spinner animation=\"border\" size=\"sm\" /> : <FaSearch />}\r\n              </Button>\r\n            </InputGroup.Append>\r\n          </InputGroup>\r\n        </Col>\r\n        {this.props.resetButton && <Col md={this.props.variant === \"full-width\" ? 1 : 2} className=\"px-0\">\r\n          <Button size=\"sm\" variant=\"secondary\" onClick={this.resetSearch}>CLEAR</Button>\r\n        </Col>}\r\n      </Row>\r\n    )\r\n  }\r\n\r\n  static defaultProps = { resetButton: true }\r\n}\r\n","import { Observable } from \"rxjs\"\r\nimport LabAccount from \"./RandomsModel/LabAccount\"\r\nimport { ObservableFromFetch } from \"../ObservableFromFetch\"\r\n\r\nexport default function LabAccountListGetObservable(link: string): Observable<LabAccount[]> {\r\n  const params: string = JSON.stringify({\r\n    Link: link,\r\n    DOT: false,\r\n    IsMarketPlace: true,\r\n    LocationID: 0,\r\n    RegionID: 0,\r\n    SearchBy: \"Account Name\",\r\n    SearchFor: \"\"\r\n  })\r\n\r\n  return ObservableFromFetch<LabAccount[]>(\"FFOrderPoolDefinition/GetPoolDefinitionLabAccounts\", params)\r\n}\r\n","import { Observable } from \"rxjs\"\r\nimport LabPanel from \"./RandomsModel/LabPanel\"\r\nimport { ObservableFromFetch } from \"../ObservableFromFetch\"\r\n\r\nexport default function LabPanelsGetObservable(link: string, labAccount: string, vendorID: number): Observable<LabPanel[]> {\r\n  const params: string = JSON.stringify({\r\n    Link: link,\r\n    IsDOT: false,\r\n    IsMarketPlace: true,\r\n    IsPoct: false,\r\n    LabAccountNumber: labAccount,\r\n    VendorID: vendorID\r\n  })\r\n\r\n  return ObservableFromFetch<LabPanel[]>(\"FFOrderPoolDefinition/GetPoolDefinitionLabPanels\", params)\r\n}\r\n","import { Observable } from \"rxjs\"\r\nimport { ObservableFromFetch } from \"../ObservableFromFetch\"\r\n\r\nexport default function SelectionIntervalsGetObservable() {\r\n  return ObservableFromFetch<string[]>(\"WorkforceRandomTest/GetSelectionIntervals\")\r\n}\r\n","import { Observable } from \"rxjs\"\r\nimport { ObservableFromFetch } from \"../ObservableFromFetch\"\r\nimport RegulatoryMode from \"./LabServiceModel/RegulatoryMode\"\r\n\r\nexport default function LabServiceRegulatoryModesGetObservable(isDOT?: boolean): Observable<RegulatoryMode[]> {\r\n  const params = isDOT === undefined ? \"\" : isDOT ? \"?isDOT=true\" : \"?isDOT=false\"\r\n  return ObservableFromFetch<RegulatoryMode[]>(`RandomTest/GetPersonnelRegulatoryModes${params}`)\r\n}","import { Observable } from \"rxjs\"\r\nimport { ObservableFromFetch } from \"../ObservableFromFetch\"\r\nimport { AccountRequest } from \"./CompanyModel/AccountRequest\"\r\nimport { AccountLimit, AccountType, ImplementationGroupID_Workforce } from \"../../config/Constants\"\r\nimport AutoFilterCompany from \"./CompanyModel/AutoFilterCompany\"\r\n\r\nexport default function GetAccountsByNameObservable(query: string, showInactive: boolean = false, accountType: AccountType = AccountType.Company ): Observable<AutoFilterCompany[]> {\r\n  const request: AccountRequest = { AccountTypeID: accountType, Name: query, Limit: AccountLimit, ImplementationGroupID: ImplementationGroupID_Workforce, ShowInactive: showInactive }\r\n  const requestBody: string = JSON.stringify(request)\r\n  return ObservableFromFetch<AutoFilterCompany[]>(\"Account/GetAllByName\", requestBody)\r\n}\r\nexport function GetAllAccountsByNameObservable(query: string, showInactive: boolean = false, accountType: AccountType = AccountType.Company ): Observable<AutoFilterCompany[]> {\r\n  const request: AccountRequest = { AccountTypeID: accountType, Name: query, Limit: 0, ImplementationGroupID: ImplementationGroupID_Workforce, ShowInactive: showInactive }\r\n  const requestBody: string = JSON.stringify(request)\r\n  return ObservableFromFetch<AutoFilterCompany[]>(\"Account/GetAllByName\", requestBody)\r\n}\r\n","import * as React from \"react\"\r\nimport { Typeahead, AsyncTypeahead } from \"react-bootstrap-typeahead\"\r\nimport { Button, Form } from \"react-bootstrap\"\r\nimport { FaAngleDown } from \"react-icons/fa\"\r\nimport AutoFilterCompany from \"../../api/Companies/CompanyModel/AutoFilterCompany\"\r\nimport { concat, of, Subject, Subscription } from \"rxjs\"\r\nimport { catchError, debounceTime, filter, map, switchMap } from \"rxjs/operators\"\r\nimport { DataLoader } from \"../OrderRequests/GovCollection\"\r\nimport GetAccountsByNameObservable from \"../../api/Companies/GetAccountsByName\"\r\nimport { RouteComponentProps, withRouter } from \"react-router\"\r\nimport { WorkforceClinicPortal } from \"../../AppState\"\r\n\r\ninterface CompanyInputState {\r\n  companies: DataLoader<AutoFilterCompany>\r\n}\r\n\r\ninterface CompanyInputProps {\r\n  defaultValue?: string\r\n  forceEdit?: boolean\r\n  id?: string\r\n  disabled?: boolean\r\n  filter?: boolean\r\n  placeholder?: string\r\n  emptyLabel?: string\r\n  allowedCompanies?: AutoFilterCompany[]\r\n  onChange?: (items: AutoFilterCompany[]) => void\r\n}\r\n\r\nclass CompanyInput extends React.PureComponent<CompanyInputProps & RouteComponentProps, CompanyInputState> {\r\n  companyAsyncTypeahead = React.createRef<AsyncTypeahead<AutoFilterCompany>>()\r\n  companyTypeahead = React.createRef<Typeahead<AutoFilterCompany>>()\r\n  companies$ = new Subject<string>()\r\n  subscription?: Subscription\r\n  state: CompanyInputState = { companies: {} }\r\n  defaultCompanyName: string = this.props.defaultValue || this.getCompanyName()\r\n\r\n  componentDidMount() {\r\n    this.subcribeCompanies()\r\n    this.onInputChange(this.defaultCompanyName)\r\n  }\r\n\r\n  componentDidUpdate(prevProps: CompanyInputProps & RouteComponentProps, prevState: CompanyInputState) {\r\n    if (!this.defaultCompanyName && this.props.location.pathname !== prevProps.location.pathname) {\r\n      this.companyAsyncTypeahead?.current?.clear()\r\n      this.onInputChange(\"\")\r\n    }\r\n  }\r\n\r\n  componentWillUnmount() {\r\n    this.subscription && this.subscription.unsubscribe()\r\n  }\r\n\r\n  onInputChange(value: string) {\r\n    if (value === \"\") {\r\n      this.setState({ companies: { selected: undefined } }, () => this.props.onChange && this.props.onChange([]))\r\n    }\r\n    else {\r\n      this.companies$.next(value)\r\n    }\r\n  }\r\n\r\n  getCompanyName() {\r\n    const participation = sessionStorage.getItem(\"company-selection\")\r\n    const portals: WorkforceClinicPortal[] = JSON.parse(sessionStorage.getItem(\"wf2-STRY0045127-portals\") || \"{}\")\r\n    var company = undefined\r\n    for (const p of portals) {\r\n      for (const c of p.AssignedClientDetailsOfClinic) {\r\n        if (c.ParticipationID.toString() == participation) {\r\n          company = c\r\n          break\r\n        }\r\n      }\r\n      if (company) {\r\n        break\r\n      }\r\n    }\r\n    return company?.Name || \"\"\r\n  }\r\n\r\n  onChange = (companies: AutoFilterCompany[]) => {\r\n    const selectedCompany = companies[0]\r\n    this.setState({ companies: { ...this.state.companies, selected: selectedCompany } })\r\n    this.props.onChange && this.props.onChange(companies)\r\n  }\r\n\r\n  subcribeCompanies() {\r\n    this.subscription = this.companies$.pipe(\r\n      debounceTime(500),\r\n      filter(filter => filter.length >= 1 || filter.length === 0),\r\n      switchMap((filter) => filter.length === 0 ?\r\n        of({ loading: false, companies: this.state.companies.data }) :\r\n        concat(\r\n          of({ loading: true }),\r\n          GetAccountsByNameObservable(filter).pipe(\r\n            map((data) => ({ loading: false, companies: data })),\r\n            catchError(() => of({ loading: false }))\r\n          )\r\n        )\r\n      )\r\n    ).subscribe(\r\n      (state: { loading: boolean, companies?: AutoFilterCompany[] }) => {\r\n        if (state.companies) {\r\n          let filteredCompanies: AutoFilterCompany[] = state.companies || []\r\n          if (this.props.allowedCompanies && Array.isArray(this.props.allowedCompanies)) {\r\n            const allowedCompanies = this.props.allowedCompanies || []\r\n            const merged = filteredCompanies.filter(c => allowedCompanies.find(item => item.AccountID === c.AccountID))\r\n            filteredCompanies = merged\r\n          }\r\n          this.setState({ companies: { loading: state.loading, data: filteredCompanies, selected: this.defaultCompanyName ? filteredCompanies[0] : undefined } }, () => this.defaultCompanyName && this.onChange((state.companies || [])))\r\n        } else {\r\n          this.setState({ companies: { loading: state.loading } })\r\n\r\n        }\r\n      },\r\n      () => this.setState({ companies: { loading: false } })\r\n    )\r\n  }\r\n\r\n  render() {\r\n    return (\r\n      <>\r\n        {(!this.defaultCompanyName || this.props.forceEdit) ? <AsyncTypeahead\r\n          useCache={false}\r\n          disabled={this.props.disabled}\r\n          emptyLabel={this.props.emptyLabel || \"No Companies Found\"}\r\n          filterBy={(option, props) => this.props.filter ? props.selected.length > 0 || option.Name.toLowerCase().indexOf(props.text.toLowerCase()) !== -1 : true}\r\n          id={this.props.id || \"company\"}\r\n          isLoading={!!this.state.companies.loading}\r\n          labelKey=\"Name\"\r\n          minLength={0}\r\n          onInputChange={input => this.onInputChange(input)}\r\n          onChange={items => this.onChange(items)}\r\n          onSearch={() => { }}\r\n          options={this.state.companies.data || []}\r\n          placeholder={this.props.placeholder || \"Enter the Company name\"}\r\n          ref={this.companyAsyncTypeahead}\r\n          selected={this.state.companies.selected ? [this.state.companies.selected] : []}>\r\n          {!this.state.companies.loading && !this.props.disabled &&\r\n            <Button variant=\"toggle\" onClick={() => { this.companyAsyncTypeahead?.current?.toggleMenu() }}>\r\n              <FaAngleDown />\r\n            </Button>}\r\n        </AsyncTypeahead> : <Form.Control type=\"text\" disabled defaultValue={this.state.companies.selected?.Name || \"\"} />}\r\n      </>\r\n    )\r\n  }\r\n}\r\n\r\nexport default withRouter(CompanyInput)\r\n","import { Observable } from \"rxjs\";\r\nimport PoolData from \"./RandomsModel/PoolData\"\r\nimport PoolCreate from \"./RandomsModel/PoolCreate\"\r\nimport { format, parseISO } from \"date-fns\"\r\nimport { ObservableFromFetch } from \"../ObservableFromFetch\"\r\n\r\nexport function PoolUpdateObservable(data: PoolData, IsConsortium: boolean): Observable<string> {\r\n  const params: string = JSON.stringify({\r\n    IsDOT: data.DOT,\r\n    RegulatoryModeID: data.RegulatoryModeID,\r\n    SelectionInterval: data.SelectionInterval,\r\n    DrugTarget: data.DrugSampleSize,\r\n    AlcoholTarget: data.AlcoholSampleSize,\r\n    ProviderMappingID: data.ProviderMappingID,\r\n    PanelID: data.PanelID,\r\n    PoolCalculationType: data.FixedOrRate,\r\n    Code: data.Code,\r\n    PoolID: data.PoolID,\r\n    PoolName: data.Name,\r\n    UseFileImportForPoolMembership: data.UseFileImportForPoolMembership,\r\n    DateFrom: format(parseISO(data.ProgramIntervalStartDate), \"MM/dd/yyyy\"),\r\n    DateTo: format(parseISO(data.ProgramIntervalEndDate), \"MM/dd/yyyy\"),\r\n    PrimaryIDType: data.PrimaryIDType || \"\",\r\n    IncludeCompaniesWithNoSelections: data.IncludeCompaniesWithNoSelections,\r\n    IsConsortium: IsConsortium,\r\n    PanelCode: data.PanelCode,\r\n    RegulatoryModes: data.RegulatoryModes,\r\n    RunOnlyByPortalAdmin: data.RunOnlyByPortalAdmin\r\n  })\r\n\r\n  return ObservableFromFetch<string>(\"FFOrderPoolDefinition/UpdatePool\", params)\r\n}\r\n\r\nexport function PoolCreateObservable(data: PoolCreate): Observable<string> {\r\n  const params: string = JSON.stringify(data)\r\n\r\n  return ObservableFromFetch<string>(\"FFOrderPoolDefinition/CreatePool\", params)\r\n}\r\n","import { Observable } from \"rxjs\"\r\nimport { ObservableFromFetch } from \"../ObservableFromFetch\"\r\nimport PrimaryIDType from \"./PrimaryIDType\"\r\n\r\nexport default function PrimaryIDTypesGetObservable(): Observable<PrimaryIDType[]> {\r\n  return ObservableFromFetch<PrimaryIDType[]>(\"FFOrderClientFileMaintenance/GetPrimaryIDTypes\")\r\n}\r\n\r\nexport function PoolPrimaryIDTypesGetObservable(): Observable<PrimaryIDType[]> {\r\n  return ObservableFromFetch<PrimaryIDType[]>(\"FFOrderPoolDefinition/GetPrimaryIDTypes\")\r\n}\r\n\r\n","import * as React from \"react\"\r\nimport { Spinner } from \"react-bootstrap\"\r\n\r\nexport default function LoadingIndicatorWrapper(props: { loading: boolean, children?: React.ReactNode }) {\r\n  if (props.loading) {\r\n    return <div className=\"py-2\"><Spinner animation=\"border\" size=\"sm\" variant=\"secondary\" /></div>\r\n  }\r\n  return (<>{props.children}</>)\r\n}\r\n","import * as React from \"react\"\r\nimport { Modal, Form, Button, Col, InputGroup, Spinner } from \"react-bootstrap\"\r\nimport { Subscription, Subject, of, concat } from \"rxjs\"\r\nimport { switchMap, filter, debounceTime, map, catchError } from \"rxjs/operators\"\r\nimport { toast } from \"react-toastify\"\r\nimport LabAccount from \"../../api/Randoms/RandomsModel/LabAccount\"\r\nimport LabAccountListGetObservable from \"../../api/Randoms/LabAccountsGet\"\r\nimport LabPanel from \"../../api/Randoms/RandomsModel/LabPanel\"\r\nimport LabPanelsGetObservable from \"../../api/Randoms/LabPanelsGet\"\r\nimport RegulatoryMode from \"../../api/LabService/LabServiceModel/RegulatoryMode\"\r\nimport SelectionIntervalsGetObservable from \"../../api/Randoms/SelectionIntervalsGet\"\r\nimport LabServiceRegulatoryModesGetObservable from \"../../api/LabService/LabServiceRegulatoryModesGet\"\r\nimport AutoFilterCompany from \"../../api/Companies/CompanyModel/AutoFilterCompany\"\r\nimport AutoFilterCompaniesGet from \"../../api/Companies/AutoFilterCompaniesGet\"\r\nimport CompanyInput from \"../FormattedInputs/CompanyInput\"\r\nimport { PoolCreateObservable } from \"../../api/Randoms/PoolSave\"\r\nimport PoolCreate from \"../../api/Randoms/RandomsModel/PoolCreate\"\r\nimport { isCompanyAdmin, isPortalAdmin } from \"../../authentication/isAdminRole\"\r\nimport { AppState, AssignedClinic } from \"../../AppState\"\r\nimport { connect } from \"react-redux\"\r\nimport PrimaryIDType from \"../../api/PrimaryIDTypes/PrimaryIDType\"\r\nimport { PoolPrimaryIDTypesGetObservable } from \"../../api/PrimaryIDTypes/PrimaryIDTypesGet\"\r\nimport { IsOnTrack } from \"../../App\";\r\nimport LoadingIndicatorWrapper from \"../LoadingIndicatorWrapper\"\r\nimport { GetSelectedAssignedClinic, SelectedPortalName } from \"../../authentication/SelectedCompany/CompanySelectionDrivenSelectors\"\r\nimport Checkbox from \"../Checkbox\"\r\nimport { Typeahead } from \"react-bootstrap-typeahead\"\r\n\r\ninterface AddPoolModalProps {\r\n  show: boolean\r\n  onHide: () => void\r\n  onSuccess: () => void\r\n  IsConsortium: boolean\r\n}\r\n\r\ninterface AddPoolModalAuthProps {\r\n  isCompanyAdmin?: boolean\r\n  isPortalAdmin?: boolean\r\n  currentCompany?: AssignedClinic | null\r\n}\r\n\r\ninterface AddPoolModalState {\r\n  companies: AutoFilterCompany[]\r\n  initialCompanies?: AutoFilterCompany[]\r\n  companiesLoading: boolean\r\n  regulatoryModesLoading: boolean\r\n  selectionIntervalsLoading: boolean\r\n  labAccountLoading: boolean\r\n  primaryIDTypesLoading: boolean\r\n  panelsLoading: boolean\r\n  selectedCompany?: AutoFilterCompany,\r\n  regulatoryModes?: RegulatoryMode[]\r\n  selectionIntervals?: string[]\r\n  labAccounts?: LabAccount[]\r\n  primaryIDTypes?: PrimaryIDType[]\r\n  labPanels?: LabPanel[]\r\n  poolName: string\r\n  poolNameValid: boolean\r\n  poolID: string\r\n  federallyRegulated: boolean | string\r\n  regulatoryModeId: number\r\n  selectionInterval: string\r\n  calcType: string\r\n  drugPoolSize: string\r\n  alcoholPoolSize: string\r\n  labAccount: string\r\n  panelID: string\r\n  useFileImportForPoolMembership: string\r\n  primaryIDType: string\r\n  saving: boolean\r\n  currentCompany?: AssignedClinic | null\r\n  includeCompaniesWithNoSelections: boolean\r\n  panelCode: string\r\n  panelCodeValid: boolean\r\n  selectedRegulatoryModes: RegulatoryMode[]\r\n  availableToSelectRegModes: RegulatoryMode[]\r\n  RunOnlyByPortalAdmin: boolean\r\n}\r\n\r\nexport class AddPoolModal extends React.PureComponent<AddPoolModalProps & AddPoolModalAuthProps, AddPoolModalState> {\r\n  state: AddPoolModalState = {\r\n    companies: [],\r\n    companiesLoading: false,\r\n    regulatoryModesLoading: false,\r\n    selectionIntervalsLoading: false,\r\n    labAccountLoading: false,\r\n    panelsLoading: false,\r\n    primaryIDTypesLoading: false,\r\n    poolName: \"\",\r\n    poolNameValid: true,\r\n    poolID: \"\",\r\n    federallyRegulated: \"\",\r\n    regulatoryModeId: 0,\r\n    selectionInterval: \"\",\r\n    calcType: \"\",\r\n    drugPoolSize: \"\",\r\n    alcoholPoolSize: \"\",\r\n    labAccount: \"\",\r\n    panelID: \"\",\r\n    useFileImportForPoolMembership: this.props.IsConsortium ? \"false\" : \"true\",\r\n    primaryIDType: \"\",\r\n    saving: false,\r\n    currentCompany: this.props.currentCompany,\r\n    includeCompaniesWithNoSelections: false,\r\n    panelCode: \"\",\r\n    panelCodeValid: true,\r\n    selectedRegulatoryModes: [],\r\n    availableToSelectRegModes: [],\r\n    RunOnlyByPortalAdmin: false || this.props.IsConsortium,\r\n  }\r\n\r\n  regulatoryModesSubscription?: Subscription\r\n  intervalsSubscription?: Subscription\r\n  labAccountsSubscription?: Subscription\r\n  primaryIDTypesSubscription?: Subscription\r\n  account$ = new Subject<LabAccount>()\r\n  labAccountSubscription?: Subscription\r\n  saveSubscription?: Subscription\r\n\r\n  componentDidMount() {\r\n\r\n    this.setState({ regulatoryModesLoading: true, selectionIntervalsLoading: true, primaryIDTypesLoading: true, labAccountLoading: true })\r\n\r\n    this.regulatoryModesSubscription = LabServiceRegulatoryModesGetObservable(true).subscribe(\r\n      (data: RegulatoryMode[]) => this.setState({ regulatoryModes: data, availableToSelectRegModes: data || [], regulatoryModesLoading: false }),\r\n      () => this.setState({ regulatoryModesLoading: false })\r\n    )\r\n\r\n    this.intervalsSubscription = SelectionIntervalsGetObservable().subscribe(\r\n      (data: string[]) => this.setState({ selectionIntervals: data, selectionIntervalsLoading: false }),\r\n      () => this.setState({ selectionIntervalsLoading: false })\r\n    )\r\n\r\n    this.primaryIDTypesSubscription = PoolPrimaryIDTypesGetObservable().subscribe(\r\n      (data: PrimaryIDType[]) => this.setState({ primaryIDTypes: data, primaryIDTypesLoading: false, primaryIDType: data?.length ? data[0].PrimaryIDType : \"\" }),\r\n      () => this.setState({ primaryIDTypesLoading: false })\r\n    )\r\n    const link = sessionStorage.getItem(\"company-selection-link\") || \"\"\r\n\r\n    this.labAccountsSubscription = LabAccountListGetObservable(link).subscribe(\r\n      (data: LabAccount[]) =>{ \r\n        const filteredLabs = data.filter((labAccount: LabAccount) => (labAccount.LabCode === \"CRL\"))\r\n        this.setState({ labAccounts: filteredLabs, labAccountLoading: false })\r\n      },\r\n      () => this.setState({ labAccountLoading: false })\r\n    )\r\n\r\n    this.labAccountSubscription = this.account$.pipe(\r\n      filter(labAccount => labAccount !== undefined),\r\n      switchMap(labAccount =>\r\n        concat(\r\n          of({ loading: true }),\r\n          LabPanelsGetObservable(link, labAccount.LabAccount, labAccount.LabClientMemberId).pipe(\r\n            map(data => ({ loading: false, data: data })),\r\n            catchError(() => of({ loading: false }))\r\n          )\r\n        )\r\n      )\r\n    ).subscribe(\r\n      (o: { loading: boolean, data?: LabPanel[] }) =>\r\n        o.data\r\n          ? this.setState({ panelsLoading: o.loading, labPanels: o.data })\r\n          : this.setState({ panelsLoading: o.loading }),\r\n      () => this.setState({ panelsLoading: false })\r\n    )\r\n  }\r\n\r\n  componentDidUpdate(prevProps: AddPoolModalProps) {\r\n    if (!prevProps.show && this.props.show) {\r\n      this.setState({\r\n        selectedCompany: undefined,\r\n        poolName: \"\",\r\n        poolNameValid: true,\r\n        poolID: \"\",\r\n        federallyRegulated: \"\",\r\n        regulatoryModeId: 0,\r\n        selectionInterval: \"\",\r\n        calcType: \"\",\r\n        drugPoolSize: \"\",\r\n        alcoholPoolSize: \"\",\r\n        labAccount: \"\",\r\n        panelID: \"\",\r\n        useFileImportForPoolMembership: \"true\",\r\n        primaryIDType: \"\",\r\n        saving: false,\r\n        selectedRegulatoryModes: []\r\n      })\r\n    }\r\n  }\r\n\r\n  componentWillUnmount() {\r\n    this.regulatoryModesSubscription && this.regulatoryModesSubscription.unsubscribe()\r\n    this.intervalsSubscription && this.intervalsSubscription.unsubscribe()\r\n    this.labAccountsSubscription && this.labAccountsSubscription.unsubscribe()\r\n    this.primaryIDTypesSubscription && this.primaryIDTypesSubscription.unsubscribe()\r\n    this.labAccountSubscription && this.labAccountSubscription.unsubscribe()\r\n    this.saveSubscription && this.saveSubscription.unsubscribe()\r\n  }\r\n\r\n  checkPoolSize = (value: string) => {\r\n    if (this.state.calcType === \"Rate\" && /^(\\s*|100|0|[1-9]{1}\\d?)$/.test(value)) {\r\n      return true\r\n    }\r\n    if (this.state.calcType === \"Fixed\" && /^(\\s*|0|[1-9]{1}\\d{0,15})$/.test(value)) {\r\n      return true\r\n    }\r\n    return false\r\n  }\r\n\r\n  handlePoolNameChange = (event: React.ChangeEvent<HTMLInputElement>) => {\r\n    const value = event.target.value\r\n    this.setState({ poolName: value, poolNameValid: value.length >= 8 })\r\n  }\r\n\r\n  handlePanelCodeChange = (event: React.ChangeEvent<HTMLInputElement>) => {\r\n    const value = event.target.value\r\n    this.setState({ panelCode: value, panelCodeValid: value.length > 1 })\r\n  }\r\n\r\n  handlePoolIDChange = (event: React.ChangeEvent<HTMLInputElement>) => {\r\n    const value = event.target.value\r\n    this.setState({ poolID: value })\r\n  }\r\n\r\n\r\n  handleFederallyRegulatedChange = (event: React.ChangeEvent<HTMLSelectElement>) => {\r\n    this.setState({ federallyRegulated: event.target.value, panelID: \"\", regulatoryModeId: 0, selectedRegulatoryModes: [], availableToSelectRegModes: this.state.regulatoryModes || [] })\r\n  }\r\n\r\n  handleIntervalChange = (event: React.ChangeEvent<HTMLSelectElement>) => {\r\n    const selectionInterval = event.target.value\r\n    this.setState({ selectionInterval: selectionInterval })\r\n  }\r\n\r\n  handleCalcTypeChange = (event: React.ChangeEvent<HTMLSelectElement>) => {\r\n    const calcType = event.target.value\r\n    this.setState({ calcType: calcType, drugPoolSize: \"\", alcoholPoolSize: \"\" })\r\n  }\r\n\r\n  handleDrugChange = (event: React.ChangeEvent<HTMLInputElement>) => {\r\n    const drug = event.target.value\r\n    if (this.checkPoolSize(drug)) {\r\n      this.setState({ drugPoolSize: drug })\r\n    }\r\n  }\r\n\r\n  handleAlcoholChange = (event: React.ChangeEvent<HTMLInputElement>) => {\r\n    const alcohol = event.target.value\r\n    if (this.checkPoolSize(alcohol)) {\r\n      this.setState({ alcoholPoolSize: alcohol })\r\n    }\r\n  }\r\n\r\n  handleLabChange = (event: React.ChangeEvent<HTMLSelectElement>) => {\r\n    const labAccount = event.target.value\r\n    this.setState({ labAccount: labAccount, labPanels: undefined, panelID: \"\" })\r\n    const currentAccount = this.state.labAccounts?.find((account: LabAccount) => account.LabAccount === labAccount)\r\n    this.account$.next(currentAccount)\r\n  }\r\n\r\n  handlePanelChange = (event: React.ChangeEvent<HTMLSelectElement>) => {\r\n    const panelID = event.target.value\r\n    this.setState({ panelID: panelID })\r\n  }\r\n\r\n  handlePoolMembershipTypeChange = (event: React.ChangeEvent<HTMLSelectElement>) => {\r\n    const useFileImportForPoolMembership = event.target.value\r\n    this.setState({ useFileImportForPoolMembership: useFileImportForPoolMembership })\r\n  }\r\n  handlePrimaryIDTypeChange = (event: React.ChangeEvent<HTMLSelectElement>) => {\r\n    const value = event.target.value || \"\"\r\n    this.setState({ primaryIDType: value })\r\n  }\r\n\r\n  isValid = () => {\r\n    return (this.props.IsConsortium || this.state.selectedCompany || this.state.currentCompany)\r\n      && this.state.poolName\r\n      && this.state.poolNameValid\r\n      && this.state.poolID\r\n      && (this.state.federallyRegulated === \"false\" || (this.state.federallyRegulated === \"true\" && this.state.regulatoryModeId !== 0 && this.state.selectedRegulatoryModes.length >= 0))\r\n      && this.state.selectionInterval\r\n      && this.state.calcType\r\n      && this.state.drugPoolSize\r\n      && this.state.alcoholPoolSize\r\n      && (this.props.IsConsortium || this.state.labAccount)\r\n      && (this.props.IsConsortium || this.state.panelID)\r\n      && this.state.useFileImportForPoolMembership !== \"\"\r\n      && this.state.primaryIDType !== \"\"\r\n      && (this.props.IsConsortium ? this.state.panelCode && this.state.panelCodeValid : true)\r\n  }\r\n\r\n  performSave = () => {\r\n    const pool: PoolCreate = {\r\n      IsNonDOT: this.state.federallyRegulated === \"false\" || !this.state.federallyRegulated,\r\n      AccountId: this.state.selectedCompany?.AccountID || this.state.currentCompany?.AccountID || 0,\r\n      PoolName: this.state.poolName,\r\n      PoolCode: this.state.poolID,\r\n      RegulatoryModeID: this.state.regulatoryModeId !== 0 ? this.state.regulatoryModeId : null,\r\n      SelectionInterval: this.state.selectionInterval,\r\n      DrugTarget: Number(this.state.drugPoolSize),\r\n      AlcoholTarget: Number(this.state.alcoholPoolSize),\r\n      PoolCalculationType: this.state.calcType,\r\n      ProviderMappingID: this.state.labAccounts ? this.state.labAccounts.find((account: LabAccount) => account.LabAccount === this.state.labAccount)?.ProviderMappingID || 0 : 0,\r\n      PanelID: this.state.panelID ? Number(this.state.panelID) : 0,\r\n      UseFileImportForPoolMembership: this.state.useFileImportForPoolMembership,\r\n      PrimaryIDType: this.state.primaryIDType,\r\n      IncludeCompaniesWithNoSelections: this.state.includeCompaniesWithNoSelections,\r\n      IsConsortium: this.props.IsConsortium,\r\n      PanelCode: this.props.IsConsortium ? this.state.panelCode : \"\",\r\n      RegulatoryModes: this.state.selectedRegulatoryModes.map(({ RegulatoryModeID }) => RegulatoryModeID),\r\n      RunOnlyByPortalAdmin: this.state.RunOnlyByPortalAdmin || this.props.IsConsortium\r\n    }\r\n\r\n    this.setState({ saving: true })\r\n\r\n    this.saveSubscription = PoolCreateObservable(pool).subscribe(\r\n      data => {\r\n        toast.success(data)\r\n        this.setState({ saving: false })\r\n        this.props.onSuccess()\r\n      },\r\n      error => {\r\n        this.setState({ saving: false })\r\n        toast.error(error?.errorData?.message || error.message)\r\n      }\r\n    )\r\n  }\r\n\r\n  onRegulatoryModeChange = (selected: RegulatoryMode[]) => {\r\n    const availableToSelectRegModes = []\r\n    const selectedRegModes = selected || []\r\n    const availableRegModes = this.state.regulatoryModes || []\r\n    let regulatoryModeId = 0\r\n    if (selectedRegModes.length > 0) {\r\n      regulatoryModeId = selectedRegModes[0].RegulatoryModeID\r\n    }\r\n\r\n    for (let i = 0; i < availableRegModes.length; i++) {\r\n      let is_selected = false;\r\n      const availRegMode = availableRegModes[i]\r\n      for (let j = 0; j < selectedRegModes.length; j++) {\r\n        const selectedRegMode = selectedRegModes[j];\r\n        if (availRegMode.RegulatoryModeID === selectedRegMode.RegulatoryModeID) {\r\n          is_selected = true\r\n          break\r\n        }\r\n      }\r\n      if (is_selected) {\r\n        continue\r\n      }\r\n      availableToSelectRegModes.push(availRegMode)\r\n    }\r\n    this.setState({ regulatoryModeId: regulatoryModeId, selectedRegulatoryModes: selectedRegModes, availableToSelectRegModes: availableToSelectRegModes })\r\n  }\r\n\r\n  handleRunOnlyByCompanyAdminChange = (event: React.ChangeEvent<HTMLInputElement>) => {\r\n    if(!this.state.RunOnlyByPortalAdmin){\r\n      return\r\n    }\r\n    const checked = event.target.checked\r\n    if(!checked){\r\n      return\r\n    }\r\n    this.setState({ RunOnlyByPortalAdmin: !checked })\r\n\r\n  }\r\n\r\n  handleRunOnlyByPortalAdminChange = (event: React.ChangeEvent<HTMLInputElement>) => {\r\n    if(this.state.RunOnlyByPortalAdmin){\r\n      return\r\n    }\r\n    const checked = event.target.checked\r\n    if(!checked){\r\n      return\r\n    }\r\n    this.setState({ RunOnlyByPortalAdmin: checked })\r\n  }\r\n\r\n  render() {\r\n    const { show, onHide, IsConsortium } = this.props\r\n    const isOnTrack = IsOnTrack()\r\n    const availableRegulatoryModes = this.state.regulatoryModes || []\r\n    const availableToSelectRegModes = this.state.availableToSelectRegModes\r\n    const selectedRegulatoryModes = this.state.selectedRegulatoryModes\r\n    const regulatoryModeId = this.state.regulatoryModeId\r\n    const regulatoryModeDisabled = (this.state.federallyRegulated === \"\") || (this.state.federallyRegulated === \"false\") || (availableRegulatoryModes.length == 0)\r\n    const runOnlyByPortalAdmin = this.state.RunOnlyByPortalAdmin\r\n    const isPortalAdmin: boolean = this.props.isPortalAdmin || false\r\n\r\n    let calcTypeMark = \"\"\r\n    switch (this.state.calcType) {\r\n      case \"Rate\":\r\n        calcTypeMark = \"%\"\r\n        break\r\n      case \"Fixed\":\r\n        calcTypeMark = \"#\"\r\n        break\r\n    }\r\n    let primaryIdType = \"SSN\"\r\n    if ((this.state.primaryIDTypes) && (this.state.primaryIDTypes[0])) {\r\n      primaryIdType = this.state.primaryIDTypes[0].PrimaryIDType\r\n    }\r\n    if (this.state.selectedCompany?.PrimaryIDType) {\r\n      primaryIdType = this.state.selectedCompany?.PrimaryIDType\r\n    }\r\n    if (this.state.primaryIDType) {\r\n      primaryIdType = this.state.primaryIDType\r\n    }\r\n\r\n    const companyName = this.state.selectedCompany?.Name || this.state.currentCompany?.Name || \"\"\r\n    return <Modal backdrop=\"static\" centered show={show} onHide={onHide} size=\"lg\">\r\n      <Modal.Header closeButton>\r\n        <Modal.Title>{IsConsortium ? \"Create New Consortium\" : \"Create New Pool\"}</Modal.Title>\r\n      </Modal.Header>\r\n      <Modal.Body>\r\n        <Form>\r\n          {!IsConsortium && <Form.Row className=\"form-group required\">\r\n            <Form.Label column sm={3} htmlFor=\"company\">Company</Form.Label>\r\n            {this.props.isCompanyAdmin && <Col sm={9}>\r\n              {this.state.companiesLoading && <div className=\"py-2\"><Spinner animation=\"border\" size=\"sm\" variant=\"secondary\" /></div>}\r\n              {!this.state.companiesLoading && <Form.Control type=\"text\" disabled={true} className=\"bg-white\" defaultValue={companyName} />}\r\n            </Col>}\r\n            {this.props.isPortalAdmin && <Col sm={9}>\r\n              <CompanyInput onChange={selected => this.setState({ selectedCompany: selected[0] })} placeholder=\"Choose a company...\" />\r\n            </Col>}\r\n          </Form.Row>}\r\n          <Form.Row className=\"form-group required\">\r\n            <Form.Label column sm={3} htmlFor=\"poolName\">Pool Name</Form.Label>\r\n            <Col sm={9}>\r\n              <Form.Control id=\"poolName\" type=\"text\" maxLength={60} onChange={this.handlePoolNameChange} isInvalid={!this.state.poolNameValid} />\r\n              <Form.Control.Feedback type=\"invalid\">Pool Name should contain at least 8 characters</Form.Control.Feedback>\r\n            </Col>\r\n          </Form.Row>\r\n          <Form.Row className=\"form-group required\">\r\n            <Form.Label column sm={3} htmlFor=\"poolID\">Pool ID</Form.Label>\r\n            <Col sm={9}>\r\n              <Form.Control id=\"poolID\" type=\"text\" maxLength={10} onChange={this.handlePoolIDChange} />\r\n            </Col>\r\n          </Form.Row>\r\n          <Form.Row className=\"form-group required\">\r\n            <Form.Label column sm={3} htmlFor=\"federallyRegulated\">Federally Regulated</Form.Label>\r\n            <Col sm={9}>\r\n              <Form.Control id=\"federallyRegulated\" as=\"select\" onChange={this.handleFederallyRegulatedChange}>\r\n                <option value=\"\">Select</option>\r\n                <option value=\"true\">Yes</option>\r\n                <option value=\"false\">No</option>\r\n              </Form.Control>\r\n            </Col>\r\n          </Form.Row>\r\n          {this.state.federallyRegulated === \"true\" && <Form.Row className=\"form-group required\">\r\n            <Form.Label column sm={3} htmlFor=\"regulatoryMode\">Regulatory Mode(s):</Form.Label>\r\n            <Col sm={9}>\r\n              <LoadingIndicatorWrapper loading={this.state.regulatoryModesLoading}>\r\n                <Typeahead id=\"regulatoryModeTypeahead\"\r\n                  labelKey=\"Name\"\r\n                  filterBy={(option, props) => props.selected.length > 0 || option.Name.toLowerCase().indexOf(props.text.toLowerCase()) !== -1}\r\n                  onChange={(selected) => { this.onRegulatoryModeChange(selected) }}\r\n                  options={availableToSelectRegModes}\r\n                  isInvalid={selectedRegulatoryModes.length === 0}\r\n                  disabled={regulatoryModeDisabled}\r\n                  emptyLabel=\"No Regulatory Modes Found\"\r\n                  placeholder=\"Select\"\r\n                  multiple\r\n                  selected={selectedRegulatoryModes ? selectedRegulatoryModes : []}\r\n                />\r\n              </LoadingIndicatorWrapper>\r\n            </Col>\r\n          </Form.Row>}\r\n          <Form.Row className=\"form-group required\">\r\n            <Form.Label column sm={3} htmlFor=\"selectionInterval\">Selection Interval</Form.Label>\r\n            <Col sm={9}>\r\n              <LoadingIndicatorWrapper loading={this.state.selectionIntervalsLoading}>\r\n                <Form.Control id=\"selectionInterval\" as=\"select\" onChange={this.handleIntervalChange}>\r\n                  <option value=\"\">Select</option>\r\n                  {this.state.selectionIntervals && this.state.selectionIntervals.map((interval: string) => <option value={interval} key={interval}>{interval}</option>)}\r\n                </Form.Control>\r\n              </LoadingIndicatorWrapper>\r\n            </Col>\r\n          </Form.Row>\r\n          <Form.Row className=\"form-group required\">\r\n            <Form.Label column sm={3} htmlFor=\"poolCalcType\">Pool Calculation Type</Form.Label>\r\n            <Col sm={9}>\r\n              <Form.Control id=\"poolCalcType\" as=\"select\" onChange={this.handleCalcTypeChange}>\r\n                <option value=\"\">Select</option>\r\n                <option value=\"Rate\">Annual Percentage</option>\r\n                <option value=\"Fixed\">Fixed Number of Selections for Program Year</option>\r\n              </Form.Control>\r\n            </Col>\r\n          </Form.Row>\r\n          <Form.Row className=\"form-group required\">\r\n            <Form.Label column sm={3} htmlFor=\"drug\">Drug</Form.Label>\r\n            <Col sm={9}>\r\n              <InputGroup>\r\n                <Form.Control id=\"drug\" type=\"text\" value={this.state.drugPoolSize} onChange={this.handleDrugChange} />\r\n                <InputGroup.Append hidden={!calcTypeMark}><InputGroup.Text>{calcTypeMark}</InputGroup.Text></InputGroup.Append>\r\n              </InputGroup>\r\n            </Col>\r\n          </Form.Row>\r\n          <Form.Row className=\"form-group required\">\r\n            <Form.Label column sm={3} htmlFor=\"alcohol\">Alcohol</Form.Label>\r\n            <Col sm={9}>\r\n              <InputGroup>\r\n                <Form.Control id=\"alcohol\" type=\"text\" value={this.state.alcoholPoolSize} onChange={this.handleAlcoholChange} />\r\n                <InputGroup.Append hidden={!calcTypeMark}><InputGroup.Text>{calcTypeMark}</InputGroup.Text></InputGroup.Append>\r\n              </InputGroup>\r\n            </Col>\r\n          </Form.Row>\r\n          {!IsConsortium &&\r\n            <Form.Row className=\"form-group required\">\r\n              <Form.Label column sm={3} htmlFor=\"labAccount\">Select your Lab</Form.Label>\r\n              <Col sm={9}>\r\n                <LoadingIndicatorWrapper loading={this.state.labAccountLoading}>\r\n                  <Form.Control id=\"labAccount\" as=\"select\" onChange={this.handleLabChange}>\r\n                    <option value=\"\">Select</option>\r\n                    {this.state.labAccounts && this.state.labAccounts.map((labAccount: LabAccount) => <option value={labAccount.LabAccount} key={labAccount.LabAccount}>{labAccount.Description}</option>)}\r\n                  </Form.Control>\r\n                </LoadingIndicatorWrapper>\r\n              </Col>\r\n            </Form.Row>}\r\n          {!IsConsortium &&\r\n            <Form.Row className=\"form-group required\">\r\n              <Form.Label column sm={3} htmlFor=\"panel\">Panel</Form.Label>\r\n              <Col sm={9}>\r\n                <LoadingIndicatorWrapper loading={this.state.panelsLoading}>\r\n                  <Form.Control id=\"panel\" as=\"select\" onChange={this.handlePanelChange} value={this.state.panelID}>\r\n                    <option value=\"\">Select</option>\r\n                    {this.state.labPanels && this.state.labPanels\r\n                      .filter(((labPanel: LabPanel) => (labPanel.DOT && this.state.federallyRegulated === \"true\") || (!labPanel.DOT && this.state.federallyRegulated === \"false\")))\r\n                      .map((labPanel: LabPanel) => <option value={labPanel.PanelID} key={labPanel.PanelID}>{labPanel.Description}</option>)}\r\n                  </Form.Control>\r\n                </LoadingIndicatorWrapper>\r\n              </Col>\r\n            </Form.Row>}\r\n          {IsConsortium && <Form.Row className=\"form-group required\">\r\n            <Form.Label column sm={3} htmlFor=\"poolPanelCode\">Panel Code</Form.Label>\r\n            <Col sm={9}>\r\n              <Form.Control id=\"poolPanelCode\" type=\"text\" maxLength={60} onChange={this.handlePanelCodeChange} isInvalid={!this.state.panelCodeValid} />\r\n              <Form.Control.Feedback type=\"invalid\">Panel Code should contain at least 2 characters</Form.Control.Feedback>\r\n            </Col>\r\n          </Form.Row>}\r\n          <Form.Row className=\"form-group required\">\r\n            <Form.Label column sm={3} htmlFor=\"poolMembershipType\">Pool Membership Type</Form.Label>\r\n            <Col sm={9}>\r\n              <Form.Control id=\"poolMembershipType\" as=\"select\" value={this.state.useFileImportForPoolMembership} onChange={this.handlePoolMembershipTypeChange}>\r\n                {<option value=\"\">Select</option>}\r\n                {<option value=\"true\">File Import</option>}\r\n                <option value=\"false\">Criteria</option>\r\n              </Form.Control>\r\n            </Col>\r\n          </Form.Row>\r\n          {IsConsortium &&\r\n            <Form.Row>\r\n              <Form.Label column sm={3} htmlFor=\"includeNoSelection\">Include companies with no selection</Form.Label>\r\n              <Col sm={9}><Checkbox id=\"includeNoSelection\" name=\"IncludeNoSelection\" label=\"\" checked={this.state.includeCompaniesWithNoSelections} className=\"pt-2 ml-3\" onChange={(e) => this.setState({ includeCompaniesWithNoSelections: e.target.checked })} /></Col>\r\n            </Form.Row>}\r\n          {!isOnTrack && <Form.Row className=\"form-group required\">\r\n            <Form.Label column sm={3} htmlFor=\"primaryIDType\">Pool Report ID Type</Form.Label>\r\n            <Col sm={9}>\r\n              <LoadingIndicatorWrapper loading={this.state.primaryIDTypesLoading}>\r\n                <Form.Control id=\"primaryIDType\" as=\"select\" value={primaryIdType} onChange={this.handlePrimaryIDTypeChange}>\r\n                  {this.state.primaryIDTypes?.map(item => <option value={item.PrimaryIDType} key={item.PrimaryIDType}>{item.PrimaryIDType}</option>)}\r\n                </Form.Control>\r\n              </LoadingIndicatorWrapper>\r\n            </Col>\r\n          </Form.Row>}\r\n          {!isOnTrack && !IsConsortium && <Form.Row>\r\n            <Form.Label column xs={6} md={4}>WHO CAN RUN POOL</Form.Label>\r\n            <Col>\r\n              <Checkbox id=\"runOnlyByCompanyAdmin\" name=\"RunOnlyByCompanyAdmin\" label=\"Company Administrator Only\" checked={!runOnlyByPortalAdmin}  disabled={!isPortalAdmin} className=\"pt-2 ml-3\" onChange={this.handleRunOnlyByCompanyAdminChange} />\r\n            </Col>\r\n            <Col>\r\n              <Checkbox id=\"runOnlyByPortalAdmin\" name=\"RunOnlyByPortalAdmin\" label=\"Portal Administrator Only\" checked={runOnlyByPortalAdmin}  disabled={!isPortalAdmin} className=\"pt-2 ml-3\" onChange={this.handleRunOnlyByPortalAdminChange} />\r\n            </Col>\r\n          </Form.Row>}\r\n\r\n        </Form>\r\n      </Modal.Body>\r\n      <Modal.Footer>\r\n        <Button variant=\"secondary\" onClick={onHide}>CANCEL</Button>\r\n        <Button variant=\"primary\" onClick={this.performSave} disabled={!this.isValid()}>SUBMIT</Button>\r\n      </Modal.Footer>\r\n    </Modal>\r\n  }\r\n}\r\n\r\nfunction mapStateToProps(state: AppState): AddPoolModalAuthProps {\r\n  const companyAdmin = isCompanyAdmin(state)\r\n  const portalAdmin = isPortalAdmin(state)\r\n  const currentCompany = companyAdmin ? GetSelectedAssignedClinic(state) : undefined\r\n  return {\r\n    isCompanyAdmin: companyAdmin,\r\n    isPortalAdmin: portalAdmin,\r\n    currentCompany: currentCompany\r\n  }\r\n}\r\nconst ConnectedAddPoolModal = connect(mapStateToProps, null)(AddPoolModal)\r\nexport default ConnectedAddPoolModal","import { Observable } from \"rxjs\"\r\nimport PoolStatisticsDetails from \"./RandomsModel/PoolStatisticsDetails\"\r\nimport { ObservableFromFetch } from \"../ObservableFromFetch\"\r\n\r\nexport default function PoolStatisticsDetailsGetObservable(poolId: number, companyId?: number): Observable<PoolStatisticsDetails> {\r\n  const requestBody: string = new URLSearchParams({\r\n    poolId: poolId.toString(),\r\n    companyId: (companyId || 0).toString()\r\n  }).toString()\r\n\r\n  return ObservableFromFetch<PoolStatisticsDetails>(\"RandomTest/GetPoolStatisticsDetails?\" + requestBody)\r\n}\r\n\r\nexport function PoolStatisticsDetailsByProgram(poolId: number, poolProgramId?: number): Observable<PoolStatisticsDetails> {\r\n  const requestBody: string = new URLSearchParams({\r\n    poolId: poolId.toString(),\r\n    poolProgramId: (poolProgramId || 0).toString()\r\n  }).toString()\r\n\r\n  return ObservableFromFetch<PoolStatisticsDetails>(\"RandomTest/PoolStatisticsDetailsByProgram?\" + requestBody)\r\n}\r\n","export default function FormatTimestampFileName(subject: string, extension: string, date: Date) {\r\n  const parts = [\r\n    subject,\r\n    (\"0\" + (date.getMonth() + 1)).slice(-2),\r\n    (\"0\" + (date.getDate())).slice(-2),\r\n    date.getFullYear(),\r\n    (\"0\" + (date.getHours())).slice(-2),\r\n    (\"0\" + (date.getMinutes())).slice(-2),\r\n    (\"0\" + (date.getSeconds())).slice(-2)\r\n  ]\r\n  return parts.join(\"_\") + \".\" + extension;\r\n}\r\n","import { Observable } from \"rxjs\"\r\nimport RandomSelectionRow from \"./RandomsModel/RandomSelectionRow\"\r\nimport { ObservableFromFetch } from \"../ObservableFromFetch\"\r\nimport { AccountTypeID } from \"../../config/Constants\"\r\n\r\nexport default function RandomSelectionListGetObservable(poolId: number, poolSelectionId: number, accountID: number): Observable<RandomSelectionRow[]> {\r\n  const params: string = JSON.stringify({\r\n    Extra: \"false\",\r\n    PageSize: 25,\r\n    PoolID: poolId,\r\n    AccountID: accountID,\r\n    PoolMembersID: [],\r\n    PoolSelectionID: poolSelectionId,\r\n    ProfileAccountTypeID: AccountTypeID\r\n  })\r\n\r\n  return ObservableFromFetch<RandomSelectionRow[]>(\"RandomTest/GetRandomSelectionList\", params)\r\n}\r\n","import { Observable } from \"rxjs\"\r\nimport { AccountTypeID } from \"../../config/Constants\"\r\nimport { ObservableFromFetch } from \"../ObservableFromFetch\"\r\n\r\nexport default function RandomSelectionListCsvGetObservable(poolId: number, poolSelectionId: number, poolName: string, accountId: number): Observable<string> {\r\n  const params: string = JSON.stringify({\r\n    Extra: \"false\",\r\n    PageSize: 25,\r\n    PoolID: poolId,\r\n    AccountID: accountId,\r\n    PoolMembersID: [],\r\n    PoolName: poolName,\r\n    PoolSelectionID: poolSelectionId,\r\n    ProfileAccountTypeID: AccountTypeID\r\n  })\r\n\r\n  return ObservableFromFetch<string>(\"RandomTest/RandomSelectionListExport\", params)\r\n}\r\n\r\n","import { Observable } from \"rxjs\"\r\nimport { AccountTypeID } from \"../../config/Constants\"\r\nimport { ObservableFromFetch } from \"../ObservableFromFetch\"\r\n\r\nexport default function RandomSelectionListPrintGetObservable(poolId: number, poolSelectionId: number, accountID: number): Observable<string> {\r\n  const params: string = JSON.stringify({\r\n    ClientDetails: {},\r\n    GetRandomSelectionList: {\r\n      Extra: \"false\",\r\n      PageSize: 25,\r\n      PoolID: poolId,\r\n      PoolMembersID: [],\r\n      PoolSelectionID: poolSelectionId,\r\n      ProfileAccountID: accountID,\r\n      ProfileAccountTypeID: AccountTypeID\r\n    }\r\n  })\r\n\r\n  return ObservableFromFetch<string>(\"WorkforceReport/RandomSelectionListReport\", params)\r\n}\r\n","import { Observable } from \"rxjs\"\r\nimport { ObservableFromFetch } from \"../ObservableFromFetch\"\r\n\r\nexport default function RandomSelectionListPrintLettersGetObservable(poolId: number, poolSelectionId: number, accountId: number): Observable<string> {\r\n  const params: string = JSON.stringify({\r\n    CompanyID: accountId > 0 ? accountId.toString() : \"\",\r\n    Extra: false,\r\n    LocationID: \"\",\r\n    PageSize: 25,\r\n    PoolID: poolId,\r\n    PoolSelectionID: poolSelectionId,\r\n    RegionID: \"\",\r\n    SpecificAccount: true\r\n  })\r\n\r\n  return ObservableFromFetch<string>(\"WorkforceRandomTest/PrintNotificationLetterOfRandom\", params)\r\n}\r\n","import { APIError } from \"../api/ObservableFromFetch\"\r\n\r\nexport default function FormatError(error: Error | APIError): string {\r\n    return (error as APIError)?.errorData?.message || error.message\r\n}\r\n","import * as React from \"react\"\r\n\r\nimport { Button, Col, Container, Modal, Row } from \"react-bootstrap\"\r\n\r\nimport ActionButton from \"./ActionButton\"\r\nimport WarningImage from \"../assets/images/warning.png\"\r\n\r\ninterface ConfirmationModalProps {\r\n  show: boolean\r\n  showImage?: boolean\r\n  title?: string\r\n  textTitle?: string\r\n  text?: string\r\n  cancelButtonText?: string\r\n  confirmButtonText?: string\r\n  children?: React.ReactNode\r\n  size?: \"lg\"\r\n  disableConfirmButton?: boolean\r\n  spinConfirmButton?: boolean\r\n  disableConfirmOnSpin?: boolean\r\n  showCancelButton?: boolean\r\n  showCloseButton?: boolean\r\n  onHide: () => void\r\n  onConfirm: () => void\r\n}\r\n\r\nfunction ConfirmationModal({\r\n  show,\r\n  showImage = true,\r\n  title = \"CONFIRM\",\r\n  textTitle = \"\",\r\n  text = \"\",\r\n  cancelButtonText = \"CANCEL\",\r\n  confirmButtonText = \"CONFIRM\",\r\n  children = null,\r\n  size = undefined,\r\n  disableConfirmButton = false,\r\n  spinConfirmButton = false,\r\n  disableConfirmOnSpin = false,\r\n  showCancelButton = true,\r\n  showCloseButton = true,\r\n  onHide,\r\n  onConfirm,\r\n}: ConfirmationModalProps) {\r\n  return (\r\n    <Modal backdrop=\"static\" centered show={show} onHide={onHide} size={size}>\r\n      <Modal.Header closeButton={showCloseButton}>\r\n        <Modal.Title className=\"h5\">{title}</Modal.Title>\r\n      </Modal.Header>\r\n      <Modal.Body>\r\n        {children || (\r\n          <Container fluid>\r\n            <Row>\r\n              {showImage && (\r\n                <Col sm={2} className=\"d-flex justify-content-center align-items-center\">\r\n                  <img src={WarningImage} alt=\"Warning\" width=\"50\" />\r\n                </Col>\r\n              )}\r\n              <Col className=\"d-flex\">\r\n                {textTitle && (\r\n                  <h5 className=\"my-auto pt-0\" style={{ whiteSpace: \"pre-wrap\" }}>\r\n                    {textTitle}\r\n                  </h5>\r\n                )}\r\n              </Col>\r\n            </Row>\r\n            {text && (\r\n              <Row>\r\n                {showImage && <Col sm={2} />}\r\n                <Col>\r\n                  <p className=\"mb-1\">{text}</p>\r\n                </Col>\r\n              </Row>\r\n            )}\r\n          </Container>\r\n        )}\r\n      </Modal.Body>\r\n      <Modal.Footer>\r\n        {showCancelButton && (\r\n          <Button variant=\"secondary\" onClick={onHide} className=\"mr-auto fixed-w5\">\r\n            {cancelButtonText}\r\n          </Button>\r\n        )}\r\n        <ActionButton\r\n          variant=\"primary\"\r\n          onClick={onConfirm}\r\n          disabled={disableConfirmButton}\r\n          spin={spinConfirmButton}\r\n          disableOnSpin={disableConfirmOnSpin}\r\n          className=\"fixed-w5\"\r\n        >\r\n          {confirmButtonText}\r\n        </ActionButton>\r\n      </Modal.Footer>\r\n    </Modal>\r\n  )\r\n}\r\n\r\nexport default ConfirmationModal\r\n","export default \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAYAAADDPmHLAAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAABIAAAASABGyWs+AAAACXZwQWcAAACAAAAAgAAw4TGaAAAUrklEQVR42u2de5BcVZ3HP+fc7p6envdkkkySzSQhD0NIAklIwAALItZquSwRxFVxWRRrdQtRQEV8LJbKClqBrLu6Vbt/8AyvqIWu7OqurCy1lqigK+Eh8g4hJJlXpmf6de895/z2j57ETJLJ9Mx0z+2Z9Cf1SyrTPff+zu987+887jn3Qo0aNWrUqFGjRo0aNWrUqHFi4B67dJH77y2LovYjSlTUDkw18tznFqLcDcxqu4xsdzOvviRyYKAHL3Y/XvJWfeFP3ojax6nkhBKA7Lz2LOKJf2PB4nbqNex7GV75A3T3ggkA1yt1jRfpix/7RdS+ThU6agemCnnmc6sIcv9BPNkOHodMaVAKUBDaDpUd+LF76B2rovZ3qjghMoDs/KxHOPR/wBpa50NdI+hGyPgQ+jD4Jux/BoZ6IAihzntaUrPX6YsfsVH7XmlOiAwgmGtQeg0oCBqh0A7pfLHyUdC6GFZfBiedX8wGhWAN4dA1Ufs9Fcz4DOCeuaFTif8cNmwjuRSsQHDg2F+u64D0fnj6IYjrA9Iyf5W++Kf7oi5DJZn5GcDjRrRuIz4bwnD0ygfwe6GpHTpXQiFswx+4MWr3K82MFoD7w43rlVZXojzQbWAGATm+hQOw5GzQHgwNXul2nLM+6nJUkhktABXXW1E6IbFOxO9DSv3jMsiyc1GBSahc/9aoy1FJZqwA3Mt/vwWlzkMnIRRwZsyL/5DZAOYuh/pWyBbOczvO3hJ1eSrFjOwEule/Ua9i7jmsWSymA9ITmdxTUAhRTzyINNa9RsuCVfrSn+WjLlu5mZkZIO59GvRiUS2QL6HdP6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sZ8wSoYuXjjKAFkclZbPVuH3bspadxco+oJe/diFjTpXGFAw8gnZY0QwH9+cqm69ZH93rcXteIKmaj9rlEmJJfGmk62/nS/99i1y+y52146dGWPEMDeA6F6YlfOM5l0cESmqDHNCdO9wRO7ct6fndw0ohkYIYA9B3yefrPg+ca8jsjcqJ2uUT58Y15/6s2C9+bAyK1xIwQw/KG681fph694S+PGcRy/RpVz56/SDwPqSAGMGAb2ZoqrZL/zaP/3TYyeKpjVrFkZzMTo+c6j/d8H6MmM3Bc5IgP05SyAe603zFx815vX/+Cyzn9RjkTU6q0xcUQTXHzXvutf6w0zgDtSACPWQLfWaxKe8tIFF3tjwAw9vrvw/F+sajgjDqmoJzRqNn7LOen7ywf2feEXrxZ+BaSXzornPY3ZPfBHEYyYGVrcHlMeKv5yf5gC2oGO+pjq+JszWy760NrGzQtaYos8mNJXmpQNdVRxi/8/8ueHlo0d77PDPz8COfTX8P9l5IeHf368z476eWlYKOxJm13bd2Z+8a+/TP8wb6QX6AX6V86O55RS4e+7g0NHPKoIXa0xrztj6wpGGoHmYaun2FxoJrmlvEbFEYqTPQbIA4PAYCquMguaY/6LfeGI27pHzQT25awkYyosGMkNHygAEsPfVdQEUO0cbAQMxbrLAYVUXIV9OXtULjlmZcY9dNJTOhdK3BYfSlO7+qcXh7JATBM21emwEDqXN0e/MOF4Faq0QgPayaHKP+pmQo2q42AdiVY4Bc4JbrSexFhX9OEpv3b1Ty/ksH9HvWjHU6k1AUwvapm6Ro0aNWrUqFGjRo0aNWocyf8DDIexNKByaU0AAAAldEVYdGRhdGU6Y3JlYXRlADIwMTAtMDItMTBUMTI6MDE6NTctMDY6MDDljyFVAAAAJXRFWHRkYXRlOm1vZGlmeQAyMDA5LTAxLTA0VDE0OjI2OjQwLTA2OjAwQlNz5QAAAABJRU5ErkJggg==\"","import { ObservableFromFetch } from \"../ObservableFromFetch\"\r\nimport { format } from \"date-fns\"\r\n\r\nexport default function GovPoolCheckTestsExistObservable(poolID: number, date: Date) {\r\n  const params: string = JSON.stringify({\r\n    poolId: poolID.toString(),\r\n    date: format(date, \"MM/dd/yyyy\")\r\n  })\r\n\r\n  return ObservableFromFetch<boolean>(\"GovPool/CheckTestsExist\", params)\r\n}\r\n","import * as React from \"react\"\r\nimport DatePicker from 'react-datepicker'\r\nimport 'react-datepicker/dist/react-datepicker.css'\r\nimport \"../../../assets/scss/RandomSchedulingExclusions.scss\"\r\nimport DaysToExclude from \"../../../api/Randoms/GovPoolModel/DaysToExclude\"\r\nimport { parseISO, format } from \"date-fns\"\r\nimport { Button, Col, Container, Form, Modal, ModalDialog, Row, Spinner } from \"react-bootstrap\"\r\nimport Checkbox from \"../../Checkbox\"\r\nimport { ChangeEvent } from \"react\"\r\nimport ConfirmationModal from \"../../ConfirmationModal\"\r\nimport { Subscription } from \"rxjs\"\r\nimport { toast } from \"react-toastify\"\r\nimport GovPoolCheckTestsExistObservable from \"../../../api/Randoms/GovPoolCheckTestsExist\"\r\nimport Draggable from 'react-draggable'\r\n\r\nexport interface DaysToExcludeExt extends DaysToExclude {\r\n  removed?: boolean\r\n  DateExcludeDt?: number\r\n}\r\n\r\ninterface RandomSchedulingExclusionsModalProps {\r\n  poolID: number\r\n  daysToExclude: DaysToExcludeExt[]\r\n  onCancel: () => void\r\n  onSave: (list: DaysToExcludeExt[]) => void\r\n}\r\n\r\ninterface RandomSchedulingExclusionsModalState {\r\n  daysToExclude: DaysToExcludeExt[]\r\n  weekdaysToExclude: number[]\r\n  selectedDate?: Date\r\n  selectedDayToExclude?: DaysToExcludeExt\r\n  selectedDayDescription?: string\r\n  selectedDayGender?: string\r\n  selectedDayPoolID?: number\r\n  showRemoveExistingEventsConfirmation: boolean\r\n  showAllGroupsConfirmation: boolean\r\n  dateCheckInProgress: boolean\r\n}\r\n\r\nexport class DraggableModalDialog extends React.Component {\r\n  render() {\r\n      return <Draggable handle=\".modal-header\"><ModalDialog {...this.props} /> \r\n </Draggable>\r\n  }\r\n}\r\n\r\nfunction buildDaysToExcludeList(daysToExclude: DaysToExcludeExt[]) {\r\n  const parseISODate = (date: string) => {\r\n    const parsed = parseISO(date)\r\n    if (parsed) {\r\n      return new Date(parsed.getFullYear(), parsed.getMonth(), parsed.getDate())\r\n    }\r\n    return undefined\r\n  }\r\n\r\n  return daysToExclude.map(item => ({\r\n    ...item,\r\n    DateExcludeDt: item.DateExcludeDt || (item.DateExclude ? parseISODate(item.DateExclude!)?.getTime() : undefined)\r\n  } as DaysToExcludeExt))\r\n}\r\n\r\nfunction buildWeekdaysToExcludeList(daysToExclude: DaysToExcludeExt[]) {\r\n  return daysToExclude.filter(item => item.DayOfWeekID && !item.removed).map(item => item.DayOfWeekID!)\r\n}\r\n\r\nexport default class RandomSchedulingExclusionsModal extends React.PureComponent<RandomSchedulingExclusionsModalProps, RandomSchedulingExclusionsModalState> {\r\n  state: RandomSchedulingExclusionsModalState = {\r\n    daysToExclude: buildDaysToExcludeList(this.props.daysToExclude),\r\n    weekdaysToExclude: buildWeekdaysToExcludeList(this.props.daysToExclude),\r\n    showRemoveExistingEventsConfirmation: false,\r\n    showAllGroupsConfirmation: false,\r\n    dateCheckInProgress: false\r\n  }\r\n  dateToAdd?: Date\r\n  checkTestEventSubscription?: Subscription\r\n\r\n  componentWillUnmount() {\r\n    this.checkTestEventSubscription && this.checkTestEventSubscription.unsubscribe()\r\n  }\r\n\r\n  componentDidUpdate(prevProps: RandomSchedulingExclusionsModalProps) {\r\n    if (this.props.daysToExclude !== prevProps.daysToExclude) {\r\n      this.setState({\r\n        daysToExclude: buildDaysToExcludeList(this.props.daysToExclude),\r\n        weekdaysToExclude: buildWeekdaysToExcludeList(this.props.daysToExclude)\r\n      })\r\n    }\r\n  }\r\n\r\n  handleExclusionDateDescriptionChange = (e: React.ChangeEvent<HTMLInputElement>) => {\r\n    const value = e.target.value\r\n\r\n    if (this.state.selectedDayToExclude) {\r\n      this.state.selectedDayToExclude.Description = value\r\n    }\r\n    this.setState({ selectedDayDescription: value })\r\n  }\r\n\r\n  handleExclusionDateGenderChange = (e: ChangeEvent<HTMLInputElement>) => {\r\n    const value = e.target.checked ? e.target.value : undefined\r\n\r\n    if (this.state.selectedDayToExclude) {\r\n      this.state.selectedDayToExclude.Gender = value\r\n    }\r\n    this.setState({ selectedDayGender: value })\r\n  }\r\n\r\n  handleExclusionDateAllGroupsChange = (e: ChangeEvent<HTMLInputElement>) => {\r\n    if (e.target.checked) {\r\n      this.setState({ showAllGroupsConfirmation: true })\r\n    } else {\r\n      this.setAllGroups(false)\r\n    }\r\n  }\r\n\r\n  setAllGroups = (checked: boolean) => {\r\n    const value = checked ? undefined : this.props.poolID\r\n\r\n    if (this.state.selectedDayToExclude) {\r\n      this.state.selectedDayToExclude.PoolID = value\r\n    }\r\n    this.setState({\r\n      selectedDayPoolID: value,\r\n      showAllGroupsConfirmation: false\r\n    })\r\n  }\r\n\r\n  handleDateEvent = (date: Date | [Date, Date] | null, event: React.SyntheticEvent<any> | undefined) => {\r\n    if (!date || !(date instanceof Date)) return\r\n    if (!event) {\r\n      // Keyboard move\r\n      let dayToExclude = this.getDayToExclude(date)\r\n      this.setState({\r\n        selectedDate: date,\r\n        selectedDayToExclude: dayToExclude,\r\n        selectedDayDescription: dayToExclude?.Description,\r\n        selectedDayGender: dayToExclude?.Gender,\r\n        selectedDayPoolID: dayToExclude?.PoolID\r\n      })\r\n    } else if (event.type === 'click') {\r\n      // Mouse click\r\n      this.toggleDayExclusion(date)\r\n    } else if (event.type === 'keydown' && event.nativeEvent instanceof KeyboardEvent && (event.nativeEvent as KeyboardEvent).code === \"Space\") {\r\n      // Space key down\r\n      this.toggleDayExclusion(date)\r\n    }\r\n  }\r\n\r\n  toggleDayExclusion = (date: Date) => {\r\n    // Do not handle dates covered by weekday exclusion\r\n    if (this.state.weekdaysToExclude.includes(date.getDay() + 1)) return\r\n\r\n    let dayToExclude = this.getDayToExclude(date)\r\n    if (!dayToExclude) {\r\n      this.dateToAdd = date\r\n      this.setState({ dateCheckInProgress: true })\r\n      this.checkTestEventSubscription = GovPoolCheckTestsExistObservable(this.props.poolID, date).subscribe(\r\n        result => result\r\n          ? this.setState({ showRemoveExistingEventsConfirmation: true, dateCheckInProgress: false })\r\n          : this.addDayToExclude(),\r\n        error => {\r\n          this.setState({ dateCheckInProgress: false })\r\n          toast.error(error?.errorData?.message || error.message)\r\n        }\r\n      )\r\n      return\r\n    }\r\n    if (this.state.selectedDate?.getTime() !== date.getTime()) {\r\n      // Click on non-selected exclusion day - just select this day\r\n      this.setState({\r\n        selectedDate: date,\r\n        selectedDayToExclude: dayToExclude,\r\n        selectedDayDescription: dayToExclude.Description,\r\n        selectedDayGender: dayToExclude.Gender,\r\n        selectedDayPoolID: dayToExclude.PoolID\r\n      })\r\n      return\r\n    }\r\n\r\n    // Click on already selected exclusion date - remove the exclusion date\r\n    dayToExclude.removed = true\r\n\r\n    this.setState({\r\n      daysToExclude: [...this.state.daysToExclude],\r\n      selectedDate: date,\r\n      selectedDayToExclude: undefined,\r\n      selectedDayDescription: undefined,\r\n      selectedDayGender: undefined,\r\n      selectedDayPoolID: undefined\r\n    })\r\n  }\r\n\r\n  addDayToExclude = () => {\r\n    // Click on day without exclusion date - Add exclusion date\r\n    if (this.dateToAdd) {\r\n      const dayToExclude: DaysToExcludeExt = {\r\n        DaysToExcludeID: 0,\r\n        ImplementationID: 0,\r\n        AccountID: 0,\r\n        PoolID: this.props.poolID,\r\n        DateExclude: format(this.dateToAdd, \"yyyy-MM-dd'T'HH:mm:ss\"),\r\n        DateExcludeDt: new Date(this.dateToAdd.getFullYear(), this.dateToAdd.getMonth(), this.dateToAdd.getDate()).getTime()\r\n      }\r\n      this.dateToAdd = undefined\r\n      this.setState({\r\n        selectedDate: this.dateToAdd,\r\n        daysToExclude: [...this.state.daysToExclude, dayToExclude],\r\n        selectedDayToExclude: dayToExclude,\r\n        selectedDayDescription: dayToExclude.Description,\r\n        selectedDayGender: dayToExclude.Gender,\r\n        selectedDayPoolID: dayToExclude.PoolID,\r\n        showRemoveExistingEventsConfirmation: false,\r\n        dateCheckInProgress: false\r\n      })\r\n    } else {\r\n      this.setState({\r\n        showRemoveExistingEventsConfirmation: false,\r\n        dateCheckInProgress: false\r\n      })\r\n    }\r\n  }\r\n\r\n  getDayToExclude = (date: Date) => {\r\n    const dateSeconds = date.getTime()\r\n    return this.state.daysToExclude.find(item => item.DateExcludeDt === dateSeconds && !item.removed)\r\n  }\r\n\r\n  render() {\r\n    const datesExcluded: { [id: number]: DaysToExcludeExt } = Object.assign({}, ...this.state.daysToExclude.filter(item => item.DateExcludeDt).map((x) => ({ [x.DateExcludeDt!]: x })))\r\n\r\n    const dayClassName = (date: Date) => {\r\n      if (this.state.weekdaysToExclude.includes(date.getDay() + 1)) {\r\n        return \"excluded-day weekday\"\r\n      }\r\n      const excludedDate = datesExcluded[date.getTime()]\r\n      if (excludedDate && !excludedDate.removed) {\r\n        return (excludedDate.PoolID ?? undefined) === undefined ? \"excluded-day all-groups\" : \"excluded-day\"\r\n      }\r\n      return null\r\n    }\r\n\r\n    const { onCancel, onSave } = this.props\r\n    const classNameDisabled = this.state.selectedDayToExclude ? \"\" : \" disabled\"\r\n\r\n    return <>\r\n      <Modal dialogAs={DraggableModalDialog} backdrop=\"static\" centered show onHide={onCancel} size=\"sm\" className=\"RandomSchedulingExclusionsModal\">\r\n        <Modal.Header>\r\n          <Modal.Title>Dates to Exclude</Modal.Title>\r\n        </Modal.Header>\r\n        <Modal.Body>\r\n          <Form>\r\n            <Row className=\"text-center legend\">\r\n              <Col>\r\n                <Form.Label className=\"pr-2\">This Group</Form.Label>\r\n                <Form.Label className=\"legend-item this-group\">&nbsp;</Form.Label>\r\n              </Col>\r\n              <Col>\r\n                <Form.Label className=\"pr-2\">All Groups</Form.Label>\r\n                <Form.Label className=\"legend-item all-groups\">&nbsp;</Form.Label>\r\n              </Col>\r\n            </Row>\r\n            <Row className=\"text-center\">\r\n              <Col>\r\n                <DatePicker inline\r\n                  peekNextMonth\r\n                  adjustDateOnChange\r\n                  allowSameDay\r\n                  minDate={new Date()}\r\n                  enableTabLoop={false}\r\n                  selected={this.state.selectedDate}\r\n                  onChange={this.handleDateEvent}\r\n                  dayClassName={(date) => dayClassName(date)}\r\n                />\r\n              </Col>\r\n            </Row>\r\n            <Row className=\"small\">\r\n              <Form.Label column className={`col-3${classNameDisabled}`} htmlFor=\"txtDescription\">Description</Form.Label>\r\n              <Col xs={9}>\r\n                <Form.Control size=\"sm\" type=\"text\" id=\"txtDescription\"\r\n                  disabled={!this.state.selectedDayToExclude}\r\n                  value={this.state.selectedDayDescription || \"\"}\r\n                  onChange={this.handleExclusionDateDescriptionChange} />\r\n              </Col>\r\n            </Row>\r\n            <Row className=\"small\">\r\n              <Form.Label column className={classNameDisabled}>Exclude by Gender</Form.Label>\r\n              <Col>\r\n                <Checkbox id=\"chkMale\" className=\"abc-checkbox\"\r\n                  label=\"Male\"\r\n                  value=\"M\"\r\n                  disabled={!this.state.selectedDayToExclude}\r\n                  checked={this.state.selectedDayGender === 'M'}\r\n                  onChange={this.handleExclusionDateGenderChange} />\r\n                <Checkbox id=\"chkFemale\" className=\"abc-checkbox\"\r\n                  label=\"Female\"\r\n                  value=\"F\"\r\n                  disabled={!this.state.selectedDayToExclude}\r\n                  checked={this.state.selectedDayGender === 'F'}\r\n                  onChange={this.handleExclusionDateGenderChange} />\r\n              </Col>\r\n            </Row>\r\n            <Row className=\"small\">\r\n              <Col>\r\n                <Checkbox id=\"chkAllGroups\" inline className=\"abc-checkbox\"\r\n                  label=\"Exclude For All Groups\"\r\n                  disabled={!this.state.selectedDayToExclude}\r\n                  checked={this.state.selectedDayToExclude && (this.state.selectedDayPoolID ?? undefined) === undefined}\r\n                  onChange={this.handleExclusionDateAllGroupsChange} />\r\n              </Col>\r\n            </Row>\r\n          </Form>\r\n          {this.state.dateCheckInProgress && <div className=\"loading-overlay\"><Spinner animation=\"border\" variant=\"light\" /></div>}\r\n        </Modal.Body>\r\n        <Modal.Footer>\r\n          <Button variant=\"secondary\" onClick={onCancel}>Cancel</Button>\r\n          <Button variant=\"primary\" onClick={() => onSave(this.state.daysToExclude)}>Save</Button>\r\n        </Modal.Footer>\r\n      </Modal>\r\n      <ConfirmationModal show={this.state.showRemoveExistingEventsConfirmation}\r\n        title=\"CONFIRM\"\r\n        confirmButtonText=\"Yes\"\r\n        cancelButtonText=\"No\"\r\n        onConfirm={() => this.addDayToExclude()}\r\n        onHide={() => this.setState({ showRemoveExistingEventsConfirmation: false })}>\r\n        <Container fluid>\r\n          <Row>\r\n            <Col>\r\n              <h5>There are collections scheduled for this date!<br />If you proceed to exclude this date all pending collections will be cancelled.</h5>\r\n              <p>Do you want to proceed?</p>\r\n            </Col>\r\n          </Row>\r\n        </Container>\r\n      </ConfirmationModal>\r\n      <ConfirmationModal show={this.state.showAllGroupsConfirmation}\r\n        title=\"CONFIRM\"\r\n        textTitle=\"This action will cancel all tests that are scheduled for this date, not just the tests associated with this group.\"\r\n        text=\"Do you still wish to proceed?\"\r\n        showImage={false}\r\n        confirmButtonText=\"Yes\"\r\n        cancelButtonText=\"No\"\r\n        onConfirm={() => this.setAllGroups(true)}\r\n        onHide={() => this.setState({ showAllGroupsConfirmation: false })} />\r\n    </>\r\n  }\r\n}\r\n","import { toast } from \"react-toastify\"\r\nimport { APIError } from \"../api/ObservableFromFetch\"\r\nimport FormatError from \"../formatters/FormatError\"\r\n\r\nconst handleAPIError = (error: Error | APIError | undefined | null, action?: () => void) => {\r\n    action?.()\r\n    error && toast.error(FormatError(error))\r\n}\r\nexport default handleAPIError\r\n","interface LoadingTableBodyWrapperProps {\r\n  loading: boolean\r\n  recordsCount: number\r\n  columnsCount: number\r\n  noDataText?: string\r\n  children: React.ReactNode\r\n}\r\n\r\nfunction LoadingTableBodyWrapper({\r\n  loading,\r\n  recordsCount,\r\n  columnsCount,\r\n  noDataText = \"No Data Found\",\r\n  children,\r\n}: LoadingTableBodyWrapperProps) {\r\n  return (\r\n    <>\r\n      {loading && recordsCount === 0 && (\r\n        <tr>\r\n          <td colSpan={columnsCount}>&nbsp;</td>\r\n        </tr>\r\n      )}\r\n      {!loading && recordsCount === 0 && (\r\n        <tr>\r\n          <td colSpan={columnsCount}>{noDataText}</td>\r\n        </tr>\r\n      )}\r\n      {children}\r\n    </>\r\n  )\r\n}\r\n\r\nexport default LoadingTableBodyWrapper\r\n","import { Spinner } from \"react-bootstrap\"\r\n\r\ninterface LoadingTableWrapperProps {\r\n  loading: boolean\r\n  variant?: \"dark\" | \"light\" | \"page\"\r\n  hideContent?: boolean\r\n  withBorder?: boolean\r\n  withHeader?: boolean\r\n  children: React.ReactNode\r\n}\r\n\r\nfunction LoadingTableWrapper({\r\n  loading,\r\n  variant = \"dark\",\r\n  hideContent = false,\r\n  withBorder = true,\r\n  withHeader = false,\r\n  children,\r\n}: LoadingTableWrapperProps) {\r\n  const cssClasses = [\"loading-table-wrapper\"]\r\n  if (loading && hideContent && withBorder) {\r\n    cssClasses.push(\"with-border\")\r\n  }\r\n  if (loading && variant === \"page\") {\r\n    cssClasses.push(\"page\")\r\n  }\r\n\r\n  return (\r\n    <div className={cssClasses.join(\" \")}>\r\n      {loading && hideContent && <div className=\"invisible\">{children}</div>}\r\n      {loading && !hideContent && children}\r\n      {loading && (\r\n        <div className={`dimming-panel ${variant}`}>\r\n          <Spinner className={`spinner ${withHeader ? \"mt-5\" : \"\"}`} animation=\"border\" variant=\"secondary\" />\r\n        </div>\r\n      )}\r\n      {!loading && children}\r\n    </div>\r\n  )\r\n}\r\n\r\nexport default LoadingTableWrapper\r\n","export default function FormatDate(date: Date | string | null | undefined, delimiter: string = \"/\"): string {\r\n  if (date) {\r\n    if (typeof date === \"string\") {\r\n      if (!isNaN(Date.parse(date))) {\r\n        date = new Date(date)\r\n      }\r\n    }\r\n    if (date instanceof Date) {\r\n      return [\r\n        (\"0\" + (date.getMonth() + 1)).slice(-2),\r\n        (\"0\" + (date.getDate())).slice(-2),\r\n        date.getFullYear(),\r\n      ].join(delimiter)\r\n    }\r\n  }\r\n  return \"\"\r\n}\r\n\r\nexport function FormatDateAsLong(date: Date | string): string {\r\n  if (date) {\r\n    if (typeof date === \"string\") {\r\n      if (!isNaN(Date.parse(date))) {\r\n        date = new Date(date)\r\n      }\r\n    }\r\n    if (date instanceof Date) {\r\n      return date.toLocaleDateString(\"en-US\", { year: 'numeric', month: 'long', day: 'numeric' })\r\n    }\r\n  }\r\n  return \"\"\r\n}\r\n\r\nexport function FormatShortDate(date: Date | string, suppressCurrentYear = false): string {\r\n  if (date) {\r\n    if (typeof date === \"string\") {\r\n      if (!isNaN(Date.parse(date))) {\r\n        date = new Date(date)\r\n      }\r\n    }\r\n    if (date instanceof Date) {\r\n      if (suppressCurrentYear && date.getFullYear() == new Date().getFullYear()) {\r\n        return date.toLocaleDateString(\"en-US\", { year: undefined, month: 'short', day: 'numeric' })\r\n      } else {\r\n        return date.toLocaleDateString(\"en-US\", { year: 'numeric', month: 'numeric', day: 'numeric' })\r\n      }\r\n    }\r\n  }\r\n  return \"\"\r\n}\r\n\r\nexport function FormatShortDateTime(date: Date | string): string {\r\n  if (date) {\r\n    if (typeof date === \"string\") {\r\n      if (!isNaN(Date.parse(date))) {\r\n        date = new Date(date)\r\n      }\r\n    }\r\n    if (date instanceof Date) {\r\n      return date.toLocaleDateString(\"en-US\", { year: 'numeric', month: 'numeric', day: 'numeric', hour: 'numeric', minute: 'numeric' })\r\n    }\r\n  }\r\n  return \"\"\r\n}\r\n","import { useEffect, useMemo, useState } from \"react\"\r\n\r\nimport { Col, Form, Row } from \"react-bootstrap\"\r\nimport { BehaviorSubject, concat, of } from \"rxjs\"\r\nimport { catchError, filter, map, switchMap  } from \"rxjs/operators\"\r\n\r\nimport handleAPIError from \"../../../utils/handleAPIError\"\r\nimport LoadingTableBodyWrapper from \"../../LoadingTableBodyWrapper\"\r\nimport LoadingTableWrapper from \"../../LoadingTableWrapper\"\r\nimport TablePagination from \"../../TablePagination\"\r\nimport { CompletedMatchingTest, CompletedTestsGridData, CompletedTestsGridOptions, GetCompletedTestsObservable } from \"../../../api/Randoms/PoolSelectionActions\"\r\nimport ApiResult from \"../../../api/ApiResult\"\r\nimport FormatDate from \"../../../formatters/FormatDate\"\r\n\r\nconst PageSize = 5\r\ninterface CompletedTestsProps {\r\n  search: { field: string; text: string }\r\n  testDetailID: number\r\n  testTypeID: number\r\n  poolSelectionID: number\r\n  selectedTest?: CompletedMatchingTest\r\n  showTitle?: boolean\r\n  onSelectTest: (test: CompletedMatchingTest | undefined) => void\r\n}\r\n\r\nfunction CompletedTests({\r\n  search,\r\n  testDetailID,\r\n  testTypeID,\r\n  poolSelectionID,\r\n  selectedTest = undefined,\r\n  showTitle = true,\r\n  onSelectTest,\r\n}: CompletedTestsProps) {\r\n  const [gridData, setGridData] = useState<CompletedTestsGridData>({ Records: [], Pages: 0, Total: 0 })\r\n  const [loadingTests, setLoadingTests] = useState<boolean>(false)\r\n\r\n  const page$ = useMemo(\r\n    () =>\r\n      new BehaviorSubject<CompletedTestsGridOptions>({\r\n        search: search ,\r\n        TestDetailID: testDetailID,\r\n        TestTypeID: testTypeID,\r\n        PoolSelectionID: poolSelectionID,\r\n        PageNumber: 1,\r\n        PageSize,\r\n      }),\r\n    [search, poolSelectionID, testTypeID, testDetailID]\r\n  )\r\n\r\n  useEffect(() => {\r\n    const subscription = page$\r\n      .pipe(\r\n        filter((params) => params.search.text.length > 0),\r\n        switchMap((params) =>\r\n          concat(\r\n            of({ loading: true }),\r\n            GetCompletedTestsObservable(params).pipe(\r\n              map((result) => ({ loading: false, result })),\r\n              catchError((error) => of({ loading: false, result: undefined, error }))\r\n            )\r\n          )\r\n        )\r\n      )\r\n      .subscribe(\r\n        ({ loading, result, error }: ApiResult<CompletedTestsGridData>) => {\r\n          setLoadingTests(loading)\r\n\r\n          if (!loading) {\r\n            setGridData({\r\n              ...result,\r\n              Records: result?.Records || [],\r\n              Pages: result?.Pages ?? 0,\r\n              Total: result?.Total ?? 0,\r\n            })\r\n            handleAPIError(error)\r\n          }\r\n        },\r\n        (error) => handleAPIError(error, () => setLoadingTests(false))\r\n      )\r\n    return () => subscription.unsubscribe()\r\n  }, [page$, search.text])\r\n\r\n  const handleSelectTest = (testId: number | undefined) => {\r\n    const selected = gridData.Records.find((t) => t.TestDetailID === testId)\r\n    onSelectTest(selected?.TestDetailID === selectedTest?.TestDetailID ? undefined : selected)\r\n  }\r\n\r\n  const handleChangePage = (page: number) => {\r\n    handleSelectTest(undefined)\r\n    setLoadingTests(true)\r\n    page$.next({ ...page$.value, search, PageNumber: page })\r\n  }\r\n\r\n  return (\r\n    <>\r\n      <Row>\r\n        <Col>{showTitle && <h5 className=\"text-body\">Completed {testTypeID === 1 ? \"Drug\" : \"Alcohol\"} Tests</h5>}</Col>\r\n      </Row>\r\n      <LoadingTableWrapper loading={loadingTests} variant=\"light\" withHeader>\r\n        <table className=\"table table-bordered\">\r\n          <thead className=\"thead-light\">\r\n            <tr>\r\n              <th className=\"text-center col-1\" aria-label=\"...\" />\r\n              <th className=\"text-nowrap\">Reason</th>\r\n              <th className=\"text-nowrap\">SampleID</th>\r\n              <th className=\"text-nowrap\">Regulated</th>\r\n              <th className=\"text-nowrap\">Type</th>\r\n              <th className=\"text-nowrap\">Created</th>\r\n              <th className=\"text-nowrap\">Name</th>\r\n              <th className=\"text-nowrap\">ID</th>\r\n              <th className=\"text-nowrap\">Company</th>\r\n              <th className=\"text-nowrap\">Location</th>\r\n            </tr>\r\n          </thead>\r\n          <tbody className=\"bg-light\">\r\n            <LoadingTableBodyWrapper\r\n              loading={loadingTests}\r\n              recordsCount={gridData.Records.length}\r\n              columnsCount={10}\r\n              noDataText=\"No Tests Found\"\r\n            >\r\n              {gridData.Records.map((test: CompletedMatchingTest) => (\r\n                <tr>\r\n                  <td className=\"align-middle\">\r\n                    <Form.Check\r\n                      type=\"checkbox\"\r\n                      name=\"pending-test-detail\"\r\n                      id={`ptd_${test.TestDetailID}`}\r\n                      className=\"abc-checkbox abc-checkbox-primary d-flex justify-content-center align-middle\"\r\n                      value={test.TestDetailID}\r\n                      label=\"\"\r\n                      disabled={!!selectedTest && selectedTest?.TestDetailID !== test.TestDetailID}\r\n                      checked={selectedTest?.TestDetailID === test.TestDetailID}\r\n                      readOnly\r\n                      onChangeCapture={() => handleSelectTest(test.TestDetailID)}\r\n                    />\r\n                  </td>\r\n                <td title={test.Reason}>{test.ReasonDescription}</td>\r\n                <td>{test.SampleID}</td>\r\n                <td>{test.Regulated}</td>\r\n                <td>{test.SampleType}</td>\r\n                <td>{FormatDate(test.DateOrdered)}</td>\r\n                <td>{test.CCFLastName}, {test.CCFFirstName}</td>\r\n                <td>{test.CCFID}</td>\r\n                <td>{test.Company}</td>\r\n                <td>{test.Location}</td>\r\n              </tr>\r\n              ))}\r\n            </LoadingTableBodyWrapper>\r\n          </tbody>\r\n        </table>\r\n      </LoadingTableWrapper>\r\n      {gridData.Records.length > 0 && (\r\n        <Row>\r\n          <Col sm={2}>Total records: {gridData.Total}</Col>\r\n          <Col>\r\n            <TablePagination\r\n              pageNumber={page$.value.PageNumber}\r\n              pages={gridData.Pages}\r\n              onChange={handleChangePage}\r\n              className=\"mb-0\"\r\n            />\r\n          </Col>\r\n        </Row>\r\n      )}\r\n    </>\r\n  )\r\n}\r\n\r\nexport default CompletedTests\r\n","import { Observable } from \"rxjs\"\r\n\r\nimport { ObservableFromFetch } from \"../ObservableFromFetch\"\r\n\r\nexport interface PoolSelectionCancel {\r\n  PoolSelectionID: number\r\n}\r\n\r\nexport interface PoolSelectionRerun {\r\n  PoolSelectionID: number\r\n  RequiredDrug: number\r\n  RequiredAlcohol: number\r\n  AlternateDrug: number\r\n  AlternateAlcohol: number\r\n  ExtraDrug: number\r\n  ExtraAlcohol: number\r\n  AccountID: number\r\n}\r\n\r\nexport interface PoolSelectionTestMatch {\r\n  TestDetailID: number\r\n  CompletedTestDetailID: number\r\n  HasError: boolean\r\n}\r\n\r\nexport interface CompletedMatchingTest {\r\n  TestEventID: number\r\n  TestDetailID: number\r\n  PersonID: number\r\n  CCFID: string\r\n  Company: string\r\n  Location: string\r\n  CCFFirstName: string\r\n  CCFLastName: string\r\n  Reason: string\r\n  ReasonDescription: string\r\n  Regulated: string\r\n  SampleType: string\r\n  DateOrdered: string\r\n  FormFoxTestAN: string\r\n  SampleID: string\r\n  HasError: boolean\r\n}\r\n\r\nexport interface CompletedTestsGridOptions {\r\n  search: {\r\n    field: string\r\n    text: string\r\n  }\r\n  TestDetailID: number\r\n  TestTypeID: number\r\n  PoolSelectionID: number\r\n  PageNumber: number\r\n  PageSize: number\r\n}\r\n\r\nexport interface CompletedTestsGridData {\r\n  Records: CompletedMatchingTest[]\r\n  Pages: number\r\n  Total: number\r\n}\r\n\r\nexport function PoolSelectionCancelObservable(poolSelection: PoolSelectionCancel): Observable<string> {\r\n  const params: string = JSON.stringify({\r\n    PoolSelectionID: poolSelection.PoolSelectionID,\r\n  })\r\n  return ObservableFromFetch<string>(\"WorkforceRandomTest/PoolSelectionCancel\", params)\r\n}\r\n\r\nexport function PoolSelectionRerunObservable(poolSelection: PoolSelectionRerun): Observable<string> {\r\n  const params: string = JSON.stringify({\r\n    PoolSelectionID: poolSelection.PoolSelectionID,\r\n    RequiredDrug: poolSelection.RequiredDrug,\r\n    RequiredAlcohol: poolSelection.RequiredAlcohol,\r\n    AlternateDrug: poolSelection.AlternateDrug,\r\n    AlternateAlcohol: poolSelection.AlternateAlcohol,\r\n    ExtraDrug: poolSelection.ExtraDrug,\r\n    ExtraAlcohol: poolSelection.ExtraAlcohol,\r\n  })\r\n  return ObservableFromFetch<string>(\"WorkforceRandomTest/PoolSelectionRerun\", params)\r\n}\r\n\r\nexport function GetCompletedTestsObservable(options: CompletedTestsGridOptions) {\r\n  const requestBody: string = JSON.stringify(options)\r\n  return ObservableFromFetch<CompletedTestsGridData>(\"WorkforceRandomTest/GetCompletedTests\", requestBody)\r\n}\r\n\r\nexport function PoolSelectionTestMatchObservable(poolSelectionMatch: PoolSelectionTestMatch) {\r\n  const params: string = JSON.stringify(poolSelectionMatch)\r\n  return ObservableFromFetch<string>(\"WorkforceRandomTest/PoolSelectionTestMatch\", params)\r\n}","import { useState } from \"react\"\r\n\r\nimport { Button, Col, Modal, ModalBody, ModalTitle, Row } from \"react-bootstrap\"\r\nimport ModalHeader from \"react-bootstrap/esm/ModalHeader\"\r\nimport { toast } from \"react-toastify\"\r\nimport { finalize } from \"rxjs/operators\"\r\n\r\nimport FormatError from \"../../../formatters/FormatError\"\r\nimport { DraggableModalDialog } from \"../../Randomization/GovPools/RandomSchedulingExclusionsModal\"\r\nimport SearchBar from \"../../SearchBar\"\r\nimport { CompletedMatchingTest, PoolSelectionTestMatchObservable } from \"../../../api/Randoms/PoolSelectionActions\"\r\nimport ActionButton from \"../../ActionButton\"\r\nimport CompletedTests from \"./CompletedTests\"\r\nimport ConfirmationModal from \"../../ConfirmationModal\"\r\n\r\n\r\ninterface CompleteRandomSelectionProps {\r\n  testDetailID: number\r\n  testTypeID: number\r\n  poolSelectionID: number\r\n  onClose: (withUpdate: boolean) => void\r\n}\r\n\r\nconst searchFields = [\r\n  { Name: \"SampleID\" },\r\n  { Name: \"All Personnel IDs\" },\r\n  { Name: \"SSN\" },\r\n  { Name: \"Employer ID\" },\r\n  { Name: \"Driver ID\" },\r\n  { Name: \"Alternate ID\" },\r\n  { Name: \"First Name\" },\r\n  { Name: \"Last Name\" },\r\n  //{ Name: \"Company\" },\r\n  //{ Name: \"Location\" },\r\n].map((el) => {\r\n  return { Name: el.Name, ID: el.Name }\r\n})\r\n\r\nfunction CompleteRandomSelection(props: CompleteRandomSelectionProps) {\r\n  const { testDetailID, testTypeID, poolSelectionID, onClose } = props\r\n\r\n  const [Search, setSearch] = useState({ field: \"\", text: \"\" })\r\n  const [selectedTest, setSelectedTest] = useState<CompletedMatchingTest>()\r\n  const [acceptProc, setAcceptProc] = useState(false)\r\n  const [confirmSave, setConfirmSave] = useState(false)\r\n\r\n  const onCancel = () => {\r\n    onClose(false)\r\n  }\r\n\r\n  const onSave = () => {\r\n    setAcceptProc(true)\r\n    setConfirmSave(false)\r\n    const acceptOptions = {\r\n      TestDetailID: testDetailID,\r\n      CompletedTestDetailID: selectedTest?.TestDetailID || 0,\r\n      HasError: selectedTest?.HasError || false\r\n    }\r\n    PoolSelectionTestMatchObservable(acceptOptions)\r\n      .pipe(finalize(() => setAcceptProc(false)))\r\n      .subscribe(\r\n        (data) => {\r\n          toast.success(data)\r\n          onClose(true)\r\n        },\r\n        (error) => toast.error(FormatError(error))\r\n      )\r\n  }\r\n\r\n  const onAccept = () => {\r\n    setConfirmSave(true)\r\n  }\r\n\r\n  const onCancelConfirm = () => {\r\n    setConfirmSave(false)\r\n  }\r\n\r\n  const handleSearch = (field: string, text: string) => {\r\n    setSelectedTest(undefined)\r\n    setSearch({ field, text })\r\n  }\r\n\r\n  return (<>\r\n    <Modal dialogAs={DraggableModalDialog} backdrop=\"static\" show size=\"xl\" dialogClassName=\"dark\" onHide={onClose}>\r\n      <ModalHeader closeButton>\r\n        <ModalTitle>Complete A Random Selection</ModalTitle>\r\n      </ModalHeader>\r\n      <ModalBody>\r\n        <Row>\r\n          <Col>\r\n            Search for test to match from Selection List:\r\n          </Col>\r\n        </Row>\r\n        <Row className=\"my-3\">\r\n          <Col>\r\n            <SearchBar onSearch={handleSearch} searchFields={searchFields} placeholder=\"All Personnel IDs\" />\r\n          </Col>\r\n        </Row>\r\n        <Row>\r\n          <Col>\r\n            <CompletedTests\r\n              search={Search}\r\n              poolSelectionID={poolSelectionID}\r\n              testDetailID={testDetailID}\r\n              testTypeID={testTypeID}\r\n              selectedTest={selectedTest}\r\n              onSelectTest={setSelectedTest}\r\n            />\r\n          </Col>\r\n        </Row>\r\n      </ModalBody>\r\n      <Modal.Footer>\r\n        <Button variant=\"primary\" onClick={onCancel}>Cancel</Button>\r\n        <ActionButton\r\n          variant=\"secondary\"\r\n          onClick={onAccept}\r\n          disabled={!selectedTest}\r\n          spin={acceptProc}\r\n        >\r\n          Accept\r\n        </ActionButton>\r\n      </Modal.Footer>\r\n    </Modal>\r\n    <ConfirmationModal show={confirmSave}\r\n        title=\"CONFIRM\"\r\n        textTitle=\"This update could not be reverted. Are you sure?\"\r\n        text=\"\"\r\n        showCancelButton={true}\r\n        showImage={false}\r\n        confirmButtonText=\"OK\"\r\n        onConfirm={onSave}\r\n        onHide={onCancelConfirm} />\r\n    </>\r\n  )\r\n}\r\n\r\nexport default CompleteRandomSelection\r\n","export default function GetDonorID(donorId: string, mockDonorId: string, unmaskDonorId: number): string {\r\n  if (unmaskDonorId > 0) {\r\n    return mockDonorId\r\n  }\r\n  return donorId\r\n}\r\nexport function GetDonorIDTitle(donorId: string, mockDonorId: string, unmaskDonorId: number): string {\r\n  if (unmaskDonorId > 0) {\r\n    return mockDonorId\r\n  }\r\n  return donorId\r\n}\r\n","import * as React from \"react\"\r\nimport { Col, Container, Modal, Row, Button, Table, Spinner } from \"react-bootstrap\"\r\nimport { Subscription } from \"rxjs\"\r\nimport FileSaver from \"file-saver\"\r\nimport { connect } from \"react-redux\"\r\nimport { toast } from \"react-toastify\"\r\nimport FormatTimestampFileName from \"../../formatters/FormatTimestampFileName\"\r\nimport PoolSelectionRow from \"../../api/Randoms/RandomsModel/PoolSelectionRow\"\r\nimport RandomSelectionRow from \"../../api/Randoms/RandomsModel/RandomSelectionRow\"\r\nimport RandomSelectionListGet from \"../../api/Randoms/RandomSelectionListGet\"\r\nimport RandomSelectionListCsvGet from \"../../api/Randoms/RandomSelectionListCsvGet\"\r\nimport RandomSelectionListPrintGet from \"../../api/Randoms/RandomSelectionListPrintGet\"\r\nimport RandomSelectionListPrintLettersGet from \"../../api/Randoms/RandomSelectionListPrintLettersGet\"\r\nimport CompleteRandomSelection from \"./Pools/CompleteRandomSelection\"\r\nimport ActionButton from \"../ActionButton\"\r\nimport { isPortalAdmin } from \"../../authentication/isAdminRole\"\r\nimport { AppState } from \"../../AppState\"\r\nimport { BuildUserAccess } from \"../../authentication/BuildUserAccess\"\r\nimport GetDonorID, { GetDonorIDTitle } from \"../../formatters/RenderDonorID\"\r\n\r\ninterface RandomSelectionListAuthProps {\r\n  isPortalAdmin?: boolean\r\n  canMatchTests?: boolean\r\n}\r\ninterface RandomSelectionListProps {\r\n  show: boolean\r\n  onHide: () => void\r\n  poolId: number\r\n  accountId?: number\r\n  poolName: string\r\n  poolSelection: PoolSelectionRow\r\n  unmaskDonorId:number\r\n}\r\n\r\ninterface RandomSelectionListState {\r\n  data?: RandomSelectionRow[]\r\n  loadingCsv: boolean\r\n  loadingPrint: boolean\r\n  loadingPrintLetter: boolean\r\n  showCompleteModal: boolean\r\n  testData?: {testID: number, testTypeID: number, poolSelectionID: number}\r\n}\r\n\r\nclass RandomSelectionList extends React.PureComponent<RandomSelectionListProps & RandomSelectionListAuthProps, RandomSelectionListState> {\r\n  state: RandomSelectionListState = {\r\n    loadingCsv: false,\r\n    loadingPrint: false,\r\n    loadingPrintLetter: false,\r\n    showCompleteModal: false,\r\n  }\r\n  listSubscription?: Subscription\r\n  csvSubscription?: Subscription\r\n  printSubscription?: Subscription\r\n  printLetterSubscription?: Subscription\r\n\r\n  componentDidMount() {\r\n    this.refreshGrid()\r\n  }\r\n\r\n  componentWillUnmount() {\r\n    this.listSubscription && this.listSubscription.unsubscribe()\r\n    this.csvSubscription && this.csvSubscription.unsubscribe()\r\n    this.printSubscription && this.printSubscription.unsubscribe()\r\n    this.printLetterSubscription && this.printLetterSubscription.unsubscribe()\r\n  }\r\n\r\n  refreshGrid = () => {\r\n    this.listSubscription && this.listSubscription.unsubscribe()\r\n    this.listSubscription = RandomSelectionListGet(this.props.poolId, this.props.poolSelection.PoolSelectionID, this.props.accountId || 0).subscribe(\r\n      (data: RandomSelectionRow[]) => {\r\n        this.setState({ data: data.filter(row => row.ID !== \"\" || row.Name !== \"\" || row.TestFor !== \"\") })\r\n      }\r\n    )\r\n  }\r\n\r\n  handleExportClick = () => {\r\n    this.setState({ loadingCsv: true })\r\n    this.csvSubscription = RandomSelectionListCsvGet(this.props.poolId, this.props.poolSelection.PoolSelectionID, this.props.poolName, this.props.accountId || 0).subscribe(\r\n      (result: string) => result ? this.export(result) : toast.error(\"Data not found.\"),\r\n      error => toast.error(error),\r\n      () => this.setState({ loadingCsv: false })\r\n    )\r\n  }\r\n\r\n  export = (csv: string) => {\r\n    const csvData = new Blob([csv], { type: 'text/csv;charset=utf-8;' })\r\n    FileSaver.saveAs(csvData, FormatTimestampFileName(\"RandomSelectionList\", \"csv\", new Date()), true)\r\n    toast.success(\"CSV file downloaded successfully.\")\r\n  }\r\n\r\n  handlePrintClick = () => {\r\n    this.setState({ loadingPrint: true })\r\n    this.printSubscription = RandomSelectionListPrintGet(this.props.poolId, this.props.poolSelection.PoolSelectionID, this.props.accountId || 0).subscribe(\r\n      (data: string) => this.print(data),\r\n      error => toast.error(error),\r\n      () => this.setState({ loadingPrint: false })\r\n    )\r\n  }\r\n\r\n  print = (base64pdf: string) => {\r\n    const pdfWindow = window.open(\"\")\r\n    if (pdfWindow) {\r\n      pdfWindow.document.write(\"<iframe width='100%' height='100%' src='data:application/pdf;base64, \" + encodeURI(base64pdf) + \"'></iframe>\")\r\n    }\r\n  }\r\n\r\n  handlePrintLettersClick = () => {\r\n    this.setState({ loadingPrintLetter: true })\r\n    this.printLetterSubscription = RandomSelectionListPrintLettersGet(this.props.poolId, this.props.poolSelection.PoolSelectionID, this.props.accountId || 0).subscribe(\r\n      (data: string) => this.print(data),\r\n      error => toast.error(error),\r\n      () => this.setState({ loadingPrintLetter: false })\r\n    )\r\n  }\r\n\r\n  drugButton = (text: string, row: RandomSelectionRow) => {\r\n    const testData = { testID: row.DrugTestDetailID, testTypeID: 1, poolSelectionID: this.props.poolSelection.PoolSelectionID }\r\n    return <Button variant=\"underline-link\" className=\"px-0 mb-1\" onClick={() => this.setState({showCompleteModal: true, testData: testData})}>{text}</Button>\r\n  }\r\n  alcoholButton = (text: string, row: RandomSelectionRow) => {\r\n    const testData = { testID: row.AlcoholTestDetailID, testTypeID: 2, poolSelectionID: this.props.poolSelection.PoolSelectionID }\r\n    return <Button variant=\"underline-link\" className=\"px-0 mb-1\" onClick={() => this.setState({showCompleteModal: true, testData: testData})}>{text}</Button>\r\n  }\r\n\r\n  generateTestForContent = (row: RandomSelectionRow) => {\r\n    if (row.TestFor.includes(\"(X)\") || !this.props.canMatchTests) return row.TestFor\r\n    const results = row.TestFor.split(\",\")\r\n\r\n    if (results.length > 1) {\r\n      if (!row.DrugIsCompleted && !row.AlcoholIsCompleted) {\r\n        return <>{this.drugButton(results[0], row)},{this.alcoholButton(results[1], row)}</>\r\n      }\r\n      else if (!row.DrugIsCompleted) {\r\n        return <>{this.drugButton(results[0], row)},{results[1]}</>\r\n      }\r\n      else if (!row.AlcoholIsCompleted) {\r\n        return <>{results[0]},{this.alcoholButton(results[1], row)}</>\r\n      }\r\n      else {\r\n        return row.TestFor\r\n      }\r\n    }\r\n    else if (results.length === 1) {\r\n      if (row.TestFor.includes(\"D\") && !row.DrugIsCompleted) {\r\n        return <>{this.drugButton(row.TestFor, row)}</>\r\n      }\r\n      else if (row.TestFor.includes(\"A\") && !row.AlcoholIsCompleted) {\r\n        return <>{this.alcoholButton(row.TestFor, row)}</>\r\n      }\r\n      else {\r\n        return row.TestFor\r\n      }\r\n    }\r\n    else {\r\n      return row.TestFor\r\n    }\r\n  }\r\n\r\n  onCloseCompleteModal = (withUpdate: boolean) => {\r\n    this.setState({ showCompleteModal: false, testData: undefined }, () => { if (withUpdate) this.refreshGrid() })\r\n  }\r\n\r\n  render() {\r\n    const {showCompleteModal, testData} = this.state\r\n\r\n    return (\r\n      <Modal backdrop=\"static\" show={this.props.show} onHide={this.props.onHide} size=\"xl\" centered>\r\n        <Modal.Header closeButton>\r\n          <Modal.Title>RANDOM SELECTION LIST</Modal.Title>\r\n        </Modal.Header>\r\n        <Modal.Body>\r\n          <Container className=\"grid-container\">\r\n            {showCompleteModal && !!testData &&\r\n              <CompleteRandomSelection\r\n                testDetailID={testData.testID}\r\n                testTypeID={testData.testTypeID}\r\n                poolSelectionID={testData.poolSelectionID}\r\n                onClose={this.onCloseCompleteModal} />\r\n            }\r\n            <Row>\r\n              <Col>\r\n                <h5>{this.props.poolName}</h5>{this.props.poolSelection.TimePeriod}\r\n              </Col>\r\n              <Col>\r\n                <Row>\r\n                  <Col className=\"text-right\">\r\n                    <ActionButton variant=\"secondary\" size=\"sm\" onClick={this.handleExportClick} className=\"mr-2\" disabled={!this.state.data?.length} spin={this.state.loadingCsv} disableOnSpin>EXPORT</ActionButton>\r\n                    <ActionButton variant=\"secondary\" size=\"sm\" onClick={this.handlePrintClick} className=\"mr-2\" disabled={!this.state.data?.length} spin={this.state.loadingPrint} disableOnSpin>PRINT</ActionButton>\r\n                  </Col>\r\n                </Row>\r\n                <Row>\r\n                  <Col className=\"text-right my-2\">\r\n                    <ActionButton variant=\"secondary\" size=\"sm\" onClick={this.handlePrintLettersClick} className=\"mr-2\" disabled={!this.state.data?.length} spin={this.state.loadingPrintLetter} disableOnSpin>PRINT NOTIFICATION LETTERS</ActionButton>\r\n                  </Col>\r\n                </Row>\r\n              </Col>\r\n            </Row>\r\n            <Row>\r\n              <Col>\r\n                <Table responsive className=\"table-sm dark\">\r\n                  <thead>\r\n                    <tr className=\"text-normal\">\r\n                      <th>COMPANY</th>\r\n                      <th>PRIMARY ID</th>\r\n                      <th>NAME</th>\r\n                      <th>SELECTION DATE</th>\r\n                      <th>TEST FOR</th>\r\n                      <th>COMPLETED DATE</th>\r\n                    </tr>\r\n                  </thead>\r\n                  <tbody>\r\n                    {!this.state.data && <tr><td className=\"text-center\" colSpan={6}><Spinner animation=\"border\" variant=\"secondary\" /></td></tr>}\r\n                    {this.state.data && this.state.data.length === 0 && <tr><td colSpan={6}>NO SELECTIONS FOR THIS ACCOUNT.</td></tr>}\r\n                    {this.state.data && this.state.data.length > 0 && this.state.data.map((row: RandomSelectionRow, i: number) =>\r\n                      <tr key={i}>\r\n                        <td className=\"align-middle\">{row.Company}</td>\r\n                        <td className=\"align-middle\">{GetDonorID(row.DonorID, row.ID, this.props.unmaskDonorId)}</td>\r\n                        <td className=\"align-middle\">{row.Name}</td>\r\n                        <td className=\"align-middle\">{row.DonorSelectedAt}</td>\r\n                        <td className=\"align-middle\">{this.generateTestForContent(row)}</td>\r\n                        <td className=\"align-middle\">{row.TestCompletedAt}</td>\r\n                      </tr>)}\r\n                  </tbody>\r\n                </Table>\r\n              </Col>\r\n            </Row>\r\n          </Container>\r\n        </Modal.Body>\r\n        <Modal.Footer>\r\n          <Button variant=\"secondary\" onClick={this.props.onHide}>CLOSE</Button>\r\n        </Modal.Footer>\r\n      </Modal>\r\n    )\r\n  }\r\n}\r\n\r\nfunction mapStateToProps(state: AppState): RandomSelectionListAuthProps {\r\n  const userAccess = BuildUserAccess(state)\r\n  return {\r\n    isPortalAdmin: isPortalAdmin(state),\r\n    canMatchTests: userAccess.canMatchTests\r\n  }\r\n}\r\nconst ConnectedRandomSelectionList = connect(mapStateToProps, null)(RandomSelectionList)\r\nexport default ConnectedRandomSelectionList","import { Observable } from \"rxjs\"\r\nimport PoolSelection from \"./RandomsModel/PoolSelection\"\r\nimport { ObservableFromFetch } from \"../ObservableFromFetch\"\r\n\r\nexport default function PoolSelectionListGetObservable(poolId: number, pageNumber: number, pageSize: number, accountId: number = 0): Observable<PoolSelection> {\r\n  const params: string = JSON.stringify({\r\n    PoolID: poolId,\r\n    AccountID: accountId,\r\n    PageNumber: pageNumber,\r\n    PageSize: pageSize\r\n  })\r\n\r\n  return ObservableFromFetch<PoolSelection>(\"RandomTest/GetPoolSelectionList\", params)\r\n}\r\n","import { useEffect, useState } from \"react\"\r\n\r\nimport { Button, Col, Container, Form, Modal, Row, Spinner } from \"react-bootstrap\"\r\nimport { toast } from \"react-toastify\"\r\nimport { finalize } from \"rxjs/operators\"\r\n\r\nimport { PoolSelectionRerun, PoolSelectionRerunObservable } from \"../../../api/Randoms/PoolSelectionActions\"\r\nimport PoolStatisticsDetailsGetObservable from \"../../../api/Randoms/PoolStatisticsDetailsGet\"\r\nimport PoolSelectionRow from \"../../../api/Randoms/RandomsModel/PoolSelectionRow\"\r\nimport PoolStatisticsDetails from \"../../../api/Randoms/RandomsModel/PoolStatisticsDetails\"\r\nimport handleAPIError from \"../../../utils/handleAPIError\"\r\nimport ActionButton from \"../../ActionButton\"\r\n\r\ninterface PoolSelectionRerunModalProps {\r\n  show?: boolean\r\n  poolId: number\r\n  companyId: number\r\n  row: PoolSelectionRow\r\n  onHide: () => void\r\n  onRefresh: () => void\r\n}\r\n\r\nfunction PoolSelectionRerunModal(props: PoolSelectionRerunModalProps) {\r\n  const { show, poolId, companyId, row, onHide, onRefresh } = props\r\n  const [running, setRunning] = useState(false)\r\n  const [statistic, setStatistic] = useState<PoolStatisticsDetails>({} as PoolStatisticsDetails)\r\n  const [loadingStatistic, setLoadingStatistic] = useState(false)\r\n\r\n  const [actualToSelectDrug, setActualToSelectDrug] = useState(0)\r\n  const [actualToSelectAlcohol, setActualToSelectAlcohol] = useState(0)\r\n  const [alternateDrug, setAlternateDrug] = useState(0)\r\n  const [alternateAlcohol, setAlternateAlcohol] = useState(0)\r\n\r\n  useEffect(() => {\r\n    setLoadingStatistic(true)\r\n    const subs = PoolStatisticsDetailsGetObservable(poolId, companyId)\r\n      .pipe(finalize(() => setLoadingStatistic(false)))\r\n      .subscribe(\r\n        (data) => {\r\n          setStatistic(data)\r\n          setActualToSelectDrug(data.DrugRequired)\r\n          setActualToSelectAlcohol(data.AlcoholRequired)\r\n        },\r\n        (error) => handleAPIError(error, () => {})\r\n      )\r\n    return () => subs.unsubscribe()\r\n  }, [poolId, companyId])\r\n\r\n  const handleReRun = () => {\r\n    setRunning(true)\r\n    const poolSelection: PoolSelectionRerun = {\r\n      PoolSelectionID: row.PoolSelectionID,\r\n      RequiredDrug: actualToSelectDrug || 0,\r\n      RequiredAlcohol: actualToSelectAlcohol || 0,\r\n      AlternateDrug: alternateDrug || 0,\r\n      AlternateAlcohol: alternateAlcohol || 0,\r\n      ExtraDrug: 0,\r\n      ExtraAlcohol: 0,\r\n      AccountID: 0,\r\n    }\r\n    PoolSelectionRerunObservable(poolSelection)\r\n      .pipe(finalize(() => setRunning(false)))\r\n      .subscribe(\r\n        (data) => {\r\n          onHide()\r\n          onRefresh()\r\n          toast.success(data)\r\n        },\r\n        (error) => handleAPIError(error, () => {})\r\n      )\r\n  }\r\n\r\n  const handleActualToSelectDrugChange = (value: string) => {\r\n    setActualToSelectDrug(Number(value.replace(/\\D/g, \"\")) || 0)\r\n  }\r\n\r\n  const handleActualToSelectAlcoholChange = (value: string) => {\r\n    setActualToSelectAlcohol(Number(value.replace(/\\D/g, \"\")) || 0)\r\n  }\r\n\r\n  const handleAlternateDrugChange = (value: string) => {\r\n    setAlternateDrug(Number(value.replace(/\\D/g, \"\")) || 0)\r\n  }\r\n\r\n  const handleAlternateAlcoholChange = (value: string) => {\r\n    setAlternateAlcohol(Number(value.replace(/\\D/g, \"\")) || 0)\r\n  }\r\n\r\n  const validateSizeValue = (value: number | undefined) => {\r\n    return !value || (value >= 0 && (!statistic || value <= statistic.CurrentPoolSize))\r\n  }\r\n\r\n  const isActualToSelectDrugValid = () => validateSizeValue(actualToSelectDrug)\r\n\r\n  const isAlternateDrugValid = () => validateSizeValue(alternateDrug)\r\n\r\n  const isActualToSelectAlcoholValid = () => validateSizeValue(actualToSelectAlcohol)\r\n\r\n  const isAlternateAlcoholValid = () => validateSizeValue(alternateAlcohol)\r\n\r\n  return (\r\n    <Modal show={show} onHide={onHide} size={statistic?.GenerateAlternates ? \"xl\" : \"lg\"} centered>\r\n      <Modal.Header closeButton>\r\n        <Modal.Title>TESTS REQUIRED FOR SELECTION {row.Period}</Modal.Title>\r\n      </Modal.Header>\r\n      <Modal.Body>\r\n        <Container>\r\n          {loadingStatistic ? (\r\n            <Row>\r\n              <Col className=\"text-center\">\r\n                <Spinner animation=\"border\" variant=\"secondary\" />\r\n              </Col>\r\n            </Row>\r\n          ) : (\r\n            <Row>\r\n              <Col>\r\n                <Form.Row>\r\n                  <Col\r\n                    lg={statistic?.GenerateAlternates ? 4 : 5}\r\n                    xl={statistic?.GenerateAlternates ? 3 : 5}\r\n                    md={12}\r\n                    className=\"form-row form-group form-inline\"\r\n                  >\r\n                    <div className=\"col-form-label col-4 justify-content-start\">DRUG</div>\r\n                    <div className=\"col-form-label col-4 justify-content-start\">{statistic?.DrugRequired || 0}</div>\r\n                  </Col>\r\n                  <Col\r\n                    lg={statistic?.GenerateAlternates ? 12 : 12}\r\n                    xl={statistic?.GenerateAlternates ? 5 : 7}\r\n                    md={12}\r\n                    className=\"form-row form-group form-inline\"\r\n                  >\r\n                    <Form.Label\r\n                      htmlFor=\"actual_to_select_drug_id\"\r\n                      className=\"col-form-label col-5 justify-content-start justify-content-lg-center\"\r\n                    >\r\n                      ACTUAL TO SELECT\r\n                    </Form.Label>\r\n                    <Form.Control\r\n                      type=\"text\"\r\n                      id=\"actual_to_select_drug_id\"\r\n                      className=\"col-4\"\r\n                      value={actualToSelectDrug}\r\n                      onChange={(e: React.ChangeEvent<HTMLInputElement>) =>\r\n                        handleActualToSelectDrugChange(e.target.value)\r\n                      }\r\n                      isInvalid={!isActualToSelectDrugValid()}\r\n                      disabled={false}\r\n                    />\r\n                    <Form.Control.Feedback type=\"invalid\">\r\n                      Drug Actual To Select is greater than pool size\r\n                    </Form.Control.Feedback>\r\n                  </Col>\r\n                  {statistic?.GenerateAlternates === true && (\r\n                    <Col lg={4} xl={4} md={12} className=\"form-row form-group form-inline\">\r\n                      <Form.Label\r\n                        htmlFor=\"alternate_actual_to_select_drug_id\"\r\n                        className=\"col-form-label col-6 justify-content-start justify-content-lg-center\"\r\n                      >\r\n                        ALTERNATES\r\n                      </Form.Label>\r\n                      <Form.Control\r\n                        type=\"text\"\r\n                        id=\"alternate_actual_to_select_drug_id\"\r\n                        className=\"col-4\"\r\n                        value={alternateDrug}\r\n                        onChange={(e: React.ChangeEvent<HTMLInputElement>) => handleAlternateDrugChange(e.target.value)}\r\n                        isInvalid={!isAlternateDrugValid()}\r\n                        disabled={false}\r\n                      />\r\n                      <Form.Control.Feedback type=\"invalid\">\r\n                        Number of drug Alternates exceeds pool membership count\r\n                      </Form.Control.Feedback>\r\n                    </Col>\r\n                  )}\r\n                </Form.Row>\r\n                <Form.Row>\r\n                  <Col\r\n                    lg={statistic?.GenerateAlternates ? 4 : 5}\r\n                    xl={statistic?.GenerateAlternates ? 3 : 5}\r\n                    md={12}\r\n                    className=\"form-row form-group form-inline\"\r\n                  >\r\n                    <div className=\"col-form-label col-4 justify-content-start\">ALCOHOL</div>\r\n                    <div className=\"col-form-label col-4 justify-content-start\">{statistic?.AlcoholRequired || 0}</div>\r\n                  </Col>\r\n                  <Col\r\n                    lg={statistic?.GenerateAlternates ? 12 : 14}\r\n                    xl={statistic?.GenerateAlternates ? 5 : 7}\r\n                    md={12}\r\n                    className=\"form-row form-group form-inline\"\r\n                  >\r\n                    <Form.Label\r\n                      htmlFor=\"actual_to_select_alcohol_id\"\r\n                      className=\"col-form-label col-5 justify-content-start justify-content-lg-center\"\r\n                    >\r\n                      ACTUAL TO SELECT\r\n                    </Form.Label>\r\n                    <Form.Control\r\n                      type=\"text\"\r\n                      id=\"actual_to_select_alcohol_id\"\r\n                      className=\"col-4\"\r\n                      value={actualToSelectAlcohol}\r\n                      onChange={(e: React.ChangeEvent<HTMLInputElement>) =>\r\n                        handleActualToSelectAlcoholChange(e.target.value)\r\n                      }\r\n                      isInvalid={!isActualToSelectAlcoholValid()}\r\n                      disabled={false}\r\n                    />\r\n                    <Form.Control.Feedback type=\"invalid\">\r\n                      Drug Actual To Select is greater than pool size\r\n                    </Form.Control.Feedback>\r\n                  </Col>\r\n                  {statistic?.GenerateAlternates === true && (\r\n                    <Col lg={4} xl={4} md={12} className=\"form-row form-group form-inline\">\r\n                      <Form.Label\r\n                        htmlFor=\"alternate_actual_to_select_alcohol_id\"\r\n                        className=\"col-form-label col-6 justify-content-start justify-content-lg-center\"\r\n                      >\r\n                        ALTERNATES\r\n                      </Form.Label>\r\n                      <Form.Control\r\n                        type=\"text\"\r\n                        id=\"alternate_actual_to_select_alcohol_id\"\r\n                        className=\"col-4\"\r\n                        value={alternateAlcohol}\r\n                        onChange={(e: React.ChangeEvent<HTMLInputElement>) =>\r\n                          handleAlternateAlcoholChange(e.target.value)\r\n                        }\r\n                        isInvalid={!isAlternateAlcoholValid()}\r\n                        disabled={false}\r\n                      />\r\n                      <Form.Control.Feedback type=\"invalid\">\r\n                        Number of alcohol Alternates exceeds pool membership count\r\n                      </Form.Control.Feedback>\r\n                    </Col>\r\n                  )}\r\n                </Form.Row>\r\n              </Col>\r\n            </Row>\r\n          )}\r\n        </Container>\r\n      </Modal.Body>\r\n      <Modal.Footer>\r\n        <Button onClick={onHide}>Cancel</Button>\r\n        <ActionButton\r\n          onClick={handleReRun}\r\n          spin={running}\r\n          disabled={\r\n            !isActualToSelectDrugValid() ||\r\n            !isActualToSelectAlcoholValid() ||\r\n            !isAlternateDrugValid() ||\r\n            !isAlternateAlcoholValid()\r\n          }\r\n          disableOnSpin\r\n        >\r\n          Run\r\n        </ActionButton>\r\n      </Modal.Footer>\r\n    </Modal>\r\n  )\r\n}\r\n\r\nPoolSelectionRerunModal.defaultProps = {\r\n  show: true,\r\n}\r\nexport default PoolSelectionRerunModal\r\n","import { useState } from \"react\"\r\n\r\nimport { Button } from \"react-bootstrap\"\r\nimport { FaReply, FaTimes } from \"react-icons/fa\"\r\nimport { toast } from \"react-toastify\"\r\nimport { finalize } from \"rxjs/operators\"\r\n\r\nimport PoolSelectionRerunModal from \"./PoolSelectionRerunModal\"\r\nimport { PoolSelectionCancel, PoolSelectionCancelObservable } from \"../../../api/Randoms/PoolSelectionActions\"\r\nimport PoolSelectionRow from \"../../../api/Randoms/RandomsModel/PoolSelectionRow\"\r\nimport handleAPIError from \"../../../utils/handleAPIError\"\r\nimport ActionButton from \"../../ActionButton\"\r\nimport ConfirmationModal from \"../../ConfirmationModal\"\r\n\r\ninterface PoolSelectionActionButtonsProps {\r\n  poolId: number\r\n  companyId: number\r\n  row: PoolSelectionRow\r\n  onRefresh: () => void\r\n}\r\n\r\nfunction PoolSelectionActionButtons(props: PoolSelectionActionButtonsProps) {\r\n  const { poolId, companyId, row, onRefresh } = props\r\n  const [canceling, setCanceling] = useState(false)\r\n  const [showCancelConfirmation, setShowCancelConfirmation] = useState(false)\r\n  const [showRerunModal, setShowRerunModal] = useState(false)\r\n\r\n  if (!row.IsActive) {\r\n    return null\r\n  }\r\n\r\n  const handleCancel = () => {\r\n    setCanceling(true)\r\n    setShowCancelConfirmation(false)\r\n    const poolSelection : PoolSelectionCancel = {PoolSelectionID : row.PoolSelectionID}\r\n    PoolSelectionCancelObservable(poolSelection)\r\n      .pipe(finalize(() => setCanceling(false)))\r\n      .subscribe(\r\n        (data) => {\r\n          onRefresh()\r\n          toast.success(data)\r\n        },\r\n        (error) => handleAPIError(error, () => {})\r\n      )\r\n  }\r\n\r\n  return (\r\n    <>\r\n      {row.Status === 0 && (\r\n        <ActionButton\r\n          variant=\"link\"\r\n          className=\"py-0\"\r\n          onClick={() => setShowCancelConfirmation(true)}\r\n          spin={canceling}\r\n          disableOnSpin\r\n        >\r\n          <FaTimes />\r\n          <span className=\"ml-1\">Cancel</span>\r\n        </ActionButton>\r\n      )}\r\n      {row.Status === 1 && (\r\n        <Button variant=\"link\" className=\"py-0\" onClick={() => setShowRerunModal(true)}>\r\n          <FaReply />\r\n          <span className=\"ml-1\">Re-run</span>\r\n        </Button>\r\n      )}\r\n      <ConfirmationModal\r\n        show={showCancelConfirmation}\r\n        title=\"CANCEL CONFIRMATION\"\r\n        textTitle=\"You are about to cancel an active Selection.\"\r\n        text=\" This cannot be undone. Are you sure you want to proceed?\"\r\n        confirmButtonText=\"Yes, cancel selection\"\r\n        cancelButtonText=\"No, do not cancel selection\"\r\n        onConfirm={handleCancel}\r\n        onHide={() => setShowCancelConfirmation(false)}\r\n      />\r\n      {showRerunModal && (\r\n        <PoolSelectionRerunModal\r\n          onHide={() => setShowRerunModal(false)}\r\n          onRefresh={onRefresh}\r\n          row={row}\r\n          poolId={poolId}\r\n          companyId={companyId}\r\n        />\r\n      )}\r\n    </>\r\n  )\r\n}\r\nexport default PoolSelectionActionButtons\r\n","import { Observable } from \"rxjs\"\r\nimport { ObservableFromFetch } from \"../../ObservableFromFetch\"\r\n\r\n\r\nexport enum FilterDataModule {\r\n  RandomModule = 6\r\n}\r\nexport enum FilterCriteriaCode {\r\n  Company = 2,\r\n  Location = 4,\r\n  RegulatoryMode = 12,\r\n  Unknown = 0\r\n}\r\nexport enum FilterSaveResult {\r\n  SuccessfullySaved = 0,\r\n  SaveError = 1,\r\n  Duplicate = 2\r\n}\r\n\r\nexport const EmptyPoolCriteria: PoolCriteria = {\r\n  PoolID: 0,\r\n  ImplementationID: 0,\r\n  FilterModuleID: FilterDataModule.RandomModule,\r\n  FilterDataID: 0,\r\n  SaveAs: \"\",\r\n  ForceOverride: false,\r\n  IsFilter: false,\r\n  UserName: \"\",\r\n  UserLoginID: 0,\r\n  SaveResultCode: FilterSaveResult.SuccessfullySaved,\r\n  SaveResultText: \"\",\r\n  Items: [],\r\n  IsConsortium: false\r\n}\r\n\r\nexport const EmptyPoolCriteriaItem: PoolCriteriaItem = {\r\n  FilterCriteriaID: 0,\r\n  FilterCriteriaName: \"Unknown\",\r\n  Name: \"\",\r\n  Values: []\r\n}\r\n\r\nexport default interface PoolCriteria {\r\n  PoolID: number\r\n  ImplementationID: number\r\n  FilterModuleID: number\r\n  FilterDataID: number\r\n  SaveAs: string\r\n  ForceOverride: boolean\r\n  IsFilter: boolean\r\n  UserName: string\r\n  UserLoginID: number\r\n  SaveResultCode: FilterSaveResult\r\n  SaveResultText: string\r\n  Items: PoolCriteriaItem[]\r\n  IsConsortium: boolean\r\n}\r\n\r\nexport interface PoolCriteriaItem {\r\n  FilterCriteriaID: number\r\n  FilterCriteriaName: string\r\n  Name: string\r\n  Values: PoolCriteriaValue[]\r\n}\r\n\r\nexport interface PoolCriteriaValue {\r\n  ID: number\r\n  IntValue: number\r\n  StringValue: string\r\n  BoolValue: boolean\r\n  StringValue2?: string\r\n  StringValue3?: string\r\n}\r\n\r\n\r\nexport const EmptyFilterData: FilterData = {\r\n  FilterDataID: 0,\r\n  ImplementationID: 0,\r\n  FilterModuleID: 0,\r\n  Name: \"\",\r\n  ForceOverride: true,\r\n  UserName: \"\",\r\n  UserLoginID: 0,\r\n  SaveResultCode: FilterSaveResult.SuccessfullySaved,\r\n  SaveResultText: \"\",\r\n  Items: []\r\n}\r\n\r\nexport const EmptyFilterDataItem: FilterDataItem = {\r\n  FilterCriteriaID: 0,\r\n  FilterCriteriaName: \"Unknown\",\r\n  Name: \"\",\r\n  Values: []\r\n}\r\n\r\nexport interface FilterDataName {\r\n  FilterDataID: number\r\n  Name: string\r\n}\r\n\r\nexport interface FilterData {\r\n  FilterDataID: number\r\n  ImplementationID: number\r\n  FilterModuleID: number\r\n  Name: string\r\n  ForceOverride: boolean\r\n  UserName: string\r\n  UserLoginID: number\r\n  SaveResultCode: FilterSaveResult\r\n  SaveResultText: string\r\n  Items: FilterDataItem[]\r\n}\r\n\r\nexport interface FilterDataItem {\r\n\r\n  FilterCriteriaID: number\r\n  FilterCriteriaName: string\r\n  Name: string\r\n  Values: FilterDataValue[]\r\n}\r\n\r\nexport interface FilterDataValue {\r\n  ID: number\r\n  IntValue: number\r\n  StringValue: string\r\n  BoolValue: boolean\r\n}\r\n\r\nexport function CopyFilterDataName(src: FilterDataName): FilterDataName {\r\n  const result: FilterDataName = {\r\n    FilterDataID: src.FilterDataID,\r\n    Name: src.Name\r\n  }\r\n  return result\r\n}\r\nexport function CopyFilterDataNames(src: FilterDataName[]): FilterDataName[] {\r\n  const result: FilterDataName[] = []\r\n  for (let i = 0; i < src.length; i++) {\r\n    const item = CopyFilterDataName(src[i])\r\n    result.push(item)\r\n  }\r\n  \r\n  return result\r\n}\r\n\r\nexport function GetPoolCriteriaItemByCode(criteria: PoolCriteria, code: FilterCriteriaCode, add: boolean = false): PoolCriteriaItem {\r\n  if (!criteria) {\r\n    return { ...EmptyPoolCriteriaItem }\r\n  }\r\n  const items = criteria.Items\r\n  const result = items.find(item => item.FilterCriteriaID === code)\r\n  if (add && !result) {\r\n    const newItem = { ...EmptyPoolCriteriaItem, FilterCriteriaID: code }\r\n    items.push(newItem)\r\n    return newItem\r\n  }\r\n  return result || { ...EmptyPoolCriteriaItem }\r\n}\r\n\r\nexport function GetCompanyPoolCriteriaItem(criteria: PoolCriteria): PoolCriteriaItem {\r\n  let result = GetPoolCriteriaItemByCode(criteria, FilterCriteriaCode.Company)\r\n  return result\r\n}\r\nexport function GetRegulatoryModePoolCriteriaItem(criteria: PoolCriteria): PoolCriteriaItem {\r\n  let result = GetPoolCriteriaItemByCode(criteria, FilterCriteriaCode.RegulatoryMode)\r\n  return result\r\n}\r\n\r\nexport function GetPoolCriteriaItemStringValues(item?: PoolCriteriaItem) {\r\n  return item?.Values.map(val => val.StringValue) || []\r\n}\r\n\r\nexport function GetFilterDataNameIndexByID(items: FilterDataName[], filterDataId: number): number {\r\n  if (!items) {\r\n    return -1;\r\n  }\r\n  const result = items.findIndex(item => item.FilterDataID === filterDataId);\r\n  return result;\r\n}\r\n\r\nexport function CreateEmptyPoolCriteria(poolId: number): PoolCriteria {\r\n  const result: PoolCriteria = {\r\n    PoolID: poolId,\r\n    ImplementationID: 0,\r\n    FilterModuleID: FilterDataModule.RandomModule,\r\n    FilterDataID: 0,\r\n    SaveAs: \"\",\r\n    ForceOverride: false,\r\n    IsFilter: false,\r\n    UserName: \"\",\r\n    UserLoginID: 0,\r\n    SaveResultCode: FilterSaveResult.SuccessfullySaved,\r\n    SaveResultText: \"\",\r\n    Items: [],\r\n    IsConsortium: false\r\n  }\r\n  return result;\r\n}\r\nexport function CreateEmptyPoolCriteriaItem(): PoolCriteriaItem {\r\n  const result: PoolCriteriaItem = {\r\n    FilterCriteriaID: 0,\r\n    FilterCriteriaName: \"\",\r\n    Name: \"\",\r\n    Values: []\r\n  }\r\n  return result;\r\n}\r\nexport function FilterDataToPoolCriteria(poolId: number, filterData: FilterData, skipCompany: boolean = false): PoolCriteria {\r\n\r\n  let result: PoolCriteria = CreateEmptyPoolCriteria(poolId);\r\n  result.ImplementationID = filterData.ImplementationID;\r\n  result.FilterModuleID = filterData.FilterModuleID\r\n  result.FilterDataID = filterData.FilterDataID;\r\n  result.SaveAs = filterData.Name;\r\n  result.IsFilter = true;\r\n  for (let i = 0; i < filterData.Items.length; i++) {\r\n    const filterDataItem: FilterDataItem = filterData.Items[i];\r\n    if (skipCompany && filterDataItem.FilterCriteriaID === FilterCriteriaCode.Company) {\r\n      continue\r\n    }\r\n    const poolCriteriaItem: PoolCriteriaItem = FilterDataItemToPoolCriteriaItem(filterDataItem)\r\n    result.Items.push(poolCriteriaItem)\r\n  }\r\n  return result;\r\n}\r\n\r\nexport function FilterDataItemToPoolCriteriaItem(filterDataItem: FilterDataItem): PoolCriteriaItem {\r\n  let result: PoolCriteriaItem = CreateEmptyPoolCriteriaItem();\r\n  result.FilterCriteriaID = filterDataItem.FilterCriteriaID;\r\n  result.FilterCriteriaName = filterDataItem.FilterCriteriaName;\r\n  result.Name = filterDataItem.Name;\r\n  for (let i = 0; i < filterDataItem.Values.length; i++) {\r\n    const filterDataValue: FilterDataValue = filterDataItem.Values[i];\r\n    const poolCriteriaValue: PoolCriteriaValue = FilterDataValueToPoolCriteriaValue(filterDataValue);\r\n    result.Values.push(poolCriteriaValue);\r\n  }\r\n  return result\r\n}\r\n\r\nexport function FilterDataValueToPoolCriteriaValue(src: FilterDataValue): PoolCriteriaValue {\r\n  const result: PoolCriteriaValue = {\r\n    ID: src.ID,\r\n    IntValue: src.IntValue,\r\n    StringValue: src.StringValue,\r\n    StringValue2: \"\",\r\n    StringValue3: \"\",\r\n    BoolValue: src.BoolValue\r\n  }\r\n  return result\r\n}\r\n\r\nexport function CopyPoolCriteriaValue(src: PoolCriteriaValue):PoolCriteriaValue\r\n{\r\n  const result: PoolCriteriaValue = {\r\n    ID: src.ID,\r\n    IntValue: src.IntValue,\r\n    StringValue: src.StringValue,\r\n    StringValue2: src.StringValue2 || \"\",\r\n    StringValue3: src.StringValue3 || \"\",\r\n    BoolValue: src.BoolValue\r\n  }\r\n  return result\r\n}\r\n\r\nexport function CopyPoolCriteriaValues(src: PoolCriteriaValue[]):PoolCriteriaValue[]\r\n{\r\n  const result: PoolCriteriaValue[] = []\r\n  for (let i = 0; i < src.length; i++) {\r\n    const item = CopyPoolCriteriaValue(src[i])\r\n    result.push(item)\r\n  }\r\n  return result\r\n}\r\nexport function CopyPoolCriteriaItem(src: PoolCriteriaItem): PoolCriteriaItem {\r\n  const result: PoolCriteriaItem = CreateEmptyPoolCriteriaItem();\r\n  result.FilterCriteriaID = src.FilterCriteriaID;\r\n  result.FilterCriteriaName = src.FilterCriteriaName;\r\n  result.Name = src.Name;\r\n  result.Values = CopyPoolCriteriaValues(src.Values)\r\n  return result\r\n}\r\nexport function CopyPoolCriteriaItems(src: PoolCriteriaItem[]): PoolCriteriaItem[] {\r\n  const result: PoolCriteriaItem[] = []\r\n  for (let i = 0; i < src.length; i++) {\r\n    const item = CopyPoolCriteriaItem(src[i])\r\n    result.push(item)\r\n  }\r\n  return result\r\n}\r\nexport function CopyPoolCriteria(src: PoolCriteria): PoolCriteria {\r\n  const result: PoolCriteria = CreateEmptyPoolCriteria(src.PoolID);\r\n  result.ImplementationID = src.ImplementationID;\r\n  result.FilterModuleID = src.FilterModuleID;\r\n  result.FilterDataID = src.FilterDataID;\r\n  result.SaveAs = src.SaveAs;\r\n  result.ForceOverride = src.ForceOverride;\r\n  result.IsFilter = src.IsFilter;\r\n  result.UserName = src.UserName;\r\n  result.UserLoginID = src.UserLoginID;\r\n  result.SaveResultCode = src.SaveResultCode;\r\n  result.SaveResultText = src.SaveResultText;\r\n  result.Items = CopyPoolCriteriaItems(src.Items)\r\n\r\n  return result\r\n\r\n}\r\n\r\nexport interface GetPoolCriteriaParams {\r\n  PoolID: number\r\n  ImplementationID: number\r\n  FilterModuleID: number\r\n  UserName: string\r\n  UserLoginID: number\r\n}\r\n\r\nexport interface GetSavedQueriesParams {\r\n  ImplementationID: number\r\n  FilterModuleID: number\r\n}\r\nexport interface GetSavedQueryParams {\r\n  FilterDataID: number\r\n  Name: string\r\n  ImplementationID: number\r\n  FilterModuleID: number\r\n  UserName: string\r\n  UserLoginID: number\r\n}\r\nexport interface DeleteSavedQueryParams {\r\n  FilterDataID: number\r\n}\r\n\r\nexport function GetPoolCriteria(poolId: number): Observable<PoolCriteria> {\r\n  const params: string = JSON.stringify({\r\n    PoolID: poolId,\r\n    ImplementationID: 0,\r\n    FilterModuleID: FilterDataModule.RandomModule,\r\n    UserName: \"\",\r\n    UserLoginID: 0\r\n  })\r\n  return ObservableFromFetch<PoolCriteria>(\"RandomTest/GetPoolCriteria\", params)\r\n}\r\n\r\nexport function SavePoolCriteria(poolCriteria: PoolCriteria): Observable<PoolCriteria> {\r\n  const params: string = JSON.stringify(poolCriteria)\r\n  return ObservableFromFetch<PoolCriteria>(\"RandomTest/SavePoolCriteria\", params)\r\n}\r\n\r\nexport function GetSavedQueries(implementationID: number): Observable<FilterDataName[]> {\r\n  const params: string = JSON.stringify({\r\n    ImplementationID: implementationID,\r\n    FilterModuleID: FilterDataModule.RandomModule\r\n  })\r\n  return ObservableFromFetch<FilterDataName[]>(\"RandomTest/GetSavedQueries\", params)\r\n}\r\n\r\nexport function GetSavedQuery(filterDataID: number, name: string): Observable<FilterData> {\r\n  const params: string = JSON.stringify({\r\n    FilterDataID: filterDataID,\r\n    Name: name,\r\n    ImplementationID: 0,\r\n    FilterModuleID: FilterDataModule.RandomModule,\r\n    UserName: \"\",\r\n    UserLoginID: 0\r\n  })\r\n  return ObservableFromFetch<FilterData>(\"RandomTest/GetSavedQuery\", params)\r\n}\r\n\r\nexport function DeleteSavedQuery(filterDataID: number): Observable<number> {\r\n  const params: string = JSON.stringify({\r\n    FilterDataID: filterDataID\r\n  })\r\n  return ObservableFromFetch<number>(\"RandomTest/DeleteSavedQuery\", params)\r\n}\r\nexport function SaveQuery(poolCriteria: PoolCriteria): Observable<FilterData> {\r\n  const params: string = JSON.stringify(poolCriteria)\r\n  return ObservableFromFetch<FilterData>(\"RandomTest/SaveQuery\", params)\r\n}\r\nexport function SaveQueryAs(poolCriteria: PoolCriteria, name: string): Observable<FilterData> {\r\n  poolCriteria.SaveAs = name;\r\n  poolCriteria.ForceOverride = true;\r\n  poolCriteria.FilterModuleID = FilterDataModule.RandomModule;\r\n  const params: string = JSON.stringify(poolCriteria)\r\n  return ObservableFromFetch<FilterData>(\"RandomTest/SaveQueryAs\", params)\r\n}\r\n","import * as React from \"react\"\r\nimport { Button, Spinner, Table } from \"react-bootstrap\"\r\nimport { format, parseISO } from \"date-fns\"\r\nimport { BehaviorSubject, concat, of, Subscription } from \"rxjs\"\r\nimport { distinctUntilChanged, switchMap, map } from \"rxjs/operators\"\r\nimport TablePagination from \"../../TablePagination\"\r\nimport PoolSelection from \"../../../api/Randoms/RandomsModel/PoolSelection\"\r\nimport PoolSelectionRow from \"../../../api/Randoms/RandomsModel/PoolSelectionRow\"\r\nimport RandomSelectionList from \"../RandomSelectionList\"\r\nimport PoolSelectionListGet from \"../../../api/Randoms/PoolSelectionListGet\"\r\nimport PoolSelectionActionButtons from \"./PoolSelectionActionButtons\"\r\n\r\ninterface PoolSelectionSearchParams {\r\n  pageNumber: number\r\n  poolId: number\r\n}\r\n\r\nconst PageSize = 5\r\n\r\ninterface TestingPeriodBreakdownGridProps {\r\n  poolId: number\r\n  poolName: string\r\n  showRandomSelectionLink?: boolean\r\n  companyId?: number\r\n  unmaskDonorId: number\r\n}\r\n\r\ninterface TestingPeriodBreakdownGridState {\r\n  loading: boolean\r\n  data?: PoolSelection\r\n  selectionListModal: boolean\r\n  poolSelection?: PoolSelectionRow\r\n}\r\n\r\nexport default class TestingPeriodBreakdownGrid extends React.PureComponent<TestingPeriodBreakdownGridProps, TestingPeriodBreakdownGridState> {\r\n  state: TestingPeriodBreakdownGridState = {\r\n    loading: false,\r\n    selectionListModal: false\r\n  }\r\n\r\n  page$ = new BehaviorSubject<PoolSelectionSearchParams>({\r\n    pageNumber: 1,\r\n    poolId: 10\r\n  })\r\n\r\n  pageSubscription?: Subscription\r\n\r\n  componentDidMount() {\r\n    this.pageSubscription = this.page$.pipe(\r\n      distinctUntilChanged(),\r\n      switchMap(params => concat(\r\n        of({ loading: true }),\r\n        PoolSelectionListGet(this.props.poolId, params.pageNumber, PageSize, this.props.companyId).pipe(\r\n          map((result: PoolSelection) => ({ data: result, loading: false })))\r\n      ))\r\n    ).subscribe(\r\n      (newState: { loading: boolean, data?: PoolSelection }) => {\r\n        if (newState.data) {\r\n          this.setState({ loading: newState.loading, data: newState.data })\r\n        } else {\r\n          this.setState({ loading: newState.loading })\r\n        }\r\n      },\r\n      () => {\r\n        this.setState({ loading: false })\r\n      }\r\n    )\r\n  }\r\n\r\n  componentDidUpdate(prevProps: TestingPeriodBreakdownGridProps, prevState: TestingPeriodBreakdownGridState) {\r\n    if (prevProps.companyId !== this.props.companyId) {\r\n      this.page$.next({ poolId: this.props.poolId, pageNumber: 1 })\r\n    }\r\n  }\r\n\r\n  componentWillUnmount() {\r\n    this.pageSubscription && this.pageSubscription.unsubscribe()\r\n  }\r\n\r\n  pageChanged = (pageNumber: number) => {\r\n    this.page$.next({ ...this.page$.value, pageNumber: pageNumber })\r\n  }\r\n\r\n  convertDate = (date: string) => {\r\n    if (date) {\r\n      return format(parseISO(date), \"MM/dd/yyyy\")\r\n    } else {\r\n      return \"\"\r\n    }\r\n  }\r\n\r\n  renderRows = () => {\r\n    if (this.state.data && this.state.data.Records && this.state.data.Records.length) {\r\n      return this.state.data.Records.map((row: PoolSelectionRow, i: number) =>\r\n        <tr key={i}>\r\n          <td>\r\n            {this.props.showRandomSelectionLink && <Button variant=\"link\" onClick={() => this.showSelectionList(row)} className=\"p-0\">{row.Period}</Button>}\r\n            {!this.props.showRandomSelectionLink && row.Period}\r\n          </td>\r\n          <td className=\"text-center\">{row.PoolSize}</td>\r\n          <td className=\"text-center\">{this.convertDate(row.SelectionDate)}</td>\r\n          <td className=\"text-center border-left\">{row.DrugSelected}</td>\r\n          <td className=\"text-center\">{row.AlcoholSelected}</td>\r\n          <td className=\"text-center border-left\">{row.DrugExtra}</td>\r\n          <td className=\"text-center\">{row.AlcoholExtra}</td>\r\n          <td className=\"text-center border-left\">{row.DrugCompleted}</td>\r\n          <td className=\"text-center\">{row.AlcoholCompleted}</td>\r\n          <td className=\"text-center\">{row.Status === 1 && \"Canceled\" }</td>\r\n          <td className=\"text-center\">\r\n            <PoolSelectionActionButtons\r\n              poolId={this.props.poolId}\r\n              companyId={this.props.companyId || 0}\r\n              row={row}\r\n              onRefresh={() => this.page$.next({ poolId: this.props.poolId, pageNumber: 1 })}\r\n            />\r\n          </td>\r\n        </tr>)\r\n    } else {\r\n      return <tr><td colSpan={11}>NO DATA FOUND</td></tr>\r\n    }\r\n  }\r\n\r\n  showSelectionList = (poolSelection: PoolSelectionRow) => this.setState({ selectionListModal: true, poolSelection: poolSelection })\r\n\r\n  hideSelectionList = () => this.setState({ selectionListModal: false, poolSelection: undefined })\r\n\r\n  render() {\r\n    return <>\r\n      <h5>TESTING PERIOD BREAKDOWN</h5>\r\n      <Table responsive className=\"table-sm dark\">\r\n        <thead>\r\n          <tr className=\"text-normal\">\r\n            <th className=\"border-bottom-0\">PERIOD</th>\r\n            <th className=\"border-bottom-0 text-center\">POOL SIZE</th>\r\n            <th className=\"border-bottom-0 text-center\">SELECTION DATE</th>\r\n            <th className=\"border-bottom-0 text-center\" colSpan={2}>TESTS SELECTED</th>\r\n            <th className=\"border-bottom-0 text-center\" colSpan={2}>EXTRA TESTS</th>\r\n            <th className=\"border-bottom-0 text-center\" colSpan={2}>TESTS COMPLETED</th>\r\n            <th className=\"border-bottom-0 text-center\" colSpan={2}></th>\r\n          </tr>\r\n          <tr className=\"text-normal\">\r\n            <th className=\"border-top-0\"></th>\r\n            <th className=\"border-top-0\"></th>\r\n            <th className=\"border-top-0\"></th>\r\n            <th className=\"border-top-0 text-center\">DRUG</th>\r\n            <th className=\"border-top-0 text-center\">ALCOHOL</th>\r\n            <th className=\"border-top-0 text-center\">DRUG</th>\r\n            <th className=\"border-top-0 text-center\">ALCOHOL</th>\r\n            <th className=\"border-top-0 text-center\">DRUG</th>\r\n            <th className=\"border-top-0 text-center\">ALCOHOL</th>\r\n            <th className=\"border-top-0 text-center\">STATUS</th>\r\n            <th className=\"border-top-0 text-center\">ACTION</th>\r\n          </tr>\r\n        </thead>\r\n        <tbody>\r\n          {\r\n            this.state.loading ?\r\n              <tr>\r\n                <td className=\"text-center\" colSpan={11}>\r\n                  <Spinner animation=\"border\" variant=\"secondary\" />\r\n                </td>\r\n              </tr> : this.renderRows()\r\n          }\r\n        </tbody>\r\n      </Table>\r\n      {this.state.data && <TablePagination pageNumber={this.page$.value.pageNumber} pages={this.state.data.Pages} onChange={this.pageChanged} />}\r\n      {\r\n        this.state.selectionListModal && this.state.poolSelection &&\r\n        <RandomSelectionList onHide={this.hideSelectionList} show={this.state.selectionListModal} accountId={this.props.companyId}\r\n          poolId={this.props.poolId} poolName={this.props.poolName} poolSelection={this.state.poolSelection} \r\n          unmaskDonorId={this.props.unmaskDonorId}/>\r\n      }\r\n    </>\r\n  }\r\n}\r\n","import { \r\n  ReportCertificationRenewalRoute,\r\n  ReportCertificationStatusRoute,\r\n  ReportManagementSummaryRoute,\r\n  ReportMISRoute,\r\n  ReportSelectedNotTestedRoute,\r\n  ReportSummaryRoute,\r\n} from \"../../config/Routes\"\r\nimport GridResponse from \"../GridResponse\"\r\nimport { ObservableFromFetch } from \"../ObservableFromFetch\"\r\n\r\nexport enum WorkforceReportType {\r\n  CertificationRenewal = 42,\r\n  CertificationStatus = 41,\r\n  ManagementSummary = 2,\r\n  MIS = -37,\r\n  SelectedNotTested = 6,\r\n  Summary = -45,\r\n}\r\n\r\nconst Reports = [\r\n  ReportCertificationRenewalRoute,\r\n  ReportCertificationStatusRoute,\r\n  ReportManagementSummaryRoute,\r\n  ReportMISRoute,\r\n  ReportSelectedNotTestedRoute,\r\n  ReportSummaryRoute,\r\n] as const\r\nexport type Report = typeof Reports[number]\r\nexport type WorkforceReportRecord = {\r\n  type: WorkforceReportType\r\n  title: string\r\n}\r\nexport type WorkforceReport = Record<Report, WorkforceReportRecord>\r\n\r\nexport default function getWorkforceReport(report: Report) {\r\n  const WorkforceReports: WorkforceReport = {\r\n    [ReportCertificationRenewalRoute]: { type: WorkforceReportType.CertificationRenewal, title: \"Driver Certification Renewal Report\" },\r\n    [ReportCertificationStatusRoute]: { type: WorkforceReportType.CertificationStatus, title: \"Driver Certification Status Report\" },\r\n    [ReportManagementSummaryRoute]: { type: WorkforceReportType.ManagementSummary, title: \"Management Summary Report\" },\r\n    [ReportMISRoute]: { type: WorkforceReportType.MIS, title: \"MIS Report\" },\r\n    [ReportSelectedNotTestedRoute]: { type: WorkforceReportType.SelectedNotTested, title: \"Selected Not Tested Report\" },\r\n    [ReportSummaryRoute]: { type: WorkforceReportType.Summary, title: \"Summary Report\" },\r\n  }\r\n  return WorkforceReports[report]\r\n}\r\n\r\nexport function RegulatoryModesGet() {\r\n  return ObservableFromFetch<string[]>(\"report/GetRegulatoryList\")\r\n}\r\n\r\nexport function YearListGet() {\r\n  return ObservableFromFetch<number[]>(\"report/GetYearList\")\r\n}\r\n\r\nexport interface ManagementSummaryReport {\r\n  AccountTypeID: number\r\n  BreakByCompanies: boolean\r\n  BreakByLocations: boolean\r\n  ClientDetails: object\r\n  Company: number[]\r\n  DateFrom: string\r\n  DateTo: string\r\n  DateType: string\r\n  IncludeAlcoholTests: boolean\r\n  MasterAccount?: number | null\r\n  ReportID: number\r\n}\r\n\r\nexport interface MISReport {\r\n  AccountType: number\r\n  AccountID: number\r\n  DtFromDate: string\r\n  DtToDate: string\r\n  RegMode: string\r\n  ReportMode: number\r\n  Year: string\r\n  Company:number[]\r\n}\r\n\r\nexport interface ExcusedReport {\r\n  AccountID: number\r\n  PoolID: number\r\n  PoolName: string\r\n}\r\n\r\nexport interface AuditPoolReport {\r\n  DateFrom: string\r\n  DateTo: string\r\n  AllDates: boolean\r\n  PoolID: number\r\n  PoolName: string\r\n}\r\n\r\nexport interface PositiveReport {\r\n  DateFrom: string\r\n  DateTo: string\r\n  DateType: string\r\n  CompanyIds: number[]\r\n  PageNumber?: number\r\n  PageSize?: number\r\n}\r\n\r\nexport interface PositiveReportRow {\r\n  CompanyName: string\r\n  LocationName: string\r\n  TestDetailID: string\r\n  TestEventID: string\r\n  RegulatoryMode: string\r\n  EmployeeCategory: string\r\n  ReferenceID: string\r\n  DonorID: string\r\n  DonorFirstName: string\r\n  DonorLastName: string\r\n  TestType: string\r\n  ResultCode: string\r\n  ResultDescription: string\r\n  DateCollected: string\r\n  MROReportDate: string\r\n  PositiveDrugList: string\r\n  Reason: string\r\n  Regulated: string\r\n}\r\n\r\nexport function ManagementSummaryReportGenerate(parameters: ManagementSummaryReport) {\r\n  const requestBody = JSON.stringify(parameters)\r\n  return ObservableFromFetch<string>(\"WorkforceReport/ManagementSummaryReport\", requestBody)\r\n}\r\n\r\nexport function MISReportGenerate(parameters: MISReport) {\r\n  const requestBody = JSON.stringify(parameters)\r\n  return ObservableFromFetch<string>(\"report/MISReport\", requestBody)\r\n}\r\n\r\nexport function ExcusedReportGenerate(parameters: ExcusedReport) {\r\n  const requestBody = JSON.stringify(parameters)\r\n  return ObservableFromFetch<string>(\"WorkforceReport/ExcusedReport\", requestBody)\r\n}\r\n\r\nexport function AuditPoolReportGenerate(parameters: AuditPoolReport) {\r\n  const requestBody = JSON.stringify(parameters)\r\n  return ObservableFromFetch<string>(\"WorkforceReport/AuditPoolReport\", requestBody)\r\n}\r\n\r\nexport interface SelectedNotTestedReportParameters {\r\n  fromDate?: string\r\n  toDate?: string\r\n  accountID?: number\r\n  poolID?: number\r\n  personID?: number\r\n  CompanyName: string\r\n  LocationName: string\r\n  PoolName: string\r\n  DonorName: string\r\n  OutputFormat:string\r\n}\r\n\r\nexport function SelectedNotTestedReportGenerate(parameters: SelectedNotTestedReportParameters) {\r\n  const requestBody: string = JSON.stringify(parameters)\r\n\r\n  return ObservableFromFetch<string>(\"WorkforceReport/SelectedNotTestedReport\", requestBody)\r\n}\r\n\r\nexport function PositiveReportLoad(parameters: PositiveReport) {\r\n  const requestBody = JSON.stringify(parameters)\r\n  return ObservableFromFetch<GridResponse<PositiveReportRow>>(\"WorkforceReport/PositiveReport\", requestBody)\r\n}\r\n\r\nexport function PositiveReportExport(parameters: PositiveReport) {\r\n  const requestBody = JSON.stringify(parameters)\r\n  return ObservableFromFetch<string>(\"WorkforceReport/ExportPositiveReport\", requestBody)\r\n}\r\n","export default function FormatData(data: string): Uint8Array {\r\n  var byteCharacters = atob(data)\r\n  var byteNumbers = new Array(byteCharacters.length)\r\n\r\n  for (var k = 0; k < byteCharacters.length; k++) {\r\n    byteNumbers[k] = byteCharacters.charCodeAt(k)\r\n  }\r\n\r\n  var byteArray = new Uint8Array(byteNumbers)\r\n  return byteArray\r\n}","import FormatData from \"../formatters/FormatBase64\"\r\n\r\nexport default function printPdf(data: string) {\r\n    const fileData = new Blob([FormatData(data)], { type: \"application/pdf\" })\r\n    const fileURL = URL.createObjectURL(fileData)\r\n    window.open(fileURL)\r\n}\r\nexport  function showPdf(data: string) {\r\n    const fileData = new Blob([FormatData(data)], { type: \"application/pdf\" })\r\n    const fileURL = URL.createObjectURL(fileData)\r\n    window.location.replace(fileURL)\r\n}\r\n","import React, {Component} from \"react\"\r\nimport { Form, InputGroup, Button } from \"react-bootstrap\"\r\nimport MaskedInput from \"react-maskedinput\"\r\nimport { FaCalendarAlt } from \"react-icons/fa\"\r\n\r\ninterface BirthdayInputProps {\r\n  required?: boolean\r\n  isInvalid?: boolean\r\n  placeholder?: string\r\n  value?: string\r\n  onClick?: () => void\r\n  onChange?: () => void\r\n}\r\n\r\nexport class BirthdayInput extends Component<BirthdayInputProps> {\r\n  render() {\r\n    return (\r\n      <InputGroup>\r\n        <Form.Control\r\n          {...this.props}\r\n          type=\"text\"\r\n          placeholder=\"MM/DD/YYYY\"\r\n          mask=\"11/11/1111\"\r\n          onClick={() => {}}\r\n          isInvalid={this.props.isInvalid || (this.props.required && !this.props.value)}\r\n          as={MaskedInput}\r\n          />\r\n        <InputGroup.Append>\r\n          <Button className=\"btn-rounded-right\" onClick={this.props.onClick}>\r\n            <FaCalendarAlt />\r\n          </Button>\r\n        </InputGroup.Append>\r\n      </InputGroup>\r\n    )\r\n  }\r\n}\r\n","import * as React from \"react\"\r\nimport { Form, Col } from \"react-bootstrap\"\r\nimport DatePicker from \"react-datepicker\"\r\nimport { BirthdayInput } from \"../FormattedInputs/BirthdayInput\"\r\n\r\ninterface FromToDatesProps {\r\n  from?: Date\r\n  to?: Date\r\n  minDate?: Date\r\n  disabled?: boolean\r\n  onChangeFrom: (date: Date) => void\r\n  onChangeTo: (date: Date) => void\r\n}\r\n\r\ninterface FromToDatesState {\r\n  from?: Date\r\n  to?: Date\r\n}\r\n\r\nexport default class FromToDates extends React.PureComponent<FromToDatesProps, FromToDatesState> {\r\n  state: FromToDatesState = { }\r\n\r\n  onFromSelect = (date: Date) => this.props.onChangeFrom(date)\r\n  onToSelect = (date: Date) => this.props.onChangeTo(date)\r\n\r\n  componentDidUpdate(prevProps: FromToDatesProps) {\r\n    if (prevProps.from !== this.props.from || prevProps.to !== this.props.to) {\r\n      this.setState({ from: this.props.from, to: this.props.to })\r\n    }\r\n  }\r\n\r\n  render() {\r\n    const { from, to } = this.state\r\n    const { disabled } = this.props\r\n\r\n    return (<Form>\r\n      <Form.Row className=\"form-group\">\r\n        <Form.Label column lg={2} htmlFor=\"from\" className={disabled ? \"\" : \"required\"}>From</Form.Label>\r\n          <Col lg={6}>\r\n            <DatePicker id=\"from\"\r\n              className=\"form-control\"\r\n              showMonthDropdown\r\n              showYearDropdown\r\n              dropdownMode=\"select\"\r\n              enableTabLoop={false}\r\n              selected={from}\r\n              disabled={disabled}\r\n              minDate={this.props.minDate}\r\n              maxDate={to || new Date()}\r\n              onChange={date => this.onFromSelect(date as Date)}\r\n              customInput={<BirthdayInput />}\r\n            />\r\n          </Col>\r\n      </Form.Row>\r\n      <Form.Row className=\"form-group\">\r\n        <Form.Label column lg={2} htmlFor=\"to\" className={disabled ? \"\" : \"required\"}>To</Form.Label>\r\n        <Col lg={6}>\r\n          <DatePicker id=\"to\"\r\n            className=\"form-control\"\r\n            showMonthDropdown\r\n            showYearDropdown\r\n            dropdownMode=\"select\"\r\n            enableTabLoop={false}\r\n            selected={to}\r\n            disabled={disabled}\r\n            minDate={from}\r\n            maxDate={new Date()}\r\n            onChange={date => this.onToSelect(date as Date)}\r\n            customInput={<BirthdayInput />}\r\n          />\r\n        </Col>\r\n      </Form.Row>\r\n    </Form>)\r\n  }\r\n}","import { useState } from \"react\"\r\n\r\nimport { Button, Col, Form, Modal, Row } from \"react-bootstrap\"\r\nimport { FaSync } from \"react-icons/fa\"\r\n\r\nimport { AuditPoolReportGenerate } from \"../../../api/Reports/WorkforceReport\"\r\nimport FormatDate from \"../../../formatters/FormatDate\"\r\nimport handleAPIError from \"../../../utils/handleAPIError\"\r\nimport printPdf from \"../../../utils/printPdf\"\r\nimport ActionButton from \"../../ActionButton\"\r\nimport FromToDates from \"../../Reports/FromToDates\"\r\n\r\ninterface AuditPoolModalProps {\r\n  poolID: number\r\n  poolName: string\r\n  onClose: () => void\r\n}\r\n\r\nconst AuditPoolModal = (props: AuditPoolModalProps) => {\r\n  const { onClose, poolID, poolName } = props\r\n  const [generating, setGenerating] = useState(false)\r\n  const [from, setFrom] = useState<Date>()\r\n  const [to, setTo] = useState<Date>()\r\n  const [includeAllDates, setIncludeAllDates] = useState<boolean>(false)\r\n\r\n  const handleCancelClick = () => onClose()\r\n  const handleClearClick = () => {\r\n    setFrom(undefined)\r\n    setTo(undefined)\r\n  }\r\n\r\n  const getReportParams = () => ({\r\n    DateFrom: FormatDate(from),\r\n    DateTo: FormatDate(to),\r\n    AllDates: includeAllDates,\r\n    PoolID: poolID,\r\n    PoolName: poolName,\r\n  })\r\n\r\n  const checkAllDates = (checked: boolean) => {\r\n    setIncludeAllDates(checked)\r\n    setFrom(undefined)\r\n    setTo(undefined)\r\n  }\r\n\r\n  const handleGenerateCsvClick = () => {\r\n    setGenerating(true)\r\n    AuditPoolReportGenerate(getReportParams()).subscribe(\r\n      (base64pdf: string) => {\r\n        setGenerating(false)\r\n        printPdf(base64pdf)\r\n      },\r\n      (error) => handleAPIError(error, () => setGenerating(false))\r\n    )\r\n  }\r\n\r\n  const isParamsValid = () => includeAllDates || (!!from && !!to)\r\n\r\n  return (\r\n    <Modal backdrop=\"static\" centered show onHide={() => handleCancelClick()}>\r\n      <Modal.Header closeButton>\r\n        <Modal.Title className=\"text-uppercase\">EXPORT CSV OPTIONS:</Modal.Title>\r\n      </Modal.Header>\r\n      <Modal.Body className=\"pt-3\">\r\n        <Form>\r\n          <Row>\r\n            <Col sm={4}>\r\n              <Form.Label htmlFor=\"include_all_dates\">Include All Dates</Form.Label>\r\n            </Col>\r\n            <Col>\r\n              <Form.Check\r\n                id=\"include_all_dates\"\r\n                type=\"checkbox\"\r\n                inline\r\n                className=\"abc-checkbox abc-checkbox-inline\"\r\n                label=\"\"\r\n                value={includeAllDates ? 1 : 0}\r\n                checked={includeAllDates}\r\n                onChange={(e) => checkAllDates(e.target.checked)}\r\n              />\r\n            </Col>\r\n          </Row>\r\n          {!includeAllDates && (\r\n            <Row>\r\n              <Col>\r\n                <FromToDates from={from} to={to} onChangeFrom={setFrom} onChangeTo={setTo} />\r\n              </Col>\r\n            </Row>\r\n          )}\r\n        </Form>\r\n      </Modal.Body>\r\n      <Modal.Footer>\r\n        <Button variant=\"secondary\" onClick={handleCancelClick}>\r\n          Cancel\r\n        </Button>\r\n        <Button variant=\"secondary\" className=\"mr-auto\" onClick={handleClearClick}>\r\n          Clear Filter&nbsp;\r\n          <FaSync />\r\n        </Button>\r\n        <ActionButton\r\n          variant=\"primary\"\r\n          disabled={!isParamsValid()}\r\n          onClick={handleGenerateCsvClick}\r\n          spin={generating}\r\n          disableOnSpin\r\n        >\r\n          Export\r\n        </ActionButton>\r\n      </Modal.Footer>\r\n    </Modal>\r\n  )\r\n}\r\nexport default AuditPoolModal\r\n","import * as React from \"react\"\r\nimport { Container, Row, Col, Spinner, Form, Button } from \"react-bootstrap\"\r\nimport { defaults, HorizontalBar } from \"react-chartjs-2\"\r\nimport \"chartjs-plugin-datalabels\"\r\nimport { ChartData, ChartOptions } from \"chart.js\"\r\nimport { concat, of, Subject, Subscription } from \"rxjs\"\r\nimport { catchError, map, switchMap } from \"rxjs/operators\"\r\nimport PoolStatisticsDetailsGet from \"../../../api/Randoms/PoolStatisticsDetailsGet\"\r\nimport PoolStatisticsDetails from \"../../../api/Randoms/RandomsModel/PoolStatisticsDetails\"\r\nimport TestingPeriodBreakdownGrid from \"./TestingPeriodBreakdownGrid\"\r\nimport PoolCriteria, { GetCompanyPoolCriteriaItem, GetPoolCriteria } from \"../../../api/Randoms/RandomsModel/PoolCriteria\"\r\nimport { ExcusedReport, ExcusedReportGenerate } from \"../../../api/Reports/WorkforceReport\"\r\nimport FormatError from \"../../../formatters/FormatError\"\r\nimport { toast } from \"react-toastify\"\r\nimport printPdf from \"../../../utils/printPdf\"\r\nimport AuditPoolModal from \"./AuditPoolModal\"\r\n\r\ninterface PoolStatisticsProps {\r\n  poolId: number\r\n  poolName: string\r\n  isConsortium: boolean\r\n  currentCompany: number\r\n  allowExcusedReport: boolean\r\n  allowAuditReport: boolean\r\n  unmaskDonorId: number\r\n}\r\n\r\ninterface PoolStatisticsState {\r\n  statisticsLoading: boolean\r\n  criteriaLoading: boolean\r\n  statistics?: PoolStatisticsDetails\r\n  poolCriteria?: PoolCriteria\r\n  companies: {ID: number, Name: string, CompanyName: string, CompanyCode: string}[]\r\n  selectedCompany: number,\r\n  showAuditPoolOptions: boolean,\r\n}\r\n\r\nconst options: ChartOptions = {\r\n  maintainAspectRatio: false,\r\n  layout: {\r\n    padding: {\r\n      right: 50\r\n    }\r\n  },\r\n  legend: {\r\n    position: 'bottom',\r\n    labels: {\r\n      usePointStyle: true,\r\n      boxWidth: 10,\r\n      fontSize: 16\r\n    }\r\n  },\r\n  plugins: {\r\n    datalabels: {\r\n      color: '#000',\r\n      display: true\r\n    }\r\n  },\r\n  scales: {\r\n    yAxes: [{ ticks: { fontSize: 16 } }],\r\n    xAxes: [{ ticks: { min: 0 } }]\r\n  }\r\n}\r\n\r\ndefaults.global.defaultFontFamily = '-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, \"Helvetica Neue\", Arial, \"Noto Sans\", sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\", \"Noto Color Emoji\"'\r\ndefaults.global.defaultFontColor = '#212529'\r\n\r\nexport default class PoolStatistics extends React.PureComponent<PoolStatisticsProps, PoolStatisticsState> {\r\n  state: PoolStatisticsState = {\r\n    statisticsLoading: false,\r\n    criteriaLoading: false,\r\n    companies: [],\r\n    selectedCompany: this.props.currentCompany,\r\n    showAuditPoolOptions: false,\r\n  }\r\n\r\n  subscriptions = new Subscription()\r\n  company$ = new Subject<number>()\r\n\r\n  componentDidMount() {\r\n    this.subscriptions.add(this.company$.pipe(\r\n      switchMap(company => concat(\r\n        of({ statisticsLoading: true }),\r\n        PoolStatisticsDetailsGet(this.props.poolId, company).pipe(\r\n          map(result => ({ statisticsLoading: false, result: result })),\r\n          catchError(() => of({ statisticsLoading: false }))\r\n        )\r\n      ))\r\n    ).subscribe(\r\n      (data: { statisticsLoading: boolean, result?: PoolStatisticsDetails }) => {\r\n        this.setState({\r\n          statisticsLoading: data.statisticsLoading,\r\n          statistics: data.result\r\n        })\r\n      }))\r\n\r\n    if (this.props.isConsortium) {\r\n      this.setState({ criteriaLoading: true })\r\n      this.subscriptions.add(GetPoolCriteria(this.props.poolId).subscribe(\r\n          (data: PoolCriteria) => {\r\n            const companyItem = GetCompanyPoolCriteriaItem(data)\r\n            const companies = companyItem.Values.map(value => {return {ID: value.IntValue, Name: value.StringValue,  CompanyName: value.StringValue2 || \"\", CompanyCode: value.StringValue3 || \"\"}})\r\n            this.setState({ poolCriteria: data, companies: companies, criteriaLoading: false })\r\n          },\r\n          () => this.setState({ criteriaLoading: false })\r\n        )\r\n      )\r\n    }\r\n\r\n    this.setState({ statisticsLoading: true })\r\n    this.company$.next(this.props.currentCompany)\r\n  }\r\n\r\n  componentWillUnmount() {\r\n    this.subscriptions && this.subscriptions.unsubscribe()\r\n  }\r\n\r\n  onCompanySelect = (event: React.ChangeEvent<HTMLSelectElement>) => {\r\n    const accountID = Number(event.target.value)\r\n    this.setState({selectedCompany: accountID})\r\n    this.company$.next(accountID)\r\n  }\r\n\r\n  runExcusedReport = () => {\r\n    const params: ExcusedReport = {\r\n      AccountID: this.state.selectedCompany,\r\n      PoolID: this.props.poolId,\r\n      PoolName: this.props.poolName\r\n    }\r\n\r\n    this.subscriptions.add(\r\n      ExcusedReportGenerate(params).subscribe(\r\n        (base64pdf: string) => printPdf(base64pdf),\r\n        (error) => toast.error(FormatError(error))\r\n      )\r\n    )\r\n  }\r\n\r\n  render() {\r\n    const { statistics, selectedCompany, companies, showAuditPoolOptions } = this.state\r\n\r\n    let labels = ['ESTIMATED TESTS REQUIRED', 'TOTAL TESTS COMPLETED', 'TOTAL TESTS PENDING COLLECTION'];\r\n    let dataDrug = [statistics?.TotalTestsRequiredDrug, statistics?.TotalTestsCompletedDrug, statistics?.TotalTestsPendingDrug]\r\n    let dataAlco = [statistics?.TotalTestsRequiredAlcohol, statistics?.TotalTestsCompletedAlcohol, statistics?.TotalTestsPendingAlcohol]\r\n    if (selectedCompany > 0) {\r\n      labels = labels.slice(1,3)\r\n      dataDrug = dataDrug.slice(1,3)\r\n      dataAlco = dataAlco.slice(1,3)\r\n    }\r\n    const data: ChartData = {\r\n      labels: labels,\r\n      datasets: [\r\n        {\r\n          label: 'DRUG',\r\n          backgroundColor: '#F7911E',\r\n          borderColor: '#F7911E',\r\n          borderWidth: 0,\r\n          data: dataDrug,\r\n          datalabels: {\r\n            align: 'end',\r\n            anchor: 'end',\r\n          },\r\n          barPercentage: 1.0,\r\n          categoryPercentage: 0.9\r\n        },\r\n        {\r\n          label: 'ALCOHOL',\r\n          backgroundColor: '#5C5C5C',\r\n          borderColor: '#5C5C5C',\r\n          borderWidth: 0,\r\n          data: dataAlco,\r\n          datalabels: {\r\n            align: 'end',\r\n            anchor: 'end',\r\n          },\r\n          barPercentage: 1.0,\r\n          categoryPercentage: 0.9\r\n        }\r\n      ]\r\n    }\r\n\r\n    return <>\r\n      <Container fluid className=\"grid-container py-0\">\r\n      {this.props.allowExcusedReport && !this.state.criteriaLoading && <Row className=\"form-group pt-4\">\r\n          {!!this.props.isConsortium  && this.props.currentCompany == 0 && companies.length > 0 && <Col xs={3} md={4}>\r\n            <Form.Control id=\"company\"\r\n              as=\"select\"\r\n              value={selectedCompany}\r\n              onChange={(e: React.ChangeEvent<HTMLSelectElement>) => this.onCompanySelect(e)}>\r\n              <option value=\"\">Select the Company</option>\r\n              {this.state.companies.map(item => <option value={item.ID} key={item.ID}>{item.CompanyName} (Company Code: {item.CompanyCode})</option>)}\r\n            </Form.Control>\r\n          </Col>}\r\n          <Col>\r\n            <Button variant=\"underline-link\" onClick={() => this.runExcusedReport()}>\r\n              Run Excused Report\r\n            </Button>\r\n          </Col>\r\n        </Row>}\r\n        {showAuditPoolOptions && <AuditPoolModal onClose={() => this.setState({showAuditPoolOptions: false})} poolID={this.props.poolId} poolName={this.props.poolName}/>}\r\n        {this.props.allowAuditReport && <Row>\r\n          <Col>\r\n            <Button variant=\"underline-link\" onClick={() => this.setState({ showAuditPoolOptions: true })}>\r\n              Pool Audit Details\r\n            </Button>\r\n          </Col>\r\n        </Row>}\r\n        <Row>\r\n          <Col>\r\n            <TestingPeriodBreakdownGrid showRandomSelectionLink poolId={this.props.poolId} companyId={this.state.selectedCompany} poolName={this.props.poolName} unmaskDonorId={this.props.unmaskDonorId}/>\r\n          </Col>\r\n        </Row>\r\n        <Row>\r\n          <Col>\r\n            <h5>TESTING TOTALS</h5>\r\n            <Container fluid>\r\n              <Row>\r\n                <Col xs={4}>\r\n                  <Row>\r\n                    <Col xs={8} className=\"p-0\">CURRENT POOL</Col>\r\n                    <Col xs={4}>{statistics?.CurrentPoolSize}</Col>\r\n                  </Row>\r\n                </Col>\r\n                <Col xs={4}>\r\n                  <Row>\r\n                    <Col xs={9}>DRUG TEST PROGRAM TARGET</Col>\r\n                    <Col xs={1}>{statistics?.TargetDrug}{statistics?.RateOrFixed === 1 && <span>%</span>}</Col>\r\n                  </Row>\r\n                </Col>\r\n                <Col xs={4}>\r\n                  <Row>\r\n                    <Col xs={9}>ALCOHOL TEST PROGRAM TARGET</Col>\r\n                    <Col xs={1}>{statistics?.TargetAlcohol}{statistics?.RateOrFixed === 1 && <span>%</span>}</Col>\r\n                  </Row>\r\n                </Col>\r\n              </Row>\r\n              <Row>\r\n                <Col xs={4}>\r\n                  <Row>\r\n                    <Col xs={8} className=\"p-0\">AVERAGE POOL SIZE</Col>\r\n                    <Col xs={4}>{statistics?.AveragePoolSize}</Col>\r\n                  </Row>\r\n                </Col>\r\n                <Col xs={4}>\r\n                  <Row>\r\n                    <Col xs={9}>DRUG TEST PROGRAM ACTUAL</Col>\r\n                    <Col xs={1}>{statistics?.TotalTestsCompletedDrug}{statistics?.RateOrFixed === 1 && <span>%</span>}</Col>\r\n                  </Row>\r\n                </Col>\r\n                <Col xs={4}>\r\n                  <Row>\r\n                    <Col xs={9}>ALCOHOL TEST PROGRAM ACTUAL</Col>\r\n                    <Col xs={1}>{statistics?.TotalTestsCompletedAlcohol}{statistics?.RateOrFixed === 1 && <span>%</span>}</Col>\r\n                  </Row>\r\n                </Col>\r\n              </Row>\r\n            </Container>\r\n          </Col>\r\n        </Row>\r\n        {this.state.statisticsLoading && <Row><Col className=\"text-center\"><Spinner animation=\"border\" variant=\"secondary\" /></Col></Row>}\r\n        {this.state.statistics &&\r\n          <Row>\r\n            <Col>\r\n              <HorizontalBar data={data} options={options} height={250} />\r\n            </Col>\r\n          </Row>}\r\n      </Container>\r\n    </>\r\n  }\r\n}\r\n","import { Observable } from \"rxjs\";\r\nimport { ObservableFromFetch } from \"../ObservableFromFetch\"\r\n\r\ninterface PoolCloseProgramYearSaveOptions {\r\n  PoolID: number\r\n  SelectionInterval?: string\r\n  AlcoholTarget?: number\r\n  DrugTarget?: number\r\n  PanelID: number\r\n  ProviderMappingID: number\r\n  DateFrom: string\r\n  DateTo: string\r\n}\r\n\r\nexport default function CloseProgramIntervalObservable(data: PoolCloseProgramYearSaveOptions): Observable<string> {\r\n  const params: string = JSON.stringify(data)\r\n  return ObservableFromFetch<string>(\"FFOrderPoolDefinition/CloseProgramInterval\", params)\r\n}\r\n","import { Observable } from \"rxjs\"\r\nimport PoolGeneralInfo, { Pool } from \"./RandomsModel/PoolData\"\r\nimport { ObservableFromFetch } from \"../ObservableFromFetch\"\r\n\r\nexport interface MissedPeriodsData {\r\n  PoolProgramID: number\r\n  MakeUp: number\r\n  TotalCompletedDrug: number\r\n  TotalCompletedAlcohol: number\r\n  AveragePoolSize: number\r\n}\r\n\r\nexport default function PoolGeneralInfoGetObservable(poolId: number): Observable<PoolGeneralInfo> {\r\n  const requestBody: string = new URLSearchParams({\r\n    poolId: poolId.toString()\r\n  }).toString()\r\n\r\n  return ObservableFromFetch<PoolGeneralInfo>(\"RandomTest/GetPoolGeneralInformation?\" + requestBody)\r\n}\r\n\r\nexport function SetMissingPeriods(data: MissedPeriodsData) {\r\n  const requestBody: string = JSON.stringify(data)\r\n\r\n  return ObservableFromFetch<string>(\"RandomTest/SetMissingPeriodTest\", requestBody)\r\n}\r\n\r\nexport function PoolsGetObservable() {\r\n  return ObservableFromFetch<Pool[]>(\"WorkforceRandomTest/GetPools\")\r\n}\r\n","import * as React from \"react\"\r\nimport { Col, Spinner, Button, Image, Form, InputGroup } from \"react-bootstrap\"\r\nimport { concat, of, Subject, Subscription } from \"rxjs\"\r\nimport { filter, map, switchMap } from \"rxjs/operators\"\r\nimport { toast } from \"react-toastify\"\r\nimport { Typeahead } from \"react-bootstrap-typeahead\"\r\nimport { FaAngleDown, FaPencilAlt, FaTimes } from \"react-icons/fa\"\r\nimport PoolData from \"../../../api/Randoms/RandomsModel/PoolData\"\r\nimport { PoolUpdateObservable } from \"../../../api/Randoms/PoolSave\"\r\nimport CloseProgramIntervalObservable from \"../../../api/Randoms/CloseProgramInterval\"\r\nimport LabServiceRegulatoryModesGetObservable from \"../../../api/LabService/LabServiceRegulatoryModesGet\"\r\nimport RegulatoryMode from \"../../../api/LabService/LabServiceModel/RegulatoryMode\"\r\nimport SelectionIntervalsGetObservable from \"../../../api/Randoms/SelectionIntervalsGet\"\r\nimport LabAccount from \"../../../api/Randoms/RandomsModel/LabAccount\"\r\nimport LabAccountListGetObservable from \"../../../api/Randoms/LabAccountsGet\"\r\nimport LabPanel from \"../../../api/Randoms/RandomsModel/LabPanel\"\r\nimport LabPanelsGetObservable from \"../../../api/Randoms/LabPanelsGet\"\r\nimport ActionButton from \"../../ActionButton\"\r\nimport ConfirmationModal from \"../../ConfirmationModal\"\r\nimport DatePicker from \"react-datepicker\"\r\nimport \"react-datepicker/dist/react-datepicker.css\";\r\nimport { format, parseISO } from \"date-fns\"\r\nimport PrimaryIDType from \"../../../api/PrimaryIDTypes/PrimaryIDType\"\r\nimport { PoolPrimaryIDTypesGetObservable } from \"../../../api/PrimaryIDTypes/PrimaryIDTypesGet\"\r\nimport { IsOnTrack } from \"../../../App\";\r\nimport MissedPeriodsModal from \"./MissedPeriodsModal\"\r\nimport Checkbox from \"../../Checkbox\"\r\nimport LoadingIndicatorWrapper from \"../../LoadingIndicatorWrapper\"\r\n\r\nexport enum PoolVariant {\r\n  CloseProgramYear\r\n}\r\n\r\ninterface PoolGeneralInfoProps {\r\n  poolId: number\r\n  variant?: PoolVariant\r\n  edit?: boolean\r\n  poolData?: PoolData\r\n  onPoolUpdate: () => void\r\n  isConsortium?: boolean\r\n  isPortalAdmin?: boolean\r\n}\r\n\r\ninterface PoolGeneralInfoEditValidity {\r\n  isPoolNameValid: boolean\r\n  isFederallyRegulatedValid: boolean\r\n  isRegulatoryModeValid: boolean\r\n  isSelectionIntervalValid: boolean\r\n  isCalcTypeValid: boolean\r\n  isDrugSampleSizeValid: boolean\r\n  isAlcoholSampleSizeValid: boolean\r\n  isLabAccountValid: boolean\r\n  isLabPanelValid: boolean\r\n  isPoolMembershipTypeValid: boolean\r\n  isPrimaryIDTypeValid: boolean\r\n  isPanelCodeValid: boolean\r\n}\r\n\r\ninterface PoolGeneralInfoState extends PoolGeneralInfoEditValidity {\r\n  data?: PoolData\r\n  editData?: PoolData\r\n  selectedCalcType?: CalcType\r\n  selectedLabAccount?: LabAccount\r\n  selectedLabPanel?: LabPanel\r\n  editing: boolean\r\n  saving: boolean\r\n  showSaveConfirmModal: boolean\r\n  regulatoryModesLoading: boolean\r\n  selectionIntervalsLoading: boolean\r\n  poolLoading: boolean\r\n  labAccountsLoading: boolean\r\n  labPanelsLoading: boolean\r\n  regulatoryModes?: RegulatoryMode[]\r\n  selectionIntervals?: string[]\r\n  labAccounts?: LabAccount[]\r\n  labPanels?: LabPanel[]\r\n  availableLabPanels?: LabPanel[]\r\n  startInEditMode: boolean\r\n  primaryIDTypesLoading: boolean\r\n  primaryIDTypes?: PrimaryIDType[]\r\n  showMissingModal: boolean\r\n  panelCode: string\r\n  selectedRegulatoryModes: RegulatoryMode[]\r\n  availableToSelectRegModes: RegulatoryMode[]\r\n}\r\n\r\nconst calcTypePercentage = \"Program Percentage\"\r\nconst calcTypeFixed = \"Program Fixed\"\r\n\r\nconst poolMembershipTypeFileImport = \"File Import\"\r\nconst poolMembershipTypeCriteria = \"Criteria\"\r\n\r\nconst yes = \"Yes\"\r\nconst no = \"No\"\r\n\r\ninterface CalcType { Name: string, Code: string, ShortCode: string }\r\nconst calcTypes: CalcType[] = [\r\n  { Name: \"Annual Percentage\", Code: calcTypePercentage, ShortCode: \"Rate\" },\r\n  { Name: \"Fixed Number of Selections for Program Year\", Code: calcTypeFixed, ShortCode: \"Fixed\" }\r\n]\r\n\r\nexport default class PoolGeneralInfo extends React.PureComponent<PoolGeneralInfoProps, PoolGeneralInfoState> {\r\n  positiveValidity: PoolGeneralInfoEditValidity = {\r\n    isPoolNameValid: true,\r\n    isFederallyRegulatedValid: true,\r\n    isRegulatoryModeValid: true,\r\n    isSelectionIntervalValid: true,\r\n    isCalcTypeValid: true,\r\n    isDrugSampleSizeValid: true,\r\n    isAlcoholSampleSizeValid: true,\r\n    isLabAccountValid: true,\r\n    isLabPanelValid: true,\r\n    isPoolMembershipTypeValid: true,\r\n    isPrimaryIDTypeValid: true,\r\n    isPanelCodeValid: true\r\n  }\r\n  state: PoolGeneralInfoState = {\r\n    ...this.positiveValidity,\r\n    editing: !!this.props.edit,\r\n    saving: false,\r\n    showSaveConfirmModal: false,\r\n    regulatoryModesLoading: false,\r\n    selectionIntervalsLoading: false,\r\n    poolLoading: false,\r\n    labAccountsLoading: false,\r\n    labPanelsLoading: false,\r\n    startInEditMode: this.props.variant === PoolVariant.CloseProgramYear,\r\n    primaryIDTypesLoading: false,\r\n    showMissingModal: false,\r\n    panelCode: \"\",\r\n    selectedRegulatoryModes: [],\r\n    availableToSelectRegModes: []\r\n\r\n  }\r\n\r\n  regulatoryModeTypeahead = React.createRef<Typeahead<RegulatoryMode>>()\r\n  federallyRegulatedTypeahead = React.createRef<Typeahead<string>>()\r\n  selectionIntervalTypeahead = React.createRef<Typeahead<string>>()\r\n  calcTypeTypeahead = React.createRef<Typeahead<CalcType>>()\r\n  labAccountTypeahead = React.createRef<Typeahead<LabAccount>>()\r\n  panelTypeahead = React.createRef<Typeahead<LabPanel>>()\r\n  poolMembershipTypeTypeahead = React.createRef<Typeahead<string>>()\r\n\r\n  labAccount$ = new Subject<LabAccount>()\r\n  labAccountSubscription?: Subscription\r\n  regulatoryModesSubscription?: Subscription\r\n  selectionIntervalsSubscription?: Subscription\r\n  labAccountsSubscription?: Subscription\r\n  updateSubscription?: Subscription\r\n  closeProgramIntervalSubscription?: Subscription\r\n  primaryIDTypesSubscription?: Subscription\r\n  subscriptions = new Subscription()\r\n\r\n  componentDidMount() {\r\n    this.loadPoolData(true)\r\n    if (this.props.poolData) {\r\n      if (this.props.poolData.DOT || this.props.poolData.RegulatoryModes.length > 0) {\r\n        this.loadRegulatoryModes()\r\n      }\r\n    }\r\n  }\r\n\r\n  componentWillUnmount() {\r\n    this.labAccountSubscription && this.labAccountSubscription.unsubscribe()\r\n    this.regulatoryModesSubscription && this.regulatoryModesSubscription.unsubscribe()\r\n    this.selectionIntervalsSubscription && this.selectionIntervalsSubscription.unsubscribe()\r\n    this.labAccountsSubscription && this.labAccountsSubscription.unsubscribe()\r\n    this.updateSubscription && this.updateSubscription.unsubscribe()\r\n    this.closeProgramIntervalSubscription && this.closeProgramIntervalSubscription.unsubscribe()\r\n    this.subscriptions.unsubscribe()\r\n  }\r\n\r\n  loadPoolData = (initial: boolean = false) => {\r\n    if (!initial) this.props.onPoolUpdate()\r\n    const { startInEditMode } = this.state\r\n    this.setState({ data: this.props.poolData, editData: undefined, editing: false, startInEditMode: false })\r\n    startInEditMode && this.handleToggleEditMode()\r\n  }\r\n\r\n  loadRegulatoryModes = () => {\r\n    if (!this.state.regulatoryModes) {\r\n      let dt = this.state.data\r\n      if (!dt) {\r\n        dt = this.props.poolData\r\n      }\r\n      this.setState({ regulatoryModesLoading: true })\r\n      this.regulatoryModesSubscription && this.regulatoryModesSubscription.unsubscribe()\r\n      this.regulatoryModesSubscription = LabServiceRegulatoryModesGetObservable(true).subscribe(\r\n        (data: RegulatoryMode[]) => {\r\n            const selectedRegulatoryModes = data.filter(rm => rm.RegulatoryModeID === dt?.RegulatoryModeID || dt?.RegulatoryModes.includes(rm.RegulatoryModeID))\r\n            const availableToSelectRegModes = data.filter(rm => !selectedRegulatoryModes.includes(rm))\r\n            this.setState({\r\n              regulatoryModes: data,\r\n              regulatoryModesLoading: false,\r\n              availableToSelectRegModes: availableToSelectRegModes,\r\n              selectedRegulatoryModes: selectedRegulatoryModes\r\n            })\r\n        },\r\n        () => this.setState({ regulatoryModesLoading: false })\r\n      )\r\n    }\r\n  }\r\n\r\n  loadSelectionIntervals = () => {\r\n    if (!this.state.selectionIntervals) {\r\n      this.setState({ selectionIntervalsLoading: true })\r\n      this.selectionIntervalsSubscription && this.selectionIntervalsSubscription.unsubscribe()\r\n      this.selectionIntervalsSubscription = SelectionIntervalsGetObservable().subscribe(\r\n        (data: string[]) => this.setState({ selectionIntervals: data, selectionIntervalsLoading: false }),\r\n        () => this.setState({ selectionIntervalsLoading: false })\r\n      )\r\n    }\r\n  }\r\n\r\n  createPanelsSubscription = () => {\r\n    const link = sessionStorage.getItem(\"company-selection-link\") || \"\"\r\n    if (!this.labAccountSubscription) {\r\n      this.labAccountSubscription = this.labAccount$.pipe(\r\n        filter(labAccount => labAccount !== undefined),\r\n        switchMap((labAccount: LabAccount) => concat(\r\n          of({ panelsLoading: true }),\r\n          LabPanelsGetObservable(link, labAccount.LabAccount, labAccount.LabClientMemberId).pipe(\r\n            map((data) => ({ panelsLoading: false, items: data }))\r\n          )))\r\n      ).subscribe(\r\n        (data: { panelsLoading: boolean, items?: LabPanel[] }) => this.setState(prevState => {\r\n          return {\r\n            labPanelsLoading: data.panelsLoading,\r\n            labPanels: data.items,\r\n            availableLabPanels: data.items ? data.items.filter(((labPanel: LabPanel) => labPanel.DOT === prevState.editData?.DOT)) : undefined,\r\n            selectedLabPanel: data.items ? data.items.find(item => item.PanelID === prevState.editData?.PanelID) : undefined\r\n          }\r\n        }),\r\n        () => this.setState({ labPanelsLoading: false })\r\n      )\r\n    }\r\n  }\r\n\r\n  loadLabAccounts = () => {\r\n    const link = sessionStorage.getItem(\"company-selection-link\") || \"\"\r\n    if (!this.state.labAccounts) {\r\n      this.setState({ labAccountsLoading: true })\r\n      this.labAccountsSubscription && this.labAccountsSubscription.unsubscribe()\r\n      this.labAccountsSubscription = LabAccountListGetObservable(link).subscribe(\r\n        (data: LabAccount[]) => {\r\n          const filteredLabs = data.filter((labAccount: LabAccount) => (labAccount.LabCode === \"CRL\"))\r\n          const selectedLabAccount = filteredLabs.find(item => item.LabAccount === this.state.editData?.LabAccountNumber)\r\n          this.setState({\r\n            labAccounts: filteredLabs,\r\n            labAccountsLoading: false,\r\n            selectedLabAccount: selectedLabAccount\r\n          })\r\n          this.labAccount$.next(selectedLabAccount)\r\n        },\r\n        () => this.setState({ labAccountsLoading: false })\r\n      )\r\n    }\r\n  }\r\n  loadPrimaryIDTypes = () => {\r\n    if (!this.state.primaryIDTypes) {\r\n      this.setState({ primaryIDTypesLoading: true })\r\n      this.primaryIDTypesSubscription && this.primaryIDTypesSubscription.unsubscribe()\r\n      this.primaryIDTypesSubscription = PoolPrimaryIDTypesGetObservable().subscribe(\r\n        (data: PrimaryIDType[]) => this.setState({ primaryIDTypes: data, primaryIDTypesLoading: false }),\r\n        () => this.setState({ primaryIDTypesLoading: false })\r\n      )\r\n    }\r\n  }\r\n\r\n  handleToggleEditMode = () => {\r\n    if (this.state.editing) {\r\n      const selectedRegulatoryModes = this.state.regulatoryModes?.filter(rm => rm.RegulatoryModeID === this.state.data?.RegulatoryModeID || this.state.data?.RegulatoryModes.includes(rm.RegulatoryModeID))\r\n      const availableToSelectRegModes = this.state.regulatoryModes?.filter(rm => !selectedRegulatoryModes?.includes(rm))\r\n      this.setState({\r\n        ...this.positiveValidity,\r\n        editing: false,\r\n        editData: undefined,\r\n        selectedCalcType: undefined,\r\n        selectedLabAccount: undefined,\r\n        selectedLabPanel: undefined,\r\n        selectedRegulatoryModes: selectedRegulatoryModes || [],\r\n        availableToSelectRegModes: availableToSelectRegModes || [],\r\n      })\r\n    } else {\r\n      const selectedLabAccount = this.state.labAccounts ? this.state.labAccounts.find(item => item.LabAccount === this.state.data?.LabAccountNumber) : undefined\r\n      this.setState((prevState) => {\r\n        return {\r\n          editing: true,\r\n          editData: prevState.data,\r\n          selectedCalcType: calcTypes.find(item => item.Code === prevState.data?.FixedOrRate),\r\n          selectedLabAccount: selectedLabAccount\r\n        }\r\n      })\r\n      this.loadRegulatoryModes()\r\n      this.loadSelectionIntervals()\r\n      this.loadPrimaryIDTypes()\r\n      this.createPanelsSubscription()\r\n      this.loadLabAccounts()\r\n      this.labAccount$.next(selectedLabAccount)\r\n    }\r\n  }\r\n\r\n  handlePoolNameChange = (event: React.ChangeEvent<HTMLInputElement>) => {\r\n    const value = event.target.value\r\n    this.state.editData && this.setState(prevState => {\r\n      const editState = prevState.editData ? { ...prevState.editData, Name: value } : prevState.editData\r\n      return { editData: editState, isPoolNameValid: value.length >= 8 }\r\n    })\r\n  }\r\n\r\n  handlePanelCodeChange = (event: React.ChangeEvent<HTMLInputElement>) => {\r\n    const value = event.target.value\r\n    this.state.editData && this.setState(prevState => {\r\n      const editState = prevState.editData ? { ...prevState.editData, PanelCode: value } : prevState.editData\r\n      return { editData: editState, isPanelCodeValid: value.length >= 2 }\r\n    })\r\n  }\r\n\r\n  handleFederallyRegulatedChange = (items: string[]) => {\r\n    let value: boolean | undefined\r\n    switch (items[0]) {\r\n      case yes: value = true; break\r\n      case no: value = false; break\r\n    }\r\n\r\n    const availableLabPanels = this.state.labPanels ? this.state.labPanels.filter(((labPanel: LabPanel) => labPanel.DOT === value)) : undefined\r\n    this.state.editData && this.setState(\r\n      (prevState) => {\r\n        const editData = prevState.editData ? { ...prevState.editData, DOT: value, RegulatoryMode: \"\" } : prevState.editData\r\n        return {\r\n          editData: editData,\r\n          isFederallyRegulatedValid: value !== undefined,\r\n          isRegulatoryModeValid: true,\r\n          availableLabPanels: availableLabPanels,\r\n          selectedLabPanel: undefined\r\n        }\r\n      })\r\n\r\n    this.handleLabPanelChange([])\r\n  }\r\n\r\n  handleRegulatoryModeChange = (items: RegulatoryMode[]) => {\r\n    const availableToSelectRegModes: RegulatoryMode[] = []\r\n    const selectedRegModes: RegulatoryMode[] = items || []\r\n    const availableRegModes: RegulatoryMode[] = this.state.regulatoryModes || []\r\n    let regulatoryModeId = 0\r\n    if (selectedRegModes.length > 0) {\r\n      regulatoryModeId = selectedRegModes[0].RegulatoryModeID\r\n    }\r\n    for (let i = 0; i < availableRegModes.length; i++) {\r\n      let is_selected = false;\r\n      const availRegMode = availableRegModes[i]\r\n      for (let j = 0; j < selectedRegModes.length; j++) {\r\n        const selectedRegMode = selectedRegModes[j];\r\n        if (availRegMode.RegulatoryModeID === selectedRegMode.RegulatoryModeID) {\r\n          is_selected = true\r\n          break\r\n        }\r\n      }\r\n      if (is_selected) {\r\n        continue\r\n      }\r\n      availableToSelectRegModes.push(availRegMode)\r\n    }\r\n\r\n    this.state.editData && this.setState(prevState => {\r\n      const editData = prevState.editData ? {\r\n        ...prevState.editData,\r\n        RegulatoryMode: items[0]?.Name || \"\",\r\n        RegulatoryModeID: items[0]?.RegulatoryModeID,\r\n        RegulatoryModes: selectedRegModes.map(({ RegulatoryModeID }) => RegulatoryModeID),\r\n      } : prevState.editData\r\n\r\n      return {\r\n        editData: editData,\r\n        isRegulatoryModeValid: items[0] !== undefined,\r\n        selectedRegulatoryModes: selectedRegModes,\r\n        availableToSelectRegModes: availableToSelectRegModes,\r\n      }\r\n    })\r\n  }\r\n\r\n  handleSelectionIntervalChange = (items: string[]) => {\r\n    this.state.editData && this.setState(prevState => {\r\n      const editData = prevState.editData ? { ...prevState.editData, SelectionInterval: items[0] || \"\" } : prevState.editData\r\n      return { editData: editData, isSelectionIntervalValid: items[0] !== undefined }\r\n    })\r\n  }\r\n\r\n  handleCalcTypeChange = (items: CalcType[]) => {\r\n    const calcTypeCode = items[0]?.Code || \"\"\r\n    this.state.editData && this.setState(prevState => {\r\n      const editData = prevState.editData ? {\r\n        ...prevState.editData,\r\n        FixedOrRate: calcTypeCode,\r\n        DrugSampleSize: calcTypeCode === calcTypePercentage ? Math.min(100, prevState.editData?.DrugSampleSize || 0) : prevState.editData?.DrugSampleSize,\r\n        AlcoholSampleSize: calcTypeCode === calcTypePercentage ? Math.min(100, prevState.editData?.AlcoholSampleSize || 0) : prevState.editData?.AlcoholSampleSize\r\n      } : prevState.editData\r\n      return {\r\n        editData: editData,\r\n        selectedCalcType: items[0],\r\n        isCalcTypeValid: items[0] !== undefined\r\n      }\r\n    })\r\n  }\r\n\r\n  handleDateChange = (key: \"ProgramIntervalStartDate\" | \"ProgramIntervalEndDate\", date: Date | null) => {\r\n    this.state.editData && this.setState(prevState => {\r\n      const editData = prevState.editData ? { ...prevState.editData, [key]: date ? date.toISOString() : \"\" } : prevState.editData\r\n      return {\r\n        editData: editData\r\n      }\r\n    })\r\n  }\r\n\r\n  parsePoolSize = (value: string): number | undefined => {\r\n    if (this.state.editData?.FixedOrRate === calcTypePercentage && /^(\\s*|100|0|[1-9]{1}\\d?)$/.test(value)) {\r\n      return Number(value)\r\n    }\r\n    if (this.state.editData?.FixedOrRate === calcTypeFixed && /^(\\s*|0|[1-9]{1}\\d{0,18})$/.test(value)) {\r\n      return Number(value)\r\n    }\r\n    return undefined\r\n  }\r\n\r\n  handleSampleSizeChangeChange = (what: keyof PoolData, validityField: keyof PoolGeneralInfoEditValidity, value: string) => {\r\n    const numberValue = this.parsePoolSize(value)\r\n    if (numberValue !== undefined) {\r\n      this.state.editData && this.setState(prevState => {\r\n        const editData = prevState.editData ? { ...prevState.editData, [what]: numberValue } : prevState.editData\r\n        return { ...{}, editData: editData, [validityField]: numberValue >= 0 }\r\n      })\r\n    }\r\n  }\r\n\r\n  handleLabAccountChange = (items: LabAccount[]) => {\r\n    this.state.editData && this.setState(prevState => {\r\n      const editData = prevState.editData ? {\r\n        ...prevState.editData,\r\n        LabAccountNumber: items[0]?.LabAccount || \"\",\r\n        Panel: \"\",\r\n        PanelID: 0\r\n      } : prevState.editData\r\n      return {\r\n        editData: editData,\r\n        selectedLabAccount: items[0],\r\n        selectedLabPanel: undefined,\r\n        labPanels: undefined,\r\n        isLabAccountValid: this.props.isConsortium || items[0] !== undefined\r\n      }\r\n    })\r\n    this.labAccount$.next(items[0])\r\n  }\r\n\r\n  handleLabPanelChange = (items: LabPanel[]) => {\r\n    this.state.editData && this.setState(prevState => {\r\n      const editData = prevState.editData ? { ...prevState.editData, Panel: items[0]?.Description || \"\", PanelID: items[0]?.PanelID || 0 } : prevState.editData\r\n      return {\r\n        editData: editData,\r\n        selectedLabPanel: items[0],\r\n        isLabPanelValid: items[0] !== undefined\r\n      }\r\n    })\r\n  }\r\n\r\n  handlePoolMembershipTypeChange = (items: string[]) => {\r\n    let value: boolean | undefined\r\n    switch (items[0]) {\r\n      case poolMembershipTypeFileImport: value = true; break\r\n      case poolMembershipTypeCriteria: value = false; break\r\n    }\r\n    this.state.editData && this.setState(prevState => {\r\n      const editData = prevState.editData ? { ...prevState.editData, UseFileImportForPoolMembership: value } : prevState.editData\r\n      return {\r\n        editData: editData,\r\n        isPoolMembershipTypeValid: value !== undefined\r\n      }\r\n    })\r\n  }\r\n\r\n  handleNoSelectionChange = () => {\r\n    this.state.editData && this.setState(prevState => {\r\n      const editData = prevState.editData ? { ...prevState.editData, IncludeCompaniesWithNoSelections: !prevState.editData?.IncludeCompaniesWithNoSelections } : prevState.editData\r\n      return {\r\n        editData: editData\r\n      }\r\n    })\r\n  }\r\n\r\n  handlePrimaryIDTypeChange = (event: React.ChangeEvent<HTMLSelectElement>) => {\r\n    const value = event.target.value || \"\"\r\n    const items: PrimaryIDType[] = this.state.primaryIDTypes || []\r\n    const ind = items.findIndex(item => item.PrimaryIDType === value);\r\n    this.state.editData && this.setState(prevState => {\r\n      const editState = prevState.editData ? { ...prevState.editData, PrimaryIDType: value } : prevState.editData\r\n      return { editData: editState, isPrimaryIDTypeValid: ind >= 0 }\r\n    })\r\n  }\r\n  handleRunOnlyByCompanyAdminChange = (event: React.ChangeEvent<HTMLInputElement>) => {\r\n    if (!this.state.editData?.RunOnlyByPortalAdmin) {\r\n      return\r\n    }\r\n    const checked = event.target.checked\r\n    if (!checked) {\r\n      return\r\n    }\r\n    this.state.editData && this.setState(prevState => {\r\n      const editData = prevState.editData ? { ...prevState.editData, RunOnlyByPortalAdmin: !checked } : prevState.editData\r\n      return {\r\n        editData: editData\r\n      }\r\n    })\r\n  }\r\n\r\n  handleRunOnlyByPortalAdminChange = (event: React.ChangeEvent<HTMLInputElement>) => {\r\n    if (this.state.editData?.RunOnlyByPortalAdmin) {\r\n      return\r\n    }\r\n    const checked = event.target.checked\r\n    if (!checked) {\r\n      return\r\n    }\r\n    this.state.editData && this.setState(prevState => {\r\n      const editData = prevState.editData ? { ...prevState.editData, RunOnlyByPortalAdmin: checked } : prevState.editData\r\n      return {\r\n        editData: editData\r\n      }\r\n    })\r\n  }\r\n\r\n  handleSubmit = () => {\r\n    if (!this.state.editData) {\r\n      return\r\n    }\r\n    const editData = this.state.editData!\r\n    const isConsortium = !!this.props.isConsortium\r\n\r\n    const sampleSizeValid = (size: number, calcType: string): boolean => {\r\n      if (size < 0) {\r\n        return false\r\n      }\r\n      if (calcType === calcTypePercentage) {\r\n        return size <= 100\r\n      }\r\n      if (calcType === calcTypeFixed) {\r\n        return size.toString().length <= 19\r\n      }\r\n      return false\r\n    }\r\n\r\n    const primary_id_types: PrimaryIDType[] = this.state.primaryIDTypes || []\r\n    const primary_id_type_ind = primary_id_types.findIndex(item => item.PrimaryIDType === editData.PrimaryIDType)\r\n    const changes: PoolGeneralInfoEditValidity = {\r\n      isPoolNameValid: editData.Name.trim().length >= 8,\r\n      isFederallyRegulatedValid: editData.DOT !== undefined,\r\n      isRegulatoryModeValid: !editData.DOT || editData.RegulatoryMode.length > 0,\r\n      isSelectionIntervalValid: editData.SelectionInterval.length > 0,\r\n      isCalcTypeValid: [calcTypePercentage, calcTypeFixed].includes(editData.FixedOrRate),\r\n      isDrugSampleSizeValid: sampleSizeValid(editData.DrugSampleSize, editData.FixedOrRate),\r\n      isAlcoholSampleSizeValid: sampleSizeValid(editData.AlcoholSampleSize, editData.FixedOrRate),\r\n      isLabAccountValid: (isConsortium || editData.LabAccountNumber.length > 0),\r\n      isLabPanelValid: (isConsortium || editData.Panel.length > 0),\r\n      isPoolMembershipTypeValid: editData.UseFileImportForPoolMembership !== undefined,\r\n      isPrimaryIDTypeValid: primary_id_type_ind >= 0,\r\n      isPanelCodeValid: (!isConsortium || editData.PanelCode.length > 1)\r\n    }\r\n    const isValid = Object.values(changes).every((valid: boolean) => valid)\r\n    if (!isValid) {\r\n      this.setState(changes)\r\n      return\r\n    }\r\n\r\n    const startDate = editData.ProgramIntervalStartDate ? parseISO(editData.ProgramIntervalStartDate) : undefined\r\n    const endDate = editData.ProgramIntervalEndDate ? parseISO(editData.ProgramIntervalEndDate) : undefined\r\n    const startDatePlusYear = editData.ProgramIntervalStartDate ? parseISO(editData.ProgramIntervalStartDate) : undefined\r\n    startDatePlusYear && startDatePlusYear.setFullYear(startDatePlusYear.getFullYear() + 1)\r\n    if (!startDate || !endDate || startDate >= endDate || !startDatePlusYear || startDatePlusYear < endDate) {\r\n      return\r\n    }\r\n\r\n    switch (this.props.variant) {\r\n      case PoolVariant.CloseProgramYear:\r\n        this.performCloseProgramYearSave()\r\n        break;\r\n      default:\r\n        this.setState({ showSaveConfirmModal: true })\r\n        break;\r\n    }\r\n  }\r\n\r\n  performSave = () => {\r\n    this.setState({ saving: true, showSaveConfirmModal: false })\r\n    const fixedOrRate = calcTypes.find(item => item.Code === this.state.editData?.FixedOrRate)?.ShortCode || \"\"\r\n    this.updateSubscription && this.updateSubscription.unsubscribe()\r\n    this.updateSubscription = PoolUpdateObservable({\r\n      ...this.state.editData!,\r\n      ProviderMappingID: this.state.selectedLabAccount?.ProviderMappingID,\r\n      FixedOrRate: fixedOrRate\r\n    }, !!this.props.isConsortium).subscribe(\r\n      () => {\r\n        toast.success(\"Updated pool details successfully.\")\r\n        this.setState({ saving: false })\r\n        this.handleToggleEditMode()\r\n        this.loadPoolData()\r\n      },\r\n      () => {\r\n        this.setState({ saving: false })\r\n        toast.error(\"Error updating pool details\")\r\n      }\r\n    )\r\n  }\r\n\r\n  performCloseProgramYearSave = () => {\r\n    if (!this.state.editData) {\r\n      return\r\n    }\r\n    this.setState({ saving: true })\r\n    this.closeProgramIntervalSubscription && this.closeProgramIntervalSubscription.unsubscribe()\r\n    this.closeProgramIntervalSubscription = CloseProgramIntervalObservable({\r\n      PoolID: this.state.editData?.PoolID || this.props.poolId,\r\n      AlcoholTarget: this.state.editData?.AlcoholSampleSize,\r\n      DrugTarget: this.state.editData?.DrugSampleSize,\r\n      PanelID: this.state.editData?.PanelID,\r\n      ProviderMappingID: this.state.selectedLabAccount?.ProviderMappingID || 0,\r\n      DateFrom: format(parseISO(this.state.editData?.ProgramIntervalStartDate || \"\"), \"MM/dd/yyyy\"),\r\n      DateTo: format(parseISO(this.state.editData?.ProgramIntervalEndDate || \"\"), \"MM/dd/yyyy\")\r\n    }).subscribe(\r\n      data => {\r\n        toast.success(data)\r\n        this.setState({ saving: false })\r\n        this.handleToggleEditMode()\r\n        this.loadPoolData()\r\n      },\r\n      error => {\r\n        this.setState({ saving: false })\r\n        toast.error(error.errorData?.message || error.message)\r\n      }\r\n    )\r\n  }\r\n\r\n  valueText = (text: string | number | undefined) => <Col xs={6} md={8} className=\"col-form-label\">{text}</Col>\r\n\r\n  rowClassName = (editable: boolean) => editable ? \"form-group required\" : this.state.editing ? \"form-group\" : \"\"\r\n\r\n  openMissingPeriodsModal = () => this.setState({ showMissingModal: true })\r\n\r\n  onSaveMissingPeriods = () => {\r\n    this.setState({ showMissingModal: false })\r\n    this.loadPoolData()\r\n  }\r\n\r\n  render() {\r\n    const { data, editData, poolLoading, regulatoryModesLoading } = this.state\r\n    const availableToSelectRegModes = this.state.availableToSelectRegModes || []\r\n    const selectedRegulatoryModes = this.state.selectedRegulatoryModes || []\r\n    const isPortalAdmin: boolean = this.props.isPortalAdmin || false\r\n    if (poolLoading) {\r\n      return <div className=\"d-flex justify-content-center\">\r\n        <Spinner animation=\"border\" variant=\"secondary\" style={{ margin: \"auto\" }} />\r\n      </div>\r\n    }\r\n    const dataCalcType = calcTypes.find(item => item.Code === data?.FixedOrRate)\r\n    const dataCalcTypeMark = data?.FixedOrRate === calcTypePercentage ? \"%\" : \"\"\r\n    const isOnTrack = IsOnTrack()\r\n\r\n    const editing = this.state.editing\r\n    const editingAndNoRun = this.state.editing && !editData?.IsRunRandom\r\n    const editingAndNoRunNonClosePY = editingAndNoRun && this.props.variant !== PoolVariant.CloseProgramYear\r\n    const editable = {\r\n      company: false,\r\n      poolID: false,\r\n      name: editingAndNoRunNonClosePY,\r\n      programInterval: editingAndNoRun,\r\n      regulated: editingAndNoRunNonClosePY,\r\n      regulatoryMode: editingAndNoRunNonClosePY,\r\n      selectionInterval: editingAndNoRunNonClosePY,\r\n      calcType: editingAndNoRunNonClosePY,\r\n      drug: editing,\r\n      alcohol: editing,\r\n      labAccount: editing,\r\n      panel: editing,\r\n      membershipType: editing,\r\n      primaryIDType: editing,\r\n      includeCompanies: editing,\r\n      panelCode: editing,\r\n      runOnlyByPortalAdmin: editing,\r\n    }\r\n\r\n    const startDateStr = (editing ? editData : data)?.ProgramIntervalStartDate\r\n    const endDateStr = (editing ? editData : data)?.ProgramIntervalEndDate\r\n    const startDate = startDateStr ? parseISO(startDateStr) : undefined\r\n    const endDate = endDateStr ? parseISO(endDateStr) : undefined\r\n    const startDatePlusYear = startDateStr ? parseISO(startDateStr) : undefined\r\n    startDatePlusYear && startDatePlusYear.setFullYear(startDatePlusYear.getFullYear() + 1)\r\n    const primaryIDType = (editable.primaryIDType) ? editData?.PrimaryIDType : data?.PrimaryIDType\r\n    let regModes = data?.RegulatoryMode\r\n    if (selectedRegulatoryModes.length > 0) {\r\n      const names = this.state.selectedRegulatoryModes.map(({ Name }) => Name).join(\", \")\r\n      regModes = names\r\n    }\r\n\r\n    return <>\r\n      <Form className=\"p-4 pt-3\">\r\n        <Form.Row>\r\n          <Col>{(this.props.variant !== PoolVariant.CloseProgramYear) && <h5>MODIFY POOL CONFIGURATION</h5>}</Col>\r\n          <Col>\r\n            {!this.state.editing && data?.IsMissingPeriodTests && <Button variant=\"underline-link\" className=\"m-2\" onClick={() => this.openMissingPeriodsModal()}>\r\n              Total tests performed for missed periods\r\n            </Button>}\r\n          </Col>\r\n          <Col xs={1}>\r\n            <h5>\r\n              <Button variant=\"icon-link\" size=\"sm\" className=\"float-right ml-1 btn-icon-primary\" onClick={this.handleToggleEditMode} hidden={!data || regulatoryModesLoading}>\r\n                {!this.state.editing && <FaPencilAlt />}\r\n                {this.state.editing && <FaTimes />}\r\n              </Button>\r\n            </h5>\r\n          </Col>\r\n        </Form.Row>\r\n        {!this.props.isConsortium && <Form.Row className={this.rowClassName(editable.company)}>\r\n          <Form.Label column xs={6} md={4}>COMPANY</Form.Label>\r\n          {this.valueText(data?.Company)}\r\n        </Form.Row>}\r\n        <Form.Row className={this.rowClassName(editable.name)}>\r\n          <Form.Label column xs={6} md={4}>POOL NAME</Form.Label>\r\n          {!editable.name && this.valueText(data?.Name)}\r\n          {editable.name &&\r\n            <Col xs={6} md={8}>\r\n              <Form.Control type=\"text\" value={editData?.Name} onChange={this.handlePoolNameChange} isInvalid={!this.state.isPoolNameValid} />\r\n              <Form.Control.Feedback type=\"invalid\">Pool Name should contain at least 8 characters</Form.Control.Feedback>\r\n            </Col>}\r\n        </Form.Row>\r\n        <Form.Row className={this.rowClassName(editable.poolID)}>\r\n          <Form.Label column xs={6} md={4}>POOL ID</Form.Label>\r\n          <Form.Label column xs={6} md={8}>{data?.Code}</Form.Label>\r\n        </Form.Row>\r\n        <Form.Row className={this.rowClassName(editable.programInterval)}>\r\n          <Form.Label column xs={6} md={4}>PROGRAM INTERVAL</Form.Label>\r\n          {!editable.programInterval && <Col xs={6} lg={1} className=\"col-form-label\">{startDate ? format(startDate, \"MM/dd/yyyy\") : \"\"}</Col>}\r\n          {editable.programInterval && <Col xs={6} lg={2} className=\"mb-1 mb-lg-0\">\r\n            <DatePicker className=\"form-control\"\r\n              peekNextMonth\r\n              showMonthDropdown\r\n              showYearDropdown\r\n              dropdownMode=\"select\"\r\n              required\r\n              popperPlacement=\"top-end\"\r\n              selected={startDate}\r\n              enableTabLoop={false}\r\n              onChange={date => this.handleDateChange(\"ProgramIntervalStartDate\", date as Date)} />\r\n          </Col>}\r\n          <Form.Label column xs={6} md={4} lg={2} xl={1} className=\"text-right pr-4\">To</Form.Label>\r\n          {!editable.programInterval && <Col xs={6} lg={1} className=\"col-form-label\">{endDate ? format(endDate, \"MM/dd/yyyy\") : \"\"}</Col>}\r\n          {editable.programInterval && <Col xs={6} lg={5}>\r\n            <DatePicker className=\"form-control\"\r\n              peekNextMonth\r\n              showMonthDropdown\r\n              showYearDropdown\r\n              dropdownMode=\"select\"\r\n              required\r\n              popperPlacement=\"top-end\"\r\n              selected={endDate}\r\n              enableTabLoop={false}\r\n              onChange={date => this.handleDateChange(\"ProgramIntervalEndDate\", date as Date)} />\r\n            {endDate && startDate && startDate >= endDate && <Form.Control.Feedback type=\"invalid\" className=\"d-block\">Date To should be later than Date From</Form.Control.Feedback>}\r\n            {endDate && startDatePlusYear && startDatePlusYear < endDate && <Form.Control.Feedback type=\"invalid\" className=\"d-block\">The From and To dates cannot be more than one calendar year in duration</Form.Control.Feedback>}\r\n          </Col>}\r\n        </Form.Row>\r\n        <Form.Row className={this.rowClassName(editable.regulated)}>\r\n          <Form.Label column xs={6} md={4}>FEDERALLY REGULATED</Form.Label>\r\n          {(!editable.regulated || !!this.props.isConsortium) && this.valueText(data?.DOT ? yes : no)}\r\n          {editable.regulated && !this.props.isConsortium &&\r\n            <Col xs={6} md={8}>\r\n              <Typeahead id=\"federallyRegulated\"\r\n                ref={this.federallyRegulatedTypeahead}\r\n                filterBy={() => true}\r\n                onChange={this.handleFederallyRegulatedChange}\r\n                options={[yes, no]}\r\n                selected={editData?.DOT === undefined ? [] : [editData?.DOT ? yes : no]}\r\n                isInvalid={!this.state.isFederallyRegulatedValid}\r\n                emptyLabel=\"Select\"\r\n                placeholder=\"Select\">\r\n                {this.state.isFederallyRegulatedValid && <Button variant=\"toggle\" onClick={() => { this.federallyRegulatedTypeahead.current?.toggleMenu() }}>\r\n                  <FaAngleDown />\r\n                </Button>}\r\n              </Typeahead>\r\n            </Col>}\r\n        </Form.Row>\r\n        {((!editing && data?.DOT) || (editing && editData?.DOT)) &&\r\n          <Form.Row className={this.rowClassName(editable.regulatoryMode)}>\r\n            <Form.Label column xs={6} md={4}>REGULATORY MODE(S)</Form.Label>\r\n            <LoadingIndicatorWrapper loading={this.state.regulatoryModesLoading}>\r\n              {!editable.regulatoryMode && this.valueText(regModes)}\r\n            </LoadingIndicatorWrapper>\r\n            {editable.regulatoryMode &&\r\n              <Col xs={6} md={8}>\r\n                <LoadingIndicatorWrapper loading={this.state.regulatoryModesLoading}>\r\n                  <Typeahead id=\"regMode\"\r\n                    ref={this.regulatoryModeTypeahead}\r\n                    labelKey=\"Name\"\r\n                    filterBy={(option, props) => props.selected.length > 0 || option.Name.toLowerCase().indexOf(props.text.toLowerCase()) !== -1}\r\n                    onChange={(selected) => { this.handleRegulatoryModeChange(selected) }}\r\n                    disabled={this.state.regulatoryModesLoading}\r\n                    options={availableToSelectRegModes}\r\n                    selected={selectedRegulatoryModes}\r\n                    multiple\r\n                    isInvalid={!this.state.isRegulatoryModeValid}\r\n                    emptyLabel=\"No Regulatory Modes Found\"\r\n                    placeholder=\"Select\">\r\n                    {this.state.isRegulatoryModeValid && !this.state.regulatoryModesLoading && <Button variant=\"toggle\" onClick={() => { this.regulatoryModeTypeahead.current?.toggleMenu() }}>\r\n                      <FaAngleDown />\r\n                    </Button>}\r\n                  </Typeahead>\r\n                </LoadingIndicatorWrapper>\r\n              </Col>}\r\n          </Form.Row>}\r\n        <Form.Row className={this.rowClassName(editable.selectionInterval)}>\r\n          <Form.Label column xs={6} md={4}>SELECTION INTERVAL</Form.Label>\r\n          {!editable.selectionInterval && this.valueText(data?.SelectionInterval)}\r\n          {editable.selectionInterval &&\r\n            <Col xs={6} md={8}>\r\n              <Typeahead id=\"selectionIntervals\"\r\n                ref={this.selectionIntervalTypeahead}\r\n                filterBy={() => true}\r\n                onChange={this.handleSelectionIntervalChange}\r\n                disabled={this.state.selectionIntervalsLoading}\r\n                options={this.state.selectionIntervals || []}\r\n                selected={editData?.SelectionInterval ? [editData?.SelectionInterval] : []}\r\n                isInvalid={!this.state.isSelectionIntervalValid}\r\n                emptyLabel=\"No Selection Intervals Found\"\r\n                placeholder=\"Select\">\r\n                {this.state.isSelectionIntervalValid && !this.state.selectionIntervalsLoading && <Button variant=\"toggle\" onClick={() => { this.selectionIntervalTypeahead.current?.toggleMenu() }}>\r\n                  <FaAngleDown />\r\n                </Button>}\r\n              </Typeahead>\r\n            </Col>}\r\n        </Form.Row>\r\n        <Form.Row className={this.rowClassName(editable.calcType)}>\r\n          <Form.Label column xs={6} md={4}>POOL CALCULATION TYPE</Form.Label>\r\n          {!editable.calcType && this.valueText(dataCalcType?.Name)}\r\n          {editable.calcType &&\r\n            <Col xs={6} md={8}>\r\n              <Typeahead id=\"calcType\"\r\n                ref={this.calcTypeTypeahead}\r\n                labelKey=\"Name\"\r\n                filterBy={() => true}\r\n                onChange={this.handleCalcTypeChange}\r\n                options={calcTypes}\r\n                selected={this.state.selectedCalcType ? [this.state.selectedCalcType] : []}\r\n                isInvalid={!this.state.isCalcTypeValid}\r\n                emptyLabel=\"No Pool Calculation Types\"\r\n                placeholder=\"Select\">\r\n                {this.state.isCalcTypeValid && <Button variant=\"toggle\" onClick={() => { this.calcTypeTypeahead.current?.toggleMenu() }}>\r\n                  <FaAngleDown />\r\n                </Button>}\r\n              </Typeahead>\r\n            </Col>}\r\n        </Form.Row>\r\n        <Form.Row className={this.rowClassName(editable.drug)}>\r\n          <Form.Label column xs={6} md={4}>DRUG</Form.Label>\r\n          {!editable.drug && this.valueText(`${data?.DrugSampleSize.toString()}${dataCalcTypeMark}`)}\r\n          {editable.drug &&\r\n            <Col xs={6} md={8}>\r\n              <InputGroup>\r\n                <Form.Control type=\"text\" value={editData?.DrugSampleSize.toString()} onChange={(e: React.ChangeEvent<HTMLInputElement>) => this.handleSampleSizeChangeChange(\"DrugSampleSize\", \"isDrugSampleSizeValid\", e.target.value)} isInvalid={!this.state.isDrugSampleSizeValid} />\r\n                <InputGroup.Append hidden={this.state.editData?.FixedOrRate !== calcTypePercentage}><InputGroup.Text>%</InputGroup.Text></InputGroup.Append>\r\n              </InputGroup>\r\n            </Col>}\r\n        </Form.Row>\r\n        <Form.Row className={this.rowClassName(editable.alcohol)}>\r\n          <Form.Label column xs={6} md={4}>ALCOHOL</Form.Label>\r\n          {!editable.alcohol && this.valueText(`${data?.AlcoholSampleSize.toString()}${dataCalcTypeMark}`)}\r\n          {editable.alcohol &&\r\n            <Col xs={6} md={8}>\r\n              <InputGroup>\r\n                <Form.Control type=\"text\" value={editData?.AlcoholSampleSize.toString()} onChange={(e: React.ChangeEvent<HTMLInputElement>) => this.handleSampleSizeChangeChange(\"AlcoholSampleSize\", \"isAlcoholSampleSizeValid\", e.target.value)} isInvalid={!this.state.isAlcoholSampleSizeValid} />\r\n                <InputGroup.Append hidden={this.state.editData?.FixedOrRate !== calcTypePercentage}><InputGroup.Text>%</InputGroup.Text></InputGroup.Append>\r\n              </InputGroup>\r\n            </Col>}\r\n        </Form.Row>\r\n        {this.props.isConsortium && <Form.Row className={this.rowClassName(editable.panelCode)}>\r\n          <Form.Label column xs={6} md={4}>PANEL CODE</Form.Label>\r\n          {!editable.panelCode && this.valueText(data?.PanelCode)}\r\n          {editable.panelCode &&\r\n            <Col xs={6} md={8}>\r\n              <Form.Control type=\"text\" disabled={(editData?.PanelID || 0) > 0} value={editData?.PanelCode} onChange={this.handlePanelCodeChange} isInvalid={!this.state.isPanelCodeValid} />\r\n              <Form.Control.Feedback type=\"invalid\">Panel Code should contain at least 2 characters</Form.Control.Feedback>\r\n            </Col>}\r\n        </Form.Row>}\r\n        {!this.props.isConsortium && <Form.Row className={this.rowClassName(editable.labAccount)}>\r\n          <Form.Label column xs={6} md={4}>DEFAULT LABORATORY ACCOUNT</Form.Label>\r\n          {!editable.labAccount && this.valueText(data?.LabAccountNumber)}\r\n          {editable.labAccount &&\r\n            <Col xs={6} md={8}>\r\n              <Typeahead id=\"labAccount\"\r\n                ref={this.labAccountTypeahead}\r\n                labelKey=\"Description\"\r\n                filterBy={() => true}\r\n                onChange={this.handleLabAccountChange}\r\n                disabled={this.state.labAccountsLoading}\r\n                options={this.state.labAccounts || []}\r\n                selected={this.state.selectedLabAccount ? [this.state.selectedLabAccount] : []}\r\n                isInvalid={!this.state.isLabAccountValid}\r\n                emptyLabel=\"No Laboratory Accounts Found\"\r\n                placeholder=\"Select\">\r\n                {this.state.isLabAccountValid && !this.state.labAccountsLoading && <Button variant=\"toggle\" onClick={() => { this.labAccountTypeahead.current?.toggleMenu() }}>\r\n                  <FaAngleDown />\r\n                </Button>}\r\n              </Typeahead>\r\n            </Col>}\r\n        </Form.Row>}\r\n        {!this.props.isConsortium && <Form.Row className={this.rowClassName(editable.panel)}>\r\n          <Form.Label column xs={6} md={4}>PANEL</Form.Label>\r\n          {!editable.panel && this.valueText(data?.Panel)}\r\n          {editable.panel &&\r\n            <Col xs={6} md={8}>\r\n              <Typeahead id=\"labPanel\"\r\n                ref={this.panelTypeahead}\r\n                labelKey=\"Description\"\r\n                filterBy={() => true}\r\n                onChange={this.handleLabPanelChange}\r\n                disabled={this.state.labPanelsLoading || !this.state.selectedLabAccount}\r\n                options={this.state.availableLabPanels || []}\r\n                selected={this.state.selectedLabPanel ? [this.state.selectedLabPanel] : []}\r\n                isInvalid={!this.state.isLabPanelValid}\r\n                emptyLabel=\"No Panels Found\"\r\n                placeholder=\"Select\">\r\n                {this.state.isLabPanelValid && !this.state.labPanelsLoading && <Button variant=\"toggle\" onClick={() => { this.panelTypeahead.current?.toggleMenu() }}>\r\n                  <FaAngleDown />\r\n                </Button>}\r\n              </Typeahead>\r\n            </Col>}\r\n        </Form.Row>}\r\n        <Form.Row className={this.rowClassName(editable.membershipType)}>\r\n          <Form.Label column xs={6} md={4}>POOL MEMBERSHIP TYPE</Form.Label>\r\n          {!editable.membershipType && data?.UseFileImportForPoolMembership === true && this.valueText(poolMembershipTypeFileImport)}\r\n          {!editable.membershipType && data?.UseFileImportForPoolMembership === false && this.valueText(poolMembershipTypeCriteria)}\r\n          {editable.membershipType &&\r\n            <Col xs={6} md={8}>\r\n              <Typeahead id=\"poolMembershipType\"\r\n                ref={this.poolMembershipTypeTypeahead}\r\n                filterBy={() => true}\r\n                onChange={this.handlePoolMembershipTypeChange}\r\n                options={[poolMembershipTypeFileImport, poolMembershipTypeCriteria]}\r\n                selected={editData?.UseFileImportForPoolMembership === undefined ? [] : [editData?.UseFileImportForPoolMembership ? poolMembershipTypeFileImport : poolMembershipTypeCriteria]}\r\n                isInvalid={!this.state.isPoolMembershipTypeValid}\r\n                emptyLabel=\"Select\"\r\n                placeholder=\"Select\">\r\n                {this.state.isPoolMembershipTypeValid && <Button variant=\"toggle\" onClick={() => { this.poolMembershipTypeTypeahead.current?.toggleMenu() }}>\r\n                  <FaAngleDown />\r\n                </Button>}\r\n              </Typeahead>\r\n            </Col>}\r\n        </Form.Row>\r\n        {!!this.props.isConsortium &&\r\n          <Form.Row>\r\n            <Form.Label column xs={6} md={4} htmlFor=\"includeNoSelection\">INCLUDE COMPANIES WITH NO SELECTIONS</Form.Label>\r\n            {!editable.includeCompanies && this.valueText(data?.IncludeCompaniesWithNoSelections ? yes : no)}\r\n            {editable.includeCompanies && <Col xs={6} md={8}><Checkbox id=\"includeNoSelection\" name=\"IncludeNoSelection\" label=\"\" checked={editData?.IncludeCompaniesWithNoSelections} className=\"pt-2\" onChange={this.handleNoSelectionChange} /></Col>}\r\n          </Form.Row>\r\n        }\r\n        {!isOnTrack && <Form.Row className=\"form-group required\">\r\n          <Form.Label column xs={6} md={4} htmlFor=\"primaryIDType\">POOL REPORT ID TYPE</Form.Label>\r\n          {!editable.primaryIDType && this.valueText(primaryIDType)}\r\n          {editable.primaryIDType &&\r\n            <Col xs={6} md={8}>\r\n              <Form.Control id=\"primaryIDType\"\r\n                as=\"select\"\r\n                value={primaryIDType}\r\n                disabled={this.state.primaryIDTypesLoading}\r\n                isInvalid={!this.state.isPrimaryIDTypeValid}\r\n                onChange={(e: React.ChangeEvent<HTMLSelectElement>) => this.handlePrimaryIDTypeChange(e)}>\r\n                {!primaryIDType && <option value=\"\"></option>}\r\n                {this.state.primaryIDTypes?.map(item => <option value={item.PrimaryIDType} key={item.PrimaryIDType}>{item.PrimaryIDType}</option>)}\r\n              </Form.Control>\r\n            </Col>}\r\n        </Form.Row>}\r\n\r\n        {!isOnTrack && <Form.Row>\r\n          <Form.Label column xs={6} md={4}>WHO CAN RUN POOL</Form.Label>\r\n          {!editable.runOnlyByPortalAdmin && this.valueText(data?.RunOnlyByPortalAdmin ? \"Portal Administrator Only\" : \"Company Administrator Only\")}\r\n          {editable.runOnlyByPortalAdmin && <Col>\r\n            <Checkbox id=\"runOnlyByCompanyAdmin\" name=\"RunOnlyByCompanyAdmin\" label=\"Company Administrator Only\" checked={!editData?.RunOnlyByPortalAdmin} disabled={!isPortalAdmin} className=\"pt-2 ml-3\" onChange={this.handleRunOnlyByCompanyAdminChange} />\r\n          </Col>}\r\n          {editable.runOnlyByPortalAdmin && <Col>\r\n            <Checkbox id=\"runOnlyByPortalAdmin\" name=\"RunOnlyByPortalAdmin\" label=\"Portal Administrator Only\" checked={editData?.RunOnlyByPortalAdmin} disabled={!isPortalAdmin} className=\"pt-2 ml-3\" onChange={this.handleRunOnlyByPortalAdminChange} />\r\n          </Col>}\r\n        </Form.Row>}\r\n\r\n        <Form.Row className=\"buttons-block\" hidden={!this.state.editing}>\r\n          <Button variant=\"secondary\" onClick={this.handleToggleEditMode}>CANCEL</Button>\r\n          <ActionButton variant=\"primary\" onClick={this.handleSubmit} spin={this.state.saving} disableOnSpin>SAVE</ActionButton>\r\n        </Form.Row>\r\n      </Form>\r\n      <ConfirmationModal show={this.state.showSaveConfirmModal}\r\n        title=\"CONFIRMATION\"\r\n        textTitle=\"Are you sure you want to submit?\"\r\n        text=\"You have made modification to this pool configuration. Changes will be applied to the next random selection for this pool.\"\r\n        onConfirm={this.performSave}\r\n        onHide={() => this.setState({ showSaveConfirmModal: false })} />\r\n      {this.state.showMissingModal && !!data && <MissedPeriodsModal details={data} onSave={() => this.onSaveMissingPeriods()} onHide={() => this.setState({ showMissingModal: false })} />}\r\n    </>\r\n  }\r\n  /*\r\n  <Form.Row className=\"form-group required\">\r\n                <Form.Label column sm={4} htmlFor=\"primaryIDType\">Primary ID Type</Form.Label>\r\n                <Col sm={8}>\r\n                  <Form.Control id=\"primaryIDType\"\r\n                    as=\"select\"\r\n                    disabled={primaryIDTypesLoading || disabled}\r\n                    value={primaryIDType}\r\n                    isInvalid={!validPrimaryIDType}\r\n                    onChange={(e: React.ChangeEvent<HTMLSelectElement>) => this.setState({ primaryIDType: Number(e.target.value) })}>\r\n                    <option value=\"0\">Select</option>\r\n                    {primaryIDTypes?.map(item => <option value={item.PrimaryTypeID} key={item.PrimaryTypeID}>{item.PrimaryIDType}</option>)}\r\n                  </Form.Control>\r\n                </Col>\r\n              </Form.Row>\r\n  */\r\n}\r\n","import * as React from \"react\"\r\nimport { Button, Col, Form, Modal } from \"react-bootstrap\"\r\nimport { toast } from \"react-toastify\"\r\nimport { Subscription } from \"rxjs\"\r\nimport { APIError } from \"../../../api/ObservableFromFetch\"\r\nimport { SetMissingPeriods, MissedPeriodsData } from \"../../../api/Randoms/PoolGeneralInfoGet\"\r\nimport PoolData from \"../../../api/Randoms/RandomsModel/PoolData\"\r\nimport FormatError from \"../../../formatters/FormatError\"\r\nimport ActionButton from \"../../ActionButton\"\r\n\r\ninterface MissedPeriodsModalProps {\r\n  details: PoolData\r\n  onHide: () => void\r\n  onSave: () => void\r\n}\r\n\r\ninterface MissedPeriodsModalState {\r\n  saving: boolean\r\n  MakeUp: boolean\r\n  TotalCompletedDrug?: number\r\n  TotalCompletedAlcohol?: number\r\n  AveragePoolSize?: number\r\n}\r\n\r\nexport default class MissedPeriodsModal extends React.PureComponent<MissedPeriodsModalProps, MissedPeriodsModalState> {\r\n  state: MissedPeriodsModalState = {\r\n    saving: false,\r\n    MakeUp: true,\r\n    TotalCompletedDrug: undefined,\r\n    TotalCompletedAlcohol: undefined,\r\n    AveragePoolSize: undefined\r\n  }\r\n\r\n  saveSubscription?: Subscription\r\n\r\n  componentWillUnmount() {\r\n    this.saveSubscription && this.saveSubscription.unsubscribe()\r\n  }\r\n\r\n  handleAPIError = (error: Error | APIError, stateChanges: object) => {\r\n    this.setState(stateChanges)\r\n    error && toast.error(FormatError(error))\r\n  }\r\n\r\n  handleSelect = (e: React.ChangeEvent<HTMLInputElement>) => this.setState({ MakeUp: e.target.value == \"makeup\", TotalCompletedDrug: undefined, TotalCompletedAlcohol: undefined, AveragePoolSize: undefined })\r\n\r\n  onSave = () => {\r\n    this.setState({ saving: true })\r\n    this.saveSubscription && this.saveSubscription.unsubscribe()\r\n    const { MakeUp, TotalCompletedDrug, TotalCompletedAlcohol, AveragePoolSize } = this.state\r\n\r\n    const data: MissedPeriodsData = {\r\n      PoolProgramID: this.props.details.PoolProgramID,\r\n      MakeUp: MakeUp ? 1 : 0,\r\n      TotalCompletedDrug: MakeUp ? 0 : TotalCompletedDrug || 0,\r\n      TotalCompletedAlcohol: MakeUp ? 0 : TotalCompletedAlcohol || 0,\r\n      AveragePoolSize: MakeUp ? 0 : AveragePoolSize || 0\r\n    }\r\n\r\n    this.saveSubscription = SetMissingPeriods(data).subscribe(\r\n      data => {\r\n        toast.success(data)\r\n        this.props.onSave()\r\n      },\r\n      error => this.handleAPIError(error, { saving: false })\r\n    )\r\n  }\r\n\r\n  changeInput = (value: string, fieldName: keyof MissedPeriodsModalState) => {\r\n    const enteredValue = value.replace(/[^0-9]+/g, '')\r\n    if (/^(0|[1-9]{1}\\d{0,18})$/.test(enteredValue)) {\r\n      this.setState({...{}, [fieldName]: Number(enteredValue) })\r\n    }\r\n    else {\r\n      this.setState({...{}, [fieldName]: undefined })\r\n    }\r\n  }\r\n\r\n  className = (disable: boolean) => disable ? \"disabled\" : \"\"\r\n  inputValue = (value: number | string | undefined) => value || value?.toString() === \"0\" ? value.toString() : \"\"\r\n\r\n  validForm = (): boolean => {\r\n    const { MakeUp, TotalCompletedDrug, TotalCompletedAlcohol, AveragePoolSize } = this.state\r\n    const validSizes = (TotalCompletedDrug !== undefined && TotalCompletedAlcohol !== undefined && AveragePoolSize !== undefined)\r\n    const valid = MakeUp ? true : validSizes\r\n    return valid\r\n  }\r\n\r\n  render() {\r\n    const { onHide } = this.props\r\n    const { MakeUp, TotalCompletedDrug, TotalCompletedAlcohol, AveragePoolSize, saving } = this.state\r\n\r\n    return (\r\n      <Modal backdrop=\"static\" show={true} onHide={onHide} size=\"lg\">\r\n        <Modal.Header closeButton>\r\n          <Modal.Title>Missing Periods</Modal.Title>\r\n        </Modal.Header>\r\n        <Modal.Body>\r\n          <Form>\r\n            <Form.Row className=\"p-2 font-weight-bold\">\r\n              If one or more periods have been missed for this pool group. Please choose one of the following options.\r\n            </Form.Row>\r\n            <Form.Check label=\"Allow Workforce to make up required tests for missed periods.\"\r\n              id=\"makeup-radio\"\r\n              type=\"radio\"\r\n              name=\"selectionType\"\r\n              className=\"abc-radio mt-3\"\r\n              value={\"makeup\"}\r\n              checked={MakeUp}\r\n              onChange={this.handleSelect} />\r\n            <Form.Check label=\"Enter total number of tests already performed for the missed periods for this pool group.\"\r\n              id=\"enter-radio\"\r\n              type=\"radio\"\r\n              name=\"selectionType\"\r\n              className=\"abc-radio mb-3\"\r\n              value={\"enter\"}\r\n              checked={!MakeUp}\r\n              onChange={this.handleSelect} />\r\n\r\n            <Form.Row className={`form-group required ${this.className(MakeUp)}`}>\r\n              <Form.Label column sm={6} htmlFor=\"totalDrug\">Total # of drug tests completed</Form.Label>\r\n              <Col sm={6}>\r\n                <Form.Control id=\"totalDrug\" type=\"text\" value={this.inputValue(TotalCompletedDrug)} disabled={MakeUp} maxLength={10} onChange={(e) => this.changeInput(e.target.value, \"TotalCompletedDrug\")} />\r\n              </Col>\r\n            </Form.Row>\r\n            <Form.Row className={`form-group required ${this.className(MakeUp)}`}>\r\n              <Form.Label column sm={6} htmlFor=\"totalAlcohol\">Total # of alcohol tests completed</Form.Label>\r\n              <Col sm={6}>\r\n                <Form.Control id=\"totalAlcohol\" type=\"text\" value={this.inputValue(TotalCompletedAlcohol)} disabled={MakeUp} maxLength={10} onChange={(e) => this.changeInput(e.target.value, \"TotalCompletedAlcohol\")} />\r\n              </Col>\r\n            </Form.Row>\r\n            <Form.Row className={`form-group required ${this.className(MakeUp)}`}>\r\n              <Form.Label column sm={6} htmlFor=\"average\">Average pool size during the missed periods</Form.Label>\r\n              <Col sm={6}>\r\n                <Form.Control id=\"average\" type=\"text\" value={this.inputValue(AveragePoolSize)} disabled={MakeUp} maxLength={10} onChange={(e) => this.changeInput(e.target.value, \"AveragePoolSize\")} />\r\n              </Col>\r\n            </Form.Row>\r\n\r\n            <Form.Row className=\"p-2\">\r\n              When choosing this option the total number of tests and average pool size should be entered prior to running the first random selection. These values are necessary for RedArrow to calculate the proper number of selections and provide accurate statistics. If the actual numbers are unknown, then estimated values should be entered when creating the pool. The pool detail form provides a link (\"Total tests performed for missed periods\") so that these values can be updated later.\r\n            </Form.Row>\r\n          </Form>\r\n        </Modal.Body>\r\n        <Modal.Footer>\r\n          <Button variant=\"secondary\" onClick={onHide} className=\"mr-auto fixed-w5\">CANCEL</Button>\r\n          <ActionButton variant=\"primary\" onClick={this.onSave} disabled={!this.validForm()} spin={saving} disableOnSpin={true} className=\"fixed-w5\">SAVE</ActionButton>\r\n        </Modal.Footer>\r\n      </Modal>\r\n    )\r\n  }\r\n}","import { Observable } from \"rxjs\"\r\nimport { ObservableFromFetch } from \"../../ObservableFromFetch\"\r\n\r\nexport interface MappingField {\r\n  FieldGroup : string\r\n  Required: boolean\r\n  Active: boolean\r\n  Name: string\r\n  UniqueName: string\r\n}\r\n\r\nexport interface MappingFields {\r\n  Required : MappingField[]\r\n  IDFields : MappingField[]\r\n  Other : MappingField[]\r\n  Supervisor1 : MappingField[]\r\n  Supervisor2 : MappingField[]\r\n}\r\n\r\nexport default function MappingFieldsGetObservable(importJobID: number): Observable<MappingFields> {\r\n  const params: string = JSON.stringify({ ImportJobID: importJobID })\r\n  return ObservableFromFetch<MappingFields>(\"WorkforceImport/GetPersonnelImportDropdown\", params)\r\n}\r\n","import { Observable } from \"rxjs\"\r\nimport ImportJobData from \"../../Administration/CompanyImport/Model/ImportJobData\"\r\nimport { ObservableFromFetch } from \"../../ObservableFromFetch\"\r\n\r\nexport default function ImportJobCreateObservable(csvBase64: string, fileName: string, hasHeaderRow: boolean, companyID: number, isGovtPersonnel?: boolean, poolID?: number, multiplePools: boolean = false): Observable<ImportJobData> {\r\n  const params: string = JSON.stringify({\r\n    CSVFileBase64String: csvBase64,\r\n    FileName: fileName,\r\n    HasHeaderRow: hasHeaderRow,\r\n    UseTemplate: false,\r\n    ImportJobID: 0,\r\n    CompanyID: companyID,\r\n    GovtPersonnel: isGovtPersonnel,\r\n    WorkforcePersonnel: !isGovtPersonnel,\r\n    PoolID: poolID || 0,\r\n    MultiplePools: multiplePools\r\n  })\r\n  return ObservableFromFetch<ImportJobData>(\"WorkforceImport/CreateImportJob\", params)\r\n}\r\n","import { Observable } from \"rxjs\"\r\nimport { ObservableFromFetch } from \"../../ObservableFromFetch\"\r\nimport ImportJobActionResult from \"./Model/ImportJobActionResult\"\r\n\r\nexport default function ImportJobMappingSetObservable(importJobID: number, selectedFields: string[]): Observable<ImportJobActionResult> {\r\n  const params: string = JSON.stringify({\r\n    ImportJobID: importJobID,\r\n    SelectedFields: selectedFields\r\n  })\r\n  return ObservableFromFetch<ImportJobActionResult>(\"WorkforceImport/MapDropDownFields\", params)\r\n}\r\n","import { Observable } from \"rxjs\"\r\nimport { ObservableFromFetch } from \"../../ObservableFromFetch\"\r\nimport ImportJobActionResult from \"./Model/ImportJobActionResult\"\r\n\r\nexport default function ImportJobValidateObservable(importJobID: number, poolID?:number): Observable<ImportJobActionResult> {\r\n  const params: string = JSON.stringify({ ImportJobID: importJobID, PoolID: poolID || 0 })\r\n  return ObservableFromFetch<ImportJobActionResult>(\"WorkforceImport/StartValidation\", params)\r\n}\r\n","import { Observable } from \"rxjs\"\r\nimport { ObservableFromFetch } from \"../../ObservableFromFetch\"\r\nimport ImportJobActionResult from \"./Model/ImportJobActionResult\"\r\n\r\nexport default function ImportJobStartObservable(importJobID: number, poolID: number): Observable<ImportJobActionResult> {\r\n  const params: string = JSON.stringify({\r\n    ImportJobID: importJobID,\r\n    PoolID: poolID\r\n  })\r\n  return ObservableFromFetch<ImportJobActionResult>(\"WorkforceImport/StartImport\", params)\r\n}\r\n","import { Observable } from \"rxjs\"\r\nimport { ObservableFromFetch } from \"../../ObservableFromFetch\"\r\nimport ImportJobActionResult from \"./Model/ImportJobActionResult\"\r\n\r\nexport default function ImportJobCancelObservable(importJobID: number): Observable<ImportJobActionResult> {\r\n  const params: string = JSON.stringify({ ImportJobID: importJobID })\r\n  return ObservableFromFetch<ImportJobActionResult>(\"WorkforceImport/CancelImportJob\", params)\r\n}\r\n","import { Observable } from \"rxjs\"\r\nimport { ObservableFromFetch } from \"../../ObservableFromFetch\"\r\n\r\nexport interface ValidationResultRow {\r\n  Cells: string[]\r\n  Status: string\r\n}\r\n\r\nexport interface ImportJobValidationResult {\r\n  TableHeaderItems: string[]\r\n  TableRows: ValidationResultRow[]\r\n  TitleMessage?: string\r\n  ImportMessage?: string\r\n  OtherMessage?: string\r\n  CancelImportMessage?: string\r\n  CanBeImported: boolean\r\n  ImportJobID: number\r\n  Pages: number\r\n  Total: number\r\n}\r\n\r\nexport default function ImportJobValidationResultGetObservable(importJobID: number, pageNumber?: number, pageSize?: number, poolID?:number): Observable<ImportJobValidationResult> {\r\n  const params: string = JSON.stringify({\r\n    ImportJobID: importJobID,\r\n    PageNumber: pageNumber || 1,\r\n    PageSize: pageSize || 10,\r\n    PoolID: poolID || 0\r\n  })\r\n  return ObservableFromFetch<ImportJobValidationResult>(\"WorkforceImport/GetImportFileValidationErrors\", params)\r\n}\r\n","import { Observable } from \"rxjs\"\r\nimport { AccountTypeID } from \"../../config/Constants\"\r\nimport { ObservableFromFetch } from \"../ObservableFromFetch\"\r\nimport AutoFilterCompany from \"./CompanyModel/AutoFilterCompany\"\r\n\r\nexport default function AutoFilterCompaniesGetObservable(filter: string, IsFilters: boolean = false): Observable<AutoFilterCompany[]> {\r\n  const requestBody: string = JSON.stringify({\r\n    AccountType: AccountTypeID,\r\n    AutoFilterValue: filter,\r\n    IncludeCompany: true,\r\n    IncludeLocation: false,\r\n    IncludeMaster: false,\r\n    IncludeParent: true,\r\n    IncludeRegion: false,\r\n    IsFilters: IsFilters\r\n  })\r\n\r\n  return ObservableFromFetch<AutoFilterCompany[]>(\"Order/GetAutoFilterCompany\", requestBody)\r\n}\r\n","import { useEffect, useMemo, useState } from \"react\"\r\n\r\nimport { Col, Container, Row, Table } from \"react-bootstrap\"\r\nimport { toast } from \"react-toastify\"\r\nimport { BehaviorSubject, concat, of } from \"rxjs\"\r\nimport { catchError, distinctUntilChanged, filter, map, switchMap } from \"rxjs/operators\"\r\n\r\nimport ImportJobValidationResultGetObservable, {\r\n  ImportJobValidationResult,\r\n  ValidationResultRow,\r\n} from \"../../api/Randoms/Import/ImportJobValidationResultGet\"\r\nimport FormatError from \"../../formatters/FormatError\"\r\nimport LoadingTableWrapper from \"../LoadingTableWrapper\"\r\nimport TablePagination from \"../TablePagination\"\r\n\r\ninterface ImportErrorDetailsProps {\r\n  importJobID: number\r\n  errors?: ImportJobValidationResult\r\n  pageSize?: number\r\n}\r\n\r\ninterface GetErrorsParams {\r\n  importJobID: number\r\n  pageSize?: number\r\n  pageNumber: number\r\n}\r\n\r\ninterface DataLoader {\r\n  data: ImportJobValidationResult\r\n  loading: boolean\r\n}\r\n\r\nfunction ImportErrorDetails(props: ImportErrorDetailsProps) {\r\n  const { importJobID, pageSize, errors } = props\r\n  const [importErrors, setImportErrors] = useState<DataLoader>({\r\n    data: errors || {\r\n      ImportJobID: importJobID,\r\n      TableHeaderItems: [],\r\n      TableRows: [],\r\n      Pages: 1,\r\n      Total: 0,\r\n      TitleMessage: \"\",\r\n      CanBeImported: false,\r\n    },\r\n    loading: false,\r\n  })\r\n\r\n  const page$ = useMemo(\r\n    () =>\r\n      new BehaviorSubject<GetErrorsParams>({\r\n        importJobID: errors ? -1 : importJobID,\r\n        pageSize,\r\n        pageNumber: 1,\r\n      }),\r\n    [importJobID, pageSize, errors]\r\n  )\r\n\r\n  useEffect(() => {\r\n    setImportErrors((prev) => ({ data: { ...prev.data }, loading: page$.value.importJobID > 0 }))\r\n\r\n    const pageSubscription = page$\r\n      .pipe(\r\n        filter((v) => v.importJobID > 0),\r\n        distinctUntilChanged(),\r\n        switchMap((params: GetErrorsParams) =>\r\n          concat(\r\n            of({ loading: true }),\r\n            ImportJobValidationResultGetObservable(params.importJobID, params.pageNumber, params.pageSize).pipe(\r\n              map((result: ImportJobValidationResult) => ({ data: result, loading: false })),\r\n              catchError((error) => of({ loading: false, errorMessage: FormatError(error) }))\r\n            )\r\n          )\r\n        )\r\n      )\r\n      .subscribe(\r\n        (o: { loading: boolean; data?: ImportJobValidationResult; errorMessage?: string }) => {\r\n          setImportErrors((prev) => ({ data: { ...prev.data, ...o.data }, loading: o.loading }))\r\n          if (o.errorMessage) {\r\n            toast.error(o.errorMessage)\r\n          }\r\n        },\r\n        (error) => {\r\n          setImportErrors((prev) => ({ data: { ...prev.data }, loading: false }))\r\n          toast.error(FormatError(error))\r\n        }\r\n      )\r\n    return () => pageSubscription.unsubscribe()\r\n  }, [errors, page$])\r\n\r\n  const pageChange = (pageNumber: number) => page$.next({ ...page$.value, importJobID, pageNumber })\r\n\r\n  const { TitleMessage, TableHeaderItems = [], TableRows = [], Pages = 1 } = importErrors.data\r\n\r\n  const renderImportCells = (row: ValidationResultRow) => {\r\n    return row.Cells.map((cell, i) => (\r\n      <td key={`cell_${TableHeaderItems[i]}`} className=\"text-nowrap\">\r\n        {i === 1 ? <div className=\"text-danger\" dangerouslySetInnerHTML={{ __html: cell }} /> : <div>{cell}</div>}\r\n      </td>\r\n    ))\r\n  }\r\n\r\n  const renderImportRows = () => {\r\n    return TableRows.map((row) => <tr key={`row_${row.Cells[0]}`}>{renderImportCells(row)}</tr>)\r\n  }\r\n\r\n  return (\r\n    <Container fluid className=\"grid-container p-0\">\r\n      {TitleMessage && (\r\n        <Row>\r\n          <Col className=\"h6\">{TitleMessage}</Col>\r\n        </Row>\r\n      )}\r\n      {TableRows.length > 0 && (\r\n        <>\r\n          <Row>\r\n            <Col>\r\n              <LoadingTableWrapper loading={importErrors.loading} variant=\"light\">\r\n                <Table className=\"table-sm mb-0\" responsive bordered size=\"sm\">\r\n                  <thead>\r\n                    <tr>\r\n                      {TableHeaderItems.map((item) => (\r\n                        <th key={`h_${item}`}>{item}</th>\r\n                      ))}\r\n                    </tr>\r\n                  </thead>\r\n                  <tbody>{renderImportRows()}</tbody>\r\n                </Table>\r\n              </LoadingTableWrapper>\r\n            </Col>\r\n          </Row>\r\n          <Row>\r\n            <Col>\r\n              <TablePagination\r\n                pageNumber={page$.value.pageNumber}\r\n                pages={Pages}\r\n                className=\"mt-3 mb-0\"\r\n                onChange={pageChange}\r\n              />\r\n            </Col>\r\n          </Row>\r\n        </>\r\n      )}\r\n    </Container>\r\n  )\r\n}\r\n\r\nImportErrorDetails.defaultProps = {\r\n  errors: undefined,\r\n  pageSize: 10,\r\n}\r\n\r\nexport default ImportErrorDetails\r\n","import * as React from \"react\"\r\nimport { Button, Col, Form, Row, Spinner, Table } from \"react-bootstrap\"\r\nimport { BehaviorSubject, concat, of, Subscription } from \"rxjs\"\r\nimport { debounceTime, filter, map, switchMap } from \"rxjs/operators\"\r\nimport { toast } from \"react-toastify\"\r\nimport { ImportCSVMaxFileSize } from \"../../../config/Constants\"\r\nimport ConfirmationModal from \"../../ConfirmationModal\"\r\nimport MappingFieldsGetObservable, { MappingField, MappingFields } from \"../../../api/Randoms/Import/MappingFieldsGet\"\r\nimport ImportJobData from \"../../../api/Administration/CompanyImport/Model/ImportJobData\"\r\nimport ImportJobCreateObservable from \"../../../api/Randoms/Import/ImportJobCreate\"\r\nimport ImportJobMappingSetObservable from \"../../../api/Randoms/Import/ImportJobMappingSet\"\r\nimport ImportJobValidateObservable from \"../../../api/Randoms/Import/ImportJobValidate\"\r\nimport ImportJobStartObservable from \"../../../api/Randoms/Import/ImportJobStart\"\r\nimport ImportJobCancelObservable from \"../../../api/Randoms/Import/ImportJobCancel\"\r\nimport ImportJobValidationResultGetObservable, { ImportJobValidationResult } from \"../../../api/Randoms/Import/ImportJobValidationResultGet\"\r\nimport AutoFilterCompany from \"../../../api/Companies/CompanyModel/AutoFilterCompany\"\r\nimport AutoFilterCompaniesGetObservable from \"../../../api/Companies/AutoFilterCompaniesGet\"\r\nimport CompanyInput from \"../../FormattedInputs/CompanyInput\"\r\nimport ImportErrorDetails from \"../ImportErrorDetails\"\r\nimport FileSaver from \"file-saver\"\r\nimport ActionButton from \"../../ActionButton\"\r\n\r\ninterface ImportPoolMembersFieldMapping {\r\n  column: number\r\n  fieldGroup?: string\r\n  mappingField?: MappingField\r\n}\r\n\r\ninterface ImportPoolMembersProps {\r\n  poolID: number,\r\n  isGovt?: boolean\r\n  poolPrimaryIDType?: string\r\n  isConsortium?: boolean\r\n  multiplePools?: boolean\r\n  onUpdate?: (updated: boolean) => void\r\n}\r\n\r\ninterface ImportPoolMembersState {\r\n  step: \"file\" | \"mapping\" | \"import\"\r\n  fileInputKey: string\r\n  selectedCompany?: AutoFilterCompany\r\n  fileName?: string\r\n  fileContent?: string\r\n  fileHasHeaderRow: boolean\r\n  importData?: ImportJobData\r\n  mappingFields?: MappingFields\r\n  mapping?: ImportPoolMembersFieldMapping[]\r\n  validationResult?: ImportJobValidationResult\r\n  unfilteredCompanies?: AutoFilterCompany[]\r\n  companies: AutoFilterCompany[]\r\n  isCompaniesLoading: boolean\r\n  isSaving: boolean\r\n  isCancelling: boolean\r\n  showCancelConfirmModal: boolean\r\n  showImportConfirmModal: boolean\r\n}\r\n\r\nexport default class ImportPoolMembers extends React.Component<ImportPoolMembersProps, ImportPoolMembersState> {\r\n  emptyData: ImportPoolMembersState = {\r\n    step: \"file\",\r\n    fileInputKey: \"file_input_key\",\r\n    selectedCompany: undefined,\r\n    fileName: undefined,\r\n    fileContent: undefined,\r\n    fileHasHeaderRow: true,\r\n    importData: undefined,\r\n    mappingFields: undefined,\r\n    mapping: undefined,\r\n    validationResult: undefined,\r\n    companies: [],\r\n    isCompaniesLoading: false,\r\n    isSaving: false,\r\n    isCancelling: false,\r\n    showCancelConfirmModal: false,\r\n    showImportConfirmModal: false\r\n  }\r\n  state: ImportPoolMembersState = { ...this.emptyData, unfilteredCompanies: [] }\r\n\r\n  searchCompany$ = new BehaviorSubject<string | undefined>(undefined)\r\n  companiesListSubscription?: Subscription\r\n  searchCompanySubscription?: Subscription\r\n  importJobCreateSubscription?: Subscription\r\n  mappingFieldsGetSubscription?: Subscription\r\n  importJobValidateSubscription?: Subscription\r\n  importJobValidationResultGetSubscription?: Subscription\r\n  importJobMappingSetSubscription?: Subscription\r\n  importJobStartSubscription?: Subscription\r\n  importJobCancelSubscription?: Subscription\r\n  poolCriteriaSubscription?: Subscription\r\n\r\n  componentDidMount() {\r\n    if (!!this.props.isConsortium) return\r\n    this.setState({ isCompaniesLoading: true })\r\n    let companies: AutoFilterCompany[] = []\r\n    this.companiesListSubscription = AutoFilterCompaniesGetObservable(\"\").subscribe(\r\n      (data: AutoFilterCompany[]) => {\r\n        companies = data\r\n        this.setState({\r\n          companies: data,\r\n          unfilteredCompanies: data,\r\n          selectedCompany: data.length === 1 ? data[0] : undefined\r\n        })\r\n      },\r\n      () => {\r\n        this.setState({ isCompaniesLoading: false })\r\n      }\r\n    )\r\n\r\n    this.searchCompanySubscription = this.searchCompany$.pipe(\r\n      filter(filter => filter !== undefined),\r\n      debounceTime(500),\r\n      map(filter => (filter ?? \"\").trim()),\r\n      switchMap((filter) => filter.length < 3\r\n        ? of({ isLoading: false, items: this.state.unfilteredCompanies })\r\n        : concat(\r\n          of({ isLoading: true }),\r\n          AutoFilterCompaniesGetObservable(filter).pipe(\r\n            map((data) => ({ isLoading: false, items: data }))\r\n          )\r\n        ))\r\n    ).subscribe(\r\n      (state: { isLoading: boolean, items?: AutoFilterCompany[] }) => {\r\n        state.items\r\n          ? this.setState({ isCompaniesLoading: state.isLoading, companies: state.items })\r\n          : this.setState({ isCompaniesLoading: state.isLoading })\r\n      },\r\n      () => this.setState({ isCompaniesLoading: false })\r\n    )\r\n  }\r\n\r\n  componentWillUnmount() {\r\n    this.companiesListSubscription && this.companiesListSubscription.unsubscribe()\r\n    this.searchCompanySubscription && this.searchCompanySubscription.unsubscribe()\r\n    this.importJobCreateSubscription && this.importJobCreateSubscription.unsubscribe()\r\n    this.mappingFieldsGetSubscription && this.mappingFieldsGetSubscription.unsubscribe()\r\n    this.importJobValidateSubscription && this.importJobValidateSubscription.unsubscribe()\r\n    this.importJobValidationResultGetSubscription && this.importJobValidationResultGetSubscription.unsubscribe()\r\n    this.importJobMappingSetSubscription && this.importJobMappingSetSubscription.unsubscribe()\r\n    this.importJobStartSubscription && this.importJobStartSubscription.unsubscribe()\r\n    this.importJobCancelSubscription && this.importJobCancelSubscription.unsubscribe()\r\n    this.poolCriteriaSubscription && this.poolCriteriaSubscription.unsubscribe()\r\n  }\r\n\r\n  createMapping = (importData: ImportJobData): ImportPoolMembersFieldMapping[] => {\r\n    const colsCount = importData.Records.length > 0 ? Math.max(importData.HeaderItems?.length ?? 0, Math.max(...importData.Records.map(row => row.length))) : 0\r\n    return [...Array(colsCount)].map((_, i) => ({ column: i }))\r\n  }\r\n\r\n  handleApiError = (error: Error) => {\r\n    this.setState({ isSaving: false, isCancelling: false })\r\n    toast.error(error)\r\n  }\r\n\r\n  handleFileStepNext = () => {\r\n    if (this.state.fileContent) {\r\n      this.setState({ isSaving: true })\r\n      this.importJobCreateSubscription && this.importJobCreateSubscription.unsubscribe()\r\n      this.importJobCreateSubscription = ImportJobCreateObservable(this.state.fileContent, this.state.fileName || \"\", !!this.state.fileHasHeaderRow, this.state.selectedCompany?.AccountID || 0, this.props.isGovt, this.props.poolID, !!this.props.multiplePools).subscribe(\r\n        (data) => this.getMappingFields(data),\r\n        (error) => this.handleApiError(error)\r\n      )\r\n    }\r\n  }\r\n\r\n  getMappingFields = (importJobData: ImportJobData) => {\r\n    this.mappingFieldsGetSubscription && this.mappingFieldsGetSubscription.unsubscribe()\r\n    this.mappingFieldsGetSubscription = MappingFieldsGetObservable(importJobData.ImportJobID).subscribe(\r\n      (mappingFields) => this.setState({\r\n        step: \"mapping\",\r\n        importData: importJobData,\r\n        mappingFields: mappingFields,\r\n        mapping: this.createMapping(importJobData),\r\n        isSaving: false\r\n      }),\r\n      (error) => this.handleApiError(error)\r\n    )\r\n  }\r\n\r\n  handleMappingValidate = () => {\r\n    const selectedMappingFields = this.state.mapping?.map(item => item.mappingField?.UniqueName || \"\") || []\r\n    if (selectedMappingFields.every(item => item.trim().length === 0)) {\r\n      toast.error(\"Mapping is empty, select at least one Column map.\")\r\n      return\r\n    }\r\n    this.setState({ isSaving: true })\r\n    this.importJobMappingSetSubscription && this.importJobMappingSetSubscription.unsubscribe()\r\n    this.importJobMappingSetSubscription = ImportJobMappingSetObservable(this.state.importData?.ImportJobID || 0, selectedMappingFields).subscribe(\r\n      (mappingResult) => this.startImportValidation(mappingResult.ImportJobID, this.props.poolID),\r\n      (error) => this.handleApiError(error)\r\n    )\r\n  }\r\n\r\n  startImportValidation = (importJobID: number, poolID?: number) => {\r\n    this.importJobValidateSubscription && this.importJobValidateSubscription.unsubscribe()\r\n    this.importJobValidateSubscription = ImportJobValidateObservable(importJobID, poolID).subscribe(\r\n      (validationResult) => this.getImportValidationResults(validationResult.ImportJobID),\r\n      (error) => this.handleApiError(error)\r\n    )\r\n  }\r\n\r\n  getImportValidationResults = (importJobID: number, poolID?: number) => {\r\n    this.importJobValidationResultGetSubscription && this.importJobValidationResultGetSubscription.unsubscribe()\r\n    this.importJobValidationResultGetSubscription = ImportJobValidationResultGetObservable(importJobID, 1, 10, poolID).subscribe(\r\n      (validationErrors) => this.setState({ step: \"import\", validationResult: validationErrors, isSaving: false }),\r\n      (error) => this.handleApiError(error)\r\n    )\r\n  }\r\n\r\n  performImport = () => {\r\n    this.setState({ isSaving: true })\r\n    this.importJobStartSubscription && this.importJobStartSubscription.unsubscribe()\r\n    this.importJobStartSubscription = ImportJobStartObservable(this.state.importData?.ImportJobID || 0, this.props.poolID).subscribe(\r\n      (data) => {\r\n        if (data.Result && data.ErrorsData.length === 0) {\r\n          toast.success(\"Records imported successfully.\")\r\n        }\r\n        else {\r\n          toast.error(\"Records imported with errors.\")\r\n          if (data.ErrorsData.length > 0) this.export(data.ErrorsData, this.state.fileName || \"data.csv\")\r\n        }\r\n        this.props.onUpdate && this.props.onUpdate(true)\r\n        this.resetState()\r\n      },\r\n      (error) => this.handleApiError(error)\r\n    )\r\n  }\r\n\r\n  export(csv: string, fileName: string) {\r\n    const csvData = new Blob([csv], { type: 'text/csv;charset=utf-8;' })\r\n    FileSaver.saveAs(csvData, fileName)\r\n    toast.success(\"CSV file downloaded successfully.\")\r\n  }\r\n\r\n  performCancel = () => {\r\n    this.setState({ isCancelling: true })\r\n    this.importJobCancelSubscription && this.importJobCancelSubscription.unsubscribe()\r\n    this.importJobCancelSubscription = ImportJobCancelObservable(this.state.importData?.ImportJobID || 0).subscribe(\r\n      () => {\r\n        toast.success(\"Created job is cancelled successfully.\")\r\n        this.resetState()\r\n      },\r\n      (error) => this.handleApiError(error)\r\n    )\r\n  }\r\n\r\n  resetState = () => this.setState(prevState => ({\r\n    ...this.emptyData,\r\n    selectedCompany: prevState.companies.length <= 1 ? prevState.selectedCompany : undefined,\r\n    fileInputKey: Math.random().toString()\r\n  }))\r\n\r\n  handleHandleFileUpload = (e: React.ChangeEvent<HTMLInputElement>) => {\r\n    const file = e.target && e.target.files && e.target.files[0]\r\n    if (file && file.size > 0 && file.size < ImportCSVMaxFileSize) {\r\n      const ext = file.name.substring(file.name.lastIndexOf(\".\") + 1)\r\n      if (ext && ext.toLowerCase() === \"csv\") {\r\n        var reader = new FileReader()\r\n        const self = this\r\n        reader.onload = function (e) {\r\n          const result = e.target?.result as string || \"\"\r\n          const stringLength = result.indexOf(\"base64\") + 7\r\n          const fileContent = result.slice(stringLength, result.length)\r\n          if (fileContent) {\r\n            self.setState({ fileName: file.name, fileContent: fileContent })\r\n          } else {\r\n            self.setState({ fileName: undefined, fileContent: undefined })\r\n            toast.error(\"CSV file is empty.\")\r\n          }\r\n        }\r\n        reader.onerror = function (error) { toast.error(error) }\r\n        reader.readAsDataURL(file)\r\n      } else {\r\n        toast.error(\"File type not allowed, Please upload CSV file.\")\r\n      }\r\n    } else {\r\n      this.setState({ fileName: undefined, fileContent: undefined })\r\n    }\r\n  }\r\n\r\n  handleFieldMappingChange = (e: React.ChangeEvent<HTMLSelectElement>, target: ImportPoolMembersFieldMapping, value: string) => {\r\n    const mappings = [...this.state.mapping || []]\r\n    const index = mappings.findIndex(item => item.column === target.column)\r\n    if (index === -1) {\r\n      return\r\n    }\r\n    if (value === \"skip\") {\r\n      mappings[index] = { column: target.column }\r\n    } else {\r\n      const valueKeys = value.split(\"|||\")\r\n      if (valueKeys.length !== 2) {\r\n        return\r\n      }\r\n      const mappingField = this.state.mappingFields![valueKeys[0] as keyof MappingFields].find(item => item.UniqueName === valueKeys[1])\r\n      if (!mappingField) {\r\n        return\r\n      }\r\n      mappings[index] = { column: target.column, fieldGroup: valueKeys[0], mappingField: mappingField }\r\n    }\r\n    this.setState({ mapping: mappings })\r\n  }\r\n  handleCompanyChange = (items: AutoFilterCompany[]) => {\r\n    const comp = items[0]\r\n    if (!comp) {\r\n      this.setState({ selectedCompany: undefined })\r\n      return\r\n    }\r\n    let ind = -1\r\n\r\n    if (this.state.companies) {\r\n      ind = this.state.companies.findIndex(item => item.AccountID === comp.AccountID)\r\n    }\r\n    if (ind < 0) {\r\n      this.setState({ selectedCompany: undefined })\r\n      return\r\n    }\r\n    const selected = this.state.companies[ind]\r\n    this.setState({ selectedCompany: selected })\r\n  }\r\n\r\n  render() {\r\n    const usedMappingFields = this.state.step === \"mapping\" && this.state.mapping\r\n      ? this.state.mapping.filter(item => !!item.mappingField).map(item => item.mappingField!.UniqueName)\r\n      : []\r\n    const poolPrimaryIDType = ((this.props.poolID > 0) && (!!this.props.poolPrimaryIDType)) ? this.props.poolPrimaryIDType : \"Unknown\"\r\n    const companyPrimaryIDType = this.state.selectedCompany?.PrimaryIDType || \"Unknown\"\r\n    const isConsortium = !!this.props.isConsortium\r\n    return <div className=\"ImportPoolMembers\">\r\n      <Form hidden={this.state.step !== \"file\"}>\r\n        <Form.Row><Col><h5>UPLOAD FILE</h5></Col></Form.Row>\r\n        {!isConsortium && !this.props.multiplePools && <Form.Row className=\"form-group\">\r\n          <Form.Label column sm={3}>Company:</Form.Label>\r\n          <Col md={5} className=\"form-label col-form-label\">\r\n            <CompanyInput\r\n              disabled={this.state.unfilteredCompanies && this.state.unfilteredCompanies.length <= 1}\r\n              allowedCompanies={isConsortium? this.state.companies : undefined}\r\n              onChange={items => this.handleCompanyChange(items)} />\r\n          </Col>\r\n        </Form.Row>}\r\n        <Form.Row><Col><h6>Import CSV File</h6></Col></Form.Row>\r\n        <Form.Row className=\"form-group\">\r\n          <Form.Label column sm={3}>Upload file:</Form.Label>\r\n          <Col md={5} className=\"form-label col-form-label\">\r\n            <input type=\"file\" key={this.state.fileInputKey} accept=\".csv\" onChange={this.handleHandleFileUpload} />\r\n          </Col>\r\n        </Form.Row>\r\n        <Form.Row className=\"form-group\">\r\n          <Col><Form.Check id=\"fileHasHeader\" label=\"File has header row\" checked={this.state.fileHasHeaderRow} onChange={(e: React.ChangeEvent<HTMLInputElement>) => this.setState({ fileHasHeaderRow: e.target.checked })} /></Col>\r\n        </Form.Row>\r\n        <Form.Row className=\"buttons-block\">\r\n          <Button type=\"reset\" variant=\"secondary\" className=\"float-left fixed-w5\" onClick={this.resetState} disabled={this.state.isSaving}>RESET</Button>\r\n          <Button variant=\"primary\" className=\"float-right fixed-w5\" onClick={this.handleFileStepNext} disabled={!this.state.fileContent || this.state.isSaving || (!isConsortium && !this.props.multiplePools && !this.state.selectedCompany)}>\r\n            {this.state.isSaving ? <Spinner animation=\"border\" size=\"sm\" /> : \"NEXT\"}\r\n          </Button>\r\n        </Form.Row>\r\n      </Form>\r\n      <Form hidden={this.state.step !== \"mapping\"}>\r\n        <Row><Col><h5>FIELD MAPPINGS FOR: {this.state.selectedCompany?.Name} </h5></Col></Row>\r\n        <Row>\r\n          <Col className=\"h6\" sm={6} md={5} lg={3}>Company Primary ID Type: <span className=\"text-muted\">{companyPrimaryIDType}</span></Col>\r\n          <Col className=\"h6\" sm={5} md={5} lg={3}>Pool Primary ID Type: <span className=\"text-muted\">{poolPrimaryIDType}</span></Col>\r\n          <Col></Col>\r\n        </Row>\r\n        {this.state.mapping && this.state.mappingFields &&\r\n          <Table className=\"mappings-table\" responsive bordered>\r\n            <thead>\r\n              <tr>\r\n                {this.state.mapping.map(mapping => {\r\n                  const selectedValue = mapping.fieldGroup && mapping.mappingField?.UniqueName ? `${mapping.fieldGroup}|||${mapping.mappingField?.UniqueName}` : \"\"\r\n                  return (<th key={`h_${mapping.column}`}>\r\n                    <Form.Control as=\"select\" value={selectedValue} onChange={(e: React.ChangeEvent<HTMLSelectElement>) => this.handleFieldMappingChange(e, mapping, e.target.value)}>\r\n                      <option disabled hidden value=\"\">Skipped Field</option>\r\n                      <option className=\"map-field-id\" disabled>Map Field #{mapping.column + 1}</option>\r\n                      <option value=\"skip\">Set this field as skipped</option>\r\n                      {Object.keys(this.state.mappingFields!).filter(group => this.state.mappingFields![group as keyof MappingFields].length > 0).map(optGroupName =>\r\n                        <optgroup key={`h_${mapping.column}_${optGroupName}`} label={optGroupName}>\r\n                          {this.state.mappingFields![optGroupName as keyof MappingFields].map(field =>\r\n                            <option\r\n                              key={`h_${mapping.column}_${optGroupName}_${field.UniqueName}`}\r\n                              value={`${optGroupName}|||${field.UniqueName}`}\r\n                              disabled={usedMappingFields.includes(field.UniqueName)}>\r\n                              {field.Name}\r\n                            </option>)}\r\n                        </optgroup>)}\r\n                    </Form.Control>\r\n                  </th>)\r\n                })}\r\n              </tr>\r\n            </thead>\r\n            <tbody>\r\n              {this.state.importData && this.state.importData.HeaderItems.length > 0 && <tr>{this.state.mapping!.map(mapping => <td key={`hr_${mapping.column}`}>{this.state.importData!.HeaderItems[mapping.column]}</td>)}</tr>}\r\n              {this.state.importData && this.state.importData.Records.length > 0 && this.state.importData.Records.map((row, i) => <tr key={`d_${i}`}>{this.state.mapping!.map(mapping => <td key={`d_${mapping.column}_${i}`}>{row[mapping.column]}</td>)}</tr>)}\r\n              {this.state.importData && this.state.importData.Records.length === 0 && <tr><td colSpan={this.state.mapping.length}>NO DATA FOUND</td></tr>}\r\n            </tbody>\r\n          </Table>}\r\n        <Form.Row className=\"buttons-block\">\r\n          <Button variant=\"secondary\" className=\"fixed-w5\" onClick={() => this.setState({ step: \"file\" })} disabled={this.state.isSaving}>BACK</Button>\r\n          <ActionButton\r\n            variant=\"primary\"\r\n            className=\"fixed-w5\"\r\n            spin={this.state.isSaving}\r\n            onClick={this.handleMappingValidate}\r\n            disabled={this.state.isSaving}>\r\n              SUBMIT FOR VALIDATION\r\n            </ActionButton>\r\n        </Form.Row>\r\n      </Form>\r\n      <Form hidden={this.state.step !== \"import\"}>\r\n        <Row><Col><h5>IMPORT FILE VALIDATION FOR: {this.state.selectedCompany?.Name}</h5></Col></Row>\r\n        {this.state.validationResult &&\r\n          <ImportErrorDetails importJobID={this.state.validationResult.ImportJobID} errors={this.state.validationResult} />}\r\n        <Form.Row className=\"buttons-block\">\r\n          <Button variant=\"secondary\" className=\"fixed-w5\" onClick={() => this.setState({ step: \"mapping\", validationResult: undefined })} disabled={this.state.isSaving || this.state.isCancelling}>BACK</Button>\r\n          <Button variant=\"secondary\" className=\"fixed-w5\" onClick={() => this.setState({ showCancelConfirmModal: true })}>\r\n            {this.state.isCancelling ? <Spinner animation=\"border\" size=\"sm\" /> : \"CANCEL\"}\r\n          </Button>\r\n          <Button variant=\"primary\" className=\"fixed-w5\" onClick={() => this.setState({ showImportConfirmModal: true })} disabled={!this.state.validationResult?.CanBeImported || this.state.isSaving || this.state.isCancelling}>\r\n            {this.state.isSaving ? <Spinner animation=\"border\" size=\"sm\" /> : \"IMPORT\"}\r\n          </Button>\r\n        </Form.Row>\r\n      </Form>\r\n      <ConfirmationModal show={this.state.showCancelConfirmModal}\r\n        title=\"CANCEL CONFIRMATION\"\r\n        textTitle={this.state.validationResult?.CancelImportMessage}\r\n        text=\"\"\r\n        onConfirm={this.performCancel}\r\n        onHide={() => this.setState({ showCancelConfirmModal: false })} />\r\n      <ConfirmationModal show={this.state.showImportConfirmModal}\r\n        title=\"IMPORT CONFIRMATION\"\r\n        textTitle={this.state.validationResult?.ImportMessage}\r\n        text=\"\"\r\n        onConfirm={this.performImport}\r\n        onHide={() => this.setState({ showImportConfirmModal: false })} />\r\n\r\n    </div>\r\n  }\r\n\r\n  static defaultProps = { step: \"file\" }\r\n}\r\n","import { Observable } from \"rxjs\"\r\nimport { ObservableFromFetchWithTaskData } from \"../ObservableFromFetch\"\r\nimport RunRandomSelectionMessage from \"./RandomsModel/RunRandomSelectionMessage\"\r\n\r\nexport default function RunRandomSelectionMessagesGetObservable(poolId: number): Observable<RunRandomSelectionMessage> {\r\n  const requestBody: string = new URLSearchParams({\r\n    poolId: poolId.toString()\r\n  }).toString()\r\n\r\n  return ObservableFromFetchWithTaskData<RunRandomSelectionMessage>(\"RandomTest/RandomSelectionMessage?\" + requestBody)\r\n}\r\n","import { Observable } from \"rxjs\"\r\nimport { ObservableFromFetch } from \"../ObservableFromFetch\"\r\nimport RandomSelectionRunData from \"./RandomsModel/RandomSelectionRunData\"\r\n\r\ninterface RandomSelectionRunOptions {\r\n  ContactId: number\r\n  UpdateMethodID: number\r\n  PoolId: number\r\n  RequiredDrug: number\r\n  RequiredAlcohol: number\r\n  AlternateDrug: number\r\n  AlternateAlcohol: number\r\n}\r\n\r\nexport interface RunCancelPoolsMessages {\r\n  PoolName: string\r\n  PoolCode: string\r\n  Message: string\r\n}\r\n\r\nexport interface PoolRunData {\r\n  PoolID: number\r\n  PoolName: string\r\n  PoolCode: string\r\n  IsConsortium: boolean\r\n}\r\n\r\nexport default function RandomSelectionRunObservable(options: RandomSelectionRunOptions): Observable<RandomSelectionRunData[]> {\r\n  const params: string = JSON.stringify(options)\r\n  return ObservableFromFetch<RandomSelectionRunData[]>(\"WorkforceRandomTest/RunRandomSelection\", params)\r\n}\r\n\r\nexport function RunCancelPoolsObservable(cancel: boolean, selectedPools: PoolRunData[]) {\r\n  const params: string = JSON.stringify({\r\n    Cancel: cancel,\r\n    SelectedPools: selectedPools\r\n  })\r\n  return ObservableFromFetch<RunCancelPoolsMessages[]>(\"WorkforceRandomTest/RunCancelSelectedPools\", params)\r\n}\r\n","import * as React from \"react\"\r\nimport { Container, Table, Row, Col, Spinner, Button, Form } from \"react-bootstrap\"\r\nimport { toast } from \"react-toastify\"\r\nimport { Subscription } from \"rxjs\"\r\nimport PoolStatisticsDetails from \"../../../api/Randoms/RandomsModel/PoolStatisticsDetails\"\r\nimport PoolStatisticsDetailsGetObservable from \"../../../api/Randoms/PoolStatisticsDetailsGet\"\r\nimport RunRandomSelectionMessage from \"../../../api/Randoms/RandomsModel/RunRandomSelectionMessage\"\r\nimport RunRandomSelectionMessagesGetObservable from \"../../../api/Randoms/RunRandomSelectionMessagesGet\"\r\nimport RandomSelectionRunData from \"../../../api/Randoms/RandomsModel/RandomSelectionRunData\"\r\nimport RandomSelectionRunObservable from \"../../../api/Randoms/RandomSelectionRun\"\r\nimport ConfirmationModal from \"../../ConfirmationModal\"\r\nimport FormatDate from \"../../../formatters/FormatDate\"\r\nimport RandomSelectionList from \"../RandomSelectionList\"\r\nimport PoolSelectionListGetObservable from \"../../../api/Randoms/PoolSelectionListGet\"\r\nimport PoolSelectionRow from \"../../../api/Randoms/RandomsModel/PoolSelectionRow\"\r\n\r\ninterface RunRandomProps {\r\n  poolId: number\r\n  poolName: string\r\n  isCompanyAdmin?: boolean\r\n  isPortalAdmin?: boolean\r\n  onRunFinish: () => void\r\n}\r\n\r\ninterface RunRandomValidity {\r\n  isActualToSelectDrugValid: boolean\r\n  isActualToSelectAlcoholValid: boolean\r\n  isAlternateDrugValid: boolean\r\n  isAlternateAlcoholValid: boolean\r\n}\r\n\r\ninterface RunRandomData {\r\n  actualToSelectDrug?: number\r\n  actualToSelectAlcohol?: number\r\n  alternateDrug?: number\r\n  alternateAlcohol?: number\r\n}\r\n\r\ninterface RunRandomState extends RunRandomData, RunRandomValidity {\r\n  step: \"run\" | \"success\"\r\n  saving: boolean\r\n  statisticsLoading: boolean\r\n  messagesLoading: boolean\r\n  poolSelectionLoading: boolean\r\n  statistics?: PoolStatisticsDetails\r\n  messages?: RunRandomSelectionMessage\r\n  runResults?: RandomSelectionRunData[]\r\n  poolSelection?: PoolSelectionRow\r\n  showRunConfirmation: boolean\r\n  showSelectionList: boolean\r\n}\r\n\r\nexport default class RunRandom extends React.PureComponent<RunRandomProps, RunRandomState> {\r\n  state: RunRandomState = {\r\n    step: \"run\",\r\n    saving: false,\r\n    statisticsLoading: false,\r\n    messagesLoading: false,\r\n    poolSelectionLoading: false,\r\n    isActualToSelectDrugValid: true,\r\n    isActualToSelectAlcoholValid: true,\r\n    isAlternateDrugValid: true,\r\n    isAlternateAlcoholValid: true,\r\n    showRunConfirmation: false,\r\n    showSelectionList: false\r\n  }\r\n\r\n  subscriptions = new Subscription()\r\n\r\n  componentDidMount() {\r\n    this.setState({ statisticsLoading: true, messagesLoading: true })\r\n    this.subscriptions.add(\r\n      PoolStatisticsDetailsGetObservable(this.props.poolId).subscribe(\r\n        data => this.setState({ statistics: data, actualToSelectDrug: data.DrugRequired, actualToSelectAlcohol: data.AlcoholRequired, statisticsLoading: false }),\r\n        () => this.setState({ statisticsLoading: false })\r\n      ))\r\n    this.subscriptions.add(\r\n      RunRandomSelectionMessagesGetObservable(this.props.poolId).subscribe(\r\n        data => this.setState({ messages: data, messagesLoading: false }),\r\n        () => this.setState({ messagesLoading: false })\r\n      ))\r\n  }\r\n\r\n  componentWillUnmount() {\r\n    this.subscriptions.unsubscribe()\r\n  }\r\n\r\n  validateSizeValue = (value: number | undefined) => !value || (value >= 0 && (!this.state.statistics || value <= this.state.statistics.CurrentPoolSize))\r\n\r\n  handleSizeChange = (what: keyof RunRandomData, validityField: keyof RunRandomValidity, value: string) => {\r\n    value = value.replace(/\\D/g, \"\")\r\n    if (value.length === 0) {\r\n      this.setState({ ...{}, [what]: undefined, [validityField]: true })\r\n    } else {\r\n      const numberValue = Number(parseInt(value))\r\n      if (numberValue !== undefined) {\r\n        this.setState({ ...{}, [what]: numberValue, [validityField]: this.validateSizeValue(numberValue) })\r\n      }\r\n    }\r\n  }\r\n\r\n  handleFormSubmit = (e: React.FormEvent) => {\r\n    e.preventDefault()\r\n\r\n    const { actualToSelectDrug, actualToSelectAlcohol, alternateDrug, alternateAlcohol, statistics } = this.state\r\n    if (!statistics) {\r\n      return\r\n    }\r\n    const validity: RunRandomValidity = {\r\n      isActualToSelectDrugValid: this.validateSizeValue(actualToSelectDrug),\r\n      isActualToSelectAlcoholValid: this.validateSizeValue(actualToSelectAlcohol),\r\n      isAlternateDrugValid: !statistics?.GenerateAlternates || this.validateSizeValue(alternateDrug),\r\n      isAlternateAlcoholValid: !statistics?.GenerateAlternates || this.validateSizeValue(alternateAlcohol)\r\n    }\r\n    const isValid = Object.values(validity).every((valid: boolean) => valid)\r\n\r\n    if (isValid) {\r\n      this.setState({ showRunConfirmation: true })\r\n    } else {\r\n      this.setState(validity)\r\n    }\r\n  }\r\n\r\n  runSelection = () => {\r\n    this.setState({ showRunConfirmation: false, saving: true })\r\n    // TODO: Pass correct contactId and updateMethodID values once authorization and account data will be available\r\n    this.subscriptions.add(\r\n      RandomSelectionRunObservable({\r\n        ContactId: 0,\r\n        UpdateMethodID: 0,\r\n        PoolId: this.props.poolId,\r\n        RequiredDrug: this.state.actualToSelectDrug || 0,\r\n        RequiredAlcohol: this.state.actualToSelectAlcohol || 0,\r\n        AlternateDrug: this.state.alternateDrug || 0,\r\n        AlternateAlcohol: this.state.alternateAlcohol || 0\r\n      }).subscribe(\r\n        data => this.setState({ runResults: data, saving: false, step: \"success\" }),\r\n        (error) => {\r\n          this.setState({ saving: false })\r\n          toast.error(error && error.errorData && error.errorData.message)\r\n        }\r\n      ))\r\n  }\r\n\r\n  handlePrintClick = () => {\r\n    this.setState({ poolSelectionLoading: true })\r\n    this.subscriptions.add(\r\n      PoolSelectionListGetObservable(this.props.poolId, 1, 1).subscribe(\r\n        (data) => this.setState({ poolSelection: data.Records[0], showSelectionList: true, poolSelectionLoading: false }),\r\n        (error) => {\r\n          this.setState({ poolSelectionLoading: false })\r\n          toast.error(error)\r\n        }\r\n      ))\r\n  }\r\n\r\n  sizeRowItem = (\r\n    name: string,\r\n    valueField: keyof RunRandomData,\r\n    valueValidityField: keyof RunRandomValidity,\r\n    disabled: boolean,\r\n    lg: number,\r\n    xl: number,\r\n    invalidMessage: string\r\n  ) => <Col lg={lg} xl={xl} md={12} className=\"form-row form-group form-inline\">\r\n      <Form.Label htmlFor={`${valueField}id`} className=\"col-form-label col-6 justify-content-start justify-content-lg-center\">{name}</Form.Label>\r\n      <Form.Control type=\"text\"\r\n        id={`${valueField}id`}\r\n        className=\"col-6\"\r\n        value={this.state[valueField]?.toString() || \"\"}\r\n        onChange={(e: React.ChangeEvent<HTMLInputElement>) => this.handleSizeChange(valueField, valueValidityField, e.target.value)}\r\n        isInvalid={!this.state[valueValidityField] || false}\r\n        disabled={disabled} />\r\n      <Form.Control.Feedback type=\"invalid\">{invalidMessage}</Form.Control.Feedback>\r\n    </Col>\r\n\r\n  sizeRow = (\r\n    name: string,\r\n    statRequiredValue: number | undefined,\r\n    valueField: keyof RunRandomData,\r\n    valueValidityField: keyof RunRandomValidity,\r\n    alternateValueField: keyof RunRandomData,\r\n    alternateValueValidityField: keyof RunRandomValidity,\r\n    showAlternates: boolean,\r\n    disabled: boolean,\r\n    invalidMessage: string,\r\n    alternateInvalidMessage: string\r\n  ) => <Form.Row>\r\n      <Col lg={3} md={12} className=\"form-row form-group form-inline\">\r\n        <div className=\"col-form-label col-6 justify-content-start\">{name}</div>\r\n        <div className=\"col-form-label col-6 justify-content-start\">{statRequiredValue}</div>\r\n      </Col>\r\n      {this.sizeRowItem(\"ACTUAL TO SELECT\", valueField, valueValidityField, disabled, 5, 4, invalidMessage)}\r\n      {showAlternates && this.sizeRowItem(\"ALTERNATES\", alternateValueField, alternateValueValidityField, disabled, 4, 4, alternateInvalidMessage)}\r\n    </Form.Row>\r\n\r\n  render() {\r\n    const { statistics, messages } = this.state\r\n    const isPortalAdmin: boolean = this.props.isPortalAdmin || false\r\n    const isCompanyAdmin: boolean = this.props.isCompanyAdmin || false\r\n    const runOnlyByPortalAdmin: boolean = messages?.RunOnlyByPortalAdmin || false\r\n\r\n    const allowRun = (isPortalAdmin && runOnlyByPortalAdmin) || (isCompanyAdmin && !runOnlyByPortalAdmin)\r\n    const disableForm = !messages?.IsRunRandomSelection || !allowRun\r\n    return <>\r\n      <Form className=\"p-4 pt-3\" onSubmit={this.handleFormSubmit} hidden={this.state.step !== \"run\"}>\r\n        {!allowRun && <Form.Row><Col className=\"error-message\">User not Authorized to run randoms for this pool.</Col></Form.Row>}\r\n        <Form.Row><Col><h5>TESTS REQUIRED FOR SELECTION</h5></Col></Form.Row>\r\n        {!this.state.statisticsLoading && <>\r\n          {this.sizeRow(\"DRUG\",\r\n            statistics?.DrugRequired,\r\n            \"actualToSelectDrug\",\r\n            \"isActualToSelectDrugValid\",\r\n            \"alternateDrug\",\r\n            \"isAlternateDrugValid\",\r\n            statistics?.GenerateAlternates || false,\r\n            disableForm,\r\n            \"Drug Actual To Select is greater than pool size\",\r\n            \"Number of drug Alternates exceeds pool membership count\")}\r\n          {this.sizeRow(\"ALCOHOL\",\r\n            statistics?.AlcoholRequired,\r\n            \"actualToSelectAlcohol\",\r\n            \"isActualToSelectAlcoholValid\",\r\n            \"alternateAlcohol\",\r\n            \"isAlternateAlcoholValid\",\r\n            statistics?.GenerateAlternates || false,\r\n            disableForm,\r\n            \"Alcohol Actual To Select is greater than pool size\",\r\n            \"Number of alcohol Alternates exceeds pool membership count\")}\r\n        </>}\r\n        {(this.state.statisticsLoading || this.state.messagesLoading) && <Row><Col className=\"text-center\"><Spinner animation=\"border\" variant=\"secondary\" /></Col></Row>}\r\n        {this.state.messages && this.state.messages.IsRunRandomSelection && this.state.messages.SkipPeriodMessage && <Form.Row><Col className=\"alert-message\">{this.state.messages.SkipPeriodMessage}</Col></Form.Row>}\r\n        {this.state.messages && this.state.messages.IsRunRandomSelection && this.state.messages.RunningPeriodMessage && <Form.Row><Col className=\"alert-message\">{this.state.messages.RunningPeriodMessage}</Col></Form.Row>}\r\n        {this.state.messages && !this.state.messages.IsRunRandomSelection && this.state.messages.RandomSelectionMessage && <Form.Row><Col className=\"alert-message\">{this.state.messages.RandomSelectionMessage}</Col></Form.Row>}\r\n        <Form.Row className=\"buttons-block left\">\r\n          <Button variant=\"primary\" type=\"submit\" disabled={disableForm}>\r\n            {this.state.saving ? <Spinner animation=\"border\" size=\"sm\" /> : \"RUN SELECTION\"}\r\n          </Button>\r\n        </Form.Row>\r\n      </Form>\r\n      <Container fluid className=\"p-4 pt-3\" hidden={this.state.step !== \"success\"}>\r\n        <Row><Col>Random Selection complete!</Col></Row>\r\n        <Row>\r\n          <Col>\r\n            <span>You may</span>\r\n            <span className=\"text-link px-1\" onClick={this.handlePrintClick}>Print the Random Selection Master List</span>\r\n            {this.state.poolSelectionLoading && <><Spinner animation=\"border\" size=\"sm\" className=\"px-1\" /></>}\r\n            <span>for the selected tests or press finish to complete the selection process and report the selections.</span>\r\n          </Col>\r\n        </Row>\r\n        <Row><Col>The following reporting of this selection process will be performed:</Col></Row>\r\n        <Row>\r\n          <Col>\r\n            <Table responsive className=\"table-sm dark\">\r\n              <thead>\r\n                <tr className=\"text-normal\">\r\n                  <th>COMPANIES</th>\r\n                  <th>EMAIL</th>\r\n                  <th>FAX</th>\r\n                  <th>FORMFOX</th>\r\n                  <th>CISNET</th>\r\n                  <th>LAST UPDATE</th>\r\n                </tr>\r\n              </thead>\r\n              <tbody>\r\n                {this.state.runResults && this.state.runResults.map((row: RandomSelectionRunData, i: number) =>\r\n                  <tr key={i}>\r\n                    <td>{row.Companies}</td>\r\n                    <td>{row.Email ? \"Yes\" : \"No\"}</td>\r\n                    <td>{row.Fax ? \"Yes\" : \"No\"}</td>\r\n                    <td>{row.FormFox}</td>\r\n                    <td>{row.CISNET}</td>\r\n                    <td>{FormatDate(row.LastUpdate)}</td>\r\n                  </tr>)}\r\n                {!this.state.runResults && <tr><td colSpan={6}>NO DATA FOUND</td></tr>}\r\n              </tbody>\r\n            </Table>\r\n          </Col>\r\n        </Row>\r\n        <Row>\r\n          <Col className=\"buttons-block\">\r\n            <Button variant=\"primary\" onClick={() => this.props.onRunFinish()}>FINISH</Button>\r\n          </Col>\r\n        </Row>\r\n      </Container>\r\n      <ConfirmationModal show={this.state.showRunConfirmation}\r\n        title=\"CONFIRM RUN RANDOM\"\r\n        text=\"Are you sure you want to run random selection process?\"\r\n        showImage={false}\r\n        onConfirm={this.runSelection}\r\n        onHide={() => this.setState({ showRunConfirmation: false })} />\r\n      {this.state.showSelectionList && this.state.poolSelection &&\r\n        <RandomSelectionList show={this.state.showSelectionList}\r\n          onHide={() => this.setState({ showSelectionList: false })}\r\n          poolId={this.props.poolId}\r\n          poolName={this.props.poolName}\r\n          poolSelection={this.state.poolSelection} \r\n          unmaskDonorId={0}/>}\r\n    </>\r\n  }\r\n}\r\n","import { Observable } from \"rxjs\"\r\nimport { ObservableFromFetch } from \"../ObservableFromFetch\"\r\ninterface PoolCloseProgramYearIntervalOptions {\r\n  PoolID: number\r\n  SelectionInterval: string\r\n  DateFrom: string\r\n  DateTo: string\r\n}\r\nexport default function CloseProgramIntervalGetObservable(poolId: number): Observable<string> {\r\n  const requestBody: string = new URLSearchParams({\r\n    poolId: poolId.toString()\r\n  }).toString()\r\n\r\n  return ObservableFromFetch<string>(\"FFOrderPoolDefinition/CloseProgramYear?\" + requestBody)\r\n}\r\nexport  function CloseProgramYearIntervalObservable(data: PoolCloseProgramYearIntervalOptions): Observable<string> {\r\n  const params: string = JSON.stringify(data)\r\n  return ObservableFromFetch<string>(\"FFOrderPoolDefinition/CloseProgramYearInterval\", params)\r\n}\r\n","import * as React from \"react\"\r\nimport { Container, Row, Col, Form } from \"react-bootstrap\"\r\nimport { toast } from \"react-toastify\"\r\nimport TestingPeriodBreakdownGrid from \"./TestingPeriodBreakdownGrid\"\r\nimport PoolGeneralInfo, { PoolVariant } from \"./PoolGeneralInfo\"\r\nimport ConfirmationModal from \"../../ConfirmationModal\"\r\nimport { CloseProgramYearIntervalObservable } from \"../../../api/Randoms/CloseProgramIntervalGet\"\r\n\r\nimport { Subscription } from \"rxjs\"\r\nimport PoolData from \"../../../api/Randoms/RandomsModel/PoolData\"\r\nimport PoolGeneralInfoGetObservable from \"../../../api/Randoms/PoolGeneralInfoGet\"\r\nimport DatePicker from \"react-datepicker\"\r\nimport \"react-datepicker/dist/react-datepicker.css\";\r\nimport { format, parseISO } from \"date-fns\"\r\n\r\ninterface CloseProgramIntervalProps {\r\n  poolId: number\r\n  poolName: string\r\n  poolData?: PoolData\r\n  onPoolUpdate: () => void\r\n}\r\n\r\ninterface CloseProgramIntervalState {\r\n  showConfirmationModal: boolean\r\n  showEditPool: boolean,\r\n  poolLoading: boolean\r\n  poolSaving: boolean\r\n  currentIntervalStartDate: string,\r\n  currentIntervalEndDate: string,\r\n  programIntervalStartDate: string,\r\n  programIntervalEndDate: string,\r\n  selectionInterval: string\r\n\r\n}\r\ninterface ValidationStatus {\r\n  isValid: boolean,\r\n  errorMessage: string\r\n}\r\nexport default class CloseProgramInterval extends React.PureComponent<CloseProgramIntervalProps, CloseProgramIntervalState> {\r\n  state: CloseProgramIntervalState = {\r\n    showConfirmationModal: true,\r\n    showEditPool: false,\r\n    poolLoading: false,\r\n    poolSaving: false,\r\n    currentIntervalStartDate: \"\",\r\n    currentIntervalEndDate: \"\",\r\n    programIntervalStartDate: \"\",\r\n    programIntervalEndDate: \"\",\r\n    selectionInterval: \"\"\r\n\r\n  }\r\n  loadPoolDataSubscription?: Subscription\r\n\r\n  closeSubscription?: Subscription\r\n  componentDidMount() {\r\n    this.loadPoolData()\r\n  }\r\n\r\n  componentWillUnmount() {\r\n    this.closeSubscription && this.closeSubscription.unsubscribe()\r\n    this.loadPoolDataSubscription && this.loadPoolDataSubscription.unsubscribe()\r\n  }\r\n  loadPoolData = () => {\r\n    this.setState({ poolLoading: true })\r\n    this.loadPoolDataSubscription && this.loadPoolDataSubscription.unsubscribe()\r\n    this.loadPoolDataSubscription = PoolGeneralInfoGetObservable(this.props.poolId).subscribe(\r\n      (data: PoolData) => {\r\n        const currentStartDate = parseISO(data.ProgramIntervalStartDate)\r\n        const currentEndDate = parseISO(data.ProgramIntervalEndDate)\r\n        \r\n        const nextStartDate = new Date(currentStartDate)\r\n        nextStartDate.setFullYear(nextStartDate?.getFullYear() + 1)\r\n\r\n        const nextEndDate = new Date (currentEndDate)\r\n        nextEndDate.setFullYear(nextEndDate?.getFullYear() + 1)\r\n\r\n        this.setState({\r\n          currentIntervalStartDate: !!currentStartDate.getDate() ? currentStartDate.toISOString() : \"\",\r\n          currentIntervalEndDate: !!currentEndDate.getDate() ? currentEndDate.toISOString() : \"\",\r\n          programIntervalStartDate: !!nextStartDate.getDate() ? nextStartDate.toISOString() : \"\",\r\n          programIntervalEndDate: !!nextEndDate.getDate() ? nextEndDate.toISOString() : \"\",\r\n          selectionInterval: data.SelectionInterval,\r\n          poolLoading: false\r\n        })\r\n      },\r\n      () => this.setState({ poolLoading: false })\r\n    )\r\n  }\r\n  handleProgramIntervalStartDateChange = (date: Date | null) => {\r\n    this.setState({ programIntervalStartDate: date ? date.toISOString() : \"\" })\r\n  }\r\n  handleProgramIntervalEndDateChange = (date: Date | null) => {\r\n    this.setState({ programIntervalEndDate: date ? date.toISOString() : \"\" })\r\n  }\r\n\r\n  showConfirmation = () => this.setState({ showConfirmationModal: true })\r\n\r\n  hideConfirmation = () => this.setState({ showConfirmationModal: false })\r\n\r\n  closeProgram = () => {\r\n    if (!this.isIntervalValid()) {\r\n      return\r\n    }\r\n    this.setState({ poolSaving: true })\r\n    this.closeSubscription && this.closeSubscription.unsubscribe\r\n    this.closeSubscription = CloseProgramYearIntervalObservable({\r\n      PoolID: this.props.poolId,\r\n      SelectionInterval: this.state.selectionInterval,\r\n      DateFrom: format(parseISO(this.state.programIntervalStartDate || \"\"), \"MM/dd/yyyy\"),\r\n      DateTo: format(parseISO(this.state.programIntervalEndDate || \"\"), \"MM/dd/yyyy\")\r\n    }).subscribe(\r\n      result => {\r\n        toast.success(result)\r\n        this.setState({ showConfirmationModal: false, showEditPool: true, poolSaving: false })\r\n      },\r\n      error => {\r\n        toast.error(error.errorData?.message || error.message)\r\n        this.setState({ poolSaving: false })\r\n      }\r\n    )\r\n  }\r\n  validateInterval = (): ValidationStatus => {\r\n    const result: ValidationStatus = {\r\n      isValid: true,\r\n      errorMessage: \"\"\r\n    }\r\n    const programIntervalStartDate = this.state.programIntervalStartDate || \"\"\r\n    const programIntervalEndDate = this.state.programIntervalEndDate || \"\"\r\n    const startDate = programIntervalStartDate ? parseISO(programIntervalStartDate) : undefined\r\n    const endDate = programIntervalEndDate ? parseISO(programIntervalEndDate) : undefined\r\n    if (!startDate) {\r\n      result.isValid = false\r\n      result.errorMessage = \"Date From can't be blank\"\r\n      return result\r\n    }\r\n    if (!endDate) {\r\n      result.isValid = false\r\n      result.errorMessage = \"Date To can't be blank\"\r\n      return result\r\n    }\r\n    if (startDate >= endDate) {\r\n      result.isValid = false\r\n      result.errorMessage = \"Date To should be later than Date From\"\r\n      return result\r\n    }\r\n    const startYear = startDate.getFullYear()\r\n    const endYear = endDate.getFullYear()\r\n    if (startYear != endYear) {\r\n      result.isValid = false\r\n      result.errorMessage = \"The From and To dates cannot be more than one calendar year in duration\"\r\n      return result\r\n    }\r\n    const d = new Date();\r\n    const currYear = d.getFullYear()\r\n    if (currYear > startYear) {\r\n      result.isValid = false\r\n      result.errorMessage = \"The program year cannot be lesser than current year\"\r\n      return result\r\n    }\r\n    const nextYear = currYear + 1\r\n    if (startYear > nextYear) {\r\n      result.isValid = false\r\n      result.errorMessage = \"The program year cannot be greater than one consecutive year\"\r\n      return result\r\n    }\r\n    return result\r\n\r\n  }\r\n  isIntervalValid = () => {\r\n    const validationStatus = this.validateInterval()\r\n    return validationStatus.isValid\r\n  }\r\n\r\n  render() {\r\n    const { currentIntervalStartDate, currentIntervalEndDate,\r\n            programIntervalStartDate, programIntervalEndDate,\r\n            selectionInterval } = this.state\r\n    \r\n    const currentStartDate = currentIntervalStartDate ? parseISO(currentIntervalStartDate) : undefined\r\n    const currentEndDate = currentIntervalEndDate ? parseISO(currentIntervalEndDate) : undefined\r\n    const nextStartDate = programIntervalStartDate ? parseISO(programIntervalStartDate) : undefined\r\n    const nextEndDate = programIntervalEndDate ? parseISO(programIntervalEndDate) : undefined\r\n\r\n    const validationStatus = this.validateInterval()\r\n\r\n    return <>\r\n      <Container fluid className=\"grid-container\" hidden={this.state.showEditPool}>\r\n        <Row>\r\n          <Col>\r\n            <TestingPeriodBreakdownGrid poolId={this.props.poolId} poolName={this.props.poolName} unmaskDonorId={0} />\r\n          </Col>\r\n        </Row>\r\n      </Container>\r\n      {this.state.showEditPool && <PoolGeneralInfo poolId={this.props.poolId} variant={PoolVariant.CloseProgramYear} poolData={this.props.poolData} onPoolUpdate={this.props.onPoolUpdate} edit />}\r\n      <ConfirmationModal show={this.state.showConfirmationModal}\r\n        title=\"CONFIRMATION\"\r\n        confirmButtonText=\"VERIFY\"\r\n        onConfirm={this.closeProgram}\r\n        onHide={this.hideConfirmation}\r\n        disableConfirmButton={(this.state.poolLoading || this.state.poolSaving || !validationStatus.isValid)}\r\n        spinConfirmButton={this.state.poolSaving}\r\n        disableConfirmOnSpin={true}\r\n        size=\"lg\">\r\n        <>\r\n          <p>\r\n            You are about to close the current program interval <b>{currentStartDate ? format(currentStartDate, \"MM/dd/yyyy\") : \"\"} - {currentEndDate ? format(currentEndDate, \"MM/dd/yyyy\") : \"\"}</b> for pool <b className=\"text-capitalize\">{this.props.poolName}</b>.\r\n          </p>\r\n          <p>\r\n            Once the current program interval is closed no further random selections can be run for that interval.\r\n          </p>\r\n          <p>\r\n            A new interval will be created and incremented by one year. All other pool settings and criteria will remain the same as the current interval. Program compliance calculations will  be reset to reflect the new program interval.\r\n          </p>\r\n          <p>\r\n            <Form.Row >\r\n              <Form.Label column xs={2} md={1} className=\"text-left\"></Form.Label>\r\n              <Form.Label column xs={6} md={4} className=\"text-left\">Program Interval (New):</Form.Label>\r\n              <Col xs={6} lg={2} className=\"mb-1 mb-lg-0\">\r\n                <DatePicker className=\"form-control\"\r\n                  peekNextMonth\r\n                  showMonthDropdown\r\n                  showYearDropdown\r\n                  dropdownMode=\"select\"\r\n                  required\r\n                  popperPlacement=\"top-end\"\r\n                  selected={nextStartDate}\r\n                  enableTabLoop={false}\r\n                  onChange={date => this.handleProgramIntervalStartDateChange(date as Date)} />\r\n              </Col>\r\n              <Form.Label column xs={6} md={4} lg={2} xl={1} className=\"text-right pr-4\">To</Form.Label>\r\n              <Col xs={6} lg={2}>\r\n                <DatePicker className=\"form-control\"\r\n                  peekNextMonth\r\n                  showMonthDropdown\r\n                  showYearDropdown\r\n                  dropdownMode=\"select\"\r\n                  required\r\n                  popperPlacement=\"top-end\"\r\n                  selected={nextEndDate}\r\n                  enableTabLoop={false}\r\n                  onChange={date => this.handleProgramIntervalEndDateChange(date as Date)} />\r\n              </Col>\r\n            </Form.Row>\r\n            {!validationStatus.isValid && \r\n            <Form.Row >\r\n              <Form.Label column xs={2} md={1} className=\"text-left\"></Form.Label>\r\n              <Form.Label column xs={6} md={4} className=\"text-left\"></Form.Label>\r\n              <Col xs={18} lg={6}><Form.Control.Feedback type=\"invalid\" className=\"d-block\">{validationStatus.errorMessage}</Form.Control.Feedback></Col>\r\n            </Form.Row>}\r\n            <Form.Row >\r\n              <Form.Label column xs={2} md={1} className=\"text-left\"></Form.Label>\r\n              <Form.Label column xs={6} md={4} className=\"text-left\">Selection Interval:</Form.Label>\r\n              <Form.Label column xs={6} md={4} lg={2} xl={1} className=\"text-left\">{selectionInterval}</Form.Label>\r\n            </Form.Row>\r\n          </p>\r\n          <p>\r\n            Any pool configuration changes to the new program interval pool must be made on the pool detail page before the first selection is run. Once the first selection has been performed, most pool configurations will be locked.\r\n          </p>\r\n          <p>To continue press Verify.</p>\r\n        </>\r\n      </ConfirmationModal>\r\n    </>\r\n  }\r\n}\r\n","import { AccountTypeID, RpAccountType } from \"../../config/Constants\"\r\nimport { Filter, Sort } from \"../GridRequest\"\r\nimport GridResponse from \"../GridResponse\"\r\nimport { ObservableFromFetch } from \"../ObservableFromFetch\"\r\nimport PoolMemberRecord from \"./PoolMembersModel/PoolMemberRecord\"\r\n\r\nconst Columns = [\"ActiveSince\", \"Company\", \"IDNumber\", \"Occupation\", \"Location\", \"Name\", \"RegulatoryMode\", \"Category\", \"Supervisor1\", \"Supervisor2\",\r\n\"HireDate\", \"TerminationDate\", \"PreEmploymentTestOnFile\", \"Gender\", \"DateOfBirth\", \"AddressLine1\", \"City\", \"State\", \"Zip\", \"WorkPhone\", \"CellPhone\",\r\n\"Email\", \"User1\", \"User2\", \"User3\", \"User4\", \"User5\", \"User6\", \"User7\", \"User8\", \"User9\", \"User10\", \"Manager\", \"ReasonForInactivation\"] as const\r\ntype Column = typeof Columns[number]\r\n\r\nexport type ColumnFilters = Record<Column, string[]>\r\nexport type PoolMembersGridResponse = GridResponse<PoolMemberRecord> & ColumnFilters\r\n\r\nexport interface PoolMembersOptions {\r\n  poolId: number\r\n  inactive: boolean | null\r\n  search: {\r\n    field: string\r\n    text: string\r\n  }\r\n  sort: Sort\r\n  filters: Filter[]\r\n  columnFilters: Filter[]\r\n  pageNumber: number\r\n  pageSize: number\r\n}\r\n\r\nfunction filters(filters: Filter[] = []) {\r\n  return {\r\n    Location: filters.find(filter => filter.column === \"Location\")?.values || [],\r\n    RegulatoryMode: filters.find(filter => filter.column === \"RegulatoryMode\")?.values || [],\r\n    ID: filters.find(filter => filter.column === \"IDNumber\")?.values || [],\r\n    Company: filters.find(filter => filter.column === \"Company\")?.values || [],\r\n    Name: filters.find(filter => filter.column === \"Name\")?.values || [],\r\n    ActiveSince: filters.find(filter => filter.column === \"ActiveSince\")?.values || [],\r\n    Occupation: filters.find(filter => filter.column === \"Occupation\")?.values || [],\r\n    Category: filters.find(filter => filter.column === \"Category\")?.values || [],\r\n    Supervisor1: filters.find(filter => filter.column === \"Supervisor1\")?.values || [],\r\n    Supervisor2: filters.find(filter => filter.column === \"Supervisor2\")?.values || [],\r\n    HireDate: filters.find(filter => filter.column === \"HireDate\")?.values || [],\r\n    TerminationDate: filters.find(filter => filter.column === \"TerminationDate\")?.values || [],\r\n    PreEmploymentTestOnFile: filters.find(filter => filter.column === \"PreEmploymentTestOnFile\")?.values || [],\r\n    Gender: filters.find(filter => filter.column === \"Gender\")?.values || [],\r\n    DateOfBirth: filters.find(filter => filter.column === \"DateOfBirth\")?.values || [],\r\n    AddressLine1: filters.find(filter => filter.column === \"AddressLine1\")?.values || [],\r\n    City: filters.find(filter => filter.column === \"City\")?.values || [],\r\n    State: filters.find(filter => filter.column === \"State\")?.values || [],\r\n    Zip: filters.find(filter => filter.column === \"Zip\")?.values || [],\r\n    WorkPhone: filters.find(filter => filter.column === \"WorkPhone\")?.values || [],\r\n    CellPhone: filters.find(filter => filter.column === \"CellPhone\")?.values || [],\r\n    Email: filters.find(filter => filter.column === \"Email\")?.values || [],\r\n    User1: filters.find(filter => filter.column === \"User1\")?.values || [],\r\n    User2: filters.find(filter => filter.column === \"User2\")?.values || [],\r\n    User3: filters.find(filter => filter.column === \"User3\")?.values || [],\r\n    User4: filters.find(filter => filter.column === \"User4\")?.values || [],\r\n    User5: filters.find(filter => filter.column === \"User5\")?.values || [],\r\n    User6: filters.find(filter => filter.column === \"User6\")?.values || [],\r\n    User7: filters.find(filter => filter.column === \"User7\")?.values || [],\r\n    User8: filters.find(filter => filter.column === \"User8\")?.values || [],\r\n    User9: filters.find(filter => filter.column === \"User9\")?.values || [],\r\n    User10: filters.find(filter => filter.column === \"User10\")?.values || [],\r\n    Manager: filters.find(filter => filter.column === \"Manager\")?.values || [],\r\n    ReasonForInactivation: filters.find(filter => filter.column === \"ReasonForInactivation\")?.values || [],\r\n  }\r\n}\r\n\r\nfunction gridParams(options: PoolMembersOptions): string {\r\n  return JSON.stringify({\r\n    PoolID: options.poolId,\r\n    RandomSelection: false,\r\n    Inactive: options.inactive,\r\n    RpAccountType: RpAccountType,\r\n    PersonID: 0,\r\n    SortGrid: { SortColumn: options.sort?.column || \"\", SortOrder: options.sort?.order.toUpperCase() === \"DESC\" ? \"DSC\" : options.sort?.order.toUpperCase() },\r\n    Filters: filters(options.columnFilters),\r\n    GridFilters: filters(options.filters),\r\n    PageNumber: options.pageNumber,\r\n    PageSize: options.pageSize || 20,\r\n  })\r\n}\r\n\r\nfunction exportParams(options: PoolMembersOptions): string {\r\n  return JSON.stringify({\r\n    Filters: filters(options.columnFilters),\r\n    Inactive: options.inactive,\r\n    PoolID: options.poolId,\r\n    RandomSelection: false,\r\n    RpAccountType: RpAccountType,\r\n  })\r\n}\r\n\r\nfunction printParams(values: number[], options: PoolMembersOptions): string {\r\n  return JSON.stringify({\r\n    AccountTypeID: AccountTypeID,\r\n    Inactive: options.inactive,\r\n    PersonID: values,\r\n    PoolID: options.poolId,\r\n    RandomSelection: false,\r\n    RpAccountType: RpAccountType,\r\n  })\r\n}\r\n\r\nexport const PoolMembersGridObservable = (params: PoolMembersOptions) => ObservableFromFetch<PoolMembersGridResponse>(\"RandomTest/GetPoolMembersList\", gridParams(params))\r\nexport const PoolMembersExportCsv = (params: PoolMembersOptions) => ObservableFromFetch<string>(\"RandomTest/ExportPoolMember\", exportParams(params))\r\nexport const PoolMembersPrint = (values: number[], params: PoolMembersOptions) => ObservableFromFetch<string>(\"WorkforceRandomTest/PrintPoolMember\", printParams(values, params))\r\n\r\nexport function ChangePersonStatus(poolID: number, personIDs: number[], toogleMode: number, accountID: number) {\r\n  const requestBody = JSON.stringify({\r\n    PoolID: poolID,\r\n    PersonIDs: personIDs,\r\n    ToogleMode: toogleMode,\r\n    AccountID: accountID\r\n  })\r\n  return ObservableFromFetch<string>(\"RandomTest/InactivePerson\", requestBody)\r\n}","import * as React from \"react\"\r\nimport RandomPersonnelIdentifier from \"../../api/Randoms/RandomPersonnelModel/RandomPersonnelIdentifier\"\r\nimport Checkbox from \"../Checkbox\"\r\n\r\nexport interface RandomPersonnelCheckboxProps {\r\n  id: string\r\n  person: RandomPersonnelIdentifier\r\n  checked: boolean\r\n  onChange: (person: RandomPersonnelIdentifier, checked: boolean) => void\r\n}\r\n\r\nexport default class RandomPersonnelCheckbox extends React.PureComponent<RandomPersonnelCheckboxProps> {\r\n  onChange = (e: React.ChangeEvent<HTMLInputElement>) => this.props.onChange(this.props.person, e.target.checked)\r\n  render() { return <Checkbox checked={this.props.checked} onChange={this.onChange} id={this.props.id}/>}\r\n}\r\n","import React from \"react\"\r\nimport { Form } from \"react-bootstrap\"\r\nimport { ConnectDragSource, ConnectDropTarget, DragSource, DragSourceConnector, DragSourceMonitor, DropTarget, DropTargetConnector, DropTargetMonitor } from \"react-dnd\"\r\nimport Checkbox from \"../Checkbox\"\r\nimport CustomizableColumn from \"./CustomizableColumn\"\r\n\r\nexport const DraggableTypeColumn = \"Column\"\r\n\r\ninterface DraggableColumnProps {\r\n  column: CustomizableColumn\r\n  moveColumn: (id: string, to: number) => void\r\n  findColumn: (id: string) => { index: number }\r\n  onVisibilityChange: (name: string, visible: boolean) => void\r\n}\r\n\r\ninterface DragDropColumnProps extends DraggableColumnProps {\r\n  connectDragSource: ConnectDragSource\r\n  isDragging: boolean\r\n  connectDropTarget: ConnectDropTarget\r\n}\r\n\r\nconst DraggableColumnSource = {\r\n  beginDrag(props: DraggableColumnProps) {\r\n    return {\r\n      id: props.column.name,\r\n      originalIndex: props.findColumn(props.column.name).index\r\n    }\r\n  },\r\n  endDrag(props: DraggableColumnProps, monitor: DragSourceMonitor) {\r\n    const { id: droppedId, originalIndex } = monitor.getItem()\r\n    if (!monitor.didDrop()) {\r\n      props.moveColumn(droppedId, originalIndex)\r\n    }\r\n  }\r\n}\r\n\r\nconst DraggableColumnCollect = (connect: DragSourceConnector, monitor: DragSourceMonitor) => ({\r\n  connectDragSource: connect.dragSource(),\r\n  isDragging: monitor.isDragging()\r\n})\r\n\r\nconst DroppableColumnTarget = {\r\n  canDrop: () => false,\r\n  hover(props: DraggableColumnProps, monitor: DropTargetMonitor) {\r\n    const { id: draggedId } = monitor.getItem()\r\n    if (draggedId !== props.column.name) {\r\n      const { index: overIndex } = props.findColumn(props.column.name)\r\n      props.moveColumn(draggedId, overIndex)\r\n    }\r\n  }\r\n}\r\n\r\nconst DroppableColumnCollect = (connect: DropTargetConnector) => ({ connectDropTarget: connect.dropTarget() })\r\n\r\nclass Column extends React.Component<DragDropColumnProps> {\r\n  handleVisibilityChange = (e: React.ChangeEvent<HTMLInputElement>) => {\r\n    this.props.onVisibilityChange(e.target.name, e.target.checked)\r\n  }\r\n\r\n  render() {\r\n    const { column, isDragging, connectDragSource, connectDropTarget } = this.props\r\n    return connectDropTarget(connectDragSource(\r\n      <div className={`customizedColumn${isDragging ? \" hovered\" : \"\"}`}>\r\n        <Checkbox key={column.name} id={column.name} name={column.name}\r\n          defaultChecked={column.visible || column.required}\r\n          label={column.label || column.name}\r\n          disabled={column.required}\r\n          className={column.required ? \"required\" : \"\"}\r\n          onChange={this.handleVisibilityChange} />\r\n      </div>\r\n    ))\r\n  }\r\n}\r\n\r\nexport default DropTarget(DraggableTypeColumn, DroppableColumnTarget, DroppableColumnCollect)(DragSource(DraggableTypeColumn, DraggableColumnSource, DraggableColumnCollect)(Column))\r\n","import React from \"react\"\r\nimport { ConnectDropTarget, DropTarget, DropTargetConnector } from \"react-dnd\"\r\nimport Column, { DraggableTypeColumn } from \"./Column\"\r\nimport CustomizableColumn from \"./CustomizableColumn\"\r\n\r\nexport interface DroppableContainerProps {\r\n  columns: CustomizableColumn[]\r\n  onChangeColumnsList: (columns: CustomizableColumn[]) => void\r\n  onVisibilityChange: (name: string, visible: boolean) => void\r\n}\r\n\r\ninterface ExtendedDroppableContainerProps extends DroppableContainerProps {\r\n  connectDropTarget: ConnectDropTarget\r\n}\r\n\r\nconst DroppableColumnTarget = { canDrop: () => true }\r\n\r\nconst DroppableColumnCollect = (connect: DropTargetConnector) => ({ connectDropTarget: connect.dropTarget() })\r\n\r\nclass DroppableContainer extends React.Component<ExtendedDroppableContainerProps> {\r\n  moveColumn = (id: string, atIndex: number) => {\r\n    const { column, index } = this.findColumn(id)\r\n    if (column) {\r\n      const newColumns = [...this.props.columns];\r\n      const prevItem = newColumns.splice(atIndex, 1, column);\r\n      newColumns.splice(index, 1, prevItem[0]);\r\n      this.props.onChangeColumnsList(newColumns)\r\n    }\r\n  }\r\n\r\n  findColumn = (id: string) => {\r\n    const column = this.props.columns.filter((c) => c.name === id)[0]\r\n    return {\r\n      column,\r\n      index: this.props.columns.indexOf(column),\r\n    }\r\n  }\r\n\r\n  render() {\r\n    const { connectDropTarget } = this.props\r\n    return connectDropTarget(\r\n      <div>\r\n        {this.props.columns.filter(col => col.customize).map((column) => (\r\n          <Column key={column.name}\r\n            column={column}\r\n            moveColumn={this.moveColumn}\r\n            findColumn={this.findColumn}\r\n            onVisibilityChange={this.props.onVisibilityChange} />))}\r\n      </div>\r\n    )\r\n  }\r\n}\r\n\r\nexport default DropTarget(DraggableTypeColumn, DroppableColumnTarget, DroppableColumnCollect)(DroppableContainer)\r\n","import * as React from \"react\"\r\nimport { Modal, Button } from \"react-bootstrap\"\r\nimport { DndProvider } from \"react-dnd\"\r\nimport { HTML5Backend } from \"react-dnd-html5-backend\"\r\nimport CustomizableColumn from \"./CustomizableColumn\"\r\nimport DroppableContainer from \"./Container\"\r\n\r\ninterface ColumnsCustomizeModalProps {\r\n  show: boolean\r\n  columns: CustomizableColumn[]\r\n  storeKey?:string\r\n  onSave: (columns: CustomizableColumn[]) => void\r\n  onClose: () => void\r\n}\r\n\r\ninterface ColumnsCustomizeModalState {\r\n  columns: CustomizableColumn[]\r\n}\r\n\r\nexport default class ColumnsCustomizeModal extends React.Component<ColumnsCustomizeModalProps, ColumnsCustomizeModalState> {\r\n  state: ColumnsCustomizeModalState = {\r\n    columns: [...this.props.columns]\r\n  }\r\n\r\n  handleChangeColumnsList = (columns: CustomizableColumn[]) => this.setState({ columns: columns })\r\n\r\n  handleVisibilityChange = (name: string, visible: boolean) => {\r\n    let newColumns = this.state.columns.map(column => {\r\n      if (name === column.name) {\r\n        return { ...column, visible: visible }\r\n      }\r\n      return column\r\n    })\r\n\r\n    this.setState({ columns: newColumns })\r\n  }\r\n\r\n  handleClose = () => {\r\n    this.setState({ columns: this.props.columns })\r\n    this.props.onClose()\r\n  }\r\n  handleSave = () => {\r\n    const key = this.props.storeKey || \"\";\r\n    saveCustomized(key, this.state.columns);\r\n    this.props.onSave(this.state.columns);\r\n  }\r\n\r\n  render() {\r\n    return <Modal backdrop=\"static\" size=\"xl\" centered show={this.props.show} onHide={this.handleClose}>\r\n      <Modal.Header closeButton>\r\n        <Modal.Title>CUSTOMIZE COLUMNS</Modal.Title>\r\n      </Modal.Header>\r\n      <Modal.Body>\r\n        <div className=\"pb-2\">Select columns you wish to view. Drag and drop columns to change the viewing order.</div>\r\n        <DndProvider backend={HTML5Backend}>\r\n          <DroppableContainer columns={this.state.columns} onChangeColumnsList={this.handleChangeColumnsList} onVisibilityChange={this.handleVisibilityChange} />\r\n        </DndProvider>\r\n      </Modal.Body>\r\n      <Modal.Footer>\r\n        <Button variant=\"secondary\" onClick={() => this.handleClose()}>CANCEL</Button>\r\n        <Button variant=\"primary\" onClick={() => this.handleSave()}>CUSTOMIZE</Button>\r\n      </Modal.Footer>\r\n    </Modal >\r\n  }\r\n}\r\n\r\nexport function saveCustomized(key: string, columns: CustomizableColumn[]) {\r\n  if (!key) {\r\n    return columns;\r\n  }\r\n  const datStr = JSON.stringify(columns)\r\n  localStorage.setItem(key, datStr)\r\n}\r\n\r\nexport function loadCustomized(key: string, defaultColumns: CustomizableColumn[]) {\r\n  if (!key) {\r\n    return defaultColumns\r\n  }\r\n  const datStr = localStorage.getItem(key);\r\n\r\n  if (!datStr) {\r\n    saveCustomized(key, defaultColumns);\r\n    return defaultColumns\r\n  }\r\n  const savedColumns: CustomizableColumn[] = JSON.parse(datStr);\r\n\r\n  if (validate(savedColumns, defaultColumns)) {\r\n    return savedColumns\r\n  }\r\n  else {\r\n    saveCustomized(key, defaultColumns);\r\n    return defaultColumns\r\n  }\r\n}\r\n\r\nfunction validate(savedColumns: CustomizableColumn[], defaultColumns: CustomizableColumn[]) {\r\n  if (savedColumns.length !== defaultColumns.length) return false\r\n  const columnNames: string[] = savedColumns.map(col => col.name)\r\n  const columLabels: string[] = savedColumns.map(col => col.label || \"\")\r\n  return defaultColumns.every(col => columnNames.includes(col.name) && columLabels.includes(col.label || \"\"))\r\n}\r\n","import { Observable } from \"rxjs\"\r\nimport { ObservableFromFetch } from \"../ObservableFromFetch\"\r\nimport GeneralInformation, {PersonDemographicRecord, PersonDemographicObject, RegMode} from \"./OrderResultModel/GeneralInformation\"\r\nimport { GetUserId } from \"../../storage/UserId\"\r\nimport { UpdateMethodID } from \"../../config/Constants\"\r\n\r\n\r\n  export const GeneralInformationGet = (PersonID: number) => ObservableFromFetch<GeneralInformation>(\"RandomTest/GetPersonnelGeneralInformation?personID=\"+PersonID)\r\n\r\n  export function GeneralInformationSave(data: GeneralInformation | undefined): Observable<string> {\r\n    const urlParams: string = new URLSearchParams({\r\n      loginID: `${GetUserId()}`,\r\n      updateMethodID: UpdateMethodID.toString()\r\n    }).toString()\r\n    const requestBody: string = JSON.stringify(data)\r\n  \r\n    return ObservableFromFetch<string>(\"/RandomTest/AddOrUpdatePerson?\" + urlParams, requestBody, \"PUT\")\r\n  }\r\n  \r\n  export const GetPersonDemographicsDetail = (PersonID: number) => ObservableFromFetch<PersonDemographicRecord>(\"RandomTest/GetPersonDemographicsDetail?personID=\"+PersonID)\r\n  \r\n  export  function UpdatePersonDemographic(data: PersonDemographicObject | undefined): Observable<string> {\r\n    const urlParams: string = new URLSearchParams({\r\n      regionID: '0',\r\n      locationID: '0'\r\n    }).toString()\r\n    const requestBody: string = JSON.stringify(data)\r\n  \r\n    return ObservableFromFetch<string>(\"/RandomTest/UpdatePersonDemographicDetail?\" + urlParams, requestBody, \"POST\")\r\n  }\r\n  \r\n  export  function SaveRegulatoryMode(PersonID: number, items: RegMode[]): Observable<string> {\r\n    const data = {\r\n      PersonID: PersonID,\r\n      RegEmpCatList: items\r\n    }\r\n    const requestBody: string = JSON.stringify(data)\r\n  \r\n    return ObservableFromFetch<string>(\"/RandomTest/SaveRegulatoryMode\", requestBody, \"POST\")\r\n  }\r\n","export default function FormatPhone(value: string) {\r\n  const np = \"N/P\"\r\n  if (value.length > 0) {\r\n    const test = (value: string, compareValue: string): boolean => value.length <= compareValue.length && compareValue.slice(0, value.length) === value.toUpperCase()\r\n    if (test(value, np)) {\r\n      return value.toUpperCase()\r\n    }\r\n    if (value.length > 1 && test(value.slice(0, -1), np)) {\r\n      return value.slice(0, -1).toUpperCase()\r\n    }\r\n  }\r\n  var r = value.replace(/\\D/g, \"\")\r\n  if (r.length > 5) {\r\n    r = r.replace(/^(\\d{3})(\\d{3})(\\d{0,4}).*/, \"$1-$2-$3\")\r\n  } else if (r.length > 2) {\r\n    r = r.replace(/^(\\d{3})(\\d{0,4})/, \"$1-$2\")\r\n  }\r\n  if (r === value + '-') {\r\n    // removing last minus symbol\r\n    r = r.slice(0, -1)\r\n  }\r\n  return r\r\n}\r\n","export default function FormatSSN(value: string) {\r\n  var r = value.replace(/\\D/g, \"\");\r\n  if (r.length > 4) {\r\n    r = r.replace(/^(\\d{3})(\\d{2})(\\d{0,4}).*/, \"$1-$2-$3\");\r\n  } else if (r.length > 2) {\r\n    r = r.replace(/^(\\d{3})(\\d{0,3})/, \"$1-$2\");\r\n  }\r\n  if (r === value + '-') {\r\n    // removing last minus symbol\r\n    r = r.slice(0, -1);\r\n  }\r\n  return r;\r\n}\r\n","export default function FormatZipCode(value: string) {\r\n  var r = value.replace(/\\D/g, \"\")\r\n  if (r.length > 6) {\r\n    r = r.slice(0, 6)\r\n  }\r\n  return r\r\n}\r\n\r\nexport function ValidZipCode(postalCode: string) {\r\n  postalCode = postalCode.toString().toUpperCase()\r\n\r\n  var us = new RegExp(\"^\\\\d{5}(-{0,1}\\\\d{4})?$\")\r\n  var ca = new RegExp(/^[ABCEGHJ-NPRSTVXY][0-9][ABCEGHJ-NPRSTV-Z][ ][0-9][ABCEGHJ-NPRSTV-Z][0-9]$/)\r\n\r\n  if (us.test(postalCode)) {\r\n      return true\r\n  }\r\n\r\n  if (ca.test(postalCode)) {\r\n      return true\r\n  }\r\n  return false\r\n}\r\n","import React, { Component } from \"react\"\r\nimport { Form } from \"react-bootstrap\"\r\nimport MaskedInput from \"react-maskedinput\"\r\n\r\ninterface PhoneNumberMaskedInputProps {\r\n  allowNotProvided?: boolean\r\n  autoComplete?: string\r\n  className?: string\r\n  isInvalid?: boolean\r\n  readOnly?: boolean\r\n  disabled?: boolean\r\n  intl11?:boolean\r\n  size?: \"sm\" | \"lg\"\r\n  value: string\r\n  id?: string\r\n  onChange: (value: string) => void\r\n}\r\n\r\nexport default class PhoneNumberMaskedInput extends Component<PhoneNumberMaskedInputProps> {\r\n  render() {\r\n    let msk = \"111-111-1111\"\r\n    if(this.props.intl11 ===  true){\r\n      msk = \"1-111-111-1111\"\r\n    }\r\n    return <Form.Control type=\"text\"\r\n      {...this.props}\r\n      as={MaskedInput}\r\n      formatCharacters={{\r\n        \"n\": { validate: (char: string) => /[\\d|n|N]/.test(char) ? \"N\" : \"\" },\r\n        \"s\": { validate: (char: string) => /[\\d|/]/.test(char) ? \"N\" : \"\" },\r\n        \"p\": { validate: (char: string) => /[\\d|p|P]/.test(char) ? \"P\" : \"\" }\r\n      }}\r\n      mask={!this.props.allowNotProvided || /^\\d+/.test(this.props.value) ? msk : \"nsp\"}\r\n      onChange={(e) => this.props.onChange(e.target.value)} />\r\n  }\r\n}\r\n","import { Observable } from \"rxjs\"\r\nimport { ObservableFromFetch } from \"../ObservableFromFetch\"\r\nimport { AccountTypeID } from \"../../config/Constants\"\r\nimport AutoFilterLocation from \"./LocationModel/AutoFilterLocation\"\r\nimport AutoFilterCompany from \"../Companies/CompanyModel/AutoFilterCompany\"\r\n\r\nexport default function AutoFilterLocationsGetObservable(company: number, region: number | string, filter: string, portal: number = 0, hideInactive: boolean = false): Observable<AutoFilterLocation[]> {\r\n  const options = {\r\n    AccountType: AccountTypeID,\r\n    ImplementationID: portal,\r\n    ParentAccountID: company,\r\n    AutoFilterValue: filter,\r\n    IsFilters: true,\r\n    HideInactive: hideInactive\r\n  }\r\n  const requestBody: string = JSON.stringify(region ? { ...options, RegionID: region } : options)\r\n\r\n  return ObservableFromFetch<AutoFilterLocation[]>(\"Order/GetAutoFilterLocation\", requestBody)\r\n}\r\n\r\nexport function AutoFilterLocationsGet(company: number, filter: string, hideInactive: boolean = false) {\r\n  const requestBody = JSON.stringify({\r\n    AccountType: AccountTypeID,\r\n    ParentAccountID: company,\r\n    AutoFilterValue: filter,\r\n    IsFilters: true,\r\n    HideInactive: hideInactive\r\n  })\r\n\r\n  return ObservableFromFetch<AutoFilterCompany[]>(\"Order/GetAutoFilterLocation\", requestBody)\r\n}\r\n\r\nexport function GetUserLocationsAdministrators(companyID: number, userID: number) {\r\n  const requestBody: string = JSON.stringify({\r\n    CompanyID: companyID,\r\n    ApplicationUserID: userID\r\n  }).toString()\r\n\r\n  return ObservableFromFetch<string[]>(\"FFOrderUserFileMaintenance/GetUserLocationsAdministrators\", requestBody)\r\n}\r\n\r\nexport function AutoFilterLocationWithRegionGetObservable(regionId: number, filter: string): Observable<AutoFilterLocation[]> {\r\n  const requestBody: string = JSON.stringify({\r\n    ParentAccountID: \"\",\r\n    AccountType: AccountTypeID,\r\n    AutoFilterValue: filter,\r\n    IncludeCompany: false,\r\n    IncludeLocation: true,\r\n    IncludeMaster: false,\r\n    IncludeParent: true,\r\n    IncludeRegion: false,\r\n    RegionID: regionId\r\n  })\r\n\r\n  return ObservableFromFetch<AutoFilterLocation[]>(\"/Order/GetAutoFilterLocationWithRegion\", requestBody)\r\n}\r\n\r\nexport function AutoFilterLocationWithoutRegionGetObservable(): Observable<AutoFilterLocation[]> {\r\n  const requestBody: string = JSON.stringify({\r\n    //ParentAccountID: , // TODO: Need to corrected once authorized user data/account be available\r\n    IncludeCompany: false,\r\n    IncludeLocation: true,\r\n    IncludeMaster: false,\r\n    IncludeParent: true,\r\n    IncludeRegion: false,\r\n  })\r\n\r\n  return ObservableFromFetch<AutoFilterLocation[]>(\"RandomTest/GetLocationWithoutRegion\", requestBody)\r\n}\r\n","import * as React from \"react\"\r\nimport { Button } from \"react-bootstrap\"\r\nimport { Typeahead, InputProps } from \"react-bootstrap-typeahead\"\r\nimport { FaAngleDown } from \"react-icons/fa\"\r\nimport State from \"../../api/OrderRequests/OrderRequestsModel/State\"\r\n\r\ninterface StateSelectProps {\r\n  id?: string\r\n  selected?: State\r\n  selectedCode?: string\r\n  states: State[] | undefined\r\n  inputProps?: InputProps\r\n  isInvalid?: boolean\r\n  isDisabled?: boolean\r\n  emptyLabel?: string\r\n  placeholder?: string\r\n  dropButtonIfInvalid?: boolean\r\n  onChange: (item: State) => void\r\n}\r\n\r\nexport default class StateSelect extends React.Component<StateSelectProps> {\r\n  typeahead = React.createRef<Typeahead<State>>()\r\n\r\n  render() {\r\n    const disabled = this.props.isDisabled\r\n    const selected = this.props.selected || this.props.selectedCode ? (this.props.states || []).find(item => item.Abbreviation.toLowerCase() === this.props.selectedCode?.toLowerCase()) : undefined\r\n    return <Typeahead\r\n      inputProps={this.props.inputProps}\r\n      id={this.props.id}\r\n      ref={this.typeahead}\r\n      labelKey={\"FullName\"}\r\n      filterBy={(option, props) => props.selected.length > 0 || option.FullName.toLowerCase().indexOf(props.text.toLowerCase()) !== -1 || option.Abbreviation.toLowerCase().indexOf(props.text.toLowerCase()) !== -1 }\r\n      onChange={(items: State[]) => this.props.onChange(items[0])}\r\n      disabled={disabled}\r\n      options={this.props.states ? this.props.states : []}\r\n      selected={selected ? [selected] : []}\r\n      emptyLabel={this.props.emptyLabel}\r\n      placeholder={this.props.placeholder}\r\n      isInvalid={this.props.isInvalid}>\r\n      {(this.props.dropButtonIfInvalid || !this.props.isInvalid) &&\r\n        <Button disabled={disabled} variant=\"toggle\" onClick={() => { this.typeahead.current?.toggleMenu() }}>\r\n          <FaAngleDown />\r\n        </Button>}\r\n    </Typeahead>\r\n  }\r\n\r\n  static defaultProps = {\r\n    id: \"state\",\r\n    isInvalid: false,\r\n    isDisabled: false,\r\n    dropButtonIfInvalid: false,\r\n    emptyLabel: \"No State Found\",\r\n    placeholder: \"Select\"\r\n  }\r\n}\r\n","import { Observable } from \"rxjs\";\r\nimport { ObservableFromFetch } from \"../ObservableFromFetch\"\r\nimport { AlcoholTestSampleType } from \"./OrderRequestsModel/AlcoholTestSampleType\"\r\nimport { TestReasonType } from \"./OrderRequestsModel/TestReasonType\"\r\nimport State from \"./OrderRequestsModel/State\"\r\nimport {GetRegulatoryModeDonor} from \"../../components/OrderRequests/OrderModels\"\r\n\r\nexport function AlcoholTestSampleTypesObservable(): Observable<AlcoholTestSampleType[]> {\r\n  return ObservableFromFetch<AlcoholTestSampleType[]>(\"Order/GetAlcoholTestSampleTypes\")\r\n}\r\n\r\nexport function TestReasonsObservable(): Observable<TestReasonType[]> {\r\n  return ObservableFromFetch<TestReasonType[]>(\"order/getreasons\")\r\n}\r\n\r\nexport function StateObservable(): Observable<State[]> {\r\n  return ObservableFromFetch<State[]>(\"Order/GetStates\")\r\n}\r\n\r\nexport function RegulatoryModeObservable(regModeId: number): Observable<GetRegulatoryModeDonor[]> {\r\n  return ObservableFromFetch<GetRegulatoryModeDonor[]>(`FFOrderRegulatoryModeDonor/GetRegulatoryModeListByID?regulatoryModeID=${regModeId}`)\r\n}","import { Observable } from \"rxjs\"\r\nimport EmployeeCategory from \"./LabServiceModel/EmployeeCategory\"\r\nimport { ObservableFromFetch } from \"../ObservableFromFetch\"\r\n\r\nexport default function EmployeeCategoriesGetObservable(id?: number): Observable<EmployeeCategory[]> {\r\n  if (id === undefined) {\r\n    return ObservableFromFetch<EmployeeCategory[]>(\"RandomTest/GetEmployeeCategory\")\r\n  }\r\n  else {\r\n    const requestBody: string = new URLSearchParams({\r\n      regModeID: id.toString()\r\n    }).toString()\r\n    return ObservableFromFetch<EmployeeCategory[]>(\"RandomTest/GetEmployeeCategoryWithRegulatoryModeID?\" + requestBody)\r\n  }\r\n}","import * as React from \"react\"\r\nimport { Modal, Button, Container, Col, Row, Form } from \"react-bootstrap\"\r\nimport { FaAngleDown, FaLevelUpAlt } from \"react-icons/fa\"\r\nimport { Typeahead } from \"react-bootstrap-typeahead\"\r\nimport 'react-bootstrap-typeahead/css/Typeahead.css'\r\nimport { Subscription } from \"rxjs\"\r\nimport LabServiceRegulatoryModesGetObservable from \"../../../api/LabService/LabServiceRegulatoryModesGet\"\r\nimport RegulatoryMode from \"../../../api/LabService/LabServiceModel/RegulatoryMode\"\r\nimport EmployeeCategoriesGetObservable from \"../../../api/LabService/EmployeeCategoriesGet\"\r\nimport EmployeeCategory from \"../../../api/LabService/LabServiceModel/EmployeeCategory\"\r\nimport { RegMode } from \"../../../api/OrderResults/OrderResultModel/GeneralInformation\"\r\nimport { toast } from \"react-toastify\"\r\nimport FormatError from \"../../../formatters/FormatError\"\r\n\r\ninterface EmployeeRegModeModalProps {\r\n  show: boolean\r\n  selectedRegulatoryModes: RegMode[]\r\n\r\n  accountType: string\r\n  onSave: (regulatoryModes: RegMode[]) => void\r\n  onClose: () => void\r\n}\r\n\r\ninterface EmployeeRegModeModalState {\r\n  availableRegulatoryModes?: RegulatoryMode[]\r\n  isRegulatoryModesLoading: boolean\r\n  selectedRegulatoryModes: RegMode[]\r\n  availableCategories?: EmployeeCategory[]\r\n  isCategoriesLoading: boolean\r\n  regulatoryModes: RegMode[]\r\n}\r\nfunction createRegulatoryModes(selectedRegulatoryModes: RegMode[], items_count: number) {\r\n  const regulatoryModes: RegMode[] = []\r\n  const selectedLength = selectedRegulatoryModes.length\r\n  for (let i = 0; i < items_count; i++) {\r\n    if (i < selectedLength) {\r\n      regulatoryModes[i] = copyRegMode(selectedRegulatoryModes[i])\r\n    }\r\n    else {\r\n      regulatoryModes[i] = createEmptyRegMode()\r\n    }\r\n  }\r\n  return regulatoryModes\r\n}\r\nfunction createEmptyRegulatoryMode() {\r\n  const result: RegulatoryMode = {\r\n    RegulatoryModeID: -1,\r\n    Name: \"\",\r\n    DOT: false,\r\n    BeginEffectiveDate: \"\",\r\n    EndEffectiveDate: \"\",\r\n    UserLogin: \"\",\r\n    UpdateDate: \"\"\r\n  }\r\n  return result\r\n}\r\nfunction createEmptyRegMode() {\r\n  const result: RegMode = {\r\n    EmpCat: \"\",\r\n    EmployeeCategoryID: -1,\r\n    PersonRegModeEmpCatID: 0,\r\n    Primary: false,\r\n    RegMode: \"\",\r\n    RegulatoryModeID: -1\r\n  }\r\n  return result\r\n}\r\nfunction createRegMode(src: RegulatoryMode) {\r\n  const result: RegMode = createEmptyRegMode()\r\n  if (!src) {\r\n    return result\r\n  }\r\n  result.RegulatoryModeID = src.RegulatoryModeID\r\n  result.RegMode = src.Name\r\n  return result\r\n}\r\nfunction copyRegMode(src: RegMode) {\r\n  if (src) {\r\n    return { ...src }\r\n  }\r\n  return createEmptyRegMode()\r\n}\r\nfunction createEmptyEmployeeCategory(regulatoryModeId: number) {\r\n  const result: EmployeeCategory = {\r\n    EmployeeCategoryID: -1,\r\n    Code: \"\",\r\n    Name: \"\",\r\n    RegulatoryModeID: regulatoryModeId,\r\n    BeginEffectiveDate: \"\",\r\n    EndEffectiveDate: \"\",\r\n    UserLogin: \"\",\r\n    UpdateDate: \"\"\r\n  }\r\n  return result\r\n}\r\n\r\nexport default class EmployeeRegModeModal extends React.Component<EmployeeRegModeModalProps, EmployeeRegModeModalState> {\r\n  ITEMS_COUNT: number = (this.props.selectedRegulatoryModes.length > 5 ? this.props.selectedRegulatoryModes.length : 5)\r\n  state: EmployeeRegModeModalState = {\r\n    isRegulatoryModesLoading: false,\r\n    selectedRegulatoryModes: this.props.selectedRegulatoryModes,\r\n    isCategoriesLoading: false,\r\n    regulatoryModes: createRegulatoryModes(this.props.selectedRegulatoryModes, this.ITEMS_COUNT)\r\n  }\r\n\r\n  subscriptions = new Subscription()\r\n  regulatoryModeTypeaheads: React.RefObject<Typeahead<RegulatoryMode>>[] = []\r\n  categoryTypeaheads: React.RefObject<Typeahead<EmployeeCategory>>[] = []\r\n  regulatoryModes: RegMode[] = []\r\n\r\n  componentDidMount() {\r\n    this.createTypeaheads()\r\n    this.setState({isRegulatoryModesLoading: true, isCategoriesLoading: true})\r\n    this.subscriptions.add(LabServiceRegulatoryModesGetObservable().subscribe(\r\n      (data: RegulatoryMode[]) => {\r\n        if(data.length > 0){\r\n          const item = createEmptyRegulatoryMode()\r\n          data.unshift(item)\r\n        }\r\n        this.setState({\r\n          availableRegulatoryModes: data,\r\n          isRegulatoryModesLoading: false\r\n        })\r\n      },\r\n      (error) => {\r\n        toast.error(FormatError(error)),\r\n        this.setState({ isRegulatoryModesLoading: false })\r\n      }\r\n    ))\r\n\r\n    this.subscriptions.add(EmployeeCategoriesGetObservable().subscribe(\r\n      (data: EmployeeCategory[]) => {\r\n        this.setState({\r\n          availableCategories: data,\r\n          isCategoriesLoading: false\r\n        })\r\n      },\r\n      (error) => {\r\n        toast.error(FormatError(error)),\r\n        this.setState({ isCategoriesLoading: false })\r\n      }\r\n    ))\r\n\r\n\r\n\r\n  }\r\n\r\n  componentWillUnmount() {\r\n    this.subscriptions.unsubscribe()\r\n  }\r\n  createTypeaheads() {\r\n    this.regulatoryModeTypeaheads = []\r\n    this.categoryTypeaheads = []\r\n    for (let i = 0; i < this.ITEMS_COUNT; i++) {\r\n      const regulatoryModeTypeahead = React.createRef<Typeahead<RegulatoryMode>>()\r\n      const categoryTypeahead = React.createRef<Typeahead<EmployeeCategory>>()\r\n      this.regulatoryModeTypeaheads[i] = regulatoryModeTypeahead\r\n      this.categoryTypeaheads[i] = categoryTypeahead\r\n    }\r\n  }\r\n  componentDidUpdate(prevProps: EmployeeRegModeModalProps, prevState: EmployeeRegModeModalState) {\r\n    if (!(this.isRegulatoryModesEqual(this.props.selectedRegulatoryModes, prevProps.selectedRegulatoryModes))) {\r\n      this.setState({\r\n        selectedRegulatoryModes: this.props.selectedRegulatoryModes,\r\n        regulatoryModes: createRegulatoryModes(this.props.selectedRegulatoryModes, this.ITEMS_COUNT)\r\n      })\r\n    }\r\n  }\r\n\r\n\r\n  isRegulatoryModesEqual = (items1: RegMode[], items2: RegMode[]) => {\r\n    const itemsString = (items: RegMode[]) => items.map(item => item.RegulatoryModeID).sort().join(\",\")\r\n    return itemsString(items1) === itemsString(items2)\r\n  }\r\n\r\n\r\n  handleSave = () => {\r\n    const regulatoryModes = this.state.regulatoryModes || []\r\n    for(let i = 0; i < regulatoryModes.length; i++){\r\n      if(regulatoryModes[i].RegulatoryModeID < 0)\r\n      {\r\n        regulatoryModes[i].RegulatoryModeID = 0\r\n        regulatoryModes[i].EmployeeCategoryID = 0\r\n      }\r\n      if(regulatoryModes[i].EmployeeCategoryID < 0)\r\n      {\r\n        regulatoryModes[i].EmployeeCategoryID = 0\r\n      }\r\n    }\r\n    this.props.onSave(regulatoryModes)\r\n  }\r\n\r\n  handleClose = () => {\r\n    this.setState({\r\n      selectedRegulatoryModes: this.props.selectedRegulatoryModes\r\n    })\r\n    this.props.onClose()\r\n  }\r\n\r\n\r\n\r\n  handleChangeRegulatoryMode = (item: RegulatoryMode, inputIndex: number) => {\r\n    const regulatoryModes = this.state.regulatoryModes || []\r\n    if (inputIndex < 0) {\r\n      return\r\n    }\r\n    if (inputIndex >= regulatoryModes.length) {\r\n      return\r\n    }\r\n    regulatoryModes[inputIndex].RegulatoryModeID = item.RegulatoryModeID\r\n    regulatoryModes[inputIndex].RegMode = item.Name\r\n    this.setState({ regulatoryModes: regulatoryModes })\r\n\r\n  }\r\n\r\n\r\n  handleChangeCategory = (item: EmployeeCategory, inputIndex: number) => {\r\n    const regulatoryModes = this.state.regulatoryModes || []\r\n    if (inputIndex < 0) {\r\n      return\r\n    }\r\n    if (inputIndex >= regulatoryModes.length) {\r\n      return\r\n    }\r\n    regulatoryModes[inputIndex].EmployeeCategoryID = item.EmployeeCategoryID\r\n    regulatoryModes[inputIndex].EmpCat = item.Name\r\n    this.setState({ regulatoryModes: regulatoryModes })\r\n  }\r\n\r\n  handleChangePrimary = (inputIndex: number) => {\r\n    const regulatoryModes = this.state.regulatoryModes || []\r\n    for(let i = 0; i < regulatoryModes.length; i++){\r\n      regulatoryModes[i].Primary = ((i === inputIndex) && (regulatoryModes[i].RegulatoryModeID >= 0))\r\n    }\r\n    this.setState({ regulatoryModes: regulatoryModes })\r\n  }\r\n  createRow = (itemIndex: number) => {\r\n    const regulatoryModes = this.state.regulatoryModes || []\r\n    const allRegulatoryModes = this.state.availableRegulatoryModes || []\r\n    if ((regulatoryModes.length === 0) || (allRegulatoryModes.length === 0)) {\r\n      return <></>\r\n    }\r\n    const disabled = this.state.isRegulatoryModesLoading || this.state.isCategoriesLoading\r\n    const regulatoryModeTypeahead = this.regulatoryModeTypeaheads[itemIndex]\r\n    const categoryTypeahead = this.categoryTypeaheads[itemIndex]\r\n    const regMode = regulatoryModes[itemIndex]\r\n    const regModeId = regMode.RegulatoryModeID\r\n    const regulatoryModeIndex = allRegulatoryModes.findIndex(item => item.RegulatoryModeID === regModeId)\r\n    const regulatoryMode = (regulatoryModeIndex >= 0) ? allRegulatoryModes[regulatoryModeIndex] : createEmptyRegulatoryMode()\r\n    const allEmployeeCategories = this.state.availableCategories || []\r\n\r\n    const employeeCategories = allEmployeeCategories.filter(item => item.RegulatoryModeID === regModeId)\r\n    if(employeeCategories.length > 0){\r\n      const item = createEmptyEmployeeCategory(regModeId)\r\n      employeeCategories.unshift(item)\r\n    }\r\n    const employeeCategoryId = regMode.EmployeeCategoryID\r\n    const employeeCategoryIndex = employeeCategories.findIndex(item => item.EmployeeCategoryID === employeeCategoryId);\r\n    const employeeCategory = (employeeCategoryIndex >= 0) ? employeeCategories[employeeCategoryIndex] : createEmptyEmployeeCategory(regModeId)\r\n    return <Row>\r\n      <Col md={5}>\r\n        <div className=\"typeahead\">\r\n          <Typeahead id={\"regMode_\" + itemIndex}\r\n            ref={regulatoryModeTypeahead}\r\n            labelKey={(option) => (option.RegulatoryModeID >= 0) ? `${option.Name}` : \"Regulatory Mode\"}\r\n            filterBy={(option, props) => {\r\n              return props.selected.length > 0 ;\r\n            }}\r\n            onChange={selected => this.handleChangeRegulatoryMode(selected[0], itemIndex)}\r\n            disabled={disabled}\r\n            options={(allRegulatoryModes)}\r\n            selected={[regulatoryMode]}\r\n            emptyLabel=\"No Result Found\"\r\n            placeholder=\"Regulatory Mode\">\r\n            <Button variant=\"toggle\" onClick={() => { regulatoryModeTypeahead && regulatoryModeTypeahead.current && (regulatoryModeTypeahead.current as any).toggleMenu() }}>\r\n              <FaAngleDown />\r\n            </Button>\r\n          </Typeahead>\r\n        </div>\r\n      </Col>\r\n      <Col md={5}>\r\n        <div className=\"typeahead\">\r\n          <Typeahead id={\"category_\" + itemIndex}\r\n            ref={categoryTypeahead}\r\n            labelKey={(option) => (option.EmployeeCategoryID >= 0) ? `${option.Name} (${option.Code})` : \"Category\"}\r\n            filterBy={(option, props) => {\r\n              return props.selected.length > 0;\r\n            }}\r\n            onChange={selected => this.handleChangeCategory(selected[0], itemIndex)}\r\n            disabled={disabled}\r\n            options={employeeCategories}\r\n            selected={[employeeCategory]}\r\n            emptyLabel=\"No Result Found\"\r\n            placeholder=\"Category\">\r\n            <Button variant=\"toggle\" onClick={() => { categoryTypeahead && categoryTypeahead.current && (categoryTypeahead.current as any).toggleMenu() }}>\r\n              <FaAngleDown />\r\n            </Button>\r\n          </Typeahead>\r\n        </div>\r\n      </Col>\r\n      <Col md={1}>\r\n        <Form.Check\r\n          type=\"radio\"\r\n          //inline \r\n          id={\"is_primary_mode_\" + itemIndex}\r\n          name={\"is_primary_mode\"}\r\n          label=\"\" \r\n          checked={regMode.Primary && regMode.RegulatoryModeID >= 0}\r\n          disabled={disabled && regMode.RegulatoryModeID >= 0}\r\n          onChange={(e: React.ChangeEvent<HTMLInputElement>) => this.handleChangePrimary(itemIndex)}\r\n          className=\"abc-radio abc-radio-primary\" />\r\n      </Col>\r\n    </Row>\r\n\r\n  }\r\n\r\n  render() {\r\n\r\n    const { selectedRegulatoryModes } = this.state\r\n    const rows = []\r\n    for (let i = 0; i < this.ITEMS_COUNT; i++) {\r\n      rows[i] = this.createRow(i)\r\n    }\r\n    return <Modal backdrop=\"static\" size=\"lg\" centered show={this.props.show} onHide={this.handleClose}>\r\n      <Modal.Header closeButton>\r\n        <Modal.Title>REGULATORY ASSIGNMENTS</Modal.Title>\r\n      </Modal.Header>\r\n      <Modal.Body>\r\n        <Container fluid>\r\n          <Row>\r\n            <Col md={5}>Regulatory Mode</Col>\r\n            <Col md={5}>Category</Col>\r\n            <Col md={1}>Primary</Col>\r\n          </Row>\r\n          {rows}\r\n        </Container>\r\n      </Modal.Body>\r\n      <Modal.Footer>\r\n        <Button variant=\"secondary\" onClick={this.handleClose}>CANCEL</Button>\r\n        <Button variant=\"primary\" onClick={() => this.handleSave()}>APPLY</Button>\r\n      </Modal.Footer>\r\n    </Modal >\r\n  }\r\n}\r\n","import * as React from \"react\"\r\nimport { Modal, Button, Container, Col, Row, Form } from \"react-bootstrap\"\r\nimport { Supervisor } from \"../../../api/OrderResults/OrderResultModel/GeneralInformation\"\r\nimport PhoneNumberMaskedInput from \"../../FormattedInputs/PhoneNumberMaskedInput\"\r\nimport { PhoneRegexp } from \"../../../config/Constants\"\r\n\r\ninterface SupervisorsModalProps {\r\n  Supervisor1: Supervisor\r\n  Supervisor2: Supervisor\r\n  onSave: (supervisors: Supervisor[]) => void\r\n  onClose: () => void\r\n}\r\n\r\ninterface  SupervisorsModalState {\r\n  Supervisor1FirstName: string\r\n  Supervisor1LastName: string\r\n  Supervisor1ContactPhone: string\r\n  Supervisor2FirstName: string\r\n  Supervisor2LastName: string\r\n  Supervisor2ContactPhone: string\r\n}\r\n\r\nexport default class EmployeeRegModeModal extends React.Component<SupervisorsModalProps, SupervisorsModalState> {\r\n  state: SupervisorsModalState = {\r\n    Supervisor1FirstName: this.props.Supervisor1.FirstName,\r\n    Supervisor1LastName: this.props.Supervisor1.LastName,\r\n    Supervisor1ContactPhone: this.props.Supervisor1.ContactPhone,\r\n    Supervisor2FirstName: this.props.Supervisor2.FirstName,\r\n    Supervisor2LastName: this.props.Supervisor2.LastName,\r\n    Supervisor2ContactPhone: this.props.Supervisor2.ContactPhone,\r\n  }\r\n\r\n  isPhoneValid = (value: string) => !!value.length && (value.replace(/\\D/g, \"\").length === 10 || PhoneRegexp.test(value))\r\n\r\n  handleClose = () => this.props.onClose()\r\n\r\n  handleSave = () => {\r\n    const SuperVisor1 = {FirstName: this.state.Supervisor1FirstName, LastName: this.state.Supervisor1LastName, ContactPhone: this.state.Supervisor1ContactPhone }\r\n    const SuperVisor2 = {FirstName: this.state.Supervisor2FirstName, LastName: this.state.Supervisor2LastName, ContactPhone: this.state.Supervisor2ContactPhone }\r\n    this.props.onSave([SuperVisor1, SuperVisor2])\r\n  }\r\n\r\n  render() {\r\n    const { Supervisor1FirstName, Supervisor1LastName, Supervisor1ContactPhone, Supervisor2FirstName, Supervisor2LastName, Supervisor2ContactPhone } = this.state\r\n\r\n    const requiredSup1Data = !!Supervisor1FirstName.length || !!Supervisor1LastName.length || !!Supervisor1ContactPhone.length\r\n    const requiredSup2Data = !!Supervisor2FirstName.length || !!Supervisor2LastName.length || !!Supervisor2ContactPhone.length\r\n    const validContactPhone1 = this.isPhoneValid(Supervisor1ContactPhone) || !requiredSup1Data\r\n    const validContactPhone2 = this.isPhoneValid(Supervisor2ContactPhone) || !requiredSup2Data\r\n    const validSup1FirstName = !!Supervisor1FirstName.length || !requiredSup1Data\r\n    const validSup1LastName =  !!Supervisor1LastName.length || !requiredSup1Data\r\n    const validSup2FirstName = !!Supervisor2FirstName.length || !requiredSup2Data\r\n    const validSup2LastName =  !!Supervisor2LastName.length || !requiredSup2Data\r\n\r\n    return <Modal backdrop=\"static\" size=\"xl\" centered show onHide={this.handleClose}>\r\n    <Modal.Header closeButton>\r\n      <Modal.Title>Supervisors</Modal.Title>\r\n    </Modal.Header>\r\n    <Modal.Body>\r\n      <Container fluid>\r\n        <Row className=\"form-group\">\r\n          <Form.Label column lg={4} htmlFor=\"supervisor1FirstName\">Supervisor 1 First\\Last Names</Form.Label>\r\n          <Col lg={4}>\r\n            <Form.Control id=\"contactFirstName\" type=\"text\"\r\n              autoComplete=\"new-password\"\r\n              value={Supervisor1FirstName}\r\n              onChange={e => this.setState({ Supervisor1FirstName: e.target.value })}\r\n              isInvalid={!validSup1FirstName} />\r\n          </Col>\r\n          <Col lg={4}>\r\n            <Form.Control id=\"supervisor1LastName\" type=\"text\"\r\n              autoComplete=\"new-password\"\r\n              value={Supervisor1LastName}\r\n              onChange={e => this.setState({ Supervisor1LastName: e.target.value })}\r\n              isInvalid={!validSup1LastName} />\r\n          </Col>\r\n        </Row>\r\n        <Row className=\"form-group\">\r\n          <Form.Label column lg={4} htmlFor=\"contactPhone1\">Supervisor 1 Contact Phone #</Form.Label>\r\n          <Col lg={4}>\r\n            <PhoneNumberMaskedInput\r\n              autoComplete=\"new-password\"\r\n              value={Supervisor1ContactPhone}\r\n              onChange={(value: string) => this.setState({ Supervisor1ContactPhone: value })}\r\n              isInvalid={!validContactPhone1} />\r\n          </Col>\r\n        </Row>\r\n        <Row className=\"form-group\">\r\n          <Form.Label column lg={4} htmlFor=\"supervisor2FirstName\">Supervisor 2 First\\Last Names</Form.Label>\r\n          <Col lg={4}>\r\n            <Form.Control id=\"contactFirstName\" type=\"text\"\r\n              autoComplete=\"new-password\"\r\n              value={Supervisor2FirstName}\r\n              onChange={e => this.setState({ Supervisor2FirstName: e.target.value })}\r\n              isInvalid={!validSup2FirstName} />\r\n          </Col>\r\n          <Col lg={4}>\r\n            <Form.Control id=\"supervisor2LastName\" type=\"text\"\r\n              autoComplete=\"new-password\"\r\n              value={Supervisor2LastName}\r\n              onChange={e => this.setState({ Supervisor2LastName: e.target.value })}\r\n              isInvalid={!validSup2LastName} />\r\n          </Col>\r\n        </Row>\r\n        <Row className=\"form-group\">\r\n          <Form.Label column lg={4} htmlFor=\"contactPhone2\">Supervisor 2 Contact Phone #</Form.Label>\r\n          <Col lg={4}>\r\n            <PhoneNumberMaskedInput\r\n              autoComplete=\"new-password\"\r\n              value={Supervisor2ContactPhone}\r\n              onChange={(value: string) => this.setState({ Supervisor2ContactPhone: value })}\r\n              isInvalid={!validContactPhone2} />\r\n          </Col>\r\n        </Row>\r\n      </Container>\r\n    </Modal.Body>\r\n    <Modal.Footer>\r\n      <Button variant=\"secondary\" onClick={this.handleClose}>CANCEL</Button>\r\n      <Button variant=\"primary\" onClick={() => this.handleSave()}>APPLY</Button>\r\n    </Modal.Footer>\r\n  </Modal >\r\n  }\r\n}","import React, { Component } from \"react\"\r\nimport { Container, Row, Col, Spinner, Button, Form } from \"react-bootstrap\"\r\nimport { Typeahead } from \"react-bootstrap-typeahead\"\r\nimport { FaAngleDown, FaPencilAlt, FaTimes } from \"react-icons/fa\"\r\nimport MaskedInput from \"react-maskedinput\"\r\nimport { Subscription } from \"rxjs\"\r\nimport GeneralInformation, { PersonDemographicRecord, PersonDemographicObject, RegMode, Supervisor } from \"../../../api/OrderResults/OrderResultModel/GeneralInformation\"\r\nimport { GeneralInformationGet, GetPersonDemographicsDetail } from \"../../../api/OrderResults/GeneralInformationGet\"\r\nimport { toast } from \"react-toastify\"\r\nimport { AppState } from \"../../../AppState\"\r\nimport { connect } from \"react-redux\"\r\nimport FormatDate from \"../../../formatters/FormatDate\"\r\nimport FormatPhone from \"../../../formatters/FormatPhone\"\r\nimport FormatSSN from \"../../../formatters/FormatSSN\"\r\nimport { ValidZipCode } from \"../../../formatters/FormatZipCode\"\r\nimport { BuildUserAccess } from \"../../../authentication/BuildUserAccess\"\r\nimport UserAccessSettings from \"../../../authentication/UserAccessSettings\";\r\nimport DatePicker from 'react-datepicker'\r\nimport 'react-datepicker/dist/react-datepicker.css'\r\nimport { EmailRegexp, PhoneRegexp } from \"../../../config/Constants\"\r\nimport { BirthdayInput } from \"../../FormattedInputs/BirthdayInput\"\r\nimport PhoneNumberMaskedInput from \"../../FormattedInputs/PhoneNumberMaskedInput\"\r\nimport ActionButton from \"../../ActionButton\"\r\nimport AutoFilterCompaniesGet from \"../../../api/Companies/AutoFilterCompaniesGet\"\r\nimport AutoFilterCompany from \"../../../api/Companies/CompanyModel/AutoFilterCompany\"\r\nimport AutoFilterLocation from \"../../../api/Location/LocationModel/AutoFilterLocation\"\r\nimport AutoFilterLocationsGet from \"../../../api/Location/AutoFilterLocationsGet\"\r\nimport State from \"../../../api/OrderRequests/OrderRequestsModel/State\"\r\nimport RegulatoryMode from \"../../../api/LabService/LabServiceModel/RegulatoryMode\"\r\nimport LabServiceRegulatoryModesGetObservable from \"../../../api/LabService/LabServiceRegulatoryModesGet\"\r\nimport StateSelect from \"../../FormattedInputs/StateSelect\"\r\nimport { StateObservable } from \"../../../api/OrderRequests/OrderRequestsConstraintGet\"\r\nimport { GeneralInformationSave, UpdatePersonDemographic, SaveRegulatoryMode } from \"../../../api/OrderResults/GeneralInformationGet\"\r\nimport FormatError from \"../../../formatters/FormatError\"\r\nimport KeyValue from \"../../../api/Administration/Model/KeyValue\"\r\nimport EmployeeRegModeModal from \"./EmployeeRegModeModal\"\r\nimport { isCompanyAdmin, isPortalAdmin } from \"../../../authentication/isAdminRole\"\r\nimport { GetSelectedAssignedClinic } from \"../../../authentication/SelectedCompany/CompanySelectionDrivenSelectors\"\r\nimport SupervisorsModal from \"./SupervisorsModal\"\r\n\r\n// TODO: \"CreateRegModeString\" type was copied from Workforce 1.0\r\ntype CreateRegModeString = {\r\n  EmpCat: string\r\n  EmployeeCategoryID: number\r\n  PersonRegModeEmpCatID: number\r\n  Primary: boolean\r\n  RegMode: string\r\n  RegulatoryModeID: number\r\n}\r\n\r\nfunction regulatoryModeValue(results: CreateRegModeString[]): string {\r\n  if (results.length > 0) {\r\n    let primary: CreateRegModeString | undefined = results.find(item => item.Primary)\r\n    let result: string = primary ? primary.RegMode : \"\"\r\n    let otherRegModes: string = results.filter(item => !item.Primary).map(item => item.RegMode).join(\", \")\r\n    if (otherRegModes !== \"\") {\r\n      result = `${result} (${otherRegModes})`\r\n    }\r\n    return result\r\n  } else {\r\n    return \"N/P\"\r\n  }\r\n}\r\n\r\nconst HeaderRow = (props: { title: string }) =>\r\n  <Row>\r\n    <Col><h5 className=\"pt-3 pb-2\">{props.title}</h5></Col>\r\n  </Row>\r\n\r\n\r\nfunction HeaderRowWithSwitchMode(props: { title: string, showEditButton: boolean, editing: boolean, handleToggleEditMode: any }) {\r\n  return <Row>\r\n    <Col><h5 className=\"pt-3 pb-2\">{props.title}</h5></Col>\r\n    {props.showEditButton && <Col xs={1}>\r\n      <h5>\r\n        <Button variant=\"icon-link\" size=\"sm\" className=\"float-right ml-1 btn-icon-primary\" onClick={props.handleToggleEditMode} >\r\n          {!props.editing && <FaPencilAlt />}\r\n          {props.editing && <FaTimes />}\r\n        </Button>\r\n      </h5>\r\n    </Col>\r\n    }\r\n  </Row>\r\n}\r\n\r\nconst InfoRow = (props: { title: string, value: string | null, className?: string }) => <Row className=\"py-1\">\r\n  <Col xs={6} md={4}><span className=\"caption\">{props.title}</span></Col>\r\n  <Col xs={6} md={8}><span className={props.className}>{props.value}</span></Col>\r\n</Row>\r\n\r\nconst UserRow = (props: { title: string, value: string | null, empty: string }) => {\r\n  const caption = props.title.toString().trim()\r\n  return (\r\n    <Row className=\"py-1\">\r\n      <Col xs={6} md={4}><span className=\"caption text-uppercase\">{caption.length > 0 && caption !== \"N/A\" ? caption : props.empty}</span></Col>\r\n      <Col xs={6} md={8}><span>{props.value}</span></Col>\r\n    </Row>\r\n  )\r\n}\r\nconst InfoRowWithInput = (props: { title: string, value: string | null, className?: string, input: React.ReactNode }) => <Row className={`py-1 ${props.className || \"\"}`}>\r\n  <Col xs={6} md={4}><span className=\"caption\">{props.title}</span></Col>\r\n  <Col xs={6} md={8}>\r\n    {props.input}\r\n  </Col>\r\n</Row>\r\n\r\nconst UserRowWithInput = (props: { title: string, value: string | null, empty: string }) => {\r\n  const caption = props.title.toString().trim()\r\n  return (\r\n    <Row className=\"py-1\">\r\n      <Col xs={6} md={4}><span className=\"caption text-uppercase\">{caption.length > 0 && caption !== \"N/A\" ? caption : props.empty}</span></Col>\r\n      <Col xs={6} md={8}><span>{props.value}</span></Col>\r\n    </Row>\r\n  )\r\n}\r\n\r\ninterface GeneralInfoProps {\r\n  PersonID: number\r\n  isGov?: boolean\r\n  onUpdate?: () => void\r\n}\r\n\r\ninterface GeneralInfoAuthProps {\r\n  userPermissions?: UserAccessSettings\r\n  isPortalAdmin: boolean\r\n  isCompanyAdmin: boolean\r\n  companyID: number\r\n}\r\n\r\ninterface GeneralInfoState {\r\n  data?: GeneralInformation,\r\n  editData?: GeneralInformation,\r\n  editing: boolean,\r\n  saving: boolean\r\n  isGeneralInfoLoading: boolean,\r\n  isPersonDemographicsDetailLoading: boolean,\r\n  isRegulatoryModesLoading: boolean\r\n  isStatesLoading: boolean\r\n  isLocationsLoading: boolean\r\n  isCompaniesLoading: boolean\r\n  isSupervisorsLoading: boolean\r\n  regulatoryModes?: RegulatoryMode[]\r\n  selectedRegulatoryMode?: RegulatoryMode\r\n  selectedCompany?: AutoFilterCompany\r\n  selectedLocation?: AutoFilterLocation\r\n  companies: AutoFilterCompany[]\r\n  locations: AutoFilterLocation[]\r\n  states: State[]\r\n  isSupervisorsLoaded: boolean\r\n  isStatesLoaded: boolean\r\n  isRegulatoryModesLoaded: boolean\r\n  isCompaniesLoaded: boolean\r\n  personDemographicRecords: PersonDemographicObject[]\r\n  userDefinedRecords: []\r\n  implementationAliasRecords: []\r\n  personDemographicObject?: PersonDemographicObject\r\n  showEmployeeRegModes: boolean\r\n  showSupervisors: boolean\r\n}\r\ninterface Gender {\r\n  Name: string\r\n  Code: string\r\n}\r\n\r\nconst genders: Gender[] = [{ Name: \"Male\", Code: \"M\" }, { Name: \"Female\", Code: \"F\" }]\r\n\r\nexport class GeneralInfo extends Component<GeneralInfoProps & GeneralInfoAuthProps, GeneralInfoState> {\r\n  state: GeneralInfoState = {\r\n    data: undefined,\r\n    editing: false,\r\n    saving: false,\r\n    isGeneralInfoLoading: false,\r\n    isPersonDemographicsDetailLoading: false,\r\n    isRegulatoryModesLoading: false,\r\n    isStatesLoading: false,\r\n    isLocationsLoading: false,\r\n    isCompaniesLoading: false,\r\n    isSupervisorsLoading: false,\r\n    regulatoryModes: undefined,\r\n    selectedRegulatoryMode: undefined,\r\n    companies: [],\r\n    locations: [],\r\n    states: [],\r\n    isSupervisorsLoaded: false,\r\n    isStatesLoaded: false,\r\n    isRegulatoryModesLoaded: false,\r\n    isCompaniesLoaded: false,\r\n    personDemographicRecords: [],\r\n    userDefinedRecords: [],\r\n    implementationAliasRecords: [],\r\n    personDemographicObject: undefined,\r\n    showEmployeeRegModes: false,\r\n    showSupervisors: false\r\n  }\r\n  generalInfoSubscription?: Subscription\r\n  personDemographicsDetailSubscription?: Subscription\r\n  regulatoryModesSubscription?: Subscription\r\n  statesSubscription?: Subscription\r\n  supervisorsSubscription?: Subscription\r\n  companiesSubscription?: Subscription\r\n  locationsSubscription?: Subscription\r\n  generalInfoSaveSubscription?: Subscription\r\n  personDemographicsSaveSubscription?: Subscription\r\n  saveRegulatoryModeSubscription?: Subscription\r\n\r\n  companyTypeahead = React.createRef<Typeahead<AutoFilterCompany>>()\r\n  locationTypeahead = React.createRef<Typeahead<AutoFilterLocation>>()\r\n  genderTypeahead = React.createRef<Typeahead<Gender>>()\r\n  hiredate = React.createRef<DatePicker>()\r\n  birthdate = React.createRef<DatePicker>()\r\n  terminationDate = React.createRef<DatePicker>()\r\n  occupationTypeahead = React.createRef<Typeahead<KeyValue>>()\r\n  user1Typeahead = React.createRef<Typeahead<KeyValue>>()\r\n  user2Typeahead = React.createRef<Typeahead<KeyValue>>()\r\n  user3Typeahead = React.createRef<Typeahead<KeyValue>>()\r\n  user4Typeahead = React.createRef<Typeahead<KeyValue>>()\r\n  user5Typeahead = React.createRef<Typeahead<KeyValue>>()\r\n  user6Typeahead = React.createRef<Typeahead<KeyValue>>()\r\n  user7Typeahead = React.createRef<Typeahead<KeyValue>>()\r\n  user8Typeahead = React.createRef<Typeahead<KeyValue>>()\r\n\r\n  componentDidMount() {\r\n    this.loadGeneralInfo(this.props.PersonID)\r\n    this.loadPersonDemographicsDetail(this.props.PersonID)\r\n  }\r\n\r\n  componentWillUnmount() {\r\n    this.generalInfoSubscription && this.generalInfoSubscription.unsubscribe()\r\n    this.personDemographicsDetailSubscription && this.personDemographicsDetailSubscription.unsubscribe()\r\n    this.regulatoryModesSubscription && this.regulatoryModesSubscription.unsubscribe()\r\n    this.statesSubscription && this.statesSubscription?.unsubscribe()\r\n    this.supervisorsSubscription && this.supervisorsSubscription?.unsubscribe()\r\n    this.companiesSubscription && this.companiesSubscription?.unsubscribe()\r\n    this.locationsSubscription && this.locationsSubscription?.unsubscribe()\r\n    this.generalInfoSaveSubscription && this.generalInfoSaveSubscription?.unsubscribe()\r\n    this.personDemographicsSaveSubscription && this.personDemographicsSaveSubscription?.unsubscribe()\r\n    this.saveRegulatoryModeSubscription && this.saveRegulatoryModeSubscription?.unsubscribe()\r\n  }\r\n\r\n  componentDidUpdate(prevProps: GeneralInfoProps) {\r\n    if (this.props.PersonID !== prevProps.PersonID) {\r\n      this.loadGeneralInfo(this.props.PersonID)\r\n    }\r\n  }\r\n\r\n  loadGeneralInfo(PersonID: number) {\r\n    this.setState({ isGeneralInfoLoading: true })\r\n    this.generalInfoSubscription && this.generalInfoSubscription.unsubscribe()\r\n    this.generalInfoSubscription = GeneralInformationGet(PersonID).subscribe(\r\n      (data: GeneralInformation) => this.setState({ data: data }),\r\n      (error) => {\r\n        this.setState({ isGeneralInfoLoading: false })\r\n        toast.error(FormatError(error))\r\n      },\r\n      () => this.setState({ isGeneralInfoLoading: false })\r\n    )\r\n  }\r\n\r\n  loadPersonDemographicsDetail(PersonID: number) {\r\n    this.setState({ isPersonDemographicsDetailLoading: true })\r\n    this.personDemographicsDetailSubscription && this.personDemographicsDetailSubscription.unsubscribe()\r\n    this.personDemographicsDetailSubscription = GetPersonDemographicsDetail(PersonID).subscribe(\r\n      (data: PersonDemographicRecord) => this.setState({\r\n        personDemographicRecords: data.PersonDemographicRecords,\r\n        userDefinedRecords: data.UserDefinedRecords,\r\n        implementationAliasRecords: data.ImplementationAliasRecords,\r\n        personDemographicObject: (data.PersonDemographicRecords.length > 0) ? data.PersonDemographicRecords[0] : undefined\r\n      }),\r\n      (error) => {\r\n        this.setState({ isPersonDemographicsDetailLoading: false })\r\n        toast.error(FormatError(error))\r\n      },\r\n      () => this.setState({ isPersonDemographicsDetailLoading: false })\r\n    )\r\n  }\r\n\r\n  handleToggleEditMode = () => {\r\n    if (this.state.editing) {\r\n      if (this.props.PersonID > 0) {\r\n        this.loadGeneralInfo(this.props.PersonID)\r\n        this.loadPersonDemographicsDetail(this.props.PersonID)\r\n      }\r\n      this.setState({ editing: false, selectedCompany: undefined, selectedLocation: undefined })\r\n    }\r\n    else {\r\n      this.setState({ editing: true })\r\n      this.loadStates()\r\n      this.loadRegulatoryModes()\r\n      this.loadAllCompanies()\r\n    }\r\n  }\r\n\r\n  loadStates = () => {\r\n    if (this.state.isStatesLoaded) {\r\n      return\r\n    }\r\n    this.statesSubscription && this.statesSubscription?.unsubscribe()\r\n    this.statesSubscription =\r\n      StateObservable().subscribe(\r\n        (results: State[]) => this.setState({ states: results, isStatesLoading: false, isStatesLoaded: true }),\r\n        () => { this.setState({ isStatesLoading: false }) }\r\n      )\r\n\r\n\r\n  }\r\n  loadRegulatoryModes = () => {\r\n\r\n    if (this.state.isRegulatoryModesLoaded) {\r\n      return\r\n    }\r\n    this.setState({ isRegulatoryModesLoading: true })\r\n    this.regulatoryModesSubscription && this.regulatoryModesSubscription.unsubscribe()\r\n    this.regulatoryModesSubscription = LabServiceRegulatoryModesGetObservable(true).subscribe(\r\n      (data: RegulatoryMode[]) => this.setState({\r\n        regulatoryModes: data,\r\n        isRegulatoryModesLoading: false,\r\n        isRegulatoryModesLoaded: true\r\n      }),\r\n      () => this.setState({ isRegulatoryModesLoading: false })\r\n    )\r\n  }\r\n\r\n  loadAllCompanies = () => {\r\n    if (this.state.isCompaniesLoaded) {\r\n      this.initialCompanyChange(this.state.companies)\r\n      return\r\n    }\r\n    this.setState({ isCompaniesLoading: true })\r\n\r\n    AutoFilterCompaniesGet(\"\").subscribe(\r\n      data => {\r\n        this.setState({ companies: data, isCompaniesLoading: false, isCompaniesLoaded: true })\r\n        this.initialCompanyChange(data)\r\n      },\r\n      () => this.setState({ isCompaniesLoading: false })\r\n    )\r\n  }\r\n\r\n  initialCompanyChange = (companies: AutoFilterCompany[]) => {\r\n    if (companies.length > 0) {\r\n      const currentCompany = companies.find(comp => comp.AccountID === this.state.data?.CompanyID)\r\n      this.setState({ selectedCompany: currentCompany })\r\n      if (!!currentCompany) this.loadAllLocations(currentCompany, true)\r\n    } else {\r\n      this.setState({\r\n        locations: [],\r\n        selectedCompany: undefined,\r\n        selectedLocation: undefined\r\n      })\r\n    }\r\n  }\r\n\r\n  handleLocationChange = (locations: AutoFilterLocation[]) => this.setState({ selectedLocation: locations[0] })\r\n\r\n  handleCompanyChange = (companies: AutoFilterCompany[]) => {\r\n    const selectedCompany = companies[0]\r\n    this.setState({ selectedCompany: companies[0], locations: [], selectedLocation: undefined })\r\n    if (!!selectedCompany) this.loadAllLocations(selectedCompany, false)\r\n  }\r\n\r\n  loadAllLocations = (company: AutoFilterCompany, initialLoad: boolean) => {\r\n    this.setState({ isLocationsLoading: true })\r\n    this.locationsSubscription && this.locationsSubscription?.unsubscribe()\r\n    this.locationsSubscription =\r\n      AutoFilterLocationsGet(company.AccountID, \"\", \"\").subscribe(\r\n        data => {\r\n          const currentLocation = data.find(loc => loc.AccountID === this.state.data?.AccountID)\r\n          this.setState({ locations: data, selectedLocation: initialLoad ? currentLocation : undefined, isLocationsLoading: false })\r\n        },\r\n        () => this.setState({ isLocationsLoading: false })\r\n      )\r\n  }\r\n\r\n  handleSubmit = () => {\r\n    if (!this.state.editing) {\r\n      return false\r\n    }\r\n    const data = this.state.data\r\n    if (!data) {\r\n      return\r\n    }\r\n    this.setState({ editing: false, saving: true })\r\n    data.RegModeEmpCat = {\r\n      EmpCat: \"\",\r\n      EmployeeCategoryID: 0,\r\n      PersonRegModeEmpCatID: 0,\r\n      Primary: false,\r\n      RegMode: \"\",\r\n      RegulatoryModeID: 0\r\n    }\r\n    data.CompanyID = this.state.selectedCompany?.AccountID || 0\r\n    data.LocationID = this.state.selectedLocation?.AccountID || 0\r\n    if ((data?.Driver || \"\").length === 0) data.DriverLICStateOfIssue = \"\"\r\n    this.generalInfoSaveSubscription && this.generalInfoSaveSubscription?.unsubscribe()\r\n    this.personDemographicsSaveSubscription && this.personDemographicsSaveSubscription?.unsubscribe()\r\n    this.saveRegulatoryModeSubscription && this.saveRegulatoryModeSubscription?.unsubscribe()\r\n    this.generalInfoSaveSubscription = GeneralInformationSave(data).subscribe(\r\n      ((result) => {\r\n        const personID = Number(result)\r\n        if (personID > 0) {\r\n          const pdo = this.state.personDemographicObject\r\n          if (pdo) {\r\n            pdo.Occupation = pdo.OccupationCode\r\n            pdo.User1 = pdo.User1Code\r\n            pdo.User2 = pdo.User2Code\r\n            pdo.User3 = pdo.User3Code\r\n            pdo.User4 = pdo.User4Code\r\n            pdo.User5 = pdo.User5Code\r\n            pdo.User6 = pdo.User6Code\r\n            pdo.User7 = pdo.User7Code\r\n            pdo.User8 = pdo.User8Code\r\n            pdo.CompanyID = this.state.selectedCompany?.AccountID || 0\r\n            pdo.LocationID = this.state.selectedLocation?.AccountID || 0\r\n\r\n            this.personDemographicsSaveSubscription = UpdatePersonDemographic(pdo).subscribe(\r\n              ((result) => {\r\n                toast.success(result)\r\n              }),\r\n              (error) => {\r\n                toast.error(FormatError(error))\r\n              }\r\n            )\r\n            this.saveRegulatoryModeSubscription = SaveRegulatoryMode(personID, data.RegModCatList).subscribe(\r\n              ((result) => {\r\n                //toast.success(result)\r\n              }),\r\n              (error) => {\r\n                toast.error(FormatError(error))\r\n              }\r\n            )\r\n          }\r\n          this.setState({ saving: false })\r\n          toast.success(\"Updated personnel data successfully.\")\r\n          this.loadGeneralInfo(personID)\r\n          this.loadPersonDemographicsDetail(personID)\r\n          this.props.onUpdate && this.props.onUpdate()\r\n        } else {\r\n          toast.error(result)\r\n        }\r\n      }),\r\n      (error) => {\r\n        this.setState({ saving: false })\r\n        toast.error(FormatError(error))\r\n      }\r\n    )\r\n    return false\r\n  }\r\n  ssnRequired = () => this.state.data?.CompanyPrimaryID === \"SSN\"\r\n  employerIDRequired = () => this.state.data?.CompanyPrimaryID === \"EmployerID\"\r\n  driverIDRequired = () => this.state.data?.CompanyPrimaryID === \"DriverID\"\r\n  alternateIDRequired = () => this.state.data?.CompanyPrimaryID === \"AlternateID\"\r\n  showDriverState = () => this.driverIDRequired() || (this.state.data?.Driver || \"\").length > 0 || (this.state.editData?.Driver || \"\").length > 0\r\n\r\n  checkIsPhoneValid = (value: string) => value.length === 0 || PhoneRegexp.test(value) || value.toLowerCase() === \"n/p\"\r\n  checkIsNotEmpty = (value: string, required: boolean) => !required || value.trim().length > 0\r\n  checkIsSSNValid = (value: string, required: boolean) => (!required && value.length === 0) || value.replace(/\\D/g, \"\").length === 9\r\n  checkIsEmailValid = (value: string) => {\r\n    if (value.length === 0) {\r\n      return true\r\n    }\r\n    return EmailRegexp.test(value)\r\n  }\r\n  createFirstNameRow = () => {\r\n    const data: GeneralInformation = this.state.data!\r\n    const editing = this.state.editing\r\n    if (!editing) {\r\n      return <InfoRow title=\"First Name\" value={data.FirstName} className=\"text-uppercase\" />\r\n    }\r\n    const input = <Form.Control type=\"text\" isInvalid={!this.isFirstNameValid()} maxLength={20} value={data.FirstName} onChange={(e: React.ChangeEvent<HTMLInputElement>) => this.handleFirstNameChange(e)} />\r\n    const result = <InfoRowWithInput title=\"First Name\" value={data.FirstName} className=\"text-uppercase\" input={input} />\r\n    return result\r\n\r\n  }\r\n\r\n  handleFirstNameChange = (event: React.ChangeEvent<HTMLInputElement>) => {\r\n    const value = event.target.value;\r\n    this.state.data && this.setState(prevState => {\r\n      return { data: prevState.data ? { ...prevState.data, FirstName: value } : prevState.data }\r\n    })\r\n  }\r\n\r\n  isFirstNameValid = () => {\r\n    return true\r\n  }\r\n\r\n  createLastNameRow = () => {\r\n    const data: GeneralInformation = this.state.data!\r\n    const editing = this.state.editing\r\n    if (!editing) {\r\n      return <InfoRow title=\"Last Name\" value={data.LastName} className=\"text-uppercase\" />\r\n    }\r\n    const input = <Form.Control type=\"text\" isInvalid={!this.isLastNameValid()} maxLength={20} value={data.LastName} onChange={(e: React.ChangeEvent<HTMLInputElement>) => this.handleLastNameChange(e)} />\r\n    const result = <InfoRowWithInput title=\"Last Name\" value={data.LastName} className=\"text-uppercase\" input={input} />\r\n    return result\r\n\r\n  }\r\n  handleLastNameChange = (event: React.ChangeEvent<HTMLInputElement>) => {\r\n    const value = event.target.value;\r\n    this.state.data && this.setState(prevState => {\r\n      return { data: prevState.data ? { ...prevState.data, LastName: value } : prevState.data }\r\n    })\r\n  }\r\n  isLastNameValid = () => {\r\n    return true\r\n\r\n  }\r\n  createEmployerIdRow = () => {\r\n    const data: GeneralInformation = this.state.data!\r\n    const editing = this.state.editing\r\n    if (!editing) {\r\n      return <InfoRow title=\"EMPLOYER ID\" value={data.Employer} className=\"text-uppercase\" />\r\n    }\r\n    const input = <Form.Control type=\"text\" isInvalid={!this.isEmployerIdValid()} value={data.Employer} onChange={(e: React.ChangeEvent<HTMLInputElement>) => this.handleEmployerIdChange(e)} />\r\n    const result = <InfoRowWithInput title=\"EMPLOYER ID\" value={data.Employer} className=\"text-uppercase\" input={input} />\r\n    return result\r\n\r\n  }\r\n  handleEmployerIdChange = (event: React.ChangeEvent<HTMLInputElement>) => {\r\n    const value = event.target.value;\r\n    this.state.data && this.setState(prevState => {\r\n      return { data: prevState.data ? { ...prevState.data, Employer: value } : prevState.data }\r\n    })\r\n  }\r\n  isEmployerIdValid = () => {\r\n    const data: GeneralInformation = this.state.data!\r\n    const value = data.Employer ? data.Employer.trim() : \"\"\r\n    if (this.employerIDRequired()) {\r\n      return value.length > 0\r\n    }\r\n    return true\r\n  }\r\n\r\n  createAlternateIdRow = () => {\r\n    const data: GeneralInformation = this.state.data!\r\n    const editing = this.state.editing\r\n    if (!editing) {\r\n      return <InfoRow title=\"ALTERNATE ID\" value={data.Alternate} className=\"text-uppercase\" />\r\n    }\r\n    const input = <Form.Control type=\"text\" isInvalid={!this.isAlternateIdValid()} value={data.Alternate} onChange={(e: React.ChangeEvent<HTMLInputElement>) => this.handleAlternateIdChange(e)} />\r\n    const result = <InfoRowWithInput title=\"ALTERNATE ID\" value={data.Alternate} className=\"text-uppercase\" input={input} />\r\n    return result\r\n\r\n  }\r\n  handleAlternateIdChange = (event: React.ChangeEvent<HTMLInputElement>) => {\r\n    const value = event.target.value;\r\n    this.state.data && this.setState(prevState => {\r\n      return { data: prevState.data ? { ...prevState.data, Alternate: value } : prevState.data }\r\n    })\r\n  }\r\n  isAlternateIdValid = () => {\r\n    const data: GeneralInformation = this.state.data!\r\n    const value = data.Alternate ? data.Alternate.trim() : \"\"\r\n    if (this.alternateIDRequired()) {\r\n      return value.length > 0\r\n    }\r\n    return true\r\n  }\r\n\r\n\r\n\r\n  createSSNRow = () => {\r\n    const data: GeneralInformation = this.state.data!\r\n    const editing = this.state.editing\r\n    if (!editing) {\r\n      return <InfoRow title=\"SSN\" value={FormatSSN(data.SSN || \"\")} />\r\n    }\r\n    const input = <Form.Control type=\"text\" as={MaskedInput} mask=\"111-11-1111\" isInvalid={!this.isSSNValid()} value={data.SSN} onChange={(e: React.ChangeEvent<HTMLInputElement>) => this.handleSSNChange(e)} />\r\n    const result = <InfoRowWithInput title=\"SSN\" value={data.Alternate} className=\"text-uppercase\" input={input} />\r\n    return result\r\n  }\r\n\r\n  handleSSNChange = (event: React.ChangeEvent<HTMLInputElement>) => {\r\n    const value = event.target.value || \"\";\r\n    this.state.data && this.setState(prevState => {\r\n      return { data: prevState.data ? { ...prevState.data, SSN: value.replace(/\\D/g, \"\") } : prevState.data }\r\n    })\r\n  }\r\n  isSSNValid = () => {\r\n    const data: GeneralInformation = this.state.data!\r\n    const value = data.SSN ? data.SSN.trim() : \"\"\r\n    const required = this.ssnRequired()\r\n    return this.checkIsSSNValid(value, required)\r\n  }\r\n\r\n\r\n  createDriverStateRow = () => {\r\n    const data: GeneralInformation = this.state.data!\r\n    const states = this.state.states\r\n    const editing = this.state.editing\r\n    if (!editing) {\r\n      return <InfoRow title=\"DRIVER'S LICENSE STATE OF ISSUANCE\" value={this.state.data?.DriverLICStateOfIssue || \"\"} />\r\n    }\r\n    const input = <StateSelect states={states} dropButtonIfInvalid selectedCode={this.state.data?.DriverLICStateOfIssue} onChange={(state) => this.handleDriverStateChange(state)} />\r\n    const result = <InfoRowWithInput title=\"DRIVER'S LICENSE STATE OF ISSUANCE\" value={data.State} className=\"text-uppercase\" input={input} />\r\n    return result\r\n  }\r\n\r\n  handleDriverStateChange = (value: State) => {\r\n    this.state.data && this.setState(prevState => {\r\n      return { data: prevState.data ? { ...prevState.data, DriverLICStateOfIssue: value?.Abbreviation || \"\" } : prevState.data }\r\n    })\r\n  }\r\n\r\n  createDriverIdRow = () => {\r\n    const data: GeneralInformation = this.state.data!\r\n    const editing = this.state.editing\r\n    if (!editing) {\r\n      return <InfoRow title=\"DRIVER ID\" value={data.Driver} className=\"text-uppercase\" />\r\n    }\r\n    const input = <Form.Control type=\"text\" isInvalid={!this.isDriverIdValid()} value={data.Driver} onChange={(e: React.ChangeEvent<HTMLInputElement>) => this.handleDriverIdChange(e)} />\r\n    const result = <InfoRowWithInput title=\"DRIVER ID\" value={data.Driver} className=\"text-uppercase\" input={input} />\r\n    return result\r\n\r\n  }\r\n  handleDriverIdChange = (event: React.ChangeEvent<HTMLInputElement>) => {\r\n    const value = event.target.value;\r\n    this.state.data && this.setState(prevState => {\r\n      return { data: prevState.data ? { ...prevState.data, Driver: value } : prevState.data }\r\n    })\r\n  }\r\n  isDriverIdValid = () => {\r\n    const data: GeneralInformation = this.state.data!\r\n    const value = data.Driver ? data.Driver.trim() : \"\"\r\n    if (this.driverIDRequired()) {\r\n      return value.length > 0\r\n    }\r\n    return true\r\n  }\r\n\r\n  createOccupationRow = () => {\r\n    const data: GeneralInformation = this.state.data!\r\n    const demographicLabels = data.ImplementationAlias\r\n    const demographicInfo = data.PersonDemographicObj\r\n    const editing = this.state.editing\r\n    let occupationTitle: string = \"OCCUPATION\"\r\n    if (data.ImplementationAlias?.Occupation) {\r\n      occupationTitle = data.ImplementationAlias.Occupation.toUpperCase()\r\n      if (occupationTitle === \"N/A\") {\r\n        occupationTitle = \"OCCUPATION\"\r\n      }\r\n    }\r\n    \r\n    const occupation = data.Occupation.length > 0 ? `${data.Occupation}` : \"\" \r\n    \r\n    if (!editing) {\r\n      return <InfoRow title={occupationTitle} value={occupation} className=\"text-uppercase\" />\r\n    }\r\n    const values = this.state.userDefinedRecords.filter(item => item['Type'] === \"OC\")\r\n    if (values.length === 0) {\r\n      return <InfoRow title={occupationTitle} value={occupation} className=\"text-uppercase\" />\r\n    }\r\n    const options: KeyValue[] = values.map(item => {\r\n      let rObj: KeyValue = {\r\n        Key: item['Code'],\r\n        Value: item['Description']\r\n      }\r\n      return rObj\r\n    })\r\n\r\n    const input = (\r\n      <Form.Control\r\n        type=\"text\"\r\n        value={data.OccupationCode}\r\n        maxLength={30}\r\n        onChange={(e) => this.handleOccupationChange({ Key: e.target.value, Value: e.target.value })}\r\n      />\r\n    )\r\n    const result = <InfoRowWithInput title={occupationTitle} value={data.Occupation} className=\"text-uppercase\" input={input} />\r\n    return result\r\n  }\r\n\r\n  handleOccupationChange = (value: KeyValue) => {\r\n    const { data, personDemographicObject } = this.state\r\n    if (data && personDemographicObject) {\r\n      this.setState({\r\n        data: { ...data, PersonDemographicObj: { ...data.PersonDemographicObj, Occupation: value.Value }, OccupationCode: value.Key, Occupation: value.Key },\r\n        personDemographicObject: { ...personDemographicObject, OccupationCode: value.Key, Occupation: value.Key }\r\n      });\r\n    }\r\n  }\r\n\r\n  isOccupationValid = () => {\r\n    return true\r\n\r\n  }\r\n\r\n  createRegulatoryModeRow = () => {\r\n    const data: GeneralInformation = this.state.data!\r\n    const editing = this.state.editing\r\n    if (!editing) {\r\n      return <InfoRow title=\"REGULATORY MODE\" value={regulatoryModeValue(data.RegModCatList)} className=\"primary\" />\r\n    }\r\n    const input = <Button variant=\"underline-link\" className=\"px-0 mx-0\" onClick={() => this.handleRegulatoryModeClick()}>{regulatoryModeValue(data.RegModCatList)} </Button>\r\n    const result = <InfoRowWithInput title=\"REGULATORY MODE\" value={regulatoryModeValue(data.RegModCatList)} className=\"text-uppercase\" input={input} />\r\n    return result\r\n  }\r\n\r\n  isRegulatoryModeValid = () => {\r\n    return true\r\n\r\n  }\r\n\r\n  handleRegulatoryModeClick = () => {\r\n    this.setState({ showEmployeeRegModes: true })\r\n  }\r\n\r\n  handleRegulatoryModeSave = (items: RegMode[]) => {\r\n    const regulatoryModes = items || []\r\n    this.state.data && this.setState(prevState => {\r\n      return { data: prevState.data ? { ...prevState.data, RegModCatList: regulatoryModes } : prevState.data, showEmployeeRegModes: false }\r\n    })\r\n    //this.setState({ showEmployeeRegModes: false })\r\n  }\r\n\r\n  handleSupervisorsSave = (items: Supervisor[]) => {\r\n    const supervisors = items || []\r\n    this.state.data && this.setState(prevState => {\r\n      return { data: prevState.data ? { ...prevState.data, Supervisor1Data: items[0], Supervisor2Data: items[1] } : prevState.data, showSupervisors: false }\r\n    })\r\n  }\r\n\r\n  handleRegulatoryModeClose = () => {\r\n    this.setState({ showEmployeeRegModes: false })\r\n  }\r\n\r\n  handleSupervisorsClose = () => {\r\n    this.setState({ showSupervisors: false })\r\n  }\r\n\r\n  createHireDateRow = () => {\r\n    const data: GeneralInformation = this.state.data!\r\n    const editing = this.state.editing\r\n\r\n    if (!editing) {\r\n      return <InfoRow title=\"HIRE DATE\" value={FormatDate(data.HireDate || \"\")} />\r\n    }\r\n\r\n    const val = data.HireDate ? new Date(data.HireDate) : null\r\n    const input = <DatePicker className=\"form-control\"\r\n      ref={this.hiredate}\r\n      peekNextMonth\r\n      showMonthDropdown\r\n      showYearDropdown\r\n      dropdownMode=\"select\"\r\n      maxDate={new Date()}\r\n      selected={val}\r\n      enableTabLoop={false}\r\n      onKeyDown={(e) => { if (this.hiredate && this.hiredate.current && e.key === 'Tab') { this.hiredate.current.setOpen(false) } }}\r\n      onChange={date => this.handleHireDateChange(date)}\r\n      customInput={<BirthdayInput />} />\r\n\r\n\r\n    const result = <InfoRowWithInput title=\"HIRE DATE\" value={FormatDate(data.HireDate || \"\")} className=\"text-uppercase\" input={input} />\r\n    return result\r\n\r\n  }\r\n  handleHireDateChange = (date: any) => {\r\n    this.state.data && this.setState(prevState => {\r\n      return { data: prevState.data ? { ...prevState.data, HireDate: date } : prevState.data }\r\n    })\r\n  }\r\n  isHireDateValid = () => {\r\n    return true\r\n\r\n  }\r\n\r\n  createTerminationDateRow = () => {\r\n    const data: GeneralInformation = this.state.data!\r\n    const editing = this.state.editing\r\n\r\n    if (!editing) {\r\n      return <InfoRow title=\"TERMINATION DATE\" value={FormatDate(data.TerminationDate) || \"N/P\"} />\r\n    }\r\n\r\n    const val = data.TerminationDate ? new Date(data.TerminationDate) : null\r\n    const input = <DatePicker className=\"form-control\"\r\n      ref={this.terminationDate}\r\n      peekNextMonth\r\n      showMonthDropdown\r\n      showYearDropdown\r\n      dropdownMode=\"select\"\r\n      selected={val}\r\n      enableTabLoop={false}\r\n      onKeyDown={(e) => { if (this.terminationDate && this.terminationDate.current && e.key === 'Tab') { this.terminationDate.current.setOpen(false) } }}\r\n      onChange={date => this.handleTerminationDateChange(date)}\r\n      customInput={<BirthdayInput />} />\r\n\r\n\r\n    const result = <InfoRowWithInput title=\"TERMINATION DATE\" value={FormatDate(data.TerminationDate) || \"N/P\"} className=\"text-uppercase\" input={input} />\r\n    return result\r\n\r\n  }\r\n  handleTerminationDateChange = (date: any) => {\r\n    this.state.data && this.setState(prevState => {\r\n      return { data: prevState.data ? { ...prevState.data, TerminationDate: date } : prevState.data }\r\n    })\r\n  }\r\n  isTerminationDateValid = () => {\r\n    return true\r\n  }\r\n\r\n  createDateOfBirthRow = () => {\r\n    const data: GeneralInformation = this.state.data!\r\n    const editing = this.state.editing\r\n\r\n    if (!editing) {\r\n      return <InfoRow title=\"DATE OF BIRTH\" value={FormatDate(data.DOB || \"\")} />\r\n    }\r\n\r\n    const val = data.DOB ? new Date(data.DOB) : null\r\n    const input = <DatePicker className=\"form-control\"\r\n      ref={this.birthdate}\r\n      peekNextMonth\r\n      showMonthDropdown\r\n      showYearDropdown\r\n      dropdownMode=\"select\"\r\n      maxDate={new Date()}\r\n      selected={val}\r\n      enableTabLoop={false}\r\n      onKeyDown={(e) => { if (this.birthdate && this.birthdate.current && e.key === 'Tab') { this.birthdate.current.setOpen(false) } }}\r\n      onChange={date => this.handleDateOfBirthChange(date)}\r\n      customInput={<BirthdayInput />} />\r\n\r\n\r\n    const result = <InfoRowWithInput title=\"DATE OF BIRTH\" value={FormatDate(data.DOB || \"\")} className=\"text-uppercase\" input={input} />\r\n    return result\r\n\r\n  }\r\n  handleDateOfBirthChange = (date: any) => {\r\n    this.state.data && this.setState(prevState => {\r\n      return { data: prevState.data ? { ...prevState.data, DOB: date } : prevState.data }\r\n    })\r\n  }\r\n  isDateOfBirthValid = () => {\r\n    return true\r\n\r\n  }\r\n\r\n  createAddress1Row = () => {\r\n    const data: GeneralInformation = this.state.data!\r\n    const editing = this.state.editing\r\n    if (!editing) {\r\n      return <InfoRow title=\"STREET ADDRESS\" value={data.Address1} />\r\n    }\r\n    const input = <Form.Control type=\"text\" isInvalid={!this.isAddress1Valid()} value={data.Address1} onChange={(e: React.ChangeEvent<HTMLInputElement>) => this.handleAddress1Change(e)} />\r\n    const result = <InfoRowWithInput title=\"STREET ADDRESS\" value={data.Address1} className=\"text-uppercase\" input={input} />\r\n    return result\r\n\r\n  }\r\n\r\n  handleAddress1Change = (event: React.ChangeEvent<HTMLInputElement>) => {\r\n    const value = event.target.value;\r\n    this.state.data && this.setState(prevState => {\r\n      return { data: prevState.data ? { ...prevState.data, Address1: value } : prevState.data }\r\n    })\r\n  }\r\n\r\n  isAddress1Valid = () => {\r\n    return true\r\n  }\r\n\r\n  createCityRow = () => {\r\n    const data: GeneralInformation = this.state.data!\r\n    const editing = this.state.editing\r\n    if (!editing) {\r\n      return <InfoRow title=\"CITY\" value={data.City} />\r\n    }\r\n    const input = <Form.Control type=\"text\" isInvalid={!this.isCityValid()} value={data.City} onChange={(e: React.ChangeEvent<HTMLInputElement>) => this.handleCityChange(e)} />\r\n    const result = <InfoRowWithInput title=\"CITY\" value={data.City} className=\"text-uppercase\" input={input} />\r\n    return result\r\n\r\n  }\r\n\r\n  handleCityChange = (event: React.ChangeEvent<HTMLInputElement>) => {\r\n    const value = event.target.value;\r\n    this.state.data && this.setState(prevState => {\r\n      return { data: prevState.data ? { ...prevState.data, City: value } : prevState.data }\r\n    })\r\n  }\r\n\r\n  isCityValid = () => {\r\n    return true\r\n  }\r\n\r\n  createInactiveRow = () => {\r\n    const data: GeneralInformation = this.state.data!\r\n    const editing = this.state.editing\r\n    if (!editing) {\r\n      return <InfoRow title=\"ACTIVE\" value={!data.Inactive ? \"Yes\" : \"No\"} />\r\n    }\r\n    const input = <Form.Check checked={!data.Inactive} onChange={(e: React.ChangeEvent<HTMLInputElement>) => this.handleInactiveChange(e)} label=\"\" id=\"personnel_inactive\" />\r\n    const result = <InfoRowWithInput title=\"ACTIVE\" value={!data.Inactive ? \"Yes\" : \"No\"} className=\"text-uppercase\" input={input} />\r\n    return result\r\n\r\n  }\r\n\r\n  handleInactiveChange = (event: React.ChangeEvent<HTMLInputElement>) => {\r\n    const value = event.target.checked;\r\n    this.state.data && this.setState(prevState => {\r\n      return { data: prevState.data ? { ...prevState.data, Inactive: !value } : prevState.data }\r\n    })\r\n  }\r\n\r\n  createReasonForInactiveRow = () => {\r\n    const data: GeneralInformation = this.state.data!\r\n    const editing = this.state.editing\r\n    if (!editing) {\r\n      return <InfoRow title=\"Reason for Inactivation\" value={data.ReasonForInactivation} className=\"text-uppercase\" />\r\n    }\r\n    const input = <Form.Control type=\"text\" maxLength={60} value={data.ReasonForInactivation} onChange={(e: React.ChangeEvent<HTMLInputElement>) => this.handleReasonForInactiveChange(e)} />\r\n    const result = <InfoRowWithInput title=\"Reason for Inactivation\" value={data.ReasonForInactivation} className=\"text-uppercase\" input={input} />\r\n    return result\r\n  }\r\n\r\n  handleReasonForInactiveChange = (event: React.ChangeEvent<HTMLInputElement>) => {\r\n    const value = event.target.value;\r\n    this.state.data && this.setState(prevState => {\r\n      return { data: prevState.data ? { ...prevState.data, ReasonForInactivation: value } : prevState.data }\r\n    })\r\n  }\r\n\r\n  createPreEmploymentTestOnFileRow = () => {\r\n    const data: GeneralInformation = this.state.data!\r\n    const editing = this.state.editing\r\n    if (!editing) {\r\n      return <InfoRow title=\"PRE-EMPLOYMENT TEST ON FILE\" value={data.PreEmploymentTestOnFile ? \"Yes\" : \"No\"} />\r\n    }\r\n    const input = <Form.Check checked={data.PreEmploymentTestOnFile} onChange={(e: React.ChangeEvent<HTMLInputElement>) => this.handlePreEmploymentTestOnFileChange(e)} label=\"\" id=\"pre_employment_test_on_file_row\" className=\"mt-2\" />\r\n    const result = <InfoRowWithInput title=\"PRE-EMPLOYMENT TEST ON FILE\" value={data.PreEmploymentTestOnFile ? \"Yes\" : \"No\"} className=\"text-uppercase\" input={input} />\r\n    return result\r\n  }\r\n\r\n  handlePreEmploymentTestOnFileChange = (event: React.ChangeEvent<HTMLInputElement>) => {\r\n    const value = event.target.checked;\r\n    this.state.data && this.setState(prevState => {\r\n      return { data: prevState.data ? { ...prevState.data, PreEmploymentTestOnFile: value } : prevState.data }\r\n    })\r\n  }\r\n  isPreEmploymentTestOnFileValid = () => {\r\n    return true\r\n  }\r\n\r\n  createManagerRow = () => {\r\n    const data: GeneralInformation = this.state.data!\r\n    const editing = this.state.editing\r\n    if (!editing) {\r\n      return <InfoRow title=\"MANAGER\" value={data.Manager ? \"Yes\" : \"No\"} />\r\n    }\r\n    const input = <Form.Check disabled={!this.props.isPortalAdmin} checked={data.Manager} onChange={(e: React.ChangeEvent<HTMLInputElement>) => this.handleManagerChange(e)} label=\"\" id=\"manager_row\" />\r\n    const result = <InfoRowWithInput title=\"MANAGER\" value={data.Manager ? \"Yes\" : \"No\"} className=\"text-uppercase\" input={input} />\r\n    return result\r\n  }\r\n\r\n  handleManagerChange = (event: React.ChangeEvent<HTMLInputElement>) => {\r\n    const value = event.target.checked;\r\n    this.state.data && this.setState(prevState => {\r\n      return { data: prevState.data ? { ...prevState.data, Manager: value } : prevState.data }\r\n    })\r\n  }\r\n\r\n  isManagerValid = () => {\r\n    return true\r\n  }\r\n\r\n  supervisorInfo = (data: Supervisor) => {\r\n    let row = \"\"\r\n    if (data.FirstName.length > 0) row += `${data.FirstName} `\r\n    if (data.LastName.length > 0) row += `${data.LastName} `\r\n    if (data.ContactPhone.length > 0) row += `(${FormatPhone(data.ContactPhone)})`\r\n    return row\r\n  }\r\n\r\n  createSupervisorRow = () => {\r\n    const data: GeneralInformation = this.state.data!\r\n    const editing = this.state.editing\r\n    if (!editing) {\r\n      return <>\r\n        <InfoRow title=\"SUPERVISOR 1\" value={this.supervisorInfo(data.Supervisor1Data)} />\r\n        <InfoRow title=\"SUPERVISOR 2\" value={this.supervisorInfo(data.Supervisor2Data)} />\r\n      </>\r\n    }\r\n    const input = <Button variant=\"underline-link\" className=\"px-0 mx-0\" onClick={() => this.handleSupervisorsClick()}>CONFIGURE</Button>\r\n    const result = <InfoRowWithInput title=\"SUPERVISORS\" value={null} className=\"align-items-center\" input={input} />\r\n    return result\r\n  }\r\n\r\n\r\n  handleSupervisorsClick = () => {\r\n    this.setState({ showSupervisors: true })\r\n  }\r\n\r\n  isSupervisor1Valid = () => true\r\n  isSupervisor2Valid = () => true\r\n\r\n  createGenderRow = () => {\r\n    const data: GeneralInformation = this.state.data!\r\n    const editing = this.state.editing\r\n    if (!editing) {\r\n      return <InfoRow title=\"GENDER\" value={`${data.Gender === \"F\" ? \"Female\" : \"\"}${data.Gender === \"M\" ? \"Male\" : \"\"}`} />\r\n    }\r\n\r\n    const input = <div className=\"typeahead\">\r\n      <Typeahead id=\"gender\"\r\n        ref={this.genderTypeahead}\r\n        labelKey=\"Name\"\r\n        filterBy={(option, props) => props.selected.length > 0 || option.Name.toLowerCase().indexOf(props.text.toLowerCase()) !== -1}\r\n        onChange={selected => this.handleGenderChange(selected[0]?.Code || \"\")}\r\n        options={genders}\r\n        selected={data.Gender !== \"\" ? [genders.find((el) => el?.Code == data.Gender) || genders[0]] : []}\r\n        placeholder=\"Select\">\r\n        <Button variant=\"toggle\" onClick={() => { this.genderTypeahead && this.genderTypeahead.current && (this.genderTypeahead.current as any).toggleMenu() }}>\r\n          <FaAngleDown />\r\n        </Button>\r\n      </Typeahead>\r\n    </div>\r\n    const result = <InfoRowWithInput title=\"GENDER\" value={data.Gender} className=\"text-uppercase\" input={input} />\r\n    return result\r\n\r\n  }\r\n\r\n  handleGenderChange = (value: string) => {\r\n    this.state.data && this.setState(prevState => {\r\n      return { data: prevState.data ? { ...prevState.data, Gender: value } : prevState.data }\r\n    })\r\n  }\r\n  isGenderValid = () => {\r\n    return true\r\n  }\r\n  createStateRow = () => {\r\n\r\n    const data: GeneralInformation = this.state.data!\r\n    const states = this.state.states\r\n    const statetID = data.StateID\r\n    const statetCode = states.find(item => item.StateProvinceTerritoryID === statetID)?.Abbreviation || \"\"\r\n    const editing = this.state.editing\r\n    if (!editing) {\r\n      return <InfoRow title=\"STATE\" value={data.State} />\r\n    }\r\n    const input = <StateSelect states={states} dropButtonIfInvalid selectedCode={statetCode} onChange={(state) => this.handleStateChange(state)} />\r\n    const result = <InfoRowWithInput title=\"STATE\" value={data.State} className=\"text-uppercase\" input={input} />\r\n    return result\r\n  }\r\n  createCompanyRow = (name: string) => {\r\n    if (this.state.editing && !!this.props.isPortalAdmin) {\r\n      const input = <Typeahead id=\"company\"\r\n        key={Math.random().toString()}\r\n        ref={this.companyTypeahead}\r\n        labelKey=\"Name\"\r\n        filterBy={(option, props) => props.selected.length > 0 || option.Name.toLowerCase().indexOf(props.text.toLowerCase()) !== -1}\r\n        isLoading={this.state.isCompaniesLoading}\r\n        isInvalid={!this.isCompanyValid()}\r\n        onChange={this.handleCompanyChange}\r\n        options={this.state.companies}\r\n        selected={this.state.selectedCompany ? [this.state.selectedCompany] : []}\r\n        emptyLabel=\"No Companies Found\"\r\n        placeholder=\"Select\">\r\n        {!this.state.isCompaniesLoading &&\r\n          <Button variant=\"toggle\" onClick={() => { this.companyTypeahead?.current?.toggleMenu() }}>\r\n            <FaAngleDown />\r\n          </Button>}\r\n      </Typeahead>\r\n      const result = <InfoRowWithInput title=\"COMPANY\" value={name} className=\"text-uppercase\" input={input} />\r\n      return result\r\n    }\r\n    else {\r\n      return <InfoRow title=\"COMPANY\" value={name} />\r\n    }\r\n   }\r\n\r\n  createLocationRow = (name: string) => {\r\n    if (this.state.editing && (!!this.props.isPortalAdmin || !!this.props.isCompanyAdmin)) {\r\n      const input = <Typeahead id=\"location\"\r\n        key={Math.random().toString()}\r\n        ref={this.locationTypeahead}\r\n        labelKey=\"Name\"\r\n        filterBy={(option, props) => props.selected.length > 0 || option.Name.toLowerCase().indexOf(props.text.toLowerCase()) !== -1}\r\n        isLoading={this.state.isLocationsLoading}\r\n        onChange={this.handleLocationChange}\r\n        options={this.state.locations}\r\n        selected={this.state.selectedLocation ? [this.state.selectedLocation] : []}\r\n        emptyLabel=\"No Locations Found\"\r\n        placeholder=\"Select\">\r\n        {!this.state.isLocationsLoading &&\r\n          <Button variant=\"toggle\" onClick={() => { this.locationTypeahead?.current?.toggleMenu() }}>\r\n            <FaAngleDown />\r\n          </Button>}\r\n      </Typeahead>\r\n      const result = <InfoRowWithInput title=\"LOCATION\" value={name} className=\"text-uppercase\" input={input} />\r\n      return result\r\n    }\r\n    else {\r\n      return <InfoRow title=\"LOCATION\" value={name} />\r\n    }\r\n  }\r\n\r\n  handleStateChange = (value: State) => {\r\n    this.state.data && this.setState(prevState => {\r\n      return { data: prevState.data ? { ...prevState.data, State: value.FullName, StateID: value.StateProvinceTerritoryID } : prevState.data }\r\n    })\r\n  }\r\n  isStateValid = () => {\r\n    const data: GeneralInformation = this.state.data!\r\n    const value = data.StateID ? data.StateID : 0\r\n    return value > 0\r\n  }\r\n\r\n  createZipRow = () => {\r\n    const data: GeneralInformation = this.state.data!\r\n    const editing = this.state.editing\r\n    if (!editing) {\r\n      return <InfoRow title=\"ZIP\" value={data.Zip} />\r\n    }\r\n    const zipValid = !!data.Zip && ValidZipCode(data.Zip)\r\n    const input = <Form.Control type=\"text\" isInvalid={!zipValid} value={data.Zip} onChange={(e: React.ChangeEvent<HTMLInputElement>) => this.handleZipChange(e)} />\r\n    const result = <InfoRowWithInput title=\"ZIP\" value={data.Zip} className=\"text-uppercase\" input={input} />\r\n    return result\r\n\r\n  }\r\n\r\n  handleZipChange = (event: React.ChangeEvent<HTMLInputElement>) => {\r\n    const value = event.target.value;\r\n    this.state.data && this.setState(prevState => {\r\n      return { data: prevState.data ? { ...prevState.data, Zip: value } : prevState.data }\r\n    })\r\n  }\r\n\r\n  createWorkPhoneRow = () => {\r\n    const data: GeneralInformation = this.state.data!\r\n    const editing = this.state.editing\r\n    if (!editing) {\r\n      return <InfoRow title=\"WORK PHONE\" value={FormatPhone(data.WPhone || \"\")} />\r\n    }\r\n    const input = <PhoneNumberMaskedInput isInvalid={!this.isWorkPhoneValid()} value={data.WPhone} onChange={(value: string) => this.handleWorkPhoneChange(value)} />\r\n    const result = <InfoRowWithInput title=\"WORK PHONE\" value={data.WPhone} className=\"text-uppercase\" input={input} />\r\n    return result\r\n  }\r\n\r\n  handleWorkPhoneChange = (value: string) => {\r\n    this.state.data && this.setState(prevState => {\r\n      return { data: prevState.data ? { ...prevState.data, WPhone: value } : prevState.data }\r\n    })\r\n  }\r\n\r\n  isWorkPhoneValid = () => {\r\n    const data: GeneralInformation = this.state.data!\r\n    const value = data.WPhone ? data.WPhone.trim() : \"\"\r\n    return this.checkIsPhoneValid(value)\r\n  }\r\n  createMobilePhoneRow = () => {\r\n    const { isGov } = this.props\r\n    const data: GeneralInformation = this.state.data!\r\n    const editing = this.state.editing\r\n    if (!editing) {\r\n      return <InfoRow title=\"MOBILE PHONE\" value={FormatPhone((isGov ? data.CPhone : data.HPhone) || \"\")} />\r\n    }\r\n    const input = <PhoneNumberMaskedInput isInvalid={!this.isMobilePhoneValid()} value={(isGov ? data.CPhone : data.HPhone) || \"\"} onChange={(value: string) => this.handleMobilePhoneChange(value)} />\r\n    const result = <InfoRowWithInput title=\"MOBILE PHONE\" value={(isGov ? data.CPhone : data.HPhone) || \"\"} className=\"text-uppercase\" input={input} />\r\n    return result\r\n  }\r\n\r\n  handleMobilePhoneChange = (value: string) => {\r\n    const { isGov } = this.props\r\n    if (isGov) {\r\n      this.state.data && this.setState(prevState => {\r\n        return { data: prevState.data ? { ...prevState.data, CPhone: value } : prevState.data }\r\n      })\r\n    }\r\n    else {\r\n      this.state.data && this.setState(prevState => {\r\n        return { data: prevState.data ? { ...prevState.data, HPhone: value } : prevState.data }\r\n      })\r\n    }\r\n  }\r\n\r\n  isMobilePhoneValid = () => {\r\n    const { isGov } = this.props\r\n    const data: GeneralInformation = this.state.data!\r\n    const phone = (isGov ? data.CPhone : data.HPhone) || \"\"\r\n    const value = phone ? phone.trim() : \"\"\r\n    return this.checkIsPhoneValid(value)\r\n  }\r\n\r\n  createEmailRow = () => {\r\n    const { isGov } = this.props\r\n    const data: GeneralInformation = this.state.data!\r\n    const editing = this.state.editing\r\n    if (!editing) {\r\n      return <InfoRow title=\"EMAIL\" value={data.Email} />\r\n    }\r\n    const input = <Form.Control type=\"text\" isInvalid={!this.isEmailValid()} value={data.Email} onChange={(e: React.ChangeEvent<HTMLInputElement>) => this.handleEmailChange(e)} />\r\n    const result = <InfoRowWithInput title=\"EMAIL\" value={data.Email} className=\"text-uppercase\" input={input} />\r\n    return result\r\n  }\r\n\r\n  handleEmailChange = (event: React.ChangeEvent<HTMLInputElement>) => {\r\n    const value = event.target.value;\r\n    this.state.data && this.setState(prevState => {\r\n      return { data: prevState.data ? { ...prevState.data, Email: value } : prevState.data }\r\n    })\r\n  }\r\n\r\n  isEmailValid = () => {\r\n    const { isGov } = this.props\r\n    const data: GeneralInformation = this.state.data!\r\n    const value = data.Email ? data.Email.trim() : \"\"\r\n    return this.checkIsEmailValid(value)\r\n  }\r\n\r\n  handleInputChange = (event: React.ChangeEvent<HTMLInputElement>) => {\r\n  }\r\n\r\n  createInfoRows = () => {\r\n    const { isGov } = this.props\r\n    const data: GeneralInformation = this.state.data!\r\n    let occupationTitle: string = \"OCCUPATION\"\r\n    if (data.ImplementationAlias?.Occupation) {\r\n      occupationTitle = data.ImplementationAlias.Occupation.toUpperCase()\r\n      if (occupationTitle === \"N/A\") {\r\n        occupationTitle = \"OCCUPATION\"\r\n      }\r\n    }\r\n    const firstNameRow = this.createFirstNameRow()\r\n    const lastNameRow = this.createLastNameRow()\r\n    const employerIdRow = this.createEmployerIdRow();\r\n    const driverIdRow = this.createDriverIdRow()\r\n    const driverStateRow = this.createDriverStateRow();\r\n    const ssnRow = this.createSSNRow()\r\n    const alternateIdRow = this.createAlternateIdRow()\r\n    const companyRow = this.createCompanyRow(data.Company)\r\n    const locationRow = this.createLocationRow(data.Location)\r\n    const occupationRow = this.createOccupationRow()\r\n    const regulatoryModeRow = this.createRegulatoryModeRow()\r\n    const superVisorRow = this.createSupervisorRow()\r\n    const hireDateRow = this.createHireDateRow()\r\n    const terminationDateRow = this.createTerminationDateRow()\r\n    const preEmploymentTestOnFileRow = this.createPreEmploymentTestOnFileRow()\r\n    const managerRow = this.createManagerRow()\r\n    const activeRow = this.createInactiveRow()\r\n    const reasonForInactivation = this.createReasonForInactiveRow()\r\n    const genderRow = this.createGenderRow()\r\n    const dateOfBirthRow = this.createDateOfBirthRow()\r\n    const streeAddressRow = this.createAddress1Row()\r\n    const cityRow = this.createCityRow()\r\n    const stateRow = this.createStateRow()\r\n    const zipRow = this.createZipRow()\r\n    const workPhoneRow = this.createWorkPhoneRow()\r\n    const mobilePhoneRow = this.createMobilePhoneRow()\r\n    const emailRow = this.createEmailRow()\r\n    const result = {\r\n      firstNameRow: firstNameRow,\r\n      lastNameRow: lastNameRow,\r\n      employerIdRow: employerIdRow,\r\n      driverIdRow: driverIdRow,\r\n      driverStateRow: driverStateRow,\r\n      ssnRow: ssnRow,\r\n      alternateIdRow: alternateIdRow,\r\n      companyRow: companyRow,\r\n      occupationRow: occupationRow,\r\n      regulatoryModeRow: regulatoryModeRow,\r\n      superVisorRow: superVisorRow,\r\n      hireDateRow: hireDateRow,\r\n      terminationDateRow: terminationDateRow,\r\n      preEmploymentTestOnFileRow: preEmploymentTestOnFileRow,\r\n      managerRow: managerRow,\r\n      activeRow: activeRow,\r\n      reasonForInactivation: reasonForInactivation,\r\n      genderRow: genderRow,\r\n      dateOfBirthRow: dateOfBirthRow,\r\n      streeAddressRow: streeAddressRow,\r\n      cityRow: cityRow,\r\n      stateRow: stateRow,\r\n      zipRow: zipRow,\r\n      workPhoneRow: workPhoneRow,\r\n      mobilePhoneRow: mobilePhoneRow,\r\n      emailRow: emailRow,\r\n      locationRow: locationRow\r\n\r\n    }\r\n    return result\r\n  }\r\n\r\n  createUser1Row = () => {\r\n    const data: GeneralInformation = this.state.data!\r\n    const demographicLabels = data.ImplementationAlias\r\n    const demographicInfo = data.PersonDemographicObj\r\n    const editing = this.state.editing\r\n    const title = (demographicLabels.User1Label === \"\" || demographicLabels.User1Label === \"N/A\") ? \"USER 1\" : demographicLabels.User1Label\r\n\r\n    if (!editing) {\r\n      return <UserRow title={title} value={demographicInfo.User1} empty=\"USER 1\" />\r\n    }\r\n    if (!this.state.personDemographicObject) {\r\n      return <UserRow title={title} value={demographicInfo.User1} empty=\"USER 1\" />\r\n    }\r\n    const values = this.state.userDefinedRecords.filter(item => item['Type'] === \"UR1\")\r\n    if (values.length === 0) {\r\n      return <UserRow title={title} value={demographicInfo.User1} empty=\"USER 1\" />\r\n    }\r\n    const code = this.state.personDemographicObject.User1Code\r\n    const value = this.state.personDemographicObject.User1\r\n\r\n    const options: KeyValue[] = values.map(item => {\r\n      let rObj: KeyValue = {\r\n        Key: item['Code'],\r\n        Value: item['Description']\r\n      }\r\n      return rObj\r\n    })\r\n    const input = <div className=\"typeahead\">\r\n      <Typeahead id=\"user1\"\r\n        ref={this.user1Typeahead}\r\n        labelKey=\"Value\"\r\n        filterBy={() => true}\r\n        onChange={selected => this.handleUser1Change(selected[0] || { Key: \"\", Value: \"\" })}\r\n        options={options}\r\n        selected={code !== \"\" ? [options.find((el) => el?.Key == code) || options[0]] : []}\r\n        placeholder=\"Select\">\r\n        <Button variant=\"toggle\" onClick={() => { this.user1Typeahead && this.user1Typeahead.current && (this.user1Typeahead.current as any).toggleMenu() }}>\r\n          <FaAngleDown />\r\n        </Button>\r\n      </Typeahead>\r\n    </div>\r\n    const result = <InfoRowWithInput title={title} value={demographicInfo.User1} className=\"text-uppercase\" input={input} />\r\n    return result\r\n\r\n  }\r\n\r\n  handleUser1Change = (value: KeyValue) => {\r\n    this.state.data && this.state.personDemographicObject && this.setState(prevState => {\r\n      const data = prevState.data\r\n        ? {\r\n          ...prevState.data,\r\n          PersonDemographicObj: prevState.data?.PersonDemographicObj ? { ...prevState.data.PersonDemographicObj, User1: value.Value } : prevState.data?.PersonDemographicObj\r\n        }\r\n        : prevState.data\r\n      return {\r\n        data: data,\r\n        personDemographicObject: prevState.personDemographicObject ? { ...prevState.personDemographicObject, User1Code: value.Key, User1: value.Key } : prevState.personDemographicObject\r\n      };\r\n    })\r\n  }\r\n  isUser1Valid = () => {\r\n    return true\r\n  }\r\n\r\n  createUser2Row = () => {\r\n    const data: GeneralInformation = this.state.data!\r\n    const demographicLabels = data.ImplementationAlias\r\n    const demographicInfo = data.PersonDemographicObj\r\n    const editing = this.state.editing\r\n    const title = (demographicLabels.User2Label === \"\" || demographicLabels.User2Label === \"N/A\") ? \"USER 2\" : demographicLabels.User2Label\r\n\r\n    if (!editing) {\r\n      return <UserRow title={title} value={demographicInfo.User2} empty=\"USER 2\" />\r\n    }\r\n    if (!this.state.personDemographicObject) {\r\n      return <UserRow title={title} value={demographicInfo.User2} empty=\"USER 2\" />\r\n\r\n    }\r\n\r\n    const values = this.state.userDefinedRecords.filter(item => item['Type'] === \"UR2\")\r\n    if (values.length === 0) {\r\n      return <UserRow title={title} value={demographicInfo.User2} empty=\"USER 2\" />\r\n    }\r\n    const code = this.state.personDemographicObject.User2Code\r\n    const value = this.state.personDemographicObject.User2\r\n    const options: KeyValue[] = values.map(item => {\r\n      let rObj: KeyValue = {\r\n        Key: item['Code'],\r\n        Value: item['Description']\r\n      }\r\n      return rObj\r\n    })\r\n    const input = <div className=\"typeahead\">\r\n      <Typeahead id=\"user2\"\r\n        ref={this.user2Typeahead}\r\n        labelKey=\"Value\"\r\n        filterBy={() => true}\r\n        onChange={selected => this.handleUser2Change(selected[0] || { Key: \"\", Value: \"\" })}\r\n        options={options}\r\n        selected={code !== \"\" ? [options.find((el) => el?.Key == code) || options[0]] : []}\r\n        placeholder=\"Select\">\r\n        <Button variant=\"toggle\" onClick={() => { this.user2Typeahead && this.user2Typeahead.current && (this.user2Typeahead.current as any).toggleMenu() }}>\r\n          <FaAngleDown />\r\n        </Button>\r\n      </Typeahead>\r\n    </div>\r\n    const result = <InfoRowWithInput title={title} value={demographicInfo.User2} className=\"text-uppercase\" input={input} />\r\n    return result\r\n\r\n  }\r\n\r\n  handleUser2Change = (value: KeyValue) => {\r\n    this.state.data && this.state.personDemographicObject && this.setState(prevState => {\r\n      const data = prevState.data\r\n        ? {\r\n          ...prevState.data,\r\n          PersonDemographicObj: prevState.data?.PersonDemographicObj ? { ...prevState.data.PersonDemographicObj, User2: value.Value } : prevState.data?.PersonDemographicObj\r\n        }\r\n        : prevState.data\r\n      return {\r\n        data: data,\r\n        personDemographicObject: prevState.personDemographicObject ? { ...prevState.personDemographicObject, User2Code: value.Key, User2: value.Key } : prevState.personDemographicObject\r\n      };\r\n    })\r\n  }\r\n  isUser2Valid = () => {\r\n    return true\r\n  }\r\n  createUser3Row = () => {\r\n    const data: GeneralInformation = this.state.data!\r\n    const demographicLabels = data.ImplementationAlias\r\n    const demographicInfo = data.PersonDemographicObj\r\n    const editing = this.state.editing\r\n    const title = (demographicLabels.User3Label === \"\" || demographicLabels.User3Label === \"N/A\") ? \"USER 3\" : demographicLabels.User3Label\r\n\r\n    if (!editing) {\r\n      return <UserRow title={title} value={demographicInfo.User3} empty=\"USER 3\" />\r\n    }\r\n    if (!this.state.personDemographicObject) {\r\n      return <UserRow title={title} value={demographicInfo.User3} empty=\"USER 3\" />\r\n\r\n    }\r\n\r\n    const values = this.state.userDefinedRecords.filter(item => item['Type'] === \"UR3\")\r\n    if (values.length === 0) {\r\n      return <UserRow title={title} value={demographicInfo.User3} empty=\"USER 3\" />\r\n    }\r\n    const code = this.state.personDemographicObject.User3Code\r\n    const value = this.state.personDemographicObject.User3\r\n\r\n    const options: KeyValue[] = values.map(item => {\r\n      let rObj: KeyValue = {\r\n        Key: item['Code'],\r\n        Value: item['Description']\r\n      }\r\n      return rObj\r\n    })\r\n    const input = <div className=\"typeahead\">\r\n      <Typeahead id=\"user3\"\r\n        ref={this.user3Typeahead}\r\n        labelKey=\"Value\"\r\n        filterBy={() => true}\r\n        onChange={selected => this.handleUser3Change(selected[0] || { Key: \"\", Value: \"\" })}\r\n        options={options}\r\n        selected={code !== \"\" ? [options.find((el) => el?.Key == code) || options[0]] : []}\r\n        placeholder=\"Select\">\r\n        <Button variant=\"toggle\" onClick={() => { this.user3Typeahead && this.user3Typeahead.current && (this.user3Typeahead.current as any).toggleMenu() }}>\r\n          <FaAngleDown />\r\n        </Button>\r\n      </Typeahead>\r\n    </div>\r\n    const result = <InfoRowWithInput title={title} value={demographicInfo.User3} className=\"text-uppercase\" input={input} />\r\n    return result\r\n\r\n  }\r\n\r\n  handleUser3Change = (value: KeyValue) => {\r\n    this.state.data && this.state.personDemographicObject && this.setState(prevState => {\r\n      const data = prevState.data\r\n        ? {\r\n          ...prevState.data,\r\n          PersonDemographicObj: prevState.data?.PersonDemographicObj ? { ...prevState.data.PersonDemographicObj, User3: value.Value } : prevState.data?.PersonDemographicObj\r\n        }\r\n        : prevState.data\r\n      return {\r\n        data: data,\r\n        personDemographicObject: prevState.personDemographicObject ? { ...prevState.personDemographicObject, User3Code: value.Key, User3: value.Key } : prevState.personDemographicObject\r\n      };\r\n    })\r\n  }\r\n  isUser3Valid = () => {\r\n    return true\r\n  }\r\n\r\n  createUser4Row = () => {\r\n    const data: GeneralInformation = this.state.data!\r\n    const demographicLabels = data.ImplementationAlias\r\n    const demographicInfo = data.PersonDemographicObj\r\n    const editing = this.state.editing\r\n    const title = (demographicLabels.User4Label === \"\" || demographicLabels.User4Label === \"N/A\") ? \"USER 4\" : demographicLabels.User4Label\r\n\r\n    if (!editing) {\r\n      return <UserRow title={title} value={demographicInfo.User4} empty=\"USER 4\" />\r\n    }\r\n    if (!this.state.personDemographicObject) {\r\n      return <UserRow title={title} value={demographicInfo.User4} empty=\"USER 4\" />\r\n\r\n    }\r\n\r\n    const values = this.state.userDefinedRecords.filter(item => item['Type'] === \"UR4\")\r\n    if (values.length === 0) {\r\n      return <UserRow title={title} value={demographicInfo.User4} empty=\"USER 4\" />\r\n    }\r\n    const code = this.state.personDemographicObject.User4Code\r\n    const value = this.state.personDemographicObject.User4\r\n\r\n    const options: KeyValue[] = values.map(item => {\r\n      let rObj: KeyValue = {\r\n        Key: item['Code'],\r\n        Value: item['Description']\r\n      }\r\n      return rObj\r\n    })\r\n    const input = <div className=\"typeahead\">\r\n      <Typeahead id=\"user4\"\r\n        ref={this.user4Typeahead}\r\n        labelKey=\"Value\"\r\n        filterBy={() => true}\r\n        onChange={selected => this.handleUser4Change(selected[0] || { Key: \"\", Value: \"\" })}\r\n        options={options}\r\n        selected={code !== \"\" ? [options.find((el) => el?.Key == code) || options[0]] : []}\r\n        placeholder=\"Select\">\r\n        <Button variant=\"toggle\" onClick={() => { this.user4Typeahead && this.user4Typeahead.current && (this.user4Typeahead.current as any).toggleMenu() }}>\r\n          <FaAngleDown />\r\n        </Button>\r\n      </Typeahead>\r\n    </div>\r\n    const result = <InfoRowWithInput title={title} value={demographicInfo.User4} className=\"text-uppercase\" input={input} />\r\n    return result\r\n\r\n  }\r\n\r\n  handleUser4Change = (value: KeyValue) => {\r\n    this.state.data && this.state.personDemographicObject && this.setState(prevState => {\r\n      const data = prevState.data\r\n        ? {\r\n          ...prevState.data,\r\n          PersonDemographicObj: prevState.data?.PersonDemographicObj ? { ...prevState.data.PersonDemographicObj, User4: value.Value } : prevState.data?.PersonDemographicObj\r\n        }\r\n        : prevState.data\r\n      return {\r\n        data: data,\r\n        personDemographicObject: prevState.personDemographicObject ? { ...prevState.personDemographicObject, User4Code: value.Key, User4: value.Key } : prevState.personDemographicObject\r\n      };\r\n    })\r\n  }\r\n  isUser4Valid = () => {\r\n    return true\r\n  }\r\n  createUser5Row = () => {\r\n    const data: GeneralInformation = this.state.data!\r\n    const demographicLabels = data.ImplementationAlias\r\n    const demographicInfo = data.PersonDemographicObj\r\n    const editing = this.state.editing\r\n    const title = (demographicLabels.User5Label === \"\" || demographicLabels.User5Label === \"N/A\") ? \"USER 1\" : demographicLabels.User5Label\r\n\r\n    if (!editing) {\r\n      return <UserRow title={title} value={demographicInfo.User5} empty=\"USER 5\" />\r\n    }\r\n    if (!this.state.personDemographicObject) {\r\n      return <UserRow title={title} value={demographicInfo.User5} empty=\"USER 5\" />\r\n\r\n    }\r\n\r\n    const values = this.state.userDefinedRecords.filter(item => item['Type'] === \"UR5\")\r\n    if (values.length === 0) {\r\n      return <UserRow title={title} value={demographicInfo.User5} empty=\"USER 5\" />\r\n    }\r\n    const code = this.state.personDemographicObject.User5Code\r\n    const value = this.state.personDemographicObject.User5\r\n\r\n    const options: KeyValue[] = values.map(item => {\r\n      let rObj: KeyValue = {\r\n        Key: item['Code'],\r\n        Value: item['Description']\r\n      }\r\n      return rObj\r\n    })\r\n    const input = <div className=\"typeahead\">\r\n      <Typeahead id=\"user5\"\r\n        ref={this.user5Typeahead}\r\n        labelKey=\"Value\"\r\n        filterBy={() => true}\r\n        onChange={selected => this.handleUser5Change(selected[0] || { Key: \"\", Value: \"\" })}\r\n        options={options}\r\n        selected={code !== \"\" ? [options.find((el) => el?.Key == code) || options[0]] : []}\r\n        placeholder=\"Select\">\r\n        <Button variant=\"toggle\" onClick={() => { this.user5Typeahead && this.user5Typeahead.current && (this.user5Typeahead.current as any).toggleMenu() }}>\r\n          <FaAngleDown />\r\n        </Button>\r\n      </Typeahead>\r\n    </div>\r\n    const result = <InfoRowWithInput title={title} value={demographicInfo.User5} className=\"text-uppercase\" input={input} />\r\n    return result\r\n\r\n  }\r\n\r\n  handleUser5Change = (value: KeyValue) => {\r\n    this.state.data && this.state.personDemographicObject && this.setState(prevState => {\r\n      const data = prevState.data\r\n        ? {\r\n          ...prevState.data,\r\n          PersonDemographicObj: prevState.data?.PersonDemographicObj ? { ...prevState.data.PersonDemographicObj, User5: value.Value } : prevState.data?.PersonDemographicObj\r\n        }\r\n        : prevState.data\r\n      return {\r\n        data: data,\r\n        personDemographicObject: prevState.personDemographicObject ? { ...prevState.personDemographicObject, User5Code: value.Key, User5: value.Key } : prevState.personDemographicObject\r\n      };\r\n    })\r\n  }\r\n  isUser5Valid = () => {\r\n    return true\r\n  }\r\n  createUser6Row = () => {\r\n    const data: GeneralInformation = this.state.data!\r\n    const demographicLabels = data.ImplementationAlias\r\n    const demographicInfo = data.PersonDemographicObj\r\n    const editing = this.state.editing\r\n    const title = (demographicLabels.User6Label === \"\" || demographicLabels.User6Label === \"N/A\") ? \"USER 6\" : demographicLabels.User6Label\r\n\r\n    if (!editing) {\r\n      return <UserRow title={title} value={demographicInfo.User6} empty=\"USER 6\" />\r\n    }\r\n    if (!this.state.personDemographicObject) {\r\n      return <UserRow title={title} value={demographicInfo.User6} empty=\"USER 6\" />\r\n\r\n    }\r\n\r\n    const values = this.state.userDefinedRecords.filter(item => item['Type'] === \"UR6\")\r\n    if (values.length === 0) {\r\n      return <UserRow title={title} value={demographicInfo.User6} empty=\"USER 6\" />\r\n    }\r\n    const code = this.state.personDemographicObject.User6Code\r\n    const value = this.state.personDemographicObject.User6\r\n\r\n    const options: KeyValue[] = values.map(item => {\r\n      let rObj: KeyValue = {\r\n        Key: item['Code'],\r\n        Value: item['Description']\r\n      }\r\n      return rObj\r\n    })\r\n    const input = <div className=\"typeahead\">\r\n      <Typeahead id=\"user6\"\r\n        ref={this.user6Typeahead}\r\n        labelKey=\"Value\"\r\n        filterBy={() => true}\r\n        onChange={selected => this.handleUser6Change(selected[0] || { Key: \"\", Value: \"\" })}\r\n        options={options}\r\n        selected={code !== \"\" ? [options.find((el) => el?.Key == code) || options[0]] : []}\r\n        placeholder=\"Select\">\r\n        <Button variant=\"toggle\" onClick={() => { this.user6Typeahead && this.user6Typeahead.current && (this.user6Typeahead.current as any).toggleMenu() }}>\r\n          <FaAngleDown />\r\n        </Button>\r\n      </Typeahead>\r\n    </div>\r\n    const result = <InfoRowWithInput title={title} value={demographicInfo.User6} className=\"text-uppercase\" input={input} />\r\n    return result\r\n\r\n  }\r\n\r\n  handleUser6Change = (value: KeyValue) => {\r\n    this.state.data && this.state.personDemographicObject && this.setState(prevState => {\r\n      const data = prevState.data\r\n        ? {\r\n          ...prevState.data,\r\n          PersonDemographicObj: prevState.data?.PersonDemographicObj ? { ...prevState.data.PersonDemographicObj, User6: value.Value } : prevState.data?.PersonDemographicObj\r\n        }\r\n        : prevState.data\r\n      return {\r\n        data: data,\r\n        personDemographicObject: prevState.personDemographicObject ? { ...prevState.personDemographicObject, User6Code: value.Key, User6: value.Key } : prevState.personDemographicObject\r\n      };\r\n    })\r\n  }\r\n  isUser6Valid = () => {\r\n    return true\r\n  }\r\n  createUser7Row = () => {\r\n    const data: GeneralInformation = this.state.data!\r\n    const demographicLabels = data.ImplementationAlias\r\n    const demographicInfo = data.PersonDemographicObj\r\n    const editing = this.state.editing\r\n    const title = (demographicLabels.User7Label === \"\" || demographicLabels.User7Label === \"N/A\") ? \"USER 7\" : demographicLabels.User7Label\r\n\r\n    if (!editing) {\r\n      return <UserRow title={title} value={demographicInfo.User7} empty=\"USER 7\" />\r\n    }\r\n    if (!this.state.personDemographicObject) {\r\n      return <UserRow title={title} value={demographicInfo.User7} empty=\"USER 7\" />\r\n\r\n    }\r\n\r\n    const values = this.state.userDefinedRecords.filter(item => item['Type'] === \"UR7\")\r\n    if (values.length === 0) {\r\n      return <UserRow title={title} value={demographicInfo.User7} empty=\"USER 7\" />\r\n    }\r\n    const code = this.state.personDemographicObject.User7Code\r\n    const value = this.state.personDemographicObject.User7\r\n\r\n    const options: KeyValue[] = values.map(item => {\r\n      let rObj: KeyValue = {\r\n        Key: item['Code'],\r\n        Value: item['Description']\r\n      }\r\n      return rObj\r\n    })\r\n    const input = <div className=\"typeahead\">\r\n      <Typeahead id=\"user7\"\r\n        ref={this.user7Typeahead}\r\n        labelKey=\"Value\"\r\n        filterBy={() => true}\r\n        onChange={selected => this.handleUser7Change(selected[0] || { Key: \"\", Value: \"\" })}\r\n        options={options}\r\n        selected={code !== \"\" ? [options.find((el) => el?.Key == code) || options[0]] : []}\r\n        placeholder=\"Select\">\r\n        <Button variant=\"toggle\" onClick={() => { this.user7Typeahead && this.user7Typeahead.current && (this.user7Typeahead.current as any).toggleMenu() }}>\r\n          <FaAngleDown />\r\n        </Button>\r\n      </Typeahead>\r\n    </div>\r\n    const result = <InfoRowWithInput title={title} value={demographicInfo.User7} className=\"text-uppercase\" input={input} />\r\n    return result\r\n\r\n  }\r\n\r\n  handleUser7Change = (value: KeyValue) => {\r\n    this.state.data && this.state.personDemographicObject && this.setState(prevState => {\r\n      const data = prevState.data\r\n        ? {\r\n          ...prevState.data,\r\n          PersonDemographicObj: prevState.data?.PersonDemographicObj ? { ...prevState.data.PersonDemographicObj, User7: value.Value } : prevState.data?.PersonDemographicObj\r\n        }\r\n        : prevState.data\r\n      return {\r\n        data: data,\r\n        personDemographicObject: prevState.personDemographicObject ? { ...prevState.personDemographicObject, User7Code: value.Key, User7: value.Key } : prevState.personDemographicObject\r\n      };\r\n    })\r\n  }\r\n  isUser7Valid = () => {\r\n    return true\r\n  }\r\n\r\n  createUser8Row = () => {\r\n    const data: GeneralInformation = this.state.data!\r\n    const demographicLabels = data.ImplementationAlias\r\n    const demographicInfo = data.PersonDemographicObj\r\n    const editing = this.state.editing\r\n    const title = (demographicLabels.User8Label === \"\" || demographicLabels.User8Label === \"N/A\") ? \"USER 8\" : demographicLabels.User8Label\r\n\r\n    if (!editing) {\r\n      return <UserRow title={title} value={demographicInfo.User8} empty=\"USER 8\" />\r\n    }\r\n    if (!this.state.personDemographicObject) {\r\n      return <UserRow title={title} value={demographicInfo.User8} empty=\"USER 8\" />\r\n\r\n    }\r\n\r\n    const values = this.state.userDefinedRecords.filter(item => item['Type'] === \"UR8\")\r\n    if (values.length === 0) {\r\n      return <UserRow title={title} value={demographicInfo.User8} empty=\"USER 8\" />\r\n    }\r\n    const code = this.state.personDemographicObject.User8Code\r\n    const value = this.state.personDemographicObject.User8\r\n\r\n    const options: KeyValue[] = values.map(item => {\r\n      let rObj: KeyValue = {\r\n        Key: item['Code'],\r\n        Value: item['Description']\r\n      }\r\n      return rObj\r\n    })\r\n    const input = <div className=\"typeahead\">\r\n      <Typeahead id=\"user8\"\r\n        ref={this.user8Typeahead}\r\n        labelKey=\"Value\"\r\n        filterBy={() => true}\r\n        onChange={selected => this.handleUser8Change(selected[0] || { Key: \"\", Value: \"\" })}\r\n        options={options}\r\n        selected={code !== \"\" ? [options.find((el) => el?.Key == code) || options[0]] : []}\r\n        placeholder=\"Select\">\r\n        <Button variant=\"toggle\" onClick={() => { this.user8Typeahead && this.user8Typeahead.current && (this.user8Typeahead.current as any).toggleMenu() }}>\r\n          <FaAngleDown />\r\n        </Button>\r\n      </Typeahead>\r\n    </div>\r\n    const result = <InfoRowWithInput title={title} value={demographicInfo.User8} className=\"text-uppercase\" input={input} />\r\n    return result\r\n\r\n  }\r\n\r\n  handleUser8Change = (value: KeyValue) => {\r\n    this.state.data && this.state.personDemographicObject && this.setState(prevState => {\r\n      const data = prevState.data\r\n        ? {\r\n          ...prevState.data,\r\n          PersonDemographicObj: prevState.data?.PersonDemographicObj ? { ...prevState.data.PersonDemographicObj, User8: value.Value } : prevState.data?.PersonDemographicObj\r\n        }\r\n        : prevState.data\r\n      return {\r\n        data: data,\r\n        personDemographicObject: prevState.personDemographicObject ? { ...prevState.personDemographicObject, User8Code: value.Key, User8: value.Key } : prevState.personDemographicObject\r\n      };\r\n    })\r\n  }\r\n  isUser8Valid = () => {\r\n    return true\r\n  }\r\n\r\n  createUser9TextRow = () => {\r\n    const data: GeneralInformation = this.state.data!\r\n    const demographicLabels = data.ImplementationAlias\r\n    const demographicInfo = data.PersonDemographicObj\r\n    const editing = this.state.editing\r\n    const title = (demographicLabels.User9Label === \"\" || demographicLabels.User9Label === \"N/A\") ? \"USER 9\" : demographicLabels.User9Label\r\n\r\n    if (!editing) {\r\n      return <UserRow title={title} value={demographicInfo.User9} empty=\"USER 9\" />\r\n    }\r\n\r\n    const input = <Form.Control type=\"text\" isInvalid={!this.isUser9TextValid()} value={demographicInfo.User9 || \"\"} onChange={(e: React.ChangeEvent<HTMLInputElement>) => this.handleUser9TextChange(e)} />\r\n    const result = <InfoRowWithInput title={title} value={demographicInfo.User9} className=\"text-uppercase\" input={input} />\r\n    return result\r\n  }\r\n\r\n  handleUser9TextChange = (event: React.ChangeEvent<HTMLInputElement>) => {\r\n    const value = event.target.value\r\n    this.state.data && this.state.personDemographicObject && this.setState(prevState => {\r\n      const data = prevState.data\r\n        ? {\r\n          ...prevState.data,\r\n          PersonDemographicObj: prevState.data?.PersonDemographicObj ? { ...prevState.data.PersonDemographicObj, User9: value } : prevState.data?.PersonDemographicObj\r\n        }\r\n        : prevState.data\r\n      return {\r\n        data: data,\r\n        personDemographicObject: prevState.personDemographicObject ? { ...prevState.personDemographicObject, User9: value } : prevState.personDemographicObject\r\n      };\r\n    })\r\n  }\r\n\r\n  isUser9TextValid = () => {\r\n    return true\r\n  }\r\n\r\n  createUser10TextRow = () => {\r\n    const data: GeneralInformation = this.state.data!\r\n    const demographicLabels = data.ImplementationAlias\r\n    const demographicInfo = data.PersonDemographicObj\r\n    const editing = this.state.editing\r\n    const title = (demographicLabels.User10Label === \"\" || demographicLabels.User10Label === \"N/A\") ? \"USER 10\" : demographicLabels.User10Label\r\n\r\n    if (!editing) {\r\n      return <UserRow title={title} value={demographicInfo.User10} empty=\"USER 10\" />\r\n    }\r\n    const input = <Form.Control type=\"text\" isInvalid={!this.isUser10TextValid()} value={demographicInfo.User10 || \"\"} onChange={(e: React.ChangeEvent<HTMLInputElement>) => this.handleUser10TextChange(e)} />\r\n    const result = <InfoRowWithInput title={title} value={demographicInfo.User10} className=\"text-uppercase\" input={input} />\r\n    return result\r\n  }\r\n\r\n  handleUser10TextChange = (event: React.ChangeEvent<HTMLInputElement>) => {\r\n    const value = event.target.value\r\n    this.state.data && this.state.personDemographicObject && this.setState(prevState => {\r\n      const data = prevState.data\r\n        ? {\r\n          ...prevState.data,\r\n          PersonDemographicObj: prevState.data?.PersonDemographicObj ? { ...prevState.data.PersonDemographicObj, User10: value } : prevState.data?.PersonDemographicObj\r\n        }\r\n        : prevState.data\r\n      return {\r\n        data: data,\r\n        personDemographicObject: prevState.personDemographicObject ? { ...prevState.personDemographicObject, User10: value } : prevState.personDemographicObject\r\n      };\r\n    })\r\n  }\r\n\r\n  isUser10TextValid = () => {\r\n    return true\r\n  }\r\n\r\n  isCompanyValid = () =>{\r\n    return this.state.isCompaniesLoading || !!this.state.selectedCompany\r\n  }\r\n\r\n  isValid = () => {\r\n    const { editing } = this.state\r\n    return editing && this.isSSNValid() &&  this.isCompanyValid()\r\n  }\r\n  createUserRows = () => {\r\n    const data: GeneralInformation = this.state.data!\r\n    const demographicLabels = data.ImplementationAlias\r\n    const demographicInfo = data.PersonDemographicObj\r\n    const userRow1 = this.createUser1Row()\r\n    const userRow2 = this.createUser2Row()\r\n    const userRow3 = this.createUser3Row()\r\n    const userRow4 = this.createUser4Row()\r\n    const userRow5 = this.createUser5Row()\r\n    const userRow6 = this.createUser6Row()\r\n    const userRow7 = this.createUser7Row()\r\n    const userRow8 = this.createUser8Row()\r\n    const userRow9 = this.createUser9TextRow()\r\n    const userRow10 = this.createUser10TextRow()\r\n    const result = {\r\n      userRow1: userRow1,\r\n      userRow2: userRow2,\r\n      userRow3: userRow3,\r\n      userRow4: userRow4,\r\n      userRow5: userRow5,\r\n      userRow6: userRow6,\r\n      userRow7: userRow7,\r\n      userRow8: userRow8,\r\n      userRow9: userRow9,\r\n      userRow10: userRow10\r\n\r\n    }\r\n    return result\r\n  }\r\n\r\n  render() {\r\n    const { isGov } = this.props\r\n    if (!this.state.data) {\r\n      return this.state.isGeneralInfoLoading ? <Spinner animation=\"border\" size=\"sm\" /> : <></>\r\n    }\r\n    const companyAdminOfAnotherCompany = this.props.isCompanyAdmin && this.props.companyID !== this.state.data.CompanyID\r\n    const canEdit = !companyAdminOfAnotherCompany && (this.props.userPermissions?.canEditPersonnel || this.props.userPermissions?.CanManageConsortiumPools ? true : false)\r\n    const editing = this.state.editing\r\n\r\n    const infoRows = this.createInfoRows();\r\n    const userRows = this.createUserRows();\r\n\r\n\r\n    return (\r\n      <Container className=\"general-info px-4 pb-4 pt-3\">\r\n        <EmployeeRegModeModal show={this.state.showEmployeeRegModes}\r\n          selectedRegulatoryModes={this.state.data.RegModCatList}\r\n          accountType=\"\"\r\n          onClose={() => this.handleRegulatoryModeClose()}\r\n          onSave={(items: RegMode[]) => this.handleRegulatoryModeSave(items)} />\r\n        {this.state.showSupervisors && <SupervisorsModal\r\n          Supervisor1={this.state.data.Supervisor1Data}\r\n          Supervisor2={this.state.data.Supervisor2Data}\r\n          onClose={() => this.handleSupervisorsClose()}\r\n          onSave={(items: Supervisor[]) => this.handleSupervisorsSave(items)} />}\r\n        <Row>\r\n          <Col xs={12} lg={6}>\r\n            <HeaderRow title=\"EMPLOYMENT INFO\" />\r\n            {infoRows.firstNameRow}\r\n            {infoRows.lastNameRow}\r\n            {infoRows.employerIdRow}\r\n            {!isGov && <React.Fragment>\r\n              {infoRows.driverIdRow}\r\n              {this.showDriverState() && infoRows.driverStateRow}\r\n              {infoRows.ssnRow}\r\n              {infoRows.alternateIdRow}\r\n            </React.Fragment>}\r\n            {isGov && infoRows.companyRow}\r\n            {!isGov && <React.Fragment>\r\n              {infoRows.occupationRow}\r\n              {infoRows.regulatoryModeRow}\r\n              {infoRows.superVisorRow}\r\n              {infoRows.hireDateRow}\r\n              {infoRows.terminationDateRow}\r\n              {infoRows.preEmploymentTestOnFileRow}\r\n              {infoRows.managerRow}\r\n            </React.Fragment>}\r\n            {infoRows.activeRow}\r\n            {this.state.data.Inactive && infoRows.reasonForInactivation}\r\n            <HeaderRow title=\"GENERAL\" />\r\n            {infoRows.genderRow}\r\n            {infoRows.dateOfBirthRow}\r\n            <HeaderRow title=\"CONTACT INFO\" />\r\n            {infoRows.streeAddressRow}\r\n            {infoRows.cityRow}\r\n            {infoRows.stateRow}\r\n            {infoRows.zipRow}\r\n            {infoRows.workPhoneRow}\r\n            {infoRows.mobilePhoneRow}\r\n            {infoRows.emailRow}\r\n          </Col>\r\n          {!isGov && <React.Fragment>\r\n            <Col xs={12} lg={6}>\r\n              <HeaderRowWithSwitchMode title=\"DEMOGRAPHICS\" showEditButton={canEdit} editing={editing} handleToggleEditMode={this.handleToggleEditMode} />\r\n              {infoRows.companyRow}\r\n              {infoRows.locationRow}\r\n              {userRows.userRow1}\r\n              {userRows.userRow2}\r\n              {userRows.userRow3}\r\n              {userRows.userRow4}\r\n              {userRows.userRow5}\r\n              {userRows.userRow6}\r\n              {userRows.userRow7}\r\n              {userRows.userRow8}\r\n              {userRows.userRow9}\r\n              {userRows.userRow10}\r\n            </Col>\r\n          </React.Fragment>}\r\n        </Row>\r\n        <Row className=\"buttons-block\" hidden={!this.state.editing}>\r\n          <Button variant=\"secondary\" onClick={this.handleToggleEditMode}>CANCEL</Button>\r\n          <ActionButton variant=\"primary\" onClick={this.handleSubmit} spin={this.state.saving} disabled={!this.isValid()} disableOnSpin>SAVE</ActionButton>\r\n        </Row>\r\n\r\n      </Container>\r\n    )\r\n  }\r\n\r\n}\r\n\r\nfunction mapStateToProps(state: AppState): GeneralInfoAuthProps {\r\n  const userAccess = BuildUserAccess(state)\r\n  const selectedCompany = GetSelectedAssignedClinic(state)\r\n  return {\r\n    userPermissions: userAccess,\r\n    isPortalAdmin: isPortalAdmin(state),\r\n    isCompanyAdmin: isCompanyAdmin(state),\r\n    companyID: selectedCompany?.AccountID || 0,\r\n  }\r\n}\r\nconst ConnectedGeneralInfo = connect(mapStateToProps)(GeneralInfo)\r\nexport default ConnectedGeneralInfo\r\n","enum PhoneType {\r\n  Work = \"WorkPhone\",\r\n  Cell = \"CellPhone\",\r\n  Home = \"HomePhone\",\r\n}\r\n\r\nexport interface PhoneNumber {\r\n  number: string\r\n  isRequired: boolean\r\n}\r\n\r\nexport default PhoneType\r\n","import { AccountTypeID } from \"../../config/Constants\"\r\nimport { ObservableFromFetch } from \"../ObservableFromFetch\"\r\nimport PhoneType from \"../PhoneType\"\r\nimport ServiceDetails from \"./OrderResultModel/ServiceDetails\"\r\nimport TestEventUpdateData from \"./OrderResultModel/TestEventUpdateData\"\r\n\r\ninterface CurrentServiceDetailsParams {\r\n  AccountTypeID?: number\r\n  TestDetailClinicalID?: string\r\n  TestDetailID?: string\r\n  CompareMode?:boolean\r\n}\r\n\r\nfunction requestParams(options: CurrentServiceDetailsParams) {\r\n  return JSON.stringify({\r\n    AccountTypeID: AccountTypeID,\r\n    TestDetailClinicalID: options.TestDetailClinicalID,\r\n    TestDetailID: options.TestDetailID,\r\n    CompareMode:false\r\n  })\r\n}\r\nfunction requestParamsForCompare(options: CurrentServiceDetailsParams) {\r\n  return JSON.stringify({\r\n    AccountTypeID: AccountTypeID,\r\n    TestDetailClinicalID: options.TestDetailClinicalID,\r\n    TestDetailID: options.TestDetailID,\r\n    CompareMode:true\r\n  })\r\n}\r\n\r\nexport const CurrentServiceDetails = (params: CurrentServiceDetailsParams) => ObservableFromFetch<ServiceDetails>(\"WorkforceTrack/GetCurrentServiceDetail\", requestParams(params))\r\nexport const CurrentServiceDetailsForCompare = (params: CurrentServiceDetailsParams) => ObservableFromFetch<ServiceDetails>(\"WorkforceTrack/GetCurrentServiceDetail\", requestParamsForCompare(params))\r\n\r\nexport const UpdateServiceData = (params: TestEventUpdateData) => {\r\n  const requestBody = JSON.stringify({\r\n    TestEventID: params.TestEventID,\r\n    FormFoxTestAN: params.FormFoxTestAN,\r\n    PersonnelID: params.PersonnelID,\r\n    IDType: params.IDType,\r\n    FirstName: params.FirstName,\r\n    LastName: params.LastName,\r\n    HomePhone: params.Phones[PhoneType.Home].number,\r\n    WorkPhone: params.Phones[PhoneType.Work].number,\r\n    CellPhone: params.Phones[PhoneType.Cell].number,\r\n    RegulatoryModeID: params.RegulatoryModeID,\r\n    EmployeeCategoryID: params.EmployeeCategoryID,\r\n  })\r\n  return ObservableFromFetch<string>(\"WorkforceTrack/UpdateCurrentServiceDetail\", requestBody)\r\n}\r\n\r\ninterface ResolveAlertData{\r\n  TestEventAlertID: string\r\n}\r\n\r\nexport const ResolveAlert = (params: ResolveAlertData) => {\r\n  const requestBody = JSON.stringify({\r\n    TestEventAlertID: params.TestEventAlertID\r\n  })\r\n  return ObservableFromFetch<string>(\"WorkforceTrack/ResolveAlert\", requestBody)\r\n}\r\n","import React from \"react\"\r\nimport { Accordion, Card } from \"react-bootstrap\"\r\n\r\ninterface AccordionCardProps {\r\n  eventKey: string\r\n  title: JSX.Element | string\r\n  children?: React.ReactNode\r\n}\r\nexport default function AccordionCard(props: AccordionCardProps) {\r\n  return (\r\n    <Card>\r\n      <Accordion.Toggle as={Card.Header} eventKey={props.eventKey} className=\"test-property\">{props.title}</Accordion.Toggle>\r\n      <Accordion.Collapse eventKey={props.eventKey}>\r\n        <Card.Body>\r\n          {props.children}\r\n        </Card.Body>\r\n      </Accordion.Collapse>\r\n    </Card>\r\n  )\r\n}\r\n","export default function FormatTime(date: Date | string | null | undefined, delimiter: string = \":\"): string {\r\n  if (date) {\r\n    if (typeof date === \"string\") {\r\n      if (!isNaN(Date.parse(date))) {\r\n        date = new Date(date)\r\n      }\r\n    }\r\n    if (date instanceof Date) {\r\n      return [\r\n        (\"0\" + date.getHours()).slice(-2),\r\n        (\"0\" + date.getMinutes()).slice(-2)\r\n      ].join(delimiter)\r\n    }\r\n  }\r\n  return \"\"\r\n}\r\n","import React, { ReactNode } from \"react\"\r\nimport { Col, Row } from \"react-bootstrap\"\r\nimport FormatDate from \"../../../../formatters/FormatDate\"\r\nimport FormatTime from \"../../../../formatters/FormatTime\"\r\n\r\ninterface BreakpointNumbers {\r\n  xs?: number\r\n  sm?: number\r\n  md?: number\r\n  lg?: number\r\n  xl?: number\r\n}\r\n\r\ninterface CardRowProps {\r\n  title: string\r\n  value?: any\r\n  date?: boolean\r\n  time?: boolean\r\n  bool?: boolean\r\n  titleBreakpoints?: BreakpointNumbers\r\n  valueBreakpoints?: BreakpointNumbers\r\n  children?: ReactNode\r\n}\r\nexport default function CardRow(props: CardRowProps) {\r\n  const { title, value, date, time, bool, titleBreakpoints: titleBr, valueBreakpoints: valueBr, children } = props\r\n  const titleXs = titleBr?.xs || 6\r\n  const titleMd = titleBr?.md || 4\r\n  const valueXs = valueBr?.xs || 6\r\n  const valueMd = valueBr?.md || 8\r\n  return (\r\n    <Row className=\"p-1\">\r\n      <Col xs={titleXs} sm={titleBr?.sm} md={titleMd} lg={titleBr?.lg} xl={titleBr?.xl} className=\"test-property\">{title}</Col>\r\n      <Col xs={valueXs} sm={valueBr?.sm} md={valueMd} lg={valueBr?.lg} xl={valueBr?.xl} className=\"status-text\">\r\n        {date ? FormatDate(value) : time ? FormatTime(value) : bool ? (value ? \"Yes\" : \"No\") : value}\r\n        {children}\r\n      </Col>\r\n    </Row>\r\n  )\r\n}\r\n","export default interface ExcuseReason {\r\n  Code: string,\r\n  Description: string\r\n}\r\nexport const ALT_LOA_CODE = 'ALT_LOA'\r\nexport const ALT_TERM_CODE = 'ALT_TERM'\r\nexport const ALT_OTHER_CODE = 'ALT_OTHER'\r\n\r\nexport const AlternateExcuseReasons: ExcuseReason[] = [\r\n  { Code: ALT_LOA_CODE, Description: \"LOA until end of Period\" },\r\n  { Code: ALT_TERM_CODE, Description: \"Terminated\" },\r\n  { Code: ALT_OTHER_CODE, Description: \"Unavailable to Test/Other\" }\r\n]\r\n\r\nexport function IsAltOtherExcuseReason(code: string) {\r\n  if (!code) {\r\n    return false\r\n  }\r\n  if (code === ALT_OTHER_CODE) {\r\n    return true\r\n  }\r\n  return false\r\n}\r\n\r\nexport function AltReasonDescriptionByCode(code: string): string{\r\n  if(!code){\r\n    return \"\"\r\n  }\r\n const ind = AlternateExcuseReasons.findIndex(item => item.Code === code);\r\n if(ind < 0){\r\n  return \"\"\r\n }\r\n return AlternateExcuseReasons[ind].Description\r\n}\r\n\r\n","import React from \"react\"\r\nimport { Col, Container, Row, Form } from \"react-bootstrap\"\r\nimport AccordionCard from \"./AccordionCard\"\r\nimport TestCardProps from \"./TestCardProps\"\r\nimport CardRow from \"./CardRow\"\r\nimport { EventData } from \"../../../../api/OrderResults/OrderResultModel/ServiceDetails\"\r\nimport FormatDate from \"../../../../formatters/FormatDate\"\r\nimport { AltReasonDescriptionByCode, IsAltOtherExcuseReason } from \"../../../../api/Randoms/RandomsModel/ExcuseReason\"\r\n\r\ntype SchedulingResult = {\r\n  schedulingStatus: string,\r\n  schedulingDate: string | null,\r\n}\r\nfunction getSchedulingData(data: EventData): SchedulingResult {\r\n  let result: SchedulingResult = { schedulingStatus: \"\", schedulingDate: \"\" }\r\n  if (data.DateScheduled) {\r\n    result.schedulingStatus = data.ScheduleStatusDescription\r\n    result.schedulingDate = FormatDate(data.DateScheduled)\r\n  } else if (data.DateNotified) {\r\n    result.schedulingStatus = \"Notified\"\r\n    result.schedulingDate = FormatDate(data.DateNotified)\r\n  } else if (data.DateOrdered) {\r\n    result.schedulingStatus = \"Created\"\r\n    result.schedulingDate = FormatDate(data.DateOrdered)\r\n  }\r\n  return result\r\n}\r\n\r\nexport default function CollectionCard(props: TestCardProps) {\r\n  const data = props.data.EventData\r\n  const schedulingResult = getSchedulingData(data)\r\n  const schedulingNotes = data.SchedulingNotes || \"\"\r\n  const excuseReasonCode = data.ExcuseReasonCode || \"\"\r\n  const excuseReasonText = AltReasonDescriptionByCode(excuseReasonCode)\r\n  const excuseComment = data.ExcuseComment || \"\"\r\n  const isAltOtherExcuseReason = IsAltOtherExcuseReason(excuseReasonCode)\r\n  const showSchedulingNotes = schedulingNotes.trim().length > 0\r\n  const showExcuseReason = excuseReasonCode.startsWith(\"ALT_\")\r\n  const showExcuseComment = isAltOtherExcuseReason && excuseComment.trim().length > 0\r\n\r\n  const title = <Row>\r\n    <Col xs={5} sm={3} className=\"test-property\">SCHEDULING</Col>\r\n    <Col xs={3} sm={5} className=\"status-text\">{schedulingResult.schedulingStatus}</Col>\r\n    <Col xs={4} sm={4} className=\"status-text\">{schedulingResult.schedulingDate}</Col>\r\n  </Row>\r\n  return (\r\n    <AccordionCard eventKey=\"scheduling\" title={title}>\r\n      <Container fluid>\r\n        <Row>\r\n          <Col lg={6} className=\"pl-0\">\r\n            <CardRow titleBreakpoints={{ md: 8 }} valueBreakpoints={{ md: 4 }} title=\"ORDERED BY\" />\r\n            <CardRow titleBreakpoints={{ md: 8 }} valueBreakpoints={{ md: 4 }} title=\"CREATED DATE\" value={data.DateOrdered} date />\r\n            <CardRow titleBreakpoints={{ md: 8 }} valueBreakpoints={{ md: 4 }} title=\"CREATED TIME\" value={data.DateOrdered} time />\r\n            <CardRow titleBreakpoints={{ md: 8 }} valueBreakpoints={{ md: 4 }} title=\"NOTIFIED DATE\" value={data.DateNotified} date />\r\n            <CardRow titleBreakpoints={{ md: 8 }} valueBreakpoints={{ md: 4 }} title=\"NOTIFIED TIME\" value={data.DateNotified} time />\r\n            <CardRow titleBreakpoints={{ md: 8 }} valueBreakpoints={{ md: 4 }} title=\"SCHEDULED DATE\" value={data.DateScheduled} date />\r\n            <CardRow titleBreakpoints={{ md: 8 }} valueBreakpoints={{ md: 4 }} title=\"SCHEDULED TIME\" value={data.DateScheduled} time />\r\n          </Col>\r\n          {(showSchedulingNotes || showExcuseReason || showExcuseComment) && <Col lg={6} className=\"px-0\">\r\n            <Form.Row>\r\n              {showSchedulingNotes &&\r\n                <Form.Control\r\n                  as=\"textarea\"\r\n                  rows={3}\r\n                  disabled={true}\r\n                  className=\"bg-white h-100\"\r\n                  value={schedulingNotes} />}\r\n              {showExcuseReason && <Form.Label>{excuseReasonText}</Form.Label>}\r\n              {showExcuseComment &&\r\n                <Form.Control\r\n                  as=\"textarea\"\r\n                  rows={3}\r\n                  disabled={true}\r\n                  className=\"bg-white h-100\"\r\n                  value={excuseComment} />}\r\n            </Form.Row>\r\n          </Col>}\r\n        </Row>\r\n      </Container>\r\n    </AccordionCard>\r\n  )\r\n}\r\n","import React from \"react\"\r\nimport { Col, Row } from \"react-bootstrap\"\r\nimport AccordionCard from \"./AccordionCard\"\r\nimport TestCardProps from \"./TestCardProps\"\r\nimport CardRow from \"./CardRow\"\r\nimport FormatDate from \"../../../../formatters/FormatDate\"\r\n\r\nexport default function CollectionCard(props: TestCardProps) {\r\n  const { data } = props\r\n  const title = <Row>\r\n    <Col xs={5} sm={3}>COLLECTION</Col>\r\n    <Col xs={3} sm={5}>{data.DateCollected ? data.CollectionStatusDescription : \"\"}</Col>\r\n    <Col xs={4} sm={4}>{data.DateCollected ? FormatDate(data.DateCollected) : \"\"}</Col>\r\n  </Row>\r\n  return (\r\n    <AccordionCard eventKey=\"collection\" title={title}>\r\n      <CardRow title=\"SITE\" value={data.CollectorVendorName}/>\r\n      <CardRow title=\"COLLECTOR\" value={data.CollectedBy}/>\r\n      <CardRow title=\"SPECIMEN/REFERENCE ID\" value={data.SampleID}/>\r\n      <CardRow title=\"SPLIT SPECIMEN\" value={data.SplitSpecimen} bool/>\r\n      <CardRow title=\"ARRIVED DATE\" value={data.DateArrived} date/>\r\n      <CardRow title=\"ARRIVED TIME\" value={data.DateArrived} time/>\r\n      <CardRow title=\"COLLECTED DATE\" value={data.DateCollected} date/>\r\n      <CardRow title=\"COLLECTED TIME\" value={data.DateCollected} time/>\r\n    </AccordionCard>\r\n  )\r\n}\r\n","import React from \"react\"\r\nimport { Col, Row } from \"react-bootstrap\"\r\nimport FormatDate from \"../../../../formatters/FormatDate\"\r\nimport AccordionCard from \"./AccordionCard\"\r\nimport CardRow from \"./CardRow\"\r\nimport TestCardProps from \"./TestCardProps\"\r\n\r\nexport default function ExamDetailCard(props: TestCardProps) {\r\n  const { data } = props\r\n  const title = <Row>\r\n    <Col xs={5} sm={3}>EXAM DETAIL</Col>\r\n    <Col xs={3} sm={5}>{data.DateCollected ? data.CollectionStatusDescription : \"\"}</Col>\r\n    <Col xs={4} sm={4}>{data.DateCollected ? FormatDate(data.DateCollected) : \"\"}</Col>\r\n  </Row>\r\n  return (\r\n    <AccordionCard eventKey=\"examDetail\" title={title}>\r\n      <CardRow title=\"SITE\" value={data.CollectorVendorName}/>\r\n      <CardRow title=\"HEALTH HISTORY COMPLETE DATE\" />\r\n      <CardRow title=\"EXAMINER\" value={data.TestDetailPhysicals.Examiner}/>\r\n      <CardRow title=\"ARRIVED DATE\" value={data.DateArrived} date/>\r\n      <CardRow title=\"ARRIVED TIME\" value={data.DateArrived} time/>\r\n      <CardRow title=\"EXAM DATE\" value={data.DateCollected} date/>\r\n      <CardRow title=\"EXAM TIME\" value={data.DateCollected} time/>\r\n    </AccordionCard>\r\n  )\r\n}\r\n","import React from \"react\"\r\nimport { Col, Row } from \"react-bootstrap\"\r\nimport FormatDate from \"../../../../formatters/FormatDate\"\r\nimport AccordionCard from \"./AccordionCard\"\r\nimport CardRow from \"./CardRow\"\r\nimport TestCardProps from \"./TestCardProps\"\r\n\r\nexport default function ExamResultDetailCard(props: TestCardProps) {\r\n  const { data } = props\r\n  const title = <Row>\r\n    <Col xs={5} sm={3}>EXAM RESULT DETAIL</Col>\r\n    <Col xs={3} sm={5}>{data.DateCollected ? data.CollectionStatusDescription : \"\"}</Col>\r\n    <Col xs={4} sm={4}>{data.DateCollected ? FormatDate(data.DateCollected) : \"\"}</Col>\r\n  </Row>\r\n  return (\r\n    <AccordionCard eventKey=\"examResultDetail\" title={title}>\r\n      <CardRow title=\"CERTIFICATION\" value={data.TestDetailPhysicals.ExamResult}/>\r\n      <CardRow title=\"EXPIRATION DATE\" value={data.TestDetailPhysicals.ExpirationDate}/>\r\n    </AccordionCard>\r\n  )\r\n}\r\n","import React from \"react\"\r\nimport { Col, Row } from \"react-bootstrap\"\r\nimport AccordionCard from \"./AccordionCard\"\r\nimport CardRow from \"./CardRow\"\r\nimport FormatDate from \"../../../../formatters/FormatDate\"\r\nimport TestCardProps from \"./TestCardProps\"\r\n\r\nexport default function BATAlcoholTestCard(props: TestCardProps) {\r\n  const { data } = props\r\n  const title = <Row>\r\n    <Col xs={5} sm={3}>BREATH ALCOHOL TEST (BAT) COLLECTION DETAIL</Col>\r\n    <Col xs={3} sm={5}>{data.DateCollected ? data.CollectionStatusDescription : \"\"}</Col>\r\n    <Col xs={4} sm={4}>{data.DateCollected ? FormatDate(data.DateCollected) : \"\"}</Col>\r\n  </Row>\r\n  return (\r\n    <AccordionCard eventKey=\"BATAlcoholTest\" title={title}>\r\n      <CardRow title=\"SITE\" value={data.CollectorVendorName}/>\r\n      <CardRow title=\"BAT TECHNICIAN\" value={data.CollectedBy}/>\r\n      <CardRow title=\"ARRIVED DATE\" value={data.DateArrived} date/>\r\n      <CardRow title=\"ARRIVED TIME\" value={data.DateArrived} time/>\r\n      <CardRow title=\"EXAM DATE\" value={data.DateCollected} date/>\r\n      <CardRow title=\"EXAM TIME\" value={data.DateCollected} time/>\r\n    </AccordionCard>\r\n  )\r\n}\r\n","import React from \"react\"\r\nimport { Col, Row, Table } from \"react-bootstrap\"\r\nimport FormatDate from \"../../../../formatters/FormatDate\"\r\nimport AccordionCard from \"./AccordionCard\"\r\nimport TestCardProps from \"./TestCardProps\"\r\n\r\nexport default function BATResultCard(props: TestCardProps) {\r\n  const { data } = props\r\n  const showConfirm = data.ConfirmLevel > 0.02\r\n  const title = <Row>\r\n    <Col xs={5} sm={3}>BAT RESULT DETAIL</Col>\r\n    <Col xs={3} sm={5}>{data.DateCollected ? data.CollectionStatusDescription : \"\"}</Col>\r\n    <Col xs={4} sm={4}>{data.DateCollected ? FormatDate(data.DateCollected) : \"\"}</Col>\r\n  </Row>\r\n  return (\r\n    <AccordionCard eventKey=\"BATResultDetail\" title={title}>\r\n      <Table bordered className=\"bat-table\">\r\n        <thead>\r\n            <tr>\r\n                <th scope=\"col\" className=\"col-md-3\">INITIAL SCREENING</th>\r\n                <th scope=\"col\" className=\"col-md-3\"></th>\r\n                {showConfirm && <th scope=\"col\" className=\"col-md-3\">CONFIRMATION SCREENING</th>}\r\n                {showConfirm && <th scope=\"col\" className=\"col-md-3\"></th>}\r\n            </tr>\r\n        </thead>\r\n        <tbody>\r\n          <tr>\r\n              <td>DEVICE NAME</td>\r\n              <td>{data.ScreenDeviceDescription}</td>\r\n              {showConfirm && <td>DEVICE NAME</td>}\r\n              {showConfirm && <td>{data.ConfirmDeviceDescription}</td>}\r\n          </tr>\r\n          <tr>\r\n              <td>DEVICE SERIAL NUMBER</td>\r\n              <td>{data.ScreenDeviceSerialNumber}</td>\r\n              {showConfirm && <td>DEVICE SERIAL NUMBER</td>}\r\n              {showConfirm && <td>{data.ConfirmDeviceSerialNumber}</td>}\r\n          </tr>\r\n          <tr>\r\n              <td>TEST NUMBER</td>\r\n              <td>{data.ScreenSequence}</td>\r\n              {showConfirm && <td>TEST NUMBER</td>}\r\n              {showConfirm && <td>{data.ConfirmSequence}</td>}\r\n          </tr>\r\n          <tr>\r\n              <td>SCREENING-LEVEL</td>\r\n              <td>{data.ScreenLevel}</td>\r\n              {showConfirm && <td>SCREENING-LEVEL</td>}\r\n              {showConfirm && <td>{data.ConfirmLevel}</td>}\r\n          </tr>\r\n        </tbody>\r\n      </Table>\r\n    </AccordionCard>\r\n  )\r\n}\r\n","import React from \"react\"\r\nimport { Col, Row } from \"react-bootstrap\"\r\nimport CardRow from \"./CardRow\"\r\nimport TestCardProps from \"./TestCardProps\"\r\nimport AccordionCard from \"./AccordionCard\"\r\nimport ServiceDetails from \"../../../../api/OrderResults/OrderResultModel/ServiceDetails\"\r\nimport FormatDate from \"../../../../formatters/FormatDate\"\r\n\r\ntype TestingResult = {\r\n  testingText: string,\r\n  testingDate: string | null,\r\n  testingStatus: string | null,\r\n  resultStatusCode?: string,\r\n  testingClassName?: string\r\n}\r\nfunction getTestingResult(data: ServiceDetails, isCovid: boolean): TestingResult {\r\n  let result: TestingResult = {testingText: \"\", testingStatus: \"\", testingDate: \"\"}\r\n  if (data.ReleaseStatus) {\r\n    if (data.ReleaseStatus.Code === \"MCOMP\" || data.ReleaseStatus.Code === \"MPEND\" || data.ReleaseStatus.Code === \"MCREL\") {\r\n        result.testingText = \"Laboratory Testing Complete \"\r\n        result.testingDate = FormatDate(data.LabReportDate)\r\n        result.testingStatus = \"\"\r\n    } else if (data.ReleaseStatus.Code === \"LCOMP\" || data.ReleaseStatus.Code === \"LCREL\" || data.ReleaseStatus.Code === \"PCOMP\" || data.ReleaseStatus.Code === \"PCREL\") {\r\n      result.testingText = \"\"\r\n      result.resultStatusCode = data.ReleaseStatus.Code\r\n      result.testingDate = FormatDate(data.LabReportDate)\r\n      result.testingStatus = \"\"\r\n      if (data.ReleaseStatus.Code === \"LCREL\") {\r\n        result.testingStatus = data.LabResultDescription\r\n      }\r\n    }\r\n  }\r\n  if (isCovid) {\r\n    result.testingStatus = data.LabResultDescription\r\n  }\r\n  result.testingClassName = (result.testingStatus === '(Negative)' || result.resultStatusCode === 'LCOMP' || result.resultStatusCode === 'LCREL' || result.resultStatusCode === 'PCOMP'|| result.resultStatusCode === 'PCREL' || isCovid) ? \"black-text\" : \"red-text\"\r\n  return result\r\n}\r\n\r\nexport default function TestingCard(props: TestCardProps) {\r\n  const { data, isCovid } = props\r\n  const testingResult = getTestingResult(data, !!isCovid)\r\n  const title = <Row>\r\n    <Col xs={5} sm={3}>TESTING</Col>\r\n    <Col xs={3} sm={5}>\r\n      {testingResult.testingText}&nbsp;\r\n      <span className={testingResult.testingClassName}>{testingResult.testingStatus}</span>\r\n    </Col>\r\n    <Col xs={4} sm={4}>{testingResult.testingDate}</Col>\r\n  </Row>\r\n  return (\r\n    <AccordionCard eventKey=\"testing\" title={title}>\r\n      <CardRow title=\"LABORATORY\" value={data.LaboratoryVendorName}/>\r\n      <CardRow title=\"LAB ACCOUNT\" value={data.LabAccountNumber}/>\r\n      <CardRow title=\"PANEL\" value={data.Panel.Description}/>\r\n      <CardRow title=\"ACCESSION NUMBER\" value={data.LabAccessionNumber}/>\r\n      <CardRow title=\"LAB RECEIVED DATE\" value={data.LabReceivedDate} date/>\r\n      <CardRow title=\"LAB RECEIVED TIME\" value={data.LabReceivedDate} time/>\r\n      <CardRow title=\"LAB REPORT DATE\" value={data.LabReportDate} date/>\r\n      <CardRow title=\"LAB REPORT TIME\" value={data.LabReportDate} time/>\r\n      {isCovid && <div><label>Laboratory Note:</label><p>{data.ClinicalLabNotes}</p></div>}\r\n    </AccordionCard>\r\n  )\r\n}\r\n","import React from \"react\"\r\nimport AccordionCard from \"./AccordionCard\"\r\nimport TestCardProps from \"./TestCardProps\"\r\nimport CardRow from \"./CardRow\"\r\n\r\nexport default function ReviewCard(props: TestCardProps) {\r\n  const { data } = props\r\n  return (\r\n    <AccordionCard eventKey=\"review\" title=\"REVIEW\">\r\n      <CardRow title=\"MRO ID\" value={data.MROVendorName}/>\r\n      <CardRow title=\"MRO NAME\" value={data.MROName}/>\r\n      <CardRow title=\"MRO COPY CCF2 DATE SENT\" value={data.MROCopyCCF2Date} date/>\r\n      <CardRow title=\"MRO COPY CCF2 TIME SENT\" value={data.MROCopyCCF2Date} time/>\r\n      <CardRow title=\"MRO RECEIVED RESULTS DATE\" value={data.MROReceivedDate} date/>\r\n      <CardRow title=\"MRO RECEIVED RESULTS TIME\" value={data.MROReceivedDate} time/>\r\n      <CardRow title=\"MRO RESULTS REPORTED DATE\" value={data.MROReportDate} date/>\r\n      <CardRow title=\"MRO RESULTS REPORTED TIME\" value={data.MROReportDate} time/>\r\n    </AccordionCard>\r\n  )\r\n}\r\n","import React from \"react\"\r\nimport { Row, Col } from \"react-bootstrap\"\r\nimport TestCardProps from \"./TestCardProps\"\r\nimport CardRow from \"./CardRow\"\r\nimport AccordionCard from \"./AccordionCard\"\r\n\r\nexport default function TestScreeningCard(props: TestCardProps) {\r\n  const { data } = props\r\n  const title = <Row>\r\n    <Col xs={6}>TESTING SCREENING: <span className=\"status-text\">{data.ScreenResultDescription}</span></Col>\r\n    <Col xs={6}>TESTING CONFIRMATION: <span className=\"status-text\">{data.ConfirmResultDescription}</span></Col>\r\n  </Row>\r\n  return (\r\n    <AccordionCard eventKey=\"testScreening\" title={title}>\r\n      <Row>\r\n        <Col xs={6}>\r\n          <CardRow title=\"SAMPLE TYPE\" value={data.ScreenSampleTypeDescription}/>\r\n          <CardRow title=\"DEVICE\" value={data.ScreenDeviceCode}/>\r\n          <CardRow title=\"DEVICE #\" value={data.ScreenDeviceSerialNumber}/>\r\n          <CardRow title=\"DEVICE EXPIRATION DATE\" value={data.ScreenDeviceExpirationDate} date/>\r\n          <CardRow title=\"TEST NUMBER\" value={data.ScreenSequence}/>\r\n          <CardRow title=\"LEVEL\" value={data.ScreenLevel}/>\r\n        </Col>\r\n        <Col xs={6}>\r\n          <CardRow title=\"SAMPLE TYPE\" value={data.ConfirmSampleTypeDescription}/>\r\n          <CardRow title=\"DEVICE\" value={data.ConfirmDeviceCode}/>\r\n          <CardRow title=\"DEVICE #\" value={data.ConfirmDeviceSerialNumber}/>\r\n          <CardRow title=\"DEVICE EXPIRATION DATE\" value={data.ConfirmDeviceExpirationDate} date/>\r\n          <CardRow title=\"TEST NUMBER\" value={data.ConfirmSequence}/>\r\n          <CardRow title=\"LEVEL\" value={data.ConfirmLevel}/>\r\n        </Col>\r\n      </Row>\r\n    </AccordionCard>\r\n  )\r\n}\r\n","import React, { Component } from \"react\"\r\nimport { Accordion, Row, Col, Container } from \"react-bootstrap\"\r\nimport OrderResultRecord from \"../../../api/OrderResults/OrderResultModel/OrderResultRecord\"\r\nimport ServiceDetails from \"../../../api/OrderResults/OrderResultModel/ServiceDetails\"\r\n\r\nimport SchedulingCard from \"./Cards/SchedulingCard\"\r\nimport CollectionCard from \"./Cards/CollectionCard\"\r\nimport ExamDetailCard from \"./Cards/ExamDetailCard\"\r\nimport ExamResultDetailCard from \"./Cards/ExamResultDetailCard\"\r\nimport BATAlcoholTestCard from \"./Cards/BATAlcoholTestCard\"\r\nimport BATResultCard from \"./Cards/BATResultCard\"\r\nimport TestingCard from \"./Cards/TestingCard\"\r\nimport ReviewCard from \"./Cards/ReviewCard\"\r\nimport TestScreeningCard from \"./Cards/TestScreeningCard\"\r\n\r\ninterface TestStepsProps {\r\n  currentRowInfo: OrderResultRecord,\r\n  currentServiceInfo: ServiceDetails,\r\n  isOnTrack?: boolean\r\n}\r\nexport default class TestSteps extends Component<TestStepsProps, {}> {\r\n  render = () => {\r\n    const {currentRowInfo, currentServiceInfo, isOnTrack} = this.props\r\n    const EventData = currentServiceInfo.EventData\r\n\r\n    // TODO: the logic for constants below was ported from Angular application and *probably* will need to be refactored\r\n    const isCollection = currentRowInfo.TestType === \"Drug\" || currentServiceInfo.IsClinical\r\n    const isExamDetail = currentRowInfo.TestType === \"Physical\"\r\n    const isAlcohol = currentRowInfo.TestType === \"Alcohol\"\r\n    const isTesting = (currentServiceInfo.TestTypeDescription !== \"Alcohol\" && currentRowInfo.TestType === \"Drug\") || currentServiceInfo.IsClinical\r\n    const isReview = currentServiceInfo.TestTypeDescription !== \"Alcohol\" && currentRowInfo.TestType === \"Drug\"\r\n    const isTestScreening = currentServiceInfo.TestTypeDescription === \"Alcohol\" && currentRowInfo.TestType === \"Drug\"\r\n    const isCovid = (currentRowInfo.TestDetailClinicalID || \"\").length > 0\r\n\r\n    return (\r\n      <Container className=\"test-steps px-3 pb-2\">\r\n        <Row>\r\n          <Col><h5 className=\"pt-3 pb-2\">TEST STEPS</h5></Col>\r\n        </Row>\r\n        <Row>\r\n          <Col>\r\n            <Accordion>\r\n              <SchedulingCard data={currentServiceInfo} />\r\n              { isCollection && <CollectionCard data={currentServiceInfo} /> }\r\n              { isExamDetail && <ExamDetailCard data={currentServiceInfo} /> }\r\n              { isExamDetail && <ExamResultDetailCard data={currentServiceInfo} /> }\r\n              { isAlcohol && <BATAlcoholTestCard data={currentServiceInfo} /> }\r\n              { isAlcohol && <BATResultCard data={currentServiceInfo} /> }\r\n              { isTesting && <TestingCard data={currentServiceInfo} isCovid={isCovid}/> }\r\n              { isReview && !isOnTrack && <ReviewCard data={currentServiceInfo} /> }\r\n              { isTestScreening && <TestScreeningCard data={currentServiceInfo} /> }\r\n            </Accordion>\r\n          </Col>\r\n        </Row>\r\n      </Container>\r\n    )\r\n  }\r\n}\r\n","import React, { Component } from \"react\"\r\nimport { Container, Row, Col, Spinner  } from \"react-bootstrap\"\r\nimport { toast } from \"react-toastify\"\r\nimport { Subscription } from \"rxjs\"\r\nimport { CurrentServiceDetails } from \"../../../api/OrderResults/CurrentServiceDetails\"\r\nimport OrderResultRecord from \"../../../api/OrderResults/OrderResultModel/OrderResultRecord\"\r\nimport ServiceDetails from \"../../../api/OrderResults/OrderResultModel/ServiceDetails\"\r\nimport SelectionInboxGridRow from \"../../../api/Randoms/SelectionInboxModel/SelectionInboxGridRow\"\r\nimport { ImplementationTypeGovt, StorageKey } from \"../../../config/Constants\"\r\nimport TestSteps from \"../EventDetails/TestSteps\"\r\n\r\ninterface CurrentServiceProps {\r\n  details: OrderResultRecord\r\n}\r\n\r\ninterface CurrentServiceState {\r\n  data?: ServiceDetails\r\n  loading: boolean\r\n}\r\n\r\nexport default class CurrentService extends Component<CurrentServiceProps, CurrentServiceState> {\r\n  subscription?: Subscription\r\n  state: CurrentServiceState = { data: undefined, loading:false }\r\n  isOnTrack: boolean = sessionStorage.getItem(StorageKey.ImplementationType) === ImplementationTypeGovt\r\n\r\n  componentDidMount() {\r\n    this.setState({ loading: true })\r\n    const details = this.props.details\r\n    this.subscription = CurrentServiceDetails({ TestDetailClinicalID: details.TestDetailClinicalID, TestDetailID: details.TestDetailID }).subscribe(\r\n      (data: ServiceDetails) => this.setState({ data: data, loading: false }),\r\n      (error: string) => {\r\n        this.setState({ loading: false })\r\n        toast.error(error)\r\n      },\r\n      () => this.setState({ loading: false })\r\n    )\r\n  }\r\n\r\n  componentWillUnmount() {\r\n    this.subscription && this.subscription.unsubscribe()\r\n  }\r\n\r\n  render() {\r\n    if (!this.state.data) {\r\n      return this.state.loading ? <Spinner animation=\"border\" size=\"sm\" /> : <></>\r\n    } else {\r\n    const currentServiceInfo = this.state.data\r\n    const currentRowInfo = this.props.details\r\n    return currentServiceInfo ? (\r\n      <Container className=\"current-service p-0\">\r\n        <Container className=\"px-4 pb-4 pt-3\">\r\n          <Row>\r\n            <Col>\r\n              <h5 className=\"pt-3 pb-2\">\r\n                <span className=\"text-uppercase\">{currentServiceInfo.TestTypeDescription}</span> TEST: {currentServiceInfo.TestReleaseStatusDescription} - {currentServiceInfo.MROResultDescription}\r\n              </h5>\r\n            </Col>\r\n          </Row>\r\n          <Row className=\"py-1\">\r\n            <Col xs={6} md={4}><span className=\"caption\">REASON FOR TEST</span></Col>\r\n            <Col xs={6} md={8}>{currentServiceInfo.TestReasonDescription}</Col>\r\n          </Row>\r\n          <Row className=\"py-1\">\r\n            <Col xs={6} md={4}><span className=\"caption\">SAMPLE TYPE</span></Col>\r\n            <Col xs={6} md={8}>{currentServiceInfo.SampleTypeDescription}</Col>\r\n          </Row>\r\n          <Row className=\"py-1\">\r\n            <Col xs={6} md={4}><span className=\"caption\">PANEL</span></Col>\r\n            <Col xs={6} md={8}>{currentServiceInfo.Panel.Description}</Col>\r\n          </Row>\r\n          <Row className=\"py-1\">\r\n            <Col xs={6} md={4}><span className=\"caption\">FEDERALLY REGULATED</span></Col>\r\n            <Col xs={6} md={8}>{currentServiceInfo.DOT ? \"Yes\" : \"No\"}</Col>\r\n          </Row>\r\n          <Row className=\"py-1\">\r\n            <Col xs={6} md={4}><span className=\"caption\">REGULATORY MODE</span></Col>\r\n            <Col xs={6} md={8}>{currentServiceInfo.EventData.RegulatoryModeName}</Col>\r\n          </Row>\r\n        </Container>\r\n        <Container className=\"px-2 pb-2\">\r\n            <TestSteps currentRowInfo={currentRowInfo} currentServiceInfo={currentServiceInfo} isOnTrack={this.isOnTrack}/>\r\n        </Container>\r\n      </Container>\r\n    ) : null\r\n  }\r\n}\r\n}\r\n","import { AccountTypeID } from \"../../config/Constants\"\r\nimport { ObservableFromFetch } from \"../ObservableFromFetch\"\r\nimport GridResponse from \"../GridResponse\"\r\nimport OrderResultRecord from \"./OrderResultModel/OrderResultRecord\"\r\n\r\nexport type ServiceHistoryGridResponse = GridResponse<OrderResultRecord>\r\n\r\ninterface CurrentServiceHistoryParams {\r\n  AccountTypeID?: number\r\n  PersonID: number\r\n  PoolID?: number\r\n  PageNumber: number\r\n  PageSize: number\r\n}\r\n\r\nfunction requestParams(options: CurrentServiceHistoryParams) {\r\n  return JSON.stringify({\r\n      AccountTypeID: AccountTypeID,\r\n      PersonID: options.PersonID,\r\n      PoolID: options.PoolID,\r\n      PageNumber: options.PageNumber,\r\n      PageSize: options.PageSize\r\n  })\r\n}\r\n\r\nexport const GetCurrentServiceHistory = (params: CurrentServiceHistoryParams) => ObservableFromFetch<ServiceHistoryGridResponse>(\"WorkforceTrack/GetEmployeeTestHistory\", requestParams(params))\r\n","import { Col, Form, Row } from \"react-bootstrap\"\r\n\r\nimport CardRow from \"./CardRow\"\r\nimport PhoneType, { PhoneNumber } from \"../../../../api/PhoneType\"\r\nimport PhoneNumberMaskedInput from \"../../../FormattedInputs/PhoneNumberMaskedInput\"\r\nimport FormatPhone from \"../../../../formatters/FormatPhone\"\r\n\r\ninterface PhoneNumberCardProps {\r\n  variant: PhoneType\r\n  readonly: boolean\r\n  phone: PhoneNumber\r\n  onChange: (value: string, type: PhoneType) => void\r\n}\r\n\r\nfunction PhoneNumberCard(props: PhoneNumberCardProps) {\r\n  const { variant, readonly, phone, onChange } = props\r\n\r\n  const label = () => {\r\n    switch (variant) {\r\n      case PhoneType.Home:\r\n        return \"HOME PHONE\"\r\n      case PhoneType.Work:\r\n        return \"WORK PHONE\"\r\n      case PhoneType.Cell:\r\n        return \"MOBILE PHONE\"\r\n      default:\r\n        return \"\"\r\n    }\r\n  }\r\n\r\n  const onNumberChange = (number: string) => onChange(number, variant)\r\n\r\n  const isValid = (phone: string) => {\r\n    const phoneNumber = phone.replace(/\\D/g, \"\")\r\n\r\n    return phoneNumber.length === 0 || phoneNumber.length === 10\r\n  }\r\n\r\n  return (\r\n    <>\r\n      {readonly && <CardRow title={`${label()}`} value={FormatPhone(phone.number)} />}\r\n      {!readonly && (\r\n        <Row className=\"p-1\">\r\n          <Form.Label column sm={4} className={`align-middle ${phone.isRequired ? \"required\" : \"\"}`} htmlFor={`${variant}Input`}>\r\n            {`${label()}`}\r\n          </Form.Label>\r\n          <Col md={8} className=\"align-self-center\">\r\n            <PhoneNumberMaskedInput\r\n              id={`${variant}Input`}\r\n              value={phone.number}\r\n              isInvalid={!isValid(phone.number)}\r\n              onChange={onNumberChange}\r\n            />\r\n          </Col>\r\n        </Row>\r\n      )}\r\n    </>\r\n  )\r\n}\r\n\r\nexport default PhoneNumberCard\r\n","import PhoneNumberCard from \"./PhoneNumberCard\"\r\nimport PhoneType, { PhoneNumber } from \"../../../../api/PhoneType\"\r\n\r\ninterface PhoneNumbersProps {\r\n  phones: Record<PhoneType, PhoneNumber>\r\n  readonly: boolean\r\n  onChange: (value: string, type: PhoneType) => void\r\n}\r\n\r\nfunction PhoneNumbers(props: PhoneNumbersProps) {\r\n  const { phones, readonly, onChange } = props\r\n\r\n  return (\r\n    <>\r\n      <PhoneNumberCard\r\n        variant={PhoneType.Home}\r\n        phone={phones[PhoneType.Home]}\r\n        readonly={readonly}\r\n        onChange={onChange}\r\n      />\r\n      <PhoneNumberCard\r\n        variant={PhoneType.Work}\r\n        phone={phones[PhoneType.Work]}\r\n        readonly={readonly}\r\n        onChange={onChange}\r\n      />\r\n      <PhoneNumberCard\r\n        variant={PhoneType.Cell}\r\n        phone={phones[PhoneType.Cell]}\r\n        readonly={readonly}\r\n        onChange={onChange}\r\n      />\r\n    </>\r\n  )\r\n}\r\n\r\nexport default PhoneNumbers\r\n","import { StorageKey } from \"../config/Constants\"\r\n\r\nconst expirationTimeout: number = 15 * 60 * 1000 // 15 minutes in milliseconds\r\nexport const ProcessingCollectionLabel = \"Processing Collection\"\r\n\r\ninterface CachedCollectionTest {\r\n  id: string\r\n  timestamp: number\r\n}\r\n\r\nfunction getCachedCollectionTests(): CachedCollectionTest[] {\r\n  return JSON.parse(sessionStorage.getItem(StorageKey.CachedCollectionTests) || \"[]\")\r\n}\r\n\r\nfunction getProcessingCollectionTests(): CachedCollectionTest[] {\r\n  const tests: CachedCollectionTest[] = getCachedCollectionTests()\r\n  return tests.filter((test: CachedCollectionTest) => test.timestamp + expirationTimeout > Date.now())\r\n}\r\n\r\nfunction setProcessingCollectionTests(tests: CachedCollectionTest[]) {\r\n  sessionStorage.setItem(StorageKey.CachedCollectionTests, JSON.stringify(tests))\r\n}\r\n\r\nexport function addProcessingCollectionTest(id: string) {\r\n  let tests: CachedCollectionTest[] = getProcessingCollectionTests()\r\n  const test: CachedCollectionTest = {id: id, timestamp: Date.now() }\r\n  tests.push(test)\r\n  setProcessingCollectionTests(tests)\r\n}\r\n\r\nexport function refreshProcessingCollectionTests() {\r\n  setProcessingCollectionTests(getProcessingCollectionTests())\r\n}\r\n\r\nexport function isProcessingCollection(id: string) {\r\n  const tests: CachedCollectionTest[] = getProcessingCollectionTests()\r\n  return tests.map(test => test.id).includes(id)\r\n}\r\n\r\nexport function hasCachedCollectionTests() {\r\n  return getCachedCollectionTests().length > 0\r\n}\r\n","import { GovPerformCollectionData } from \"./GovPoolModel/GovPerformCollection\"\r\nimport { ObservableFromFetch } from \"../ObservableFromFetch\"\r\n\r\nexport interface SendResult {\r\n  Success: boolean\r\n  Text: string\r\n  ImageData: string\r\n\r\n}\r\nexport default function GovSendToLab(data: GovPerformCollectionData) {\r\n  const params: string = JSON.stringify(data)\r\n\r\n  return ObservableFromFetch<SendResult>(\"GovOrder/GovSendToLab\", params)\r\n}\r\nexport function GovMarkAsComplete(data: GovPerformCollectionData) {\r\n  const params: string = JSON.stringify(data)\r\n\r\n  return ObservableFromFetch<SendResult>(\"GovOrder/GovMarkAsComplete\", params)\r\n}","import React, { useCallback, useEffect, useRef, useState } from 'react'\r\nimport { Row, Col, Container, Form } from 'react-bootstrap'\r\nimport { useEffectAfterMount } from '../../utils/hooks'\r\n\r\nexport enum Temperature {\r\n  NOT_SELECTED = 0,\r\n  IN_RANGE = 1,\r\n  OUT_OF_RANGE = 2\r\n}\r\n\r\nexport interface RecordTemperatureProps {\r\n  temperature: number\r\n  required: boolean\r\n  disabled?: boolean\r\n  validate?: boolean | undefined\r\n  onChange: (value: number, isValid: boolean) => void\r\n}\r\n\r\nconst RecordTemperature = (props: RecordTemperatureProps) => {\r\n  const [isValid, setIsValid] = useState(true)\r\n  const [temperature, setTemperature] = useState(props.temperature)\r\n\r\n  const refObj = useRef({ onChange: props.onChange })\r\n  const refInput = useRef<HTMLInputElement | null>(null)\r\n\r\n  const isRangeSelected = useCallback(() => {\r\n    return !props.required || temperature !== Temperature.NOT_SELECTED\r\n  }, [props.required, temperature])\r\n\r\n  useEffectAfterMount(() => {\r\n    if (props.validate !== undefined) {\r\n      const valid = isRangeSelected()\r\n      if (!valid) { refInput.current?.focus() }\r\n\r\n      setIsValid(valid)\r\n    }\r\n\r\n  }, [isRangeSelected, props.validate])\r\n\r\n  useEffect(() => {\r\n    refObj.current.onChange(temperature, isRangeSelected())\r\n  }, [isRangeSelected, temperature])\r\n\r\n  const onChange = (e: React.ChangeEvent<HTMLInputElement>) => setTemperature(Number(e.target.value))\r\n\r\n  return (\r\n    <Container fluid className='mt-3'>\r\n      <Row>\r\n        <Col><h6 className={`mb-0 ${props.required ? 'required' : ''}`}>Record Temperature</h6></Col>\r\n        <Col>\r\n          <Form.Check inline name=\"record-temp\" type=\"radio\"\r\n            ref={refInput}\r\n            id=\"temp_in_range\"\r\n            label=\"Temp In Range\"\r\n            value={Temperature.IN_RANGE}\r\n            className=\"abc-radio text-success\"\r\n            checked={temperature === Temperature.IN_RANGE}\r\n            disabled={props.disabled}\r\n            onChange={onChange} />\r\n        </Col>\r\n        <Col>\r\n          <Form.Check inline name=\"record-temp\" type=\"radio\"\r\n            id=\"temp_out_of_range\"\r\n            label=\"Temp Out of Range\"\r\n            value={Temperature.OUT_OF_RANGE}\r\n            className=\"abc-radio text-danger\"\r\n            checked={temperature === Temperature.OUT_OF_RANGE}\r\n            disabled={props.disabled}\r\n            onChange={onChange} />\r\n        </Col>\r\n        <Col></Col>\r\n      </Row>\r\n      <Row>\r\n        <Col>\r\n          {!isValid && <Form.Control.Feedback type=\"invalid\" className=\"d-block\">Please select temperature range.</Form.Control.Feedback>}\r\n        </Col>\r\n      </Row>\r\n    </Container>)\r\n}\r\n\r\nexport default RecordTemperature\r\n","import React, { useEffect, useState } from 'react'\r\nimport { Row, Col, Container, Spinner } from 'react-bootstrap'\r\nimport FormatDate from '../../formatters/FormatDate'\r\nimport { GeneralInformationGet } from '../../api/OrderResults/GeneralInformationGet'\r\nimport GeneralInformation from '../../api/OrderResults/OrderResultModel/GeneralInformation'\r\nimport FormatError from '../../formatters/FormatError'\r\nimport { toast } from 'react-toastify'\r\nimport { Subscriber } from 'rxjs'\r\nimport { finalize } from 'rxjs/operators'\r\n\r\nexport interface DonorInfoProps {\r\n  personID?: number,\r\n  firstName?: string,\r\n  lastName?: string,\r\n  dateOfBirth?: Date,\r\n  gender?: string\r\n}\r\n\r\nconst DonorInfo = (props: DonorInfoProps) => {\r\n  const { personID } = props\r\n\r\n  const [loading, setLoading] = useState(false)\r\n  const [person, setPerson] = useState<DonorInfoProps>({ ...props })\r\n\r\n  const formatGender = (gender: string = \"\") => {\r\n    switch (gender) {\r\n      case \"M\":\r\n        return \"Male\"\r\n      case \"F\":\r\n        return \"Female\"\r\n      default:\r\n        return \"Unknown\"\r\n    }\r\n  }\r\n\r\n  useEffect(() => {\r\n    const sub = new Subscriber()\r\n    if (!!personID) {\r\n      setLoading(true)\r\n      const sub = GeneralInformationGet(personID)\r\n        .pipe(finalize(() => setLoading(false)))\r\n        .subscribe(\r\n          (data: GeneralInformation) => {\r\n            setPerson({\r\n              personID: data.PersonID,\r\n              firstName: data.FirstName,\r\n              lastName: data.LastName,\r\n              dateOfBirth: !!data.DOB ? new Date(data.DOB) : undefined,\r\n              gender: data.Gender\r\n            })\r\n          },\r\n          error => toast.error(FormatError(error))\r\n        )\r\n    }\r\n    return () => sub.unsubscribe()\r\n  }, [personID])\r\n\r\n  return (\r\n    <Container fluid className='border-bottom py-1'>\r\n      <Row>\r\n        <Col className='border-right'>\r\n          <h6>Donor Name:</h6>\r\n          {loading ? <Spinner animation=\"border\" size=\"sm\" variant=\"light\" /> : `${person.firstName} ${person.lastName}`}\r\n        </Col>\r\n        <Col className='border-right'>\r\n          <h6>DOB:</h6>\r\n          {loading ? <Spinner animation=\"border\" size=\"sm\" variant=\"light\" /> : FormatDate(person.dateOfBirth)}\r\n        </Col>\r\n        <Col>\r\n          <h6>Gender:</h6>\r\n          {loading ? <Spinner animation=\"border\" size=\"sm\" variant=\"light\" /> : formatGender(person.gender)}\r\n        </Col>\r\n      </Row>\r\n    </Container>\r\n  )\r\n}\r\n\r\nexport default DonorInfo\r\n","import { EffectCallback, DependencyList, useRef, useEffect } from \"react\";\r\n\r\n/**\r\n * A custom useEffect hook that only triggers on updates, not on initial mount\r\n * @param {Function} effect\r\n * @param {Array<any>} dependencies\r\n */\r\nexport const useEffectAfterMount = (effect: EffectCallback, dependencies: DependencyList | undefined = []) => {\r\n  const mounted = useRef(true);\r\n\r\n  useEffect(() => {\r\n    if (!mounted.current) {\r\n      return effect()\r\n    }\r\n    mounted.current = false\r\n  }, dependencies)\r\n}\r\n","export enum PanelResult {\r\n  NOT_SELECTED = 0,\r\n  POSITIVE = 1,\r\n  INCONCLUSIVE = 2,\r\n  NEGATIVE = 3,\r\n}\r\n","import { Form } from \"react-bootstrap\"\r\n\r\ninterface SpecimenIdInputProps {\r\n  className?: string\r\n  readOnly?: boolean\r\n  disabled?: boolean\r\n  size?: \"sm\" | \"lg\"\r\n  value: string\r\n  isValid?: () => boolean\r\n  onChange: (value: string) => void\r\n}\r\n\r\nconst SpecimenIdInput = (props: SpecimenIdInputProps) => {\r\n  return (\r\n    <Form.Control type=\"text\"\r\n      className={props.className}\r\n      readOnly={props.readOnly}\r\n      disabled={props.disabled}\r\n      value={props.value}\r\n      isInvalid={!!props.isValid && !props.isValid()}\r\n      onChange={(e) => props.onChange(e.target.value)} />\r\n  )\r\n}\r\n\r\nexport default SpecimenIdInput\r\n","import { useCallback, useEffect, useRef, useState } from \"react\"\r\nimport { Col, Container, Form, Row } from \"react-bootstrap\"\r\nimport SpecimenIdInput from \"../FormattedInputs/SpecimenIdInput\"\r\nimport { useEffectAfterMount } from \"../../utils/hooks\"\r\n\r\nexport interface InputSpecimenIdProps {\r\n  sampleId?: string\r\n  required?: boolean\r\n  disabled?: boolean\r\n  validate?: boolean | undefined\r\n  onChange: (value: string, isValid: boolean) => void\r\n}\r\n\r\nconst InputSpecimenId = (props: InputSpecimenIdProps) => {\r\n  const { sampleId = \"\", required = false, disabled = false } = props\r\n\r\n  const [id, setId] = useState(sampleId)\r\n  const [idRepeat, setIdRepeat] = useState(sampleId)\r\n  const [isIdValid, setIdValid] = useState(true)\r\n  const [isIdRepeatValid, setIdRepeatValid] = useState(true)\r\n  const refObj = useRef({ onChange: props.onChange })\r\n\r\n  const isIdFormatValid = (value: string, alowEmpty: boolean = false) => {\r\n    return value.length === 0 ? alowEmpty : new RegExp(`^[A-Za-z]{1}[0-9]{9}$`).test(value)\r\n  }\r\n\r\n  const isValid = useCallback(() => {\r\n    return isIdFormatValid(id, !required) && id === idRepeat\r\n  }, [id, idRepeat, required])\r\n\r\n  useEffect(() => {\r\n    refObj.current.onChange(id, isValid())\r\n  }, [id, isValid])\r\n\r\n  useEffectAfterMount(() => {\r\n    if (props.validate !== undefined) {\r\n      setIdValid(isIdFormatValid(id, !required))\r\n      setIdRepeatValid(id === idRepeat)\r\n    }\r\n  }, [props.validate, required, id, idRepeat])\r\n\r\n  return (\r\n    <Container fluid className='mt-3'>\r\n      <Row>\r\n        <Col>\r\n          <h6 className={required ? \"required\" : \"\"}>Specimen ID#</h6>\r\n          <SpecimenIdInput\r\n            disabled={disabled}\r\n            value={id}\r\n            isValid={() => isIdValid}\r\n            onChange={value => setId(value)} />\r\n        </Col>\r\n        <Col>\r\n          <h6 className={required ? \"required\" : \"\"}>Repeat Specimen ID#</h6>\r\n          <SpecimenIdInput\r\n            disabled={disabled}\r\n            value={idRepeat}\r\n            isValid={() => isIdRepeatValid}\r\n            onChange={value => setIdRepeat(value)} />\r\n        </Col>\r\n        <Col></Col>\r\n        <Col></Col>\r\n        <Col></Col>\r\n      </Row>\r\n      <Row>\r\n        <Col>\r\n          {!isIdValid && <Form.Control.Feedback className=\"d-block\" type=\"invalid\">\r\n            {`The SpecimenID must start with an Alpha character followed by 9 digits.`}\r\n          </Form.Control.Feedback>}\r\n          {!isIdRepeatValid && <Form.Control.Feedback className={`d-block ${isIdValid ? \"\" : \"mt-0\"}`} type=\"invalid\">\r\n            The two Specimen ID entries must match each other.\r\n          </Form.Control.Feedback>}\r\n        </Col>\r\n      </Row>\r\n    </Container>\r\n  )\r\n}\r\n\r\nexport default InputSpecimenId\r\n","import { Container, Row, Col, Form } from \"react-bootstrap\"\r\n\r\nexport interface CollectorNotesProps {\r\n  notes: string\r\n  disabled?: boolean\r\n  onChange: (value: string) => void\r\n}\r\n\r\nconst CollectorNotes = (props: CollectorNotesProps) => {\r\n  const { disabled = false } = props\r\n\r\n  return (\r\n    <Container fluid className='mt-3 mb-2'>\r\n      <Row>\r\n        <Col>\r\n          <h6>Collector Notes</h6>\r\n          <Form.Control as=\"textarea\"\r\n            placeholder=\"Insert collector's notes\"\r\n            disabled={disabled}\r\n            value={props.notes}\r\n            onChange={e => props.onChange(e.target.value)} />\r\n        </Col>\r\n      </Row>\r\n    </Container>\r\n  )\r\n}\r\n\r\nexport default CollectorNotes\r\n","import React, { useEffect, useState } from \"react\"\r\nimport { Row, Col, Form, Table } from \"react-bootstrap\"\r\nimport SelectedGovPanel from \"../../api/Randoms/GovPoolModel/GovPerformCollection\"\r\nimport { Dictionary } from \"../../api/GovPerformCollection/Dictionary\"\r\n\r\nexport interface AdditionalPanelsProps {\r\n  panels: Dictionary<SelectedGovPanel>\r\n  onUpdate: (panels: Dictionary<SelectedGovPanel>) => void\r\n}\r\n\r\nconst AdditionalPanels = (props: AdditionalPanelsProps) => {\r\n  const { onUpdate } = props\r\n\r\n  const [panels, setPanels] = useState<Dictionary<SelectedGovPanel>>(props.panels)\r\n\r\n  const formatDrugLabel = (label: string) => {\r\n    const mappings = [{ from: \" CONF URN\", to: \"\" }].forEach((m) => (label = label.replace(m.from, m.to)))\r\n\r\n    return label\r\n  }\r\n\r\n  const onSelect = (e: React.ChangeEvent<HTMLInputElement>) => {\r\n    const code = e.target.value\r\n    const checked = e.target.checked ? 1 : 0\r\n\r\n    setPanels((prev) => ({ ...prev, [code]: { ...prev[code], SendToLab: checked } }))\r\n  }\r\n\r\n  useEffect(() => {\r\n    setPanels(props.panels)\r\n  }, [props.panels])\r\n\r\n  useEffect(() => {\r\n    onUpdate(panels)\r\n  }, [onUpdate, panels])\r\n\r\n  return (\r\n    <>\r\n      {Object.values(panels).length > 0 && (\r\n        <Row className=\"pt-3\">\r\n          <Col>\r\n            <h6 className=\"ml-3\">Additional Testing</h6>\r\n            <Table striped bordered hover responsive className=\"m-0\">\r\n              <tbody>\r\n                {Object.values(panels).map((panel, code) => (\r\n                  <tr key={`adpanel_${code}`}>\r\n                    <td>\r\n                      <Form.Check\r\n                        //inline\r\n                        id={`adpanel_${code}`}\r\n                        type=\"checkbox\"\r\n                        value={panel.Code}\r\n                        label={formatDrugLabel(panel.Name)\r\n                          /*panel.ExternalID !== \"\"\r\n                            ? formatDrugLabel(panel.Name)\r\n                            : `${formatDrugLabel(panel.Name)} (Not Available)`*/\r\n                        }\r\n                        checked={panel.SendToLab === 1}\r\n                        //disabled={panel.ExternalID === \"\"}\r\n                        onChange={onSelect}\r\n                      />\r\n                    </td>\r\n                  </tr>\r\n                ))}\r\n              </tbody>\r\n            </Table>\r\n          </Col>\r\n        </Row>\r\n      )}\r\n    </>\r\n  )\r\n}\r\n\r\nexport default AdditionalPanels\r\n","import { Form } from \"react-bootstrap\"\r\nimport SelectedGovPanel from \"../../api/Randoms/GovPoolModel/GovPerformCollection\"\r\nimport { PanelResult } from \"../../api/GovPerformCollection/PanelResult\"\r\n\r\nexport interface MainPanelRowProps {\r\n  panel: SelectedGovPanel\r\n  onUpdatePanel: (panel: SelectedGovPanel) => void\r\n}\r\n\r\nconst MainPanelRow = (props: MainPanelRowProps) => {\r\n  const { panel, onUpdatePanel } = props\r\n\r\n  const onChange = (e: React.ChangeEvent<HTMLInputElement>) => {\r\n    const value = Number(e.target.value)\r\n    const newPanel = { ...panel, SelectedStatus: value }\r\n    if ([PanelResult.POSITIVE, PanelResult.INCONCLUSIVE].includes(value)) {\r\n      newPanel.SendToLab = 1\r\n    }\r\n    onUpdatePanel(newPanel)\r\n  }\r\n\r\n  const onToggleSendToLab = (e: React.ChangeEvent<HTMLInputElement>) => {\r\n    onUpdatePanel({ ...panel, SendToLab: e.target.checked ? 1 : 0 })\r\n  }\r\n\r\n\r\n  if (panel.ExternalID === \"\") {\r\n    return (\r\n      <tr className=\"text-muted\">\r\n        <td>\r\n          {panel.Label}\r\n        </td>\r\n        <td colSpan={4} className=\"text-center\">Not Available</td>\r\n      </tr>\r\n    )\r\n  }\r\n\r\n  return (\r\n    <tr>\r\n      <td>\r\n        {panel.Label}\r\n      </td>\r\n      <td>\r\n        <Form.Check inline name={`panel_${panel.InternalCode}`} type=\"radio\"\r\n          value={PanelResult.POSITIVE}\r\n          checked={panel.SelectedStatus === PanelResult.POSITIVE}\r\n          onChange={onChange} />\r\n      </td>\r\n      <td>\r\n        <Form.Check inline name={`panel_${panel.InternalCode}`} type=\"radio\"\r\n          value={PanelResult.INCONCLUSIVE}\r\n          checked={panel.SelectedStatus === PanelResult.INCONCLUSIVE}\r\n          onChange={onChange} />\r\n      </td>\r\n      <td>\r\n        <Form.Check inline name={`panel_${panel.InternalCode}`} type=\"radio\"\r\n          value={PanelResult.NEGATIVE}\r\n          checked={panel.SelectedStatus === PanelResult.NEGATIVE}\r\n          onChange={onChange} />\r\n      </td>\r\n      <td>\r\n        <Form.Check inline type=\"checkbox\"\r\n          value={panel.SendToLab}\r\n          disabled={panel.SelectedStatus === PanelResult.NOT_SELECTED}\r\n          checked={panel.SendToLab === 1}\r\n          onChange={onToggleSendToLab} />\r\n      </td>\r\n    </tr>\r\n  )\r\n}\r\n\r\nexport default MainPanelRow\r\n","import { Row, Col, Table, Form, Spinner } from \"react-bootstrap\"\r\nimport SelectedGovPanel from \"../../api/Randoms/GovPoolModel/GovPerformCollection\"\r\nimport { useCallback, useEffect, useState } from \"react\"\r\nimport MainPanelRow from \"./MainPanelRow\"\r\nimport { Dictionary } from \"../../api/GovPerformCollection/Dictionary\"\r\nimport { PanelResult } from \"../../api/GovPerformCollection/PanelResult\"\r\n\r\nexport interface MainPanels {\r\n  panels: Dictionary<SelectedGovPanel>\r\n  loading?: boolean\r\n  onUpdate: (panels: Dictionary<SelectedGovPanel>) => void\r\n}\r\n\r\nconst MainPanels = (props: MainPanels) => {\r\n  const { loading = false, onUpdate } = props\r\n\r\n  const [panels, setPanels] = useState<Dictionary<SelectedGovPanel>>(props.panels)\r\n\r\n  const isAllPanelSelected = (type: number) => Object.values(panels)\r\n    .filter(panel => panel.ExternalID !== \"\")\r\n    .every(panel => panel.SelectedStatus === type)\r\n\r\n  const isAllPanelDisabled = () => loading || Object.values(panels).filter(panel => panel.ExternalID !== \"\").length == 0\r\n\r\n  const isAllSendToLabSelected = () => {\r\n    const values = Object.values(panels).filter(panel => panel.ExternalID !== \"\")\r\n    return values.length == 0 || values.every(panel => panel.SendToLab === 1)\r\n  }\r\n\r\n  const isAllSendToLabDisabled = () => Object.values(panels)\r\n    .filter(panel => panel.ExternalID !== \"\")\r\n    .every(panel => panel.SelectedStatus === PanelResult.NOT_SELECTED)\r\n\r\n  const onSelectAllPanels = (e: React.ChangeEvent<HTMLInputElement>) => {\r\n    const value = Number(e.target.value)\r\n    const uncheckLabOnNegative = (isAllPanelSelected(PanelResult.POSITIVE) || isAllPanelSelected(PanelResult.INCONCLUSIVE)) && value == PanelResult.NEGATIVE\r\n    const selectedPanels = Object.entries(panels)\r\n      .reduce<Dictionary<SelectedGovPanel>>((acc, [key, panel]) => {\r\n        return {\r\n          ...acc,\r\n          [key]: {\r\n            ...panel,\r\n            SelectedStatus: panel.ExternalID !== \"\" ? value : panel.SelectedStatus,\r\n            SendToLab: [PanelResult.POSITIVE, PanelResult.INCONCLUSIVE].includes(value) && panel.ExternalID !== \"\" ? 1 : uncheckLabOnNegative ? 0 : panel.SendToLab\r\n          }\r\n        }\r\n      }, {})\r\n\r\n    setPanels(prev => ({ ...prev, ...selectedPanels }))\r\n  }\r\n\r\n  const onSelectAllSendToLab = (e: React.ChangeEvent<HTMLInputElement>) => {\r\n    const checked = e.target.checked ? 1 : 0\r\n\r\n    const selectedPanels = Object.entries(panels)\r\n      .reduce((acc, [key, panel]) => {\r\n        return {\r\n          ...acc,\r\n          [key]: {\r\n            ...panel,\r\n            SendToLab: panel.SelectedStatus !== PanelResult.NOT_SELECTED && panel.ExternalID !== \"\" ? checked : panel.SendToLab\r\n          }\r\n        }\r\n      }, {})\r\n\r\n    setPanels(prev => ({ ...prev, ...selectedPanels }))\r\n  }\r\n\r\n  const onUpdatePanel = useCallback((panel: SelectedGovPanel) => {\r\n    setPanels(prev => ({ ...prev, [panel.InternalCode]: { ...prev[panel.InternalCode], ...panel } }))\r\n  }, [])\r\n\r\n  useEffect(() => {\r\n    setPanels(props.panels)\r\n  }, [props.panels])\r\n\r\n  useEffect(() => {\r\n    onUpdate(panels)\r\n  }, [onUpdate, panels])\r\n\r\n  return (\r\n    <Row className=\"pt-2\">\r\n      <Col>\r\n        <Table striped bordered hover responsive>\r\n          <thead>\r\n            <tr>\r\n              <th>DRUG CODE</th>\r\n              <th>\r\n                <Form.Check inline name=\"panel_header\" type=\"radio\" className=\"with-label\"\r\n                  id=\"ph_positive\"\r\n                  label=\"POSITIVE\"\r\n                  value={PanelResult.POSITIVE}\r\n                  disabled={isAllPanelDisabled()}\r\n                  checked={isAllPanelSelected(PanelResult.POSITIVE)}\r\n                  onChange={onSelectAllPanels} />\r\n              </th>\r\n              <th>\r\n                <Form.Check inline name=\"panel_header\" type=\"radio\" className=\"with-label\"\r\n                  id=\"ph_inconclusive\"\r\n                  label=\"INCONCLUSIVE\"\r\n                  value={PanelResult.INCONCLUSIVE}\r\n                  disabled={isAllPanelDisabled()}\r\n                  checked={isAllPanelSelected(PanelResult.INCONCLUSIVE)}\r\n                  onChange={onSelectAllPanels} />\r\n              </th>\r\n              <th>\r\n                <Form.Check inline name=\"panel_header\" type=\"radio\" className=\"with-label\"\r\n                  id=\"ph_negative\"\r\n                  label=\"NEGATIVE\"\r\n                  value={PanelResult.NEGATIVE}\r\n                  disabled={isAllPanelDisabled()}\r\n                  checked={isAllPanelSelected(PanelResult.NEGATIVE)}\r\n                  onChange={onSelectAllPanels} />\r\n              </th>\r\n              <th>\r\n                <Form.Check inline type=\"checkbox\" className=\"with-label\"\r\n                  id=\"ph_send_to_lab\"\r\n                  label=\"SEND TO LAB\"\r\n                  checked={isAllSendToLabSelected()}\r\n                  disabled={isAllSendToLabDisabled()}\r\n                  onChange={onSelectAllSendToLab} />\r\n              </th>\r\n            </tr>\r\n          </thead>\r\n          <tbody>\r\n            {loading && <tr><td colSpan={5}><Spinner animation=\"border\" variant=\"light\" /></td></tr>}\r\n            {!loading && Object.values(panels).length == 0 && <tr><td colSpan={5}>DATA NOT FOUND</td></tr>}\r\n            {!loading && Object.values(panels).map((panel) =>\r\n              <MainPanelRow key={`panel_row_${panel.InternalCode}`} panel={panel} onUpdatePanel={onUpdatePanel} />\r\n            )}\r\n          </tbody>\r\n        </Table>\r\n      </Col>\r\n    </Row>\r\n  )\r\n}\r\n\r\nexport default MainPanels\r\n","import { SampleType } from \"./GovPoolModel/CollectionTypeResponse\"\r\nimport { ObservableFromFetch } from \"../ObservableFromFetch\"\r\n\r\nexport default function GetPanels(labAccountCode: string, DeviceID: number = 0) {\r\n  return ObservableFromFetch<SampleType[]>(\r\n    \"GovPool/GetPanels?labAccountCode=\" + labAccountCode + \"&DeviceID=\" + DeviceID\r\n  )\r\n}\r\nexport function GovGetLabDeviceDrugs(sampleTypeCode: string, labAccountCode: string, DeviceID: number = 0, AccountID: number) {\r\n  return ObservableFromFetch<SampleType[]>(\r\n    \"GovOrder/GetLabDeviceDrugs?sampleTypeCode=\" +\r\n      sampleTypeCode +\r\n      \"&labAccountCode=\" +\r\n      labAccountCode +\r\n      \"&deviceId=\" +\r\n      DeviceID +\r\n      \"&accountId=\" +\r\n      AccountID\r\n  )\r\n}\r\n","import { useCallback, useEffect, useState } from \"react\"\r\nimport SelectedGovPanel from \"../../api/Randoms/GovPoolModel/GovPerformCollection\"\r\nimport AdditionalPanels from \"./AdditionalPanels\"\r\nimport MainPanels from \"./MainPanels\"\r\nimport { toast } from \"react-toastify\"\r\nimport { GovGetLabDeviceDrugs } from \"../../api/Randoms/GovGetPanels\"\r\nimport FormatError from \"../../formatters/FormatError\"\r\nimport { SampleType } from \"../../api/Randoms/GovPoolModel/CollectionTypeResponse\"\r\nimport { finalize } from \"rxjs/operators\"\r\nimport { Dictionary } from \"../../api/GovPerformCollection/Dictionary\"\r\nimport { PanelResult } from \"../../api/GovPerformCollection/PanelResult\"\r\n\r\nexport interface PanelsProps {\r\n  labCode: string\r\n  sampleTypeCode: string\r\n  onUpdate: (panels: SelectedGovPanel[]) => void\r\n  onLoading: (loading: boolean) => void\r\n  deviceID: number\r\n  accountID: number\r\n}\r\n\r\nconst Panels = (props: PanelsProps) => {\r\n  const { labCode, sampleTypeCode, onUpdate, onLoading, deviceID, accountID } = props\r\n\r\n  const [loadingPanels, setLoadingPanels] = useState<boolean>(false)\r\n  const [mainPanels, setMainPanels] = useState<Dictionary<SelectedGovPanel>>({})\r\n  const [additionalPanels, setAdditionalPanels] = useState<Dictionary<SelectedGovPanel>>({})\r\n\r\n  const isPOCTSample = () => [\"QT\", \"QTS\"].includes(sampleTypeCode)\r\n\r\n  const isLabSample = useCallback(() => [\"UR\", \"SLD\"].includes(sampleTypeCode), [sampleTypeCode])\r\n\r\n  const populatePanels = useCallback(\r\n    (data: SampleType[]) => {\r\n      return data.reduce<Dictionary<SelectedGovPanel>>((panels, sampleType) => {\r\n        sampleType.Panels.map((panel) => {\r\n          panels[panel.InternalCode || panel.ID] = {\r\n            SelectedStatus: PanelResult.NOT_SELECTED,\r\n            SendToLab: (isLabSample() && panel.InternalCode !== \"\") ? 1 : 0,   // Additional panels will have blank InternalCode\r\n            SampleTypeID: sampleType.SampleTypeID,\r\n            Code: panel.ID,\r\n            Name: panel.Name,\r\n            Label: panel.Name.split(\" \")[0] || panel.InternalCode || \"\",\r\n            ExternalID: panel.ExternalID || \"\",\r\n            InternalCode: panel.InternalCode || \"\",\r\n          }\r\n        })\r\n        return panels\r\n      }, {})\r\n    },\r\n    [isLabSample]\r\n  )\r\n\r\n  useEffect(() => {\r\n    setLoadingPanels(true)\r\n    const subscription = GovGetLabDeviceDrugs(sampleTypeCode, labCode, deviceID, accountID)\r\n      .pipe(finalize(() => setLoadingPanels(false)))\r\n      .subscribe(\r\n        (data) => {\r\n          const mainPanels: Dictionary<SelectedGovPanel> = {}\r\n          const additionalPanels: Dictionary<SelectedGovPanel> = {}\r\n          Object.entries(populatePanels(data)).forEach(([code, panel]) => {\r\n            ;(panel.InternalCode == \"\" ? additionalPanels : mainPanels)[code] = panel\r\n          })\r\n          setMainPanels(mainPanels)\r\n          setAdditionalPanels(additionalPanels)\r\n        },\r\n        (error) => toast.error(FormatError(error))\r\n      )\r\n    return () => subscription.unsubscribe()\r\n  }, [labCode, populatePanels])\r\n\r\n  useEffect(() => {\r\n    onLoading(loadingPanels)\r\n  }, [loadingPanels, onLoading])\r\n\r\n  useEffect(() => {\r\n    onUpdate(Object.values({ ...mainPanels, ...additionalPanels }))\r\n  }, [mainPanels, additionalPanels, onUpdate])\r\n\r\n  return (\r\n    <>\r\n      {loadingPanels && <>Loading...</>}\r\n      {isPOCTSample() && <MainPanels panels={mainPanels} loading={loadingPanels} onUpdate={setMainPanels} />}\r\n      <AdditionalPanels panels={additionalPanels} onUpdate={setAdditionalPanels} />\r\n    </>\r\n  )\r\n}\r\n\r\nexport default Panels\r\n","import React, { PureComponent } from \"react\"\r\nimport { Col, Container, Modal, Row } from \"react-bootstrap\"\r\nimport { toast } from \"react-toastify\"\r\nimport { Subscription } from \"rxjs\"\r\nimport GovSendToLab, { GovMarkAsComplete, SendResult } from \"../../api/Randoms/GovPerformCollection\"\r\nimport SelectedGovPanel, { GovPerformCollectionData } from \"../../api/Randoms/GovPoolModel/GovPerformCollection\"\r\nimport ActionButton from \"../ActionButton\"\r\nimport printPdf from \"../../utils/printPdf\"\r\nimport DonorInfo from \"../GovPerformCollection/DonorInfo\"\r\nimport RecordTemperature, { Temperature } from \"../GovPerformCollection/RecordTemperature\"\r\nimport { finalize } from \"rxjs/operators\"\r\nimport InputSpecimenId from \"../GovPerformCollection/InputSpecimenId\"\r\nimport CollectorNotes from \"../GovPerformCollection/CollectorNotes\"\r\nimport FormatError from \"../../formatters/FormatError\"\r\nimport Panels from \"../GovPerformCollection/Panels\"\r\nimport { PanelResult } from \"../../api/GovPerformCollection/PanelResult\"\r\n\r\nexport interface GovPerformCollectionProps {\r\n  testName?: string\r\n  testDetailID: number\r\n  testDetailIDHash: string\r\n  referenceID: number\r\n  sampleTypeCode: string\r\n  sampleTypeID: number\r\n  labCode: string\r\n  sampleID: string\r\n  tempInRange?: number\r\n  personID?: number\r\n  firstName?: string\r\n  lastName?: string\r\n  dateOfBirth?: Date\r\n  gender?: string\r\n  collectorNotes?: string\r\n  onHide: (collected?: boolean) => void\r\n  DeviceID: number\r\n  AccountID: number\r\n}\r\n\r\ninterface GovPerformCollectionState {\r\n  loading: boolean\r\n  collected: boolean\r\n  sendingToLab: boolean\r\n  markingAsComplete: boolean\r\n  isTempRangeValid: boolean\r\n  isSampleIdValid: boolean\r\n  validate: boolean | undefined\r\n  data: GovPerformCollectionData\r\n}\r\n\r\nexport default class GovPerformCollection extends PureComponent<GovPerformCollectionProps, GovPerformCollectionState> {\r\n  state: GovPerformCollectionState = {\r\n    loading: false,\r\n    collected: false,\r\n    sendingToLab: false,\r\n    markingAsComplete: false,\r\n    isTempRangeValid: this.props.tempInRange !== Temperature.NOT_SELECTED,\r\n    isSampleIdValid: true,\r\n    validate: undefined,\r\n    data: {\r\n      TestDetailID: this.props.testDetailID,\r\n      TestDetailIDHash: this.props.testDetailIDHash,\r\n      ReferenceID: this.props.referenceID,\r\n      SampleTypeCode: this.props.sampleTypeCode || \"\",\r\n      SampleTypeID: this.props.sampleTypeID,\r\n      TempInRange: this.props.tempInRange || Temperature.NOT_SELECTED,\r\n      SampleID: [\"N/P\"].includes(this.props.sampleID) ? \"\" : this.props.sampleID,\r\n      CollectorNotes: this.props.collectorNotes || \"\",\r\n      SelectedPanels: [],\r\n      DeviceID: this.props.DeviceID || 0\r\n    }\r\n  }\r\n\r\n  markAsCompleteSubscription?: Subscription = undefined\r\n  sendToLabSubscription?: Subscription = undefined\r\n\r\n  componentWillUnmount() {\r\n    this.markAsCompleteSubscription && this.markAsCompleteSubscription.unsubscribe()\r\n    this.sendToLabSubscription && this.sendToLabSubscription.unsubscribe()\r\n  }\r\n\r\n  withoutNotAvailable = () => this.state.data.SelectedPanels.filter(p => p.ExternalID !== \"\")\r\n\r\n  isAllMainPanelsSelected = (type: number) => {\r\n    const panels = this.withoutNotAvailable().filter(p => !this.isAdditional(p))\r\n    return panels.length > 0 && panels.every(p => p.SelectedStatus === type)\r\n  }\r\n\r\n  isUrineSample = () => [\"UR\", \"QT\"].includes(this.props.sampleTypeCode)\r\n\r\n  isPOCTSample = () => [\"QT\", \"QTS\"].includes(this.props.sampleTypeCode)\r\n\r\n  isLabSample = () => [\"UR\", \"SLD\"].includes(this.props.sampleTypeCode)\r\n\r\n  hasSendToLabPanels = () => this.withoutNotAvailable().some(p => p.SendToLab === 1)\r\n\r\n  isCanMarkAsComplete = () => !this.hasSendToLabPanels()\r\n\r\n  isCanSendToLab = () => this.isLabSample() || this.hasSendToLabPanels()\r\n\r\n  isAdditional = (panel: SelectedGovPanel) => panel.Code.startsWith(\"W\")\r\n\r\n  showMarkAsComplete = () => {\r\n    return this.isPOCTSample() &&\r\n      !this.withoutNotAvailable().some(p => p.SelectedStatus === PanelResult.NOT_SELECTED && !this.isAdditional(p));\r\n  }\r\n\r\n  showCanSendToLab = () => {\r\n    return this.isLabSample() || this.withoutNotAvailable()\r\n      .some(p => p.SendToLab === 1);\r\n  }\r\n\r\n  resultProcessing = (data: SendResult) => {\r\n    if (data.Success) {\r\n      if (data.ImageData !== \"\") {\r\n        printPdf(data.ImageData)\r\n      }\r\n      this.setState({ collected: true }, this.onHide);\r\n    } else {\r\n      toast.error(data.Text)\r\n    }\r\n  }\r\n\r\n  onMarkAsComplete = () => {\r\n    this.setState({ markingAsComplete: true })\r\n    if (!this.validateForm()) {\r\n      this.setState({ markingAsComplete: false })\r\n      return\r\n    }\r\n\r\n    const panels = this.state.data.SelectedPanels.filter(p=> !this.isAdditional(p))\r\n    const data = {...this.state.data, SelectedPanels: panels}\r\n\r\n    this.markAsCompleteSubscription && this.markAsCompleteSubscription.unsubscribe()\r\n    this.markAsCompleteSubscription = GovMarkAsComplete(data)\r\n      .pipe(finalize(() => this.setState({ markingAsComplete: false })))\r\n      .subscribe(\r\n        data => this.resultProcessing(data),\r\n        error => toast.error(FormatError(error))\r\n      )\r\n  }\r\n\r\n  onSendToLab = () => {\r\n    this.setState({ sendingToLab: true })\r\n    if (!this.validateForm()) {\r\n      this.setState({ sendingToLab: false })\r\n      return\r\n    }\r\n\r\n    this.sendToLabSubscription && this.sendToLabSubscription.unsubscribe()\r\n    this.sendToLabSubscription = GovSendToLab(this.state.data)\r\n      .pipe(finalize(() => this.setState({ sendingToLab: false })))\r\n      .subscribe(\r\n        data => this.resultProcessing(data),\r\n        error => toast.error(FormatError(error))\r\n      )\r\n  }\r\n\r\n  onHide = () => this.props.onHide(this.state.collected)\r\n\r\n  onChangeTemperature = (value: number, isValid: boolean) =>\r\n    this.setState(prev => ({ ...prev, isTempRangeValid: isValid, data: { ...prev.data, TempInRange: value } }))\r\n\r\n  onChangeSpecimenId = (value: string, isValid: boolean) =>\r\n    this.setState(prev => ({ ...prev, isSampleIdValid: isValid, validate: true, data: { ...prev.data, SampleID: value } }))\r\n\r\n  onChangeCollectorNotes = (value: string) =>\r\n    this.setState(prev => ({ ...prev, data: { ...prev.data, CollectorNotes: value } }))\r\n\r\n  onUpdatePanels = (panels: SelectedGovPanel[]) =>\r\n    this.setState(prev => ({ ...prev, data: { ...prev.data, SelectedPanels: panels } }))\r\n\r\n  onSetLoading = (loading: boolean) =>\r\n    this.setState({ loading: loading })\r\n\r\n  validateTemp = () => !this.isUrineSample() || this.state.isTempRangeValid\r\n\r\n  validateForm = () => {\r\n    this.setState(prev => ({ ...prev, validate: !prev.validate }))\r\n    return this.state.isSampleIdValid && this.validateTemp()\r\n  }\r\n\r\n  render() {\r\n    const { loading, markingAsComplete, sendingToLab } = this.state\r\n    const { SampleID, TempInRange } = this.state.data\r\n\r\n    return (\r\n      <Modal backdrop=\"static\" show={true} onHide={this.onHide} size=\"xl\" dialogClassName=\"dark\">\r\n        <Modal.Header closeButton={true}>\r\n          <Modal.Title>PERFORM COLLECTION</Modal.Title>\r\n        </Modal.Header>\r\n        <Modal.Body className=\"event-details\">\r\n          <Container fluid className=\"grid-container event-grid\">\r\n            <DonorInfo\r\n              personID={this.props.personID}\r\n              firstName={this.props.firstName}\r\n              lastName={this.props.lastName}\r\n              dateOfBirth={this.props.dateOfBirth}\r\n              gender={this.props.gender}\r\n              />\r\n            {this.props.testName && <Container className=\"pt-3\"><Row><Col md={3}><h6>Test to be performed:</h6></Col><Col className=\"mx-2\">{this.props.testName}</Col></Row></Container>}\r\n            {(this.isUrineSample()) && <RecordTemperature\r\n              temperature={TempInRange}\r\n              required={this.isUrineSample()}\r\n              disabled={loading}\r\n              validate={this.state.validate}\r\n              onChange={this.onChangeTemperature} />}\r\n            <Panels\r\n              labCode={this.props.labCode}\r\n              sampleTypeCode={this.props.sampleTypeCode}\r\n              onUpdate={this.onUpdatePanels}\r\n              onLoading={this.onSetLoading}\r\n              deviceID={this.props.DeviceID}\r\n              accountID={this.props.AccountID} />\r\n            <InputSpecimenId\r\n              sampleId={SampleID}\r\n              disabled={loading}\r\n              required={this.isCanSendToLab()}\r\n              validate={this.state.validate}\r\n              onChange={this.onChangeSpecimenId} />\r\n            <CollectorNotes\r\n              disabled={loading}\r\n              notes={this.state.data.CollectorNotes}\r\n              onChange={this.onChangeCollectorNotes} />\r\n          </Container>\r\n        </Modal.Body>\r\n        {<Modal.Footer>\r\n          {this.showCanSendToLab() && <ActionButton variant=\"primary\"\r\n            disabled={!this.isCanSendToLab() || loading || sendingToLab}\r\n            onClick={this.onSendToLab}\r\n            spin={sendingToLab}>Send To Lab</ActionButton>}\r\n          {this.showMarkAsComplete() && <ActionButton variant=\"primary\"\r\n            disabled={!this.isCanMarkAsComplete() || loading || markingAsComplete}\r\n            onClick={this.onMarkAsComplete}\r\n            spin={markingAsComplete}>Mark as Complete</ActionButton>}\r\n        </Modal.Footer>}\r\n      </Modal>\r\n    )\r\n  }\r\n}\r\n","import { FaRandom } from \"react-icons/fa\"\r\n\r\ninterface RandomTestCardProps {\r\n  description: string\r\n  useIcon?: boolean\r\n}\r\n\r\nfunction RandomTestCard(props: RandomTestCardProps) {\r\n  const { description, useIcon } = props\r\n\r\n  return (\r\n    <div className=\"d-flex align-items-center\">\r\n      <div>{description}</div>\r\n      <div className=\"ml-auto text-success\" title=\"Random selection test\">\r\n        {useIcon ? <FaRandom /> : <div>R</div>}\r\n      </div>\r\n    </div>\r\n  )\r\n}\r\nRandomTestCard.defaultProps = {\r\n  useIcon: false,\r\n}\r\nexport default RandomTestCard\r\n","import React, { Component } from \"react\"\r\n\r\nimport { Button, Col, Container, Form, OverlayTrigger, Popover, Row } from \"react-bootstrap\"\r\nimport { Typeahead } from \"react-bootstrap-typeahead\"\r\nimport { FaAngleDown, FaInfoCircle, FaPencilAlt, FaTimes } from \"react-icons/fa\"\r\nimport { connect } from \"react-redux\"\r\nimport { toast } from \"react-toastify\"\r\nimport { Subscription } from \"rxjs\"\r\n\r\nimport CardRow from \"./Cards/CardRow\"\r\nimport PhoneNumbers from \"./Cards/PhoneNumbers\"\r\nimport {\r\n  hasCachedCollectionTests,\r\n  isProcessingCollection,\r\n  ProcessingCollectionLabel,\r\n} from \"../../../api/CachedCollectionTest\"\r\nimport EmployeeCategoriesGetObservable from \"../../../api/LabService/EmployeeCategoriesGet\"\r\nimport EmployeeCategory from \"../../../api/LabService/LabServiceModel/EmployeeCategory\"\r\nimport RegulatoryMode from \"../../../api/LabService/LabServiceModel/RegulatoryMode\"\r\nimport LabServiceRegulatoryModesGetObservable from \"../../../api/LabService/LabServiceRegulatoryModesGet\"\r\nimport OrderResultRecord from \"../../../api/OrderResults/OrderResultModel/OrderResultRecord\"\r\nimport ServiceDetails from \"../../../api/OrderResults/OrderResultModel/ServiceDetails\"\r\nimport TestEventUpdateData from \"../../../api/OrderResults/OrderResultModel/TestEventUpdateData\"\r\nimport PhoneType from \"../../../api/PhoneType\"\r\nimport { AppState } from \"../../../AppState\"\r\nimport { BuildUserAccess } from \"../../../authentication/BuildUserAccess\"\r\nimport FormatError from \"../../../formatters/FormatError\"\r\nimport GovPerformCollection, { GovPerformCollectionProps } from \"../../OrderRequests/GovPerformCollection\"\r\nimport RandomTestCard from \"../RandomTestCard\"\r\n\r\nenum TestReleaseStatusID {\r\n  PendingCollection = 1,\r\n  CollectionInProcess = 2,\r\n  PendingLaboratoryTesting = 7\r\n}\r\n\r\ninterface DrugTestProps {\r\n  currentRowInfo: OrderResultRecord\r\n  currentServiceInfo: ServiceDetails\r\n  isOnTrack?: boolean\r\n  editModeChanged: (editMode: boolean) => void\r\n  updateFields: (testEventData: TestEventUpdateData) => void\r\n  onMerge?: () => void\r\n  onHide?: (collected?: boolean) => void\r\n}\r\n\r\ninterface DrugTestAuthProps {\r\n  canEditPendingOrders?: boolean\r\n  canMergeTests?: boolean\r\n}\r\n\r\ninterface DrugTestState {\r\n  showPerformCollection: boolean\r\n  editing: boolean\r\n  ccfPersonnelID: string\r\n  ccfName: string\r\n  ccfFirstName: string\r\n  ccfLastName: string\r\n  testEventData: TestEventUpdateData\r\n  availableRegulatoryModes: RegulatoryMode[]\r\n  isRegulatoryModesLoading: boolean\r\n  selectedRegulatoryMode?: RegulatoryMode\r\n  availableCategories: EmployeeCategory[]\r\n  isCategoriesLoading: boolean\r\n  selectedCategory?: EmployeeCategory\r\n}\r\n\r\nclass DrugTestInfo extends Component<DrugTestProps & DrugTestAuthProps, DrugTestState> {\r\n  testEventData: TestEventUpdateData = {\r\n    PersonnelID: this.props.currentServiceInfo.CCFPersonnelID,\r\n    FirstName: this.props.currentServiceInfo.CCFFirstName,\r\n    LastName: this.props.currentServiceInfo.CCFLastName,\r\n    Phones: {\r\n      [PhoneType.Home]: { number: this.props.currentRowInfo.HomePhone, isRequired: false },\r\n      [PhoneType.Work]: { number: this.props.currentRowInfo.WorkPhone, isRequired: true },\r\n      [PhoneType.Cell]: { number: this.props.currentRowInfo.CellPhone, isRequired: false },\r\n    },\r\n    RegulatoryModeID: this.props.currentServiceInfo.EventData.RegulatoryModeID ?? 0,\r\n    EmployeeCategoryID: this.props.currentServiceInfo.EventData.EmployeeCategoryID ?? 0,\r\n  }\r\n\r\n  baseNameState = {\r\n    ccfName: this.props.currentServiceInfo.CCFName,\r\n    ccfFirstName: this.props.currentServiceInfo.CCFFirstName,\r\n    ccfLastName: this.props.currentServiceInfo.CCFLastName\r\n  }\r\n\r\n  state: DrugTestState = {\r\n    showPerformCollection: false,\r\n    editing: false,\r\n    ccfPersonnelID: this.props.currentServiceInfo.CCFPersonnelID,\r\n    ...this.baseNameState,\r\n    testEventData: this.testEventData,\r\n    isRegulatoryModesLoading: false,\r\n    isCategoriesLoading: false,\r\n    availableRegulatoryModes: [],\r\n    availableCategories: [],\r\n  }\r\n\r\n  subscriptions = new Subscription()\r\n\r\n  regulatoryModeTypeahead = React.createRef<Typeahead<RegulatoryMode>>()\r\n\r\n  categoryTypeahead = React.createRef<Typeahead<EmployeeCategory>>()\r\n\r\n  componentDidMount() {\r\n    const { currentServiceInfo } = this.props\r\n    this.subscriptions.add(\r\n      LabServiceRegulatoryModesGetObservable().subscribe(\r\n        (modes: RegulatoryMode[]) => {\r\n          const curMode = modes.find(\r\n            (el) => el.RegulatoryModeID === (currentServiceInfo.EventData?.RegulatoryModeID || 0)\r\n          )\r\n          this.setState(\r\n            {\r\n              availableRegulatoryModes: modes,\r\n              selectedRegulatoryMode: curMode,\r\n              isRegulatoryModesLoading: false,\r\n            },\r\n            () => this.loadCategories(curMode)\r\n          )\r\n        },\r\n        (error) => {\r\n          toast.error(FormatError(error))\r\n          this.setState({ isRegulatoryModesLoading: false })\r\n        }\r\n      )\r\n    )\r\n  }\r\n\r\n  componentWillUnmount() {\r\n    this.subscriptions.unsubscribe()\r\n  }\r\n\r\n  showPerformCollection = () => {\r\n    this.setState({ showPerformCollection: true })\r\n  }\r\n\r\n  closePerformCollection = (collected?: boolean) => {\r\n    this.setState({ showPerformCollection: false }, () => this.props.onHide && this.props.onHide(collected))\r\n  }\r\n\r\n  handleToggleEditMode = () => this.setState((prevState) => {\r\n    const isEditNow = !prevState.editing\r\n    this.props.editModeChanged(isEditNow)\r\n    return {\r\n      editing: isEditNow,\r\n      testEventData: this.testEventData,\r\n      ccfPersonnelID: isEditNow ? '' : this.props.currentServiceInfo.CCFPersonnelID,\r\n      selectedRegulatoryMode: this.state.availableRegulatoryModes.find((el) => el.RegulatoryModeID === this.testEventData.RegulatoryModeID),\r\n      selectedCategory: undefined,\r\n      ...this.baseNameState\r\n    }\r\n  }, () => this.loadCategories(this.state.selectedRegulatoryMode))\r\n\r\n  handleDonorIdChange = (event: React.ChangeEvent<HTMLInputElement>) => {\r\n    const value = event.target.value.trim()\r\n    this.setState((prevState) => {\r\n      return { testEventData: { ...prevState.testEventData, PersonnelID: value.length > 0 ? value : this.props.currentServiceInfo.CCFPersonnelID }, ccfPersonnelID: value }\r\n    },\r\n      () => { this.props.updateFields(this.state.testEventData) }\r\n    )\r\n  }\r\n\r\n  handleCcfFirstNameChange = (event: React.ChangeEvent<HTMLInputElement>) => {\r\n    const value = event.target.value.trim()\r\n    this.setState((prevState) => {\r\n      return { testEventData: { ...prevState.testEventData, FirstName: value.length > 0 ? value : this.props.currentServiceInfo.CCFFirstName }, ccfFirstName: value }\r\n    },\r\n      () => { this.props.updateFields(this.state.testEventData) }\r\n    )\r\n  }\r\n\r\n  handleCcfLastNameChange = (event: React.ChangeEvent<HTMLInputElement>) => {\r\n    const value = event.target.value.trim()\r\n    this.setState((prevState) => {\r\n      return { testEventData: { ...prevState.testEventData, LastName: value.length > 0 ? value : this.props.currentServiceInfo.CCFLastName }, ccfLastName: value }\r\n    },\r\n      () => { this.props.updateFields(this.state.testEventData) }\r\n    )\r\n  }\r\n\r\n  handleRegulatoryModeChange = (items: RegulatoryMode[]) => {\r\n    this.setState((prevState) => {\r\n      return {\r\n        testEventData: { ...prevState.testEventData, EmployeeCategoryID: 0, RegulatoryModeID: items.length > 0 ? items[0].RegulatoryModeID : 0 }, \r\n        selectedRegulatoryMode: items.length > 0 ? items[0] : undefined,\r\n        selectedCategory: undefined,\r\n        availableCategories: items.length > 0 ? prevState.availableCategories : [],\r\n      }\r\n    },\r\n      () => {\r\n        if (items.length > 0) this.loadCategories(items[0])\r\n        this.props.updateFields(this.state.testEventData)\r\n      }\r\n    )\r\n\r\n  }\r\n\r\n  handleCategoryChange = (items: EmployeeCategory[]) => {\r\n    this.setState((prevState) => {\r\n      return {\r\n        testEventData: { ...prevState.testEventData, EmployeeCategoryID: items.length > 0 ? items[0].EmployeeCategoryID : this.props.currentServiceInfo.EventData.EmployeeCategoryID ?? 0 }, \r\n        selectedCategory: items.length > 0 ? items[0] : undefined,\r\n      }\r\n    },\r\n      () => this.props.updateFields(this.state.testEventData)\r\n    )\r\n  }\r\n\r\n  createGovPerformCollectionProps = (): GovPerformCollectionProps => {\r\n    const {currentRowInfo, currentServiceInfo} = this.props\r\n    const testDetailID: number = 0\r\n    const testDetailIDHash: string = currentRowInfo.TestDetailID || currentServiceInfo.TestDetailID || \"\"\r\n    const referenceID: number = currentServiceInfo.FormFoxTestAN || 0\r\n    const sampleTypeCode: string = currentServiceInfo.SampleType?.Code || \"\"\r\n    const sampleTypeID: number = currentServiceInfo.SampleTypeID\r\n    const labCode: string = currentServiceInfo.LabAccountNumber || \"\"\r\n    const sampleID: string = currentRowInfo.SampleID || currentServiceInfo.SampleID || \"\"\r\n    const tempInRange: number = currentServiceInfo.TemperatureInRange === undefined ? 0 : currentServiceInfo.TemperatureInRange ? 1 : 2\r\n    const accountID: number = currentRowInfo.CompanyID as number\r\n    const result: GovPerformCollectionProps = {\r\n      testDetailID: testDetailID,\r\n      testDetailIDHash: testDetailIDHash,\r\n      sampleTypeCode: sampleTypeCode,\r\n      sampleTypeID: sampleTypeID,\r\n      referenceID: referenceID,\r\n      labCode: labCode,\r\n      sampleID: sampleID,\r\n      tempInRange: tempInRange,\r\n      personID: currentRowInfo.PersonID,\r\n      collectorNotes: currentServiceInfo.TestDetailDocument?.CollectorNotes,\r\n      onHide: this.closePerformCollection,\r\n      DeviceID: 0,\r\n      AccountID: accountID\r\n    }\r\n    return result\r\n  }\r\n\r\n  onPhoneNumberChange = (value: string, type: PhoneType) => {\r\n    this.setState(prev => ({\r\n      ...prev,\r\n      testEventData: {\r\n        ...prev.testEventData,\r\n        Phones: { \r\n          ...prev.testEventData.Phones,\r\n          [type]: {\r\n            ...prev.testEventData.Phones[type], \r\n            number: value.replace(/\\D/g, \"\")\r\n          }\r\n        }\r\n      }\r\n    }),\r\n    () => { this.props.updateFields(this.state.testEventData) })\r\n  }\r\n\r\n  loadCategories = (regulatoryMode?: RegulatoryMode) => {\r\n    if (!regulatoryMode) return\r\n    this.setState({ isCategoriesLoading: true })\r\n    const { currentServiceInfo } = this.props\r\n    this.subscriptions.add(\r\n      EmployeeCategoriesGetObservable(regulatoryMode.RegulatoryModeID).subscribe(\r\n        (categories: EmployeeCategory[]) => {\r\n          const curCat = categories.find(\r\n            (el) => el.EmployeeCategoryID === (currentServiceInfo.EventData?.EmployeeCategoryID || 0)\r\n          )\r\n          this.setState({\r\n            availableCategories: categories,\r\n            selectedCategory: curCat,\r\n            isCategoriesLoading: false,\r\n          })\r\n        },\r\n        (error) => {\r\n          toast.error(FormatError(error))\r\n          this.setState({ isCategoriesLoading: false })\r\n        }\r\n      )\r\n    )\r\n  }\r\n\r\n  render() {\r\n    const { currentRowInfo, currentServiceInfo, isOnTrack, canEditPendingOrders, canMergeTests } = this.props\r\n    const {\r\n      editing,\r\n      isRegulatoryModesLoading,\r\n      availableRegulatoryModes,\r\n      selectedRegulatoryMode,\r\n      isCategoriesLoading,\r\n      availableCategories,\r\n      selectedCategory,\r\n      testEventData: { Phones },\r\n    } = this.state\r\n    const panelInfo = currentServiceInfo.Panel\r\n    const EventData = currentServiceInfo.EventData\r\n    const isPending = currentRowInfo.TestReleaseStatusID === TestReleaseStatusID.PendingCollection\r\n    const isProcessing = currentRowInfo.TestReleaseStatusID === TestReleaseStatusID.CollectionInProcess ||\r\n      currentRowInfo.TestReleaseStatusID === TestReleaseStatusID.PendingLaboratoryTesting\r\n    const isProcessingTest = !hasCachedCollectionTests() || isProcessingCollection(currentRowInfo.TestDetailID)\r\n    const isDrug = currentServiceInfo.TestTypeDescription === \"Drug\"\r\n    const isEditable = !currentRowInfo.DateCollected\r\n    const performCollectionProps = this.createGovPerformCollectionProps()\r\n\r\n    const regEl = (\r\n      <Typeahead\r\n        id=\"regMode\"\r\n        ref={this.regulatoryModeTypeahead}\r\n        labelKey=\"Name\"\r\n        filterBy={(option, props) =>\r\n          props.selected.length > 0 || option?.Name.toLowerCase().indexOf(props.text.toLowerCase()) !== -1\r\n        }\r\n        onChange={this.handleRegulatoryModeChange}\r\n        disabled={isRegulatoryModesLoading || availableRegulatoryModes.length === 0}\r\n        options={availableRegulatoryModes}\r\n        selected={selectedRegulatoryMode ? [selectedRegulatoryMode] : []}\r\n        emptyLabel={isRegulatoryModesLoading ? \"LOADING...\" : \"No Regulatory Modes Found\"}\r\n        placeholder=\"Select\"\r\n      >\r\n        <Button\r\n          variant=\"toggle\"\r\n          onClick={() => {\r\n            this.regulatoryModeTypeahead.current?.toggleMenu()\r\n          }}\r\n        >\r\n          <FaAngleDown />\r\n        </Button>\r\n      </Typeahead>\r\n    )\r\n\r\n    const validCategory =\r\n      selectedRegulatoryMode === undefined ||\r\n      (!!selectedRegulatoryMode && !isCategoriesLoading && (!!selectedCategory || availableCategories.length === 0))\r\n\r\n    const catEl = (\r\n      <Typeahead\r\n        id=\"category\"\r\n        ref={this.categoryTypeahead}\r\n        labelKey=\"Name\"\r\n        filterBy={(option, props) =>\r\n          props.selected.length > 0 || option.Name.toLowerCase().indexOf(props.text.toLowerCase()) !== -1\r\n        }\r\n        onChange={this.handleCategoryChange}\r\n        disabled={isCategoriesLoading || (!isCategoriesLoading && availableCategories.length === 0)}\r\n        isInvalid={!validCategory}\r\n        options={availableCategories}\r\n        selected={selectedCategory ? [selectedCategory] : []}\r\n        emptyLabel={isCategoriesLoading ? \"LOADING...\" : \"No Categories Found\"}\r\n        placeholder=\"Select\"\r\n      >\r\n        <Button\r\n          variant=\"toggle\"\r\n          onClick={() => {\r\n            this.categoryTypeahead.current?.toggleMenu()\r\n          }}\r\n        >\r\n          <FaAngleDown />\r\n        </Button>\r\n      </Typeahead>\r\n    )\r\n\r\n    return (\r\n      <Container>\r\n        {this.state.showPerformCollection &&\r\n          <GovPerformCollection\r\n            testDetailID={performCollectionProps.testDetailID}\r\n            testDetailIDHash={performCollectionProps.testDetailIDHash}\r\n            referenceID={performCollectionProps.referenceID}\r\n            sampleTypeCode={performCollectionProps.sampleTypeCode}\r\n            sampleTypeID={performCollectionProps.sampleTypeID}\r\n            labCode={performCollectionProps.labCode}\r\n            sampleID={performCollectionProps.sampleID}\r\n            tempInRange={performCollectionProps.tempInRange}\r\n            personID={performCollectionProps.personID}\r\n            collectorNotes={performCollectionProps.collectorNotes}\r\n            onHide={performCollectionProps.onHide}\r\n            DeviceID={currentServiceInfo.ScreenDeviceID || 0}\r\n            AccountID={performCollectionProps.AccountID}\r\n            />\r\n        }\r\n\r\n        <Row>\r\n          <Col md={8} className=\"pt-0\">\r\n            <h5>\r\n              {!isOnTrack && <span className=\"text-uppercase\">{currentServiceInfo.TestTypeDescription}</span>} TEST DETAIL <span className=\"text-uppercase\">{currentServiceInfo.CCFName}</span> {currentRowInfo ? currentRowInfo[\"DonorID\"] : \"\"}\r\n            </h5>\r\n          </Col>\r\n          {!isOnTrack && isEditable && canEditPendingOrders && <Col md={12}>\r\n            <Button variant=\"icon-link\" disabled={currentServiceInfo.IsRandom} className=\"float-right ml-1 btn-icon-primary\" size=\"sm\" onClick={this.handleToggleEditMode} >\r\n              {!this.state.editing && !currentServiceInfo.IsRandom && <FaPencilAlt />}\r\n              {!this.state.editing && currentServiceInfo.IsRandom &&\r\n                <OverlayTrigger placement=\"top\" delay={{ show: 100, hide: 400 }} overlay={\r\n                  <Popover id=\"defaultDisable\">\r\n                    Orders placed in the Selection Inbox may not be edited\r\n                  </Popover>}>\r\n                  <FaPencilAlt />\r\n                </OverlayTrigger>}\r\n              {this.state.editing && <FaTimes />}\r\n            </Button>\r\n          </Col>}\r\n          <Col md={4} className=\"text-right\">\r\n            {isOnTrack && isProcessing && currentRowInfo.FormFoxTestAN && isProcessingTest && <h4>{ProcessingCollectionLabel}</h4>}\r\n            {isOnTrack && isPending && <Button onClick={this.showPerformCollection}>Collect Test Now</Button>}\r\n          </Col>\r\n        </Row>\r\n        <Row className=\"drug-test-info\">\r\n          <Col xs={12} sm={6}>\r\n            <CardRow title=\"PRIMARY ID\" value={`${currentRowInfo.DonorID || \"\"} (${EventData?.PrimaryIDType})`} />\r\n            {!this.state.editing && <CardRow title=\"PERSONNEL ID\" value={`${currentRowInfo.DonorID || \"\"} (${EventData?.PrimaryIDType})`} />}\r\n            {this.state.editing && <Row className=\"p-1\">\r\n              <Form.Label column sm={4} className=\"align-middle\" htmlFor=\"donorId\">\r\n                PERSONNEL ID\r\n                <OverlayTrigger placement=\"top\" delay={{ show: 100, hide: 400 }} overlay={\r\n                  <Popover id=\"defaultDisable\">\r\n                    Enter new value to update Primary ID\r\n                  </Popover>}>\r\n                  <FaInfoCircle className=\"mb-1 ml-2\" />\r\n                </OverlayTrigger>\r\n              </Form.Label>\r\n              <Col md={8} className=\"align-self-center\">\r\n                <Form.Control id=\"donorId\" type=\"text\" placeholder={currentRowInfo.DonorID} value={this.state.ccfPersonnelID} onChange={this.handleDonorIdChange} />\r\n              </Col>\r\n            </Row>}\r\n            {!this.state.editing && <CardRow title=\"NAME\" value={currentServiceInfo.CCFName} />}\r\n            {this.state.editing && <Row className=\"p-1 required\">\r\n              <Form.Label column sm={4} className=\"align-middle\" htmlFor=\"CCFFIrstName\">NAME</Form.Label>\r\n              <Col md={8} className=\"align-self-center\">\r\n                <Form.Control id=\"CCFFirstName\" type=\"text\" value={this.state.ccfFirstName} onChange={this.handleCcfFirstNameChange} />\r\n              </Col>\r\n            </Row>}\r\n            {this.state.editing && <Row className=\"p-1\">\r\n              <Form.Label column sm={4} className=\"align-middle\" htmlFor=\"CCFLastName\">&nbsp;</Form.Label>\r\n              <Col md={8} className=\"align-self-center\">\r\n                <Form.Control id=\"CCFLastName\" type=\"text\" value={this.state.ccfLastName} onChange={this.handleCcfLastNameChange} />\r\n              </Col>\r\n            </Row>}\r\n            {!isOnTrack && <PhoneNumbers phones={Phones} readonly={!editing} onChange={this.onPhoneNumberChange} />}\r\n            {!isOnTrack && !editing && <CardRow title=\"REGULATORY MODE\" value={EventData?.RegulatoryModeName} />}\r\n            {!isOnTrack && !editing && <CardRow title=\"EMPLOYEE CATEGORY\" value={EventData?.EmployeeCategoryName} />}\r\n            {!isOnTrack && editing && <CardRow title=\"REGULATORY MODE\" value={regEl} />}\r\n            {!isOnTrack && editing && <CardRow title=\"EMPLOYEE CATEGORY\" value={catEl} />}\r\n            <CardRow title=\"COMPANY NAME\" value={EventData?.CompanyName} />\r\n            {!isOnTrack && <CardRow title=\"LOCATION\" value={EventData?.LocationName} />}\r\n            {!isOnTrack && this.props.currentServiceInfo.LabAccountNumber && isDrug && <CardRow title=\"LAB ACCOUNT\" value={this.props.currentServiceInfo.LabAccountNumber} />}\r\n          </Col>\r\n          <Col xs={12} sm={6} className=\"summary-block\">\r\n            <Row>\r\n              <Col>\r\n                <Button variant=\"contained\">Summary:</Button>\r\n              </Col>\r\n              {!!canMergeTests && <Col className=\"text-right\">\r\n                <Button variant=\"link\" onClick={this.props.onMerge}>Merge</Button>\r\n              </Col>}\r\n            </Row>\r\n            <Container>\r\n              <CardRow title=\"REASON FOR TEST\">\r\n                {currentServiceInfo.IsRandom && <RandomTestCard description={currentServiceInfo.TestReasonDescription} />} \r\n                {!currentServiceInfo.IsRandom && <>{currentServiceInfo.TestReasonDescription}</> }\r\n              </CardRow>\r\n              {isOnTrack && <CardRow title=\"Specimen / Reference ID\" value={currentServiceInfo.SampleID} />}\r\n              {!isOnTrack && <>\r\n                <Row>\r\n                  <Col xs={6} md={4}>TEST TYPE</Col>\r\n                  <Col xs={6} md={2} className=\"status-text\">{currentServiceInfo.TestTypeDescription}</Col>\r\n                  <Col xs={12} md={6}>\r\n                    <Col xs={6} md={12} className=\"test-property\">Specimen / Reference ID</Col>\r\n                    <Col xs={6} md={12}>{currentServiceInfo.SampleID}</Col>\r\n                  </Col>\r\n                </Row>\r\n                <CardRow title=\"SAMPLE TYPE\" value={currentServiceInfo.SampleTypeDescription} />\r\n                <CardRow title=\"PANEL\" value={panelInfo?.Description || currentServiceInfo.PanelDescription} />\r\n                <CardRow title=\"REGULATED\" value={currentServiceInfo.DOT} bool />\r\n              </>}\r\n              <CardRow title=\"EVENT STATUS\" value={currentServiceInfo.TestReleaseStatusDescription} />\r\n            </Container>\r\n          </Col>\r\n        </Row>\r\n      </Container>\r\n    )\r\n  }\r\n}\r\nfunction mapStateToProps(state: AppState): DrugTestAuthProps {\r\n  const userAccess = BuildUserAccess(state)\r\n  return {\r\n    canEditPendingOrders: userAccess.canEditPendingOrders,\r\n    canMergeTests: userAccess.canMergeTests\r\n  }\r\n}\r\nconst ConnectedDrugTestInfo = connect(mapStateToProps, null)(DrugTestInfo)\r\nexport default ConnectedDrugTestInfo\r\n","import React, { Component } from \"react\"\r\nimport { Modal } from \"react-bootstrap\"\r\nimport DrugTestInfo from \"./EventDetails/DrugTestInfo\"\r\nimport TestSteps from \"./EventDetails/TestSteps\"\r\nimport OrderResultRecord from \"../../api/OrderResults/OrderResultModel/OrderResultRecord\"\r\nimport { Subscription } from \"rxjs\"\r\nimport { toast } from \"react-toastify\"\r\nimport { CurrentServiceDetails, UpdateServiceData } from \"../../api/OrderResults/CurrentServiceDetails\"\r\nimport ServiceDetails from \"../../api/OrderResults/OrderResultModel/ServiceDetails\"\r\nimport { ImplementationTypeGovt, StorageKey } from \"../../config/Constants\"\r\nimport TestEventUpdateData from \"../../api/OrderResults/OrderResultModel/TestEventUpdateData\"\r\nimport PhoneType from \"../../api/PhoneType\"\r\nimport { APIError } from \"../../api/ObservableFromFetch\"\r\nimport ConfirmationModal from \"../ConfirmationModal\"\r\nimport ActionButton from \"../ActionButton\"\r\n\r\ninterface EventDetailsModalProps {\r\n  details: OrderResultRecord\r\n  onHide: (updated: boolean) => void\r\n  onRefreshGrid?: () => void\r\n  onMerge?: () => void\r\n}\r\n\r\ninterface EventDetailsModalState {\r\n  data?: ServiceDetails\r\n  loading: boolean\r\n  saving: boolean\r\n  editMode: boolean\r\n  testEventData?: TestEventUpdateData\r\n  oldRegulatoryModeID?: number,\r\n  oldEmployeeCategoryID?: number,\r\n  updated: boolean,\r\n  showConfirmSave: boolean\r\n}\r\n\r\nexport default class EventDetailsModal extends Component<EventDetailsModalProps, EventDetailsModalState> {\r\n  subscription?: Subscription\r\n  updateSubscription?: Subscription\r\n  state: EventDetailsModalState = { data: undefined, loading: false, saving: false, editMode: false, testEventData: undefined, updated: false, showConfirmSave: false }\r\n  isOnTrack: boolean = sessionStorage.getItem(StorageKey.ImplementationType) === ImplementationTypeGovt\r\n\r\n  componentDidMount() {\r\n    this.setState({ loading: true })\r\n    const details = this.props.details\r\n    this.subscription = CurrentServiceDetails({ TestDetailClinicalID: details.TestDetailClinicalID, TestDetailID: details.TestDetailID }).subscribe(\r\n      (data: ServiceDetails) => this.setState({ data: data, loading: false }),\r\n      (error: string) => {\r\n        this.setState({ loading: false })\r\n        toast.error(error)\r\n      },\r\n      () => this.setState({ loading: false })\r\n    )\r\n  }\r\n\r\n  handleAPIError = (error: Error | APIError) => {\r\n    error && toast.error((error as APIError)?.errorData?.message || error.message)\r\n  }\r\n\r\n  handleEditModeChanged = (editMode: boolean) => {\r\n    const { details: {HomePhone, WorkPhone, CellPhone} } = this.props\r\n    const { CCFPersonnelID, CCFFirstName, CCFLastName } = this.state.data || {}\r\n\r\n    const regulatoryModeID = this.state.data?.EventData?.RegulatoryModeID ?? 0\r\n    const employeeCategoryID = this.state.data?.EventData?.EmployeeCategoryID ?? 0\r\n\r\n    this.setState({\r\n      editMode: editMode,\r\n      testEventData: {\r\n        PersonnelID: CCFPersonnelID || \"\",\r\n        FirstName: CCFFirstName || \"\",\r\n        LastName: CCFLastName || \"\",\r\n        Phones: {\r\n          [PhoneType.Home]: { number: HomePhone, isRequired: false },\r\n          [PhoneType.Work]: { number: WorkPhone, isRequired: true },\r\n          [PhoneType.Cell]: { number: CellPhone, isRequired: false },\r\n        },\r\n        RegulatoryModeID: regulatoryModeID,\r\n        EmployeeCategoryID: employeeCategoryID,\r\n      },\r\n      oldRegulatoryModeID: regulatoryModeID,\r\n      oldEmployeeCategoryID: employeeCategoryID\r\n    })\r\n  }\r\n\r\n  handleUpdateFields = (testEventData: TestEventUpdateData) => {\r\n    this.setState({ testEventData: testEventData })\r\n  }\r\n\r\n  saveChanges = () => {\r\n    this.setState({ saving: true })\r\n    this.updateSubscription && this.updateSubscription.unsubscribe()\r\n    this.updateSubscription = UpdateServiceData(\r\n      { ...this.state.testEventData as TestEventUpdateData,\r\n        TestEventID: this.props.details.TestEventID,\r\n        IDType: this.props.details.IDType,\r\n        FormFoxTestAN: this.props.details.FormFoxTestAN\r\n      }).subscribe(\r\n      (data) => {\r\n        toast.success(data)\r\n        this.setState({ updated: true, saving: false }, () => this.props.onHide(this.state.updated))\r\n      },\r\n      (error) => {\r\n        this.setState({ saving: false })\r\n        this.handleAPIError(error)\r\n        this.props.onHide(this.state.updated)\r\n      })\r\n  }\r\n\r\n  handleSaveChanges = () => {\r\n    const { oldEmployeeCategoryID, oldRegulatoryModeID, testEventData } = this.state\r\n\r\n    if(oldEmployeeCategoryID !== testEventData?.EmployeeCategoryID || oldRegulatoryModeID !== testEventData?.RegulatoryModeID) {\r\n      this.setState({showConfirmSave: true})\r\n    } else {\r\n      this.saveChanges()\r\n    }\r\n  }\r\n\r\n  onHide = (collected?: boolean) => {\r\n    if (collected) {\r\n      this.props.onHide(this.state.updated)\r\n      this.props.onRefreshGrid?.()\r\n    }\r\n  }\r\n\r\n  handleConfirmSave = () => {\r\n    this.setState({showConfirmSave:false});\r\n    this.saveChanges();\r\n  }\r\n\r\n  handleConfirmClose = () => {\r\n    this.setState({showConfirmSave:false});\r\n  }\r\n\r\n  isPhonesValid = () => {\r\n    const { Phones } = this.state.testEventData || {}\r\n    \r\n    return (!Phones ||\r\n      Object.values(Phones).every(phone =>\r\n        !phone.isRequired ||\r\n        phone.number.replace(/\\D/g, \"\").length === 10)\r\n      )\r\n  }\r\n\r\n  isValid = () => {\r\n    return (\r\n      this.state.testEventData && \r\n      this.state.testEventData.FirstName.length > 0 &&\r\n      this.state.testEventData.LastName.length > 0 && \r\n      this.state.testEventData?.PersonnelID.length > 0 && \r\n      this.isPhonesValid()\r\n    )\r\n  }\r\n\r\n  componentWillUnmount() {\r\n    this.subscription && this.subscription.unsubscribe()\r\n    this.updateSubscription && this.updateSubscription.unsubscribe()\r\n  }\r\n\r\n  render() {\r\n    const currentRowInfo = this.props.details\r\n    const currentServiceInfo = this.state.data\r\n    const { saving}  = this.state\r\n    return currentRowInfo && currentServiceInfo ? (<>\r\n      <Modal show onHide={() => this.props.onHide(this.state.updated)} size=\"xl\" dialogClassName=\"dark\">\r\n        <Modal.Header closeButton>\r\n          <Modal.Title>VIEW/EDIT EVENT DETAILS</Modal.Title>\r\n        </Modal.Header>\r\n        <Modal.Body className=\"event-details\">\r\n          <DrugTestInfo\r\n            currentRowInfo={currentRowInfo}\r\n            updateFields={this.handleUpdateFields}\r\n            currentServiceInfo={currentServiceInfo}\r\n            isOnTrack={this.isOnTrack}\r\n            editModeChanged={this.handleEditModeChanged}\r\n            onMerge={this.props.onMerge}\r\n            onHide={this.onHide} />\r\n          <TestSteps currentRowInfo={currentRowInfo} currentServiceInfo={currentServiceInfo} isOnTrack={this.isOnTrack} />\r\n        </Modal.Body>\r\n        {this.state.editMode && <Modal.Footer>\r\n          <ActionButton variant=\"primary\" onClick={this.handleSaveChanges} disabled={!this.isValid() || saving} spin={saving} disableOnSpin>Save</ActionButton>\r\n        </Modal.Footer>}\r\n      </Modal>\r\n      <ConfirmationModal show={this.state.showConfirmSave}\r\n        title=\"CONFIRM\"\r\n        textTitle=\"Please also update the information with the lab to ensure laboratory reports are accurate and reflect the saved changes.\"\r\n        text=\"\"\r\n        showCancelButton={false}\r\n        showImage={false}\r\n        confirmButtonText=\"OK\"\r\n        onConfirm={this.handleConfirmSave}\r\n        onHide={this.handleConfirmClose} />\r\n      </>\r\n    ) : null\r\n  }\r\n}\r\n","import { Component } from \"react\"\r\n\r\nimport { Button, Container, Spinner, Table  } from \"react-bootstrap\"\r\nimport { toast } from \"react-toastify\"\r\nimport { BehaviorSubject, concat, of, Subscription } from \"rxjs\"\r\nimport { catchError, distinctUntilChanged, map, switchMap } from \"rxjs/operators\"\r\n\r\nimport { GetCurrentServiceHistory, ServiceHistoryGridResponse } from \"../../../api/OrderResults/CurrentServiceHistory\"\r\nimport OrderResultRecord from \"../../../api/OrderResults/OrderResultModel/OrderResultRecord\"\r\nimport FormatDate from \"../../../formatters/FormatDate\"\r\nimport FormatError from \"../../../formatters/FormatError\"\r\nimport TablePagination from \"../../TablePagination\"\r\nimport EventDetailsModal from \"../EventDetailsModal\"\r\n\r\ninterface CurrentServiceHistoryProps {\r\n  PersonID: number\r\n  PoolID?: number\r\n  PoolName?: string\r\n  isOntrack?: boolean\r\n}\r\n\r\ninterface CurrentServiceHistoryState {\r\n  loading: boolean\r\n  data?: ServiceHistoryGridResponse\r\n  detailsModal: boolean\r\n  details?: OrderResultRecord\r\n}\r\n\r\nconst PageSize = 10\r\n\r\ninterface GridParams {\r\n  pageNumber: number\r\n}\r\n\r\nexport default class CurrentServiceHistory extends Component<CurrentServiceHistoryProps, CurrentServiceHistoryState> {\r\n  state: CurrentServiceHistoryState = {\r\n    loading: false,\r\n    detailsModal: false,\r\n  }\r\n\r\n  page$ = new BehaviorSubject<GridParams>({\r\n    pageNumber: 1,\r\n  })\r\n\r\n  pageSubscription?: Subscription\r\n\r\n  componentDidMount() {\r\n    const { PersonID, PoolID } = this.props\r\n\r\n    this.setState({ loading: true })\r\n\r\n    this.pageSubscription = this.page$\r\n      .pipe(\r\n        distinctUntilChanged(),\r\n        switchMap((params: GridParams) =>\r\n          concat(\r\n            of({ loading: true }),\r\n            GetCurrentServiceHistory({ PersonID, PoolID, PageNumber: params.pageNumber, PageSize }).pipe(\r\n              map((result: ServiceHistoryGridResponse) => ({ data: result, loading: false })),\r\n              catchError((error) => of({ loading: false, errorMessage: FormatError(error) }))\r\n            )\r\n          )\r\n        )\r\n      )\r\n      .subscribe(\r\n        (newState: { loading: boolean; data?: ServiceHistoryGridResponse; errorMessage?: string }) => {\r\n          if (newState.data) {\r\n            this.setState({ loading: newState.loading, data: newState.data })\r\n          } else {\r\n            this.setState({ loading: newState.loading })\r\n          }\r\n          if (newState.errorMessage) {\r\n            toast.error(newState.errorMessage)\r\n          }\r\n        },\r\n        (error) => {\r\n          this.setState({ loading: false })\r\n          toast.error(FormatError(error))\r\n        }\r\n      )\r\n  }\r\n\r\n  componentWillUnmount() {\r\n    this.pageSubscription?.unsubscribe()\r\n  }\r\n\r\n  handlePageChange = (pageNumber: number) => this.page$.next({ ...this.page$.value, pageNumber })\r\n\r\n  showDetailsModal = (details: OrderResultRecord) => this.setState({ detailsModal: true, details })\r\n\r\n  render() {\r\n    const { loading, data, detailsModal, details } = this.state\r\n    const { PoolID, PoolName, isOntrack } = this.props\r\n\r\n    return (\r\n      <div>\r\n        {loading && <Spinner animation=\"border\" size=\"sm\" />}\r\n        {detailsModal && details && (\r\n          <EventDetailsModal details={details} onHide={() => this.setState({ detailsModal: false })} />\r\n        )}\r\n        {!loading && data && (\r\n          <Container fluid className=\"grid-container event-grid\">\r\n            {PoolID && PoolID > 0 && <h5>Pool: {PoolName}</h5>}\r\n            <Table bordered responsive>\r\n              <thead>\r\n                <tr>\r\n                  <th>SERVICE</th>\r\n                  <th>STATUS</th>\r\n                  <th>REASON</th>\r\n                  <th>RESULT</th>\r\n                  <th>COMPANY</th>\r\n                  {!isOntrack && <th>REGULATED</th>}\r\n                  <th>REFERENCE ID</th>\r\n                  <th>EVENT DATE</th>\r\n                  <th>REPORT DATE</th>\r\n                </tr>\r\n              </thead>\r\n              <tbody>\r\n                {data.Records.length > 0 &&\r\n                  data.Records.map((row: OrderResultRecord) => (\r\n                    <tr key={`${row.TestDetailID  }_${ row.TestDetailClinicalID}`}>\r\n                      <td className=\"service-name\">{row.Service}</td>\r\n                      <td className=\"test-reason\">{row.Status}</td>\r\n                      <td className=\"test-reason\">{row.Reason}</td>\r\n                      <td className=\"test-result\">{row.Result}</td>\r\n                      <td className=\"service-name\">{row.CompanyName}</td>\r\n                      {!isOntrack && <td>{row.Regulated}</td>}\r\n                      <td className=\"reference-id\">\r\n                        <Button variant=\"link\" onClick={() => this.showDetailsModal(row)} className=\"p-0\">\r\n                          {row.ReferenceID}\r\n                        </Button>\r\n                      </td>\r\n                      <td>{FormatDate(row.EventDate)}</td>\r\n                      <td>{FormatDate(row.ReportDate)}</td>\r\n                    </tr>\r\n                  ))}\r\n                {data.Records.length === 0 && (\r\n                  <tr>\r\n                    <td colSpan={9}>No Records Found</td>\r\n                  </tr>\r\n                )}\r\n                {data.Records.length > 0 && (\r\n                  <tr>\r\n                    <td colSpan={9}>\r\n                      <span className=\"total-records\">Total records: {data.Total}</span>\r\n                      <TablePagination\r\n                        pageNumber={this.page$.value.pageNumber}\r\n                        pages={data.Pages}\r\n                        onChange={this.handlePageChange}\r\n                      />\r\n                    </td>\r\n                  </tr>\r\n                )}\r\n              </tbody>\r\n            </Table>\r\n          </Container>\r\n        )}\r\n      </div>\r\n    )\r\n  }\r\n}\r\n","import { ObservableFromFetch } from \"../ObservableFromFetch\"\r\nimport EmployeeToMerge from \"./OrderResultModel/EmployeeToMerge\"\r\n\r\n\r\nexport default function SearchEmployeesToMerge(personId: number, implementationId: number, accountId: number, searchBy: string, searchFor: string) {\r\n    const requestBody: string = JSON.stringify({\r\n        PersonID: personId,\r\n        ImplementationID: implementationId,\r\n        AccountID: accountId,\r\n        SearchBy: searchBy,\r\n        SearchFor: searchFor\r\n    })\r\n    return ObservableFromFetch<EmployeeToMerge[]>(\"WorkforceRandomTest/SearchEmployeesToMerge\", requestBody)\r\n    //const result: EmployeeToMerge[] = []\r\n    //return result\r\n}\r\n\r\nexport function MergeEmployees(originalPersonId: number, mergePersonId: number, implementationId: number, accountId: number) {\r\n    const requestBody: string = JSON.stringify({\r\n        OriginalPersonID: originalPersonId,\r\n        MergePersonID: mergePersonId,\r\n        ImplementationID: implementationId,\r\n        AccountID: accountId\r\n    })\r\n    return ObservableFromFetch<string>(\"WorkforceRandomTest/MergeEmployees\", requestBody)\r\n}\r\n","import React, { PureComponent } from \"react\"\r\nimport { Container, Row, Col, Spinner, Modal, Button, Form } from \"react-bootstrap\"\r\nimport { Subscription } from \"rxjs\"\r\nimport GeneralInformation, { PersonDemographicRecord, PersonDemographicObject, RegMode } from \"../../../api/OrderResults/OrderResultModel/GeneralInformation\"\r\nimport { GeneralInformationGet, GetPersonDemographicsDetail } from \"../../../api/OrderResults/GeneralInformationGet\"\r\nimport { toast } from \"react-toastify\"\r\nimport { AppState } from \"../../../AppState\"\r\nimport FormatSSN from \"../../../formatters/FormatSSN\"\r\nimport FormatDate from \"../../../formatters/FormatDate\"\r\nimport 'react-datepicker/dist/react-datepicker.css'\r\nimport FormatError from \"../../../formatters/FormatError\"\r\nimport ActionButton from \"../../ActionButton\"\r\nimport { MergeEmployees } from \"../../../api/OrderResults/SearchEmployesToMerge\"\r\nimport RegulatoryMode from \"../../../api/LabService/LabServiceModel/RegulatoryMode\"\r\nimport LabServiceRegulatoryModesGetObservable from \"../../../api/LabService/LabServiceRegulatoryModesGet\"\r\n\r\ntype CreateRegModeString = {\r\n  EmpCat: string\r\n  EmployeeCategoryID: number\r\n  PersonRegModeEmpCatID: number\r\n  Primary: boolean\r\n  RegMode: string\r\n  RegulatoryModeID: number\r\n}\r\n\r\nfunction regulatoryModeValue(results: CreateRegModeString[]): string {\r\n  if (results.length > 0) {\r\n    let primary: CreateRegModeString | undefined = results.find(item => item.Primary)\r\n    let result: string = primary ? primary.RegMode : \"\"\r\n    let otherRegModes: string = results.filter(item => !item.Primary).map(item => item.RegMode).join(\", \")\r\n    if (otherRegModes !== \"\") {\r\n      result = `${result} (${otherRegModes})`\r\n    }\r\n    return result\r\n  } else {\r\n    return \"N/P\"\r\n  }\r\n}\r\n\r\nconst HeaderRow = (props: { title: string }) =>\r\n  <Row>\r\n    <Col><h5 className=\"pt-3 pb-2\">{props.title}</h5></Col>\r\n  </Row>\r\n\r\n\r\n\r\nconst InfoRow = (props: { title: string, value: string | null, className?: string }) => <Row className=\"py-1\">\r\n  <Col xs={8} md={6}><span className=\"caption\">{props.title}</span></Col>\r\n  <Col xs={8} md={6}><span className={props.className}>{props.value}</span></Col>\r\n</Row>\r\n\r\n\r\n\r\ninterface EmployeeToMergeInfoProps {\r\n  OriginalPersonID: number\r\n  MergePersonID: number\r\n  isGov?: boolean\r\n  onHide: () => void\r\n}\r\n\r\n\r\n\r\ninterface EmployeeToMergeInfoState {\r\n  data?: GeneralInformation,\r\n  saving: boolean\r\n  loading: boolean\r\n  isRegulatoryModesLoading: boolean\r\n  isRegulatoryModesLoaded: boolean\r\n  regulatoryModes: RegulatoryMode[]\r\n\r\n\r\n}\r\nexport default class EmployeeToMergeInfo extends PureComponent<EmployeeToMergeInfoProps, EmployeeToMergeInfoState> {\r\n  state: EmployeeToMergeInfoState = {\r\n    data: undefined,\r\n    saving: false,\r\n    loading: false,\r\n    isRegulatoryModesLoading: false,\r\n    isRegulatoryModesLoaded: false,\r\n    regulatoryModes: []\r\n  }\r\n  loadSubscription?: Subscription\r\n  saveSubscription?: Subscription\r\n  regulatoryModesSubscription?: Subscription\r\n\r\n  componentDidMount() {\r\n    this.loadGeneralInfo(this.props.MergePersonID)\r\n    this.loadRegulatoryModes()\r\n  }\r\n\r\n  componentWillUnmount() {\r\n    this.loadSubscription && this.loadSubscription.unsubscribe()\r\n    this.saveSubscription && this.saveSubscription?.unsubscribe()\r\n    this.regulatoryModesSubscription && this.regulatoryModesSubscription.unsubscribe()\r\n  }\r\n\r\n\r\n\r\n  loadGeneralInfo(PersonID: number) {\r\n    this.setState({ loading: true })\r\n    this.loadSubscription && this.loadSubscription.unsubscribe()\r\n    this.loadSubscription = GeneralInformationGet(PersonID).subscribe(\r\n      (data: GeneralInformation) => this.setState({ data: data }),\r\n      (error) => {\r\n        this.setState({ loading: false })\r\n        toast.error(FormatError(error))\r\n      },\r\n      () => this.setState({ loading: false })\r\n    )\r\n  }\r\n  loadRegulatoryModes = () => {\r\n\r\n    if (this.state.isRegulatoryModesLoaded) {\r\n      return\r\n    }\r\n    this.setState({ isRegulatoryModesLoading: true, regulatoryModes: [] })\r\n    this.regulatoryModesSubscription && this.regulatoryModesSubscription.unsubscribe()\r\n    this.regulatoryModesSubscription = LabServiceRegulatoryModesGetObservable(true).subscribe(\r\n      (data: RegulatoryMode[]) => this.setState({\r\n        regulatoryModes: data,\r\n        isRegulatoryModesLoading: false,\r\n        isRegulatoryModesLoaded: true\r\n      }),\r\n      () => this.setState({ isRegulatoryModesLoading: false })\r\n    )\r\n  }\r\n  handleSubmit = () => {\r\n    const originalPersonId = this.props.OriginalPersonID\r\n    const mergePersonID = this.props.MergePersonID\r\n    this.setState({ saving: true })\r\n    this.saveSubscription && this.saveSubscription?.unsubscribe()\r\n    this.saveSubscription = MergeEmployees(originalPersonId, mergePersonID, 0, 0).subscribe(\r\n      ((result) => {\r\n        this.setState({ saving: false })\r\n        toast.success(\"Merged personnel data successfully.\")\r\n        this.props.onHide()\r\n      }),\r\n      (error) => {\r\n        this.setState({ saving: false })\r\n        toast.error(FormatError(error))\r\n      }\r\n    )\r\n    return false\r\n  }\r\n\r\n  createDonorIdTypeRow = () => {\r\n    const data: GeneralInformation = this.state.data!\r\n    return <InfoRow title=\"Company ID Type\" value={data.CompanyPrimaryID} className=\"text-uppercase\" />\r\n\r\n  }\r\n  createDonorIdRow = () => {\r\n    const data: GeneralInformation = this.state.data!\r\n    const idType = data.PrimaryIDType\r\n    let val = data.PrimaryIDValue\r\n    if (data.CompanyPrimaryID === \"SSN\") {\r\n      if (data.SSN) {\r\n        val = data.SSN\r\n      }\r\n      val = FormatSSN(val)\r\n    }\r\n    return <InfoRow title=\"Donor ID\" value={val} className=\"text-uppercase\" />\r\n\r\n  }\r\n\r\n  createFirstNameRow = () => {\r\n    const data: GeneralInformation = this.state.data!\r\n    return <InfoRow title=\"First Name\" value={data.FirstName} className=\"text-uppercase\" />\r\n  }\r\n\r\n\r\n  createLastNameRow = () => {\r\n    const data: GeneralInformation = this.state.data!\r\n    return <InfoRow title=\"Last Name\" value={data.LastName} className=\"text-uppercase\" />\r\n\r\n  }\r\n\r\n\r\n  createCompanyRow = (name: string) => {\r\n    return <InfoRow title=\"COMPANY\" value={name} />\r\n  }\r\n\r\n  createLocationRow = (name: string) => {\r\n    return <InfoRow title=\"LOCATION\" value={name} />\r\n  }\r\n\r\n  createEmployerIdRow = () => {\r\n    const data: GeneralInformation = this.state.data!\r\n    return <InfoRow title=\"EMPLOYER ID\" value={data.Employer} className=\"text-uppercase\" />\r\n\r\n  }\r\n\r\n  createAlternateIdRow = () => {\r\n    const data: GeneralInformation = this.state.data!\r\n    return <InfoRow title=\"ALTERNATE ID\" value={data.Alternate} className=\"text-uppercase\" />\r\n  }\r\n\r\n\r\n\r\n  createSSNRow = () => {\r\n    const data: GeneralInformation = this.state.data!\r\n    return <InfoRow title=\"SSN\" value={FormatSSN(data.SSN || \"\")} />\r\n  }\r\n\r\n\r\n  createDriverIdRow = () => {\r\n    const data: GeneralInformation = this.state.data!\r\n    return <InfoRow title=\"DRIVER ID\" value={data.Driver} className=\"text-uppercase\" />\r\n  }\r\n\r\n  createGenderRow = () => {\r\n    const data: GeneralInformation = this.state.data!\r\n    return <InfoRow title=\"GENDER\" value={`${data.Gender === \"F\" ? \"Female\" : \"\"}${data.Gender === \"M\" ? \"Male\" : \"\"}`} />\r\n  }\r\n\r\n  createDateOfBirthRow = () => {\r\n    const data: GeneralInformation = this.state.data!\r\n    return <InfoRow title=\"DATE OF BIRTH\" value={FormatDate(data.DOB || \"\")} />\r\n  }\r\n\r\n  createHireDateRow = () => {\r\n    const data: GeneralInformation = this.state.data!\r\n    return <InfoRow title=\"HIRE DATE\" value={FormatDate(data.HireDate || \"\")} />\r\n  }\r\n\r\n  createTerminationDateRow = () => {\r\n    const data: GeneralInformation = this.state.data!\r\n    return <InfoRow title=\"TERMINATION DATE\" value={FormatDate(data.TerminationDate) || \"N/P\"} />\r\n  }\r\n\r\n  createInactiveRow = () => {\r\n    const data: GeneralInformation = this.state.data!\r\n    return <InfoRow title=\"ACTIVE\" value={!data.Inactive ? \"Yes\" : \"No\"} />\r\n  }\r\n\r\n  createRegulatoryModeRow = () => {\r\n    const data: GeneralInformation = this.state.data!\r\n    return <InfoRow title=\"REGULATORY MODE\" value={regulatoryModeValue(data.RegModCatList)} className=\"primary\" />\r\n  }\r\n\r\n  createInfoRows = () => {\r\n    const data: GeneralInformation = this.state.data!\r\n    const donorIdTypeRow = this.createDonorIdTypeRow()\r\n    const donorIdRow = this.createDonorIdRow()\r\n    const firstNameRow = this.createFirstNameRow()\r\n    const lastNameRow = this.createLastNameRow()\r\n    const companyRow = this.createCompanyRow(data.Company)\r\n    const locationRow = this.createLocationRow(data.Location)\r\n    const employerIdRow = this.createEmployerIdRow();\r\n    const driverIdRow = this.createDriverIdRow()\r\n    const ssnRow = this.createSSNRow()\r\n    const alternateIdRow = this.createAlternateIdRow()\r\n    const genderRow = this.createGenderRow()\r\n    const dateOfBirthRow = this.createDateOfBirthRow()\r\n    const hireDateRow = this.createHireDateRow()\r\n    const terminationDateRow = this.createTerminationDateRow()\r\n    const activeRow = this.createInactiveRow()\r\n    const regulatoryModeRow = this.createRegulatoryModeRow()\r\n\r\n\r\n    const result = {\r\n      donorIdTypeRow: donorIdTypeRow,\r\n      donorIdRow: donorIdRow,\r\n      firstNameRow: firstNameRow,\r\n      lastNameRow: lastNameRow,\r\n      companyRow: companyRow,\r\n      locationRow: locationRow,\r\n      employerIdRow: employerIdRow,\r\n      driverIdRow: driverIdRow,\r\n      ssnRow: ssnRow,\r\n      alternateIdRow: alternateIdRow,\r\n      genderRow: genderRow,\r\n      dateOfBirthRow: dateOfBirthRow,\r\n      hireDateRow: hireDateRow,\r\n      terminationDateRow: terminationDateRow,\r\n      activeRow: activeRow,\r\n      regulatoryModeRow: regulatoryModeRow,\r\n\r\n    }\r\n    return result\r\n  }\r\n\r\n\r\n\r\n  render() {\r\n    const { loading, saving } = this.state\r\n    if (!this.state.data) {\r\n      return this.state.loading ? <Spinner animation=\"border\" size=\"sm\" /> : <></>\r\n    }\r\n\r\n    const infoRows = this.createInfoRows();\r\n\r\n\r\n    return (\r\n      <Modal backdrop=\"static\" show={true} onHide={this.props.onHide} size=\"xl\" dialogClassName=\"dark\">\r\n        <Modal.Header closeButton={true}>\r\n          <Modal.Title>MERGE DONOR</Modal.Title>\r\n        </Modal.Header>\r\n        <Modal.Body className=\"event-details\">\r\n          <Container className=\"general-info px-4 pb-4 pt-3\">\r\n            <Row>\r\n              <Col xs={12} lg={6}>\r\n                <HeaderRow title=\"DONOR INFO\" />\r\n              </Col>\r\n              <Col xs={12} lg={6}>\r\n                <HeaderRow title=\"\" />\r\n              </Col>\r\n            </Row>\r\n            <Row>\r\n              <Col xs={12} lg={6}>\r\n                {infoRows.companyRow}\r\n                {infoRows.donorIdTypeRow}\r\n                {infoRows.firstNameRow}\r\n                {infoRows.employerIdRow}\r\n                {infoRows.ssnRow}\r\n                {infoRows.genderRow}\r\n                {infoRows.hireDateRow}\r\n                {infoRows.activeRow}\r\n              </Col>\r\n              <Col xs={12} lg={6}>\r\n                {infoRows.locationRow}\r\n                {infoRows.donorIdRow}\r\n                {infoRows.lastNameRow}\r\n                {infoRows.driverIdRow}\r\n                {infoRows.alternateIdRow}\r\n                {infoRows.dateOfBirthRow}\r\n                {infoRows.terminationDateRow}\r\n                {infoRows.regulatoryModeRow}\r\n              </Col>\r\n            </Row>\r\n          </Container>\r\n        </Modal.Body>\r\n        {<Modal.Footer>\r\n          {<ActionButton variant=\"primary\"\r\n            disabled={loading || saving}\r\n            onClick={this.handleSubmit}\r\n            spin={saving}>Merge</ActionButton>}\r\n          {<ActionButton variant=\"primary\"\r\n            disabled={loading || saving}\r\n            onClick={this.props.onHide}>Cancel</ActionButton>}\r\n        </Modal.Footer>}\r\n      </Modal>\r\n    )\r\n  }\r\n\r\n}\r\n\r\n","import React from \"react\"\r\nimport { Container, Row, Col, Table, Spinner, Button, Dropdown } from \"react-bootstrap\"\r\nimport { Subscription } from \"rxjs\"\r\nimport { toast } from \"react-toastify\"\r\nimport { AppState, CurrentUserPermissions } from \"../../../AppState\"\r\nimport { connect } from \"react-redux\"\r\nimport { BuildUserAccess } from \"../../../authentication/BuildUserAccess\"\r\nimport UserAccessSettings from \"../../../authentication/UserAccessSettings\"\r\nimport EmployeeToMerge from \"../../../api/OrderResults/OrderResultModel/EmployeeToMerge\"\r\nimport SearchField from '../../../api/SearchField'\r\nimport SearchBar from '../../SearchBar'\r\nimport FormatError from \"../../../formatters/FormatError\"\r\nimport SearchEmployeesToMerge from \"../../../api/OrderResults/SearchEmployesToMerge\"\r\nimport EmployeeToMergeInfo from \"./EmployeeToMergeInfo\"\r\n\r\nconst DefaultSearchFields: SearchField[] = [\r\n  //{ ID: \"All Personnel IDs\", Name: \"All Personnel IDs\" },\r\n  { ID: \"First Name\", Name: \"First Name\" },\r\n  { ID: \"Last Name\", Name: \"Last Name\" },\r\n  { ID: \"Donor ID\", Name: \"Donor ID\" }\r\n]\r\ninterface EmployesToMergeProps {\r\n  PersonID: number\r\n  CompanyID: number\r\n  isGov: boolean\r\n  //onPoolUpdate: () => void\r\n}\r\n\r\n\r\ninterface EmployesToMergeGridState {\r\n  loading: boolean\r\n  data: EmployeeToMerge[]\r\n  mergePersonID: number\r\n  showEmployeeToMergeInfo: boolean\r\n}\r\n\r\n\r\nexport class EmployesToMergeGrid extends React.PureComponent<EmployesToMergeProps, EmployesToMergeGridState> {\r\n  state: EmployesToMergeGridState = {\r\n    loading: false,\r\n    data: [],\r\n    mergePersonID: 0,\r\n\r\n    showEmployeeToMergeInfo: false\r\n  }\r\n  pageSubscription?: Subscription\r\n\r\n\r\n\r\n  componentWillUnmount() {\r\n    this.pageSubscription && this.pageSubscription.unsubscribe()\r\n  }\r\n\r\n\r\n  onSearch = (field: string, text: string) => {\r\n    this.setState({ loading: true })\r\n    this.pageSubscription && this.pageSubscription.unsubscribe()\r\n    this.pageSubscription = SearchEmployeesToMerge(this.props.PersonID, 0, this.props.CompanyID, field, text).subscribe(\r\n      (data: EmployeeToMerge[]) => this.setState({ data: data }),\r\n      (error) => {\r\n        this.setState({ loading: false })\r\n        toast.error(FormatError(error))\r\n      },\r\n      () => this.setState({ loading: false })\r\n    )\r\n  }\r\n\r\n  showEmployeeToMerge = (details: EmployeeToMerge) => {\r\n    this.setState({ showEmployeeToMergeInfo: true, mergePersonID: details.PersonID })\r\n  }\r\n  hideEmployeeToMerge = () => {\r\n    this.setState({ showEmployeeToMergeInfo: false, mergePersonID: 0 })\r\n  }\r\n\r\n  renderRows = () => {\r\n    if (this.state.data && this.state.data.length) {\r\n      return this.state.data.map((row: EmployeeToMerge, i: number) =>\r\n        <tr key={i}>\r\n          <td><Button variant=\"link\" onClick={() => this.showEmployeeToMerge(row)} className=\"p-0\">{row.PersonID}</Button></td>\r\n          <td>{row.PrimaryIDType}</td>\r\n          <td>{row.LastName}</td>\r\n          <td>{row.FirstName}</td>\r\n        </tr>)\r\n    } else {\r\n      return <tr><td colSpan={4}>No Records Found</td></tr>\r\n    }\r\n  }\r\n\r\n  render() {\r\n    const { showEmployeeToMergeInfo, mergePersonID } = this.state\r\n    return (\r\n      <>\r\n        {\r\n          showEmployeeToMergeInfo && mergePersonID > 0 &&\r\n          <EmployeeToMergeInfo\r\n            MergePersonID={mergePersonID}\r\n            OriginalPersonID={this.props.PersonID} isGov={this.props.isGov}\r\n            onHide={this.hideEmployeeToMerge}>\r\n\r\n          </EmployeeToMergeInfo>\r\n        }\r\n        <Container fluid className=\"grid-container\">\r\n          <Row className=\"pb-2\">\r\n            <Col>\r\n              <SearchBar\r\n                allowBlank={false}\r\n                resetButton={true}\r\n                onSearch={this.onSearch}\r\n                searchFields={DefaultSearchFields}\r\n                //defaultField={DefaultSearchFields[0]}\r\n                loading={this.state.loading}\r\n              />\r\n            </Col>\r\n            <Col></Col>\r\n          </Row>\r\n          <Row>\r\n            <Col>\r\n              <Table bordered responsive>\r\n                <thead>\r\n                  <tr>\r\n                    <th>ID</th>\r\n                    <th>ID Type</th>\r\n                    <th>First Name</th>\r\n                    <th>Last Name</th>\r\n                  </tr>\r\n                </thead>\r\n                <tbody>\r\n                  {\r\n                    this.state.loading ?\r\n                      <tr>\r\n                        <td className=\"text-center\" colSpan={4}>\r\n                          <Spinner animation=\"border\" variant=\"secondary\" />\r\n                        </td>\r\n                      </tr> : this.renderRows()\r\n                  }\r\n                </tbody>\r\n              </Table>\r\n\r\n            </Col>\r\n          </Row>\r\n        </Container>\r\n      </>\r\n    )\r\n  }\r\n}\r\n\r\nfunction mapStateToProps(state: AppState): { userPermissions: UserAccessSettings } {\r\n  const userAccess = BuildUserAccess(state);\r\n  return {\r\n    userPermissions: userAccess\r\n  }\r\n}\r\nconst ConnectedEmployesToMergeGrid = connect(mapStateToProps, null)(EmployesToMergeGrid)\r\nexport default ConnectedEmployesToMergeGrid\r\n","import React, { Component } from \"react\"\r\nimport { Container, Row, Col, Spinner, Button, Form } from \"react-bootstrap\"\r\nimport { Subscription } from \"rxjs\"\r\nimport GeneralInformation, { PersonDemographicRecord, PersonDemographicObject, RegMode } from \"../../../api/OrderResults/OrderResultModel/GeneralInformation\"\r\nimport { GeneralInformationGet, GetPersonDemographicsDetail } from \"../../../api/OrderResults/GeneralInformationGet\"\r\nimport { toast } from \"react-toastify\"\r\nimport { AppState } from \"../../../AppState\"\r\nimport { connect } from \"react-redux\"\r\nimport FormatSSN from \"../../../formatters/FormatSSN\"\r\nimport FormatDate from \"../../../formatters/FormatDate\"\r\nimport { BuildUserAccess } from \"../../../authentication/BuildUserAccess\"\r\nimport UserAccessSettings from \"../../../authentication/UserAccessSettings\";\r\nimport 'react-datepicker/dist/react-datepicker.css'\r\nimport { GeneralInformationSave, UpdatePersonDemographic, SaveRegulatoryMode } from \"../../../api/OrderResults/GeneralInformationGet\"\r\nimport FormatError from \"../../../formatters/FormatError\"\r\nimport { isCompanyAdmin, isPortalAdmin } from \"../../../authentication/isAdminRole\"\r\nimport { GetSelectedAssignedClinic } from \"../../../authentication/SelectedCompany/CompanySelectionDrivenSelectors\"\r\nimport EmployesToMergeGrid from \"./EmployesToMergeGrid\"\r\nimport RegulatoryMode from \"../../../api/LabService/LabServiceModel/RegulatoryMode\"\r\nimport LabServiceRegulatoryModesGetObservable from \"../../../api/LabService/LabServiceRegulatoryModesGet\"\r\n\r\ntype CreateRegModeString = {\r\n  EmpCat: string\r\n  EmployeeCategoryID: number\r\n  PersonRegModeEmpCatID: number\r\n  Primary: boolean\r\n  RegMode: string\r\n  RegulatoryModeID: number\r\n}\r\nfunction regulatoryModeValue(results: CreateRegModeString[]): string {\r\n  if (results.length > 0) {\r\n    let primary: CreateRegModeString | undefined = results.find(item => item.Primary)\r\n    let result: string = primary ? primary.RegMode : \"\"\r\n    let otherRegModes: string = results.filter(item => !item.Primary).map(item => item.RegMode).join(\", \")\r\n    if (otherRegModes !== \"\") {\r\n      result = `${result} (${otherRegModes})`\r\n    }\r\n    return result\r\n  } else {\r\n    return \"N/P\"\r\n  }\r\n}\r\nconst HeaderRow = (props: { title: string }) =>\r\n  <Row>\r\n    <Col><h5 className=\"pt-3 pb-2\">{props.title}</h5></Col>\r\n  </Row>\r\n\r\n\r\n\r\nconst InfoRow = (props: { title: string, value: string | null, className?: string }) => <Row className=\"py-1\">\r\n  <Col xs={6} md={6}><span className=\"caption\">{props.title}</span></Col>\r\n  <Col xs={6} md={6}><span className={props.className}>{props.value}</span></Col>\r\n</Row>\r\n\r\n\r\n\r\ninterface MergeEmployeeProps {\r\n  PersonID: number\r\n  isGov?: boolean\r\n}\r\n\r\ninterface MergeEmployeeAuthProps {\r\n  userPermissions?: UserAccessSettings\r\n  isPortalAdmin: boolean\r\n  isCompanyAdmin: boolean\r\n  companyID: number\r\n}\r\n\r\ninterface MergeEmployeeState {\r\n  data?: GeneralInformation,\r\n  isGeneralInfoLoading: boolean,\r\n  isRegulatoryModesLoading: boolean\r\n  isRegulatoryModesLoaded: boolean\r\n  regulatoryModes: RegulatoryMode[]\r\n\r\n}\r\nexport class MergeEmployee extends Component<MergeEmployeeProps & MergeEmployeeAuthProps, MergeEmployeeState> {\r\n  state: MergeEmployeeState = {\r\n    data: undefined,\r\n    isGeneralInfoLoading: false,\r\n    isRegulatoryModesLoading: false,\r\n    isRegulatoryModesLoaded: false,\r\n    regulatoryModes: []\r\n  }\r\n  generalInfoSubscription?: Subscription\r\n  generalInfoSaveSubscription?: Subscription\r\n  regulatoryModesSubscription?: Subscription\r\n\r\n  componentDidMount() {\r\n    this.loadGeneralInfo(this.props.PersonID)\r\n    this.loadRegulatoryModes()\r\n  }\r\n\r\n  componentWillUnmount() {\r\n    this.generalInfoSubscription && this.generalInfoSubscription.unsubscribe()\r\n    this.generalInfoSaveSubscription && this.generalInfoSaveSubscription?.unsubscribe()\r\n    this.regulatoryModesSubscription && this.regulatoryModesSubscription.unsubscribe()\r\n  }\r\n\r\n  loadGeneralInfo(PersonID: number) {\r\n    this.setState({ isGeneralInfoLoading: true })\r\n    this.generalInfoSubscription && this.generalInfoSubscription.unsubscribe()\r\n    this.generalInfoSubscription = GeneralInformationGet(PersonID).subscribe(\r\n      (data: GeneralInformation) => this.setState({ data: data }),\r\n      (error) => {\r\n        this.setState({ isGeneralInfoLoading: false })\r\n        toast.error(FormatError(error))\r\n      },\r\n      () => this.setState({ isGeneralInfoLoading: false })\r\n    )\r\n  }\r\n\r\n  loadRegulatoryModes = () => {\r\n\r\n    if (this.state.isRegulatoryModesLoaded) {\r\n      return\r\n    }\r\n    this.setState({ isRegulatoryModesLoading: true, regulatoryModes: [] })\r\n    this.regulatoryModesSubscription && this.regulatoryModesSubscription.unsubscribe()\r\n    this.regulatoryModesSubscription = LabServiceRegulatoryModesGetObservable(true).subscribe(\r\n      (data: RegulatoryMode[]) => this.setState({\r\n        regulatoryModes: data,\r\n        isRegulatoryModesLoading: false,\r\n        isRegulatoryModesLoaded: true\r\n      }),\r\n      () => this.setState({ isRegulatoryModesLoading: false })\r\n    )\r\n  }\r\n  createDonorIdTypeRow = () => {\r\n    const data: GeneralInformation = this.state.data!\r\n    return <InfoRow title=\"Company ID Type\" value={data.CompanyPrimaryID} className=\"text-uppercase\" />\r\n\r\n  }\r\n  createDonorIdRow = () => {\r\n    const data: GeneralInformation = this.state.data!\r\n    const idType = data.PrimaryIDType\r\n    let val = data.PrimaryIDValue\r\n    if (data.CompanyPrimaryID === \"SSN\") {\r\n      if (data.SSN) {\r\n        val = data.SSN\r\n      }\r\n      val = FormatSSN(val)\r\n    }\r\n    return <InfoRow title=\"Donor ID\" value={val} className=\"text-uppercase\" />\r\n\r\n  }\r\n\r\n  createFirstNameRow = () => {\r\n    const data: GeneralInformation = this.state.data!\r\n    return <InfoRow title=\"First Name\" value={data.FirstName} className=\"text-uppercase\" />\r\n  }\r\n\r\n\r\n  createLastNameRow = () => {\r\n    const data: GeneralInformation = this.state.data!\r\n    return <InfoRow title=\"Last Name\" value={data.LastName} className=\"text-uppercase\" />\r\n\r\n  }\r\n\r\n\r\n  createCompanyRow = (name: string) => {\r\n    return <InfoRow title=\"COMPANY\" value={name} />\r\n  }\r\n\r\n  createLocationRow = (name: string) => {\r\n    return <InfoRow title=\"LOCATION\" value={name} />\r\n  }\r\n  createEmployerIdRow = () => {\r\n    const data: GeneralInformation = this.state.data!\r\n    return <InfoRow title=\"EMPLOYER ID\" value={data.Employer} className=\"text-uppercase\" />\r\n\r\n  }\r\n\r\n  createAlternateIdRow = () => {\r\n    const data: GeneralInformation = this.state.data!\r\n    return <InfoRow title=\"ALTERNATE ID\" value={data.Alternate} className=\"text-uppercase\" />\r\n  }\r\n\r\n\r\n\r\n  createSSNRow = () => {\r\n    const data: GeneralInformation = this.state.data!\r\n    return <InfoRow title=\"SSN\" value={FormatSSN(data.SSN || \"\")} />\r\n  }\r\n\r\n\r\n  createDriverIdRow = () => {\r\n    const data: GeneralInformation = this.state.data!\r\n    return <InfoRow title=\"DRIVER ID\" value={data.Driver} className=\"text-uppercase\" />\r\n  }\r\n\r\n  createGenderRow = () => {\r\n    const data: GeneralInformation = this.state.data!\r\n    return <InfoRow title=\"GENDER\" value={`${data.Gender === \"F\" ? \"Female\" : \"\"}${data.Gender === \"M\" ? \"Male\" : \"\"}`} />\r\n  }\r\n\r\n  createDateOfBirthRow = () => {\r\n    const data: GeneralInformation = this.state.data!\r\n    return <InfoRow title=\"DATE OF BIRTH\" value={FormatDate(data.DOB || \"\")} />\r\n  }\r\n\r\n  createHireDateRow = () => {\r\n    const data: GeneralInformation = this.state.data!\r\n    return <InfoRow title=\"HIRE DATE\" value={FormatDate(data.HireDate || \"\")} />\r\n  }\r\n\r\n  createTerminationDateRow = () => {\r\n    const data: GeneralInformation = this.state.data!\r\n    return <InfoRow title=\"TERMINATION DATE\" value={FormatDate(data.TerminationDate) || \"N/P\"} />\r\n  }\r\n\r\n  createInactiveRow = () => {\r\n    const data: GeneralInformation = this.state.data!\r\n    return <InfoRow title=\"ACTIVE\" value={!data.Inactive ? \"Yes\" : \"No\"} />\r\n  }\r\n\r\n  createRegulatoryModeRow = () => {\r\n    const data: GeneralInformation = this.state.data!\r\n    return <InfoRow title=\"REGULATORY MODE\" value={regulatoryModeValue(data.RegModCatList)} className=\"primary\" />\r\n  }\r\n\r\n  createInfoRows = () => {\r\n    const { isGov } = this.props\r\n    const data: GeneralInformation = this.state.data!\r\n    const donorIdTypeRow = this.createDonorIdTypeRow()\r\n    const donorIdRow = this.createDonorIdRow()\r\n    const firstNameRow = this.createFirstNameRow()\r\n    const lastNameRow = this.createLastNameRow()\r\n    const companyRow = this.createCompanyRow(data.Company)\r\n    const locationRow = this.createLocationRow(data.Location)\r\n    const employerIdRow = this.createEmployerIdRow();\r\n    const driverIdRow = this.createDriverIdRow()\r\n    const ssnRow = this.createSSNRow()\r\n    const alternateIdRow = this.createAlternateIdRow()\r\n    const genderRow = this.createGenderRow()\r\n    const dateOfBirthRow = this.createDateOfBirthRow()\r\n    const hireDateRow = this.createHireDateRow()\r\n    const terminationDateRow = this.createTerminationDateRow()\r\n    const activeRow = this.createInactiveRow()\r\n    const regulatoryModeRow = this.createRegulatoryModeRow()\r\n\r\n\r\n    const result = {\r\n      donorIdTypeRow: donorIdTypeRow,\r\n      donorIdRow: donorIdRow,\r\n      firstNameRow: firstNameRow,\r\n      lastNameRow: lastNameRow,\r\n      companyRow: companyRow,\r\n      locationRow: locationRow,\r\n      employerIdRow: employerIdRow,\r\n      driverIdRow: driverIdRow,\r\n      ssnRow: ssnRow,\r\n      alternateIdRow: alternateIdRow,\r\n      genderRow: genderRow,\r\n      dateOfBirthRow: dateOfBirthRow,\r\n      hireDateRow: hireDateRow,\r\n      terminationDateRow: terminationDateRow,\r\n      activeRow: activeRow,\r\n      regulatoryModeRow: regulatoryModeRow,\r\n    }\r\n    return result\r\n  }\r\n\r\n\r\n\r\n  render() {\r\n    const { isGov } = this.props\r\n    if (!this.state.data) {\r\n      return this.state.isGeneralInfoLoading ? <Spinner animation=\"border\" size=\"sm\" /> : <></>\r\n    }\r\n    const companyAdminOfAnotherCompany = this.props.isCompanyAdmin && this.props.companyID !== this.state.data.CompanyID\r\n\r\n    const infoRows = this.createInfoRows();\r\n\r\n\r\n    return (\r\n      <Container className=\"general-info px-4 pb-4 pt-3\">\r\n        <Container className=\"px-4 pb-4 pt-3\">\r\n          <Row>\r\n            <Col xs={12} lg={6}>\r\n              <HeaderRow title=\"DONOR INFO\" />\r\n            </Col>\r\n            <Col xs={12} lg={6}>\r\n              <HeaderRow title=\"\" />\r\n            </Col>\r\n          </Row>\r\n          <Row>\r\n            <Col xs={12} lg={6}>\r\n              {infoRows.companyRow}\r\n              {infoRows.donorIdTypeRow}\r\n              {infoRows.firstNameRow}\r\n              {infoRows.employerIdRow}\r\n              {infoRows.ssnRow}\r\n              {infoRows.genderRow}\r\n              {infoRows.hireDateRow}\r\n              {infoRows.activeRow}\r\n            </Col>\r\n            <Col xs={12} lg={6}>\r\n              {infoRows.locationRow}\r\n              {infoRows.donorIdRow}\r\n              {infoRows.lastNameRow}\r\n              {infoRows.driverIdRow}\r\n              {infoRows.alternateIdRow}\r\n              {infoRows.dateOfBirthRow}\r\n              {infoRows.terminationDateRow}\r\n              {infoRows.regulatoryModeRow}\r\n            </Col>\r\n          </Row>\r\n        </Container>\r\n        <Container>\r\n          <HeaderRow title=\"SEARCH FOR DONOR TO MERGE\" />\r\n        </Container>\r\n        <EmployesToMergeGrid PersonID={this.props.PersonID} CompanyID={this.props.companyID} isGov={this.props.isGov || false}></EmployesToMergeGrid>\r\n      </Container>\r\n    )\r\n  }\r\n\r\n}\r\n\r\nfunction mapStateToProps(state: AppState): MergeEmployeeAuthProps {\r\n  const userAccess = BuildUserAccess(state)\r\n  const selectedCompany = GetSelectedAssignedClinic(state)\r\n  return {\r\n    userPermissions: userAccess,\r\n    isPortalAdmin: isPortalAdmin(state),\r\n    isCompanyAdmin: isCompanyAdmin(state),\r\n    companyID: selectedCompany?.AccountID || 0,\r\n  }\r\n}\r\nconst ConnectedMergeEmployee = connect(mapStateToProps)(MergeEmployee)\r\nexport default ConnectedMergeEmployee\r\n","import React, { Component } from \"react\"\r\nimport { Col, Container, Modal, Row, Tab, Tabs } from \"react-bootstrap\"\r\nimport GeneralInfo from \"./EmployeeDetails/GeneralInfo\"\r\nimport CurrentService from \"./EmployeeDetails/CurrentService\"\r\nimport OrderResultRecord from \"../../api/OrderResults/OrderResultModel/OrderResultRecord\"\r\nimport CurrentServiceHistory from \"./EmployeeDetails/CurrentServiceHistory\"\r\nimport MergeEmployee from \"./EmployeeDetails/MergeEmployee\"\r\n\r\nconst GeneralInfoKey = \"general-info\"\r\nconst ServiceKey = \"service\"\r\nconst TestingHistoryKey = \"testing-history\"\r\nconst MergeEmployeeKey = \"merge-employee\"\r\n\r\n\r\ninterface EmployeeDetailsModalProps {\r\n  details?: OrderResultRecord\r\n  personID: number\r\n  poolID?: number\r\n  poolName?: string\r\n  name: string\r\n  id: string\r\n  showService?: boolean\r\n  onHide: (updated: boolean) => void\r\n  isGov?: boolean\r\n}\r\n\r\ninterface EmployeeDetailsModalState {\r\n  currentTab: string\r\n  updated: boolean\r\n}\r\n\r\nexport default class EmployeeDetailsModal extends Component<EmployeeDetailsModalProps, EmployeeDetailsModalState> {\r\n  state: EmployeeDetailsModalState = { currentTab: GeneralInfoKey, updated: false }\r\n\r\n  render() {\r\n    const { details, showService, personID, poolID, poolName, name, id, isGov } = this.props\r\n    const modalHeader = isGov ? \"DONOR DETAILS\" : \"EMPLOYEE DETAILS\"\r\n    return (\r\n      <Modal show onHide={() => this.props.onHide(this.state.updated)} size=\"xl\" dialogClassName=\"dark\">\r\n        <Modal.Header closeButton>\r\n          <Modal.Title>\r\n            <h4>{modalHeader}</h4>\r\n          </Modal.Title>\r\n        </Modal.Header>\r\n        <Modal.Body className=\"p-0\">\r\n          <Container className=\"tab-container p-0\">\r\n            <Row className=\"px-0 pt-2\">\r\n              <Col>\r\n                <h4 className=\"px-4\">\r\n                  <span className=\"text-uppercase\">{name}</span> - {id}\r\n                </h4>\r\n                <Tabs\r\n                  defaultActiveKey={GeneralInfoKey}\r\n                  activeKey={this.state.currentTab}\r\n                  className=\"px-4 py-2\"\r\n                  onSelect={(eventKey) => {\r\n                    eventKey && this.setState({ currentTab: eventKey })\r\n                  }}\r\n                >\r\n                  <Tab eventKey=\"general-info\" title=\"GENERAL INFORMATION\" tabClassName=\"rounded-pill px-4\">\r\n                    {GeneralInfoKey === this.state.currentTab && (\r\n                      <GeneralInfo\r\n                        PersonID={personID}\r\n                        isGov={isGov}\r\n                        onUpdate={() => this.setState({ updated: true })}\r\n                      />\r\n                    )}\r\n                  </Tab>\r\n                  {showService && details && (\r\n                    <Tab eventKey=\"service\" title=\"CURRENT SERVICE DETAILS\" tabClassName=\"rounded-pill px-4\">\r\n                      {ServiceKey === this.state.currentTab && <CurrentService details={details} />}\r\n                    </Tab>\r\n                  )}\r\n                  {!isGov && !showService && (\r\n                    <Tab eventKey={TestingHistoryKey} title=\"CURRENT SERVICE DETAILS\" tabClassName=\"rounded-pill px-4\">\r\n                      {TestingHistoryKey === this.state.currentTab && (\r\n                        <CurrentServiceHistory\r\n                          PersonID={personID}\r\n                          PoolID={poolID}\r\n                          PoolName={poolName}\r\n                          isOntrack={isGov}\r\n                        />\r\n                      )}\r\n                    </Tab>\r\n                  )}\r\n                  {!isGov && (personID > 0) &&\r\n                    <Tab eventKey=\"merge-employee\" title=\"MERGE DONOR\" tabClassName=\"rounded-pill px-4\">\r\n                      {MergeEmployeeKey === this.state.currentTab && (\r\n                        <MergeEmployee\r\n                          PersonID={personID}\r\n                          isGov={isGov}\r\n                          \r\n                        />\r\n                      )}\r\n                    </Tab>\r\n                  }\r\n                </Tabs>\r\n              </Col>\r\n            </Row>\r\n          </Container>\r\n        </Modal.Body>\r\n      </Modal>\r\n    )\r\n  }\r\n}\r\n","import * as React from \"react\"\r\nimport { Modal, Button, Container, Col, Row } from \"react-bootstrap\"\r\nimport { FaAngleDown } from \"react-icons/fa\"\r\nimport { Typeahead } from \"react-bootstrap-typeahead\"\r\nimport 'react-bootstrap-typeahead/css/Typeahead.css'\r\nimport { Subscription } from \"rxjs\"\r\nimport { AutoFilterLocationWithoutRegionGetObservable } from \"../../api/Location/AutoFilterLocationsGet\"\r\nimport AutoFilterLocation from \"../../api/Location/LocationModel/AutoFilterLocation\"\r\nimport LabServiceRegulatoryModesGetObservable from \"../../api/LabService/LabServiceRegulatoryModesGet\"\r\nimport RegulatoryMode from \"../../api/LabService/LabServiceModel/RegulatoryMode\"\r\n\r\ninterface PoolMembersFiltersModalProps {\r\n  show: boolean\r\n  selectedLocations: AutoFilterLocation[]\r\n  selectedRegulatoryModes: RegulatoryMode[]\r\n  onSave: (locations: AutoFilterLocation[], regulatoryModes: RegulatoryMode[], close: boolean) => void\r\n  onClose: () => void\r\n}\r\n\r\ninterface PoolMembersFiltersModalState {\r\n  availableLocations?: AutoFilterLocation[]\r\n  isLocationsLoading: boolean\r\n  selectedLocations: AutoFilterLocation[]\r\n  availableRegulatoryModes?: RegulatoryMode[]\r\n  isRegulatoryModesLoading: boolean\r\n  selectedRegulatoryModes: RegulatoryMode[]\r\n}\r\n\r\nexport default class PoolMembersFiltersModal extends React.Component<PoolMembersFiltersModalProps, PoolMembersFiltersModalState> {\r\n  state: PoolMembersFiltersModalState = {\r\n    isLocationsLoading: false,\r\n    selectedLocations: this.props.selectedLocations,\r\n    isRegulatoryModesLoading: false,\r\n    selectedRegulatoryModes: this.props.selectedRegulatoryModes\r\n  }\r\n\r\n  subscriptions = new Subscription()\r\n\r\n  locationTypeahead = React.createRef<Typeahead<AutoFilterLocation>>()\r\n  regulatoryModeTypeahead = React.createRef<Typeahead<RegulatoryMode>>()\r\n\r\n  componentDidMount() {\r\n    this.setState({ isLocationsLoading: true, isRegulatoryModesLoading: true })\r\n    this.subscriptions.add(\r\n      AutoFilterLocationWithoutRegionGetObservable().subscribe(\r\n        (data: AutoFilterLocation[]) => this.setState({ availableLocations: data, isLocationsLoading: false }),\r\n        () => this.setState({ isLocationsLoading: false })\r\n      )\r\n    )\r\n\r\n    this.subscriptions.add(\r\n      LabServiceRegulatoryModesGetObservable().subscribe(\r\n        (data: RegulatoryMode[]) => this.setState({ availableRegulatoryModes: data, isRegulatoryModesLoading: false }),\r\n        () => this.setState({ isRegulatoryModesLoading: false })\r\n      )\r\n    )\r\n  }\r\n\r\n  componentWillUnmount() {\r\n    this.subscriptions.unsubscribe()\r\n  }\r\n\r\n  componentDidUpdate(prevProps: PoolMembersFiltersModalProps, prevState: PoolMembersFiltersModalState) {\r\n    if (!(this.isLocationsEqual(this.props.selectedLocations, prevProps.selectedLocations)\r\n      && this.isRegulatoryModesEqual(this.props.selectedRegulatoryModes, prevProps.selectedRegulatoryModes))) {\r\n      this.setState({\r\n        selectedLocations: this.props.selectedLocations,\r\n        selectedRegulatoryModes: this.props.selectedRegulatoryModes\r\n      })\r\n    }\r\n  }\r\n\r\n  isLocationsEqual = (items1: AutoFilterLocation[], items2: AutoFilterLocation[]) => {\r\n    const itemsString = (items: AutoFilterLocation[]) => items.map(item => item.Name).sort().join(\",\")\r\n    return itemsString(items1) === itemsString(items2)\r\n  }\r\n\r\n  isRegulatoryModesEqual = (items1: RegulatoryMode[], items2: RegulatoryMode[]) => {\r\n    const itemsString = (items: RegulatoryMode[]) => items.map(item => item.Name).sort().join(\",\")\r\n    return itemsString(items1) === itemsString(items2)\r\n  }\r\n\r\n  handleSave = () => this.props.onSave(this.state.selectedLocations, this.state.selectedRegulatoryModes, true)\r\n\r\n  handleClearAll = () => {\r\n    this.setState({ selectedLocations: [], selectedRegulatoryModes: [] })\r\n\r\n    const { selectedLocations, selectedRegulatoryModes } = this.props\r\n    const filterAlreadySet = selectedLocations.length > 0 || selectedRegulatoryModes.length > 0\r\n    if (filterAlreadySet) {\r\n      this.props.onSave([], [], false)\r\n    }\r\n  }\r\n\r\n  handleClose = () => {\r\n    this.setState({ selectedLocations: this.props.selectedLocations, selectedRegulatoryModes: this.props.selectedRegulatoryModes })\r\n    this.props.onClose()\r\n  }\r\n\r\n  handleAddLocation = (items: AutoFilterLocation[]) => {\r\n    if (items[0] && !this.state.selectedLocations.find(item => item.Name === items[0].Name)) {\r\n      this.setState({ selectedLocations: [...this.state.selectedLocations, items[0]] })\r\n    }\r\n  }\r\n\r\n  handleRemoveLocation = (removeItem: AutoFilterLocation) => {\r\n    this.setState({ selectedLocations: this.state.selectedLocations.filter(item => item.Name !== removeItem.Name) })\r\n  }\r\n\r\n  handleAddRegulatoryMode = (items: RegulatoryMode[]) => {\r\n    if (items[0] && !this.state.selectedRegulatoryModes.find(item => item.RegulatoryModeID === items[0].RegulatoryModeID)) {\r\n      this.setState({ selectedRegulatoryModes: [...this.state.selectedRegulatoryModes, items[0]] })\r\n    }\r\n  }\r\n\r\n  handleRemoveRegulatoryMode = (removeItem: RegulatoryMode) => {\r\n    this.setState({ selectedRegulatoryModes: this.state.selectedRegulatoryModes.filter(item => item.RegulatoryModeID !== removeItem.RegulatoryModeID) })\r\n  }\r\n\r\n  render() {\r\n    const { selectedLocations, selectedRegulatoryModes } = this.state\r\n\r\n    const hasChanges = !(this.isLocationsEqual(this.props.selectedLocations, selectedLocations)\r\n      && this.isRegulatoryModesEqual(this.props.selectedRegulatoryModes, selectedRegulatoryModes))\r\n    const canClearAll = hasChanges || selectedLocations.length > 0 || selectedRegulatoryModes.length > 0\r\n\r\n    return <Modal backdrop=\"static\" size=\"lg\" centered show={this.props.show} onHide={this.handleClose}>\r\n      <Modal.Header closeButton>\r\n        <Modal.Title>ADVANCED FILTERS</Modal.Title>\r\n      </Modal.Header>\r\n      <Modal.Body>\r\n        <Container fluid className=\"AdvancedFiltersModal\">\r\n          <Row>\r\n            <Col md={6}>\r\n              <div className=\"typeahead\">\r\n                <Typeahead id=\"location\"\r\n                  ref={this.locationTypeahead}\r\n                  labelKey=\"Name\"\r\n                  filterBy={(option, props) => props.selected.length > 0 || option.Name.toLowerCase().indexOf(props.text.toLowerCase()) !== -1}\r\n                  onChange={this.handleAddLocation}\r\n                  disabled={this.state.isLocationsLoading}\r\n                  options={(this.state.availableLocations || []).filter(item => !this.state.selectedLocations.includes(item))}\r\n                  selected={[]}\r\n                  emptyLabel=\"No Locations Found\"\r\n                  placeholder=\"Location\">\r\n                  {!this.state.isLocationsLoading &&\r\n                    <Button variant=\"toggle\" onClick={() => { this.locationTypeahead.current?.toggleMenu() }}>\r\n                      <FaAngleDown />\r\n                    </Button>}\r\n                </Typeahead>\r\n              </div>\r\n              <div className=\"selection\">\r\n                {this.state.selectedLocations.map(item => <div key={item.Name}>\r\n                  <span>{item.Name}</span>\r\n                  <span className=\"remove\" onClick={() => this.handleRemoveLocation(item)}>×</span>\r\n                </div>)}\r\n              </div>\r\n            </Col>\r\n            <Col md={6}>\r\n              <div className=\"typeahead\">\r\n                <Typeahead id=\"regMode\"\r\n                  ref={this.regulatoryModeTypeahead}\r\n                  labelKey=\"Name\"\r\n                  filterBy={(option, props) => props.selected.length > 0 || option.Name.toLowerCase().indexOf(props.text.toLowerCase()) !== -1}\r\n                  onChange={this.handleAddRegulatoryMode}\r\n                  disabled={this.state.isRegulatoryModesLoading}\r\n                  options={(this.state.availableRegulatoryModes || []).filter(item => !this.state.selectedRegulatoryModes.includes(item))}\r\n                  selected={[]}\r\n                  emptyLabel=\"No Regulatory Modes Found\"\r\n                  placeholder=\"Regulatory Mode\">\r\n                  {!this.state.isRegulatoryModesLoading && <Button variant=\"toggle\" onClick={() => { this.regulatoryModeTypeahead.current?.toggleMenu() }}>\r\n                    <FaAngleDown />\r\n                  </Button>}\r\n                </Typeahead>\r\n              </div>\r\n              <div className=\"selection\">\r\n                {this.state.selectedRegulatoryModes.map(item => <div key={item.RegulatoryModeID}>\r\n                  <span>{item.Name}</span>\r\n                  <span className=\"remove\" onClick={() => this.handleRemoveRegulatoryMode(item)}>×</span>\r\n                </div>)}\r\n              </div>\r\n            </Col>\r\n          </Row>\r\n        </Container>\r\n      </Modal.Body>\r\n      <Modal.Footer>\r\n        {hasChanges && <Button variant=\"primary\" onClick={() => this.handleSave()}>APPLY</Button>}\r\n        {canClearAll && <Button variant=\"primary\" onClick={() => this.handleClearAll()}>CLEAR ALL</Button>}\r\n        {!hasChanges && <Button variant=\"secondary\" onClick={() => this.handleClose()}>CLOSE</Button>}\r\n      </Modal.Footer>\r\n    </Modal >\r\n  }\r\n}\r\n","import * as React from \"react\"\r\nimport { Container, Modal, Row, Col, Button, Form } from \"react-bootstrap\"\r\nimport { toast } from \"react-toastify\"\r\nimport { Subscription } from \"rxjs\"\r\nimport { APIError } from \"../../api/ObservableFromFetch\"\r\nimport EventExcuseObservable from \"../../api/Randoms/EventExcuse\"\r\nimport SelectionInboxGridRow from \"../../api/Randoms/SelectionInboxModel/SelectionInboxGridRow\"\r\nimport ConfirmationModal from \"../ConfirmationModal\"\r\n\r\ninterface QueryNameModalProps {\r\n  show: boolean\r\n  onSave: (name: string) => void\r\n  onClose: () => void\r\n}\r\n\r\ninterface QueryNameModalState {\r\n  comment: string\r\n  saving: boolean\r\n}\r\n\r\nexport default class QueryNameModal extends React.PureComponent<QueryNameModalProps, {}> {\r\n  state: QueryNameModalState = { comment: \"\", saving: false }\r\n  subscription?: Subscription\r\n\r\n  componentWillUnmount() {\r\n    this.subscription && this.subscription.unsubscribe()\r\n  }\r\n\r\n  handleAPIError = (error: Error | APIError, stateChanges: object) => {\r\n    this.setState(stateChanges)\r\n    error && toast.error((error as APIError)?.errorData?.message || error.message)\r\n  }\r\n  \r\n  handleConfirm = () => {\r\n    this.props.onSave(this.state.comment.trim())\r\n  }\r\n\r\n  render() {\r\n    return <ConfirmationModal show={this.props.show}\r\n      title=\"Save Query\"\r\n      confirmButtonText=\"Save\"\r\n      onConfirm={this.handleConfirm}\r\n      onHide={() => this.props.onClose()}\r\n      size=\"lg\"\r\n      disableConfirmButton={this.state.comment.trim().length === 0}\r\n      spinConfirmButton={this.state.saving}\r\n      disableConfirmOnSpin={true}>\r\n      <Form>\r\n        <Form.Row className=\"form-group required\">\r\n          <Form.Label column lg={3} htmlFor=\"comment\">Enter query name</Form.Label>\r\n          <Col lg={9}>\r\n            <Form.Control\r\n              id=\"comment\"\r\n              type=\"text\"\r\n              value={this.state.comment}\r\n              onChange={e => this.setState({ comment: e.target.value })} />\r\n          </Col>\r\n        </Form.Row>\r\n      </Form>\r\n    </ConfirmationModal>\r\n  }\r\n}","import React from \"react\"\r\nimport { Form, Col, Row, Button, Container } from \"react-bootstrap\"\r\nimport { FaAngleDoubleDown, FaAngleDoubleLeft, FaAngleDoubleRight, FaAngleDoubleUp, FaAngleDown, FaAngleUp, FaChevronLeft, FaChevronRight } from \"react-icons/fa\"\r\nimport _lodash from \"lodash\"\r\n\r\ninterface DualListBoxProps<T> {\r\n  disabled?: boolean\r\n  idKey?: keyof T\r\n  labelKey?: keyof T\r\n  options: T[]\r\n  selected: T[]\r\n  availableTitle: string\r\n  selectedTitle: string\r\n  onChange: (selected: T[]) => void\r\n  isConsortium?: boolean\r\n}\r\n\r\ninterface DualListBoxState<T> {\r\n  selected: T[]\r\n  selectionLeft: string[]\r\n  selectionRight: string[]\r\n}\r\n\r\nexport default class DualListBox<T> extends React.PureComponent<DualListBoxProps<T>, DualListBoxState<T>> {\r\n  state = { selected: this.mapOptions(this.props.selected), selectionLeft: [], selectionRight: [] }\r\n\r\n  mapOption(option: any): any {\r\n    return this.props.idKey ? option[this.props.idKey].toString() : option\r\n  }\r\n\r\n  mapOptions(options: any[]): any[] {\r\n    return this.props.idKey ? options.map(option => option[this.props.idKey].toString()) : options\r\n  }\r\n\r\n  optionLabel(option: any): any {\r\n    return this.props.labelKey ? option[this.props.labelKey] + (!!option.DisableMessage ? \" (\"+option.DisableMessage+\")\" : \"\") : option\r\n  }\r\n\r\n  disabledOption(option: any): boolean {\r\n    return !!option.DisableMessage\r\n  }\r\n\r\n  optionTitle(option: any): any {\r\n    return !!option.DisableMessage ? option.DisableMessage : \"\"\r\n  }\r\n\r\n  componentDidUpdate(prevProps: DualListBoxProps<T>, prevState: DualListBoxState<T>) {\r\n    if (!_lodash.isEqual(this.props.selected, prevProps.selected)) {\r\n      const selection = this.mapOptions(this.props.selected)\r\n      this.setState({ selected: selection })\r\n    }\r\n    if (!_lodash.isEqual(this.state.selected, prevState.selected)) {\r\n      const selection = this.props.options.filter(option => this.state.selected.includes(this.mapOption(option)))\r\n      this.props.onChange(selection)\r\n    }\r\n  }\r\n\r\n  move(dir: \"ltr\" | \"rtl\", all?: boolean) {\r\n    const selectionRight: string[] =  this.state.selectionRight\r\n    let newSelection = [];\r\n    if (dir === \"ltr\") \r\n    {\r\n      newSelection = this.mapOptions(this.props.options.filter(o => !this.disabledOption(o))); \r\n    } \r\n\r\n    if (!all)\r\n    {\r\n      newSelection = [...this.state.selected, ...this.state.selectionLeft]\r\n      if (dir === \"rtl\")\r\n      {\r\n        newSelection = this.state.selected.filter(option => !selectionRight.includes(option))\r\n      } \r\n    }\r\n    dir === \"ltr\" ? this.setState({ selectionLeft: [], selected: newSelection }) : this.setState({ selectionRight: [], selected: newSelection })\r\n  }\r\n\r\n  render() {\r\n    const options: T[] = this.props.options\r\n    const selection: string[] = this.state.selected\r\n    const availableOptions = options.filter(option => !selection.includes(this.mapOption(option)))\r\n    const selectedOptions = options.filter(option => selection.includes(this.mapOption(option)))\r\n    return (\r\n      <>\r\n        <Row className=\"d-none d-lg-flex\">\r\n          <Col lg={5}>{this.props.availableTitle}</Col>\r\n          <Col className=\"px-0\"></Col>\r\n          <Col lg={5} className=\"pl-lg-0\">{this.props.selectedTitle}</Col>\r\n        </Row>\r\n        <Row>\r\n          <Col lg={5} className=\"pr-lg-0\">\r\n            <div className=\"d-lg-none\">{this.props.availableTitle}</div>\r\n            <Form.Control as=\"select\" multiple style={{ height: \"152px\" }}\r\n              disabled={this.props.disabled}\r\n              onChange={(e: React.ChangeEvent<HTMLSelectElement>) => { this.setState({ selectionLeft: Array.from(e.target.selectedOptions, option => option.value) }) }}>\r\n              { availableOptions.map(option => <option key={this.mapOption(option)} value={this.mapOption(option)} disabled={this.disabledOption(option)} title={this.optionTitle(option)}>{this.optionLabel(option)}</option>) }\r\n            </Form.Control>\r\n          </Col>\r\n          <Col className=\"px-0\">\r\n            <Container fluid>\r\n              <Row>\r\n                <Col lg={12} xs={3} className=\"px-1 text-center\">\r\n                  <Button className=\"btn-sm btn-sm-icon mb-lg-2 mt-lg-0 my-1\" disabled={!availableOptions.length || this.props.disabled || this.props.isConsortium}\r\n                    onClick={ () => this.move(\"ltr\", true) }>\r\n                    <FaAngleDoubleRight className=\"d-none d-lg-inline\" />\r\n                    <FaAngleDoubleDown className=\"d-lg-none\" />\r\n                  </Button>\r\n                </Col>\r\n                <Col lg={12} xs={3} className=\"px-1 text-center\">\r\n                  <Button className=\"btn-sm btn-sm-icon mb-lg-2 mt-lg-0 my-1\" disabled={!this.state.selectionLeft.length || this.props.disabled}\r\n                      onClick={ () => this.move(\"ltr\") }>\r\n                    <FaChevronRight className=\"d-none d-lg-inline\" />\r\n                    <FaAngleDown className=\"d-lg-none\" />\r\n                  </Button>\r\n                </Col>\r\n                <Col lg={12} xs={3} className=\"px-1 text-center\">\r\n                  <Button className=\"btn-sm btn-sm-icon mb-lg-2 mt-lg-0 my-1\" disabled={!this.state.selectionRight.length || this.props.disabled}\r\n                      onClick={() => this.move(\"rtl\")}>\r\n                    <FaChevronLeft className=\"d-none d-lg-inline\" />\r\n                    <FaAngleUp className=\"d-lg-none\" />\r\n                  </Button>\r\n                </Col>\r\n                <Col lg={12} xs={3} className=\"px-1 text-center\">\r\n                  <Button className=\"btn-sm btn-sm-icon mb-lg-2 mt-lg-0 my-1\"  disabled={!selectedOptions.length || this.props.disabled || this.props.isConsortium}\r\n                    onClick={() => this.move(\"rtl\", true)}>\r\n                    <FaAngleDoubleLeft className=\"d-none d-lg-inline\" />\r\n                    <FaAngleDoubleUp className=\"d-lg-none\" />\r\n                  </Button>\r\n                </Col>\r\n              </Row>\r\n            </Container>\r\n          </Col>\r\n          <Col lg={5} className=\"pl-lg-0\">\r\n            <div className=\"d-lg-none\">{this.props.selectedTitle}</div>\r\n            <Form.Control as=\"select\" multiple style={{ height: \"152px\" }} disabled={this.props.disabled}\r\n              onChange={(e: React.ChangeEvent<HTMLSelectElement>) => { this.setState({ selectionRight: Array.from(e.target.selectedOptions, option => option.value) }) }}>\r\n              { selectedOptions.map(option => <option key={this.mapOption(option)} value={this.mapOption(option)}>{this.optionLabel(option)}</option>) }\r\n            </Form.Control>\r\n          </Col>\r\n        </Row>\r\n      </>\r\n    )\r\n  }\r\n\r\n  static defaultProps = { selected: [], availableTitle: \"Available\", selectedTitle: \"Selected\", disabledkeys: [] }\r\n}\r\n","import React from \"react\"\r\nimport { Modal, Form, Col, Row, Button } from \"react-bootstrap\"\r\nimport { toast } from \"react-toastify\"\r\nimport { Subscription } from \"rxjs\"\r\nimport DualListBox from \"../../components/Administration/DualListBox\"\r\nimport RegulatoryMode from \"../../api/LabService/LabServiceModel/RegulatoryMode\"\r\nimport ActivateAndInActiveLabAccountObservable from \"../../api/Administration/ActivateAndInActiveLabAccount\"\r\nimport ActionButton from \"../ActionButton\"\r\nimport { APIError } from \"../../api/ObservableFromFetch\"\r\n\r\ninterface RegulatoryModeSelectionProps {\r\n  regulatoryModes: RegulatoryMode[]\r\n  selectedRegulatoryModes: RegulatoryMode[]\r\n  show: boolean\r\n  onSave: (regulatoryModes: RegulatoryMode[]) => void\r\n  onClose: () => void\r\n}\r\n\r\ninterface RegulatoryModeSelectionState {\r\n  show: boolean\r\n  regulatoryModes: RegulatoryMode[]\r\n  selectedRegulatoryModes: RegulatoryMode[]\r\n}\r\n\r\nexport default class RegulatoryModeSelection extends React.PureComponent<RegulatoryModeSelectionProps, RegulatoryModeSelectionState> {\r\n  state: RegulatoryModeSelectionState = {\r\n    show: this.props.show,\r\n    regulatoryModes: this.props.regulatoryModes,\r\n    selectedRegulatoryModes: this.props.selectedRegulatoryModes\r\n  }\r\n\r\n\r\n  onCancel = () => {\r\n    this.props.onClose()\r\n  }\r\n\r\n  onSubmit = () => {\r\n    const { regulatoryModes, selectedRegulatoryModes } = this.state\r\n    this.props.onSave(selectedRegulatoryModes)\r\n  }\r\n\r\n \r\n  render() {\r\n    const { regulatoryModes, selectedRegulatoryModes } = this.props\r\n\r\n    return (\r\n        <Modal backdrop=\"static\" show={this.props.show} size=\"xl\">\r\n          <Modal.Header>\r\n            <Modal.Title className=\"text-uppercase\">Regulatory Modes</Modal.Title>\r\n          </Modal.Header>\r\n          <Modal.Body>\r\n            <React.Fragment>\r\n              <Form className=\"px-4\">\r\n                <DualListBox\r\n                  disabled={false}\r\n                  options={regulatoryModes}\r\n                  selected={selectedRegulatoryModes}\r\n                  idKey=\"RegulatoryModeID\"\r\n                  labelKey=\"Name\"\r\n                  availableTitle=\"Possible Criteria\"\r\n                  selectedTitle=\"Selected Criteria\"\r\n                  onChange={selected => this.setState({ selectedRegulatoryModes: [...selected] })}\r\n                />\r\n              </Form>\r\n            </React.Fragment>\r\n          </Modal.Body>\r\n          <Modal.Footer>\r\n            <Button variant=\"secondary\" onClick={this.onCancel} className=\"px-4\">Cancel</Button>\r\n            <ActionButton onClick={this.onSubmit} className=\"px-4\">Save</ActionButton>\r\n          </Modal.Footer>\r\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rW0jhe4kuGXO6WU5ZiTk/wA+nailtLqG9tIbq3cPDMgdGHcEZFFdB5jvfUr2ei6dYX93f2tqsdzeENPICTvP4nA/DFXcA0UUWsDbbuyGysrfTrVbW0iEUKFiqAkgZJJxntknjtRRRQJu+rP/2Q==\"","import * as React from \"react\"\r\nimport { Modal, Col, Row, Spinner, Button, Container, Image, Form, InputGroup } from \"react-bootstrap\"\r\nimport { FaAngleDown } from \"react-icons/fa\"\r\nimport { Typeahead } from \"react-bootstrap-typeahead\"\r\nimport 'react-bootstrap-typeahead/css/Typeahead.css'\r\nimport { toast } from \"react-toastify\"\r\nimport { Subscription } from \"rxjs\"\r\nimport { FilterDataName, GetFilterDataNameIndexByID, DeleteSavedQuery } from \"../../api/Randoms/RandomsModel/PoolCriteria\"\r\nimport { APIError } from \"../../api/ObservableFromFetch\"\r\nimport DeleteQueryImg from '../../assets/images/delete_query.png'\r\nimport ConfirmationModal from \"../ConfirmationModal\"\r\n\r\ninterface SavedQueriesModalProps {\r\n  savedQueries: FilterDataName[]\r\n  show: boolean\r\n  onSelect: (filterDataId: number, name: string) => void\r\n  onDelete: (filterDataId: number) => void\r\n  onClose: () => void\r\n}\r\n\r\ninterface SavedQueriesModalState {\r\n  saving: boolean\r\n  showConfirmation: boolean\r\n  idToDelete: number\r\n\r\n}\r\n\r\nexport default class SavedQueriesModal extends React.Component<SavedQueriesModalProps, SavedQueriesModalState> {\r\n  subscription?: Subscription\r\n  state: SavedQueriesModalState = {\r\n    saving: false,\r\n    showConfirmation: false,\r\n    idToDelete: 0\r\n  }\r\n\r\n  saveSubscription?: Subscription\r\n\r\n\r\n  componentWillUnmount() {\r\n    this.saveSubscription && this.saveSubscription.unsubscribe()\r\n  }\r\n\r\n  handleAPIError = (error: Error | APIError, stateChanges: object) => {\r\n    this.setState(stateChanges)\r\n    error && toast.error((error as APIError)?.errorData?.message || error.message)\r\n  }\r\n\r\n\r\n  handleClose = () => {\r\n    this.props.onClose()\r\n  }\r\n\r\n  handleSelectQuery = (filterDataId: number, name:string) => {\r\n    this.props.onSelect(filterDataId, name)\r\n  }\r\n  handleDeleteQuery = (filterDataId: number) => {\r\n    if (filterDataId <= 0) {\r\n      return\r\n    }\r\n    const itemIndex = GetFilterDataNameIndexByID(this.props.savedQueries, filterDataId);\r\n    if (itemIndex < 0) {\r\n      return\r\n    }\r\n    this.setState({ saving:false, showConfirmation: true, idToDelete: filterDataId })\r\n  }\r\n  deleteSelectedQuery = () => {\r\n    const filterDataId = this.state.idToDelete;\r\n    if (filterDataId <= 0) {\r\n      this.setState({ saving:false, showConfirmation: false, idToDelete: 0 })\r\n      return;\r\n    }\r\n    const itemIndex = GetFilterDataNameIndexByID(this.props.savedQueries, filterDataId);\r\n    if (itemIndex < 0) {\r\n      this.setState({ saving:false, showConfirmation: false, idToDelete: 0 })\r\n      return\r\n    }\r\n\r\n    this.setState({ saving: true })\r\n\r\n    this.saveSubscription && this.saveSubscription.unsubscribe()\r\n    this.saveSubscription = DeleteSavedQuery(filterDataId).subscribe(\r\n      data => {\r\n        this.setState({ saving: false })\r\n        this.props.onDelete(filterDataId)\r\n        toast.success(\"Record deleted successfully.\")\r\n      },\r\n      error => this.handleAPIError(error, { saving: false })\r\n    )\r\n    this.closeConfirmation();\r\n  }\r\n  closeConfirmation = () => {\r\n    this.setState({ saving:false, showConfirmation: false, idToDelete: 0 })\r\n  }\r\n\r\n\r\n  render() {\r\n    const savedQueries = this.props.savedQueries\r\n    return (\r\n      <>\r\n        <ConfirmationModal show={this.state.showConfirmation}\r\n          title=\"\"\r\n          textTitle=\"\"\r\n          text=\"Are you sure you want to delete this record?\"\r\n          showImage={false}\r\n          cancelButtonText=\"No\"\r\n          confirmButtonText=\"Yes\"\r\n          spinConfirmButton={this.state.saving}\r\n          onConfirm={() => this.deleteSelectedQuery()}\r\n          onHide={() => this.closeConfirmation()} />\r\n        <Modal backdrop=\"static\" size=\"lg\" centered show={this.props.show} onHide={this.handleClose}>\r\n          <Modal.Header closeButton>\r\n            <Modal.Title>Saved Queries</Modal.Title>\r\n          </Modal.Header>\r\n          <Modal.Body>\r\n            <Form>\r\n              {savedQueries.map((savedQuery, i) => {\r\n                return (\r\n                  <Form.Row key={`${savedQuery.FilterDataID}_${i}`}>\r\n                    <Col xs={9}>\r\n                      <Button variant=\"underline-link\" className=\"px-0 mx-0 \" onClick={() => this.handleSelectQuery(savedQuery.FilterDataID, savedQuery.Name)}>{savedQuery.Name}</Button>\r\n                    </Col>\r\n                    <Col xs={3} className=\"py-2 text-center\">\r\n                      <Image src={DeleteQueryImg} title=\"Delete Query\" onClick={() => this.handleDeleteQuery(savedQuery.FilterDataID)} />\r\n                    </Col>\r\n                  </Form.Row>)\r\n              })}           \r\n              </Form>\r\n          </Modal.Body>\r\n          <Modal.Footer>\r\n            {<Button variant=\"secondary\" onClick={() => this.handleClose()}>Cancel</Button>}\r\n          </Modal.Footer>\r\n        </Modal >\r\n      </>\r\n    )\r\n  }\r\n}\r\n","import React from \"react\"\r\nimport { Modal, Form, Button } from \"react-bootstrap\"\r\nimport DualListBox from \"../../components/Administration/DualListBox\"\r\nimport ActionButton from \"../ActionButton\"\r\nimport AutoFilterLocation from \"../../api/Location/LocationModel/AutoFilterLocation\"\r\n\r\ninterface LocationSelectionProps {\r\n  locations: AutoFilterLocation[]\r\n  selectedLocations: AutoFilterLocation[]\r\n  show: boolean\r\n  onSave: (locations: AutoFilterLocation[]) => void\r\n  onClose: () => void\r\n}\r\n\r\ninterface LocationSelectionState {\r\n  selectedLocations: AutoFilterLocation[]\r\n}\r\n\r\nexport default class LocationSelection extends React.PureComponent<LocationSelectionProps, LocationSelectionState> {\r\n  state: LocationSelectionState = {\r\n    selectedLocations: []\r\n  }\r\n\r\n  onCancel = () => this.props.onClose()\r\n\r\n  onSubmit = () => this.props.onSave(this.state.selectedLocations)\r\n\r\n  render() {\r\n    return (\r\n      <Modal backdrop=\"static\" show={this.props.show} size=\"xl\">\r\n        <Modal.Header>\r\n          <Modal.Title className=\"text-uppercase\">Locations</Modal.Title>\r\n        </Modal.Header>\r\n        <Modal.Body>\r\n          <Form className=\"px-4\">\r\n            <DualListBox\r\n              disabled={false}\r\n              options={this.props.locations}\r\n              selected={this.props.selectedLocations}\r\n              idKey=\"AccountID\"\r\n              labelKey=\"Name\"\r\n              availableTitle=\"Possible Criteria\"\r\n              selectedTitle=\"Selected Criteria\"\r\n              onChange={selected => this.setState({ selectedLocations: [...selected] })}\r\n            />\r\n          </Form>\r\n        </Modal.Body>\r\n        <Modal.Footer>\r\n          <Button variant=\"secondary\" onClick={this.onCancel} className=\"px-4\">Cancel</Button>\r\n          <ActionButton onClick={this.onSubmit} className=\"px-4\">Save</ActionButton>\r\n        </Modal.Footer>\r\n      </Modal>\r\n    )\r\n  }\r\n}\r\n","import { Observable } from \"rxjs\"\r\nimport { AccountTypeID } from \"../../config/Constants\"\r\nimport { ObservableFromFetch } from \"../ObservableFromFetch\"\r\nimport AutoFilterCompany from \"../Companies/CompanyModel/AutoFilterCompany\"\r\n\r\nexport function GetConsortiumCompaniesObservable(poolId: number): Observable<AutoFilterCompany[]> {\r\n  const requestBody: string = JSON.stringify({\r\n    AccountTypeID: AccountTypeID,\r\n    PoolID: poolId\r\n  })\r\n\r\n  return ObservableFromFetch<AutoFilterCompany[]>(\"RandomTest/GetConsortiumAccounts\", requestBody)\r\n}\r\n\r\nexport function ValidateConsortiumCompanyObservable(poolId: number, accountID: number|string): Observable<string> {\r\n  const requestBody: string = JSON.stringify({\r\n    accountID: Number(accountID),\r\n    poolID: poolId\r\n  })\r\n\r\n  return ObservableFromFetch<string>(\"RandomTest/ValidateConsortiumAccount\", requestBody)\r\n}","import React from \"react\"\r\nimport { Modal, Form, Button, Spinner, Col } from \"react-bootstrap\"\r\nimport AutoFilterCompany from \"../../api/Companies/CompanyModel/AutoFilterCompany\"\r\nimport DualListBox from \"../../components/Administration/DualListBox\"\r\nimport ActionButton from \"../ActionButton\"\r\nimport { ValidateConsortiumCompanyObservable } from \"../../api/Randoms/ConsortiumData\"\r\nimport { Subscription } from \"rxjs\"\r\nimport { toast } from \"react-toastify\"\r\nimport { APIError } from \"../../api/ObservableFromFetch\"\r\n\r\ninterface CompanySelectionProps {\r\n  companies: AutoFilterCompany[]\r\n  selectedCompanies: AutoFilterCompany[]\r\n  show: boolean\r\n  onSave: (companies: AutoFilterCompany[]) => void\r\n  onClose: () => void\r\n  isConsortium?: boolean\r\n  poolID: number\r\n}\r\n\r\ninterface CompanySelectionState {\r\n  selectedCompanies: AutoFilterCompany[]\r\n  validations: CompanyValidation[]\r\n  validating: boolean\r\n  showModal: boolean\r\n  validationMessage: string\r\n}\r\n\r\ninterface CompanyValidation{\r\n  poolID: number\r\n  accountID: number\r\n  message: string\r\n}\r\n\r\nexport default class CompanySelection extends React.PureComponent<CompanySelectionProps, CompanySelectionState> {\r\n  state: CompanySelectionState = {\r\n    selectedCompanies: [],\r\n    validations: [],\r\n    validating: false,\r\n    showModal: false,\r\n    validationMessage: \"\"\r\n  }\r\n\r\n  subscriptions = new Subscription()\r\n  validateSubscription?: Subscription\r\n\r\n  componentDidMount() {\r\n    this.setState({ selectedCompanies: [...this.props.selectedCompanies] })\r\n    if (!!this.props.isConsortium) {\r\n      const datStr = localStorage.getItem(\"consortiumCheckCompanies\");\r\n      if (datStr) {\r\n        const data: CompanyValidation[] = JSON.parse(datStr)\r\n        if (data.length > 0) {\r\n          this.setState({validations: data})\r\n        }\r\n      }\r\n      else {\r\n        this.setState({validations: []})\r\n      }\r\n    }\r\n  }\r\n\r\n  componentWillUnmount() {\r\n    if (!!this.props.isConsortium) {\r\n      localStorage.setItem(\"consortiumCheckCompanies\", JSON.stringify(this.state.validations))\r\n    }\r\n  }\r\n\r\n  handleAPIError = (error: Error | APIError, stateChanges: object) => {\r\n    this.setState(stateChanges)\r\n    error && toast.error((error as APIError)?.errorData?.message || error.message)\r\n  }\r\n\r\n  onChange = (selected: AutoFilterCompany[]) => {\r\n    const { selectedCompanies } = this.state\r\n    if (this.props.isConsortium && selected.length > selectedCompanies.length) {\r\n      this.setState({showModal: true, validating: true})\r\n      const diff = selected.find(x => !this.state.selectedCompanies.find(el => el.AccountID === x.AccountID))\r\n      if (diff) {\r\n        this.validate(diff, selected)\r\n      }\r\n    }\r\n    else {\r\n      this.setState({ selectedCompanies: [...selected] })\r\n    }\r\n  }\r\n\r\n  validate = (account: AutoFilterCompany, selected: AutoFilterCompany[]) =>\r\n  {\r\n    ValidateConsortiumCompanyObservable(this.props.poolID, account.AccountID).subscribe(\r\n      (message) => {\r\n        let validations = [...this.state.validations]\r\n        if (message.length === 0) {\r\n          let vs = validations.findIndex(v => v.poolID === this.props.poolID && v.accountID === account.AccountID)\r\n          if(vs >= 0)\r\n          {\r\n            validations.splice(vs, 1)\r\n          }\r\n          this.setState({ selectedCompanies: [...selected], showModal: false })\r\n        }\r\n        else \r\n        {\r\n          let vs = validations.find(v => v.poolID === this.props.poolID && v.accountID === account.AccountID)\r\n          if (vs !== undefined) {\r\n            vs.message = message\r\n          }\r\n          else {\r\n            validations.push({poolID: this.props.poolID, accountID: account.AccountID, message: message})\r\n          }\r\n        }\r\n        this.setState({ validating: false, validationMessage: message, validations: [...validations ] })\r\n      },\r\n      (error) => this.handleAPIError(error, {validating: false, showModal: false, validationMessage: \"\"})\r\n    )\r\n  }\r\n\r\n  onCancel = () => this.props.onClose()\r\n\r\n  onSubmit = () => this.props.onSave(this.state.selectedCompanies)\r\n\r\n  render() {\r\n    let cs = this.props.companies.map(a => {\r\n      let v = this.state.validations.find(v => v.poolID === this.props.poolID && v.accountID === a.AccountID)\r\n      let n = !!v?.message ? `${a.Name} (${v.message})` : a.Name\r\n      return {...a, Name: n} \r\n    })\r\n    return (<>\r\n      {!this.state.showModal && <Modal backdrop=\"static\" show={this.props.show} size=\"xl\">\r\n        <Modal.Header>\r\n          <Modal.Title className=\"text-uppercase\">Companies</Modal.Title>\r\n        </Modal.Header>\r\n        <Modal.Body>\r\n          <Form className=\"px-4\">\r\n            <DualListBox\r\n              disabled={false}\r\n              options={cs}\r\n              selected={this.state.selectedCompanies}\r\n              idKey=\"AccountID\"\r\n              labelKey=\"Name\"\r\n              availableTitle=\"Possible Criteria\"\r\n              selectedTitle=\"Selected Criteria\"\r\n              onChange={this.onChange}\r\n              isConsortium={true}\r\n            />\r\n          </Form>\r\n        </Modal.Body>\r\n        <Modal.Footer>\r\n          <Button variant=\"secondary\" onClick={this.onCancel} className=\"px-4\">Cancel</Button>\r\n          <ActionButton onClick={this.onSubmit} className=\"px-4\">Save</ActionButton>\r\n        </Modal.Footer>\r\n      </Modal>}\r\n      {this.state.showModal && <Modal backdrop=\"static\" show size=\"lg\">\r\n        <Modal.Header>\r\n          <Modal.Title className=\"text-uppercase\">VALIDATION</Modal.Title>\r\n        </Modal.Header>\r\n        <Modal.Body>\r\n          {this.state.validating &&\r\n            <Col>\r\n              <Spinner animation=\"border\" variant=\"secondary\" />\r\n            </Col>\r\n          }\r\n           {!this.state.validating &&\r\n            <Col>\r\n              {this.state.validationMessage}\r\n            </Col>\r\n          }\r\n        </Modal.Body>\r\n        <Modal.Footer>\r\n        {!this.state.validating  &&  <Button variant=\"secondary\" onClick={() => this.setState({showModal: false})} className=\"px-4\">OK</Button>}\r\n        </Modal.Footer>\r\n      </Modal>}\r\n      </>\r\n    )\r\n  }\r\n}\r\n","import * as React from \"react\"\r\nimport { Modal, Col, Row, Spinner, Button, Form } from \"react-bootstrap\"\r\nimport 'react-bootstrap-typeahead/css/Typeahead.css'\r\nimport { toast } from \"react-toastify\"\r\nimport { Subscription } from \"rxjs\"\r\nimport RegulatoryMode from \"../../api/LabService/LabServiceModel/RegulatoryMode\"\r\nimport AutoFilterLocation from \"../../api/Location/LocationModel/AutoFilterLocation\"\r\nimport LabServiceRegulatoryModesGetObservable from \"../../api/LabService/LabServiceRegulatoryModesGet\"\r\nimport { APIError } from \"../../api/ObservableFromFetch\"\r\nimport PoolCriteria, { CopyFilterDataNames, CopyPoolCriteria, EmptyPoolCriteria, FilterData, FilterDataName, FilterDataToPoolCriteria, GetCompanyPoolCriteriaItem, GetFilterDataNameIndexByID, GetPoolCriteria, GetPoolCriteriaItemStringValues, GetRegulatoryModePoolCriteriaItem, GetSavedQueries, GetSavedQuery, SavePoolCriteria, SaveQueryAs, GetPoolCriteriaItemByCode, FilterCriteriaCode } from \"../../api/Randoms/RandomsModel/PoolCriteria\"\r\nimport ActionButton from \"../ActionButton\"\r\nimport QueryNameModal from \"./QueryNameModal\"\r\nimport RegulatoryModeSelection from \"./RegulatoryModeSelection\"\r\nimport SavedQueriesModal from \"./SavedQueriesModal\"\r\nimport LocationSelection from \"./LocationSelection\"\r\nimport AutoFilterLocationsGetObservable from \"../../api/Location/AutoFilterLocationsGet\"\r\nimport AutoFilterCompany from \"../../api/Companies/CompanyModel/AutoFilterCompany\"\r\nimport CompanySelection from \"./CompanySelection\"\r\nimport { GetConsortiumCompaniesObservable } from \"../../api/Randoms/ConsortiumData\"\r\nimport ConfirmationModal from \"../ConfirmationModal\"\r\n\r\ninterface PoolMembersCriteriaModalProps {\r\n  poolId: number\r\n  poolName: string\r\n  regulated: boolean\r\n  show: boolean\r\n  onSave: (close: boolean) => void\r\n  onClose: () => void\r\n  isConsortium: boolean\r\n  useFileImportForPoolMembership: boolean\r\n}\r\n\r\ninterface PoolMembersCriteriaModalState {\r\n  availableRegulatoryModes: RegulatoryMode[]\r\n  isRegulatoryModesLoading: boolean\r\n  availableCompanies: AutoFilterCompany[]\r\n  selectedCompanies: AutoFilterCompany[]\r\n  availableLocations: AutoFilterLocation[]\r\n  selectedLocations: AutoFilterLocation[]\r\n  loadingLocations: boolean\r\n  isPoolCriteriaLoading: boolean\r\n  isSavedQueriesLoading: boolean\r\n  isSavedQueryLoading: boolean\r\n  showRegulatoryModes: boolean\r\n  showLocations: boolean\r\n  showCompanies: boolean\r\n  showSavedQueries: boolean\r\n  showQueryName: boolean\r\n  poolCriteria: PoolCriteria\r\n  savedQueries: FilterDataName[]\r\n  criteriaSaving: boolean\r\n  querySaving: boolean\r\n  querySavingAs: boolean\r\n  saveQueryMode: string\r\n  originalCompanies: AutoFilterCompany[]\r\n  originalLocations: AutoFilterLocation[]\r\n  showConfirmSave: boolean\r\n  confirmSaveText: string\r\n\r\n}\r\n\r\nexport default class PoolMembersCriteriaModal extends React.Component<PoolMembersCriteriaModalProps, PoolMembersCriteriaModalState> {\r\n  saveSubscription?: Subscription\r\n  saveAsSubscription?: Subscription\r\n  loadSavedQuerySubscription?: Subscription\r\n  state: PoolMembersCriteriaModalState = {\r\n    availableRegulatoryModes: [],\r\n    isRegulatoryModesLoading: false,\r\n    availableLocations: [],\r\n    selectedLocations: [],\r\n    availableCompanies: [],\r\n    selectedCompanies: [],\r\n    loadingLocations: true,\r\n    isPoolCriteriaLoading: false,\r\n    isSavedQueriesLoading: false,\r\n    isSavedQueryLoading: false,\r\n    showRegulatoryModes: false,\r\n    showLocations: false,\r\n    showCompanies: false,\r\n    showSavedQueries: false,\r\n    showQueryName: false,\r\n    poolCriteria: EmptyPoolCriteria,\r\n    savedQueries: [],\r\n    criteriaSaving: false,\r\n    querySaving: false,\r\n    querySavingAs: false,\r\n    saveQueryMode: \"\",\r\n    originalCompanies: [],\r\n    originalLocations: [],\r\n    showConfirmSave: false,\r\n    confirmSaveText: \"\"\r\n  }\r\n\r\n  subscriptions = new Subscription()\r\n  locationSubscription?: Subscription\r\n\r\n  componentDidMount() {\r\n    if (this.props.regulated) {\r\n      this.setState({ isRegulatoryModesLoading: true, loadingLocations: true })\r\n      this.subscriptions.add(\r\n        LabServiceRegulatoryModesGetObservable().subscribe(\r\n          (data: RegulatoryMode[]) => this.setState({ availableRegulatoryModes: data, isRegulatoryModesLoading: false }),\r\n          () => this.setState({ isRegulatoryModesLoading: false })\r\n        )\r\n      )\r\n    }\r\n\r\n    this.setState({ isPoolCriteriaLoading: true, isSavedQueriesLoading: true, loadingLocations: true })\r\n    this.subscriptions.add(\r\n      GetPoolCriteria(this.props.poolId).subscribe(\r\n        (data: PoolCriteria) => {\r\n          this.setState({ poolCriteria: data, isPoolCriteriaLoading: false })\r\n          const companyItem = GetCompanyPoolCriteriaItem(this.state.poolCriteria)\r\n\r\n          if (this.props.isConsortium) {\r\n            this.locationSubscription = GetConsortiumCompaniesObservable(this.props.poolId).subscribe(\r\n              (data: AutoFilterCompany[]) => {\r\n                const selectedCompanies = this.getSelectedCompanies(this.state.poolCriteria, data)\r\n                this.setState({ availableCompanies: data, selectedCompanies: selectedCompanies, originalCompanies: selectedCompanies, loadingLocations: false })\r\n              },\r\n              () => this.setState({ loadingLocations: false })\r\n            )\r\n          }\r\n          else {\r\n            const companyID = companyItem.Values.length ? companyItem.Values[0].IntValue : 0\r\n            this.locationSubscription = AutoFilterLocationsGetObservable(companyID, \"\", \"\").subscribe(\r\n              (data: AutoFilterLocation[]) => {\r\n                const selectedLocations = this.getSelectedLocations(this.state.poolCriteria, data)\r\n                this.setState({ availableLocations: data, selectedLocations: selectedLocations, originalLocations: selectedLocations, loadingLocations: false })\r\n              },\r\n              () => this.setState({ loadingLocations: false })\r\n            )\r\n          }\r\n        },\r\n        () => this.setState({ isPoolCriteriaLoading: false })\r\n      )\r\n    )\r\n    this.subscriptions.add(\r\n      GetSavedQueries(0).subscribe(\r\n        (data: FilterDataName[]) => this.setState({ savedQueries: data, isSavedQueriesLoading: false }),\r\n        () => this.setState({ isSavedQueriesLoading: false })\r\n      )\r\n    )\r\n  }\r\n\r\n  componentWillUnmount() {\r\n    this.saveSubscription && this.saveSubscription.unsubscribe()\r\n    this.saveAsSubscription && this.saveAsSubscription.unsubscribe()\r\n    this.loadSavedQuerySubscription && this.loadSavedQuerySubscription.unsubscribe()\r\n    this.subscriptions.unsubscribe()\r\n    this.locationSubscription && this.locationSubscription.unsubscribe()\r\n  }\r\n\r\n  handleAPIError = (error: Error | APIError, stateChanges: object) => {\r\n    this.setState(stateChanges)\r\n    error && toast.error((error as APIError)?.errorData?.message || error.message)\r\n  }\r\n\r\n  confirmSave = () => {\r\n    if (!this.props.isConsortium || !this.props.useFileImportForPoolMembership){\r\n      this.handleSave()\r\n      return\r\n    }\r\n    const deletedCompanies = this.getDeletedCompanies()\r\n    if (deletedCompanies.length > 0) {\r\n      this.setState({ showConfirmSave: true, confirmSaveText:this.getConfirmText(deletedCompanies)})\r\n    } else {\r\n      this.handleSave()\r\n    }\r\n  }\r\n\r\n  getDeletedCompanies = (): AutoFilterCompany[] => {\r\n    const companyCriteria = GetCompanyPoolCriteriaItem(this.state.poolCriteria)\r\n    const originalCompanies = this.state.originalCompanies\r\n    const deletedCompanies = originalCompanies.filter(c => !companyCriteria.Values.find(item => item.IntValue === c.AccountID))\r\n    return deletedCompanies || []\r\n  }\r\n\r\n  getConfirmText = (deletedCompanies: AutoFilterCompany[]): string => {\r\n    if (deletedCompanies.length === 0) {\r\n      return \"\"\r\n    }\r\n    if (deletedCompanies.length === 1) {\r\n      return \"You removing a company from the pool and all members in the company will be marked as inactive.\\\r\n      Do you want to continue?\"\r\n    }\r\n    return  \"You have removed \" + deletedCompanies.length + \" companies from the pool.\\\r\n    All members of these companies will be marked as inactive.\\\r\n    Do you want to continue?\"\r\n  }\r\n\r\n  handleConfirmSave = () => {\r\n    this.setState({ showConfirmSave: false})\r\n    this.handleSave()\r\n  }\r\n\r\n  handleConfirmClose = () => {\r\n    this.setState({ showConfirmSave: false })\r\n  }\r\n\r\n  handleSave = () => {\r\n    this.setState({ criteriaSaving: true })\r\n    this.saveSubscription && this.saveSubscription.unsubscribe()\r\n    const data = { ...this.state.poolCriteria, IsConsortium: this.props.isConsortium }\r\n    this.saveSubscription = SavePoolCriteria(data).subscribe(\r\n      (data: PoolCriteria) => {\r\n        this.setState({ criteriaSaving: false })\r\n        toast.success(\"Criteria saved successfully.\")\r\n        this.props.onSave(true)\r\n      },\r\n      error => this.handleAPIError(error, { criteriaSaving: false })\r\n    )\r\n  }\r\n\r\n  handleSaveQuery = () => {\r\n    if ((this.state.poolCriteria.FilterDataID === 0) || (this.state.poolCriteria.SaveAs.length === 0)) {\r\n      this.setState({ showQueryName: true, saveQueryMode: \"save\" })\r\n    }\r\n    else {\r\n      this.handleQueryNameSave(this.state.poolCriteria.SaveAs, \"save\")\r\n    }\r\n  }\r\n  handleSaveQueryAs = () => {\r\n    this.setState({ showQueryName: true, saveQueryMode: \"save_as\" })\r\n  }\r\n\r\n  handleQueryNameSave = (name: string, save_mode: string = \"\") => {\r\n    if (name.trim().length === 0) {\r\n      this.setState({ showQueryName: false, querySaving: false, querySavingAs: false, saveQueryMode: \"\" })\r\n      return\r\n    }\r\n    const save_query_mode = save_mode || this.state.saveQueryMode;\r\n    const querySaving = (save_query_mode === \"save\")\r\n    const querySavingAs = (save_query_mode === \"save_as\")\r\n    this.setState({ showQueryName: false, querySaving: querySaving, querySavingAs: querySavingAs })\r\n    this.saveAsSubscription && this.saveAsSubscription.unsubscribe()\r\n    this.saveAsSubscription = SaveQueryAs(this.state.poolCriteria, name).subscribe(\r\n      (data: FilterData) => {\r\n        const filterDataId = data.FilterDataID;\r\n        const itemIndex = GetFilterDataNameIndexByID(this.state.savedQueries, filterDataId);\r\n        let savedQueries = this.state.savedQueries;\r\n        if (itemIndex < 0) {\r\n\r\n          const newFilterDataItem = {\r\n            FilterDataID: filterDataId,\r\n            Name: data.Name\r\n          }\r\n          savedQueries = CopyFilterDataNames(this.state.savedQueries);\r\n          savedQueries.push(newFilterDataItem);\r\n        }\r\n\r\n        const loadedPoolCriteria: PoolCriteria = FilterDataToPoolCriteria(this.state.poolCriteria.PoolID, data)\r\n        const selectedLocations = this.getSelectedLocations(loadedPoolCriteria, this.state.availableLocations)\r\n        this.setState({ poolCriteria: loadedPoolCriteria, selectedLocations: selectedLocations, savedQueries: savedQueries, querySaving: false, querySavingAs: false, saveQueryMode: \"\" })\r\n        toast.success(data.SaveResultText)\r\n      },\r\n      error => this.handleAPIError(error, { querySaving: false, querySavingAs: false, saveQueryMode: \"\" })\r\n    )\r\n  }\r\n\r\n  handleQueryNameClose = () => {\r\n    this.setState({ showQueryName: false })\r\n  }\r\n\r\n  handleClearFilter = () => {\r\n    const poolCriteria = CopyPoolCriteria(this.state.poolCriteria)\r\n    const poolCriteriaItem = GetRegulatoryModePoolCriteriaItem(poolCriteria);\r\n    const locationCriteria = GetPoolCriteriaItemByCode(poolCriteria, FilterCriteriaCode.Location)\r\n    poolCriteriaItem.Values = []\r\n    locationCriteria.Values = []\r\n    this.setState({ poolCriteria: poolCriteria, selectedLocations: [] })\r\n  }\r\n\r\n  handleClose = () => {\r\n    this.props.onClose()\r\n  }\r\n\r\n  handleSelectSavedQuery = (filterDataId: number, name: string) => {\r\n    this.setState({ showSavedQueries: false, isSavedQueryLoading: true })\r\n    this.loadSavedQuerySubscription && this.loadSavedQuerySubscription.unsubscribe()\r\n    this.loadSavedQuerySubscription = GetSavedQuery(filterDataId, name).subscribe(\r\n      (data: FilterData) => {\r\n        //preserve Company\r\n        const companyItem = GetCompanyPoolCriteriaItem(this.state.poolCriteria)\r\n        const loadedPoolCriteria: PoolCriteria = FilterDataToPoolCriteria(this.state.poolCriteria.PoolID, data, true)\r\n        loadedPoolCriteria.Items.push(companyItem)\r\n\r\n        const selectedLocations = this.getSelectedLocations(loadedPoolCriteria, this.state.availableLocations)\r\n        const locationCriteria = GetPoolCriteriaItemByCode(loadedPoolCriteria, FilterCriteriaCode.Location, true)\r\n        locationCriteria.Values = selectedLocations.map(item => ({ ID: 0, IntValue: item.AccountID || 0, StringValue: item.Name, BoolValue: false }))\r\n\r\n        this.setState({ poolCriteria: loadedPoolCriteria, selectedLocations: selectedLocations, isSavedQueryLoading: false })\r\n        toast.success(\"Query loaded successfully.\")\r\n      },\r\n      error => this.handleAPIError(error, { isSavedQueryLoading: false })\r\n    )\r\n  }\r\n\r\n  handleDeleteSavedQuery = (filterDataId: number) => {\r\n\r\n    let savedQueries = this.state.savedQueries;\r\n    const itemIndex = GetFilterDataNameIndexByID(savedQueries, filterDataId);\r\n    if (itemIndex >= 0) {\r\n      savedQueries = CopyFilterDataNames(savedQueries);\r\n      savedQueries.splice(itemIndex, 1)\r\n    }\r\n\r\n    this.setState({ showSavedQueries: false, savedQueries: savedQueries })\r\n  }\r\n\r\n  handleShowSavedQueries = () => {\r\n    this.setState({ showSavedQueries: true })\r\n  }\r\n\r\n  handleRegulatoryModeChange = (items: RegulatoryMode[]) => {\r\n    const poolCriteria = this.setRegulatorModes(items)\r\n    this.setState({ showRegulatoryModes: false, poolCriteria: poolCriteria })\r\n  }\r\n\r\n  handleEditRegulatoryMode = () => this.setState({ showRegulatoryModes: true })\r\n\r\n  handleLocationChange = (items: AutoFilterLocation[]) => {\r\n    const poolCriteria = CopyPoolCriteria(this.state.poolCriteria)\r\n    const locationCriteria = GetPoolCriteriaItemByCode(poolCriteria, FilterCriteriaCode.Location, true)\r\n    locationCriteria.Values = items.map(item => ({ ID: 0, IntValue: item.AccountID || 0, StringValue: item.Name, BoolValue: false }))\r\n\r\n    this.setState({ showLocations: false, poolCriteria: poolCriteria, selectedLocations: items })\r\n  }\r\n\r\n  handleCompanyChange = (items: AutoFilterCompany[]) => {\r\n    const poolCriteria = CopyPoolCriteria(this.state.poolCriteria)\r\n    const companyCriteria = GetPoolCriteriaItemByCode(poolCriteria, FilterCriteriaCode.Company, true)\r\n    companyCriteria.Values = items.map(item => ({ ID: 0, IntValue: item.AccountID || 0, StringValue: item.Name, BoolValue: false }))\r\n\r\n    this.setState({ showCompanies: false, poolCriteria: poolCriteria, selectedCompanies: items })\r\n  }\r\n\r\n  handleEdiLocation = () => this.setState({ showLocations: true })\r\n  handleEditCompany = () => this.setState({ showCompanies: true })\r\n\r\n  getSelectedRegulatoryModeModes = () => {\r\n    let result: RegulatoryMode[] = [];\r\n    let poolCriteriaItem = GetRegulatoryModePoolCriteriaItem(this.state.poolCriteria);\r\n    let values = poolCriteriaItem.Values;\r\n    let items = this.state.availableRegulatoryModes;\r\n    for (let i = 0; i < values.length; i++) {\r\n      let val = values[i];\r\n      for (let j = 0; j < items.length; j++) {\r\n        let item = items[j];\r\n        if (item.RegulatoryModeID === val.IntValue) {\r\n          result.push(item)\r\n          break;\r\n        }\r\n      }\r\n    }\r\n    return result;\r\n  }\r\n\r\n  setRegulatorModes = (items: RegulatoryMode[]): PoolCriteria => {\r\n    const poolCriteria = CopyPoolCriteria(this.state.poolCriteria)\r\n    const poolCriteriaItem = GetRegulatoryModePoolCriteriaItem(poolCriteria);\r\n    poolCriteriaItem.Values = []\r\n    for (let i = 0; i < items.length; i++) {\r\n      const item = items[i];\r\n      const val = {\r\n        ID: 0,\r\n        PoolCriteriaID: 0,\r\n        PoolCriteriaIntID: 0,\r\n        PoolOptionID: 0,\r\n        IntValue: item.RegulatoryModeID,\r\n        StringValue: item.Name,\r\n        BoolValue: false\r\n      }\r\n      poolCriteriaItem.Values.push(val);\r\n    }\r\n    return poolCriteria;\r\n  }\r\n\r\n\r\n  getCompanyNames = () => {\r\n    let item = GetCompanyPoolCriteriaItem(this.state.poolCriteria)\r\n    const companies = item.Values.map(value => { return { ID: value.IntValue, Name: value.StringValue, CompanyName: value.StringValue2 || \"\", CompanyCode: value.StringValue3 || \"\" } })\r\n    let names: string[] = []\r\n    for (let i = 0; i < companies.length; i++) {\r\n      let name = companies[i].CompanyName || \"\"\r\n      let code = companies[i].CompanyCode ? companies[i].CompanyCode.toString() : \"\"\r\n      if (code) {\r\n        code = \" (Company Code: \" + code + \")\"\r\n      }\r\n      names[i] = name + code\r\n    }\r\n    return names\r\n  }\r\n\r\n  getRegulatoryModeNames = () => {\r\n    let item = GetRegulatoryModePoolCriteriaItem(this.state.poolCriteria)\r\n    let result = GetPoolCriteriaItemStringValues(item)\r\n    return result;\r\n  }\r\n\r\n  getSelectedLocations = (poolCriteria: PoolCriteria, availableLocations: AutoFilterLocation[]) => {\r\n    const locationCriteria = GetPoolCriteriaItemByCode(poolCriteria, FilterCriteriaCode.Location)\r\n    const locationIds = locationCriteria.Values.map(value => value.IntValue)\r\n    return availableLocations.filter(location => locationIds.includes(location.AccountID || 0))\r\n  }\r\n\r\n  getSelectedCompanies = (poolCriteria: PoolCriteria, availableCompanies: AutoFilterCompany[]) => {\r\n    const companyCriteria = GetPoolCriteriaItemByCode(poolCriteria, FilterCriteriaCode.Company)\r\n    const companyIds = companyCriteria.Values.map(value => value.IntValue)\r\n    return availableCompanies.filter(company => companyIds.includes(company.AccountID || 0))\r\n  }\r\n\r\n  getLocationNames = () => this.state.selectedLocations.map(item => item.Name)\r\n\r\n  creatCompanyRow = (companyName: string) => {\r\n    return <Row><Col>{companyName}</Col></Row>\r\n  }\r\n  creatCompanyRows = (items: string[]) => {\r\n    let result = []\r\n    for (let i = 0; i < items.length; i++) {\r\n      result[i] = this.creatCompanyRow(items[i])\r\n    }\r\n    return result\r\n  }\r\n  render() {\r\n    const { criteriaSaving, querySaving, querySavingAs, availableRegulatoryModes, availableLocations, selectedLocations, savedQueries, availableCompanies, selectedCompanies,\r\n      isRegulatoryModesLoading, isPoolCriteriaLoading, isSavedQueriesLoading, showQueryName, isSavedQueryLoading, loadingLocations } = this.state\r\n    const { regulated, isConsortium } = this.props\r\n    const selectedRegulatoryModes = this.getSelectedRegulatoryModeModes()\r\n    const companyNames = this.getCompanyNames() || []\r\n    const companyRows = this.creatCompanyRows(companyNames)\r\n    const regulatoryModeNames = this.getRegulatoryModeNames()\r\n    const regulatoryModeNamesStr = regulatoryModeNames.join(\", \")\r\n    const locationNames = this.getLocationNames().join(\", \")\r\n    const loading = (regulated && isRegulatoryModesLoading) || isPoolCriteriaLoading || isSavedQueriesLoading || isSavedQueryLoading || loadingLocations\r\n    const savedQueriesPresent = savedQueries.length > 0\r\n    const isShowSaveQuery = true;\r\n    const isShowSaveQueryAs = (this.state.poolCriteria.FilterDataID > 0)\r\n    const isShowClose = true;\r\n    const isShowClearFilter = true;\r\n    const isShowSave = true;\r\n\r\n    const saving = criteriaSaving || querySaving || querySavingAs;\r\n\r\n    return (\r\n      <>\r\n        <QueryNameModal\r\n          show={showQueryName}\r\n          onSave={(name) => this.handleQueryNameSave(name)}\r\n          onClose={this.handleQueryNameClose} />\r\n        {savedQueriesPresent &&\r\n          <SavedQueriesModal\r\n            show={this.state.showSavedQueries}\r\n            savedQueries={savedQueries}\r\n            onClose={() => this.setState({ showSavedQueries: false })}\r\n            onSelect={(filterDataId, name) => this.handleSelectSavedQuery(filterDataId, name)}\r\n            onDelete={(filterDataId) => this.handleDeleteSavedQuery(filterDataId)} />\r\n        }\r\n        {this.props.regulated && <RegulatoryModeSelection\r\n          show={this.state.showRegulatoryModes}\r\n          regulatoryModes={availableRegulatoryModes}\r\n          selectedRegulatoryModes={selectedRegulatoryModes}\r\n          onClose={() => this.setState({ showRegulatoryModes: false })}\r\n          onSave={(regModes) => this.handleRegulatoryModeChange(regModes)} />}\r\n        <LocationSelection\r\n          show={this.state.showLocations}\r\n          locations={availableLocations}\r\n          selectedLocations={selectedLocations}\r\n          onClose={() => this.setState({ showLocations: false })}\r\n          onSave={(locations) => this.handleLocationChange(locations)} />\r\n        {!loadingLocations && <CompanySelection\r\n          show={this.state.showCompanies}\r\n          companies={availableCompanies}\r\n          selectedCompanies={selectedCompanies}\r\n          onClose={() => this.setState({ showCompanies: false })}\r\n          onSave={(companies) => this.handleCompanyChange(companies)}\r\n          isConsortium={isConsortium}\r\n          poolID={this.props.poolId}\r\n        />}\r\n        {!loading && !saving &&\r\n          <ConfirmationModal show={this.state.showConfirmSave}\r\n            title=\"\"\r\n            textTitle=\"\"\r\n            text={this.state.confirmSaveText}\r\n            showImage={false}\r\n            cancelButtonText=\"No\"\r\n            confirmButtonText=\"Yes\"\r\n            onConfirm={() => this.handleConfirmSave()}\r\n            onHide={() => this.handleConfirmClose()} />\r\n        }\r\n\r\n        <Modal backdrop=\"static\" size=\"lg\" centered show={this.props.show} onHide={this.handleClose}>\r\n          <Modal.Header closeButton>\r\n            <Modal.Title>CRITERIA</Modal.Title>\r\n          </Modal.Header>\r\n          <Modal.Body>\r\n            {(loading || saving) &&\r\n              <Col>\r\n                <Spinner animation=\"border\" variant=\"secondary\" />\r\n              </Col>}\r\n\r\n            {!loading && !saving &&\r\n              <Form>\r\n                <Row>\r\n                  <Col sm={9} md={6} lg={3}>\r\n                    <Form.Label></Form.Label>\r\n                  </Col>\r\n                  <Col sm={9} md={6} lg={3}>\r\n                    <Form.Label>\r\n                      {savedQueriesPresent &&\r\n                        <Button variant=\"underline-link\" onClick={() => this.handleShowSavedQueries()}>Saved Queries</Button>\r\n                      }\r\n                    </Form.Label>\r\n                  </Col>\r\n                </Row>\r\n                <Row>\r\n                  <Col sm={9} md={6} lg={3}>\r\n                    {!isConsortium && <Form.Label>Company</Form.Label>}\r\n                    {isConsortium && <Button variant=\"underline-link\" className=\"p-0 mx-0\" onClick={this.handleEditCompany}>Company</Button>}\r\n                  </Col>\r\n                  <Col>\r\n                    <Form.Label>{companyRows}</Form.Label>\r\n\r\n                  </Col>\r\n                  <Col sm={9} md={6} lg={3}>\r\n                    <Form.Label></Form.Label>\r\n                  </Col>\r\n                </Row>\r\n                {!isConsortium && <Row>\r\n                  <Col sm={9} md={6} lg={3}>\r\n                    <Button variant=\"underline-link\" className=\"p-0 mx-0\" onClick={this.handleEdiLocation}>Location</Button>\r\n                  </Col>\r\n                  <Col>\r\n                    <Form.Label>{locationNames}</Form.Label>\r\n                  </Col>\r\n                  <Col sm={9} md={6} lg={3}>\r\n                    <Form.Label></Form.Label>\r\n                  </Col>\r\n                </Row>}\r\n                {regulated && <Row>\r\n                  <Col sm={9} md={6} lg={3}>\r\n                    <Form.Label>\r\n                      <Button variant=\"underline-link\" className=\"px-0 mx-0\" onClick={() => this.handleEditRegulatoryMode()}>Regulatory Mode</Button>\r\n                    </Form.Label>\r\n                  </Col>\r\n                  <Col>\r\n                    <Form.Label>{regulatoryModeNamesStr}</Form.Label>\r\n                  </Col>\r\n                  <Col sm={9} md={6} lg={3}>\r\n                    <Form.Label></Form.Label>\r\n                  </Col>\r\n                </Row>}\r\n              </Form>}\r\n          </Modal.Body>\r\n          <Modal.Footer>\r\n            {isShowSaveQuery && <ActionButton variant=\"primary\" spin={querySaving} onClick={() => this.handleSaveQuery()}>Save Query</ActionButton>}\r\n            {isShowSaveQueryAs && <ActionButton variant=\"primary\" spin={querySavingAs} onClick={() => this.handleSaveQueryAs()}>Save Query As</ActionButton>}\r\n            {isShowClose && <ActionButton variant=\"secondary\" onClick={() => this.handleClose()}>Cancel</ActionButton>}\r\n            {isShowClearFilter && <ActionButton variant=\"primary\" onClick={() => this.handleClearFilter()}>Clear Filter</ActionButton>}\r\n            {isShowSave && <ActionButton variant=\"primary\" spin={criteriaSaving} onClick={() => this.confirmSave()}>Save</ActionButton>}\r\n          </Modal.Footer>\r\n        </Modal >\r\n      </>\r\n    )\r\n  }\r\n}\r\n","import { Observable } from \"rxjs\"\r\nimport CheckPoolMember from \"./RandomsModel/CheckPoolMember\"\r\nimport { PoolCompanyInfo } from \"./RandomsModel/PoolCompanyInfo\"\r\nimport PoolMemberData from \"./RandomsModel/PoolMemberData\"\r\nimport { ObservableFromFetch } from \"../ObservableFromFetch\"\r\n\r\nexport function PoolMemberCheck(poolId: number, accountType: string, mask: string, searchBy: string): Observable<CheckPoolMember> {\r\n  const params: string = JSON.stringify({\r\n    PoolId: poolId,\r\n    AccountType: accountType,\r\n    Mask: mask,\r\n    SearchBy: searchBy\r\n  })\r\n\r\n  return ObservableFromFetch<CheckPoolMember>(\"/WorkforceRandomTest/CheckPoolMember\", params)\r\n}\r\n\r\nexport function PoolCompanyInfoGet(poolId: number): Observable<PoolCompanyInfo> {\r\n  const params: string = JSON.stringify({\r\n    PoolId: poolId\r\n  })\r\n\r\n  return ObservableFromFetch<PoolCompanyInfo>(\"/RandomTest/GetCompanyByPoolID\", params)\r\n}\r\n\r\nexport function PoolMemberAdd(data: PoolMemberData): Observable<string> {\r\n  const params: string = JSON.stringify(data)\r\n\r\n  return ObservableFromFetch<string>(\"/RandomTest/AddPerson\", params)\r\n}\r\n\r\n\r\n\r\n","import { Observable } from \"rxjs\"\r\nimport { ObservableFromFetch } from \"../ObservableFromFetch\"\r\nimport { AccountTypeID } from \"../../config/Constants\"\r\nimport AutoFilterRegion from \"./Model/AutoFilterRegion\"\r\n\r\nexport default function AutoFilterRegionsGetObservable(company: number, filter: string): Observable<AutoFilterRegion[]> {\r\n  const requestBody: string = JSON.stringify({\r\n    AccountType: AccountTypeID,\r\n    ParentAccountID: company,\r\n    AutoFilterValue: filter,\r\n    IsFilters: true\r\n  })\r\n\r\n  return ObservableFromFetch<AutoFilterRegion[]>(\"Order/GetAutoFilterRegion\", requestBody)\r\n}\r\n","import React from \"react\"\r\nimport { Container, Row, Col, Table, Spinner, Button, Dropdown } from \"react-bootstrap\"\r\nimport { BehaviorSubject, Subscription, concat, of } from \"rxjs\"\r\nimport { map, switchMap } from \"rxjs/operators\"\r\nimport { toast } from \"react-toastify\"\r\nimport { FaPrint } from \"react-icons/fa\"\r\nimport FileSaver from \"file-saver\"\r\nimport PoolMemberRecord from \"../../../api/Randoms/PoolMembersModel/PoolMemberRecord\"\r\nimport RandomPersonnelIdentifier from \"../../../api/Randoms/RandomPersonnelModel/RandomPersonnelIdentifier\"\r\nimport { PoolMembersGridObservable, PoolMembersExportCsv, PoolMembersPrint, ChangePersonStatus, PoolMembersOptions, ColumnFilters, PoolMembersGridResponse } from \"../../../api/Randoms/PoolMembersGridGet\"\r\nimport AutoFilterCompany from \"../../../api/Companies/CompanyModel/AutoFilterCompany\"\r\nimport AutoFilterLocation from \"../../../api/Location/LocationModel/AutoFilterLocation\"\r\nimport AutoFilterRegion from \"../../../api/Regions/Model/AutoFilterRegion\"\r\nimport RegulatoryMode from \"../../../api/LabService/LabServiceModel/RegulatoryMode\"\r\nimport EmployeeCategory from \"../../../api/LabService/LabServiceModel/EmployeeCategory\"\r\nimport RandomPersonnelCheckbox from \"../RandomPersonnelCheckbox\"\r\nimport ColumnsCustomizeModal from \"../../ColumnsCustomizeModal/ColumnsCustomizeModal\"\r\nimport EmployeeDetailsModal from \"../../OrderResults/EmployeeDetailsModal\"\r\nimport TablePagination from \"../../TablePagination\"\r\nimport ColumnHeaderFilter from \"../../ColumnHeaderFilter\"\r\nimport SearchField from \"../../../api/SearchField\"\r\nimport PoolMembersFiltersModal from \"../PoolMembersFiltersModal\"\r\nimport PoolMembersCriteriaModal from \"../PoolMembersCriteriaModal\"\r\nimport AddPoolMemberModal from \"../AddPoolMemberModal\"\r\nimport FormatSSN from \"../../../formatters/FormatSSN\"\r\nimport FormatDate from \"../../../formatters/FormatDate\"\r\nimport FormatTimestampFileName from \"../../../formatters/FormatTimestampFileName\"\r\nimport ActionButton from \"../../ActionButton\"\r\nimport Checkbox from \"../../Checkbox\"\r\nimport { CustomizableFilterColumn } from \"../../ColumnsCustomizeModal/CustomizableColumn\"\r\nimport { AppState, CurrentUserPermissions } from \"../../../AppState\"\r\nimport { connect } from \"react-redux\"\r\nimport { StorageKey } from \"../../../config/Constants\"\r\nimport { loadCustomized, saveCustomized } from \"../../ColumnsCustomizeModal/ColumnsCustomizeModal\"\r\nimport { BuildUserAccess } from \"../../../authentication/BuildUserAccess\"\r\nimport  UserAccessSettings from \"../../../authentication/UserAccessSettings\"\r\nimport GetDonorID, { GetDonorIDTitle } from \"../../../formatters/RenderDonorID\"\r\n\r\ntype Column = CustomizableFilterColumn<keyof PoolMemberRecord, keyof ColumnFilters>\r\n\r\nexport enum RandomPersonnelGridMode {\r\n  PersonnelGrid = \"PersonnelGrid\",\r\n  PoolMembers = \"PoolMembers\"\r\n}\r\n\r\nenum StatusOptions {\r\n  All = \"All\",\r\n  Active = \"Active\",\r\n  Inactive = \"Inactive\"\r\n}\r\n\r\ninterface PoolMembersGridProps {\r\n  poolID: number\r\n  poolName: string\r\n  useFileImportForPoolMembership: boolean\r\n  regulated: boolean\r\n  userPermissions?: UserAccessSettings\r\n  isConsortium: boolean\r\n  isCompanyAdmin?: boolean\r\n  unmaskDonorId: number\r\n  onPoolUpdate: () => void\r\n}\r\n\r\ninterface RandomPersonnelGridStateSelectedPersons {\r\n  selectedPrintRowIDs: RandomPersonnelIdentifier[]\r\n  selectedChangeStatusRowIDs: RandomPersonnelIdentifier[]\r\n}\r\n\r\ninterface PoolMembersGridState extends RandomPersonnelGridStateSelectedPersons {\r\n  loading: boolean\r\n  loadingCsv: boolean\r\n  importing: boolean\r\n  removing: boolean\r\n  data?: PoolMembersGridResponse\r\n  columns: Column[]\r\n  customizeModal: boolean\r\n  advancedFiltersModal: boolean\r\n  addPoolMember: boolean\r\n  searchFields?: SearchField[]\r\n  selectedCompanies: AutoFilterCompany[]\r\n  selectedRegions: AutoFilterRegion[]\r\n  selectedLocations: AutoFilterLocation[]\r\n  selectedRegulatoryModes: RegulatoryMode[]\r\n  selectedCategories: EmployeeCategory[]\r\n  status: StatusOptions\r\n  accountType: string\r\n  employeeDetails: boolean\r\n  details?: PoolMemberRecord\r\n  showPoolMembersCriteriaModal: boolean\r\n}\r\n\r\nconst defaultColumns: Column[] = [\r\n  { name: \"PrimaryID\", filter: \"IDNumber\", label: \"PERSONNEL ID\", visible: true, customize: false },\r\n  { name: \"Name\", filter: \"Name\", label: \"NAME\", visible: true, customize: true },\r\n  { name: \"Company\", filter: \"Company\", label: \"COMPANY\", visible: true, customize: true },\r\n  { name: \"Occupation\", filter: \"Occupation\", label: \"OCCUPATION\", visible: true, customize: true },\r\n  { name: \"Location\", filter: \"Location\", label: \"LOCATION\", visible: true, customize: true },\r\n  { name: \"RegMode\", filter: \"RegulatoryMode\", label: \"REGULATORY MODE\", visible: true, customize: true },\r\n  { name: \"DateActive\", filter: \"ActiveSince\", label: \"ACTIVE SINCE\", visible: true, customize: true },\r\n  { name: \"ReasonForInactivation\", filter: \"ReasonForInactivation\", label: \"REASON FOR INACTIVATION\", visible: false, customize: true },\r\n  { name: \"Category\", filter: \"Category\", label: \"EMPLOYEE CATEGORY\", visible: false, customize: true },\r\n  { name: \"Supervisor1\", filter: \"Supervisor1\", label: \"SUPERVISOR 1\", visible: false, customize: true },\r\n  { name: \"Supervisor2\", filter: \"Supervisor2\", label: \"SUPERVISOR 2\", visible: false, customize: true },\r\n  { name: \"HireDate\", filter: \"HireDate\", label: \"HIRE DATE\", visible: false, customize: true },\r\n  { name: \"TerminationDate\", filter: \"TerminationDate\", label: \"TERMINATION DATE\", visible: false, customize: true },\r\n  { name: \"PreEmploymentTestOnFile\", filter: \"PreEmploymentTestOnFile\", label: \"PRE-EMPLOYMENT TEST ON FILE\", visible: false, customize: true },\r\n  { name: \"Gender\", filter: \"Gender\", label: \"GENDER\", visible: false, customize: true },\r\n  { name: \"DateOfBirth\", filter: \"DateOfBirth\", label: \"DATE OF BIRTH\", visible: false, customize: true },\r\n  { name: \"AddressLine1\", filter: \"AddressLine1\", label: \"STREET ADDRESS\", visible: false, customize: true },\r\n  { name: \"City\", filter: \"City\", label: \"CITY\", visible: false, customize: true },\r\n  { name: \"State\", filter: \"State\", label: \"STATE\", visible: false, customize: true },\r\n  { name: \"Zip\", filter: \"Zip\", label: \"ZIP\", visible: false, customize: true },\r\n  { name: \"WorkPhone\", filter: \"WorkPhone\", label: \"WORK PHONE\", visible: false, customize: true },\r\n  { name: \"CellPhone\", filter: \"CellPhone\", label: \"MOBILE PHONE\", visible: false, customize: true },\r\n  { name: \"Email\", filter: \"Email\", label: \"EMAIL\", visible: false, customize: true },\r\n  { name: \"User1\", filter: \"User1\", label: \"USER 1\", visible: false, customize: true },\r\n  { name: \"User2\", filter: \"User2\", label: \"USER 2\", visible: false, customize: true },\r\n  { name: \"User3\", filter: \"User3\", label: \"USER 3\", visible: false, customize: true },\r\n  { name: \"User4\", filter: \"User4\", label: \"USER 4\", visible: false, customize: true },\r\n  { name: \"User5\", filter: \"User5\", label: \"USER 5\", visible: false, customize: true },\r\n  { name: \"User6\", filter: \"User6\", label: \"USER 6\", visible: false, customize: true },\r\n  { name: \"User7\", filter: \"User7\", label: \"USER 7\", visible: false, customize: true },\r\n  { name: \"User8\", filter: \"User8\", label: \"USER 8\", visible: false, customize: true },\r\n  { name: \"User9\", filter: \"User9\", label: \"USER 9\", visible: false, customize: true },\r\n  { name: \"User10\", filter: \"User10\", label: \"USER 10\", visible: false, customize: true },\r\n  { name: \"Manager\", filter: \"Manager\", label: \"MANAGER\", visible: false, customize: true },\r\n]\r\n\r\nconst PageSize = 20\r\n\r\nexport class PoolMembersGrid extends React.PureComponent<PoolMembersGridProps, PoolMembersGridState> {\r\n  state: PoolMembersGridState = {\r\n    loading: false,\r\n    loadingCsv: false,\r\n    importing: false,\r\n    removing: false,\r\n    columns: loadCustomized(StorageKey.PoolMembersGridColumns, defaultColumns) as Column[],\r\n    customizeModal: false,\r\n    advancedFiltersModal: false,\r\n    addPoolMember: false,\r\n    selectedPrintRowIDs: [],\r\n    selectedChangeStatusRowIDs: [],\r\n    selectedCompanies: [],\r\n    selectedRegions: [],\r\n    selectedLocations: [],\r\n    selectedRegulatoryModes: [],\r\n    selectedCategories: [],\r\n    status: StatusOptions.Active,\r\n    accountType: \"master\", // TODO: Get it from Account data once Auth/Account will be implemented\r\n    employeeDetails: false,\r\n    showPoolMembersCriteriaModal: false\r\n  }\r\n  page$ = new BehaviorSubject<PoolMembersOptions>({\r\n    poolId: this.props.poolID,\r\n    inactive: false,\r\n    search: { field: \"\", text: \"\" },\r\n    sort: { column: \"\", order: \"\" },\r\n    filters: [],\r\n    columnFilters: [],\r\n    pageNumber: 1,\r\n    pageSize: PageSize\r\n  })\r\n  pageSubscription?: Subscription\r\n\r\n  file = React.createRef<HTMLInputElement>()\r\n\r\n  componentDidMount() {\r\n    this.pageSubscription = this.page$.pipe(\r\n      switchMap(params => concat(\r\n        of({ loading: true }),\r\n        PoolMembersGridObservable(params).pipe(\r\n          map((result: PoolMembersGridResponse) => ({ data: result, loading: false })))\r\n      ))\r\n    ).subscribe(\r\n      (newState: { loading: boolean, data?: PoolMembersGridResponse }) => {\r\n        if (newState.data) {\r\n          if (newState.data.ActiveSince?.length) {\r\n            newState.data.ActiveSince = newState.data.ActiveSince.map(dateString => FormatDate(dateString))\r\n          }\r\n          if (newState.data.HireDate?.length) {\r\n            newState.data.HireDate = newState.data.HireDate.map(dateString => FormatDate(dateString))\r\n          }\r\n          if (newState.data.TerminationDate?.length) {\r\n            newState.data.TerminationDate = newState.data.TerminationDate.map(dateString => FormatDate(dateString))\r\n          }\r\n          if (newState.data.DateOfBirth?.length) {\r\n            newState.data.DateOfBirth = newState.data.DateOfBirth.map(dateString => FormatDate(dateString))\r\n          }\r\n          if (!this.props.userPermissions?.isPortalAdmin && newState.data.Manager?.length) {\r\n            this.setState({columns: this.state.columns.filter( x => x.name != \"Manager\")})\r\n          }\r\n          this.setState({ loading: newState.loading, data: newState.data, selectedPrintRowIDs: [], selectedChangeStatusRowIDs: [] })\r\n        } else {\r\n          this.setState({ loading: newState.loading })\r\n        }\r\n      },\r\n      (error: string) => {\r\n        this.setState({ loading: false })\r\n        toast.error(error)\r\n      }\r\n    )\r\n  }\r\n\r\n  componentWillUnmount() {\r\n    this.pageSubscription && this.pageSubscription.unsubscribe()\r\n  }\r\n\r\n  visibleColumns = () => this.state.columns.filter(col => col.visible)\r\n\r\n  renderCell = (row: PoolMemberRecord, colName: keyof PoolMemberRecord, key: number) => {\r\n    switch (colName) {\r\n      case \"PrimaryID\":\r\n        const idValue = GetDonorID(row[\"DonorID\"], row[colName], this.props.unmaskDonorId)\r\n        return <td key={key} className=\"align-text-top\"><Button variant=\"link\" className=\"p-0\" onClick={() => this.showEmployeeDetails(row)}>{idValue}</Button></td>\r\n      case \"DateActive\":\r\n      case \"HireDate\":\r\n      case \"TerminationDate\":\r\n      case \"DateOfBirth\":\r\n        return <td key={key} className=\"align-text-top\">{FormatDate(row[colName] as string)}</td>\r\n      case \"Manager\":\r\n        return <td key={key} className=\"align-text-top\">{row[colName].toString().toUpperCase()}</td>\r\n      default:\r\n        return <td key={key} className=\"align-text-top\">{row[colName]}</td>\r\n    }\r\n  }\r\n\r\n  sortGrid(column: string, order?: string) {\r\n    this.page$.next({ ...this.page$.value, sort: { column: column, order: order || \"\" } })\r\n  }\r\n\r\n  filterGridColumn(column: string, items: string[]) {\r\n    const columnFilters = this.page$.value.columnFilters\r\n    const filter = { column: column, values: items }\r\n    let index = columnFilters.findIndex(item => item.column === filter.column)\r\n    if (index >= 0) {\r\n      columnFilters[index] = filter\r\n    } else {\r\n      columnFilters.push(filter)\r\n    }\r\n\r\n    this.page$.next({ ...this.page$.value, pageNumber: 1, columnFilters: columnFilters })\r\n  }\r\n\r\n  handleExportClick(fileName: string) {\r\n    this.setState({ loadingCsv: true })\r\n    PoolMembersExportCsv(this.page$.value).subscribe(\r\n      result => this.export(result, fileName),\r\n      error => {\r\n        toast.error(error)\r\n        this.setState({ loadingCsv: false })\r\n      },\r\n      (() => this.setState({ loadingCsv: false }))\r\n    )\r\n  }\r\n\r\n  export(csv: string, fileName: string) {\r\n    const csvData = new Blob([csv], { type: 'text/csv;charset=utf-8;' })\r\n    FileSaver.saveAs(csvData, FormatTimestampFileName(fileName, \"csv\", new Date()), true)\r\n    toast.success(\"CSV file downloaded successfully.\")\r\n  }\r\n\r\n  handlePrintClick() {\r\n    PoolMembersPrint(this.state.selectedPrintRowIDs.map(row => row.PersonID), this.page$.value).subscribe(\r\n      (data: string) => this.print(data),\r\n      error => toast.error(error)\r\n    )\r\n  }\r\n\r\n  print(base64pdf: string) {\r\n    const pdfWindow = window.open(\"\")\r\n    if (pdfWindow) {\r\n      pdfWindow.document.write(\"<iframe width='100%' height='100%' src='data:application/pdf;base64, \" + encodeURI(base64pdf) + \"'></iframe>\")\r\n    }\r\n  }\r\n\r\n  handleChangePersonsStatusClick() {\r\n    ChangePersonStatus(this.props.poolID, this.state.selectedChangeStatusRowIDs.map(row => row.PersonID), 0, 0).subscribe(\r\n      data => {\r\n        this.setState({ removing: false, selectedChangeStatusRowIDs: [] })\r\n        this.refreshGrid()\r\n        /*data.error\r\n          ? toast.error(\"Person activation failed.\")\r\n          : toast.success(data.message)*/\r\n        toast.success(data)\r\n      },\r\n      error => toast.error(error)\r\n    )\r\n  }\r\n\r\n  handlePrintSelectAllRowsChange = (e: React.ChangeEvent<HTMLInputElement>) => {\r\n    const selectedPrintRowIDs = e.target.checked && this.state.data ? this.state.data.Records.map((row: PoolMemberRecord, i: number) => ({ PersonID: row.PersonID, ID: row.PrimaryID })) : []\r\n    this.setState({ selectedPrintRowIDs: selectedPrintRowIDs })\r\n  }\r\n\r\n  changePersonRowSelection = (person: RandomPersonnelIdentifier, checked: boolean, stateFieldName: keyof RandomPersonnelGridStateSelectedPersons) => {\r\n    let selectedRows = [...this.state[stateFieldName]]\r\n    const index = selectedRows.findIndex(item => item.PersonID === person.PersonID && item.ID === person.ID)\r\n    if (index > -1) {\r\n      selectedRows = [...selectedRows.slice(0, index), ...selectedRows.slice(index + 1)]\r\n    } else {\r\n      selectedRows.push(person)\r\n    }\r\n    this.setState({ ...{}, [stateFieldName]: selectedRows })\r\n  }\r\n\r\n  handlePrintSelectRowChange = (person: RandomPersonnelIdentifier, checked: boolean) => {\r\n    this.changePersonRowSelection(person, checked, \"selectedPrintRowIDs\")\r\n  }\r\n\r\n  handleChangePersonStatusSelectRowChange = (person: RandomPersonnelIdentifier, checked: boolean) => {\r\n    this.changePersonRowSelection(person, checked, \"selectedChangeStatusRowIDs\")\r\n  }\r\n\r\n  handleChangePage(pageNumber: number) {\r\n    this.page$.next({ ...this.page$.value, pageNumber: pageNumber })\r\n  }\r\n\r\n  handleChangeStatusFilter(status: StatusOptions) {\r\n    this.setState({ status: status })\r\n    /*const filters = this.page$.value.filters.filter(filter => filter.column !== \"Inactive\")\r\n    if (status !== \"All\") {\r\n      filters.push({ column: \"Inactive\", values: [status.toString()] })\r\n    }*/\r\n    const inactive = (status === StatusOptions.All) ? null : status === StatusOptions.Inactive\r\n    this.page$.next({ ...this.page$.value, inactive: inactive/*, filters: filters*/ })\r\n  }\r\n\r\n  handleSearch = (field: string, text: string) => {\r\n    this.page$.next({ ...this.page$.value, search: { field: field, text: text } })\r\n  }\r\n  handlePoolMembersCriteriaSave = (closeModal: boolean) => {\r\n    this.setState({\r\n      showPoolMembersCriteriaModal: !closeModal\r\n    })\r\n    this.page$.next({ ...this.page$.value, pageNumber: 1})\r\n    this.props.onPoolUpdate()\r\n  }\r\n\r\n  handleAdvancedFiltersSave = (companies: AutoFilterCompany[], regions: AutoFilterRegion[], locations: AutoFilterLocation[], regulatoryModes: RegulatoryMode[], categories: EmployeeCategory[], closeModal: boolean) => {\r\n    this.setState({\r\n      selectedCompanies: companies,\r\n      selectedRegions: regions,\r\n      selectedLocations: locations,\r\n      selectedRegulatoryModes: regulatoryModes,\r\n      selectedCategories: categories,\r\n      advancedFiltersModal: !closeModal\r\n    })\r\n    const filters = [\r\n      { column: \"Company\", values: companies.map(item => item.Name) },\r\n      { column: \"Region\", values: regions.map(item => item.Name) },\r\n      { column: \"Location\", values: locations.map(item => item.Name) },\r\n      { column: \"Reg\", values: regulatoryModes.map(item => item.Name) },\r\n      { column: \"Category\", values: categories.map(item => item.Name) }\r\n    ]\r\n    this.page$.next({ ...this.page$.value, filters: filters })\r\n  }\r\n\r\n  handleAddIndividualSave = () => {\r\n    this.setState({ addPoolMember: false })\r\n    this.refreshGrid()\r\n  }\r\n\r\n  formatSearchString = (ID: string, value: string): string => ID === \"SSN\" ? FormatSSN(value) : value\r\n  showEmployeeDetails = (data: PoolMemberRecord) => this.setState({ employeeDetails: true, details: data })\r\n  refreshGrid = () => this.page$.next(this.page$.value)\r\n\r\n  render() {\r\n    const limitedAccess =  this.props.isConsortium && this.props.isCompanyAdmin\r\n    const headerColumns = this.visibleColumns().map((col: Column, i) => {\r\n      const sort = this.page$.value.sort\r\n      const filterValues = this.page$.value.filters.find(filter => filter.column === col.name)?.values || []\r\n      const message = filterValues.length > 0 ?\r\n        (<>\r\n          <div>Some options in this list may be hidden</div>\r\n          <div>because of the advanced filter configuration.</div>\r\n          <div>Click <span className=\"text-link\" onClick={() => this.setState({ advancedFiltersModal: true })}>filters</span> or ADVANCED FILTERS button to configure</div>\r\n        </>) :\r\n        <></>\r\n      const columnFilterValues = this.page$.value.columnFilters.find(filter => filter.column === col.filter)?.values || []\r\n      return (\r\n        <th key={col.name}>\r\n          {this.state.data && col.filter && col.filter in this.state.data && <ColumnHeaderFilter title={col.label || col.name}\r\n            filtered={columnFilterValues.length > 0}\r\n            filteredItems={columnFilterValues}\r\n            sort={sort && sort.column === col.name ? sort.order === \"asc\" ? \"asc\" : \"desc\" : undefined}\r\n            items={this.state.data[col.filter as keyof ColumnFilters] || []}\r\n            message={message}\r\n            onSort={(order?: string) => this.sortGrid(col.name, order)}\r\n            onFilter={(items: string[]) => col.filter && this.filterGridColumn(col.filter, items)}\r\n          />}\r\n          {(!this.state.data || !col.filter) && (col.label || col.name)}\r\n        </th>\r\n      )\r\n    })\r\n    const allPrintChecked = !this.state.loading && this.state.data?.Records?.length === this.state.selectedPrintRowIDs.length\r\n\r\n    const { useFileImportForPoolMembership, userPermissions } = this.props\r\n    // TODO: Some permissions are missed in AppState:\r\n    //          *userPermissions.CanUpdatePoolMembership\r\n    // const manageIndividual = userPermissions && (userPermissions.CanManagePools || userPermissions.CanUpdatePoolMembership)\r\n    const manageIndividual = userPermissions?.canManagePools\r\n    return (\r\n      <>\r\n        {this.state.employeeDetails && this.state.details && (\r\n          <EmployeeDetailsModal\r\n            personID={this.state.details.PersonID}\r\n            poolID={this.props.poolID}\r\n            poolName={this.props.poolName}\r\n            name={this.state.details.Name}\r\n            id={this.state.details.PrimaryID}\r\n            onHide={(updated) => this.setState({ employeeDetails: false }, () => updated && this.refreshGrid())}\r\n          />\r\n        )}\r\n        <ColumnsCustomizeModal\r\n          show={this.state.customizeModal}\r\n          columns={this.props.userPermissions?.isPortalAdmin ? this.state.columns : this.state.columns.filter( x => x.name != \"Manager\")}\r\n          storeKey={StorageKey.PoolMembersGridColumns}\r\n          onClose={() => this.setState({ customizeModal: false })}\r\n          onSave={(columns) => this.setState({ columns: columns as Column[], customizeModal: false })}\r\n        />\r\n        {this.state.showPoolMembersCriteriaModal && (\r\n          <PoolMembersCriteriaModal\r\n            show={this.state.showPoolMembersCriteriaModal}\r\n            poolId={this.props.poolID}\r\n            poolName={this.props.poolName}\r\n            regulated={this.props.regulated}\r\n            isConsortium={this.props.isConsortium}\r\n            useFileImportForPoolMembership={this.props.useFileImportForPoolMembership}\r\n            onClose={() => this.setState({ showPoolMembersCriteriaModal: false })}\r\n            onSave={(close) => this.handlePoolMembersCriteriaSave(close)}\r\n          />\r\n        )}\r\n        <PoolMembersFiltersModal\r\n          show={this.state.advancedFiltersModal}\r\n          selectedLocations={this.state.selectedLocations}\r\n          selectedRegulatoryModes={this.state.selectedRegulatoryModes}\r\n          onClose={() => this.setState({ advancedFiltersModal: false })}\r\n          onSave={(locations, regModes, close) =>\r\n            this.handleAdvancedFiltersSave([], [], locations, regModes, [], close)\r\n          }\r\n        />\r\n        {\r\n          <AddPoolMemberModal\r\n            show={this.state.addPoolMember}\r\n            poolID={this.props.poolID || 0}\r\n            accountType={this.state.accountType}\r\n            onCancel={() => this.setState({ addPoolMember: false })}\r\n            onAdd={this.handleAddIndividualSave}\r\n          />\r\n        }\r\n        <Container fluid className=\"grid-container\">\r\n          <Row className=\"pb-2\">\r\n            <Col className=\"mr-0 pr-0\">\r\n              <Dropdown className=\"dropdown-menu-secondary\">\r\n                <Dropdown.Toggle size=\"sm\" variant=\"secondary\">\r\n                  {this.state.status}\r\n                </Dropdown.Toggle>\r\n                <Dropdown.Menu className=\"secondary\">\r\n                  <Dropdown.Item\r\n                    as={Button}\r\n                    onClick={() => this.handleChangeStatusFilter(StatusOptions.All)}\r\n                    variant=\"menu-item\"\r\n                  >\r\n                    All\r\n                  </Dropdown.Item>\r\n                  <Dropdown.Item\r\n                    as={Button}\r\n                    onClick={() => this.handleChangeStatusFilter(StatusOptions.Active)}\r\n                    variant=\"menu-item\"\r\n                  >\r\n                    Active\r\n                  </Dropdown.Item>\r\n                  <Dropdown.Item\r\n                    as={Button}\r\n                    onClick={() => this.handleChangeStatusFilter(StatusOptions.Inactive)}\r\n                    variant=\"menu-item\"\r\n                  >\r\n                    Inactive\r\n                  </Dropdown.Item>\r\n                </Dropdown.Menu>\r\n              </Dropdown>\r\n            </Col>\r\n            <Col>\r\n              {(!useFileImportForPoolMembership || this.props.isConsortium) && !limitedAccess && (\r\n                <Button\r\n                  variant=\"secondary\"\r\n                  size=\"sm\"\r\n                  className=\"mr-1\"\r\n                  onClick={() => this.setState({ showPoolMembersCriteriaModal: true })}\r\n                >\r\n                  Criteria\r\n                </Button>\r\n              )}\r\n            </Col>\r\n            <Col lg={7} className=\"text-right\">\r\n              <Button\r\n                variant=\"secondary\"\r\n                size=\"sm\"\r\n                className=\"mr-1\"\r\n                onClick={() => this.setState({ advancedFiltersModal: true })}\r\n              >\r\n                ADVANCED FILTERS\r\n              </Button>\r\n              <Button\r\n                variant=\"secondary\"\r\n                size=\"sm\"\r\n                className=\"mr-1\"\r\n                onClick={() => this.setState({ customizeModal: true })}\r\n              >\r\n                CUSTOMIZE\r\n              </Button>\r\n              <ActionButton\r\n                variant=\"secondary\"\r\n                size=\"sm\"\r\n                className=\"mr-1\"\r\n                onClick={() => this.handleExportClick(\"PoolMembers\")}\r\n                disabled={!this.state.data?.Records?.length}\r\n                spin={this.state.loadingCsv}\r\n                disableOnSpin\r\n              >\r\n                EXPORT CSV\r\n              </ActionButton>\r\n              {manageIndividual && (\r\n                <Button variant=\"secondary\" size=\"sm\" onClick={() => this.setState({ addPoolMember: true })}>\r\n                  ADD INDIVIDUAL\r\n                </Button>\r\n              )}\r\n            </Col>\r\n          </Row>\r\n          <Row>\r\n            <Col>\r\n              <Table bordered responsive>\r\n                <thead>\r\n                  <tr>\r\n                    <th className=\"text-center print-column\">\r\n                      <Checkbox\r\n                        id=\"print_all_members\"\r\n                        checked={allPrintChecked}\r\n                        onChange={this.handlePrintSelectAllRowsChange}\r\n                      />\r\n                      <Button\r\n                        variant=\"secondary\"\r\n                        size=\"sm\"\r\n                        onClick={() => this.handlePrintClick()}\r\n                        className=\"float-right\"\r\n                        disabled={this.state.selectedPrintRowIDs.length === 0}\r\n                      >\r\n                        <FaPrint />\r\n                      </Button>\r\n                    </th>\r\n                    {headerColumns}\r\n                    {manageIndividual && (\r\n                      <th className=\"text-center small-column\">\r\n                        <Button\r\n                          variant=\"secondary\"\r\n                          size=\"sm\"\r\n                          onClick={() => this.handleChangePersonsStatusClick()}\r\n                          disabled={this.state.selectedChangeStatusRowIDs.length === 0}\r\n                        >\r\n                          {this.state.status === StatusOptions.All && \"ACTIVATE/INACTIVATE\"}\r\n                          {this.state.status === StatusOptions.Active && \"INACTIVATE\"}\r\n                          {this.state.status === StatusOptions.Inactive && \"ACTIVATE\"}\r\n                        </Button>\r\n                      </th>\r\n                    )}\r\n                  </tr>\r\n                </thead>\r\n                <tbody>\r\n                  {this.state.loading && (\r\n                    <tr>\r\n                      <td colSpan={this.visibleColumns().length + 2}>\r\n                        <Spinner animation=\"border\" variant=\"secondary\" />\r\n                      </td>\r\n                    </tr>\r\n                  )}\r\n                  {!this.state.loading &&\r\n                    (this.state.data && this.state.data.Records && this.state.data.Records.length > 0 ? (\r\n                      this.state.data.Records.map((row: PoolMemberRecord, i: number) => {\r\n                        const person = { PersonID: row.PersonID, ID: row.PrimaryID }\r\n                        return (\r\n                          <tr key={`${person.PersonID}_${person.ID}_1_${i}`}>\r\n                            <td className=\"text-center\">\r\n                              <RandomPersonnelCheckbox\r\n                                id={`${person.PersonID}_${person.ID}_check1_${i}`}\r\n                                person={person}\r\n                                checked={\r\n                                  !!this.state.selectedPrintRowIDs.find(\r\n                                    (item) => person.PersonID === item.PersonID && person.ID === item.ID\r\n                                  )\r\n                                }\r\n                                onChange={this.handlePrintSelectRowChange}\r\n                              />\r\n                            </td>\r\n                            {this.visibleColumns().map((col, i) =>\r\n                              this.renderCell(row, col.name as keyof PoolMemberRecord, i)\r\n                            )}\r\n                            {manageIndividual && (\r\n                              <td className=\"text-center\">\r\n                                <RandomPersonnelCheckbox\r\n                                  id={`${person.PersonID}_${person.ID}_check3_${i}`}\r\n                                  person={person}\r\n                                  checked={\r\n                                    !!this.state.selectedChangeStatusRowIDs.find(\r\n                                      (item) => person.PersonID === item.PersonID && person.ID === item.ID\r\n                                    )\r\n                                  }\r\n                                  onChange={this.handleChangePersonStatusSelectRowChange}\r\n                                />\r\n                              </td>\r\n                            )}\r\n                          </tr>\r\n                        )\r\n                      })\r\n                    ) : (\r\n                      <tr>\r\n                        <td colSpan={this.visibleColumns().length + 2}>NO DATA FOUND</td>\r\n                      </tr>\r\n                    ))}\r\n                </tbody>\r\n              </Table>\r\n              {this.state.data && !this.state.loading && (\r\n                <span className=\"total-records\">Total records: {this.state.data.Total}</span>\r\n              )}\r\n              {this.state.data && (\r\n                <TablePagination\r\n                  pageNumber={this.page$.value.pageNumber}\r\n                  pages={this.state.data.Pages}\r\n                  onChange={(pageNumber) => this.handleChangePage(pageNumber)}\r\n                />\r\n              )}\r\n            </Col>\r\n          </Row>\r\n        </Container>\r\n      </>\r\n    )\r\n  }\r\n}\r\n\r\nfunction mapStateToProps(state: AppState): { userPermissions: UserAccessSettings } {\r\n  const userAccess = BuildUserAccess(state);\r\n  return {\r\n    userPermissions: userAccess\r\n  }\r\n}\r\nconst ConnectedPoolMembersGrid = connect(mapStateToProps, null)(PoolMembersGrid)\r\nexport default ConnectedPoolMembersGrid\r\n","import * as React from \"react\"\r\nimport { Button, Col, Container, Form, Modal, Row, Spinner } from \"react-bootstrap\"\r\nimport { toast } from \"react-toastify\"\r\nimport { Typeahead } from \"react-bootstrap-typeahead\"\r\nimport { FaAngleDown } from \"react-icons/fa\"\r\nimport { Subscription } from \"rxjs\"\r\nimport SearchBar from \"../SearchBar\"\r\nimport SearchField from \"../../api/SearchField\"\r\nimport FormatSSN from \"../../formatters/FormatSSN\"\r\nimport { PoolMemberCheck, PoolCompanyInfoGet, PoolMemberAdd } from \"../../api/Randoms/PoolMemberProcess\"\r\nimport { PoolCompanyInfo, PoolRegulatoryMode } from \"../../api/Randoms/RandomsModel/PoolCompanyInfo\"\r\nimport CheckPoolMember from \"../../api/Randoms/RandomsModel/CheckPoolMember\"\r\nimport PoolMemberData from \"../../api/Randoms/RandomsModel/PoolMemberData\"\r\nimport AutoFilterCompany from \"../../api/Companies/CompanyModel/AutoFilterCompany\"\r\nimport AutoFilterRegion from \"../../api/Regions/Model/AutoFilterRegion\"\r\nimport AutoFilterRegionsGet from \"../../api/Regions/AutoFilterRegionsGet\"\r\nimport AutoFilterLocation from \"../../api/Location/LocationModel/AutoFilterLocation\"\r\nimport AutoFilterLocationsGet from \"../../api/Location/AutoFilterLocationsGet\"\r\nimport Category from \"../../api/LabService/LabServiceModel/EmployeeCategory\"\r\nimport EmployeeCategoriesGetObservable from \"../../api/LabService/EmployeeCategoriesGet\"\r\nimport CompanyInput from \"../FormattedInputs/CompanyInput\"\r\nimport { UpdateMethodID } from \"../../config/Constants\"\r\nimport { GetUserId } from \"../../storage/UserId\"\r\nimport StateSelect from \"../FormattedInputs/StateSelect\"\r\nimport State from \"../../api/OrderRequests/OrderRequestsModel/State\"\r\nimport { StateObservable } from \"../../api/OrderRequests/OrderRequestsConstraintGet\"\r\n\r\ninterface AddPoolMemberModalProps {\r\n  show: boolean\r\n  poolID: number\r\n  accountType: string\r\n  onAdd: () => void\r\n  onCancel: () => void\r\n}\r\n\r\ninterface AddPoolMemberModalPersonnelCheckData {\r\n  id?: string\r\n  idType?: string\r\n  isPersonnelFound?: boolean\r\n  checkMember?: CheckPoolMember\r\n}\r\n\r\ninterface AddPoolMemberModalValidity {\r\n  isCompanyValid: boolean\r\n  isLastNameValid: boolean\r\n  isFirstNameValid: boolean\r\n  isStateValid: boolean\r\n}\r\n\r\nexport interface AddPoolMemberModalData {\r\n  firstName: string\r\n  lastName: string\r\n  selectedCompany?: AutoFilterCompany\r\n  selectedRegion?: AutoFilterRegion\r\n  selectedLocation?: AutoFilterLocation\r\n  selectedRegulatoryMode?: PoolRegulatoryMode\r\n  selectedCategory?: Category\r\n  state?: State\r\n  stateCode?: string\r\n}\r\n\r\ninterface AddPoolMemberModalState extends AddPoolMemberModalData, AddPoolMemberModalValidity, AddPoolMemberModalPersonnelCheckData {\r\n  isLoading: boolean\r\n  isSaving: boolean\r\n  showAddPersonnelPanel: boolean\r\n  poolCompanyData?: PoolCompanyInfo\r\n  isCompaniesLoading: boolean\r\n  isRegionsLoading: boolean\r\n  isLocationsLoading: boolean\r\n  isCategoriesLoading: boolean\r\n  companies: AutoFilterCompany[]\r\n  regions: AutoFilterRegion[]\r\n  locations: AutoFilterLocation[]\r\n  regulatoryModes: PoolRegulatoryMode[]\r\n  categories: Category[]\r\n  states: State[]\r\n  statesLoading: boolean\r\n  state?: State\r\n  stateCode?: string\r\n}\r\n\r\nexport default class AddPoolMemberModal extends React.Component<AddPoolMemberModalProps, AddPoolMemberModalState> {\r\n  emptyData: AddPoolMemberModalData = {\r\n    firstName: \"\",\r\n    lastName: \"\",\r\n    selectedRegulatoryMode: undefined,\r\n    selectedCategory: undefined,\r\n    state: undefined,\r\n    stateCode: undefined\r\n  }\r\n  positiveValidity: AddPoolMemberModalValidity = { isCompanyValid: true, isLastNameValid: true, isFirstNameValid: true, isStateValid: true }\r\n  personnelCheckEmptyData: AddPoolMemberModalPersonnelCheckData = { idType: undefined, id: undefined, isPersonnelFound: false, checkMember: undefined }\r\n  state: AddPoolMemberModalState = {\r\n    ...this.emptyData,\r\n    ...this.positiveValidity,\r\n    ...this.personnelCheckEmptyData,\r\n    showAddPersonnelPanel: false,\r\n    isLoading: false,\r\n    isSaving: false,\r\n    isCompaniesLoading: false,\r\n    isRegionsLoading: false,\r\n    isLocationsLoading: false,\r\n    isCategoriesLoading: false,\r\n    companies: [],\r\n    regions: [],\r\n    locations: [],\r\n    regulatoryModes: [],\r\n    categories: [],\r\n    states: [],\r\n    statesLoading: false\r\n  }\r\n  idTypes: SearchField[] = [\r\n    { ID: \"AlternateID\", Name: \"Alternate ID\" },\r\n    { ID: \"DriverID\", Name: \"Driver ID\" },\r\n    { ID: \"EmployerID\", Name: \"Employer ID\" },\r\n    { ID: \"SSN\", Name: \"SSN\" },\r\n    { ID: \"FirstName\", Name: \"First Name\" },\r\n    { ID: \"LastName\", Name: \"Last Name\" },\r\n  ]\r\n\r\n  companyTypeahead = React.createRef<Typeahead<AutoFilterCompany>>()\r\n  regionTypeahead = React.createRef<Typeahead<AutoFilterRegion>>()\r\n  locationTypeahead = React.createRef<Typeahead<AutoFilterLocation>>()\r\n  regulatoryModeTypeahead = React.createRef<Typeahead<PoolRegulatoryMode>>()\r\n  categoryTypeahead = React.createRef<Typeahead<Category>>()\r\n\r\n  subscriptions = new Subscription()\r\n\r\n  componentDidMount() {\r\n    this.setState({ isCompaniesLoading: true })\r\n    this.subscriptions.add(\r\n      PoolCompanyInfoGet(this.props.poolID).subscribe(\r\n      (data: PoolCompanyInfo) => {\r\n        const companies: AutoFilterCompany[] = data.CompanyList.length > 0\r\n          ? data.CompanyList.map((company) => {return { AccountID: company.ID, Name: company.Description, Description: company.Description, PrimaryIDType: \"SSN\" } as AutoFilterCompany})\r\n          : [{ AccountID: data.CompanyID, Name: data.CompanyName, Description: data.CompanyName, PrimaryIDType: data.PrimaryIDType }]\r\n        const selectedCompany = companies.length > 1 ? undefined : companies[0]\r\n        this.setState({ companies: companies, selectedCompany: selectedCompany, regulatoryModes: data.RegulatoryModes, poolCompanyData: data, isCompaniesLoading: false, idType: selectedCompany?.PrimaryIDType || \"SSN\" })\r\n\r\n        if (data.CompanyList.length === 1) {\r\n          this.loadAllRegions(selectedCompany)\r\n          this.loadAllLocations(selectedCompany)\r\n        }\r\n\r\n        if (data.HasRegModeBlock && data.RegulatoryModes.length === 1) {\r\n          this.setState({ selectedRegulatoryMode: data.RegulatoryModes[0] })\r\n          this.loadCategories(data.RegulatoryModes[0])\r\n        }\r\n      },\r\n      () => this.setState({ isCompaniesLoading: false })\r\n    ))\r\n  }\r\n\r\n  componentWillUnmount() {\r\n    this.subscriptions.unsubscribe()\r\n  }\r\n\r\n  loadAllRegions = (company?: AutoFilterCompany) => {\r\n    this.setState({ isRegionsLoading: true })\r\n    this.subscriptions.add(\r\n      AutoFilterRegionsGet(company?.AccountID || 0, \"\").subscribe(\r\n        (data: AutoFilterRegion[]) => this.setState({ regions: data, isRegionsLoading: false }),\r\n        () => this.setState({ isRegionsLoading: false })\r\n      )\r\n    )\r\n  }\r\n\r\n  loadAllLocations = (company?: AutoFilterCompany, region?: AutoFilterRegion) => {\r\n    this.setState({ isLocationsLoading: true })\r\n    this.subscriptions.add(\r\n      AutoFilterLocationsGet(company?.AccountID || 0, 0, \"\").subscribe(\r\n        (data: AutoFilterLocation[]) => this.setState({ locations: data, isLocationsLoading: false }),\r\n        () => this.setState({ isLocationsLoading: false })\r\n      )\r\n    )\r\n  }\r\n\r\n  loadCategories = (regulatoryMode: PoolRegulatoryMode) => {\r\n    this.setState({ isCategoriesLoading: true })\r\n    this.subscriptions.add(\r\n      EmployeeCategoriesGetObservable(regulatoryMode.ID).subscribe(\r\n        categories => this.setState({ categories: categories, isCategoriesLoading: false }),\r\n        () => this.setState({ isCategoriesLoading: false })\r\n      )\r\n    )\r\n  }\r\n\r\n  loadStates = () => {\r\n    this.setState({ statesLoading: true })\r\n    this.subscriptions.add(\r\n      StateObservable().subscribe(\r\n        (results: State[]) => this.setState({ states: results, statesLoading: false }),\r\n        () => { this.setState({ statesLoading: false }) }\r\n      )\r\n    )\r\n  }\r\n\r\n  savePoolMember = () => {\r\n    const primaryIDType = this.state.idType || \"\"\r\n    const id = this.state.id || \"\"\r\n    const params: PoolMemberData = {\r\n      PoolID: this.props.poolID,\r\n      Employer: primaryIDType === \"EmployerID\" ? id : \"\",\r\n      Driver: primaryIDType === \"DriverID\" ? id : \"\",\r\n      SSN: primaryIDType === \"SSN\" ? id : \"\",\r\n      Alternate: primaryIDType === \"AlternateID\" ? id : \"\",\r\n      PrimaryIDType: primaryIDType,\r\n      CompanyPrimaryID: primaryIDType,\r\n      PrimaryIDValue: id,\r\n      CompanyID: this.state.selectedCompany?.AccountID || 0,\r\n      Company: this.state.selectedCompany?.Name || \"\",\r\n      RegionID: this.state.selectedRegion?.Code || \"\",\r\n      Region: this.state.selectedRegion?.Name || \"\",\r\n      LocationID: this.state.selectedLocation?.AccountID || 0,\r\n      Location: this.state.selectedLocation?.Name || \"\",\r\n      FirstName: this.state.firstName.replace(/^\\s+|\\s+$/gm, \"\").replace(/\\s+/g, \" \"),\r\n      LastName: this.state.lastName.replace(/^\\s+|\\s+$/gm, \"\").replace(/\\s+/g, \" \"),\r\n      ConsortiumPoolCode: \"\",\r\n      IsConsortiumPool: \"\",\r\n      EmployeeCategory: this.state.selectedCategory?.Name || null,\r\n      EmployeeCategoryID: this.state.selectedCategory?.EmployeeCategoryID || null,\r\n      Inactive: this.state.checkMember?.Inactive || false,\r\n      PersonID: this.state.checkMember?.PersonID || \"\",\r\n      RegulatoryMode: this.state.selectedRegulatoryMode?.Description || null,\r\n      RegulatoryModeID: this.state.selectedRegulatoryMode?.ID || null,\r\n      TerminationDate: null,\r\n      UpdateMethodID: UpdateMethodID,\r\n      UserLoginID: GetUserId(),\r\n      searchString: id,\r\n      DriverLICStateOfIssue: this.state.stateCode || \"\"\r\n    }\r\n\r\n    if (this.state.poolCompanyData) {\r\n      params.ConsortiumPoolCode = this.state.poolCompanyData.ConsortiumPoolCode;\r\n      params.IsConsortiumPool = this.state.poolCompanyData.IsConsortiumPool;\r\n    }\r\n\r\n    this.setState({ isSaving: true })\r\n    this.subscriptions.add(\r\n      PoolMemberAdd(params).subscribe(\r\n        ((result) => {\r\n          this.setState({ isSaving: false })\r\n          if (Number(result) > 0) {\r\n            toast.success(\"Added member successfully.\")\r\n            this.resetState()\r\n            this.props.onAdd()\r\n          } else {\r\n            toast.error(result)\r\n          }\r\n        }),\r\n        error => toast.error(error)\r\n      )\r\n    )\r\n  }\r\n\r\n  isValid = (state: AddPoolMemberModalValidity) => state.isCompanyValid && state.isLastNameValid && state.isFirstNameValid && state.isStateValid\r\n  validateState = () => {\r\n    if (this.state.idType !== \"DriverID\") {\r\n      return true\r\n    }\r\n    if (this.state.stateCode && this.state.stateCode?.trim().length > 0) {\r\n      return true\r\n    }\r\n    return false\r\n  }\r\n\r\n  handleFormSubmit = (e: React.FormEvent) => {\r\n    e.preventDefault()\r\n    const changes: AddPoolMemberModalValidity = {\r\n      isCompanyValid: !!this.state.selectedCompany,\r\n      isLastNameValid: this.state.lastName.trim().length > 0,\r\n      isFirstNameValid: this.state.firstName.trim().length > 0,\r\n      isStateValid: this.validateState()\r\n    }\r\n    const isValid = this.isValid(changes)\r\n\r\n    if (isValid) {\r\n      this.savePoolMember()\r\n    } else {\r\n      this.setState(changes)\r\n    }\r\n  }\r\n\r\n  resetState = () => this.setState({ ...this.emptyData, ...this.positiveValidity, ...this.personnelCheckEmptyData, showAddPersonnelPanel: false })\r\n\r\n  handleClose = () => {\r\n    this.resetState()\r\n    this.props.onCancel()\r\n  }\r\n\r\n  handleAddMember = ()  => {\r\n    if (this.state.idType === \"DriverID\") {\r\n      this.loadStates()\r\n    }\r\n    this.setState({ showAddPersonnelPanel: true })\r\n  }\r\n\r\n  handleMemberSearch = (field: string, text: string) => {\r\n    text = text.replace(/\\s+/g, \"\")\r\n    if (field.length === 0 || text.length === 0) {\r\n      toast.error(\"Please enter proper search criteria.\")\r\n      return\r\n    }\r\n    if (field === \"SSN\") {\r\n      text = text.replace(/\\D/g, \"\")\r\n      if (text.length !== 9) {\r\n        toast.error(\"Please enter a valid SSN.\")\r\n        return\r\n      }\r\n    }\r\n    this.setState({ isLoading: true })\r\n\r\n    this.subscriptions.add(\r\n      PoolMemberCheck(this.props.poolID, this.props.accountType, text, field).subscribe(\r\n        (result: CheckPoolMember) => {\r\n          toast.success(result.Message)\r\n          result.ID ? this.setState({ firstName: result.FirstName, lastName: result.LastName, id: text, idType: field, isPersonnelFound: true, isLoading: false, checkMember: result }) : this.setState({ isPersonnelFound: false, isLoading: false })\r\n        },\r\n        (error) => {\r\n          toast.error(error?.errorData?.message || error.message)\r\n          this.setState({ isLoading: false, checkMember: undefined })\r\n          if (error?.errorData?.message) {\r\n            this.setState({ isPersonnelFound: true, id: text, idType: field })\r\n          }\r\n        }\r\n      )\r\n    )\r\n  }\r\n\r\n  formatSearchString = (ID: string, value: string): string => {\r\n    return ID === \"SSN\" ? FormatSSN(value) : value\r\n  }\r\n\r\n  handleCompanyChange = (companies: AutoFilterCompany[]) => {\r\n    if (companies.length > 0) {\r\n      this.setState({ selectedCompany: companies[0], isCompanyValid: true, selectedRegion: undefined, selectedLocation: undefined, })\r\n      this.loadAllRegions(companies[0])\r\n      this.loadAllLocations(companies[0], undefined)\r\n    } else {\r\n      this.setState({ isRegionsLoading: false, regions: [], locations: [], selectedCompany: undefined, selectedRegion: undefined, selectedLocation: undefined, isCompanyValid: false, checkMember: undefined })\r\n    }\r\n  }\r\n\r\n  handleRegionChange = (regions: AutoFilterRegion[]) => {\r\n    if (regions.length > 0) {\r\n      this.setState({ selectedRegion: regions[0], selectedLocation: undefined })\r\n      this.loadAllLocations(this.state.selectedCompany, regions[0])\r\n    } else {\r\n      this.setState({ isLocationsLoading: false, locations: [], selectedRegion: undefined, selectedLocation: undefined })\r\n    }\r\n  }\r\n  handleLocationChange = (locations: AutoFilterLocation[]) => this.setState({ selectedLocation: locations[0] })\r\n  handleRegulatoryModeChange = (items: PoolRegulatoryMode[]) => {\r\n    if (items.length > 0) {\r\n      this.setState({ selectedRegulatoryMode: items[0], selectedCategory: undefined })\r\n      this.loadCategories(items[0])\r\n    } else {\r\n      this.setState({ categories: [], selectedRegulatoryMode: undefined, selectedCategory: undefined })\r\n    }\r\n  }\r\n  handleCategoryChange = (items: Category[]) => this.setState({ selectedCategory: items[0] })\r\n  handleStateChange = (state: State) => this.setState({ state: state, stateCode: state.Abbreviation, isStateValid: state.Abbreviation.length > 0 })\r\n\r\n  render() {\r\n    return <Modal backdrop=\"static\" size=\"lg\" centered show={this.props.show} onHide={this.handleClose} >\r\n      <Modal.Header closeButton>\r\n        <Modal.Title>ADD INDIVIDUAL</Modal.Title>\r\n      </Modal.Header>\r\n      <Modal.Body>\r\n        <Container fluid hidden={this.state.showAddPersonnelPanel}>\r\n          <Row>\r\n            <Col>\r\n              <h5>Check For Existing Personnel</h5>\r\n              <SearchBar searchFields={this.idTypes} defaultField={this.idTypes.find((el) => el.ID === this.state.selectedCompany?.PrimaryIDType) || this.idTypes[3]} resetButton={false} onSearch={this.handleMemberSearch} formatValue={this.formatSearchString} loading={this.state.isLoading} />\r\n            </Col>\r\n          </Row>\r\n          <Row className=\"modal-footer border-top-0\">\r\n            <Button variant=\"secondary\" onClick={this.props.onCancel}>CANCEL</Button>\r\n            <Button variant=\"primary\" onClick={() => this.handleAddMember()} disabled={!this.state.isPersonnelFound}>ADD</Button>\r\n          </Row>\r\n        </Container>\r\n        <Form onSubmit={this.handleFormSubmit} hidden={!this.state.showAddPersonnelPanel}>\r\n          <Row><Col><h5>Create and Add New Pool Member</h5></Col></Row>\r\n          <Form.Row className=\"form-group required\">\r\n            <Form.Label column sm={3}>ID</Form.Label>\r\n            <Col md={9} className=\"form-label col-form-label\">{this.state.id}</Col>\r\n          </Form.Row>\r\n          {this.state.idType === \"DriverID\" && <Form.Row className=\"form-group required\">\r\n            <Form.Label column sm={3}>DRIVER'S LICENSE STATE OF ISSUANCE</Form.Label>\r\n            <Col md={9}>\r\n              <StateSelect\r\n                isInvalid={!this.state.isStateValid}\r\n                isDisabled={this.state.statesLoading}\r\n                states={this.state.states}\r\n                dropButtonIfInvalid\r\n                selected={this.state.state}\r\n                selectedCode={this.state.stateCode}\r\n                onChange={(state) => this.handleStateChange(state)} />\r\n            </Col>\r\n          </Form.Row>}\r\n          <Form.Row className=\"form-group required\">\r\n            <Form.Label column sm={3}>FIRST NAME</Form.Label>\r\n            <Col md={9}>\r\n              <Form.Control type=\"text\" isInvalid={!this.state.isFirstNameValid} maxLength={20} value={this.state.firstName} onChange={(e) => { this.setState({ firstName: e.target.value, isFirstNameValid: e.target.value.trim().length > 0 }) }} />\r\n            </Col>\r\n          </Form.Row>\r\n          <Form.Row className=\"form-group required\">\r\n              <Form.Label column sm={3}>LAST NAME</Form.Label>\r\n              <Col md={9}>\r\n                <Form.Control type=\"text\" isInvalid={!this.state.isLastNameValid} maxLength={20} value={this.state.lastName} onChange={(e) => { this.setState({ lastName: e.target.value, isLastNameValid: e.target.value.trim().length > 0 }) }} />\r\n              </Col>\r\n            </Form.Row>\r\n            <Form.Row className=\"form-group required\">\r\n              <Form.Label column sm={3}>COMPANY</Form.Label>\r\n              { this.state.companies.length <= 1 && <Row><Col md={9}>{this.state.companies[0]?.Name}</Col></Row> }\r\n              { this.state.companies.length > 1 &&\r\n                <Col md={9}>\r\n                  <CompanyInput filter onChange={ this.handleCompanyChange } placeholder=\"Select\" />\r\n                </Col>}\r\n            </Form.Row>\r\n            <Form.Row className=\"form-group\">\r\n              <Form.Label column sm={3}>REGION</Form.Label>\r\n              {!this.state.isRegionsLoading && this.state.regions.length === 0 && <Form.Label column sm={9}>None</Form.Label>}\r\n              {(this.state.isRegionsLoading || this.state.regions.length > 0) &&\r\n                <Col md={9}>\r\n                  <Typeahead id=\"region\"\r\n                    ref={this.regionTypeahead}\r\n                    labelKey=\"Name\"\r\n                    filterBy={(option, props) => props.selected.length > 0 || option.Name.toLowerCase().indexOf(props.text.toLowerCase()) !== -1}\r\n                    isLoading={this.state.isRegionsLoading}\r\n                    onChange={this.handleRegionChange}\r\n                    options={this.state.regions}\r\n                    selected={this.state.selectedRegion ? [this.state.selectedRegion] : []}\r\n                    minLength={0}\r\n                    emptyLabel=\"No Regions Found\"\r\n                    placeholder=\"Select\"\r\n                    inputProps={{ autoComplete: \"chrome-off\" }}>\r\n                    {!this.state.isRegionsLoading &&\r\n                      <Button variant=\"toggle\" onClick={() => { this.regionTypeahead.current?.toggleMenu() }}>\r\n                        <FaAngleDown />\r\n                      </Button>}\r\n                  </Typeahead>\r\n                </Col>}\r\n            </Form.Row>\r\n            <Form.Row className=\"form-group\">\r\n              <Form.Label column sm={3}>LOCATION</Form.Label>\r\n              {!this.state.isLocationsLoading && this.state.locations.length === 0 && <Form.Label column sm={9}>None</Form.Label>}\r\n              {(this.state.isLocationsLoading || this.state.locations.length > 0) &&\r\n                <Col md={9}>\r\n                  <Typeahead id=\"location\"\r\n                    ref={this.locationTypeahead}\r\n                    labelKey=\"Name\"\r\n                    filterBy={(option, props) => props.selected.length > 0 || option.Name.toLowerCase().indexOf(props.text.toLowerCase()) !== -1}\r\n                    isLoading={this.state.isLocationsLoading}\r\n                    onChange={this.handleLocationChange}\r\n                    options={this.state.locations}\r\n                    selected={this.state.selectedLocation ? [this.state.selectedLocation] : []}\r\n                    minLength={0}\r\n                    emptyLabel=\"No Locations Found\"\r\n                    placeholder=\"Select\">\r\n                    {!this.state.isLocationsLoading &&\r\n                      <Button variant=\"toggle\" onClick={() => { this.locationTypeahead.current?.toggleMenu() }}>\r\n                        <FaAngleDown />\r\n                      </Button>}\r\n                  </Typeahead>\r\n                </Col>}\r\n            </Form.Row>\r\n            <Form.Row className=\"form-group\" hidden={!!!this.state.poolCompanyData?.HasRegModeBlock}>\r\n              <Form.Label column sm={3}>REGULATORY MODE</Form.Label>\r\n              {!this.state.isLoading && this.state.regulatoryModes.length === 0 && <Form.Label column sm={9}>None</Form.Label>}\r\n              {(this.state.isLoading || this.state.regulatoryModes.length > 0) &&\r\n                <Col md={9}>\r\n                  <Typeahead id=\"regMode\"\r\n                    ref={this.regulatoryModeTypeahead}\r\n                    labelKey=\"Description\"\r\n                    filterBy={(option, props) => props.selected.length > 0 || option?.Description.toLowerCase().indexOf(props.text.toLowerCase()) !== -1}\r\n                    onChange={this.handleRegulatoryModeChange}\r\n                    disabled={this.state.isLoading}\r\n                    options={this.state.regulatoryModes}\r\n                    selected={this.state.selectedRegulatoryMode ? [this.state.selectedRegulatoryMode] : []}\r\n                    emptyLabel=\"No Regulatory Modes Found\"\r\n                    placeholder=\"Select\">\r\n                    <Button variant=\"toggle\" onClick={() => { this.regulatoryModeTypeahead.current?.toggleMenu() }}>\r\n                      <FaAngleDown />\r\n                    </Button>\r\n                  </Typeahead>\r\n                </Col>}\r\n            </Form.Row>\r\n            <Form.Row className=\"form-group\" hidden={!!!this.state.poolCompanyData?.HasRegModeBlock}>\r\n              <Form.Label column sm={3}>CATEGORY</Form.Label>\r\n              {!this.state.isCategoriesLoading && this.state.categories.length === 0 && <Form.Label column sm={9}>None</Form.Label>}\r\n              {(this.state.isCategoriesLoading || this.state.categories.length > 0) &&\r\n                <Col md={9}>\r\n                  <Typeahead id=\"category\"\r\n                    ref={this.categoryTypeahead}\r\n                    labelKey=\"Name\"\r\n                    filterBy={(option, props) => props.selected.length > 0 || option.Name.toLowerCase().indexOf(props.text.toLowerCase()) !== -1}\r\n                    onChange={this.handleCategoryChange}\r\n                    disabled={this.state.isCategoriesLoading}\r\n                    options={this.state.categories}\r\n                    selected={this.state.selectedCategory ? [this.state.selectedCategory] : []}\r\n                    emptyLabel=\"No Categories Found\"\r\n                    placeholder=\"Select\">\r\n                    <Button variant=\"toggle\" onClick={() => { this.categoryTypeahead.current?.toggleMenu() }}>\r\n                      <FaAngleDown />\r\n                    </Button>\r\n                  </Typeahead>\r\n                </Col>}\r\n            </Form.Row>\r\n            <Form.Row className=\"form-group\" hidden={!!!this.state.poolCompanyData?.IsConsortiumPool}>\r\n              <Form.Label column sm={3} className=\"text-uppercase\">{this.state.poolCompanyData?.User9Alias}</Form.Label>\r\n              <Form.Label column sm={9}>{this.state.poolCompanyData?.ConsortiumPoolCode}</Form.Label>\r\n            </Form.Row>\r\n            <Form.Row className=\"modal-footer\">\r\n              <Button variant=\"secondary\" onClick={() => this.resetState()}>CANCEL</Button>\r\n              <Button variant=\"primary\" type=\"submit\" disabled={!this.isValid(this.state)} >\r\n                {this.state.isSaving ? <Spinner animation=\"border\" size=\"sm\" /> : \"SAVE\"}\r\n              </Button>\r\n            </Form.Row>\r\n        </Form>\r\n      </Modal.Body>\r\n    </Modal>\r\n  }\r\n}\r\n","import * as React from \"react\"\r\nimport { Button, Spinner, Table } from \"react-bootstrap\"\r\nimport { format, parseISO } from \"date-fns\"\r\nimport { BehaviorSubject, concat, of, Subscription } from \"rxjs\"\r\nimport { distinctUntilChanged, switchMap, map } from \"rxjs/operators\"\r\nimport TablePagination from \"../../TablePagination\"\r\nimport RandomSelectionList from \"../RandomSelectionList\"\r\nimport GetPoolSelectionHistoryList from \"../../../api/Randoms/PoolSelectionHistoryGet\"\r\nimport PoolSelectionHistory, { PoolSelectionHistoryRow, createPoolSelectionRow } from \"../../../api/Randoms/RandomsModel/PoolSelectionHistoryRow\"\r\n\r\ninterface PoolSelectionSearchParams {\r\n  pageNumber: number\r\n  poolId: number\r\n}\r\n\r\nconst PageSize = 5\r\n\r\ninterface SelectionHistoryGridProps {\r\n  poolId: number\r\n  poolName: string\r\n  poolProgramId: number\r\n  companyId: number\r\n}\r\n\r\ninterface SelectionHistoryGridState {\r\n  loading: boolean\r\n  data?: PoolSelectionHistory\r\n  selectionListModal: boolean\r\n  poolSelection?: PoolSelectionHistoryRow\r\n}\r\n\r\nexport default class SelectionHistoryGrid extends React.PureComponent<SelectionHistoryGridProps, SelectionHistoryGridState> {\r\n  state: SelectionHistoryGridState = {\r\n    loading: false,\r\n    selectionListModal: false,\r\n    data: undefined\r\n  }\r\n\r\n  page$ = new BehaviorSubject<PoolSelectionSearchParams>({\r\n    pageNumber: 1,\r\n    poolId: this.props.poolId\r\n  })\r\n\r\n  pageSubscription?: Subscription\r\n\r\n  componentDidMount() {\r\n    this.pageSubscription = this.page$.pipe(\r\n      distinctUntilChanged(),\r\n      switchMap(params => concat(\r\n        of({ loading: true }),\r\n        GetPoolSelectionHistoryList(this.props.poolId, this.props.poolProgramId, PageSize, params.pageNumber).pipe(\r\n          map((result: PoolSelectionHistory) => ({ data: result, loading: false })))\r\n      ))\r\n    ).subscribe(\r\n      (newState: { loading: boolean, data?: PoolSelectionHistory }) => {\r\n        if (newState.data) {\r\n          this.setState({ loading: newState.loading, data: newState.data })\r\n        } else {\r\n          this.setState({ loading: newState.loading })\r\n        }\r\n      },\r\n      () => {\r\n        this.setState({ loading: false })\r\n      }\r\n    )\r\n  }\r\n\r\n  componentDidUpdate(prevProps: SelectionHistoryGridProps, prevState: SelectionHistoryGridState) {\r\n    if (prevProps.poolProgramId !== this.props.poolProgramId) {\r\n      this.page$.next({ poolId: this.props.poolId, pageNumber: 1 })\r\n    }\r\n  }\r\n\r\n  componentWillUnmount() {\r\n    this.pageSubscription && this.pageSubscription.unsubscribe()\r\n  }\r\n\r\n  pageChanged = (pageNumber: number) => {\r\n    this.page$.next({ ...this.page$.value, pageNumber: pageNumber })\r\n  }\r\n\r\n  convertDate = (date: string) => {\r\n    if (date) {\r\n      return format(parseISO(date), \"MM/dd/yyyy\")\r\n    } else {\r\n      return \"\"\r\n    }\r\n  }\r\n\r\n  renderRows = () => {\r\n    if (this.state.data && this.state.data.Records && this.state.data.Records.length) {\r\n      return this.state.data.Records.map((row: PoolSelectionHistoryRow, i: number) =>\r\n        <tr key={i}>\r\n          <td>\r\n            {<Button variant=\"link\" onClick={() => this.showSelectionList(row)} className=\"p-0\">{row.Period}</Button>}\r\n          </td>\r\n          <td className=\"text-center\">{row.PoolSize}</td>\r\n          <td className=\"text-center\">{this.convertDate(row.SelectionDate)}</td>\r\n          <td className=\"text-center border-left\">{row.DrugSelected}</td>\r\n          <td className=\"text-center\">{row.AlcoholSelected}</td>\r\n          <td className=\"text-center border-left\">{row.DrugExtra}</td>\r\n          <td className=\"text-center\">{row.AlcoholExtra}</td>\r\n          <td className=\"text-center border-left\">{row.DrugPending}</td>\r\n          <td className=\"text-center\">{row.AlcoholPending}</td>\r\n          <td className=\"text-center border-left\">{row.DrugNotComplete}</td>\r\n          <td className=\"text-center\">{row.AlcoholNotComplete}</td>\r\n          <td className=\"text-center border-left\">{row.DrugCompleted}</td>\r\n          <td className=\"text-center\">{row.AlcoholCompleted}</td>\r\n        </tr>)\r\n    } else {\r\n      return <tr><td colSpan={9}>NO DATA FOUND</td></tr>\r\n    }\r\n  }\r\n\r\n  showSelectionList = (poolSelection: PoolSelectionHistoryRow) => this.setState({ selectionListModal: true, poolSelection: poolSelection })\r\n\r\n  hideSelectionList = () => this.setState({ selectionListModal: false, poolSelection: undefined })\r\n\r\n  render() {\r\n    return <>\r\n      <h5>TESTING PERIOD BREAKDOWN</h5>\r\n      <Table responsive className=\"table-sm dark\">\r\n        <thead>\r\n          <tr className=\"text-normal\">\r\n            <th className=\"border-bottom-0\">PERIOD</th>\r\n            <th className=\"border-bottom-0 text-center\">POOL SIZE</th>\r\n            <th className=\"border-bottom-0 text-center\">SELECTION DATE</th>\r\n            <th className=\"border-bottom-0 text-center\" colSpan={2}>TESTS SELECTED</th>\r\n            <th className=\"border-bottom-0 text-center\" colSpan={2}>EXTRA TESTS</th>\r\n            <th className=\"border-bottom-0 text-center\" colSpan={2}>TESTS PEND COLL</th>\r\n            <th className=\"border-bottom-0 text-center\" colSpan={2}>TESTS INCMPL</th>\r\n            <th className=\"border-bottom-0 text-center\" colSpan={2}>TESTS COMPLETED</th>\r\n          </tr>\r\n          <tr className=\"text-normal\">\r\n            <th className=\"border-top-0\"></th>\r\n            <th className=\"border-top-0\"></th>\r\n            <th className=\"border-top-0\"></th>\r\n            <th className=\"border-top-0 text-center\">DRUG</th>\r\n            <th className=\"border-top-0 text-center\">ALCOHOL</th>\r\n            <th className=\"border-top-0 text-center\">DRUG</th>\r\n            <th className=\"border-top-0 text-center\">ALCOHOL</th>\r\n            <th className=\"border-top-0 text-center\">DRUG</th>\r\n            <th className=\"border-top-0 text-center\">ALCOHOL</th>\r\n            <th className=\"border-top-0 text-center\">DRUG</th>\r\n            <th className=\"border-top-0 text-center\">ALCOHOL</th>\r\n            <th className=\"border-top-0 text-center\">DRUG</th>\r\n            <th className=\"border-top-0 text-center\">ALCOHOL</th>\r\n          </tr>\r\n        </thead>\r\n        <tbody>\r\n          {\r\n            this.state.loading ?\r\n              <tr>\r\n                <td className=\"text-center\" colSpan={13}>\r\n                  <Spinner animation=\"border\" variant=\"secondary\" />\r\n                </td>\r\n              </tr> : this.renderRows()\r\n          }\r\n        </tbody>\r\n      </Table>\r\n      {this.state.data && <TablePagination pageNumber={this.page$.value.pageNumber} pages={this.state.data.Pages} onChange={this.pageChanged} />}\r\n      {\r\n          this.state.selectionListModal && this.state.poolSelection &&\r\n          <RandomSelectionList onHide={this.hideSelectionList} show={this.state.selectionListModal} accountId={this.props.companyId}\r\n            poolId={this.props.poolId} poolName={this.props.poolName} poolSelection={createPoolSelectionRow(this.state.poolSelection)} \r\n            unmaskDonorId={0}/> \r\n      }\r\n\r\n    </>\r\n  }\r\n}\r\n","import { Observable } from \"rxjs\"\r\nimport { ObservableFromFetch } from \"../ObservableFromFetch\"\r\nimport PoolProgramYear from \"./RandomsModel/PoolProgramYear\"\r\nimport PoolSelectionHistory from \"./RandomsModel/PoolSelectionHistoryRow\"\r\n\r\n\r\n\r\nexport default function GetPoolSelectionHistoryList(poolId: number, poolProgramId: number,  pageSize:number, pageNumber: number,): Observable<PoolSelectionHistory> {\r\n  const requestBody: string = new URLSearchParams({\r\n    poolId: poolId.toString(),\r\n    poolProgramId: poolProgramId.toString(),\r\n    pageSize: pageSize.toString(),\r\n    pageNumber: pageNumber.toString()\r\n  }).toString()\r\n\r\n  return ObservableFromFetch<PoolSelectionHistory>(\"RandomTest/PoolSelectionHistoryList?\" + requestBody)\r\n}\r\n\r\n\r\nexport function GetPoolPrograms(poolId: number, count: number): Observable<PoolProgramYear[]> {\r\n  const requestBody: string = new URLSearchParams({\r\n    poolId: poolId.toString(),\r\n    count: count.toString()\r\n  }).toString()\r\n\r\n  return ObservableFromFetch<PoolProgramYear[]>(\"RandomTest/GetPoolPrograms?\" + requestBody)\r\n}\r\n","import PoolSelectionRow from \"./PoolSelectionRow\"\r\n\r\nexport  interface PoolSelectionHistoryRow {\r\n  SelectionInterval: string\r\n  SelectionMethod: string\r\n  Period: string\r\n  PoolSize: number\r\n  SelectionDate: string\r\n  DrugSelected: number \r\n  AlcoholSelected: number \r\n  DrugExtra: number\r\n  AlcoholExtra: number\r\n  DrugCompleted: number\r\n  AlcoholCompleted: number\r\n  DrugNotComplete: number\r\n  AlcoholNotComplete: number\r\n  DrugPending: number\r\n  AlcoholPending: number\r\n  PoolSelectionID: number\r\n  UseCrews: number\r\n\r\n }\r\n\r\n\r\nexport default interface PoolSelectionHistory {\r\n  Records: PoolSelectionHistoryRow[]\r\n  Pages: number\r\n  Total: number\r\n}\r\n\r\nexport function createPoolSelectionRow(hstRow : PoolSelectionHistoryRow) : PoolSelectionRow\r\n{\r\n\r\n  let result = {PoolSelectionID: hstRow.PoolSelectionID,\r\n    Period:  hstRow.Period,\r\n    TimePeriod: \"\",\r\n    PoolSize: hstRow.PoolSize,\r\n    SelectionDate: hstRow.SelectionDate,\r\n    DrugSelected: hstRow.DrugSelected,\r\n    AlcoholSelected: hstRow.AlcoholSelected,\r\n    DrugExtra: hstRow.DrugExtra,\r\n    AlcoholExtra: hstRow.AlcoholExtra,\r\n    DrugCompleted: hstRow.DrugCompleted,\r\n    AlcoholCompleted: hstRow.AlcoholCompleted\r\n  }\r\n  return result\r\n}\r\n","import * as React from \"react\"\r\nimport { Container, Row, Col, Spinner, Form } from \"react-bootstrap\"\r\nimport { defaults } from \"react-chartjs-2\"\r\nimport \"chartjs-plugin-datalabels\"\r\nimport { ChartOptions } from \"chart.js\"\r\nimport { Subject, Subscription } from \"rxjs\"\r\nimport { PoolStatisticsDetailsByProgram } from \"../../../api/Randoms/PoolStatisticsDetailsGet\"\r\nimport PoolStatisticsDetails from \"../../../api/Randoms/RandomsModel/PoolStatisticsDetails\"\r\nimport { ExcusedReport, ExcusedReportGenerate } from \"../../../api/Reports/WorkforceReport\"\r\nimport FormatError from \"../../../formatters/FormatError\"\r\nimport { toast } from \"react-toastify\"\r\nimport printPdf from \"../../../utils/printPdf\"\r\nimport PoolProgramYear from \"../../../api/Randoms/RandomsModel/PoolProgramYear\"\r\nimport PoolSelectionHistoryRow from \"../../../api/Randoms/RandomsModel/PoolSelectionHistoryRow\"\r\nimport { GetPoolPrograms } from \"../../../api/Randoms/PoolSelectionHistoryGet\"\r\nimport SelectionHistoryGrid from \"./SelectionHistoryGrid\"\r\n\r\ninterface PoolHistoryProps {\r\n  poolId: number\r\n  poolName: string\r\n  isConsortium: boolean\r\n  currentCompany: number\r\n  allowExcusedReport: boolean\r\n}\r\n\r\ninterface PoolHistoryState {\r\n  poolProgramsLoading: boolean\r\n  poolProgramsYear: PoolProgramYear[],\r\n  selectedPoolProgramId: number,\r\n  selectedPoolYear: number\r\n  statisticsLoading: boolean\r\n  statistics?: PoolStatisticsDetails\r\n  historyLoading: boolean\r\n  selectionHistory: PoolSelectionHistoryRow[]\r\n\r\n}\r\n\r\nconst options: ChartOptions = {\r\n  maintainAspectRatio: false,\r\n  layout: {\r\n    padding: {\r\n      right: 50\r\n    }\r\n  },\r\n  legend: {\r\n    position: 'bottom',\r\n    labels: {\r\n      usePointStyle: true,\r\n      boxWidth: 10,\r\n      fontSize: 16\r\n    }\r\n  },\r\n  plugins: {\r\n    datalabels: {\r\n      color: '#000',\r\n      display: true\r\n    }\r\n  },\r\n  scales: {\r\n    yAxes: [{ ticks: { fontSize: 16 } }],\r\n    xAxes: [{ ticks: { min: 0 } }]\r\n  }\r\n}\r\n\r\ndefaults.global.defaultFontFamily = '-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, \"Helvetica Neue\", Arial, \"Noto Sans\", sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\", \"Noto Color Emoji\"'\r\ndefaults.global.defaultFontColor = '#212529'\r\n\r\nexport default class PoolHistory extends React.PureComponent<PoolHistoryProps, PoolHistoryState> {\r\n  state: PoolHistoryState = {\r\n\r\n    poolProgramsLoading: false,\r\n    poolProgramsYear: [],\r\n    selectedPoolProgramId: 0,\r\n    selectedPoolYear: 0,\r\n    statisticsLoading: false,\r\n    statistics: undefined,\r\n    historyLoading: false,\r\n    selectionHistory: []\r\n  }\r\n\r\n  poolProgramsSubscription = new Subscription()\r\n  poolStatisticSubscription = new Subscription()\r\n  subscriptions = new Subscription()\r\n  company$ = new Subject<number>()\r\n\r\n  componentDidMount() {\r\n    this.loadPoolProgramsYear()\r\n  }\r\n\r\n  componentWillUnmount() {\r\n    this.poolProgramsSubscription && this.poolProgramsSubscription.unsubscribe()\r\n    this.poolStatisticSubscription && this.poolStatisticSubscription.unsubscribe()\r\n  }\r\n\r\n  startLoading() {\r\n    this.setState({\r\n      poolProgramsLoading: true,\r\n      selectedPoolProgramId: 0,\r\n      selectedPoolYear: 0,\r\n      poolProgramsYear: [],\r\n      statisticsLoading: false,\r\n      statistics: undefined,\r\n      historyLoading: false,\r\n      selectionHistory: []\r\n    })\r\n  }\r\n\r\n  loadPoolProgramsYear() {\r\n    this.startLoading()\r\n    this.poolProgramsSubscription && this.poolProgramsSubscription.unsubscribe()\r\n    this.poolProgramsSubscription = GetPoolPrograms(this.props.poolId, 5).subscribe(\r\n      (data: PoolProgramYear[]) => {\r\n        const poolProgramId = (data.length > 0) ? data[0].PoolProgramID : 0\r\n        const poolYear = (data.length > 0) ? data[0].Year : 0\r\n        this.setState({\r\n          poolProgramsYear: data,\r\n          selectedPoolProgramId: poolProgramId,\r\n          selectedPoolYear: poolYear,\r\n        })\r\n        this.loadPoolStatistics(poolProgramId)\r\n      },\r\n      (error) => {\r\n        toast.error(error?.errorData?.message || error.message)\r\n      },\r\n      () => {\r\n        this.setState({ poolProgramsLoading: false })\r\n\r\n      }\r\n    )\r\n  }\r\n\r\n  loadPoolStatistics(poolProgramId: number) {\r\n    this.setState({\r\n      statisticsLoading: true,\r\n      statistics: undefined,\r\n    })\r\n\r\n    this.poolStatisticSubscription && this.poolStatisticSubscription.unsubscribe()\r\n    this.poolStatisticSubscription = PoolStatisticsDetailsByProgram(this.props.poolId, poolProgramId).subscribe(\r\n      (data: PoolStatisticsDetails) => {\r\n        this.setState({\r\n          statistics: data\r\n        })\r\n      },\r\n      (error) => {\r\n        toast.error(error?.errorData?.message || error.message)\r\n      },\r\n      () => {\r\n        this.setState({ statisticsLoading: false })\r\n\r\n      }\r\n    )\r\n  }\r\n\r\n  onPoolProgramSelect(event: React.ChangeEvent<HTMLSelectElement>) {\r\n    if (this.state.poolProgramsYear.length === 0) {\r\n      return\r\n    }\r\n    const poolProgramId = Number(event.target.value)\r\n    const poolYearItem = this.state.poolProgramsYear.find(item => item.PoolProgramID === poolProgramId)\r\n    const poolYear = poolYearItem ? poolYearItem.Year : 0\r\n    this.setState({ selectedPoolProgramId: poolProgramId, selectedPoolYear: poolYear })\r\n    this.loadPoolStatistics(poolProgramId)\r\n  }\r\n\r\n  runExcusedReport = () => {\r\n    const params: ExcusedReport = {\r\n      AccountID: 0,//this.state.selectedCompany,\r\n      PoolID: this.props.poolId,\r\n      PoolName: this.props.poolName\r\n    }\r\n\r\n    this.subscriptions.add(\r\n      ExcusedReportGenerate(params).subscribe(\r\n        (base64pdf: string) => printPdf(base64pdf),\r\n        (error) => toast.error(FormatError(error))\r\n      )\r\n    )\r\n  }\r\n\r\n  render() {\r\n    const { statistics, selectedPoolProgramId, selectedPoolYear, poolProgramsYear, poolProgramsLoading } = this.state\r\n    let labels = ['ESTIMATED TESTS REQUIRED', 'TOTAL TESTS COMPLETED', 'TOTAL TESTS PENDING COLLECTION'];\r\n    let dataDrug = [statistics?.TotalTestsRequiredDrug, statistics?.TotalTestsCompletedDrug, statistics?.TotalTestsPendingDrug]\r\n    let dataAlco = [statistics?.TotalTestsRequiredAlcohol, statistics?.TotalTestsCompletedAlcohol, statistics?.TotalTestsPendingAlcohol]\r\n    const totalTestsRequired = (statistics?.TotalTestsRequiredDrug || 0)  + (statistics?.TotalTestsRequiredAlcohol || 0)\r\n    const totalEstimatedComplete= (statistics?.TotalEstimatedCompleteDrug || 0)  + (statistics?.TotalEstimatedCompleteAlcohol || 0)\r\n    \r\n    const targetDrug = (statistics?.RateOrFixed == 1) ? (statistics?.TargetDrug || 0) : (statistics?.TotalTestsRequiredDrug || 0)\r\n    const targetAlcohol = (statistics?.RateOrFixed == 1) ? (statistics?.TargetAlcohol || 0) : (statistics?.TotalTestsRequiredAlcohol || 0)\r\n\r\n    const actualDrug = statistics?.ActualDrug || 0\r\n    const actualAlcohol = statistics?.ActualAlcohol || 0\r\n\r\n    return <>\r\n      <Container fluid className=\"grid-container py-0\">\r\n        {!poolProgramsLoading && <Row className=\"form-group\">\r\n          <Col xs={2}>PROGRAM YEAR:</Col>\r\n          {<Col xs={2} md={2}>\r\n            <Form.Control id=\"pool_program_id\"\r\n              as=\"select\"\r\n              disabled={false}\r\n              value={selectedPoolProgramId}\r\n              onChange={(e: React.ChangeEvent<HTMLSelectElement>) => this.onPoolProgramSelect(e)}>\r\n              {poolProgramsYear.map(item => <option value={item.PoolProgramID} key={\"pool_program_\" + item.PoolProgramID}>{item.Year}</option>)}\r\n            </Form.Control>\r\n          </Col>}\r\n          <Col xs={4}>PROGRAM START DATE: {\"01/01/\" + selectedPoolYear}</Col>\r\n          <Col xs={4}>PROGRAM END DATE: {\"12/31/\" + selectedPoolYear}</Col>\r\n        </Row>}\r\n        <Row>\r\n          <Col>\r\n            {this.state.selectedPoolProgramId > 0 && <SelectionHistoryGrid poolId={this.props.poolId} poolProgramId={this.state.selectedPoolProgramId} poolName={this.props.poolName} companyId={0}/>}\r\n          </Col>\r\n        </Row>\r\n        <Row>\r\n          <Col>\r\n            <h5>TESTING TOTALS</h5>\r\n            <Container fluid>\r\n              <Row>\r\n                <Col xs={4}>PROGRAM YEAR-TO-DATE:</Col>\r\n                <Col xs={2}></Col>\r\n                <Col xs={4}>TOTAL # TESTS REQUIRED:</Col>\r\n                <Col xs={2}>{totalTestsRequired}</Col>\r\n              </Row>\r\n              <Row>\r\n                <Col xs={4}></Col>\r\n                <Col xs={2}></Col>\r\n                <Col xs={4}>TOTAL ESTIMATED COMPLETE:</Col>\r\n                <Col xs={2}>{totalEstimatedComplete}</Col>\r\n              </Row>\r\n              <Row>\r\n                <Col xs={4}></Col>\r\n                <Col xs={2}></Col>\r\n                <Col xs={4}>DIFFERENCE:</Col>\r\n                <Col xs={2}>{totalTestsRequired - totalEstimatedComplete}</Col>\r\n              </Row>\r\n\r\n              <Row>\r\n                <Col xs={4}>TARGET DRUG:</Col>\r\n                <Col xs={2}>{targetDrug}{statistics?.RateOrFixed === 1 && <span>%</span>}</Col>\r\n                <Col xs={4}>TARGET ALCOHOL:</Col>\r\n                <Col xs={2}>{targetAlcohol}{statistics?.RateOrFixed === 1 && <span>%</span>}</Col>\r\n              </Row>\r\n              <Row>\r\n                <Col xs={4}>ACTUAL DRUG:</Col>\r\n                <Col xs={2}>{actualDrug}</Col>\r\n                <Col xs={4}>ACTUAL ALCOHOL:</Col>\r\n                <Col xs={2}>{actualAlcohol}</Col>\r\n              </Row>\r\n            </Container>\r\n          </Col>\r\n        </Row>\r\n        {this.state.statisticsLoading && <Row><Col className=\"text-center\"><Spinner animation=\"border\" variant=\"secondary\" /></Col></Row>}\r\n        {this.state.statistics &&\r\n          <Row>\r\n            <Col>\r\n            </Col>\r\n          </Row>}\r\n      </Container>\r\n    </>\r\n  }\r\n}\r\n","import NotificationApplicationUsersGridData from \"./NotificationApplicationUsersGridData\"\r\nimport NotificationApplicationUsersSearchParams from \"./NotificationApplicationUsersSearchParams\"\r\nimport NotificationContactData from \"./NotificationContactData\"\r\nimport NotificationContactsDeleteParams from \"./NotificationContactsDeleteParams\"\r\nimport NotificationContactsGetParams from \"./NotificationContactsGetParams\"\r\nimport NotificationEvents from \"./NotificationEvent\"\r\nimport NotificationGridData from \"./NotificationGridData\"\r\nimport NotificationSendParams from \"./NotificationSendParams\"\r\nimport NotificationMethod from \"../../Notifications/Model/NotificationMethod\"\r\nimport { ObservableFromFetch } from \"../../ObservableFromFetch\"\r\n\r\nexport function GetNotificationContactsObservable(params: NotificationContactsGetParams) {\r\n  const requestBody: string = JSON.stringify(params)\r\n  return ObservableFromFetch<NotificationGridData>(\"WorkforceRandomNotification/GetNotificationContacts\", requestBody)\r\n}\r\n\r\nexport function GetNotificationApplicationUsersObservable(params: NotificationApplicationUsersSearchParams) {\r\n  const requestBody: string = JSON.stringify(params)\r\n  return ObservableFromFetch<NotificationApplicationUsersGridData>(\r\n    \"WorkforceRandomNotification/SearchNotificationApplicationUsers\",\r\n    requestBody\r\n  )\r\n}\r\n\r\nexport function SaveNotificationContactObservable(params: NotificationContactData) {\r\n  const parsedParams = {\r\n    PoolID: params.PoolID,\r\n    ContactID: params.ContactID,\r\n    ApplicationUserID: params.ApplicationUserID,\r\n    NotificationMode: params.NotificationMode,\r\n    NotificationMethodIDs: params.NotificationMethods.filter((x) => x.selected).map((x) => x.NotificationMethodID),\r\n    NotificationEventsIDs: params.NotificationEvents.filter((x) => x.selected).map((x) => x.RandomNotificationEventID),\r\n  }\r\n  const requestBody: string = JSON.stringify(parsedParams)\r\n  return ObservableFromFetch<string>(\"WorkforceRandomNotification/SaveNotificationContact\", requestBody)\r\n}\r\n\r\nexport function DeleteNotificationContactsObservable(params: NotificationContactsDeleteParams) {\r\n  const requestBody: string = JSON.stringify(params)\r\n  return ObservableFromFetch<string>(\"WorkforceRandomNotification/DeleteNotificationContacts\", requestBody)\r\n}\r\n\r\nexport function SendNotificationsObservable(params: NotificationSendParams) {\r\n  const requestBody: string = JSON.stringify(params)\r\n  return ObservableFromFetch<string>(\"WorkforceRandomNotification/SendNotifications\", requestBody)\r\n}\r\n\r\nexport function GetNotificationMethodsObservable() {\r\n  return ObservableFromFetch<NotificationMethod[]>(\"WorkforceRandomNotification/GetNotificationDeliveryMethods\")\r\n}\r\n\r\nexport function GetNotificationEventsObservable() {\r\n  return ObservableFromFetch<NotificationEvents[]>(\"WorkforceRandomNotification/GetNotificationEvents\")\r\n}\r\n","import { useCallback, useState } from \"react\"\r\n\r\nimport { toast } from \"react-toastify\"\r\nimport { concat, Observable, of } from \"rxjs\"\r\nimport { catchError, map } from \"rxjs/operators\"\r\n\r\nimport NotificationContactData from \"./NotificationContactData\"\r\nimport handleAPIError from \"../../../utils/handleAPIError\"\r\nimport ApiResult from \"../../ApiResult\"\r\n\r\ninterface UseNotificationActionProps<T> {\r\n  actionObservable: (props: { PoolId: number; ContactIds: number[] }) => Observable<T>\r\n  callback?: (result?: T) => void\r\n}\r\n\r\nfunction useNotificationAction<T>({\r\n  actionObservable,\r\n  callback,\r\n}: UseNotificationActionProps<T>): [\r\n  processing: Record<number, boolean>,\r\n  performAction: (poolId: number, contacts: NotificationContactData[]) => void,\r\n] {\r\n  const [processing, setProcessing] = useState<Record<number, boolean>>({})\r\n\r\n  const performAction = useCallback(\r\n    (poolId: number, contacts: NotificationContactData[]) => {\r\n      const contactIds = contacts.map((c) => c.ContactID)\r\n\r\n      const observable = concat(\r\n        of({ loading: true }),\r\n        actionObservable({\r\n          PoolId: poolId,\r\n          ContactIds: contactIds,\r\n        }).pipe(\r\n          map((result) => ({ loading: false, result })),\r\n          catchError((error) => of({ loading: false, result: undefined, error }))\r\n        )\r\n      )\r\n\r\n      const subscription = observable.subscribe(({ loading, result, error }: ApiResult<T>) => {\r\n        setProcessing(contactIds.reduce((acc, id) => ({ ...acc, [id]: loading }), {}))\r\n        if (!loading && !error) {\r\n          toast.success(result)\r\n          callback?.(result)\r\n        }\r\n        if (error) {\r\n          handleAPIError(error)\r\n        }\r\n      })\r\n\r\n      return () => subscription.unsubscribe()\r\n    },\r\n    [actionObservable, callback]\r\n  )\r\n\r\n  return [processing, performAction]\r\n}\r\n\r\nexport default useNotificationAction\r\n","import { DeleteNotificationContactsObservable } from \"./NotificationContactsProcess\"\r\nimport useNotificationAction from \"./useNotificationAction\"\r\n\r\nfunction useNotificationContactsDelete(callback?: (result?: string) => void | Promise<void>) {\r\n  const [processing, deleteContacts] = useNotificationAction<string>({\r\n    actionObservable: DeleteNotificationContactsObservable,\r\n    callback,\r\n  })\r\n\r\n  return { deletingContacts: processing, deleteContacts }\r\n}\r\n\r\nexport default useNotificationContactsDelete\r\n","import { useCallback, useEffect, useMemo, useState } from \"react\"\r\n\r\nimport { BehaviorSubject, concat, of } from \"rxjs\"\r\nimport { catchError, distinctUntilChanged, finalize, map, switchMap } from \"rxjs/operators\"\r\n\r\nimport NotificationContactData from \"./NotificationContactData\"\r\nimport NotificationContactsGetParams from \"./NotificationContactsGetParams\"\r\nimport { GetNotificationContactsObservable } from \"./NotificationContactsProcess\"\r\nimport NotificationGridData from \"./NotificationGridData\"\r\nimport handleAPIError from \"../../../utils/handleAPIError\"\r\nimport ApiResult from \"../../ApiResult\"\r\n\r\nconst PAGE_SIZE = 10\r\n\r\nfunction useNotificationContactsLoad(poolId: number) {\r\n  const [gridData, setGridData] = useState<NotificationGridData>({ Records: [], Pages: 0, Total: 0 })\r\n  const [loadingContacts, setLoadingContacts] = useState(false)\r\n\r\n  const initialParams = useMemo(\r\n    () => ({\r\n      PoolId: poolId,\r\n      PageNumber: 1,\r\n      PageSize: PAGE_SIZE,\r\n    }),\r\n    [poolId]\r\n  )\r\n\r\n  const page$ = useMemo(() => new BehaviorSubject<NotificationContactsGetParams>(initialParams), [initialParams])\r\n\r\n  useEffect(() => {\r\n    const fetchNotificationContacts = (params: NotificationContactsGetParams) => {\r\n      return concat(\r\n        of({ loading: true }),\r\n        GetNotificationContactsObservable(params).pipe(\r\n          map((result) => ({ loading: false, result })),\r\n          catchError((error) => of({ loading: false, result: undefined, error })),\r\n          finalize(() => setLoadingContacts(false))\r\n        )\r\n      )\r\n    }\r\n\r\n    setLoadingContacts(true)\r\n    const subscription = page$\r\n      .pipe(distinctUntilChanged(), switchMap(fetchNotificationContacts))\r\n      .subscribe(({ loading, result, error }: ApiResult<NotificationGridData>) => {\r\n        if (!loading && result) {\r\n          const parsedRecords = result.Records.map((record: NotificationContactData) => ({\r\n            ...record,\r\n            selected: false,\r\n          }))\r\n\r\n          setGridData({\r\n            ...result,\r\n            Records: parsedRecords || [],\r\n            Pages: result.Pages ?? 0,\r\n            Total: result.Total ?? 0,\r\n          })\r\n        }\r\n\r\n        if (error) {\r\n          handleAPIError(error)\r\n        }\r\n      })\r\n    return () => subscription.unsubscribe()\r\n  }, [page$])\r\n\r\n  const reloadContacts = useCallback(() => {\r\n    page$.next({ ...page$.value, PageNumber: 1 })\r\n  }, [page$])\r\n\r\n  const selectContacts = useCallback((contactIds: number[], checked: boolean) => {\r\n    setGridData((prev) => ({\r\n      ...prev,\r\n      Records: prev.Records?.map((c) => (contactIds.includes(c.ContactID) ? { ...c, selected: checked } : c)),\r\n    }))\r\n  }, [])\r\n\r\n  const selectedContacts = useMemo(() => {\r\n    return gridData.Records.filter((c) => c.selected)\r\n  }, [gridData])\r\n\r\n  return { loadingContacts, gridData, selectedContacts, page$, selectContacts, reloadContacts }\r\n}\r\n\r\nexport default useNotificationContactsLoad\r\n","import { SendNotificationsObservable } from \"./NotificationContactsProcess\"\r\nimport useNotificationAction from \"./useNotificationAction\"\r\n\r\nfunction useNotificationsSend(callback?: (result?: string) => void | Promise<void>) {\r\n  const [processing, sendNotifications] = useNotificationAction<string>({\r\n    actionObservable: SendNotificationsObservable,\r\n    callback,\r\n  })\r\n\r\n  return { sendingNotifications: processing, sendNotifications }\r\n}\r\n\r\nexport default useNotificationsSend\r\n","import { createContext, useMemo } from \"react\"\r\n\r\nimport { BehaviorSubject } from \"rxjs\"\r\n\r\nimport NotificationContactData from \"../../../api/Randoms/Notification/NotificationContactData\"\r\nimport NotificationContactsGetParams from \"../../../api/Randoms/Notification/NotificationContactsGetParams\"\r\nimport NotificationGridData from \"../../../api/Randoms/Notification/NotificationGridData\"\r\nimport useNotificationContactsDelete from \"../../../api/Randoms/Notification/useNotificationContactsDelete\"\r\nimport useNotificationContactsLoad from \"../../../api/Randoms/Notification/useNotificationContactsLoad\"\r\nimport useNotificationsSend from \"../../../api/Randoms/Notification/useNotificationsSend\"\r\n\r\ninterface NotificationContactsProviderProps {\r\n  poolId: number\r\n  children: React.ReactNode\r\n}\r\n\r\ninterface NotificationContactsContextType {\r\n  poolId: number\r\n  gridData: NotificationGridData\r\n  selectedContacts: NotificationContactData[]\r\n  loadingContacts: boolean\r\n  deletingContacts: { [key: number]: boolean }\r\n  sendingNotifications: { [key: number]: boolean }\r\n}\r\n\r\ninterface NotificationContactsActionsContextType {\r\n  page$: BehaviorSubject<NotificationContactsGetParams>\r\n  deleteContacts: (poopId: number, contact: NotificationContactData[]) => void\r\n  sendNotifications: (poopId: number, contact: NotificationContactData[]) => void\r\n  selectContacts: (contactIds: number[], checked: boolean) => void\r\n  reloadContacts: () => void\r\n}\r\n\r\nexport const NotificationContactsContext = createContext<NotificationContactsContextType | null>(null)\r\nexport const NotificationContactsActionsContext = createContext<NotificationContactsActionsContextType | null>(null)\r\n\r\nfunction NotificationContactsProvider({ poolId, children }: NotificationContactsProviderProps) {\r\n  const { loadingContacts, gridData, selectedContacts, page$, selectContacts, reloadContacts } =\r\n    useNotificationContactsLoad(poolId)\r\n  const { deletingContacts, deleteContacts } = useNotificationContactsDelete(reloadContacts)\r\n  const { sendingNotifications, sendNotifications } = useNotificationsSend(reloadContacts)\r\n\r\n  const value = useMemo(\r\n    () => ({\r\n      poolId,\r\n      gridData,\r\n      selectedContacts,\r\n      loadingContacts,\r\n      deletingContacts,\r\n      sendingNotifications,\r\n    }),\r\n    [poolId, gridData, selectedContacts, loadingContacts, deletingContacts, sendingNotifications]\r\n  )\r\n\r\n  const actions = useMemo(\r\n    () => ({\r\n      page$,\r\n      deleteContacts,\r\n      sendNotifications,\r\n      selectContacts,\r\n      reloadContacts,\r\n    }),\r\n    [page$, deleteContacts, reloadContacts, selectContacts, sendNotifications]\r\n  )\r\n\r\n  return (\r\n    <NotificationContactsContext.Provider value={value}>\r\n      <NotificationContactsActionsContext.Provider value={actions}>\r\n        {children}\r\n      </NotificationContactsActionsContext.Provider>\r\n    </NotificationContactsContext.Provider>\r\n  )\r\n}\r\n\r\nexport default NotificationContactsProvider\r\n","import { Col, Row } from \"react-bootstrap\"\r\n\r\nimport FormatPhone from \"../../../formatters/FormatPhone\"\r\n\r\ninterface NotificationApplicationUserInfoProps {\r\n  UserName: string\r\n  FirstName: string\r\n  LastName: string\r\n  Email: string\r\n  Phone: string\r\n}\r\n\r\nfunction NotificationApplicationUserInfo({\r\n  UserName,\r\n  FirstName,\r\n  LastName,\r\n  Email,\r\n  Phone,\r\n}: NotificationApplicationUserInfoProps) {\r\n  const INFO_FIELDS = [\r\n    { label: \"User Name\", value: UserName },\r\n    { label: \"Name\", value: `${FirstName} ${LastName}` },\r\n    { label: \"Email\", value: Email },\r\n    { label: \"Phone Number\", value: FormatPhone(Phone) },\r\n  ]\r\n\r\n  return (\r\n    <>\r\n      {INFO_FIELDS.map((field) => (\r\n        <Row key={field.label.replace(/\\s+/g, \"_\")}>\r\n          <Col sm={3} className=\"py-2\">\r\n            {field.label}\r\n          </Col>\r\n          <Col>\r\n            <div className=\"py-2 pl-1 border-bottom\">{field.value}</div>\r\n          </Col>\r\n        </Row>\r\n      ))}\r\n    </>\r\n  )\r\n}\r\n\r\nexport default NotificationApplicationUserInfo\r\n","interface NotificationNameCellProps {\r\n  firstName: string\r\n  lastName: string\r\n}\r\nfunction NotificationNameCell({ firstName, lastName }: NotificationNameCellProps) {\r\n  return (\r\n    <>\r\n      {firstName && (\r\n        <span\r\n          className=\"d-inline-block mr-2\"\r\n          style={{ maxWidth: \"250px\", overflow: \"hidden\", textOverflow: \"ellipsis\" }}\r\n        >\r\n          {firstName}\r\n        </span>\r\n      )}\r\n      {firstName && (\r\n        <span className=\"d-inline-block\" style={{ maxWidth: \"250px\", overflow: \"hidden\", textOverflow: \"ellipsis\" }}>\r\n          {lastName}\r\n        </span>\r\n      )}\r\n    </>\r\n  )\r\n}\r\n\r\nexport default NotificationNameCell\r\n","import { memo, useCallback } from \"react\"\r\n\r\nimport { Form } from \"react-bootstrap\"\r\n\r\nimport NotificationNameCell from \"./NotificationNameCell\"\r\nimport NotificationApplicationUserData from \"../../../api/Randoms/Notification/NotificationApplicationUserData\"\r\nimport FormatPhone from \"../../../formatters/FormatPhone\"\r\n\r\ninterface NotificationApplicationUsersGridRowProps {\r\n  user: NotificationApplicationUserData\r\n  selectUser: (user: number[], checked: boolean) => void\r\n}\r\n\r\nfunction NotificationApplicationUsersGridRow({ user, selectUser }: NotificationApplicationUsersGridRowProps) {\r\n  const { ApplicationUserID, UserName, FirstName, LastName, Email, Phone, selected } = user\r\n\r\n  const handleChange = useCallback(\r\n    (e: React.ChangeEvent<HTMLInputElement>) => {\r\n      selectUser([ApplicationUserID], e.target.checked)\r\n    },\r\n    [ApplicationUserID, selectUser]\r\n  )\r\n\r\n  const formattedPhone = Phone ? FormatPhone(Phone) : null\r\n\r\n  return (\r\n    <tr>\r\n      <td className=\"justify-content-center align-middle\">\r\n        <Form.Check\r\n          type=\"radio\"\r\n          name=\"random-notification-contact\"\r\n          id={`rau_${ApplicationUserID}`}\r\n          className=\"abc-radio d-flex justify-content-center align-middle\"\r\n          value={ApplicationUserID}\r\n          label=\"\"\r\n          checked={selected}\r\n          disabled={!Email && !Phone}\r\n          onChange={handleChange}\r\n        />\r\n      </td>\r\n      <td>{UserName}</td>\r\n      <td>\r\n        <NotificationNameCell firstName={FirstName} lastName={LastName} />\r\n      </td>\r\n      <td>{Email}</td>\r\n      <td>{formattedPhone}</td>\r\n    </tr>\r\n  )\r\n}\r\n\r\nexport default memo(NotificationApplicationUsersGridRow)\r\n","import { useCallback, useEffect, useMemo, useState } from \"react\"\r\n\r\nimport { BehaviorSubject, concat, of } from \"rxjs\"\r\nimport { catchError, distinctUntilChanged, map, switchMap } from \"rxjs/operators\"\r\n\r\nimport NotificationApplicationUserData from \"./NotificationApplicationUserData\"\r\nimport NotificationApplicationUsersGridData from \"./NotificationApplicationUsersGridData\"\r\nimport NotificationApplicationUsersSearchParams from \"./NotificationApplicationUsersSearchParams\"\r\nimport { GetNotificationApplicationUsersObservable } from \"./NotificationContactsProcess\"\r\nimport handleAPIError from \"../../../utils/handleAPIError\"\r\nimport ApiResult from \"../../ApiResult\"\r\n\r\nconst PAGE_SIZE = 3\r\n\r\nfunction useNotificationApplicationUsersLoad(poolId: number) {\r\n  const [gridData, setGridData] = useState<NotificationApplicationUsersGridData>({\r\n    Records: [],\r\n    Pages: 0,\r\n    Total: 0,\r\n  })\r\n  const [loadingApplicationUsers, setLoadingApplicationUsers] = useState(false)\r\n\r\n  const initialSearchParams = useMemo(\r\n    () => ({\r\n      PoolId: poolId,\r\n      SearchFor: \"\",\r\n      SearchBy: \"\",\r\n      PageNumber: 1,\r\n      PageSize: PAGE_SIZE,\r\n    }),\r\n    [poolId]\r\n  )\r\n\r\n  const page$ = useMemo(\r\n    () => new BehaviorSubject<NotificationApplicationUsersSearchParams>(initialSearchParams),\r\n    [initialSearchParams]\r\n  )\r\n\r\n  const handleApiResponse = useCallback(\r\n    ({ loading, result, error }: ApiResult<NotificationApplicationUsersGridData>) => {\r\n      setLoadingApplicationUsers(loading)\r\n\r\n      if (!loading && result) {\r\n        const parsedRecords = result.Records.map((record: NotificationApplicationUserData) => ({\r\n          ...record,\r\n          selected: false,\r\n        }))\r\n\r\n        setGridData({\r\n          ...result,\r\n          Records: parsedRecords ?? [],\r\n          Pages: result.Pages ?? 0,\r\n          Total: result.Total ?? 0,\r\n        })\r\n      }\r\n\r\n      if (error) {\r\n        handleAPIError(error)\r\n      }\r\n    },\r\n    []\r\n  )\r\n\r\n  useEffect(() => {\r\n    const fetchApplicationUsers = (params: NotificationApplicationUsersSearchParams) => {\r\n      return concat(\r\n        of({ loading: true }),\r\n        GetNotificationApplicationUsersObservable(params).pipe(\r\n          map((result) => ({ loading: false, result })),\r\n          catchError((error) =>\r\n            of({\r\n              loading: false,\r\n              result: {\r\n                Records: [],\r\n                Pages: 0,\r\n                Total: 0,\r\n              },\r\n              error,\r\n            })\r\n          )\r\n        )\r\n      )\r\n    }\r\n\r\n    const subscription = page$\r\n      .pipe(distinctUntilChanged(), switchMap(fetchApplicationUsers))\r\n      .subscribe(handleApiResponse, (error) => handleAPIError(error, () => setLoadingApplicationUsers(false)))\r\n\r\n    return () => subscription.unsubscribe()\r\n  }, [page$, handleApiResponse])\r\n\r\n  const updateSearchParams = useCallback(\r\n    (updates: Partial<NotificationApplicationUsersSearchParams>) => {\r\n      page$.next({ ...page$.value, ...updates })\r\n    },\r\n    [page$]\r\n  )\r\n\r\n  const setPage = useCallback(\r\n    (page: number) => {\r\n      updateSearchParams({ PageNumber: page })\r\n    },\r\n    [updateSearchParams]\r\n  )\r\n\r\n  const searchApplicationUsers = useCallback(\r\n    (searchField: string, searchText: string) => {\r\n      updateSearchParams({ SearchFor: searchText, SearchBy: searchField, PageNumber: 1 })\r\n    },\r\n    [updateSearchParams]\r\n  )\r\n\r\n  const reloadApplicationUsers = useCallback(() => {\r\n    updateSearchParams({ PageNumber: 1 })\r\n  }, [updateSearchParams])\r\n\r\n  const updateSelectedUsers = useCallback((userIds: number[], checked: boolean, isSingleSelect = false) => {\r\n    setGridData((prev) => ({\r\n      ...prev,\r\n      Records: prev.Records?.map((c) =>\r\n        // eslint-disable-next-line no-nested-ternary\r\n        userIds.includes(c.ApplicationUserID)\r\n          ? { ...c, selected: checked }\r\n          : isSingleSelect\r\n            ? { ...c, selected: false }\r\n            : c\r\n      ),\r\n    }))\r\n  }, [])\r\n\r\n  const selectApplicationUsers = useCallback(\r\n    (userIds: number[], checked: boolean) => {\r\n      updateSelectedUsers(userIds, checked)\r\n    },\r\n    [updateSelectedUsers]\r\n  )\r\n\r\n  const selectOneApplicationUser = useCallback(\r\n    (userIds: number[], checked: boolean) => {\r\n      updateSelectedUsers(userIds, checked, true)\r\n    },\r\n    [updateSelectedUsers]\r\n  )\r\n\r\n  const selectedApplicationUsers = useMemo(() => gridData.Records.filter((c) => c.selected), [gridData])\r\n\r\n  return {\r\n    loadingApplicationUsers,\r\n    gridData,\r\n    selectedApplicationUsers,\r\n    pageNumber: page$.value.PageNumber,\r\n    setPage,\r\n    selectApplicationUsers,\r\n    selectOneApplicationUser,\r\n    reloadApplicationUsers,\r\n    searchApplicationUsers,\r\n  }\r\n}\r\n\r\nexport default useNotificationApplicationUsersLoad\r\n","import { useEffect } from \"react\"\r\n\r\nimport { Col, Row } from \"react-bootstrap\"\r\n\r\nimport NotificationApplicationUsersGridRow from \"./NotificationApplicationUsersGridRow\"\r\nimport NotificationApplicationUserData from \"../../../api/Randoms/Notification/NotificationApplicationUserData\"\r\nimport useNotificationApplicationUsersLoad from \"../../../api/Randoms/Notification/useNotificationApplicationUsersLoad\"\r\nimport LoadingTableBodyWrapper from \"../../LoadingTableBodyWrapper\"\r\nimport LoadingTableWrapper from \"../../LoadingTableWrapper\"\r\nimport SearchBar from \"../../SearchBar\"\r\nimport TablePagination from \"../../TablePagination\"\r\n\r\ninterface NotificationApplicationUsersGridProps {\r\n  poolId: number\r\n  onSelectUser: (user: NotificationApplicationUserData | null) => void\r\n}\r\n\r\nfunction NotificationApplicationUsersGrid({ poolId, onSelectUser }: NotificationApplicationUsersGridProps) {\r\n  const DEFAULT_SEARCH_FIELDS = [\r\n    { ID: \"All\", Name: \"All\" },\r\n    { ID: \"UserName\", Name: \"User Name\" },\r\n    { ID: \"FirstName\", Name: \"First Name\" },\r\n    { ID: \"LastName\", Name: \"Last Name\" },\r\n    { ID: \"Email\", Name: \"Email\" },\r\n    { ID: \"Phone\", Name: \"Phone Number\" },\r\n  ]\r\n\r\n  const {\r\n    gridData,\r\n    loadingApplicationUsers,\r\n    pageNumber,\r\n    setPage,\r\n    searchApplicationUsers,\r\n    selectOneApplicationUser,\r\n    selectedApplicationUsers,\r\n  } = useNotificationApplicationUsersLoad(poolId)\r\n\r\n  useEffect(() => {\r\n    onSelectUser(selectedApplicationUsers[0] || null)\r\n  }, [selectedApplicationUsers, onSelectUser])\r\n\r\n  return (\r\n    <>\r\n      <SearchBar\r\n        defaultField={DEFAULT_SEARCH_FIELDS[0]}\r\n        resetButton\r\n        variant=\"full-width\"\r\n        onSearch={searchApplicationUsers}\r\n        searchFields={DEFAULT_SEARCH_FIELDS}\r\n        loading={loadingApplicationUsers}\r\n      />\r\n      <LoadingTableWrapper loading={loadingApplicationUsers} variant=\"light\" withHeader>\r\n        <table className=\"table table-bordered table-responsive mt-2\">\r\n          <thead className=\"thead-light text-nowrap text-uppercase\">\r\n            <tr>\r\n              <th className=\"text-center col-auto px-0\">&nbsp;</th>\r\n              <th>User Name</th>\r\n              <th>Name</th>\r\n              <th className=\"col-2\">Email address</th>\r\n              <th className=\"col-1\">Phone number</th>\r\n            </tr>\r\n          </thead>\r\n          <tbody className=\"bg-light\">\r\n            <LoadingTableBodyWrapper\r\n              loading={loadingApplicationUsers}\r\n              recordsCount={gridData?.Records?.length || 0}\r\n              columnsCount={5}\r\n              noDataText=\"No available users found\"\r\n            >\r\n              {gridData?.Records?.map((record) => (\r\n                <NotificationApplicationUsersGridRow\r\n                  key={`au_${record.ApplicationUserID}_${record.RoleID}`}\r\n                  user={record}\r\n                  selectUser={selectOneApplicationUser}\r\n                />\r\n              ))}\r\n            </LoadingTableBodyWrapper>\r\n          </tbody>\r\n        </table>\r\n      </LoadingTableWrapper>\r\n      {gridData?.Total > 0 && (\r\n        <Row>\r\n          <Col sm={2}>Total records: {gridData.Total}</Col>\r\n          <Col>\r\n            <TablePagination pageNumber={pageNumber} pages={gridData.Pages || 0} onChange={setPage} className=\"mb-0\" />\r\n          </Col>\r\n        </Row>\r\n      )}\r\n    </>\r\n  )\r\n}\r\n\r\nexport default NotificationApplicationUsersGrid\r\n","import { useMemo } from \"react\"\r\n\r\nimport { Badge } from \"react-bootstrap\"\r\n\r\nimport SelectableItem from \"../../../api/SelectableItem\"\r\n\r\ninterface NotificationEditTabTitleProps {\r\n  title: string\r\n  icon?: JSX.Element\r\n  items: Record<number, SelectableItem>\r\n}\r\nfunction NotificationEditTabTitle({ title, icon = undefined, items }: NotificationEditTabTitleProps) {\r\n  const values = useMemo(() => Object.values(items || {}), [items])\r\n  const selectedCount = useMemo(() => values.filter((v) => v.selected).length, [values])\r\n\r\n  const badgeVariant = selectedCount === 0 ? \"required\" : \"light\"\r\n  const badgeTitle = selectedCount > 0 ? \"\" : \"Required at least one.\"\r\n  const badgeContent = `${selectedCount}/${values.length}`\r\n\r\n  return (\r\n    <>\r\n      {icon}\r\n      <span className=\"initialism px-1 pr-2\">{title}</span>\r\n      <Badge variant={badgeVariant} title={badgeTitle}>\r\n        {badgeContent}\r\n      </Badge>\r\n    </>\r\n  )\r\n}\r\n\r\nexport default NotificationEditTabTitle\r\n","import * as React from \"react\"\r\n\r\ninterface ToggleSwitchProps {\r\n  on?: string\r\n  off?: string\r\n  className?: string\r\n  checked?: boolean\r\n  disabled?: boolean\r\n  onCheck(checked: boolean): void\r\n}\r\n\r\nexport default class ToggleSwitch extends React.PureComponent<ToggleSwitchProps> {\r\n  render() {\r\n    const className = `switch ${ this.props.className || \"\" }`\r\n    return (\r\n      <label className={ className }>\r\n        <input type=\"checkbox\" checked={ this.props.checked } disabled={ this.props.disabled } onChange={ e => this.props.onCheck(e.target.checked) } />\r\n        <span className=\"slider round\">\r\n          <span className=\"on\">{ this.props.on || \"On\" }</span>\r\n          <span className=\"off\">{ this.props.off || \"Off\" }</span>\r\n        </span>\r\n      </label>\r\n    )\r\n  }\r\n}\r\n","import { Col, Form, Row, Spinner } from \"react-bootstrap\"\r\n\r\nimport NotificationEvent from \"../../../api/Randoms/Notification/NotificationEvent\"\r\nimport ToggleSwitch from \"../../FormattedInputs/ToggleSwitch\"\r\n\r\ninterface NotificationMethodsTabProps {\r\n  loading?: boolean\r\n  events?: Record<string, NotificationEvent>\r\n  showTitle?: boolean\r\n  disabled?: boolean\r\n  onChange: (code: string, checked: boolean) => void\r\n}\r\n\r\nfunction NotificationEventsTab({\r\n  loading = false,\r\n  events = {},\r\n  showTitle = false,\r\n  disabled = false,\r\n  onChange,\r\n}: NotificationMethodsTabProps) {\r\n  return (\r\n    <>\r\n      {showTitle && <h5>Reminders</h5>}\r\n      {loading && <Spinner animation=\"border\" variant=\"secondary\" className=\"mb-1\" />}\r\n      {!loading &&\r\n        Object.values(events || {})\r\n          .filter((e) => e.DisplayOrder > 0)\r\n          .map((event) => (\r\n            <Form.Group as={Row} className=\"mb-1\" key={event.Code}>\r\n              <Form.Label column sm={6} className=\"d-flex align-items-center\">\r\n                {event.Description}\r\n              </Form.Label>\r\n              <Col className=\"d-flex align-items-center\">\r\n                <ToggleSwitch\r\n                  on=\"Yes\"\r\n                  off=\"No\"\r\n                  className=\"mb-0\"\r\n                  checked={event.selected}\r\n                  onCheck={(checked) => onChange(event.Code, checked)}\r\n                  disabled={disabled}\r\n                />\r\n              </Col>\r\n            </Form.Group>\r\n          ))}\r\n    </>\r\n  )\r\n}\r\n\r\nexport default NotificationEventsTab\r\n","import { Col, Form, Row, Spinner } from \"react-bootstrap\"\r\n\r\nimport NotificationMethod from \"../../../api/Notifications/Model/NotificationMethod\"\r\nimport NotificationContactData from \"../../../api/Randoms/Notification/NotificationContactData\"\r\nimport ToggleSwitch from \"../../FormattedInputs/ToggleSwitch\"\r\n\r\ninterface NotificationMethodsTabProps {\r\n  loading?: boolean\r\n  methods?: Record<string, NotificationMethod>\r\n  contact?: NotificationContactData\r\n  showTitle?: boolean\r\n  onChange: (code: string, checked: boolean) => void\r\n}\r\n\r\nfunction NotificationMethodsTab({\r\n  loading = false,\r\n  methods = {},\r\n  contact = undefined,\r\n  showTitle = false,\r\n  onChange,\r\n}: NotificationMethodsTabProps) {\r\n  const disableMethod = (code: string) => {\r\n    switch (code.toUpperCase()) {\r\n      case \"EMAIL\":\r\n        return !contact?.Email\r\n      case \"TEXT\":\r\n        return !contact?.Phone\r\n      default:\r\n        return false\r\n    }\r\n  }\r\n\r\n  const methodText = {\r\n    EMAIL: \"Please provide an Email address for this method.\",\r\n    TEXT: \"Please provide a Phone number for this method.\",\r\n  } as Record<string, string>\r\n\r\n  return (\r\n    <>\r\n      {showTitle && <h5>How would you like to be notified?</h5>}\r\n      {loading && <Spinner animation=\"border\" variant=\"secondary\" className=\"mb-1\" />}\r\n      {!loading &&\r\n        Object.values(methods || {}).map((method) => (\r\n          <div key={method.Code}>\r\n            <Form.Group as={Row} className=\"mb-1\">\r\n              <Form.Label column sm={1} className=\"d-flex align-items-center\">\r\n                {method.Description}\r\n              </Form.Label>\r\n              <Col sm={2} className=\"d-flex align-items-center\">\r\n                <ToggleSwitch\r\n                  on=\"Yes\"\r\n                  off=\"No\"\r\n                  className=\"mb-0\"\r\n                  disabled={disableMethod(method.Code)}\r\n                  checked={method.selected}\r\n                  onCheck={(checked) => onChange(method.Code, checked)}\r\n                />\r\n              </Col>\r\n            </Form.Group>\r\n            <Form.Group as={Row} className=\"my-0\">\r\n              <Col>\r\n                <Form.Text as=\"span\" muted className=\"small\" style={{ position: \"relative\", top: \"-10px\" }}>\r\n                  {methodText[method.Code]}\r\n                </Form.Text>\r\n              </Col>\r\n            </Form.Group>\r\n          </div>\r\n        ))}\r\n    </>\r\n  )\r\n}\r\n\r\nexport default NotificationMethodsTab\r\n","enum NotificationMode {\r\n  AUTOMATIC = 1,\r\n  MANUAL = 2,\r\n}\r\n\r\nexport type NotificationModeType = keyof typeof NotificationMode\r\n\r\nexport const NotificationModes = (Object.keys(NotificationMode) as NotificationModeType[]).filter(\r\n  (key) => typeof NotificationMode[key] === \"number\"\r\n)\r\nexport default NotificationMode\r\n","import { useContext } from \"react\"\r\n\r\nimport { NotificationContactsContext } from \"../../../components/Randomization/Notification/NotificationContactsProvider\"\r\n\r\nexport const useNotificationContacts = () => {\r\n  const notificationContactsContext = useContext(NotificationContactsContext)\r\n\r\n  if (!notificationContactsContext) {\r\n    throw new Error(\"useNotificationContacts must be used within a NotificationContactsProvider\")\r\n  }\r\n\r\n  return notificationContactsContext\r\n}\r\n","import { useContext } from \"react\"\r\n\r\nimport { NotificationContactsActionsContext } from \"../../../components/Randomization/Notification/NotificationContactsProvider\"\r\n\r\nexport const useNotificationContactsActions = () => {\r\n  const notificationContactsActionsContext = useContext(NotificationContactsActionsContext)\r\n\r\n  if (!notificationContactsActionsContext) {\r\n    throw new Error(\"useNotificationContacts must be used within a NotificationContactsActionsProvider\")\r\n  }\r\n\r\n  return notificationContactsActionsContext\r\n}\r\n","import { useCallback, useState } from \"react\"\r\n\r\nimport { toast } from \"react-toastify\"\r\nimport { concat, of } from \"rxjs\"\r\nimport { catchError, finalize, map } from \"rxjs/operators\"\r\n\r\nimport NotificationContactData from \"./NotificationContactData\"\r\nimport { SaveNotificationContactObservable } from \"./NotificationContactsProcess\"\r\nimport FormatError from \"../../../formatters/FormatError\"\r\nimport handleAPIError from \"../../../utils/handleAPIError\"\r\nimport ApiResult from \"../../ApiResult\"\r\n\r\n/**\r\n * Hook to handle saving a notification contact.\r\n *\r\n * @param {((result?: T) => void) | undefined} callback - A callback to be called when the request is finished.\r\n *  The callback will receive the request result as an argument if the request was successful.\r\n * @returns {{ saving: boolean, error: string, result: T | undefined, submitContact: (params: NotificationContactData) => void }}\r\n *   An object with the following properties:\r\n *   - saving: A boolean indicating if the request is in progress.\r\n *   - error: An error message if the request failed.\r\n *   - result: The result of the request if it was successful.\r\n *   - submitContact: A function to submit the request.\r\n */\r\nfunction useNotificationContactSave<T>(callback?: (result?: T) => void): {\r\n  saving: boolean\r\n  error: string\r\n  result: T | undefined\r\n  submitContact: (params: NotificationContactData) => void\r\n} {\r\n  const [saving, setSaving] = useState(false)\r\n  const [error, setError] = useState<string>(\"\")\r\n  const [result, setResult] = useState<T | undefined>(undefined)\r\n\r\n  const submitContact = useCallback(\r\n    (params: NotificationContactData) => {\r\n      setSaving(true)\r\n      setResult(undefined)\r\n      setError(\"\")\r\n\r\n      const observable = concat(\r\n        of({ loading: true }),\r\n        SaveNotificationContactObservable(params).pipe(\r\n          map((res) => {\r\n            return { loading: false, result: res } as unknown as ApiResult<T>\r\n          }),\r\n          catchError((err) => {\r\n            setError(FormatError(err))\r\n            handleAPIError(err)\r\n            return of({ loading: false, result: undefined, error: err })\r\n          }),\r\n          finalize(() => {\r\n            setSaving(false)\r\n            if (!error) {\r\n              callback?.(result)\r\n            }\r\n          })\r\n        )\r\n      )\r\n\r\n      const subscription = observable.subscribe(({ loading, result }: ApiResult<T>) => {\r\n        setSaving(loading)\r\n        if (!loading && result) {\r\n          setResult(result)\r\n          toast.success(result)\r\n        }\r\n      })\r\n\r\n      return () => subscription.unsubscribe()\r\n    },\r\n    [callback, error, result]\r\n  )\r\n\r\n  return { saving, error, result, submitContact }\r\n}\r\n\r\nexport default useNotificationContactSave\r\n","import { useCallback, useEffect, useMemo, useState } from \"react\"\r\n\r\nimport { finalize } from \"rxjs/operators\"\r\n\r\nimport { GetNotificationEventsObservable } from \"./NotificationContactsProcess\"\r\nimport NotificationEvent from \"./NotificationEvent\"\r\nimport handleAPIError from \"../../../utils/handleAPIError\"\r\n\r\n/**\r\n * Custom hook to manage notification events.\r\n *\r\n * @param {NotificationEvent[]} selectedEvents - The initially selected notification events.\r\n * @returns {[boolean, Record<string, NotificationEvent>, React.Dispatch<React.SetStateAction<Record<string, NotificationEvent>>>, () => void]}\r\n *   An array containing:\r\n *   - loading: A boolean indicating if the data is being loaded.\r\n *   - events: A record of notification events.\r\n *   - setEvents: A function to update the events state.\r\n *   - resetEventsSelection: A function to reset the selection state of events.\r\n */\r\nfunction useNotificationEvents(\r\n  selectedEvents: NotificationEvent[] = []\r\n): [\r\n  loading: boolean,\r\n  events: Record<string, NotificationEvent>,\r\n  setEvents: React.Dispatch<React.SetStateAction<Record<string, NotificationEvent>>>,\r\n  resetEventsSelection: () => void,\r\n] {\r\n  const [loading, setLoading] = useState(false)\r\n  const [events, setEvents] = useState<Record<string, NotificationEvent>>({})\r\n\r\n  useEffect(() => {\r\n    setLoading(true)\r\n    const subscription = GetNotificationEventsObservable()\r\n      .pipe(finalize(() => setLoading(false)))\r\n      .subscribe({\r\n        next: (data) => {\r\n          setEvents(\r\n            data.reduce<Record<string, NotificationEvent>>((acc, event) => {\r\n              acc[event.Code] = {\r\n                ...event,\r\n                selected: selectedEvents.some(\r\n                  (selected) => selected.RandomNotificationEventID === event.RandomNotificationEventID\r\n                ),\r\n              }\r\n              return acc\r\n            }, {})\r\n          )\r\n        },\r\n        error: handleAPIError,\r\n      })\r\n\r\n    return () => subscription.unsubscribe()\r\n  }, [selectedEvents])\r\n\r\n  /**\r\n   * Reset the selection state of all events to false.\r\n   */\r\n  const resetEventsSelection = useCallback(() => {\r\n    setEvents((prev) => {\r\n      const updatedEvents = Object.entries(prev).reduce<Record<string, NotificationEvent>>((acc, [key, event]) => {\r\n        acc[key] = { ...event, selected: false }\r\n        return acc\r\n      }, {})\r\n      return updatedEvents\r\n    })\r\n  }, [])\r\n\r\n  return useMemo(\r\n    () => [loading, events, setEvents, resetEventsSelection],\r\n    [loading, events, setEvents, resetEventsSelection]\r\n  )\r\n}\r\n\r\nexport default useNotificationEvents\r\n","import { useCallback, useEffect, useMemo, useState } from \"react\"\r\n\r\nimport { finalize } from \"rxjs/operators\"\r\n\r\nimport { GetNotificationMethodsObservable } from \"./NotificationContactsProcess\"\r\nimport handleAPIError from \"../../../utils/handleAPIError\"\r\nimport NotificationMethod from \"../../Notifications/Model/NotificationMethod\"\r\n\r\n/**\r\n * Custom hook to manage notification methods.\r\n *\r\n * @param {NotificationMethod[]} selectedMethods - The initially selected notification methods.\r\n * @returns {[boolean, Record<string, NotificationMethod>, React.Dispatch<React.SetStateAction<Record<string, NotificationMethod>>>, () => void]}\r\n *   An array containing:\r\n *   - loading: A boolean indicating if the data is being loaded.\r\n *   - methods: A record of notification methods.\r\n *   - setMethods: A function to update the methods state.\r\n *   - resetMethodsSelection: A function to reset the selection state of methods.\r\n */\r\nfunction useNotificationMethods(\r\n  selectedMethods: NotificationMethod[] = []\r\n): [\r\n  loading: boolean,\r\n  methods: Record<string, NotificationMethod>,\r\n  setMethods: React.Dispatch<React.SetStateAction<Record<string, NotificationMethod>>>,\r\n  resetMethodsSelection: () => void,\r\n] {\r\n  const [loading, setLoading] = useState(false)\r\n  const [methods, setMethods] = useState<Record<string, NotificationMethod>>({})\r\n\r\n  useEffect(() => {\r\n    setLoading(true)\r\n    const subscription = GetNotificationMethodsObservable()\r\n      .pipe(finalize(() => setLoading(false)))\r\n      .subscribe({\r\n        next: (data) => {\r\n          const methodMap = data.reduce<Record<string, NotificationMethod>>((acc, method) => {\r\n            acc[method.Code] = {\r\n              ...method,\r\n              selected: selectedMethods.some(\r\n                (selectedMethod) => selectedMethod.NotificationMethodID === method.NotificationMethodID\r\n              ),\r\n            }\r\n            return acc\r\n          }, {})\r\n          setMethods(methodMap)\r\n        },\r\n        error: handleAPIError,\r\n      })\r\n\r\n    return () => subscription.unsubscribe()\r\n  }, [selectedMethods])\r\n\r\n  /**\r\n   * Reset the selection state of all methods to false.\r\n   */\r\n  const resetMethodsSelection = useCallback(() => {\r\n    setMethods((prev) => {\r\n      const updatedMethods = Object.entries(prev).reduce<Record<string, NotificationMethod>>((acc, [key, method]) => {\r\n        acc[key] = { ...method, selected: false }\r\n        return acc\r\n      }, {})\r\n      return updatedMethods\r\n    })\r\n  }, [])\r\n\r\n  return useMemo(\r\n    () => [loading, methods, setMethods, resetMethodsSelection],\r\n    [loading, methods, setMethods, resetMethodsSelection]\r\n  )\r\n}\r\n\r\nexport default useNotificationMethods\r\n","import { useCallback, useMemo, useState } from \"react\"\r\n\r\nimport { Alert, Button, Col, Container, Form, Modal, Row, Tab, Tabs } from \"react-bootstrap\"\r\nimport { FaRegBell, FaRegEnvelope } from \"react-icons/fa\"\r\n\r\nimport NotificationApplicationUserInfo from \"./NotificationApplicationUserInfo\"\r\nimport NotificationApplicationUsersGrid from \"./NotificationApplicationUsersGrid\"\r\nimport NotificationEditTabTitle from \"./NotificationEditTabTitle\"\r\nimport NotificationEventsTab from \"./NotificationEventsTab\"\r\nimport NotificationMethodsTab from \"./NotificationMethodsTab\"\r\nimport NotificationApplicationUserData from \"../../../api/Randoms/Notification/NotificationApplicationUserData\"\r\nimport NotificationContactData from \"../../../api/Randoms/Notification/NotificationContactData\"\r\nimport NotificationEvent from \"../../../api/Randoms/Notification/NotificationEvent\"\r\nimport NotificationMode, { NotificationModes } from \"../../../api/Randoms/Notification/NotificationMode\"\r\nimport { useNotificationContacts } from \"../../../api/Randoms/Notification/useNotificationContacts\"\r\nimport { useNotificationContactsActions } from \"../../../api/Randoms/Notification/useNotificationContactsActions\"\r\nimport useNotificationContactSave from \"../../../api/Randoms/Notification/useNotificationContactSave\"\r\nimport useNotificationEvents from \"../../../api/Randoms/Notification/useNotificationEvents\"\r\nimport useNotificationMethods from \"../../../api/Randoms/Notification/useNotificationMethods\"\r\nimport ActionButton from \"../../ActionButton\"\r\n\r\ninterface NotificationContactEditModalProps {\r\n  contact?: NotificationContactData | null | undefined\r\n  onHide?: () => void\r\n}\r\n\r\nenum TabKey {\r\n  METHODS = \"methods\",\r\n  EVENTS = \"events\",\r\n}\r\n\r\nfunction NotificationContactEditModal({ contact = undefined, onHide = undefined }: NotificationContactEditModalProps) {\r\n  const { poolId } = useNotificationContacts()\r\n  const { reloadContacts } = useNotificationContactsActions()\r\n\r\n  const initialContact = useMemo(\r\n    () =>\r\n      contact || {\r\n        PoolID: poolId,\r\n        ContactID: 0,\r\n        ApplicationUserID: 0,\r\n        UserName: \"\",\r\n        Email: \"\",\r\n        FirstName: \"\",\r\n        LastName: \"\",\r\n        Phone: \"\",\r\n        NotificationMode: NotificationMode.AUTOMATIC,\r\n        NotificationMethods: [],\r\n        NotificationEvents: [],\r\n      },\r\n    [contact, poolId]\r\n  )\r\n\r\n  const [notificationContact, setNotificationContact] = useState(initialContact)\r\n\r\n  const {\r\n    ContactID,\r\n    ApplicationUserID,\r\n    UserName,\r\n    Email,\r\n    FirstName,\r\n    LastName,\r\n    Phone,\r\n    NotificationMode: Mode,\r\n    NotificationMethods: Methods,\r\n    NotificationEvents: Events,\r\n  } = notificationContact\r\n\r\n  const [loadingMethods, methods, setMethods, resetMethodsSelection] = useNotificationMethods(Methods)\r\n  const [loadingEvents, events, setEvents, resetEventsSelection] = useNotificationEvents(Events)\r\n  const [tabKey, setTabKey] = useState(Mode === NotificationMode.MANUAL ? TabKey.METHODS : TabKey.EVENTS)\r\n  const [showAlert, setShowAlert] = useState(false)\r\n\r\n  const onContactSavedSuccessfully = useCallback(() => {\r\n    reloadContacts()\r\n    if (!loadingMethods && !loadingEvents) {\r\n      onHide?.()\r\n    }\r\n  }, [onHide, reloadContacts, loadingMethods, loadingEvents])\r\n\r\n  const { saving: savingContact, submitContact } = useNotificationContactSave<string>(onContactSavedSuccessfully)\r\n\r\n  const isMethodsValid = () => {\r\n    return Object.values(methods).some((m) => m.selected)\r\n  }\r\n\r\n  const isEventsValid = () => {\r\n    return (\r\n      Mode === NotificationMode.MANUAL ||\r\n      (Mode === NotificationMode.AUTOMATIC && Object.values(events).some((e) => e.selected))\r\n    )\r\n  }\r\n  const isFormValid = () => {\r\n    return ApplicationUserID > 0 && isMethodsValid() && isEventsValid()\r\n  }\r\n\r\n  const shouldShowAlert = () => {\r\n    return ApplicationUserID === 0 || !isMethodsValid() || !isEventsValid()\r\n  }\r\n\r\n  const handleSaveContact = (event: React.FormEvent) => {\r\n    event.preventDefault()\r\n    if (isFormValid()) {\r\n      submitContact({\r\n        ...notificationContact,\r\n        NotificationMethods: Object.values(methods),\r\n        NotificationEvents: Object.values(events),\r\n      })\r\n    } else {\r\n      setShowAlert(shouldShowAlert)\r\n    }\r\n  }\r\n\r\n  const handleSelectApplicationUser = useCallback(\r\n    (user: NotificationApplicationUserData | null) => {\r\n      setNotificationContact((prev) => ({\r\n        ...prev,\r\n        ...(user ?? initialContact),\r\n      }))\r\n      if (!user) {\r\n        resetEventsSelection()\r\n        resetMethodsSelection()\r\n      }\r\n    },\r\n    [initialContact, resetEventsSelection, resetMethodsSelection]\r\n  )\r\n\r\n  const handleChangeNotificationMethods = useCallback(\r\n    (code: string, checked: boolean) => {\r\n      setMethods((prev) => ({ ...prev, [code]: { ...prev[code], selected: checked } }))\r\n      setShowAlert(false)\r\n    },\r\n    [setMethods]\r\n  )\r\n\r\n  const handleChangeNotificationEvents = useCallback(\r\n    (code: string, checked: boolean) => {\r\n      setEvents((prev) => ({ ...prev, [code]: { ...prev[code], selected: checked } }))\r\n      setShowAlert(false)\r\n    },\r\n    [setEvents]\r\n  )\r\n\r\n  const handleChangeNotificationMode = useCallback(\r\n    (event: React.ChangeEvent<HTMLInputElement>) => {\r\n      const notificationModeValue = Number(event.target.value)\r\n      setNotificationContact((prev) => {\r\n        if (prev.NotificationMode !== notificationModeValue) {\r\n          return {\r\n            ...prev,\r\n            NotificationMode: notificationModeValue,\r\n            NotificationEvents:\r\n              notificationModeValue === NotificationMode.MANUAL ? [events.MANUAL_ROSTER_REMINDER] : [],\r\n          }\r\n        }\r\n        return prev\r\n      })\r\n\r\n      if (notificationModeValue === NotificationMode.MANUAL) {\r\n        // Switch to the Notification Methods tab.\r\n        setTabKey(TabKey.METHODS)\r\n\r\n        // Reset selected status for events without using Object.fromEntries\r\n        const newEvents = Object.entries(events).reduce((acc: Record<string, NotificationEvent>, [key, value]) => {\r\n          acc[key] = { ...value, selected: false }\r\n          return acc\r\n        }, {})\r\n\r\n        setEvents(newEvents)\r\n      } else if (notificationModeValue === NotificationMode.AUTOMATIC) {\r\n        // Switch to the Notification Methods tab.\r\n        setTabKey(TabKey.EVENTS)\r\n      }\r\n    },\r\n    [events, setEvents]\r\n  )\r\n\r\n  return (\r\n    <Modal backdrop=\"static\" size={ContactID === 0 ? \"xl\" : \"lg\"} centered show onHide={onHide}>\r\n      <Modal.Header closeButton>\r\n        <Modal.Title className=\"text-uppercase h5\">{`${ContactID ? \"Edit\" : \"Add\"} Notification Contact`}</Modal.Title>\r\n      </Modal.Header>\r\n      <Modal.Body>\r\n        <Alert variant=\"warning\" transition show={showAlert} onClose={() => setShowAlert(false)} dismissible>\r\n          <ul className=\"mb-0 pl-3\">\r\n            {notificationContact.ApplicationUserID === 0 && <li>User must be selected.</li>}\r\n            {Object.values(methods).every((m) => !m.selected) && (\r\n              <li>\r\n                At least one <span className=\"text-uppercase small\">notification method</span> must be selected.\r\n              </li>\r\n            )}\r\n            {Mode === NotificationMode.AUTOMATIC && Object.values(events).every((e) => !e.selected) && (\r\n              <li>\r\n                At least one <span className=\"text-uppercase small\">reminder</span> must be selected.\r\n              </li>\r\n            )}\r\n          </ul>\r\n        </Alert>\r\n        {ContactID === 0 && (\r\n          <NotificationApplicationUsersGrid poolId={poolId} onSelectUser={handleSelectApplicationUser} />\r\n        )}\r\n        {ContactID > 0 && (\r\n          <NotificationApplicationUserInfo\r\n            UserName={UserName}\r\n            FirstName={FirstName}\r\n            LastName={LastName}\r\n            Email={Email}\r\n            Phone={Phone}\r\n          />\r\n        )}\r\n        <Form.Group as={Row} className=\"mt-3\">\r\n          <Form.Label column sm={3}>\r\n            Notification Mode\r\n          </Form.Label>\r\n          <Col className=\"d-flex align-items-center\">\r\n            {NotificationModes.map((mode) => {\r\n              const modeValue = NotificationMode[mode]\r\n              return (\r\n                <Form.Check\r\n                  key={`nm-${mode}`}\r\n                  inline\r\n                  type=\"radio\"\r\n                  label={mode}\r\n                  name=\"notification-mode\"\r\n                  id={`nm-${mode}`}\r\n                  className=\"abc-radio small\"\r\n                  value={modeValue}\r\n                  onChange={handleChangeNotificationMode}\r\n                  checked={Mode === NotificationMode[mode]}\r\n                />\r\n              )\r\n            })}\r\n          </Col>\r\n        </Form.Group>\r\n        <Container className=\"tab-material\">\r\n          <Tabs activeKey={tabKey} onSelect={(k) => k && setTabKey(TabKey[k.toUpperCase() as keyof typeof TabKey])}>\r\n            {Mode === NotificationMode.AUTOMATIC && (\r\n              <Tab\r\n                eventKey={TabKey.EVENTS}\r\n                title={\r\n                  <NotificationEditTabTitle\r\n                    items={Object.values(events || []).filter((e) => e.DisplayOrder > 0)}\r\n                    title=\"Reminders\"\r\n                    icon={<FaRegBell className=\"small\" />}\r\n                  />\r\n                }\r\n                disabled={Mode !== NotificationMode.AUTOMATIC}\r\n              >\r\n                <NotificationEventsTab\r\n                  loading={loadingEvents}\r\n                  events={events}\r\n                  onChange={handleChangeNotificationEvents}\r\n                  disabled={ApplicationUserID === 0}\r\n                />\r\n              </Tab>\r\n            )}\r\n            <Tab\r\n              eventKey={TabKey.METHODS}\r\n              title={\r\n                <NotificationEditTabTitle\r\n                  items={methods}\r\n                  title=\"Notification Methods\"\r\n                  icon={<FaRegEnvelope className=\"small\" />}\r\n                />\r\n              }\r\n            >\r\n              <NotificationMethodsTab\r\n                loading={loadingMethods}\r\n                methods={methods}\r\n                contact={notificationContact}\r\n                onChange={handleChangeNotificationMethods}\r\n              />\r\n            </Tab>\r\n          </Tabs>\r\n        </Container>\r\n      </Modal.Body>\r\n      <Modal.Footer>\r\n        <Button variant=\"secondary\" disabled={savingContact || loadingMethods || loadingEvents} onClick={onHide}>\r\n          Cancel\r\n        </Button>\r\n        <ActionButton\r\n          variant=\"primary\"\r\n          onClick={handleSaveContact}\r\n          disabled={loadingMethods || loadingEvents}\r\n          spin={savingContact}\r\n          disableOnSpin\r\n        >\r\n          Submit\r\n        </ActionButton>\r\n      </Modal.Footer>\r\n    </Modal>\r\n  )\r\n}\r\n\r\nexport default NotificationContactEditModal\r\n","import React from \"react\"\r\n\r\nimport { Button, ButtonProps, Spinner } from \"react-bootstrap\"\r\n\r\ninterface ActionButtonProps extends ButtonProps {\r\n  spin?: boolean\r\n  disableOnSpin?: boolean\r\n  children?: React.ReactNode\r\n}\r\n\r\nfunction ActionIconButton({\r\n  spin = false,\r\n  disableOnSpin = false,\r\n  children = null,\r\n  className,\r\n  disabled,\r\n  ...buttonProps\r\n}: ActionButtonProps) {\r\n  const actualDisabled = disabled || (disableOnSpin && spin)\r\n  const actualClassName = `${className || \"\"} btn-icon-action`\r\n\r\n  return (\r\n    // eslint-disable-next-line react/jsx-props-no-spreading\r\n    <Button {...buttonProps} className={actualClassName} disabled={actualDisabled}>\r\n      {!spin ? children : <Spinner animation=\"border\" size=\"sm\" variant=\"link\" className=\"ml-1\" />}\r\n    </Button>\r\n  )\r\n}\r\n\r\nexport default ActionIconButton\r\n","import { memo, useCallback, useState } from \"react\"\r\n\r\nimport { FaPaperPlane, FaPencilAlt, FaTrashAlt } from \"react-icons/fa\"\r\n\r\nimport NotificationContactEditModal from \"./NotificationEditModal\"\r\nimport NotificationContactData from \"../../../api/Randoms/Notification/NotificationContactData\"\r\nimport { useNotificationContacts } from \"../../../api/Randoms/Notification/useNotificationContacts\"\r\nimport { useNotificationContactsActions } from \"../../../api/Randoms/Notification/useNotificationContactsActions\"\r\nimport ActionIconButton from \"../../ActionIconButton\"\r\nimport ConfirmationModal from \"../../ConfirmationModal\"\r\n\r\ninterface NotificationActionCellProps {\r\n  contact: NotificationContactData\r\n}\r\n\r\nfunction NotificationActionCell({ contact }: NotificationActionCellProps) {\r\n  const { ContactID, FirstName, LastName, NotificationMethods } = contact\r\n  const { poolId, deletingContacts, sendingNotifications } = useNotificationContacts()\r\n  const { deleteContacts, sendNotifications } = useNotificationContactsActions()\r\n  const [showDeleteConfirmation, setShowDeleteConfirmation] = useState(false)\r\n  const [showNotificationConfirmation, setShowNotificationConfirmation] = useState(false)\r\n  const [showContactForm, setShowContactForm] = useState(false)\r\n\r\n  const handleDelete = useCallback(() => {\r\n    deleteContacts(poolId, [contact])\r\n    setShowDeleteConfirmation(false)\r\n  }, [contact, deleteContacts, poolId])\r\n\r\n  const handleSend = useCallback(() => {\r\n    sendNotifications(poolId, [contact])\r\n    setShowNotificationConfirmation(false)\r\n  }, [contact, poolId, sendNotifications])\r\n\r\n  if (!contact) return null\r\n\r\n  return (\r\n    <>\r\n      <ActionIconButton variant=\"link\" onClick={() => setShowContactForm(true)} className=\"px-1 py-0\" disableOnSpin>\r\n        <FaPencilAlt title=\"Edit contact.\" />\r\n      </ActionIconButton>\r\n      <ActionIconButton\r\n        variant=\"link\"\r\n        onClick={() => setShowDeleteConfirmation(true)}\r\n        className=\"px-1 py-0\"\r\n        spin={deletingContacts[ContactID]}\r\n        disableOnSpin\r\n      >\r\n        <FaTrashAlt title=\"Delete contact.\" />\r\n      </ActionIconButton>\r\n      <ActionIconButton\r\n        variant=\"link\"\r\n        onClick={() => setShowNotificationConfirmation(true)}\r\n        className=\"px-1 py-0\"\r\n        spin={sendingNotifications[ContactID]}\r\n        disableOnSpin\r\n        disabled={(NotificationMethods?.length ?? 0) === 0}\r\n      >\r\n        <FaPaperPlane title=\"Send notification.\" />\r\n      </ActionIconButton>\r\n\r\n      <ConfirmationModal\r\n        show={showDeleteConfirmation}\r\n        title=\"CONFIRM REMOVE CONTACTS\"\r\n        textTitle={`Are you sure you want to remove \\n${FirstName} ${LastName} contact ?`}\r\n        onConfirm={handleDelete}\r\n        onHide={() => setShowDeleteConfirmation(false)}\r\n      />\r\n\r\n      <ConfirmationModal\r\n        show={showNotificationConfirmation}\r\n        title=\"CONFIRM SENDING NOTIFICATIONS\"\r\n        textTitle={`Are you sure you want to send notifications to contact \\n${FirstName} ${LastName} ?`}\r\n        onConfirm={handleSend}\r\n        onHide={() => setShowNotificationConfirmation(false)}\r\n      />\r\n\r\n      {showContactForm && <NotificationContactEditModal contact={contact} onHide={() => setShowContactForm(false)} />}\r\n    </>\r\n  )\r\n}\r\n\r\nexport default memo(NotificationActionCell)\r\n","import { ListGroup } from \"react-bootstrap\"\r\nimport { FaRegClock } from \"react-icons/fa\"\r\n\r\nimport NotificationEvent from \"../../../api/Randoms/Notification/NotificationEvent\"\r\n\r\ninterface NotificationEventsCellProps {\r\n  types: NotificationEvent[]\r\n}\r\n\r\nfunction NotificationEventsCell({ types }: NotificationEventsCellProps) {\r\n  return (\r\n    <>\r\n      {types?.length > 0 && (\r\n        <ListGroup>\r\n          {types.map((x) => (\r\n            <ListGroup.Item\r\n              key={`${x.Code}-icon-type`}\r\n              className=\"bg-transparent border-0 p-0 d-flex align-items-center\"\r\n            >\r\n              <FaRegClock className=\"text-notification mr-2\" />\r\n              <span className=\"d-inline-block text-truncate\" style={{ maxWidth: \"350px\" }}>\r\n                {x.Description}\r\n              </span>\r\n            </ListGroup.Item>\r\n          ))}\r\n        </ListGroup>\r\n      )}\r\n    </>\r\n  )\r\n}\r\n\r\nexport default NotificationEventsCell\r\n","import { ListGroup } from \"react-bootstrap\"\r\nimport { FaEnvelope, FaSms } from \"react-icons/fa\"\r\n\r\nimport NotificationMethod from \"../../../api/Notifications/Model/NotificationMethod\"\r\n\r\ninterface NotificationMethodCellProps {\r\n  methods: NotificationMethod[]\r\n}\r\n\r\nfunction NotificationMethodCell({ methods }: NotificationMethodCellProps) {\r\n  const getIconByCode = (code?: string) => {\r\n    switch (code) {\r\n      case \"EMAIL\":\r\n        return <FaEnvelope title=\"Enabled notification by Email.\" data-toggle=\"tooltip\" />\r\n      case \"TEXT\":\r\n        return <FaSms title=\"Enabled notification by SMS.\" data-toggle=\"tooltip\" />\r\n      default:\r\n        return null\r\n    }\r\n  }\r\n\r\n  return (\r\n    <>\r\n      {methods?.length > 0 && (\r\n        <ListGroup horizontal>\r\n          {methods.map((x) => (\r\n            <ListGroup.Item key={`${x.Code}-icon-method`} className=\"bg-transparent text-warning border-0 py-0 px-2\">\r\n              {getIconByCode(x.Code)}\r\n            </ListGroup.Item>\r\n          ))}\r\n        </ListGroup>\r\n      )}\r\n    </>\r\n  )\r\n}\r\n\r\nexport default NotificationMethodCell\r\n","import { memo } from \"react\"\r\n\r\nimport { Form } from \"react-bootstrap\"\r\n\r\nimport NotificationActionCell from \"./NotificationActionCell\"\r\nimport NotificationEventCell from \"./NotificationEventsCell\"\r\nimport NotificationMethodCell from \"./NotificationMethodsCell\"\r\nimport NotificationNameCell from \"./NotificationNameCell\"\r\nimport NotificationContactData from \"../../../api/Randoms/Notification/NotificationContactData\"\r\nimport NotificationMode from \"../../../api/Randoms/Notification/NotificationMode\"\r\nimport { useNotificationContactsActions } from \"../../../api/Randoms/Notification/useNotificationContactsActions\"\r\nimport FormatPhone from \"../../../formatters/FormatPhone\"\r\n\r\ninterface NotificationGridRowProps {\r\n  contact: NotificationContactData\r\n}\r\n\r\nfunction NotificationGridRow({ contact }: NotificationGridRowProps) {\r\n  const { selectContacts } = useNotificationContactsActions()\r\n  const { ContactID, selected, Email, Phone, NotificationMethods, NotificationEvents, NotificationMode: mode } = contact\r\n\r\n  const handleChange = (e: React.ChangeEvent<HTMLInputElement>) => {\r\n    selectContacts([Number(e.target.value)], e.target.checked)\r\n  }\r\n\r\n  return (\r\n    <tr>\r\n      <td>\r\n        <Form.Check\r\n          type=\"checkbox\"\r\n          name=\"random-notification-contact\"\r\n          id={`rnc_${ContactID}`}\r\n          className=\"abc-checkbox abc-checkbox-primary d-flex justify-content-center align-middle\"\r\n          value={ContactID}\r\n          label=\"\"\r\n          checked={selected}\r\n          readOnly\r\n          onChange={handleChange}\r\n        />\r\n      </td>\r\n      <td>\r\n        <NotificationNameCell firstName={contact.FirstName} lastName={contact.LastName} />\r\n      </td>\r\n      <td>{Email}</td>\r\n      <td>{FormatPhone(Phone)}</td>\r\n      <td>{NotificationMethods && <NotificationMethodCell methods={NotificationMethods} />}</td>\r\n      <td>{NotificationEvents && <NotificationEventCell types={NotificationEvents} />}</td>\r\n      <td className=\"text-center text-uppercase small\">{NotificationMode[mode]}</td>\r\n      <td>\r\n        <NotificationActionCell contact={contact} />\r\n      </td>\r\n    </tr>\r\n  )\r\n}\r\n\r\nexport default memo(NotificationGridRow)\r\n","import { memo } from \"react\"\r\n\r\nimport { Col, Row } from \"react-bootstrap\"\r\n\r\nimport NotificationGridRow from \"./NotificationGridRow\"\r\nimport NotificationContactData from \"../../../api/Randoms/Notification/NotificationContactData\"\r\nimport { useNotificationContacts } from \"../../../api/Randoms/Notification/useNotificationContacts\"\r\nimport { useNotificationContactsActions } from \"../../../api/Randoms/Notification/useNotificationContactsActions\"\r\nimport Checkbox from \"../../Checkbox\"\r\nimport LoadingTableBodyWrapper from \"../../LoadingTableBodyWrapper\"\r\nimport LoadingTableWrapper from \"../../LoadingTableWrapper\"\r\nimport TablePagination from \"../../TablePagination\"\r\n\r\nfunction NotificationGrid() {\r\n  const { loadingContacts, gridData } = useNotificationContacts()\r\n  const { page$, selectContacts } = useNotificationContactsActions()\r\n\r\n  const handleSelectAllContacts = (e: React.ChangeEvent<HTMLInputElement>) => {\r\n    const { checked } = e.target\r\n    const contactIds = gridData.Records.map((record: NotificationContactData) => record.ContactID)\r\n\r\n    selectContacts(contactIds, checked)\r\n  }\r\n\r\n  const isAllContactSelected = () => {\r\n    return (\r\n      gridData?.Records?.length > 0 && gridData?.Records.every((record: NotificationContactData) => record.selected)\r\n    )\r\n  }\r\n\r\n  const handleChangePage = (page: number) => {\r\n    page$.next({ ...page$.value, PageNumber: page })\r\n  }\r\n\r\n  return (\r\n    <LoadingTableWrapper loading={loadingContacts} variant=\"light\" withHeader>\r\n      <table className=\"table table-bordered table-responsive\">\r\n        <thead className=\"thead-light text-nowrap text-uppercase\">\r\n          <tr>\r\n            <th className=\"text-center col-auto px-0\">\r\n              <Checkbox\r\n                id=\"all_contacts\"\r\n                disabled={loadingContacts || (gridData?.Records?.length ?? 0) === 0}\r\n                checked={isAllContactSelected()}\r\n                onChange={handleSelectAllContacts}\r\n              />\r\n            </th>\r\n            <th>Name</th>\r\n            <th className=\"col-2\">Email address</th>\r\n            <th className=\"col-1\">Phone number</th>\r\n            <th className=\"text-center col-1\">Notify by</th>\r\n            <th className=\"col-3\">Notification types</th>\r\n            <th className=\"col-1 text-center\">Mode</th>\r\n            <th className=\"col-1 text-center\">Actions</th>\r\n          </tr>\r\n        </thead>\r\n        <tbody className=\"bg-light\">\r\n          <LoadingTableBodyWrapper\r\n            loading={loadingContacts}\r\n            recordsCount={gridData?.Records?.length || 0}\r\n            columnsCount={8}\r\n            noDataText=\"No contacts found\"\r\n          >\r\n            {gridData.Records.map((record: NotificationContactData) => (\r\n              <NotificationGridRow key={`nc_${record.ContactID}`} contact={record} />\r\n            ))}\r\n          </LoadingTableBodyWrapper>\r\n        </tbody>\r\n      </table>\r\n      {gridData?.Records?.length > 0 && (\r\n        <Row>\r\n          <Col sm={2}>Total records: {gridData.Total}</Col>\r\n          <Col>\r\n            <TablePagination pageNumber={page$.value.PageNumber} pages={gridData.Pages} onChange={handleChangePage} />\r\n          </Col>\r\n        </Row>\r\n      )}\r\n    </LoadingTableWrapper>\r\n  )\r\n}\r\n\r\nexport default memo(NotificationGrid)\r\n","import React from \"react\"\r\n\r\nimport { Button, ButtonProps, Spinner } from \"react-bootstrap\"\r\n\r\ninterface ActionButtonProps extends ButtonProps {\r\n  spin?: boolean\r\n  disableOnSpin?: boolean\r\n  children?: React.ReactNode\r\n  icon: React.ReactNode\r\n}\r\n\r\nfunction ActionButtonWithIcon({\r\n  spin = false,\r\n  disableOnSpin = false,\r\n  children = null,\r\n  icon,\r\n  className,\r\n  disabled,\r\n  ...buttonProps\r\n}: ActionButtonProps) {\r\n  const actualDisabled = disabled || (disableOnSpin && spin)\r\n  const actualClassName = `${className || \"\"} d-flex align-items-center`\r\n\r\n  return (\r\n    <Button {...buttonProps} className={actualClassName} disabled={actualDisabled}>\r\n      {!spin ? icon : <Spinner animation=\"border\" size=\"sm\" variant={buttonProps.variant} className=\"text-white\" />}\r\n      <span className=\"ml-1\">{children}</span>\r\n    </Button>\r\n  )\r\n}\r\n\r\nexport default ActionButtonWithIcon\r\n","import { useCallback, useState } from \"react\"\r\n\r\nimport { Col, Container, Row } from \"react-bootstrap\"\r\nimport { FaPaperPlane, FaUserMinus, FaUserPlus } from \"react-icons/fa\"\r\n\r\nimport NotificationContactEditModal from \"./NotificationEditModal\"\r\nimport NotificationGrid from \"./NotificationGrid\"\r\nimport { useNotificationContacts } from \"../../../api/Randoms/Notification/useNotificationContacts\"\r\nimport { useNotificationContactsActions } from \"../../../api/Randoms/Notification/useNotificationContactsActions\"\r\nimport ActionButtonWithIcon from \"../../ActionButtonWithIcon\"\r\nimport ConfirmationModal from \"../../ConfirmationModal\"\r\n\r\nfunction NotificationDetails() {\r\n  const { poolId, loadingContacts, deletingContacts, sendingNotifications, selectedContacts } =\r\n    useNotificationContacts()\r\n  const { deleteContacts, sendNotifications } = useNotificationContactsActions()\r\n\r\n  const [showContactForm, setShowContactForm] = useState(false)\r\n  const [showDeleteConfirmation, setShowDeleteConfirmation] = useState(false)\r\n  const [showSendNotificationConfirmation, setSendNotificationConfirmation] = useState(false)\r\n\r\n  const handleDeleteContacts = useCallback(() => {\r\n    deleteContacts(poolId, selectedContacts)\r\n    setShowDeleteConfirmation(false)\r\n  }, [poolId, deleteContacts, selectedContacts])\r\n\r\n  const handleSendNotifications = useCallback(() => {\r\n    sendNotifications(poolId, selectedContacts)\r\n    setSendNotificationConfirmation(false)\r\n  }, [poolId, sendNotifications, selectedContacts])\r\n\r\n  const isDeleting = () => {\r\n    return Object.values(deletingContacts).some((value) => value === true)\r\n  }\r\n\r\n  const isSending = () => {\r\n    return Object.values(sendingNotifications).some((value) => value === true)\r\n  }\r\n\r\n  const isNotificationPossible = () => {\r\n    return selectedContacts.some((contact) => contact?.NotificationMethods?.length > 0)\r\n  }\r\n\r\n  return (\r\n    <Container fluid className=\"grid-container pb-3\">\r\n      <Row>\r\n        <Col>\r\n          <h5>NOTIFICATION CONTACTS</h5>\r\n        </Col>\r\n        <Col className=\"d-flex justify-content-end align-items-center\">\r\n          <ActionButtonWithIcon\r\n            icon={<FaUserPlus />}\r\n            variant=\"secondary\"\r\n            disabled={loadingContacts}\r\n            onClick={() => setShowContactForm(true)}\r\n          >\r\n            ADD CONTACT\r\n          </ActionButtonWithIcon>\r\n        </Col>\r\n      </Row>\r\n      <Row>\r\n        <Col>\r\n          <NotificationGrid />\r\n        </Col>\r\n      </Row>\r\n      {showContactForm && <NotificationContactEditModal onHide={() => setShowContactForm(false)} />}\r\n      <Row className=\"buttons-block pr-0\">\r\n        <Col className=\"d-flex justify-content-end align-items-center\">\r\n          <ActionButtonWithIcon\r\n            icon={<FaUserMinus />}\r\n            variant=\"secondary\"\r\n            disabled={loadingContacts || (selectedContacts?.length ?? 0) === 0}\r\n            onClick={() => setShowDeleteConfirmation(true)}\r\n            spin={isDeleting()}\r\n            disableOnSpin\r\n            className=\"mr-1\"\r\n          >\r\n            DELETE CONTACTS\r\n          </ActionButtonWithIcon>\r\n          <ActionButtonWithIcon\r\n            icon={<FaPaperPlane />}\r\n            variant=\"primary\"\r\n            disabled={loadingContacts || !isNotificationPossible()}\r\n            onClick={() => setSendNotificationConfirmation(true)}\r\n            spin={isSending()}\r\n            disableOnSpin\r\n          >\r\n            SEND NOTIFICATIONS\r\n          </ActionButtonWithIcon>\r\n        </Col>\r\n      </Row>\r\n      <ConfirmationModal\r\n        show={showDeleteConfirmation}\r\n        title=\"CONFIRM REMOVE CONTACTS\"\r\n        textTitle={`Are you sure you want to remove \\n${selectedContacts?.length} contact(s)?`}\r\n        onConfirm={handleDeleteContacts}\r\n        onHide={() => setShowDeleteConfirmation(false)}\r\n      />\r\n      <ConfirmationModal\r\n        show={showSendNotificationConfirmation}\r\n        title=\"CONFIRM SENDING NOTIFICATIONS\"\r\n        textTitle={`Are you sure you want to send notifications \\n${selectedContacts?.length} to contact(s)?`}\r\n        onConfirm={handleSendNotifications}\r\n        onHide={() => setSendNotificationConfirmation(false)}\r\n      />\r\n    </Container>\r\n  )\r\n}\r\n\r\nexport default NotificationDetails\r\n","import NotificationContactsProvider from \"./NotificationContactsProvider\"\r\nimport NotificationDetails from \"./NotificationDetails\"\r\n\r\ninterface PoolNotificationsProps {\r\n  poolId: number\r\n}\r\n\r\nfunction PoolNotifications({ poolId }: PoolNotificationsProps) {\r\n  return (\r\n    <NotificationContactsProvider poolId={poolId}>\r\n      <NotificationDetails />\r\n    </NotificationContactsProvider>\r\n  )\r\n}\r\nexport default PoolNotifications\r\n","import * as React from \"react\"\r\nimport { Tab, Tabs, Row, Col, Modal } from \"react-bootstrap\"\r\nimport PoolGridRow from \"../../../api/Randoms/RandomsModel/PoolGridRow\"\r\nimport PoolStatistics from \"./PoolStatistics\"\r\nimport PoolGeneralInfo from \"./PoolGeneralInfo\"\r\nimport ImportPoolMembers from \"./ImportPoolMembers\"\r\nimport RunRandom from \"./RunRandom\"\r\nimport CloseProgramInterval from \"./CloseProgramInterval\"\r\nimport PoolMembersGrid from \"./PoolMembersGrid\"\r\nimport { AppState } from \"../../../AppState\"\r\nimport { connect } from \"react-redux\"\r\nimport { BuildUserAccess } from \"../../../authentication/BuildUserAccess\"\r\nimport { GetSelectedAssignedClinic, GetSelectedPortal } from \"../../../authentication/SelectedCompany/CompanySelectionDrivenSelectors\"\r\nimport { isCompanyAdmin, isPortalAdmin } from \"../../../authentication/isAdminRole\"\r\nimport PoolData from \"../../../api/Randoms/RandomsModel/PoolData\"\r\nimport { Subscription } from \"rxjs\"\r\nimport PoolGeneralInfoGetObservable from \"../../../api/Randoms/PoolGeneralInfoGet\"\r\nimport { toast } from \"react-toastify\"\r\nimport PoolHistory from \"./PoolHistory\"\r\nimport PoolNotifications from \"../Notification/PoolNotifications\"\r\n\r\nexport interface PoolDetailsModalProps {\r\n  details: PoolGridRow\r\n  onHide: () => void\r\n  isConsortium: boolean\r\n}\r\nexport interface PoolDetailsModalAppStateProps {\r\n  showRunRandom: boolean\r\n  showPersonnelImport: boolean\r\n  companyID: number\r\n  isCompanyAdmin?: boolean\r\n  isPortalAdmin?: boolean\r\n  unmaskDonorId: number\r\n\r\n}\r\n\r\ninterface PoolDetailsModalState {\r\n  currentTab: string\r\n  data?: PoolData\r\n}\r\n\r\nconst StatisticsKey = \"statistics\"\r\nconst HistoryKey = \"pool_history\"\r\nconst GeneralInformationKey = \"general_information\"\r\nconst PoolMembersKey = \"pool_members\"\r\nconst RunRandomKey = \"run_random\"\r\nconst CloseProgramIntervalKey = \"close_program_interval\"\r\nconst NotificationKey = \"notification\"\r\n\r\nexport class PoolDetailsModal extends React.PureComponent<PoolDetailsModalProps & PoolDetailsModalAppStateProps, PoolDetailsModalState> {\r\n  state: PoolDetailsModalState = {\r\n    currentTab: StatisticsKey\r\n  }\r\n\r\n  subscriptions = new Subscription()\r\n\r\n  componentDidMount() {\r\n    this.loadPoolData()\r\n  }\r\n\r\n  componentWillUnmount() {\r\n    this.subscriptions.unsubscribe()\r\n  }\r\n\r\n  loadPoolData = () => {\r\n    this.subscriptions.add(\r\n      PoolGeneralInfoGetObservable(this.props.details.PoolID).subscribe(\r\n        (data: PoolData) => this.setState({ data: data }),\r\n        (error: string) => toast.error(error)\r\n      ))\r\n  }\r\n\r\n  handleRunFinish = () => this.setState({ currentTab: StatisticsKey })\r\n\r\n  onPoolDetailsUpdate = () => {\r\n    this.setState({ data: undefined })\r\n    this.loadPoolData()\r\n  }\r\n\r\n  render() {\r\n    const { details, onHide, isConsortium, isCompanyAdmin, isPortalAdmin } = this.props\r\n    const limitedCons = isConsortium && isCompanyAdmin\r\n    // TODO: Some permissions are missed in AppState:\r\n    //          *userPermissions.CanRunRandoms\r\n    //          *userPermissions.CanUpdatePoolMembership\r\n    // const showRunRandom = userPermissions && (userPermissions.CanRunRandoms || userPermissions.CanManagePools)\r\n    // const showPersonnelImport = userPermissions && (userPermissions.CanManagePersonnel || userPermissions.CanUpdatePoolMembership)\r\n\r\n    return (\r\n      <Modal backdrop=\"static\" show={true} onHide={onHide} size=\"xl\" dialogClassName=\"modal-90w\">\r\n        <Modal.Header closeButton>\r\n          <Modal.Title>{isConsortium ? \"CONSORTIUM DETAILS\" : \"POOL DETAILS\"}</Modal.Title>\r\n        </Modal.Header>\r\n        <Modal.Body className=\"p-0\">\r\n          <div className=\"tab-container\">\r\n            <Row className=\"px-0 pt-2\">\r\n              <Col>\r\n                <h4 className=\"px-4\"><span className=\"text-uppercase\">{details.Name}</span> ({details.ID})</h4>\r\n                <Tabs defaultActiveKey={StatisticsKey} activeKey={this.state.currentTab} className=\"px-4 py-2\" onSelect={(eventKey) => { eventKey && this.setState({ currentTab: eventKey }) }}>\r\n                  <Tab eventKey={StatisticsKey} title=\"STATISTICS\">\r\n                    {StatisticsKey === this.state.currentTab && <PoolStatistics isConsortium={isConsortium} allowExcusedReport={isCompanyAdmin || isPortalAdmin || false} allowAuditReport={this.props.showRunRandom} currentCompany={this.props.companyID} poolId={details.PoolID} poolName={details.Name}  unmaskDonorId={this.props.unmaskDonorId}/>}\r\n                  </Tab>\r\n                  {!isConsortium && <Tab eventKey={HistoryKey} title=\"HISTORY\">\r\n                    {HistoryKey === this.state.currentTab && <PoolHistory isConsortium={isConsortium} allowExcusedReport={isCompanyAdmin || isPortalAdmin || false} currentCompany={this.props.companyID} poolId={details.PoolID} poolName={details.Name} />}\r\n                  </Tab>}\r\n                  {!limitedCons && <Tab eventKey={GeneralInformationKey} title=\"GENERAL INFORMATION\">\r\n                    {GeneralInformationKey === this.state.currentTab && !!this.state.data && <PoolGeneralInfo onPoolUpdate={this.onPoolDetailsUpdate} isConsortium={isConsortium} poolId={details.PoolID} poolData={this.state.data} isPortalAdmin={isPortalAdmin} />}\r\n                  </Tab>}\r\n                  <Tab eventKey={PoolMembersKey} title={isConsortium ? \"CONSORTIUM MEMBERS\" : \"POOL MEMBERS\"}>\r\n                    {PoolMembersKey === this.state.currentTab && <PoolMembersGrid onPoolUpdate={this.onPoolDetailsUpdate} isConsortium={isConsortium} isCompanyAdmin={isCompanyAdmin} poolID={details.PoolID} poolName={details.Name} regulated={details.Regulated} useFileImportForPoolMembership={this.state.data?.UseFileImportForPoolMembership || false} unmaskDonorId={this.props.unmaskDonorId}/>}\r\n                  </Tab>\r\n                  {this.props.showRunRandom && !limitedCons && <Tab eventKey={RunRandomKey} title=\"RUN RANDOM\">\r\n                    {RunRandomKey === this.state.currentTab && <RunRandom poolId={details.PoolID} poolName={details.Name} isCompanyAdmin={isCompanyAdmin} isPortalAdmin={isPortalAdmin} onRunFinish={this.handleRunFinish} />}\r\n                  </Tab>}\r\n                  {this.props.showPersonnelImport && !limitedCons && <Tab eventKey=\"personnel_import\" title=\"PERSONNEL IMPORT\">\r\n                    <ImportPoolMembers poolID={details.PoolID} poolPrimaryIDType={this.state.data?.PrimaryIDType} isConsortium={isConsortium} multiplePools={(this.props.isPortalAdmin && !isConsortium) || false} />\r\n                  </Tab>}\r\n                  {!limitedCons && <Tab eventKey={CloseProgramIntervalKey} title=\"CLOSE PROGRAM INTERVAL\">\r\n                    {CloseProgramIntervalKey === this.state.currentTab && !!this.state.data && <CloseProgramInterval poolId={details.PoolID} poolName={details.Name} poolData={this.state.data} onPoolUpdate={this.onPoolDetailsUpdate} />}\r\n                  </Tab>}\r\n                  {isPortalAdmin && !isConsortium && <Tab eventKey={NotificationKey} title=\"NOTIFICATION\">\r\n                    {NotificationKey === this.state.currentTab && <PoolNotifications poolId={details.PoolID} />}\r\n                  </Tab>}\r\n                </Tabs>\r\n              </Col>\r\n            </Row>\r\n          </div>\r\n        </Modal.Body>\r\n      </Modal>\r\n    )\r\n  }\r\n}\r\n\r\nfunction mapStateToProps(state: AppState): PoolDetailsModalAppStateProps {\r\n  const userAccess = BuildUserAccess(state)\r\n  const portal = GetSelectedPortal(state)\r\n  const unmaskDonorId = portal ? portal.UnmaskDonorID : 0\r\n  return {\r\n    showRunRandom: userAccess.canManagePools || userAccess.CanManageConsortiumPools,\r\n    showPersonnelImport: userAccess.canManagePersonnel || userAccess.CanManageConsortiumPools,\r\n    companyID: GetSelectedAssignedClinic(state)?.AccountID || 0,\r\n    isCompanyAdmin: isCompanyAdmin(state),\r\n    isPortalAdmin: isPortalAdmin(state),\r\n    unmaskDonorId: unmaskDonorId\r\n  }\r\n}\r\nconst ConnectedPoolDetailsModal = connect(mapStateToProps)(PoolDetailsModal)\r\nexport default ConnectedPoolDetailsModal\r\n","import { ObservableFromFetch } from \"../ObservableFromFetch\"\r\nimport PoolGridData from \"./RandomsModel/PoolGridData\"\r\nimport FormatDate from \"../../formatters/FormatDate\"\r\nimport { Filter, Sort } from \"../GridRequest\"\r\n\r\nexport function PoolGridGetObservable(pageNumber: number, pageSize: number, sort: Sort, filters: Filter[], search: { field: string, text: string }, isConsortium: boolean = false) {\r\n  const requestBody: string = JSON.stringify({\r\n    BatchPool: \"\",\r\n    BySel: search.field,\r\n    Filters: {\r\n      ID: filters.find(filter => filter.column === \"ID\")?.values || [],\r\n      Name: filters.find(filter => filter.column === \"Name\")?.values || [],\r\n      LastMemberImport: filters.find(filter => filter.column === \"LastUpdate\")?.values.map((value) => FormatDate(value)) || [],\r\n      LastSelection: filters.find(filter => filter.column === \"LastSelection\")?.values || [],\r\n      ReadyToRun: filters.find(filter => filter.column === \"ReadyToRunDate\")?.values || [],       // NOTE: this mapping matches 1.0\r\n      ReadyToRunDate: [],//filters.find(filter => filter.column === \"ReadyToRunDate\")?.values || [],\r\n      SelectionInterval: filters.find(filter => filter.column === \"SelectionInterval\")?.values || [],\r\n    },\r\n    MatchSel: \"Partial\",\r\n    PageNumber: pageNumber,\r\n    PageSize: pageSize,\r\n    SortGrid: { SortColumn: sort.column, SortOrder: sort.order.toUpperCase() === \"DESC\" ? \"DSC\" : sort.order.toUpperCase() },\r\n    SrchFor: search.text,\r\n    TypeSel: \"\",\r\n    IsConsortium: isConsortium\r\n  })\r\n\r\n  return ObservableFromFetch<PoolGridData>(\"RandomTest/GetPoolGrid\", requestBody)\r\n}\r\n\r\nexport function PoolGridCsvGet(filters: Filter[], search: { field: string, text: string }, isConsortium: boolean = false) {\r\n  const requestBody: string = JSON.stringify({\r\n    BatchPool: \"\",\r\n    BySel: search.field,\r\n    Filters: {\r\n      // Next 4 filters always empty in 1.0: in code we pass array but the array is never filled up\r\n      // 1.0 code: src\\app\\pages\\random-testing-pools\\random-testing-pools.component.ts, method \"exportCSV\":\r\n      // this.printMemberObj['Filters'].LastMemberImport = lastUpdateArray;\r\n      // this.printMemberObj['Filters'].LastSelection = this.selectedLastselectionsList;\r\n      // this.printMemberObj['Filters'].ReadyToRun = this.selectedReadytorunList;\r\n      // this.printMemberObj['Filters'].SelectionInterval = this.selectedIntervalList;\r\n      LastMemberImport: [],\r\n      LastSelection: [],\r\n      ReadyToRun: [],\r\n      SelectionInterval: []\r\n    },\r\n    MatchSel: \"Partial\",\r\n    SrchFor: search.text,\r\n    TypeSel: \"\",\r\n    IsConsortium: isConsortium\r\n  })\r\n\r\n  return ObservableFromFetch<string>(\"RandomTest/ExportRandomRecords\", requestBody)\r\n}\r\n\r\nexport function PoolGridPrint(values: number[], filters: { column: string, values: string[] }[], search: { field: string, text: string }, isConsortium: boolean = false) {\r\n  const requestBody: string = JSON.stringify({\r\n    ContactID: 0, // TODO: VALUESTORAGE.CONTACT_ID Verify parameter value\r\n    PoolID: values,\r\n    BatchPool: \"\",\r\n    BySel: search.field ? search.field : \"All\",\r\n    Filters: {\r\n      // Next 4 filters always empty in 1.0: in code we pass array but the array is never filled up\r\n      // 1.0 code: src\\app\\pages\\random-testing-pools\\random-testing-pools.component.ts, method \"actualPrintFunction\":\r\n      // this.printMemberObj['Filters'].LastMemberImport = lastUpdateArray;\r\n      // this.printMemberObj['Filters'].LastSelection = this.selectedLastselectionsList;\r\n      // this.printMemberObj['Filters'].ReadyToRun = this.selectedReadytorunList;\r\n      // this.printMemberObj['Filters'].SelectionInterval = this.selectedIntervalList;\r\n      LastMemberImport: [],\r\n      LastSelection: [],\r\n      ReadyToRun: [],\r\n      SelectionInterval: [],\r\n      // Next 3 filters always empty in 1.0 - pass them empty too\r\n      ReadyToRunDate: [],\r\n      ID: [],\r\n      Name: [],\r\n    },\r\n    MatchSel: \"Partial\",\r\n    SrchFor: search.text,\r\n    TypeSel: \"\",\r\n    IsConsortium: isConsortium\r\n  })\r\n  return ObservableFromFetch<string>(\"WorkforceRandomTest/PrintRandomRecords\", requestBody)\r\n}\r\n","import { Observable } from \"rxjs\"\r\nimport { ObservableFromFetch } from \"../ObservableFromFetch\"\r\n\r\nexport interface PoolReadyToRunItem {\r\n  PoolID: number\r\n  ReadyToRun: boolean\r\n}\r\n\r\nexport default function PoolReadyToRunUpdateObservable(list: PoolReadyToRunItem[]): Observable<string> {\r\n  const params: string = JSON.stringify({ ReadyToRunList: list })\r\n  return ObservableFromFetch<string>(\"RandomTest/UpdatePoolReadyToRun\", params)\r\n}\r\n","import React from \"react\"\r\nimport { Nav, TabContainer } from \"react-bootstrap\"\r\nimport { Link, withRouter } from \"react-router-dom\"\r\nimport { RouteComponentProps } from \"react-router\"\r\nimport { ConsortiumPersonnelRoute, ConsortiumsRoute, RandomsPersonnelRoute, RandomsRoute } from \"../../config/Routes\"\r\n\r\ninterface RandomNavProps extends RouteComponentProps {\r\n  canManagePools?: boolean\r\n  canManagePersonnel?: boolean\r\n  canManageConsortiumPools?: boolean\r\n  isConsortium: boolean\r\n}\r\n\r\nconst RandomLink = (props: {name: string, path: string, current: boolean}) => <Link className={`btn btn-sm ${props.current ? \"btn-primary\" : \"\"}`} to={{ pathname: props.path }}>{props.name}</Link>\r\n\r\nexport class RandomNav extends React.PureComponent<RandomNavProps> {\r\n  render() {\r\n    const props = this.props as RouteComponentProps\r\n    const path = props.location.pathname\r\n    return (\r\n      <TabContainer defaultActiveKey={path}>\r\n        {!this.props.isConsortium && <Nav variant=\"pills\" className=\"m-3\">\r\n          { this.props.canManagePools && <Nav.Item><RandomLink path={RandomsRoute} name=\"Pools\" current={path === RandomsRoute} /></Nav.Item> }\r\n          { this.props.canManagePersonnel && <Nav.Item><RandomLink path={RandomsPersonnelRoute} name=\"Personnel\" current={path === RandomsPersonnelRoute} /></Nav.Item> }\r\n        </Nav>}\r\n        {this.props.isConsortium && <Nav variant=\"pills\" className=\"m-3\">\r\n          { this.props.canManageConsortiumPools && <Nav.Item><RandomLink path={ConsortiumsRoute} name=\"Consortium Pools\" current={path === ConsortiumsRoute} /></Nav.Item> }\r\n          { this.props.canManageConsortiumPools && <Nav.Item><RandomLink path={ConsortiumPersonnelRoute} name=\"Consortium Personnel\" current={path === ConsortiumPersonnelRoute} /></Nav.Item> }\r\n        </Nav>}\r\n      </TabContainer>\r\n    )\r\n  }\r\n}\r\n\r\nexport default withRouter(RandomNav)\r\n","import React, { Component } from \"react\"\r\nimport { Button, Col, Container, Form, Modal, Row, Spinner, Table } from \"react-bootstrap\"\r\nimport ActionButton from \"../../ActionButton\"\r\nimport { RunCancelPoolsMessages } from \"../../../api/Randoms/RandomSelectionRun\"\r\n\r\nexport interface RunCancelNotificationModalProps {\r\n  notes: RunCancelPoolsMessages[]\r\n  loading: boolean\r\n  isConsortium: boolean\r\n  confirmationText: string\r\n  onSubmit: () => void\r\n  onHide: () => void\r\n}\r\n\r\nexport default class RunCancelNotificationModal extends Component<RunCancelNotificationModalProps> {\r\n\r\n  render() {\r\n    const { isConsortium, loading, onHide, confirmationText, notes, onSubmit } = this.props\r\n    const messageRow = (note: RunCancelPoolsMessages, index: number) => {\r\n      return <tr key={`notification_${index}`}>\r\n        <td>{note.PoolName}</td>\r\n        <td>{note.PoolCode}</td>\r\n        <td>{note.Message}</td>\r\n      </tr>\r\n    }\r\n    const showNotes = notes.length > 0\r\n\r\n    return (\r\n      <Modal backdrop=\"static\" size={ showNotes ? \"xl\" : \"sm\" } centered show dialogClassName={loading ? \"loading\" : \"\"}>\r\n        <Modal.Body>\r\n          {!showNotes && !loading && <Row><Col><p>{confirmationText}</p></Col></Row>}\r\n          {!showNotes && loading && <div className=\"text-center\"><Spinner animation=\"border\" variant=\"light\" /></div>}\r\n          {showNotes && <Container fluid style={{ height: \"400px\", overflowY: \"scroll\", overflowX: \"hidden\" }}>\r\n              <Form.Group as={Row}>\r\n                <Table responsive bordered className=\"dark text-center\">\r\n                  <thead>\r\n                    <tr>\r\n                      <th>{`${ isConsortium ? \"Consortium\" : \"Pool\" } Name`}</th>\r\n                      <th>{`${ isConsortium ? \"Consortium\" : \"Pool\" } Code`}</th>\r\n                      <th>Result message</th>\r\n                    </tr>\r\n                  </thead>\r\n                  <tbody>{notes.map((note, i) => messageRow(note, i))}</tbody>\r\n                </Table>\r\n              </Form.Group>\r\n          </Container>}\r\n        </Modal.Body>\r\n        {!loading && <Modal.Footer>\r\n          {!showNotes && <Button variant=\"secondary\" onClick={onHide} className=\"mr-auto fixed-w5\">Cancel</Button>}\r\n          {!showNotes && <ActionButton variant=\"primary\" onClick={onSubmit} spin={loading} disableOnSpin className=\"fixed-w5\">Confirm</ActionButton>}\r\n          {showNotes && <Button variant=\"secondary\" onClick={onHide} className=\"ml-auto fixed-w5\">OK</Button>}\r\n        </Modal.Footer>}\r\n      </Modal>)\r\n  }\r\n}\r\n","import * as React from \"react\"\r\nimport { Modal, Row, Button, Form, Container, Table } from \"react-bootstrap\"\r\nimport 'react-bootstrap-typeahead/css/Typeahead.css'\r\nimport { toast } from \"react-toastify\"\r\nimport { Subscription } from \"rxjs\"\r\nimport { Pool } from \"../../../api/Randoms/RandomsModel/PoolData\"\r\nimport FormatError from \"../../../formatters/FormatError\"\r\nimport { APIError } from \"../../../api/ObservableFromFetch\"\r\nimport { RunCancelPoolsMessages, RunCancelPoolsObservable } from \"../../../api/Randoms/RandomSelectionRun\"\r\nimport Checkbox from \"../../Checkbox\"\r\nimport RunCancelNotificationModal from \"./RunCancelNotificationModal\"\r\n\r\ninterface RunCancelModalProps {\r\n  poolsData: Pool[]\r\n  cancel: boolean\r\n  isConsortium: boolean\r\n  onClose: () => void\r\n  onUpdate: () => void\r\n}\r\n\r\ninterface RunCancelModalState {\r\n  saving: boolean\r\n  showConfirmation: boolean\r\n  selectedPools: Pool[]\r\n  selectAll: boolean\r\n  messages: RunCancelPoolsMessages[]\r\n}\r\n\r\nexport default class RunCancelModal extends React.Component<RunCancelModalProps, RunCancelModalState> {\r\n  subscription?: Subscription\r\n\r\n  state: RunCancelModalState = {\r\n    saving: false,\r\n    showConfirmation: false,\r\n    selectedPools: [],\r\n    selectAll: true,\r\n    messages: []\r\n  }\r\n\r\n  saveSubscription?: Subscription\r\n\r\n  componentWillUnmount() {\r\n    this.saveSubscription && this.saveSubscription.unsubscribe()\r\n  }\r\n\r\n  handleAPIError = (error: Error | APIError, stateChanges: object) => {\r\n    this.setState(stateChanges)\r\n    error && toast.error(FormatError(error))\r\n  }\r\n\r\n\r\n  handleClose = () => {\r\n    this.props.onClose()\r\n  }\r\n\r\n  handleCheckPool = (pool: Pool) => {\r\n    let selectedPools = [...this.state.selectedPools]\r\n\r\n    const index = selectedPools.findIndex(item => item.PoolID === pool.PoolID)\r\n    if (index > -1) {\r\n      selectedPools = [...selectedPools.slice(0, index), ...selectedPools.slice(index + 1)]\r\n    } else {\r\n      selectedPools.push(pool)\r\n    }\r\n    this.setState({ selectedPools: selectedPools })\r\n  }\r\n\r\n  executeRunCancel = () => {\r\n    this.setState({ saving: true })\r\n    const { selectAll, selectedPools } = this.state\r\n    let pools = selectAll ? this.props.poolsData : selectedPools\r\n    const poolsData = pools.map(p => { return { PoolID: p.PoolID, PoolName: p.PoolName, PoolCode: p.Code, IsConsortium: p.IsConsortium } }\r\n    )\r\n\r\n    this.saveSubscription && this.saveSubscription.unsubscribe()\r\n    this.saveSubscription = RunCancelPoolsObservable(this.props.cancel, poolsData).subscribe(\r\n      data => {\r\n        this.setState({ saving: false, messages: data })\r\n        toast.success(\"Action executed successfully.\")\r\n      },\r\n      error => {\r\n        this.handleAPIError(error, { saving: false })\r\n        this.closeConfirmation()\r\n      }\r\n    )\r\n  }\r\n\r\n  handleConfirm = () => this.setState({ showConfirmation: true })\r\n\r\n  closeConfirmation = () => {\r\n    this.setState({ showConfirmation: false })\r\n    if (this.state.messages.length > 0) this.props.onUpdate()\r\n  }\r\n\r\n  render() {\r\n    const { cancel, poolsData, isConsortium } = this.props\r\n    const { selectedPools, selectAll, saving, messages, showConfirmation } = this.state\r\n\r\n    const poolRow = (pool: Pool) => {\r\n      return <tr key={`pool_${pool.PoolID}`}>\r\n        <td><Checkbox checked={selectedPools.includes(pool)} onChange={() => this.handleCheckPool(pool)} id={`checkbox_${pool.PoolID}`} /></td>\r\n        <td>{pool.PoolName}</td>\r\n        <td>{pool.Code}</td>\r\n        {!cancel && <>\r\n          <td>{pool.SelectionInterval}</td>\r\n          <td>{pool.DrugSampleSize}{pool.DrugRateOrFixed === \"Rate\" && \"%\"}</td>\r\n          <td>{pool.AlcoholSampleSize}{pool.AlcoholRateOrFixed === \"Rate\" && \"%\"}</td>\r\n        </>}\r\n      </tr>\r\n    }\r\n\r\n    return (\r\n      <>\r\n        {showConfirmation && <RunCancelNotificationModal\r\n          confirmationText={`Are you sure you want to ${ cancel ? \"Cancel\" : \"Run\" } ${ isConsortium ? \"Consortiums\" : \"Pools\" }?`}\r\n          notes={messages}\r\n          loading={saving}\r\n          isConsortium={this.props.isConsortium}\r\n          onHide={this.closeConfirmation}\r\n          onSubmit={() => this.executeRunCancel()}/>}\r\n        <Modal backdrop=\"static\" size=\"xl\" centered show onHide={this.handleClose}>\r\n          <Modal.Header closeButton>\r\n            <Modal.Title>{`Select ${ isConsortium ? \"Consortiums\" : \"Pools\" } to ${ cancel ? \"Cancel\" : \"Run\" }`}</Modal.Title>\r\n          </Modal.Header>\r\n          <Modal.Body>\r\n            <Form>\r\n              <Row className=\"mb-2 text-center\">\r\n                <Form.Check inline id=\"pools-all\" name=\"pools\" type=\"radio\" label={`All ${ isConsortium ? \"Consortiums\" : \"Pools\" }`} className=\"abc-radio mx-2 ml-auto\" checked={selectAll} onChange={() => this.setState({ selectAll: true })} />\r\n                <Form.Check inline id=\"pools-selected\" name=\"pools\" type=\"radio\" label={`Selected ${ isConsortium ? \"Consortiums\" : \"Pools\" }`} className=\"abc-radio mx-2 mr-auto\" checked={!selectAll} onChange={() => this.setState({ selectAll: false })} />\r\n              </Row>\r\n            </Form>\r\n            {!selectAll && <Container fluid style={{ height: \"400px\", overflowY: \"scroll\", overflowX: \"hidden\" }}>\r\n              <Form.Group as={Row}>\r\n                <Table responsive bordered className=\"dark text-center\">\r\n                  <thead>\r\n                    <tr>\r\n                      <th></th>\r\n                      <th>{`${ isConsortium ? \"Consortium\" : \"Pool\" } Name`}</th>\r\n                      <th>{`${ isConsortium ? \"Consortium\" : \"Pool\" } Code`}</th>\r\n                      {!cancel && <><th>Selection Interval</th><th>Drug</th><th>Alcohol</th></>}\r\n                    </tr>\r\n                  </thead>\r\n                  <tbody>{poolsData.map((pool) => poolRow(pool))}</tbody>\r\n                </Table>\r\n              </Form.Group>\r\n              </Container>}\r\n          </Modal.Body>\r\n          <Modal.Footer>\r\n            <Button variant=\"primary\" disabled={!selectAll && selectedPools.length == 0} onClick={() => this.handleConfirm()}>Execute</Button>\r\n            <Button variant=\"secondary\" onClick={() => this.handleClose()}>Cancel</Button>\r\n          </Modal.Footer>\r\n        </Modal >\r\n      </>\r\n    )\r\n  }\r\n}\r\n","export const csvHeader = [\r\n  \"COMPCODE\",\r\n  \"Location CODE\",\r\n  \"SSN\",\r\n  \"EMPLOYER ID\",\r\n  \"DRIVER ID\",\r\n  \"State of Issuance\",\r\n  \"ALTERNATE ID\",\r\n  \"Fname\",\r\n  \"Lname\",\r\n  \"RegMode\",\r\n  \"Employee Category\",\r\n  \"OccupationCode\",\r\n  \"DOB\",\r\n  \"Hire DATE\",\r\n  \"MANAGER\",\r\n  \"Home Phone\",\r\n  \"Work Phone\",\r\n  \"STREET ADDRESS\",\r\n  \"CITY\",\r\n  \"STATE\",\r\n  \"ZIP\",\r\n  \"Supervisor 1 First Name\",\r\n  \"Supervisor 1 Last Name\",\r\n  \"Supervisor 1 Phone\",\r\n  \"Supervisor 2 First Name\",\r\n  \"Supervisor 2 Last Name\",\r\n  \"Supervisor 2 Phone\",\r\n  \"ReasonForInactivation\",\r\n]\r\n","import * as React from \"react\"\r\nimport { Container, Row, Col, Table, Spinner, Button } from \"react-bootstrap\"\r\nimport { Subscription, BehaviorSubject, of, concat } from \"rxjs\"\r\nimport { distinctUntilChanged, switchMap, map } from \"rxjs/operators\"\r\nimport { toast } from \"react-toastify\"\r\nimport { FiRefreshCw } from \"react-icons/fi\"\r\nimport { FaArrowDown, FaArrowUp, FaPrint } from \"react-icons/fa\"\r\nimport FileSaver from \"file-saver\"\r\nimport { AppPageWrapper } from \"../NavMenu/AppPageWrapper\"\r\nimport TablePagination from \"../TablePagination\"\r\nimport PoolGridData from \"../../api/Randoms/RandomsModel/PoolGridData\"\r\nimport ColumnFilter from \"../../api/Randoms/RandomsModel/ColumnFilter\"\r\nimport PoolGridRow from \"../../api/Randoms/RandomsModel/PoolGridRow\"\r\nimport ColumnHeaderFilter from \"../ColumnHeaderFilter\"\r\nimport SearchField from \"../../api/SearchField\"\r\nimport SearchBar from \"../SearchBar\"\r\nimport AddPoolModal from \"./AddPoolModal\"\r\nimport PoolDetailsModal from \"./Pools/PoolDetailsModal\"\r\nimport FormatTimestampFileName from \"../../formatters/FormatTimestampFileName\"\r\nimport { PoolGridGetObservable, PoolGridCsvGet, PoolGridPrint } from \"../../api/Randoms/PoolGridGet\"\r\nimport PoolReadyToRunUpdateObservable, { PoolReadyToRunItem } from \"../../api/Randoms/PoolReadyToRunUpdate\"\r\nimport FormatDate from \"../../formatters/FormatDate\"\r\nimport Checkbox from \"../Checkbox\"\r\nimport ActionButton from \"../ActionButton\"\r\nimport { connect } from \"react-redux\"\r\nimport { AppState}  from \"../../AppState\"\r\nimport { BuildUserAccess } from \"../../authentication/BuildUserAccess\"\r\nimport RandomNav from \"./RandomNav\"\r\nimport { Filter, Sort } from \"../../api/GridRequest\"\r\nimport RunCancelModal from \"./Pools/RunCancelModal\"\r\nimport { csvHeader } from \"../../api/Randoms/ImportPersonnelTemplate\"\r\n\r\ninterface RandomPoolsProps {\r\n  canManagePools?: boolean\r\n  canManagePersonnel?: boolean\r\n  canManageConsortiumPools?: boolean\r\n  isConsortium?: boolean\r\n  isPortalAdmin?: boolean\r\n}\r\n\r\ninterface RandomPoolsState {\r\n  loading: boolean\r\n  loadingCsv: boolean\r\n  updatingReadyToRun: boolean\r\n  data?: PoolGridData\r\n  details?: PoolGridRow\r\n  detailsModal: boolean\r\n  modal: boolean\r\n  readyToRunChanges: PoolReadyToRunItem[]\r\n  selectedPrintRowIDs: number[]\r\n  runPools: boolean\r\n  cancelPools: boolean\r\n}\r\n\r\ninterface PoolGridSearchParams {\r\n  pageNumber: number\r\n  sort: Sort\r\n  filters: Filter[]\r\n  search: { field: string, text: string }\r\n}\r\n\r\nconst PageSize = 10\r\n\r\nconst DefaultSearchFields: SearchField[] = [\r\n  { ID: \"All\", Name: \"All\" },\r\n  { ID: \"ID\", Name: \"ID\" },\r\n  { ID: \"Name\", Name: \"Name\" }\r\n]\r\n\r\nclass RandomPools extends React.PureComponent<RandomPoolsProps, RandomPoolsState> {\r\n  state: RandomPoolsState = {\r\n    loading: false,\r\n    loadingCsv: false,\r\n    updatingReadyToRun: false,\r\n    detailsModal: false,\r\n    modal: false,\r\n    readyToRunChanges: [],\r\n    selectedPrintRowIDs: [],\r\n    runPools: false,\r\n    cancelPools: false,\r\n  }\r\n\r\n  page$ = new BehaviorSubject<PoolGridSearchParams>({\r\n    pageNumber: 1,\r\n    sort: { column: \"\", order: \"\" },\r\n    filters: [],\r\n    search: { field: \"\", text: \"\" }\r\n  })\r\n  pageSubscription?: Subscription\r\n  csvSubscription?: Subscription\r\n  printSubscription?: Subscription\r\n  updateReadyToRunSubscription?: Subscription\r\n\r\n  componentDidMount() {\r\n    this.pageSubscription = this.page$.pipe(\r\n      distinctUntilChanged(),\r\n      switchMap(params => concat(\r\n        of({ loading: true }),\r\n        PoolGridGetObservable(params.pageNumber, PageSize, params.sort, params.filters, params.search, !!this.props.isConsortium).pipe(\r\n          map((result: PoolGridData) => ({ data: result, loading: false })))\r\n      )\r\n      )\r\n    ).subscribe(\r\n      (newState: { loading: boolean, data?: PoolGridData }) => {\r\n        if (newState.data) {\r\n          this.setState({ loading: newState.loading, data: newState.data, readyToRunChanges: [], selectedPrintRowIDs: [] })\r\n        } else {\r\n          this.setState({ loading: newState.loading })\r\n        }\r\n      },\r\n      (error: string) => {\r\n        this.setState({ loading: false })\r\n        toast.error(error)\r\n      }\r\n    )\r\n  }\r\n\r\n  componentWillUnmount() {\r\n    this.pageSubscription && this.pageSubscription.unsubscribe()\r\n    this.csvSubscription && this.csvSubscription.unsubscribe()\r\n    this.printSubscription && this.printSubscription.unsubscribe()\r\n    this.updateReadyToRunSubscription && this.updateReadyToRunSubscription.unsubscribe()\r\n    this.page$.unsubscribe()\r\n  }\r\n\r\n  pageChanged = (pageNumber: number) => this.page$.next({ ...this.page$.value, pageNumber: pageNumber })\r\n\r\n  sortGrid(column: string, order?: string) {\r\n    if (column === \"LastUpdate\") {\r\n      column = \"LastMemberImport\"\r\n    }\r\n    const newSort = { column: column, order: order || \"\" }\r\n    this.page$.next({ ...this.page$.value, sort: newSort })\r\n  }\r\n\r\n  filterGrid(column: string, items: string[]) {\r\n    const filters = [...this.page$.value.filters]\r\n    const filter = { column: column, values: items }\r\n    let index = filters.findIndex(item => item.column === filter.column)\r\n    if (index >= 0) {\r\n      filters[index] = filter\r\n    } else {\r\n      filters.push(filter)\r\n    }\r\n\r\n    this.page$.next({ ...this.page$.value, pageNumber: 1, filters: filters })\r\n  }\r\n\r\n  onSearch = (field: string, text: string) => this.page$.next({ ...this.page$.value, pageNumber: 1, search: { field: field, text: text } })\r\n\r\n  handlePrintClick() {\r\n    const value = this.page$.value\r\n    this.printSubscription && this.printSubscription.unsubscribe()\r\n    this.printSubscription = PoolGridPrint(this.state.selectedPrintRowIDs, value.filters, value.search, !!this.props.isConsortium).subscribe(\r\n      data => this.print(data),\r\n      error => toast.error(error)\r\n    )\r\n  }\r\n\r\n  print(base64pdf: string) {\r\n    const pdfWindow = window.open(\"\")\r\n    if (pdfWindow) {\r\n      pdfWindow.document.write(\"<iframe width='100%' height='100%' src='data:application/pdf;base64, \" + encodeURI(base64pdf) + \"'></iframe>\")\r\n    }\r\n  }\r\n\r\n  handlePrintSelectAllRowsChange = (e: React.ChangeEvent<HTMLInputElement>) => {\r\n    const selectedPrintRowIDs = e.target.checked && this.state.data && this.state.data.Records ? this.state.data.Records.map(item => item.PoolID) : []\r\n    this.setState({ selectedPrintRowIDs: selectedPrintRowIDs })\r\n  }\r\n\r\n  changePrintRowSelection = (poolID: number, checked: boolean) => {\r\n    let selected = [...this.state.selectedPrintRowIDs].filter(item => item !== poolID)\r\n    this.setState({ selectedPrintRowIDs: checked ? [...selected, poolID] : selected })\r\n  }\r\n\r\n  renderHeaderColumn = (columnName: string, title: string) => {\r\n    const sort = this.page$.value.sort\r\n    return <th>\r\n      {this.state.data\r\n        ? <ColumnHeaderFilter title={title}\r\n          sort={sort.column === columnName ? sort.order === \"asc\" ? \"asc\" : \"desc\" : undefined}\r\n          items={(this.state.data as ColumnFilter)[columnName as keyof ColumnFilter]}\r\n          filteredItems={this.page$.value.filters.find(item => item.column === columnName)?.values || []}\r\n          onSort={(order?: string) => this.sortGrid(columnName, order)}\r\n          onFilter={(items: string[]) => this.filterGrid(columnName, items)} />\r\n        : title.toUpperCase()}\r\n    </th>\r\n  }\r\n\r\n  renderReadyToRunHeaderColumn = () => {\r\n    const sort = this.page$.value.sort\r\n    const isReadyToRun = sort.column === \"ReadyToRun\"\r\n    const setAscSort = !isReadyToRun || sort.order !== \"asc\"\r\n    return <th>\r\n      <div className=\"filter-toggle\">\r\n        <span onClick={() => this.sortGrid(\"ReadyToRun\", setAscSort ? \"asc\" : \"desc\")} className=\"column-header-title text-uppercase mr-1\">READY TO RUN</span>\r\n        {isReadyToRun && <>\r\n          <span hidden={sort.order !== \"asc\"}><FaArrowUp /></span>\r\n          <span hidden={sort.order !== \"desc\"}><FaArrowDown /></span>\r\n        </>}\r\n        <ActionButton size=\"sm\"\r\n          className=\"btn-sm-icon p-0 mt-n1 ml-2\"\r\n          onClick={this.handleReadyToRunClick}\r\n          spin={this.state.updatingReadyToRun}\r\n          disableOnSpin><FiRefreshCw strokeWidth={3} /></ActionButton>\r\n      </div>\r\n    </th>\r\n  }\r\n\r\n  renderRows = () => {\r\n    if (this.state.data?.Records && this.state.data?.Records.length) {\r\n      return this.state.data.Records.map((row: PoolGridRow, i: number) =>\r\n        <tr key={i}>\r\n          <td className=\"text-center\">\r\n            <Checkbox id={`${row.PoolID}_check1_${i}`}\r\n              checked={this.state.selectedPrintRowIDs.includes(row.PoolID)}\r\n              onChange={(e: React.ChangeEvent<HTMLInputElement>) => this.changePrintRowSelection(row.PoolID, e.target.checked)} />\r\n          </td>\r\n          <td><Button variant=\"link\" onClick={() => this.showDetailsModal(row)} className=\"p-0\">{row.Name}</Button></td>\r\n          <td>{row.ID}</td>\r\n          <td>{row.SelectionInterval}</td>\r\n          <td>\r\n            {row.Selection}\r\n            {row.LastSelectionStatus === 1 && (<span className=\"small text-muted ml-1\">(Canceled)</span>)}\r\n          </td>\r\n          <td>{FormatDate(row.LastMemberImport)}</td>\r\n          <td>{FormatDate(row.ReadyToRunDate)}</td>\r\n          <td className=\"text-center\">\r\n            {row.RequireManualVerify &&\r\n              <Checkbox id={`ready-${row.ID}`}\r\n                key={row.ID}\r\n                onChange={(e: React.ChangeEvent<HTMLInputElement>) => this.handleChangeReadyToRunChange(row.PoolID, e.target.checked)}\r\n                checked={this.state.readyToRunChanges.find(item => item.PoolID === row.PoolID)?.ReadyToRun ?? row.ReadyToRun} />}\r\n          </td>\r\n        </tr>)\r\n    } else {\r\n      return <tr><td colSpan={8}>No Records Found</td></tr>\r\n    }\r\n  }\r\n\r\n  showDetailsModal = (details: PoolGridRow) => this.setState({ detailsModal: true, details: details })\r\n  hideDetailsModal = () => {\r\n    this.setState({ detailsModal: false, details: undefined })\r\n    this.reload()\r\n  }\r\n  showModal = () => this.setState({ modal: true })\r\n  hideModal = () => this.setState({ modal: false })\r\n  reload = () => this.page$.next({ ...this.page$.value, pageNumber: 1 })\r\n\r\n  handleCreateSuccessful = () => {\r\n    this.hideModal()\r\n    this.reload()\r\n  }\r\n\r\n  handleReadyToRunClick = () => {\r\n    if (!this.state.readyToRunChanges.length) {\r\n      toast.error(\"Please change status of at least one record.\")\r\n      return\r\n    }\r\n    this.setState({ updatingReadyToRun: true })\r\n    this.updateReadyToRunSubscription && this.updateReadyToRunSubscription.unsubscribe()\r\n    this.updateReadyToRunSubscription = PoolReadyToRunUpdateObservable(this.state.readyToRunChanges).subscribe(\r\n      result => {\r\n        this.setState({ updatingReadyToRun: false })\r\n        toast.success(result)\r\n        this.reload()\r\n      },\r\n      error => {\r\n        this.setState({ updatingReadyToRun: false })\r\n        toast.error(error)\r\n      }\r\n    )\r\n  }\r\n\r\n  handleChangeReadyToRunChange = (poolID: number, checked: boolean) => {\r\n    let changes = [...this.state.readyToRunChanges]\r\n\r\n    const index = changes.findIndex(item => item.PoolID === poolID)\r\n    if (index > -1) {\r\n      changes.splice(index, 1);\r\n    }\r\n    const pool = this.state.data?.Records.find(item => item.PoolID === poolID)\r\n    if (pool && pool.ReadyToRun !== checked) {\r\n      changes.push({ PoolID: poolID, ReadyToRun: checked })\r\n    }\r\n    this.setState({ readyToRunChanges: changes })\r\n  }\r\n\r\n  onRun = () => {\r\n    this.setState({ runPools: false, cancelPools: false })\r\n    this.reload()\r\n  }\r\n\r\n  onExportClick = () => {\r\n    this.setState({ loadingCsv: true })\r\n    const value = this.page$.value\r\n    this.csvSubscription && this.csvSubscription.unsubscribe()\r\n    this.csvSubscription = PoolGridCsvGet(value.filters, value.search, !!this.props.isConsortium).subscribe(\r\n      result => {\r\n        this.setState({ loadingCsv: false })\r\n        this.export(result)\r\n      },\r\n      error => {\r\n        this.setState({ loadingCsv: false })\r\n        toast.error(error)\r\n      }\r\n    )\r\n  }\r\n\r\n  downloadTemplate = () => {\r\n    // const header = this.props.isPortalAdmin ? csvHeader : csvHeader.filter((item) => item.toUpperCase() !== \"MANAGER\")\r\n    const csvData = new Blob([csvHeader.join(\",\") + \"\\r\\n\"], { type: 'text/csv;charset=utf-8;' })\r\n    FileSaver.saveAs(csvData, \"import-list-template.csv\")\r\n  }\r\n\r\n  export = (csv: string) => {\r\n    const csvData = new Blob([csv], { type: 'text/csv;charset=utf-8;' })\r\n    FileSaver.saveAs(csvData, FormatTimestampFileName(\"Pools\", \"csv\", new Date()), true)\r\n    toast.success(\"CSV file downloaded successfully.\")\r\n  }\r\n\r\n  render() {\r\n    const allPrintChecked = !this.state.loading && this.state.data?.Records?.length === this.state.selectedPrintRowIDs.length\r\n    const { runPools, cancelPools } = this.state\r\n    const poolsData = this.state.data?.AllPools\r\n    return (\r\n      <AppPageWrapper parentClassName={\"align-items-center\"} showNav>\r\n        <RandomNav canManagePools={this.props.canManagePools} canManagePersonnel={this.props.canManagePersonnel} canManageConsortiumPools={this.props.canManageConsortiumPools} isConsortium={!!this.props.isConsortium} />\r\n        <Container fluid className=\"grid-container\">\r\n          <Row className=\"pb-2\">\r\n            <Col>\r\n              {this.state.detailsModal && this.state.details && <PoolDetailsModal isConsortium={!!this.props.isConsortium} details={this.state.details} onHide={this.hideDetailsModal} />}\r\n              {this.state.modal && <AddPoolModal show={this.state.modal} IsConsortium={!!this.props.isConsortium} onHide={this.hideModal} onSuccess={this.handleCreateSuccessful} />}\r\n              <SearchBar onSearch={this.onSearch} searchFields={DefaultSearchFields} />\r\n            </Col>\r\n            <Col md={6} className=\"text-md-right mt-2 mt-md-0\">\r\n              {this.props.isPortalAdmin && <ActionButton variant=\"secondary\" size=\"sm\" onClick={() => this.setState({ runPools: true })} spin={this.state.loading} disableOnSpin className=\"mr-2\">{ this.props.isConsortium ? \"RUN CONSORTIUMS\" : \"RUN POOLS\" }</ActionButton>}\r\n              {false && this.props.isPortalAdmin && <ActionButton variant=\"secondary\" size=\"sm\" onClick={() => this.setState({ cancelPools: true })} spin={this.state.loading} disableOnSpin className=\"mr-2\">{ this.props.isConsortium ? \"CANCEL CONSORTIUMS RUN\" : \"CANCEL POOLS RUN\" }</ActionButton>}\r\n              {!this.props.isConsortium && <Button variant=\"secondary\" size=\"sm\" onClick={this.showModal} className=\"mr-2\">CREATE NEW POOL</Button>}\r\n              {this.props.isConsortium && this.props.canManageConsortiumPools && this.props.isPortalAdmin && <Button variant=\"secondary\" size=\"sm\" onClick={this.showModal} className=\"mr-2\">CREATE NEW CONSORTIUM</Button>}\r\n              {!this.props.isConsortium && <Button variant=\"secondary\" size=\"sm\" className=\"mr-2\" onClick={() => this.downloadTemplate()}>DOWNLOAD TEMPLATE</Button>}\r\n              <ActionButton variant=\"secondary\" size=\"sm\" onClick={this.onExportClick} disabled={!(this.state.data?.Records || []).length} spin={this.state.loadingCsv} disableOnSpin>EXPORT CSV</ActionButton>\r\n            </Col>\r\n          </Row>\r\n          <Row>\r\n            <Col>\r\n              <Table bordered responsive>\r\n                <thead>\r\n                  <tr>\r\n                    <th className=\"text-center print-column\">\r\n                      <Checkbox id=\"print_all\" checked={allPrintChecked} onChange={this.handlePrintSelectAllRowsChange} />\r\n                      <Button variant=\"secondary\" size=\"sm\" onClick={() => this.handlePrintClick()} className=\"float-right\" disabled={this.state.selectedPrintRowIDs.length === 0}><FaPrint /></Button>\r\n                    </th>\r\n                    {this.renderHeaderColumn(\"Name\", this.props.isConsortium ? \"Consortium Name\" : \"Pool Name\")}\r\n                    {this.renderHeaderColumn(\"ID\", \"Pool ID\")}\r\n                    {this.renderHeaderColumn(\"SelectionInterval\", \"Selection Interval\")}\r\n                    {this.renderHeaderColumn(\"LastSelection\", \"Last Selection\")}\r\n                    {this.renderHeaderColumn(\"LastUpdate\", \"Last Update\")}\r\n                    {this.renderHeaderColumn(\"ReadyToRunDate\", \"Date Ready To Run\")}\r\n                    {this.renderReadyToRunHeaderColumn()}\r\n                  </tr>\r\n                </thead>\r\n                <tbody>\r\n                  {\r\n                    this.state.loading ?\r\n                      <tr>\r\n                        <td className=\"text-center\" colSpan={8}>\r\n                          <Spinner animation=\"border\" variant=\"secondary\" />\r\n                        </td>\r\n                      </tr> : this.renderRows()\r\n                  }\r\n                </tbody>\r\n              </Table>\r\n            </Col>\r\n          </Row>\r\n          {this.state.data ?\r\n            <Row>\r\n              <Col>\r\n                <span className=\"total-records\">Total records: {this.state.data.Total}</span>\r\n                <TablePagination pageNumber={this.page$.value.pageNumber} pages={this.state.data.Pages} onChange={this.pageChanged} />\r\n              </Col>\r\n            </Row> : undefined}\r\n        </Container>\r\n        { (runPools || cancelPools) && poolsData && <RunCancelModal isConsortium={!!this.props.isConsortium} poolsData={poolsData} cancel={cancelPools} onClose={()=> this.setState({ runPools: false, cancelPools: false })} onUpdate={this.onRun} />}\r\n      </AppPageWrapper>\r\n    )\r\n  }\r\n}\r\nfunction mapStateToProps(state: AppState): RandomPoolsProps {\r\n  const userAccess = BuildUserAccess(state)\r\n  return {\r\n    canManagePools: userAccess.canManagePools,\r\n    canManagePersonnel: userAccess.canManagePersonnel,\r\n    canManageConsortiumPools: userAccess.CanManageConsortiumPools,\r\n    isPortalAdmin: userAccess.isPortalAdmin,\r\n  }\r\n}\r\nconst ConnectedRandomPools = connect(mapStateToProps, null)(RandomPools)\r\nexport default ConnectedRandomPools\r\n","import GovPoolCreate from \"./GovPoolModel/GovPoolCreate\"\r\nimport { ObservableFromFetch } from \"../ObservableFromFetch\"\r\n\r\nexport default function PoolCreateObservable(data: GovPoolCreate) {\r\n  const params: string = JSON.stringify(data)\r\n\r\n  return ObservableFromFetch<string>(\"GovPool/CreateGovPool\", params, \"put\")\r\n}\r\n","export enum Day {\r\n  SUN = 1,\r\n  MON = 2,\r\n  TUE = 3,\r\n  WED = 4,\r\n  THU = 5,\r\n  FRI = 6,\r\n  SAT = 7,\r\n}\r\n\r\nconst DayMap = new Map<Day, string>([\r\n  [Day.SUN, \"Sun\"],\r\n  [Day.MON, \"Mon\"],\r\n  [Day.TUE, \"Tue\"],\r\n  [Day.WED, \"Wed\"],\r\n  [Day.THU, \"Thu\"],\r\n  [Day.FRI, \"Fri\"],\r\n  [Day.SAT, \"Sat\"],\r\n])\r\n\r\nexport function getDayName(key: Day) {\r\n  return DayMap.get(key) || \"\"\r\n}\r\n\r\nexport const WeekDays: DayOfWeek[] = [\r\n  { Id: Day.SUN, Name: getDayName(Day.SUN) },\r\n  { Id: Day.MON, Name: getDayName(Day.MON) },\r\n  { Id: Day.TUE, Name: getDayName(Day.TUE) },\r\n  { Id: Day.WED, Name: getDayName(Day.WED) },\r\n  { Id: Day.THU, Name: getDayName(Day.THU) },\r\n  { Id: Day.FRI, Name: getDayName(Day.FRI) },\r\n  { Id: Day.SAT, Name: getDayName(Day.SAT) }\r\n]\r\n\r\nexport default interface DayOfWeek {\r\n  Id: Day\r\n  Name: string\r\n}\r\n","export enum DeviceSampleType {\r\n  Saliva = \"SL\",\r\n  Urine = \"UR\"\r\n}\r\n","import * as React from \"react\"\r\nimport { WeekDays, Day, getDayName } from \"../../../api/Randoms/GovPoolModel/DayOfWeek\"\r\nimport DaysToExclude from \"../../../api/Randoms/GovPoolModel/DaysToExclude\"\r\nimport Checkbox from \"../../Checkbox\"\r\nimport { parseISO } from \"date-fns\"\r\n\r\ninterface WeekdaysToExcludeProps {\r\n  daysToExclude: DaysToExclude[]\r\n  editable?: boolean\r\n  handlerChange: (e: React.ChangeEvent<HTMLInputElement>, day: Day) => void\r\n}\r\n\r\nexport class WeekdaysToExclude extends React.PureComponent<WeekdaysToExcludeProps> {\r\n  valueText = (daysToExclude: DaysToExclude[]) => {\r\n    return [\r\n      ...daysToExclude.filter(item => item.DayOfWeekID).map(item => item.DayOfWeekID).sort().map(day => getDayName(day!)),\r\n    ].join(\", \")\r\n  }\r\n\r\n  render() {\r\n    const today = new Date(new Date().getFullYear(), new Date().getMonth(), new Date().getDate()).getTime()\r\n    // Remove past dates\r\n    const daysToExclude = this.props.daysToExclude.filter(item => item.DayOfWeekID || (item.DateExclude && parseISO(item.DateExclude)?.getTime() >= today))\r\n    const weekdaysToExclude = daysToExclude.filter(item => item.DayOfWeekID).map(item => item.DayOfWeekID as Day)\r\n    return <>\r\n      {!this.props.editable && this.valueText(daysToExclude)}\r\n      {this.props.editable &&\r\n        WeekDays.map(\r\n          day => {\r\n            const checkbox = <Checkbox\r\n              inline\r\n              id={day.Name}\r\n              label={day.Name}\r\n              key={day.Name}\r\n              defaultChecked={this.props.daysToExclude && weekdaysToExclude.includes(day.Id)}\r\n              onChange={(e: React.ChangeEvent<HTMLInputElement>) => { this.props.handlerChange(e, day.Id) }}\r\n            />\r\n            return checkbox\r\n          }\r\n        )}\r\n    </>\r\n  }\r\n}\r\n","import { SampleType } from \"./GovPoolModel/CollectionTypeResponse\"\r\nimport { ObservableFromFetch } from \"../ObservableFromFetch\"\r\n\r\nexport default function GovGetCollectionTypes() {\r\n  return ObservableFromFetch<SampleType[]>(\"GovPool/GetCollectionTypes\")\r\n}\r\n","import LabAccount from \"./LabServiceModel/LabAccount\"\r\nimport { ObservableFromFetch } from \"../ObservableFromFetch\"\r\nimport LabPanel from \"../Randoms/RandomsModel/LabPanel\";\r\n\r\nexport interface LabAccountsGetParams {\r\n  AccountID?: number\r\n  CompanyID: number\r\n  RegionID: number\r\n  LocationID: number\r\n  SearchFor: string\r\n  SearchBy: string\r\n  DOT: boolean\r\n  AutoFilter?: string\r\n  IsMarketPlace: boolean\r\n  Link?: string\r\n}\r\n\r\nexport interface FilteredLabAccountsGetParams {\r\n  AccountID?: number\r\n  CompanyID: number\r\n  RegionID: number\r\n  LocationID: number\r\n  SearchFor: string\r\n  SearchBy: string\r\n  DOT: boolean\r\n  AutoFilter?: string\r\n  IsMarketPlace: boolean\r\n  Link?: string\r\n  POCT: boolean\r\n  Panel: string\r\n}\r\n\r\ninterface LabLookup {\r\n  DOT: boolean\r\n  LabAccount: string\r\n  Laboratory: string\r\n  Link?: string\r\n}\r\n\r\nexport default function LabAccountsGetObservable(params: LabAccountsGetParams) {\r\n  const requestBody: string = JSON.stringify({\r\n    ...params\r\n  });\r\n\r\n  return ObservableFromFetch<LabAccount[]>(\"order/GetLabAccounts\", requestBody)\r\n}\r\n\r\nexport function FilteredLabAccountsGetObservable(params: FilteredLabAccountsGetParams) {\r\n  const requestBody: string = JSON.stringify({\r\n    ...params\r\n  });\r\n\r\n  return ObservableFromFetch<LabAccount[]>(\"order/GetFilteredLabAccounts\", requestBody)\r\n}\r\n\r\nexport function LabAccountLookup(account: string, lab: string, dot: boolean, link: string) {\r\n  const params: LabLookup = {\r\n    DOT: dot,\r\n    LabAccount: account,\r\n    Laboratory: lab\r\n  }\r\n\r\n  if (link !== \"\") { params.Link = link }\r\n\r\n  const requestBody: string = JSON.stringify(params);\r\n\r\n  return ObservableFromFetch<LabPanel[]>(\"FFOrderUser/GetAccountLookup\", requestBody)\r\n}\r\n\r\n","import GovDevice, { ModifyGovDevice } from \"./GovPoolModel/GovDevice\"\r\nimport { ObservableFromFetch } from \"../ObservableFromFetch\"\r\n\r\nexport default function GovDeviceGetObservable(labAccount: string) {\r\n  return ObservableFromFetch<GovDevice[]>(`GovPool/GetDevices?laboratoryAccount=${labAccount}`)\r\n}\r\n\r\nexport function DevicesGetObservable(labAccount: string = \"\") {\r\n  const params: string = JSON.stringify({\r\n    LabAccount: labAccount\r\n  })\r\n  return ObservableFromFetch<GovDevice[]>(\"GovPool/GetCommonDevices\", params)\r\n}\r\n\r\nexport function GovDeviceModifyObservable(data: ModifyGovDevice) {\r\n  const params: string = JSON.stringify(data)\r\n\r\n  return ObservableFromFetch<string>(\"GovPool/ModifyGovDevice\", params)\r\n}","import * as React from \"react\"\r\nimport { Form, Col, Button, Spinner } from \"react-bootstrap\"\r\nimport { Subscription } from \"rxjs\"\r\nimport { SampleType, GovPanel } from \"../../api/Randoms/GovPoolModel/CollectionTypeResponse\"\r\nimport GovGetCollectionTypes from \"../../api/Randoms/GovGetCollectionTypes\"\r\nimport LabAccountsGetObservable from \"../../api/LabService/LabAccountsGet\"\r\nimport LabAccount from \"../../api/LabService/LabServiceModel/LabAccount\"\r\nimport GovDeviceGetObservable from \"../../api/Randoms/GovDevicesGet\"\r\nimport GovDevice from \"../../api/Randoms/GovPoolModel/GovDevice\"\r\nimport { Typeahead } from \"react-bootstrap-typeahead\"\r\nimport { LabAccountMaxLength } from \"../../config/Constants\"\r\nimport { toast } from \"react-toastify\"\r\nimport GovGetPanels from \"../../api/Randoms/GovGetPanels\"\r\nimport FormatError from \"../../formatters/FormatError\"\r\nimport { DeviceSampleType } from \"./DeviceSampleType\"\r\nimport { FaAngleDown } from \"react-icons/fa\"\r\n\r\ninterface GovCollectionProps {\r\n  editing?: boolean\r\n  pendingRandom?: boolean\r\n  showHeading?: boolean\r\n  labAccount?: string\r\n  serviceDOT: boolean\r\n  sampleTypeID?: number\r\n  panel?: string\r\n  device?: string\r\n  companyID: number\r\n  labelClassName?: string\r\n  onTypeChange: (sampleType?: SampleType, isPOCTDevice?: boolean) => void\r\n  onLabChange: (labAccount?: LabAccount) => void\r\n  onPanelChange: (panel?: GovPanel) => void\r\n  onDeviceChange: (device?: GovDevice) => void\r\n}\r\n\r\ninterface LabAccountType {\r\n  isUrineLab: boolean\r\n  isSalivaLab: boolean\r\n  isUrinePOCT: boolean\r\n  isSalivaPOCT: boolean\r\n}\r\n\r\nexport const getLabType = (lab: LabAccount): LabAccountType => {\r\n  const regionID = (lab.LabAccount || \"\").split(\".\")[1] || \"\"\r\n  const isUrineLab = !(regionID.startsWith(\"ORF\") || regionID.startsWith(\"CON\") || regionID.startsWith(\"OCO\") || regionID.startsWith(\"POC\"))\r\n  const isSalivaLab = regionID.startsWith(\"ORF\")\r\n  const isUrinePOCT = regionID.startsWith(\"CON\")\r\n  const isSalivaPOCT = regionID.startsWith(\"OCO\")\r\n  return {\r\n    isUrineLab: isUrineLab,\r\n    isSalivaLab: isSalivaLab,\r\n    isUrinePOCT: isUrinePOCT,\r\n    isSalivaPOCT: isSalivaPOCT\r\n  }\r\n}\r\n\r\nexport const showLabForSelectedCollectionType = (lab: LabAccount, collectionType: string): boolean => {\r\n  return (\r\n    (getLabType(lab).isSalivaLab && collectionType === \"Saliva Lab Test\") ||\r\n    (getLabType(lab).isUrineLab && collectionType === \"Urine Lab Test\") ||\r\n    (getLabType(lab).isSalivaPOCT && collectionType === \"Saliva POCT\") ||\r\n    (getLabType(lab).isUrinePOCT && collectionType === \"Urine POCT\")\r\n  )\r\n}\r\n\r\nexport interface DataLoader<T> {\r\n  data?: T[]\r\n  loading?: boolean\r\n  selected?: T\r\n}\r\n\r\ninterface GovCollectionState {\r\n  devices: DataLoader<GovDevice>\r\n  labAccounts: DataLoader<LabAccount>\r\n  panels: DataLoader<GovPanel>\r\n  sampleTypes: DataLoader<SampleType>\r\n  isPOCTDevice?: boolean\r\n  defaultSampleTypeID?: number\r\n  defaultLabAccount?: string\r\n  defaultPanel?: string\r\n  defaultDevice?: string\r\n}\r\n\r\nexport default class GovCollection extends React.PureComponent<GovCollectionProps, GovCollectionState> {\r\n  state: GovCollectionState = {\r\n    devices: {},\r\n    labAccounts: {},\r\n    panels: {},\r\n    sampleTypes: {},\r\n    isPOCTDevice: false,\r\n    defaultSampleTypeID: this.props.sampleTypeID,\r\n    defaultLabAccount: this.props.labAccount,\r\n    defaultPanel: this.props.panel,\r\n    defaultDevice: this.props.device\r\n  }\r\n\r\n  labAccountRef = React.createRef<Typeahead<LabAccount>>()\r\n\r\n  subscription = new Subscription()\r\n  labAccountSubscription?: Subscription = undefined\r\n  panelSubscription?: Subscription = undefined\r\n  deviceSubscription?: Subscription = undefined\r\n\r\n  componentDidMount() {\r\n    this.loadSampleTypes()\r\n  }\r\n\r\n  componentDidUpdate(prevProps: GovCollectionProps) {\r\n    const editModeChanged = prevProps.editing !== this.props.editing\r\n    const formChanged = prevProps.sampleTypeID !== this.props.sampleTypeID || prevProps.labAccount !== this.props.labAccount || prevProps.panel !== this.props.panel || prevProps.device !== this.props.device\r\n    if (editModeChanged && formChanged) {\r\n      this.setState({\r\n        defaultSampleTypeID: this.props.sampleTypeID,\r\n        defaultLabAccount: this.props.labAccount,\r\n        defaultPanel: this.props.panel,\r\n        defaultDevice: this.props.device\r\n      }, this.loadSampleTypes)\r\n    }\r\n  }\r\n\r\n  componentWillUnmount() {\r\n    this.labAccountSubscription && this.labAccountSubscription.unsubscribe()\r\n    this.panelSubscription && this.panelSubscription.unsubscribe()\r\n    this.deviceSubscription && this.deviceSubscription.unsubscribe()\r\n    this.subscription.unsubscribe()\r\n  }\r\n\r\n  loadSampleTypes = () => {\r\n    const labAccountNode = this.labAccountRef?.current\r\n    if (labAccountNode) {\r\n      labAccountNode.getInput().maxLength = LabAccountMaxLength\r\n    }\r\n\r\n    this.setState({ sampleTypes: { loading: true } })\r\n\r\n    this.subscription.add(\r\n      GovGetCollectionTypes().subscribe(\r\n        (data: SampleType[]) => {\r\n          const selectedSampleType = data.find(type => type.SampleTypeID === this.state.defaultSampleTypeID)\r\n          const isPOCTDevice = selectedSampleType?.Description.includes(\"POCT\")\r\n\r\n          this.setState({ isPOCTDevice: isPOCTDevice, sampleTypes: { data: data, loading: false, selected: selectedSampleType }, defaultSampleTypeID: undefined })\r\n          this.props.onTypeChange(selectedSampleType, isPOCTDevice)\r\n          this.loadLabAccounts()\r\n        },\r\n        (error) => {\r\n          this.setState({ sampleTypes: { loading: false } })\r\n          toast.error(error?.errorData?.message || error.message)\r\n        }\r\n      )\r\n    )\r\n  }\r\n\r\n  loadLabAccounts = () => {\r\n    this.setState({\r\n      labAccounts: { data: [], selected: undefined, loading: true },\r\n      panels: { data: [], selected: undefined, loading: false },\r\n      devices: { data: [], selected: undefined, loading: false }\r\n    })\r\n    this.labAccountSubscription && this.labAccountSubscription.unsubscribe()\r\n    this.labAccountSubscription = LabAccountsGetObservable({\r\n      SearchFor: \"\",\r\n      SearchBy: \"Account Name\",\r\n      CompanyID: this.props.companyID,\r\n      RegionID: 0,\r\n      LocationID: 0,\r\n      DOT: false,\r\n      IsMarketPlace: true\r\n    }).subscribe(\r\n      (data: LabAccount[]) => {\r\n        const selectedLabAccount = data.find(item => item.LabAccount === this.state.defaultLabAccount)\r\n        this.setState({\r\n          labAccounts: { data: data, loading: false, selected: selectedLabAccount }\r\n        })\r\n        this.loadPanels(0, selectedLabAccount)\r\n        this.loadDevices(selectedLabAccount)\r\n        this.props.onLabChange(selectedLabAccount)\r\n        if (!selectedLabAccount) {\r\n          this.setState({ defaultPanel: undefined, defaultDevice: undefined })\r\n        }\r\n        this.filterSampleTypes()\r\n      },\r\n      () => this.setState({ labAccounts: { loading: false } })\r\n    )\r\n  }\r\n\r\n  loadPanels = (device: number, selectedLabAccount?: LabAccount) => {\r\n    if (!selectedLabAccount?.LabAccount) {\r\n      this.setState({ panels: { data: [], selected: undefined, loading: false } })\r\n      return\r\n    }\r\n    this.setState({ panels: { data: [], selected: undefined, loading: true } })\r\n\r\n    if (this.state.isPOCTDevice) {\r\n      if (!!this.state.devices.selected) {\r\n        const selectedPanel = { ID: this.state.devices.selected?.PanelCode, Name: this.state.devices.selected?.PanelCode } as GovPanel\r\n        this.setState({ panels: { data: [], selected: selectedPanel, loading: false } })\r\n        this.props.onPanelChange(selectedPanel)\r\n      }\r\n\r\n      return\r\n    }\r\n    this.panelSubscription && this.panelSubscription.unsubscribe()\r\n    this.panelSubscription = GovGetPanels(selectedLabAccount?.LabAccount, this.state.devices.selected?.DeviceID).subscribe(\r\n      (data: SampleType[]) => {\r\n        const selectedSampleType = data.find(type => type.SampleTypeID === this.state.sampleTypes.selected?.SampleTypeID)\r\n        let selectedPanel = selectedSampleType?.Panels.find(p => p.ID === this.state.defaultPanel)\r\n        this.setState({ panels: { data: selectedSampleType?.Panels, selected: selectedPanel, loading: false }, defaultPanel: undefined })\r\n        this.props.onPanelChange(selectedPanel)\r\n      },\r\n      (error) => {\r\n        this.setState({ panels: { loading: false } })\r\n        toast.error(error?.errorData?.message || error.message)\r\n      }\r\n    )\r\n  }\r\n\r\n  loadDevices = (selectedLabAccount?: LabAccount) => {\r\n    if (!selectedLabAccount?.LabAccount) {\r\n      this.setState({ devices: { data: [], selected: undefined, loading: false }})\r\n      return\r\n    }\r\n    this.setState({ devices: {data: [], selected: undefined, loading: true } })\r\n    this.deviceSubscription && this.deviceSubscription.unsubscribe()\r\n    this.deviceSubscription = GovDeviceGetObservable(selectedLabAccount?.LabAccount).subscribe(\r\n      (data: GovDevice[]) => {\r\n        const selectedDevice = data.find(item => item.Code === this.state.defaultDevice)\r\n        const isPOCTDevice = this.state.isPOCTDevice\r\n        const selectedSampleType = this.state.sampleTypes?.selected\r\n\r\n        let filtered = data\r\n        if (selectedSampleType && isPOCTDevice) {\r\n          const sampleTypeCode: DeviceSampleType = DeviceSampleType[selectedSampleType.LabCode as keyof typeof DeviceSampleType]\r\n          filtered = data?.filter(device => device.SampleType === sampleTypeCode)\r\n        }\r\n\r\n        this.setState({ devices: { data: filtered, selected: selectedDevice, loading: false }, defaultDevice: undefined })\r\n        this.props.onDeviceChange(selectedDevice)\r\n        if (isPOCTDevice) {\r\n          const selectedPanel = { ID: selectedDevice?.PanelCode, Name: selectedDevice?.PanelCode } as GovPanel\r\n          this.setState({ panels: { ...this.state.panels, selected: selectedPanel } })\r\n          this.props.onPanelChange(selectedPanel)\r\n        }\r\n      },\r\n      (error) => {\r\n        this.setState({ devices: { loading: false } })\r\n        toast.error(FormatError(error))\r\n      }\r\n    )\r\n  }\r\n\r\n  handleSampleTypeChange = (event: React.ChangeEvent<HTMLSelectElement>) => {\r\n    const sampleTypeId = event.target.value\r\n    const selectedSampleType = this.state.sampleTypes?.data?.find(type => type.SampleTypeID == Number(sampleTypeId))\r\n    const isPOCTDevice = selectedSampleType?.Description.includes(\"POCT\")\r\n    this.setState({\r\n      sampleTypes: { ...this.state.sampleTypes, selected: selectedSampleType },\r\n      labAccounts: { ...this.state.labAccounts, selected: undefined },\r\n      panels: { data: [], selected: undefined, loading: false },\r\n      devices: { data: [], selected: undefined, loading: false },\r\n      isPOCTDevice: isPOCTDevice,\r\n      defaultLabAccount: undefined,\r\n      defaultPanel: undefined,\r\n      defaultDevice: undefined\r\n    })\r\n    this.props.onTypeChange(selectedSampleType, !!isPOCTDevice)\r\n  }\r\n\r\n  handleLabChange = (items: LabAccount[]) => {\r\n    const selectedLab = items[0]\r\n    this.setState({\r\n      labAccounts: { ...this.state.labAccounts, selected: selectedLab },\r\n      devices: { data:[], selected: undefined, loading: false },\r\n      panels: { data:[], selected: undefined, loading: false }\r\n    }, () => {\r\n      this.props.onLabChange(selectedLab)\r\n      this.loadPanels(0, selectedLab)\r\n      this.loadDevices(selectedLab)\r\n    })\r\n  }\r\n\r\n  handlePanelChange = (event: React.ChangeEvent<HTMLSelectElement>) => {\r\n    const panelId = event.target.value\r\n    const panel = this.state.panels.data?.find(p => p.ID == panelId)\r\n    this.setState({ panels: { ...this.state.panels, selected: panel } })\r\n    this.props.onPanelChange(panel)\r\n  }\r\n\r\n  handleDeviceChange = (event: React.ChangeEvent<HTMLSelectElement>) => {\r\n    const deviceCode = event.target.value\r\n    const selectedDevice = this.state.devices.data?.find(d => d.Code === deviceCode)\r\n    const selectedPanel = { ID: selectedDevice?.PanelCode, Name: selectedDevice?.PanelCode } as GovPanel\r\n    this.setState({ devices: { ...this.state.devices, selected: selectedDevice }, panels: { ...this.state.panels, selected: selectedPanel } })\r\n    this.props.onDeviceChange(selectedDevice)\r\n    this.props.onPanelChange(selectedPanel)\r\n  }\r\n\r\n  filterSampleTypes = () => {\r\n    const filtered = this.state.sampleTypes.data?.filter(item => this.state.labAccounts.data?.some(lab => showLabForSelectedCollectionType(lab, item.Description)))\r\n    this.setState(prevState => ({ sampleTypes: { ...prevState.sampleTypes, data: filtered } }))\r\n  }\r\n\r\n  populateSelectedOptions = <T extends object, K extends keyof T, V extends keyof T, D extends keyof T>(value: V, description: D, data?: T[], uniqKey?: K) => {\r\n    return data?.map((o: T) => {\r\n      const optionValue: string = o[value] as unknown as string\r\n      const key: string = uniqKey ? o[uniqKey] as unknown as string : optionValue\r\n      return <option value={optionValue} key={key}>{o[description]}</option>\r\n    })\r\n  }\r\n\r\n  render() {\r\n    const { showHeading, editing, labelClassName } = this.props\r\n    const sampleTypeDisabled = this.state.sampleTypes.loading\r\n    const labAccountDisabled = sampleTypeDisabled || this.state.labAccounts.loading || !this.state.sampleTypes.selected\r\n    const panelsDisabled = labAccountDisabled || this.state.panels.loading || !this.state.labAccounts.selected\r\n    const devicesDisabled = labAccountDisabled || this.state.devices.loading || !this.state.labAccounts.selected\r\n    return (\r\n      <Form.Group>\r\n        {showHeading && <Form.Label className=\"font-weight-bold required\">PLEASE SELECT SERVICE:</Form.Label>}\r\n        <Form.Row className=\"form-group required align-items-center\">\r\n          <Form.Label column sm={5} htmlFor=\"panel\" className={labelClassName}>Type of Collection</Form.Label>\r\n          <Col sm={7}>\r\n            {!editing && this.state.sampleTypes.loading && <Spinner animation=\"border\" variant=\"secondary\" size=\"sm\" style={{ margin: \"auto\" }} />}\r\n            {!editing && this.state.sampleTypes.selected?.Description}\r\n            {editing && <Form.Control id=\"sampleType\" as=\"select\" disabled={sampleTypeDisabled} onChange={this.handleSampleTypeChange} value={this.state.sampleTypes.selected?.SampleTypeID}>\r\n              <option value=\"\">{this.state.sampleTypes.loading ? \"Loading...\" : \"Select\"}</option>\r\n              {this.populateSelectedOptions(\"SampleTypeID\", \"Description\", this.state.sampleTypes.data)}\r\n            </Form.Control>}\r\n          </Col>\r\n        </Form.Row>\r\n        <Form.Row className=\"form-group required align-items-center\">\r\n          <Form.Label column sm={5} htmlFor=\"labAccount\" className={labelClassName}>{showHeading ? \"\" : \"Default \"}Laboratory / Account Number</Form.Label>\r\n          <Col sm={7}>\r\n            {!editing && this.state.labAccounts.loading && <Spinner animation=\"border\" variant=\"secondary\" size=\"sm\" style={{ margin: \"auto\" }} />}\r\n            {!editing && this.state.labAccounts.selected?.Description}\r\n            {editing && <Typeahead id=\"labAccount\"\r\n              ref={this.labAccountRef}\r\n              labelKey=\"Description\"\r\n              emptyLabel=\"No Laboratory Accounts Found\"\r\n              disabled={labAccountDisabled}\r\n              filterBy={(option, props) => showLabForSelectedCollectionType(option, this.state.sampleTypes.selected?.Description || \"\")}\r\n              onChange={this.handleLabChange}\r\n              options={this.state.labAccounts.data || []}\r\n              selected={this.state.labAccounts.selected ? [this.state.labAccounts.selected] : []}\r\n              placeholder=\"Enter the Lab Account\">\r\n              <Button variant=\"toggle\"\r\n                disabled={labAccountDisabled}\r\n                onClick={() => { this.labAccountRef.current?.toggleMenu() }}>\r\n                <FaAngleDown />\r\n              </Button>\r\n            </Typeahead>}\r\n          </Col>\r\n        </Form.Row>\r\n        {!this.state.isPOCTDevice && <Form.Row className=\"form-group required align-items-center\">\r\n          <Form.Label column sm={5} htmlFor=\"panel\" className={labelClassName}>Test to Perform</Form.Label>\r\n          <Col sm={7}>\r\n            {!editing && this.state.panels.loading && <Spinner animation=\"border\" variant=\"secondary\" size=\"sm\" style={{ margin: \"auto\" }} />}\r\n            {!editing && this.state.panels.selected?.Name}\r\n            {editing && <Form.Control id=\"panel\" as=\"select\"\r\n              disabled={panelsDisabled}\r\n              onChange={this.handlePanelChange}\r\n              value={this.state.panels.selected?.ID}>\r\n              <option value=\"\">{this.state.panels.loading ? \"Loading...\" : \"Select\"}</option>\r\n              {this.populateSelectedOptions(\"ID\", \"Name\", this.state.panels.data)}\r\n            </Form.Control>}\r\n          </Col>\r\n        </Form.Row>}\r\n        {this.state.isPOCTDevice &&\r\n          <Form.Row className=\"form-group required align-items-center\">\r\n            <Form.Label column sm={5} htmlFor=\"device\" className={labelClassName}>POCT Device</Form.Label>\r\n            <Col sm={7}>\r\n              {!editing && this.state.devices.loading && <Spinner animation=\"border\" variant=\"secondary\" size=\"sm\" style={{ margin: \"auto\" }} />}\r\n              {!editing && this.state.devices.selected?.Description}\r\n              {editing && <Form.Control id=\"device\" as=\"select\"\r\n                disabled={devicesDisabled}\r\n                onChange={this.handleDeviceChange}\r\n                value={this.state.devices.selected?.Code}>\r\n                <option value=\"\">Select</option>\r\n                {this.populateSelectedOptions(\"Code\", \"Description\", this.state.devices.data)}\r\n              </Form.Control>}\r\n            </Col>\r\n          </Form.Row>\r\n        }\r\n      </Form.Group>\r\n    )\r\n  }\r\n\r\n  static defaultProps = {\r\n    editing: false,\r\n    pendingRandom: false\r\n  }\r\n}\r\n","import { ObservableFromFetch } from \"../ObservableFromFetch\"\r\nimport DaysToExclude from \"./GovPoolModel/DaysToExclude\"\r\n\r\nexport default function GetDaysToExclude(poolID: number = 0) {\r\n  return ObservableFromFetch<DaysToExclude[]>(`GovPool/GetDaysToExclude?poolID=${poolID}`)\r\n}","import DaysToExclude from \"../../../api/Randoms/GovPoolModel/DaysToExclude\"\r\nimport { FormatShortDate } from \"../../../formatters/FormatDate\"\r\nimport { parseISO } from \"date-fns\"\r\n\r\nexport interface DatesToExcludeProps {\r\n  daysToExclude: DaysToExclude[]\r\n}\r\n\r\nconst DatesToExclude = (props: DatesToExcludeProps) => {\r\n  const today = new Date(new Date().getFullYear(), new Date().getMonth(), new Date().getDate()).getTime()\r\n  // Remove past dates\r\n  const daysToExclude = props.daysToExclude.filter(item => item.DayOfWeekID || (item.DateExclude && parseISO(item.DateExclude)?.getTime() >= today))\r\n\r\n  const toExclude = (daysToExclude: DaysToExclude[]) => {\r\n    return daysToExclude\r\n      .filter(item => item.DateExclude)\r\n      .map(item => parseISO(item.DateExclude || \"\"))\r\n      .sort((a, b) => a.getTime() - b.getTime())\r\n      .map(date => FormatShortDate(date!, true))\r\n  }\r\n\r\n  const datesToExclude = toExclude(daysToExclude)\r\n\r\n  return (\r\n    <>\r\n      {datesToExclude.map((date, index) =>\r\n        <div key={date.replace(' ', '_')} className=\"float-left text-nowrap pt-2 pr-2\">\r\n          {index < datesToExclude.length - 1 ? `${date},` : `${date}`}\r\n        </div>\r\n      )}\r\n    </>\r\n  )\r\n}\r\n\r\nexport default DatesToExclude\r\n","import { useCallback, useState } from \"react\"\r\nimport { Button } from \"react-bootstrap\"\r\nimport { FaRegCalendarCheck } from \"react-icons/fa\"\r\nimport RandomSchedulingExclusionsModal, { DaysToExcludeExt } from \"./RandomSchedulingExclusionsModal\"\r\n\r\nexport interface DatesToExcludeModalProps {\r\n  daysExcluded: DaysToExcludeExt[]\r\n  poolID: number\r\n  classNameButton?: string\r\n  onSave: (list: DaysToExcludeExt[]) => void\r\n}\r\n\r\nconst DatesToExcludeModal = (props: DatesToExcludeModalProps) => {\r\n  const { daysExcluded, poolID, classNameButton, onSave } = props\r\n  const [show, setShow] = useState(false)\r\n\r\n  const handleSave = useCallback((list: DaysToExcludeExt[]) => {\r\n    setShow(false)\r\n    onSave(list)\r\n  }, [onSave])\r\n\r\n  return (\r\n    <>\r\n      <Button variant=\"link\"\r\n        className={`text-uppercase ${classNameButton}`}\r\n        onClick={() => setShow(true)}>\r\n        <span className=\"small\">add dates <FaRegCalendarCheck className=\"inline-block mb-1 p-0\" /></span>\r\n      </Button>\r\n      {show && <RandomSchedulingExclusionsModal\r\n        daysToExclude={daysExcluded}\r\n        poolID={poolID}\r\n        onCancel={() => setShow(false)}\r\n        onSave={handleSave} />}\r\n    </>\r\n  )\r\n}\r\n\r\nexport default DatesToExcludeModal\r\n","import * as React from \"react\"\r\nimport { Modal, Form, Button, Col, Spinner } from \"react-bootstrap\"\r\nimport { Subscription, Subject } from \"rxjs\"\r\nimport { map, debounceTime, distinctUntilChanged } from \"rxjs/operators\"\r\nimport { toast } from \"react-toastify\"\r\nimport LabAccount from \"../../../api/LabService/LabServiceModel/LabAccount\"\r\nimport GovPoolCreateObservable from \"../../../api/Randoms/GovPoolCreate\"\r\nimport GovPoolCreate from \"../../../api/Randoms/GovPoolModel/GovPoolCreate\"\r\nimport { Day } from \"../../../api/Randoms/GovPoolModel/DayOfWeek\"\r\nimport { isCompanyAdmin, isPortalAdmin } from \"../../../authentication/isAdminRole\"\r\nimport { AppState } from \"../../../AppState\"\r\nimport { connect } from \"react-redux\"\r\nimport NumericInput from \"react-numeric-input\"\r\nimport { SampleType, GovPanel } from \"../../../api/Randoms/GovPoolModel/CollectionTypeResponse\"\r\nimport { WeekdaysToExclude } from \"./WeekdaysToExclude\"\r\nimport GovDevice from \"../../../api/Randoms/GovPoolModel/GovDevice\"\r\nimport GovCollection from \"../../OrderRequests/GovCollection\"\r\nimport { MaxDateMonthly, MaxDateWeekly, MinDate } from \"../../../config/Constants\"\r\nimport { DaysToExcludeExt } from \"./RandomSchedulingExclusionsModal\"\r\nimport GetDaysToExclude from \"../../../api/Randoms/GovDaysToExclude\"\r\nimport DatesToExclude from \"./DatesToExclude\"\r\nimport DatesToExcludeModal from \"./DatesToExcludeModal\"\r\n\r\ninterface AddPoolModalProps {\r\n  onHide: () => void\r\n  onSuccess: () => void\r\n}\r\n\r\ninterface AddPoolModalAuthProps {\r\n  selectedCompany?: string\r\n  isCompanyAdmin?: boolean\r\n  isPortalAdmin?: boolean\r\n}\r\n\r\ninterface AddPoolModalState {\r\n  groupName: string\r\n  selectionInterval: string\r\n  selectionFrom: number\r\n  selectionTo: number\r\n  labAccount: string\r\n  sampleType: string\r\n  panel: string\r\n  device: string\r\n  daysToExclude: DaysToExcludeExt[]\r\n  groupNameValid: boolean\r\n  saving: boolean\r\n  loadingAllGroupsExclusions: boolean\r\n  isPOCTDevice?: boolean\r\n  isAccountServiceAvailable?: boolean\r\n  minSelectionFrom: number\r\n  maxSelectionFrom: number\r\n  minSelectionTo: number\r\n  maxSelectionTo: number\r\n}\r\n\r\nexport class AddGovPoolModal extends React.PureComponent<AddPoolModalProps & AddPoolModalAuthProps, AddPoolModalState> {\r\n  state: AddPoolModalState = {\r\n    groupName: \"\",\r\n    selectionInterval: \"\",\r\n    selectionFrom: 1,\r\n    selectionTo: 1,\r\n    labAccount: \"\",\r\n    sampleType: \"\",\r\n    panel: \"\",\r\n    device: \"\",\r\n    daysToExclude: [],\r\n    groupNameValid: true,\r\n    saving: false,\r\n    loadingAllGroupsExclusions: false,\r\n    isPOCTDevice: false,\r\n    isAccountServiceAvailable: true,\r\n    minSelectionFrom: MinDate,\r\n    maxSelectionFrom: MaxDateMonthly,\r\n    minSelectionTo: MinDate,\r\n    maxSelectionTo: MaxDateMonthly\r\n  }\r\n\r\n  groupName$ = new Subject<React.ChangeEvent<HTMLInputElement>>();\r\n  groupNameSubscription?: Subscription\r\n  allGroupsExclusionsLoadSubscription?: Subscription\r\n  saveSubscription?: Subscription\r\n\r\n  componentDidMount() {\r\n    this.setState({ loadingAllGroupsExclusions: true })\r\n    this.allGroupsExclusionsLoadSubscription = GetDaysToExclude().subscribe(\r\n      result => this.setState({ daysToExclude: result, loadingAllGroupsExclusions: false }),\r\n      error => {\r\n        this.setState({ loadingAllGroupsExclusions: false })\r\n        toast.error(error?.errorData?.message || error.message)\r\n      }\r\n    )\r\n\r\n    this.groupNameSubscription = this.groupName$.pipe(\r\n      map(e => e.target.value),\r\n      debounceTime(500),\r\n      distinctUntilChanged()\r\n    ).subscribe(value => {\r\n      this.setState({ groupName: value, groupNameValid: value.length >= 8 })\r\n    });\r\n\r\n    const link = sessionStorage.getItem(\"company-selection-link\") || \"\"\r\n  }\r\n\r\n  componentWillUnmount() {\r\n    this.saveSubscription && this.saveSubscription.unsubscribe()\r\n    this.allGroupsExclusionsLoadSubscription && this.allGroupsExclusionsLoadSubscription.unsubscribe()\r\n    this.groupNameSubscription && this.groupName$.unsubscribe()\r\n  }\r\n\r\n  handleGroupNameChange = (event: React.ChangeEvent<HTMLInputElement>) => {\r\n    this.groupName$.next(event)\r\n  }\r\n\r\n  handleIntervalChange = (event: React.ChangeEvent<HTMLSelectElement>) => {\r\n    const interval = event.target.value\r\n    const { minSelectionFrom, daysToExclude: days = [] } = this.state\r\n    const maxSelectionFrom = this.maxSelectionTo(days, interval)\r\n\r\n    this.setState({\r\n      selectionInterval: interval,\r\n      maxSelectionFrom: maxSelectionFrom,\r\n      selectionFrom: minSelectionFrom,\r\n      selectionTo: minSelectionFrom,\r\n      minSelectionTo: minSelectionFrom,\r\n      maxSelectionTo: maxSelectionFrom\r\n    })\r\n  }\r\n\r\n  handleNumberOfSelectionChange = (value: React.ChangeEvent<HTMLInputElement>) => {\r\n    const minSelectionFrom = Number(value)\r\n    this.setState({ selectionFrom: minSelectionFrom, minSelectionTo: minSelectionFrom })\r\n  }\r\n\r\n  handleMaxNumberSelections = (value: React.ChangeEvent<HTMLInputElement>) => this.setState({ selectionTo: Number(value) })\r\n  handleSampleTypeChange = (sampleType?: SampleType, isPOCTDevice?: boolean) => this.setState({ sampleType: sampleType?.SampleTypeID.toString() || \"\", isPOCTDevice: isPOCTDevice })\r\n  handleLabChange = (lab?: LabAccount) => this.setState({ labAccount: lab?.LabAccount || \"\" })\r\n  handlePanelChange = (panel?: GovPanel) => this.setState({ panel: panel?.ID || \"\" })\r\n  handleDeviceChange = (device?: GovDevice) => this.setState({ device: device?.Code || \"\", panel: device?.PanelCode || \"\" })\r\n\r\n  handleWeekdayToExcludeChange = (event: React.ChangeEvent<HTMLInputElement>, day: Day) => {\r\n    const checked = event.target.checked\r\n    const list = [...this.state.daysToExclude]\r\n    const index = list.findIndex(item => item.DayOfWeekID === day)\r\n    if (index === -1) {\r\n      if (checked) {\r\n        list.push({ ImplementationID: 0, AccountID: 0, DaysToExcludeID: 0, DayOfWeekID: day })\r\n      }\r\n    } else {\r\n      list[index] = { ...list[index], removed: !checked }\r\n    }\r\n\r\n    this.putDaysToExcludeToState(list)\r\n  }\r\n\r\n  handleDaysToExcludeChange = (list: DaysToExcludeExt[]) => this.putDaysToExcludeToState(list)\r\n\r\n  putDaysToExcludeToState = (list: DaysToExcludeExt[]) => {\r\n    const { selectionInterval, selectionTo, selectionFrom } = this.state\r\n\r\n    const activeDaysToExclude = list.filter(item => !item.removed)\r\n    const maxSelectionFrom = this.maxSelectionTo(activeDaysToExclude, selectionInterval)\r\n    this.setState({\r\n      daysToExclude: list,\r\n      maxSelectionFrom: maxSelectionFrom,\r\n      selectionFrom: this.calcIntervalValue(activeDaysToExclude, selectionInterval, selectionFrom),\r\n      maxSelectionTo: maxSelectionFrom,\r\n      selectionTo: this.calcIntervalValue(activeDaysToExclude, selectionInterval, selectionTo)\r\n    })\r\n  }\r\n\r\n  maxSelectionTo = (days: DaysToExcludeExt[], selectionInterval: string) => {\r\n    switch (selectionInterval) {\r\n      case \"Weekly\":\r\n        return MaxDateWeekly - days.filter(item => item.DayOfWeekID).length\r\n      case \"Monthly\":\r\n        return MaxDateMonthly - days.filter(item => item.DayOfWeekID).length * 4\r\n      default:\r\n        return MaxDateMonthly\r\n    }\r\n  }\r\n\r\n  calcIntervalValue = (days: DaysToExcludeExt[], selectionInterval: string, currentValue: number) => {\r\n    const maxSelectionFrom = this.maxSelectionTo(days, selectionInterval)\r\n    return currentValue === 0 || currentValue > maxSelectionFrom ? maxSelectionFrom : currentValue\r\n  }\r\n\r\n  isValid = () => {\r\n    return this.state.groupName\r\n      && this.state.groupNameValid\r\n      && this.state.selectionInterval\r\n      && this.state.selectionFrom\r\n      && this.state.labAccount\r\n      && this.state.panel\r\n      && (!this.state.isPOCTDevice || (this.state.isPOCTDevice && this.state.device))\r\n      && this.state.selectionFrom <= this.state.selectionTo\r\n  }\r\n\r\n  performSave = () => {\r\n    const pool: GovPoolCreate = {\r\n      Name: this.state.groupName,\r\n      SelectionInterval: this.state.selectionInterval,\r\n      NumberOfSelections: this.state.selectionFrom,\r\n      MaxNumberSelections: this.state.selectionTo,\r\n      LaboratoryAccount: this.state.labAccount,\r\n      SampleTypeID: Number(this.state.sampleType),\r\n      DefaultPanel: this.state.panel,\r\n      DefaultDevice: this.state.isPOCTDevice ? this.state.device : \"\",\r\n      Inactive: false,\r\n      DaysExcluded: this.state.daysToExclude.map(item => {\r\n        const { removed, ...rest } = item\r\n        return { ...rest, DoRemove: (item.DaysToExcludeID ?? 0) > 0 && removed }\r\n      })\r\n    }\r\n    this.setState({ saving: true })\r\n\r\n    this.saveSubscription = GovPoolCreateObservable(pool).subscribe(\r\n      () => {\r\n        toast.success(\"Group created successfully.\")\r\n        this.setState({ saving: false })\r\n        this.props.onSuccess()\r\n      },\r\n      error => {\r\n        this.setState({ saving: false })\r\n        toast.error(error?.errorData?.message || error.message)\r\n      }\r\n    )\r\n  }\r\n  \r\n  daysToExcludeWithoutRemoved = () => this.state.daysToExclude.filter(item => !item.removed)\r\n\r\n  render() {\r\n    const { onHide } = this.props\r\n\r\n    return <>\r\n      <Modal backdrop=\"static\" centered show onHide={onHide} size=\"xl\">\r\n        <Modal.Header closeButton>\r\n          <Modal.Title>Create New Group</Modal.Title>\r\n        </Modal.Header>\r\n        <Modal.Body>\r\n          <Form>\r\n            <Form.Row className=\"form-group required\">\r\n              <Form.Label column sm={5} htmlFor=\"groupName\">Group Name</Form.Label>\r\n              <Col sm={7}>\r\n                <Form.Control id=\"groupName\" type=\"text\" onChange={this.handleGroupNameChange} maxLength={65} isInvalid={!this.state.groupNameValid} />\r\n                <Form.Control.Feedback type=\"invalid\">Group Name should contain at least 8 characters</Form.Control.Feedback>\r\n              </Col>\r\n            </Form.Row>\r\n            <Form.Row className=\"form-group required\">\r\n              <Form.Label column sm={5} htmlFor=\"selectionInterval\">Selection Interval</Form.Label>\r\n              <Col sm={7}>\r\n                <Form.Control id=\"selectionInterval\" as=\"select\" onChange={this.handleIntervalChange}>\r\n                  <option value=\"\">Select</option>\r\n                  <option value=\"Weekly\">Weekly</option>\r\n                  <option value=\"Monthly\">Monthly</option>\r\n                </Form.Control>\r\n              </Col>\r\n            </Form.Row>\r\n            <Form.Row className=\"form-group\">\r\n              <Form.Label column sm={5} htmlFor=\"SelectionFrom\" className=\"required\">Number of Selections / Interval</Form.Label>\r\n              <Col sm={2} />\r\n              <Col sm={2}>\r\n                <Form.Control as={NumericInput} id=\"SelectionFrom\" min={this.state.minSelectionFrom} max={this.state.maxSelectionFrom} value={this.state.selectionFrom} strict onChange={this.handleNumberOfSelectionChange} />\r\n              </Col>\r\n              <Form.Label column sm={1} htmlFor=\"SelectionTo\" className=\"text-right\">To</Form.Label>\r\n              <Col sm={2}>\r\n                <Form.Control as={NumericInput} id=\"SelectionTo\" strict\r\n                  min={this.state.minSelectionTo}\r\n                  max={this.state.maxSelectionTo}\r\n                  value={this.state.selectionTo}\r\n                  onChange={this.handleMaxNumberSelections} />\r\n              </Col>\r\n            </Form.Row>\r\n            <GovCollection\r\n              editing\r\n              labAccount={this.state.labAccount || \"\"}\r\n              serviceDOT={false}\r\n              sampleTypeID={Number(this.state.sampleType)}\r\n              panel={this.state.panel || \"\"}\r\n              companyID={Number(this.props.selectedCompany)}\r\n              onTypeChange={this.handleSampleTypeChange}\r\n              onLabChange={this.handleLabChange}\r\n              onPanelChange={this.handlePanelChange}\r\n              onDeviceChange={this.handleDeviceChange} />\r\n            <Form.Row className=\"form-group\">\r\n              <Form.Label column sm={5}>Days of Week to Exclude</Form.Label>\r\n              <Col className=\"d-flex\">\r\n                {this.state.loadingAllGroupsExclusions\r\n                  ? <Spinner animation=\"border\" size=\"sm\" />\r\n                  : <WeekdaysToExclude editable daysToExclude={this.daysToExcludeWithoutRemoved()} handlerChange={this.handleWeekdayToExcludeChange} />}\r\n              </Col>\r\n            </Form.Row>\r\n            <Form.Row>\r\n              <Form.Label column sm={3}>Dates to Exclude</Form.Label>\r\n              <Col sm={2} className=\"align-items-top\">\r\n                {!this.state.loadingAllGroupsExclusions &&\r\n                  <DatesToExcludeModal\r\n                    classNameButton=\"float-right\"\r\n                    poolID={0}\r\n                    daysExcluded={this.state.daysToExclude}\r\n                    onSave={this.handleDaysToExcludeChange} />}\r\n              </Col>\r\n              <Col sm={7} className=\"align-items-top\">\r\n                <DatesToExclude daysToExclude={this.daysToExcludeWithoutRemoved()} />\r\n              </Col>\r\n            </Form.Row>\r\n          </Form>\r\n        </Modal.Body>\r\n        <Modal.Footer>\r\n          <Button variant=\"secondary\" onClick={onHide}>CANCEL</Button>\r\n          <Button variant=\"primary\" onClick={this.performSave} disabled={!this.isValid()}>SUBMIT</Button>\r\n        </Modal.Footer>\r\n      </Modal>\r\n    </>\r\n  }\r\n}\r\n\r\nfunction mapStateToProps(state: AppState): AddPoolModalAuthProps {\r\n  return {\r\n    selectedCompany: state.Workforce1State.selectedCompany,\r\n    isCompanyAdmin: isCompanyAdmin(state),\r\n    isPortalAdmin: isPortalAdmin(state)\r\n  }\r\n}\r\nconst ConnectedAddGovPoolModal = connect(mapStateToProps, null)(AddGovPoolModal)\r\nexport default ConnectedAddGovPoolModal\r\n","import { ObservableFromFetch } from \"../ObservableFromFetch\"\r\n\r\nexport function SelectionReportPrint(selectionInterval: string) {\r\n  const requestBody: string = new URLSearchParams({\r\n    selectionInterval: selectionInterval\r\n  }).toString()\r\n\r\n  return ObservableFromFetch<string>(\"GovPool/GroupSelectionPdfReport?\" + requestBody)\r\n}\r\n","import * as React from \"react\"\r\nimport { Container, Row, Col, Spinner, Table, Button } from \"react-bootstrap\"\r\nimport { toast } from \"react-toastify\"\r\nimport { Subscription } from \"rxjs\"\r\nimport GovPoolStatisticsDetailsGet from \"../../../api/Randoms/GovPoolStatisticsDetailsGet\"\r\nimport GovPoolStatisticsDetails from \"../../../api/Randoms/RandomsModel/GovPoolStatisticsDetails\"\r\nimport { SelectionReportPrint } from \"../../../api/Randoms/SelectionReportPrint\"\r\n\r\ninterface PoolStatisticsProps {\r\n  poolId: number\r\n  poolName: string\r\n}\r\n\r\ninterface PoolStatisticsState {\r\n  statisticsLoading: boolean\r\n  statistics?: GovPoolStatisticsDetails[]\r\n}\r\n\r\nexport default class PoolStatistics extends React.PureComponent<PoolStatisticsProps, PoolStatisticsState> {\r\n  state: PoolStatisticsState = {\r\n    statisticsLoading: false\r\n  }\r\n\r\n  statisticsSubscription?: Subscription\r\n  printSubscription?: Subscription\r\n\r\n  componentDidMount() {\r\n    this.setState({ statisticsLoading: true })\r\n    this.statisticsSubscription = GovPoolStatisticsDetailsGet(this.props.poolId).subscribe(\r\n      (data: GovPoolStatisticsDetails[]) =>\r\n          this.setState({\r\n            statisticsLoading: false,\r\n            statistics: data\r\n          }),\r\n      () => this.setState({ statisticsLoading: false }))\r\n  }\r\n\r\n  componentWillUnmount() {\r\n    this.printSubscription && this.printSubscription.unsubscribe()\r\n    this.statisticsSubscription && this.statisticsSubscription.unsubscribe()\r\n  }\r\n\r\n  print(base64pdf: string) {\r\n    const pdfWindow = window.open(\"\")\r\n    if (pdfWindow) {\r\n      pdfWindow.document.write(\"<iframe width='100%' height='100%' src='data:application/pdf;base64, \" + encodeURI(base64pdf) + \"'></iframe>\")\r\n    }\r\n  }\r\n\r\n  handleGroupSelectionClick = (row: GovPoolStatisticsDetails) => {\r\n    this.printSubscription && this.printSubscription.unsubscribe()\r\n    this.printSubscription = SelectionReportPrint(row.Period).subscribe(\r\n      data => this.print(data),\r\n      error => toast.error(error)\r\n    )\r\n  }\r\n\r\n  renderRows = () => {\r\n    const { statistics } = this.state\r\n    if (statistics && statistics.length) {\r\n      return statistics.map((row: GovPoolStatisticsDetails, i: number) =>\r\n        <tr key={i}>\r\n          <td><Button variant=\"link\" onClick={() => this.handleGroupSelectionClick(row)} className=\"p-0\">{row.Period}</Button></td>\r\n          <td className=\"text-center\">{row.GroupSize}</td>\r\n          <td className=\"text-center\">{row.SelectionDate}</td>\r\n          <td className=\"text-center\">{row.TestsCompleted === 0 ? \"\" : row.TestsCompleted}</td>\r\n          <td className=\"text-center\">{row.NoShow === 0 ? \"\" : row.NoShow}</td>\r\n        </tr>)\r\n    } else {\r\n      return <tr><td colSpan={5}>NO DATA FOUND</td></tr>\r\n    }\r\n  }\r\n\r\n  render() {\r\n    return <>\r\n      <Container fluid className=\"grid-container\">\r\n        <Row>\r\n          <Col>\r\n            <h5>TESTING PERIOD BREAKDOWN</h5>\r\n          </Col>\r\n        </Row>\r\n        <Table responsive className=\"table-sm dark\">\r\n          <thead>\r\n            <tr className=\"text-normal\">\r\n              <th className=\"border-bottom-0\">Period</th>\r\n              <th className=\"border-bottom-0 text-center\">Group Size</th>\r\n              <th className=\"border-bottom-0 text-center\">Selection Date</th>\r\n              <th className=\"border-bottom-0 text-center\">Tests Completed</th>\r\n              <th className=\"border-bottom-0 text-center\">No Show</th>\r\n            </tr>\r\n          </thead>\r\n          <tbody>\r\n            {\r\n              this.state.statisticsLoading ?\r\n                <tr>\r\n                  <td className=\"text-center\" colSpan={5}>\r\n                    <Spinner animation=\"border\" variant=\"secondary\" />\r\n                  </td>\r\n                </tr> : this.renderRows()\r\n            }\r\n          </tbody>\r\n        </Table>\r\n      </Container>\r\n    </>\r\n  }\r\n}\r\n","import { Observable } from \"rxjs\"\r\nimport GovPoolStatisticsDetails from \"./RandomsModel/GovPoolStatisticsDetails\"\r\nimport { ObservableFromFetch } from \"../ObservableFromFetch\"\r\n\r\nexport default function GovPoolStatisticsDetailsGetObservable(poolId: number): Observable<GovPoolStatisticsDetails[]> {\r\n  const requestBody: string = new URLSearchParams({\r\n    govPoolId: poolId.toString()\r\n  }).toString()\r\n\r\n  return ObservableFromFetch<GovPoolStatisticsDetails[]>(\"GovPool/GetGovPoolStatistics?\" + requestBody)\r\n}\r\n","import { ObservableFromFetch } from \"../ObservableFromFetch\"\r\nimport GridRow from \"./GovPoolModel/GridRow\"\r\n\r\nexport default function PoolUpdateObservable(data: GridRow) {\r\n  const params: string = JSON.stringify(data)\r\n\r\n  return ObservableFromFetch<string>(\"GovPool/UpdateGovPool\", params, \"post\")\r\n}\r\n","import * as React from \"react\"\r\nimport { Form, Button, Col, Spinner } from \"react-bootstrap\"\r\nimport { Subscription } from \"rxjs\"\r\nimport { toast } from \"react-toastify\"\r\nimport { FaPencilAlt, FaTimes } from \"react-icons/fa\"\r\nimport { Day } from \"../../../api/Randoms/GovPoolModel/DayOfWeek\"\r\nimport GovPoolUpdateObservable from \"../../../api/Randoms/GovPoolUpdate\"\r\nimport { WeekdaysToExclude } from \"./WeekdaysToExclude\"\r\nimport ActionButton from \"../../ActionButton\"\r\nimport ConfirmationModal from \"../../ConfirmationModal\"\r\nimport GridRow from \"../../../api/Randoms/GovPoolModel/GridRow\"\r\nimport { SampleType, GovPanel } from \"../../../api/Randoms/GovPoolModel/CollectionTypeResponse\"\r\nimport GovDevice from \"../../../api/Randoms/GovPoolModel/GovDevice\"\r\nimport LabAccount from \"../../../api/LabService/LabServiceModel/LabAccount\"\r\nimport GovCollection from \"../../OrderRequests/GovCollection\"\r\nimport { DaysToExcludeExt } from \"./RandomSchedulingExclusionsModal\"\r\nimport GetDaysToExclude from \"../../../api/Randoms/GovDaysToExclude\"\r\nimport DatesToExclude from \"./DatesToExclude\"\r\nimport DatesToExcludeModal from \"./DatesToExcludeModal\"\r\n\r\ninterface GovPoolGeneralInfoProps {\r\n  details: GridRow\r\n  onUpdate: (updated: boolean) => void\r\n}\r\n\r\ninterface GovPoolGeneralInfoState {\r\n  data: GridRow\r\n  editing: boolean\r\n  saving: boolean\r\n  loadingDaysExcluded: boolean\r\n  showSaveConfirmModal: boolean\r\n\r\n  sampleTypeID?: number\r\n  isPOCTDevice?: boolean\r\n  labAccount?: string\r\n  panelID?: string\r\n  deviceCode?: string\r\n\r\n  daysExcluded: DaysToExcludeExt[]\r\n}\r\n\r\nexport default class GovPoolGeneralInfo extends React.PureComponent<GovPoolGeneralInfoProps, GovPoolGeneralInfoState> {\r\n  state: GovPoolGeneralInfoState = {\r\n    data: { ...this.props.details },\r\n    sampleTypeID: this.props.details.SampleTypeID,\r\n    labAccount: this.props.details.LaboratoryAccount,\r\n    panelID: this.props.details.DefaultPanel,\r\n    deviceCode: this.props.details.DefaultDevice,\r\n    editing: false,\r\n    saving: false,\r\n    loadingDaysExcluded: false,\r\n    showSaveConfirmModal: false,\r\n    daysExcluded: [...this.props.details.DaysExcluded]\r\n  }\r\n\r\n  updateSubscription?: Subscription\r\n  loadDaysExcludedSubscription?: Subscription\r\n\r\n  componentDidMount() {\r\n\r\n  }\r\n\r\n  componentWillUnmount() {\r\n    this.updateSubscription?.unsubscribe()\r\n    this.loadDaysExcludedSubscription?.unsubscribe()\r\n  }\r\n\r\n  componentDidUpdate(prevProps: GovPoolGeneralInfoProps, prevState: GovPoolGeneralInfoState) {\r\n    if (this.state.data !== prevState.data && this.state.loadingDaysExcluded === prevState.loadingDaysExcluded) {\r\n      this.setState({ loadingDaysExcluded: true })\r\n      this.loadDaysExcludedSubscription?.unsubscribe()\r\n      this.loadDaysExcludedSubscription = GetDaysToExclude(this.state.data.PoolID).subscribe(\r\n        result => {\r\n          this.setState(prevState => {\r\n            return {\r\n              ...prevState,\r\n              data: { ...prevState.data, DaysExcluded: result },\r\n              daysExcluded: result,\r\n              loadingDaysExcluded: false\r\n            }\r\n          })\r\n        },\r\n        error => {\r\n          this.setState({ loadingDaysExcluded: false })\r\n          toast.error(error?.errorData?.message || error.message)\r\n        }\r\n      )\r\n    }\r\n  }\r\n\r\n  handleToggleEditMode = () => {\r\n    if (this.state.editing) {\r\n      this.setState({\r\n        sampleTypeID: this.state.data.SampleTypeID,\r\n        labAccount: this.state.data.LaboratoryAccount,\r\n        panelID: this.state.data.DefaultPanel,\r\n        deviceCode: this.state.data.DefaultDevice,\r\n        daysExcluded: this.state.data.DaysExcluded,\r\n        isPOCTDevice: this.state.isPOCTDevice\r\n      })\r\n    }\r\n    this.setState({ editing: !this.state.editing })\r\n  }\r\n\r\n  handleTypeChange = (type?: SampleType, isPOCTDevice?: boolean) => this.setState({ sampleTypeID: type?.SampleTypeID, isPOCTDevice: isPOCTDevice })\r\n  handleLabChange = (lab?: LabAccount) => this.setState({ labAccount: lab?.LabAccount })\r\n  handlePanelChange = (panel?: GovPanel) => this.setState({ panelID: panel?.ID })\r\n  handleDeviceChange = (device?: GovDevice) => this.setState({ deviceCode: device?.Code.toString() })\r\n\r\n  handleWeekdayToExcludeChange = (event: React.ChangeEvent<HTMLInputElement>, day: Day) => {\r\n    const checked = event.target.checked\r\n    const list = [...this.state.daysExcluded]\r\n    const index = list.findIndex(item => item.DayOfWeekID === day)\r\n    if (index === -1) {\r\n      if (checked) {\r\n        list.push({ ImplementationID: 0, AccountID: 0, DaysToExcludeID: 0, DayOfWeekID: day })\r\n      }\r\n    } else {\r\n      list[index] = { ...list[index], removed: !checked }\r\n    }\r\n\r\n    this.setState({ daysExcluded: list })\r\n  }\r\n\r\n  handleDaysToExcludeChange = (list: DaysToExcludeExt[]) => {\r\n    const addedAndRemovedDays = list.filter(item => !(item.removed && item.DaysToExcludeID === 0))\r\n    this.setState({\r\n      daysExcluded: [...addedAndRemovedDays]\r\n    })\r\n  }\r\n\r\n  handleSubmit = () => {\r\n    if (!this.isValid()) {\r\n      return\r\n    }\r\n    this.setState({ showSaveConfirmModal: true })\r\n  }\r\n\r\n  isValid = (): boolean => {\r\n    const changes = [\r\n      Number(this.state.sampleTypeID) > 0,\r\n      !!this.state.labAccount,\r\n      !!this.state.panelID,\r\n      (!this.state.isPOCTDevice || (this.state.isPOCTDevice && !!this.state.deviceCode))\r\n    ]\r\n    return changes.every((valid: boolean) => valid)\r\n  }\r\n\r\n  performSave = () => {\r\n    this.setState({ saving: true, showSaveConfirmModal: false })\r\n    this.updateSubscription?.unsubscribe()\r\n    const data = {\r\n      ...this.state.data,\r\n      SampleTypeID: Number(this.state.sampleTypeID),\r\n      LaboratoryAccount: String(this.state.labAccount),\r\n      DefaultPanel: String(this.state.panelID),\r\n      DefaultDevice: String(this.state.deviceCode),\r\n      DaysExcluded: this.state.daysExcluded.filter(item => !(item.removed && item.DaysToExcludeID === 0)).map(item => {\r\n        const { removed, ...rest } = item\r\n        return { ...rest, DoRemove: (item.DaysToExcludeID ?? 0) > 0 && removed }\r\n      })\r\n    }\r\n\r\n    this.updateSubscription = GovPoolUpdateObservable(data).subscribe(\r\n      () => {\r\n        toast.success(\"Updated group details successfully.\")\r\n        this.setState({ saving: false, data: data })\r\n        this.props.onUpdate(true)\r\n        this.handleToggleEditMode()\r\n      },\r\n      () => {\r\n        this.setState({ saving: false })\r\n        toast.error(\"Error updating group details\")\r\n      }\r\n    )\r\n  }\r\n\r\n  daysToExcludeWithoutRemoved = () => this.state.daysExcluded.filter(item => !item.removed)\r\n\r\n  render() {\r\n    const { editing, daysExcluded } = this.state\r\n\r\n    return <>\r\n      <Form className=\"p-4 pt-3\">\r\n        <Form.Row>\r\n          <Col>{<h5>MODIFY GROUP CONFIGURATION</h5>}</Col>\r\n          <Col xs={1}>\r\n            <h5>\r\n              <Button variant=\"icon-link\" size=\"sm\" className=\"float-right ml-1 btn-icon-primary\" onClick={this.handleToggleEditMode}>\r\n                {!editing && <FaPencilAlt />}\r\n                {editing && <FaTimes />}\r\n              </Button>\r\n            </h5>\r\n          </Col>\r\n        </Form.Row>\r\n        <Form.Row className={\"form-group\"}>\r\n          <Form.Label column sm={5}>Group Name</Form.Label>\r\n          <Col sm={7} className=\"d-flex align-items-center\">\r\n            {this.props.details.Name}\r\n          </Col>\r\n        </Form.Row>\r\n        <Form.Row className={\"form-group\"}>\r\n          <Form.Label column sm={5} htmlFor=\"selectionInterval\">Selection Interval</Form.Label>\r\n          <Col sm={7} className=\"d-flex align-items-center\">\r\n            {this.props.details.SelectionInterval}\r\n          </Col>\r\n        </Form.Row>\r\n        <Form.Row className=\"form-group\">\r\n          <Form.Label column sm={5} htmlFor=\"numberOfSelections\">Number of Selections / Interval </Form.Label>\r\n          <Col sm={7} className=\"d-flex align-items-center\">\r\n            {this.props.details.NumberOfSelections} to {this.props.details.MaxNumberSelections || this.props.details.NumberOfSelections}\r\n          </Col>\r\n        </Form.Row>\r\n        <GovCollection\r\n          editing={editing}\r\n          labAccount={this.state.labAccount}\r\n          serviceDOT={false}\r\n          sampleTypeID={this.state.sampleTypeID}\r\n          panel={this.state.panelID}\r\n          device={this.state.deviceCode}\r\n          companyID={this.state.data.AccountID}\r\n          onTypeChange={this.handleTypeChange}\r\n          onLabChange={this.handleLabChange}\r\n          onPanelChange={this.handlePanelChange}\r\n          onDeviceChange={this.handleDeviceChange}\r\n        />\r\n        <Form.Row className=\"form-group\">\r\n          <Form.Label column sm={5} htmlFor=\"daysToExclude\">Days of Week to Exclude</Form.Label>\r\n          <Col className=\"d-flex align-items-center\">\r\n            {this.state.loadingDaysExcluded\r\n              ? <Spinner animation=\"border\" size=\"sm\" />\r\n              : <WeekdaysToExclude editable={editing} daysToExclude={this.daysToExcludeWithoutRemoved()} handlerChange={this.handleWeekdayToExcludeChange} />}\r\n          </Col>\r\n        </Form.Row>\r\n        <Form.Row>\r\n          <Form.Label column sm={3}>Dates to Exclude</Form.Label>\r\n          <Col sm={2} className=\"align-items-top\">\r\n            {!this.state.loadingDaysExcluded && editing &&\r\n              <DatesToExcludeModal\r\n                classNameButton=\"float-right\"\r\n                poolID={this.state.data.PoolID}\r\n                daysExcluded={this.state.daysExcluded}\r\n                onSave={this.handleDaysToExcludeChange} />}\r\n          </Col>\r\n          <Col sm={7} className=\"align-items-center\">\r\n            <DatesToExclude daysToExclude={this.daysToExcludeWithoutRemoved()} />\r\n          </Col>\r\n        </Form.Row>\r\n        <Form.Row className=\"buttons-block\" hidden={!editing}>\r\n          <Button variant=\"secondary\" onClick={this.handleToggleEditMode}>CANCEL</Button>\r\n          <ActionButton variant=\"primary\" onClick={this.handleSubmit} spin={this.state.saving} disabled={!this.isValid()} disableOnSpin>SAVE</ActionButton>\r\n        </Form.Row>\r\n      </Form>\r\n      <ConfirmationModal show={this.state.showSaveConfirmModal}\r\n        title=\"CONFIRMATION\"\r\n        textTitle=\"Are you sure you want to submit?\"\r\n        text=\"You have made modification to this group configuration. Changes will be applied to the next random selection for this group.\"\r\n        onConfirm={this.performSave}\r\n        onHide={() => this.setState({ showSaveConfirmModal: false })} />\r\n    </>\r\n  }\r\n}\r\n","import * as React from \"react\"\r\nimport { Tab, Tabs, Row, Col, Modal } from \"react-bootstrap\"\r\nimport PoolStatistics from \"../GovPools/PoolStatistics\"\r\nimport GovPoolGeneralInfo from \"./PoolGeneralInfo\"\r\nimport ImportPoolMembers from \"../Pools/ImportPoolMembers\"\r\nimport { AppState, CurrentUserPermissions } from \"../../../AppState\"\r\nimport { connect } from \"react-redux\"\r\nimport GridRow from \"../../../api/Randoms/GovPoolModel/GridRow\"\r\nimport { BuildUserAccess } from \"../../../authentication/BuildUserAccess\"\r\nimport { control } from \"leaflet\"\r\n\r\nexport interface PoolDetailsModalProps {\r\n  details: GridRow\r\n  onHide: (hasUpdates: boolean) => void\r\n}\r\nexport interface PoolDetailsModalAppStateProps {\r\n  showRunRandom: boolean\r\n  showPersonnelImport: boolean\r\n}\r\n\r\ninterface PoolDetailsModalState {\r\n  currentTab: string\r\n  updated: boolean\r\n}\r\n\r\nconst StatisticsKey = \"statistics\"\r\nconst GeneralInformationKey = \"general_information\"\r\n\r\nexport class PoolDetailsModal extends React.PureComponent<PoolDetailsModalProps & PoolDetailsModalAppStateProps, PoolDetailsModalState> {\r\n  state: PoolDetailsModalState = {\r\n    currentTab: StatisticsKey,\r\n    updated: false\r\n  }\r\n\r\n  onHide = () => { this.props.onHide(this.state.updated) }\r\n  onUpdate = () => this.setState({ updated: true })\r\n  handleRunFinish = () => this.setState({ currentTab: StatisticsKey })\r\n\r\n  render() {\r\n    const {details } = this.props\r\n\r\n    return (\r\n      <Modal backdrop=\"static\" show={true} onHide={this.onHide} size=\"xl\" dialogClassName=\"modal-90w\">\r\n        <Modal.Header closeButton>\r\n          <Modal.Title>GROUP DETAILS</Modal.Title>\r\n        </Modal.Header>\r\n        <Modal.Body className=\"p-0\">\r\n          <div className=\"tab-container\">\r\n            <Row className=\"px-0 pt-2\">\r\n              <Col>\r\n                <h4 className=\"px-4\"><span className=\"text-uppercase\">{details.Name}</span></h4>\r\n                <Tabs defaultActiveKey={StatisticsKey} activeKey={this.state.currentTab} className=\"px-4 py-2\" onSelect={(eventKey) => { eventKey && this.setState({ currentTab: eventKey }) }}>\r\n                  <Tab eventKey={StatisticsKey} title=\"STATISTICS\">\r\n                    {StatisticsKey === this.state.currentTab && <PoolStatistics poolId={details.PoolID} poolName={details.Name} />}\r\n                  </Tab>\r\n                  <Tab eventKey={GeneralInformationKey} title=\"GENERAL INFORMATION\">\r\n                    {GeneralInformationKey === this.state.currentTab && <GovPoolGeneralInfo details={details} onUpdate={this.onUpdate} />}\r\n                  </Tab>\r\n                  {this.props.showPersonnelImport && <Tab eventKey=\"personnel_import\" title=\"PERSONNEL IMPORT\">\r\n                    <ImportPoolMembers poolID={details.PoolID} isGovt onUpdate={this.onUpdate} />\r\n                  </Tab>}\r\n                </Tabs>\r\n              </Col>\r\n            </Row>\r\n          </div>\r\n        </Modal.Body>\r\n      </Modal>\r\n    )\r\n  }\r\n}\r\n\r\nfunction mapStateToProps(state: AppState): PoolDetailsModalAppStateProps{\r\n  const userAccess = BuildUserAccess(state);\r\n  return {\r\n    showRunRandom: userAccess.CanManageGovPools,\r\n    showPersonnelImport: userAccess.CanManageGovDonors,\r\n  }\r\n}\r\nconst ConnectedPoolDetailsModal = connect(mapStateToProps)(PoolDetailsModal)\r\nexport default ConnectedPoolDetailsModal\r\n","import { ObservableFromFetch } from \"../ObservableFromFetch\"\r\n\r\nexport default function GovPoolSelectionUpdate(DateSelected: string, DaysSelectedID: number) {\r\n  const params = JSON.stringify({\r\n    DateSelected: DateSelected,\r\n    DaysSelectedID: DaysSelectedID\r\n  })\r\n\r\n  return ObservableFromFetch<string>(\"GovPool/UpdateGovDaysSelected\", params, \"post\")\r\n}\r\n","import * as React from \"react\"\r\nimport { Row, Col, Modal, Form } from \"react-bootstrap\"\r\nimport DatePicker from 'react-datepicker'\r\nimport 'react-datepicker/dist/react-datepicker.css'\r\nimport { toast } from \"react-toastify\"\r\nimport { Subscription } from \"rxjs\"\r\nimport GovPoolSelection from \"../../../api/Randoms/GovPoolModel/GovPoolSelection\"\r\nimport { GovPoolSelectionGet } from \"../../../api/Randoms/GovPoolSelectionGet\"\r\nimport GovPoolSelectionUpdate from \"../../../api/Randoms/GovPoolSelectioUpdate\"\r\nimport FormatDate from \"../../../formatters/FormatDate\"\r\nimport FormatError from \"../../../formatters/FormatError\"\r\nimport ActionButton from \"../../ActionButton\"\r\nimport { BirthdayInput } from \"../../FormattedInputs/BirthdayInput\"\r\nimport DaysToExclude from \"../../../api/Randoms/GovPoolModel/DaysToExclude\"\r\nimport { parseISO } from \"date-fns\"\r\n\r\ntype SelectionInterval = 'Monthly' | 'Weekly'\r\n\r\nexport interface GovPoolDateSelectedModalProps {\r\n  onHide: () => void\r\n  onSuccess: () => void\r\n  dateSelected: Date\r\n  dateSelectedID: number\r\n  interval: SelectionInterval\r\n  daysExcluded: DaysToExclude[]\r\n}\r\n\r\ninterface GovPoolDateSelectedModalState {\r\n  govPoolSelection?: GovPoolSelection\r\n  dateSelected: Date\r\n  maxDate: Date\r\n  minDate: Date\r\n}\r\n\r\nexport default class GovPoolDateSelected extends React.PureComponent<GovPoolDateSelectedModalProps, GovPoolDateSelectedModalState> {\r\n\r\n  state: GovPoolDateSelectedModalState = {\r\n    govPoolSelection: undefined,\r\n    dateSelected: new Date(this.props.dateSelected),\r\n    maxDate: new Date(),\r\n    minDate: new Date()\r\n  }\r\n\r\n  govPoolSelectionSubcription?: Subscription\r\n  govSelectionSubcriptionUpdate?: Subscription\r\n\r\n  componentDidMount() {\r\n    this.loadGovPoolSelection()\r\n  }\r\n\r\n  componentDidUpdate(prevProps: GovPoolDateSelectedModalProps) {\r\n    if (this.props.dateSelectedID != prevProps.dateSelectedID) {\r\n      this.loadGovPoolSelection()\r\n    }\r\n  }\r\n\r\n  componentWillUnmount() {\r\n    this.govPoolSelectionSubcription && this.govPoolSelectionSubcription.unsubscribe()\r\n    this.govSelectionSubcriptionUpdate && this.govSelectionSubcriptionUpdate.unsubscribe()\r\n  }\r\n\r\n  loadGovPoolSelection() {\r\n    this.govPoolSelectionSubcription = GovPoolSelectionGet(this.props.dateSelectedID).subscribe(\r\n      (data: GovPoolSelection) => {\r\n        let selectionPeriod = data?.SelectionPeriod\r\n        let { minDate, maxDate } = this.calcDateRange()\r\n        this.setState({ govPoolSelection: data, minDate: minDate, maxDate: maxDate })\r\n      },\r\n    )\r\n  }\r\n\r\n  addDays(date: Date, days: number): Date {\r\n    var result = new Date(date)\r\n    result.setDate(result.getDate() + days)\r\n    return result\r\n  }\r\n\r\n  calcSelectionPeriod(dateEnd: Date, dateSelected: Date): number {\r\n    let resultingDate = new Date(dateEnd.getTime() - dateSelected.getTime())\r\n    return resultingDate.getDate()\r\n  }\r\n\r\n  calcDateRange() {\r\n    let minDate = new Date()\r\n    minDate.setDate(minDate.getDate() + 1)\r\n\r\n    let maxDate = new Date()\r\n    let selectionDays = this.props.interval === \"Weekly\" ? 7 : this.props.interval === \"Monthly\" ? 30 : 120\r\n    maxDate = this.addDays(maxDate, selectionDays)\r\n\r\n    return { minDate, maxDate }\r\n  }\r\n\r\n  onHide = () => { this.props.onHide() }\r\n\r\n  dateValid = () => {\r\n    return this.state.dateSelected\r\n  }\r\n\r\n  performSave = () => {\r\n    this.govSelectionSubcriptionUpdate = GovPoolSelectionUpdate(FormatDate(this.state.dateSelected), this.props.dateSelectedID).subscribe(\r\n      data => {\r\n        toast.success(data)\r\n        this.props.onSuccess()\r\n      },\r\n      (error) => {\r\n        toast.error(FormatError(error))\r\n      })\r\n  }\r\n\r\n  render() {\r\n    const { dateSelected, maxDate, minDate } = this.state\r\n    const weekdaysExcluded = this.props.daysExcluded.filter(item => item.DayOfWeekID).map(item => item.DayOfWeekID!)\r\n    const datesExcluded = this.props.daysExcluded.filter(item => item.DateExclude).map(item => parseISO(item.DateExclude!).getTime())\r\n    return (\r\n      <Modal backdrop=\"static\" show centered onHide={this.onHide}>\r\n        <Modal.Header closeButton>\r\n          <Modal.Title>CHANGE DATE</Modal.Title>\r\n        </Modal.Header>\r\n        <Modal.Body className=\"p-0\">\r\n          <Form.Row className=\"form-group p-3\">\r\n            <Col />\r\n            <Form.Label column md={4}>Date Scheduled</Form.Label>\r\n            <Col md={5}>\r\n              <DatePicker className=\"form-control\"\r\n                peekNextMonth\r\n                showMonthDropdown\r\n                showYearDropdown\r\n                dropdownMode=\"select\"\r\n                minDate={minDate}\r\n                maxDate={maxDate}\r\n                selected={dateSelected}\r\n                enableTabLoop={false}\r\n                onChange={date => this.setState({ dateSelected: date as Date || undefined })}\r\n                filterDate={date => !weekdaysExcluded.includes(date.getDay() + 1) && !datesExcluded.includes(date.getTime())}\r\n                customInput={<BirthdayInput />}\r\n              />\r\n            </Col>\r\n            <Col />\r\n          </Form.Row>\r\n        </Modal.Body>\r\n        <Modal.Footer>\r\n          <ActionButton variant=\"primary\" onClick={this.performSave} disabled={!this.dateValid()} className=\"fixed-w5\" >Save</ActionButton>\r\n        </Modal.Footer>\r\n      </Modal>\r\n    )\r\n  }\r\n}\r\n","import { ObservableFromFetch } from \"../ObservableFromFetch\"\r\nimport GovPoolSelection from \"./GovPoolModel/GovPoolSelection\"\r\n\r\nexport function GovPoolSelectionGet(dateSelectedID: number) {\r\n  return ObservableFromFetch<GovPoolSelection>(\"GovPool/GovPoolSelection?dateSelectedID=\" + dateSelectedID)\r\n}\r\n\r\n","import * as React from \"react\"\r\nimport { Container, Row, Col, Table, Spinner, Button } from \"react-bootstrap\"\r\nimport { Subscription, BehaviorSubject, of, concat } from \"rxjs\"\r\nimport { distinctUntilChanged, switchMap, map } from \"rxjs/operators\"\r\nimport { toast } from \"react-toastify\"\r\nimport { AppPageWrapper } from \"../../NavMenu/AppPageWrapper\"\r\nimport TablePagination from \"../../TablePagination\"\r\nimport GridData from \"../../../api/Randoms/GovPoolModel/GridData\"\r\nimport GridRow from \"../../../api/Randoms/GovPoolModel/GridRow\"\r\nimport { ColumnFilter } from \"../../../api/Randoms/GovPoolModel/ColumnFilter\"\r\nimport ColumnHeaderFilter from \"../../ColumnHeaderFilter\"\r\nimport AddGovPoolModal from \"./AddGovPoolModal\"\r\nimport GovPoolDetailsModal from \"./PoolDetailsModal\"\r\nimport GovPoolDateSelectedModal from \"./GovPoolDateSelectedModal\"\r\nimport { PoolGridGetObservable } from \"../../../api/Randoms/GovPoolGridGet\"\r\nimport FormatDate from \"../../../formatters/FormatDate\"\r\nimport { connect } from \"react-redux\"\r\nimport { AppState } from \"../../../AppState\"\r\nimport { Filter, Sort } from \"../../../api/GridRequest\"\r\nimport { CustomizableFilterColumn } from \"../../ColumnsCustomizeModal/CustomizableColumn\"\r\nimport { Day, getDayName } from \"../../../api/Randoms/GovPoolModel/DayOfWeek\"\r\nimport GenderInfo from \"../../../api/Randoms/GovPoolModel/GenderInfo\"\r\nimport DaySelected from \"../../../api/Randoms/GovPoolModel/DaySelected\"\r\nimport { BuildUserAccess } from \"../../../authentication/BuildUserAccess\"\r\n\r\ntype Column = CustomizableFilterColumn<keyof GridRow, keyof ColumnFilter>\r\ntype SelectionInterval = 'Monthly' | 'Weekly'\r\n\r\ninterface PoolsProps {\r\n  canManagePools?: boolean\r\n  canManagePersonnel?: boolean\r\n}\r\n\r\ninterface PoolsState {\r\n  loading: boolean\r\n  data?: GridData\r\n  details?: GridRow\r\n  detailsModal: boolean\r\n  dateSelectedModal: boolean\r\n  modal: boolean\r\n  columns: Column[]\r\n  dateSelectedID?: number\r\n  dateSelected?: Date\r\n}\r\n\r\ninterface PoolGridSearchParams {\r\n  pageNumber: number\r\n  sort: Sort\r\n  filters: Filter[]\r\n  search: { field: string, text: string }\r\n}\r\n\r\nconst PageSize = 10\r\n\r\nconst defaultColumns: Column[] = [\r\n  { name: \"Name\", label: \"GROUP NAME\", visible: true, filter: \"Name\" },\r\n  { name: \"SelectionInterval\", label: \"SELECTION INTERVAL\", visible: true, filter: \"SelectionInterval\" },\r\n  { name: \"SelectionDate\", label: \"SELECTION DATE\", visible: true, filter: \"SelectionDate\" },\r\n  { name: \"DaysToSelect\", label: \"DAYS TO SELECT\", visible: true, filter: \"DaysToSelect\" },\r\n  { name: \"GroupSize\", label: \"GROUP SIZE\", visible: true, filter: \"GroupSize\" },\r\n  { name: \"GendersInfo\", label: \"GENDER\", visible: true },\r\n  { name: \"DaysSelected\", label: \"DAYS SELECTED\", visible: true }\r\n]\r\n\r\nclass RandomGovPools extends React.PureComponent<PoolsProps, PoolsState> {\r\n  state: PoolsState = {\r\n    loading: false,\r\n    detailsModal: false,\r\n    dateSelectedModal: false,\r\n    modal: false,\r\n    columns: defaultColumns,\r\n    dateSelectedID: undefined,\r\n    dateSelected: undefined\r\n  }\r\n\r\n  page$ = new BehaviorSubject<PoolGridSearchParams>({\r\n    pageNumber: 1,\r\n    sort: { column: \"\", order: \"\" },\r\n    filters: [],\r\n    search: { field: \"\", text: \"\" }\r\n  })\r\n\r\n  pageSubscription?: Subscription\r\n\r\n  componentDidMount() {\r\n    this.pageSubscription = this.page$.pipe(\r\n      distinctUntilChanged(),\r\n      switchMap((params: PoolGridSearchParams) => concat(\r\n        of({ loading: true }),\r\n        PoolGridGetObservable(params.pageNumber, PageSize, params.sort, params.filters, params.search).pipe(\r\n          map((result: GridData) => ({ data: result, loading: false })))\r\n      )\r\n      )\r\n    ).subscribe(\r\n      (newState: { loading: boolean, data?: GridData }) => {\r\n        if (newState.data) {\r\n          if (newState.data.SelectionDate?.length) {\r\n            newState.data.SelectionDate = newState.data.SelectionDate.map(dateString => FormatDate(dateString))\r\n          }\r\n          this.setState({ loading: newState.loading, data: newState.data })\r\n        } else {\r\n          this.setState({ loading: newState.loading })\r\n        }\r\n      },\r\n      (error: string) => {\r\n        this.setState({ loading: false })\r\n        toast.error(error)\r\n      }\r\n    )\r\n  }\r\n\r\n  componentWillUnmount() {\r\n    this.pageSubscription && this.pageSubscription.unsubscribe()\r\n    this.page$.unsubscribe()\r\n  }\r\n\r\n  handlePageChange = (pageNumber: number) => this.page$.next({ ...this.page$.value, pageNumber: pageNumber })\r\n\r\n  sortGrid(column: string, order?: string) {\r\n    const newSort = { column: column, order: order || \"\" }\r\n    this.page$.next({ ...this.page$.value, sort: newSort })\r\n  }\r\n\r\n  filterGrid(column: string, items: string[]) {\r\n    const filters = [...this.page$.value.filters]\r\n    const filter = { column: column, values: items }\r\n    let index = filters.findIndex(item => item.column === filter.column)\r\n    if (index >= 0) {\r\n      filters[index] = filter\r\n    } else {\r\n      filters.push(filter)\r\n    }\r\n\r\n    this.page$.next({ ...this.page$.value, pageNumber: 1, filters: filters })\r\n  }\r\n\r\n  visibleColumns = () => this.state.columns.filter(col => col.visible)\r\n\r\n  headerColumns = () => this.visibleColumns().map((col: Column, i) => {\r\n    const sort = this.page$.value.sort\r\n    return (\r\n      <th key={col.name}>\r\n        {this.state.data && col.filter && col.filter in this.state.data && <ColumnHeaderFilter\r\n          title={col.label || col.name}\r\n          filteredItems={this.page$.value.filters.find(item => item.column === col.filter)?.values || []}\r\n          sort={sort.column === col.name ? sort.order === \"asc\" ? \"asc\" : \"desc\" : undefined}\r\n          items={this.state.data[col.filter as keyof ColumnFilter]?.filter(item => !!item) || []}\r\n          onSort={(order?: string) => this.sortGrid(col.name, order)}\r\n          onFilter={(items: string[]) => col.filter && this.filterGrid(col.filter, items)}\r\n        />}\r\n        {(!this.state.data || !col.filter) && (col.label || col.name)}\r\n      </th>\r\n    )\r\n  })\r\n\r\n  formatGender = (values: GenderInfo[]) => values?.map(o => `${o.Type}:${o.Count}`).join(', ')\r\n\r\n  intersperse = (arr: React.ReactElement[], sep: string) => {\r\n    if (arr.length === 0) {\r\n      return []\r\n    }\r\n    return arr.slice(1).reduce(function (xs, x, i) {\r\n      return xs.concat([<span key={i}>{sep}</span>, x]);\r\n    }, [arr[0]])\r\n  }\r\n\r\n  formatDaysSelected = (row: GridRow) => {\r\n    const { DaysSelected: daysSelected, SelectionInterval: selectionInterval } = row\r\n    let days: React.ReactElement[] = []\r\n    if (selectionInterval === \"Weekly\") {\r\n      days = daysSelected?.sort((a, b) => a.DayOfWeek - b.DayOfWeek).map(elem => {\r\n        if (new Date(elem.DateSelected) > new Date()) {\r\n          return (<Button key={elem.DaysSelectedID} variant=\"link\" className=\"p-0 align-baseline\" onClick={() => this.showChangeDateModal(elem.DaysSelectedID, elem.DateSelected, row)}>{getDayName(elem.DayOfWeek)}</Button>)\r\n        }\r\n        else {\r\n          return (<span key={elem.DaysSelectedID} className=\"p-0\">{getDayName(elem.DayOfWeek)}</span>)\r\n        }\r\n      })\r\n    }\r\n    if (selectionInterval === \"Monthly\") {\r\n      days = daysSelected?.sort((a, b) => new Date(a.DateSelected).getTime() - new Date(b.DateSelected).getTime()).map(elem => {\r\n        if (new Date(elem.DateSelected) > new Date()) {\r\n          return (<Button key={elem.DaysSelectedID} variant=\"link\" className=\"p-0 align-baseline\" onClick={() => this.showChangeDateModal(elem.DaysSelectedID, elem.DateSelected, row)}>{FormatDate(elem.DateSelected)}</Button>)\r\n        }\r\n        else {\r\n          return (<span key={elem.DaysSelectedID} className=\"p-0\">{FormatDate(elem.DateSelected)}</span>)\r\n        }\r\n      })\r\n    }\r\n    return this.intersperse(days, \", \");\r\n  }\r\n\r\n  renderRows = () => {\r\n    if (this.state.data?.Records && this.state.data?.Records.length) {\r\n      return this.state.data.Records.map((row: GridRow, i: number) =>\r\n        <tr key={i}>\r\n          <td><Button variant=\"link\" onClick={() => this.showDetailsModal(row)} className=\"p-0\">{row.Name}</Button></td>\r\n          <td>{row.SelectionInterval}</td>\r\n          <td>{FormatDate(row.SelectionDate)}</td>\r\n          <td>{row.DaysToSelect > 0 && row.DaysToSelect}</td>\r\n          <td>{row.GroupSize > 0 && row.GroupSize}</td>\r\n          <td>{this.formatGender(row.GendersInfo)}</td>\r\n          <td>{this.formatDaysSelected(row)}</td>\r\n        </tr>)\r\n    } else {\r\n      return <tr><td colSpan={9}>No Records Found</td></tr>\r\n    }\r\n  }\r\n\r\n  showDetailsModal = (details: GridRow) => this.setState({ detailsModal: true, details: details })\r\n\r\n  showChangeDateModal = (dateSelectedID: number, dateSelected: Date, details: GridRow) => {\r\n    this.setState({ dateSelectedModal: true, dateSelectedID: dateSelectedID, dateSelected: dateSelected, details: details })\r\n  }\r\n\r\n  hideDetailsModal = (hasUpdates: boolean) => {\r\n    if (hasUpdates) {\r\n      this.handlePageChange(1)\r\n    }\r\n    this.setState({ detailsModal: false, details: undefined })\r\n  }\r\n\r\n  hideDateSelectedModal = () => {\r\n    this.setState({ dateSelectedModal: false })\r\n  }\r\n\r\n  showModal = () => this.setState({ modal: true })\r\n  hideModal = () => this.setState({ modal: false })\r\n  reload = () => this.page$.next({ ...this.page$.value, pageNumber: 1 })\r\n\r\n  handleCreateSuccessful = () => {\r\n    this.hideModal()\r\n    this.reload()\r\n  }\r\n\r\n  handleUpdateSuccessful = () => {\r\n    this.hideDateSelectedModal()\r\n    this.reload()\r\n  }\r\n\r\n  render() {\r\n    return (\r\n      <AppPageWrapper parentClassName={\"align-items-center\"} showNav>\r\n        <Container fluid className=\"grid-container\">\r\n          <Row className=\"pb-0\"><Col className=\"note-message font-italic px-3 text-center\">IVR Phone Number: (833) 589-2187</Col></Row>\r\n          <Row className=\"pb-2\">\r\n            <Col>\r\n              {this.state.detailsModal && this.state.details && <GovPoolDetailsModal details={this.state.details} onHide={this.hideDetailsModal} />}\r\n              {this.state.dateSelectedModal && this.state.details &&\r\n                <GovPoolDateSelectedModal\r\n                  interval={this.state.details.SelectionInterval as SelectionInterval}\r\n                  onSuccess={this.handleUpdateSuccessful}\r\n                  daysExcluded={this.state.details.DaysExcluded}\r\n                  dateSelectedID={this.state.dateSelectedID || 0}\r\n                  dateSelected={this.state.dateSelected || new Date()}\r\n                  onHide={this.hideDateSelectedModal} />}\r\n              {this.state.modal && <AddGovPoolModal onHide={this.hideModal} onSuccess={this.handleCreateSuccessful} />}\r\n            </Col>\r\n            <Col md={8} className=\"text-md-right mt-2 mt-md-0\">\r\n              <Button variant=\"primary\" size=\"sm\" onClick={this.showModal} className=\"mr-2\">CREATE NEW GROUP</Button>\r\n            </Col>\r\n          </Row>\r\n          <Row>\r\n            <Col>\r\n              <Table bordered responsive>\r\n                <thead>\r\n                  <tr>\r\n                    {this.headerColumns()}\r\n                  </tr>\r\n                </thead>\r\n                <tbody>\r\n                  {\r\n                    this.state.loading ?\r\n                      <tr>\r\n                        <td className=\"text-center\" colSpan={8}>\r\n                          <Spinner animation=\"border\" variant=\"secondary\" />\r\n                        </td>\r\n                      </tr> : this.renderRows()\r\n                  }\r\n                </tbody>\r\n              </Table>\r\n            </Col>\r\n          </Row>\r\n          {this.state.data ?\r\n            <Row>\r\n              <Col>\r\n                <span className=\"total-records\">Total records: {this.state.loading ? \" ... \" : this.state.data.Total}</span>\r\n                <TablePagination pageNumber={this.page$.value.pageNumber} pages={this.state.data.Pages} onChange={this.handlePageChange} />\r\n              </Col>\r\n            </Row> : undefined}\r\n        </Container>\r\n      </AppPageWrapper>\r\n    )\r\n  }\r\n}\r\nfunction mapStateToProps(state: AppState): PoolsProps {\r\n  const userAccess = BuildUserAccess(state);\r\n  return {\r\n    canManagePools: userAccess.canManagePools,\r\n    canManagePersonnel: userAccess.canManagePersonnel,\r\n  }\r\n}\r\nconst ConnectedRandomGovPools = connect(mapStateToProps, null)(RandomGovPools)\r\nexport default ConnectedRandomGovPools\r\n","import { ObservableFromFetch } from \"../ObservableFromFetch\"\r\nimport GridData from \"./GovPoolModel/GridData\"\r\nimport { Filter, Sort } from \"../GridRequest\"\r\n\r\nexport function PoolGridGetObservable(pageNumber: number, pageSize: number, sort: Sort, filters: Filter[], search: { field: string, text: string }) {\r\n  const requestBody: string = JSON.stringify({\r\n    Filters: {\r\n      Name: filters.find(filter => filter.column === \"Name\")?.values || [],\r\n      SelectionInterval: filters.find(filter => filter.column === \"SelectionInterval\")?.values || [],\r\n      SelectionDate: filters.find(filter => filter.column === \"SelectionDate\")?.values || [],\r\n      DaysToSelect: filters.find(filter => filter.column === \"DaysToSelect\")?.values || [],\r\n      GroupSize: filters.find(filter => filter.column === \"GroupSize\")?.values || [],\r\n    },\r\n    PageNumber: pageNumber,\r\n    PageSize: pageSize,\r\n    SortGrid: { SortColumn: sort.column, SortOrder: sort.order.toUpperCase() },\r\n  })\r\n\r\n  return ObservableFromFetch<GridData>(\"GovPool/GetGrid\", requestBody)\r\n}\r\n","import { Observable } from \"rxjs\"\r\nimport GovPoolData from \"./RandomsModel/GovPoolData\"\r\nimport { ObservableFromFetch } from \"../ObservableFromFetch\"\r\n\r\nexport default function GovPoolsObservable(): Observable<GovPoolData[]> {\r\n  return ObservableFromFetch<GovPoolData[]>(\"GovDonor/GetGovPools\")\r\n}\r\n","import { Observable } from \"rxjs\";\r\nimport { ObservableFromFetch } from \"../ObservableFromFetch\"\r\nimport DonorRecord from \"../Randoms/RandomsModel/DonorRecord\"\r\n\r\nexport function GovDonorAddObservable(data: DonorRecord): Observable<string> {\r\n  const params: string = JSON.stringify(data)\r\n\r\n  return ObservableFromFetch<string>(\"GovDonor/CreateDonor\", params)\r\n}\r\n","import { Observable } from \"rxjs\";\r\nimport { ObservableFromFetch } from \"../ObservableFromFetch\"\r\nimport DonorRecord from \"../Randoms/RandomsModel/DonorRecord\"\r\n\r\nexport function GovDonorEditObservable(data: DonorRecord): Observable<string> {\r\n  const params: string = JSON.stringify(data)\r\n\r\n  return ObservableFromFetch<string>(\"GovDonor/UpdateDonor\", params)\r\n}\r\n","import React from 'react'\r\nimport { Button, Col, Container, Form } from 'react-bootstrap'\r\nimport DatePicker from \"react-datepicker\"\r\nimport { EmailRegexp, PhoneRegexp, NameRegexp, InvalidNameMessage, MaxDonorIdLength, InvalidDonorIdLength, DonorIdRegexp, InvalidDonorId } from '../../config/Constants';\r\nimport FormatZipCode from '../../formatters/FormatZipCode';\r\nimport PhoneNumberMaskedInput from '../FormattedInputs/PhoneNumberMaskedInput';\r\nimport State from '../../api/OrderRequests/OrderRequestsModel/State';\r\nimport { Subscription } from 'rxjs';\r\nimport { StateObservable } from '../../api/OrderRequests/OrderRequestsConstraintGet';\r\nimport StateSelect from '../FormattedInputs/StateSelect';\r\nimport AutoFilterLocation from '../../api/Location/LocationModel/AutoFilterLocation';\r\nimport AutoFilterCompany from '../../api/Companies/CompanyModel/AutoFilterCompany';\r\nimport AutoFilterRegion from '../../api/Regions/Model/AutoFilterRegion';\r\nimport AutoFilterLocationsGet from '../../api/Location/AutoFilterLocationsGet';\r\nimport CompanyInput from '../FormattedInputs/CompanyInput';\r\nimport GovPoolData from '../../api/Randoms/RandomsModel/GovPoolData';\r\nimport GovPoolGet from '../../api/Randoms/GovPoolGet';\r\nimport { AppState } from '../../AppState';\r\nimport { connect } from 'react-redux';\r\nimport { isCompanyAdmin, isLocationAdmin, isPortalAdmin } from \"../../authentication/isAdminRole\";\r\nimport { GetSelectedAssignedClinic } from \"../../authentication/SelectedCompany/CompanySelectionDrivenSelectors\";\r\nimport DonorRecord from '../../api/Randoms/RandomsModel/DonorRecord';\r\nimport { GovDonorAddObservable } from '../../api/GovDonor/GovDonorAddObservable';\r\nimport { toast } from 'react-toastify';\r\nimport ActionButton from '../ActionButton';\r\nimport GridRow from '../../api/GovDonor/GridRow'\r\nimport { GovDonorEditObservable } from '../../api/GovDonor/GovDonorEditObservable';\r\nimport FormatPhone from '../../formatters/FormatPhone';\r\nimport { FaPencilAlt, FaTimes } from \"react-icons/fa\"\r\nimport FormatError from '../../formatters/FormatError';\r\nimport FormatDate from '../../formatters/FormatDate';\r\n\r\ntype StateKey = \"WorkPhone\" | \"MobilePhone\"\r\ntype StateValidKey = \"isWorkPhoneValid\" | \"isMobilePhoneValid\"\r\n\r\ninterface EditGovDonorProps {\r\n  PersonID?: number\r\n  editing: boolean\r\n  onHide: (hasUpdates: boolean) => void\r\n  onSuccess: () => void\r\n  row?: GridRow\r\n}\r\n\r\ninterface EditGovDonorAuthProps {\r\n  companyID?: number\r\n  isLocationAdmin?: boolean\r\n  isCompanyAdmin?: boolean\r\n  isPortalAdmin?: boolean\r\n}\r\n\r\ninterface DonorDetailsValidity {\r\n  isDonorIdValid: boolean\r\n  isLastNameValid: boolean\r\n  isFirstNameValid: boolean\r\n  isMobilePhoneValid: boolean\r\n  isWorkPhoneValid: boolean\r\n  isGenderValid: boolean\r\n  isGroupAssignmentValid: boolean\r\n  isEmailValid: boolean\r\n}\r\n\r\ninterface EditGovDonorState extends DonorDetailsValidity {\r\n  HireDate: string\r\n  Gender?: string\r\n  Birthday: string\r\n  FirstName: string\r\n  LastName: string\r\n  DonorId: string\r\n  GroupAssignment: string\r\n  GroupAssignmentName: string\r\n  Zip: string\r\n  City: string\r\n  Address1: string\r\n  WorkPhone: string\r\n  MobilePhone: string\r\n  Email: string\r\n  Active: boolean\r\n  states: State[]\r\n  state?: State\r\n  locations: AutoFilterLocation[]\r\n  selectedLocation?: AutoFilterLocation\r\n  companies: AutoFilterCompany[]\r\n  selectedCompany?: AutoFilterCompany\r\n  govPools: GovPoolData[]\r\n  saving: boolean\r\n  editing: boolean\r\n\r\n  isStatesLoading: boolean\r\n  isLocationsLoading: boolean\r\n  isCompaniesLoading: boolean\r\n  isGovPoolsLoading: boolean\r\n}\r\n\r\nclass EditGovDonorForm extends React.Component<EditGovDonorProps & EditGovDonorAuthProps, EditGovDonorState> {\r\n  subscriptions = new Subscription()\r\n  saveSubscription?: Subscription\r\n\r\n  componentDidMount() {\r\n    this.setState({ isStatesLoading: true, isCompaniesLoading: true, isGovPoolsLoading: true })\r\n    this.setState({ editing: this.props.editing })\r\n\r\n    this.subscriptions.add(\r\n      GovPoolGet().subscribe(\r\n        (results: GovPoolData[]) => this.setState({ govPools: results, isGovPoolsLoading: false }),\r\n        (error) => {\r\n          this.setState({ isGovPoolsLoading: false })\r\n          toast.error(FormatError(error))\r\n        }\r\n      )\r\n    )\r\n\r\n    this.subscriptions.add(\r\n      StateObservable().subscribe(\r\n        (results: State[]) => {\r\n          if (this.props.row?.PersonID) {\r\n            var selectedState = results.find(state => state.Abbreviation === this.props.row?.StateCode);\r\n            if (selectedState !== undefined) {\r\n              this.setState({ state: selectedState })\r\n            }\r\n          }\r\n          this.setState({ states: results, isStatesLoading: false }),\r\n            () => {\r\n              this.setState({ isStatesLoading: false })\r\n            }\r\n        },\r\n      )\r\n    )\r\n\r\n    this.loadPersonData()\r\n  }\r\n\r\n  componentWillUnmount() {\r\n    this.subscriptions.unsubscribe()\r\n    this.saveSubscription?.unsubscribe()\r\n  }\r\n\r\n  loadPersonData() {\r\n    if (!this.props.row || !this.props.PersonID) {\r\n      return\r\n    }\r\n    this.setState({\r\n      HireDate: this.props.row?.HireDate,\r\n      Gender: this.props.row?.Gender,\r\n      Birthday: this.props.row?.DateOfBirth,\r\n      LastName: this.props.row?.LastName!,\r\n      FirstName: this.props.row?.FirstName!,\r\n      DonorId: this.props.row?.EmployerID.toString(),\r\n      GroupAssignment: (this.props.row?.GovPoolID || \"\").toString(),\r\n      GroupAssignmentName: this.props.row?.GovPoolName,\r\n      Zip: this.props.row?.Zip,\r\n      City: this.props.row?.City,\r\n      Address1: this.props.row?.Address,\r\n      WorkPhone: this.props.row?.WorkPhone,\r\n      MobilePhone: this.props.row?.CellPhone,\r\n      Email: this.props.row?.Email,\r\n      Active: this.props.row?.Active\r\n    })\r\n  }\r\n\r\n  performSave = () => {\r\n    const donor: DonorRecord = {\r\n      PersonID: this.props.PersonID,\r\n      FirstName: this.state.FirstName.trim(),\r\n      LastName: this.state.LastName.trim(),\r\n      DonorId: this.state.DonorId.replace(/\\s+/g, \" \").replace(/[-']/g,\"\"),\r\n      GovPoolId: this.state.GroupAssignment,\r\n      IntakeDate: FormatDate(this.state.HireDate),\r\n      Gender: this.state.Gender,\r\n      Birthday: FormatDate(this.state.Birthday),\r\n      Company: this.state.selectedCompany?.AccountID,\r\n      Location: this.state.selectedLocation?.AccountID,\r\n      Address1: this.state.Address1,\r\n      City: this.state.City,\r\n      State: this.state.state?.StateProvinceTerritoryID,\r\n      WorkPhone: this.state.WorkPhone.replace(/\\D/g, \"\"),\r\n      MobilePhone: this.state.MobilePhone.replace(/\\D/g, \"\"),\r\n      Email: this.state.Email,\r\n      Inactive: !this.state.Active,\r\n      Zip: this.state.Zip,\r\n      isPortalAdmin: this.props.isPortalAdmin\r\n    }\r\n    if (!donor.Company) {\r\n      donor.Company = this.props.companyID\r\n    }\r\n    this.setState({ saving: true })\r\n\r\n    this.saveSubscription = ((this.props.PersonID === undefined) ? GovDonorAddObservable(donor) : GovDonorEditObservable(donor)).subscribe(\r\n      data => {\r\n        toast.success(data)\r\n        this.setState({ saving: false })\r\n        this.props.onSuccess();\r\n      },\r\n      error => {\r\n        this.setState({ saving: false })\r\n        toast.error(error?.errorData?.message || error.message)\r\n      }\r\n    )\r\n  }\r\n\r\n  loadAllLocations = (company?: AutoFilterCompany, region?: AutoFilterRegion) => {\r\n    this.setState({ isLocationsLoading: true })\r\n    this.subscriptions.add(\r\n      AutoFilterLocationsGet(company?.AccountID || 0, region?.Code || \"\", \"\").subscribe(\r\n        data => {\r\n          let location = data.find(l => l.AccountID === this.props.row?.LocationID)\r\n          if (this.props.isLocationAdmin && !this.props.PersonID) {\r\n            location = data[0]\r\n          }\r\n          this.setState({ locations: data, isLocationsLoading: false, selectedLocation: location })\r\n        },\r\n        () => this.setState({ isLocationsLoading: false })\r\n      )\r\n    )\r\n  }\r\n\r\n  defaultState: EditGovDonorState = {\r\n    HireDate: \"\",\r\n    Gender: \"\",\r\n    Birthday: \"\",\r\n    FirstName: \"\",\r\n    LastName: \"\",\r\n    DonorId: \"\",\r\n    GroupAssignment: \"\",\r\n    GroupAssignmentName: \"\",\r\n    Zip: \"\",\r\n    City: \"\",\r\n    Address1: \"\",\r\n    WorkPhone: \"\",\r\n    MobilePhone: \"\",\r\n    Email: \"\",\r\n    Active: true,\r\n    states: [],\r\n    state: undefined,\r\n    locations: [],\r\n    selectedLocation: undefined,\r\n    companies: [],\r\n    selectedCompany: undefined,\r\n    govPools: [],\r\n\r\n    isDonorIdValid: true,\r\n    isLastNameValid: true,\r\n    isFirstNameValid: true,\r\n    isMobilePhoneValid: true,\r\n    isWorkPhoneValid: true,\r\n    isGenderValid: true,\r\n    isGroupAssignmentValid: true,\r\n    isEmailValid: true,\r\n\r\n    isStatesLoading: true,\r\n    isLocationsLoading: false,\r\n    isCompaniesLoading: false,\r\n    isGovPoolsLoading: false,\r\n    saving: false,\r\n    editing: false,\r\n  }\r\n\r\n  state: EditGovDonorState = { ...this.defaultState }\r\n\r\n  handleFirstNameChange = (event: React.ChangeEvent<HTMLInputElement>) => {\r\n    const value = event.target.value || \"\"\r\n    this.setState({ FirstName: value, isFirstNameValid: this.isNameValid(value) })\r\n  }\r\n\r\n  handleLastNameChange = (event: React.ChangeEvent<HTMLInputElement>) => {\r\n    const value = event.target.value || \"\"\r\n    this.setState({ LastName: value, isLastNameValid: this.isNameValid(value) })\r\n  }\r\n\r\n  handleDonorIdChange = (event: React.ChangeEvent<HTMLInputElement>) => {\r\n    const value = event.target.value.trim()\r\n    this.setState({ DonorId: value, isDonorIdValid: this.isDonorIdValid(value) })\r\n  }\r\n  handleGenderChange = (event: React.ChangeEvent<HTMLSelectElement>) => this.setState({ Gender: event.target.value })\r\n  handleCompanyChange = (selected: AutoFilterCompany) => {\r\n    this.setState({ selectedCompany: selected })\r\n    if (!this.props.isPortalAdmin) {\r\n      this.loadAllLocations(selected, undefined)\r\n    }\r\n  }\r\n\r\n  handleLocationChange = (event: React.ChangeEvent<HTMLSelectElement>) => {\r\n    let location = this.state.locations.find(l => l.AccountID === Number(event.target.value))\r\n    this.setState({ selectedLocation: location })\r\n  }\r\n  handleStreetAddressChange = (event: React.ChangeEvent<HTMLInputElement>) => this.setState({ Address1: event.target.value })\r\n  handleCityChange = (event: React.ChangeEvent<HTMLInputElement>) => this.setState({ City: event.target.value })\r\n  handleStateChange = (state: State) => this.setState({ state: state })\r\n  handleZipChange = (event: React.ChangeEvent<HTMLInputElement>) => this.setState({ Zip: FormatZipCode(event.target.value) })\r\n  handleWorkPhoneChange = (value: string, stateKey: StateKey, stateValidKey: StateValidKey) => this.setState({ ...{}, [stateKey]: value, [stateValidKey]: this.isPhoneValid(value) })\r\n  handleMobilePhoneChange = (value: string, stateKey: StateKey, stateValidKey: StateValidKey) => this.setState({ ...{}, [stateKey]: value, [stateValidKey]: this.isPhoneValid(value) })\r\n  handleEmailChange = (event: React.ChangeEvent<HTMLInputElement>) => this.setState({ Email: event.target.value, isEmailValid: this.emailValid(event.target.value) })\r\n  handleGroupAssignmentChange = (event: React.ChangeEvent<HTMLSelectElement>) => this.setState({ GroupAssignment: event.target.value })\r\n  isNameValid = (value: string) => (value.length > 0 && NameRegexp.test(value))\r\n  emailValid = (value: string) => (value.length === 0) || EmailRegexp.test(value)\r\n  isPhoneValid = (value: string) => (value.length === 0 || value.toLowerCase() === 'n/p' || PhoneRegexp.test(FormatPhone(value)))\r\n  isDonorIdValid = (value: string) => (value.length > 0 && value.length <= MaxDonorIdLength && DonorIdRegexp.test(value))\r\n  handleToggleEditMode = () => this.setState((prevState) => { return { editing: !prevState.editing } })\r\n  isValid = () => {\r\n    return this.isNameValid(this.state.FirstName) && this.isNameValid(this.state.LastName) && this.isDonorIdValid(this.state.DonorId) && !!this.state.Gender &&\r\n      this.isPhoneValid(this.state.WorkPhone) && this.isPhoneValid(this.state.MobilePhone) && this.emailValid(this.state.Email) && !!this.state.Birthday\r\n  }\r\n\r\n  render() {\r\n    const editable = this.state.editing ? \"form-group required\" : \"form-group\"\r\n    const donorInfoLabel = this.props.PersonID ? \"DONOR INFO\" : \"\"\r\n    return <div>\r\n      <Container className=\"general-info px-4 pb-4 pt-3\">\r\n        <Form>\r\n          {this.props.PersonID && <Form.Row className=\"px-0 pt-2\">\r\n            <Col md={12}>\r\n              <Button variant=\"icon-link\" className=\"float-right ml-1 btn-icon-primary\" size=\"sm\" onClick={this.handleToggleEditMode} >\r\n                {!this.state.editing && <FaPencilAlt />}\r\n                {this.state.editing && <FaTimes />}\r\n              </Button>\r\n            </Col>\r\n          </Form.Row>}\r\n          <Form.Row className=\"form-group\">\r\n            <Col sm={5}><h5>{donorInfoLabel}</h5></Col>\r\n            <Col sm={7}>\r\n              <Form.Row>\r\n                <Col sm={6}>\r\n                  <h5>Group Assignment</h5>\r\n                </Col>\r\n                <Col sm={6} className=\"align-self-center\">\r\n                  {!this.state.editing && <Form.Label className=\"col-form-label\">{this.state.GroupAssignmentName}</Form.Label>}\r\n                  {this.state.editing && <Form.Control id=\"groupAssignment\" as=\"select\" value={this.state.GroupAssignment} onChange={this.handleGroupAssignmentChange}>\r\n                    <option value=\"\">Select</option>\r\n                    {this.state.govPools.map(gp => <option value={gp.GovPoolId} key={gp.GovPoolId}>{gp.Name}</option>)}\r\n                  </Form.Control>}\r\n                </Col>\r\n              </Form.Row>\r\n            </Col>\r\n          </Form.Row>\r\n          <Form.Row className={editable}>\r\n            <Form.Label column sm={5} htmlFor=\"firstName\">First Name</Form.Label>\r\n            <Col sm={7}>\r\n              {!this.state.editing && <Form.Label className=\"col-form-label\">{this.state.FirstName}</Form.Label>}\r\n              {this.state.editing && <Form.Control id=\"firstName\" value={this.state.FirstName} type=\"text\" isInvalid={!this.state.isFirstNameValid} onChange={this.handleFirstNameChange} maxLength={30} />}\r\n              {this.state.editing && <Form.Control.Feedback type=\"invalid\">{InvalidNameMessage}</Form.Control.Feedback>}\r\n            </Col>\r\n          </Form.Row>\r\n          <Form.Row className={editable}>\r\n            <Form.Label column sm={5} htmlFor=\"lastName\">Last Name</Form.Label>\r\n            <Col sm={7}>\r\n              {!this.state.editing && <Form.Label className=\"col-form-label\">{this.state.LastName}</Form.Label>}\r\n              {this.state.editing && <Form.Control id=\"lastName\" type=\"text\" value={this.state.LastName} isInvalid={!this.state.isLastNameValid} onChange={this.handleLastNameChange} maxLength={30} />}\r\n              {this.state.editing && <Form.Control.Feedback type=\"invalid\">{InvalidNameMessage}</Form.Control.Feedback>}\r\n            </Col>\r\n          </Form.Row>\r\n          <Form.Row className={editable}>\r\n            <Form.Label column sm={5} htmlFor=\"donorId\">Donor ID</Form.Label>\r\n            <Col sm={7}>\r\n              {!this.state.editing && <Form.Label className=\"col-form-label\">{this.state.DonorId}</Form.Label>}\r\n              {this.state.editing && <Form.Control id=\"donorId\" type=\"text\" value={this.state.DonorId} isInvalid={!this.state.isDonorIdValid} onChange={this.handleDonorIdChange} maxLength={MaxDonorIdLength} />}\r\n              {this.state.editing && <Form.Control.Feedback type=\"invalid\">\r\n                {!DonorIdRegexp.test(this.state.DonorId) ? InvalidDonorId : InvalidDonorIdLength}\r\n              </Form.Control.Feedback>}\r\n            </Col>\r\n          </Form.Row>\r\n          <Form.Row className=\"form-group\">\r\n            <Form.Label column sm={5} htmlFor=\"hideDate\">Intake Date</Form.Label>\r\n            <Col md={6} className=\"mb-1 mb-lg-0\">\r\n              {!this.state.editing && <Form.Label className=\"col-form-label\">{FormatDate(this.state.HireDate)}</Form.Label>}\r\n              {this.state.editing && <DatePicker className=\"form-control\"\r\n                peekNextMonth\r\n                showMonthDropdown\r\n                showYearDropdown\r\n                dropdownMode=\"select\"\r\n                selected={this.state.HireDate ? new Date(this.state.HireDate) : undefined}\r\n                enableTabLoop={false}\r\n                onChange={date => this.setState({ HireDate: date?.toString() || \"\" })}\r\n              />}\r\n            </Col>\r\n          </Form.Row>\r\n          <Form.Row className={editable}>\r\n            <Form.Label column sm={5} htmlFor=\"gender\">Gender</Form.Label>\r\n            <Col sm={7}>\r\n              {!this.state.editing && <Form.Label className=\"col-form-label\">{this.state.Gender === \"M\" ? \"Male\" : \"Female\"}</Form.Label>}\r\n              {this.state.editing && <Form.Control id=\"gender\" value={this.state.Gender} as=\"select\" onChange={this.handleGenderChange}>\r\n                <option value=\"\">Select</option>\r\n                <option value=\"M\">Male</option>\r\n                <option value=\"F\">Female</option>\r\n              </Form.Control>}\r\n            </Col>\r\n          </Form.Row>\r\n          <Form.Row className={editable}>\r\n            <Form.Label column sm={5} htmlFor=\"birthday\">Date of Birth</Form.Label>\r\n            <Col md={6} className=\"mb-1 mb-lg-0\">\r\n              {!this.state.editing && <Form.Label className=\"col-form-label\">{FormatDate(this.state.Birthday)}</Form.Label>}\r\n              {this.state.editing && <DatePicker className=\"form-control mb-1 mb-lg-0\"\r\n                peekNextMonth\r\n                showMonthDropdown\r\n                showYearDropdown\r\n                dropdownMode=\"select\"\r\n                selected={this.state.Birthday ? new Date(this.state.Birthday) : undefined}\r\n                enableTabLoop={false}\r\n                maxDate={new Date()}\r\n                onChange={date => this.setState({ Birthday: date?.toString() || \"\" })} />}\r\n            </Col>\r\n          </Form.Row>\r\n          <Form.Row className=\"form-group\">\r\n            <Form.Label column sm={5} htmlFor=\"company\">Company</Form.Label>\r\n            <Col sm={7}>\r\n              {(!this.props.isPortalAdmin || (this.props.isPortalAdmin && !this.state.editing)) && <Form.Label className=\"col-form-label\">{this.state.selectedCompany?.Name}</Form.Label>}\r\n              {this.state.editing && this.props.isPortalAdmin && <CompanyInput\r\n                filter onChange={items => this.handleCompanyChange(items[0])} placeholder=\"Choose a company...\" />}\r\n            </Col>\r\n          </Form.Row>\r\n          <Form.Row className=\"form-group\">\r\n            <Form.Label column sm={5} htmlFor=\"location\">Location</Form.Label>\r\n            <Col sm={7}>\r\n              {(this.props.isLocationAdmin || ((this.props.isPortalAdmin || this.props.isCompanyAdmin) && !this.state.editing)) && <Form.Label className=\"col-form-label\">{this.state.selectedLocation?.Name}</Form.Label>}\r\n              {(this.props.isPortalAdmin || this.props.isCompanyAdmin) && this.state.editing && <Form.Control id=\"location\" as=\"select\" value={this.state.selectedLocation?.AccountID} onChange={this.handleLocationChange}>\r\n                <option value=\"\">Select</option>\r\n                {this.state.locations.map(l => <option value={l.AccountID} key={l.AccountID}>{l.Name}</option>)}\r\n              </Form.Control>}\r\n            </Col>\r\n          </Form.Row>\r\n          <Form.Row className=\"form-group\">\r\n            <Form.Label column sm={5} htmlFor=\"streetAddress\">Street Address</Form.Label>\r\n            <Col sm={7}>\r\n              {!this.state.editing && <Form.Label className=\"col-form-label\">{this.state.Address1}</Form.Label>}\r\n              {this.state.editing && <Form.Control id=\"streetAddress\" value={this.state.Address1} type=\"text\" onChange={this.handleStreetAddressChange} maxLength={60} />}\r\n            </Col>\r\n          </Form.Row>\r\n          <Form.Row className=\"form-group\">\r\n            <Form.Label column sm={5} htmlFor=\"city\">City</Form.Label>\r\n            <Col sm={7}>\r\n              {!this.state.editing && <Form.Label className=\"col-form-label\">{this.state.City}</Form.Label>}\r\n              {this.state.editing && <Form.Control id=\"city\" type=\"text\" value={this.state.City} onChange={this.handleCityChange} maxLength={40} />}\r\n            </Col>\r\n          </Form.Row>\r\n          <Form.Row className=\"form-group\">\r\n            <Form.Label column sm={5} htmlFor=\"state\">State</Form.Label>\r\n            <Col sm={7}>\r\n              {!this.state.editing && <Form.Label className=\"col-form-label\">{this.state.state?.FullName}</Form.Label>}\r\n              {this.state.editing && <StateSelect states={this.state.states} dropButtonIfInvalid selectedCode={this.state.state?.Abbreviation} onChange={(state) => this.handleStateChange(state)} />}\r\n            </Col>\r\n          </Form.Row>\r\n          <Form.Row className=\"form-group\">\r\n            <Form.Label column sm={5} htmlFor=\"zip\">Zip</Form.Label>\r\n            <Col sm={7}>\r\n              {!this.state.editing && <Form.Label className=\"col-form-label\">{this.state.Zip}</Form.Label>}\r\n              {this.state.editing && <Form.Control id=\"zip\" type=\"text\" value={this.state.Zip} onChange={this.handleZipChange} maxLength={15} />}\r\n            </Col>\r\n          </Form.Row>\r\n          <Form.Row className=\"form-group\">\r\n            <Form.Label column sm={5} htmlFor=\"workPhone\">Work Phone</Form.Label>\r\n            <Col sm={7}>\r\n              {!this.state.editing && <Form.Label className=\"col-form-label\">{FormatPhone(this.state.WorkPhone)}</Form.Label>}\r\n              {this.state.editing && <PhoneNumberMaskedInput value={this.state.WorkPhone} onChange={(value: string) => this.handleWorkPhoneChange(value, \"WorkPhone\", \"isWorkPhoneValid\")} isInvalid={!this.state.isWorkPhoneValid} />}\r\n            </Col>\r\n          </Form.Row>\r\n          <Form.Row className=\"form-group\">\r\n            <Form.Label column sm={5} htmlFor=\"mobilePhone\">Mobile Phone</Form.Label>\r\n            <Col sm={7}>\r\n              {!this.state.editing && <Form.Label className=\"col-form-label\">{FormatPhone(this.state.MobilePhone)}</Form.Label>}\r\n              {this.state.editing && <PhoneNumberMaskedInput value={this.state.MobilePhone} onChange={(value: string) => this.handleMobilePhoneChange(value, \"MobilePhone\", \"isMobilePhoneValid\")} isInvalid={!this.state.isMobilePhoneValid} />}\r\n            </Col>\r\n          </Form.Row>\r\n          <Form.Row className=\"form-group\">\r\n            <Form.Label column sm={5} htmlFor=\"email\">Email</Form.Label>\r\n            <Col sm={7}>\r\n              {!this.state.editing && <Form.Label className=\"col-form-label\">{this.state.Email}</Form.Label>}\r\n              {this.state.editing && <Form.Control id=\"email\" value={this.state.Email} isInvalid={!this.state.isEmailValid} type=\"text\" onChange={this.handleEmailChange} maxLength={60} />}\r\n            </Col>\r\n          </Form.Row>\r\n          {this.props.PersonID && <Form.Row className=\"form-group\">\r\n            <Form.Label column sm={5}>ACTIVE</Form.Label>\r\n            <Col sm={7}>\r\n              {this.state.editing && <Form.Check checked={this.state.Active} onChange={(e: React.ChangeEvent<HTMLInputElement>) => this.setState({ Active: e.target.checked })} className=\"mt-2\" />}\r\n              {!this.state.editing && <Form.Label className=\"col-form-label\">{this.state.Active ? \"Yes\" : \"No\"} </Form.Label>}\r\n            </Col>\r\n          </Form.Row>}\r\n          <Form.Row className=\"buttons-block\">\r\n            <Button variant=\"secondary\" onClick={() => this.props.onHide(false)}>CANCEL</Button>\r\n            <ActionButton variant=\"primary\" hidden={!this.state.editing} disabled={!this.isValid()} onClick={this.performSave} spin={this.state.saving} disableOnSpin>SAVE</ActionButton>\r\n          </Form.Row>\r\n        </Form>\r\n      </Container>\r\n    </div>\r\n  }\r\n}\r\n\r\nfunction mapStateToProps(state: AppState): EditGovDonorAuthProps {\r\n  const selectedCompany = GetSelectedAssignedClinic(state)  \r\n  return {\r\n    companyID: selectedCompany?.AccountID || 0,\r\n    isLocationAdmin: isLocationAdmin(state),\r\n    isCompanyAdmin: isCompanyAdmin(state),\r\n    isPortalAdmin: isPortalAdmin(state)\r\n  }\r\n}\r\n\r\nconst ConnectedEditGovDonor = connect(mapStateToProps, null)(EditGovDonorForm)\r\nexport default ConnectedEditGovDonor\r\n","import React, { PureComponent } from 'react'\r\nimport { Modal } from 'react-bootstrap'\r\nimport EditGovDonorForm from './EditGovDonorForm';\r\n\r\ninterface AddGovDonorProps {\r\n  show: boolean\r\n  onHide: () => void\r\n  onSuccess: () => void\r\n}\r\n\r\nexport default class AddGovDonorModal extends React.Component<AddGovDonorProps> {\r\n\r\n  render() {\r\n    const { show, onHide } = this.props\r\n\r\n    return <Modal backdrop=\"static\" centered show={show} onHide={onHide} size=\"lg\">\r\n      <Modal.Header closeButton>\r\n        <Modal.Title>Add Donor</Modal.Title>\r\n      </Modal.Header>\r\n      <Modal.Body>\r\n        <EditGovDonorForm onSuccess={() => this.props.onSuccess()} onHide={this.props.onHide} editing PersonID={undefined} />\r\n      </Modal.Body>\r\n    </Modal>\r\n  }\r\n}\r\n\r\n","import React, { PureComponent } from 'react'\r\nimport { Button, Col, Container, Form, Modal, Row, Tab, Table, Tabs } from 'react-bootstrap'\r\nimport { toast } from 'react-toastify'\r\nimport { BehaviorSubject, concat, of, Subscription } from 'rxjs'\r\nimport { distinctUntilChanged, switchMap, map } from 'rxjs/operators'\r\nimport { IVRCallLogObservable } from '../../api/GovDonor/IVRCallLogObservable'\r\nimport { IVRCallLogRequest } from '../../api/GovDonor/Model/IVRCallLogRequest'\r\nimport { IVRLog } from '../../api/GovDonor/Model/IVRLog'\r\nimport FormatDate from '../../formatters/FormatDate'\r\nimport DatePicker from \"react-datepicker\"\r\nimport ActionButton from '../ActionButton'\r\nimport FormatPhone from '../../formatters/FormatPhone'\r\n\r\ninterface IVRLogProps {\r\n  PersonID: number\r\n}\r\n\r\ninterface IVRLogState {\r\n  from: Date\r\n  to: Date\r\n  data: IVRLog[]\r\n  loading: boolean\r\n}\r\n\r\n\r\nexport default class IVRLogForm extends PureComponent<IVRLogProps, IVRLogState> {\r\n  state = {loading: false, from: new Date(new Date().setDate(new Date().getDate() - 30)), to: new Date(), data: []}\r\n\r\n  pageSubscription?: Subscription\r\n  page$ = new BehaviorSubject<IVRCallLogRequest>({\r\n    PersonId: this.props.PersonID,\r\n    FromDate: this.state.from.toDateString(),\r\n    ToDate: this.state.to.toDateString(),\r\n  })\r\n\r\n  componentDidMount() {\r\n    this.pageSubscription = this.page$.pipe(\r\n      distinctUntilChanged(),\r\n      switchMap((params: IVRCallLogRequest) => concat(\r\n        of({ loading: true }),\r\n        IVRCallLogObservable(params).pipe(\r\n          map((result: IVRLog[]) => ({ data: result, loading: false })))\r\n        )\r\n      )\r\n    ).subscribe(\r\n      (newState: { loading: boolean, data?: IVRLog[] }) => {\r\n        if (newState.data) {\r\n          this.setState({ loading: newState.loading, data: newState.data })\r\n        } else {\r\n          this.setState({ loading: newState.loading })\r\n        }\r\n      },\r\n      (error: string) => {\r\n        this.setState({ loading: false })\r\n        toast.error(error)\r\n      }\r\n    )\r\n  }\r\n\r\n  componentWillUnmount() {\r\n    this.pageSubscription && this.pageSubscription.unsubscribe()\r\n    this.page$.unsubscribe()\r\n  }\r\n\r\n  applyFilter = () => this.page$.next({ ...this.page$.value, FromDate: this.state.from.toDateString(), ToDate: new Date((new Date()).setDate(this.state.to.getDate() + 1)).toDateString() })\r\n\r\n  render() {\r\n    return (<Container className=\"grid-container\">\r\n      <Form inline className=\"p-3\">\r\n        <Form.Group>\r\n          <Form.Row>\r\n            <Form.Label className=\"mr-1\">From</Form.Label>\r\n            <DatePicker className=\"form-control\"\r\n              required\r\n              showMonthDropdown\r\n              showYearDropdown\r\n              maxDate={new Date()}\r\n              dropdownMode=\"select\"\r\n              selected={ this.state.from }\r\n              enableTabLoop={false}\r\n              onChange={date => this.setState({ from: date as Date})}\r\n            />\r\n            <Form.Label className=\"ml-3 mr-1\">To</Form.Label>\r\n            <DatePicker className=\"form-control\"\r\n              required\r\n              showMonthDropdown\r\n              showYearDropdown\r\n              minDate={ this.state.from }\r\n              maxDate={ new Date() }\r\n              dropdownMode=\"select\"\r\n              selected={ this.state.to }\r\n              enableTabLoop={false}\r\n              onChange={date => this.setState({ to: date as Date})}\r\n            />\r\n            <Col><ActionButton disabled={!this.state.from || !this.state.to} spin={this.state.loading} disableOnSpin onClick={ this.applyFilter }>Search</ActionButton></Col>\r\n          </Form.Row>\r\n        </Form.Group>\r\n      </Form>\r\n      <Table bordered responsive>\r\n        <thead>\r\n          <tr>\r\n            <th>Date</th>\r\n            <th>FromPhone</th>\r\n            <th>Message</th>\r\n          </tr>\r\n        </thead>\r\n        <tbody>\r\n          {this.state.data && this.state.data.map((row: IVRLog) => <tr key={row.CallDate}>\r\n            <td>{FormatDate(row.CallDate)}</td>\r\n            <td>{row.PhoneNumber}</td>\r\n            <td>{row.Message}</td>\r\n          </tr> )}\r\n          {!this.state.data?.length && <tr><td colSpan={3}>No Records Found</td></tr>}\r\n        </tbody>\r\n      </Table>\r\n    </Container>)\r\n  }\r\n}\r\n","import { ObservableFromFetch } from \"../ObservableFromFetch\"\r\nimport { IVRCallLogRequest } from \"./Model/IVRCallLogRequest\"\r\nimport { IVRLog } from \"./Model/IVRLog\"\r\n\r\nexport function IVRCallLogObservable(request: IVRCallLogRequest) {\r\n  const requestBody: string = JSON.stringify(request)\r\n\r\n  return ObservableFromFetch<IVRLog[]>(\"GovDonor/GetIVRCallLog\", requestBody)\r\n}\r\n","import React, { PureComponent } from 'react'\r\nimport { Button, Container, Modal, Row, Col, Tab, Tabs, Image } from 'react-bootstrap'\r\nimport { Link } from 'react-router-dom'\r\nimport GridRow from '../../api/GovDonor/GridRow'\r\nimport CurrentServiceHistory from '../OrderResults/EmployeeDetails/CurrentServiceHistory'\r\nimport EditGovDonorForm from './EditGovDonorForm'\r\nimport IVRLogForm from './IVRLogForm'\r\n\r\nconst IVRLogKey = \"ivr-log\"\r\nconst GeneralInformation = \"general-informatioh\"\r\nconst ServiceKey = \"service\"\r\n\r\ninterface GovDonorDetailsProps {\r\n  details: GridRow\r\n  onHide: (hasUpdates: boolean) => void\r\n}\r\n\r\ninterface GovDonorDetailsState {\r\n  currentTab: string\r\n  editing: boolean\r\n}\r\n\r\nexport default class GovDonorDetailsModal extends PureComponent<GovDonorDetailsProps, GovDonorDetailsState> {\r\n  state = { currentTab: GeneralInformation, editing: false }\r\n\r\n  handleSuccessful = () => {\r\n    this.props.onHide(true)\r\n  }\r\n\r\n  render() {\r\n    const { PersonID, FirstName, LastName, EmployerID, GovAccessCode } = this.props.details\r\n    return (\r\n      <Modal backdrop=\"static\" size=\"xl\" show dialogClassName=\"dark\" onHide={() => this.props.onHide(false)}>\r\n        <Modal.Header closeButton><Modal.Title className=\"text-uppercase\">Donor Details</Modal.Title></Modal.Header>\r\n        <Modal.Body className=\"p-0\">\r\n          <Container className=\"tab-container p-0\">\r\n            <Row className=\"px-0 pt-2\">\r\n              <Col md={4}>\r\n                <h4 className=\"px-4\"><span className=\"text-uppercase\">{`${LastName}, ${FirstName}`}</span> - {EmployerID}</h4>\r\n              </Col>\r\n              <Col md={5}>\r\n                <h4>Access Code: {GovAccessCode}</h4>\r\n              </Col>\r\n              <Col md={3}>\r\n                <Link className=\"btn btn-secondary\" to={{ pathname: \"/gov-order\", state: { formData: [this.props.details], pendingRandom: false } }}>ORDER TEST</Link>\r\n              </Col>\r\n            </Row>\r\n            <Row className=\"px-0 pt-2\">\r\n              <Col>\r\n                <Tabs defaultActiveKey={IVRLogKey} activeKey={this.state.currentTab} className=\"px-4 py-2\" onSelect={(eventKey) => { eventKey && this.setState({ currentTab: eventKey }) }}>\r\n                  <Tab eventKey={GeneralInformation} title=\"GENERAL INFORMATION\" tabClassName=\"rounded-pill px-4\">\r\n                    {GeneralInformation === this.state.currentTab && <EditGovDonorForm row={this.props.details} onSuccess={() => this.handleSuccessful()} onHide={this.props.onHide} editing={false} PersonID={PersonID} />}\r\n                  </Tab>\r\n                  <Tab eventKey={IVRLogKey} title=\"IVR Log\" tabClassName=\"rounded-pill px-4\">\r\n                    {IVRLogKey === this.state.currentTab && <IVRLogForm PersonID={PersonID} />}\r\n                  </Tab>\r\n                  {<Tab eventKey={ServiceKey} title=\"CURRENT SERVICE DETAILS\" tabClassName=\"rounded-pill px-4\">\r\n                    {ServiceKey === this.state.currentTab && <CurrentServiceHistory PersonID={PersonID} isOntrack />}\r\n                  </Tab>}\r\n                </Tabs>\r\n              </Col>\r\n            </Row>\r\n          </Container>\r\n        </Modal.Body>\r\n        {this.state.currentTab !== GeneralInformation && <Modal.Footer>\r\n          <Button variant=\"secondary\" onClick={() => this.props.onHide(false)} className=\"px-4\">Close</Button>\r\n        </Modal.Footer>}\r\n      </Modal>\r\n    )\r\n  }\r\n}\r\n","import React, { PureComponent } from 'react'\r\nimport { Button, Col, Container, Row, Spinner, Table } from 'react-bootstrap'\r\nimport { Subscription, BehaviorSubject, of, concat } from \"rxjs\"\r\nimport { distinctUntilChanged, switchMap, map, catchError } from \"rxjs/operators\"\r\nimport { toast } from \"react-toastify\"\r\nimport { connect } from \"react-redux\"\r\nimport { ColumnFilter } from '../../api/GovDonor/ColumnFilter'\r\nimport GridData from '../../api/GovDonor/GridData'\r\nimport GridRow from '../../api/GovDonor/GridRow'\r\nimport { AppState } from '../../AppState'\r\nimport { Filter, Sort } from \"../../api/GridRequest\"\r\nimport ColumnHeaderFilter from '../ColumnHeaderFilter'\r\nimport { CustomizableFilterColumn } from '../ColumnsCustomizeModal/CustomizableColumn'\r\nimport { AppPageWrapper } from '../NavMenu/AppPageWrapper'\r\nimport TablePagination from '../TablePagination'\r\nimport AddGovDonorModal from './AddGovDonorModal'\r\nimport GovDonorDetailsModal from './GovDonorDetailsModal'\r\nimport { GovDonorGridGetObservable } from '../../api/GovDonor/GovDonorGridGetObservable'\r\nimport SearchField from '../../api/SearchField'\r\nimport SearchBar from '../SearchBar'\r\nimport { FaArrowDown, FaArrowUp } from 'react-icons/fa'\r\nimport { GetSelectedAssignedClinic } from '../../authentication/SelectedCompany/CompanySelectionDrivenSelectors'\r\nimport { Link } from 'react-router-dom'\r\nimport { BuildUserAccess } from \"../../authentication/BuildUserAccess\"\r\nimport FormatError from '../../formatters/FormatError'\r\nimport { isProcessingCollection, ProcessingCollectionLabel, refreshProcessingCollectionTests } from '../../api/CachedCollectionTest'\r\n\r\ntype Column = CustomizableFilterColumn<keyof GridRow, keyof ColumnFilter>\r\n\r\ninterface GovDonorState {\r\n  loading: boolean\r\n  data?: GridData\r\n  details?: GridRow\r\n  detailsModal: boolean\r\n  addDonorModal: boolean\r\n  columns: Column[]\r\n}\r\n\r\ninterface GovDonorProps {\r\n  canManageGovDonors?: boolean\r\n  company?: number\r\n}\r\n\r\nconst PageSize = 30\r\n\r\nconst DefaultSearchFields: SearchField[] = [\r\n  { ID: \"EmployerID\", Name: \"Donor ID\" },\r\n  { ID: \"FirstName\", Name: \"First Name\" },\r\n  { ID: \"LastName\", Name: \"Last Name\" },\r\n  { ID: \"AccessCode\", Name: \"Access Code\" }\r\n]\r\n\r\nconst DefaultColumns: Column[] = [\r\n  { name: \"EmployerID\", label: \"DONOR ID\", visible: true },\r\n  { name: \"LastName\", label: \"LAST NAME\", visible: true },\r\n  { name: \"FirstName\", label: \"FIRST NAME\", visible: true },\r\n  { name: \"GovAccessCode\", label: \"ACCESS CODE\", visible: true },\r\n  { name: \"GovPoolName\", label: \"GROUP\", visible: true, filter: \"GovPoolName\" },\r\n  { name: \"LastTestDate\", label: \"LAST TEST DATE\", visible: true },\r\n  { name: \"Result\", label: \"RESULT\", visible: true },\r\n  { name: \"DateScheduled\", label: \"PENDING RANDOM\", visible: true }\r\n]\r\n\r\ninterface GridSearchParams {\r\n  pageNumber: number\r\n  sort: Sort\r\n  filters: Filter[]\r\n  search: { field: string, text: string }\r\n}\r\n\r\nclass GovDonorGrid extends PureComponent<GovDonorProps, GovDonorState> {\r\n  pageSubscription?: Subscription\r\n\r\n  state: GovDonorState = {\r\n    loading: false,\r\n    detailsModal: false,\r\n    addDonorModal: false,\r\n    columns: DefaultColumns\r\n  }\r\n\r\n  page$ = new BehaviorSubject<GridSearchParams>({\r\n    pageNumber: 1,\r\n    sort: { column: \"\", order: \"\" },\r\n    filters: [],\r\n    search: { field: \"\", text: \"\" }\r\n  })\r\n\r\n  sortGrid(column: string, order?: string) {\r\n    const newSort = { column: column, order: order || \"\" }\r\n    this.page$.next({ ...this.page$.value, sort: newSort })\r\n  }\r\n\r\n  filterGrid(column: string, items: string[]) {\r\n    const filters = [...this.page$.value.filters]\r\n    const filter = { column: column, values: items }\r\n    let index = filters.findIndex(item => item.column === filter.column)\r\n    if (index >= 0) {\r\n      filters[index] = filter\r\n    } else {\r\n      filters.push(filter)\r\n    }\r\n\r\n    this.page$.next({ ...this.page$.value, pageNumber: 1, filters: filters })\r\n  }\r\n\r\n  onSearch = (field: string, text: string) => this.page$.next({ ...this.page$.value, pageNumber: 1, search: { field: field, text: text } })\r\n  handlePageChange = (pageNumber: number) => this.page$.next({ ...this.page$.value, pageNumber: pageNumber })\r\n  showDetailsModal = (details: GridRow) => this.setState({ detailsModal: true, details: details })\r\n  hideDetailsModal = (hasUpdates: boolean) => {\r\n    if (hasUpdates) {\r\n      this.handlePageChange(1)\r\n    }\r\n    this.setState({ detailsModal: false, details: undefined })\r\n  }\r\n\r\n  showAddDonor = () => this.setState({ addDonorModal: true })\r\n  hideAddDonor = () => this.setState({ addDonorModal: false })\r\n  reload = () => this.page$.next({ ...this.page$.value, pageNumber: 1 })\r\n\r\n  handleCreateSuccessful = () => {\r\n    this.hideAddDonor()\r\n    this.reload()\r\n  }\r\n\r\n  componentDidMount() {\r\n    this.pageSubscription = this.page$.pipe(\r\n      distinctUntilChanged(),\r\n      switchMap((params: GridSearchParams) => concat(\r\n        of({ loading: true }),\r\n        GovDonorGridGetObservable(params.pageNumber, PageSize, params.sort, params.filters, params.search, this.props.company).pipe(\r\n          map((result: GridData) => ({ data: result, loading: false })),\r\n          catchError((error) => of({ loading: false, errorMessage: FormatError(error) }))\r\n      )))\r\n    ).subscribe(\r\n      (newState: { loading: boolean, data?: GridData, errorMessage?: string }) => {\r\n        if (newState.data) {\r\n          this.setState({ loading: newState.loading, data: newState.data })\r\n        } else {\r\n          this.setState({ loading: newState.loading })\r\n        }\r\n        newState.errorMessage && toast.error(newState.errorMessage)\r\n      },\r\n      (error) => {\r\n        this.setState({ loading: false })\r\n        toast.error(FormatError(error))\r\n      }\r\n    )\r\n  }\r\n\r\n  componentWillUnmount() {\r\n    this.pageSubscription && this.pageSubscription.unsubscribe()\r\n    this.page$.unsubscribe()\r\n  }\r\n\r\n  visibleColumns = () => this.state.columns.filter(col => col.visible)\r\n\r\n  renderHeader = () => this.visibleColumns().map((col: Column, i) => {\r\n    const sort = this.page$.value.sort\r\n    return (\r\n      <th key={col.name}>\r\n        {this.state.data && col.filter && col.filter in this.state.data && <ColumnHeaderFilter\r\n          title={col.label || col.name}\r\n          filteredItems={this.page$.value.filters.find(item => item.column === col.filter)?.values || []}\r\n          sort={sort.column === col.name ? sort.order === \"asc\" ? \"asc\" : \"desc\" : undefined}\r\n          items={this.state.data[col.filter as keyof ColumnFilter]?.filter(item => !!item) || []}\r\n          onSort={(order?: string) => this.sortGrid(col.name, order)}\r\n          onFilter={(items: string[]) => col.filter && this.filterGrid(col.filter, items)}\r\n        />}\r\n        {(this.state.data && !col.filter) && this.renderHeaderColumn(col.name, col.label || col.name)}\r\n      </th>\r\n    )\r\n  })\r\n\r\n  renderHeaderColumn = (columnName: string, title: string) => {\r\n    const sort = this.page$.value.sort\r\n    const setAscSort = sort.order !== \"asc\"\r\n    return <>\r\n      <div className=\"filter-toggle\">\r\n        <span onClick={() => this.sortGrid(columnName, setAscSort ? \"asc\" : \"desc\")} className=\"column-header-title text-uppercase mr-1\">{title}</span>\r\n        <span hidden={sort.column !== columnName || sort.order !== \"asc\"}><FaArrowUp /></span>\r\n        <span hidden={sort.column !== columnName || sort.order !== \"desc\"}><FaArrowDown /></span>\r\n      </div>\r\n    </>\r\n  }\r\n\r\n  renderRows = () => {\r\n    if (this.state.data?.Records && this.state.data?.Records.length) {\r\n      return this.state.data.Records.map((row: GridRow, i: number) =>\r\n        <tr key={i}>\r\n          <td><Button variant=\"link\" onClick={() => this.showDetailsModal(row)} className=\"p-0\">{row.EmployerID}</Button></td>\r\n          <td>{row.LastName}</td>\r\n          <td>{row.FirstName}</td>\r\n          <td>{row.GovAccessCode}</td>\r\n          <td>{row.GovPoolName}</td>\r\n          <td>{row.LastTestDate}</td>\r\n          <td>{row.Result}</td>\r\n          <td>{row.DateScheduled && (isProcessingCollection(row.TestDetailID) ? ProcessingCollectionLabel : \r\n            <Link className=\"btn-link btn-icon-link\" to={{ pathname: \"/gov-order\", state: { formData: [row], pendingRandom: true } }}>Random Test</Link>)}\r\n          </td>\r\n        </tr>)\r\n    } else {\r\n      return <tr><td colSpan={9}>No Records Found</td></tr>\r\n    }\r\n  }\r\n\r\n  render() {\r\n    refreshProcessingCollectionTests()\r\n    return (\r\n      <AppPageWrapper parentClassName={\"align-items-center\"} showNav>\r\n        <Container fluid className=\"grid-container\">\r\n          <Row className=\"pb-2\">\r\n            <Col>\r\n              {this.state.detailsModal && this.state.details && <GovDonorDetailsModal details={this.state.details} onHide={this.hideDetailsModal} />}\r\n              {this.state.addDonorModal && <AddGovDonorModal show onHide={() => this.hideAddDonor()} onSuccess={() => this.handleCreateSuccessful()} />}\r\n              <SearchBar\r\n                allowBlank\r\n                resetButton\r\n                onSearch={this.onSearch}\r\n                searchFields={DefaultSearchFields}\r\n                loading={this.state.loading}\r\n              />\r\n            </Col>\r\n            <Col md={8} className=\"text-md-right mt-2 mt-md-0\">\r\n              <Button variant=\"primary\" size=\"sm\" onClick={this.showAddDonor} className=\"mr-2\">Add Donor</Button>\r\n            </Col>\r\n          </Row>\r\n          <Row>\r\n            <Col>\r\n              <Table bordered responsive>\r\n                <thead>\r\n                  <tr>\r\n                    {this.renderHeader()}\r\n                  </tr>\r\n                </thead>\r\n                <tbody>\r\n                  {\r\n                    this.state.loading ?\r\n                      <tr>\r\n                        <td className=\"text-center\" colSpan={8}>\r\n                          <Spinner animation=\"border\" variant=\"secondary\" />\r\n                        </td>\r\n                      </tr> : this.renderRows()\r\n                  }\r\n                </tbody>\r\n              </Table>\r\n            </Col>\r\n          </Row>\r\n          {this.state.data ?\r\n            <Row>\r\n              <Col>\r\n                <span className=\"total-records\">Total records: {this.state.loading ? \" ... \" : this.state.data.Total}</span>\r\n                <TablePagination pageNumber={this.page$.value.pageNumber} pages={this.state.data.Pages} onChange={this.handlePageChange} />\r\n              </Col>\r\n            </Row> : undefined}\r\n        </Container>\r\n      </AppPageWrapper>\r\n    )\r\n  }\r\n}\r\n\r\nfunction mapStateToProps(state: AppState): GovDonorProps {\r\n  const userAccess = BuildUserAccess(state);\r\n\r\n  return {\r\n    canManageGovDonors: userAccess.CanManageGovDonors,\r\n    company: GetSelectedAssignedClinic(state)?.AccountID\r\n  }\r\n}\r\nconst ConnectedGovDonor = connect(mapStateToProps, null)(GovDonorGrid)\r\nexport default ConnectedGovDonor\r\n","import { ObservableFromFetch } from \"../ObservableFromFetch\"\r\nimport { Filter, Sort } from \"../GridRequest\"\r\nimport GridData from \"./GridData\"\r\n\r\nexport function GovDonorGridGetObservable(pageNumber: number, pageSize: number, sort: Sort, filters: Filter[], search: { field: string, text: string }, accountID?: number) {\r\n  const requestBody: string = JSON.stringify({\r\n    Filters: {\r\n      GovPoolName: filters.find(filter => filter.column === \"GovPoolName\")?.values || [],\r\n    },\r\n    AccountID: accountID,\r\n    PageNumber: pageNumber,\r\n    PageSize: pageSize,\r\n    SearchBy: search.field || \"\",\r\n    SearchText: search.text || \"\",\r\n    SortGrid: { SortColumn: sort.column, SortOrder: sort.order.toUpperCase() },\r\n  })\r\n\r\n  return ObservableFromFetch<GridData>(\"GovDonor/GetGrid\", requestBody)\r\n}\r\n","export default interface ServiceType {\r\n  ServiceTypeID: number\r\n  ServiceTypeName: string\r\n  ServiceTypeCode: string\r\n  DisplayOrder: number\r\n}\r\n\r\nexport enum ServiceTypeCode {\r\n  Drug = \"Drug\",\r\n  Alcohol = \"Alcohol\",\r\n  Physical = \"Physical\",\r\n  OHS = \"OHS\",\r\n  POCT = \"POCT\",\r\n  Background = \"Background\",\r\n  Audiogram = \"Audiogram\",\r\n  CHS = \"CHS\",\r\n  None = \"\"\r\n}\r\n\r\n\r\nlet emptyServiceType = {\r\n  ServiceTypeID: 0,\r\n  ServiceTypeName: \"\",\r\n  ServiceTypeCode: \"\",\r\n  DisplayOrder: 0\r\n}\r\nexport function ServiceTypeById(items: ServiceType[], serviceTypeId: number): ServiceType {\r\n  for (let i = 0; i < items.length; i++) {\r\n    if (items[i].ServiceTypeID === serviceTypeId) {\r\n      return items[i];\r\n    }\r\n  }\r\n  return emptyServiceType;\r\n}\r\n\r\nexport function ServiceTypeByCode(items: ServiceType[], code: ServiceTypeCode): ServiceType {\r\n  for (let i = 0; i < items.length; i++) {\r\n    if (items[i].ServiceTypeCode === code) {\r\n      return items[i];\r\n    }\r\n  }\r\n  \r\n  return emptyServiceType;\r\n}\r\n\r\n\r\nexport function GetDrugServiceType(items: ServiceType[]): ServiceType {\r\n  return ServiceTypeByCode(items, ServiceTypeCode.Drug);\r\n}\r\n\r\nexport function GetAlcoholServiceType(items: ServiceType[]): ServiceType  {\r\n  return ServiceTypeByCode(items, ServiceTypeCode.Alcohol);\r\n}\r\n\r\nexport function GetPhysicalServiceType(items: ServiceType[]): ServiceType  {\r\n  return ServiceTypeByCode(items, ServiceTypeCode.Physical);\r\n}\r\n\r\nexport function GetOHSServiceType(items: ServiceType[]): ServiceType  {\r\n  return ServiceTypeByCode(items, ServiceTypeCode.OHS);\r\n}\r\n\r\nexport function GettPOCTServiceType(items: ServiceType[]): ServiceType  {\r\n  return ServiceTypeByCode(items, ServiceTypeCode.POCT);\r\n}\r\n\r\nexport function GettBackgroundServiceType(items: ServiceType[]): ServiceType {\r\n  return ServiceTypeByCode(items, ServiceTypeCode.Background);\r\n}\r\nexport function GetCHSServiceType(items: ServiceType[]): ServiceType  {\r\n  return ServiceTypeByCode(items, ServiceTypeCode.CHS);\r\n}\r\n\r\nexport function IsServiceTypeDrug(data: ServiceType): boolean {\r\n  if (data.ServiceTypeCode === ServiceTypeCode.Drug) {\r\n    return true;\r\n  }\r\n  return false;\r\n}\r\nexport function IsServiceTypeAlcohol(data: ServiceType): boolean {\r\n  if (data.ServiceTypeCode === ServiceTypeCode.Alcohol) {\r\n    return true;\r\n  }\r\n  return false;\r\n}\r\n\r\nexport function IsServiceTypePhysical(data: ServiceType): boolean {\r\n  if (data.ServiceTypeCode === ServiceTypeCode.Physical) {\r\n    return true;\r\n  }\r\n  return false;\r\n}\r\n\r\nexport function IsServiceTypeOHS(data: ServiceType): boolean {\r\n  if (data.ServiceTypeCode === ServiceTypeCode.OHS) {\r\n    return true;\r\n  }\r\n  return false;\r\n}\r\n\r\n\r\nexport function IsServiceTypePOCT(data: ServiceType): boolean {\r\n  if (data.ServiceTypeCode === ServiceTypeCode.POCT) {\r\n    return true;\r\n  }\r\n  return false;\r\n}\r\n\r\n\r\nexport function IsServiceTypeBackground(data: ServiceType): boolean {\r\n  if (data.ServiceTypeCode === ServiceTypeCode.Background) {\r\n    return true;\r\n  }\r\n  return false;\r\n}\r\n\r\nexport function IsServiceTypeCHS(data: ServiceType): boolean {\r\n  return data.ServiceTypeCode === ServiceTypeCode.CHS\r\n}\r\n\r\nexport function IsServiceTypeCodeDrug(code: ServiceTypeCode): boolean {\r\n  if (code === ServiceTypeCode.Drug) {\r\n    return true;\r\n  }\r\n  return false;\r\n}\r\nexport function IsServiceTypeCodeAlcohol(code: ServiceTypeCode): boolean {\r\n  if (code === ServiceTypeCode.Alcohol) {\r\n    return true;\r\n  }\r\n  return false;\r\n}\r\n\r\nexport function IsServiceTypeCodePhysical(code: ServiceTypeCode): boolean {\r\n  if (code === ServiceTypeCode.Physical) {\r\n    return true;\r\n  }\r\n  return false;\r\n}\r\n\r\nexport function IsServiceTypeCodeOHS(code: ServiceTypeCode): boolean {\r\n  if (code === ServiceTypeCode.OHS) {\r\n    return true;\r\n  }\r\n  return false;\r\n}\r\n\r\n\r\nexport function IsServiceTypeCodePOCT(code: ServiceTypeCode): boolean {\r\n  if (code === ServiceTypeCode.POCT) {\r\n    return true;\r\n  }\r\n  return false;\r\n}\r\n\r\n\r\nexport function IsServiceTypeCodeBackground(code: ServiceTypeCode): boolean {\r\n  if (code === ServiceTypeCode.Background) {\r\n    return true;\r\n  }\r\n  return false;\r\n}\r\n\r\nexport function IsServiceTypeCodeCHS(code: ServiceTypeCode): boolean {\r\n  return code === ServiceTypeCode.CHS\r\n}","import React, { Component } from 'react'\r\nimport { Button, Collapse } from 'react-bootstrap'\r\n\r\nexport interface TogglePanelProps {\r\n  collapsibleId: string,\r\n  header: React.ReactNode,\r\n  children: React.ReactNode,\r\n  isOpen: boolean,\r\n  isDisabled: boolean,\r\n  onHeaderClick: () => void\r\n}\r\n\r\nexport default class TogglePanel extends Component<TogglePanelProps> {\r\n  render() {\r\n    const { collapsibleId, header, isOpen, isDisabled, onHeaderClick, children } = this.props\r\n\r\n    return (\r\n      <div className=\"pb-2\">\r\n        <Button size=\"sm\" className=\"w-100\" aria-controls={collapsibleId} aria-expanded={isOpen} onClick={onHeaderClick} disabled={isDisabled}>\r\n            {header}\r\n        </Button>\r\n        <Collapse in={isOpen}>\r\n          <div id={collapsibleId} className=\"m-2 p-2 section-border\">\r\n            {children}\r\n          </div>\r\n        </Collapse>\r\n      </div>\r\n    )\r\n  }\r\n}\r\n","import React, { Component } from 'react'\r\nimport { Form, Col, Button } from 'react-bootstrap'\r\nimport TogglePanel from '../TogglePanel'\r\nimport { ServiceDataModel } from '../OrderModels'\r\n\r\nexport interface SelectServiceTogglePanelProps {\r\n  title: string,\r\n  data: ServiceDataModel,\r\n  collapsibleId: string,\r\n  disabled: boolean,\r\n  open?: boolean,\r\n  onClose: () => void,\r\n  onSubmit: () => void,\r\n  onValidate: (data: ServiceDataModel) => boolean\r\n}\r\n\r\ninterface SelectServiceTogglePanelState {\r\n  open: boolean\r\n}\r\n\r\nexport default class SelectServiceTogglePanel extends Component<SelectServiceTogglePanelProps, SelectServiceTogglePanelState> {\r\n  constructor(props: SelectServiceTogglePanelProps) {\r\n    super(props)\r\n\r\n    this.state = { open: props.open || false }\r\n  }\r\n\r\n  onSubmit = (e: React.FormEvent) => {\r\n    e.preventDefault()\r\n    this.props.onSubmit()\r\n    this.setOpen(false)\r\n  }\r\n\r\n  onHeaderClick = () => this.state.open ? null : this.setOpen(true)\r\n\r\n  onCloseClick = () => {\r\n    this.setOpen(false)\r\n    this.props.onClose()\r\n  }\r\n\r\n  setOpen = (open: boolean) => this.setState({open: open}) // Closing clears all entered data\r\n\r\n  render() {\r\n    const { title, disabled, onValidate, collapsibleId, data } = this.props\r\n    const isValid = onValidate(data)\r\n    const header = <div>{title}<span className=\"float-right\">+</span></div>\r\n    return (\r\n      <TogglePanel  collapsibleId={collapsibleId}\r\n                    header={header}\r\n                    onHeaderClick={this.onHeaderClick}\r\n                    isOpen={this.state.open}\r\n                    isDisabled={disabled || (!!this.props.open && !!this.props.open !== this.state.open)}>\r\n        <Form onSubmit={this.onSubmit}>\r\n          {this.props.children}\r\n          <Form.Row>\r\n            <Col>\r\n              {!this.props.open && <Button type=\"reset\" variant=\"secondary\" size=\"sm\" className=\"fixed-w5\" onClick={this.onCloseClick}>CANCEL</Button>}\r\n              <Button type=\"submit\" variant=\"primary\" size=\"sm\" className=\"fixed-w5 float-right\" disabled={!isValid}>ADD</Button>\r\n            </Col>\r\n          </Form.Row>\r\n        </Form>\r\n      </TogglePanel>\r\n    )\r\n  }\r\n}\r\n","export enum ServiceCode {\r\n  DrugDOTUrine = \"DOTU\",\r\n  DrugDOTOral = \"DOTSL\",\r\n  DrugNonDOTUrine = \"NDOTU\",\r\n  DrugNonDOTOral = \"SDRG\",\r\n  AlcoholBreath = \"BALC\",\r\n  AlcoholSaliva = \"SALC\",\r\n  AlcoholBreathDOT = \"DOTBALC\",\r\n  AlcoholSalivaDOT = \"DOTSALC\",\r\n  PhysicalDOT = \"DOTPHY\",\r\n  Physical = \"FFPPE\",\r\n  POCT = \"IDRUG\",\r\n  FLEX = \"FLEX\",\r\n  Audiogram = \"AUDIOGRAM\",\r\n  Clinical = \"CLINICAL\",\r\n  COVID = \"COVID\",\r\n  Pulmonary = \"PULMONARY\",\r\n  RespiratorFit = \"RESPIRATOR\",\r\n  RespiratorMedical = \"RESPMEQ\",\r\n  Tuberculosis = \"TBSKIN\",\r\n  Wellness = \"WELLNESS\",\r\n  Hair = \"HAIR\",\r\n  None = \"\",\r\n}\r\n","import EmployeeCategory from \"../../api/LabService/LabServiceModel/EmployeeCategory\"\r\nimport LabAccount from \"../../api/LabService/LabServiceModel/LabAccount\"\r\nimport TestToBePerform from \"../../api/LabService/LabServiceModel/TestToBePerform\"\r\nimport RegulatoryMode from \"../../api/LabService/LabServiceModel/RegulatoryMode\"\r\nimport State from \"../../api/OrderRequests/OrderRequestsModel/State\"\r\nimport { ServiceTypeCode } from \"../../api/Administration/Model/ServiceType\"\r\nimport Service from \"../../api/Administration/Model/Service\"\r\nimport { SampleType } from \"../../api/LookupCodes/SampleType\"\r\nimport { ServiceCode } from \"../../api/LookupCodes/ServiceCode\"\r\n\r\nexport const OTHER_REASON_TEXT = 'Other'\r\n\r\nexport enum ServiceTypeOld {\r\n  Drug = \"DRUG\",\r\n  Alcohol = \"ALCOHOL\",\r\n  Physical = \"PHYSICAL\",\r\n  POCT = \"POINT OF CARE TEST (POCT)\",\r\n  Background = \"BACKGROUND\"\r\n}\r\n\r\nexport const EmptyServiceData: ServiceDataModel = {\r\n  id: 0,\r\n  serviceTypeCode: ServiceTypeCode.None,\r\n  serviceCode: ServiceCode.None,\r\n  isMarketplace: false,\r\n  isDOT: undefined,\r\n  testToPerform: '',\r\n  testToPerformObj: undefined,\r\n  labAccount: '',\r\n  labAccountObj: undefined,\r\n  reqSpecimenCollection: '',\r\n  observedCollection: false,\r\n  regulatoryMode: '',\r\n  regulatoryModeObj: undefined,\r\n  category: '',\r\n  categoryObj: undefined,\r\n  selectedTests: [],\r\n  selectedServices: [],\r\n  selectedTestType: undefined,\r\n  isValidMode: false\r\n}\r\n\r\nexport interface ServiceDataModel {\r\n  id: number\r\n  serviceTypeCode: ServiceTypeCode\r\n  serviceCode: ServiceCode\r\n  isMarketplace: boolean\r\n  isDOT?: boolean\r\n  testToPerform: string\r\n  testToPerformObj?: AlcoholTestSampleType | TestToBePerform\r\n  labAccount: string\r\n  labAccountObj?: LabAccount\r\n  reqSpecimenCollection: string\r\n  observedCollection: boolean\r\n  regulatoryMode: string\r\n  regulatoryModeObj?: RegulatoryMode\r\n  category: string | number\r\n  categoryObj?: EmployeeCategory\r\n  selectedTests: TestToBePerform[]\r\n  selectedServices: Service[]\r\n  selectedTestType?: SampleType\r\n  isValidMode: boolean\r\n}\r\n\r\nexport interface ServiceOrderedModel {\r\n  serviceCode: ServiceCode,\r\n  serviceTypeCode: ServiceTypeCode,\r\n  isDOT?: boolean,\r\n  labAccountDesc?: string\r\n  testToPerformDesc?: string\r\n}\r\n\r\nexport interface GovLabModel {\r\n  labAccount?: string\r\n  labCode?: string\r\n  labClientMemberId?: number\r\n}\r\n\r\nexport interface GovPanelModel {\r\n  panelCode?: string\r\n  panelDescription?: string\r\n  testToPerform?: string\r\n}\r\n\r\nexport interface GovServiceDataModel extends GovLabModel, GovPanelModel {\r\n  id?: number\r\n  serviceType?: ServiceTypeOld\r\n  sampleType?: string\r\n  isDOT?: boolean\r\n  testDetailID?: string\r\n}\r\n\r\n\r\nexport interface DonorInformationModel {\r\n  idType?: string\r\n  idTypeObj?: GetRegulatoryModeDonor\r\n  state?: State | undefined\r\n  stateCode?: string | undefined\r\n  states?: State[] | undefined\r\n  donorId?: string\r\n  firstName?: string\r\n  middleInitial?: string\r\n  lastName?: string\r\n  eveningPhone?: string\r\n  daytimePhone?: string\r\n  birthdate?: Date\r\n  gender?: string\r\n  personId?: number\r\n  accessCode?: number\r\n  email?: string\r\n  firstNameReadOnly?: boolean\r\n  middleInitialReadOnly?: boolean\r\n  lastNameReadOnly?: boolean\r\n  homePhoneReadOnly?: boolean\r\n  workPhoneReadOnly?: boolean\r\n  genderReadOnly?: boolean\r\n  stateReadOnly?: boolean\r\n  showPotentialMatches?: boolean\r\n  idReadOnly?: boolean\r\n  address?: DonorAddressModel\r\n}\r\n\r\nexport interface DonorAddressModel {\r\n  Address1: string\r\n  Address2: string | null\r\n  City: string\r\n  State: string\r\n  Zip: string\r\n}\r\n\r\nexport interface ScheduleModel {\r\n  timezone: string | undefined,\r\n  overrideAllowed: boolean,\r\n  hoursUntilExpires: number | undefined,\r\n  expirationDate: Date | undefined,\r\n  formattedExpirationDate: string,\r\n  displayExpirationDate: string,\r\n  comment: string,\r\n  proceedImmediately:boolean\r\n  extendExpirationHours: number\r\n}\r\n\r\nexport interface Reason {\r\n  BeginEffectiveDate: string,\r\n  Code: string | number | null,\r\n  Description: string,\r\n  EndEffectiveDate: string,\r\n  TestReasonID: number,\r\n  UpdateDate: string,\r\n  UpdateMethod: string | number | null,\r\n  UserLogin: string | number | null\r\n}\r\n\r\nexport interface AlcoholTestSampleType {\r\n  BeginEffectiveDate: string,\r\n  ClientID: number,\r\n  Code: string,\r\n  Description: string,\r\n  EndEffectiveDate: string,\r\n  IsAlcohol: boolean,\r\n  IsPoct: boolean,\r\n  SampleTypeID: string | number,\r\n  TestDetails: string | number | null,\r\n  UpdateDate: string,\r\n  UpdateMethod: string | number | null,\r\n  UserLogin: string | number | null\r\n  PanelID?: number\r\n  SampleTypeCode?: string\r\n}\r\n\r\nexport interface GetRegulatoryModeDonor {\r\n  Description: string\r\n  PrimaryIDType: string\r\n  Rank: number\r\n  DisplayState: boolean\r\n}\r\n\r\nexport interface Collector {\r\n  VendorID: string | number\r\n  ParentVendorID: string | null\r\n  FFID: string\r\n  Name: string\r\n  Code: string\r\n  Type: string | null\r\n  Address1: string\r\n  Address2: string | null\r\n  City: string\r\n  State: string\r\n  Zip: string\r\n  Phone: string | null\r\n  HoursOfOperation: string\r\n  Private: boolean\r\n  Distance: number\r\n  Latitude: number\r\n  Longitude: number\r\n  UseDOTForm: boolean\r\n  FFEnabled: boolean\r\n  OutOfNetwork: boolean\r\n  iVendorID: number\r\n  SiteID: string | null\r\n  Fax: string | null\r\n}\r\n","export default \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAACKUlEQVR42q2UT0gUURzHf5rtzswiqaRlpZC2CDbasDNvwQ5ihMcO0s3AAomCrl4k0kBMvXSShKBDmx4MIchLkERU7KlTRLe6lGJuYrq1ju7Ojt+3vrfq4uwI+oMPu+/35/ve7zePR0RUSv5WAsp8ck6CMyQSw8D0KYgViT0E38Bp6SgHd8AEeASi4lTSdOGXxrtqB49FzXUQ8NqtCUyDt6ADhMAlMCT+XwFxMAWqvOazn68e9IhWufgH8AzcALUedSRnyItmD8lr0EZBK91JR2kqc35oUdeVqJbzMRDJdMk4fMMac/7k48yZ2a5Lx3bXSbYFWTqRqzbdE6qV/a5ZmQQ1JmsUY/2WylxHMdMDudno/zqxtpH/NT9DYzWcE8LvzgmlIC8y1i7zhICR6sZpX2jMXSE9VSfjiuU811h2mS4kqw8kSPpyHU9QzI0hCL5EcYKMlYpdIxpXWXY1qNuNBxJUI3YfTyhrTV5VmPNEjWbXgoYd3hHMzGGTJWpKlHsKIuk/nIOYzwjWSazjdO6nGjA3WuSH4nG0O8XXQTNzN99RoSAG/gA7LkiOm5s391yDVjeED/VJxtFB19743/M4yDy1LDZI11k6YusocvvnwC9gg3XwG7zzyI0Ve+KOgWvgCxgB/eA2uA8+g26R42u6eNuegnvglPAPixgJXy8YB6PAKhSvBHygk+A9uLjPRmPiWSs0XvcKvAH5y2+JB7K5yMnbfTqrEI906RYqNPeJ/mi8SQAAAABJRU5ErkJggg==\"","import { Component } from 'react'\r\nimport { ServiceDataModel } from '../OrderModels'\r\nimport ServiceType from \"../../../api/Administration/Model/ServiceType\"\r\nimport Service from \"../../../api/Administration/Model/Service\"\r\nimport AccountService from \"../../../api/Administration/Model/AccountService\"\r\nimport { OrderDefault } from '../../../api/Administration/OrderDefaults'\r\n\r\n\r\nexport interface SelectServiceProps {\r\n  disabled: boolean,\r\n  open?: boolean,\r\n  isDot?: boolean,\r\n  selectedTestCode?: string,\r\n  labAccountNumber?: string,\r\n  panelId?: number,\r\n  canAddDOT: boolean,\r\n  canAddNonDOT: boolean,\r\n  orderableServiceType: ServiceType,\r\n  orderableServices: Service[],\r\n  orderableAccountServices: AccountService[],\r\n  defaults?: OrderDefault[],\r\n  marketplaceServicesCount: number,\r\n  notMarketplaceServicesCount: number,\r\n  denyAddService: boolean\r\n  regulatoryModeID?: number\r\n  employeeCategoryID?: number\r\n  onAdd: (data: ServiceDataModel) => void\r\n}\r\n\r\nexport interface SelectServiceState extends ServiceDataModel { \r\n\r\n}\r\n\r\nexport default class SelectService<P extends SelectServiceProps, S extends SelectServiceState> extends Component<P, S> {\r\n  isAllServicesDisabled: boolean = true;\r\n  static getDerivedStateFromProps(props: SelectServiceProps, state: SelectServiceState) {\r\n    let shouldResetDOT = !props.canAddDOT && state.isDOT === true\r\n    shouldResetDOT = shouldResetDOT || (!props.canAddNonDOT && state.isDOT === false)\r\n    if (shouldResetDOT) {\r\n      return {...state, isDOT: undefined}\r\n    }\r\n    return null\r\n  }\r\n}\r\n","import { Observable } from \"rxjs\"\r\nimport { ObservableFromFetch } from \"../ObservableFromFetch\"\r\nimport TestToBePerformWithCompanyName from \"./LabServiceModel/TestToBePerformWithCompanyName\"\r\n\r\nexport interface LabServicesGetParams {\r\n  ImplementationID?: number\r\n  LabAccountNumber: string\r\n  VendorID: number\r\n  IsDOT: boolean\r\n  IsPoct: boolean\r\n  AutoFilterValue?: string\r\n  IsMarketPlace: boolean\r\n  Link?: string\r\n}\r\n\r\nexport default function TestToBePerformGetObservable(params: LabServicesGetParams): Observable<TestToBePerformWithCompanyName> {\r\n  const requestBody: string = JSON.stringify(params)\r\n  return ObservableFromFetch<TestToBePerformWithCompanyName>(\"order/GetTestToBePerformsWithCompanyName\", requestBody)\r\n}","import AccountService, { AccountServicesByServiceId, HasActiveAccountServicesByServiceId } from \"./AccountService\"\r\nimport { ServiceCode } from \"../../LookupCodes/ServiceCode\"\r\n\r\nexport default interface Service {\r\n  ServiceID: number\r\n  ServiceName: string\r\n  ServiceDescription: string\r\n  ServiceCode: string\r\n  SampleType?: string\r\n  ServiceTypeID: number\r\n  DOT: boolean\r\n  ActiveWorkForce: boolean\r\n  ActivateAll: boolean\r\n  Marketplace: boolean\r\n  DisplayOrder: number\r\n  FFServiceCode: string\r\n  MPSku: string\r\n}\r\n\r\nconst emptyService = {\r\n  ServiceID: 0,\r\n  ServiceName: \"\",\r\n  ServiceDescription: \"\",\r\n  ServiceCode: \"\",\r\n  SampleType: \"\",\r\n  ServiceTypeID: 0,\r\n  DOT: false,\r\n  ActiveWorkForce: false,\r\n  ActivateAll: false,\r\n  Marketplace: false,\r\n  DisplayOrder: 0,\r\n  FFServiceCode: \"\",\r\n  MPSku: \"\",\r\n}\r\n\r\nexport function ServiceById(items: Service[], serviceId: number) {\r\n  return items.find((item) => item.ServiceID === serviceId) || emptyService\r\n}\r\n\r\nexport function ServiceByCode(items: Service[], code: ServiceCode): Service {\r\n  return items.find((item) => item.FFServiceCode === code) || emptyService\r\n}\r\n\r\nexport function ServicesByServiceTypeId(items: Service[], serviceTypeId: number) {\r\n  return items.filter((item) => item.ServiceTypeID === serviceTypeId)\r\n}\r\n\r\nexport function ServicesByServiceSampleType(items: Service[], sampleType: string) {\r\n  return items.filter((item) => item.SampleType === sampleType)\r\n}\r\n\r\nexport function AccountsForServices(services: Service[], accountServices: AccountService[]) {\r\n  return services.reduce((result: AccountService[], service) => {\r\n    const accounts = AccountServicesByServiceId(accountServices, service.ServiceID)\r\n    return result.concat(accounts)\r\n  }, [])\r\n}\r\n\r\nexport function IsServiceActive(service: Service, accountServices: AccountService[]) {\r\n  return service.ActiveWorkForce && HasActiveAccountServicesByServiceId(accountServices, service.ServiceID)\r\n}\r\n\r\nexport function IsServiceCodePOCT(code: ServiceCode) {\r\n  return code === ServiceCode.POCT\r\n}\r\n\r\nexport function IsServiceCodeFLEX(code: ServiceCode) {\r\n  return code === ServiceCode.FLEX\r\n}\r\n\r\nexport function IsServiceCodeWellness(code: ServiceCode) {\r\n  return code === ServiceCode.Wellness\r\n}\r\n\r\nexport function IsServiceCodeCHSBL(code: ServiceCode | string) {\r\n  return code === ServiceCode.Clinical\r\n}\r\n","export enum SampleType {\r\n  UR = \"UR\",\r\n  SD = \"SD\",\r\n  SLD = \"SLD\",\r\n  HR = \"HR\",\r\n}\r\n","export default interface AccountService {\r\n  AccountServiceID: number\r\n  ImplementationID: number\r\n  AccountID?: number\r\n  ServiceID: number\r\n  Active: boolean\r\n  IsDefault: boolean\r\n}\r\n\r\n\r\n\r\n\r\nexport function AccountServicesByServiceId(items: AccountService[], serviceId: number): AccountService[] {\r\n  let result = [];\r\n  for (let i = 0; i < items.length; i++) {\r\n    if (items[i].ServiceID === serviceId) {\r\n      result.push(items[i]);\r\n    }\r\n  }\r\n  return result;\r\n}\r\n\r\n\r\nexport function ActiveAccountServicesByServiceId(items: AccountService[], serviceId: number): AccountService[] {\r\n  let result = [];\r\n  for (let i = 0; i < items.length; i++) {\r\n    if (((!!items[i].AccountID && items[i].Active) || (!items[i].AccountID && items[i].Active && items[i].IsDefault)) && (items[i].ServiceID === serviceId)) {\r\n      result.push(items[i]);\r\n    }\r\n  }\r\n  return result;\r\n}\r\n\r\nexport function HasActiveAccountServicesByServiceId(items: AccountService[], serviceId: number):  boolean{\r\n  let activeItems = ActiveAccountServicesByServiceId(items, serviceId);\r\n  \r\n  if(activeItems.length > 0){\r\n    return true;\r\n  }\r\n  return false;\r\n}","import { Form } from \"react-bootstrap\"\r\n\r\ninterface SelectSpecimenCollectionProps {\r\n  selectedValue?: string\r\n  disabled?: boolean\r\n  onChange: (e: React.ChangeEvent<HTMLInputElement>) => void\r\n}\r\n\r\nfunction SelectSpecimenCollection(props: SelectSpecimenCollectionProps) {\r\n  const { selectedValue, disabled, onChange } = props\r\n\r\n  return (\r\n    <Form.Group>\r\n      <Form.Check\r\n        inline\r\n        label=\"SINGLE\"\r\n        id=\"single-radio\"\r\n        type=\"radio\"\r\n        name=\"reqSpecimenCollection\"\r\n        className=\"font-weight-bold abc-radio\"\r\n        value=\"single\"\r\n        disabled={disabled}\r\n        checked={selectedValue === \"single\"}\r\n        onChange={onChange}\r\n      />\r\n      <Form.Check\r\n        inline\r\n        label=\"SPLIT\"\r\n        id=\"split-radio\"\r\n        type=\"radio\"\r\n        name=\"reqSpecimenCollection\"\r\n        className=\"font-weight-bold abc-radio\"\r\n        value=\"split\"\r\n        checked={selectedValue === \"split\"}\r\n        onChange={onChange}\r\n      />\r\n    </Form.Group>\r\n  )\r\n}\r\n\r\nSelectSpecimenCollection.defaultProps = {\r\n  selectedValue: \"\",\r\n  disabled: false,\r\n}\r\n\r\nexport default SelectSpecimenCollection\r\n","import { Form } from \"react-bootstrap\"\r\n\r\nimport Checkbox from \"../../Checkbox\"\r\n\r\ninterface SelectObservedProps {\r\n  checked?: boolean\r\n  disabled?: boolean\r\n  onChange: (e: React.ChangeEvent<HTMLInputElement>) => void\r\n}\r\n\r\nfunction SelectObserved(props: SelectObservedProps) {\r\n  const { checked, disabled, onChange } = props\r\n\r\n  return (\r\n    <Form.Group>\r\n      <Checkbox\r\n        label=\"OBSERVED\"\r\n        id=\"observed-checkbox\"\r\n        className=\"font-weight-bold ml-2\"\r\n        name=\"observedCollection\"\r\n        checked={checked}\r\n        disabled={disabled}\r\n        onChange={onChange}\r\n      />\r\n    </Form.Group>\r\n  )\r\n}\r\n\r\nSelectObserved.defaultProps = {\r\n  checked: false,\r\n  disabled: false,\r\n}\r\n\r\nexport default SelectObserved\r\n","export enum DefaultLookupCode {\r\n  RegMode = \"REGMODE\",\r\n  TestReason = \"REASON\",\r\n  ExpTime = \"EXPIRATION\",\r\n  FAAEmployee = \"FAAEMPLOYEE\",\r\n  DOTSampleType = \"DOTSAMPLE\",\r\n  NonDOTSampleType = \"NONDOTSAMPLE\",\r\n}\r\n","import { Component } from \"react\"\r\n\r\nimport { Col, Form } from \"react-bootstrap\"\r\nimport { Typeahead } from \"react-bootstrap-typeahead\"\r\nimport { concat, of, Subject, Subscription } from \"rxjs\"\r\nimport { filter, map, switchMap } from \"rxjs/operators\"\r\n\r\nimport { OrderDefault } from \"../../api/Administration/OrderDefaults\"\r\nimport EmployeeCategoriesGetObservable from \"../../api/LabService/EmployeeCategoriesGet\"\r\nimport EmployeeCategory from \"../../api/LabService/LabServiceModel/EmployeeCategory\"\r\nimport RegulatoryMode from \"../../api/LabService/LabServiceModel/RegulatoryMode\"\r\nimport LabServiceRegulatoryModesGetObservable from \"../../api/LabService/LabServiceRegulatoryModesGet\"\r\nimport { DefaultLookupCode } from \"../../api/LookupCodes/DefaultLookupCode\"\r\n\r\ninterface RegulatoryModeProps {\r\n  defaults?: OrderDefault[]\r\n  regulatoryModeID?: number\r\n  employeeCategoryID?: number\r\n  onChange: (isValid: boolean, mode?: RegulatoryMode, cat?: EmployeeCategory) => void\r\n}\r\n\r\ninterface RegulatoryModeState {\r\n  regulatoryModesLoading: boolean\r\n  categoriesLoading: boolean\r\n  regulatoryModes: RegulatoryMode[]\r\n  filteredModes: RegulatoryMode[]\r\n  categories: EmployeeCategory[]\r\n  regulatoryModeObj?: RegulatoryMode\r\n  categoryObj?: EmployeeCategory\r\n}\r\n\r\nexport default class RegulatoryModeControl extends Component<RegulatoryModeProps, RegulatoryModeState> {\r\n  state: RegulatoryModeState = {\r\n    regulatoryModesLoading: false,\r\n    categoriesLoading: false,\r\n    regulatoryModes: [],\r\n    filteredModes: [],\r\n    categories: [],\r\n    regulatoryModeObj: undefined,\r\n    categoryObj: undefined,\r\n  }\r\n\r\n  subscriptions = new Subscription()\r\n\r\n  regulatoryMode$ = new Subject<RegulatoryMode>()\r\n\r\n  componentDidMount() {\r\n    const { employeeCategoryID, defaults, regulatoryModeID } = this.props\r\n    const { regulatoryModeObj } = this.state\r\n\r\n    this.subscriptions.add(\r\n      this.regulatoryMode$.subscribe((selected) =>\r\n        this.setState({\r\n          regulatoryModeObj: selected,\r\n          categories: [],\r\n        })\r\n      )\r\n    )\r\n\r\n    this.subscriptions.add(\r\n      this.regulatoryMode$\r\n        .pipe(\r\n          filter((selected) => !!selected),\r\n          switchMap((selected: RegulatoryMode) =>\r\n            concat(\r\n              of({ isLoading: true }),\r\n              EmployeeCategoriesGetObservable(selected.RegulatoryModeID).pipe(\r\n                map((data) => ({ isLoading: false, result: data }))\r\n              )\r\n            )\r\n          )\r\n        )\r\n        .subscribe((data: { isLoading: boolean; result?: EmployeeCategory[] }) => {\r\n          const items = data.result || []\r\n          const categoryObj = items.find((item) => item.EmployeeCategoryID === employeeCategoryID)\r\n          if (regulatoryModeObj?.RegulatoryModeID.toString() === \"3\") {\r\n            const filteredCategories: EmployeeCategory[] = []\r\n            const FAADefaults = defaults?.filter((item) => item.LookupCode === DefaultLookupCode.FAAEmployee)\r\n            if (FAADefaults && FAADefaults.length > 0) {\r\n              const defaultFAA = FAADefaults.find((item) => !!item.Show && !!item.IsDefault)\r\n              items.forEach((item) => {\r\n                const def = FAADefaults?.find((el) => el.FieldName === item.Name)\r\n                if (!def || def?.Show) filteredCategories.push(item)\r\n              })\r\n              if (defaultFAA) {\r\n                this.setState({\r\n                  categories: filteredCategories,\r\n                  categoriesLoading: data.isLoading,\r\n                  categoryObj: filteredCategories.find((item) => item.Name === defaultFAA?.FieldName),\r\n                })\r\n              } else {\r\n                this.setState({ categories: filteredCategories, categoriesLoading: data.isLoading })\r\n              }\r\n            } else {\r\n              this.setState({ categoriesLoading: data.isLoading, categories: items })\r\n            }\r\n          } else {\r\n            this.setState({\r\n              categoriesLoading: data.isLoading,\r\n              categories: items,\r\n              categoryObj,\r\n            })\r\n          }\r\n          this.onCategoryChange(categoryObj)\r\n        })\r\n    )\r\n\r\n    this.setState({ regulatoryModesLoading: true })\r\n    this.subscriptions.add(\r\n      LabServiceRegulatoryModesGetObservable(true).subscribe(\r\n        (result: RegulatoryMode[]) => {\r\n          const regMode = result.find((item) => item.RegulatoryModeID === regulatoryModeID)\r\n          this.setState({\r\n            regulatoryModes: result,\r\n            regulatoryModesLoading: false,\r\n            regulatoryModeObj: regMode,\r\n          })\r\n\r\n          if (regMode) {\r\n            this.regulatoryMode$.next(regMode)\r\n          } else {\r\n            this.filterFields()\r\n          }\r\n        },\r\n        () => this.setState({ regulatoryModesLoading: false })\r\n      )\r\n    )\r\n  }\r\n\r\n  componentDidUpdate(prevProps: RegulatoryModeProps) {\r\n    const { defaults, regulatoryModeID, employeeCategoryID } = this.props\r\n    const { categories } = this.state\r\n    if (defaults !== prevProps.defaults && !regulatoryModeID) {\r\n      this.filterFields()\r\n    }\r\n    if (!!employeeCategoryID && employeeCategoryID > 0 && prevProps.employeeCategoryID !== employeeCategoryID) {\r\n      const categoryObj = categories.find((item) => item.EmployeeCategoryID === employeeCategoryID)\r\n      this.onCategoryChange(categoryObj)\r\n    }\r\n  }\r\n\r\n  componentWillUnmount() {\r\n    this.subscriptions.unsubscribe()\r\n  }\r\n\r\n  onCategoryChange = (selected?: EmployeeCategory) => {\r\n    const { onChange } = this.props\r\n    const { regulatoryModeObj } = this.state\r\n    this.setState({ categoryObj: selected })\r\n    onChange(this.isValidSelection(selected), regulatoryModeObj, selected)\r\n  }\r\n\r\n  filterFields = () => {\r\n    const { defaults } = this.props\r\n    const { regulatoryModes } = this.state\r\n    let modeDefaults = defaults?.filter((item) => item.LookupCode === DefaultLookupCode.RegMode)\r\n    if (modeDefaults && modeDefaults.length === 0)\r\n      modeDefaults = defaults?.filter((item) => item.LookupCode === DefaultLookupCode.RegMode && !item.AccountID)\r\n    if (modeDefaults && modeDefaults.length > 0) {\r\n      const filteredModes: RegulatoryMode[] = []\r\n      const defaultMode = modeDefaults.find((item) => !!item.Show && !!item.IsDefault)\r\n      regulatoryModes.forEach((item) => {\r\n        const def = modeDefaults?.find((el) => el.FieldName === item.Name)\r\n        if (!def || def?.Show) filteredModes.push(item)\r\n      })\r\n      this.setState({ filteredModes })\r\n      if (defaultMode) this.regulatoryMode$.next(filteredModes.find((item) => item.Name === defaultMode?.FieldName))\r\n    } else {\r\n      this.setState({ filteredModes: [...regulatoryModes] })\r\n    }\r\n  }\r\n\r\n  isValidSelection = (category?: EmployeeCategory) => {\r\n    const { categories, categoriesLoading } = this.state\r\n    return !!category || (categories.length === 0 && !categoriesLoading)\r\n  }\r\n\r\n  render() {\r\n    const { regulatoryModesLoading, regulatoryModeObj, filteredModes, categoriesLoading, categories, categoryObj } =\r\n      this.state\r\n    const { regulatoryModeID, employeeCategoryID } = this.props\r\n\r\n    return (\r\n      <>\r\n        <Form.Row>\r\n          <Col xs=\"12\">\r\n            <Form.Group>\r\n              <Form.Label className=\"font-weight-bold required\">REGULATORY MODE</Form.Label>\r\n              <Typeahead\r\n                id=\"regulatoryModeTypeahead\"\r\n                labelKey=\"Name\"\r\n                filterBy={(option, props) => {\r\n                  return props.selected.length > 0 || option.Name.toLowerCase().indexOf(props.text.toLowerCase()) !== -1\r\n                }}\r\n                disabled={regulatoryModesLoading || !!regulatoryModeID}\r\n                isInvalid={!regulatoryModesLoading && !regulatoryModeObj}\r\n                onChange={(selected) => this.regulatoryMode$.next(selected[0])}\r\n                options={filteredModes || []}\r\n                placeholder={\r\n                  regulatoryModesLoading\r\n                    ? \"Loading...\"\r\n                    : filteredModes.length > 0 ? \"Enter the Regulatory Mode name\" : \"No Regulatory Modes Available\" }\r\n                selected={regulatoryModeObj ? [regulatoryModeObj] : []}\r\n              />\r\n            </Form.Group>\r\n          </Col>\r\n        </Form.Row>\r\n        <Form.Row>\r\n          <Col xs=\"12\">\r\n            <Form.Group>\r\n              <Form.Label className={`font-weight-bold ${categories.length > 0 && \"required\"}`}>CATEGORY</Form.Label>\r\n                <Typeahead\r\n                  id=\"regulatoryModeCategoryTypeahead\"\r\n                  labelKey=\"Name\"\r\n                  filterBy={(option, props) => {\r\n                    return (\r\n                      props.selected.length > 0 || option.Name.toLowerCase().indexOf(props.text.toLowerCase()) !== -1\r\n                    )\r\n                  }}\r\n                  onChange={(selected) => this.onCategoryChange(selected[0])}\r\n                  isInvalid={categories.length > 0 && !categoryObj}\r\n                  options={categories}\r\n                  disabled={categoriesLoading || categories.length === 0 || !!employeeCategoryID}\r\n                  placeholder={regulatoryModesLoading || !regulatoryModeObj ? \"\" :\r\n                    categoriesLoading\r\n                      ? \"Loading...\"\r\n                      : categories.length > 0 ? \"Enter the Category name\" : \"No Categories Available\"}\r\n                  selected={categoryObj ? [categoryObj] : []}\r\n                />\r\n            </Form.Group>\r\n          </Col>\r\n        </Form.Row>\r\n      </>\r\n    )\r\n  }\r\n\r\n  static defaultProps = { defaults: [], regulatoryModeID: undefined, employeeCategoryID: undefined }\r\n}\r\n","import AccountService from \"./Model/AccountService\"\r\nimport Service, { IsServiceActive } from \"./Model/Service\"\r\nimport TestToBePerform from \"../LabService/LabServiceModel/TestToBePerform\"\r\nimport { ServiceCode } from \"../LookupCodes/ServiceCode\"\r\n\r\nexport interface IDrugService extends Service {\r\n  isDOT: boolean\r\n  isFlex: boolean\r\n  isPOCT: boolean\r\n  isDOTUrine: boolean\r\n  isDOTSalive: boolean\r\n  isNonDOTUrine: boolean\r\n  isNonDOTSaliva: boolean\r\n  isMarketplace: boolean\r\n  tests: TestToBePerform[]\r\n  hasTests: boolean\r\n  isActive: boolean\r\n}\r\n\r\nexport const IsServiceDrug = (data: Service) => {\r\n  return [\r\n    ServiceCode.DrugDOTUrine,\r\n    ServiceCode.DrugDOTOral,\r\n    ServiceCode.DrugNonDOTUrine,\r\n    ServiceCode.DrugNonDOTOral,\r\n  ].includes(data.FFServiceCode as ServiceCode)\r\n}\r\n\r\nexport const IsServiceDrugDOT = (data: Service) => {\r\n  return data.DOT && IsServiceDrug(data)\r\n}\r\n\r\nexport const IsServiceDrugNonDOT = (data: Service) => {\r\n  return !data.DOT && IsServiceDrug(data)\r\n}\r\n\r\nexport const IsServiceDrugDOTUrine = (data: Service) => {\r\n  return data.DOT && data.FFServiceCode === ServiceCode.DrugDOTUrine\r\n}\r\n\r\nexport const IsServiceDrugDOTSaliva = (data: Service) => {\r\n  return data.DOT && data.FFServiceCode === ServiceCode.DrugDOTOral\r\n}\r\n\r\nexport const IsServiceDrugNonDOTUrine = (data: Service) => {\r\n  return !data.DOT && data.FFServiceCode === ServiceCode.DrugNonDOTUrine\r\n}\r\n\r\nexport const IsServiceDrugNonDOTSaliva = (data: Service) => {\r\n  return !data.DOT && data.FFServiceCode === ServiceCode.DrugNonDOTOral\r\n}\r\n\r\nexport function IsServicePOCT(data: Service): boolean {\r\n  return data.FFServiceCode === ServiceCode.POCT\r\n}\r\n\r\nexport function IsServiceFLEX(data: Service): boolean {\r\n  return data.FFServiceCode === ServiceCode.FLEX\r\n}\r\n\r\nconst DrugService = (\r\n  service: Service,\r\n  serviceTests: TestToBePerform[],\r\n  orderableAccountServices?: AccountService[]\r\n): IDrugService => {\r\n  const isDOT = IsServiceDrugDOT(service)\r\n  const isDOTUrine = IsServiceDrugDOTUrine(service)\r\n  const isDOTSalive = IsServiceDrugDOTSaliva(service)\r\n  const isNonDOTUrine = IsServiceDrugNonDOTUrine(service)\r\n  const isNonDOTSaliva = IsServiceDrugNonDOTSaliva(service)\r\n  const isFlex = IsServiceFLEX(service)\r\n  const isPOCT = IsServicePOCT(service)\r\n  const isMarketplace = service.Marketplace\r\n  const tests = serviceTests || []\r\n  const isActive = IsServiceActive(service, orderableAccountServices || [])\r\n\r\n  return {\r\n    ...service,\r\n    isDOT,\r\n    isFlex,\r\n    isPOCT,\r\n    isDOTUrine,\r\n    isDOTSalive,\r\n    isNonDOTUrine,\r\n    isNonDOTSaliva,\r\n    isMarketplace,\r\n    tests,\r\n    hasTests: tests.length > 0,\r\n    isActive,\r\n  }\r\n}\r\n\r\nexport default DrugService\r\n","import { ChangeEvent, useCallback, useEffect } from \"react\"\r\n\r\nimport { Form } from \"react-bootstrap\"\r\n\r\nimport DrugService, { IDrugService } from \"../../../api/Administration/DrugService\"\r\nimport AccountService from \"../../../api/Administration/Model/AccountService\"\r\nimport Service from \"../../../api/Administration/Model/Service\"\r\nimport { ServiceTests } from \"../../../api/Administration/Model/ServiceTests\"\r\nimport TestToBePerform from \"../../../api/LabService/LabServiceModel/TestToBePerform\"\r\nimport { ServiceCode } from \"../../../api/LookupCodes/ServiceCode\"\r\nimport { useStateWithCallback } from \"../../../utils/useStateWithCallback\"\r\n\r\ninterface DrugServicesPanelProps {\r\n  orderableServices?: Service[]\r\n  orderableAccountServices?: AccountService[]\r\n  selectedServiceCode?: ServiceCode\r\n  canAddDOT: boolean\r\n  canAddNonDOT: boolean\r\n  canAddPOCT: boolean\r\n  canAddFLEX: boolean\r\n  serviceTests?: ServiceTests\r\n  notMarketplaceServicesCount: number\r\n  marketplaceServicesCount: number\r\n  panelId?: number\r\n  onChangeTestType: (value: string) => void\r\n  onUpdateTests?: (tests: TestToBePerform[]) => void\r\n  setAllServicesDisabled: (disabled: boolean) => void\r\n}\r\n\r\ninterface ServiceWithOptions extends IDrugService {\r\n  disabled: boolean\r\n  checked: boolean\r\n  onChange: (e: ChangeEvent<HTMLInputElement>) => void\r\n}\r\n\r\nfunction DrugServicesPanel({\r\n  orderableServices = [],\r\n  orderableAccountServices = [],\r\n  selectedServiceCode = undefined,\r\n  canAddDOT,\r\n  canAddNonDOT,\r\n  canAddPOCT,\r\n  canAddFLEX,\r\n  serviceTests = {} as ServiceTests,\r\n  notMarketplaceServicesCount,\r\n  marketplaceServicesCount,\r\n  panelId = undefined,\r\n  onChangeTestType,\r\n  onUpdateTests = () => {},\r\n  setAllServicesDisabled,\r\n}: DrugServicesPanelProps) {\r\n  const [services, setServices] = useStateWithCallback<ServiceWithOptions[]>([])\r\n\r\n  const canAddTests = useCallback(\r\n    (service: IDrugService) => {\r\n      if (service.isDOT) {\r\n        return canAddDOT\r\n      }\r\n      if (service.isNonDOTSaliva || service.isNonDOTUrine) {\r\n        return canAddNonDOT\r\n      }\r\n      if (service.isPOCT) {\r\n        return canAddPOCT\r\n      }\r\n      if (service.isFlex) {\r\n        return canAddFLEX\r\n      }\r\n      return true\r\n    },\r\n    [canAddDOT, canAddFLEX, canAddNonDOT, canAddPOCT]\r\n  )\r\n\r\n  const disabledRegulatedSalivaService = useCallback(\r\n    (service: IDrugService) => {\r\n      const isSalivaPanelsAvailable = serviceTests?.[ServiceCode.DrugDOTOral].some((t) => [\"WF15\"].includes(t.Code))\r\n      return service.isDOTSalive && !isSalivaPanelsAvailable\r\n    },\r\n    [serviceTests]\r\n  )\r\n\r\n  const disabledRegulatedUrineService = useCallback(\r\n    (service: IDrugService) => {\r\n      const isSalivaPanelAvailable = serviceTests?.[ServiceCode.DrugDOTOral].some((t) => [\"WF15\"].includes(t.Code))\r\n      const isUrinePanelsAvailable =\r\n        !isSalivaPanelAvailable || serviceTests?.[ServiceCode.DrugDOTUrine].some((t) => [\"W215\"].includes(t.Code))\r\n\r\n      return service.isDOTUrine && !isUrinePanelsAvailable\r\n    },\r\n    [serviceTests]\r\n  )\r\n\r\n  const disabledIfTestPresent = useCallback(\r\n    (service: IDrugService) => {\r\n      const code = service.FFServiceCode as ServiceCode\r\n      return !!panelId && serviceTests?.[code].every((t) => t.PanelID !== panelId)\r\n    },\r\n    [panelId, serviceTests]\r\n  )\r\n\r\n  const disabledIfFlexPresent = useCallback(\r\n    (service: IDrugService) => !service.isFlex && (serviceTests?.[ServiceCode.FLEX] ?? []).length > 0,\r\n    [serviceTests]\r\n  )\r\n\r\n  const disabledMarketplaceService = useCallback(\r\n    (service: IDrugService) => !!service.isMarketplace && notMarketplaceServicesCount > 0,\r\n    [notMarketplaceServicesCount]\r\n  )\r\n\r\n  const disabledNotMarketplaceService = useCallback(\r\n    (service: IDrugService) => !service.isMarketplace && marketplaceServicesCount > 0,\r\n    [marketplaceServicesCount]\r\n  )\r\n\r\n  const checked = useCallback(\r\n    (service: Service) => {\r\n      return service.FFServiceCode === selectedServiceCode\r\n    },\r\n    [selectedServiceCode]\r\n  )\r\n\r\n  const disabled = useCallback(\r\n    (service: IDrugService) => {\r\n      return (\r\n        !checked(service) &&\r\n        (!service.isActive ||\r\n          !service.hasTests ||\r\n          !canAddTests(service) ||\r\n          disabledIfTestPresent(service) ||\r\n          disabledIfFlexPresent(service) ||\r\n          disabledRegulatedSalivaService(service) ||\r\n          disabledRegulatedUrineService(service) ||\r\n          disabledMarketplaceService(service) ||\r\n          disabledNotMarketplaceService(service))\r\n      )\r\n    },\r\n    [\r\n      checked,\r\n      canAddTests,\r\n      disabledIfTestPresent,\r\n      disabledMarketplaceService,\r\n      disabledNotMarketplaceService,\r\n      disabledIfFlexPresent,\r\n      disabledRegulatedSalivaService,\r\n      disabledRegulatedUrineService,\r\n    ]\r\n  )\r\n\r\n  useEffect(() => {\r\n    const drugServices =\r\n      orderableServices?.map((service) => {\r\n        const serviceDrug = DrugService(\r\n          service,\r\n          serviceTests?.[service.FFServiceCode as ServiceCode] || [],\r\n          orderableAccountServices\r\n        )\r\n        return {\r\n          ...serviceDrug,\r\n          disabled: disabled(serviceDrug),\r\n          checked: checked(serviceDrug),\r\n          onChange: (e: ChangeEvent<HTMLInputElement>) => onChangeTestType(e.target.value),\r\n        }\r\n      }) || []\r\n\r\n    setServices(drugServices, (newServices) => {\r\n      const testsForEnabledServices = newServices\r\n        .filter((s) => !s.disabled)\r\n        .reduce((acc: TestToBePerform[], service) => {\r\n          return acc.concat(service.tests)\r\n        }, [])\r\n      onUpdateTests?.(testsForEnabledServices)\r\n      setAllServicesDisabled(newServices.every((s) => s.disabled))\r\n    })\r\n  }, [\r\n    orderableServices,\r\n    orderableAccountServices,\r\n    serviceTests,\r\n    checked,\r\n    disabled,\r\n    onChangeTestType,\r\n    setAllServicesDisabled,\r\n    onUpdateTests,\r\n    setServices,\r\n  ])\r\n\r\n  return (\r\n    <Form.Group className={`${selectedServiceCode ? \"section-border\" : \"invalid-section-border\"} p-2`}>\r\n      {services.map((item) => (\r\n        <Form.Check\r\n          label={item.ServiceDescription}\r\n          id={`${item.FFServiceCode}-drug-test`}\r\n          key={item.FFServiceCode}\r\n          type=\"radio\"\r\n          name=\"serviceCode\"\r\n          className=\"font-weight-bold abc-radio\"\r\n          disabled={item.disabled}\r\n          checked={item.checked}\r\n          value={item.FFServiceCode}\r\n          onChange={item.onChange}\r\n        />\r\n      ))}\r\n    </Form.Group>\r\n  )\r\n}\r\n\r\nexport default DrugServicesPanel\r\n","import { useCallback, useEffect, useRef, useState } from \"react\"\r\n\r\n/**\r\n * Custom hook that allows for a state value to be set and executed with a callback function.\r\n * @param initialState The initial state value.\r\n * @returns An array containing the state value and a function to set the state value.\r\n */\r\nexport const useStateWithCallback = <T>(\r\n  initialState: T\r\n): [state: T, setState: (updatedState: React.SetStateAction<T>, callback?: (updatedState: T) => void) => void] => {\r\n  const [state, setState] = useState<T>(initialState)\r\n  const callbackRef = useRef<(updated: T) => void>()\r\n\r\n  const handleSetState = useCallback((updatedState: React.SetStateAction<T>, callback?: (updatedState: T) => void) => {\r\n    callbackRef.current = callback\r\n    setState(updatedState)\r\n  }, [])\r\n\r\n  useEffect(() => {\r\n    if (typeof callbackRef.current === \"function\") {\r\n      callbackRef.current(state)\r\n      callbackRef.current = undefined\r\n    }\r\n  }, [state])\r\n\r\n  return [state, handleSetState]\r\n}\r\n","import React from \"react\"\r\nimport { Form, Col, Image, Spinner } from \"react-bootstrap\"\r\nimport { Typeahead } from \"react-bootstrap-typeahead\"\r\nimport { BehaviorSubject, concat, of, Subject, Subscription } from \"rxjs\"\r\nimport { filter, map, switchMap } from \"rxjs/operators\"\r\nimport SelectServiceTogglePanel from \"./SelectServiceTogglePanel\"\r\nimport { ServiceDataModel, EmptyServiceData } from \"../OrderModels\"\r\nimport dotImage from \"../../../assets/images/dot-img.png\"\r\nimport SelectService, { SelectServiceProps, SelectServiceState } from \"./SelectService\"\r\n\r\nimport TestToBePerformGetObservable from \"../../../api/LabService/TestToBePerformGet\"\r\nimport LabAccountsGetObservable from \"../../../api/LabService/LabAccountsGet\"\r\nimport LabAccount from \"../../../api/LabService/LabServiceModel/LabAccount\"\r\nimport TestToBePerform from \"../../../api/LabService/LabServiceModel/TestToBePerform\"\r\nimport { ServiceTypeCode } from \"../../../api/Administration/Model/ServiceType\"\r\nimport Service, { ServiceByCode, IsServiceCodePOCT} from \"../../../api/Administration/Model/Service\"\r\nimport TestToBePerformWithCompanyName from \"../../../api/LabService/LabServiceModel/TestToBePerformWithCompanyName\"\r\nimport { SampleType } from \"../../../api/LookupCodes/SampleType\"\r\nimport SelectSpecimenCollection from \"./SelectSpecimenCollection\"\r\nimport SelectObserved from \"./SelectObserved\"\r\nimport RegulatoryModeControl from \"../RegulatoryModeControl\"\r\nimport DrugServicesPanel from \"./DrugServicesPanel\"\r\nimport { IsServiceFLEX, IsServicePOCT } from \"../../../api/Administration/DrugService\"\r\nimport { ServiceTests } from \"../../../api/Administration/Model/ServiceTests\"\r\nimport { ServiceCode } from \"../../../api/LookupCodes/ServiceCode\"\r\nimport { DefaultLookupCode } from \"../../../api/LookupCodes/DefaultLookupCode\"\r\n\r\nexport interface SelectDrugTestProps extends SelectServiceProps {\r\n  company?: number\r\n  location?: number\r\n  canAddPOCT: boolean\r\n  canAddFLEX: boolean\r\n  isObservedMandatory: boolean\r\n  sampleType?: SampleType\r\n}\r\n\r\ninterface SelectDrugTestState extends SelectServiceState {\r\n  labAccountsLoading: boolean\r\n  testsLoading: boolean\r\n  labAccounts: LabAccount[]\r\n  availableTests: TestToBePerform[]\r\n  tests: TestToBePerform[]\r\n  serviceTests: ServiceTests\r\n  labAccountCompanyName?: string\r\n  isAllServicesDisabled: boolean\r\n}\r\n\r\nexport default class SelectDrugTest extends SelectService<SelectDrugTestProps, SelectDrugTestState> {\r\n  defaultService: ServiceDataModel = {\r\n    ...EmptyServiceData,\r\n    serviceTypeCode: ServiceTypeCode.Drug,\r\n    serviceCode: ServiceCode.None,\r\n    observedCollection: false,\r\n  }\r\n  state: SelectDrugTestState = {\r\n    ...this.defaultService,\r\n    labAccountsLoading: false,\r\n    testsLoading: false,\r\n    labAccounts: [],\r\n    availableTests: [],\r\n    tests: [],\r\n    serviceTests: {} as ServiceTests,\r\n    isDOT: this.props.isDot,\r\n    reqSpecimenCollection: this.props.isDot ? \"split\" : \"single\",\r\n    isAllServicesDisabled: true,\r\n  }\r\n\r\n  subscriptions = new Subscription()\r\n  company$ = new BehaviorSubject<number>(0)\r\n  labAccount$ = new Subject<LabAccount>()\r\n\r\n  componentDidMount() {\r\n    this.subscriptions.add(\r\n      this.company$\r\n        .pipe(\r\n          switchMap((company: number) =>\r\n            !company\r\n              ? of({ isLoading: false })\r\n              : concat(\r\n                  of({ isLoading: true }),\r\n                  LabAccountsGetObservable({\r\n                    SearchFor: \"\",\r\n                    SearchBy: \"Account Name\",\r\n                    CompanyID: company,\r\n                    RegionID: 0,\r\n                    LocationID: this.props.location || 0,\r\n                    DOT: !!this.state.isDOT,\r\n                    IsMarketPlace: true,\r\n                  }).pipe(map((data) => ({ isLoading: false, result: data })))\r\n                )\r\n          )\r\n        )\r\n        .subscribe((data: { isLoading: boolean; result?: LabAccount[] }) => {\r\n          this.setState({\r\n            labAccountsLoading: data.isLoading,\r\n            labAccounts: data.result || [],\r\n          })\r\n          const selectedLabAccount = this.props.labAccountNumber\r\n            ? data.result?.find((item) => item.LabAccount === this.props.labAccountNumber)\r\n            : undefined\r\n          this.labAccount$.next(selectedLabAccount)\r\n        })\r\n    )\r\n\r\n    this.subscriptions.add(\r\n      this.labAccount$.subscribe((selected) =>\r\n        this.setState({\r\n          labAccount: selected?.LabCode || \"\",\r\n          labAccountObj: selected,\r\n          availableTests: [],\r\n          tests: [],\r\n          testToPerform: \"\",\r\n          testToPerformObj: undefined,\r\n          labAccountCompanyName: undefined,\r\n          isAllServicesDisabled: true,\r\n          serviceTests: {} as ServiceTests,\r\n        })\r\n      )\r\n    )\r\n\r\n    this.subscriptions.add(\r\n      this.labAccount$\r\n        .pipe(\r\n          filter((selected) => !!selected),\r\n          switchMap((selected: LabAccount) =>\r\n            concat(\r\n              of({ isLoading: true }),\r\n              TestToBePerformGetObservable({\r\n                LabAccountNumber: selected.LabAccount,\r\n                VendorID: selected.LabClientMemberId,\r\n                IsDOT: !!this.state.isDOT,\r\n                IsPoct: IsServiceCodePOCT(this.state.serviceCode),\r\n                IsMarketPlace: true,\r\n              }).pipe(map((data) => ({ isLoading: false, result: data })))\r\n            )\r\n          )\r\n        )\r\n        .subscribe((data: { isLoading: boolean; result?: TestToBePerformWithCompanyName }) => {\r\n          const availableTests = data.result?.Panels || []\r\n          const companyName = data.result?.CompanyName\r\n          const labAccount = this.state.labAccountObj\r\n\r\n          if (!!companyName && companyName.length > 0 && labAccount) {\r\n            const newLabAccount = {\r\n              ...labAccount,\r\n              Description: labAccount.Description.replace(\"Undefined\", companyName),\r\n            }\r\n            if (newLabAccount.Description !== labAccount.Description) {\r\n              const index = this.state.labAccounts.indexOf(labAccount)\r\n              const newLabAccountsArray: LabAccount[] = [\r\n                ...this.state.labAccounts.slice(0, index),\r\n                newLabAccount,\r\n                ...this.state.labAccounts.slice(index + 1),\r\n              ]\r\n\r\n              this.setState({ labAccountObj: newLabAccount, labAccounts: newLabAccountsArray })\r\n            }\r\n          }\r\n\r\n          const serviceTests = this.groupTestsByService(availableTests)\r\n\r\n          const tests = Object.values(serviceTests).reduce((acc, values) => {\r\n            return acc.concat(values)\r\n          }, [])\r\n\r\n          this.setState(\r\n            {\r\n              testsLoading: data.isLoading,\r\n              availableTests: tests,\r\n              labAccountCompanyName: data.result?.CompanyName,\r\n              tests: [],\r\n              testToPerform: \"\",\r\n              testToPerformObj: undefined,\r\n              serviceTests,\r\n            },\r\n            () => this.selectServiceByDefault()\r\n          )\r\n        })\r\n    )\r\n\r\n    if (this.props.company) {\r\n      this.company$.next(this.props.company)\r\n    }\r\n  }\r\n\r\n  componentWillUnmount() {\r\n    this.subscriptions.unsubscribe()\r\n  }\r\n\r\n  componentDidUpdate(prevProps: SelectDrugTestProps) {\r\n    if (\r\n      this.props.company &&\r\n      (this.props.company !== prevProps.company || (this.props.location && this.props.location !== prevProps.location))\r\n    ) {\r\n      this.company$.next(this.props.company)\r\n    }\r\n  }\r\n\r\n  setInitialState = () => this.setState({ ...this.defaultService, labAccountCompanyName: undefined })\r\n\r\n  filterTests = (tests: TestToBePerform[], service?: Service, sampleType?: SampleType) => {\r\n    const { orderableServices } = this.props\r\n    const { serviceCode } = this.state\r\n\r\n    const selectedService = service || ServiceByCode(orderableServices, serviceCode)\r\n    const isPoct = IsServicePOCT(selectedService)\r\n    const isFlex = IsServiceFLEX(selectedService)\r\n    const isDOT = isPoct ? undefined : selectedService.DOT\r\n\r\n    let filteredTests = tests\r\n    if (isPoct) {\r\n      filteredTests = tests.filter((test) => test.POCT && !test.FLEX)\r\n    } else if (isFlex) {\r\n      filteredTests = tests.filter((test) => test.FLEX)\r\n    } else if (isDOT) {\r\n      filteredTests = tests.filter((test) => test.DOT)\r\n    } else if (isDOT === false) {\r\n      filteredTests = tests.filter((test) => test.NDOT)\r\n    }\r\n\r\n    if (sampleType) {\r\n      filteredTests = filteredTests.filter((t) => t.SampleTypeCode === sampleType)\r\n    }\r\n    return filteredTests\r\n  }\r\n\r\n  groupTestsByService = (tests: TestToBePerform[]) => {\r\n    const { orderableServices } = this.props\r\n\r\n    return orderableServices.reduce((acc, service) => {\r\n      const serviceCode = service.FFServiceCode as ServiceCode\r\n      const testSampleType = [SampleType.SD, SampleType.SLD].includes(service.SampleType as SampleType)\r\n        ? SampleType.SLD\r\n        : (service.SampleType as SampleType)\r\n\r\n      acc[serviceCode] = this.filterTests(tests, ServiceByCode(orderableServices, serviceCode), testSampleType)\r\n\r\n      return acc\r\n    }, {} as ServiceTests)\r\n  }\r\n\r\n  setAllServicesDisabled = (disabled: boolean) => {\r\n    this.setState({ isAllServicesDisabled: disabled })\r\n  }\r\n\r\n  onChangeLab = (lab: LabAccount) => {\r\n    this.setState({ ...this.defaultService }, () => this.labAccount$.next(lab))\r\n  }\r\n\r\n  onChangeTestType = (value: string) => {\r\n    const { orderableServices } = this.props\r\n    const serviceCode = value as ServiceCode\r\n    const service = ServiceByCode(orderableServices, serviceCode)\r\n    const isPOCT = IsServicePOCT(service)\r\n    const isDOT = service.DOT\r\n    const reqSpecimenCollection = isPOCT ? \"single\" : isDOT ? \"split\" : \"single\"\r\n    const selectedTest = this.props.panelId\r\n      ? this.state.availableTests.find((item) => item.PanelID === this.props.panelId)\r\n      : undefined\r\n\r\n    this.setState((prev) => ({\r\n      serviceCode,\r\n      isDOT,\r\n      isMarketplace: service.Marketplace,\r\n      reqSpecimenCollection,\r\n      tests: prev.serviceTests[serviceCode] || [],\r\n      testToPerform: selectedTest?.Description || \"\",\r\n      testToPerformObj: selectedTest,\r\n      selectedTestType: service.SampleType as SampleType,\r\n      observedCollection: service.SampleType === SampleType.UR ? prev.observedCollection : false,\r\n    }))\r\n  }\r\n\r\n  onChangeTest = (values: TestToBePerform[]) => {\r\n    const { serviceTests, serviceCode, tests } = this.state\r\n\r\n    const selected = values[0]\r\n    if (!selected) return\r\n\r\n    const selectedSampleType = selected.SampleTypeCode as SampleType\r\n\r\n    const selectedServiceEntry = Object.entries(serviceTests).find(([, tests]) =>\r\n      tests.some((test) => test.PanelID === selected.PanelID)\r\n    )\r\n    const selectedServiceCode = selectedServiceEntry?.[0] as ServiceCode\r\n\r\n    const shouldUpdateServiceCode = !serviceCode && selectedServiceCode\r\n    const newServiceCode = shouldUpdateServiceCode ? selectedServiceCode : serviceCode\r\n    const newTests = selectedServiceCode ? serviceTests[selectedServiceCode] || tests : tests\r\n\r\n    this.setState(\r\n      {\r\n        testToPerform: selected.Code || \"\",\r\n        testToPerformObj: selected,\r\n        selectedTestType: selectedSampleType,\r\n        serviceCode: newServiceCode,\r\n        tests: newTests,\r\n      },\r\n      () => {\r\n        if (shouldUpdateServiceCode) {\r\n          const { orderableServices } = this.props\r\n          const { serviceCode } = this.state\r\n\r\n          const service = ServiceByCode(orderableServices, serviceCode);\r\n          const isDOT = service.DOT;\r\n          const isPOCT = IsServicePOCT(service);\r\n          const reqSpecimenCollection = isPOCT ? \"single\" : isDOT ? \"split\" : \"single\"\r\n\r\n          this.setState((prev) => ({\r\n            serviceCode,\r\n            isDOT,\r\n            isMarketplace: service.Marketplace,\r\n            reqSpecimenCollection,\r\n            selectedTestType: service.SampleType as SampleType,\r\n            observedCollection: service.SampleType === SampleType.UR ? prev.observedCollection : false,\r\n          }))\r\n        }\r\n      }\r\n    )\r\n  }\r\n\r\n  onChange = (e: React.ChangeEvent<HTMLInputElement>) => {\r\n    const value = e.target.type === \"checkbox\" ? e.target.checked : e.target.value\r\n    this.setState({ ...{}, [e.target.name]: value })\r\n  }\r\n\r\n  onServiceAdd = () => {\r\n    const observedCollection = this.state.observedCollection || (this.props.isObservedMandatory && this.state.isDOT)\r\n    this.props.onAdd({ ...this.state, observedCollection } as ServiceDataModel)\r\n    this.setInitialState()\r\n  }\r\n\r\n  onPanelClose = () => {\r\n    // Clear all entered values\r\n    this.setInitialState()\r\n  }\r\n\r\n  setDefaultTests = (tests: TestToBePerform[]) => {\r\n    if(!this.state.tests?.length) {\r\n      this.setState({ tests })  \r\n    }\r\n  }\r\n\r\n  isValid = (data: ServiceDataModel) => {\r\n    if (this.state.isAllServicesDisabled || this.props.denyAddService) {\r\n      return false\r\n    }\r\n    return (\r\n      (IsServiceCodePOCT(data.serviceCode) || typeof data.isDOT === \"boolean\") && // POCT or DOT or Non-DOT type is set\r\n      !!data.testToPerform &&\r\n      data.testToPerform.length > 0 && // testToPerform is set\r\n      !!data.labAccount &&\r\n      data.labAccount.length > 0 && // labAccount is set\r\n      (data.isDOT !== true || this.state.isValidMode)\r\n    )\r\n  }\r\n\r\n  hasAvailableTests = () => {\r\n    const { availableTests, labAccountObj } = this.state\r\n\r\n    return labAccountObj && availableTests.length > 0\r\n  }\r\n\r\n  showSelectSampleTestType = () => {\r\n    const { serviceCode, isDOT } = this.state\r\n\r\n    return (\r\n      this.hasAvailableTests() &&\r\n      !isDOT &&\r\n      ![ServiceCode.None, ServiceCode.POCT, ServiceCode.FLEX].includes(serviceCode)\r\n    )\r\n  }\r\n\r\n  showSpecimenCollection = () => {\r\n    const { selectedTestType } = this.state\r\n    const showSelectSampleTestType = this.showSelectSampleTestType()\r\n\r\n    return (\r\n      (!showSelectSampleTestType && this.hasAvailableTests()) ||\r\n      (showSelectSampleTestType && selectedTestType !== undefined)\r\n    )\r\n  }\r\n\r\n  showObserved = () => {\r\n    const { selectedTestType } = this.state\r\n    const showSelectSampleTestType = this.showSelectSampleTestType()\r\n\r\n    return (\r\n      (!showSelectSampleTestType && this.hasAvailableTests()) ||\r\n      (showSelectSampleTestType && selectedTestType === SampleType.UR)\r\n    )\r\n  }\r\n\r\n  showDOTRelatedControls = () => {\r\n    const { isDOT } = this.state\r\n\r\n    return this.hasAvailableTests() && isDOT === true\r\n  }\r\n\r\n  selectServiceByDefault = () => {\r\n    const { availableTests, serviceTests } = this.state\r\n    const { panelId } = this.props\r\n\r\n    const selectedTest = availableTests.find((item) => item.PanelID === panelId)\r\n\r\n    const serviceCode = selectedTest\r\n      ? this.getDefaultServiceByTest(selectedTest)\r\n      : this.getDefaultService(serviceTests)\r\n\r\n    if (serviceCode) {\r\n      this.onChangeTestType(serviceCode)\r\n    }\r\n  }\r\n\r\n  getDefaultServiceByTest = (selectedTest: TestToBePerform) => {\r\n    const { DOT, SampleTypeCode, POCT, FLEX } = selectedTest\r\n    const { sampleType, isDot } = this.props\r\n\r\n    const sampleTypeCodeValue = (sampleType || SampleTypeCode) as SampleType\r\n    const dotValue = sampleType ? isDot : DOT\r\n\r\n    if (FLEX) {\r\n      return ServiceCode.FLEX\r\n    }\r\n\r\n    if (POCT) {\r\n      return ServiceCode.POCT\r\n    }\r\n\r\n    if (sampleTypeCodeValue === SampleType.UR) {\r\n      return dotValue ? ServiceCode.DrugDOTUrine : ServiceCode.DrugNonDOTUrine\r\n    }\r\n\r\n    if ([SampleType.SD, SampleType.SLD].includes(sampleTypeCodeValue)) {\r\n      return dotValue ? ServiceCode.DrugDOTOral : ServiceCode.DrugNonDOTOral\r\n    }\r\n\r\n    return ServiceCode.DrugNonDOTUrine\r\n  }\r\n\r\n  getDefaultService = (serviceTests: ServiceTests) => {\r\n    // Check for FLEX service first\r\n    if ((serviceTests[ServiceCode.FLEX]?.length ?? 0) > 0) {\r\n      return ServiceCode.FLEX\r\n    }\r\n    const serviceTestsEntries = Object.entries(serviceTests)\r\n\r\n    // Find a single service with tests while others have no tests\r\n    const defaultService = serviceTestsEntries.find(\r\n      ([serviceCode, tests]) =>\r\n        tests.length > 0 && serviceTestsEntries.every(([s, t]) => s !== serviceCode && (t?.length ?? 0) === 0)\r\n    )?.[0] as ServiceCode\r\n    \r\n    // If there is a single service with tests, use it\r\n    if (defaultService) {\r\n      return defaultService\r\n    }\r\n\r\n    // Determine if only DOT services have tests\r\n    const hasOnlyDOTServices = !serviceTestsEntries.some(\r\n      ([serviceCode, tests]) =>\r\n        ![ServiceCode.DrugDOTUrine, ServiceCode.DrugDOTOral].includes(serviceCode as ServiceCode) &&\r\n        (tests?.length ?? 0) > 0\r\n    )\r\n\r\n    if (hasOnlyDOTServices) {\r\n      return this.getDefaultDOTServiceCode(serviceTests);\r\n    }\r\n\r\n    // Determine if only Non-DOT services have tests\r\n    const hasOnlyNonDOTServices = !serviceTestsEntries.some(\r\n      ([serviceCode, tests]) =>\r\n        ![ServiceCode.DrugNonDOTUrine, ServiceCode.DrugNonDOTOral].includes(serviceCode as ServiceCode) &&\r\n        (tests?.length ?? 0) > 0\r\n    )\r\n    if (hasOnlyNonDOTServices) {\r\n      return this.getDefaultNonDOTServiceCode(serviceTests);\r\n    }\r\n    \r\n    return undefined\r\n  }\r\n\r\n  getDefaultSampleType = (lookupCode: string): string | undefined => {\r\n    return this.props.defaults?.find(\r\n      (item) =>\r\n        item.LookupCode === lookupCode && item.Show && item.IsDefault\r\n    )?.FieldName;\r\n  }\r\n\r\n  getDefaultDOTServiceCode = (serviceTests: ServiceTests) => {\r\n    const hasDrugDOTOral = serviceTests[ServiceCode.DrugDOTOral]?.length > 0\r\n    const hasDrugDOTUrine = serviceTests[ServiceCode.DrugDOTUrine]?.length > 0\r\n\r\n    const defaultDOTSampleType = this.getDefaultSampleType(DefaultLookupCode.DOTSampleType);\r\n\r\n    if (defaultDOTSampleType === SampleType.SD && hasDrugDOTOral) {\r\n      return ServiceCode.DrugDOTOral\r\n    }\r\n\r\n    if (defaultDOTSampleType === SampleType.UR && hasDrugDOTUrine) {\r\n      return ServiceCode.DrugDOTUrine\r\n    }\r\n\r\n    return undefined\r\n  }\r\n\r\n  getDefaultNonDOTServiceCode = (serviceTests: ServiceTests) => {\r\n    const hasDrugNonDOTOral = serviceTests[ServiceCode.DrugNonDOTOral]?.length > 0\r\n    const hasDrugNonDOTUrine = serviceTests[ServiceCode.DrugNonDOTUrine]?.length > 0\r\n\r\n    const defaultNonDOTSampleType = this.getDefaultSampleType(DefaultLookupCode.NonDOTSampleType);\r\n\r\n    if (defaultNonDOTSampleType === SampleType.SD && hasDrugNonDOTOral) {\r\n      return ServiceCode.DrugNonDOTOral\r\n    }\r\n\r\n    if (defaultNonDOTSampleType === SampleType.UR && hasDrugNonDOTUrine) {\r\n      return ServiceCode.DrugNonDOTUrine\r\n    }\r\n\r\n    return undefined\r\n  }\r\n\r\n  render() {\r\n    const { disabled, isObservedMandatory } = this.props\r\n    const {\r\n      labAccounts,\r\n      labAccountObj,\r\n      labAccountsLoading,\r\n      availableTests,\r\n      tests,\r\n      testToPerformObj,\r\n      testsLoading,\r\n      labAccountCompanyName,\r\n      isDOT,\r\n      reqSpecimenCollection,\r\n      observedCollection,\r\n      serviceCode,\r\n      serviceTests,\r\n    } = this.state\r\n\r\n    const observedCheckedDisabled = isObservedMandatory && isDOT\r\n\r\n    return (\r\n      <SelectServiceTogglePanel\r\n        title=\"DRUG TEST\"\r\n        data={this.state as ServiceDataModel}\r\n        collapsibleId=\"DrugTestCollapsePanel\"\r\n        disabled={disabled}\r\n        open={this.props.open}\r\n        onSubmit={this.onServiceAdd}\r\n        onValidate={this.isValid}\r\n        onClose={this.onPanelClose}\r\n      >\r\n        <Form.Row>\r\n          <Col xs=\"12\">\r\n            <Form.Group>\r\n              <Form.Label className=\"font-weight-bold required\">LAB ACCOUNT</Form.Label>\r\n              <Typeahead\r\n                id=\"labAccountsTypeahead\"\r\n                labelKey=\"Description\"\r\n                filterBy={(option, props) => {\r\n                  return (\r\n                    props.selected.length > 0 ||\r\n                    option.Description.toLowerCase().indexOf(props.text.toLowerCase()) !== -1\r\n                  )\r\n                }}\r\n                onChange={(selected: LabAccount[]) => this.onChangeLab(selected[0])}\r\n                options={labAccounts}\r\n                isInvalid={!labAccountObj}\r\n                disabled={!!this.props.labAccountNumber}\r\n                placeholder=\"Enter the Lab Account name\"\r\n                selected={labAccountObj ? [labAccountObj] : []}\r\n              />\r\n            </Form.Group>\r\n          </Col>\r\n        </Form.Row>\r\n        {labAccountCompanyName && (\r\n          <Form.Row>\r\n            <Col className=\"font-weight-bold form-group\">{labAccountCompanyName}</Col>\r\n          </Form.Row>\r\n        )}\r\n        {!labAccountsLoading && !testsLoading && labAccountObj && availableTests.length === 0 && (\r\n          <Form.Row>\r\n            <Col className=\"error-message\">No services found for lab account</Col>\r\n          </Form.Row>\r\n        )}\r\n        {testsLoading && (\r\n          <Form.Row>\r\n            <Col className=\"text-center\">\r\n              <Spinner animation=\"border\" variant=\"secondary\" />\r\n            </Col>\r\n          </Form.Row>\r\n        )}\r\n        {!labAccountsLoading && !testsLoading && this.hasAvailableTests() && (\r\n          <Form.Row>\r\n            <Col>\r\n              <DrugServicesPanel\r\n                {...this.props}\r\n                selectedServiceCode={serviceCode}\r\n                serviceTests={serviceTests}\r\n                onChangeTestType={this.onChangeTestType}\r\n                onUpdateTests={this.setDefaultTests}\r\n                setAllServicesDisabled={this.setAllServicesDisabled}\r\n              />\r\n            </Col>\r\n            <Col xs=\"1\" md=\"1\" sm=\"1\">\r\n              {isDOT && <Image src={dotImage} />}\r\n            </Col>\r\n          </Form.Row>\r\n        )}\r\n        {this.showSpecimenCollection() && (\r\n          <Form.Row>\r\n            <Col xs=\"12\">\r\n              <SelectSpecimenCollection\r\n                selectedValue={reqSpecimenCollection}\r\n                disabled={isDOT === true}\r\n                onChange={this.onChange}\r\n              />\r\n            </Col>\r\n          </Form.Row>\r\n        )}\r\n        {this.showObserved() && (\r\n          <Form.Row>\r\n            <Col xs=\"12\">\r\n              <SelectObserved\r\n                checked={observedCheckedDisabled || observedCollection}\r\n                disabled={observedCheckedDisabled}\r\n                onChange={this.onChange}\r\n              />\r\n            </Col>\r\n          </Form.Row>\r\n        )}\r\n        {this.showDOTRelatedControls() && (\r\n          <RegulatoryModeControl\r\n            defaults={this.props.defaults}\r\n            regulatoryModeID={this.props.regulatoryModeID}\r\n            employeeCategoryID={this.props.employeeCategoryID}\r\n            onChange={(isValid, mode, cat) =>\r\n              this.setState({ isValidMode: isValid, regulatoryModeObj: mode, categoryObj: cat })\r\n            }\r\n          />\r\n        )}\r\n        {this.hasAvailableTests() && (\r\n          <Form.Row>\r\n            <Col xs=\"12\">\r\n              <Form.Group>\r\n                <Form.Label className=\"font-weight-bold required\">TEST TO BE PERFORMED</Form.Label>\r\n                <Typeahead\r\n                  id=\"drugTestToPerformTypeahead\"\r\n                  labelKey=\"Description\"\r\n                  filterBy={(option, props) => {\r\n                    return (\r\n                      props.selected.length > 0 ||\r\n                      option.Description.toLowerCase().indexOf(props.text.toLowerCase()) !== -1\r\n                    )\r\n                  }}\r\n                  onChange={this.onChangeTest}\r\n                  isInvalid={!testsLoading && !testToPerformObj}\r\n                  options={tests}\r\n                  disabled={testsLoading || tests.length === 0 || !!this.props.panelId}\r\n                  placeholder= {testsLoading ? \"Loading...\" : tests.length > 0 ? \"Enter the Test name\" : \"No Tests Available\"}\r\n                  selected={testToPerformObj ? [testToPerformObj as TestToBePerform] : []}\r\n                />\r\n              </Form.Group>\r\n            </Col>\r\n          </Form.Row>\r\n        )}\r\n      </SelectServiceTogglePanel>\r\n    )\r\n  }\r\n}\r\n","import React from 'react'\r\nimport { Form, Col, Image } from 'react-bootstrap'\r\nimport { Subscription } from \"rxjs\"\r\nimport { Typeahead } from 'react-bootstrap-typeahead'\r\nimport { toast } from \"react-toastify\"\r\nimport SelectServiceTogglePanel from './SelectServiceTogglePanel'\r\nimport { ServiceDataModel, EmptyServiceData } from '../OrderModels'\r\nimport dotImage from '../../../assets/images/dot-img.png'\r\nimport SelectService, { SelectServiceProps, SelectServiceState } from './SelectService'\r\nimport { AlcoholTestSampleTypesObservable } from \"../../../api/OrderRequests/OrderRequestsConstraintGet\"\r\nimport { AlcoholTestSampleType } from \"../../../api/OrderRequests/OrderRequestsModel/AlcoholTestSampleType\"\r\nimport { ServiceTypeCode } from \"../../../api/Administration/Model/ServiceType\"\r\nimport { IsServiceActive, ServicesByServiceSampleType, ServiceByCode } from \"../../../api/Administration/Model/Service\"\r\nimport { EventType } from '../../../config/Constants'\r\nimport RegulatoryModeControl from '../RegulatoryModeControl'\r\nimport { ServiceCode } from '../../../api/LookupCodes/ServiceCode'\r\n\r\ninterface SelectAlcoholTestState extends SelectServiceState {\r\n  // TODO: 2.0 API availableAlcoholTestSampleTypes: OrderFieldListItem[]\r\n  availableAlcoholTestSampleTypes: AlcoholTestSampleType[]\r\n}\r\n\r\nexport default class SelectAlcoholTest extends SelectService<SelectServiceProps, SelectAlcoholTestState> {\r\n  defaultService: ServiceDataModel = { ...EmptyServiceData, serviceTypeCode: ServiceTypeCode.Alcohol, serviceCode: ServiceCode.None }\r\n\r\n  subscriptions = new Subscription()\r\n\r\n  constructor(props: SelectServiceProps) {\r\n    super(props)\r\n\r\n    this.defaultService = { ...EmptyServiceData, serviceTypeCode: ServiceTypeCode.Alcohol, serviceCode: ServiceCode.None,  isDOT: props.isDot }\r\n    this.state = { ...this.defaultService, availableAlcoholTestSampleTypes: [] }\r\n  }\r\n\r\n  componentDidMount() {\r\n    const selectedTest = this.props.selectedTestCode\r\n    const isDot = this.props.isDot\r\n    this.subscriptions.add(\r\n      AlcoholTestSampleTypesObservable().subscribe(\r\n        (results: AlcoholTestSampleType[]) => {\r\n          this.setState({\r\n            availableAlcoholTestSampleTypes: results,\r\n            testToPerform: selectedTest && results.find(type => type.Code === selectedTest)?.Description || \"\",\r\n            testToPerformObj: selectedTest ? results.find(type => type.Code === selectedTest) : undefined\r\n          })\r\n          if (selectedTest) {\r\n            let serviceCode = ServiceCode.AlcoholBreath\r\n            if (selectedTest === EventType.Breath && isDot) serviceCode = ServiceCode.AlcoholBreathDOT\r\n            if (selectedTest === EventType.Saliva && isDot) serviceCode = ServiceCode.AlcoholSalivaDOT\r\n            if (selectedTest === EventType.Saliva && !isDot) serviceCode = ServiceCode.AlcoholSaliva\r\n            this.onChangeTestType(serviceCode)\r\n          }\r\n        },\r\n        error => toast.error(error)\r\n      )\r\n    )\r\n  }\r\n\r\n  componentWillUnmount() {\r\n    this.subscriptions.unsubscribe()\r\n  }\r\n\r\n  setInitialState = () => this.setState({ ...this.defaultService })\r\n  \r\n  onChangeTestType = (value: string) => {\r\n    const orderableServices = this.props.orderableServices;\r\n    const serviceCode = value as ServiceCode;\r\n    const service = ServiceByCode(orderableServices, serviceCode);\r\n    this.setState(\r\n      {\r\n        serviceCode: serviceCode,\r\n        isDOT: service.DOT,\r\n        isMarketplace: service.Marketplace\r\n      })\r\n  }\r\n\r\n  onChangeTestToPerform = (selected: AlcoholTestSampleType[]) => {\r\n    const item = selected.length > 0 ? selected[0] : undefined\r\n    this.setState({ testToPerform: item?.Description || '', testToPerformObj: item })\r\n  }\r\n\r\n  onServiceAdd = () => {\r\n    this.props.onAdd(this.state as ServiceDataModel)\r\n    this.setInitialState()\r\n  }\r\n\r\n  onPanelClose = () => {\r\n    // Clear all entered values\r\n    this.setInitialState()\r\n  }\r\n\r\n  isValid = (data: ServiceDataModel): boolean => {\r\n    if(this.isAllServicesDisabled || this.props.denyAddService){\r\n      return false;\r\n    }\r\n\r\n    return typeof data.isDOT === \"boolean\" // type is set\r\n      && !!data.testToPerform && data.testToPerform.length > 0 // testToPerform is set\r\n      && (data.isDOT !== true || this.state.isValidMode)\r\n  }\r\n\r\n  render() {\r\n    const { disabled, canAddDOT, canAddNonDOT, open } = this.props\r\n    const { testToPerformObj, isDOT } = this.state\r\n    const orderableServiceType = this.props.orderableServiceType;\r\n\r\n    const marketplaceServicesCount = this.props.marketplaceServicesCount;\r\n    const notMarketplaceServicesCount = this.props.notMarketplaceServicesCount;\r\n\r\n    const canAddMarketplace = notMarketplaceServicesCount === 0;\r\n    const canAddNotMarketplace = marketplaceServicesCount === 0;\r\n\r\n\r\n    return (\r\n      <SelectServiceTogglePanel title={orderableServiceType.ServiceTypeName || \"ALCOHOL TEST\"}\r\n        data={this.state as ServiceDataModel}\r\n        collapsibleId='AlcoholTestCollapsePanel'\r\n        disabled={disabled}\r\n        open={open}\r\n        onSubmit={this.onServiceAdd}\r\n        onValidate={this.isValid}\r\n        onClose={this.onPanelClose}>\r\n        <Form.Row>\r\n          <Col>\r\n          <Form.Group>\r\n            <Form.Label className=\"font-weight-bold required\">ALCOHOL TEST TO BE PERFORMED</Form.Label>\r\n            <Typeahead id=\"alcoholTestToPerformTypeahead\"\r\n              labelKey={option => `${option.Description}`}\r\n              filterBy={(option, props) => {\r\n                return props.selected.length > 0 || (option?.Description || \"\").toLowerCase().indexOf(props.text.toLowerCase()) !== -1;\r\n              }}\r\n              onChange={this.onChangeTestToPerform}\r\n              options={this.state.availableAlcoholTestSampleTypes || []}\r\n              placeholder=\"Enter the Sample Type name\"\r\n              isInvalid={!testToPerformObj}\r\n              disabled={!!this.props.selectedTestCode}\r\n              selected={testToPerformObj ? [testToPerformObj as AlcoholTestSampleType] : []} />\r\n            </Form.Group>\r\n          </Col>\r\n        </Form.Row>\r\n        <Form.Row>\r\n          <Col xs=\"11\" md=\"11\" sm=\"11\">\r\n            <Form.Group className={!this.state.serviceCode ? \"invalid-section-border p-2\" : \"section-border p-2\"}>\r\n              {this.getServicesComponents()}\r\n            </Form.Group>\r\n          </Col>\r\n          <Col xs=\"1\" md=\"1\" sm=\"1\" hidden={isDOT !== true}>\r\n            <Image src={dotImage} />\r\n          </Col>\r\n        </Form.Row>\r\n        {isDOT && <RegulatoryModeControl\r\n          defaults={this.props.defaults}\r\n          regulatoryModeID={this.props.regulatoryModeID}\r\n          employeeCategoryID={this.props.employeeCategoryID}\r\n          onChange={(isValid, mode, cat) => this.setState({ isValidMode: isValid, regulatoryModeObj: mode, categoryObj: cat })}\r\n        />}\r\n      </SelectServiceTogglePanel>\r\n    )\r\n  }\r\n\r\n  getServicesComponents() {\r\n    const { disabled, canAddDOT, canAddNonDOT, open } = this.props\r\n    const { testToPerformObj, isDOT, availableAlcoholTestSampleTypes } = this.state\r\n\r\n    let sampleType = \"\";\r\n    if(testToPerformObj){\r\n      sampleType = testToPerformObj.Code;\r\n    }\r\n    if(sampleType === \"\"){\r\n      if(availableAlcoholTestSampleTypes){\r\n        if(availableAlcoholTestSampleTypes.length > 0){\r\n          sampleType = availableAlcoholTestSampleTypes[0].Code;\r\n        }\r\n      }\r\n    }\r\n    if(sampleType === \"\"){\r\n      if(this.props.orderableServices.length > 0){\r\n        sampleType = this.props.orderableServices[0].SampleType || \"\";\r\n      }\r\n    }\r\n    \r\n    const orderableServices = ServicesByServiceSampleType(this.props.orderableServices, sampleType);\r\n    const orderableAccountServices = this.props.orderableAccountServices\r\n    const marketplaceServicesCount = this.props.marketplaceServicesCount;\r\n    const notMarketplaceServicesCount = this.props.notMarketplaceServicesCount;\r\n\r\n    const canAddMarketplace = notMarketplaceServicesCount === 0;\r\n    const canAddNotMarketplace = marketplaceServicesCount === 0;\r\n\r\n    let servicesComponents = [];\r\n    this.isAllServicesDisabled = true;\r\n    for (let i = 0; i < orderableServices.length; i++) {\r\n      const orderableService = orderableServices[i];\r\n      const serviceActive = IsServiceActive(orderableService, orderableAccountServices);\r\n      const item_id = orderableService.DOT ? \"regulated-alcohol-test-radio\" : \"non-regulated-alcohol-test-radio\";\r\n      //const item_value = orderableService.DOT ? \"regulated\" : \"non-dot\";\r\n      const item_value = orderableService.FFServiceCode;\r\n\r\n      const item_disabled = !serviceActive \r\n        || (orderableService.DOT  && (!canAddDOT || (!!this.props.selectedTestCode && isDOT !== true))) \r\n        || (!orderableService.DOT  && (!canAddNonDOT || (!!this.props.selectedTestCode && isDOT !== false)))\r\n        || (orderableService.Marketplace && !canAddMarketplace)\r\n        || (!orderableService.Marketplace && !canAddNotMarketplace)\r\n\r\n        if(!item_disabled){\r\n          this.isAllServicesDisabled = false;\r\n        }        \r\n\r\n      const item_checked = (isDOT === true && orderableService.DOT) || (isDOT === false && !orderableService.DOT)\r\n      const serviceComponent = <Form.Check label={orderableService.ServiceDescription}\r\n        id={item_id}\r\n        key={item_id}\r\n        type=\"radio\"\r\n        name=\"testType\"\r\n        className=\"font-weight-bold abc-radio\"\r\n        disabled={item_disabled}\r\n        value={item_value}\r\n        onChange={(e) => this.onChangeTestType(e.target.value)}\r\n        checked={item_checked} />\r\n      servicesComponents.push(serviceComponent)\r\n    }\r\n    return <>{servicesComponents}</>\r\n\r\n\r\n  }\r\n\r\n}\r\n","import React from 'react'\r\nimport { Form } from 'react-bootstrap'\r\nimport { ServiceDataModel, EmptyServiceData } from '../OrderModels'\r\nimport SelectServiceTogglePanel from './SelectServiceTogglePanel'\r\nimport SelectService, { SelectServiceProps, SelectServiceState } from './SelectService'\r\nimport { ServiceTypeCode } from \"../../../api/Administration/Model/ServiceType\"\r\nimport { IsServiceActive, ServiceByCode } from \"../../../api/Administration/Model/Service\"\r\nimport RegulatoryModeControl from '../RegulatoryModeControl'\r\nimport { ServiceCode } from '../../../api/LookupCodes/ServiceCode'\r\n\r\nexport default class SelectPhysicalExam extends SelectService<SelectServiceProps, SelectServiceState> {\r\n  defaultService: ServiceDataModel = {...EmptyServiceData, serviceTypeCode: ServiceTypeCode.Physical, serviceCode: ServiceCode.None}\r\n  state: SelectServiceState = { ...this.defaultService }\r\n\r\n  setInitialState = () => this.setState({ ...this.defaultService })\r\n\r\n  onChangeTestType = (e: React.ChangeEvent<HTMLInputElement>) => {\r\n    const orderableServices = this.props.orderableServices;\r\n    const serviceCode = e.target.value as ServiceCode;\r\n    const service = ServiceByCode(orderableServices, serviceCode);\r\n    this.setState(\r\n      {\r\n        serviceCode: serviceCode,\r\n        isDOT: service.DOT,\r\n        isMarketplace: service.Marketplace\r\n      })\r\n  }\r\n  onServiceAdd = () => {\r\n    this.props.onAdd(this.state as ServiceDataModel)\r\n    this.setInitialState()\r\n  }\r\n\r\n  onPanelClose = () => {\r\n    // Clear all entered values\r\n    this.setInitialState()\r\n  }\r\n\r\n  isValid = (data: ServiceDataModel): boolean => {\r\n    if(this.isAllServicesDisabled || this.props.denyAddService){\r\n      return false\r\n    }\r\n    return typeof data.isDOT === \"boolean\" && (data.isDOT !== true || this.state.isValidMode)\r\n  }\r\n  render() {\r\n    const { disabled } = this.props\r\n    const orderableServiceType = this.props.orderableServiceType;\r\n\r\n    const marketplaceServicesCount = this.props.marketplaceServicesCount;\r\n    const notMarketplaceServicesCount = this.props.notMarketplaceServicesCount;\r\n\r\n    const canAddMarketplace = notMarketplaceServicesCount === 0;\r\n    const canAddNotMarketplace = marketplaceServicesCount === 0;\r\n\r\n\r\n    return (\r\n      <SelectServiceTogglePanel title={orderableServiceType.ServiceTypeName || \"PHYSICAL EXAM\"}\r\n                                data={this.state as ServiceDataModel}\r\n                                collapsibleId='PhysicalExamCollapsePanel'\r\n                                disabled={disabled}\r\n                                onSubmit={this.onServiceAdd}\r\n                                onValidate={this.isValid}\r\n                                onClose={this.onPanelClose}>\r\n        <Form.Row className=\"px-2\">\r\n          {this.getServicesComponents()}\r\n        </Form.Row>\r\n        {this.state.isDOT && <RegulatoryModeControl\r\n          defaults={this.props.defaults}\r\n          regulatoryModeID={this.props.regulatoryModeID}\r\n          employeeCategoryID={this.props.employeeCategoryID}\r\n          onChange={(isValid, mode, cat) => this.setState({ isValidMode: isValid, regulatoryModeObj: mode, categoryObj: cat })}\r\n        />}\r\n      </SelectServiceTogglePanel>\r\n    )\r\n  }\r\n\r\n  getServicesComponents() {\r\n    const { disabled, canAddDOT, canAddNonDOT } = this.props\r\n    const orderableServiceType = this.props.orderableServiceType;\r\n    const orderableServices = this.props.orderableServices;\r\n    const orderableAccountServices = this.props.orderableAccountServices\r\n    const marketplaceServicesCount = this.props.marketplaceServicesCount;\r\n    const notMarketplaceServicesCount = this.props.notMarketplaceServicesCount;\r\n    const canAddMarketplace = notMarketplaceServicesCount === 0;\r\n    const canAddNotMarketplace = marketplaceServicesCount === 0;\r\n\r\n    let servicesComponents = [];\r\n    this.isAllServicesDisabled = true;\r\n    for (let i = 0; i < orderableServices.length; i++) {\r\n      const orderableService = orderableServices[i];\r\n      const serviceActive = IsServiceActive(orderableService, orderableAccountServices);\r\n      const item_id = orderableService.DOT ? \"regulated-physical-exam\" : \"non-regulated-physical-exam\";\r\n      //const item_value = orderableService.DOT ? \"regulated\" : \"non-dot\";\r\n      const item_value = orderableService.FFServiceCode;\r\n\r\n      const item_disabled = !serviceActive\r\n        || (orderableService.DOT && !canAddDOT)\r\n        || (!orderableService.DOT && !canAddNonDOT)\r\n        || (orderableService.Marketplace && !canAddMarketplace)\r\n        || (!orderableService.Marketplace && !canAddNotMarketplace)\r\n\r\n        if(!item_disabled){\r\n          this.isAllServicesDisabled = false;\r\n        }\r\n\r\n\r\n      const item_checked = (canAddDOT && this.state.isDOT === true && orderableService.DOT) || (canAddNonDOT && this.state.isDOT === false && !orderableService.DOT)\r\n      const serviceComponent = <Form.Check label={orderableService.ServiceDescription}\r\n        id={item_id}\r\n        key={item_id}\r\n        type=\"radio\"\r\n        name=\"testType\"\r\n        className=\"font-weight-bold abc-radio\"\r\n        disabled={item_disabled}\r\n        value={item_value}\r\n        onChange={this.onChangeTestType}\r\n        checked={item_checked} />\r\n      servicesComponents.push(serviceComponent)\r\n    }\r\n    return <Form.Group className={this.state.serviceCode ? \"section-border p-2\" : \"invalid-section-border p-2\"}>{servicesComponents}</Form.Group>\r\n  }\r\n}\r\n","import React from 'react'\r\nimport { Col, Form, Spinner } from 'react-bootstrap'\r\nimport { ServiceDataModel, EmptyServiceData } from '../OrderModels'\r\nimport SelectServiceTogglePanel from './SelectServiceTogglePanel'\r\nimport SelectService, { SelectServiceProps, SelectServiceState } from './SelectService'\r\nimport { ServiceTypeCode } from \"../../../api/Administration/Model/ServiceType\"\r\nimport { IsServiceActive, ServiceByCode, IsServiceCodeWellness } from \"../../../api/Administration/Model/Service\"\r\nimport LabAccount from \"../../../api/LabService/LabServiceModel/LabAccount\"\r\nimport TestToBePerformGetObservable from \"../../../api/LabService/TestToBePerformGet\"\r\nimport TestToBePerformWithCompanyName from \"../../../api/LabService/LabServiceModel/TestToBePerformWithCompanyName\"\r\nimport TestToBePerform from \"../../../api/LabService/LabServiceModel/TestToBePerform\"\r\nimport { BehaviorSubject, concat, of, Subject, Subscription } from 'rxjs'\r\nimport { catchError, map, switchMap } from 'rxjs/operators'\r\nimport LabAccountsGetObservable from '../../../api/LabService/LabAccountsGet'\r\nimport FormatError from '../../../formatters/FormatError'\r\nimport { toast } from 'react-toastify'\r\nimport { APIError } from '../../../api/ObservableFromFetch'\r\nimport { Typeahead } from 'react-bootstrap-typeahead'\r\nimport { ServiceCode } from '../../../api/LookupCodes/ServiceCode'\r\n\r\ninterface SelectOHSProps extends SelectServiceProps {\r\n  services: ServiceDataModel[]\r\n  company?: number\r\n  location?: number\r\n}\r\n\r\ninterface SelectOHSTestState extends SelectServiceState {\r\n  labAccountsLoading: boolean\r\n  labAccounts: LabAccount[]\r\n  testsLoading: boolean\r\n  availableTests: TestToBePerform[]\r\n  labAccountCompanyName?: string\r\n}\r\n\r\nexport default class SelectOHS extends SelectService<SelectOHSProps, SelectOHSTestState> {\r\n  defaultService: ServiceDataModel = {...EmptyServiceData, serviceTypeCode: ServiceTypeCode.OHS, serviceCode: ServiceCode.None}\r\n  state: SelectOHSTestState = {\r\n    ...this.defaultService,\r\n    labAccountsLoading: false,\r\n    labAccounts: [],\r\n    testsLoading: false,\r\n    availableTests: [] }\r\n\r\n  subscriptions = new Subscription()\r\n  company$ = new BehaviorSubject<number>(0)\r\n  labAccount$ = new Subject<LabAccount>()\r\n  service$ = new Subject<TestToBePerform>()\r\n\r\n  componentDidMount() {\r\n    this.subscriptions.add(\r\n      this.company$.pipe(\r\n        switchMap((company: number) =>\r\n          !company\r\n            ? of({ isLoading: false })\r\n            : concat(\r\n              of({ isLoading: true }),\r\n              LabAccountsGetObservable({\r\n                SearchFor: \"\",\r\n                SearchBy: \"Account Name\",\r\n                CompanyID: company,\r\n                RegionID: 0,\r\n                LocationID: this.props.location || 0,\r\n                DOT: false,\r\n                IsMarketPlace: true\r\n              }).pipe(\r\n                map((data) => ({ isLoading: false, result: data })),\r\n                catchError((error) => of({ isLoading: false, error: error }))\r\n              )\r\n            ))\r\n      ).subscribe(\r\n        (data: { isLoading: boolean, result?: LabAccount[], error?: Error | APIError }) => {\r\n          if (data.error) {\r\n            toast.error(FormatError(data.error))\r\n          }\r\n          this.setState({ labAccountsLoading: data.isLoading, labAccounts: data.result || [] })\r\n          this.labAccount$.next(undefined)\r\n        }))\r\n\r\n    this.subscriptions.add(\r\n      this.labAccount$.subscribe(\r\n        selected => this.setState({\r\n          labAccount: selected?.LabCode || \"\",\r\n          labAccountObj: selected,\r\n          availableTests: [],\r\n          testToPerform: \"\",\r\n          testToPerformObj: undefined,\r\n          labAccountCompanyName: undefined\r\n        })\r\n      ))\r\n\r\n    this.subscriptions.add(\r\n      this.labAccount$.pipe(\r\n        switchMap((selected: LabAccount) =>\r\n          !selected\r\n            ? of({ isLoading: false }) : concat(\r\n              of({ isLoading: true }),\r\n              TestToBePerformGetObservable({\r\n                LabAccountNumber: selected.LabAccount,\r\n                VendorID: selected.LabClientMemberId,\r\n                IsDOT: false,\r\n                IsPoct: false,\r\n                IsMarketPlace: true\r\n              }).pipe(\r\n                map((data) => ({ isLoading: false, result: data })),\r\n                catchError((error) => of({ isLoading: false, error: error }))\r\n              )\r\n            ))\r\n      ).subscribe(\r\n        (data: { isLoading: boolean, result?: TestToBePerformWithCompanyName, error?: Error | APIError }) => {\r\n          if (data.error) {\r\n            toast.error(FormatError(data.error))\r\n          }\r\n          this.setState({\r\n            testsLoading: data.isLoading,\r\n            availableTests: data.result?.Panels || [],\r\n            labAccountCompanyName: data.result?.CompanyName,\r\n            testToPerform: \"\",\r\n            testToPerformObj: undefined\r\n          })\r\n        }))\r\n\r\n    this.subscriptions.add(\r\n      this.service$.subscribe(selected => this.setState({ testToPerform: selected?.Code || \"\", testToPerformObj: selected }))\r\n    )\r\n\r\n    this.props.company && this.company$.next(this.props.company)\r\n  }\r\n\r\n  componentWillUnmount() {\r\n    this.subscriptions.unsubscribe()\r\n  }\r\n\r\n  componentDidUpdate(prevProps: SelectOHSProps) {\r\n    if (this.props.company && (this.props.company !== prevProps.company || (this.props.location && this.props.location !== prevProps.location))) {\r\n      this.company$.next(this.props.company)\r\n    }\r\n  }\r\n\r\n  setInitialState = () => this.setState({ ...this.defaultService })\r\n\r\n  onChangeLab = (lab: LabAccount) => this.labAccount$.next(lab)\r\n\r\n  onChangeTestType = (e: React.ChangeEvent<HTMLInputElement>) => {\r\n    const orderableServices = this.props.orderableServices;\r\n    const serviceCode = e.target.value as ServiceCode;\r\n    const service = ServiceByCode(orderableServices, serviceCode);\r\n    this.setState(\r\n      {\r\n        serviceCode: serviceCode,\r\n        isDOT: service.DOT,\r\n        isMarketplace: service.Marketplace,\r\n        testToPerform: service.ServiceDescription\r\n      })\r\n  }\r\n  onServiceAdd = () => {\r\n    this.props.onAdd(this.state as ServiceDataModel)\r\n    this.setInitialState()\r\n  }\r\n\r\n  onPanelClose = () => {\r\n    // Clear all entered values\r\n    this.setInitialState()\r\n  }\r\n\r\n  isValid = (data: ServiceDataModel): boolean => {\r\n    if (this.isAllServicesDisabled || this.props.denyAddService){\r\n      return false\r\n    }\r\n    if (IsServiceCodeWellness(this.state.serviceCode) && (!this.state.labAccountObj || !this.state.testToPerformObj)) {\r\n      return false\r\n    }\r\n    return !!this.state.serviceCode\r\n  }\r\n\r\n  render() {\r\n    const { disabled, orderableServiceType } = this.props\r\n    const { labAccounts, labAccountObj, labAccountsLoading,\r\n      labAccountCompanyName, availableTests, testsLoading,\r\n      testToPerformObj, serviceCode } = this.state\r\n    const showPanels = labAccountObj && availableTests.length\r\n\r\n    return (\r\n      <SelectServiceTogglePanel title={orderableServiceType.ServiceTypeName || \"Occupational Health Services\"}\r\n                                data={this.state as ServiceDataModel}\r\n                                collapsibleId='OHSCollapsePanel'\r\n                                disabled={disabled}\r\n                                onSubmit={this.onServiceAdd}\r\n                                onValidate={this.isValid}\r\n                                onClose={this.onPanelClose}>\r\n\r\n        <Form.Row className=\"px-2\">\r\n          {this.getServicesComponents()}\r\n        </Form.Row>\r\n        {IsServiceCodeWellness(serviceCode) && <>\r\n          <Form.Row>\r\n            <Col xs=\"12\">\r\n              <Form.Group>\r\n                <Form.Label className=\"font-weight-bold required\">LAB ACCOUNT</Form.Label>\r\n                <Typeahead id=\"labAccountsTypeahead\"\r\n                  labelKey=\"Description\"\r\n                  filterBy={(option, props) => {\r\n                    return props.selected.length > 0 || option.Description.toLowerCase().indexOf(props.text.toLowerCase()) !== -1;\r\n                  }}\r\n                  onChange={(selected: LabAccount[]) => this.onChangeLab(selected[0])}\r\n                  options={labAccounts}\r\n                  disabled={!!this.props.labAccountNumber}\r\n                  placeholder=\"Enter the Lab Account name\"\r\n                  selected={labAccountObj ? [labAccountObj] : []} />\r\n              </Form.Group>\r\n            </Col>\r\n          </Form.Row>\r\n          {labAccountCompanyName && <Form.Row>\r\n            <Col className=\"font-weight-bold form-group\">{labAccountCompanyName}</Col>\r\n          </Form.Row>}\r\n          {labAccountObj && availableTests.length === 0 && !labAccountsLoading && !testsLoading && <Form.Row>\r\n            <Col className=\"error-message\">No services found for lab account</Col>\r\n          </Form.Row>}\r\n          {testsLoading && <Form.Row>\r\n            <Col className=\"text-center\"><Spinner animation=\"border\" variant=\"secondary\" /></Col>\r\n          </Form.Row>}\r\n          <Form.Row hidden={!showPanels}>\r\n            <Col xs=\"12\">\r\n              <Form.Group>\r\n                <Form.Label className=\"font-weight-bold required\">TEST TO BE PERFORMED</Form.Label>\r\n                <Typeahead id=\"clinicalTestToPerformTypeahead\"\r\n                  labelKey=\"Description\"\r\n                  filterBy={(option, props) => props.selected.length > 0 || option.Description.toLowerCase().indexOf(props.text.toLowerCase()) !== -1}\r\n                  onChange={selected => this.service$.next(selected[0])}\r\n                  options={availableTests}\r\n                  disabled={testsLoading}\r\n                  placeholder=\"Enter the Test name\"\r\n                  selected={testToPerformObj ? [testToPerformObj as TestToBePerform] : []} />\r\n              </Form.Group>\r\n            </Col>\r\n          </Form.Row>\r\n        </>}\r\n      </SelectServiceTogglePanel>\r\n    )\r\n  }\r\n\r\n  getServicesComponents() {\r\n    const { canAddDOT, canAddNonDOT, orderableServices, orderableAccountServices, marketplaceServicesCount, notMarketplaceServicesCount } = this.props\r\n    const canAddMarketplace = notMarketplaceServicesCount === 0\r\n    const canAddNotMarketplace = marketplaceServicesCount === 0\r\n\r\n    let servicesComponents = []\r\n    this.isAllServicesDisabled = true\r\n    for (let i = 0; i < orderableServices.length; i++) {\r\n      const orderableService = orderableServices[i]\r\n      const serviceActive = IsServiceActive(orderableService, orderableAccountServices)\r\n      const alreadySelected = this.props.services.filter(item => item.serviceCode === orderableService.FFServiceCode)\r\n      const item_id = `${orderableService.FFServiceCode}_${orderableService.ServiceID}`\r\n      const item_value = orderableService.FFServiceCode\r\n\r\n      const item_disabled = !serviceActive || alreadySelected.length > 0 && !IsServiceCodeWellness(orderableService.ServiceCode as ServiceCode)\r\n        || (orderableService.DOT && !canAddDOT)\r\n        || (!orderableService.DOT && !canAddNonDOT)\r\n        || (orderableService.Marketplace && !canAddMarketplace)\r\n        || (!orderableService.Marketplace && !canAddNotMarketplace)\r\n\r\n        if(!item_disabled){\r\n          this.isAllServicesDisabled = false;\r\n        }\r\n\r\n      const item_checked = this.state.serviceCode === item_value\r\n      const serviceComponent = <Form.Check\r\n        label={orderableService.ServiceDescription}\r\n        id={item_id}\r\n        key={item_id}\r\n        type=\"radio\"\r\n        name=\"testType\"\r\n        className=\"font-weight-bold abc-radio\"\r\n        disabled={item_disabled}\r\n        value={item_value}\r\n        onChange={this.onChangeTestType}\r\n        checked={item_checked} />\r\n      servicesComponents.push(serviceComponent)\r\n    }\r\n\r\n    return <Form.Group className={this.state.serviceCode ? \"section-border p-2\" : \"invalid-section-border p-2\"}>{servicesComponents}</Form.Group>\r\n  }\r\n}\r\n","import { Form } from \"react-bootstrap\"\r\n\r\nimport Service from \"../../../../api/Administration/Model/Service\"\r\nimport { ServiceCode } from \"../../../../api/LookupCodes/ServiceCode\"\r\n\r\ninterface CHSServiceProps {\r\n  service: Service\r\n  selected: boolean\r\n  disabled: boolean\r\n  onSelectService: (serviceCode: ServiceCode, add: boolean) => void\r\n}\r\n\r\nfunction CHSService(props: CHSServiceProps) {\r\n  const {\r\n    service: { ServiceID, ServiceDescription, FFServiceCode },\r\n    selected,\r\n    disabled,\r\n    onSelectService,\r\n  } = props\r\n\r\n  const onChange = (e: React.ChangeEvent<HTMLInputElement>) => {\r\n    onSelectService(e.target.value as ServiceCode, e.target.checked)\r\n  }\r\n\r\n  return (\r\n    <Form.Check\r\n      id={`${FFServiceCode}_${ServiceID}`}\r\n      label={ServiceDescription}\r\n      type=\"checkbox\"\r\n      name=\"service\"\r\n      className=\"font-weight-bold abc-checkbox-primary abc-checkbox\"\r\n      disabled={disabled}\r\n      value={FFServiceCode}\r\n      onChange={onChange}\r\n      checked={selected}\r\n    />\r\n  )\r\n}\r\n\r\nexport default CHSService\r\n","import { useEffect } from \"react\"\r\n\r\nimport { Form } from \"react-bootstrap\"\r\n\r\nimport CHSService from \"./CHSService\"\r\nimport AccountService from \"../../../../api/Administration/Model/AccountService\"\r\nimport Service, { IsServiceActive, IsServiceCodeCHSBL } from \"../../../../api/Administration/Model/Service\"\r\nimport { ServiceCode } from \"../../../../api/LookupCodes/ServiceCode\"\r\nimport { ServiceDataModel } from \"../../OrderModels\"\r\n\r\ninterface CHSServicesProps {\r\n  services: ServiceDataModel[]\r\n  orderableServices: Service[]\r\n  selectedServices: Service[]\r\n  accountServices: AccountService[]\r\n  canAddDOT: boolean\r\n  canAddNonDOT: boolean\r\n  canAddMarketplace: boolean\r\n  canAddNotMarketplace: boolean\r\n  onSelectService: (serviceCode: ServiceCode, add: boolean) => void\r\n}\r\n\r\nfunction CHSServices(props: CHSServicesProps) {\r\n  const {\r\n    services,\r\n    orderableServices,\r\n    selectedServices,\r\n    accountServices,\r\n    canAddDOT,\r\n    canAddNonDOT,\r\n    canAddMarketplace,\r\n    canAddNotMarketplace,\r\n    onSelectService,\r\n  } = props\r\n\r\n  useEffect(() => {\r\n    if (orderableServices.length === 1 && selectedServices.length === 0) {\r\n      onSelectService(orderableServices[0].FFServiceCode as ServiceCode, true)\r\n    }\r\n  }, [onSelectService, selectedServices, orderableServices])\r\n\r\n  const isSelected = (service: Service) => {\r\n    return !!selectedServices.find((item) => item.FFServiceCode === service.FFServiceCode)\r\n  }\r\n\r\n  const isDisabled = (service: Service) => {\r\n    return (\r\n      !IsServiceActive(service, accountServices) ||\r\n      services.filter((item) => item.serviceCode === service.FFServiceCode).length > 0 ||\r\n      !IsServiceCodeCHSBL(service.FFServiceCode) ||\r\n      (service.DOT && !canAddDOT) ||\r\n      (!service.DOT && !canAddNonDOT) ||\r\n      (service.Marketplace && !canAddMarketplace) ||\r\n      (!service.Marketplace && !canAddNotMarketplace)\r\n    )\r\n  }\r\n\r\n  return (\r\n    <Form.Group>\r\n      {orderableServices.map((service) => (\r\n        <CHSService\r\n          key={service.ServiceID}\r\n          service={service}\r\n          selected={isSelected(service)}\r\n          disabled={isDisabled(service)}\r\n          onSelectService={onSelectService}\r\n        />\r\n      ))}\r\n    </Form.Group>\r\n  )\r\n}\r\n\r\nexport default CHSServices\r\n","import { Form } from \"react-bootstrap\"\r\nimport { Typeahead } from \"react-bootstrap-typeahead\"\r\n\r\nimport TestToBePerform from \"../../../../api/LabService/LabServiceModel/TestToBePerform\"\r\n\r\ninterface CHSTestsProps {\r\n  selectedTests: TestToBePerform[]\r\n  availableTests: TestToBePerform[]\r\n  disabled?: boolean\r\n  onChange: (selected: TestToBePerform[]) => void\r\n}\r\n\r\nfunction CHSTests(props: CHSTestsProps) {\r\n  const { selectedTests, availableTests, disabled, onChange } = props\r\n\r\n  return (\r\n    <Form.Group>\r\n      <Form.Label className=\"font-weight-bold required\">TEST TO BE PERFORMED</Form.Label>\r\n      <Typeahead\r\n        id=\"clinicalTestToPerformTypeahead\"\r\n        labelKey=\"Description\"\r\n        onChange={onChange}\r\n        options={availableTests}\r\n        isInvalid={selectedTests.length === 0}\r\n        disabled={disabled}\r\n        placeholder=\"Enter the Test name\"\r\n        multiple\r\n        selected={selectedTests}\r\n      />\r\n    </Form.Group>\r\n  )\r\n}\r\n\r\nCHSTests.defaultProps = {\r\n  disabled: false,\r\n}\r\n\r\nexport default CHSTests\r\n","import React, { PureComponent } from \"react\"\r\n\r\nimport { Col, Form, Spinner } from \"react-bootstrap\"\r\nimport { Typeahead } from \"react-bootstrap-typeahead\"\r\nimport { toast } from \"react-toastify\"\r\nimport { BehaviorSubject, concat, of, Subject, Subscription } from \"rxjs\"\r\nimport { catchError, map, switchMap } from \"rxjs/operators\"\r\n\r\nimport CHSServices from \"./CHS/CHSServices\"\r\nimport CHSTests from \"./CHS/CHSTests\"\r\nimport { SelectServiceProps } from \"./SelectService\"\r\nimport SelectServiceTogglePanel from \"./SelectServiceTogglePanel\"\r\nimport { ServiceByCode } from \"../../../api/Administration/Model/Service\"\r\nimport { ServiceTypeCode } from \"../../../api/Administration/Model/ServiceType\"\r\nimport LabAccountsGetObservable from \"../../../api/LabService/LabAccountsGet\"\r\nimport LabAccount from \"../../../api/LabService/LabServiceModel/LabAccount\"\r\nimport TestToBePerform from \"../../../api/LabService/LabServiceModel/TestToBePerform\"\r\nimport TestToBePerformWithCompanyName from \"../../../api/LabService/LabServiceModel/TestToBePerformWithCompanyName\"\r\nimport TestToBePerformGetObservable from \"../../../api/LabService/TestToBePerformGet\"\r\nimport { APIError } from \"../../../api/ObservableFromFetch\"\r\nimport FormatError from \"../../../formatters/FormatError\"\r\nimport { EmptyServiceData, ServiceDataModel } from \"../OrderModels\"\r\nimport { ServiceCode } from \"../../../api/LookupCodes/ServiceCode\"\r\n\r\ninterface SelectCHSProps extends SelectServiceProps {\r\n  company?: number\r\n  location?: number\r\n  services: ServiceDataModel[]\r\n}\r\n\r\ninterface SelectCHSTestState {\r\n  serviceData: ServiceDataModel\r\n  labAccountsLoading: boolean\r\n  labAccounts: LabAccount[]\r\n  testsLoading: boolean\r\n  availableTests: TestToBePerform[]\r\n  labAccountCompanyName?: string\r\n}\r\n\r\nexport default class SelectCHS extends PureComponent<SelectCHSProps, SelectCHSTestState> {\r\n  defaultService = {\r\n    ...EmptyServiceData,\r\n    serviceTypeCode: ServiceTypeCode.CHS,\r\n    serviceCode: ServiceCode.None,\r\n    selectedTests: [],\r\n    selectedServices: [],\r\n  }\r\n\r\n  state: SelectCHSTestState = {\r\n    serviceData: { ...this.defaultService },\r\n    labAccountsLoading: false,\r\n    labAccounts: [],\r\n    testsLoading: false,\r\n    availableTests: [],\r\n  }\r\n\r\n  subscriptions = new Subscription()\r\n\r\n  company$ = new BehaviorSubject<number>(0)\r\n\r\n  labAccount$ = new Subject<LabAccount>()\r\n\r\n  componentDidMount() {\r\n    const { company, location } = this.props\r\n\r\n    this.subscriptions.add(\r\n      this.company$\r\n        .pipe(\r\n          switchMap((companyId: number) =>\r\n            !companyId\r\n              ? of({ isLoading: false })\r\n              : concat(\r\n                  of({ isLoading: true }),\r\n                  LabAccountsGetObservable({\r\n                    SearchFor: \"\",\r\n                    SearchBy: \"Account Name\",\r\n                    CompanyID: companyId,\r\n                    RegionID: 0,\r\n                    LocationID: location || 0,\r\n                    DOT: false,\r\n                    IsMarketPlace: true,\r\n                  }).pipe(\r\n                    map((data) => ({ isLoading: false, result: data })),\r\n                    catchError((error) => of({ isLoading: false, error }))\r\n                  )\r\n                )\r\n          )\r\n        )\r\n        .subscribe((data: { isLoading: boolean; result?: LabAccount[]; error?: Error | APIError }) => {\r\n          if (data.error) {\r\n            toast.error(FormatError(data.error))\r\n          }\r\n          this.setState({ labAccountsLoading: data.isLoading, labAccounts: data.result || [] })\r\n          this.labAccount$.next(undefined)\r\n        })\r\n    )\r\n\r\n    this.subscriptions.add(\r\n      this.labAccount$.subscribe((selected) =>\r\n        this.setState((prev) => ({\r\n          ...prev,\r\n          serviceData: {\r\n            ...prev.serviceData,\r\n            labAccount: selected?.LabCode || \"\",\r\n            labAccountObj: selected,\r\n            availableTests: [],\r\n            testToPerform: \"\",\r\n            testToPerformObj: undefined,\r\n            labAccountCompanyName: undefined,\r\n          },\r\n        }))\r\n      )\r\n    )\r\n\r\n    this.subscriptions.add(\r\n      this.labAccount$\r\n        .pipe(\r\n          switchMap((selected: LabAccount) =>\r\n            !selected\r\n              ? of({ isLoading: false })\r\n              : concat(\r\n                  of({ isLoading: true }),\r\n                  TestToBePerformGetObservable({\r\n                    LabAccountNumber: selected.LabAccount,\r\n                    VendorID: selected.LabClientMemberId,\r\n                    IsDOT: false,\r\n                    IsPoct: false,\r\n                    IsMarketPlace: true,\r\n                  }).pipe(\r\n                    map((data) => ({ isLoading: false, result: data })),\r\n                    catchError((error) => of({ isLoading: false, error }))\r\n                  )\r\n                )\r\n          )\r\n        )\r\n        .subscribe(\r\n          (data: { isLoading: boolean; result?: TestToBePerformWithCompanyName; error?: Error | APIError }) => {\r\n            if (data.error) {\r\n              toast.error(FormatError(data.error))\r\n            }\r\n            this.setState((prev) => ({\r\n              ...prev,\r\n              testsLoading: data.isLoading,\r\n              availableTests: data.result?.Panels || [],\r\n              labAccountCompanyName: data.result?.CompanyName,\r\n              serviceData: {\r\n                ...prev.serviceData,\r\n                testToPerform: \"\",\r\n                testToPerformObj: undefined,\r\n                selectedTests: [],\r\n                selectedServices: [],\r\n              },\r\n            }))\r\n          }\r\n        )\r\n    )\r\n\r\n    if (company) {\r\n      this.company$.next(company)\r\n    }\r\n  }\r\n\r\n  componentDidUpdate(prevProps: SelectCHSProps) {\r\n    const { company, location } = this.props\r\n\r\n    if (company && (company !== prevProps.company || (location && location !== prevProps.location))) {\r\n      this.company$.next(company)\r\n    }\r\n  }\r\n\r\n  componentWillUnmount() {\r\n    this.subscriptions.unsubscribe()\r\n  }\r\n\r\n  onChangeLab = (lab: LabAccount) => this.labAccount$.next(lab)\r\n\r\n  onSelectService = (serviceCode: ServiceCode, add: boolean) => {\r\n    const { orderableServices } = this.props\r\n    const service = ServiceByCode(orderableServices, serviceCode)\r\n\r\n    this.setState((prev) => {\r\n      const { selectedServices } = prev.serviceData\r\n\r\n      if (add && !selectedServices.find((item) => item.ServiceCode === service.ServiceCode)) {\r\n        return {\r\n          ...prev,\r\n          serviceData: {\r\n            ...prev.serviceData,\r\n            selectedServices: [...prev.serviceData.selectedServices, service],\r\n          },\r\n        }\r\n      }\r\n      return {\r\n        ...prev,\r\n        serviceData: {\r\n          ...prev.serviceData,\r\n          selectedServices: prev.serviceData.selectedServices.filter((s) => s.ServiceCode !== service.ServiceCode),\r\n        },\r\n      }\r\n    })\r\n  }\r\n\r\n  onServiceAdd = () => {\r\n    const { onAdd } = this.props\r\n    const { serviceData } = this.state\r\n\r\n    onAdd(serviceData)\r\n    this.setInitialState()\r\n  }\r\n\r\n  onPanelClose = () => this.setInitialState()\r\n\r\n  onClinicalTestToBePerformedChange = (selected: TestToBePerform[]) => {\r\n    this.setState((prev) => ({\r\n      ...prev,\r\n      serviceData: {\r\n        ...prev.serviceData,\r\n        testToPerform: selected.map((test) => test.Code).join(\", \") || \"\",\r\n        selectedTests: selected,\r\n      },\r\n    }))\r\n  }\r\n\r\n  setInitialState = () => this.setState({ serviceData: this.defaultService })\r\n\r\n  isValid = (): boolean => {\r\n    const { denyAddService } = this.props\r\n    const {\r\n      serviceData: { labAccountObj, selectedTests, selectedServices },\r\n    } = this.state\r\n\r\n    // TODO: Should returns false if all services are disabled\r\n\r\n    return !denyAddService && !!labAccountObj && selectedTests.length > 0 && selectedServices.length > 0\r\n  }\r\n\r\n  render() {\r\n    const {\r\n      services,\r\n      disabled,\r\n      orderableServiceType,\r\n      labAccountNumber,\r\n      orderableServices,\r\n      orderableAccountServices,\r\n      canAddDOT,\r\n      canAddNonDOT,\r\n      notMarketplaceServicesCount,\r\n      marketplaceServicesCount,\r\n    } = this.props\r\n\r\n    const {\r\n      labAccounts,\r\n      labAccountsLoading,\r\n      labAccountCompanyName,\r\n      availableTests,\r\n      testsLoading,\r\n      serviceData,\r\n      serviceData: { labAccountObj, selectedTests, selectedServices },\r\n    } = this.state\r\n\r\n    const showPanels = labAccountObj && availableTests.length > 0\r\n    const showNoServicesFound = !labAccountsLoading && labAccountObj && !testsLoading && availableTests.length === 0\r\n\r\n    return (\r\n      <SelectServiceTogglePanel\r\n        title={orderableServiceType.ServiceTypeName || \"Clinical Health Services\"}\r\n        data={serviceData}\r\n        collapsibleId=\"CHSCollapsePanel\"\r\n        disabled={disabled}\r\n        onSubmit={this.onServiceAdd}\r\n        onValidate={this.isValid}\r\n        onClose={this.onPanelClose}\r\n      >\r\n        <Form.Row>\r\n          <Col xs=\"12\">\r\n            <Form.Group>\r\n              <Form.Label className=\"font-weight-bold required\">LAB ACCOUNT</Form.Label>\r\n              <Typeahead\r\n                id=\"labAccountsTypeahead\"\r\n                labelKey=\"Description\"\r\n                filterBy={(option, props) => {\r\n                  return (\r\n                    props.selected.length > 0 ||\r\n                    option.Description.toLowerCase().indexOf(props.text.toLowerCase()) !== -1\r\n                  )\r\n                }}\r\n                onChange={(selected: LabAccount[]) => this.onChangeLab(selected[0])}\r\n                isInvalid={!labAccountObj}\r\n                options={labAccounts}\r\n                disabled={!!labAccountNumber}\r\n                placeholder=\"Enter the Lab Account name\"\r\n                selected={labAccountObj ? [labAccountObj] : []}\r\n              />\r\n            </Form.Group>\r\n          </Col>\r\n        </Form.Row>\r\n        {labAccountCompanyName && (\r\n          <Form.Row>\r\n            <Col xs=\"12\" className=\"font-weight-bold form-group mb-2\">\r\n              {labAccountCompanyName}\r\n            </Col>\r\n          </Form.Row>\r\n        )}\r\n        {showNoServicesFound && (\r\n          <Form.Row>\r\n            <Col xs=\"12\" className=\"error-message\">\r\n              No services found for lab account\r\n            </Col>\r\n          </Form.Row>\r\n        )}\r\n        {testsLoading && (\r\n          <Form.Row>\r\n            <Col className=\"text-center\">\r\n              <Spinner animation=\"border\" variant=\"secondary\" />\r\n            </Col>\r\n          </Form.Row>\r\n        )}\r\n        {showPanels && (\r\n          <Form.Row>\r\n            <Col xs=\"12\">\r\n              <CHSTests\r\n                availableTests={availableTests}\r\n                selectedTests={selectedTests}\r\n                disabled={testsLoading}\r\n                onChange={this.onClinicalTestToBePerformedChange}\r\n              />\r\n            </Col>\r\n          </Form.Row>\r\n        )}\r\n        {orderableServices.length > 0 && (\r\n          <Form.Row className=\"px-2\">\r\n            <Col xs=\"12\">\r\n              <CHSServices\r\n                services={services}\r\n                orderableServices={orderableServices}\r\n                selectedServices={selectedServices}\r\n                accountServices={orderableAccountServices}\r\n                canAddDOT={canAddDOT}\r\n                canAddNonDOT={canAddNonDOT}\r\n                canAddMarketplace={notMarketplaceServicesCount === 0}\r\n                canAddNotMarketplace={marketplaceServicesCount === 0}\r\n                onSelectService={this.onSelectService}\r\n              />\r\n            </Col>\r\n          </Form.Row>\r\n        )}\r\n      </SelectServiceTogglePanel>\r\n    )\r\n  }\r\n\r\n  static defaultProps = {\r\n    company: 0,\r\n    location: 0,\r\n  }\r\n}\r\n","import { Component } from 'react'\r\nimport SelectDrugTest from './OrderServices/SelectDrugTest'\r\nimport SelectAlcoholTest from './OrderServices/SelectAlcoholTest'\r\nimport SelectPhysicalExam from './OrderServices/SelectPhysicalExam'\r\nimport { ServiceDataModel } from './OrderModels'\r\nimport { TestReasonType } from '../../api/OrderRequests/OrderRequestsModel/TestReasonType'\r\nimport { TestData } from './OrderRequest'\r\nimport ServiceType, { ServiceTypeCode, GetDrugServiceType, GetAlcoholServiceType, GetPhysicalServiceType, GetOHSServiceType, GetCHSServiceType } from \"../../api/Administration/Model/ServiceType\"\r\nimport Service, { ServicesByServiceTypeId, AccountsForServices, IsServiceCodePOCT, IsServiceCodeCHSBL } from \"../../api/Administration/Model/Service\"\r\nimport AccountService from \"../../api/Administration/Model/AccountService\"\r\nimport SelectOHS from './OrderServices/SelectOHS'\r\nimport SelectCHS from './OrderServices/SelectCHS'\r\nimport { OrderDefault } from '../../api/Administration/OrderDefaults'\r\nimport RegulatoryMode from '../../api/LabService/LabServiceModel/RegulatoryMode'\r\nimport EmployeeCategory from '../../api/LabService/LabServiceModel/EmployeeCategory'\r\nimport { ServiceCode } from '../../api/LookupCodes/ServiceCode'\r\nimport { SampleType } from '../../api/LookupCodes/SampleType'\r\n\r\ninterface ServicesSelectionProps {\r\n  company?: number\r\n  location?: number\r\n  reason?: TestReasonType\r\n  services: ServiceDataModel[]\r\n  selectedRegMode?: RegulatoryMode\r\n  selectedCategory?: EmployeeCategory\r\n  maximumDrugTests: number\r\n  maximumAlcoholTests: number\r\n  maximumPhysicalTests: number\r\n  showDrugSection?: boolean\r\n  showAlcoholSection?: boolean\r\n  showPhysicalSection?: boolean\r\n  showOHSSection?: boolean\r\n  showCHSSection?: boolean\r\n  denyAddServices: boolean\r\n  completingPendingOrders?: boolean\r\n  drugTestData?: TestData\r\n  alcoholTestData?: TestData,\r\n  orderableServiceTypes: ServiceType[],\r\n  orderableServices: Service[],\r\n  orderableAccountServices: AccountService[],\r\n  defaults: OrderDefault[],\r\n  onAddService: (data: ServiceDataModel) => void\r\n}\r\n\r\nconst ReasonReturnToDuty = \"Return To Duty\"\r\nconst ReasonFollowUp = \"Follow-up\"\r\n\r\nexport default class ServicesSelection extends Component<ServicesSelectionProps> {\r\n  render() {\r\n    const { onAddService } = this.props\r\n    const isDot = this.props.completingPendingOrders && (this.props.drugTestData?.dot || this.props.alcoholTestData?.dot)\r\n    const hasServices = (isDOT: boolean) => {\r\n      return this.props.services\r\n        .filter(item => ![\r\n          ServiceCode.POCT,\r\n          ServiceCode.Physical,\r\n          ServiceCode.PhysicalDOT,\r\n          ServiceCode.DrugNonDOTUrine,\r\n          ServiceCode.DrugDOTUrine,\r\n          ServiceCode.DrugDOTOral,\r\n          ServiceCode.DrugNonDOTOral\r\n        ].includes(item.serviceCode))\r\n        .filter(item => ![ServiceTypeCode.OHS].includes(item.serviceTypeCode))\r\n        .filter(item => ![ServiceTypeCode.CHS].includes(item.serviceTypeCode))\r\n        .filter(item => item.isDOT === isDOT)\r\n        .length > 0\r\n    }\r\n    const filterServicesByType = (types: ServiceTypeCode[]) => {\r\n      return this.props.services.filter(item => types.includes(item.serviceTypeCode))\r\n    }\r\n    const filterServicesByMarketplace = (marketplace: boolean) => {\r\n      return this.props.services.filter(item => item.isMarketplace === marketplace)\r\n    }\r\n\r\n    // Regulated (DOT) test type is available to select if no any Non-Regulated (NON-DOT) test types in ordered services list\r\n    const canAddDOT = this.props.completingPendingOrders && !isDot ? false : !hasServices(false)\r\n    // Non-Regulated (NON-DOT) test type is available to select if no any Regulated (DOT) test types in ordered services list\r\n    const canAddNonDOT = this.props.completingPendingOrders && isDot ? false : !hasServices(true)\r\n    const canAddPOCT = !this.props.completingPendingOrders\r\n    const canAddFLEX = !this.props.completingPendingOrders\r\n    const canAddDrugDOT = !(this.props.completingPendingOrders && !isDot)\r\n    const canAddDrugNonDOT = !(this.props.completingPendingOrders && isDot)\r\n\r\n    // Whether panels should be disabled\r\n    const canAddDrugService = true\r\n    const canAddAlcoholService = filterServicesByType([ServiceTypeCode.Alcohol]).length < this.props.maximumAlcoholTests\r\n    const canAddPhysicalService = filterServicesByType([ServiceTypeCode.Physical]).length < this.props.maximumPhysicalTests\r\n    const canAddOHSService = true\r\n    const canAddCHSService = true\r\n\r\n    // Observed checkbox should be checked and unable to change for Reasons \"Return To Duty\" and \"Follow-up\"\r\n    // Implemented according to Steve W. decision made on scrum 5/19/2021\r\n    // Matching by name according to WF 1.0 logic (src\\app\\pages\\order\\order.component.ts:1949)\r\n    const isObservedMandatory = this.props.reason && (this.props.reason.Description === ReasonReturnToDuty || this.props.reason.Description === ReasonFollowUp) || false\r\n    const orderableServiceTypes = this.props.orderableServiceTypes;\r\n    const orderableServices = this.props.orderableServices;\r\n    const orderableAccountServices = this.props.orderableAccountServices;\r\n\r\n    const drugServiceType = GetDrugServiceType(orderableServiceTypes);\r\n    const alcoholServiceType = GetAlcoholServiceType(orderableServiceTypes);\r\n    const physicalServiceType = GetPhysicalServiceType(orderableServiceTypes);\r\n    const ohsServiceType = GetOHSServiceType(orderableServiceTypes)\r\n    const chsServiceType = GetCHSServiceType(orderableServiceTypes)\r\n\r\n    const drugServices = ServicesByServiceTypeId(orderableServices, drugServiceType.ServiceTypeID);\r\n    const alcoholServices = ServicesByServiceTypeId(orderableServices, alcoholServiceType.ServiceTypeID);\r\n    const physicalServices = ServicesByServiceTypeId(orderableServices, physicalServiceType.ServiceTypeID);\r\n    const ohsServices = ServicesByServiceTypeId(orderableServices, ohsServiceType.ServiceTypeID)\r\n    const chsServices = ServicesByServiceTypeId(orderableServices, chsServiceType.ServiceTypeID)\r\n\r\n    const drugAccountServices = AccountsForServices(drugServices, orderableAccountServices);\r\n    const alcoholAccountServices = AccountsForServices(alcoholServices, orderableAccountServices);\r\n    const physicalAccountServices = AccountsForServices(physicalServices, orderableAccountServices);\r\n    const ohsAccountServices = AccountsForServices(ohsServices, orderableAccountServices)\r\n    const chsAccountServices = AccountsForServices(chsServices, orderableAccountServices)\r\n\r\n    const marketplaceServicesCount = filterServicesByMarketplace(true).length;\r\n    const notMarketplaceServicesCount = filterServicesByMarketplace(false).length;\r\n\r\n    return (\r\n      <div className=\"py-2\">\r\n        {(this.props.showDrugSection || this.props.showAlcoholSection || this.props.showPhysicalSection) && <span className=\"font-weight-bold\">PLEASE SELECT SERVICES:</span>}\r\n        {this.props.showDrugSection && <SelectDrugTest disabled={!canAddDrugService}\r\n          open={this.props.completingPendingOrders}\r\n          company={this.props.company}\r\n          location={this.props.location}\r\n          isObservedMandatory={isObservedMandatory}\r\n          isDot={this.props.drugTestData?.dot}\r\n          labAccountNumber={this.props.drugTestData?.labAccountNumber}\r\n          panelId={this.props.drugTestData?.panelID}\r\n          regulatoryModeID={this.props.drugTestData?.regulatoryModeID || this.props.selectedRegMode?.RegulatoryModeID}\r\n          employeeCategoryID={this.props.drugTestData?.employeeCategoryID || this.props.selectedCategory?.EmployeeCategoryID}\r\n          onAdd={onAddService}\r\n          canAddDOT={canAddDrugDOT}\r\n          canAddNonDOT={canAddDrugNonDOT}\r\n          canAddPOCT={canAddPOCT}\r\n          canAddFLEX={canAddFLEX}\r\n          orderableServiceType={drugServiceType}\r\n          orderableServices={drugServices}\r\n          orderableAccountServices={drugAccountServices}\r\n          defaults={this.props.defaults}\r\n          marketplaceServicesCount={marketplaceServicesCount}\r\n          notMarketplaceServicesCount={notMarketplaceServicesCount}\r\n          denyAddService={this.props.denyAddServices}\r\n          sampleType={this.props.drugTestData?.eventType as SampleType}\r\n          />}\r\n        {this.props.showAlcoholSection && <SelectAlcoholTest disabled={!canAddAlcoholService}\r\n          open={this.props.completingPendingOrders}\r\n          isDot={this.props.alcoholTestData?.dot}\r\n          selectedTestCode={this.props.alcoholTestData?.eventType}\r\n          onAdd={onAddService}\r\n          canAddDOT={canAddDOT}\r\n          canAddNonDOT={canAddNonDOT}\r\n          orderableServiceType={alcoholServiceType}\r\n          orderableServices={alcoholServices}\r\n          orderableAccountServices={alcoholAccountServices}\r\n          marketplaceServicesCount={marketplaceServicesCount}\r\n          notMarketplaceServicesCount={notMarketplaceServicesCount}\r\n          denyAddService={this.props.denyAddServices}\r\n          regulatoryModeID={this.props.alcoholTestData?.regulatoryModeID || this.props.selectedRegMode?.RegulatoryModeID}\r\n          employeeCategoryID={this.props.alcoholTestData?.employeeCategoryID || this.props.selectedCategory?.EmployeeCategoryID}\r\n          />}\r\n        {this.props.showPhysicalSection && <SelectPhysicalExam disabled={!canAddPhysicalService}\r\n          open={this.props.completingPendingOrders}\r\n          onAdd={onAddService}\r\n          canAddDOT={true}\r\n          canAddNonDOT={true}\r\n          orderableServiceType={physicalServiceType}\r\n          orderableServices={physicalServices}\r\n          orderableAccountServices={physicalAccountServices}\r\n          marketplaceServicesCount={marketplaceServicesCount}\r\n          notMarketplaceServicesCount={notMarketplaceServicesCount}\r\n          denyAddService={this.props.denyAddServices}\r\n          regulatoryModeID={this.props.selectedRegMode?.RegulatoryModeID}\r\n          employeeCategoryID={this.props.selectedCategory?.EmployeeCategoryID}\r\n          />}\r\n          {this.props.showOHSSection && <SelectOHS disabled={!canAddOHSService}\r\n            services={this.props.services}\r\n            open={this.props.completingPendingOrders}\r\n            canAddDOT={true}\r\n            canAddNonDOT={true}\r\n            company={this.props.company}\r\n            location={this.props.location}\r\n            onAdd={onAddService}\r\n            orderableServiceType={ohsServiceType}\r\n            orderableServices={ohsServices}\r\n            orderableAccountServices={ohsAccountServices}\r\n            marketplaceServicesCount={marketplaceServicesCount}\r\n            notMarketplaceServicesCount={notMarketplaceServicesCount}\r\n            denyAddService={this.props.denyAddServices}\r\n          />}\r\n          {this.props.showCHSSection && <SelectCHS disabled={!canAddCHSService}\r\n            services={this.props.services}\r\n            open={this.props.completingPendingOrders}\r\n            company={this.props.company}\r\n            location={this.props.location}\r\n            canAddDOT={true}\r\n            canAddNonDOT={true}\r\n            onAdd={onAddService}\r\n            orderableServiceType={chsServiceType}\r\n            orderableServices={chsServices}\r\n            orderableAccountServices={chsAccountServices}\r\n            marketplaceServicesCount={marketplaceServicesCount}\r\n            notMarketplaceServicesCount={notMarketplaceServicesCount}\r\n            denyAddService={this.props.denyAddServices}\r\n          />}\r\n      </div>\r\n    )\r\n  }\r\n}\r\n","import { Form } from 'react-bootstrap'\r\n\r\nexport interface TextFormControlProps {\r\n  value: string | undefined\r\n  maxLength?: number\r\n  disabled?: boolean\r\n  readOnly?: boolean\r\n  changeHandler: (value: string) => void\r\n  isValid?: () => boolean\r\n  blurHandler?: () => void\r\n  enterTapHandler?: () => void\r\n  formatFunction?: (value: string) => string\r\n}\r\n\r\nexport default (props: TextFormControlProps) => {\r\n\r\n  const onChange = (value: string) => {\r\n    if (props.formatFunction) { value = props.formatFunction(value) }\r\n    props.changeHandler(value)\r\n  }\r\n\r\n  return (\r\n    <Form.Control type=\"text\"\r\n      value={props.value || ''}\r\n      onChange={e => onChange(e.target.value)}\r\n      disabled={props.disabled}\r\n      maxLength={props.maxLength}\r\n      readOnly={props.readOnly}\r\n      isInvalid={props.value !== undefined && (props.isValid !== undefined && !props.isValid())}\r\n      onBlur={() => { onChange(props.value || ''); if (props.blurHandler) { props.blurHandler() } }}\r\n      onKeyDown={(e: { keyCode: number }) => { if (props.enterTapHandler && e.keyCode === 13) { props.enterTapHandler() } }} />\r\n  )\r\n}\r\n","import { Observable } from \"rxjs\"\r\nimport { ObservableFromFetch } from \"../ObservableFromFetch\"\r\nimport { Donor } from \"./OrderRequestsModel/Donor\"\r\n\r\nexport interface GetDonorRequest {\r\n  Identifier?: string\r\n  IdentifierType?: number | string\r\n  DonorID?: string\r\n  CompanyID: number\r\n  RegulatoryModeID: number\r\n  LastName?: string\r\n  EveningPhone?: string\r\n  DayTimePhone?: string\r\n  Mobile?: null\r\n  DateOfBirth?: string\r\n  isPortalAdmin?: boolean\r\n}\r\n\r\nexport function SearchDonorGetObservable(parameters: GetDonorRequest): Observable<Donor[]> {\r\n  const requestBody: string = JSON.stringify(parameters)\r\n  return ObservableFromFetch<Donor[]>(\"Workforceorder/SearchDonorInformationByIDV2\", requestBody)\r\n}\r\n\r\nexport function AdvanceSearchDonorGetObservable(parameters: GetDonorRequest): Observable<Donor[]> {\r\n  const requestBody: string = JSON.stringify(parameters)\r\n  return ObservableFromFetch<Donor[]>(\"Workforceorder/AdvanceSearchDonorInformation\", requestBody)\r\n}","import React, { Component, createRef } from 'react'\r\nimport { toast } from 'react-toastify'\r\nimport { Form, Col, InputGroup, Button, Spinner } from 'react-bootstrap'\r\nimport TextFormControl from './TextFormControl'\r\nimport DatePicker from 'react-datepicker'\r\nimport 'react-datepicker/dist/react-datepicker.css'\r\nimport FormatPhone from '../../formatters/FormatPhone'\r\nimport FormatSSN from '../../formatters/FormatSSN'\r\nimport { DonorInformationModel, GetRegulatoryModeDonor } from './OrderModels'\r\nimport { Subscription } from \"rxjs\"\r\nimport { StateObservable } from \"../../api/OrderRequests/OrderRequestsConstraintGet\"\r\nimport State from \"../../api/OrderRequests/OrderRequestsModel/State\"\r\nimport StateSelect from \"../FormattedInputs/StateSelect\"\r\nimport { Donor } from \"../../api/OrderRequests/OrderRequestsModel/Donor\"\r\nimport { SearchDonorGetObservable } from \"../../api/OrderRequests/SearchDonorGet\"\r\nimport { FaSearch } from \"react-icons/fa\"\r\nimport { BirthdayInput } from \"../FormattedInputs/BirthdayInput\"\r\nimport { DonorData } from './OrderRequest'\r\nimport { DonorIdRegexp, InvalidDonorId, InvalidDonorIdLength, InvalidNameMessage, MaxDonorIdLength, NameRegexp } from '../../config/Constants';\r\nimport { DonorDetail } from \"../../api/OrderRequests/SSOOrderRequest\"\r\nimport RegulatoryMode from '../../api/LabService/LabServiceModel/RegulatoryMode'\r\n\r\ntype PhoneField = \"WorkPhone\" | \"CellPhone\" | \"HomePhone\"\r\n\r\nexport interface DonorInformationProps {\r\n  companyId?: number\r\n  completingPendingOrders?: boolean\r\n  orderFormData?: DonorData\r\n  donor: DonorInformationModel\r\n  idTypes: GetRegulatoryModeDonor[]\r\n  isBirthDateRequired?: boolean\r\n  regulatoryMode?: RegulatoryMode\r\n  showIdType: boolean\r\n  showMiddleInitial: boolean\r\n  eveningPhoneLabel: string\r\n  daytimePhoneLabel: string\r\n  eveningPhoneField: PhoneField\r\n  daytimePhoneField: PhoneField\r\n  daytimePhoneRequired: boolean\r\n  showGenderField: boolean\r\n  validateDonorIdFormat?: boolean\r\n  maxDonorIdLength?: number\r\n  SSODonorData?: DonorDetail\r\n  onDonorChange: (donor: DonorInformationModel, isValid: boolean, isDonorInfoSuccess: boolean) => void\r\n}\r\n\r\ninterface DonorInformationState extends DonorInformationModel {\r\n  loading: boolean\r\n  statesLoading: boolean\r\n}\r\n\r\nexport default class DonorInformation extends Component<DonorInformationProps, DonorInformationState> {\r\n  state: DonorInformationState = {\r\n    ...this.props.donor,\r\n    idTypeObj: this.props.donor.idType && this.props.idTypes.find(item => item.PrimaryIDType === this.props.donor.idType) ? this.props.donor.idTypeObj : this.props.idTypes.sort((a, b) => (a.Rank < b.Rank ? -1 : 1))[0],\r\n    loading: false,\r\n    statesLoading: false\r\n  }\r\n  birthDateInput = createRef<DatePicker>()\r\n  isDonorInfoSuccess: boolean = false\r\n  lastSearch: string = \"\"\r\n\r\n  subscriptions = new Subscription()\r\n\r\n  componentDidMount() {\r\n    this.handleDonorIdChange(this.state.donorId || \"\")\r\n  }\r\n\r\n  componentWillUnmount() {\r\n    this.subscriptions && this.subscriptions.unsubscribe()\r\n  }\r\n\r\n  componentDidUpdate(prevProps: DonorInformationProps) {\r\n    const objEq = (obj1: GetRegulatoryModeDonor[], obj2: GetRegulatoryModeDonor[]) => obj1.every((val, index) => val === obj2[index])\r\n    if (!prevProps.idTypes.length && this.props.idTypes.length || prevProps.idTypes.length && !objEq(prevProps.idTypes, this.props.idTypes)) {\r\n      if (this.props.completingPendingOrders && this.props.orderFormData) {\r\n        this.fillPendingFormData(this.props.orderFormData)\r\n      }\r\n      else {\r\n        this.handleIdTypeChange(this.props.donor.idType)\r\n        this.populateSSODonorData()\r\n      }\r\n    }\r\n  }\r\n\r\n  fillPendingFormData(data: DonorData) {\r\n    const idType = data.IDType\r\n    const idTypeObj = this.props.idTypes.find(item => item.PrimaryIDType === idType) || this.props.idTypes[0]\r\n    if (this.displayState(idTypeObj)) {\r\n      this.loadStates()\r\n    }\r\n    this.setState({\r\n      personId: data.PersonID,\r\n      firstName: data.FirstName,\r\n      lastName: data.LastName,\r\n      donorId: data.DonorID,\r\n      idType: data.IDType,\r\n      idTypeObj: idTypeObj,\r\n    })\r\n    SearchDonorGetObservable({\r\n      CompanyID: this.props.companyId || 0,\r\n      DonorID: data.MockDonorID,\r\n      Identifier: idType,\r\n      IdentifierType: idTypeObj.Rank,\r\n      RegulatoryModeID: this.props.regulatoryMode?.RegulatoryModeID || 0,\r\n    }).subscribe(\r\n      response => this.getDonorInfoSuccess(response),\r\n      error => this.getDonorError(error)\r\n    )\r\n  }\r\n\r\n  loadStates = () => {\r\n    if (!this.state.states && !this.state.statesLoading) {\r\n      this.setState({ statesLoading: true })\r\n      this.subscriptions.add(\r\n        StateObservable().subscribe(\r\n          (results: State[]) => this.setState({ states: results, statesLoading: false }),\r\n          () => { this.setState({ statesLoading: false }) }\r\n        )\r\n      )\r\n    }\r\n  }\r\n\r\n  populateSSODonorData = () => {\r\n    const data = this.props.SSODonorData\r\n    if (!data) return\r\n\r\n    this.handleIdTypeChange(data.DonorIDType)\r\n    if (data.DonorID) {\r\n      this.handleDonorIdChange(data.DonorID)\r\n    }\r\n    this.setState({\r\n      idReadOnly: !!data.DonorID,\r\n      firstName: data.DonorFirstName,\r\n      lastName: data.DonorLastName,\r\n      donorId: data.DonorID,\r\n      idType: data.DonorIDType,\r\n      birthdate: data.DonorDOB ? new Date(data.DonorDOB) : undefined,\r\n      daytimePhone: data.DonorPhone,\r\n      email: data.DonorEmail,\r\n      address: { Address1: data.Address?.Line1 || \"\", Address2: data.Address?.Line2 || \"\", City: data.Address?.City || \"\", State: data.Address?.State || \"\", Zip: data.Address?.Zip || \"\" }\r\n    }, () => this.onDonorSearch())\r\n  }\r\n\r\n  handleIdTypeChange = (idType?: string) => {\r\n    const idTypeObject = this.props.idTypes.find(item => item.PrimaryIDType === idType) || this.props.idTypes.sort((a, b) => (a.Rank < b.Rank ? -1 : 1))[0]\r\n\r\n    if (this.displayState(idTypeObject)) {\r\n      this.loadStates()\r\n    }\r\n\r\n    this.updateState({ donorId: \"\", idTypeObj: idTypeObject }, true)\r\n  }\r\n\r\n  handleDonorIdChange = (value: string) => {\r\n    value = this.state.idTypeObj?.PrimaryIDType === \"SSN\" ? FormatSSN(value) : value\r\n    this.updateState({ donorId: value })\r\n  }\r\n\r\n  handleStateChange = (state: State) => this.updateState({ state: state, stateCode: state?.Abbreviation }, true)\r\n  handleBirthDateChange = (value: Date | undefined) => this.updateState({ birthdate: value }, true)\r\n  handleChange = (name: string, value: string) => this.updateState({ [name]: value })\r\n  isPhoneValid = (value: string | undefined, require: boolean) => (require === false && !value) || (value || '').replace(/\\D/g, \"\").length === 10 || value === \"n/p\" || value === \"N/P\" || value === \"np\" || value === \"NP\"\r\n  isFirstNameValid = (value: string | undefined, require: boolean) => (require === false && !value) || ((value || '').trim().length > 0 && NameRegexp.test((value || '').trim()))\r\n  isLastNameValid = (value: string | undefined, require: boolean) => (require === false && !value) || ((value || '').trim().length > 0 && NameRegexp.test((value || '').trim()))\r\n  isSSNValid = (value: string) => this.props.completingPendingOrders || value.replace(/\\D/g, \"\").length === 9\r\n\r\n  updateState(changes: object, sendDonorInformation: boolean = false) {\r\n    this.setState(changes, () => {\r\n      if (sendDonorInformation) {\r\n        const newInfo = { ...this.state, ...changes }\r\n        this.sendDonorInformation(newInfo)\r\n      }\r\n    })\r\n  }\r\n\r\n  onDonorSearch = () => {\r\n    const identifier = (this.state.donorId?.toString().replace(/-/g, \"\") || \"\").trim()\r\n    if (identifier.length === 0) {\r\n      return\r\n    }\r\n    if (identifier === this.lastSearch) {\r\n      return\r\n    }\r\n    this.lastSearch = identifier\r\n\r\n    if (this.state.idTypeObj?.PrimaryIDType === \"SSN\" && !this.isSSNValid(this.state.donorId || \"\")) {\r\n      toast.error(\"Please enter valid 9 digit ID.\")\r\n      return\r\n    }\r\n\r\n    if (!this.props.companyId) {\r\n      return\r\n    }\r\n\r\n    this.setState({ loading: true })\r\n    SearchDonorGetObservable({ CompanyID: this.props.companyId || 0, Identifier: identifier, IdentifierType: this.state.idTypeObj?.Rank || 0, RegulatoryModeID: this.props.regulatoryMode?.RegulatoryModeID || 0 }).subscribe(\r\n      response => this.getDonorInfoSuccess(response),\r\n      error => this.getDonorError(error)\r\n    )\r\n  }\r\n\r\n  getDonorInfoSuccess = (response: Donor[]) => {\r\n    if (response.length === 0) {\r\n      this.isDonorInfoSuccess = false\r\n      toast.error(\"Donor was not found. New donor will be created.\")\r\n      if (this.props.SSODonorData) {\r\n        this.setState({\r\n          loading: false,\r\n          firstNameReadOnly: false,\r\n          middleInitialReadOnly: false,\r\n          lastNameReadOnly: false,\r\n          homePhoneReadOnly: false,\r\n          workPhoneReadOnly: false,\r\n          stateReadOnly: false,\r\n          genderReadOnly: false,\r\n          idReadOnly: true\r\n        })\r\n      } else {\r\n      this.setState(this.props.completingPendingOrders ? {\r\n        loading: false,\r\n        firstNameReadOnly: !!this.state.firstName,\r\n        middleInitialReadOnly: !!this.state.middleInitial,\r\n        lastNameReadOnly: !!this.state.lastName,\r\n        homePhoneReadOnly: (this.state.eveningPhone || \"\") !== \"\",\r\n        workPhoneReadOnly: (this.state.daytimePhone || \"\") !== \"\",\r\n        stateReadOnly: (this.state.stateCode || \"\") !== \"\",\r\n        genderReadOnly: !!this.state.gender\r\n      } : {\r\n        loading: false,\r\n        firstName: \"\",\r\n        middleInitial: \"\",\r\n        lastName: \"\",\r\n        eveningPhone: \"\",\r\n        daytimePhone: \"\",\r\n        birthdate: undefined,\r\n        firstNameReadOnly: false,\r\n        middleInitialReadOnly: false,\r\n        lastNameReadOnly: false,\r\n        homePhoneReadOnly: false,\r\n        workPhoneReadOnly: false,\r\n        state: undefined,\r\n        stateCode: undefined,\r\n        personId: undefined,\r\n        accessCode: undefined,\r\n        gender: \"\",\r\n        email: \"\",\r\n        genderReadOnly: false\r\n      })\r\n      }\r\n    } else if (this.props.SSODonorData) {\r\n      this.isDonorInfoSuccess = true\r\n      const data = response[0]\r\n      const fetchedDate = data.DateOfBirth ? new Date(data.DateOfBirth) : undefined\r\n      const validDate = fetchedDate && fetchedDate.getTime && !isNaN(fetchedDate.getTime())\r\n      const { firstName, middleInitial, lastName, eveningPhone, daytimePhone, birthdate } = this.state\r\n      let newData = { firstName: firstName, middleInitial: middleInitial, lastName: lastName, eveningPhone: eveningPhone, daytimePhone: daytimePhone, birthdate: birthdate }\r\n      if (this.noValueOrEmpty(firstName)) newData.firstName = data.FirstName\r\n      if (this.noValueOrEmpty(middleInitial)) newData.middleInitial = data.MiddleInitial\r\n      if (this.noValueOrEmpty(lastName)) newData.lastName = data.LastName\r\n      if (this.noValueOrEmpty(eveningPhone)) newData.eveningPhone = FormatPhone(data[this.props.eveningPhoneField] || '')\r\n      if (this.noValueOrEmpty(daytimePhone)) newData.daytimePhone = FormatPhone(data[this.props.daytimePhoneField] || '')\r\n      if (this.noValueOrEmpty(birthdate)) newData.birthdate = validDate ? fetchedDate : undefined\r\n      this.setState({ loading: false, personId: data.PersonID, ...newData })\r\n    }\r\n    else {\r\n      this.isDonorInfoSuccess = true\r\n      const data = response[0]\r\n      const fetchedDate = data.DateOfBirth ? new Date(data.DateOfBirth) : undefined\r\n      const validDate = fetchedDate && fetchedDate.getTime && !isNaN(fetchedDate.getTime())\r\n      const isReadOnly = !this.allowEdit()\r\n\r\n      this.setState({\r\n        loading: false,\r\n        personId: data.PersonID,\r\n        firstName: data.FirstName,\r\n        middleInitial: data.MiddleInitial.substring(0, 1),\r\n        lastName: data.LastName,\r\n        eveningPhone: FormatPhone(data[this.props.eveningPhoneField] || ''),\r\n        daytimePhone: FormatPhone(data[this.props.daytimePhoneField] || ''),\r\n        birthdate: validDate ? fetchedDate : undefined,\r\n        accessCode: data.GovAccessCode,\r\n        gender: data.Gender,\r\n        email: data.Email,\r\n        firstNameReadOnly: !!data.FirstName && isReadOnly,\r\n        middleInitialReadOnly: !!data.MiddleInitial && isReadOnly,\r\n        lastNameReadOnly: !!data.LastName && isReadOnly,\r\n        homePhoneReadOnly: ((data.HomePhone || \"\") !== \"N/P\") && isReadOnly,\r\n        workPhoneReadOnly: ((data.WorkPhone || \"\") !== \"N/P\") && isReadOnly,\r\n        stateReadOnly: (data.DriverLICStateOfIssue !== \"\") && isReadOnly,\r\n        genderReadOnly: !!data.Gender && isReadOnly,\r\n        state: undefined,\r\n        stateCode: data.DriverLICStateOfIssue ? data.DriverLICStateOfIssue : undefined\r\n      })\r\n    }\r\n    this.sendDonorInformation()\r\n  }\r\n\r\n  noValueOrEmpty = (value: string | Date | undefined) => !value || value === \"\"\r\n\r\n  getDonorError = (error: string): void => {\r\n    this.isDonorInfoSuccess = false\r\n    this.setState({ loading: false })\r\n    toast.error(\"Donor was not found. New donor will be created.\")\r\n  }\r\n\r\n  isDonorIdValid = (info: DonorInformationModel = this.state) => {\r\n    const { donorId, idTypeObj } = info\r\n    if (donorId === undefined) { return true }\r\n    if (idTypeObj?.PrimaryIDType === \"SSN\") {\r\n      return this.isSSNValid(donorId)\r\n    }\r\n    const value = donorId.trim()\r\n    return value.length > 0 && value.length <= MaxDonorIdLength && (this.props.validateDonorIdFormat ? DonorIdRegexp.test(value) : true)\r\n  }\r\n\r\n  sendDonorInformation = (info: DonorInformationModel = this.state) => {\r\n    const { firstName, lastName, eveningPhone, daytimePhone, birthdate, gender } = info\r\n    const isFormValid = this.isDonorIdValid(info) &&\r\n      this.isStateValid(info) &&\r\n      this.isPhoneValid(eveningPhone, false) &&\r\n      this.isPhoneValid(daytimePhone, this.props.daytimePhoneRequired) &&\r\n      this.isFirstNameValid(firstName, true) &&\r\n      this.isLastNameValid(lastName, true) &&\r\n      (this.props.isBirthDateRequired ? !!birthdate : true) &&\r\n      ((gender || \"\").trim().length > 0 || !this.props.showGenderField)\r\n\r\n    this.props.onDonorChange(info, isFormValid, this.isDonorInfoSuccess)\r\n  }\r\n\r\n  displayState = (idType?: GetRegulatoryModeDonor) => idType?.PrimaryIDType === \"DriverID\"\r\n  isStateValid = (info: DonorInformationModel = this.state) => !this.displayState(info.idTypeObj) || !!info.stateCode\r\n\r\n  allowEdit = () => {\r\n    const value = this.state.idTypeObj?.PrimaryIDType || \"\"\r\n    return value === \"DriverID\"\r\n  }\r\n\r\n  render() {\r\n    const { idTypeObj, donorId, firstName, middleInitial, lastName, eveningPhone, daytimePhone, birthdate, gender, statesLoading } = this.state\r\n    const { showIdType, showMiddleInitial, eveningPhoneLabel, daytimePhoneLabel, daytimePhoneRequired, showGenderField, validateDonorIdFormat } = this.props\r\n    const validDonorIdFormat = validateDonorIdFormat ? DonorIdRegexp.test(donorId || \"\") : true\r\n\r\n    const label = (text: string, required: boolean) => <Form.Label className={`font-weight-bold${required ? ' required' : ''}`}>{text}</Form.Label>\r\n    const idTypesOptions = () => this.props.idTypes.sort((a, b) => (a.Rank > b.Rank) ? 1 : -1).map(item => <option value={item.PrimaryIDType} key={item.PrimaryIDType}>{item.Description || item.PrimaryIDType}</option>)\r\n    return (\r\n      <Form>\r\n        <Form.Row>\r\n          <Form.Label column className=\"font-weight-bold required\">DONOR INFORMATION</Form.Label>\r\n        </Form.Row>\r\n        <Form.Row>\r\n          {showIdType && <Col xs={12} sm={4}>\r\n            <Form.Group>\r\n              {label('ID TYPE', false)}\r\n              <Form.Control as=\"select\"\r\n                disabled={this.props.completingPendingOrders}\r\n                readOnly={this.state.idReadOnly}\r\n                value={idTypeObj?.PrimaryIDType}\r\n                onChange={e => this.handleIdTypeChange(e.target.value)}\r\n                onBlur={() => this.sendDonorInformation}>\r\n                {idTypesOptions()}\r\n              </Form.Control>\r\n            </Form.Group>\r\n          </Col>}\r\n          <Col xs={12} sm={4}>\r\n            <Form.Group>\r\n              {label('DONOR ID', true)}\r\n              <InputGroup className=\"mb-3\">\r\n                <TextFormControl value={donorId}\r\n                  readOnly={this.state.idReadOnly}\r\n                  disabled={this.props.completingPendingOrders}\r\n                  maxLength={this.props.maxDonorIdLength}\r\n                  changeHandler={(value) => this.handleDonorIdChange(value)}\r\n                  isValid={() => this.props.completingPendingOrders || this.isDonorIdValid()}\r\n                  blurHandler={() => { this.sendDonorInformation(); this.onDonorSearch(); }}\r\n                  enterTapHandler={this.onDonorSearch} />\r\n                <Form.Control.Feedback className=\"order-last\" type=\"invalid\">{!validDonorIdFormat ? InvalidDonorId : InvalidDonorIdLength}</Form.Control.Feedback>\r\n                <InputGroup.Append>\r\n                  <Button className=\"btn-rounded-right\" onClick={() => this.onDonorSearch()} disabled={!donorId || this.props.completingPendingOrders}>\r\n                    {this.state.loading ? <Spinner size=\"sm\" animation=\"border\" /> : <FaSearch />}\r\n                  </Button>\r\n                </InputGroup.Append>\r\n              </InputGroup>\r\n            </Form.Group>\r\n          </Col>\r\n          <Col xs={12} sm={4}>\r\n            <Form.Group hidden={!this.displayState(idTypeObj)}>\r\n              {label('STATE OF ISSUANCE', true)}\r\n              <StateSelect\r\n                isInvalid={!this.isStateValid()}\r\n                states={this.state.states}\r\n                dropButtonIfInvalid\r\n                selected={this.state.state}\r\n                selectedCode={this.state.stateCode}\r\n                onChange={(state) => this.handleStateChange(state)} />\r\n            </Form.Group>\r\n          </Col>\r\n          {!showIdType && <Col xs={12} sm={4}></Col>}\r\n          <Col xs={12} sm={4}>\r\n            <Form.Group>\r\n              {label('FIRST NAME', true)}\r\n              <TextFormControl value={firstName}\r\n                //maxLength={20}\r\n                readOnly={this.state.firstNameReadOnly}\r\n                changeHandler={(value) => this.handleChange('firstName', value)}\r\n                isValid={() => this.isFirstNameValid(firstName, true)}\r\n                blurHandler={this.sendDonorInformation} />\r\n              <Form.Control.Feedback type=\"invalid\">{InvalidNameMessage}</Form.Control.Feedback>\r\n            </Form.Group>\r\n          </Col>\r\n          {showMiddleInitial && <Col xs={12} sm={4}>\r\n            <Form.Group>\r\n              {label('MIDDLE INITIAL', false)}\r\n              <TextFormControl value={middleInitial}\r\n                maxLength={1}\r\n                readOnly={this.state.middleInitialReadOnly || this.props.completingPendingOrders}\r\n                changeHandler={(value) => this.handleChange('middleInitial', value)}\r\n                blurHandler={this.sendDonorInformation} />\r\n            </Form.Group>\r\n          </Col>}\r\n          <Col xs={12} sm={4}>\r\n            <Form.Group>\r\n              {label('LAST NAME', true)}\r\n              <TextFormControl value={lastName}\r\n                //maxLength={20}\r\n                readOnly={this.state.lastNameReadOnly}\r\n                changeHandler={(value) => this.handleChange('lastName', value)}\r\n                isValid={() => this.isFirstNameValid(lastName, true)}\r\n                blurHandler={this.sendDonorInformation} />\r\n              <Form.Control.Feedback type=\"invalid\">{InvalidNameMessage}</Form.Control.Feedback>\r\n            </Form.Group>\r\n          </Col>\r\n          <Col xs={12} sm={6}>\r\n            <Form.Group>\r\n              {label(eveningPhoneLabel, false)}\r\n              <TextFormControl value={eveningPhone}\r\n                readOnly={this.state.homePhoneReadOnly || this.props.completingPendingOrders}\r\n                changeHandler={(value) => this.handleChange('eveningPhone', value)}\r\n                formatFunction={(value) => FormatPhone(value)}\r\n                isValid={() => this.isPhoneValid(eveningPhone, false)}\r\n                blurHandler={this.sendDonorInformation} />\r\n            </Form.Group>\r\n          </Col>\r\n          <Col xs={12} sm={6}>\r\n            <Form.Group>\r\n              {label(daytimePhoneLabel, daytimePhoneRequired)}\r\n              <TextFormControl value={daytimePhone}\r\n                readOnly={this.state.workPhoneReadOnly}\r\n                changeHandler={(value) => this.handleChange('daytimePhone', value)}\r\n                formatFunction={(value) => FormatPhone(value)}\r\n                isValid={() => this.isPhoneValid(daytimePhone, daytimePhoneRequired)}\r\n                blurHandler={this.sendDonorInformation} />\r\n            </Form.Group>\r\n          </Col>\r\n          <Col xs={12} sm={6}>\r\n            <Form.Group>\r\n              {label(\"DATE OF BIRTH\", !!this.props.isBirthDateRequired)}\r\n              <DatePicker className=\"form-control\"\r\n                ref={this.birthDateInput}\r\n                required={this.props.isBirthDateRequired}\r\n                peekNextMonth\r\n                showMonthDropdown\r\n                showYearDropdown\r\n                dropdownMode=\"select\"\r\n                maxDate={new Date()}\r\n                selected={birthdate}\r\n                enableTabLoop={false}\r\n                onKeyDown={(e) => { if (this.birthDateInput.current && (e.key === 'Tab')) { this.birthDateInput.current.setOpen(false) } }}\r\n                onChange={date => this.handleBirthDateChange(date as Date || undefined)}\r\n                customInput={<BirthdayInput required={this.props.isBirthDateRequired} />} />\r\n            </Form.Group>\r\n          </Col>\r\n          {showGenderField &&\r\n            <Col xs={12} sm={6}>\r\n              <Form.Group>\r\n                {label(\"GENDER\", true)}\r\n                <Form.Control id=\"gender\" value={gender} as=\"select\"\r\n                  disabled={this.state.genderReadOnly || this.props.completingPendingOrders}\r\n                  required\r\n                  onChange={(e: React.ChangeEvent<HTMLSelectElement>) => this.updateState({ gender: e.target.value }, true)}>\r\n                  <option value=\"\">Select</option>\r\n                  <option value=\"M\">Male</option>\r\n                  <option value=\"F\">Female</option>\r\n                </Form.Control>\r\n              </Form.Group>\r\n            </Col>\r\n          }\r\n        </Form.Row>\r\n      </Form>\r\n    )\r\n  }\r\n\r\n  static defaultProps = {\r\n    showIdType: true,\r\n    showMiddleInitial: true,\r\n    eveningPhoneLabel: 'EVENING PHONE',\r\n    daytimePhoneLabel: 'DAYTIME PHONE',\r\n    eveningPhoneField: 'HomePhone',\r\n    daytimePhoneField: 'WorkPhone',\r\n    daytimePhoneRequired: true,\r\n    showGenderField: false\r\n  }\r\n\r\n}\r\n","import {\r\n    Alabama, Alaska, Arizona, Arkansas, California, Colorado,\r\n    Connecticut, Delaware, Florida, Georgia,\r\n    Hawaii, Idaho, Illinois, Indiana, Iowa, Kansas, Kentucky, Louisiana,\r\n    Maine, Maryland, Massachusetts, Michigan, Minnesota,\r\n    Mississippi, Missouri, Montana,\r\n    Nebraska, Nevada, NewHampshire, NewJersey,\r\n    NewMexico, NewYork, NorthCarolina, NorthDakota,\r\n    Ohio, Oklahoma, Oregon, Pennsylvania,\r\n    RhodeIsland, SouthCarolina, SouthDakota,\r\n    Tennessee, Texas, Utah, Vermont, Virginia, Washington,\r\n    WestVirginia, Wisconsin, Wyoming, CommonWealthStateListing, CommonWealthState\r\n} from \"./CommonWealthState\";\r\n\r\nconst statesAbbreviationsRegx = new RegExp(\r\n    \"^(?:(A[KLRZ]|C[AOT]|D[CE]|FL|GA|HI|I[ADLN]|K[SY]|LA|M[ADEINOST]|N[CDEHJMVY]|O[HKR]|P[AR]|RI|S[CD]|T[NX]|UT|V[AIT]|W[AIVY]))$\"\r\n);\r\nconst statesFullNamesAbbreviationsRegx = new RegExp(\r\n    \"^(Alabama|Alaska|Arizona|Arkansas|California|Colorado|Connecticut|Delaware|Florida|Georgia|Hawaii|Idaho|Illinois|Indiana|Iowa|\"+\r\n    \"Kansas|Kentucky|Louisiana|Maine|Maryland|Massachusetts|Michigan|Minnesota|Mississippi|Missouri|Montana|Nebraska|\"+\r\n    \"Nevada|New\\\\sHampshire|New\\\\sJersey|New\\\\sMexico|New\\\\sYork|North\\\\sCarolina|North\\\\sDakota|Ohio|Oklahoma|Oregon|\"+\r\n    \"Pennsylvania|Rhode\\\\sIsland|South\\\\sCarolina|South\\\\sDakota|Tennessee|Texas|Utah|Vermont|Virginia|Washington|\" +\r\n    \"West\\\\sVirginia|Wisconsin|Wyoming)$\", \"i\"\r\n);\r\nexport default function FindCommonWealthStatesInText(text: string): CommonWealthState[]{\r\n    let statesFound: CommonWealthState[] = [];\r\n    text.toUpperCase().split(\",\").map( (value: string) => {\r\n            let trimmedInput  = value.trim();\r\n            if(statesFullNamesAbbreviationsRegx.test(trimmedInput)){\r\n                const stateFound = CommonWealthStateListing.filter((y: string) => y == trimmedInput);\r\n                if(stateFound.length > 0) {\r\n                    statesFound.push(stateFound[0]);\r\n                }\r\n            }\r\n            else if(statesAbbreviationsRegx.test(value)){\r\n                statesFound.push(stateAbbreviationsToCommonWealthState[trimmedInput]);\r\n            }\r\n        }\r\n    )\r\n    return statesFound;\r\n}\r\n\r\nexport const stateAbbreviationsToCommonWealthState: {[key: string]: CommonWealthState} = {\r\n    \"AL\":Alabama,\r\n    \"AK\": Alaska,\r\n    \"AZ\": Arizona,\r\n    \"AR\": Arkansas,\r\n    \"CA\": California,\r\n    \"CO\": Colorado,\r\n    \"CT\": Connecticut,\r\n    \"DE\": Delaware,\r\n    \"FL\": Florida,\r\n    \"GA\": Georgia,\r\n    \"HI\": Hawaii,\r\n    \"ID\": Idaho,\r\n    \"IL\": Illinois,\r\n    \"IN\": Indiana,\r\n    \"IA\": Iowa,\r\n    \"KS\": Kansas,\r\n    \"KY\": Kentucky,\r\n    \"LA\": Louisiana,\r\n    \"ME\": Maine,\r\n    \"MD\": Maryland,\r\n    \"MA\": Massachusetts,\r\n    \"MI\": Michigan,\r\n    \"MN\": Minnesota,\r\n    \"MS\": Mississippi,\r\n    \"MO\": Missouri,\r\n    \"MT\": Montana,\r\n    \"NE\": Nebraska,\r\n    \"NV\": Nevada,\r\n    \"NH\": NewHampshire,\r\n    \"NJ\": NewJersey,\r\n    \"NM\": NewMexico,\r\n    \"NY\": NewYork,\r\n    \"NC\": NorthCarolina,\r\n    \"ND\": NorthDakota,\r\n    \"OH\": Ohio,\r\n    \"OK\": Oklahoma,\r\n    \"OR\": Oregon,\r\n    \"PA\": Pennsylvania,\r\n    \"RI\": RhodeIsland,\r\n    \"SC\": SouthCarolina,\r\n    \"SD\": SouthDakota,\r\n    \"TN\": Tennessee,\r\n    \"TX\": Texas,\r\n    \"UT\": Utah,\r\n    \"VT\": Vermont,\r\n    \"VA\": Virginia,\r\n    \"WA\": Washington,\r\n    \"WV\": WestVirginia,\r\n    \"WI\": Wisconsin,\r\n    \"WY\": Wyoming,\r\n}\r\nexport type TimeZone = \"CST\" | \"AKST\" | \"MST\" | \"HST\" | \"EDT\" | \"PST\";\r\nexport const StateToTimeZone: {[key in CommonWealthState]: TimeZone} = {\r\n    Alabama: \"CST\",\r\n    Alaska: \"AKST\",\r\n    Arizona: \"MST\",\r\n    Arkansas: \"CST\",\r\n    California: \"PST\",\r\n    Colorado: \"MST\",\r\n    Connecticut: \"EDT\",\r\n    Delaware: \"EDT\",\r\n    Florida: \"EDT\",\r\n    Georgia: \"EDT\",\r\n    Hawaii: \"HST\",\r\n    Idaho: \"MST\",\r\n    Illinois: \"CST\",\r\n    Indiana: \"EDT\",\r\n    Iowa: \"CST\",\r\n    Kansas: \"CST\",\r\n    Kentucky: \"EDT\",\r\n    Louisiana: \"CST\",\r\n    Maine: \"EDT\",\r\n    Maryland: \"EDT\",\r\n    Massachusetts: \"EDT\",\r\n    Michigan: \"CST\",\r\n    Minnesota: \"CST\",\r\n    Mississippi: \"CST\",\r\n    Missouri: \"CST\",\r\n    Montana: \"MST\",\r\n    Nebraska: \"CST\",\r\n    Nevada: \"PST\",\r\n    NewHampshire: \"EDT\",\r\n    NewJersey: \"EDT\",\r\n    NewMexico: \"MST\",\r\n    NewYork: \"EDT\",\r\n    NorthCarolina: \"EDT\",\r\n    NorthDakota: \"CST\",\r\n    Ohio: \"EDT\",\r\n    Oklahoma: \"CST\",\r\n    Oregon: \"PST\",\r\n    Pennsylvania: \"EDT\",\r\n    RhodeIsland: \"EDT\",\r\n    SouthCarolina: \"EDT\",\r\n    SouthDakota: \"CST\",\r\n    Tennessee: \"EDT\",\r\n    Texas: \"CST\",\r\n    Utah: \"MST\",\r\n    Vermont: \"EDT\",\r\n    Virginia: \"EDT\",\r\n    Washington: \"PST\",\r\n    WestVirginia: \"EDT\",\r\n    Wisconsin: \"CST\",\r\n    Wyoming: \"MST\"\r\n}\r\n","export const Alabama = \"Alabama\";\r\nexport const Alaska = \"Alaska\";\r\nexport const Arizona = \"Arizona\";\r\nexport const Arkansas = \"Arkansas\";\r\nexport const California = \"California\";\r\nexport const Colorado = \"Colorado\";\r\nexport const Connecticut = \"Connecticut\";\r\nexport const Delaware = \"Delaware\";\r\nexport const Florida = \"Florida\";\r\nexport const Georgia = \"Georgia\";\r\nexport const Hawaii = \"Hawaii\";\r\nexport const Idaho = \"Idaho\";\r\nexport const Illinois = \"Illinois\";\r\nexport const Indiana = \"Indiana\";\r\nexport const Iowa = \"Iowa\";\r\nexport const Kansas = \"Kansas\";\r\nexport const Kentucky = \"Kentucky\";\r\nexport const Louisiana = \"Louisiana\";\r\nexport const Maine = \"Maine\";\r\nexport const Maryland = \"Maryland\";\r\nexport const Massachusetts = \"Massachusetts\";\r\nexport const Michigan = \"Michigan\";\r\nexport const Minnesota = \"Minnesota\";\r\nexport const Mississippi = \"Mississippi\";\r\nexport const Missouri = \"Missouri\";\r\nexport const Montana = \"Montana\";\r\nexport const Nebraska = \"Nebraska\";\r\nexport const Nevada = \"Nevada\";\r\nexport const NewHampshire = \"NewHampshire\";\r\nexport const NewJersey = \"NewJersey\";\r\nexport const NewMexico = \"NewMexico\";\r\nexport const NewYork = \"NewYork\";\r\nexport const NorthCarolina = \"NorthCarolina\";\r\nexport const NorthDakota = \"NorthDakota\";\r\nexport const Ohio = \"Ohio\";\r\nexport const Oklahoma = \"Oklahoma\";\r\nexport const Oregon = \"Oregon\";\r\nexport const Pennsylvania = \"Pennsylvania\";\r\nexport const RhodeIsland = \"RhodeIsland\";\r\nexport const SouthCarolina = \"SouthCarolina\";\r\nexport const SouthDakota = \"SouthDakota\";\r\nexport const Tennessee = \"Tennessee\";\r\nexport const Texas = \"Texas\";\r\nexport const Utah = \"Utah\";\r\nexport const Vermont = \"Vermont\";\r\nexport const Virginia = \"Virginia\";\r\nexport const Washington = \"Washington\";\r\nexport const WestVirginia = \"WestVirginia\";\r\nexport const Wisconsin = \"Wisconsin\";\r\nexport const Wyoming = \"Wyoming\";\r\nexport type CommonWealthState = \"Alabama\" | \"Alaska\" | \"Arizona\" | \"Arkansas\" | \"California\" | \"Colorado\" | \"Connecticut\" | \"Delaware\" | \"Florida\" | \"Georgia\" | \"Hawaii\" | \"Idaho\" | \"Illinois\" | \"Indiana\" | \"Iowa\" | \"Kansas\" | \"Kentucky\" | \"Louisiana\" | \"Maine\" | \"Maryland\" | \"Massachusetts\" | \"Michigan\" | \"Minnesota\" | \"Mississippi\" | \"Missouri\" | \"Montana\" | \"Nebraska\" | \"Nevada\" | \"NewHampshire\" | \"NewJersey\" | \"NewMexico\" | \"NewYork\" | \"NorthCarolina\" | \"NorthDakota\" | \"Ohio\" | \"Oklahoma\" | \"Oregon\" | \"Pennsylvania\" | \"RhodeIsland\" | \"SouthCarolina\" | \"SouthDakota\" | \"Tennessee\" | \"Texas\" | \"Utah\" | \"Vermont\" | \"Virginia\" | \"Washington\" | \"WestVirginia\" | \"Wisconsin\" | \"Wyoming\";\r\nexport const CommonWealthStateListing:CommonWealthState[] = [\"Alabama\" , \"Alaska\" , \"Arizona\" , \"Arkansas\" , \"California\" , \"Colorado\" , \"Connecticut\" , \"Delaware\" , \"Florida\" , \"Georgia\" , \"Hawaii\" , \"Idaho\" , \"Illinois\" , \"Indiana\" , \"Iowa\" , \"Kansas\" , \"Kentucky\" , \"Louisiana\" , \"Maine\" , \"Maryland\" , \"Massachusetts\" , \"Michigan\" , \"Minnesota\" , \"Mississippi\" , \"Missouri\" , \"Montana\" , \"Nebraska\" , \"Nevada\" , \"NewHampshire\" , \"NewJersey\" , \"NewMexico\" , \"NewYork\" , \"NorthCarolina\" , \"NorthDakota\" , \"Ohio\" , \"Oklahoma\" , \"Oregon\" , \"Pennsylvania\" , \"RhodeIsland\" , \"SouthCarolina\" , \"SouthDakota\" , \"Tennessee\" , \"Texas\" , \"Utah\" , \"Vermont\" , \"Virginia\" , \"Washington\" , \"WestVirginia\" , \"Wisconsin\" , \"Wyoming\"];\r\n","export const TimeZoneMapping: {[key: string]: string} = {\r\n  \"CST\": \"America/Chicago\",\r\n  \"AKST\": \"America/Anchorage\",\r\n  \"MST\": \"America/Denver\",\r\n  \"HST\": \"Pacific/Honolulu\",\r\n  \"EDT\": \"America/New_York\",\r\n  \"PST\": \"America/Los_Angeles\"\r\n}\r\n\r\nexport interface DateStrings {\r\n  formattedDate: string\r\n  gmtFullDate: string\r\n  gmtShortDate: string\r\n}\r\n\r\nexport default function CalculateDateStrings(date: Date, timezoneCode: string | undefined): DateStrings {\r\n  const result: DateStrings = {\r\n    formattedDate: \"\",\r\n    gmtFullDate: \"\",\r\n    gmtShortDate: \"\"\r\n  }\r\n  const timezone = timezoneCode ? TimeZoneMapping[timezoneCode] : undefined\r\n\r\n  const timezoneDateString = date.toLocaleString(\"en-US\", { timeZone: timezone })\r\n  const timezoneDate = new Date(timezoneDateString)\r\n\r\n  const diff = Math.round((timezoneDate.getTime() - date.getTime()) / (1000 * 60 * 60)) // in hours\r\n  const localOffset = Math.round(new Date(date).getTimezoneOffset() / 60) // local offset in hours\r\n  const offset = diff - localOffset //time zone offset in hours\r\n\r\n  const sign = Math.sign(offset) === -1 ? \"-\" : \"+\";\r\n\r\n  const dt = new Date(timezoneDate.getTime() - localOffset * 60 * 60 * 1000)\r\n  result.formattedDate = `${dt.toISOString().replace(\"Z\", \"\")}${sign}${Math.abs(offset).toString().padStart(2, \"0\")}:00`\r\n\r\n  const userDate = timezoneDate.toLocaleString(\"en-US\", { month: \"long\", day: \"numeric\", year: 'numeric', hour: \"numeric\", minute: \"numeric\" })\r\n  result.gmtFullDate = `${userDate} GMT${sign}${Math.abs(offset)}`\r\n\r\n  const shortDate = timezoneDate.toLocaleString(\"en-US\" , { month: \"2-digit\", day: \"2-digit\", year: '2-digit', hour: \"numeric\", minute: \"2-digit\" }).replace(\",\", \"\")\r\n  result.gmtShortDate = `${shortDate} GMT${sign}${Math.abs(offset)}`\r\n\r\n  return result\r\n}\r\n","import React, { Component } from \"react\"\r\nimport { Form } from \"react-bootstrap\"\r\nimport DatePicker from \"react-datepicker\"\r\nimport CalculateDateStrings from \"./OrderRequests/CalculateDateStrings\"\r\n\r\ninterface ExpirationDateProps {\r\n  expirationDate: Date | undefined\r\n  disabled?: boolean\r\n  timezone: string | undefined\r\n  onChange(date: Date | [Date, Date] | null): void\r\n}\r\n\r\ninterface ExpirationDateState {\r\n  expirationDate: Date | undefined\r\n}\r\n\r\nexport default class ExpirationDate extends Component<ExpirationDateProps, ExpirationDateState> {\r\n  state: ExpirationDateState = { expirationDate: undefined }\r\n  datePickerRef = React.createRef<DatePicker>()\r\n\r\n  componentDidUpdate(prevProps: Readonly<ExpirationDateProps>) {\r\n    if (this.props.expirationDate !== prevProps.expirationDate) {\r\n      this.setState({ expirationDate: this.props.expirationDate })\r\n    }\r\n  }\r\n\r\n  addHoursToCurrentDate = (hours: number) => {\r\n    const newDate = new Date()\r\n    newDate.setHours(newDate.getHours() + hours)\r\n    return newDate\r\n  }\r\n\r\n  onChangeDate = (date: Date | [Date, Date] | null) => {\r\n    this.setState({ expirationDate: date as Date || undefined })\r\n    this.props.onChange(date)\r\n  }\r\n\r\n  render() {\r\n    const { expirationDate } = this.state\r\n    const displayExpirationDate = expirationDate ? CalculateDateStrings(expirationDate, this.props.timezone).gmtShortDate : \"\"\r\n\r\n    return <>\r\n      <DatePicker className=\"form-control\"\r\n        ref={this.datePickerRef}\r\n        peekNextMonth\r\n        showMonthDropdown\r\n        showYearDropdown\r\n        dropdownMode=\"select\"\r\n        minDate={new Date()}\r\n        maxDate={this.addHoursToCurrentDate(2160)}\r\n        selected={this.state.expirationDate as Date}\r\n        enableTabLoop={false}\r\n        timeInputLabel=\"Time:\"\r\n        dateFormat=\"MM/dd/yyyy h:mm aa\"\r\n        showTimeInput\r\n        disabled={!!this.props.disabled}\r\n        onKeyDown={(e) => { if (this.datePickerRef && this.datePickerRef.current && e.key === 'Tab') { this.datePickerRef.current.setOpen(false) } }}\r\n        onChange={this.onChangeDate} />\r\n    </>\r\n  }\r\n}\r\n","import React, { ChangeEvent, Component } from 'react'\r\nimport { Form, Col } from 'react-bootstrap'\r\nimport { ScheduleModel } from './OrderModels'\r\nimport CollectionSite from \"../../api/Location/LocationModel/CollectionSite\"\r\nimport { stateAbbreviationsToCommonWealthState, StateToTimeZone } from \"../../api/Location/LocationModel/CommonWealthStateTextMapping\"\r\nimport Checkbox from '../Checkbox'\r\nimport { OrderDefault } from '../../api/Administration/OrderDefaults'\r\nimport CalculateDateStrings from './CalculateDateStrings'\r\nimport ExpirationDate from '../ExpirationDate'\r\n\r\nexport interface ScheduleProps {\r\n  allowDonorSelect: boolean,\r\n  schedule: ScheduleModel,\r\n  clinic?: CollectionSite,\r\n  defaultExpiration?: OrderDefault\r\n  onScheduleChange: (schedule: ScheduleModel) => void\r\n}\r\nexport const DefaultExtendExpirationHours: number = 24\r\nconst DefaultExtendExpirationMS: number = DefaultExtendExpirationHours * 60 * 60 * 1000\r\nconst ExpirationDateChangeMarker = -999999999\r\nexport default class Schedule extends Component<ScheduleProps> {\r\n  // TODO: Change to get date from clinic's coordinates\r\n  //\r\n  // Current implementation of Timezone and Estimated Expiration Date calculation is a sample\r\n  // implementation and relies on browser local datetime because we cannot obtain local time of\r\n  // selected clinic due to blocker described in GitHub issue #5 (https://github.com/chcinc1/web-crl-workforce/issues/5)\r\n  //\r\n  state: ScheduleModel = { ...this.props.schedule }\r\n\r\n  handleOverrideAllowedChange = (e: ChangeEvent<HTMLInputElement>) => {\r\n    this.updateState({ \r\n      overrideAllowed: e.target.checked,\r\n      extendExpirationHours: e.target.checked ? e.target.value : 0,\r\n    }, true)\r\n  }\r\n\r\n  handleHoursToExpireChange = (value: string) => {\r\n    var r = value.replace(/\\D/g, \"\") // Only digits\r\n    r = r.length > 3 ? r.slice(0, 3) : r // Maxlength 3 digits\r\n    this.updateState({\r\n      hoursUntilExpires: !!r ? +r : undefined\r\n    })\r\n  }\r\n\r\n  handleChange = (name: string, value: string) => {\r\n    this.updateState({ [name]: value })\r\n  }\r\n\r\n  updateState = (changes: object, sendSchedule: boolean = false) => {\r\n    this.setState((prevState) => { return { ...prevState, ...changes } }, () => { if (sendSchedule) { this.sendSchedule() } })\r\n  }\r\n\r\n  sendSchedule = () => {\r\n    this.props.onScheduleChange(this.state)\r\n  }\r\n\r\n  calculateExpirationDate = (prevExpirationDate: Date | undefined, expirationHours: number = 0) => {\r\n    const estimatedExpiration = prevExpirationDate || new Date()\r\n    let expirationMS: number = 0\r\n    if (expirationHours !== ExpirationDateChangeMarker) {\r\n      expirationMS = expirationHours * 60 * 60 * 1000\r\n    }\r\n    if (this.state.overrideAllowed) {\r\n      expirationMS = expirationMS + DefaultExtendExpirationMS\r\n    }\r\n    else {\r\n      if (expirationHours === 0) {\r\n        expirationMS = expirationMS - DefaultExtendExpirationMS\r\n      }\r\n    }\r\n    const expirationDate = expirationMS !== 0\r\n      ? new Date(estimatedExpiration.getTime() + expirationMS)\r\n      : prevExpirationDate\r\n\r\n    let formattedExpirationDate = \"\"\r\n    let displayExpirationDate = \"\"\r\n\r\n    if (expirationDate) {\r\n      const dateStrings = CalculateDateStrings(expirationDate, this.state.timezone || \"\")\r\n      formattedExpirationDate = dateStrings.formattedDate\r\n      displayExpirationDate = dateStrings.gmtFullDate\r\n    }\r\n\r\n    this.updateState({ expirationDate: expirationDate, formattedExpirationDate, displayExpirationDate }, true)\r\n  }\r\n\r\n  initializeTimezone = () => {\r\n    this.updateTimeZone(this.props.clinic)\r\n  }\r\n\r\n  componentDidMount() {\r\n    this.initializeTimezone()\r\n  }\r\n\r\n  componentDidUpdate(prevProps: ScheduleProps) {\r\n    if (prevProps.clinic !== this.props.clinic) {\r\n      this.updateTimeZone(this.props.clinic)\r\n    }\r\n    const defaultExpirationHours = +(this.props.defaultExpiration?.DefaultValue || 0)\r\n    if (prevProps.schedule.timezone !== this.props.schedule.timezone) {\r\n      this.calculateExpirationDate(new Date(), defaultExpirationHours)\r\n    }\r\n\r\n    let prevOrderDefaultId = prevProps.defaultExpiration?.OrderDefaultID || 0\r\n    let propsOrderDefaultId = this.props.defaultExpiration?.OrderDefaultID || 0\r\n    if ((prevOrderDefaultId !== propsOrderDefaultId) || (prevProps.allowDonorSelect !== this.props.allowDonorSelect)) {\r\n      this.handleHoursToExpireChange(this.props.defaultExpiration?.DefaultValue || \"\")\r\n      this.calculateExpirationDate(new Date(), defaultExpirationHours)\r\n    }\r\n\r\n    if (prevProps.schedule.overrideAllowed !== this.props.schedule.overrideAllowed) {\r\n      this.calculateExpirationDate(this.props.schedule.expirationDate, 0)\r\n    }\r\n  }\r\n\r\n  updateTimeZone = (clinic?: CollectionSite) => {\r\n    let timezone = undefined\r\n    if (clinic?.State) {\r\n      const state = stateAbbreviationsToCommonWealthState[clinic?.State]\r\n      timezone = clinic.TimeZone || StateToTimeZone[state]\r\n    }\r\n    this.updateState({ timezone: timezone }, true)\r\n  }\r\n\r\n  proceedImmediatelyChange = (e: ChangeEvent<HTMLInputElement>) => {\r\n    const enabled = !!e.target.checked\r\n    this.updateState({ proceedImmediately: enabled }, true)\r\n  }\r\n\r\n  render() {\r\n    const { expirationDate, overrideAllowed, comment, timezone, proceedImmediately } = this.state\r\n    return (\r\n      <>\r\n        <Form className=\"py-2\" hidden={!this.props.clinic && !this.props.allowDonorSelect}>\r\n          <Form.Row>\r\n            <Form.Label column className=\"font-weight-bold\">SCHEDULE</Form.Label>\r\n          </Form.Row>\r\n          {this.props.clinic && <Form.Row>\r\n            <Col xs={12} sm={3}>\r\n              <Form.Label className=\"font-weight-bold\">Clinic Time Zone</Form.Label>\r\n              <Form.Control type=\"text\" readOnly={true} value={timezone || ''} />\r\n            </Col>\r\n          </Form.Row>}\r\n          {/*<Form.Row>\r\n            <Col xs={12} sm={6} md={3}>\r\n              <Checkbox id=\"proceedImmediately\" label=\"Hide Expiration Date\" className=\"font-weight-bold\" checked={proceedImmediately} onChange={(e) => { this.proceedImmediatelyChange(e) }} />\r\n            </Col>\r\n          </Form.Row>*/}\r\n          {!proceedImmediately && <Form.Row>\r\n            <Col xs={12} sm={6} md={3}>\r\n              <Form.Label className=\"font-weight-bold\">Expiration Date</Form.Label>\r\n              <ExpirationDate expirationDate={expirationDate as Date} timezone={timezone} onChange={date => this.calculateExpirationDate(date as Date || undefined, ExpirationDateChangeMarker)} />\r\n            </Col>\r\n            <Col xs={12} sm={6} md={3}>\r\n              <Checkbox \r\n                id=\"override_allowed\"\r\n                label=\"Extend Expiration by 24 Hours\"\r\n                className=\"font-weight-bold\"\r\n                value='24'\r\n                checked={overrideAllowed}\r\n                onChange={this.handleOverrideAllowedChange}\r\n              />\r\n            </Col>\r\n          </Form.Row>}\r\n          <Form.Row>\r\n            <Col xs={12} sm={6}>\r\n              <Form.Label className=\"font-weight-bold\">COMMENTS TO SITE</Form.Label>\r\n              <Form.Control as=\"textarea\"\r\n                rows={3}\r\n                value={comment}\r\n                onChange={e => this.handleChange('comment', e.target.value)}\r\n                onBlur={() => this.sendSchedule()} />\r\n            </Col>\r\n          </Form.Row>\r\n        </Form>\r\n      </>\r\n    )\r\n  }\r\n}\r\n","import { Observable } from \"rxjs\";\r\nimport { ObservableFromFetch } from \"../ObservableFromFetch\"\r\nimport Address from \"./LocationModel/Address\";\r\n\r\nexport default function LocationQueryGetObservable(query: string): Observable<Address[]> {\r\n  const requestBody: string = JSON.stringify({ AutoCompleteString: query })\r\n  return ObservableFromFetch<Address[]>(\"Order/SmartyStreetsAutoComplete\", requestBody)\r\n}\r\n","import { Component, createRef } from \"react\"\r\nimport { InputGroup, Button, Spinner } from \"react-bootstrap\"\r\nimport { BehaviorSubject, Subscription, of, concat } from \"rxjs\"\r\nimport { catchError, debounceTime, filter, map, switchMap, tap } from \"rxjs/operators\"\r\nimport { AsyncTypeahead } from \"react-bootstrap-typeahead\"\r\nimport { FaSearch } from \"react-icons/fa\"\r\nimport LocationQueryGet from \"../../api/Location/LocationQueryGet\"\r\nimport Address from \"../../api/Location/LocationModel/Address\"\r\n\r\nexport interface AddressSearchProps {\r\n  onSearch: (query: string | undefined) => void\r\n  isSearching: boolean\r\n  disabledSearch: boolean\r\n  defaultAddress?: string,\r\n  disableSuggestions?: boolean\r\n  isSSO: boolean\r\n  defaultSearchCompleted?: boolean\r\n}\r\n\r\ninterface AddressSearchState {\r\n  options: Address[],\r\n  selectedOption?: Address,\r\n  isOptionsLoading: boolean\r\n  defaultAddressInitialized: boolean\r\n}\r\n\r\nexport default class AddressSearch extends Component<AddressSearchProps, AddressSearchState> {\r\n  state: AddressSearchState = {\r\n    options: [],\r\n    isOptionsLoading: false,\r\n    defaultAddressInitialized: (this.props.defaultAddress || \"\") === \"\"\r\n  }\r\n  searchQuery: string = \"\"\r\n  typeahead = createRef<AsyncTypeahead<Address>>()\r\n  addressesQuery$?: BehaviorSubject<string>\r\n  addressesSubscription?: Subscription\r\n\r\n  componentDidMount() {\r\n    this.addressesQuery$ = new BehaviorSubject<string>(this.props.defaultAddress || \"\")\r\n    this.addressesSubscription = this.addressesQuery$.pipe(\r\n      debounceTime(500),\r\n      filter(query => (query ?? \"\").trim().length > 0),\r\n      switchMap((query) => concat(\r\n        of({ isOptionsLoading: true }),\r\n        LocationQueryGet(query).pipe(\r\n          map((options) => ({ isOptionsLoading: false, options: options })),\r\n          catchError(() => of({ isOptionsLoading: false }))\r\n        )\r\n      ))\r\n    ).subscribe(\r\n      (state: { isOptionsLoading: boolean, options?: Address[] }) => {\r\n        state.options ?\r\n          this.setState({ isOptionsLoading: state.isOptionsLoading, options: state.options }) :\r\n          this.setState({ isOptionsLoading: state.isOptionsLoading })\r\n\r\n          if (!this.state.defaultAddressInitialized && !state.isOptionsLoading) {\r\n            this.setState({ defaultAddressInitialized: true })\r\n            if (state?.options?.length) {\r\n              this.setState({ selectedOption: state?.options[0] },\r\n                () => this.performSearch(undefined, this.props.defaultSearchCompleted)\r\n              )\r\n            }\r\n            else {\r\n              if (this.props.isSSO) {\r\n                this.setState({ selectedOption: {Text: this.props.defaultAddress} },\r\n                  () => this.performSearch(undefined, this.props.defaultSearchCompleted)\r\n                )\r\n              }\r\n            }\r\n          }\r\n      },\r\n      () => this.setState({ isOptionsLoading: false })\r\n    )\r\n  }\r\n\r\n  componentWillUnmount() {\r\n    this.addressesSubscription && this.addressesSubscription.unsubscribe()\r\n  }\r\n\r\n  performSearch = (selected?: Address, skipOnSearch: boolean = false) => {\r\n    let address = selected || this.selectedPrediction() || this.state.selectedOption\r\n    let query = address ? address.Text : this.searchQuery\r\n\r\n    this.typeahead.current?.blur()\r\n    if (!skipOnSearch) {\r\n      this.props.onSearch(query)\r\n    }\r\n  }\r\n\r\n  selectedPrediction = (): Address | null => {\r\n    // We have to know whether some prediction is under focus because Typeahead component shows prediction under focus inside input box.\r\n    // It looks like to the user as he just typed this text and it forces user to think that\r\n    // if he clicks on Search button then it will search by that text.\r\n    const { activeItem } = this.typeahead.current?.state as { activeItem: Address | null }\r\n    return activeItem\r\n  }\r\n\r\n  render() {\r\n    return (\r\n      <InputGroup>\r\n        <AsyncTypeahead\r\n          id=\"addressSearch\"\r\n          labelKey={option => option.Text || \"\"}\r\n          emptyLabel=\"No Result Found\"\r\n          minLength={3}\r\n          placeholder=\"City and State or Zip or FF Site ID\"\r\n          promptText=\"City and State or Zip or FF Site ID\"\r\n          isLoading={this.state.isOptionsLoading}\r\n          onSearch={(query) => !this.props.disableSuggestions && this.addressesQuery$ && this.addressesQuery$.next(query)}\r\n          open={!!this.props.disableSuggestions ? false : undefined}\r\n          options={this.state.options}\r\n          filterBy={() => true}\r\n          ref={this.typeahead}\r\n          onInputChange={input => this.searchQuery = input}\r\n          onKeyDown={(e: Event) => {\r\n            if (e.type === \"keydown\" && (e as KeyboardEvent).key === \"Enter\") {\r\n              // Start search on Enter only if no any selections in prompted items\r\n              // If any prompt item is selected then search will be initiated via onChange event\r\n              !this.selectedPrediction() && this.performSearch()\r\n            }\r\n          }}\r\n          onChange={selected => {\r\n            this.setState({ selectedOption: selected[0] })\r\n            // Start search only if an option has been selected\r\n            selected[0] && this.performSearch(selected[0])\r\n          }}\r\n          selected={this.state.selectedOption ? [this.state.selectedOption] : []} />\r\n        <InputGroup.Append>\r\n          <Button\r\n            variant=\"secondary\"\r\n            className=\"btn-rounded-right\"\r\n            disabled={this.props.isSearching || this.props.disabledSearch}\r\n            onClick={() => {\r\n              const selectedPrediction = this.selectedPrediction()\r\n              if (selectedPrediction) {\r\n                // Set prediction in focus as selected.\r\n                this.setState({ selectedOption: selectedPrediction })\r\n                this.performSearch(selectedPrediction)\r\n              } else {\r\n                this.performSearch()\r\n              }\r\n            }}>\r\n            {this.props.isSearching && <Spinner animation=\"border\" size=\"sm\" />}\r\n            {!this.props.isSearching && <FaSearch />}\r\n          </Button>\r\n        </InputGroup.Append>\r\n      </InputGroup>\r\n    )\r\n  }\r\n\r\n  static defaultProps = {\r\n    disableSuggestions: true,\r\n    defaultSearchCompleted: true,\r\n  }\r\n}\r\n","import { ChangeEvent, Component } from \"react\"\r\nimport { Col, Form, Button, Image } from \"react-bootstrap\"\r\nimport ClinicSearchOptions from \"../../api/Clinics/Models/ClinicSearchOptions\"\r\nimport CollectionSite from \"../../api/Location/LocationModel/CollectionSite\"\r\nimport clearFiltersIcon from \"../../assets/images/clear-filters.png\"\r\nimport ClinicSearchPrice from \"../../api/Clinics/Models/ClinicSearchPrice\"\r\n\r\ntype FilterFunction = (site: CollectionSite) => boolean\r\n\r\nexport interface FilterProps {\r\n  sites: CollectionSite[]\r\n  radius: number\r\n  clinicSearchOptions?: ClinicSearchOptions\r\n  priceTiers?: ClinicSearchPrice[]\r\n  filter?: FilterFunction\r\n  onRadiusChanged: (radius: number) => void\r\n  onFilterChanged: (filter?: FilterFunction) => void\r\n}\r\n\r\nconst DEFAULT_MIN_RADIUS = 15\r\nconst DEFAULT_MAX_RADIUS = 50\r\n\r\nexport default class Filter extends Component<FilterProps> {\r\n\r\n  handleRadiusChange = (e: ChangeEvent<HTMLInputElement>) => this.props.onRadiusChanged(parseInt(e.target.value) as number)\r\n\r\n  getFilters() {\r\n    if (this.props.sites.length === 0 ) return []\r\n    const result = [\r\n      { name: \"Primary\", filter: (site: CollectionSite) => site.GroupName === \"Primary\" || site.GroupName === \"Favorite\" },\r\n    ]\r\n    const sites = this.props.sites.map(item => {\r\n      const newSite = {...item}\r\n      newSite.PriceTier = item.IsMarketPlace ? item.PriceTier : \"\"\r\n      return newSite\r\n    })\r\n\r\n    if (this.props.priceTiers) {\r\n      this.props.priceTiers.forEach(pt => {\r\n        const existsTier = sites.some(item => item.PriceTier === pt.Name)\r\n        if (existsTier) {\r\n          result.push({\r\n            name: pt.DisplayName || pt.Name,\r\n            filter: (site: CollectionSite) => site.PriceTier?.toLowerCase() === pt.Name.toLowerCase()\r\n          })\r\n        }\r\n      })\r\n    }\r\n\r\n    result.push({ name: \"Non MarketPlace\", filter: (site: CollectionSite) => site.GroupName === \"NonMarketplace\" })\r\n\r\n    return result\r\n  }\r\n  \r\n  render() {\r\n    const minRadius = this.props.clinicSearchOptions?.SearchRadius1 || DEFAULT_MIN_RADIUS\r\n    const maxRadius = this.props.clinicSearchOptions?.SearchRadius2 || DEFAULT_MAX_RADIUS\r\n\r\n    const filters = this.getFilters()\r\n    return (\r\n      <Form className=\"site-search-filter\">\r\n        <Form.Row>\r\n          <Col>\r\n            <Form.Label className=\"secondary font-weight-bold\">Radius</Form.Label>\r\n            <Form.Check type=\"radio\" name=\"radius\" id=\"radius-min\" className=\"abc-radio\" value={minRadius} label={`Min Radius (${minRadius} Miles)`} checked={this.props.radius === minRadius} onChange={(e: ChangeEvent<HTMLInputElement>) => this.props.onRadiusChanged(parseInt(e.target.value) as number)} />\r\n            <Form.Check type=\"radio\" name=\"radius\" id=\"radius-max\" className=\"abc-radio\" value={maxRadius} label={`Max Radius (${maxRadius} Miles)`} checked={this.props.radius === maxRadius} onChange={(e: ChangeEvent<HTMLInputElement>) => this.props.onRadiusChanged(parseInt(e.target.value) as number)} />\r\n          </Col>\r\n        </Form.Row>\r\n        {filters.length > 0 && <Form.Row>\r\n          <Col xs={9} className=\"secondary py-2 font-weight-bold\">Filter</Col>\r\n          <Col xs={3}>\r\n            <Button variant=\"icon-link\" className=\"w-100\" onClick={() => this.props.onFilterChanged(undefined)}>\r\n              <Image src={clearFiltersIcon} title=\"Clear Filter\" width={17} height={17} />\r\n            </Button>\r\n          </Col>\r\n        </Form.Row>}\r\n        {filters.map(filter => {\r\n          return (\r\n            <Form.Row key={filter.name} className={this.props.filter && this.props.filter === filter.filter ? \"selected\" : \"\"}>\r\n              <Col xs={9}>\r\n                <Button variant=\"underline-link\" className=\"px-0 mx-0\" onClick={() => this.props.onFilterChanged(filter.filter)}>{filter.name}</Button>\r\n              </Col>\r\n              <Col xs={3} className=\"py-2 text-center\">\r\n                  {this.props.sites.filter(site => filter.filter(site)).length.toString()}\r\n              </Col>\r\n            </Form.Row>)\r\n        })}\r\n      </Form>\r\n    )\r\n  }\r\n}\r\n","import React, { Component } from \"react\"\r\nimport { Col, Button, Image, Container, Row } from \"react-bootstrap\"\r\nimport CollectionSite from \"../../api/Location/LocationModel/CollectionSite\"\r\nimport clinicIcons_FFEnabled from \"../../assets/images/clinic-icons_formfox-enabled.png\"\r\nimport clinicIcons_NotFFEnabled from \"../../assets/images/clinic-icons_not-formfox-enabled.png\"\r\nimport clinicIcons_Marketplace from \"../../assets/images/clinic-icons_marketplace.png\"\r\nimport priceTier_Silver from \"../../assets/images/seal-icons_silver.png\"\r\nimport priceTier_Gold from \"../../assets/images/seal-icons_gold.png\"\r\nimport priceTier_Platinum from \"../../assets/images/seal-icons_platinum.png\"\r\nimport priceTier_GoldPlus from \"../../assets/images/seal-icons_goldplus.png\"\r\nimport clinicRating_3Stars from \"../../assets/images/price-icons_3-star.png\"\r\nimport clinicRating_4Stars from \"../../assets/images/price-icons_4-star.png\"\r\nimport clinicRating_5Stars from \"../../assets/images/price-icons_5-star.png\"\r\nimport { FaChevronUp, FaChevronDown } from \"react-icons/fa\"\r\nimport FormatPhone from \"../../formatters/FormatPhone\"\r\nimport SiteService from \"../../api/Location/LocationModel/SiteService\"\r\nimport { SiteServices } from \"./SiteServices\"\r\n\r\ninterface ImagesMap { [key: string]: string }\r\nconst PRICE_TIER_IMAGES: ImagesMap = {\r\n  'silver': priceTier_Silver,\r\n  'gold': priceTier_Gold,\r\n  'platinum': priceTier_Platinum,\r\n  'gold plus': priceTier_GoldPlus,\r\n}\r\n\r\nexport interface SiteCardProps {\r\n  site: CollectionSite\r\n  onSiteSelected?: (site: CollectionSite) => void\r\n}\r\n\r\nexport default class SiteCard extends Component<SiteCardProps, { open: boolean }> {\r\n  state = { open: false }\r\n  \r\n  getServiceItem(service: SiteService, isMP: boolean) {\r\n    if (!service) {\r\n      return <></>\r\n    }\r\n\r\n    if (!isMP) {\r\n      return <>\r\n        <div><span>{service.Name}</span></div>\r\n      </>\r\n    }\r\n\r\n    let imageSrc = PRICE_TIER_IMAGES[service.PriceTier?.toLowerCase() || ''];\r\n    if (imageSrc) {\r\n      return <>\r\n        <Image src={imageSrc} /><span>{service.Name}</span>\r\n      </>\r\n    } else {\r\n      let displayName = service.PriceTierDisplayName || service.PriceTier;\r\n      return <>\r\n        {displayName !== \"\" && <span className=\"primary\">{displayName}</span>}\r\n        <div><span>{service.Name}</span></div>\r\n      </>\r\n    }\r\n  }\r\n\r\n  render() {\r\n    const { site } = this.props\r\n    return (\r\n      <Container fluid className=\"site-card\">\r\n        <Row>\r\n          <Col xs={1} className=\"p-0\">\r\n            {(site.FFEnabled && !site.IsMarketPlace) && <Image src={clinicIcons_FFEnabled} className=\"w-100 h-auto\" />}\r\n            {(!site.FFEnabled && !site.IsMarketPlace) && <Image src={clinicIcons_NotFFEnabled} className=\"w-100 h-auto\" />}\r\n            {(site.IsMarketPlace) && <Image src={clinicIcons_Marketplace} className=\"w-100 h-auto\" />}\r\n          </Col>\r\n          <Col xs={11} className=\"pr-3\">\r\n            <Button variant=\"icon-link\" className=\"float-right mr-n4\" onClick={() => this.setState({ open: !this.state.open })}>\r\n              {this.state.open ? <FaChevronUp /> : <FaChevronDown />}\r\n            </Button>\r\n            <div className=\"font-weight-bold\">\r\n              <span className=\"text-uppercase\">{site.Name}</span>\r\n              {site.IsMarketPlace && <span> (Marketplace Enabled)</span>}\r\n            </div>\r\n            {site.Distance && <div className=\"float-right pl-1\">({site.Distance.toFixed(2)} Miles)</div>}\r\n            <div className=\"float-left\">{site.Address1}{site.Address2 && ` ${site.Address2}`} </div>\r\n            <div className=\"float-left\">{site.City && ` ${site.City}`}{site.State && ` ${site.State}`}{site.Zip && ` ${site.Zip}`}</div>\r\n          </Col>\r\n        </Row>\r\n        <Row hidden={!this.state.open}>\r\n          <Col xs={1}></Col>\r\n          <Col xs={10}>\r\n            {site.HoursOfOperation && <div>{site.HoursOfOperation}</div>}\r\n            {site.Phone && <div className=\"d-inline-block pr-3\">Phone: {FormatPhone(site.Phone)}</div>}\r\n            {site.Fax && <div className=\"d-inline-block\">Fax1: {FormatPhone(site.Fax)}</div>}\r\n            {site.SiteRating > 0 && (\r\n              <div className=\"rating\">\r\n                Rating\r\n                {site.SiteRating <= 3 && <Image src={clinicRating_3Stars} />}\r\n                {site.SiteRating === 4 && <Image src={clinicRating_4Stars} />}\r\n                {site.SiteRating === 5 && <Image src={clinicRating_5Stars} />}\r\n              </div>\r\n            )}\r\n            <div className=\"services\">\r\n              SERVICES\r\n              {site.SiteServices && site.SiteServices.map(service => (\r\n                <div key={service.Code}>\r\n                  {this.getServiceItem(service, site.IsMarketPlace)}\r\n                </div>\r\n              ))}\r\n            </div>\r\n          </Col>\r\n          <Col xs={1}></Col>\r\n        </Row>\r\n        <Row>\r\n          <Col className=\"pl-0 pt-2 pb-3 pr-3\">\r\n            {this.props.onSiteSelected && <Button variant=\"primary\" size=\"sm\" className=\"w-100 rounded-pill\" onClick={() => this.props.onSiteSelected && this.props.onSiteSelected(site)}>SELECT SITE</Button>}\r\n          </Col>\r\n        </Row>\r\n      </Container >\r\n    )\r\n  }\r\n}\r\n","export default \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIcAAACHCAMAAAALObo4AAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAdFQTFRFAAAAtra6tra6tra6tra6tra6tra6tra6tra6tra6tra6tra6tra6tra6tra6tra6tra6tra6tra6tra6tra6tra6tra6tra6tra6tra6tra6tra6tra6tra6tra6tra6tra6tra6tra6tra6tra6tra6tra6tra6tra6tra6tra6tra6tra6tra6tra6tra6tra6tra6tra6tra6tra6tra6tra6tra6tra6tra6tra6tra6tra6tra6tra6tra6tra6tra6tra6tra6tra6tra6tra6tra6tra6tra6tra6tra6tra6tra6tra6tra6tra6tra6tra6tra6tra6tra6tra6tra6tra6tra6tra6tra6tra6tra6tra6tra6tra6t7e7vLzAwsLFxcXIyMjLxcXJ1NTW4eHj7e3u9vb3/v7+////w8PG2Nja7Ozt/Pz9wcHE3Nzd9PT1zs7RuLi89vb20dHU9/f3xsbJ8PDx6Ojp39/h19fZ0dHTzc3PysrNubm94ODi/f39x8fLubm89fX2z8/S5+fo9fX1vb3A+vr6wMDE4uLju7u+9/f4/Pz8zc3Q+/v72trc5OTl1dXX8vLyy8vO39/gu7u/0NDTTJYffAAAAGB0Uk5TAAeufhVVJvhh/WUBvbB1Xgn1hxPrTJkDnpuoBj8C6LcK1xw3xA+AVPeMhtAn+dFg8HwM1dzGaOdsInDeXHHSTcB7xY+ToBAZp6VpLvG4fUK7/M2SV8yQlLxdIzj2ZJi2Rp1ONQAAAAFiS0dEbMwBMDsAAAAJcEhZcwAAAEgAAABIAEbJaz4AAAiVSURBVHjazVxpQxM7FB0EFcTKJsgiiwtFEZ+CgggiKCCyg7s+nwakQBeLFWURQVFwwb0FWvi1r+0kM8lMJpMpU8n5drOeSW5ubraRpB0jZU/KzguxAakgdTeqTdtLyvv2g/37yKC9aX+BR3rGAVzMPAgAOJiJBx3ISP8LPBwAHMLELBBDFhZyCABH8mlk50SrzVW+P+9wnMfhPKV9cqNiTnbSeeTH6y04AsVCIKMQykcK4mJ+0nkUyfUWl8SlowDhaFwuKZalomTTKC2D9ZZXRKWUYwqPYzEjUlEOpbJS22vOLzq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b9FX88xJlzz9f4BfSaO/Y+wxxINxv4HvM+a8H7QhoaJm+Ucmu8HpaU7cnRxfPtj8xFFT4LrzM0P4/2xHLQ/Ju1svzAc3ghth81cQo79Qhm7sn96gr7JflmA/WQIIfbXhTlvEOX8RZDzKFHO5wQ5rxTl/FaQ82xRzvcFue8gyv0PUe7DwPtB7R2dNx1DSbwfNOS42dnR7rxmdD+IwC7elyIgyv0xQe7TiXK/UJT7lqLcPxXkPq4o95NFua8tyv11Ue7zC/K+QZT3HqK8fyGxe++BSIjyPkqU92L4+7l6C+/n8MeXdryfE+U9ofK+8qHl95UP7XxfKb83LZPfmz7i5hHf7SlplLfd7HhvKsr7WwvvkdUbNUl4j8x6n52K8UhN8vtsEsp79acVEuW9Orp1lYT36hoI8n4f/s/gieH/DOSbecn/n4Eo/3cQ5X8Xwvz/Q5T/oeiwS/+H0cGW/+X8Dx6WGEXD4OO6AAAAJXRFWHRkYXRlOmNyZWF0ZQAyMDE5LTA3LTIzVDE4OjEzOjE4KzAwOjAwcSiqUAAAACV0RVh0ZGF0ZTptb2RpZnkAMjAxOS0wNy0yM1QxODoxMzoxOCswMDowMAB1EuwAAAAZdEVYdFNvZnR3YXJlAEFkb2JlIEltYWdlUmVhZHlxyWU8AAAAAElFTkSuQmCC\"","export default \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIcAAACHCAMAAAALObo4AAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAhxQTFRFAAAA08CF08CF08CF08CF08CF08CF08CF08CF08CF08CF08CF08CF08CF08CF08CF08CF08CF08CF08CF08CF08CF08CF08CF08CF08CF08CF08CF08CF08CF08CF08CF08CF08CF08CF08CF08CF08CF08CF08CF08CF08CF08CF08CF08CF08CF08CF08CF08CF08CF08CF08CF08CF08CF08CF08CF08CF08CF08CF08CF08CF08CF08CF08CF08CF08CF08CF08CF08CF08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U1daU1daU1daU1daU1daU1daU1daU1daU1daU1daU1daU1daU1daU1daU1daU1daU1daU1daU1daU1daU1daU1daU1daU1daU1daU1daU1daU1daU1daU1daU1daU1daU1daU1daU1daU1daU1daU1daU1daU1daU1daU1daU1daU1daU1daU1daU1daU1daU1daU1daU1daU1daU1daU1daU1daU1daU1daU1daU1daU1daU1da////h25I+QAAAEN0Uk5TAAAAJOSQ3y9+zh0ebLsQ+1qqIW1w8uDzS/Ej0AiaXfUr1gykaPhHY7IL91GhA+3qQMIaj4kEiO5NLsqUBqxXT/bNJrse7+MAAAABYktHRAH/Ai3eAAAACXBIWXMAAABIAAAASABGyWs+AAACpElEQVRYw82Yx1bjQBBFWwMYwxBNzjlnGIYc9f//hCV1UoXXvfCCWlmte+65C6vkY2PIDA0PD9GzIhrKFWRSPpW3IJSZkbIcyalzXKqO+lTegriuU5adnDrHpeqoT+UtCGWjZX9G03WeS9Qxn8Y7ENZ1K6ibrvNcoo75NN6BsG6sgsbSdZ5L1DGfxjsQycbLev6m6gKH67hP4T2I6iYaaCJVFzhcx30K70FUN9lAk6m6wOE67lN4DwLZ1HQDTU/huoiDdYJP5gMI6mZKOzO4LuJgneCT+QCCulkHzeK6iIN1gk/mA9i+2ZubD7PgoIXocK5XgYPmskCzWCZnsZINmssCzVIaWqpkg+ayQLO8kmJWlivZoLks0JjVNcysrTbf5DTXfJEzuSxh/3lZ30DMxrp7zlKcewbzuCxh/TxvbmnI1ma8BRAXb4gcLkvYrJvtHZnZ2W7vKJ1r7y/ga2+7hNDuyN09idnbpRtU4+h21X1kGWOh3+H7BxQ52Jf2u8RJ7wrNx94VSBjeOocUOpTfZJyT32SKj7/JgDDUHVHoSK7jnFyn+HgdEIa6Ywody3Wck+sUH68DQi87OaXQ6YlUJ3FSneZjdUjo685KNmdSncRJdZqP1SGhrzvn0LlUJ3FSneZjdUjoZBeX7tbVlft0ecHrZI7XqT5aB4Wu7trdubm9vXGfr3mdzPE61UfroNDV3dnzf/fG3P+3F3e8TuZ4neqjdVDo6jr16cNjc/X4UF92eJ3M8TrVR+ug0Mqe6sPnnovtPdcHT7RO42id7iNxWGgP6/9YXl7Dbn59qU66tE7jaJ3uI3VYaM/e+j/i301r3vs//N9oHeeKmqN1uo/UMbCIhfbs4/Pr25D5/vr8oHWcK4qKo3W6j9QxsIiF5s9vnt9d9wOB70xVD9p7YAAAACV0RVh0ZGF0ZTpjcmVhdGUAMjAxOS0wNy0yNFQxODoyODowOCswMDowMCF5z00AAAAldEVYdGRhdGU6bW9kaWZ5ADIwMTktMDctMjRUMTg6Mjg6MDgrMDA6MDBQJHfxAAAAAElFTkSuQmCC\"","export default \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMYAAAAmCAMAAACoARTtAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAMxQTFRFU1da////U1daU1daU1daU1daU1daU1daU1daU1daU1daU1daU1daU1daU1daU1daU1daU1daU1daU1daU1daU1daU1daU1daU1daU1daU1daU1daU1daU1daU1daU1daU1daU1daU1daU1daU1daU1daU1daU1daU1daU1daU1daU1daU1daU1daU1daU1daU1daU1daU1daU1daU1daU1daU1daU1daU1daU1daU1daU1daU1daU1daU1daU1daU1daU1daU1da////QJPOqAAAAEJ0Uk5TAAAk5JDfL37OHR5suxD7WqohbXDy4PNL8SPQCJpd9SvWDKRo+Edjsgv3UaED7epAwhqPiQSI7k0uypQGrFdP9s0mSyI+DgAAAAFiS0dEAf8CLd4AAAAJcEhZcwAAAEgAAABIAEbJaz4AAAMISURBVFjD3ZjXVuMwFEUlIIQZahh6770PQ6/+/4+auMi2zm168BP3KXH22tJeC1sJzsGMjI6O4DXfGuQ8jOUT+Qr0xqCQX9WNZdlYSkbgrAz0iXwFmhkgFDJ6WdZLyQiclYE+ka9AMwOE/Krj2XDG7YyaMzKIT+IDaGWgkM/o51Tfzqg5I4P4JD6AVgYK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from \"../ObservableFromFetch\"\r\nimport ServiceType from \"./Model/ServiceType\"\r\nimport Service from \"./Model/Service\"\r\nimport AccountService from \"./Model/AccountService\"\r\n\r\nexport default function ServicesGet() {\r\n  return ObservableFromFetch<Service[]>(\"WorkforceService/GetServices\")\r\n}\r\n\r\nexport function ServiceTypesGet() {\r\n  return ObservableFromFetch<ServiceType[]>(\"WorkforceService/GetServiceTypes\")\r\n}\r\n\r\nexport function AccountServicesGet(implementationID: number, accountID?: number) {\r\n  var body: {ImplementationID: string, AccountID?: string} =  { ImplementationID: implementationID.toString(), AccountID: \"0\" } \r\n  if (accountID) body.AccountID = accountID.toString()\r\n  const requestBody = JSON.stringify(body);\r\n  return ObservableFromFetch<AccountService[]>(\"WorkforceService/GetAccountServices\", requestBody )\r\n}\r\n\r\n\r\nexport interface SaveService {\r\n  ServiceID: number\r\n  ActiveWorkForce: boolean\r\n  ActivateAll: boolean\r\n}\r\n\r\nexport interface SaveAccountService {\r\n  AccountServiceID?: number\r\n  Active: boolean\r\n  ServiceID: number\r\n}\r\n\r\nexport interface SaveServices {\r\n  Services: SaveService[]\r\n  AccountServices: SaveAccountService[]\r\n  AccountID?: number\r\n  ImplementationID?: number\r\n}\r\n\r\nexport function AccountServicesSave(data: SaveServices) {\r\n  const requestBody: string = JSON.stringify(data)\r\n\r\n  return ObservableFromFetch<string>(\"WorkforceService/UpdateServices\", requestBody )\r\n}","import React, { Component } from \"react\"\r\nimport { Row, Col, Container } from \"react-bootstrap\"\r\nimport { connect } from \"react-redux\"\r\nimport { toast } from \"react-toastify\"\r\nimport { forkJoin, Subscription } from \"rxjs\"\r\nimport AccountService from \"../../api/Administration/Model/AccountService\"\r\nimport Service from \"../../api/Administration/Model/Service\"\r\nimport ServiceType from \"../../api/Administration/Model/ServiceType\"\r\nimport ServicesGet, { AccountServicesGet, ServiceTypesGet } from \"../../api/Administration/OrderableServices\"\r\nimport { APIError } from \"../../api/ObservableFromFetch\"\r\nimport { AppState, AssignedClinic, WorkforceClinicPortal } from \"../../AppState\"\r\nimport { GetSelectedAssignedClinic, GetSelectedPortal } from \"../../authentication/SelectedCompany/CompanySelectionDrivenSelectors\"\r\nimport Checkbox from \"../Checkbox\"\r\n\r\ninterface SiteServicesAuthProps {\r\n  Company?: AssignedClinic,\r\n  Portal?: WorkforceClinicPortal\r\n}\r\n\r\ninterface ServiceGroup {\r\n  name: string\r\n  code: string\r\n  services: { name: string, value: string, enabled: boolean }[]\r\n}\r\n\r\nexport interface SiteServicesProps {\r\n  hidden: boolean,\r\n  services: string[],\r\n  onChange: (services: string[]) => void\r\n}\r\n\r\ninterface SiteServicesState {\r\n  loadingServices: boolean\r\n  types: ServiceType[]\r\n  services: Service[]\r\n  accountServices: AccountService[],\r\n  serviceGroups: ServiceGroup[]\r\n}\r\n\r\nexport class SiteServices extends Component<SiteServicesProps & SiteServicesAuthProps, SiteServicesState> {\r\n  emptyState: SiteServicesState = {\r\n    loadingServices: false,\r\n    types: [],\r\n    services: [],\r\n    accountServices: [],\r\n    serviceGroups: []\r\n  }\r\n  state:SiteServicesState = { ...this.emptyState }\r\n\r\n  loadSubscription?: Subscription\r\n  loadAccountServicesSubscription?: Subscription\r\n\r\n  componentWillMount() {\r\n    this.loadInitialData()\r\n  }\r\n\r\n  componentWillUnmount() {\r\n    this.loadSubscription && this.loadSubscription.unsubscribe()\r\n    this.loadAccountServicesSubscription && this.loadAccountServicesSubscription.unsubscribe()\r\n  }\r\n\r\n  loadInitialData() {\r\n    if (this.props.hidden) return\r\n    this.loadSubscription && this.loadSubscription.unsubscribe()\r\n    this.setState({ loadingServices: true })\r\n\r\n    this.loadSubscription = forkJoin({\r\n      types: ServiceTypesGet(),\r\n      services: ServicesGet()\r\n    }).subscribe(\r\n      ({ types, services }) => {\r\n        this.setState({ types: types, services: services })\r\n        this.loadAccountServices(this.props.Portal?.ImplementationID || 0, this.props.Company?.AccountID)\r\n      },\r\n      (error) => this.handleAPIError(error, { loadingServices: false })\r\n    )\r\n  }\r\n\r\n  loadAccountServices = (implementationID: number, accountID?: number) => {\r\n    this.loadAccountServicesSubscription && this.loadAccountServicesSubscription.unsubscribe()\r\n    let accountServices: AccountService[] = []\r\n    this.loadAccountServicesSubscription = AccountServicesGet(implementationID, accountID).subscribe(\r\n      data => {\r\n        if (data?.length) {\r\n          accountServices = data\r\n        }\r\n        else {\r\n          if (accountID) {\r\n            this.loadAccountServices(implementationID)\r\n          }\r\n          else {\r\n            accountServices = this.state.services.map(service => {return {AccountServiceID: 0, ImplementationID: implementationID, ServiceID: service.ServiceID, Active: false, IsDefault: false}})\r\n          }\r\n        }\r\n        if (accountServices.length) {\r\n          this.setState({accountServices: accountServices, loadingServices: false})\r\n          this.populateServiceData()\r\n        }\r\n      },\r\n      (error) => this.handleAPIError(error, { loadingServices: false })\r\n    )\r\n  }\r\n\r\n  populateServiceData = () => {\r\n    let serviceGroups = this.state.types.map((type) => ({name: type.ServiceTypeName, code: type.ServiceTypeCode, services: this.populateServices(type.ServiceTypeID)}))\r\n    this.setState({ serviceGroups: serviceGroups })\r\n  }\r\n\r\n\r\n  populateServices = (typeID: number) => {\r\n    return this.state.services.filter(service => service.ServiceTypeID === typeID).map((service) => (\r\n        {name: service.ServiceDescription || service.ServiceName || \"\", value: service.FFServiceCode, enabled: this.checkEnabled(service.ServiceID)}\r\n      ))\r\n  }\r\n\r\n  checkEnabled = (serviceID: number): boolean => {\r\n    const relatedService = this.state.accountServices.find(accService => accService.ServiceID === serviceID)\r\n    const companyMode = !!this.props.Company?.AccountID\r\n    const enabledForPortal = relatedService ? !companyMode && relatedService?.Active : false\r\n    const enabledForCompany = relatedService ? (!!relatedService.AccountID && relatedService?.Active) || (companyMode && !relatedService.AccountID && relatedService.IsDefault) : false\r\n    return enabledForPortal || enabledForCompany\r\n  }\r\n\r\n  onChange = (e: React.ChangeEvent<HTMLInputElement>) => {\r\n    const name = e.target.name\r\n    const services = this.props.services.filter(service => service !== name)\r\n    if (e.target.checked) {\r\n      services.push(name)\r\n    }\r\n    this.props.onChange(services)\r\n  }\r\n\r\n  handleAPIError = (error: Error | APIError, stateChanges: object) => {\r\n    this.setState(stateChanges)\r\n    error && toast.error((error as APIError)?.errorData?.message || error.message)\r\n  }\r\n\r\n  render() {\r\n    if (this.props.hidden) {\r\n      return <></>\r\n    }\r\n\r\n    return (\r\n      <Container fluid className=\"pt-2\" hidden={this.state.loadingServices}>\r\n        <Row><Col className=\"note-message font-italic px-3\">At least one service must be checked to search</Col></Row>\r\n        {this.state.serviceGroups.map(serviceGroup => <Row key={serviceGroup.name}>\r\n          <Col className=\"pt-2\">\r\n            <span className=\"secondary font-weight-bold\">{serviceGroup.name}</span>\r\n            {serviceGroup.services.map((service, index) => <Checkbox key={`${service.name}_${index}`} className=\"ml-3\" label={service.name} id={`${service.value}_id`} name={service.value} checked={this.props.services.includes(service.value)} onChange={this.onChange} disabled={!service.enabled} />)}\r\n          </Col>\r\n        </Row>)}\r\n      </Container>\r\n    )\r\n  }\r\n}\r\n\r\nfunction mapStateToProps(state: AppState): SiteServicesAuthProps {\r\n  return {\r\n    Company: GetSelectedAssignedClinic(state) || undefined,\r\n    Portal: GetSelectedPortal(state)\r\n  }\r\n}\r\nconst ConnectedSiteServices = connect(mapStateToProps, null)(SiteServices)\r\nexport default ConnectedSiteServices\r\n","import React from \"react\"\r\nimport { GMapApiKey, DefaultMapLatitude, DefaultMapLongitude } from \"../../config/Constants\"\r\nimport GoogleMapReact from \"google-map-react\"\r\nimport CollectionSite from \"../../api/Location/LocationModel/CollectionSite\"\r\n\r\n\r\nconst handleApiLoaded = (map: any, maps: any, sites: CollectionSite[]) => {\r\n  const markers: any[] = []\r\n  const infoWindows: any[] = []\r\n\r\n  sites.forEach((site) => {\r\n    markers.push(new maps.Marker({\r\n      position: {\r\n        lat: site.Latitude,\r\n        lng: site.Longitude,\r\n      },\r\n      map,\r\n    }))\r\n\r\n    infoWindows.push(new maps.InfoWindow({ content: getInfoWindowString(site) }))\r\n  })\r\n  if (markers.length) {\r\n    var bounds = new google.maps.LatLngBounds()\r\n    markers.forEach((marker, i) => {\r\n      marker.addListener(\"click\", () => {\r\n        infoWindows.forEach((infoWindow) => infoWindow.close(map))\r\n        infoWindows[i].open(map, marker)\r\n      })\r\n      bounds.extend(marker.position)\r\n    })\r\n    map.fitBounds(bounds);\r\n  }\r\n}\r\n\r\nconst getInfoWindowString = (site: CollectionSite) => `\r\n  <table>\r\n    <thead><tr><th colspan=\"2\"><h3 class=\"info-window-head\">${site.Name}</h3><th><tr></thead>\r\n    <tr><td class=\"info-window-content\">Phone:</td><td>${site.Phone}</td></tr>\r\n    <tr><td class=\"info-window-content\">Fax:</td><td>${site.Fax}</td></tr>\r\n    <tr><td class=\"info-window-content\">Hours:</td><td>${site.HoursOfOperation}</td></tr>\r\n    <tr><td class=\"info-window-content\">Distance:</td><td>${site.Distance && site.Distance.toFixed(2)} Miles</td></tr>\r\n    </tbody></table>\r\n    <div><div class=\"col-xs-4 padding-zero info-window-content\">Services:</div><div class=\"scroll-info-window padding-zero col-xs-8\"><ul class=\"info-window-ul\">${site.VendorService ? site.VendorService.map(service => { `<li>${service}</li>` }) : \"\"}</ul></div></div>\r\n  `\r\n\r\ninterface MapContainerProps {\r\n  sites: CollectionSite[]\r\n  center: {\r\n    lat: number,\r\n    lng: number\r\n  },\r\n  zoom: number\r\n}\r\n\r\nexport default class MapContainer extends React.Component<MapContainerProps, { mapReactKey: string }> {\r\n  state = { mapReactKey: Math.random().toString() }\r\n\r\n  componentDidUpdate(prevProps: MapContainerProps) {\r\n    if (this.props.sites !== prevProps.sites) {\r\n      this.setState({ mapReactKey: Math.random().toString() })\r\n    }\r\n  }\r\n\r\n  render() {\r\n    const { sites } = this.props\r\n    const style = {\r\n      width: \"100%\",\r\n      height: \"600px\"\r\n    }\r\n    return (\r\n      <div style={style}>\r\n        <GoogleMapReact\r\n          key={this.state.mapReactKey}\r\n          bootstrapURLKeys={{ key: GMapApiKey, language: \"en\" }}\r\n          defaultCenter={this.props.center}\r\n          defaultZoom={this.props.zoom}\r\n          options={{ mapTypeControl: true }}\r\n          yesIWantToUseGoogleMapApiInternals\r\n          onGoogleApiLoaded={({ map, maps }) => handleApiLoaded(map, maps, sites)}>\r\n        </GoogleMapReact>\r\n      </div>\r\n    )\r\n  }\r\n\r\n  static defaultProps = {\r\n    center: {\r\n      lat: DefaultMapLatitude,\r\n      lng: DefaultMapLongitude\r\n    },\r\n    zoom: 1\r\n  }\r\n}\r\n","import { Observable } from \"rxjs\"\r\nimport { ObservableFromFetch } from \"../ObservableFromFetch\"\r\nimport Clinic from \"./Models/Clinic\"\r\nimport ClinicSearchPrice from \"./Models/ClinicSearchPrice\"\r\nimport ClinicSearchOptions from \"./Models/ClinicSearchOptions\"\r\nimport ClinicSearchListType from \"./Models/ClinicSearchListType\"\r\nimport ClinicSearchAdditionalOption from \"./Models/ClinicSearchAdditionalOption\"\r\nimport { AdditionalOption } from \"../../components/Administration/ClinicSearchOptions/AdditionalOptions\"\r\n\r\nexport function ClinicGetObservable(clinicSearchListTypeID: number): Observable<Clinic[]> {\r\n  const requestBody: string = new URLSearchParams({\r\n    clinicSearchListTypeID: clinicSearchListTypeID.toString()\r\n  }).toString()\r\n\r\n  return ObservableFromFetch<Clinic[]>(\"WorkforceClinics/GetClinicLists?\" + requestBody)\r\n}\r\n\r\nexport function ClinicSearchPriceSetObservable(list: ClinicSearchPrice[]): Observable<string> {\r\n  var counter = 0;\r\n  const ClinicSearchPriceTiers = list.map((el) => {\r\n    el.SortOrder = ++counter\r\n    return el\r\n  })\r\n  const requestBody: string = JSON.stringify({\r\n    ClinicSearchPriceTiers\r\n  })\r\n\r\n  return ObservableFromFetch<string>(\"WorkforceClinics/SetClinicSearchPrice\", requestBody)\r\n}\r\n\r\nexport function ClinicSearchPriceGetObservable(): Observable<ClinicSearchPrice[]> {\r\n  return ObservableFromFetch<ClinicSearchPrice[]>(\"WorkforceClinics/GetClinicSearchPrice\")\r\n}\r\n\r\nexport function ClinicSearchOptionsSetObservable(radius1: number, radius2: number, mpSitesOnly: boolean = false): Observable<string> {\r\n  const requestBody: string = JSON.stringify({\r\n    radius1: radius1,\r\n    radius2: radius2,\r\n    mpSitesOnly: mpSitesOnly\r\n  })\r\n\r\n  return ObservableFromFetch<string>(\"WorkforceClinics/SetClinicSearchRadius\", requestBody)\r\n}\r\n\r\nexport function ClinicSearchOptionsGetObservable(): Observable<ClinicSearchOptions> {\r\n  const requestBody: string = JSON.stringify({})\r\n\r\n  return ObservableFromFetch<ClinicSearchOptions>(\"WorkforceClinics/GetClinicSearchRadius\", requestBody)\r\n}\r\n\r\nexport function ClinicSearchListTypesGetObservable(): Observable<ClinicSearchListType[]> {\r\n  return ObservableFromFetch<ClinicSearchListType[]>(\"WorkforceClinics/GetClinicSearchListType\")\r\n}\r\n\r\nexport function ClinicSearchListRemoveObservable(clinicSearchListTypeID: number, clinicSearchListIDs: number[]): Observable<string> {\r\n  const requestBody: string = JSON.stringify({\r\n    clinicSearchListTypeID: clinicSearchListTypeID,\r\n    clinicSearchListID: clinicSearchListIDs,\r\n    isRemove: true\r\n  })\r\n\r\n  return ObservableFromFetch<string>(\"WorkforceClinics/SetClinicLists\", requestBody)\r\n}\r\n\r\nexport function ClinicSearchListAddObservable(clinicSearchListTypeID: number, code: string, name: string): Observable<string> {\r\n  const requestBody: string = JSON.stringify({\r\n    clinicSearchListTypeID: clinicSearchListTypeID,\r\n    code: code,\r\n    name: name\r\n  })\r\n\r\n  return ObservableFromFetch<string>(\"WorkforceClinics/SetClinicLists\", requestBody)\r\n}\r\n\r\nexport function ClinicSearchPriceForSiteSearchGetObservable(): Observable<ClinicSearchPrice[]> {\r\n  return ObservableFromFetch<ClinicSearchPrice[]>(\"WorkforceClinics/GetClinicSearchPriceForSiteSearch\")\r\n}\r\n\r\nexport function ClinicSearchAdditionalOptionsGetObservable(): Observable<ClinicSearchAdditionalOption[]> {\r\n  return ObservableFromFetch<ClinicSearchAdditionalOption[]>(\"WorkforceClinics/GetClinicSearchOptions\")\r\n}\r\n\r\nexport function ClinicSearchAdditionalOptionsSetObservable(options: AdditionalOption[]): Observable<string> {\r\n  const requestBody: string = JSON.stringify(\r\n    options\r\n  )\r\n  return ObservableFromFetch<string>(\"WorkforceClinics/SetClinicSearchOptions\", requestBody)\r\n}\r\n\r\ninterface OwnedSitesData {\r\n  UsePrimarySitesOnly: boolean\r\n  Clinics: Clinic[]\r\n}\r\n\r\nexport function RetrieveOwnedSitesObservable() {\r\n  const requestBody: string = JSON.stringify({})\r\n\r\n  return ObservableFromFetch<OwnedSitesData>(\"WorkforceClinics/RetrieveOwnedSites\", requestBody)\r\n}\r\n\r\nexport function UpdateOwnedSitesObservable(data: OwnedSitesData) {\r\n  const requestBody: string = JSON.stringify(data)\r\n\r\n  return ObservableFromFetch<string>(\"WorkforceClinics/UpdateOwnedSites\", requestBody)\r\n}\r\n","import { Observable } from \"rxjs\"\r\nimport { ServiceTypeCode } from \"../Administration/Model/ServiceType\"\r\nimport { ObservableFromFetch } from \"../ObservableFromFetch\"\r\nimport OrderData from \"./OrderRequestsModel/OrderData\"\r\n\r\nexport interface SSOOrderRequestData {\r\n  OrderRequest?: OrderRequest\r\n  Donor?: DonorDetail\r\n}\r\ninterface OrderRequest {\r\n  UserName?: string\r\n  Password?: string\r\n  CustomerId?: number\r\n  ExternalUserName?: string\r\n  WFUserName?: string\r\n  ClientID?: number\r\n  CompanyAccount?: number\r\n  ReferenceTestId?: string\r\n  PostBackURL?: string\r\n}\r\nexport interface DonorDetail {\r\n  DonorFirstName?: string\r\n  DonorLastName?: string\r\n  DonorID?: string\r\n  DonorIDType?: string\r\n  DonorDOB?: string\r\n  DonorPhone?: string\r\n  DonorEmail?: string\r\n  Donoremail?: string\r\n  Address?: DonorAddress\r\n}\r\ninterface DonorAddress {\r\n  Line1?: string\r\n  Line2?: string\r\n  City?: string\r\n  State?: string\r\n  Zip?: string\r\n}\r\nconst emptyOrderRequest = {\r\n  UserName: \"\",\r\n  Password: \"\",\r\n  CustomerId: 0,\r\n  ExternalUserName: \"\",\r\n  WFUserName: \"\",\r\n  ClientID: 0,\r\n  CompanyAccount: 0,\r\n  ReferenceTestId: \"\",\r\n  PostBackURL: \"\"\r\n}\r\nconst emptyDonorAddress = {\r\n  Line1: \"\",\r\n  Line2: \"\",\r\n  City: \"\",\r\n  State: \"\",\r\n  Zip: \"\"\r\n}\r\nconst emptyDonorDetail = {\r\n  DonorFirstName: \"\",\r\n  DonorLastName: \"\",\r\n  DonorID: \"\",\r\n  DonorIDType: \"\",\r\n  DonorDOB: \"\",\r\n  DonorPhone: \"\",\r\n  Donoremail: \"\",\r\n  Address: emptyDonorAddress\r\n}\r\n\r\nexport const EmptySSOOrderRequestData = {\r\n  OrderRequest: emptyOrderRequest,\r\n  Donor: emptyDonorDetail\r\n}\r\n\r\nexport interface EmbededTestEventWithDetail {\r\n  TestEventID: number\r\n  PersonID: number\r\n  ImplementationID: number\r\n  OrderUserLoginID: number\r\n  FirstName: string\r\n  LastName:  string\r\n  SSN:  string\r\n  EmployerID:  string\r\n  AllowDonorClinicSelect: boolean\r\n  TestDetailID: number\r\n  DOT: boolean\r\n  FLEX: boolean\r\n  Observed: boolean\r\n  LabCode: string\r\n  FormFoxTestAN: number\r\n  FormFoxVendorAN: number\r\n  FFVendorCode: string\r\n  TestTypeID: number\r\n  TestTypeDescription: ServiceTypeCode\r\n  SampleTypeID: number\r\n  SampleTypeDescription: string\r\n  SampleTypeCode: string\r\n  SampleTypeIsPoct: boolean\r\n  SampleTypeIsAlcohol: boolean\r\n  FFCode: string\r\n  IsClinical: boolean\r\n}\r\n\r\nexport interface FFSiteSearchData {\r\n  DefaultAddress: string\r\n  Radius: number\r\n  CallbackLink: string\r\n  ReferenceTestID: number\r\n  PriceTierOverride?: string[]\r\n}\r\n\r\nexport interface PendingOrderRequest {\r\n  OrderRequestID: number\r\n  ExternalUserID: number\r\n  FormFoxTestAN: number\r\n  RequestToken: string\r\n  ExpiredAt: Date\r\n  CreatedAt: Date\r\n  RequestText: string\r\n  SendLink: boolean\r\n  SendCallback: boolean\r\n  IsFFOrder: boolean\r\n}\r\n\r\nexport interface ServicePriceTierParameter {\r\n  ServiceCode: string\r\n  ServicePriceTier: string\r\n}\r\n\r\nexport interface SetTestDetailVendorParameters {\r\n  formFoxTestAN: number\r\n  collectionVendorID: number\r\n  formFoxVendorAN: number\r\n  FFVendorCode: string\r\n  collectorVendorName: string\r\n  servicePriceTiers: ServicePriceTierParameter[]\r\n  ssoToken?: string\r\n  expirationDate?: string\r\n  timeZone: string\r\n  sendLink: boolean\r\n  sendCallback: boolean\r\n  isFFOrder: boolean\r\n  ReferenceTestID: number\r\n  ProceedImmediately:boolean\r\n  ExtendExpirationHours: number\r\n  IsMarketPlace?: boolean\r\n  ClinicWasUpdated?: boolean\r\n}\r\n\r\nexport function GetEmbededTestEventWithDetail(formFoxTestAN: number) {\r\n  const requestBody: string = JSON.stringify({\r\n    FormFoxTestAN: formFoxTestAN\r\n  })\r\n  return ObservableFromFetch<EmbededTestEventWithDetail[]>(\"Workforceorder/GetEmbededTestEventWithDetail\", requestBody)\r\n}\r\n\r\nexport function GetFFTestData(token: string) {\r\n  const requestBody: string = new URLSearchParams({\r\n    requestToken: token\r\n  }).toString()\r\n  return ObservableFromFetch<FFSiteSearchData>(\"Workforceorder/GetFFTestData?\" + requestBody)\r\n}\r\n\r\nexport function SetTestDetailVendor(parameters: SetTestDetailVendorParameters) {\r\n  const requestBody: string = JSON.stringify(parameters)\r\n  return ObservableFromFetch<OrderData>(\"Workforceorder/SetTestDetailVendor\", requestBody)\r\n}\r\n\r\nexport function SetFFTestDetailVendor(parameters: SetTestDetailVendorParameters) {\r\n  const requestBody: string = JSON.stringify(parameters)\r\n  return ObservableFromFetch<string>(\"Workforceorder/SetTestDetailVendor\", requestBody)\r\n}\r\n\r\nexport function GetOrderRequest(token: string) {\r\n  const requestBody: string = new URLSearchParams({\r\n    requestToken: token\r\n  }).toString()\r\n\r\n  return ObservableFromFetch<PendingOrderRequest>(\"WorkforceApiRequest/GetApiRequest?\" + requestBody)\r\n}\r\n\r\nexport function GetOrderRequestData(token: string) {\r\n  const requestBody: string = new URLSearchParams({\r\n    requestToken: token\r\n  }).toString()\r\n\r\n  return ObservableFromFetch<SSOOrderRequestData>(\"WorkforceApiRequest/GetApiRequestData?\" + requestBody)\r\n}\r\n","import { ChangeEvent, Component } from \"react\"\r\nimport { Row, Col, Container, Button, Form } from \"react-bootstrap\"\r\nimport { BehaviorSubject, Subscription, of, concat, combineLatest } from \"rxjs\"\r\nimport { catchError, debounceTime, filter, finalize, map, switchMap, tap } from \"rxjs/operators\"\r\nimport { toast } from \"react-toastify\"\r\nimport LocationsListGet, { LocationsListGetParams } from \"../../api/Location/LocationsListGet\"\r\nimport CollectionSite from \"../../api/Location/LocationModel/CollectionSite\"\r\nimport AddressSearch from \"./AddressSearch\"\r\nimport Filter from \"./Filter\"\r\nimport SiteCard from \"./SiteCard\"\r\nimport SiteServices from \"./SiteServices\"\r\nimport { ServiceDataModel } from \"../OrderRequests/OrderModels\"\r\nimport { EventType } from \"../../config/Constants\"\r\nimport MapContainer from \"./MapContainer\"\r\nimport { FaChevronLeft, FaChevronRight, FaChevronUp, FaChevronDown } from \"react-icons/fa\"\r\nimport { ClinicSearchOptionsGetObservable, ClinicSearchPriceForSiteSearchGetObservable  } from \"../../api/Clinics/ClinicOptionsGet\"\r\nimport ClinicSearchOptions from \"../../api/Clinics/Models/ClinicSearchOptions\"\r\nimport { IsServiceTypeCodeAlcohol, IsServiceTypeCodeDrug, IsServiceTypeCodePhysical } from \"../../api/Administration/Model/ServiceType\"\r\nimport { SSOOrderRequestData, EmptySSOOrderRequestData, EmbededTestEventWithDetail, GetEmbededTestEventWithDetail, FFSiteSearchData, GetFFTestData } from \"../../api/OrderRequests/SSOOrderRequest\"\r\nimport ClinicSearchPrice from \"../../api/Clinics/Models/ClinicSearchPrice\"\r\nimport { GetSSOToken } from \"../../storage/AuthToken\"\r\nimport { SampleType } from \"../../api/LookupCodes/SampleType\"\r\nimport Checkbox from \"../Checkbox\"\r\nimport _lodash from \"lodash\"\r\nimport { ServiceCode } from \"../../api/LookupCodes/ServiceCode\"\r\nimport handleAPIError from \"../../utils/handleAPIError\"\r\nimport LoadingTableWrapper from \"../LoadingTableWrapper\"\r\n\r\nexport type FilterFunction = (site: CollectionSite) => boolean\r\n\r\ninterface SiteSearchProps {\r\n  tests?: ServiceDataModel[]\r\n  defaultAddress?: string\r\n  isSSO?: boolean\r\n  onSiteSelect?: (site: CollectionSite, callbackParams: {сallbackLink?: string, referenceTestID: number} ) => void\r\n  formFoxTestAN?: number\r\n  isFFOrder?: boolean\r\n  forceShowFilter: boolean\r\n  accountID?: number\r\n}\r\n\r\ninterface Geolocation {\r\n  available?: boolean\r\n  enabled?: boolean\r\n  latitude?: any\r\n  longitude?: any\r\n  error?: string\r\n}\r\n\r\ninterface SiteSearchState {\r\n  isFilterShown: boolean\r\n  isMapShown: boolean\r\n  siteServices: string[]\r\n  sites: CollectionSite[]\r\n  filteredSites: CollectionSite[]\r\n  filter?: FilterFunction\r\n  isLocationsSearching: boolean\r\n  dataLoaded: boolean\r\n  radius: number\r\n  clinicSearchOptions?: ClinicSearchOptions\r\n  ssoOrderRequest: SSOOrderRequestData\r\n  defaultSearchCompleted: boolean\r\n  tests?: EmbededTestEventWithDetail[]\r\n  FFSiteSearchData?: FFSiteSearchData\r\n  defaultAddress?: string\r\n  сallbackLink?: string\r\n  referenceTestID?: number\r\n  priceTiers?: ClinicSearchPrice[]\r\n  priceTiersOverride?: string[]\r\n  customRadius: number\r\n  geolocation?: Geolocation\r\n  priceTiersLoaded: boolean\r\n  embeddedTestEventLoaded: boolean\r\n}\r\n\r\nconst INITIAL_RADIUS = 15\r\n\r\nexport default class SiteSearch extends Component<SiteSearchProps, SiteSearchState> {\r\n  state: SiteSearchState = {\r\n    isFilterShown: true,\r\n    isMapShown: true,\r\n    siteServices: [],\r\n    sites: [],\r\n    filteredSites: [],\r\n    radius: INITIAL_RADIUS,\r\n    isLocationsSearching: false,\r\n    ssoOrderRequest: EmptySSOOrderRequestData,\r\n    defaultSearchCompleted: false,\r\n    dataLoaded: false,\r\n    customRadius: 0,\r\n    geolocation: { available: !!navigator.geolocation },\r\n    priceTiersLoaded: false,\r\n    embeddedTestEventLoaded: this.props.formFoxTestAN ? false : true,\r\n  }\r\n\r\n  locationsQuery$ = new BehaviorSubject<string | undefined>(undefined)\r\n  radius$ = new BehaviorSubject<number>(INITIAL_RADIUS)\r\n  locationsSubscription?: Subscription\r\n  radiusOptionsSubscription?: Subscription\r\n  testEventSubscription?: Subscription\r\n  ssoOrderSubscription?: Subscription\r\n  priceTierSubscription?: Subscription\r\n\r\n  componentDidMount() {\r\n    this.locationsSubscription = combineLatest([\r\n      this.locationsQuery$.pipe(\r\n        filter(query => query !== undefined),\r\n        map((query) => query!.replace(/\\s+/g, \" \").trim()),\r\n        filter(query => !!query)\r\n      ),\r\n      this.radius$.pipe(debounceTime(500)),\r\n    ]).pipe(\r\n      filter(_ => this.isSearchAllowed()),\r\n      switchMap(([query, radius]) => concat(\r\n        of({ isLoading: true }),\r\n        LocationsListGet(this.buildSearchCriteria(query, radius)).pipe(\r\n          map((data) => ({ isLoading: false, result: data })),\r\n          catchError(() => of({ isLoading: false }))\r\n        )))\r\n    ).subscribe(\r\n      (o: { isLoading: boolean, result?: CollectionSite[] }) => {\r\n        this.setState((prev) => ({\r\n          isLocationsSearching: o.isLoading,\r\n          defaultSearchCompleted: !o.isLoading && !prev.defaultSearchCompleted ? true : prev.defaultSearchCompleted,\r\n        }))\r\n        !!o.result && this.handleSearchCompleted(o.result)\r\n      },\r\n      (error) => handleAPIError(error, () => this.setState({ isLocationsSearching: false }))\r\n    )\r\n    this.radiusOptionsSubscription = ClinicSearchOptionsGetObservable().subscribe(\r\n      (response: ClinicSearchOptions) => {\r\n        this.setState({ clinicSearchOptions: response, radius: response.SearchRadius1 || INITIAL_RADIUS })\r\n        if (this.props.formFoxTestAN || !!this.props.isFFOrder) {\r\n          if (this.props.isFFOrder) {\r\n            var token = GetSSOToken()\r\n            this.testEventSubscription = GetFFTestData(token).subscribe(\r\n              (data: FFSiteSearchData) => this.setState({\r\n                referenceTestID: data.ReferenceTestID,\r\n                сallbackLink: data.CallbackLink,\r\n                defaultAddress: data.DefaultAddress,\r\n                radius: data.Radius,\r\n                priceTiersOverride: data.PriceTierOverride,\r\n                clinicSearchOptions: {SearchRadius1: data.Radius, SearchRadius2: data.Radius},\r\n                dataLoaded: true\r\n              }),\r\n              handleAPIError\r\n            )\r\n          } else {\r\n            this.testEventSubscription = GetEmbededTestEventWithDetail(this.props.formFoxTestAN || 0).subscribe(\r\n              (data: EmbededTestEventWithDetail[]) => this.setState({ tests: data, dataLoaded: true }),\r\n              handleAPIError\r\n            )\r\n          }\r\n        }\r\n      }, handleAPIError)\r\n\r\n    this.priceTierSubscription = ClinicSearchPriceForSiteSearchGetObservable()\r\n      .pipe(finalize(() => this.setState({ priceTiersLoaded: true })))\r\n      .subscribe((response: ClinicSearchPrice[]) => this.setState({ priceTiers: response }), handleAPIError)\r\n\r\n    if (this.props.formFoxTestAN) {\r\n      this.testEventSubscription = GetEmbededTestEventWithDetail(this.props.formFoxTestAN)\r\n        .pipe(finalize(() => this.setState({ embeddedTestEventLoaded: true })))\r\n        .subscribe((data: EmbededTestEventWithDetail[]) => this.setState({ tests: data }), handleAPIError)\r\n    }\r\n\r\n  }\r\n\r\n  componentWillUnmount() {\r\n    this.locationsSubscription && this.locationsSubscription.unsubscribe()\r\n    this.radiusOptionsSubscription && this.radiusOptionsSubscription.unsubscribe()\r\n    this.testEventSubscription && this.testEventSubscription.unsubscribe()\r\n    this.ssoOrderSubscription && this.ssoOrderSubscription.unsubscribe()\r\n    this.priceTierSubscription && this.priceTierSubscription.unsubscribe()\r\n  }\r\n\r\n  componentDidUpdate(prevProps: SiteSearchProps, prevState: SiteSearchState) {\r\n    if (this.state.radius !== prevState.radius) {\r\n      this.radius$.next(this.state.radius)\r\n    }\r\n  }\r\n\r\n  buildSearchCriteria = (query: string, radius: number): LocationsListGetParams => {\r\n    if (this.props.tests) {\r\n      const { tests } = this.props\r\n\r\n      return {\r\n        Address: query, //anything in the address line from UI goes in this parameter\r\n        Radius: radius, //miles selected for search\r\n        LabCode: tests.find(item => IsServiceTypeCodeDrug(item.serviceTypeCode))?.labAccountObj?.LabCode, //lab code from the lab account selected\r\n        IsObserved: !!tests.find(item => IsServiceTypeCodeDrug(item.serviceTypeCode) && item.observedCollection),\r\n        Codes: tests.map(test => test.serviceCode),\r\n        IsSSO: !!this.props.isSSO || !!this.props.formFoxTestAN,\r\n        ReferenceTestID: 0,\r\n        IsFFOrder: false,\r\n        AccountID: this.props.accountID,\r\n        PriceTierOverride: []\r\n      }\r\n    }\r\n    if (!!this.props.isFFOrder) {\r\n      const { referenceTestID } = this.state\r\n      return {\r\n        Address: query,\r\n        Radius: radius,\r\n        LabCode: \"CRL\",//other labs not supported at this time, hard coding will have to be removed if other labs added in future\r\n        IsObserved: false,\r\n        Codes: [],\r\n        ReferenceTestID: referenceTestID || 0,\r\n        IsSSO: !!this.props.isSSO,\r\n        IsFFOrder: true,\r\n        AccountID: this.props.accountID,\r\n        PriceTierOverride: this.state.priceTiersOverride || [],\r\n        Latitude: this.state.geolocation?.enabled ? this.state.geolocation?.latitude ?? \"0.0\" : null,\r\n        Longitude: this.state.geolocation?.enabled ? this.state.geolocation?.longitude ?? \"0.0\" : null\r\n      }\r\n    }\r\n    if (this.state.tests) {\r\n      const { tests } = this.state\r\n      return {\r\n        Address: query,\r\n        Radius: radius,\r\n        LabCode: tests.find(item => IsServiceTypeCodeDrug(item.TestTypeDescription))?.LabCode,\r\n        IsObserved: !!tests.find(item => IsServiceTypeCodeDrug(item.TestTypeDescription) && item.Observed),\r\n        Codes: this.embeddedTestsCodes(tests),\r\n        ReferenceTestID: 0,\r\n        IsSSO: !!this.props.isSSO,\r\n        IsFFOrder: false,\r\n        AccountID: this.props.accountID,\r\n        PriceTierOverride: []\r\n      }\r\n    }\r\n    else {\r\n      return {\r\n        Address: query,\r\n        Radius: radius,\r\n        IsObserved: false,\r\n        LabCode: \"\",\r\n        Codes: this.state.siteServices,\r\n        IsSSO: false,\r\n        ReferenceTestID: 0,\r\n        IsFFOrder: false,\r\n        AccountID: this.props.accountID,\r\n        PriceTierOverride: []\r\n      }\r\n    }\r\n  }\r\n\r\n  embeddedTestsCodes = (tests: EmbededTestEventWithDetail[]) => {\r\n    let codes: string[] = []\r\n\r\n    tests.forEach((test) => {\r\n      if (test.IsClinical) {\r\n        codes.push(test.FFCode)\r\n      }\r\n      else {\r\n        if (IsServiceTypeCodeDrug(test.TestTypeDescription)) {\r\n          if (test.DOT) {\r\n            if (test.SampleTypeCode === SampleType.SD) {\r\n              codes.push(ServiceCode.DrugDOTOral)\r\n            } else {\r\n              codes.push(ServiceCode.DrugDOTUrine)\r\n            }\r\n          }\r\n          else if (test.FLEX) {\r\n            codes.push(ServiceCode.FLEX)\r\n          }\r\n          else if (test.SampleTypeIsPoct) {\r\n            codes.push(ServiceCode.POCT)\r\n          } else {\r\n            if (test.SampleTypeCode === SampleType.SD) {\r\n              codes.push(ServiceCode.DrugNonDOTOral)\r\n            } else if (test.SampleTypeCode === SampleType.HR) {\r\n              codes.push(ServiceCode.Hair)\r\n            } else {\r\n              codes.push(ServiceCode.DrugNonDOTUrine)\r\n            }\r\n          }\r\n        }\r\n        if (IsServiceTypeCodeAlcohol(test.TestTypeDescription) && test.SampleTypeCode === EventType.Breath) {\r\n          if (test.DOT) {\r\n            codes.push(ServiceCode.AlcoholBreathDOT)\r\n          }\r\n          else {\r\n            codes.push(ServiceCode.AlcoholBreath)\r\n          }\r\n        }\r\n        if (IsServiceTypeCodeAlcohol(test.TestTypeDescription) && test.SampleTypeCode === EventType.Saliva) {\r\n          if (test.DOT) {\r\n            codes.push(ServiceCode.AlcoholSalivaDOT)\r\n          }\r\n          else {\r\n            codes.push(ServiceCode.AlcoholSaliva)\r\n          }\r\n        }\r\n        if (IsServiceTypeCodePhysical(test.TestTypeDescription)) {\r\n          if (test.DOT) {\r\n            codes.push(ServiceCode.PhysicalDOT)\r\n          }\r\n          else {\r\n            codes.push(ServiceCode.Physical)\r\n          }\r\n        }\r\n      }\r\n    })\r\n\r\n    return codes\r\n  }\r\n\r\n  isSearchAllowed = () => !!this.props.tests || this.state.siteServices.length > 0 || !!this.state.tests || !!this.props.isFFOrder\r\n\r\n  handleSearchCompleted = (sites: CollectionSite[]) => {\r\n    this.setState({\r\n      sites: sites,\r\n      filteredSites: this.state.filter ? sites.filter(site => this.state.filter!(site)) : sites\r\n    })\r\n    if (sites.length > 0) {\r\n      toast.success(\"Sites found successfully.\")\r\n    } else {\r\n      toast.error(\"We are currently unable to locate any locations in your area.\")\r\n    }\r\n  }\r\n  handleFilterChange = (filter?: FilterFunction) => this.setState({ filter: filter, filteredSites: filter ? this.state.sites.filter(site => filter(site)) : this.state.sites })\r\n  handleRadiusChange = (radius: number) => this.setState({ radius: radius })\r\n  handleCustomRadiusChange = (radius: number) => {\r\n    this.setState({ customRadius: radius }, () => this.radius$.next(radius))\r\n  }\r\n\r\n  handleSiteSelection = (site: CollectionSite) => {\r\n    this.props.onSiteSelect && this.props.onSiteSelect(site, {сallbackLink: this.state.сallbackLink, referenceTestID: this.state.referenceTestID || 0})\r\n  }\r\n\r\n  handleGeoLocationChange = (e: ChangeEvent<HTMLInputElement>) => {\r\n    const enabled = !!e.target.checked\r\n    if (navigator.geolocation) {\r\n      this.setState({ geolocation: { available: true, enabled: enabled } }, () => enabled && navigator.geolocation.getCurrentPosition(this.setPosition, this.setError))\r\n    } else {\r\n      this.setState({ geolocation: { available: false, enabled: false, error: \"Geolocation is not supported by this browser.\" } })\r\n    }\r\n  }\r\n\r\n  setPosition = (position: GeolocationPosition) => this.setState({ geolocation: {...this.state.geolocation, latitude: position.coords.latitude, longitude: position.coords.longitude } })\r\n  setError = (error: GeolocationPositionError) => {\r\n    var message: string\r\n    switch (error.code) {\r\n      case error.PERMISSION_DENIED:\r\n        message = \"This site has been blocked from accessing your location.\"\r\n        break;\r\n      case error.POSITION_UNAVAILABLE:\r\n        message = \"Location information is unavailable.\"\r\n        break;\r\n      case error.TIMEOUT:\r\n        message = \"The request to get your location timed out.\"\r\n        break;\r\n      default:\r\n        message = \"An unknown error occurred.\"\r\n        break;\r\n    }\r\n    message && toast.error(message)\r\n    this.setState({ geolocation: { error: message, available: false, enabled: false } })\r\n  }\r\n\r\n  dataCanBeLoaded = () => this.props.formFoxTestAN || !!this.props.isFFOrder\r\n\r\n  defaultSearchCompleted = () => {\r\n    const {dataLoaded, defaultAddress, defaultSearchCompleted} = this.state\r\n\r\n    if (!this.dataCanBeLoaded()) {\r\n      return true\r\n    } \r\n    return dataLoaded && (!defaultAddress || (!!defaultAddress && defaultSearchCompleted))\r\n  } \r\n\r\n  isPageLoading = () => {\r\n    const {dataLoaded, priceTiersLoaded, embeddedTestEventLoaded} = this.state\r\n\r\n    return (this.dataCanBeLoaded() && !dataLoaded) ||\r\n      !priceTiersLoaded ||\r\n      !embeddedTestEventLoaded ||\r\n      !this.defaultSearchCompleted()\r\n    \r\n  }\r\n\r\n  handleAddressSearch = (query: string | undefined ) => {\r\n    this.locationsQuery$?.next(query)\r\n  }\r\n\r\n\r\n  render() {\r\n    const isSSO = this.props.isSSO || !!this.props.formFoxTestAN || !!this.props.isFFOrder\r\n    const showFilter = !isSSO || this.props.forceShowFilter\r\n    return (\r\n      <LoadingTableWrapper loading={isSSO && this.isPageLoading()} variant=\"page\" hideContent withBorder={false}>\r\n      <Container fluid>\r\n        <Row className=\"d-none d-lg-flex\">\r\n          {showFilter && this.state.isFilterShown && <Col xs={12} sm={12} md={12} lg={3} xl={2} className=\"border-top-0 border-left-0 border-right-0 border-bottom border-style-dotted\">\r\n            <div className=\"secondary py-2 caption-5 float-left\">Hierarchy</div>\r\n            <Button variant=\"link\" className=\"secondary position-absolute top-0 right-0\" onClick={() => this.setState({ isFilterShown: false })}><FaChevronLeft /></Button>\r\n          </Col>}\r\n          <Col>\r\n            {!this.state.isFilterShown && <Button variant=\"link\" className=\"secondary float-left pl-0\" onClick={() => this.setState({ isFilterShown: true })}><FaChevronRight /></Button>}\r\n            <div className=\"primary pt-2 caption-5 float-left\">FIND A SITE</div>\r\n            {!this.state.isMapShown && <Button variant=\"link\" className=\"secondary position-absolute top-0 right-0\" onClick={() => this.setState({ isMapShown: true })}><FaChevronLeft /></Button>}\r\n          </Col>\r\n          {this.state.isMapShown && <Col xs={12} sm={12} md={12} lg={5} xl={5}>\r\n            <Button variant=\"link\" className=\"secondary position-absolute top-0 left-0\" onClick={() => this.setState({ isMapShown: false })}><FaChevronRight /></Button>\r\n          </Col>}\r\n        </Row>\r\n        <Row className=\"d-flex d-lg-none\">\r\n          <Col>\r\n            <Button variant=\"link\" className=\"secondary float-left pl-0\" onClick={() => this.setState({ isFilterShown: !this.state.isFilterShown })}>\r\n              {this.state.isFilterShown && <FaChevronUp />}\r\n              {!this.state.isFilterShown && <FaChevronDown />}\r\n            </Button>\r\n            <div className=\"primary pt-2 caption-5 float-left\">FIND A SITE</div>\r\n          </Col>\r\n        </Row>\r\n        <Row>\r\n          {showFilter && this.state.isFilterShown && <Col xs={12} sm={12} md={12} lg={3} xl={2}>\r\n            <Filter\r\n              sites={this.state.sites}\r\n              radius={this.state.radius}\r\n              filter={this.state.filter}\r\n              clinicSearchOptions={this.state.clinicSearchOptions}\r\n              priceTiers={this.state.priceTiers || []}\r\n              onRadiusChanged={this.handleRadiusChange}\r\n              onFilterChanged={this.handleFilterChange} />\r\n          </Col>}\r\n          <Col>\r\n            {(((this.props.formFoxTestAN || !!this.props.isFFOrder) && this.state.dataLoaded) || (!this.props.formFoxTestAN && !this.props.isFFOrder)) && (\r\n              <AddressSearch\r\n                onSearch={this.handleAddressSearch}\r\n                isSearching={this.state.isLocationsSearching}\r\n                disabledSearch={!this.isSearchAllowed()}\r\n                defaultAddress={this.props.defaultAddress || this.state.defaultAddress}\r\n                isSSO={isSSO}\r\n                defaultSearchCompleted={this.defaultSearchCompleted()}\r\n              />\r\n            )}\r\n            {isSSO && <Row className=\"justify-content-md-center mt-1\">\r\n              <Col xs={6} className=\"d-flex justify-content-end\">\r\n                <Form.Label htmlFor=\"customSearchRadius\">Radius (Miles):</Form.Label>\r\n              </Col>\r\n              <Col xs={2}>\r\n                <Form.Control id=\"customSearchRadius\"\r\n                  type=\"text\"\r\n                  size=\"sm\"\r\n                  maxLength={2}\r\n                  value={this.state.customRadius || this.state.radius || \"\"}\r\n                  onChange={e => this.handleCustomRadiusChange(+e.target.value)} />\r\n              </Col>\r\n              <Col xs={4} className=\"align-self-end d-flex justify-content-end\">\r\n                <Checkbox\r\n                  id=\"useCurrentLocation\"\r\n                  label=\"Use current location\"\r\n                  checked={!!this.state.geolocation?.enabled}\r\n                  onChange={this.handleGeoLocationChange} title={this.state.geolocation?.error}\r\n                />\r\n              </Col>\r\n            </Row>}\r\n            <SiteServices hidden={!!this.props.tests || isSSO} services={this.state.siteServices} onChange={services => this.setState({ siteServices: services })} />\r\n            <Container fluid className=\"pr-4 mt-4 site-card-container\">\r\n              {this.state.filteredSites.map((site, index) => (\r\n                <Row key={`${site.Code}_${index}`}>\r\n                  <Col className=\"pr-0\">\r\n                    <SiteCard site={site} onSiteSelected={this.props.onSiteSelect ? this.handleSiteSelection : undefined} />\r\n                  </Col>\r\n                </Row>))}\r\n                {isSSO && this.state.defaultSearchCompleted && !this.state.filteredSites.length &&\r\n                  <div className=\"note-message font-italic px-0\">If you are unable to locate a site, please call your program administrator for assistance.</div>}\r\n            </Container>\r\n          </Col>\r\n          <Col xs={12} className=\"d-flex d-lg-none\">\r\n            <Button variant=\"link\" className=\"secondary float-left pl-0\" onClick={() => this.setState({ isMapShown: !this.state.isMapShown })}>\r\n              {this.state.isMapShown && <FaChevronUp />}\r\n              {!this.state.isMapShown && <FaChevronDown />}\r\n            </Button>\r\n            <div className=\"pt-2 caption-5 float-left\">MAP</div>\r\n          </Col>\r\n          {this.state.isMapShown && <Col xs={12} sm={12} md={12} lg={5} xl={5}>\r\n            <MapContainer sites={this.state.filteredSites} />\r\n          </Col>}\r\n        </Row>\r\n      </Container>\r\n      </LoadingTableWrapper>\r\n    )\r\n  }\r\n\r\n  static defaultProps = { forceShowFilter: false }\r\n}\r\n","import { Observable } from \"rxjs\"\r\nimport { ObservableFromFetch } from \"../ObservableFromFetch\"\r\nimport CollectionSite from \"./LocationModel/CollectionSite\"\r\n\r\nexport interface LocationsListGetParams {\r\n  Radius: number\r\n  Address: string\r\n  LabCode?: string\r\n  IsObserved: boolean\r\n  Codes: string[]\r\n  IsSSO: boolean\r\n  ReferenceTestID: number\r\n  IsFFOrder: boolean\r\n  AccountID?: number\r\n  PriceTierOverride: string[]\r\n  Latitude?: string\r\n  Longitude?: string\r\n}\r\n\r\nexport default function LocationsListGetObservable(params: LocationsListGetParams): Observable<CollectionSite[]> {\r\n  const requestBody: string = JSON.stringify(params)\r\n  return ObservableFromFetch<CollectionSite[]>(\"order/FindCollectionSitesV2\", requestBody)\r\n}\r\n","export default \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAeGVYSWZNTQAqAAAACAAFARIAAwAAAAEAAQAAARoABQAAAAEAAABKARsABQAAAAEAAABSASgAAwAAAAEAAgAAh2kABAAAAAEAAABaAAAAAAAACAAAAAABAAAIAAAAAAEAAqACAAQAAAABAAAAEKADAAQAAAABAAAAEAAAAADMEAlUAAAACXBIWXMAATr2AAE69gE6sVc6AAACZmlUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iWE1QIENvcmUgNi4wLjAiPgogICA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLX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V8iXvEJ/w5eYB3uoUmR3BQo2Shy/wCqp2Bb+7QaowAAAABJRU5ErkJggg==\"","import React, { Component } from \"react\"\r\nimport { Button, Table, Image } from \"react-bootstrap\"\r\nimport { ServiceDataModel } from \"../OrderModels\"\r\nimport { FaTimes } from \"react-icons/fa\"\r\nimport ConfirmationModal from \"../../ConfirmationModal\"\r\nimport dotImage from \"../../../assets/images/dot-img.png\"\r\nimport shoppingCarImage from \"../../../assets/images/shopping-cart.png\"\r\n\r\nexport interface OrderedServicesProps {\r\n  services: ServiceDataModel[],\r\n  canConfirm: boolean,\r\n  canRemove: boolean,\r\n  onRemoveService: (id: number) => void,\r\n  onConfirm: () => void\r\n}\r\n\r\ninterface OrderedServicesState {\r\n  showRemoveConfirmation: boolean\r\n  idToRemove?: number\r\n}\r\n\r\nexport default class OrderedServices extends Component<OrderedServicesProps> {\r\n  state: OrderedServicesState = { showRemoveConfirmation: false }\r\n\r\n  closeRemoveConfirmation = () => this.setState({ showRemoveConfirmation: false, idToRemove: undefined })\r\n  performRemove = () => {\r\n    if (!this.props.canRemove) {\r\n      return\r\n    }\r\n    this.closeRemoveConfirmation()\r\n    this.props.onRemoveService(this.state.idToRemove || 0)\r\n  }\r\n\r\n  render() {\r\n    const { services, canConfirm, onConfirm } = this.props\r\n    if (services.length === 0) {\r\n      return <></>\r\n    }\r\n    return (\r\n      <div>\r\n        <div className=\"font-weight-bold\">CART&nbsp;<Image className=\"ml-auto\" src={shoppingCarImage}  /></div>\r\n        <Table className=\"table-sm dark\" responsive>\r\n          <thead>\r\n            <tr>\r\n              <th>SERVICE TYPE</th>\r\n              <th></th>\r\n              <th>ACCOUNT</th>\r\n              <th>TEST TO BE PERFORMED</th>\r\n              {this.props.canRemove && <th>REMOVE</th>}\r\n            </tr>\r\n          </thead>\r\n          <tbody>\r\n            {services.map((service, index) =>\r\n              <tr key={service.id}>\r\n                <td className=\"justify-content-between\">\r\n                  <span>{service.serviceTypeCode}</span>\r\n                </td>\r\n                <td><Image className=\"ml-auto\" src={dotImage} hidden={service.isDOT !== true} /></td>\r\n                <td>{service.labAccount}</td>\r\n                <td>{service.testToPerform}</td>\r\n                {this.props.canRemove && <td >\r\n                  <Button size=\"sm\" variant=\"outline-dark\" className=\"btn-icon-link py-0\" onClick={() => this.setState({ showRemoveConfirmation: true, idToRemove: service.id })}><FaTimes /></Button>\r\n                </td>}\r\n              </tr>)}\r\n          </tbody>\r\n        </Table>\r\n        <Button size=\"sm\" disabled={!canConfirm} onClick={onConfirm} className=\"float-right\">CONFIRM</Button>\r\n        <div>Count:&nbsp;{services.length}</div>\r\n        <ConfirmationModal show={this.state.showRemoveConfirmation}\r\n          title=\"CONFIRM REMOVE\"\r\n          textTitle=\"Are you sure you want to remove selected service?\"\r\n          text=\"Selected service will be removed permanently.\"\r\n          onConfirm={this.performRemove}\r\n          onHide={this.closeRemoveConfirmation} />\r\n      </div>\r\n    )\r\n  }\r\n}\r\n","import React from 'react'\r\nimport { Table, Button } from 'react-bootstrap'\r\n\r\nexport interface StepData {\r\n  title: string\r\n  disabled: boolean\r\n  current: boolean\r\n  onClick: () => void\r\n}\r\n\r\nexport interface OrderRequestsHeaderProps {\r\n  steps: StepData[]\r\n  title?: string\r\n}\r\n\r\nexport default (props: OrderRequestsHeaderProps) => {\r\n  const steps = () => props.steps.map(step => (\r\n    <Button className={`${step.current ? \" selected\" : ''}`} disabled={step.disabled} onClick={step.onClick}>{step.title}</Button>\r\n  ))\r\n  const stepsWithDelimiters = () => steps().reduce((r: JSX.Element[], step: JSX.Element) => r.length ? [...r, <hr/>, step] : [step], [])\r\n  const trs = stepsWithDelimiters().map((item, index) => <td key={index}>{item}</td>)\r\n  return (\r\n    <>\r\n      <h4 className=\"primary\">{ props.title || \"ORDER FORM\" }</h4>\r\n      <Table className=\"OrderRequestsHeader\">\r\n        <tbody>\r\n          <tr>\r\n            {trs}\r\n          </tr>\r\n        </tbody>\r\n      </Table>\r\n    </>\r\n  )\r\n}\r\n","import { Observable } from \"rxjs\"\r\nimport { ObservableFromFetch } from \"../ObservableFromFetch\"\r\nimport OrderData from \"./OrderRequestsModel/OrderData\"\r\nimport SaveOrder from \"./OrderRequestsModel/SaveOrder\"\r\nimport { FinishData } from \"../../components/OrderRequests/OrderFinish\"\r\n\r\nexport default function OrderSubmitObservable(params: SaveOrder): Observable<OrderData> {\r\n  const requestBody: string = JSON.stringify(params)\r\n\r\n  return ObservableFromFetch<OrderData>(\"/workforceorder/saveorder\", requestBody)\r\n}\r\n\r\nexport function OrderFinishObservable(data: FinishData) {\r\n  const requestBody: string = JSON.stringify(data)\r\n\r\n  return ObservableFromFetch<string>(\"WorkforceOrder/FinishOrder\", requestBody)\r\n}","import { Component } from 'react'\r\nimport { Form, Button, Table, Modal } from 'react-bootstrap'\r\nimport { Donor } from \"../../api/OrderRequests/OrderRequestsModel/Donor\"\r\n\r\ninterface PotentialDonorMatchProps {\r\n  potentialDonorMatchList: Donor[]\r\n  onClose: () => void\r\n  onSubmit: (match: Donor) => void\r\n  show?: boolean\r\n}\r\n\r\ninterface PotentialDonorMatchState {\r\n  selectedDonorMatch?: Donor\r\n}\r\n\r\nexport default class PotentialDonorMatchModal extends Component<PotentialDonorMatchProps, PotentialDonorMatchState> {\r\n  state = { selectedDonorMatch: undefined }\r\n  selectDonorMatch = (donorMatch: Donor) => this.setState({ selectedDonorMatch: donorMatch })\r\n  render() {\r\n    return (\r\n      <Modal show={ this.props.show } onHide={ this.props.onClose } size=\"xl\" dialogClassName=\"dark\">\r\n        <Modal.Header closeButton>\r\n          <Modal.Title>POTENTIAL DONOR MATCH</Modal.Title>\r\n        </Modal.Header>\r\n        <Modal.Body>\r\n          <Table>\r\n            <thead>\r\n              <tr>\r\n                <th>&nbsp;</th>\r\n                <th>Name</th><th>Existing ID</th><th>Match</th>\r\n              </tr>\r\n            </thead>\r\n            <tbody>\r\n              { this.props.potentialDonorMatchList.map(donorMatch => <tr key={ donorMatch?.CCFPersonnelID } onClick={ () => this.selectDonorMatch(donorMatch) } >\r\n                <td>\r\n                  <Form.Check type=\"radio\" name=\"CCFPersonnelID\" label=\"\" id={ (donorMatch?.PersonID || \"\").toString() } checked={ this.state.selectedDonorMatch === donorMatch } className=\"abc-radio abc-radio-primary\" onChange={ () => this.selectDonorMatch(donorMatch) } />\r\n                </td>\r\n                <td>{ donorMatch?.FirstName } { donorMatch?.LastName }</td>\r\n                <td>{ donorMatch?.CCFPersonnelID }</td>\r\n                <td>{ donorMatch?.Match }</td>\r\n              </tr>) }\r\n            </tbody>\r\n          </Table>\r\n        </Modal.Body>\r\n        <Modal.Footer>\r\n          <Button variant=\"secondary\" className=\"font-weight-bold px-4\" onClick={() => { this.props.onClose() }}>Create New</Button>\r\n          <Button variant=\"primary\" className=\"font-weight-bold px-4\" onClick={() => { this.props.onSubmit(this.state.selectedDonorMatch!) }} disabled={!this.state.selectedDonorMatch}>Confirm</Button>\r\n        </Modal.Footer>\r\n      </Modal>\r\n    )\r\n  }\r\n}\r\n","import { ObservableFromFetch } from \"../ObservableFromFetch\"\r\n\r\nexport interface OrderDefault {\r\n  OrderDefaultID?: number\r\n  ImplementationID: number\r\n  AccountID?: number\r\n  LookupCode: string\r\n  FieldName: string\r\n  DefaultValue?: string\r\n  Show: boolean\r\n  IsDefault: boolean\r\n  Disable: boolean\r\n}\r\n\r\nexport interface SaveOrderDefaults {\r\n  Defaults: OrderDefault[]\r\n}\r\n\r\ninterface GetResetDefaults {\r\n  ImplementationID: number,\r\n  AccountID?: number | string,\r\n  LookupCode: string\r\n}\r\n\r\nexport default function OrderDefaultsGet(data: GetResetDefaults) {\r\n  const requestBody: string = JSON.stringify(data)\r\n  return ObservableFromFetch<OrderDefault[]>(\"WorkforceOrder/GetOrderDefaults\", requestBody)\r\n}\r\n\r\nexport function OrderDefaultsSave(data: SaveOrderDefaults) {\r\n  const requestBody: string = JSON.stringify(data)\r\n  return ObservableFromFetch<string>(\"WorkforceOrder/SaveOrderDefaults\", requestBody )\r\n}\r\n\r\nexport function OrderDefaultsReset(data: GetResetDefaults)  {\r\n  const requestBody: string = JSON.stringify(data)\r\n  return ObservableFromFetch<string>(\"WorkforceOrder/ResetOrderDefaults\", requestBody )\r\n}","import * as React from \"react\"\r\nimport { Typeahead, AsyncTypeahead } from \"react-bootstrap-typeahead\"\r\nimport { Button, Form } from \"react-bootstrap\"\r\nimport { FaAngleDown } from \"react-icons/fa\"\r\nimport AutoFilterCompany from \"../../api/Companies/CompanyModel/AutoFilterCompany\"\r\nimport { concat, of, Subject, Subscription } from \"rxjs\"\r\nimport { catchError, debounceTime, filter, map, switchMap } from \"rxjs/operators\"\r\nimport { DataLoader } from \"../OrderRequests/GovCollection\"\r\nimport { RouteComponentProps, withRouter } from \"react-router\"\r\nimport { AutoFilterLocationsGet } from \"../../api/Location/AutoFilterLocationsGet\"\r\nimport { WorkforceClinicPortal } from \"../../AppState\"\r\n\r\ninterface LocationInputState {\r\n  locations: DataLoader<AutoFilterCompany>\r\n}\r\n\r\ninterface LocationInputProps {\r\n  defaultValue?: string\r\n  companyID: number\r\n  id?: string\r\n  disabled?: boolean\r\n  filter?: boolean\r\n  placeholder?: string\r\n  emptyLabel?: string\r\n  hideInactive?: boolean\r\n  onChange?: (items: AutoFilterCompany[]) => void\r\n}\r\n\r\nclass LocationInput extends React.PureComponent<LocationInputProps & RouteComponentProps, LocationInputState> {\r\n  locationAsyncTypeahead = React.createRef<AsyncTypeahead<AutoFilterCompany>>()\r\n  locationTypeahead = React.createRef<Typeahead<AutoFilterCompany>>()\r\n  locations$ = new Subject<string>()\r\n  subscription?: Subscription\r\n  state: LocationInputState = { locations: {} }\r\n  defaultLocationName: string = this.props.defaultValue || this.getLocationName()\r\n\r\n  componentDidMount() {\r\n    this.subscribeLocations()\r\n    this.onInputChange(this.defaultLocationName)\r\n  }\r\n\r\n  componentDidUpdate(prevProps: LocationInputProps & RouteComponentProps, prevState: LocationInputState) {\r\n    if (!this.defaultLocationName && this.props.location.pathname !== prevProps.location.pathname) {\r\n      this.locationAsyncTypeahead?.current?.clear()\r\n      this.onInputChange(\"\")\r\n    }\r\n  }\r\n\r\n  componentWillUnmount() {\r\n    this.subscription && this.subscription.unsubscribe()\r\n  }\r\n\r\n  onInputChange(value: string) {\r\n    if (value === \"\") {\r\n      this.setState({ locations: { selected: undefined } }, () => this.props.onChange && this.props.onChange([]))\r\n    }\r\n    else {\r\n      this.locations$.next(value)\r\n    }\r\n  }\r\n\r\n  getLocationName() {\r\n    const participation = sessionStorage.getItem(\"company-selection\")\r\n    const portals: WorkforceClinicPortal[] = JSON.parse(sessionStorage.getItem(\"wf2-STRY0045127-portals\") || \"{}\")\r\n    var company = undefined\r\n    for (const p of portals) {\r\n      for (const c of p.AssignedClientDetailsOfClinic) {\r\n        if (c.ParticipationID.toString() == participation) {\r\n          company = c\r\n          break\r\n        }\r\n      }\r\n      if (company) {\r\n        break\r\n      }\r\n    }\r\n    return company?.LocationName || \"\"\r\n  }\r\n\r\n  onChange = (locations: AutoFilterCompany[]) => {\r\n    const selectedLocation = locations[0]\r\n    this.setState({ locations: {...this.state.locations, selected: selectedLocation} })\r\n    this.props.onChange && this.props.onChange(locations)\r\n  }\r\n\r\n  subscribeLocations() {\r\n    this.subscription = this.locations$.pipe(\r\n      debounceTime(500),\r\n      filter(filter => filter.length >= 1 || filter.length === 0),\r\n      switchMap((filter) => filter.length === 0 ?\r\n        of({ loading: false, locations: this.state.locations.data }) :\r\n        concat(\r\n          of({ loading: true }),\r\n          AutoFilterLocationsGet(this.props.companyID, filter, !!this.props.hideInactive).pipe(\r\n            map((data) => ({ loading: false, locations: data })),\r\n            catchError(() => of({ loading: false }))\r\n          )\r\n        )\r\n      )\r\n    ).subscribe(\r\n      (state: { loading: boolean, locations?: AutoFilterCompany[] }) => {\r\n        state.locations ?\r\n          this.setState({ locations: { loading: state.loading, data: state.locations, selected: this.defaultLocationName ? state.locations[0] : undefined} }, () => this.defaultLocationName && this.onChange((state.locations || []))) :\r\n          this.setState({ locations: { loading: state.loading } })\r\n      },\r\n      () => this.setState({ locations: { loading: false } })\r\n    )\r\n  }\r\n\r\n  render() {\r\n    return (\r\n      <>\r\n        { !this.defaultLocationName ? <AsyncTypeahead\r\n          useCache={false}\r\n          disabled={this.props.disabled}\r\n          emptyLabel={this.props.emptyLabel || \"No Locations Found\"}\r\n          filterBy={(option, props) => this.props.filter ? props.selected.length > 0 || option.Name.toLowerCase().indexOf(props.text.toLowerCase()) !== -1 : true}\r\n          id={this.props.id || \"location\"}\r\n          isLoading={!!this.state.locations.loading}\r\n          labelKey=\"Name\"\r\n          minLength={0}\r\n          onInputChange={input => this.onInputChange(input)}\r\n          onChange={items => this.onChange(items)}\r\n          onSearch={() => { }}\r\n          options={this.state.locations.data || []}\r\n          placeholder={this.props.placeholder || \"Enter the Location name\"}\r\n          ref={this.locationAsyncTypeahead}\r\n          selected={this.state.locations.selected ? [this.state.locations.selected] : []}>\r\n          {!this.state.locations.loading && !this.props.disabled &&\r\n            <Button variant=\"toggle\" onClick={() => { this.locationAsyncTypeahead?.current?.toggleMenu() }}>\r\n              <FaAngleDown />\r\n            </Button>}\r\n        </AsyncTypeahead> : <Form.Control type=\"text\" disabled defaultValue={this.state.locations.selected?.Name || \"\"} />}\r\n      </>\r\n    )\r\n  }\r\n}\r\n\r\nexport default withRouter(LocationInput)\r\n","import { Component } from \"react\"\r\nimport { toast } from \"react-toastify\"\r\nimport { Container, Row, Col, Button, Modal, Form } from \"react-bootstrap\"\r\nimport { RouteComponentProps } from \"react-router\"\r\nimport { Subscription, forkJoin } from \"rxjs\"\r\nimport ServicesSelection from \"./ServicesSelection\"\r\nimport DonorInformation from \"./DonorInformation\"\r\nimport Schedule from \"./Schedule\"\r\nimport SiteSearch from \"../SiteSearch/SiteSearch\"\r\nimport CollectionSite from \"../../api/Location/LocationModel/CollectionSite\"\r\nimport OrderedServices from \"./OrderServices/OrderedServices\"\r\nimport { ServiceDataModel, DonorInformationModel, ScheduleModel, OTHER_REASON_TEXT, GetRegulatoryModeDonor, ServiceOrderedModel } from \"./OrderModels\"\r\nimport OrderRequestsHeader, { StepData } from \"./OrderRequestsHeader\"\r\nimport OrderSubmitObservable from \"../../api/OrderRequests/OrderSubmit\"\r\nimport SelectionInboxGridRow from \"../../api/Randoms/SelectionInboxModel/SelectionInboxGridRow\"\r\nimport PotentialDonorMatchModal from \"./PotentialDonorMatchModal\"\r\nimport FormatDate from \"../../formatters/FormatDate\"\r\nimport FormatPhone from \"../../formatters/FormatPhone\"\r\nimport ActionButton from \"../ActionButton\"\r\nimport CompanyInput from \"../FormattedInputs/CompanyInput\"\r\nimport { AppPageWrapper } from \"../NavMenu/AppPageWrapper\"\r\n\r\nimport AutoFilterCompany from \"../../api/Companies/CompanyModel/AutoFilterCompany\"\r\nimport { TestReasonsObservable, RegulatoryModeObservable } from \"../../api/OrderRequests/OrderRequestsConstraintGet\"\r\nimport { TestReasonType } from \"../../api/OrderRequests/OrderRequestsModel/TestReasonType\"\r\nimport { AdvanceSearchDonorGetObservable } from \"../../api/OrderRequests/SearchDonorGet\"\r\nimport { Donor } from \"../../api/OrderRequests/OrderRequestsModel/Donor\"\r\nimport OrderData from \"../../api/OrderRequests/OrderRequestsModel/OrderData\"\r\nimport SaveOrder from \"../../api/OrderRequests/OrderRequestsModel/SaveOrder\"\r\nimport { EmailRegexp, EventType, StorageKey } from \"../../config/Constants\"\r\nimport { AlcoholTestSampleType } from \"../../api/OrderRequests/OrderRequestsModel/AlcoholTestSampleType\"\r\nimport { FaChevronRight } from \"react-icons/fa\"\r\nimport { OrderFinishRoute, SSOOrderFinishRoute } from \"../../config/Routes\"\r\nimport ServicesGet, { ServiceTypesGet, AccountServicesGet } from \"../../api/Administration/OrderableServices\"\r\nimport ServiceType, { IsServiceTypeCodeAlcohol, IsServiceTypeCodeDrug, IsServiceTypeCodePhysical, IsServiceTypeCodeBackground, IsServiceTypeCodeOHS, IsServiceTypeCodeCHS } from \"../../api/Administration/Model/ServiceType\"\r\nimport Service, { IsServiceCodePOCT, IsServiceCodeFLEX } from \"../../api/Administration/Model/Service\"\r\nimport AccountService from \"../../api/Administration/Model/AccountService\"\r\nimport Checkbox from \"../Checkbox\"\r\nimport { GetOrderRequest, SSOOrderRequestData, GetOrderRequestData  } from \"../../api/OrderRequests/SSOOrderRequest\"\r\nimport { GetSSOToken } from \"../../storage/AuthToken\"\r\nimport { APIError } from \"../../api/ObservableFromFetch\"\r\nimport ConfirmationModal from \"../ConfirmationModal\"\r\nimport { AutoFilterLocationsGet } from \"../../api/Location/AutoFilterLocationsGet\"\r\nimport { AppState } from \"../../AppState\"\r\nimport { connect } from \"react-redux\"\r\nimport { GetSelectedAssignedClinic } from \"../../authentication/SelectedCompany/CompanySelectionDrivenSelectors\"\r\nimport OrderDefaultsGet, { OrderDefault } from \"../../api/Administration/OrderDefaults\"\r\nimport LocationInput from \"../FormattedInputs/LocationInput\"\r\nimport { FullBaseUrl } from \"../../api/ApiUrl\"\r\nimport RegulatoryMode from \"../../api/LabService/LabServiceModel/RegulatoryMode\"\r\nimport EmployeeCategory from \"../../api/LabService/LabServiceModel/EmployeeCategory\"\r\nimport { DefaultLookupCode } from \"../../api/LookupCodes/DefaultLookupCode\"\r\nimport { ServiceCode } from \"../../api/LookupCodes/ServiceCode\"\r\n\r\ninterface OrderRequestProps {\r\n  location: {\r\n    state?: {\r\n      formData?: SelectionInboxGridRow[]\r\n    }\r\n  }\r\n}\r\n\r\ninterface OrderRequestAuthProps {\r\n  isLocation?: boolean\r\n}\r\n\r\ninterface OrderRequestData {\r\n  issuerType: string\r\n  company?: string\r\n  location?: string\r\n  selectedCompany?: AutoFilterCompany\r\n  selectedLocation?: AutoFilterCompany\r\n  regulatoryModeObj?: RegulatoryMode\r\n  categoryObj?: EmployeeCategory\r\n  reasonObj?: TestReasonType\r\n  reasonOther?: string\r\n  reason?: string\r\n  donor: DonorInformationModel\r\n  services: ServiceDataModel[]\r\n  clinic?: CollectionSite\r\n  schedule: ScheduleModel\r\n}\r\n\r\ninterface OrderRequestState extends OrderRequestData {\r\n  formKey: string\r\n  step: number\r\n  isDonorInfoSuccess: boolean\r\n  showSiteSearch: boolean\r\n  showPotentialMatches: boolean\r\n  potentialDonorMatchList: Donor[]\r\n  nextServiceID: number,\r\n  isDonorValid: boolean\r\n  isServicesConfirmed: boolean\r\n  reasonsLoading: boolean\r\n  defaultsLoading: boolean\r\n  defaults: OrderDefault[]\r\n  pendingDefaults: OrderDefault[]\r\n  reasons: TestReasonType[]\r\n  filteredReasons: TestReasonType[]\r\n  idTypes: GetRegulatoryModeDonor[],\r\n  orderSubmitting: boolean\r\n  submittedOrder: boolean\r\n  orderableServiceTypes: ServiceType[]\r\n  orderableServices: Service[]\r\n  orderableAccountServices: AccountService[],\r\n  allowDonorClinicSelect: boolean\r\n  ssoOrderRequest?: SSOOrderRequestData\r\n  defaultAddress?: string\r\n  showDrugWarning: boolean\r\n  showLocations: boolean\r\n  email?: string\r\n  emailValid: boolean\r\n}\r\n\r\nexport interface TestData {\r\n  eventType: string\r\n  dot: boolean\r\n  testDetailID: string\r\n  labAccountNumber?: string\r\n  panelID?: number\r\n  regulatoryModeID?: number\r\n  employeeCategoryID?: number\r\n}\r\n\r\nexport interface DonorData {\r\n  PersonID: number\r\n  FirstName: string\r\n  LastName: string\r\n  DonorID: string\r\n  IDType: string\r\n  MockDonorID: string\r\n}\r\n\r\nconst IssuerTypeIndividual = \"individual\"\r\nconst RandomReason = \"Random\"\r\nconst FMCSARegulatoryMode = \"FMCSA\"\r\nconst DefaultExpirationHours: number = 72\r\nconst emptyDonor: DonorInformationModel = {\r\n  idType: undefined,\r\n  idTypeObj: undefined,\r\n  state: undefined,\r\n  stateCode: undefined,\r\n  donorId: undefined,\r\n  firstName: undefined,\r\n  middleInitial: undefined,\r\n  lastName: undefined,\r\n  eveningPhone: undefined,\r\n  daytimePhone: undefined,\r\n  birthdate: undefined\r\n}\r\nconst emptySchedule: ScheduleModel = {\r\n  timezone: undefined,\r\n  overrideAllowed: false,\r\n  hoursUntilExpires: undefined,\r\n  expirationDate: undefined,\r\n  formattedExpirationDate: \"\",\r\n  displayExpirationDate: \"\",\r\n  comment: \"\",\r\n  proceedImmediately:false,\r\n  extendExpirationHours: 0\r\n}\r\nconst emptyData: OrderRequestData = {\r\n  issuerType: IssuerTypeIndividual, // In Angular app for Non-MCP users it is only choice and it is selected by default\r\n  company: undefined,\r\n  location: undefined,\r\n  selectedCompany: undefined,\r\n  reasonObj: undefined,\r\n  reasonOther: undefined,\r\n  reason: undefined,\r\n  donor: { ...emptyDonor },\r\n  services: [],\r\n  clinic: undefined,\r\n  schedule: { ...emptySchedule }\r\n}\r\n\r\nconst buildOrderRequestData = (orderFormData?: SelectionInboxGridRow[]) => ({\r\n  ...emptyData,\r\n  company: orderFormData ? orderFormData[0]?.CompanyName : undefined,\r\n  location: orderFormData ? orderFormData[0]?.LocationName : undefined,\r\n  reason: orderFormData ? RandomReason : undefined,\r\n  donor: {\r\n    ...emptyDonor,\r\n    idType: orderFormData ? orderFormData[0]?.IDType : undefined,\r\n    donorId: orderFormData ? orderFormData[0]?.DonorID : undefined,\r\n  }\r\n})\r\n\r\nexport class OrderRequest extends Component<OrderRequestProps & OrderRequestAuthProps, OrderRequestState> {\r\n  orderRequestToken = GetSSOToken()\r\n  showAlcoholSection: boolean = false\r\n  showDrugSection: boolean = false\r\n  showPhysicalSection: boolean = false\r\n  showOHSSection: boolean = false\r\n  showCHSSection: boolean = false\r\n  completingPendingOrders: boolean = false\r\n  drugTestData?: TestData\r\n  alcoholTestData?: TestData\r\n  orderFormData?: SelectionInboxGridRow[]\r\n  donorData?: DonorData\r\n\r\n  constructor(props: OrderRequestProps) {\r\n    super(props)\r\n\r\n    this.orderFormData = props.location.state?.formData\r\n    if (this.orderFormData) {\r\n      this.completingPendingOrders = true\r\n      this.donorData = {\r\n        PersonID: this.orderFormData[0].PersonID,\r\n        FirstName: this.orderFormData[0].FirstName,\r\n        LastName: this.orderFormData[0].LastName,\r\n        DonorID: this.orderFormData[0].DonorID,\r\n        IDType: this.orderFormData[0].IDType,\r\n        MockDonorID: this.orderFormData[0].MockDonorID\r\n      }\r\n      this.orderFormData.forEach(data => {\r\n        if (data.EventType === EventType.Urine || data.EventType === \"SD\") {\r\n          this.showDrugSection = true\r\n          this.drugTestData = {\r\n            eventType: data.EventType,\r\n            dot: data.DOT,\r\n            testDetailID: data.TestDetailID,\r\n            labAccountNumber: data.LabAccountNumber,\r\n            panelID: data.PanelID,\r\n            regulatoryModeID: data.RegulatoryModeID,\r\n            employeeCategoryID: data.EmployeeCategoryID\r\n          }\r\n        } else if (data.EventType === EventType.Breath || data.EventType === EventType.Saliva) {\r\n          this.showAlcoholSection = true\r\n          this.alcoholTestData = {\r\n            eventType: data.EventType,\r\n            dot: data.DOT,\r\n            testDetailID: data.TestDetailID,\r\n            regulatoryModeID: data.RegulatoryModeID,\r\n            employeeCategoryID: data.EmployeeCategoryID\r\n          }\r\n        }\r\n      })\r\n    } else {\r\n      this.showDrugSection = true\r\n      this.showAlcoholSection = true\r\n      this.showPhysicalSection = true\r\n      this.showOHSSection = true\r\n      this.showCHSSection = true\r\n      this.completingPendingOrders = false\r\n    }\r\n\r\n    const data = buildOrderRequestData(this.orderFormData)\r\n    this.state = {\r\n      ...data,\r\n      formKey: \"OrderRequestForm\",\r\n      step: 1,\r\n      showSiteSearch: false,\r\n      isDonorInfoSuccess: false,\r\n      showPotentialMatches: false,\r\n      potentialDonorMatchList: [],\r\n      nextServiceID: 1,\r\n      services: [],\r\n      isDonorValid: false,\r\n      isServicesConfirmed: false,\r\n      reasonsLoading: false,\r\n      defaultsLoading: false,\r\n      defaults: [],\r\n      pendingDefaults: [],\r\n      reasons: [],\r\n      filteredReasons: [],\r\n      idTypes: [],\r\n      submittedOrder: false,\r\n      orderSubmitting: false,\r\n      orderableServiceTypes: [],\r\n      orderableServices: [],\r\n      orderableAccountServices: [],\r\n      showDrugWarning: false,\r\n      showLocations: false,\r\n      emailValid: true,\r\n      allowDonorClinicSelect: false\r\n    }\r\n  }\r\n\r\n  subscriptions = new Subscription()\r\n  advanceSearchDonorSubscription?: Subscription\r\n  loaInitialDataSubscription?: Subscription\r\n  loadAccountServicesSubscription?: Subscription\r\n  loadLocationsSubscription?: Subscription\r\n\r\n  componentDidMount() {\r\n    this.loadInitialData()\r\n\r\n    if (this.isSSO()) {\r\n      this.subscriptions.add(\r\n        GetOrderRequest(this.orderRequestToken).subscribe(\r\n          data => this.parseOrderRequest(data.RequestText),\r\n          error => this.handleAPIError(error, {})\r\n        )\r\n      )\r\n    }\r\n  }\r\n\r\n  parseOrderRequest = (text: string) => {\r\n    const request: SSOOrderRequestData = JSON.parse(text)\r\n    this.setState({ ssoOrderRequest: request, defaultAddress: this.formatAddress(request) })\r\n  }\r\n\r\n  formatAddress = (ssoOrderRequest: SSOOrderRequestData) => {\r\n    const address = ssoOrderRequest?.Donor?.Address\r\n    return address ? `${address.Line1}, ${address.City} ${address.State}` : \"\"\r\n  }\r\n\r\n  isSSO = () => {\r\n    return this.orderRequestToken !== \"\"\r\n  }\r\n\r\n  loadInitialData() {\r\n    this.loaInitialDataSubscription && this.loaInitialDataSubscription.unsubscribe()\r\n    this.setState({ reasonsLoading: true })\r\n    this.loaInitialDataSubscription = forkJoin({\r\n      orderableServiceTypes: ServiceTypesGet(),\r\n      orderableServices: ServicesGet(),\r\n      reasons: TestReasonsObservable()\r\n    }).subscribe(\r\n      ({ orderableServiceTypes, orderableServices, reasons }) => {\r\n        this.setState({ \r\n          orderableServiceTypes: orderableServiceTypes,\r\n          orderableServices: orderableServices,\r\n          reasons: reasons,\r\n          filteredReasons: reasons,\r\n          reasonsLoading: false,\r\n          reasonObj: this.orderFormData && reasons.find(item => item.Description === RandomReason)\r\n        })\r\n      },\r\n      (error) => this.handleAPIError(error, { companiesLoading: false, reasonsLoading: false })\r\n    )\r\n  }\r\n\r\n  loadAllDefaults = (accountID: number) => {\r\n    if (this.completingPendingOrders || this.orderFormData) {\r\n      return\r\n    }\r\n    this.setState({ defaultsLoading: true })\r\n    this.subscriptions.add(\r\n      OrderDefaultsGet({ ImplementationID:  0, AccountID: accountID, LookupCode: \"\" }).subscribe(\r\n        data => {\r\n          this.populateDefaults(data)\r\n          this.setState({ defaults: data, defaultsLoading: false }, () => this.filterFields())\r\n        },\r\n        error => this.handleAPIError(error, { defaultsLoading: false })\r\n      )\r\n    )\r\n  }\r\n  loadPendingDefaults = (accountID: number) => {\r\n    if (!this.completingPendingOrders || accountID <= 0) {\r\n      return\r\n    }\r\n    this.setState({ defaultsLoading: true })\r\n    this.subscriptions.add(\r\n      OrderDefaultsGet({ ImplementationID: 0, AccountID: accountID, LookupCode: \"\" }).subscribe(\r\n        data => {\r\n          this.populateDefaults(data)\r\n          this.setState({ pendingDefaults: data, defaultsLoading: false })\r\n        },\r\n        error => this.handleAPIError(error, { defaultsLoading: false })\r\n      )\r\n    )\r\n  }\r\n\r\n  populateDefaults = (defaults: OrderDefault[]) => {\r\n    if (!Array.isArray(defaults)) {\r\n      return\r\n    }\r\n    this.populateDefaultExpTime(defaults)\r\n\r\n  }\r\n\r\n  populateDefaultExpTime = (defaults: OrderDefault[]) => {\r\n    if (!Array.isArray(defaults)) {\r\n      return\r\n    }\r\n    let defaultExpTime = defaults.find(item => item.LookupCode === DefaultLookupCode.ExpTime && !!item.AccountID)\r\n    if (!defaultExpTime) {\r\n      defaultExpTime = defaults.find(item => item.LookupCode === DefaultLookupCode.ExpTime && !item.AccountID)\r\n    }\r\n    if (!defaultExpTime) {\r\n      let accountId = 0\r\n      const selectedCompany = this.state.selectedCompany\r\n      if (selectedCompany) {\r\n        accountId = selectedCompany.AccountID\r\n      }\r\n      defaultExpTime = {\r\n        OrderDefaultID: 0,\r\n        ImplementationID: 0,\r\n        AccountID: accountId,\r\n        LookupCode: DefaultLookupCode.ExpTime,\r\n        FieldName: \"\",\r\n        DefaultValue: DefaultExpirationHours.toString(),\r\n        Show: false,\r\n        IsDefault: false,\r\n        Disable: false\r\n      }\r\n      defaults.push(defaultExpTime)\r\n    }\r\n    const defaultValue = defaultExpTime.DefaultValue || \"\"\r\n    if (defaultValue === \"\") {\r\n      defaultExpTime.DefaultValue = DefaultExpirationHours.toString()\r\n    }\r\n  }\r\n\r\n  filterFields = () => {\r\n    let reasonsDefaults = this.state.defaults.filter(item => item.LookupCode === DefaultLookupCode.TestReason && !!item.AccountID)\r\n    if (reasonsDefaults.length === 0) reasonsDefaults = this.state.defaults.filter(item => item.LookupCode === DefaultLookupCode.TestReason && !item.AccountID)\r\n    if (reasonsDefaults.length > 0) {\r\n      let filteredReasons: TestReasonType[] = []\r\n      const defaultReason = reasonsDefaults.find(item => !!item.Show && !!item.IsDefault)\r\n      this.state.reasons.forEach((item, index) => {\r\n        const def = reasonsDefaults.find(el => el.FieldName === item.Description)\r\n        if (!def || def?.Show) filteredReasons.push(item)\r\n      })\r\n      this.setState({ filteredReasons: filteredReasons })\r\n      if (defaultReason) this.onReasonChange(defaultReason.FieldName)\r\n    }\r\n    else {\r\n      this.setState({ filteredReasons: [...this.state.reasons], })\r\n    }\r\n  }\r\n\r\n  defaultExpirationTime = () => {\r\n    let defaults = this.state.defaults\r\n    if (this.completingPendingOrders) {\r\n      defaults = this.state.pendingDefaults\r\n    }\r\n    let def = defaults.find(item => item.LookupCode === DefaultLookupCode.ExpTime && !!item.AccountID)\r\n    if (!def) {\r\n      def = defaults.find(item => item.LookupCode === DefaultLookupCode.ExpTime && !item.AccountID)\r\n    }\r\n    return def\r\n  }\r\n\r\n  loadAccountServices = (implementationID: number, accountID?: number) => {\r\n    this.loadAccountServicesSubscription && this.loadAccountServicesSubscription.unsubscribe()\r\n    let accountServices: AccountService[] = []\r\n    this.loadAccountServicesSubscription = AccountServicesGet(implementationID, accountID).subscribe(\r\n      data => {\r\n        if (data?.length) {\r\n          accountServices = data\r\n        }\r\n        else {\r\n          if (accountID) {\r\n            this.loadAccountServices(implementationID)\r\n          }\r\n          else {\r\n            accountServices = this.state.orderableServices.map(service => { return { AccountServiceID: 0, ImplementationID: implementationID, ServiceID: service.ServiceID, Active: false, IsDefault: false } })\r\n          }\r\n        }\r\n        if (accountServices.length) {\r\n          this.setState({ orderableAccountServices: accountServices, services: [], isServicesConfirmed: false })\r\n        }\r\n      },\r\n      (error) => this.handleAPIError(error, {})\r\n    )\r\n  }\r\n\r\n  loadLocations = (accountID: number) => {\r\n    this.loadLocationsSubscription && this.loadLocationsSubscription.unsubscribe()\r\n    this.loadLocationsSubscription = AutoFilterLocationsGet(accountID, \"\", true).subscribe(\r\n      data => {\r\n        const showLocations = data.length > 0\r\n        if (this.props.isLocation) {\r\n          const locationName = this.state.location || data[0]?.Name || \"\"\r\n          this.setState({ showLocations: showLocations, location: locationName })\r\n        }\r\n        else {\r\n          this.setState({ showLocations: showLocations })\r\n        }\r\n      },\r\n      error => this.handleAPIError(error, { companiesLoading: false })\r\n    )\r\n  }\r\n\r\n  componentWillUnmount() {\r\n    this.subscriptions.unsubscribe()\r\n    this.advanceSearchDonorSubscription && this.advanceSearchDonorSubscription.unsubscribe()\r\n    this.loaInitialDataSubscription && this.loaInitialDataSubscription.unsubscribe()\r\n    this.loadAccountServicesSubscription && this.loadAccountServicesSubscription.unsubscribe()\r\n    this.loadLocationsSubscription && this.loadLocationsSubscription.unsubscribe()\r\n  }\r\n\r\n  handleAPIError = (error: Error | APIError, stateChanges: object) => {\r\n    this.setState(stateChanges)\r\n    error && toast.error((error as APIError)?.errorData?.message || error.message)\r\n  }\r\n\r\n  resetForm = () => {\r\n    const data = buildOrderRequestData(this.orderFormData)\r\n    const company = data.company || this.state.selectedCompany?.Name || \"\"\r\n    const selectedCompany = company ? this.state.selectedCompany : undefined\r\n    const reasonObj = data.reason ? this.state.reasons.find(item => item.Description === data.reason) : undefined\r\n    const idTypeObj = data.donor.idType ? this.state.idTypes.find(item => item.PrimaryIDType === data.donor.idType) : undefined\r\n\r\n    this.setState({\r\n      ...data,\r\n      formKey: Math.random().toString(),\r\n      company: company,\r\n      selectedCompany: selectedCompany,\r\n      reasonObj: reasonObj,\r\n      clinic: undefined,\r\n      donor: { ...data.donor, idTypeObj: idTypeObj },\r\n      step: 1,\r\n      showSiteSearch: false,\r\n      isDonorInfoSuccess: false,\r\n      showPotentialMatches: false,\r\n      potentialDonorMatchList: [],\r\n      nextServiceID: 1,\r\n      isDonorValid: false,\r\n      isServicesConfirmed: false,\r\n      submittedOrder: false,\r\n      orderSubmitting: false\r\n    })\r\n  }\r\n\r\n  onCompanyChange = (companies: AutoFilterCompany[]) => {\r\n    const selectedCompany = companies[0]\r\n    if (selectedCompany) {\r\n      this.loadAccountServices(selectedCompany?.ImplementationID || 0, selectedCompany.AccountID)\r\n      this.loadAllDefaults(selectedCompany.AccountID)\r\n      this.loadPendingDefaults(selectedCompany.AccountID)\r\n      this.setState({ company: selectedCompany?.Name, selectedCompany: selectedCompany, showLocations: false, selectedLocation: undefined, reasonObj: (this.orderFormData ? this.state.reasonObj : undefined), reason: (this.orderFormData ? this.state.reason : undefined), reasonOther: undefined })\r\n      this.loadLocations(selectedCompany.AccountID)\r\n    }\r\n    else {\r\n      this.setState({ selectedCompany: selectedCompany, reasonObj: undefined, reason: undefined, reasonOther: undefined, services: [], orderableAccountServices: [], isServicesConfirmed: false })\r\n    }\r\n  }\r\n\r\n  onLocationChange = (locations: AutoFilterCompany[]) => {\r\n    const selectedLocation = locations[0]\r\n    this.setState({ selectedLocation: selectedLocation })\r\n    if (selectedLocation) {\r\n      this.setState({ selectedLocation: selectedLocation, services: [], isServicesConfirmed: false })\r\n    }\r\n    else {\r\n      this.setState({ selectedLocation: selectedLocation })\r\n    }\r\n  }\r\n\r\n  onReasonChange = (value: string) => {\r\n    const reasonObject = this.state.reasons?.find((item: TestReasonType) => item.Description === value)\r\n    this.setState({ reason: reasonObject?.Description, reasonObj: reasonObject, submittedOrder: false })\r\n  }\r\n  onDonorChange = (donor: DonorInformationModel, isValid: boolean, isDonorInfoSuccess: boolean) => this.setState({ donor: donor, isDonorValid: isValid, isDonorInfoSuccess: isDonorInfoSuccess, submittedOrder: false, email: donor.email })\r\n  onScheduleChange = (schedule: ScheduleModel) => this.setState({ schedule: schedule, submittedOrder: false })\r\n\r\n  hasDragService = (services: ServiceDataModel[], isDot: boolean) => services.find(service => IsServiceTypeCodeDrug(service.serviceTypeCode) && service.isDOT === isDot)\r\n\r\n  onAddService = (data: ServiceDataModel) => {\r\n    // Add service to list\r\n    // Reset confirmation status\r\n    const { services, nextServiceID } = this.state\r\n    \r\n    let newServices = [ ...services ]\r\n    let newServiceID = nextServiceID\r\n\r\n    if(data.selectedServices.length > 0) {\r\n      data.selectedServices.map((service) => {\r\n        if (!newServices.find((s) => s.serviceCode === service.FFServiceCode)){\r\n          newServices.push({\r\n            ...data,\r\n            id: newServiceID++,\r\n            serviceCode: service.FFServiceCode as ServiceCode,\r\n            isDOT: service.DOT,\r\n            isMarketplace: service.Marketplace,\r\n          })\r\n        }\r\n      })\r\n    } else {\r\n      newServices = [...services, ...[{...data, id: newServiceID++}]]\r\n    }\r\n    \r\n    const showDrugWarning = \r\n      IsServiceTypeCodeDrug(data.serviceTypeCode) &&\r\n      !!this.hasDragService(services, true) && !!this.hasDragService(services, false) &&\r\n      (!this.hasDragService(this.state.services, true) || !this.hasDragService(this.state.services, false))\r\n\r\n    const modeObj = !!this.state.regulatoryModeObj ? this.state.regulatoryModeObj : data.regulatoryModeObj\r\n    const catObj = !!this.state.categoryObj ? this.state.categoryObj : data.categoryObj\r\n\r\n    this.setState({\r\n      showDrugWarning: showDrugWarning,\r\n      nextServiceID: newServiceID,\r\n      services: newServices,\r\n      isServicesConfirmed: false,\r\n      submittedOrder: false,\r\n      regulatoryModeObj: modeObj,\r\n      categoryObj: catObj,\r\n    })\r\n  }\r\n\r\n  onRemoveService = (id: number) => {\r\n    // Remove service from list\r\n    // Reset confirmation status\r\n    const services = this.state.services.filter(item => item.id !== id)\r\n\r\n    if (services.length === 0) {\r\n      this.setState({ services: services, isServicesConfirmed: false, submittedOrder: false, regulatoryModeObj: undefined, categoryObj: undefined })\r\n    }\r\n    {\r\n      this.setState({ services: services, isServicesConfirmed: false, submittedOrder: false })\r\n    }\r\n  }\r\n\r\n  onConfirmServices = () => this.setState({ isServicesConfirmed: true })\r\n\r\n  // Navigation methods\r\n  onCancel = () => {\r\n    localStorage.removeItem(StorageKey.SavedOrderData)\r\n    localStorage.removeItem(StorageKey.OrderedServices)\r\n    localStorage.removeItem(StorageKey.CanViewOrderFinish)\r\n    if (this.props.location.state?.formData) {\r\n      (this.props as RouteComponentProps).history.goBack()\r\n    } else {\r\n      this.resetForm()\r\n    }\r\n  }\r\n\r\n  handleAllowDonorClinicSelect = (event: React.ChangeEvent<HTMLInputElement>) => {\r\n    const lastValue = this.state.allowDonorClinicSelect\r\n    if(!this.isSSO()){\r\n      this.setState({ allowDonorClinicSelect: event.target.checked, schedule: (lastValue ?  { ...emptySchedule } : this.state.schedule)})\r\n      return\r\n    }\r\n    let donor_email = this.state.email || \"\"\r\n    if(donor_email === \"\"){\r\n        donor_email = this.state.ssoOrderRequest?.Donor?.Donoremail || \"\"\r\n    } \r\n    this.setState({ \r\n      allowDonorClinicSelect: event.target.checked, schedule: (lastValue ?  { ...emptySchedule } : this.state.schedule),\r\n      email: donor_email, emailValid: this.isEmailValid(donor_email)\r\n   })\r\n  }\r\n\r\n  getIdTypes = () => {\r\n    this.subscriptions.add(\r\n      RegulatoryModeObservable(this.regulatoryModeFromServices()).subscribe(\r\n        results => this.setState({ idTypes: results }),\r\n        error => toast.error(error)\r\n      )\r\n    )\r\n  }\r\n\r\n  onGoToStep1 = () => this.setState({ step: 1 })\r\n  onGoToStep2 = () => {\r\n    this.setState({ step: 2 })\r\n    this.getIdTypes()\r\n  }\r\n\r\n  onSubmit = () => {\r\n    if (this.state.isDonorInfoSuccess) {\r\n      this.saveOrder()\r\n    }\r\n    else {\r\n      this.advanceSearchDonorSubscription && this.advanceSearchDonorSubscription.unsubscribe()\r\n      const params = {\r\n        CompanyID: this.state.selectedCompany?.AccountID || 0,\r\n        DayTimePhone: this.state.donor?.daytimePhone || \"\",\r\n        EveningPhone: this.state.donor?.eveningPhone || \"\",\r\n        Mobile: null,\r\n        RegulatoryModeID: this.regulatoryModeFromServices(),\r\n        LastName: this.state.donor?.lastName,\r\n        DateOfBirth: this.state.donor?.birthdate ? FormatDate(this.state.donor?.birthdate) : undefined\r\n      }\r\n      this.advanceSearchDonorSubscription = AdvanceSearchDonorGetObservable(params).subscribe(\r\n        (response: Donor[]) => {\r\n          if (response.length) {\r\n            this.setState({ potentialDonorMatchList: response, showPotentialMatches: true })\r\n          }\r\n          else {\r\n            this.saveOrder()\r\n          }\r\n        },\r\n        (error: string) => toast.error(error)\r\n      )\r\n    }\r\n  }\r\n\r\n  // TODO: Verify logic src\\app\\pages\\order\\order.component.ts:2793\r\n  regulatoryModeFromServices = () => this.state.services.find(item => item.isDOT && item.regulatoryModeObj)?.regulatoryModeObj?.RegulatoryModeID || 0\r\n  categoryFromServices = () => this.state.services.find(item => item.isDOT && item.categoryObj)?.categoryObj?.EmployeeCategoryID || 0\r\n\r\n  saveOrder() {\r\n    const formatPhone = (phone?: string) => {\r\n      if (!phone || phone === \"np\" || phone === \"n/p\" || phone === \"NP\" || phone === \"N/P\") {\r\n        return \"N/P\"\r\n      }\r\n      return phone.replace(/-/g, \"\")\r\n    }\r\n\r\n    const formatDate = (date?: Date) => {\r\n      if (!date) {\r\n        return \"\"\r\n      }\r\n      return FormatDate(date)\r\n    }\r\n\r\n    const order: SaveOrder = {\r\n      MultipleDrug: [],\r\n      MultipleAlcohol: this.state.services.filter(service => IsServiceTypeCodeAlcohol(service.serviceTypeCode)).map((service) => { return { DOT: !!service.isDOT, SampleTypeID: (service.testToPerformObj as AlcoholTestSampleType).SampleTypeID } }),\r\n      MultiplePOCT: [],\r\n      MultipleClinical: [],\r\n      MultiplePhysical: {},\r\n      POCTCount: 0,\r\n      CollectionVendorID: this.state.clinic?.VendorID || \"\",\r\n      FormFoxVendorAN: this.state.clinic?.FormFoxVendorAN || 0,\r\n      Collector: {\r\n        VendorID: this.state.clinic?.VendorID || 0,\r\n        ParentVendorID: this.state.clinic?.ParentVendorID || null,\r\n        FFID: this.state.clinic?.FFID || \"\",\r\n        Name: this.state.clinic?.Name || \"\",\r\n        Code: this.state.clinic?.Code || \"\",\r\n        Type: this.state.clinic?.Type || null,\r\n        Address1: this.state.clinic?.Address1 || \"\",\r\n        Address2: this.state.clinic?.Address2 || \"\",\r\n        City: this.state.clinic?.City || \"\",\r\n        State: this.state.clinic?.State || \"\",\r\n        Zip: this.state.clinic?.Zip || \"\",\r\n        Phone: this.state.clinic?.Phone || \"\",\r\n        HoursOfOperation: this.state.clinic?.HoursOfOperation || \"\",\r\n        Private: this.state.clinic?.Private || false,\r\n        Distance: this.state.clinic?.Distance || 0,\r\n        Latitude: this.state.clinic?.Latitude || 0,\r\n        Longitude: this.state.clinic?.Longitude || 0,\r\n        UseDOTForm: this.state.clinic?.UseDOTForm || false,\r\n        FFEnabled: this.state.clinic?.FFEnabled || false,\r\n        OutOfNetwork: this.state.clinic?.OutOfNetwork || false,\r\n        iVendorID: this.state.clinic?.iVendorID || 0,\r\n        SiteID: this.state.clinic?.SiteID || null,\r\n        Fax: this.state.clinic?.Fax || \"\",\r\n        IsMarketPlace: this.state.clinic?.IsMarketPlace || false,\r\n      },\r\n      CollectorPhone: null,\r\n      CollectorVendorName: this.state.clinic?.Name || \"\",\r\n      ConfirmDeviceCode: \"\",\r\n      ConfirmDeviceDescription: \"\",\r\n      ConfirmDeviceExpirationDate: null,\r\n      ConfirmDeviceID: null,\r\n      ConfirmDeviceSerialNumber: \"\",\r\n      EventData: {\r\n        AccountID: this.state.selectedCompany?.AccountID || 0,\r\n        CompanyID: this.state.selectedCompany?.AccountID || 0,\r\n        CompanyCode: this.state.selectedCompany?.Code || \"\",\r\n        CompanyFullName: this.state.selectedCompany?.Code ? `${this.state.selectedCompany?.Name || \"\"} (${this.state.selectedCompany?.Code || \"\"})` : \"\",\r\n        CompanyName: this.state.selectedCompany?.Name || \"\",\r\n        DateOrdered: \"\",\r\n        DateScheduled: \"\",\r\n        ExpirationDate: this.state.schedule.formattedExpirationDate,\r\n        LocationID: this.state.selectedLocation?.AccountID.toString() || \"\",\r\n        PrimaryID: (this.state.donor.donorId || \"\").replace(/-/g, \"\"),\r\n        PrimaryIDRank: this.state.donor.idTypeObj?.Rank || 0,\r\n        PrimaryIDType: this.state.donor.idTypeObj?.PrimaryIDType || \"\",\r\n        RegulatoryModeID: this.regulatoryModeFromServices(),\r\n        EmployeeCategoryID: this.categoryFromServices(),\r\n        RegionID: \"\",\r\n        RegionName: \"\",\r\n        TimeZone: this.state.schedule.timezone,\r\n        AllowDonorClinicSelect: this.state.allowDonorClinicSelect || false,\r\n        ProceedImmediately: this.state.schedule.proceedImmediately,\r\n        ExtendExpirationHours: this.state.schedule.extendExpirationHours || 0\r\n      },\r\n      Panel: {\r\n        PanelID: \"\",\r\n        Description: \"\",\r\n        Code: \"\",\r\n        ClientID: \"\",\r\n        BeginEffectiveDate: \"\",\r\n        EndEffectiveDate: \"\",\r\n        UserLogin: \"\",\r\n        UpdateMethod: \"\",\r\n        UpdateDate: \"\"\r\n      },\r\n      PanelDescription: \"\",\r\n      IsAlcohol: \"\",\r\n      IsAssociatedWithPool: false,\r\n      IsCompleted: false,\r\n      IsDrug: \"\",\r\n      IsBackground: false,\r\n      IsNew: false,\r\n      IsPhysical: false,\r\n      IsAudiogram: false,\r\n      IsPoct: false,\r\n      IsRandom: false,\r\n      IsReleased: false,\r\n      LaboratoryVendorCode: \"\",\r\n      LaboratoryVendorID: \"\",\r\n      LaboratoryVendorName: \"\",\r\n      LabPanelID: 0,\r\n      TestReasonID: this.state.reasonObj?.TestReasonID || 0,\r\n      TestReasonDescription: this.state.reasonObj?.Description || \"\",\r\n      TestTypeDescription: this.state.services.some(item => IsServiceTypeCodeDrug(item.serviceTypeCode)) ? \"Drug\" : \"\",\r\n      TestTypeID: this.state.services.some(item => IsServiceTypeCodeDrug(item.serviceTypeCode)) ? 1 : 0,\r\n      SampleTypeID: \"\",\r\n      SampleTypeDescription: \"\",\r\n      Labbased: this.state.services.some(item => IsServiceTypeCodeDrug(item.serviceTypeCode)),\r\n      OrderComment: this.state.schedule.comment,\r\n      SplitSpecimen: \"\",\r\n      Observed: \"\",\r\n      DOT: this.state.services.some(item => item.isDOT),\r\n      Normal: \"\",\r\n      SampleTypeCode: \"\",\r\n      PersonDetail: {\r\n        PersonID: this.state.donor.personId || 0,\r\n        DateOfBirth: formatDate(this.state.donor.birthdate),\r\n        HomePhone: formatPhone(this.state.donor.eveningPhone),\r\n        CellPhone: \"\",\r\n        WorkPhone: formatPhone(this.state.donor.daytimePhone),\r\n        MiddleInitial: (this.state.donor.middleInitial || \"\").substring(0,1),\r\n        AlternateID: \"\",\r\n        DriverID: \"\",\r\n        EmployerID: \"\",\r\n        SSN: \"\",\r\n        FirstName: this.state.donor.firstName || \"\",\r\n        LastName: this.state.donor.lastName || \"\",\r\n        CCFPersonnelID: (this.state.donor.donorId || \"\").replace(/-/g, \"\"),\r\n        MockCCFPersonnelID: this.orderFormData ? this.orderFormData[0].MockDonorID : \"\",\r\n        DriverLicStateOfIssue: this.state.donor?.stateCode || this.state.donor?.state?.Abbreviation || \"\",\r\n        Email: this.state.email || \"\"\r\n      },\r\n      MockAlcoholTestDetailID: this.alcoholTestData?.testDetailID || \"\",\r\n      MockDrugTestDetailID: this.drugTestData?.testDetailID || \"\",\r\n      PoolMembersID: this.orderFormData ? this.orderFormData[0]?.PoolMembersID : undefined,\r\n      SSOToken: this.orderRequestToken,\r\n      BaseUrl:  FullBaseUrl(),\r\n    }\r\n\r\n    if (this.orderRequestToken) {\r\n      order.PersonDetail.Address = this.state.donor.address\r\n    }\r\n\r\n    if (this.state.services.some(item => IsServiceTypeCodePhysical(item.serviceTypeCode))) {\r\n      order.MultiplePhysical.DOT = this.state.services.find(item => IsServiceTypeCodePhysical(item.serviceTypeCode))?.isDOT\r\n      order.IsPhysical = true\r\n    }\r\n\r\n    this.state.services.filter(service => IsServiceTypeCodeDrug(service.serviceTypeCode)).forEach((service) => {\r\n      const is_poct = IsServiceCodePOCT(service.serviceCode)\r\n      const is_flex = IsServiceCodeFLEX(service.serviceCode)\r\n      order.MultipleDrug.push(\r\n        {\r\n          DOT: !!service.isDOT,\r\n          IsPoct: is_poct || is_flex,\r\n          IsFlex: is_flex,\r\n          SplitSpecimen: service.reqSpecimenCollection === \"single\" ? false : true,\r\n          Observed: service.observedCollection,\r\n          Normal: !service.observedCollection,\r\n          RegulatoryModeID: service.regulatoryModeObj?.RegulatoryModeID || \"\",\r\n          RegulatoryModeName: service.regulatoryModeObj?.Name || \"\",\r\n          EmployeeCategoryID: service.categoryObj?.EmployeeCategoryID || \"\",\r\n          EmployeeCategoryName: service.categoryObj?.Name || \"\",\r\n          LabAccountNumber: service.labAccountObj?.LabAccount || \"\",\r\n          LaboratoryVendorCode: service.labAccountObj?.LabCode || \"\",\r\n          LaboratoryVendorID: service.labAccountObj?.LabClientMemberId || 0,\r\n          LabPanelID: service.testToPerformObj?.PanelID || 0,\r\n          PanelDescription: service.testToPerformObj?.Description || \"\",\r\n          PanelCode: service.testToPerformObj?.Code || \"\",\r\n          SampleTypeCode: service.testToPerformObj?.SampleTypeCode || \"\",\r\n        }\r\n      )\r\n    })\r\n\r\n    this.state.services.filter(service => IsServiceTypeCodeOHS(service.serviceTypeCode) || IsServiceTypeCodeCHS(service.serviceTypeCode)).forEach((service) => {\r\n      order.MultipleClinical.push({\r\n          DOT: !!service.isDOT,\r\n          IsPoct: false,\r\n          SplitSpecimen: false,\r\n          Observed: false,\r\n          Normal: true,\r\n          RegulatoryModeID: \"\",\r\n          RegulatoryModeName: \"\",\r\n          EmployeeCategoryID: \"\",\r\n          EmployeeCategoryName: \"\",\r\n          LabAccountNumber: service.labAccountObj?.LabAccount || \"\",\r\n          LaboratoryVendorCode: service.labAccountObj?.LabCode || \"\",\r\n          LaboratoryVendorID: service.labAccountObj?.LabClientMemberId || 0,\r\n          LabPanelID: service.testToPerformObj?.PanelID || 0,\r\n          PanelDescription: service.testToPerformObj?.Description || \"\",\r\n          PanelCode: service.testToPerformObj?.Code || \"\",\r\n          ClinicalTestType: service.serviceCode,\r\n          SelectedPanels:[]\r\n      })\r\n      const item = order.MultipleClinical[order.MultipleClinical.length - 1]\r\n      const selectedTests = service.selectedTests || []\r\n      for(let i = 0; i < selectedTests.length; i++){\r\n        const panel = {\r\n          LabPanelID: selectedTests[i].PanelID || 0,\r\n          PanelDescription: selectedTests[i].Description || \"\",\r\n          PanelCode: selectedTests[i].Code || \"\",\r\n          PanelID: selectedTests[i].PanelID || 0,\r\n          ClientID: selectedTests[i].ClientID || 0,\r\n          Code: selectedTests[i].Code || \"\",\r\n          Description: selectedTests[i].Description || \"\",\r\n          DOT: !!selectedTests[i].DOT ,\r\n          POCT: !!selectedTests[i].POCT,\r\n          FLEX: !!selectedTests[i].FLEX,\r\n          NDOT: !!selectedTests[i].NDOT,\r\n          SampleTypeCode: selectedTests[i].SampleTypeCode || \"\"\r\n        }\r\n        item.SelectedPanels.push(panel)\r\n        }\r\n    })\r\n\r\n    this.setState({ orderSubmitting: true })\r\n    this.subscriptions.add(\r\n      OrderSubmitObservable(order).subscribe(\r\n        (results: OrderData) => {\r\n          this.setState({ submittedOrder: true, orderSubmitting: false })\r\n          this.saveSuccess(results)\r\n        },\r\n        error => {\r\n          this.setState({ submittedOrder: false, orderSubmitting: false })\r\n          toast.error(error)\r\n        }\r\n      )\r\n    )\r\n  }\r\n\r\n  saveSuccess = (orderFinishData: OrderData) => {\r\n    localStorage.setItem(StorageKey.SavedOrderData, JSON.stringify(orderFinishData))\r\n    const isTest = true         // TODO: remove hard-coded value when Background test is added, remap to: isTest = (this.findLocationObj.IsDrug === true || this.findLocationObj.IsPoct === true || this.findLocationObj.IsAlcohol === true || this.findLocationObj.IsPhysical === true))\r\n    const isBackground = false  // TODO: remove hard-coded value when Background test is added, remap to: isBackground = this.findLocationObj.IsBackground === true\r\n    if (orderFinishData.FormFoxTestAN > 0 || orderFinishData.ProfileNumber) {\r\n      if (orderFinishData.FormFoxTestAN === 0 && isTest) {\r\n        toast.error(orderFinishData.FFresult)\r\n      }\r\n      if (!orderFinishData.ProfileNumber && isBackground) {\r\n        toast.error(orderFinishData.CSresult)\r\n      }\r\n\r\n      localStorage.setItem(StorageKey.OrderedServices, JSON.stringify(this.normalizeOrderedServices()))\r\n      localStorage.setItem(StorageKey.CanViewOrderFinish, JSON.stringify(true))\r\n      localStorage.setItem(StorageKey.FromSelectionInbox, JSON.stringify(!!this.orderFormData))\r\n      localStorage.setItem(StorageKey.OrderDonorSiteSelect, JSON.stringify(!this.state.clinic))\r\n\r\n      const props = this.props as RouteComponentProps\r\n      props.history.push(this.isSSO() ? SSOOrderFinishRoute : OrderFinishRoute)\r\n    } else {\r\n      if (isTest) {\r\n        toast.error(orderFinishData.FFresult)\r\n      }\r\n      if (isBackground) {\r\n        toast.error(orderFinishData.CSresult)\r\n      }\r\n    }\r\n  }\r\n\r\n  normalizeOrderedServices = (): ServiceOrderedModel[] => {\r\n    return this.state.services.map(service => {\r\n      const { serviceTypeCode, serviceCode, isDOT, testToPerform, testToPerformObj, labAccountObj } = service\r\n      return { serviceTypeCode, serviceCode, isDOT, testToPerformDesc: testToPerformObj?.Description || testToPerform, labAccountDesc: labAccountObj?.Description }\r\n    })\r\n  }\r\n\r\n  closePotentialDonorMatchModal = () => {\r\n    //this.PersonID = 0\r\n    toast.error(\"Donor was not found. New donor will be created.\")\r\n    this.setState({ showPotentialMatches: false }, () => this.saveOrder())\r\n  }\r\n\r\n  submitPotentialDonorMatchModal = (response: Donor) => {\r\n    toast.success(\"Your Order will be placed with the selected ID Type.\")\r\n    const fetchedDate = response.DateOfBirth ? new Date(response.DateOfBirth) : undefined\r\n    const validDate = fetchedDate && fetchedDate.getTime && !isNaN(fetchedDate.getTime())\r\n    const newDonor: DonorInformationModel = {\r\n      ...this.state.donor,\r\n      personId: response.PersonID,\r\n      firstName: response.FirstName,\r\n      middleInitial: response.MiddleInitial,\r\n      lastName: response.LastName,\r\n      eveningPhone: FormatPhone(response.HomePhone),\r\n      daytimePhone: FormatPhone(response.WorkPhone),\r\n      birthdate: validDate ? fetchedDate : undefined,\r\n\r\n      firstNameReadOnly: !!response.FirstName,\r\n      middleInitialReadOnly: !!response.MiddleInitial,\r\n      lastNameReadOnly: !!response.LastName,\r\n      homePhoneReadOnly: !!(response.HomePhone && response.HomePhone !== \"N/P\"),\r\n      workPhoneReadOnly: !!(response.WorkPhone && response.WorkPhone !== \"N/P\"),\r\n      state: undefined,\r\n      stateCode: response.DriverLICStateOfIssue ? response.DriverLICStateOfIssue : undefined\r\n    }\r\n    this.setState({\r\n      donor: newDonor,\r\n      showPotentialMatches: false\r\n    }, () => this.saveOrder())\r\n  }\r\n\r\n  closeDrugWarning = () => this.setState({ showDrugWarning: false })\r\n\r\n  isEmailValid = (value: string) => EmailRegexp.test(value)\r\n\r\n  handleEmailChange = (event: React.ChangeEvent<HTMLInputElement>) => {\r\n    const value = event.target.value\r\n    this.setState({ email: value, emailValid: this.isEmailValid(value) })\r\n  }\r\n\r\n  render() {\r\n    const { issuerType, company, reasonObj, reasonOther, submittedOrder, selectedCompany, clinic, showLocations } = this.state\r\n    const isIssuerValid = !!issuerType && !!company && !!reasonObj && (reasonObj?.Description !== OTHER_REASON_TEXT || !!reasonOther)\r\n    // Step 2 is available when services list is confirmed, company is set and reason is set\r\n    const canGoToOrderFeatures = this.state.isServicesConfirmed && isIssuerValid\r\n    const isStep2Available = this.state.step !== 2 && canGoToOrderFeatures\r\n    const allowClinicSelectValid = (!!this.state.clinic && !this.state.allowDonorClinicSelect) || (this.state.allowDonorClinicSelect && (this.isSSO() || (this.state.emailValid && this.state.email && this.state.email !== \"\")))\r\n    const isOrderCanBeSubmitted = canGoToOrderFeatures && this.state.isDonorValid && allowClinicSelectValid && !submittedOrder\r\n    const isBirthDateRequired = this.state.services.filter(service => IsServiceTypeCodePhysical(service.serviceTypeCode) || IsServiceTypeCodeBackground(service.serviceTypeCode)).length > 0\r\n    // Confirm button is enabled when at least one service is added to ordered services list and confirmation status is not set\r\n    const canConfirm = this.completingPendingOrders ? this.state.services.length === this.orderFormData?.length && !this.state.isServicesConfirmed : this.state.services.length > 0 && !this.state.isServicesConfirmed\r\n    const disableReason = this.state.services.length > 0 || !selectedCompany || this.state.defaultsLoading\r\n\r\n    const headerSteps: StepData[] = [\r\n      {\r\n        title: '1',\r\n        disabled: this.state.step === 1,\r\n        current: this.state.step === 1,\r\n        onClick: () => this.setState({ step: 1 })\r\n      },\r\n      {\r\n        title: '2',\r\n        disabled: !isStep2Available,\r\n        current: this.state.step === 2,\r\n        onClick: () => this.setState({ step: 2 })\r\n      },\r\n      {\r\n        title: '3',\r\n        disabled: true,\r\n        current: this.state.step === 3,\r\n        onClick: () => { }\r\n      }\r\n    ]\r\n\r\n    //2022-09-29. Yanek Dogel. DFCT0011749 Donor Self Schedule does not work in conjunction with Embedded Ordering. \r\n    //Do not hide email for SSO. \r\n   \r\n    return (<>\r\n      <AppPageWrapper parentClassName=\"OrderRequest\" showNav={true}>\r\n        <PotentialDonorMatchModal\r\n          potentialDonorMatchList={this.state.potentialDonorMatchList}\r\n          show={this.state.showPotentialMatches}\r\n          onClose={this.closePotentialDonorMatchModal}\r\n          onSubmit={this.submitPotentialDonorMatchModal} />\r\n        <Modal show={this.state.showSiteSearch} onHide={() => this.setState({ showSiteSearch: false })} size=\"xl\" dialogClassName=\"dark modal-90w\">\r\n          <Modal.Header closeButton>\r\n            <Modal.Title>SITE SEARCH</Modal.Title>\r\n          </Modal.Header>\r\n          <Modal.Body>\r\n            <SiteSearch\r\n              accountID={this.state.selectedLocation?.AccountID || this.state.selectedCompany?.AccountID}\r\n              tests={this.state.services}\r\n              isSSO={this.isSSO()}\r\n              defaultAddress={this.state.defaultAddress}\r\n              onSiteSelect={site => this.setState({ clinic: site, showSiteSearch: false, submittedOrder: false })} \r\n            />\r\n          </Modal.Body>\r\n        </Modal>\r\n        <ConfirmationModal \r\n          show={this.state.showDrugWarning} \r\n          title=\"CAUTION\" text=\"Scheduling multiple Urine collections on the same order may cause extended wait time at the clinic for your donor. Call our support line if we can consult on this matter.\"\r\n          showImage={false}\r\n          showCancelButton={false}\r\n          confirmButtonText=\"OK\"\r\n          onHide={this.closeDrugWarning}\r\n          onConfirm={this.closeDrugWarning}\r\n        />\r\n        <Container fluid className=\"OrderRequests\" key={this.state.formKey}>\r\n          <Row>\r\n            <Col md={12}>\r\n              <Container fluid className=\"mb-4\">\r\n                <Row>\r\n                  <Col xs={12} md={6} className=\"p-0 px-2 mx-1\">\r\n                    <OrderRequestsHeader steps={headerSteps} />\r\n                  </Col>\r\n                </Row>\r\n              </Container>\r\n            </Col>\r\n          </Row>\r\n          <Row>\r\n            <Col hidden={this.state.step !== 1}>\r\n              <Container fluid>\r\n                <Row>\r\n                  <Col sm={12} md={6} lg={4}>\r\n                    <span className=\"font-weight-bold\">Do you want to order for?</span>\r\n                    <Form>\r\n                      <Form.Group>\r\n                        <Form.Check inline label=\"An Individual\"\r\n                          type=\"radio\"\r\n                          value=\"individual\"\r\n                          className=\"font-weight-bold abc-radio\"\r\n                          checked={this.state.issuerType === 'individual'}\r\n                          onChange={() => { }} />\r\n                      </Form.Group>\r\n                      <Form.Group>\r\n                        <Form.Label className=\"font-weight-bold\">COMPANY</Form.Label>\r\n                        <CompanyInput filter disabled={this.completingPendingOrders} defaultValue={this.state.company} onChange={this.onCompanyChange} />\r\n                      </Form.Group>\r\n                      {showLocations && <Form.Group>\r\n                        <Form.Label className=\"font-weight-bold\">LOCATION</Form.Label>\r\n                        <LocationInput\r\n                          hideInactive\r\n                          filter\r\n                          companyID={this.state.selectedCompany?.AccountID || 0}\r\n                          defaultValue={this.state.location}\r\n                          disabled={this.completingPendingOrders}\r\n                          onChange={this.onLocationChange} />\r\n                      </Form.Group>}\r\n                      <Form.Group>\r\n                        <Form.Label className=\"font-weight-bold required\">REASON</Form.Label>\r\n                        <Form.Control as=\"select\" value={reasonObj?.Description || \"\"}\r\n                          onChange={(e) => this.onReasonChange(e.target.value)}\r\n                          isInvalid={this.state.selectedCompany && !this.state.reasonObj}\r\n                          disabled={this.state.reasonsLoading || this.completingPendingOrders || disableReason}>\r\n                          <option />\r\n                          {this.state.filteredReasons.map((item: TestReasonType) => <option value={item.Description} key={item.TestReasonID}>{item.Description}</option>)}\r\n                        </Form.Control>\r\n                      </Form.Group>\r\n                      <Form.Group hidden={this.state.reasonObj?.Description !== OTHER_REASON_TEXT}>\r\n                        <Form.Label className=\"font-weight-bold required\">OTHER REASON</Form.Label>\r\n                        <Form.Control type=\"text\"\r\n                          value={this.state.reasonOther || \"\"}\r\n                          isInvalid={!this.state.reasonOther}\r\n                          onChange={(e) => this.setState({ reasonOther: e.target.value })} />\r\n                      </Form.Group>\r\n                    </Form>\r\n                    <ServicesSelection services={this.state.services}\r\n                      reason={this.state.reasonObj}\r\n                      selectedRegMode={this.state.regulatoryModeObj}\r\n                      selectedCategory={this.state.categoryObj}\r\n                      completingPendingOrders={this.completingPendingOrders}\r\n                      company={this.state.selectedCompany?.AccountID}\r\n                      location={this.state.selectedLocation?.AccountID}\r\n                      showDrugSection={this.showDrugSection && !!selectedCompany}\r\n                      drugTestData={this.drugTestData}\r\n                      showAlcoholSection={this.showAlcoholSection && !!selectedCompany}\r\n                      alcoholTestData={this.alcoholTestData}\r\n                      showPhysicalSection={this.showPhysicalSection && !!selectedCompany}\r\n                      showOHSSection={this.showOHSSection && !!selectedCompany}\r\n                      showCHSSection={this.showCHSSection && !!selectedCompany}\r\n                      denyAddServices={!this.state.reasonObj}\r\n                      maximumDrugTests={this.showDrugSection ? 1 : 0}\r\n                      maximumAlcoholTests={this.showAlcoholSection ? this.completingPendingOrders ? 1 : 4 : 0}\r\n                      maximumPhysicalTests={1}\r\n                      orderableServiceTypes={this.state.orderableServiceTypes}\r\n                      orderableServices={this.state.orderableServices}\r\n                      orderableAccountServices={this.state.orderableAccountServices}\r\n                      defaults={this.state.defaults}\r\n                      onAddService={this.onAddService} />\r\n                  </Col>\r\n                  <Col sm={12} md={6} lg={8} className=\"d-flex align-items-center\">\r\n                    <OrderedServices services={this.state.services}\r\n                      canConfirm={canConfirm}\r\n                      canRemove={!this.completingPendingOrders}\r\n                      onRemoveService={this.onRemoveService}\r\n                      onConfirm={this.onConfirmServices} />\r\n                  </Col>\r\n                </Row>\r\n              </Container>\r\n            </Col>\r\n            <Col className=\"p-0\" hidden={this.state.step !== 2}>\r\n              <Container fluid>\r\n                <Col xs={12} sm={12} md={6}>\r\n                  <DonorInformation companyId={this.state.selectedCompany?.AccountID}\r\n                    completingPendingOrders={!!this.orderFormData}\r\n                    orderFormData={this.donorData}\r\n                    donor={this.state.donor}\r\n                    onDonorChange={this.onDonorChange}\r\n                    isBirthDateRequired={isBirthDateRequired}\r\n                    idTypes={this.state.idTypes}\r\n                    regulatoryMode={this.state.regulatoryModeObj}\r\n                    SSODonorData={this.isSSO() ? this.state.ssoOrderRequest?.Donor : undefined} />\r\n                </Col>\r\n                <Col>\r\n                  <Form className=\"py-2\">\r\n                    <Form.Row>\r\n                      <Form.Label column className={`font-weight-bold ${this.state.allowDonorClinicSelect ? \"\" : \"required\" }`}>Clinic</Form.Label>\r\n                    </Form.Row>\r\n                    <Form.Row hidden={!clinic}>\r\n                      <Col xs={12} sm={4}>\r\n                        <Form.Label className=\"font-weight-bold\">{clinic?.Name}</Form.Label>\r\n                      </Col>\r\n                    </Form.Row>\r\n                    <Form.Row hidden={!clinic}>\r\n                      <Col xs={12} sm={4}>\r\n                        <Form.Label>{clinic?.Address1} {clinic?.Address2} {clinic?.Zip}</Form.Label>\r\n                      </Col>\r\n                    </Form.Row>\r\n                    {clinic && (!!clinic?.Phone || !!clinic?.Fax) && <Form.Row>\r\n                      <Col xs={12} sm={4}>\r\n                        {clinic?.Phone && <Form.Label className=\"pr-3\">Phone: {FormatPhone(clinic?.Phone)}</Form.Label>}\r\n                        {clinic?.Fax && <Form.Label>Fax: {FormatPhone(clinic?.Fax)}</Form.Label>}\r\n                      </Col>\r\n                    </Form.Row>}\r\n                    <Form.Row className=\"pt-2\">\r\n                      <Col xs={4} sm={3}>\r\n                        <Button variant=\"secondary\" className=\"fixed-w10 btn-icon\" onClick={() => this.setState({ showSiteSearch: true })}>\r\n                          {this.state.clinic ? \"CHANGE CLINIC\" : \"FIND CLINIC\"}\r\n                          <FaChevronRight />\r\n                        </Button>\r\n                      </Col>\r\n                      <Col xs={6} sm={4} className=\"mt-2\">\r\n                        <Checkbox id=\"allow_select_clinic\" label=\"Allow Donor to select Clinic\" className=\"font-weight-bold\"\r\n                          checked={this.state.allowDonorClinicSelect} onChange={this.handleAllowDonorClinicSelect} />\r\n                      </Col>\r\n                    </Form.Row>\r\n                    <Form.Row className=\"pt-2\" hidden={!this.state.allowDonorClinicSelect}> \r\n                      <Col xs={2} sm={2}>\r\n                        <Form.Label column className=\"font-weight-bold required\">DONOR EMAIL</Form.Label>\r\n                      </Col>\r\n                      <Col xs={6} sm={4}>\r\n                        <Form.Control id=\"email\" size=\"sm\" type=\"text\" value={this.state.email || this.state.donor.email} onChange={this.handleEmailChange} isInvalid={!this.state.emailValid} className=\"rounded-pill\" />\r\n                        {!this.state.emailValid && <Form.Control.Feedback type=\"invalid\" className=\"d-block\">Please enter valid email</Form.Control.Feedback>}\r\n                      </Col>\r\n                    </Form.Row>\r\n                  </Form>\r\n                </Col>\r\n                <Col>\r\n                  <Schedule allowDonorSelect={this.state.allowDonorClinicSelect} clinic={this.state.clinic} schedule={this.state.schedule} onScheduleChange={this.onScheduleChange} defaultExpiration={this.defaultExpirationTime()}/>\r\n                </Col>\r\n              </Container>\r\n            </Col>\r\n          </Row>\r\n          <Container fluid>\r\n            <Row>\r\n              <Col xs={12} md={6} lg={6} className=\"d-flex pt-2 pr-1\">\r\n                <Button hidden={this.state.step !== 1} onClick={this.onCancel} variant=\"secondary\" className=\"mr-auto fixed-w10\">CANCEL</Button>\r\n                <Button hidden={this.state.step !== 2} onClick={this.onGoToStep1} variant=\"secondary\" className=\"mr-auto fixed-w10\">BACK</Button>\r\n                <Button hidden={this.state.step !== 1} onClick={this.onGoToStep2} disabled={!isStep2Available} variant=\"primary\" className=\"ml-auto fixed-w10\">NEXT</Button>\r\n                <ActionButton hidden={this.state.step !== 2} onClick={this.onSubmit} disabled={!isOrderCanBeSubmitted} spin={this.state.orderSubmitting} variant=\"primary\" className=\"ml-auto fixed-w10\" disableOnSpin>SUBMIT</ActionButton>\r\n              </Col>\r\n            </Row>\r\n          </Container>\r\n        </Container>\r\n      </AppPageWrapper>\r\n    </>)\r\n  }\r\n}\r\n\r\nfunction mapStateToProps(state: AppState): OrderRequestAuthProps {\r\n  return {\r\n    isLocation: (GetSelectedAssignedClinic(state)?.LocationID || 0) > 0\r\n  }\r\n}\r\nconst ConnectedOrderRequest = connect(mapStateToProps, null)(OrderRequest)\r\nexport default ConnectedOrderRequest\r\n","import { Observable } from \"rxjs\"\r\nimport { ObservableFromFetch } from \"../ObservableFromFetch\"\r\nimport AuthFormParams, {AuthFormByTokenParams} from \"./OrderResultModel/AuthFormParams\"\r\n\r\nexport default function AuthFormProcessObservable(params: AuthFormParams): Observable<string> {\r\n  const requestBody: string = JSON.stringify({\r\n    FormFoxTestAN: params.FormFoxTestAN,\r\n    PersonID: params.PersonID,\r\n    VendorID: params.VendorID,\r\n    SendToEmail: params.SendToEmail,\r\n    SendText: params.SendText,\r\n    EmailAddress: params.EmailAddress,\r\n    ClientDetails: { },\r\n  })\r\n\r\n  return ObservableFromFetch<string>(\"WorkforceReport/TrackingAuthorizationForm\", requestBody)\r\n}\r\n\r\nexport  function AuthFormByToken(params: AuthFormByTokenParams): Observable<string> {\r\n  const requestBody: string = JSON.stringify({\r\n    requestToken: params.requestToken,\r\n    FormFoxTestAN: params.FormFoxTestAN\r\n  })\r\n\r\n  return ObservableFromFetch<string>(\"WorkforceReport/AuthorizationFormByToken\", requestBody)\r\n}","import React, { Component } from \"react\"\r\nimport { toast, ToastContainer } from \"react-toastify\"\r\nimport { Container, Row, Col, Button, Table, Image, Form } from \"react-bootstrap\"\r\nimport { ServiceOrderedModel } from \"./OrderModels\"\r\nimport { FaMinus, FaPlus } from \"react-icons/fa\"\r\nimport PhoneNumberMaskedInput from \"../FormattedInputs/PhoneNumberMaskedInput\"\r\nimport SendEmailObservable from \"../../api/OrderRequests/SendEmail\"\r\nimport OrderReportPrintObservable from \"../../api/OrderRequests/OrderReportPrint\"\r\nimport OrderRequestsHeader, { StepData } from \"./OrderRequestsHeader\"\r\nimport OrderData, { OrderDataSSO, SSOConfig } from \"../../api/OrderRequests/OrderRequestsModel/OrderData\"\r\nimport { RouteComponentProps } from \"react-router\"\r\nimport { EmailRegexp, PhoneRegexp, StorageKey } from \"../../config/Constants\"\r\nimport SendMessageObservable from \"../../api/OrderRequests/SendMessage\"\r\nimport dotImage from \"../../assets/images/dot-img.png\"\r\nimport { AppPageWrapper } from \"../NavMenu/AppPageWrapper\"\r\nimport ActionButton from \"../ActionButton\"\r\nimport { OrderRoute, SelectionInboxRoute } from \"../../config/Routes\"\r\nimport ServiceType, { ServiceTypeCode } from \"../../api/Administration/Model/ServiceType\"\r\nimport Service, { IsServiceCodePOCT } from \"../../api/Administration/Model/Service\"\r\nimport { OrderFinishObservable } from \"../../api/OrderRequests/OrderSubmit\"\r\nimport { APIError } from \"../../api/ObservableFromFetch\"\r\nimport { GetSSOToken } from \"../../storage/AuthToken\"\r\nimport { FullBaseUrl } from \"../../api/ApiUrl\"\r\nimport AuthFormProcessObservable from \"../../api/OrderResults/AuthForm\"\r\nimport FormatError from \"../../formatters/FormatError\"\r\n\r\ninterface OrderFinishProps {\r\n  isSSO?: boolean\r\n  isFFOrder?: boolean\r\n}\r\n\r\ninterface OrderFinishState {\r\n  step: number\r\n  authorizationID?: number,\r\n  emailItems: string[]\r\n  mobileItems: string[]\r\n  sendingEmail: boolean\r\n  sendingText: boolean\r\n}\r\n\r\nexport interface FinishData {\r\n  FormFoxTestAN: number\r\n  ApiRequestToken: string\r\n  BaseUrl: string\r\n  AccountID: number\r\n  Email: string\r\n  SendSelectClinicLink: boolean\r\n  MarketplaceAuthNum: string\r\n  PersonID: number\r\n  TestReason: string\r\n  TestDetailIDs: number[],\r\n  TestDetailClinicalIDs: number[]\r\n}\r\n\r\nexport default class OrderFinish extends Component<OrderFinishProps, OrderFinishState> {\r\n  orderObj?: OrderData = undefined\r\n  TestDetailIDs: number[] = []\r\n  TestDetailClinicalIDs: number[] = []\r\n  authorizationID?: number\r\n  servicesOrderedList: ServiceOrderedModel[] = []\r\n  siteSelected: boolean = false\r\n\r\n  constructor(props: OrderFinishProps) {\r\n    super(props)\r\n\r\n    this.getSavedOrder()\r\n\r\n    this.state = {\r\n      step: 3,\r\n      authorizationID: this.authorizationID,\r\n      emailItems: [\"\"],\r\n      mobileItems: [\"\"],\r\n      sendingEmail: false,\r\n      sendingText: false\r\n    }\r\n  }\r\n\r\n  componentWillUnmount() {\r\n    localStorage.removeItem(StorageKey.CanViewOrderFinish)\r\n    localStorage.removeItem(StorageKey.OrderedServices)\r\n    localStorage.removeItem(StorageKey.OrderDonorSiteSelect)\r\n  }\r\n\r\n  handlePrintClick = (): void => {\r\n    const params = {\r\n      PersonID: this.orderObj?.PersonID,\r\n      VendorID: this.orderObj?.VendorID,\r\n      XMLFile: this.orderObj?.OrderXML,\r\n      SendToEmail: false,\r\n      EmailAddress: [],\r\n      TestDetailIDs: this.TestDetailIDs,\r\n      TestDetailClinicalIDs: this.TestDetailClinicalIDs\r\n    }\r\n    OrderReportPrintObservable(params).subscribe(\r\n      (data) => this.print(data),\r\n      error => toast.error(error)\r\n    )\r\n  }\r\n\r\n  print(base64pdf: string) {\r\n    const pdfWindow = window.open(\"\")\r\n    if (pdfWindow) {\r\n      pdfWindow.document.write(\"<iframe width='100%' height='100%' src='data:application/pdf;base64, \" + encodeURI(base64pdf) + \"'></iframe>\")\r\n    }\r\n  }\r\n\r\n  addEmail = (index: number, email: string = \"\") => {\r\n    if (email !== this.state.emailItems[index]) {\r\n      this.setState({ emailItems: [...this.state.emailItems, email] })\r\n    }\r\n  }\r\n\r\n  removeEmail = (email: string, index: number) => {\r\n    var array = [...this.state.emailItems]\r\n    if (index > -1) {\r\n      array.splice(index, 1)\r\n      this.setState({ emailItems: array })\r\n    }\r\n  }\r\n\r\n  changeEmail = (email: string, index: number) => {\r\n    var array = [...this.state.emailItems]\r\n    if (index > -1) {\r\n      array[index] = email\r\n      this.setState({ emailItems: array })\r\n    }\r\n  }\r\n\r\n  sendEmail = () => {\r\n    if (this.state.emailItems.filter(Boolean).length > 0) {\r\n      if (Array.from(new Set(this.state.emailItems.map(value => value.toLowerCase()))).length !== this.state.emailItems.length) {\r\n        toast.error(\"Duplicate email address is present in the list.\")\r\n        return\r\n      }\r\n      const params = {\r\n        TestDetailID: this.orderObj ? this.orderObj.DrugTestDetailID > 0 ? this.orderObj.DrugTestDetailID : this.orderObj.AlcoholTestDetailID > 0 ? this.orderObj.AlcoholTestDetailID : this.orderObj.PhysicalTestDetailID > 0 ? this.orderObj.PhysicalTestDetailID : this.orderObj.POCTTestDetailID > 0 ? this.orderObj.POCTTestDetailID : 0 : 0,\r\n        EmailAddress: this.state.emailItems,\r\n        Message: this.orderObj?.Message || \"\",\r\n        TestDetailIDs: this.TestDetailIDs,\r\n        TestDetailClinicalIDs: this.TestDetailClinicalIDs,\r\n        PersonID: this.orderObj?.PersonID,\r\n        VendorID: this.orderObj?.VendorID,\r\n        XMLFile: this.orderObj?.OrderXML\r\n      }\r\n      this.setState({ sendingEmail: true })\r\n      SendEmailObservable(params).subscribe(\r\n        (response) => toast.success(response),\r\n        (response) => toast.error(response),\r\n        () => this.setState({ sendingEmail: false })\r\n      )\r\n    }\r\n    else {\r\n      toast.error(\"Please enter email address.\")\r\n    }\r\n  }\r\n\r\n  isEmailValid = (value: string): boolean => {\r\n    if (value.length === 0) {\r\n      return true\r\n    }\r\n    return EmailRegexp.test(value)\r\n  }\r\n\r\n  canAddEmail = (email: string): boolean => email.length > 0 && this.isEmailValid(email)\r\n\r\n  addMobile = (index: number, phone: string = \"\") => {\r\n    if (phone !== this.state.mobileItems[index]) {\r\n      this.setState({ mobileItems: [...this.state.mobileItems, phone] })\r\n    }\r\n  }\r\n\r\n  removeMobile = (phone: string, index: number) => {\r\n    var array = [...this.state.mobileItems]\r\n    if (index > -1) {\r\n      array.splice(index, 1)\r\n      this.setState({ mobileItems: array })\r\n    }\r\n  }\r\n\r\n  changeMobile = (phone: string, index: number) => {\r\n    var array = [...this.state.mobileItems]\r\n    if (index > -1) {\r\n      array[index] = phone\r\n      this.setState({ mobileItems: array })\r\n    }\r\n  }\r\n\r\n  sendText = () => {\r\n    if (this.state.mobileItems.filter(Boolean).length > 0) {\r\n      if (Array.from(new Set(this.state.mobileItems.map(value => value.toLowerCase()))).length !== this.state.mobileItems.length) {\r\n        toast.error(\"Duplicate mobile number is present in the list.\")\r\n        return\r\n      }\r\n\r\n      if (!!this.props.isSSO) {\r\n        const params = {\r\n          EmailAddress: this.state.mobileItems,\r\n          FormFoxTestAN: this.state.authorizationID || 0,\r\n          PersonID: 0,\r\n          VendorID: 0,\r\n          SendToEmail: false,\r\n          SendText: true\r\n        }\r\n        this.setState({ sendingText: true })\r\n        AuthFormProcessObservable(params).subscribe(\r\n          data => toast.success(\"Text sent successfully\"),\r\n          error => toast.error(FormatError(error))\r\n        )\r\n        this.setState({ sendingText: false })\r\n      }\r\n      else {\r\n        const params = {\r\n          TestDetailID: this.orderObj?.DrugTestDetailID || this.orderObj?.AlcoholTestDetailID || this.orderObj?.PhysicalTestDetailID || this.orderObj?.POCTTestDetailID || 0,\r\n          EmailAddress: this.state.mobileItems,\r\n          Message: this.orderObj?.Message || \"\",\r\n          TestDetailIDs: this.TestDetailIDs,\r\n          TestDetailClinicalIDs: this.TestDetailClinicalIDs,\r\n        }\r\n        this.setState({ sendingText: false })\r\n        SendMessageObservable(params).subscribe(\r\n          () => toast.success(\"Text sent successfully\"),\r\n          (err) => toast.error(\"No data found\"),\r\n          () => this.setState({ sendingText: false })\r\n        )\r\n      }\r\n    }\r\n    else {\r\n      toast.error(\"Please enter mobile number.\")\r\n    }\r\n  }\r\n  isPhoneValid = (value: string): boolean => value.length === 0 || PhoneRegexp.test(value)\r\n  canAddMobile = (mobile: string): boolean => mobile.length > 0 && this.isPhoneValid(mobile)\r\n\r\n  getSavedOrder(): void {\r\n    const orderDonorSiteSelect = localStorage.getItem(StorageKey.OrderDonorSiteSelect) || \"\"\r\n    this.siteSelected = orderDonorSiteSelect === \"\" || !JSON.parse(orderDonorSiteSelect)\r\n    const data = localStorage.getItem(StorageKey.SavedOrderData)\r\n\r\n    if (!data) {\r\n      return\r\n    }\r\n    const savedOrderData: OrderData = JSON.parse(data)\r\n    if (Array.isArray(savedOrderData)) {\r\n        this.orderObj = savedOrderData[0]\r\n    }\r\n    else {\r\n        this.orderObj = savedOrderData\r\n    }\r\n    if (this.orderObj) {\r\n      if (this.orderObj.FormFoxTestAN) {\r\n        this.authorizationID = this.orderObj.FormFoxTestAN\r\n      }\r\n      this.TestDetailIDs = []\r\n      if (this.orderObj.AlcoholTestDetailIDList && this.orderObj.AlcoholTestDetailIDList.length > 0) {\r\n        this.TestDetailIDs = this.TestDetailIDs.concat(this.orderObj.AlcoholTestDetailIDList)\r\n      }\r\n      if (this.orderObj.DrugTestDetailIDList && this.orderObj.DrugTestDetailIDList.length > 0) {\r\n        this.TestDetailIDs = this.TestDetailIDs.concat(this.orderObj.DrugTestDetailIDList)\r\n      }\r\n      if (this.orderObj.POCTTestDetailIDList && this.orderObj.POCTTestDetailIDList.length > 0) {\r\n        this.TestDetailIDs = this.TestDetailIDs.concat(this.orderObj.POCTTestDetailIDList)\r\n      }\r\n      if (this.orderObj.PhysicalTestDetailID) {\r\n        this.TestDetailIDs.push(this.orderObj.PhysicalTestDetailID)\r\n      }\r\n      if (this.orderObj.ClinicalTestDetailIDList && this.orderObj.ClinicalTestDetailIDList.length > 0) {\r\n        this.TestDetailClinicalIDs = this.TestDetailClinicalIDs.concat(this.orderObj.ClinicalTestDetailIDList)\r\n      }\r\n    }\r\n\r\n    const savedServices = localStorage.getItem(StorageKey.OrderedServices)\r\n    if (savedServices && savedServices.length) {\r\n      this.servicesOrderedList = JSON.parse(savedServices)\r\n    }\r\n  }\r\n\r\n  handleAPIError = (error: Error | APIError, stateChanges: object) => {\r\n    this.setState(stateChanges)\r\n    error && toast.error((error as APIError)?.errorData?.message || error.message)\r\n  }\r\n\r\n  finishOrder = () => {\r\n    const token = GetSSOToken()\r\n    const sendLink = this.orderObj?.SendSelectClinicLink || false\r\n\r\n    if (token != \"\" || sendLink) {\r\n      const data: FinishData = {\r\n        FormFoxTestAN: this.authorizationID || 0,\r\n        ApiRequestToken: token,\r\n        BaseUrl: FullBaseUrl(),\r\n        AccountID: this.orderObj?.AccountID || 0,\r\n        Email: this.orderObj?.Email || \"\",\r\n        SendSelectClinicLink: sendLink,\r\n        MarketplaceAuthNum: this.orderObj?.MarketplaceAuthNum?.toString() || \"\",\r\n        PersonID: this.orderObj?.PersonID || 0,\r\n        TestReason: this.orderObj?.TestReasonDescription || \"\",\r\n        TestDetailIDs: this.TestDetailIDs,\r\n        TestDetailClinicalIDs: this.TestDetailClinicalIDs\r\n      }\r\n\r\n      OrderFinishObservable(data).subscribe(\r\n        data => {\r\n          toast.success(data)\r\n          this.returnToStart()\r\n        },\r\n        error => this.handleAPIError(error, {})\r\n      )\r\n    }\r\n    else {\r\n      this.returnToStart()\r\n    }\r\n  }\r\n\r\n  returnToStart = () => {\r\n    const props = this.props as RouteComponentProps\r\n    const returnToSelectionInbox = localStorage.getItem(StorageKey.FromSelectionInbox) === \"true\"\r\n    localStorage.removeItem(StorageKey.OrderedServices)\r\n    localStorage.removeItem(StorageKey.SavedOrderData)\r\n    localStorage.removeItem(StorageKey.FromSelectionInbox)\r\n    props.history.push(returnToSelectionInbox ? SelectionInboxRoute : OrderRoute)\r\n  }\r\n\r\n  render() {\r\n    const headerSteps: StepData[] = [{\r\n        title: '1',\r\n        disabled: true,\r\n        current: this.state.step === 1,\r\n        onClick: () => this.setState({ step: 1 })\r\n      },{\r\n        title: '2',\r\n        disabled: true,\r\n        current: this.state.step === 2,\r\n        onClick: () => this.setState({ step: 2 })\r\n      },{\r\n        title: '3',\r\n        disabled: false,\r\n        current: this.state.step === 3,\r\n        onClick: () => this.setState({ step: 3 })\r\n      }\r\n    ]\r\n\r\n    const serviceTypesList = this.servicesOrderedList.map((service: ServiceOrderedModel) => IsServiceCodePOCT(service.serviceCode) ? \"POCT\" : service.serviceTypeCode)\r\n    const serviceTypesString = serviceTypesList.filter((item, index) => serviceTypesList.indexOf(item) === index).join(', ').replace(/, ([^,]*)$/, ' AND $1')\r\n\r\n    if (!!this.props.isFFOrder)\r\n    return (\r\n    <AppPageWrapper showNav={true}>\r\n      <Container fluid className=\"OrderRequests grid-container\">\r\n        <Row className=\"pb-2\"><Col>Your order has been updated.</Col></Row>\r\n      </Container>\r\n    </AppPageWrapper>\r\n    )\r\n\r\n    return (\r\n      <AppPageWrapper showNav={true}>\r\n        <Container fluid className=\"OrderRequests grid-container\">\r\n          <Row>\r\n            <Container>\r\n              <Row className=\"mb-4\">\r\n              { !this.props.isSSO && <Col><OrderRequestsHeader steps={ headerSteps } title=\"SERVICE ORDER FORM\" /></Col>}\r\n              </Row>\r\n              <Row>\r\n                <Col>\r\n                  <h4 className=\"primary text-uppercase\">\r\n                    <span className=\"mr-2\">{ serviceTypesString }</span>\r\n                    <span>AUTHORIZATION # </span>\r\n                    <span className=\"authorizationNumber\"> ({ this.state.authorizationID })</span>\r\n                  </h4>\r\n                </Col>\r\n              </Row>\r\n              <Row>\r\n                <Col>\r\n                  { !this.props.isSSO && <Table className=\"table-sm dark\" responsive>\r\n                    <thead>\r\n                      <tr>\r\n                        <th>SERVICE TYPE</th>\r\n                        <th>&nbsp;</th>\r\n                        <th>ACCOUNT</th>\r\n                        <th>TEST TO BE PERFORMED</th>\r\n                      </tr>\r\n                    </thead>\r\n                    <tbody>\r\n                      { this.servicesOrderedList.map((service: ServiceOrderedModel, index: number) => <tr key={`service-${index}`}>\r\n                        <td>{service.serviceTypeCode}</td>\r\n                        <td className=\"text-center\">\r\n                          <Image className=\"\" src={dotImage} hidden={service.isDOT !== true} />\r\n                        </td>\r\n                        <td>{service.labAccountDesc}</td>\r\n                        <td>\r\n                          <span>{service.testToPerformDesc}</span>\r\n                        </td>\r\n                      </tr>\r\n                      )}\r\n                      { !this.servicesOrderedList?.length && <tr><td className=\"pull-left\" colSpan={5}>NO DATA FOUND</td></tr>}\r\n                    </tbody>\r\n                  </Table> }\r\n                  {!this.props.isSSO &&  <Row className=\"pb-2\"><Col>Count: {this.servicesOrderedList?.length}</Col></Row>}\r\n                  {this.siteSelected && <Row className=\"pb-2\"><Col>Your order has been placed. Please choose from the following options to send authorization form.</Col></Row>}\r\n                  {this.siteSelected && <Row className=\"pb-2\">\r\n                    <Col xs={3} lg={2}>Print form:</Col>\r\n                    <Col xs={9} lg={10} className=\"d-flex\"><Button size=\"sm\" className=\"fixed-w10\" onClick={this.handlePrintClick}>Print PDF</Button></Col>\r\n                  </Row>}\r\n                  { this.siteSelected && this.state.emailItems.map((email, index) => <Row className=\"pt-2\" key={ `email-${index}` }>\r\n                      <Col xs={12} sm={3} md={3} lg={2}>\r\n                        { index === 0 && \"Email form:\" }\r\n                      </Col>\r\n                      <Col xs={9} sm={5} md={4}>\r\n                        <Form.Control size=\"sm\" name=\"email_address\" maxLength={ 40 } type=\"text\" value={ email } onChange={ (e) => this.changeEmail(e.target.value, index) } readOnly={ this.state.emailItems.length !== index + 1 } isInvalid={ !this.isEmailValid(email) } />\r\n                      </Col>\r\n                      <Col xs={3} sm={4} md={5}>\r\n                        { this.state.emailItems.length === index + 1 ? <Button size=\"sm\" variant=\"primary\" className=\"btn-sm-icon\" onClick={ () => this.addEmail(index) } disabled={ !this.canAddEmail(email) }><FaPlus /></Button> : <Button size=\"sm\" variant=\"primary\" className=\"btn-sm-icon\" onClick={ () => this.removeEmail(email, index) }><FaMinus /></Button> }\r\n                      </Col>\r\n                    </Row>\r\n                  ) }\r\n                  {this.siteSelected && <Row className=\"py-2\">\r\n                    <Col xs={12} sm={3} md={3} lg={2}></Col>\r\n                    <Col xs={12} sm={3}><ActionButton size=\"sm\" className=\"fixed-w10\" onClick={ this.sendEmail } disabled={ !this.state.emailItems.every(email => this.isEmailValid(email))} spin={this.state.sendingEmail} disableOnSpin>Send Email</ActionButton></Col>\r\n                  </Row>}\r\n                  {this.siteSelected && this.state.mobileItems.map((mobile, index) => <Row className=\"pt-2\" key={ `mobile-${index}` }>\r\n                      <Col xs={12} sm={3} md={3} lg={2}>\r\n                        { index === 0 && \"Text form:\" }\r\n                      </Col>\r\n                      <Col xs={9} sm={5} md={4}>\r\n                        <PhoneNumberMaskedInput size=\"sm\" value={ mobile} onChange={(value: string) => this.changeMobile(value, index)} readOnly={ this.state.mobileItems.length !== index + 1 } isInvalid={ !this.isPhoneValid(mobile) } />\r\n                      </Col>\r\n                      <Col xs={3} sm={4} md={5}>\r\n                        { this.state.mobileItems.length === index + 1 ? <Button size=\"sm\" variant=\"primary\" className=\"btn-sm-icon\" onClick={ () => this.addMobile(index) } disabled={ !this.canAddMobile(mobile) }><FaPlus /></Button> : <Button size=\"sm\" variant=\"primary\" className=\"btn-sm-icon\" onClick={ () => this.removeMobile(mobile, index) }><FaMinus /></Button> }\r\n                      </Col>\r\n                    </Row>\r\n                  ) }\r\n                  {this.siteSelected && <Row className=\"pt-2\">\r\n                    <Col xs={12} sm={3} md={3} lg={2}></Col>\r\n                    <Col xs={12} sm={3}><ActionButton size=\"sm\" className=\"fixed-w10\" onClick={ this.sendText } disabled={ !this.state.mobileItems.every(mobile => this.isPhoneValid(mobile)) } spin={this.state.sendingText} disableOnSpin>Send Text</ActionButton></Col>\r\n                  </Row>}\r\n                  <Row className=\"py-2\">\r\n                  {!this.props.isSSO && <Col><Button size=\"sm\" onClick={this.finishOrder} variant=\"primary\" className=\"fixed-w10 float-left\">FINISH</Button></Col>}\r\n                  </Row>\r\n                </Col>\r\n              </Row>\r\n            </Container>\r\n          </Row>\r\n          <Row>\r\n            <Col xs={12} md={6} lg={4} className=\"pt-2\">\r\n            </Col>\r\n          </Row>\r\n        </Container>\r\n      </AppPageWrapper>\r\n    )\r\n  }\r\n}\r\n","import { Observable } from \"rxjs\"\r\nimport { ObservableFromFetch } from \"../ObservableFromFetch\"\r\nimport OrderReportPrintParams from \"./OrderRequestsModel/OrderReportPrintParams\"\r\n\r\nexport default function OrderReportPrintObservable(params: OrderReportPrintParams): Observable<string> {\r\n  const requestBody: string = JSON.stringify({\r\n    SendToEmail: false,\r\n    EmailAddress: [],\r\n    TestDetailIDs: params.TestDetailIDs,\r\n    TestDetailClinicalIDs: params.TestDetailClinicalIDs,\r\n    PersonID: params.PersonID,\r\n    VendorID: params.VendorID,\r\n    XMLFile: params.XMLFile,\r\n    ClientDetails: {\r\n      // TODO: ContactID: VALUESTORAGE.CONTACT_ID\r\n    },\r\n  })\r\n\r\n  return ObservableFromFetch<string>(\"WorkforceReport/AuthorizationFormReport\", requestBody)\r\n}","import { Observable } from \"rxjs\"\r\nimport { ObservableFromFetch } from \"../ObservableFromFetch\"\r\nimport OrderReportPrintParams from \"./OrderRequestsModel/OrderReportPrintParams\"\r\n\r\nexport default function SendEmailObservable(params: OrderReportPrintParams): Observable<any> {\r\n  const requestBody: string = JSON.stringify({\r\n    SendToEmail: true,\r\n    EmailAddress: params.EmailAddress,\r\n    TestDetailIDs: params.TestDetailIDs,\r\n    TestDetailClinicalIDs: params.TestDetailClinicalIDs,\r\n    PersonID: params.PersonID,\r\n    VendorID: params.VendorID,\r\n    XMLFile: params.XMLFile,\r\n    ClientDetails: {\r\n      // TODO: ContactID: VALUESTORAGE.CONTACT_ID\r\n    },\r\n  })\r\n\r\n  return ObservableFromFetch<any>(\"WorkforceReport/AuthorizationFormReport\", requestBody)\r\n}","import { Observable } from \"rxjs\"\r\nimport { ObservableFromFetch } from \"../ObservableFromFetch\"\r\nimport SendTextMessage from \"./OrderRequestsModel/SendTextMessage\"\r\nimport SentTextMessage from \"./OrderRequestsModel/SentTextMessage\"\r\n\r\nexport default function SendMessageObservable(params: SendTextMessage): Observable<SentTextMessage> {\r\n  const requestBody: string = JSON.stringify({\r\n    EmailAddress: params.EmailAddress,\r\n    Message: params.Message,\r\n    TestDetailIDs: params.TestDetailIDs,\r\n    TestDetailID: params.TestDetailID ,\r\n    TestDetailClinicalIDs: params.TestDetailClinicalIDs,\r\n    ClientDetails: {\r\n      // TODO: ContactID: VALUESTORAGE.CONTACT_ID\r\n    },\r\n  })\r\n\r\n  return ObservableFromFetch<SentTextMessage>(\"WorkforceOrder/SendTextMessage\", requestBody)\r\n}\r\n","import { AccountTypeID } from \"../../config/Constants\"\r\nimport { ObservableFromFetch } from \"../ObservableFromFetch\"\r\nimport { OrderResultsGridRequest } from \"./OrderResultModel/OrderResultGridRequest\"\r\nimport { OrderResultGridResponse } from \"./OrderResultModel/OrderResultGridResponse\"\r\n\r\nfunction columnFilters(options: OrderResultsGridRequest) {\r\n    const filters = options.filters || []\r\n    return {\r\n        AuthorizationID: filters.find(filter => filter.column === \"AuthorizationID\")?.values || [],\r\n        Clinic: filters.find(filter => filter.column === \"Clinic\")?.values || [],\r\n        Company: filters.find(filter => filter.column === \"Company\")?.values || [],\r\n        EventDate: filters.find(filter => filter.column === \"EventDate\")?.values || [],\r\n        CollectionTime: filters.find(filter => filter.column === \"CollectionTime\")?.values || [],\r\n        IDNumber: filters.find(filter => filter.column === \"IDNumber\")?.values || [],\r\n        LabAccountNumber: filters.find(filter => filter.column === \"LabAccountNumber\")?.values || [],\r\n        Location: filters.find(filter => filter.column === \"Location\")?.values || [],\r\n        Name: filters.find(filter => filter.column === \"Name\")?.values || [],\r\n        OrderDate: filters.find(filter => filter.column === \"OrderDate\")?.values || [],\r\n        OrderedBy: filters.find(filter => filter.column === \"OrderedBy\")?.values || [],\r\n        OrderUpdatedAt: filters.find(filter => filter.column === \"OrderUpdatedAt\")?.values || [],\r\n        OrderUpdatedBy: filters.find(filter => filter.column === \"OrderUpdatedBy\")?.values || [],\r\n        RAImageID: filters.find(filter => filter.column === \"RAImageID\")?.values || [],\r\n        Reason: filters.find(filter => filter.column === \"Reason\")?.values || [],\r\n        Region: filters.find(filter => filter.column === \"Region\")?.values || [],\r\n        Regulated: filters.find(filter => filter.column === \"Regulated\")?.values || [],\r\n        ReportDate: filters.find(filter => filter.column === \"ReportDate\")?.values || [],\r\n        Result: filters.find(filter => filter.column === \"Result\")?.values || [],\r\n        SampleID: filters.find(filter => filter.column === \"SampleID\")?.values || [],\r\n        Service: filters.find(filter => filter.column === \"Service\")?.values || [],\r\n        MarketPlaceOrderNum: filters.find(filter => filter.column === \"MarketPlaceOrderNum\")?.values || [],\r\n\r\n    }\r\n}\r\n\r\nfunction gridParams(options: OrderResultsGridRequest, accountTypeID: number): string {\r\n    return JSON.stringify({\r\n        AccountTypeID: accountTypeID,\r\n        ColumnFilters: columnFilters(options),\r\n        DateFrom: \"1/01/0001 00:00:00\",\r\n        DateTo: \"1/01/0001 00:00:00\",\r\n        ExportDateFrom: options.exportDateFrom,\r\n        ExportDateTo: options.exportDateTo,\r\n        Exact: false,\r\n        Filters: {\r\n            Company: [],\r\n            DateRange: \"\",\r\n            DateType: \"\",\r\n            EndDate: \"\",\r\n            Location: [],\r\n            Reason: [],\r\n            Region: [],\r\n            Regulated: \"Regulated & Non-Regulated\",\r\n            Service: [],\r\n            StartDate: \"\",\r\n            Status: \"In Process\"\r\n        },\r\n        InProcessStatus: true,\r\n        IsMarketPlace: true,\r\n        IsReviewed: options.complete,\r\n        IncludeArchived: options.includeArchived,\r\n        Mask: options.text || \"\",\r\n        PageNumber: options.pageNumber,\r\n        PageSize: options.pageSize || 20,\r\n        Pending: true,\r\n        SearchBy: options.field || \"AllIDs\",\r\n        SortGrid: { SortColumn: options.sort?.column || \"\", SortOrder: options.sort?.order.toUpperCase() === \"DESC\" ? \"DSC\" : options.sort?.order.toUpperCase() },\r\n        Type: \"All\"\r\n    })\r\n}\r\n\r\nfunction printParams(options: OrderResultsGridRequest, accountTypeID: number) {\r\n    const request = JSON.stringify({\r\n        AccountTypeID: accountTypeID,\r\n        ColumnFilters: columnFilters(options),\r\n        Filters: {\r\n            Company: [],\r\n            Location: [],\r\n            Reason: [],\r\n            Region: [],\r\n            Service: [],\r\n            Status: \"In Process\"\r\n        },\r\n        IsSearch: !!options.text,\r\n        SearchBy: options.field || \"AllIDs\",\r\n        SearchString: options.text || \"\",\r\n        TrackPersonID: options.print || []\r\n    })\r\n    return request\r\n}\r\n\r\nexport const ResultsGridObservable = (params: OrderResultsGridRequest, accountTypeID: number = AccountTypeID) => ObservableFromFetch<OrderResultGridResponse>(\"WorkforceTrack/GetColumnTrackingGrid\", gridParams(params, accountTypeID))\r\nexport const OrderResultsExportCsv = (params: OrderResultsGridRequest, accountTypeID: number = AccountTypeID) => ObservableFromFetch<string>(\"WorkforceTrack/ExportTrackRecord\", gridParams(params, accountTypeID))\r\nexport const OrderResultsPrint = (params: OrderResultsGridRequest, accountTypeID: number = AccountTypeID) => ObservableFromFetch<string>(\"WorkforceTrack/PrintTrackRecord\", printParams(params, accountTypeID))\r\n","import { Observable } from \"rxjs\"\r\nimport { ObservableFromFetch } from \"../ObservableFromFetch\"\r\n\r\nexport default function ResultsWatchObservable(testEventIDs: number[], modifiedBy: string): Observable<string> {\r\n  const params: string = JSON.stringify({\r\n    TestEventIDS: testEventIDs.map(testEventID => ({ TestEventID: testEventID })),\r\n    ModifiedBy: modifiedBy\r\n  })\r\n\r\n  return ObservableFromFetch<string>(\"FFOrderWatchResolve/Watch\", params)\r\n}\r\n","import { ObservableFromFetch } from \"../ObservableFromFetch\"\r\nimport SearchField from \"../SearchField\"\r\n\r\nexport const SearchFieldsGet = () => ObservableFromFetch<SearchField[]>(\"RandomTest/GetEventSearchDropdowns\")","import { TestToProcess } from \"../../components/OrderResults/CompleteModal\"\r\nimport FormatDate from \"../../formatters/FormatDate\"\r\nimport { ObservableFromFetch } from \"../ObservableFromFetch\"\r\n\r\nexport default function CompleteTest(test: TestToProcess) {\r\n  const requestBody: string = JSON.stringify({\r\n    TestDetailID: test.TestDetailID,\r\n    TestDetailClinicalID: test.TestDetailClinicalID,\r\n    PersonID: test.PersonID,\r\n    HireDate: FormatDate(test.HireDate),\r\n    PoolID: test.PoolID,\r\n    Images: test.Images\r\n  })\r\n  return ObservableFromFetch<string>(\"WorkforceTrack/CompleteTest\", requestBody)\r\n}\r\n\r\nexport function UnarchiveTest(test: TestToProcess) {\r\n  const requestBody: string = JSON.stringify({\r\n    TestDetailID: test.TestDetailID,\r\n    TestDetailClinicalID: test.TestDetailClinicalID,\r\n    PersonID: test.PersonID\r\n  })\r\n  return ObservableFromFetch<string>(\"WorkforceTrack/UnarchiveTest\", requestBody)\r\n}","export enum Status {\r\n  None = 0,       // No Color\r\n  Completed = 1,  // Green\r\n  InProcess = 2,  // Yellow\r\n  Alert = 3,      // Red\r\n  NoStatus = 4,   // Grey\r\n  Cancelled = 5,   // Grey\r\n}\r\n","import React, { Component } from \"react\"\r\nimport { Button, Col, Container, Form, Modal, Row } from \"react-bootstrap\"\r\nimport DatePicker from 'react-datepicker'\r\nimport { Subscription } from \"rxjs\"\r\nimport 'react-datepicker/dist/react-datepicker.css'\r\nimport { BirthdayInput } from \"../FormattedInputs/BirthdayInput\"\r\nimport { toast } from \"react-toastify\"\r\nimport { APIError } from \"../../api/ObservableFromFetch\"\r\nimport CompanyPoolsGet, { CompanyPool } from \"../../api/OrderResults/CompanyPoolsGet\"\r\nimport ActionButton from \"../ActionButton\"\r\nimport CompleteTest, { UnarchiveTest } from \"../../api/OrderResults/CompleteTest\"\r\n\r\nexport interface TestToProcess {\r\n  TestEventID?: number\r\n  TestDetailID: string\r\n  TestDetailClinicalID: string\r\n  PersonID: number\r\n  HireDate: Date | undefined\r\n  PoolID: number | string | null\r\n  Images: string[]\r\n  DonorName?: string\r\n  AuthorizationID?: string\r\n}\r\n\r\ninterface CompleteModalProps {\r\n  selectedTests: TestToProcess[]\r\n  unarchive: boolean\r\n  show: boolean\r\n  onHide: () => void\r\n  onSave: () => void\r\n}\r\n\r\ninterface CompleteModalState {\r\n  currentTest: TestToProcess\r\n  hireDate: Date | undefined\r\n  pools: CompanyPool[]\r\n  saving: boolean\r\n  didHire: boolean | undefined\r\n  showHireModal: boolean\r\n  showCompleteModal: boolean\r\n  testsToProcess: TestToProcess[]\r\n  processedTests: TestToProcess[]\r\n  currentDonorIndex: number\r\n}\r\n\r\n\r\nexport default class CompleteModal extends Component<CompleteModalProps, CompleteModalState> {\r\n  state: CompleteModalState = {\r\n    pools: [],\r\n    hireDate: undefined,\r\n    saving: false,\r\n    didHire: undefined,\r\n    currentTest: this.props.selectedTests[0],\r\n    currentDonorIndex: 0,\r\n    showHireModal: this.props.selectedTests.length !== 1,\r\n    showCompleteModal: this.props.selectedTests.length === 1,\r\n    testsToProcess: this.props.selectedTests,\r\n    processedTests: []\r\n  }\r\n\r\n  hiredate = React.createRef<DatePicker>()\r\n  poolSubscription?: Subscription\r\n  saveSubscription?: Subscription\r\n\r\n  componentDidMount() {\r\n    this.poolSubscription = CompanyPoolsGet(this.state.testsToProcess[0]?.TestEventID || 0).subscribe(\r\n      (data) => this.setState({ pools: data }),\r\n      (error) => this.handleAPIError(error, {})\r\n    )\r\n    this.completeAllTests(0)\r\n  }\r\n\r\n  componentWillUnmount() {\r\n    this.poolSubscription && this.poolSubscription.unsubscribe()\r\n    this.saveSubscription && this.saveSubscription.unsubscribe()\r\n  }\r\n\r\n  handlePoolChange = (event: React.ChangeEvent<HTMLInputElement>) => {\r\n    const value = event.target.value\r\n    this.setState({ currentTest: { ...this.state.currentTest, PoolID: value } })\r\n  }\r\n\r\n  handleAPIError = (error: Error | APIError, stateChanges: object) => {\r\n    this.setState(stateChanges)\r\n    error && toast.error((error as APIError)?.errorData?.message || error.message)\r\n  }\r\n\r\n  onCancelHireModal = () => {\r\n    this.setState({ showHireModal: false })\r\n    this.props.onHide()\r\n  }\r\n\r\n  onSubmitHireModal = () => {\r\n    if (this.state.didHire) {\r\n      this.setState({ showCompleteModal: true })\r\n    }\r\n    else {\r\n      this.setState({ saving: true })\r\n      this.completeAllTests(0)\r\n    }\r\n  }\r\n\r\n  completeTest = () => {\r\n    this.setState({ saving: true })\r\n    const { currentTest } = this.state\r\n\r\n    const testToComplete: TestToProcess = {\r\n      TestDetailID: currentTest.TestDetailID,\r\n      TestDetailClinicalID: currentTest.TestDetailClinicalID,\r\n      PersonID: currentTest.PersonID,\r\n      HireDate: this.state.hireDate,\r\n      PoolID: currentTest.PoolID || null,\r\n      Images: currentTest.Images || []\r\n    }\r\n\r\n    this.saveSubscription = CompleteTest(testToComplete).subscribe(\r\n      (data) => {\r\n        toast.success(\"Test was successfully marked archived.\")\r\n        this.setState({ saving: false, processedTests: [ ...this.state.processedTests, testToComplete ] })\r\n      },\r\n      (error) => this.handleAPIError(error, { saving: false })\r\n    )\r\n  }\r\n\r\n  completeAllTests = (currentIndex: number) => {\r\n    const currentTest = this.state.testsToProcess[currentIndex]\r\n    const testToComplete: TestToProcess = {\r\n      TestDetailID: currentTest.TestDetailID,\r\n      TestDetailClinicalID: currentTest.TestDetailClinicalID,\r\n      PersonID: currentTest.PersonID,\r\n      HireDate: undefined,\r\n      PoolID: 0,\r\n      Images: []\r\n    }\r\n\r\n    if (!!this.props.unarchive) {\r\n      this.saveSubscription = UnarchiveTest(testToComplete).subscribe(\r\n      (data) => {\r\n        if (currentIndex + 1 === this.state.testsToProcess.length) {\r\n          toast.success(\"Tests were successfully unarchived.\")\r\n          this.setState({ showHireModal: false, saving: false })\r\n          this.props.onHide()\r\n          this.props.onSave()\r\n        }\r\n        else this.completeAllTests(currentIndex + 1)\r\n      },\r\n      (error) => this.handleAPIError(error, { saving: false })\r\n    )\r\n    }\r\n    else {\r\n      this.saveSubscription = CompleteTest(testToComplete).subscribe(\r\n        (data) => {\r\n          if (currentIndex + 1 === this.state.testsToProcess.length) {\r\n            toast.success(\"Tests were successfully marked archived.\")\r\n            this.setState({ showHireModal: false, saving: false })\r\n            this.props.onHide()\r\n            this.props.onSave()\r\n          }\r\n          else this.completeAllTests(currentIndex + 1)\r\n        },\r\n        (error) => this.handleAPIError(error, { saving: false })\r\n      )\r\n    }\r\n  }\r\n\r\n  onSubmit = () => {\r\n    this.completeTest()\r\n  }\r\n\r\n  onCancel = () => {\r\n    const { testsToProcess, currentDonorIndex } = this.state\r\n    if (testsToProcess.length === 1 || currentDonorIndex + 1 === testsToProcess.length) {\r\n      this.props.onHide()\r\n      this.props.onSave()\r\n    }\r\n    else {\r\n      const newDonorIndex = currentDonorIndex + 1\r\n      const newDonorTest = this.state.testsToProcess[newDonorIndex]\r\n      const testForSameDonor =  this.state.processedTests.find(item => item.PersonID === newDonorTest.PersonID && item.HireDate)\r\n      const hireDate = testForSameDonor?.HireDate ? testForSameDonor.HireDate : undefined\r\n      this.setState({ currentTest: { ...newDonorTest}, currentDonorIndex: newDonorIndex, hireDate: hireDate })\r\n    }\r\n  }\r\n\r\n  render() {\r\n    const { testsToProcess, currentTest, pools, currentDonorIndex, showHireModal, showCompleteModal, processedTests, hireDate } = this.state\r\n    const lastDonor = currentDonorIndex + 1 === testsToProcess.length\r\n    const testForSameDonor = processedTests.some(item => item.PersonID === currentTest.PersonID && item.TestDetailID !== currentTest.TestDetailID && item.HireDate)\r\n    return (\r\n      <>\r\n      </>\r\n    )\r\n  }\r\n}\r\n","import { ObservableFromFetch } from \"../ObservableFromFetch\"\r\n\r\nexport interface CompanyPool {\r\n  PoolID: number\r\n  PoolName: string\r\n}\r\n\r\nexport default function CompanyPoolsGet(testEventId: number) {\r\n  const requestBody: string = JSON.stringify({\r\n    TestEventID: testEventId\r\n  })\r\n  return ObservableFromFetch<CompanyPool[]>(\"WorkforceRandomTest/GetCompanyPools\", requestBody)\r\n}\r\n","export default \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJYAAACWCAYAAAA8AXHiAAAABGdBTUEAALGPC/xhBQAAAAFz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CDL3Cbg6+jTJRcSeYPblh0VJCLyUiQe7OK0nBy43n1I4NhnkTi8TyIBcMfMWjHeidUK8xENeRdyaTuPkdr0KqJpr22i9yOa+CFGaulrmvxascyOGgWtiPX/7i9Twq3/80MAAAAldEVYdGRhdGU6Y3JlYXRlADIwMTktMDQtMTVUMTQ6Mzg6NTQrMDA6MDCrqYHaAAAAJXRFWHRkYXRlOm1vZGlmeQAyMDE5LTA0LTE1VDE0OjM4OjU0KzAwOjAw2vQ5ZgAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAAASUVORK5CYII=\"","import React from \"react\"\r\n\r\nimport { Col, Container, OverlayTrigger, Popover, Row } from \"react-bootstrap\"\r\n\r\nimport OrderResultRecord from \"../../api/OrderResults/OrderResultModel/OrderResultRecord\"\r\nimport Stage, { Collect, StatusDetail } from \"../../api/OrderResults/OrderResultModel/Stage\"\r\nimport { Status } from \"../../api/OrderResults/OrderResultModel/Status\"\r\nimport ImageOrderExpired from \"../../assets/images/order-expired.png\"\r\nimport { FormatShortDateTime } from \"../../formatters/FormatDate\"\r\n\r\nconst stepStatusColor = (stage: Stage, showCompleteOrders: boolean) => {\r\n  // TODO: code below was ported from angular application, refactor into meaningful class names (e.g. success, warning error etc)\r\n  switch (stage.Status) {\r\n    case Status.None:\r\n      return \"status-none\"\r\n    case Status.Completed:\r\n      return showCompleteOrders ? \"status-completed-close\" : \"status-completed\"\r\n    case Status.InProcess:\r\n      return \"status-in-progress\"\r\n    case Status.Alert:\r\n      return \"status-alert\"\r\n    case Status.Cancelled:\r\n      return \"status-no-status\"\r\n    case Status.NoStatus || (showCompleteOrders && stage.Status !== Status.Completed):\r\n      return \"status-no-status\"\r\n    default:\r\n      return \"status-no-status\"\r\n  }\r\n}\r\n\r\nconst isCollect = (statusDetail: StatusDetail | undefined): statusDetail is Collect => {\r\n  return (\r\n    statusDetail !== undefined &&\r\n    \"siteName\" in statusDetail &&\r\n    \"siteAddress\" in statusDetail &&\r\n    \"collectionDate\" in statusDetail &&\r\n    \"collectionStatus\" in statusDetail\r\n  )\r\n}\r\n\r\ninterface GridStatusInfoProps {\r\n  value: OrderResultRecord\r\n  showCompleteOrders: boolean\r\n}\r\n\r\nfunction GridStatusInfo({ value, showCompleteOrders }: GridStatusInfoProps) {\r\n  const stages = value.Stages || []\r\n  const { ScheduleStatusID, TestEventStatus, TestDetailClinicalID, IsExpired, ExpirationDate, ColStatus } = value\r\n\r\n  const showEventStatus = ScheduleStatusID > 0 && TestDetailClinicalID && TestEventStatus === \"Cancelled\"\r\n  const collect = stages.find((s) => s.Name === \"Collect\")?.StatusDetail\r\n  const collectDetail = collect && isCollect(collect) ? collect.CollectionStatus : undefined\r\n  // -eslint-disable-next-line no-nested-ternary, prettier/prettier\r\n  const extraStatus = ScheduleStatusID === 11 // Canceled\r\n      ? TestEventStatus\r\n      : !!ColStatus && collectDetail !== \"Collected\"\r\n        ? ColStatus\r\n        : \"\"\r\n  const shownStage = stages.find((stage) => stage.Status === Status.Completed) || stages[stages.length - 1]\r\n\r\n  if (!stages.length) return null\r\n\r\n  return (\r\n    <>\r\n      <Container className=\"d-none d-sm-block overflow-hidden\" style={{ whiteSpace: \"nowrap\" }}>\r\n        {shownStage?.IsStatusVisible ? (\r\n          <Row>\r\n            <Col className={`${stepStatusColor(shownStage, showCompleteOrders)} px-1 step`}>\r\n              <span className=\"numbers mr-2\">\r\n                {showCompleteOrders && shownStage.Status !== 1 ? \"X\" : shownStage.Sequence}\r\n              </span>\r\n              <span className=\"montserrat-regular\">\r\n                {showEventStatus ? TestEventStatus : shownStage.StatusDetail.Description}\r\n              </span>\r\n              <span className=\"status-details\">\r\n                {ScheduleStatusID > 0 && !shownStage?.StatusDetail?.Detail\r\n                  ? extraStatus\r\n                  : shownStage?.StatusDetail?.Detail}\r\n              </span>\r\n              {IsExpired && !!ExpirationDate && (\r\n                <OverlayTrigger\r\n                  placement=\"top\"\r\n                  delay={{ show: 100, hide: 400 }}\r\n                  overlay={\r\n                    <Popover id=\"exp-date\">\r\n                      <Popover.Title as=\"h3\">Expiration Date:</Popover.Title>\r\n                      <Popover.Content>{FormatShortDateTime(ExpirationDate)}</Popover.Content>\r\n                    </Popover>\r\n                  }\r\n                >\r\n                  <img\r\n                    src={ImageOrderExpired}\r\n                    alt=\"Order expired\"\r\n                    width=\"20\"\r\n                    height=\"20\"\r\n                    className=\"ml-1\"\r\n                    aria-label=\"Order expired icon\"\r\n                  />\r\n                </OverlayTrigger>\r\n              )}\r\n            </Col>\r\n          </Row>\r\n        ) : (\r\n          <Row>\r\n            <Col>{shownStage.Name}</Col>\r\n          </Row>\r\n        )}\r\n      </Container>\r\n      <Container className=\"d-block d-sm-none\">\r\n        {stages.slice(-2).map((stage) => (\r\n          <div key={stage.Name.replace(/\\s/g, \"_\")}>\r\n            {stage.IsStatusVisible ? (\r\n              <>\r\n                <Row>\r\n                  <Col>{stage.Name}</Col>\r\n                </Row>\r\n                <Row className=\"color-status\">\r\n                  <Col className={stepStatusColor(stage, showCompleteOrders)} />\r\n                </Row>\r\n              </>\r\n            ) : (\r\n              <Row>\r\n                <Col>{stage.Name}</Col>\r\n              </Row>\r\n            )}\r\n          </div>\r\n        ))}\r\n      </Container>\r\n    </>\r\n  )\r\n}\r\n\r\nexport default GridStatusInfo\r\n","import { ObservableFromFetch } from \"../ObservableFromFetch\"\r\n\r\ninterface ImageRequest {\r\n  TestImageID: number\r\n  TestDetailID: string\r\n  TestDetailClinicalID: string\r\n  IsMarketPlace: boolean\r\n  TestDescription: string\r\n}\r\n\r\nexport interface ImageData {\r\n  Base64String: Base64String[]\r\n  ImageType: string\r\n  ExceptionMessage?: string\r\n}\r\n\r\nexport interface Base64String {\r\n  Base64Strings: string\r\n  ImageType: string\r\n  Title: string\r\n}\r\n\r\nexport enum TestReleaseStatusID {\r\n  PoctComplete = 5,\r\n  PoctCompleteReleased = 6,\r\n  LaboratoryTestingComplete = 8,\r\n  LaboratoryTestingCompleteReleased = 9,\r\n  MroReviewComplete = 11,\r\n  MroReviewCompleteReleased = 12\r\n}\r\n\r\nexport default function ImageGet(request: ImageRequest) {\r\n  const requestBody: string = JSON.stringify(request)\r\n  return ObservableFromFetch<ImageData>(\"CCFImage/GetCCFImage\", requestBody)\r\n}\r\n\r\nexport function GenerateMROReport(testDetailID: string) {\r\n  const requestBody: string = JSON.stringify({\r\n    ReportKey: 1,\r\n    PrintRecords: testDetailID\r\n  })\r\n\r\n  return ObservableFromFetch<string>(\"Report/EventsReport\", requestBody)\r\n}\r\n\r\nexport function GetMROLetter(testDetailID: string) {\r\n  const requestBody: string = JSON.stringify({\r\n    PrintRecords: testDetailID\r\n  })\r\n\r\n  return ObservableFromFetch<string>(\"WorkforceReport/MroLetter\", requestBody)\r\n}\r\n","export enum TestTypes {\r\n  CRLCovidClearAntibody = \"CRL Covid Clear - Antibody\",\r\n  CRLRapidResponseCovid = \"CRL Rapid Response - Covid\"\r\n}\r\n","import React, { Component } from \"react\"\r\nimport { Container, Modal, Row } from \"react-bootstrap\"\r\nimport OrderResultRecord from \"../../api/OrderResults/OrderResultModel/OrderResultRecord\"\r\nimport Stage, { Exam, Investigation, Notification, SiteAssigned, Laboratory, Screen, Collect, MRO, Confirm, POCT } from \"../../api/OrderResults/OrderResultModel/Stage\"\r\nimport { Status } from \"../../api/OrderResults/OrderResultModel/Status\"\r\nimport FormatDate from \"../../formatters/FormatDate\"\r\n\r\nconst stageStatus = (status: Status): string => {\r\n  switch (status.toString()) {\r\n    case Status.None.toString(): return \"status-none\"\r\n    case Status.Completed.toString(): return \"status-completed\"\r\n    case Status.InProcess.toString(): return \"status-in-progress\"\r\n    case Status.Alert.toString(): return \"status-alert\"\r\n    case Status.NoStatus.toString(): return \"status-no-status\"\r\n    default: return \"\"\r\n  }\r\n}\r\n\r\ninterface ModalStatusInfoProps {\r\n  details: OrderResultRecord\r\n  onHide: () => void\r\n}\r\n\r\nexport default class ModalStatusInfo extends Component<ModalStatusInfoProps> {\r\n  render() {\r\n    const renderStatus = (status: OrderResultRecord) => {\r\n      if (!status.Stages) {\r\n        return <></>\r\n      }\r\n      return status.Stages.map((stage: Stage, key: number) => {\r\n        let fields = []\r\n        const header = (label: string) => <Row className={stageStatus(stage.StatusDetail.Status)} key={label + key}>{label}</Row>\r\n        const field = (label: string, value: string | number): JSX.Element | null => value ? <Row key={label + key}>{label}: {value}</Row> : null\r\n        if (stage.Name === \"Investigation\") {\r\n          const detail = stage.StatusDetail as Investigation\r\n          fields.push(header(\"INVESTIGATION\"))\r\n          fields.push(field(\"Title\", detail.Title))\r\n          fields.push(field(\"Date Order\", FormatDate(detail.DateOrder)))\r\n          fields.push(field(\"Reference ID\", detail.ReferenceID))\r\n          fields.push(field(\"Processed By\", detail.ProcessedBy))\r\n        }\r\n        if (stage.Name === \"Exam\") {\r\n          const detail = stage.StatusDetail as Exam\r\n          fields.push(header(\"EXAM\"))\r\n          fields.push(field(\"Title\", detail.Title))\r\n          fields.push(field(\"Site Name\", detail.SiteName))\r\n          fields.push(field(\"Site Address\", detail.SiteAddress))\r\n          fields.push(field(\"Collection Date\", FormatDate(detail.CollectionDate)))\r\n          fields.push(field(\"Status\", detail.Status))\r\n        }\r\n        if (stage.Name === \"Notification\") {\r\n          const detail = stage.StatusDetail as Notification\r\n          fields.push(header(\"NOTIFICATION\"))\r\n          fields.push(field(\"Title\", detail.Title))\r\n          fields.push(field(\"Notification Date\", FormatDate(detail.NotificationDate)))\r\n          fields.push(field(\"Recipient\", detail.Recipient))\r\n          fields.push(field(\"Method\", detail.Method))\r\n        }\r\n        if (stage.Name === \"Site Assigned\") {\r\n          const detail = stage.StatusDetail as SiteAssigned\r\n          fields.push(header(\"SITE ASSIGNED\"))\r\n          fields.push(field(\"Title\", detail.Title))\r\n          fields.push(field(\"Site Name\", detail.SiteName))\r\n          fields.push(field(\"Site Address\", detail.SiteAddress))\r\n        }\r\n        if (stage.Name === \"Laboratory\") {\r\n          const detail = stage.StatusDetail as Laboratory\r\n          fields.push(header(\"LABORATORY\"))\r\n          fields.push(field(\"Title\", detail.Title))\r\n          fields.push(field(\"Laboratory Name\", detail.LaboratoryName))\r\n          fields.push(field(\"Date Received\", FormatDate(detail.DateReceived)))\r\n          fields.push(field(\"Report Date\", FormatDate(detail.ReportDate)))\r\n        }\r\n        if (stage.Name === \"MRO\") {\r\n          const detail = stage.StatusDetail as MRO\r\n          fields.push(header(\"MRO\"))\r\n          fields.push(field(\"Title\", detail.Title))\r\n          fields.push(field(\"Date Received\", FormatDate(detail.DateReceived)))\r\n          fields.push(field(\"MRO Status\", detail.MROStatus))\r\n        }\r\n        if (stage.Name === \"Collect\") {\r\n          const detail = stage.StatusDetail as Collect\r\n          fields.push(header(\"COLLECT\"))\r\n          fields.push(field(\"Title\", detail.Title))\r\n          fields.push(field(\"Site Name\", detail.SiteName))\r\n          fields.push(field(\"Site Address\", detail.SiteAddress))\r\n          fields.push(field(\"Collection Date\", FormatDate(detail.CollectionDate)))\r\n          fields.push(field(\"Collection Status\", detail.CollectionStatus))\r\n        }\r\n        if (stage.Name === \"Screen\") {\r\n          const detail = stage.StatusDetail as Screen\r\n          fields.push(header(\"SCREEN\"))\r\n          fields.push(field(\"Title\", detail.Title))\r\n          fields.push(field(\"Site Name\", detail.SiteName))\r\n          fields.push(field(\"Site Address\", detail.SiteAddress))\r\n          fields.push(field(\"Collection Date\", FormatDate(detail.CollectionDate)))\r\n        }\r\n        if (stage.Name === \"Confirm\") {\r\n          const detail = stage.StatusDetail as Confirm\r\n          fields.push(header(\"CONFIRM\"))\r\n          fields.push(field(\"Title\", detail.Title))\r\n          fields.push(field(\"Site Name\", detail.SiteName))\r\n          fields.push(field(\"Site Address\", detail.SiteAddress))\r\n          fields.push(field(\"Collection Date\", FormatDate(detail.CollectionDate)))\r\n        }\r\n        if (stage.Name === \"POCT\") {\r\n          const detail = stage.StatusDetail as POCT\r\n          fields.push(header(\"POCT Reported\"))\r\n          fields.push(field(\"Title\", detail.Title))\r\n        }\r\n        return (\r\n          <Container key={key} className={fields.length > 0 ? \"pb-3\" : \"\"}>\r\n            {fields}\r\n          </Container>\r\n        )\r\n      })\r\n    }\r\n    const status = this.props.details\r\n    return (\r\n      <Modal show onHide={this.props.onHide} dialogClassName=\"status-info\" >\r\n        <Modal.Header closeButton>\r\n          <Modal.Title>STATUS INFORMATION</Modal.Title>\r\n        </Modal.Header>\r\n        <Modal.Body>\r\n          {status ? renderStatus(status) : \"\"}\r\n        </Modal.Body>\r\n      </Modal>\r\n    )\r\n  }\r\n}\r\n","export default \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAYCAYAAAD6S912AAAByElEQVQ4EbVVv2vCQBR+p7GzDkUcHNrJpYVCR13awd1/w1lwcOnmP+B/4NRgQZcOUhfXgoWK6CIZrIOCraSlQUzse9feeYlp8YQ+OO679+PLdy93CfM8bwN7WqVSgX6/T9mJVqv1FlYWQULYdzDGoF6vQyQSeQ0jI5/huu5vsR1/NBoF27ahVqtBLBajnSVM0/Qp1VboOA7QqFargA/YUXqQQiG9XC6DYRhcKbaCKzWof/sa9g7G47EvvVAoQLPZJKWMAloKi8Wij0wshsOhgKClUFYFACkXpqVQFAVnH6FOD4NEYu0j1DmHgiA40/kUJnu4Mk3wJhPh15pPBwN4BrihImZZFr/LT9ksHB9IqD5dKvxE74caQXy1XnNPxzB8+Prnuj4oWxWl8i2/o2fbCYCLdhvukIjsrNGQmNaz2Qy6qRTBHZN32dlsuEJSScNNp+V6FY9LTLHlcgnneJhFrjpLhTYmfm8QAdp9JgOX3S7HnVxO4kfE8/kcaA4zhh9M/lJu83k4enkJy9HybRXiltUearEoyazX63GF0+lUcetB+jiUSqUTrHKkwmQyqceiZC8WC/qNWOSS51CJa8P/vcuj0Uhb0V8FX23+DaPCz0G5AAAAAElFTkSuQmCC\"","export default \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAYCAYAAAD6S912AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7E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/j3FzDAMXvA5n4fzAwvGFfXwHZO3GDfrNSeex8db3KpAvENEPXzFZBlyMZvBQzbLoZjm5vO5NFqWBV3sHUHXjiBy6AW//77vsLjQarWCa8yJnQ6T6CmXC6OvOJ4LRQ5dTITtR3zxajDgUExztm1Lo3gucgEbjUZ8r91CAU6W1J3j9O0Qexhf6VDYcDg8+raZTqdQqVT+8W0j/Zc1TTt6y6RqtYpbBvgEl2HI6eJHZ08AAAAASUVORK5CYII=\"","import { Observable } from \"rxjs\"\r\nimport { ObservableFromFetch } from \"../ObservableFromFetch\"\r\n\r\nexport interface TestResolveData {\r\n  TestEventID: number\r\n  AlertResolved: boolean\r\n  WatchResolved: boolean\r\n  TimingAlertResolved: boolean\r\n  ResultsAcknowledged: boolean\r\n}\r\nexport default function ResultsResolveObservable(testsData: TestResolveData[], modifiedBy: string): Observable<string> {\r\n  const params: string = JSON.stringify({ TestEventIDS: testsData, ModifiedBy: modifiedBy })\r\n  return ObservableFromFetch<string>(\"FFOrderWatchResolve/Resolve\", params)\r\n}\r\n","import * as React from \"react\"\r\n\r\nimport { Col, OverlayTrigger, Popover, Row } from \"react-bootstrap\"\r\nimport { FaArchive } from \"react-icons/fa\"\r\n\r\nimport OrderTrackingRowWarning from \"./OrderTrackingRowWarning\"\r\nimport OrderResultRecord from \"../../api/OrderResults/OrderResultModel/OrderResultRecord\"\r\nimport OrderResultRecordIdentifier from \"../../api/OrderResults/OrderResultModel/OrderResultRecordIdentifier\"\r\nimport { ImplementationTypeGovt } from \"../../config/Constants\"\r\nimport Checkbox from \"../Checkbox\"\r\n\r\nexport interface OrderTrackingCheckboxProps {\r\n  idPrefix: string\r\n  item: OrderResultRecordIdentifier\r\n  row: OrderResultRecord\r\n  implementationType: string\r\n  checked: boolean\r\n  disabled: boolean\r\n  onChange: (item: OrderResultRecordIdentifier, checked: boolean) => void\r\n}\r\n\r\nfunction OrderTrackingCheckbox({\r\n  idPrefix,\r\n  item,\r\n  row,\r\n  implementationType,\r\n  checked,\r\n  disabled,\r\n  onChange,\r\n}: OrderTrackingCheckboxProps) {\r\n  const handleChange = (e: React.ChangeEvent<HTMLInputElement>) => onChange(item, e.target.checked)\r\n\r\n  return (\r\n    <Row>\r\n      <Col className=\"d-flex justify-content-center align-items-center p-0\">\r\n        {implementationType !== ImplementationTypeGovt}\r\n      </Col>\r\n      <Col className=\"d-flex justify-content-center align-items-center p-0\">\r\n        <Checkbox\r\n          id={`${idPrefix}_${item.TestDetailID}_${item.TestDetailClinicalID}`}\r\n          className=\"mt-1\"\r\n          checked={checked}\r\n          disabled={disabled}\r\n          onChange={handleChange}\r\n        />\r\n      </Col>\r\n      <Col className=\"d-flex justify-content-center align-items-center p-0\">\r\n        {item.Archived && (\r\n          <OverlayTrigger\r\n            placement=\"top-start\"\r\n            delay={{ show: 100, hide: 400 }}\r\n            overlay={\r\n              <Popover id=\"is_archived\" className=\"bg-light\">\r\n                <Popover.Content>The sample is archived.</Popover.Content>\r\n              </Popover>\r\n            }\r\n          >\r\n            <FaArchive className=\"icon icon-archived\" />\r\n          </OverlayTrigger>\r\n        )}\r\n      </Col>\r\n    </Row>\r\n  )\r\n}\r\n\r\nexport default OrderTrackingCheckbox\r\n","import React, { Component } from \"react\"\r\nimport { Button, Col, Container, Form, Modal, Row } from \"react-bootstrap\"\r\nimport OrderResultRecord from \"../../api/OrderResults/OrderResultModel/OrderResultRecord\"\r\nimport { toast } from \"react-toastify\"\r\nimport AuthFormProcessObservable from \"../../api/OrderResults/AuthForm\"\r\nimport printPdf from \"../../utils/printPdf\"\r\nimport FormatError from \"../../formatters/FormatError\"\r\nimport { EmailRegexp, PhoneRegexp } from \"../../config/Constants\"\r\nimport PhoneNumberMaskedInput from \"../FormattedInputs/PhoneNumberMaskedInput\"\r\nimport ActionButton from \"../ActionButton\"\r\nimport { FaMinus, FaPlus } from \"react-icons/fa\"\r\nimport { Subscription } from \"rxjs\"\r\nimport { AppState } from \"../../AppState\"\r\nimport { connect } from \"react-redux\"\r\nimport { BuildUserAccess } from \"../../authentication/BuildUserAccess\"\r\n\r\ninterface AuthFormModalProps {\r\n  details?: OrderResultRecord\r\n  onHide: () => void\r\n  onEdit?: (data: OrderResultRecord) => void\r\n  isAfterUpdate?: boolean\r\n}\r\n\r\ninterface AuthFormModalAuthProps {\r\n  canEditPendingOrders?: boolean\r\n}\r\n\r\ninterface AuthFormModalState {\r\n  emailItems: string[]\r\n  mobileItems: string[]\r\n  sendingEmail: boolean\r\n  sendingText: boolean\r\n}\r\n\r\nclass AuthFormModal extends Component<AuthFormModalProps & AuthFormModalAuthProps, AuthFormModalState> {\r\n  state: AuthFormModalState = {\r\n    emailItems: [\"\"],\r\n    mobileItems: [\"\"],\r\n    sendingEmail: false,\r\n    sendingText: false\r\n  }\r\n\r\n  loadSubscription?: Subscription\r\n\r\n  componentWillUnmount() {\r\n    this.loadSubscription && this.loadSubscription.unsubscribe()\r\n  }\r\n\r\n  handlePrintClick = (): void => {\r\n    this.loadSubscription && this.loadSubscription.unsubscribe()\r\n    const params = {\r\n      FormFoxTestAN: Number(this.props.details?.FormFoxTestAN || 0),\r\n      PersonID: this.props.details?.PersonID || 0,\r\n      VendorID: this.props.details?.CollectionVendorID || 0,\r\n      SendToEmail: false,\r\n      SendText: false,\r\n      EmailAddress: []\r\n    }\r\n    this.loadSubscription = AuthFormProcessObservable(params).subscribe(\r\n      data => printPdf(data),\r\n      error => toast.error(FormatError(error))\r\n    )\r\n  }\r\n\r\n  addEmail = (index: number, email: string = \"\") => {\r\n    if (email !== this.state.emailItems[index]) {\r\n      this.setState({ emailItems: [...this.state.emailItems, email] })\r\n    }\r\n  }\r\n\r\n  removeEmail = (email: string, index: number) => {\r\n    var array = [...this.state.emailItems]\r\n    if (index > -1) {\r\n      array.splice(index, 1)\r\n      this.setState({ emailItems: array })\r\n    }\r\n  }\r\n\r\n  changeEmail = (email: string, index: number) => {\r\n    var array = [...this.state.emailItems]\r\n    if (index > -1) {\r\n      array[index] = email\r\n      this.setState({ emailItems: array })\r\n    }\r\n  }\r\n\r\n  sendEmail = () => {\r\n    if (this.state.emailItems.filter(Boolean).length > 0) {\r\n      if (Array.from(new Set(this.state.emailItems.map(value => value.toLowerCase()))).length !== this.state.emailItems.length) {\r\n        toast.error(\"Duplicate email address is present in the list.\")\r\n        return\r\n      }\r\n      this.loadSubscription && this.loadSubscription.unsubscribe()\r\n      const params = {\r\n        EmailAddress: this.state.emailItems,\r\n        FormFoxTestAN: Number(this.props.details?.FormFoxTestAN || 0),\r\n        PersonID: this.props.details?.PersonID || 0,\r\n        VendorID: this.props.details?.CollectionVendorID || 0,\r\n        SendToEmail: true,\r\n        SendText: false\r\n      }\r\n      this.setState({ sendingEmail: true })\r\n      this.loadSubscription = AuthFormProcessObservable(params).subscribe(\r\n        data => toast.success(data),\r\n        error => toast.error(FormatError(error))\r\n      )\r\n      this.setState({ sendingEmail: false })\r\n    }\r\n    else {\r\n      toast.error(\"Please enter email address.\")\r\n    }\r\n  }\r\n\r\n  isEmailValid = (value: string): boolean => {\r\n    if (value.length === 0) {\r\n      return true\r\n    }\r\n    return EmailRegexp.test(value)\r\n  }\r\n\r\n  canAddEmail = (email: string): boolean => email.length > 0 && this.isEmailValid(email)\r\n\r\n  addMobile = (index: number, phone: string = \"\") => {\r\n    if (phone !== this.state.mobileItems[index]) {\r\n      this.setState({ mobileItems: [...this.state.mobileItems, phone] })\r\n    }\r\n  }\r\n\r\n  removeMobile = (phone: string, index: number) => {\r\n    var array = [...this.state.mobileItems]\r\n    if (index > -1) {\r\n      array.splice(index, 1)\r\n      this.setState({ mobileItems: array })\r\n    }\r\n  }\r\n\r\n  changeMobile = (phone: string, index: number) => {\r\n    var array = [...this.state.mobileItems]\r\n    if (index > -1) {\r\n      array[index] = phone\r\n      this.setState({ mobileItems: array })\r\n    }\r\n  }\r\n\r\n  sendText = () => {\r\n    if (this.state.mobileItems.filter(Boolean).length > 0) {\r\n      if (Array.from(new Set(this.state.mobileItems.map(value => value.toLowerCase()))).length !== this.state.mobileItems.length) {\r\n        toast.error(\"Duplicate mobile number is present in the list.\")\r\n        return\r\n      }\r\n      this.loadSubscription && this.loadSubscription.unsubscribe()\r\n      const params = {\r\n        EmailAddress: this.state.mobileItems,\r\n        FormFoxTestAN: Number(this.props.details?.FormFoxTestAN || 0),\r\n        PersonID: this.props.details?.PersonID || 0,\r\n        VendorID: this.props.details?.CollectionVendorID || 0,\r\n        SendToEmail: false,\r\n        SendText: true\r\n      }\r\n      this.setState({ sendingText: true })\r\n      this.loadSubscription = AuthFormProcessObservable(params).subscribe(\r\n        data => toast.success(\"Text sent successfully\"),\r\n        error => toast.error(FormatError(error))\r\n      )\r\n      this.setState({ sendingText: false })\r\n    }\r\n    else {\r\n      toast.error(\"Please enter mobile number.\")\r\n    }\r\n  }\r\n\r\n  isPhoneValid = (value: string): boolean => value.length === 0 || PhoneRegexp.test(value)\r\n  canAddMobile = (mobile: string): boolean => mobile.length > 0 && this.isPhoneValid(mobile)\r\n\r\n  render() {\r\n    const { sendingEmail, sendingText, mobileItems, emailItems } = this.state\r\n    const { details, onHide, canEditPendingOrders } = this.props\r\n\r\n    return (\r\n      <Modal show onHide={onHide} size=\"lg\" dialogClassName=\"dark\">\r\n        <Modal.Header closeButton>\r\n          <Modal.Title>\r\n            {!this.props.isAfterUpdate && <h4 className=\"text-uppercase\"><span>AUTHORIZATION #{ details?.FormFoxTestAN }</span></h4>}\r\n            {!!this.props.isAfterUpdate && <h4 className=\"text-uppercase\"><span>Resend Authorization #{ details?.FormFoxTestAN }</span></h4>}\r\n          </Modal.Title>\r\n        </Modal.Header>\r\n        <Modal.Body className=\"p-3\">\r\n          <Container fluid>\r\n            <Row className=\"pb-2\">\r\n              <Col xs={3} lg={2}>Print form:</Col>\r\n              <Col xs={9} lg={10} className=\"d-flex\"><Button size=\"sm\" className=\"fixed-w10\" onClick={this.handlePrintClick}>Print PDF</Button></Col>\r\n            </Row>\r\n            {emailItems.map((email, index) => <Row className=\"pt-2\" key={ `email-${index}` }>\r\n                <Col xs={12} sm={3} md={3} lg={2}>\r\n                  { index === 0 && \"Email form:\" }\r\n                </Col>\r\n                <Col xs={9} sm={5} md={4}>\r\n                  <Form.Control size=\"sm\" name=\"email_address\" maxLength={ 40 } type=\"text\" value={ email } onChange={ (e) => this.changeEmail(e.target.value, index) } readOnly={ emailItems.length !== index + 1 } isInvalid={ !this.isEmailValid(email) } />\r\n                </Col>\r\n                <Col xs={3} sm={2} md={2}>\r\n                  { emailItems.length === index + 1 ? <Button size=\"sm\" variant=\"primary\" className=\"btn-sm-icon\" onClick={ () => this.addEmail(index) } disabled={ !this.canAddEmail(email) }><FaPlus /></Button> : <Button size=\"sm\" variant=\"primary\" className=\"btn-sm-icon\" onClick={ () => this.removeEmail(email, index) }><FaMinus /></Button> }\r\n                </Col>\r\n                {index === 0 && <Col xs={3} sm={2} md={2}><ActionButton size=\"sm\" className=\"fixed-w10\" onClick={ this.sendEmail } disabled={ emailItems.some(email => !this.isEmailValid(email)) || sendingEmail || sendingText} spin={sendingEmail}>Send Email</ActionButton></Col>}\r\n              </Row>\r\n            )}\r\n            {mobileItems.map((mobile, index) => <Row className=\"pt-2\" key={ `mobile-${index}` }>\r\n                <Col xs={12} sm={3} md={3} lg={2}>\r\n                  { index === 0 && \"Text form:\" }\r\n                </Col>\r\n                <Col xs={9} sm={5} md={4}>\r\n                  <PhoneNumberMaskedInput size=\"sm\" value={ mobile} onChange={(value: string) => this.changeMobile(value, index)} readOnly={ mobileItems.length !== index + 1 } isInvalid={ !this.isPhoneValid(mobile) } />\r\n                </Col>\r\n                <Col xs={3} sm={2} md={2}>\r\n                  { mobileItems.length === index + 1 ? <Button size=\"sm\" variant=\"primary\" className=\"btn-sm-icon\" onClick={ () => this.addMobile(index) } disabled={ !this.canAddMobile(mobile) }><FaPlus /></Button> : <Button size=\"sm\" variant=\"primary\" className=\"btn-sm-icon\" onClick={ () => this.removeMobile(mobile, index) }><FaMinus /></Button> }\r\n                </Col>\r\n                {index === 0 && <Col xs={3} sm={2} md={2}><ActionButton size=\"sm\" className=\"fixed-w10\" onClick={ this.sendText } disabled={ mobileItems.some(mobile => !this.isPhoneValid(mobile)) || sendingEmail || sendingText } spin={sendingText}>Send Text</ActionButton></Col>}\r\n              </Row>\r\n            )}\r\n          </Container>\r\n        </Modal.Body>\r\n        <Modal.Footer>\r\n          {details && canEditPendingOrders && !this.props.isAfterUpdate && <Button size=\"sm\" onClick={() => this.props.onEdit && this.props.onEdit(details)} className=\"mr-auto fixed-w5\">Edit Order</Button>}\r\n          <Button variant=\"secondary\" size=\"sm\" onClick={onHide}>Close</Button>\r\n        </Modal.Footer>\r\n      </Modal>\r\n    )\r\n  }\r\n}\r\n\r\nfunction mapStateToProps(state: AppState): AuthFormModalAuthProps {\r\n  const userAccess = BuildUserAccess(state)\r\n  return {\r\n    canEditPendingOrders: userAccess.canEditPendingOrders\r\n  }\r\n}\r\nconst ConnectedAuthFormModal = connect(mapStateToProps, null)(AuthFormModal)\r\nexport default ConnectedAuthFormModal","import { ObservableFromFetch } from \"../ObservableFromFetch\"\r\n\r\nexport default function OrderCancel(testDetailID?: string, testDetailClinicalID?: string, formFoxTestAN?: string) {\r\n  const requestBody: string = JSON.stringify({\r\n    MockTestDetailID: testDetailID,\r\n    MockTestDetailClinicalID: testDetailClinicalID,\r\n    FormFoxTestAN: formFoxTestAN\r\n  })\r\n\r\n  return ObservableFromFetch<string>(\"WorkforceOrder/CancelOrder\", requestBody)\r\n}","import { ObservableFromFetch } from \"../ObservableFromFetch\"\r\nimport { SetTestDetailVendorParameters } from \"./SSOOrderRequest\"\r\n\r\nexport default function OrderUpdate(parameters: SetTestDetailVendorParameters) {\r\n  const requestBody: string = JSON.stringify(parameters)\r\n  return ObservableFromFetch<string>(\"WorkforceOrder/UpdateOrder\", requestBody)\r\n}\r\n","import React, { Component } from \"react\"\r\nimport { Container, Modal, Spinner } from \"react-bootstrap\"\r\n\r\nexport interface ProcessingModalProps {\r\n  message: string\r\n}\r\nexport default class ProcessingModal extends Component<ProcessingModalProps> {\r\n  render() {\r\n    return (\r\n      <Modal backdrop=\"static\" show size=\"sm\" dialogClassName=\"loading\" centered>\r\n        <Modal.Body>\r\n          <Container fluid>\r\n            <div className=\"text-center\">\r\n              <Spinner animation=\"border\" variant=\"light\" />\r\n              <p>{this.props.message}</p>\r\n            </div>\r\n          </Container>\r\n        </Modal.Body>\r\n      </Modal>)\r\n  }\r\n}\r\n","import * as React from \"react\"\r\nimport { toast } from \"react-toastify\"\r\nimport CollectionSite from \"../../api/Location/LocationModel/CollectionSite\"\r\nimport { stateAbbreviationsToCommonWealthState, StateToTimeZone } from \"../../api/Location/LocationModel/CommonWealthStateTextMapping\"\r\nimport { APIError } from \"../../api/ObservableFromFetch\"\r\nimport { GetOrderRequest, ServicePriceTierParameter, SetFFTestDetailVendor, SetTestDetailVendor, SetTestDetailVendorParameters } from \"../../api/OrderRequests/SSOOrderRequest\"\r\nimport { StorageKey } from \"../../config/Constants\"\r\nimport { GetSSOToken } from \"../../storage/AuthToken\"\r\nimport { AppPageWrapper } from \"../NavMenu/AppPageWrapper\"\r\nimport OrderFinish from \"../OrderRequests/OrderFinish\"\r\nimport ProcessingModal from \"../ProcessingModal\"\r\nimport SiteSearch from \"../SiteSearch/SiteSearch\"\r\n\r\nexport const TimeZoneMapping: {[key: string]: string} = {\r\n  \"CST\": \"Central Standard Time\",\r\n  \"AKST\": \"Alaskan Standard Time\",\r\n  \"MST\": \"Mountain Standard Time\",\r\n  \"HST\": \"Hawaiian Standard Time\",\r\n  \"EDT\": \"Eastern Daylight Time\",\r\n  \"PST\": \"Pacific Standard Time\",\r\n  \"EST\": \"Eastern Standard Time\"\r\n}\r\n\r\ninterface SiteSearchPageState {\r\n  formFoxTestAN: number\r\n  sendLink: boolean\r\n  sendCallback: boolean\r\n  isLoading: boolean\r\n  ssoToken: string\r\n  isSaving: boolean\r\n  showFinish: boolean\r\n  isFFOrder: boolean\r\n  spinnerMessage: string\r\n}\r\nexport default class SiteSearchPage extends React.PureComponent<{}, SiteSearchPageState> {\r\n  state: SiteSearchPageState = {\r\n    formFoxTestAN: 0,\r\n    sendLink: false,\r\n    sendCallback: false,\r\n    isLoading: true,\r\n    ssoToken: GetSSOToken(),\r\n    isSaving: false,\r\n    showFinish: false,\r\n    isFFOrder: false,\r\n    spinnerMessage: \"Data is loading..\"\r\n  }\r\n\r\n  componentDidMount() {\r\n    localStorage.removeItem(StorageKey.CanViewOrderFinish)\r\n    localStorage.removeItem(StorageKey.OrderedServices)\r\n    localStorage.removeItem(StorageKey.SavedOrderData)\r\n    localStorage.removeItem(StorageKey.OrderDonorSiteSelect)\r\n    localStorage.removeItem(StorageKey.FromSelectionInbox)\r\n    this.retrieveFFTestAN()\r\n  }\r\n\r\n  retrieveFFTestAN = () => {\r\n    GetOrderRequest(this.state.ssoToken).subscribe(\r\n      data => this.setState({ formFoxTestAN: data.FormFoxTestAN, sendLink: data.SendLink, sendCallback: data.SendCallback, isFFOrder: data.IsFFOrder, isLoading: false }),\r\n      error => this.handleAPIError(error, { isLoading: false })\r\n    )\r\n  }\r\n\r\n  updateOrder = (site: CollectionSite, params: {сallbackLink?: string, referenceTestID: number}) => {\r\n    this.setState({ isSaving: true, spinnerMessage: \"Saving..\" })\r\n    let timezone = \"\"\r\n    let serviceTiers: ServicePriceTierParameter[] = []\r\n\r\n    if (site.State) {\r\n      const state = stateAbbreviationsToCommonWealthState[site.State]\r\n      const statetimezone = StateToTimeZone[state]\r\n      timezone = TimeZoneMapping[statetimezone] || \"\"\r\n    }\r\n    if (this.state.isFFOrder && !!site.SiteServices) {\r\n      serviceTiers = site.SiteServices.map(el => { return {ServiceCode: el.Code, ServicePriceTier: (el.PriceTier ?? \"\")}})\r\n    }\r\n\r\n    const parameters: SetTestDetailVendorParameters = {\r\n      formFoxTestAN: this.state.formFoxTestAN,\r\n      collectionVendorID: site.VendorID,\r\n      formFoxVendorAN: site.FormFoxVendorAN || 0,\r\n      FFVendorCode: site.Code,\r\n      collectorVendorName: site.Name || \"\",\r\n      servicePriceTiers: serviceTiers,\r\n      ssoToken: this.state.ssoToken,\r\n      timeZone: timezone,\r\n      sendLink: this.state.sendLink,\r\n      sendCallback: this.state.sendCallback,\r\n      isFFOrder: this.state.isFFOrder,\r\n      ReferenceTestID: params.referenceTestID,\r\n      ProceedImmediately:false,\r\n      ExtendExpirationHours: 0,\r\n      IsMarketPlace: site?.IsMarketPlace || false,\r\n      ClinicWasUpdated: true,\r\n    }\r\n\r\n    if (this.state.isFFOrder) {\r\n      SetFFTestDetailVendor(parameters).subscribe(\r\n        data => {\r\n          const message = !!data && data.length > 0 ? data : \"Your order has been updated.\"\r\n          toast.success(message)\r\n          if (!!params.сallbackLink && params.сallbackLink != \"\") {\r\n            this.setState({spinnerMessage: \"Redirecting...\"})\r\n            setTimeout(() => {\r\n              this.setState({ isSaving: false, showFinish: false })\r\n              window.location.replace(params.сallbackLink || \"\")\r\n            }, 3000);\r\n          }\r\n          else {\r\n            this.setState({ isSaving: false, showFinish: true })\r\n          }\r\n        },\r\n        error => this.handleAPIError(error, { isSaving: false })\r\n      )\r\n    }\r\n    else {\r\n      SetTestDetailVendor(parameters).subscribe(\r\n        data => {\r\n          localStorage.setItem(StorageKey.SavedOrderData, JSON.stringify(data))\r\n          this.setState({ isSaving: false, showFinish: true })\r\n        },\r\n        error => this.handleAPIError(error, { isSaving: false })\r\n      )\r\n    }\r\n  }\r\n\r\n  handleAPIError = (error: Error | APIError, stateChanges: object) => {\r\n    this.setState(stateChanges)\r\n    error && toast.error((error as APIError)?.errorData?.message || error.message)\r\n  }\r\n\r\n  render() {\r\n    const { isLoading, formFoxTestAN, isSaving, showFinish } = this.state;\r\n\r\n    return <AppPageWrapper showNav={true}>\r\n      {(isLoading || isSaving) && <ProcessingModal message={this.state.spinnerMessage} />}\r\n      {!isLoading && !showFinish && <SiteSearch formFoxTestAN={formFoxTestAN} isFFOrder={this.state.isFFOrder} isSSO={true} onSiteSelect={(site, callbackAction) => this.updateOrder(site, callbackAction)} />}\r\n      {showFinish && <OrderFinish isSSO isFFOrder={this.state.isFFOrder} />}\r\n    </AppPageWrapper>\r\n  }\r\n}\r\n","import React, { ChangeEvent, Component } from \"react\"\r\nimport { Button, Col, Form, FormLabel, Modal, OverlayTrigger, Popover, Spinner } from \"react-bootstrap\"\r\nimport DatePicker from 'react-datepicker'\r\nimport 'react-datepicker/dist/react-datepicker.css'\r\nimport { FaChevronRight, FaInfoCircle } from \"react-icons/fa\"\r\nimport { toast } from \"react-toastify\"\r\nimport { Subscription } from \"rxjs\"\r\nimport CollectionSite from \"../../api/Location/LocationModel/CollectionSite\"\r\nimport { stateAbbreviationsToCommonWealthState, StateToTimeZone } from \"../../api/Location/LocationModel/CommonWealthStateTextMapping\"\r\nimport { APIError } from \"../../api/ObservableFromFetch\"\r\nimport OrderCancel from \"../../api/OrderRequests/OrderCancel\"\r\nimport OrderResultRecord from \"../../api/OrderResults/OrderResultModel/OrderResultRecord\"\r\nimport CollectionSiteInfoGet from \"../../api/Vendor/CollectionSiteInfoGet\"\r\nimport FormatError from \"../../formatters/FormatError\"\r\nimport FormatPhone from \"../../formatters/FormatPhone\"\r\nimport ActionButton from \"../ActionButton\"\r\nimport ConfirmationModal from \"../ConfirmationModal\"\r\nimport CalculateDateStrings from \"../OrderRequests/CalculateDateStrings\"\r\nimport SiteSearch from \"../SiteSearch/SiteSearch\"\r\nimport { SetTestDetailVendorParameters } from \"../../api/OrderRequests/SSOOrderRequest\"\r\nimport OrderUpdate from \"../../api/OrderRequests/OrderUpdate\"\r\nimport { CurrentServiceDetails } from \"../../api/OrderResults/CurrentServiceDetails\"\r\nimport ServiceDetails from \"../../api/OrderResults/OrderResultModel/ServiceDetails\"\r\nimport { TimeZoneMapping } from \"../sso/SiteSearchPage\"\r\nimport Checkbox from \"../Checkbox\"\r\nimport ExpirationDate from \"../ExpirationDate\"\r\n\r\ninterface OrderEditModalProps {\r\n  details?: OrderResultRecord\r\n  onHide: () => void\r\n  onOrderUpdated: () => void\r\n}\r\n\r\ninterface OrderEditModalState {\r\n  loading: boolean\r\n  data?: ServiceDetails\r\n  clinicLoading: boolean\r\n  cancelling: boolean\r\n  saving: boolean\r\n  clinic?: CollectionSite\r\n  newClinic?: CollectionSite\r\n  expirationDate: Date | undefined\r\n  timezone: string | undefined\r\n  showSiteSearch: boolean\r\n  showConfirmCancelOrderModal: boolean\r\n  showConfirmSaveModal: boolean\r\n  proceedImmediately: boolean\r\n  selectedExpirationDate: Date | undefined\r\n  extendExpirationHours: number\r\n}\r\n\r\nexport default class OrderEditModal extends Component<OrderEditModalProps, OrderEditModalState> {\r\n  state: OrderEditModalState = {\r\n    loading: false,\r\n    clinicLoading: false,\r\n    cancelling: false,\r\n    saving: false,\r\n    showSiteSearch: false,\r\n    showConfirmCancelOrderModal: false,\r\n    showConfirmSaveModal: false,\r\n    expirationDate: undefined,\r\n    timezone: undefined,\r\n    proceedImmediately: false,\r\n    selectedExpirationDate: undefined,\r\n    extendExpirationHours: 0\r\n  }\r\n\r\n  expirationDate = React.createRef<DatePicker>()\r\n  subscription?: Subscription\r\n  loadClinicSubscription?: Subscription\r\n  cancelSubscription?: Subscription\r\n  saveSubscription?: Subscription\r\n\r\n  componentDidMount() {\r\n    const { details } = this.props\r\n    const { FormFoxVendorAN, CollectionVendorID, TestDetailClinicalID, TestDetailID } = details || { FormFoxVendorAN: undefined, CollectionVendorID: undefined, TestDetailID: undefined, TestDetailClinicalID: undefined }\r\n    if (FormFoxVendorAN || CollectionVendorID) {\r\n      this.setState({ clinicLoading: true })\r\n      this.loadClinicSubscription = CollectionSiteInfoGet(FormFoxVendorAN, CollectionVendorID).subscribe(\r\n        data => {\r\n          const clinic = data?.Name ? data : undefined\r\n          const timezone = this.calculateTimezone(clinic)\r\n          this.setState({\r\n            clinicLoading: false,\r\n            clinic: clinic,\r\n            showSiteSearch: false,\r\n            timezone: data?.TimeZone || timezone\r\n          })\r\n        },\r\n        error => this.handleAPIError(error, { clinicLoading: false })\r\n      )\r\n    }\r\n\r\n    if (TestDetailID || TestDetailClinicalID) {\r\n      this.setState({ loading: true })\r\n      this.subscription = CurrentServiceDetails({ TestDetailClinicalID: TestDetailClinicalID, TestDetailID: TestDetailID || \"\" }).subscribe(\r\n        (data: ServiceDetails) => {\r\n          const selectedExpirationDate = data.EventData.ExpirationDate ? new Date(data.EventData.ExpirationDate) : undefined\r\n          selectedExpirationDate?.setHours(selectedExpirationDate.getHours() - data.EventData.ExtendExpirationHours)\r\n          \r\n          this.setState({\r\n            data: data,\r\n            loading: false,\r\n            expirationDate: data.EventData.ExpirationDate ? new Date(data.EventData.ExpirationDate) : undefined,\r\n            proceedImmediately: data.EventData.ProceedImmediately,\r\n            selectedExpirationDate,\r\n            extendExpirationHours: data.EventData.ExtendExpirationHours\r\n        })},\r\n        (error) => this.handleAPIError(error, { loading: false })\r\n      )\r\n    }\r\n  }\r\n\r\n  componentWillUnmount() {\r\n    this.subscription && this.subscription.unsubscribe()\r\n    this.loadClinicSubscription && this.loadClinicSubscription.unsubscribe()\r\n    this.cancelSubscription && this.cancelSubscription.unsubscribe()\r\n    this.saveSubscription && this.saveSubscription.unsubscribe()\r\n  }\r\n\r\n  handleAPIError = (error: Error | APIError, stateChanges: object) => {\r\n    this.setState(stateChanges)\r\n    error && toast.error(FormatError(error))\r\n  }\r\n\r\n  onClinicChange = (site: CollectionSite) => {\r\n    const timezone = this.calculateTimezone(site)\r\n    this.setState({\r\n      newClinic: site,\r\n      showSiteSearch: false,\r\n      timezone: site.TimeZone || timezone\r\n    })\r\n  }\r\n\r\n  addHoursToCurrentDate = (hours: number) => {\r\n    const newDate = new Date()\r\n    newDate.setHours(newDate.getHours() + hours)\r\n    return newDate\r\n  }\r\n\r\n  calculateTimezone = (clinic?: CollectionSite) => {\r\n    const stateAbbr = clinic?.State\r\n    if (stateAbbr) {\r\n      const state = stateAbbreviationsToCommonWealthState[stateAbbr]\r\n      return StateToTimeZone[state]\r\n    }\r\n    return undefined\r\n  }\r\n\r\n  performCancelOrder = () => {\r\n    this.setState({ cancelling: true, showConfirmCancelOrderModal: false })\r\n    this.cancelSubscription && this.cancelSubscription.unsubscribe()\r\n    this.cancelSubscription = OrderCancel(this.props.details?.TestDetailID, this.props.details?.TestDetailClinicalID, this.props.details?.FormFoxTestAN).subscribe(\r\n      data => {\r\n        toast.success(data)\r\n        this.props.onOrderUpdated()\r\n      },\r\n      error => this.handleAPIError(error, { cancelling: false })\r\n    )\r\n  }\r\n\r\n  performSave = () => {\r\n    this.setState({ saving: true, showConfirmSaveModal: false })\r\n    this.saveSubscription && this.saveSubscription.unsubscribe()\r\n\r\n    const { clinic, newClinic, expirationDate, timezone, proceedImmediately } = this.state\r\n    const { details, onOrderUpdated } = this.props\r\n\r\n    const site = newClinic || clinic\r\n    const formFoxTestAN: number = parseInt(details?.FormFoxTestAN || \"0\");\r\n    const formattedExpirationDate = expirationDate ? CalculateDateStrings(expirationDate, timezone).formattedDate : undefined\r\n\r\n    const timeZoneName = TimeZoneMapping[timezone || \"\"]\r\n    const parameters: SetTestDetailVendorParameters = {\r\n      formFoxTestAN: formFoxTestAN,\r\n      collectionVendorID: site?.VendorID || 0,\r\n      formFoxVendorAN: site?.FormFoxVendorAN || 0,\r\n      FFVendorCode: site?.Code || \"\",\r\n      collectorVendorName: site?.Name || \"\",\r\n      servicePriceTiers: [],\r\n      expirationDate: formattedExpirationDate,\r\n      sendLink: false,\r\n      sendCallback: false,\r\n      timeZone: timeZoneName || \"\",\r\n      isFFOrder: false,\r\n      ReferenceTestID: 0,\r\n      ProceedImmediately: proceedImmediately,\r\n      ExtendExpirationHours: this.state.extendExpirationHours,\r\n      IsMarketPlace: site?.IsMarketPlace || false,\r\n      ClinicWasUpdated: !!newClinic,\r\n    }\r\n    this.saveSubscription = OrderUpdate(parameters).subscribe(\r\n      data => {\r\n        toast.success(data)\r\n        onOrderUpdated()\r\n      },\r\n      error => this.handleAPIError(error, { saving: false })\r\n    )\r\n  }\r\n\r\n  proceedImmediatelyChange = (e: ChangeEvent<HTMLInputElement>) => {\r\n    const enabled = !!e.target.checked\r\n    this.setState({ proceedImmediately: enabled })\r\n  }\r\n\r\n  calculateExpirationDate = (date: Date | undefined, extendHours: number, toggle: boolean) => {\r\n    if (!date) {\r\n      return\r\n    }\r\n\r\n    const newExpirationDate = new Date(date)\r\n    newExpirationDate.setHours(newExpirationDate.getHours() + (toggle ? extendHours : -extendHours))\r\n    \r\n    return newExpirationDate\r\n  }\r\n\r\n  handleChangeExtendExpirationHours = (e: ChangeEvent<HTMLInputElement>) => {\r\n    const hours = Number(e.target.value)\r\n    const checked = e.target.checked\r\n\r\n    this.setState((prev) => {\r\n      const currentExpirationDate = prev.expirationDate ? new Date(prev.expirationDate) : new Date()\r\n      return {\r\n        ...prev,\r\n        expirationDate: this.calculateExpirationDate(currentExpirationDate, hours, checked),\r\n        extendExpirationHours: checked ? hours : 0,\r\n      }\r\n    })\r\n  }\r\n\r\n  handleChangeExpirationDate = (date: Date) => {\r\n    const extendExpirationHours = date ? this.state.extendExpirationHours : 0\r\n\r\n    this.setState((prev) => ({ \r\n      ...prev,\r\n      selectedExpirationDate: date || undefined,\r\n      extendExpirationHours: extendExpirationHours,\r\n      expirationDate: this.calculateExpirationDate(date, extendExpirationHours, extendExpirationHours > 0),\r\n    }))\r\n  }\r\n\r\n  render() {\r\n    const {\r\n      clinicLoading,\r\n      cancelling,\r\n      saving,\r\n      clinic,\r\n      newClinic,\r\n      expirationDate,\r\n      timezone,\r\n      showSiteSearch,\r\n      showConfirmCancelOrderModal,\r\n      showConfirmSaveModal,\r\n      loading,\r\n      data,\r\n      proceedImmediately,\r\n      extendExpirationHours\r\n    } = this.state\r\n    const { details, onHide } = this.props\r\n\r\n    const clinicToDisplay = newClinic || clinic\r\n    const formFoxTestAN: number = parseInt(details?.FormFoxTestAN || \"0\");\r\n\r\n    return <>\r\n      {showSiteSearch && <Modal show={true} onHide={() => this.setState({ showSiteSearch: false })} size=\"xl\" dialogClassName=\"dark modal-90w\">\r\n        <Modal.Header closeButton>\r\n          <Modal.Title>SITE SEARCH</Modal.Title>\r\n        </Modal.Header>\r\n        <Modal.Body>\r\n          <SiteSearch formFoxTestAN={formFoxTestAN} isSSO={false} forceShowFilter defaultAddress=\"\" onSiteSelect={this.onClinicChange} />\r\n        </Modal.Body>\r\n      </Modal>}\r\n      <Modal show onHide={onHide} size=\"lg\" dialogClassName=\"dark\">\r\n        <Modal.Header closeButton>\r\n          <Modal.Title>\r\n            <h4 className=\"text-uppercase\"><span>AUTHORIZATION #{details?.FormFoxTestAN}</span></h4>\r\n          </Modal.Title>\r\n        </Modal.Header>\r\n        <Modal.Body className=\"p-3\">\r\n          <Form className=\"py-2\">\r\n            {clinicLoading && <Form.Row>\r\n              <Col>\r\n                <Spinner animation=\"border\" variant=\"secondary\" />\r\n              </Col>\r\n            </Form.Row>}\r\n            {!clinicLoading && <>\r\n              <Form.Row>\r\n                <Form.Label column className=\"font-weight-bold\">Clinic</Form.Label>\r\n              </Form.Row>\r\n              {clinicToDisplay && <>\r\n                <Form.Row>\r\n                  <Col>\r\n                    <Form.Label className=\"font-weight-bold\">{clinicToDisplay?.Name}</Form.Label>\r\n                  </Col>\r\n                </Form.Row>\r\n                <Form.Row>\r\n                  <Col>\r\n                    <Form.Label>{clinicToDisplay?.Address1} {clinicToDisplay?.Address2} {clinicToDisplay?.Zip}</Form.Label>\r\n                  </Col>\r\n                </Form.Row>\r\n                {(!!clinicToDisplay?.Phone || !!clinicToDisplay?.Fax) && <Form.Row>\r\n                  <Col>\r\n                    {clinicToDisplay?.Phone && <Form.Label className=\"pr-3\">Phone: {FormatPhone(clinicToDisplay?.Phone)}</Form.Label>}\r\n                    {clinicToDisplay?.Fax && <Form.Label>Fax: {FormatPhone(clinicToDisplay?.Fax)}</Form.Label>}\r\n                  </Col>\r\n                </Form.Row>\r\n                }\r\n              </>}\r\n              <Form.Row className=\"pt-2\">\r\n                <Col>\r\n                  <Button variant=\"secondary\" className=\"fixed-w10 btn-icon\" disabled={cancelling || saving} onClick={() => this.setState({ showSiteSearch: true })}>\r\n                    {(clinic || newClinic) ? \"CHANGE CLINIC\" : \"FIND CLINIC\"}\r\n                    <FaChevronRight />\r\n                  </Button>\r\n                </Col>\r\n              </Form.Row>\r\n              <Form.Row className=\"pt-4\">\r\n                <Form.Label column className=\"font-weight-bold\">SCHEDULE</Form.Label>\r\n              </Form.Row>\r\n              <Form.Row>\r\n                <Form.Label column className=\"font-weight-bold col-4\">Clinic Time Zone</Form.Label>\r\n                <Form.Label column>{timezone}</Form.Label>\r\n              </Form.Row>\r\n              {/* <Form.Row>\r\n                <Form.Label column className=\"font-weight-bold col-4\">Hide Expiration Date</Form.Label>\r\n                <Col xs={4} className=\"align-self-start d-flex justify-content-start\">\r\n                  {<Checkbox id=\"proceedImmediately\" checked={!!proceedImmediately} onChange={this.proceedImmediatelyChange} title={\"hide expiration date\"} />}\r\n                </Col>\r\n              </Form.Row> */}\r\n              <Form.Row>\r\n                <Form.Label column sm={5} className=\"font-weight-bold col-4\">\r\n                  Expiration Date\r\n                </Form.Label>\r\n                <Col>\r\n                  {proceedImmediately ? \r\n                    <>Proceed Immediately to the Collection Site</>\r\n                    :\r\n                    <>\r\n                      <ExpirationDate\r\n                        expirationDate={this.state.selectedExpirationDate}\r\n                        timezone={timezone}\r\n                        disabled={cancelling || saving}\r\n                        onChange={this.handleChangeExpirationDate}\r\n                      />\r\n                      {!!extendExpirationHours && expirationDate && (\r\n                        <OverlayTrigger placement=\"top-start\" delay={{ show: 100, hide: 400 }} overlay={\r\n                          <Popover id=\"extend_expiration_hours\">\r\n                            <Popover.Title as={\"h3\"}>Extended Expiration Date</Popover.Title>\r\n                            <Popover.Content>\r\n                              {expirationDate.toLocaleString('en-US', { \r\n                                  year: 'numeric',\r\n                                  month: '2-digit',\r\n                                  day: '2-digit',\r\n                                  hour: 'numeric',\r\n                                  minute: 'numeric'\r\n                                })}\r\n                            </Popover.Content>\r\n                          </Popover>}>\r\n                          <FaInfoCircle className=\"info-icon\" />\r\n                        </OverlayTrigger>\r\n                      )}\r\n                    </>\r\n                  }\r\n                </Col>\r\n              </Form.Row>\r\n              {!proceedImmediately && (\r\n                <Form.Row>\r\n                  <FormLabel column sm={5} className=\"font-weight-bold\" htmlFor=\"extend_expiration_hours\">\r\n                    Extend Expiration by 24 Hours\r\n                  </FormLabel>\r\n                  <Col className=\"d-flex align-items-center\">\r\n                    <Checkbox \r\n                      id=\"extend_expiration_hours\"\r\n                      label=\"\"\r\n                      value='24'\r\n                      disabled={!expirationDate}\r\n                      className=\"abc-checkbox\"\r\n                      checked={expirationDate && extendExpirationHours > 0}\r\n                      onChange={this.handleChangeExtendExpirationHours}\r\n                    />\r\n                  </Col>\r\n                </Form.Row>)}\r\n            </>}\r\n          </Form>\r\n        </Modal.Body>\r\n        <Modal.Footer>\r\n          {!!data && <ActionButton variant=\"secondary\" size=\"sm\" disabled={clinicLoading || saving || loading} disableOnSpin={true} spin={cancelling} className=\"mr-auto\" onClick={() => this.setState({ showConfirmCancelOrderModal: true })}>Cancel Order</ActionButton>}\r\n          <ActionButton variant=\"primary\" size=\"sm\" disabled={clinicLoading || cancelling || !(newClinic || expirationDate || proceedImmediately)} disableOnSpin={true} spin={saving} onClick={() => this.setState({ showConfirmSaveModal: true })}>Save Changes</ActionButton>\r\n          <Button variant=\"secondary\" size=\"sm\" onClick={onHide}>Close</Button>\r\n        </Modal.Footer>\r\n      </Modal>\r\n      <ConfirmationModal show={showConfirmCancelOrderModal}\r\n        title=\"CANCEL CONFIRMATION\"\r\n        textTitle={!!data?.IsRandom ? \"Orders placed in the Selection Inbox may not be cancelled.\" : \"Are you sure you want to cancel the Order?\"}\r\n        text=\"\"\r\n        disableConfirmButton={!!data?.IsRandom}\r\n        onConfirm={this.performCancelOrder}\r\n        onHide={() => this.setState({ showConfirmCancelOrderModal: false })} />\r\n      <ConfirmationModal show={showConfirmSaveModal}\r\n        title=\"ORDER UPDATE CONFIRMATION\"\r\n        textTitle=\"Are you sure you want to Save changes?\"\r\n        text=\"\"\r\n        onConfirm={this.performSave}\r\n        onHide={() => this.setState({ showConfirmSaveModal: false })} />\r\n    </>\r\n  }\r\n}\r\n","import CollectionSite from \"../Location/LocationModel/CollectionSite\"\r\nimport { ObservableFromFetch } from \"../ObservableFromFetch\"\r\n\r\nexport default function CollectionSiteInfoGet(formFoxVendorAN?: number, collectionVendorID?: number) {\r\n  let params = {}\r\n  if (formFoxVendorAN) {\r\n    params = {...params, formFoxVendorAN: formFoxVendorAN.toString()}\r\n  }\r\n  if (collectionVendorID) {\r\n    params = {...params, collectionVendorID: collectionVendorID.toString()}\r\n  }\r\n  const requestBody: string = new URLSearchParams(params).toString()\r\n  return ObservableFromFetch<CollectionSite>(\"WorkforceOrder/GetCollectionSiteInfo?\" + requestBody)\r\n}\r\n","import { Observable } from \"rxjs\"\r\nimport { ObservableFromFetch } from \"../ObservableFromFetch\"\r\nimport SendSelectClinicLinkParams from \"./OrderResultModel/SendSelectClinicLinkParams\"\r\n\r\nexport default function SendSelectClinicLinkObservable(params: SendSelectClinicLinkParams): Observable<string> {\r\n  const requestBody: string = JSON.stringify(params)\r\n\r\n  return ObservableFromFetch<string>(\"workforceorder/SendSelectClinicLink\", requestBody)\r\n}","import React, { Component } from \"react\"\r\nimport { Button, Col, Container, Form, Modal, Row } from \"react-bootstrap\"\r\nimport OrderResultRecord from \"../../api/OrderResults/OrderResultModel/OrderResultRecord\"\r\nimport { toast } from \"react-toastify\"\r\nimport printPdf from \"../../utils/printPdf\"\r\nimport FormatError from \"../../formatters/FormatError\"\r\nimport { EmailRegexp, PhoneRegexp } from \"../../config/Constants\"\r\nimport PhoneNumberMaskedInput from \"../FormattedInputs/PhoneNumberMaskedInput\"\r\nimport ActionButton from \"../ActionButton\"\r\nimport { FaMinus, FaPlus } from \"react-icons/fa\"\r\nimport { Subscription } from \"rxjs\"\r\nimport { AppState } from \"../../AppState\"\r\nimport { connect } from \"react-redux\"\r\nimport { BuildUserAccess } from \"../../authentication/BuildUserAccess\"\r\nimport { GetSSOToken } from \"../../storage/AuthToken\"\r\nimport { FullBaseUrl } from \"../../api/ApiUrl\"\r\nimport SendSelectClinicLinkParams from \"../../api/OrderResults/OrderResultModel/SendSelectClinicLinkParams\"\r\nimport SendSelectClinicLinkObservable from \"../../api/OrderResults/SendClinicSelectLink\"\r\n\r\n\r\ninterface SendSelectClinicLinkProps {\r\n  details?: OrderResultRecord\r\n  onHide: () => void\r\n  onEdit?: (data: OrderResultRecord) => void\r\n  isAfterUpdate?: boolean\r\n}\r\n\r\n\r\ninterface SendSelectClinicLinkState {\r\n  emailItems: string[]\r\n  email: string\r\n  sendingEmail: boolean\r\n}\r\n\r\nexport default class SendSelectClinicLink extends Component<SendSelectClinicLinkProps, SendSelectClinicLinkState> {\r\n  state: SendSelectClinicLinkState = {\r\n    emailItems: [\"\"],\r\n    email: \"\",\r\n    sendingEmail: false\r\n  }\r\n\r\n  loadSubscription?: Subscription\r\n\r\n  componentWillUnmount() {\r\n    this.loadSubscription && this.loadSubscription.unsubscribe()\r\n  }\r\n\r\n \r\n\r\n\r\n  changeEmail = (email: string) => {\r\n    this.setState({ email: email || \"\" })\r\n  }\r\n\r\n  sendEmail = () => {\r\n    const email = this.state.email || \"\"\r\n    if (!this.isEmailValid(email)) {\r\n      toast.error(\"Please enter valid email address.\")\r\n      return\r\n    }\r\n\r\n    let formFoxTestAN = parseInt(this.props.details?.FormFoxTestAN || \"0\")\r\n    if (isNaN(formFoxTestAN)) {\r\n      formFoxTestAN = 0\r\n    }\r\n    \r\n    let accountID = 0\r\n    if(this.props.details?.CompanyID){\r\n      accountID = parseInt(this.props.details?.CompanyID.toString())\r\n    }\r\n    if (isNaN(accountID)) {\r\n      accountID = 0\r\n    }\r\n\r\n    let testDetailID = 0\r\n    if(this.props.details?.TestDetailID){\r\n      testDetailID = parseInt(this.props.details?.TestDetailID.toString())\r\n    }\r\n    if (isNaN(testDetailID)) {\r\n      testDetailID = 0\r\n    }\r\n    let testDetailClinicalID = 0\r\n    if(this.props.details?.TestDetailClinicalID){\r\n      testDetailClinicalID = parseInt(this.props.details?.TestDetailClinicalID.toString())\r\n    }\r\n    if (isNaN(testDetailClinicalID)) {\r\n      testDetailClinicalID = 0\r\n    }\r\n    const params: SendSelectClinicLinkParams = {\r\n      FormFoxTestAN: formFoxTestAN,\r\n      ApiRequestToken: \"\",\r\n      BaseUrl: FullBaseUrl(),\r\n      AccountID: accountID,\r\n      Email: email,\r\n      MarketplaceAuthNum: this.props.details?.MarketPlaceOrderNum || \"\",\r\n      PersonID: this.props.details?.PersonID || 0,\r\n      TestReason: this.props.details?.Reason || \"\",\r\n      TestDetailID: this.props.details?.TestDetailID || \"\",\r\n      TestDetailClinicalID: this.props.details?.TestDetailClinicalID || \"\"\r\n    }\r\n    this.loadSubscription && this.loadSubscription.unsubscribe()\r\n    this.setState({ sendingEmail: true })\r\n    this.loadSubscription = SendSelectClinicLinkObservable(params).subscribe(\r\n      data => {\r\n        toast.success(\"Email sent successfully\")\r\n        this.setState({ sendingEmail: false })\r\n        this.props.onHide()\r\n      },\r\n      error => {\r\n        toast.error(FormatError(error))\r\n        this.setState({ sendingEmail: false })\r\n      }\r\n    )\r\n\r\n  }\r\n\r\n  isEmailValid = (value: string): boolean => {\r\n    if (value.length === 0) {\r\n      return false\r\n    }\r\n    return EmailRegexp.test(value)\r\n  }\r\n\r\n\r\n\r\n  render() {\r\n    const { sendingEmail, email } = this.state\r\n    const { details, onHide } = this.props\r\n    return (\r\n      <Modal show onHide={onHide} size=\"lg\" dialogClassName=\"dark\">\r\n        <Modal.Header closeButton>\r\n          <Modal.Title>\r\n            {<h4 className=\"text-uppercase\"><span>Resend Email (Authorization #{details?.FormFoxTestAN})</span></h4>}\r\n          </Modal.Title>\r\n        </Modal.Header>\r\n        <Modal.Body className=\"p-3\">\r\n          <Container fluid>\r\n            {<Row className=\"pt-2\" key={`donor_email`}>\r\n              <Col xs={14} sm={4} md={4} lg={3}>\r\n                {\"Donor Email:\"}\r\n              </Col>\r\n              <Col>\r\n                <Form.Control size=\"sm\" name=\"email_address\" maxLength={40} type=\"text\" value={email} onChange={(e) => this.changeEmail(e.target.value)} isInvalid={!this.isEmailValid(email)} />\r\n              </Col>\r\n            </Row>\r\n            }\r\n          </Container>\r\n        </Modal.Body>\r\n        <Modal.Footer>\r\n          <ActionButton size=\"sm\" className=\"fixed-w10\" onClick={this.sendEmail} disabled={!this.isEmailValid(email) || sendingEmail} spin={sendingEmail}>Send Email</ActionButton>\r\n          <Button variant=\"secondary\" size=\"sm\" onClick={onHide}>Close</Button>\r\n        </Modal.Footer>\r\n      </Modal>\r\n    )\r\n  }\r\n}\r\n\r\n","export default \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJYAAACWCAYAAAA8AXHiAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAAASAAAAEgARslrPgAAEKZJREFUeNrtnXuwVVUdxz/nQGKJ+QBJA+Ei4BPE4uS70pTCVCyfM46v0so0Hd/PGcUSH/jAyozUmnTGP9RyGsx01MRquD649Edg6aCJV9REcEThcq/A3f3x2/vew+Gce35r77X22nvf85lZg1z33Xv9fr8va6+9Hr9VYnAzDhgPtIVlHDACGBn+OQIoA0OBbcPf+QTYCPQCq6vKKuAtYHlY3gz/XmiCIKj785LviqXIHsAhwDRgSli2d/zMj4AlYVkMtAOv+naETQajsCYCM4DpwEHATr4rFPIB8ALwDPAU8LrvCiWhkbCKRAkR0J3AMiDISVkGzA3rnrt/6EEQ1C1FYG/gNqRf41skScvy0JZ9fDtVS9GEtQ1wFtJn8S0GV6U9tHEb384eiKIIa2dgNvIV5jvwaZXVoc07+3Z+PfIurHHAvUA3/gPtq3SHPhjnOxjV5FVYo4F7gB78BzYrpSf0yRjfwYH8CWs4cCPQhf9AZrV0hT4a7jNQjYSVtc/bEnAq8mW0SwrP60RGyJeH5S36R9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e2QQfRBZiT9O41X6yEp+JNm8HdUIiYT1/4BdpxoYQLWmAAAAJXRFWHRkYXRlOmNyZWF0ZQAyMDE5LTA0LTE1VDE0OjM4OjU0KzAwOjAwq6mB2gAAACV0RVh0ZGF0ZTptb2RpZnkAMjAxOS0wNC0xNVQxNDozODo1NCswMDowMNr0OWYAAAAZdEVYdFNvZnR3YXJlAEFkb2JlIEltYWdlUmVhZHlxyWU8AAAAAElFTkSuQmCC\"","import { debug } from \"console\"\r\nimport React, { Component } from \"react\"\r\nimport { Container, Row, Col, Button, Form, Modal, Spinner } from \"react-bootstrap\"\r\nimport { FaAngleDown, FaPencilAlt, FaTimes } from \"react-icons/fa\"\r\nimport { BehaviorSubject, concat, of, Subject, Subscription } from \"rxjs\"\r\nimport { addProcessingCollectionTest, hasCachedCollectionTests, isProcessingCollection, ProcessingCollectionLabel } from \"../../../api/CachedCollectionTest\"\r\nimport AutoFilterCompany from \"../../../api/Companies/CompanyModel/AutoFilterCompany\"\r\nimport AutoFilterLocationsGet from \"../../../api/Location/AutoFilterLocationsGet\"\r\nimport AutoFilterLocation from \"../../../api/Location/LocationModel/AutoFilterLocation\"\r\nimport OrderResultRecord from \"../../../api/OrderResults/OrderResultModel/OrderResultRecord\"\r\nimport ServiceDetails from \"../../../api/OrderResults/OrderResultModel/ServiceDetails\"\r\nimport AutoFilterRegion from \"../../../api/Regions/Model/AutoFilterRegion\"\r\nimport PersonnelRegulatoryModes from \"../../Accounts/RegulatoryMode/PersonnelRegulatoryModes\"\r\nimport CompanyInput from \"../../FormattedInputs/CompanyInput\"\r\nimport CardRow from \"./Cards/CardRow\"\r\nimport Category from \"../../../api/LabService/LabServiceModel/EmployeeCategory\"\r\nimport { Typeahead } from \"react-bootstrap-typeahead\"\r\nimport { PoolRegulatoryMode } from \"../../../api/Randoms/RandomsModel/PoolCompanyInfo\"\r\nimport EmployeeCategoriesGetObservable from \"../../../api/LabService/EmployeeCategoriesGet\"\r\nimport EmployeeCategory from \"../../../api/LabService/LabServiceModel/EmployeeCategory\"\r\nimport TestEventUpdateData from \"../../../api/OrderResults/OrderResultModel/TestEventUpdateData\"\r\nimport { filter, map, switchMap } from \"rxjs/operators\"\r\nimport LabAccountsGetObservable, { FilteredLabAccountsGetObservable } from \"../../../api/LabService/LabAccountsGet\"\r\nimport LabAccount from \"../../../api/Randoms/RandomsModel/LabAccount\"\r\nimport TestToBePerform from \"../../../api/LabService/LabServiceModel/TestToBePerform\"\r\n\r\n\r\ninterface DrugTestCompareProps {\r\n  currentRowInfo: OrderResultRecord\r\n  currentServiceInfoNew: ServiceDetails\r\n  currentServiceInfoOld: ServiceDetails\r\n  isOnTrack?: boolean\r\n  hasChanges: boolean\r\n}\r\n\r\ninterface DrugTestCompareState {\r\n\r\n}\r\n\r\nexport default class DrugTestCompare extends Component<DrugTestCompareProps, DrugTestCompareState> {\r\n\r\n  dataRow(title: string, newValue: string, oldValue: string, ignoreChanges: boolean = false) {\r\n\r\n    //{date ? FormatDate(value) : time ? FormatTime(value) : bool ? (value ? \"Yes\" : \"No\") : value}\r\n    if ((newValue !== oldValue) || ignoreChanges){\r\n      return (\r\n        <Row className=\"p-1\">\r\n          <Col xs={6} md={3} className=\"test-property\">{title}</Col>\r\n          <Col xs={6} md={3} className=\"status-text\">{newValue}</Col>\r\n          <Col xs={3} md={1} className=\"status-text\"></Col>\r\n          <Col xs={6} md={3} className=\"status-text\">{oldValue}</Col>\r\n        </Row>\r\n      )\r\n    }\r\n    return \"\"\r\n\r\n  }\r\n\r\n  render = () => {\r\n    const { currentRowInfo, currentServiceInfoNew, currentServiceInfoOld, isOnTrack } = this.props\r\n    const panelInfoNew = currentServiceInfoNew.Panel\r\n    const panelInfoOld = currentServiceInfoOld.Panel\r\n    const EventDataNew = currentServiceInfoNew.EventData\r\n    const EventDataOld = currentServiceInfoOld.EventData\r\n    const isDrug = currentServiceInfoNew.TestTypeDescription === \"Drug\"\r\n\r\n    const primaryIdNew = (currentRowInfo.DonorID || \"\") + \" \" + EventDataNew?.PrimaryIDType\r\n    const primaryIdOld = \"\"\r\n\r\n    const personelIdNew = primaryIdNew\r\n    const personelIdOld = primaryIdOld\r\n    const testTypeOrSampleIDChanged = ((currentServiceInfoNew.TestTypeDescription !== currentServiceInfoOld.TestTypeDescription) || (currentServiceInfoNew.SampleID !== currentServiceInfoOld.SampleID))\r\n    return (\r\n      <Container>\r\n        <Row>\r\n          <Col md={8} className=\"pt-0\">\r\n            <h5>\r\n              {!isOnTrack && <span className=\"text-uppercase\">{currentServiceInfoNew.TestTypeDescription}</span>}TEST DETAIL COMP <span className=\"text-uppercase\">{currentServiceInfoNew.CCFName}</span> {currentRowInfo ? currentRowInfo[\"DonorID\"] : \"\"}\r\n            </h5>\r\n          </Col>\r\n        </Row>\r\n        <Row className=\"drug-test-info\">\r\n          <Col>\r\n            {this.dataRow(\"PRIMARY ID\", primaryIdNew, primaryIdOld)}\r\n            {this.dataRow(\"PERSONNEL ID\", personelIdNew, personelIdOld)}\r\n            {this.dataRow(\" \", \" \", \" \")}\r\n            {this.props.hasChanges &&\r\n              <Row className=\"status-alert\">\r\n                <Col xs={6} md={3}>Changes</Col>\r\n                <Col xs={6} md={3}>New Value</Col>\r\n                <Col xs={3} md={1}></Col>\r\n                <Col xs={6} md={3}>Old Value</Col>\r\n              </Row>\r\n            }\r\n            {this.dataRow(\"NAME\", currentServiceInfoNew.CCFName, currentServiceInfoOld.CCFName)}\r\n            {!isOnTrack && this.dataRow(\"REGULATORY MODE\", EventDataNew?.RegulatoryModeName, EventDataOld?.RegulatoryModeName)}\r\n            {!isOnTrack && this.dataRow(\"EMPLOYEE CATEGORY\", EventDataNew?.EmployeeCategoryName, EventDataOld?.EmployeeCategoryName)}\r\n            {this.dataRow(\"COMPANY NAME\", EventDataNew?.CompanyName, EventDataOld?.CompanyName)}\r\n            {!isOnTrack && this.dataRow(\"LOCATION\", EventDataNew?.LocationName, EventDataOld?.LocationName)}\r\n            {!isOnTrack && this.dataRow(\"LAB ACCOUNT\", currentServiceInfoNew.LabAccountNumber, currentServiceInfoOld.LabAccountNumber)}\r\n            {this.dataRow(\"REASON FOR TEST\", currentServiceInfoNew.TestReasonDescription, currentServiceInfoOld.TestReasonDescription)}\r\n            {isOnTrack && this.dataRow(\"Specimen / Reference ID\", currentServiceInfoNew.SampleID, currentServiceInfoOld.SampleID)}\r\n            {!isOnTrack && testTypeOrSampleIDChanged && this.dataRow(\"TEST TYPE\", currentServiceInfoNew.TestTypeDescription, currentServiceInfoOld.TestTypeDescription, true)}\r\n            {!isOnTrack && testTypeOrSampleIDChanged && this.dataRow(\"Specimen / Reference ID\", currentServiceInfoNew.SampleID, currentServiceInfoOld.SampleID, true)}\r\n            {!isOnTrack && this.dataRow(\"SAMPLE TYPE\", currentServiceInfoNew.SampleTypeDescription, currentServiceInfoOld.SampleTypeDescription)}\r\n            {!isOnTrack && this.dataRow(\"PANEL\", panelInfoNew?.Description, panelInfoOld?.Description)}\r\n            {!isOnTrack && this.dataRow(\"REGULATED\", currentServiceInfoNew.DOT ? \"Yes\" : \"No\", currentServiceInfoOld.DOT ? \"Yes\" : \"No\")}\r\n            {this.dataRow(\"EVENT STATUS\", currentServiceInfoNew.TestReleaseStatusDescription, currentServiceInfoOld.TestReleaseStatusDescription)}\r\n          </Col>\r\n        </Row>\r\n      </Container>\r\n    )\r\n  }\r\n}\r\n","import React, { Component } from \"react\"\r\nimport { Button, Modal } from \"react-bootstrap\"\r\nimport TestSteps from \"./EventDetails/TestSteps\"\r\nimport OrderResultRecord from \"../../api/OrderResults/OrderResultModel/OrderResultRecord\"\r\nimport { Subscription } from \"rxjs\"\r\nimport { toast } from \"react-toastify\"\r\nimport { CurrentServiceDetailsForCompare, ResolveAlert } from \"../../api/OrderResults/CurrentServiceDetails\"\r\nimport ServiceDetails from \"../../api/OrderResults/OrderResultModel/ServiceDetails\"\r\nimport { ImplementationTypeGovt, StorageKey } from \"../../config/Constants\"\r\nimport TestEventUpdateData from \"../../api/OrderResults/OrderResultModel/TestEventUpdateData\"\r\nimport DrugTestCompare from \"./EventDetails/DrugTestCompare\"\r\n\r\ninterface EventDetailsCompareProps {\r\n  details: OrderResultRecord\r\n  onHide: () => void\r\n  onRefreshGrid?: () => void\r\n}\r\n\r\ninterface EventDetailsCompareState {\r\n  dataNew?: ServiceDetails\r\n  dataOld?: ServiceDetails\r\n  loadingNew: boolean\r\n  loadingOld: boolean\r\n}\r\n\r\nexport default class EventDetailsCompare extends Component<EventDetailsCompareProps, EventDetailsCompareState> {\r\n  subscriptionNew?: Subscription\r\n  subscriptionOld?: Subscription\r\n  updateSubscription?: Subscription\r\n  state: EventDetailsCompareState = { dataNew: undefined, dataOld: undefined, loadingNew: false, loadingOld: false}\r\n  isOnTrack: boolean = sessionStorage.getItem(StorageKey.ImplementationType) === ImplementationTypeGovt\r\n\r\n  componentDidMount() {\r\n    this.setState({ loadingNew: true, loadingOld: true, dataNew: undefined, dataOld: undefined })\r\n    const details = this.props.details\r\n    this.subscriptionNew = CurrentServiceDetailsForCompare({ TestDetailClinicalID: undefined, TestDetailID: details.TestDetailID }).subscribe(\r\n      (data: ServiceDetails) => {\r\n        this.setState({ dataNew: data, loadingNew: false })\r\n        this.subscriptionOld = CurrentServiceDetailsForCompare({ TestDetailClinicalID: undefined, TestDetailID: details.MergeFrom }).subscribe(\r\n          (data: ServiceDetails) => this.setState({ dataOld: data, loadingOld: false }),\r\n          (error: string) => {\r\n            this.setState({ loadingOld: false })\r\n            toast.error(error)\r\n          }\r\n        )\r\n      },\r\n      (error: string) => {\r\n        this.setState({ loadingNew: false })\r\n        toast.error(error)\r\n      }\r\n    )\r\n  }\r\n\r\n  handleSave = () => {\r\n    this.updateSubscription = ResolveAlert({TestEventAlertID: this.props.details.TestEventAlertID}).subscribe(\r\n      (data: string) => {\r\n        toast.success(data)\r\n        this.props.onHide();\r\n        this.props.onRefreshGrid && this.props.onRefreshGrid();\r\n      }),\r\n      (error: string) => {\r\n        toast.error(error)\r\n        this.props.onHide();\r\n      }\r\n  }\r\n  handleCancel = () => {\r\n    this.props.onHide();\r\n    this.props.onRefreshGrid && this.props.onRefreshGrid();\r\n  }\r\n  componentWillUnmount() {\r\n    this.subscriptionNew && this.subscriptionNew.unsubscribe()\r\n    this.subscriptionOld && this.subscriptionOld.unsubscribe()\r\n    this.updateSubscription && this.updateSubscription.unsubscribe()\r\n  }\r\n  hasChanges() {\r\n    const currentRowInfo = this.props.details\r\n    const currentServiceInfoNew = this.state.dataNew\r\n    if (!currentServiceInfoNew) {\r\n      return false\r\n    }\r\n    const currentServiceInfoOld = this.state.dataOld\r\n    if (!currentServiceInfoOld) {\r\n      return false\r\n    }\r\n    const panelInfoNew = currentServiceInfoNew.Panel\r\n    const panelInfoOld = currentServiceInfoOld.Panel\r\n    const EventDataNew = currentServiceInfoNew.EventData\r\n    const EventDataOld = currentServiceInfoOld.EventData\r\n\r\n    if (currentServiceInfoNew.CCFName !== currentServiceInfoOld.CCFName) {\r\n      return true\r\n    }\r\n    if (EventDataNew?.RegulatoryModeName !== EventDataOld?.RegulatoryModeName) {\r\n      return true\r\n    }\r\n    if (EventDataNew?.EmployeeCategoryName !== EventDataOld?.EmployeeCategoryName) {\r\n      return true\r\n    }\r\n    if (EventDataNew?.CompanyName !== EventDataOld?.CompanyName) {\r\n      return true\r\n    }\r\n    if (EventDataNew?.LocationName !== EventDataOld?.LocationName) {\r\n      return true\r\n    }\r\n    if (currentServiceInfoNew.LabAccountNumber !== currentServiceInfoOld.LabAccountNumber) {\r\n      return true\r\n    }\r\n    if (currentServiceInfoNew.TestReasonDescription !== currentServiceInfoOld.TestReasonDescription) {\r\n      return true\r\n    }\r\n    if (currentServiceInfoNew.SampleID !== currentServiceInfoOld.SampleID) {\r\n      return true\r\n    }\r\n    if ((currentServiceInfoNew.TestTypeDescription !== currentServiceInfoOld.TestTypeDescription) || (currentServiceInfoNew.SampleID !== currentServiceInfoOld.SampleID)) {\r\n      return true\r\n    }\r\n    if ((currentServiceInfoNew.TestTypeDescription !== currentServiceInfoOld.TestTypeDescription) || (currentServiceInfoNew.SampleID !== currentServiceInfoOld.SampleID)) {\r\n      return true\r\n    }\r\n    if (currentServiceInfoNew.SampleTypeDescription !== currentServiceInfoOld.SampleTypeDescription) {\r\n      return true\r\n    }\r\n    if (panelInfoNew?.Description !== panelInfoOld?.Description) {\r\n      return true\r\n    }\r\n    if (currentServiceInfoNew.DOT !== currentServiceInfoOld.DOT) {\r\n      return true\r\n    }\r\n    if (currentServiceInfoNew.TestReleaseStatusDescription !== currentServiceInfoOld.TestReleaseStatusDescription) {\r\n      return true\r\n    }\r\n    return false\r\n  }\r\n  render() {\r\n    const currentRowInfo = this.props.details\r\n    const currentServiceInfoNew = this.state.dataNew\r\n    const currentServiceInfoOld = this.state.dataOld\r\n    const hasChanges = this.hasChanges()\r\n    return currentRowInfo && currentServiceInfoNew && currentServiceInfoOld ? (\r\n      <Modal show onHide={this.props.onHide} size=\"xl\" dialogClassName=\"dark\">\r\n        <Modal.Header closeButton>\r\n          <Modal.Title>EVENT DETAILS COMPARE</Modal.Title>\r\n        </Modal.Header>\r\n        <Modal.Body className=\"event-details\">\r\n          <DrugTestCompare currentRowInfo={currentRowInfo} currentServiceInfoNew={currentServiceInfoNew} currentServiceInfoOld={currentServiceInfoOld} isOnTrack={this.isOnTrack} hasChanges={hasChanges} />\r\n        </Modal.Body>\r\n        {<Modal.Footer>\r\n          \r\n          {hasChanges && <Button variant=\"primary\" onClick={this.handleSave} className=\"fixed-w5 ml-2\">Accept</Button>}\r\n          {hasChanges && <Button variant=\"secondary\" onClick={this.handleCancel} className=\"fixed-w5 ml-2\">Postpone</Button>}\r\n          {!hasChanges && <Button variant=\"secondary\" onClick={this.handleCancel} className=\"fixed-w5 ml-2\">Close</Button>}\r\n        </Modal.Footer>}\r\n      </Modal>\r\n    ) : null\r\n  }\r\n}\r\n","import React, { Component } from \"react\"\r\nimport { Button, Modal, Spinner, Col, Row, Table, Container } from \"react-bootstrap\"\r\nimport OrderResultRecord from \"../../api/OrderResults/OrderResultModel/OrderResultRecord\"\r\nimport { Subscription, BehaviorSubject, of, concat } from \"rxjs\"\r\nimport { distinctUntilChanged, switchMap, map, catchError } from \"rxjs/operators\"\r\nimport { toast } from \"react-toastify\"\r\nimport ColumnHeaderFilter from \"../ColumnHeaderFilter\"\r\nimport ColumnFilter from \"../../api/Randoms/RandomsModel/ColumnFilter\"\r\nimport FormatDate from \"../../formatters/FormatDate\"\r\nimport TestEventUpdateData from \"../../api/OrderResults/OrderResultModel/TestEventUpdateData\"\r\nimport SearchField from \"../../api/SearchField\"\r\nimport SearchBar from \"../SearchBar\"\r\nimport { Filter, Sort } from \"../../api/GridRequest\"\r\nimport FormatSSN from \"../../formatters/FormatSSN\"\r\nimport { TestToMergeGetObservable, MergeTest } from \"../../api/OrderResults/TestToMergeGet\"\r\nimport TestToMergeViewModel from \"../../api/OrderResults/OrderResultModel/TestToMergeRecord\"\r\nimport { TestToMergeRecord } from \"../../api/OrderResults/OrderResultModel/TestToMergeRecord\"\r\nimport TablePagination from \"../TablePagination\"\r\nimport ConfirmationModal from \"../ConfirmationModal\"\r\n\r\ninterface SearchTestToMergeProps {\r\n  details: OrderResultRecord\r\n  onHide: () => void\r\n}\r\n\r\ninterface SearchTestToMergeState {\r\n  data?: TestToMergeViewModel\r\n  loading: boolean\r\n  searchFields: SearchField[]\r\n  selectedTest?: TestToMergeRecord\r\n  dataSaving: boolean\r\n  showMergeFullCopyConfirmation: boolean\r\n  showMergeUpdateEmptyConfirmation: boolean\r\n}\r\nconst DefaultSearchFields: SearchField[] = [\r\n  { ID: \"AllPersonnelIDs\", Name: \"All Personnel IDs\" },\r\n  { ID: \"AlternateID\", Name: \"Alternate ID\" },\r\n  { ID: \"DriverID\", Name: \"Driver ID\" },\r\n  { ID: \"EmployerID\", Name: \"Employer ID\" },\r\n  { ID: \"SSN\", Name: \"SSN\" },\r\n  { ID: \"FirstName\", Name: \"First Name\" },\r\n  { ID: \"LastName\", Name: \"Last Name\" },\r\n  { ID: \"FullName\", Name: \"Full Name\" },\r\n  { ID: \"SampleID\", Name: \"Sample ID\" }\r\n]\r\ninterface TesToMergeSearchParams {\r\n  pageNumber: number\r\n  sort: Sort\r\n  filters: Filter[]\r\n  search: { field: string, text: string }\r\n}\r\ninterface ResultColumn {\r\n  ID: string\r\n  Name: string\r\n}\r\nconst ResultColumns: ResultColumn[] = [\r\n  { ID: \"ID\", Name: \"ID\" },\r\n  { ID: \"Name\", Name: \"Name\" },\r\n  { ID: \"CollDate\", Name: \"Coll Date\" },\r\n  { ID: \"ReferenceID\", Name: \"Reference ID\" },\r\n  { ID: \"Reason\", Name: \"Reason\" },\r\n  { ID: \"Type\", Name: \"Type\" },\r\n  { ID: \"Result\", Name: \"Result\" },\r\n  { ID: \"Status\", Name: \"Status\" },\r\n  { ID: \"Company\", Name: \"Company\" },\r\n]\r\n\r\nconst PageSize = 20\r\nexport default class SearchTestToMerge extends Component<SearchTestToMergeProps, SearchTestToMergeState> {\r\n  subscription?: Subscription\r\n  mergeSubscription?: Subscription\r\n  pageSubscription?: Subscription\r\n  state: SearchTestToMergeState = {\r\n    data: undefined, loading: false, searchFields: DefaultSearchFields,\r\n    selectedTest: undefined, dataSaving: false, showMergeFullCopyConfirmation: false, showMergeUpdateEmptyConfirmation: false\r\n  }\r\n\r\n  page$ = new BehaviorSubject<TesToMergeSearchParams>({\r\n    pageNumber: 1,\r\n    sort: { column: \"\", order: \"\" },\r\n    filters: [],\r\n    search: { field: \"\", text: \"\" }\r\n  })\r\n\r\n  componentDidMount() {\r\n    this.pageSubscription = this.page$.pipe(\r\n      distinctUntilChanged(),\r\n      switchMap(params => concat(\r\n        of({ loading: true }),\r\n        TestToMergeGetObservable(params.pageNumber, PageSize, params.sort, params.filters, params.search, this.props.details.TestDetailID, this.props.details.TestType).pipe(\r\n          map((result: TestToMergeViewModel) => ({ data: result, loading: false })))\r\n      )\r\n      )\r\n    ).subscribe(\r\n      (newState: { loading: boolean, data?: TestToMergeViewModel }) => {\r\n        if (newState.data) {\r\n          this.setState({ loading: newState.loading, data: newState.data })\r\n        } else {\r\n          this.setState({ loading: newState.loading })\r\n        }\r\n      },\r\n      (error: string) => {\r\n        this.setState({ loading: false })\r\n        toast.error(error)\r\n      }\r\n    )\r\n  }\r\n\r\n\r\n  componentWillUnmount() {\r\n    this.mergeSubscription && this.mergeSubscription.unsubscribe()\r\n    this.pageSubscription && this.pageSubscription.unsubscribe()\r\n  }\r\n\r\n\r\n  onCancel = () => {\r\n    this.props.onHide()\r\n\r\n  }\r\n  confirmMergeFullCopy = () => {\r\n    this.setState({ showMergeFullCopyConfirmation: true })\r\n  }\r\n  onMergeFullCopy = () => {\r\n\r\n    this.setState({ showMergeFullCopyConfirmation: false })\r\n    if (this.state.selectedTest) {\r\n      this.mergeTest(1)\r\n      //this.props.onHide()\r\n      return\r\n    }\r\n    this.props.onHide()\r\n  }\r\n  confirmMergeUpdateEmpty = () => {\r\n    this.setState({ showMergeUpdateEmptyConfirmation: true })\r\n  }\r\n  onMergeUpdateEmpty = () => {\r\n    this.setState({ showMergeUpdateEmptyConfirmation: false })\r\n    if (this.state.selectedTest) {\r\n      this.mergeTest(2)\r\n      //this.props.onHide()\r\n      return\r\n    }\r\n    this.props.onHide()\r\n  }\r\n  createMergeParams(mergeMode: number) {\r\n    return {\r\n      TestDetailID: this.props.details.TestDetailID,\r\n      MergeTestDetailID: this.state.selectedTest?.TestDetailID || 0,\r\n      MergeMode: mergeMode,\r\n      KeepReleased: false\r\n    }\r\n  }\r\n  mergeTest(mergeMode: number) {\r\n    this.setState({ dataSaving: true, loading: false })\r\n    const updateData = this.createMergeParams(mergeMode)\r\n    this.mergeSubscription && this.mergeSubscription.unsubscribe()\r\n    this.mergeSubscription = MergeTest(updateData).subscribe(\r\n      data => {\r\n        this.setState({ dataSaving: false })\r\n        toast.success(data),\r\n          // this.onSubmit()\r\n          this.props.onHide()\r\n      },\r\n      (error) => {\r\n        toast.error(error?.errorData?.message || error.message)\r\n        this.setState({ dataSaving: false })\r\n      },\r\n      () => {\r\n        this.setState({ dataSaving: false })\r\n        this.props.onHide()\r\n      }\r\n    )\r\n\r\n  }\r\n  sortGrid(column: string, order?: string) {\r\n    const newSort = { column: column, order: order || \"\" }\r\n    this.page$.next({ ...this.page$.value, sort: newSort })\r\n  }\r\n\r\n  filterGrid(column: string, items: string[]) {\r\n    const filters = [...this.page$.value.filters]\r\n    const filter = { column: column, values: items }\r\n    let index = filters.findIndex(item => item.column === filter.column)\r\n    if (index >= 0) {\r\n      filters[index] = filter\r\n    } else {\r\n      filters.push(filter)\r\n    }\r\n\r\n    this.page$.next({ ...this.page$.value, pageNumber: 1, filters: filters })\r\n  }\r\n  onSearch = (field: string, text: string) => {\r\n    this.page$.next({ ...this.page$.value, pageNumber: 1, search: { field: field, text: text } })\r\n  }\r\n  formatSearchString = (ID: string, value: string): string => {\r\n    return ID === \"SSN\" ? FormatSSN(value) : value\r\n  }\r\n  pageChanged = (pageNumber: number) => {\r\n    this.page$.next({ ...this.page$.value, pageNumber: pageNumber })\r\n  }\r\n  filterItems = (columnName: string): any[] => {\r\n    if (columnName === \"ID\") {\r\n      return this.state.data?.ID || []\r\n    }\r\n    if (columnName === \"Name\") {\r\n      return this.state.data?.Name || []\r\n    }\r\n    if (columnName === \"DateCollected\") {\r\n      return this.state.data?.DateCollected || []\r\n    }\r\n    if (columnName === \"Reason\") {\r\n      return this.state.data?.Reason || []\r\n    }\r\n    if (columnName === \"Type\") {\r\n      return this.state.data?.Type || []\r\n    }\r\n    if (columnName === \"Result\") {\r\n      return this.state.data?.Result || []\r\n    }\r\n    if (columnName === \"Status\") {\r\n      return this.state.data?.Status || []\r\n    }\r\n    if (columnName === \"Company\") {\r\n      return this.state.data?.Company || []\r\n    }\r\n    return []\r\n  }\r\n  renderHeaderColumn = (columnName: string, title: string) => {\r\n    const sort = this.page$.value.sort\r\n    return <th>\r\n      {this.state.data\r\n        ? <ColumnHeaderFilter title={title}\r\n          sort={sort.column === columnName ? sort.order === \"asc\" ? \"asc\" : \"desc\" : undefined}\r\n          items={this.filterItems(columnName)?.filter(item => !!item) || []}\r\n          filteredItems={this.page$.value.filters.find(item => item.column === columnName)?.values || []}\r\n          onSort={(order?: string) => this.sortGrid(columnName, order)}\r\n          onFilter={(items: string[]) => this.filterGrid(columnName, items)} />\r\n        : title.toUpperCase()}\r\n    </th>\r\n  }\r\n\r\n  selectTest = (row: TestToMergeRecord) => {\r\n    this.setState({ selectedTest: row })\r\n  }\r\n\r\n  renderRows = () => {\r\n    if (this.state.data?.Records && this.state.data?.Records.length) {\r\n      return this.state.data.Records.map((row: TestToMergeRecord, i: number) =>\r\n        <tr key={i} onClick={() => this.selectTest(row)}>\r\n          <td>{row.ID}</td>\r\n          <td>{row.Name}</td>\r\n          <td>{FormatDate(row.DateCollected)}</td>\r\n          <td>{row.TestReasonCode}</td>\r\n          <td>{row.SampleTypeCode}</td>\r\n          <td>{row.EventResultCode}</td>\r\n          <td>{row.EventStatusCode}</td>\r\n          <td>{row.Company}</td>\r\n        </tr>)\r\n    } else {\r\n      return <tr><td colSpan={8}>No Records Found</td></tr>\r\n    }\r\n  }\r\n\r\n  render() {\r\n    const selectedTest = this.state.selectedTest\r\n    const fullCopyConfirmationText = \"Please be aware all original test information will be retained. All merge data will overwrite the fields on the existing test. Press 'Continue' to merge the two records or 'Cancel' to return.\"\r\n    const updateEmptyConfirmationText = \"Please be aware all original test information will be retained. Any merge data will be lost except for values that can be populated to null fields on the original test. Press 'Continue' to merge the two records or 'Cancel' to return. \"\r\n\r\n    const content = <>\r\n      <Modal.Header>\r\n        <Modal.Title className=\"text-uppercase\">Merge</Modal.Title>\r\n      </Modal.Header>\r\n      <Modal.Body>\r\n        {<Container>\r\n          <Row className=\"pb-2\">\r\n            <Col>\r\n              <SearchBar onSearch={this.onSearch} searchFields={this.state.searchFields || []} formatValue={this.formatSearchString} allowBlank placeholder=\"Select\" />\r\n            </Col>\r\n          </Row>\r\n          <Row className=\"d-flex justify-content-center\">\r\n            <Col md=\"auto\">\r\n            </Col>\r\n            <Col md=\"auto\">\r\n            </Col>\r\n          </Row>\r\n        </Container>}\r\n        {<Container>\r\n          <Row>\r\n            <Col>\r\n              <Table bordered responsive>\r\n                <thead>\r\n                  <tr >\r\n                    {this.renderHeaderColumn(\"ID\", \"ID\")}\r\n                    {this.renderHeaderColumn(\"Name\", \"Name\")}\r\n                    {this.renderHeaderColumn(\"DateCollected\", \"Coll Date\")}\r\n                    {this.renderHeaderColumn(\"Reason\", \"Reason\")}\r\n                    {this.renderHeaderColumn(\"Type\", \"Type\")}\r\n                    {this.renderHeaderColumn(\"Result\", \"Result\")}\r\n                    {this.renderHeaderColumn(\"Status\", \"Status\")}\r\n                    {this.renderHeaderColumn(\"Company\", \"Company\")}\r\n\r\n\r\n\r\n                  </tr>\r\n                </thead>\r\n                <tbody>\r\n                  {\r\n                    this.state.loading ?\r\n                      <tr>\r\n                        <td className=\"text-center\" colSpan={8}>\r\n                          <Spinner animation=\"border\" variant=\"secondary\" />\r\n                        </td>\r\n                      </tr> : this.renderRows()\r\n                  }\r\n                </tbody>\r\n              </Table>\r\n            </Col>\r\n          </Row>\r\n          {this.state.data ?\r\n            <Row>\r\n              <Col>\r\n                <span className=\"total-records\">Total records: {this.state.data.Total}</span>\r\n                <TablePagination pageNumber={this.page$.value.pageNumber} pages={this.state.data.Pages} onChange={this.pageChanged} />\r\n              </Col>\r\n            </Row> : undefined}\r\n          {(this.state.data && this.state.selectedTest) ?\r\n            <Row>\r\n              <Col>\r\n                <Row>\r\n                  <Col>Donor ID: </Col><Col>{this.state.selectedTest.ID || \"\"}</Col>\r\n                  <Col>Reason For Test: </Col><Col>{this.state.selectedTest.TestReason || \"\"}</Col>\r\n                </Row>\r\n                <Row>\r\n                  <Col>First Name: </Col><Col>{this.state.selectedTest.FirstName}</Col>\r\n                  <Col>Sample Type: </Col><Col>{this.state.selectedTest.SampleType || \"\"}</Col>\r\n                </Row>\r\n                <Row>\r\n                  <Col>Last Name: </Col><Col>{this.state.selectedTest.LastName}</Col>\r\n                  <Col>Federal Regulated: </Col><Col>{this.state.selectedTest.DOT ? \"Yes\" : \"No\"}</Col>\r\n                </Row>\r\n              </Col>\r\n            </Row> : undefined\r\n          }\r\n        </Container>}\r\n      </Modal.Body>\r\n      <Modal.Footer>\r\n        <Button variant=\"primary\" className=\"px-4\" onClick={this.onCancel}>Cancel</Button>\r\n        <Button variant=\"primary\" className=\"px-4\" onClick={this.confirmMergeFullCopy} disabled={!this.state.selectedTest}>Merge (Full copy)</Button>\r\n        <Button variant=\"primary\" className=\"px-4\" onClick={this.confirmMergeUpdateEmpty} disabled={!this.state.selectedTest}>Merge (Update Empty)</Button>\r\n      </Modal.Footer>\r\n      <ConfirmationModal show={this.state.showMergeFullCopyConfirmation}\r\n        title=\"CONFIRM MERGE\"\r\n        textTitle=\"Are you sure you want to merge?\"\r\n        text={fullCopyConfirmationText}\r\n        onConfirm={this.onMergeFullCopy}\r\n        onHide={() => this.setState({ showMergeFullCopyConfirmation: false })} />\r\n\r\n      <ConfirmationModal show={this.state.showMergeUpdateEmptyConfirmation}\r\n        title=\"CONFIRM MERGE\"\r\n        textTitle=\"Are you sure you want to merge?\"\r\n        text={updateEmptyConfirmationText}\r\n        onConfirm={this.onMergeUpdateEmpty}\r\n        onHide={() => this.setState({ showMergeUpdateEmptyConfirmation: false })} />\r\n    </>\r\n\r\n    return <>\r\n      {\r\n        <Modal.Dialog size=\"xl\">{content}</Modal.Dialog>}\r\n      {<Modal backdrop=\"static\" show size=\"xl\">{content}</Modal>}\r\n    </>\r\n  }\r\n}\r\n","import { useState } from \"react\"\r\nimport { Button, Container, Form, Modal, Spinner } from \"react-bootstrap\"\r\nimport { FaPrint } from \"react-icons/fa\"\r\n\r\nenum PrintMode {\r\n  REPORTS = \"REPORTS\",\r\n  RECORDS = \"RECORDS\"\r\n}\r\n\r\ninterface PrintFormModalProps {\r\n  disabled: boolean\r\n  hasReports: boolean\r\n  printing: boolean\r\n  onPrintRecords: () => void\r\n  onPrintReports: () => void\r\n}\r\n\r\nconst PrintFormModal = (props: PrintFormModalProps) => {\r\n  const [printMode, setPrintMode] = useState<PrintMode>(PrintMode.REPORTS)\r\n  const [showPrintModal, setShowPrintModal] = useState<boolean>(false)\r\n  const { disabled, printing, hasReports, onPrintRecords } = props\r\n\r\n  const showPrintForm = () => hasReports ? setShowPrintModal(true) : onPrintRecords()\r\n\r\n  const hidePrintForm = () => setShowPrintModal(false)\r\n\r\n  const onChange = (e: React.ChangeEvent<HTMLInputElement>) => setPrintMode(e.target.value as PrintMode)\r\n\r\n  const onPrint = (): void => {\r\n    switch (printMode) {\r\n      case PrintMode.RECORDS:\r\n        props.onPrintRecords()\r\n        break\r\n      case PrintMode.REPORTS:\r\n        props.onPrintReports()\r\n        break\r\n    }\r\n    hidePrintForm()\r\n  }\r\n\r\n  return (\r\n    <>\r\n      <Button variant=\"secondary\" size=\"sm\" onClick={() => showPrintForm()} className=\"float-right\" disabled={disabled || printing}>\r\n        {printing && <Spinner animation=\"border\" size=\"sm\" />}\r\n        {!printing && <FaPrint />}\r\n      </Button>\r\n      <Modal show={showPrintModal} onHide={() => hidePrintForm()} dialogClassName=\"dark\">\r\n        <Modal.Header closeButton>\r\n          <Modal.Title>\r\n            CHOOSE OPTION\r\n          </Modal.Title>\r\n        </Modal.Header>\r\n        <Modal.Body className=\"p-3\">\r\n          <Container fluid>\r\n            <Form.Check id=\"reports\" name=\"print\" type=\"radio\" label=\"Print Result Reports\" value={PrintMode.REPORTS} checked={printMode === PrintMode.REPORTS} className=\"abc-radio\" onChange={(e) => onChange(e)} />\r\n            <Form.Check id=\"records\" name=\"print\" type=\"radio\" label=\"Print Records\" value={PrintMode.RECORDS} checked={printMode === PrintMode.RECORDS} className=\"abc-radio mt-2\" onChange={(e) => onChange(e)} />\r\n          </Container>\r\n        </Modal.Body>\r\n        <Modal.Footer className=\"button-block\">\r\n          <Button variant=\"primary\" size=\"sm\" onClick={() => onPrint()}>CONTINUE</Button>\r\n        </Modal.Footer>\r\n      </Modal>\r\n    </>\r\n  )\r\n}\r\nexport default PrintFormModal\r\n","import { ObservableFromFetch } from \"../ObservableFromFetch\"\r\nimport TestToMergeViewModel, {MergeEventParameters} from \"./OrderResultModel/TestToMergeRecord\"\r\nimport { Filter, Sort } from \"../GridRequest\"\r\n\r\nexport function TestToMergeGetObservable(pageNumber: number, pageSize: number, sort: Sort, filters: Filter[], search: { field: string, text: string }, testDetailID: string, testType: string) {\r\n  const requestBody: string = JSON.stringify({\r\n    BatchPool: \"\",\r\n    BySel: search.field,\r\n    Filters: {\r\n      ID: filters.find(filter => filter.column === \"ID\")?.values || [],\r\n      Name: filters.find(filter => filter.column === \"Name\")?.values || [],\r\n      DateCollected: filters.find(filter => filter.column === \"DateCollected\")?.values || [],\r\n      Reason: filters.find(filter => filter.column === \"Reason\")?.values || [],\r\n      Type: filters.find(filter => filter.column === \"Type\")?.values || [],\r\n      Result: filters.find(filter => filter.column === \"Result\")?.values || [],\r\n      Status: filters.find(filter => filter.column === \"Status\")?.values || [],\r\n      Company: filters.find(filter => filter.column === \"Company\")?.values || [],\r\n    },\r\n    MatchSel: \"Partial\",\r\n    PageNumber: pageNumber,\r\n    PageSize: pageSize,\r\n    SortGrid: { SortColumn: sort.column, SortOrder: sort.order.toUpperCase() === \"DESC\" ? \"DSC\" : sort.order.toUpperCase() },\r\n    SrchFor:  search.text,\r\n    TypeSel: \"\",\r\n    TestDetailID: testDetailID,\r\n    TestType: testType\r\n    \r\n  })\r\n\r\n  return ObservableFromFetch<TestToMergeViewModel>(\"WorkForceTrack/SearchTestsToMerge\", requestBody)\r\n}\r\nexport  function MergeTest(data: MergeEventParameters) {\r\n  const requestBody = JSON.stringify({\r\n    TestDetailID: data.TestDetailID,\r\n    MergeTestDetailID: data.MergeTestDetailID,\r\n    MergeMode: data.MergeMode,\r\n    KeepReleased: data.KeepReleased\r\n  })\r\n\r\n  return ObservableFromFetch<string>(\"WorkForceTrack/MergeTest\", requestBody)\r\n}","import RandomTestCard from \"./RandomTestCard\"\r\nimport OrderResultRecord from \"../../api/OrderResults/OrderResultModel/OrderResultRecord\"\r\n\r\ninterface ReasonForTestCellProps {\r\n  row: OrderResultRecord\r\n  useIcon?: boolean\r\n}\r\n\r\nfunction ReasonForTestCell(props: ReasonForTestCellProps) {\r\n  const { row, useIcon } = props\r\n\r\n  if (row.IsRandom) {\r\n    return <RandomTestCard description={row.Reason} useIcon={useIcon} />\r\n  }\r\n  return <div className=\"d-flex align-items-center\">{row.Reason}</div>\r\n}\r\n\r\nReasonForTestCell.defaultProps = {\r\n  useIcon: false,\r\n}\r\nexport default ReasonForTestCell\r\n","import FileSaver from \"file-saver\"\r\nimport { toast } from \"react-toastify\"\r\n\r\nexport default function exportCsv(csv: string, fileName: string) {\r\n    const csvData = new Blob([csv], { type: 'text/csv;charset=utf-8;' })\r\n    FileSaver.saveAs(csvData, fileName, true)\r\n    toast.success(\"CSV file downloaded successfully.\")\r\n}\r\n","import { useState } from \"react\"\r\n\r\nimport { Button, Col, Form, Modal, Row } from \"react-bootstrap\"\r\nimport { FaFileCsv, FaSync } from \"react-icons/fa\"\r\n\r\nimport { Filter, Sort } from \"../../api/GridRequest\"\r\nimport { OrderResultsExportCsv } from \"../../api/OrderResults/OrderResultsListGet\"\r\nimport { AccountTypeID } from \"../../config/Constants\"\r\nimport FormatDate from \"../../formatters/FormatDate\"\r\nimport FormatTimestampFileName from \"../../formatters/FormatTimestampFileName\"\r\nimport exportCsv from \"../../utils/exportCsv\"\r\nimport handleAPIError from \"../../utils/handleAPIError\"\r\nimport ActionButton from \"../ActionButton\"\r\nimport FromToDates from \"../Reports/FromToDates\"\r\n\r\ninterface ExportSearchParams {\r\n  field: string\r\n  text: string\r\n  sort?: Sort\r\n  filters: Filter[]\r\n}\r\n\r\ninterface ExportCSVModalProps {\r\n  isPortalAdmin: boolean\r\n  searchParams: ExportSearchParams\r\n  onClose: () => void\r\n}\r\n\r\nfunction ExportCSVModal(props: ExportCSVModalProps) {\r\n  const { isPortalAdmin, searchParams, onClose } = props\r\n  const [generatingCsv, setGeneratingCsv] = useState(false)\r\n  const [from, setFrom] = useState<Date>()\r\n  const [to, setTo] = useState<Date>()\r\n  const [includeAllDates, setIncludeAllDates] = useState(false)\r\n  const [includeArchivedOrders, setIncludeArchivedOrders] = useState(true)\r\n  const [includeActiveOrders, setIncludeActiveOrders] = useState(true)\r\n\r\n  const minDate = new Date(new Date().setFullYear(new Date().getFullYear() - 2))\r\n  const accountType = isPortalAdmin ? 0 : AccountTypeID\r\n\r\n  const handleCancelClick = () => onClose()\r\n\r\n  const handleClearClick = () => {\r\n    setFrom(undefined)\r\n    setTo(undefined)\r\n    setIncludeAllDates(false)\r\n    setIncludeArchivedOrders(true)\r\n    setIncludeActiveOrders(true)\r\n  }\r\n\r\n  const handelActiveChange = (event: React.ChangeEvent<HTMLInputElement>) => {\r\n    setIncludeActiveOrders(event.target.checked)\r\n  }\r\n\r\n  const handelArchivedChange = (event: React.ChangeEvent<HTMLInputElement>) => {\r\n    setIncludeArchivedOrders(event.target.checked)\r\n  }\r\n\r\n  const getReportParams = () => ({\r\n    ...searchParams,\r\n    exportDateFrom: FormatDate(from),\r\n    exportDateTo: FormatDate(to),\r\n    includeArchived: includeArchivedOrders && includeActiveOrders,\r\n    complete: includeArchivedOrders && !includeActiveOrders,\r\n  })\r\n\r\n  const checkAllDates = (checked: boolean) => {\r\n    setIncludeAllDates(checked)\r\n    setFrom(undefined)\r\n    setTo(undefined)\r\n  }\r\n\r\n  const handleGenerateCsvClick = () => {\r\n    setGeneratingCsv(true)\r\n    OrderResultsExportCsv(getReportParams(), accountType).subscribe(\r\n      (results: string) => {\r\n        setGeneratingCsv(false)\r\n        exportCsv(results, FormatTimestampFileName(\"Tracking\", \"csv\", new Date()))\r\n      },\r\n      (error) => handleAPIError(error, () => setGeneratingCsv(false))\r\n    )\r\n  }\r\n\r\n  const isParamsValid = () => (includeArchivedOrders || includeActiveOrders) && (includeAllDates || (!!from && !!to))\r\n\r\n  return (\r\n    <Modal backdrop=\"static\" centered show onHide={handleCancelClick}>\r\n      <Modal.Header closeButton>\r\n        <Modal.Title className=\"text-uppercase\">EXPORT CSV OPTIONS:</Modal.Title>\r\n      </Modal.Header>\r\n      <Modal.Body className=\"pt-3\">\r\n        <Form>\r\n          <Row>\r\n            <Col sm={4}>\r\n              <Form.Label htmlFor=\"include_all_dates\">Include All Dates</Form.Label>\r\n            </Col>\r\n            <Col>\r\n              <Form.Check\r\n                id=\"include_all_dates\"\r\n                type=\"checkbox\"\r\n                inline\r\n                className=\"abc-checkbox abc-checkbox-inline\"\r\n                label=\"\"\r\n                value={includeAllDates ? 1 : 0}\r\n                checked={includeAllDates}\r\n                onChange={(e) => checkAllDates(e.target.checked)}\r\n              />\r\n            </Col>\r\n          </Row>\r\n          <Row>\r\n            <Col>\r\n              <FromToDates\r\n                disabled={includeAllDates}\r\n                minDate={minDate}\r\n                from={from}\r\n                to={to}\r\n                onChangeFrom={setFrom}\r\n                onChangeTo={setTo}\r\n              />\r\n            </Col>\r\n          </Row>\r\n          <Row>\r\n            <Col sm={4}>\r\n              <Form.Label className=\"required\">Include Orders</Form.Label>\r\n            </Col>\r\n            <Col>\r\n              <Form.Check\r\n                id=\"include_active\"\r\n                type=\"checkbox\"\r\n                className=\"abc-checkbox abc-checkbox-primary\"\r\n                label=\"Active\"\r\n                value={includeActiveOrders ? 1 : 0}\r\n                checked={includeActiveOrders}\r\n                onChange={handelActiveChange}\r\n              />\r\n              <Form.Check\r\n                id=\"include_archived\"\r\n                type=\"checkbox\"\r\n                className=\"abc-checkbox abc-checkbox-primary\"\r\n                label=\"Archived\"\r\n                value={includeArchivedOrders ? 1 : 0}\r\n                checked={includeArchivedOrders}\r\n                onChange={handelArchivedChange}\r\n              />\r\n            </Col>\r\n          </Row>\r\n        </Form>\r\n      </Modal.Body>\r\n      <Modal.Footer>\r\n        <Button variant=\"secondary\" onClick={handleCancelClick}>\r\n          Cancel\r\n        </Button>\r\n        <Button variant=\"secondary\" className=\"mr-auto\" onClick={handleClearClick}>\r\n          Clear Filter&nbsp;\r\n          <FaSync />\r\n        </Button>\r\n        <ActionButton\r\n          variant=\"primary\"\r\n          disabled={!isParamsValid()}\r\n          onClick={handleGenerateCsvClick}\r\n          spin={generatingCsv}\r\n          disableOnSpin\r\n        >\r\n          Export CSV&nbsp;\r\n          <FaFileCsv />\r\n        </ActionButton>\r\n      </Modal.Footer>\r\n    </Modal>\r\n  )\r\n}\r\nexport default ExportCSVModal\r\n","import { Image } from \"react-bootstrap\"\r\n\r\nimport OrderResultRecord from \"../../api/OrderResults/OrderResultModel/OrderResultRecord\"\r\nimport watchResolvedImage from \"../../assets/images/watch-resolved.png\"\r\nimport watchImage from \"../../assets/images/watch.png\"\r\n\r\ninterface WatchCellProps {\r\n  row: OrderResultRecord\r\n}\r\n\r\nfunction WatchCell(props: WatchCellProps) {\r\n  const { row } = props\r\n\r\n  return (\r\n    <td className=\"alert-icons\" key={`alert-${row.TestDetailID}-${row.TestDetailClinicalID}`}>\r\n      {row.TestEventAlert?.Watch && (\r\n        <div>\r\n          {!row.TestEventAlert.WatchResolved && <Image src={watchImage} title=\"Watch Alert\" />}\r\n          {row.TestEventAlert.WatchResolved && <Image src={watchResolvedImage} title=\"Watch Resolved\" />}\r\n        </div>\r\n      )}\r\n    </td>\r\n  )\r\n}\r\n\r\nexport default WatchCell\r\n","export default \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJYAAACWCAMAAAAL34HQAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAvpQTFRFAAAA////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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CC\"","import React, { useCallback, useEffect, useRef, useState } from \"react\"\r\n\r\nimport { fromEvent, Subscription } from \"rxjs\"\r\nimport { debounceTime } from \"rxjs/operators\"\r\n\r\ninterface HorizontalScrollWrapperProps {\r\n  gridRef: React.RefObject<HTMLTableElement | HTMLDivElement>\r\n  recalculateWidth: boolean\r\n  visible?: boolean\r\n  children: React.ReactNode\r\n  offsetVertical?: number\r\n}\r\n\r\nfunction HorizontalScrollWrapper(props: HorizontalScrollWrapperProps) {\r\n  const { gridRef, recalculateWidth, visible, children, offsetVertical } = props\r\n  const [gridWidth, setGridWidth] = useState(0)\r\n\r\n  const scrollWrapper = useRef<HTMLDivElement>(null)\r\n  const gridWrapper = useRef<HTMLDivElement>(null)\r\n\r\n  const updateWidth = useCallback(() => {\r\n    if (gridRef.current && gridWrapper.current) {\r\n      const { clientWidth, offsetWidth } = gridWrapper.current\r\n      const verticalScrollBoxWidth = offsetWidth - clientWidth\r\n      setGridWidth(Math.round(gridRef.current.offsetWidth + verticalScrollBoxWidth))\r\n    }\r\n  }, [gridRef])\r\n\r\n  const onSyncScroll = (event: Event) => {\r\n    if (gridWrapper.current) {\r\n      gridWrapper.current.scrollLeft = (event.target as HTMLDivElement).scrollLeft\r\n    }\r\n  }\r\n\r\n  useEffect(() => {\r\n    const resizeSubscription: Subscription = fromEvent(window, \"resize\").pipe(debounceTime(50)).subscribe(updateWidth)\r\n\r\n    const scrollSubscription: Subscription = fromEvent(scrollWrapper.current!, \"scroll\")\r\n      .pipe(debounceTime(5))\r\n      .subscribe(onSyncScroll)\r\n\r\n    updateWidth()\r\n\r\n    return () => {\r\n      resizeSubscription.unsubscribe()\r\n      scrollSubscription.unsubscribe()\r\n    }\r\n  }, [updateWidth])\r\n\r\n  useEffect(() => {\r\n    if (recalculateWidth) {\r\n      updateWidth()\r\n    } else {\r\n      setGridWidth(0)\r\n    }\r\n  }, [recalculateWidth, updateWidth])\r\n\r\n  const visibleHorizontalScroll = () => {\r\n    if (gridWrapper.current) {\r\n      const { scrollWidth, clientWidth } = gridWrapper.current\r\n      return visible && gridWidth > 0 && scrollWidth > clientWidth\r\n    }\r\n    return false\r\n  }\r\n\r\n  return (\r\n    <>\r\n      <div\r\n        ref={scrollWrapper}\r\n        className=\"scroll-wrapper\"\r\n        style={{ visibility: visibleHorizontalScroll() ? \"visible\" : \"hidden\" }}\r\n      >\r\n        <div style={{ height: \"1px\", width: `${gridWidth}px` ?? \"100%\" }} />\r\n      </div>\r\n      <div\r\n        className=\"table-sticky-head overflow-x-hide mb-2\"\r\n        ref={gridWrapper}\r\n        style={{ height: `calc(100vh - ${offsetVertical}px)` }}\r\n      >\r\n        {children}\r\n      </div>\r\n    </>\r\n  )\r\n}\r\n\r\nHorizontalScrollWrapper.defaultProps = {\r\n  visible: true,\r\n  offsetVertical: 0,\r\n}\r\n\r\nexport default HorizontalScrollWrapper\r\n","import { Button } from \"react-bootstrap\"\r\n\r\nimport OrderResultRecord from \"../../api/OrderResults/OrderResultModel/OrderResultRecord\"\r\nimport { ScheduleStatus } from \"../../config/Constants\"\r\n\r\ninterface FormFoxTestANColumnProps {\r\n  row: OrderResultRecord\r\n  prevRow?: OrderResultRecord\r\n  showAuthFormModal: (row: OrderResultRecord) => void\r\n}\r\n\r\nfunction FormFoxTestANColumn(props: FormFoxTestANColumnProps) {\r\n  const { row, prevRow, showAuthFormModal } = props\r\n\r\n  const isShowValue = (prevRow === undefined) || (prevRow && ((prevRow.PersonID !== row.PersonID) || (prevRow.FormFoxTestAN !== row.FormFoxTestAN)))\r\n  const isLinkVisible =\r\n    row.FormFoxTestAN !== \"\" &&\r\n    !row.DateCollected &&\r\n    row.ScheduleStatusID !== ScheduleStatus.Cancelled &&\r\n    !row.IsExpired && isShowValue\r\n\r\n  return isLinkVisible ? (\r\n    <Button variant=\"underline-link pl-1\" onClick={() => showAuthFormModal(row)}>\r\n      {row.FormFoxTestAN}\r\n    </Button>\r\n  ) : (\r\n    <div className=\"text-nowrap ml-1\">{isShowValue ? row.FormFoxTestAN : \"\"}</div>\r\n  )\r\n}\r\n\r\nexport default FormFoxTestANColumn\r\n","import React from \"react\"\r\nimport { Container, Row, Col, Table, Button, Spinner, Image } from \"react-bootstrap\"\r\nimport { AppPageWrapper } from \"../NavMenu/AppPageWrapper\"\r\nimport { Subscription } from \"rxjs\"\r\nimport { toast } from \"react-toastify\"\r\nimport { FaExclamationTriangle, FaFileCsv, FaSync } from \"react-icons/fa\"\r\nimport { OrderResultGridResponse, ColumnFilters } from \"../../api/OrderResults/OrderResultModel/OrderResultGridResponse\"\r\nimport OrderResultRecordIdentifier from \"../../api/OrderResults/OrderResultModel/OrderResultRecordIdentifier\"\r\nimport OrderResultRecord, { RAImage } from \"../../api/OrderResults/OrderResultModel/OrderResultRecord\"\r\nimport { Sort, Filter } from \"../../api/GridRequest\"\r\nimport { ResultsGridObservable, OrderResultsPrint } from \"../../api/OrderResults/OrderResultsListGet\"\r\nimport ResultsWatchObservable from \"../../api/OrderResults/ResultsWatch\"\r\nimport { SearchFieldsGet } from \"../../api/OrderResults/SearchFieldsGet\"\r\nimport SearchField from \"../../api/SearchField\"\r\nimport SearchBar from \"../SearchBar\"\r\nimport ColumnsCustomizeModal from \"../ColumnsCustomizeModal/ColumnsCustomizeModal\"\r\nimport CompleteModal from \"./CompleteModal\"\r\nimport { CustomizableFilterColumn } from \"../ColumnsCustomizeModal/CustomizableColumn\"\r\nimport ColumnHeaderFilter from \"../ColumnHeaderFilter\"\r\nimport TablePagination from \"../TablePagination\"\r\nimport EmployeeDetailsModal from \"./EmployeeDetailsModal\"\r\nimport EventDetailsModal from \"./EventDetailsModal\"\r\nimport GridStatusInfo from \"./GridStatusInfo\"\r\nimport ModalStatusInfo from \"./ModalStatusInfo\"\r\nimport FormatDate from \"../../formatters/FormatDate\"\r\nimport FormatSSN from \"../../formatters/FormatSSN\"\r\nimport FormatTimestampFileName from \"../../formatters/FormatTimestampFileName\"\r\nimport Checkbox from \"../Checkbox\"\r\nimport ImageCCF from \"../../assets/images/CCF.png\"\r\nimport ImageMRO from \"../../assets/images/MRO.png\"\r\nimport ImageOHS from \"../../assets/images/OHS.png\"\r\nimport { AppState } from \"../../AppState\"\r\nimport { connect } from \"react-redux\"\r\nimport ImageGet, { ImageData, GetMROLetter, GenerateMROReport, TestReleaseStatusID } from \"../../api/OrderResults/GenerateCCFImage\"\r\nimport { APIError } from \"../../api/ObservableFromFetch\"\r\nimport FormatData from \"../../formatters/FormatBase64\"\r\nimport { isPortalAdmin } from \"../../authentication/isAdminRole\"\r\nimport { AccountTypeID, ImplementationTypeGovt, ScheduleStatus, StorageKey } from \"../../config/Constants\"\r\nimport { loadCustomized } from \"../ColumnsCustomizeModal/ColumnsCustomizeModal\"\r\nimport { getLoggedInUserName, GetSelectedPortal } from \"../../authentication/SelectedCompany/CompanySelectionDrivenSelectors\"\r\nimport ResultsResolveObservable from \"../../api/OrderResults/ResultsResolve\"\r\nimport { BuildUserAccess } from \"../../authentication/BuildUserAccess\"\r\nimport { ServiceTypeCode } from '../../api/Administration/Model/ServiceType';\r\nimport printPdf from \"../../utils/printPdf\"\r\nimport { TestTypes } from \"../../api/Administration/Model/TestType\"\r\nimport OrderTrackingCheckbox from \"./OrderTrackingCheckbox\"\r\nimport ConnectedAuthFormModal from \"./AuthFormModal\"\r\nimport OrderEditModal from \"./OrderEditModal\"\r\nimport SendSelectClinicLink from \"./SendSelectClinicLink\"\r\nimport ImageAlert from \"../../assets/images/alert.png\"\r\nimport ImageAlertResolved from \"../../assets/images/alert-resolved.png\"\r\nimport EventDetailsCompare from \"./EventDetailsCompare\"\r\nimport SearchTestToMerge from \"./SearchTestToMerge\"\r\nimport PrintFormModal from \"./PrintFormModal\"\r\nimport ReasonForTestCell from \"./ReasonForTestCell\"\r\nimport ExportCSVModal from \"./ExportCSVModal\"\r\nimport WatchCell from \"./WatchCell\"\r\nimport ActionButton from \"../ActionButton\"\r\nimport HorizontalScrollWrapper from \"../HorizontalScrollWrapper\"\r\nimport FormFoxTestANColumn from \"./FormFoxTestANColumn\"\r\nimport GetDonorID, { GetDonorIDTitle } from \"../../formatters/RenderDonorID\"\r\nimport OrderTrackingRowWarning from \"./OrderTrackingRowWarning\"\r\n\r\ntype Column = CustomizableFilterColumn<keyof OrderResultRecord, keyof ColumnFilters>\r\n\r\ninterface OrderTrackingProps {\r\n  isPortalAdmin: boolean\r\n  canCompleteEvents?: boolean\r\n  canVieweCCFCopy2PreMRO?: boolean\r\n  LoginName: string\r\n  implementationType: string\r\n  unmaskDonorId: number\r\n}\r\n\r\ninterface OrderTrackingState {\r\n  loading: boolean\r\n  data?: OrderResultGridResponse\r\n  columns: Column[]\r\n  showStatusModal: boolean\r\n  searchField: string\r\n  searchText: string\r\n  showArchivedOrders: boolean\r\n  sort?: Sort\r\n  filters: Filter[]\r\n  pageNumber: number\r\n  showExportOptions: boolean\r\n  selectedTests: OrderResultRecordIdentifier[]\r\n  customizeModal: boolean\r\n  completeModal: boolean\r\n  searchFields?: SearchField[]\r\n  statusInfo: boolean\r\n  employeeDetails: boolean\r\n  eventDetails: boolean\r\n  details?: OrderResultRecord\r\n  updatingWatchList: boolean\r\n  resolving: boolean\r\n  showAuthFormModal: boolean\r\n  showResendAuth: boolean\r\n  showOrderEditModal: boolean\r\n  eventCompare: boolean\r\n  showMergeEvent: boolean\r\n  printing: boolean\r\n  showSelectClinicEmail: boolean\r\n}\r\n\r\nconst defaultColumns: Column[] = [\r\n  { name: \"DonorID\", filter: \"IDNumber\", label: \"ID NUMBER\", visible: true, customize: false },\r\n  { name: \"DonorName\", filter: \"Name\", label: \"NAME\", visible: true, customize: true },\r\n  { name: \"Service\", filter: \"Service\", label: \"SERVICE\", visible: true, customize: true },\r\n  { name: \"Result\", filter: \"Result\", label: \"SAMPLE RESULT\", visible: true, customize: true },\r\n  { name: \"Status\", label: \"STATUS\", visible: true, customize: true },\r\n  { name: \"CompanyName\", filter: \"Company\", label: \"COMPANY\", visible: true, customize: true },\r\n  { name: \"RegionName\", filter: \"Region\", label: \"COMPANY REGION\", visible: false, customize: true },\r\n  { name: \"LocationName\", filter: \"Location\", label: \"COMPANY LOCATION\", visible: false, customize: true },\r\n  { name: \"RAImageID\", label: \"eDocs\", visible: true, customize: true },\r\n  { name: \"DOT\", filter: \"Regulated\", label: \"REGULATED\", visible: true, customize: true },\r\n  { name: \"FormFoxTestAN\", filter: \"AuthorizationID\", label: \"AUTHORIZATION ID\", visible: true, customize: true },\r\n  { name: \"SampleID\", filter: \"SampleID\", label: \"SAMPLE ID\", visible: true, customize: true },\r\n  { name: \"OrderedDate\", filter: \"OrderDate\", label: \"ORDER DATE\", visible: true, customize: true },\r\n  { name: \"SiteName\", filter: \"Clinic\", label: \"CLINIC\", visible: true, customize: true },\r\n  { name: \"LabAccountNumber\", filter: \"LabAccountNumber\", label: \"LAB ACCOUNT\", visible: false, customize: true },\r\n  { name: \"OrderedBy\", filter: \"OrderedBy\", label: \"ORDERED BY\", visible: false, customize: true },\r\n  { name: \"OrderUpdatedBy\", filter: \"OrderUpdatedBy\", label: \"UPDATED BY\", visible: true, customize: true },\r\n  { name: \"OrderUpdatedAt\", filter: \"OrderUpdatedAt\", label: \"UPDATE DATE\", visible: true, customize: true },\r\n  { name: \"EventDate\", filter: \"EventDate\", label: \"COLLECTION DATE\", visible: false, customize: true },\r\n  { name: \"CollectionTime\", filter: \"CollectionTime\", label: \"COLLECTION TIME\", visible: false, customize: true },\r\n  { name: \"Reason\", filter: \"Reason\", label: \"REASON FOR TEST\", visible: true, customize: true },\r\n  { name: \"MarketPlaceOrderNum\", filter: \"MarketPlaceOrderNum\", label: \"MPO#\", visible: false, customize: true },\r\n]\r\n\r\nconst GridIDNumber = (props: { value: OrderResultRecord, unmaskDonorId: number }) => {\r\n  const idType = (type: string) => {\r\n    switch (type) {\r\n      case \"SSN\":\r\n        return \"SSN\";\r\n      case \"DriverID\":\r\n        return \"CL\";\r\n      case \"EmployeerID\":\r\n        return \"EID\";\r\n      case \"AlternateID\":\r\n        return \"Alt\";\r\n      default: return type;\r\n    }\r\n  }\r\n\r\n  const idRow = (idValue: string, idType: string, idTitle: string = \"\") => {\r\n    return <><Button variant=\"link\" className=\"btn-service\" title={idTitle}>{idValue}</Button><span className=\"align-middle text-bold\">{idType}</span></>\r\n  }\r\n  const value = props.value\r\n  const idValue = value.DonorID || \"\"// GetDonorID(value.DonorID, value.MockDonorID, props.unmaskDonorId)\r\n  const idTitle = GetDonorIDTitle(value.DonorID, value.MockDonorID, props.unmaskDonorId)\r\n  return (\r\n    <Row><Col>{idRow(idValue, idType(value.IDType), idTitle)}</Col></Row>\r\n  )\r\n}\r\n\r\nconst PageSize = 40\r\n\r\ntype ReportProps = {\r\n  canView: boolean\r\n  canDownload: boolean\r\n  MROReport: boolean\r\n  MROStage: string\r\n}\r\n\r\nexport class OrderTracking extends React.PureComponent<OrderTrackingProps, OrderTrackingState> {\r\n  subscription?: Subscription\r\n  searchFieldsSubscription?: Subscription\r\n  loadImageSubscription?: Subscription\r\n  loadReportSubscription?: Subscription\r\n  watchSubscription?: Subscription\r\n  resolveSubscription?: Subscription\r\n\r\n  state: OrderTrackingState = {\r\n    loading: false,\r\n    data: undefined,\r\n    columns: loadCustomized(StorageKey.OrderTrackingGridColumns, defaultColumns) as Column[],\r\n    showStatusModal: false,\r\n    searchField: \"\",\r\n    searchText: \"\",\r\n    showArchivedOrders: false,\r\n    showExportOptions: false,\r\n    sort: undefined,\r\n    filters: [],\r\n    pageNumber: 1,\r\n    selectedTests: [],\r\n    customizeModal: false,\r\n    completeModal: false,\r\n    statusInfo: false,\r\n    employeeDetails: false,\r\n    eventDetails: false,\r\n    updatingWatchList: false,\r\n    resolving: false,\r\n    showAuthFormModal: false,\r\n    showResendAuth: false,\r\n    showOrderEditModal: false,\r\n    eventCompare: false,\r\n    showMergeEvent: false,\r\n    printing: false,\r\n    showSelectClinicEmail: false\r\n  }\r\n\r\n  gridRef = React.createRef<HTMLTableElement>()\r\n\r\n  componentDidMount() {\r\n    this.refreshGrid()\r\n    this.searchFieldsSubscription = SearchFieldsGet().subscribe(\r\n      (data: SearchField[]) => this.setState({ searchFields: data }),\r\n      error => toast.error(error)\r\n    )\r\n  }\r\n\r\n  componentWillUnmount() {\r\n    this.subscription && this.subscription.unsubscribe()\r\n    this.searchFieldsSubscription && this.searchFieldsSubscription.unsubscribe()\r\n    this.loadImageSubscription && this.loadImageSubscription.unsubscribe()\r\n    this.loadReportSubscription && this.loadReportSubscription.unsubscribe()\r\n    this.watchSubscription && this.watchSubscription.unsubscribe()\r\n    this.resolveSubscription && this.resolveSubscription.unsubscribe()\r\n  }\r\n\r\n  componentDidUpdate(prevProps: OrderTrackingProps, prevState: OrderTrackingState) {\r\n    if (this.state.searchField !== prevState.searchField ||\r\n      this.state.searchText !== prevState.searchText ||\r\n      this.state.showArchivedOrders !== prevState.showArchivedOrders ||\r\n      this.state.sort !== prevState.sort ||\r\n      this.state.filters !== prevState.filters ||\r\n      this.state.pageNumber !== prevState.pageNumber) {\r\n      this.refreshGrid()\r\n    }\r\n  }\r\n\r\n  refreshGrid() {\r\n    this.setState({ loading: true })\r\n    this.subscription && this.subscription.unsubscribe()\r\n    this.subscription = ResultsGridObservable({\r\n      field: this.state.searchField,\r\n      text: this.state.searchText,\r\n      complete: this.state.showArchivedOrders,\r\n      sort: this.state.sort,\r\n      filters: this.state.filters,\r\n      pageNumber: this.state.pageNumber,\r\n      pageSize: PageSize,\r\n      includeArchived: this.state.showArchivedOrders,\r\n    }, this.props.isPortalAdmin ? 0 : AccountTypeID).subscribe(\r\n      (data: OrderResultGridResponse) => this.setState({ data: data, loading: false, selectedTests: [] }),\r\n      error => {\r\n        this.setState({ loading: false })\r\n        toast.error(error)\r\n      }\r\n    )\r\n  }\r\n\r\n  pageChanged = (pageNumber: number) => {\r\n    this.setState({ pageNumber: pageNumber })\r\n  }\r\n  checkArchivedOrders(e: React.ChangeEvent<HTMLInputElement>) {\r\n    this.setState({ showArchivedOrders: e.target.checked, pageNumber: 1 })\r\n  }\r\n  sortGrid(column: string, order?: string) {\r\n    this.setState({ sort: { column: column, order: order || \"\" }, pageNumber: 1 })\r\n  }\r\n  filterGrid(column: string, items: string[]) {\r\n    this.setState(prevState => {\r\n      const filters = [...prevState.filters]\r\n      const filter = { column: column, values: items }\r\n      let index = filters.findIndex(item => item.column === filter.column)\r\n      if (index >= 0) {\r\n        filters[index] = filter\r\n      } else {\r\n        filters.push(filter)\r\n      }\r\n      return { filters: filters, pageNumber: 1 }\r\n    })\r\n  }\r\n  onSearch(searchField?: string, searchText?: string) {\r\n    this.setState({ searchField: searchField || \"\", searchText: searchText || \"\", pageNumber: 1 })\r\n  }\r\n  onExportClick() {\r\n    this.setState({ showExportOptions: true })\r\n  }\r\n\r\n  generateCCFImage = (image: RAImage, row: OrderResultRecord, canDownload: boolean) => {\r\n    if (!canDownload) return\r\n    this.loadImageSubscription && this.loadImageSubscription.unsubscribe()\r\n    const data = {\r\n      TestImageID: image.RAImageID,\r\n      TestDetailID: row.TestDetailID,\r\n      TestDetailClinicalID: row.TestDetailClinicalID || \"\",\r\n      IsMarketPlace: true,\r\n      TestDescription: image.Description\r\n    }\r\n\r\n    this.loadImageSubscription = ImageGet(data).subscribe(\r\n      (data: ImageData) => this.processCCF(data),\r\n      (error) => this.handleAPIError(error, {})\r\n    )\r\n  }\r\n\r\n  isMroLetter = (item: RAImage) => item.Description == \"MroLetter\"\r\n  isMroLetterRow = (row: OrderResultRecord) => row.RAImage?.filter(this.isMroLetter).length ?? 0 > 0 // assume there would be no multiple MRO images\r\n\r\n  isMroCopy = (item: RAImage) => {\r\n    if (!item.Description) {\r\n      return false\r\n    }\r\n    const desc = item.Description.toLowerCase()\r\n    return desc == \"mrocopy\"\r\n  }\r\n  isMroCopyRow = (row: OrderResultRecord) => {\r\n    const mroImages = row.RAImage?.filter(this.isMroCopy)\r\n    return (mroImages?.length ?? 0 > 0) // assume there would be no multiple MRO images\r\n  }\r\n\r\n  printMROReport = (row: OrderResultRecord) => {\r\n    this.loadReportSubscription && this.loadReportSubscription.unsubscribe()\r\n\r\n    const method = this.isMroLetterRow(row) ? GetMROLetter : GenerateMROReport\r\n\r\n    this.loadReportSubscription = method(row.TestDetailID).subscribe(\r\n      (data) => this.processReport(data),\r\n      (error) => this.handleAPIError(error, {})\r\n    )\r\n  }\r\n\r\n  processCCF = (data: ImageData) => {\r\n    if (data && data.Base64String) {\r\n      const currentDate = new Date()\r\n      data.Base64String.forEach((item, index) => {\r\n        const type = item.ImageType\r\n        const fileName = FormatTimestampFileName(\"CCF_Image_Report\" + index, type.split('/')[1], currentDate)\r\n        const fileData = new Blob([FormatData(item.Base64Strings)], { type: type || data.ImageType })\r\n        var fileURL = URL.createObjectURL(fileData)\r\n        window.open(fileURL)\r\n      })\r\n    } else {\r\n      toast.error(\"Service is not able to return CCF image for this record.\")\r\n    }\r\n  }\r\n\r\n  processReport = (data: string) => {\r\n    if (data && data !== \"\") {\r\n      const fileName = FormatTimestampFileName(this.props.implementationType === ImplementationTypeGovt ? \"POCT_Report_\" : \"MRO_Report_\", \"pdf\", new Date())\r\n      const fileData = new Blob([FormatData(data)], { type: \"application/pdf\" })\r\n      var fileURL = URL.createObjectURL(fileData)\r\n      window.open(fileURL)\r\n    } else {\r\n      toast.error(\"Data not found.\")\r\n    }\r\n  }\r\n\r\n  handleAPIError = (error: Error | APIError, stateChanges: object) => {\r\n    this.setState(stateChanges)\r\n    error && toast.error((error as APIError)?.errorData?.message || error.message)\r\n  }\r\n\r\n  handleAllTestDetailChange(e: React.ChangeEvent<HTMLInputElement>) {\r\n    const selectedTests = e.target.checked && this.state.data && this.state.data.Records\r\n      ? this.state.data.Records\r\n        .map((rows: OrderResultRecord[]) => rows\r\n          .map((row: OrderResultRecord) => ({ TestDetailID: row.TestDetailID, TestDetailClinicalID: row.TestDetailClinicalID, Archived: row.Reviewed })\r\n          ))\r\n      : []\r\n    this.setState({ selectedTests: selectedTests.reduce((acc, val) => acc.concat(val), []) })\r\n  }\r\n\r\n  handleTestDetailChange = (row: OrderResultRecordIdentifier, checked: boolean) => {\r\n    let selectedRows = [...this.state.selectedTests]\r\n\r\n    const index = selectedRows.findIndex(item => item.TestDetailID === row.TestDetailID && item.TestDetailClinicalID === row.TestDetailClinicalID)\r\n    if (index > -1) {\r\n      selectedRows = [...selectedRows.slice(0, index), ...selectedRows.slice(index + 1)]\r\n    } else {\r\n      selectedRows.push(row)\r\n    }\r\n    this.setState({ selectedTests: selectedRows })\r\n  }\r\n\r\n  selectedReports = () => {\r\n    return this.selectedResults().filter(r => this.iconsVisibility(r).MROReport).map(t => t.TestDetailID)\r\n  }\r\n\r\n  onPrintRecords = () => {\r\n    this.setState({ printing: true })\r\n    OrderResultsPrint({\r\n      field: this.state.searchField,\r\n      text: this.state.searchText,\r\n      filters: this.state.filters,\r\n      print: this.state.selectedTests,\r\n    }, this.props.isPortalAdmin ? 0 : AccountTypeID).subscribe(\r\n      (data: string) => {\r\n        printPdf(data)\r\n        this.setState({ printing: false })\r\n      },\r\n      error => this.handleAPIError(error, { printing: false })\r\n    )\r\n  }\r\n\r\n  onPrintReports = () => {\r\n    this.loadReportSubscription && this.loadReportSubscription.unsubscribe()\r\n    this.setState({ printing: true })\r\n    this.loadReportSubscription = GenerateMROReport(this.selectedReports().join(';')).subscribe(\r\n      (data: string) => {\r\n        this.processReport(data)\r\n        this.setState({ printing: false })\r\n      },\r\n      error => this.handleAPIError(error, { printing: false })\r\n    )\r\n  }\r\n\r\n  onOrderUpdated = () => {\r\n    const formFoxVendoAN = this.state.details?.FormFoxVendorAN || 0\r\n    if (formFoxVendoAN > 0) {\r\n      this.setState({ showOrderEditModal: false, showAuthFormModal: false, eventDetails: false, showResendAuth: true, showSelectClinicEmail: false })\r\n    } else {\r\n      this.setState({ showOrderEditModal: false, showAuthFormModal: false, eventDetails: false, showResendAuth: false, showSelectClinicEmail: true })\r\n    }\r\n  }\r\n\r\n  onCloseResend = () => {\r\n    this.setState({ showResendAuth: false, details: undefined })\r\n    this.refreshGrid()\r\n  }\r\n  onCloseResendEmail = () => {\r\n    this.setState({ showSelectClinicEmail: false, details: undefined })\r\n    this.refreshGrid()\r\n  }\r\n\r\n  handleWatchClick = () => {\r\n    this.setState({ updatingWatchList: true })\r\n    this.watchSubscription && this.watchSubscription.unsubscribe()\r\n    this.watchSubscription = ResultsWatchObservable(\r\n      this.selectedResults().map(item => item.TestEventID),\r\n      this.props.LoginName\r\n    ).subscribe(\r\n      data => {\r\n        this.setState({ updatingWatchList: false })\r\n        toast.success(data)\r\n        this.refreshGrid()\r\n      },\r\n      error => this.handleAPIError(error, { updatingWatchList: false })\r\n    )\r\n  }\r\n\r\n  handleResolveClick = () => {\r\n    const testData = this.selectedResults()?.map(test => ({\r\n        TestEventID: test.TestEventID,\r\n        AlertResolved: false,\r\n        WatchResolved: true,\r\n        TimingAlertResolved: false,\r\n        ResultsAcknowledged: false\r\n      })\r\n    )\r\n    this.setState({ resolving: true })\r\n    this.resolveSubscription = ResultsResolveObservable(testData, this.props.LoginName).subscribe(\r\n      data => {\r\n        this.setState({ resolving: false })\r\n        toast.success(data)\r\n        this.refreshGrid()\r\n      },\r\n      error => this.handleAPIError(error, { resolving: false })\r\n    )\r\n  }\r\n\r\n  showStatusModal = (data: OrderResultRecord) => this.setState({ statusInfo: true, details: data })\r\n  showEmployeeDetails = (data: OrderResultRecord) => this.setState({ employeeDetails: true, details: data })\r\n  showEventDetailsModal = (data: OrderResultRecord) => {\r\n    this.setState({ eventDetails: true, details: data })\r\n  }\r\n  showEventDetailsCompareModal = (data: OrderResultRecord) => {\r\n    this.setState({ eventCompare: true, details: data })\r\n  }\r\n  showAuthFormModal = (data: OrderResultRecord) => {\r\n    if (data.FormFoxVendorAN > 0) {\r\n      this.setState({ showAuthFormModal: true, showResendAuth: false, details: data, showSelectClinicEmail: false })\r\n    } else {\r\n      this.setState({ showAuthFormModal: false, showResendAuth: false, details: data, showSelectClinicEmail: true })\r\n    }\r\n  }\r\n  showOrderEditModal = (data: OrderResultRecord) => this.setState({ showOrderEditModal: true, details: data })\r\n  visibleColumns = () => this.state.columns.filter(col => col.visible)\r\n  renderCell = (row: OrderResultRecord, colName: keyof OrderResultRecord, key: number, isFirstRow: boolean, isLastRow: boolean, prevRow?: OrderResultRecord) => {\r\n    switch (colName) {\r\n      case \"DonorID\":\r\n        return <td key={key} className={`align-text-top group-cell ${isFirstRow ? \"first\" : \"\"} ${isLastRow ? \"last\" : \"\"}`} style={{ whiteSpace: \"nowrap\" }} onClick={() => this.showEmployeeDetails(row)}>\r\n          {isFirstRow && <GridIDNumber value={row} unmaskDonorId={this.props.unmaskDonorId} />}\r\n        </td>\r\n      case \"DonorName\":\r\n        return <td key={key} className={`align-text-top group-cell ${isFirstRow ? \"first\" : \"\"} ${isLastRow ? \"last\" : \"\"}`} style={{whiteSpace: \"nowrap\"}}>{isFirstRow && row[colName]}</td>\r\n      case \"Service\":\r\n        const showImageAlert = row.MockMergeFrom > 0 && row.MockTestEventAlertID > 0 && row.Alert && !row.AlertResolved\r\n        const showImageAlertResolved = row.MockMergeFrom > 0 && row.MockTestEventAlertID > 0 && row.Alert && row.AlertResolved\r\n        return <td key={key} className=\"align-text-top\">\r\n          <div style={{ display: 'flex', width: '100%', whiteSpace: \"nowrap\" }}>\r\n            <Button variant=\"underline-link\" onClick={() => this.showEventDetailsModal(row)}>{row[colName]}</Button>\r\n            {showImageAlert && <img onClick={() => this.showEventDetailsCompareModal(row)} src={ImageAlert} alt={row.MergeFrom} title={row.MergeFrom} width=\"20px\" height=\"20px\" />}\r\n            {showImageAlertResolved && <img src={ImageAlertResolved} alt={row.MergeFrom} title={row.MergeFrom} width=\"20px\" height=\"20px\" />}\r\n          </div>\r\n        </td>\r\n      case \"Status\":\r\n        return <td key={key} onClick={() => this.showStatusModal(row)} className=\"status-data align-text-top\" style={{whiteSpace: \"nowrap\"}}>\r\n          <GridStatusInfo value={row} showCompleteOrders={this.state.showArchivedOrders} />\r\n        </td>\r\n      case \"SiteName\":\r\n        return <td key={key} className=\"align-text-top\" style={{whiteSpace: \"nowrap\"}}>{row.SiteID ? `${row.SiteName} (${row.SiteID})` : row.Clinics ? row.Clinics : \"\"}</td>\r\n      case \"OrderedDate\":\r\n      case \"EventDate\":\r\n      case \"OrderUpdatedAt\":\r\n        return <td key={key} className=\"align-text-top\" style={{whiteSpace: \"nowrap\"}}>{FormatDate(row[colName])}</td>\r\n      case \"DOT\":\r\n        return <td key={key} className=\"align-text-top\" style={{whiteSpace: \"nowrap\"}}>{row[colName] ? \"Yes\" : \"No\"}</td>\r\n      case \"RAImageID\":\r\n        const iconsVisibility = this.iconsVisibility(row)\r\n        return <td key={key} className=\"align-text-top\" style={{whiteSpace: \"nowrap\"}}>\r\n          {iconsVisibility.canView ? this.mapCCFImages(row, iconsVisibility.canDownload) : \"\"}\r\n          {iconsVisibility.MROReport ? this.mapMROReport(row, iconsVisibility.MROStage) : \"\"}\r\n        </td>\r\n      case \"FormFoxTestAN\":\r\n        const isShowValue = (prevRow === undefined) || (prevRow && ((prevRow.PersonID !== row.PersonID) || (prevRow.FormFoxTestAN !== row.FormFoxTestAN)))\r\n        return <td key={key} className={`align-text-top group-cell ${isFirstRow || isShowValue? \"first\" : \"\"} ${isLastRow ? \"last\" : \"\"}`}>\r\n          <FormFoxTestANColumn row={row} prevRow={prevRow} showAuthFormModal={this.showAuthFormModal} />\r\n        </td>\r\n      case \"Result\":\r\n        return <td key={key} className=\"align-text-top\" style={{whiteSpace: \"nowrap\"}}>{this.getResultText(row)}</td>\r\n      case \"Reason\":\r\n        return <td key={key} className=\"align-text-top\" style={{whiteSpace: \"nowrap\"}}><ReasonForTestCell row={row}/></td>\r\n      default:\r\n        return <td key={key} className=\"align-text-top\" style={{whiteSpace: \"nowrap\"}}>{row[colName] === \"N/P\" ? \"Not Provided\" : row[colName]}</td>\r\n    }\r\n  }\r\n\r\n  getResultText = (row: OrderResultRecord) => {\r\n    const result = row.Result || \"\"\r\n    if (this.props.implementationType !== ImplementationTypeGovt) {\r\n      return result\r\n    }\r\n    if (row.TestType !== ServiceTypeCode.Drug) {\r\n      return result\r\n    }\r\n    if (result.toLowerCase() !== \"positive\") {\r\n      return result\r\n    }\r\n    if (row.EventType.startsWith(\"QT\") || row.Service.includes('POCT')) {\r\n      return \"POC-\" + result\r\n    }\r\n    return result\r\n  }\r\n\r\n  iconsVisibility = (row: OrderResultRecord): ReportProps => {\r\n    let result: ReportProps = { canView: false, canDownload: false, MROReport: false, MROStage: \"\" }\r\n\r\n    if (this.isMroLetterRow(row)) {\r\n      result.MROReport = true\r\n    }\r\n    if (this.isMroCopyRow(row)) {\r\n      result.MROReport = true\r\n    }\r\n    if (this.props.implementationType === ImplementationTypeGovt) {\r\n      if (row.TestType === ServiceTypeCode.Drug && row.Service.includes('POCT') && !!row.DateCollected) {\r\n        result.MROReport = true\r\n        result.MROStage = \"POCT Letter Report\"\r\n      }\r\n      // Display all available images in OnTrack with no restrictions\r\n      result.canView = true\r\n      result.canDownload = true\r\n    }\r\n    else {\r\n      row.Stages.forEach((stage) => {\r\n        if (row.TestType === ServiceTypeCode.Drug && stage.Sequence === 6) {\r\n          result.canView = true\r\n          result.canDownload = this.props.canVieweCCFCopy2PreMRO || false\r\n          result.MROReport = stage.Status === 1\r\n          result.MROStage = stage.Name\r\n        }\r\n        if (\r\n          row.TestType === ServiceTypeCode.Drug\r\n          && row.MROResultID === 0\r\n          && [TestReleaseStatusID.LaboratoryTestingComplete, TestReleaseStatusID.LaboratoryTestingCompleteReleased].includes(row.TestReleaseStatusID)\r\n          && stage.Sequence === 6\r\n          && ((row.LabResultID === 3 && !row.MRONonDOTNeg) || (row.LabResultID !== 3 && !row.MRONonDOTPos))\r\n        ) {\r\n          result.canView = true\r\n          result.canDownload = this.props.canVieweCCFCopy2PreMRO || false\r\n          result.MROReport = true\r\n          result.MROStage = \"Laboratory Report\"\r\n        }\r\n\r\n        if (row.TestType === ServiceTypeCode.Drug &&\r\n          (row.IsPOCT || row.IsFLEX) &&\r\n          row.MROResultID === 0 && row.LabResultID === 0\r\n          && (row.TestReleaseStatusID === TestReleaseStatusID.PoctComplete\r\n            || row.TestReleaseStatusID === TestReleaseStatusID.PoctCompleteReleased)\r\n          && stage.Sequence === 3 && row.Result === \"Negative\") {\r\n          result.canView = true\r\n          result.canDownload = this.props.canVieweCCFCopy2PreMRO || false\r\n          result.MROReport = true\r\n          result.MROStage = \"POCT Report\"\r\n        }\r\n\r\n        if (row.TestType === ServiceTypeCode.Alcohol && (stage.Sequence === 3 || stage.Sequence === 4)) {\r\n          result.canView = true\r\n          result.canDownload = true\r\n        }\r\n        if (row.TestType === ServiceTypeCode.Physical) {\r\n          if (stage.Sequence === 3) {\r\n            result.canView = true\r\n            result.canDownload = true\r\n          }\r\n        } else if (row.ServiceTypeCode === ServiceTypeCode.OHS) {\r\n          if (stage.Sequence === 1 && (row.TestType === TestTypes.CRLCovidClearAntibody || row.TestType === TestTypes.CRLRapidResponseCovid)) {\r\n            result.canView = true\r\n            result.canDownload = true\r\n          } else if (stage.Sequence === 3) {\r\n            result.canView = true\r\n            result.canDownload = true\r\n          }\r\n        }\r\n        if (row.ServiceTypeCode === ServiceTypeCode.CHS)  {\r\n          result.canView = true\r\n          result.canDownload = true\r\n        }\r\n      })\r\n    }\r\n    return result\r\n  }\r\n\r\n  ccfImageDescription = (row: OrderResultRecord, item: RAImage) => {\r\n    if (row.IsFLEX) {\r\n      const upDescription = item.Description.toUpperCase()\r\n      if (upDescription === \"MROCOPY\") {\r\n        return \"COPY2\"\r\n      }\r\n    }\r\n    //return row.IsFLEX && item.Description.toUpperCase() == \"COPY2\" ? \"Instant Test Results Report\" : item.Description\r\n    return item.Description\r\n  }\r\n\r\n  isPositiveFlexInstantReport = (row: OrderResultRecord, item: RAImage) => {\r\n    return row.IsFLEX && row.Result == \"Positive\" && item.Description == \"COPY2\"\r\n  }\r\n  mapCCFImages = (row: OrderResultRecord, canDownload: boolean) => {\r\n    const imgSrc = row.ServiceTypeCode === ServiceTypeCode.OHS ? ImageOHS : ImageCCF\r\n    return row.RAImage?.filter(i => !this.isMroLetter(i)).filter(i => !this.isPositiveFlexInstantReport(row, i)).map((item: RAImage) => <img key={item.RAImageID} onClick={() => this.generateCCFImage(item, row, canDownload)} src={imgSrc} alt={this.ccfImageDescription(row, item)} title={this.ccfImageDescription(row, item)} />)\r\n  }\r\n\r\n  mapMROReport = (row: OrderResultRecord, title: string) => <img onClick={() => this.printMROReport(row)} src={ImageMRO} alt={title} title={title} />\r\n\r\n  selectedIdentifierByRow = (row: OrderResultRecord) => this.state.selectedTests.find(item => row.TestDetailID === item.TestDetailID && row.TestDetailClinicalID === item.TestDetailClinicalID)\r\n  flattenResults = () => (this.state.data?.Records || []).reduce((acc, val) => acc.concat(val), [])\r\n  selectedResults = () => this.flattenResults().filter(row => !!this.selectedIdentifierByRow(row))\r\n\r\n  hideMergeEvent = () => {\r\n    this.setState({ showMergeEvent: false })\r\n  }\r\n\r\n  onMergeEvent = () => {\r\n    this.setState({ showMergeEvent: true })\r\n  }\r\n\r\n  render() {\r\n    const testsSelected = this.state.selectedTests.length > 0\r\n    const firstSelectedArchived = testsSelected && !!this.state.selectedTests[0].Archived\r\n    const headerColumns = this.visibleColumns().map((col: Column, i) => {\r\n      return (\r\n        <th key={i}>\r\n          {this.state.data && col.filter && col.filter in this.state.data && <ColumnHeaderFilter title={col.label || col.name}\r\n            filtered={this.state.filters.findIndex(item => item.column === col.filter) >= 0}\r\n            sort={this.state.sort && this.state.sort.column === col.name ? this.state.sort.order === \"asc\" ? \"asc\" : \"desc\" : undefined}\r\n            items={this.state.data[col.filter as keyof ColumnFilters] || []}\r\n            itemValueLabels={{ \"N/P\": \"Not Provided\" }}\r\n            onSort={(order?: string) => this.sortGrid(col.name, order)}\r\n            onFilter={(items: string[]) => col.filter && this.filterGrid(col.filter, items)}\r\n            offsetTop={19}\r\n          />}\r\n          {(!this.state.data || !col.filter) && (col.label || col.name)}\r\n        </th>\r\n      )\r\n    })\r\n    const hasTestErrors = (row: OrderResultRecord) => false; //row.PersonID === 0 || row.CompanyID === 0 \r\n\r\n    const dataColumns = (row: OrderResultRecord, isFirstRow: boolean, isLastRow: boolean, prevRow?: OrderResultRecord) => this.visibleColumns().map((col, i) => this.renderCell(row, col.name as keyof OrderResultRecord, i, isFirstRow, isLastRow, prevRow))\r\n    const printCell = (row: OrderResultRecord, implementationType: string) => {\r\n      const identifier = this.selectedIdentifierByRow(row)\r\n      \r\n      return (\r\n        <td\r\n          style={{ justifyContent: 'center', alignItems: 'center', verticalAlign: 'middle'}}\r\n          key={`print-${row.TestDetailID}-${row.TestDetailClinicalID}`}\r\n        >\r\n          <OrderTrackingCheckbox\r\n            idPrefix=\"td\"\r\n            item={identifier || { TestDetailID: row.TestDetailID, TestDetailClinicalID: row.TestDetailClinicalID, Archived: row.Reviewed }}\r\n            row={row}\r\n            implementationType={implementationType}\r\n            checked={!!identifier}\r\n            disabled={testsSelected && ((!row.Reviewed && firstSelectedArchived) || (row.Reviewed && !firstSelectedArchived))}\r\n            onChange={this.handleTestDetailChange}\r\n          />\r\n        </td>\r\n      )\r\n    }\r\n    const groupedRows = (data: OrderResultGridResponse) => data.Records.map((rows: OrderResultRecord[]) => dataRows(rows))\r\n    \r\n    const dataRows = (rows: OrderResultRecord[]) => rows.map((row: OrderResultRecord, i: number) =>\r\n      <tr key={i} className={this.props.implementationType !== ImplementationTypeGovt && hasTestErrors(row) ? \"bg-row-highlight\" : undefined}>\r\n        {printCell(row, this.props.implementationType)}\r\n        {this.props.implementationType !== ImplementationTypeGovt && <WatchCell row={row} />}\r\n        {dataColumns(row, i === 0, i === rows.length - 1, (i > 0 ? rows[i - 1] : undefined))}\r\n      </tr>)\r\n\r\n    const { loading, data, columns, showStatusModal, searchField, searchText, showAuthFormModal, showResendAuth,\r\n      showOrderEditModal, showArchivedOrders, sort, filters, pageNumber, selectedTests, showExportOptions,\r\n      customizeModal, completeModal, searchFields, statusInfo, employeeDetails,\r\n      updatingWatchList, resolving,\r\n      eventDetails, details, eventCompare, showMergeEvent, showSelectClinicEmail } = this.state\r\n\r\n    const emptyRow = <tr><td colSpan={this.visibleColumns().length + 2}>NO DATA FOUND</td></tr>\r\n    const allPrintChecked = !loading && !!data?.Records?.length && this.flattenResults().length === selectedTests.length\r\n    return (\r\n      <AppPageWrapper parentClassName={\"align-items-center\"} showNav={true}>\r\n        <Container fluid className=\"grid-container pt-2\">\r\n          <Row>\r\n            <Col className=\"px-0 pb-2\">\r\n              <Checkbox checked={showArchivedOrders} onChange={(e) => this.checkArchivedOrders(e)} label=\"Show Archived Orders\" id=\"showCompletedOrders\" />\r\n            </Col>\r\n          </Row>\r\n          <Row className=\"pb-2\">\r\n            <Col className=\"px-0\">\r\n              <SearchBar allowBlank searchFields={searchFields || []} onSearch={(searchField?: string, searchText?: string) => { this.onSearch(searchField, searchText) }} formatValue={(id, value) => id === \"SSN\" ? FormatSSN(value) : value} />\r\n            </Col>\r\n            <Col lg={6} className=\"text-right p-0\">\r\n              {testsSelected && this.props.canCompleteEvents && <Button variant=\"secondary\" size=\"sm\" className=\"mr-1\" onClick={() => this.setState({ completeModal: true })} >{firstSelectedArchived ? \"UNARCHIVE\" : \"ARCHIVE\"}</Button>}\r\n              <ActionButton variant=\"secondary\" size=\"sm\" className=\"mr-1\" onClick={this.handleWatchClick} disabled={selectedTests.length === 0} spin={updatingWatchList} disableOnSpin>WATCH</ActionButton>\r\n              <ActionButton variant=\"secondary\" size=\"sm\" className=\"mr-1\" onClick={this.handleResolveClick} disabled={selectedTests.length === 0} spin={resolving} disableOnSpin>RESOLVE</ActionButton>\r\n              <Button variant=\"secondary\" size=\"sm\" className=\"mr-1\" onClick={() => this.setState({ customizeModal: true })}>CUSTOMIZE</Button>\r\n              <Button variant=\"secondary\" size=\"sm\" className=\"mr-1\" onClick={() => this.onExportClick()}>\r\n                EXPORT CSV&nbsp;\r\n                <FaFileCsv />\r\n              </Button>\r\n              <Button variant=\"secondary\" size=\"sm\" className=\"mr-1\" onClick={() => this.setState({ filters: [] })}>CLEAR FILTERS&nbsp;<FaSync /></Button>\r\n              {this.props.implementationType === ImplementationTypeGovt && <Button variant=\"secondary\" size=\"sm\" className=\"mr-1\" onClick={() => this.refreshGrid()}>REFRESH&nbsp;<FaSync /></Button>}\r\n              {showExportOptions &&\r\n                <ExportCSVModal\r\n                  onClose={() => this.setState({showExportOptions: false})}\r\n                  isPortalAdmin={this.props.isPortalAdmin}\r\n                  searchParams={{field: this.state.searchField, text: this.state.searchText, sort: this.state.sort, filters: this.state.filters}}\r\n                />}\r\n              {statusInfo && details && <ModalStatusInfo details={details} onHide={() => this.setState({ statusInfo: false })} />}\r\n              {showAuthFormModal && details && <ConnectedAuthFormModal details={details} onEdit={this.showOrderEditModal} onHide={() => this.setState({ showAuthFormModal: false, details: undefined })} />}\r\n              {showResendAuth && details && <ConnectedAuthFormModal details={details} isAfterUpdate onHide={this.onCloseResend} />}\r\n              {showSelectClinicEmail && details && <SendSelectClinicLink details={details} isAfterUpdate onHide={this.onCloseResendEmail} />}\r\n              {showOrderEditModal && details && <OrderEditModal\r\n                details={details}\r\n                onHide={() => this.setState({ showOrderEditModal: false })}\r\n                onOrderUpdated={this.onOrderUpdated} />}\r\n              {employeeDetails && details && <EmployeeDetailsModal\r\n                showService\r\n                details={details}\r\n                personID={details.PersonID}\r\n                name={details.DonorName}\r\n                id={details.DonorID || details.SSN}\r\n                onHide={(updated) => this.setState({ employeeDetails: false }, () => updated && this.refreshGrid())}\r\n                isGov={this.props.implementationType === ImplementationTypeGovt}\r\n              />}\r\n              {eventDetails && details && <EventDetailsModal\r\n                details={details}\r\n                onRefreshGrid={() => this.refreshGrid()}\r\n                onHide={(updated) => this.setState({ eventDetails: false }, () => updated && this.onOrderUpdated())}\r\n                onMerge={this.onMergeEvent} />}\r\n              {eventCompare && details && <EventDetailsCompare details={details} onRefreshGrid={() => this.refreshGrid()} onHide={() => this.setState({ eventCompare: false })} />}\r\n              <ColumnsCustomizeModal show={customizeModal}\r\n                columns={columns}\r\n                storeKey={StorageKey.OrderTrackingGridColumns}\r\n                onClose={() => this.setState({ customizeModal: false })}\r\n                onSave={(columns) => this.setState({ columns: columns as Column[], customizeModal: false })} />\r\n              {completeModal && <CompleteModal\r\n                unarchive={firstSelectedArchived}\r\n                show={completeModal}\r\n                onHide={() => this.setState({ completeModal: false })}\r\n                onSave={() => this.refreshGrid()}\r\n                selectedTests={this.selectedResults().map(item => ({ TestEventID: item.TestEventID, TestDetailID: item.TestDetailID, TestDetailClinicalID: item.TestDetailClinicalID || \"\", PersonID: item.PersonID, HireDate: undefined, PoolID: null, Images: [], DonorName: item.DonorName, AuthorizationID: item.FormFoxTestAN }))}\r\n              />}\r\n              {showMergeEvent && details &&\r\n                <SearchTestToMerge\r\n                  details={details} onHide={this.hideMergeEvent}\r\n                />}\r\n            </Col>\r\n          </Row>\r\n          <Row>\r\n            <Col className=\"px-0\">\r\n              <HorizontalScrollWrapper\r\n                gridRef={this.gridRef}\r\n                recalculateWidth={!loading && !customizeModal}\r\n                visible={this.state.data && this.state.data?.Total > 0}\r\n                offsetVertical={330}\r\n              >\r\n                <Table bordered className=\"mb-0\" ref={this.gridRef}> \r\n                  <thead>\r\n                    <tr>\r\n                      <th className=\"text-center print-column\">\r\n                        {!showArchivedOrders && <Checkbox id=\"printSelectAll\" checked={allPrintChecked} onChange={(e) => this.handleAllTestDetailChange(e)} />}\r\n                        <PrintFormModal\r\n                          disabled={selectedTests.length === 0}\r\n                          hasReports={this.selectedReports().length > 0}\r\n                          printing={this.state.printing}\r\n                          onPrintRecords={() => this.onPrintRecords()}\r\n                          onPrintReports={() => this.onPrintReports()}\r\n                        />\r\n                      </th>\r\n                      {this.props.implementationType !== ImplementationTypeGovt && <th className=\"alert-icons\">WATCH</th>}\r\n                      {headerColumns}\r\n                    </tr>\r\n                  </thead>\r\n                  <tbody>\r\n                    {\r\n                      loading ?\r\n                        <tr>\r\n                          <td colSpan={this.visibleColumns().length + 2} className=\"align-middle text-center\">\r\n                            <div className=\"d-flex justify-content-center text-secondary\" style={{ width: \"100vw\" }}>\r\n                              <Spinner animation=\"border\" variant=\"secondary\" role=\"status\" className=\"mr-2\" />\r\n                              <span>Loading...</span>\r\n                            </div>\r\n                          </td>\r\n                        </tr> :\r\n                        data?.Records && data.Records.length > 0 ? groupedRows(data) : emptyRow\r\n                    }\r\n                  </tbody>\r\n                </Table>\r\n              </HorizontalScrollWrapper>\r\n            </Col>\r\n          </Row>\r\n          {!loading && data && (\r\n            <Row>\r\n              <Col>\r\n                <span className=\"total-records\">Total records: {data.Total}</span>\r\n                <TablePagination pageNumber={pageNumber} pages={data.Pages} onChange={this.pageChanged} />\r\n              </Col>\r\n            </Row>\r\n          )}\r\n        </Container>\r\n      </AppPageWrapper>\r\n    )\r\n  }\r\n}\r\n\r\nfunction mapStateToProps(state: AppState): OrderTrackingProps {\r\n  const getImplementationType = () => sessionStorage.getItem(\"implementationType\") || \"\"\r\n  const userAccess = BuildUserAccess(state)\r\n  const portal = GetSelectedPortal(state)\r\n  const unmaskDonorId = portal ? portal.UnmaskDonorID : 0\r\n  return {\r\n    isPortalAdmin: isPortalAdmin(state),\r\n    canCompleteEvents: userAccess.canCompleteEvents,\r\n    canVieweCCFCopy2PreMRO: userAccess.canVieweCCFCopy2PreMRO,\r\n    LoginName: getLoggedInUserName(state),\r\n    implementationType: getImplementationType(),\r\n    unmaskDonorId: unmaskDonorId,\r\n  }\r\n}\r\nconst ConnectedRandomPools = connect(mapStateToProps, null)(OrderTracking)\r\nexport default ConnectedRandomPools\r\n","import * as React from \"react\"\r\nimport { AppPageWrapper } from \"../NavMenu/AppPageWrapper\"\r\nimport SiteSearch from \"./SiteSearch\"\r\n\r\nexport default class SiteSearchPage extends React.PureComponent {\r\n  render() {\r\n    return <AppPageWrapper parentClassName={\"align-items-center\"} showNav>\r\n      <SiteSearch />\r\n    </AppPageWrapper>\r\n  }\r\n}\r\n","import {Component} from \"react\"\r\nimport {Button, Form, Modal} from \"react-bootstrap\"\r\nimport {toast} from \"react-toastify\"\r\nimport { Subscription } from \"rxjs\"\r\nimport { APIError } from \"../../api/ObservableFromFetch\"\r\nimport UserPasswordReset from \"../../api/Administration/UserPasswordReset\"\r\nimport { EmailRegexp } from \"../../config/Constants\"\r\n\r\ninterface ForgotPasswordProps{\r\n  userName?: string\r\n}\r\n\r\ninterface ForgotPasswordState {\r\n  showModal: boolean\r\n  userName: string\r\n  userNameValid: boolean\r\n}\r\n\r\nexport default class ForgotPassword extends Component<ForgotPasswordProps, ForgotPasswordState> {\r\n  state: ForgotPasswordState = {\r\n    showModal: false,\r\n    userName: \"\",\r\n    userNameValid: false\r\n  }\r\n\r\n  userPasswordResetSubscription?: Subscription\r\n\r\n  componentWillUnmount() {\r\n    this.userPasswordResetSubscription && this.userPasswordResetSubscription.unsubscribe()\r\n  }\r\n\r\n  isEmailValid = (value: string) => value.length > 0 && EmailRegexp.test(value)\r\n  handleShow = () => this.setState({showModal: true, userName: this.props.userName || '', userNameValid: this.isEmailValid(this.props.userName || \"\")})\r\n  handleClose = () => this.setState({showModal: false})\r\n  handleChange = (email: string) => this.setState({userName: email, userNameValid: this.isEmailValid(email)})\r\n\r\n  submitPasswordReset = () => {\r\n    this.userPasswordResetSubscription && this.userPasswordResetSubscription.unsubscribe()\r\n\r\n    this.userPasswordResetSubscription = UserPasswordReset(this.state.userName, window.location.href, true).subscribe(\r\n      data => {\r\n        toast.success(data)\r\n        this.handleClose()\r\n      },\r\n      (error) => this.handleAPIError(error, {})\r\n    )\r\n  }\r\n\r\n  handleAPIError = (error: Error | APIError, stateChanges: object) => {\r\n    this.setState(stateChanges)\r\n    error && toast.error((error as APIError)?.errorData?.message || error.message)\r\n  }\r\n\r\n  render() {\r\n    const { userName, userNameValid } = this.state\r\n\r\n    return <>\r\n        <Button variant=\"link\" onClick={()=> {this.handleShow()}}>Forgot Password</Button>\r\n        <Modal show={this.state.showModal} onHide={()=> {this.handleClose()}}>\r\n          <Modal.Header closeButton>\r\n            <Modal.Title>Forgot Password</Modal.Title>\r\n          </Modal.Header>\r\n          <Modal.Body>\r\n            <Form>\r\n              <Form.Group className=\"mb-3\" controlId=\"formBasicEmail\">\r\n                  <Form.Label>Please enter your email address:</Form.Label>\r\n                  <Form.Control value={userName} type=\"text\" placeholder=\"Enter email\" onChange={(e) => this.handleChange(e.target.value)} isInvalid={!userNameValid} />\r\n              </Form.Group>\r\n            </Form>\r\n          </Modal.Body>\r\n          <Modal.Footer>\r\n            <Button variant=\"secondary\" onClick={this.handleClose}>Close</Button>\r\n            <Button variant=\"primary\" onClick={this.submitPasswordReset} disabled={!userNameValid} >Email Password Reset Link</Button>\r\n          </Modal.Footer>\r\n        </Modal>\r\n    </>\r\n  }\r\n}","import React, { Component } from \"react\"\r\nimport { Nav } from \"react-bootstrap\"\r\nimport { GetSinglePageAppPath } from \"../../BaseUrl\"\r\nimport { Home, AboutRoute } from \"../../config/Routes\"\r\n\r\nexport interface LoginNavMenuProps {\r\n  active?: string\r\n}\r\n\r\nexport class LoginNavMenu extends Component<LoginNavMenuProps, {}> {\r\n  linkTo = (route: string, caption: string) => <Nav.Link href={`${GetSinglePageAppPath()}#${route}`} bsPrefix=\"btn btn-link\">{caption}</Nav.Link>\r\n\r\n  render() {\r\n    return (\r\n      <Nav>\r\n        <Nav.Item>\r\n          {this.linkTo(Home, \"Home\")}\r\n        </Nav.Item>\r\n        {/*<Nav.Item>\r\n          {this.linkTo(AboutRoute, \"About\")}\r\n        </Nav.Item>*/}\r\n      </Nav>)\r\n  }\r\n}\r\n","import React, { Component } from \"react\"\r\nimport { Card } from \"react-bootstrap\"\r\nimport CustomerNotification from \"../../api/Notifications/Model/CustomerNotification\"\r\nimport { FormatDateAsLong } from \"../../formatters/FormatDate\"\r\n\r\ninterface NotificationCardProps {\r\n  notification: CustomerNotification\r\n  index: number\r\n  count: number\r\n}\r\n\r\nexport class NotificationCard extends Component<NotificationCardProps, {}> {\r\n  render() {\r\n    const note = this.props.notification\r\n\r\n    return <Card className=\"mt-2\">\r\n      <Card.Body className=\"p-2\">\r\n        <Card.Title>{note.NotificationTitle}</Card.Title>\r\n        <Card.Text><small>{note.NotificationDescription}</small></Card.Text>\r\n        <Card.Subtitle>\r\n          <div className=\"float-left\">({this.props.index + 1} of {this.props.count})</div>\r\n          <div className=\"float-right\">Expiry {FormatDateAsLong(note.NotificationExpirationDate)}</div>\r\n        </Card.Subtitle>\r\n      </Card.Body>\r\n    </Card>\r\n  }\r\n}\r\n","import React, { Component } from \"react\"\r\nimport { Subscription } from \"rxjs\"\r\nimport CustomerNotificationsGet from \"../../api/Notifications/CustomerNotificationsGet\"\r\nimport CustomerNotifications from \"../../api/Notifications/Model/CustomerNotifications\"\r\nimport CustomerNotification from \"../../api/Notifications/Model/CustomerNotification\"\r\nimport { NotificationCard } from \"./NotificationCard\"\r\n\r\ninterface NotificationPanelState {\r\n  loading: boolean\r\n  notifications?: CustomerNotifications\r\n  pinnedNotifications: CustomerNotification[]\r\n  unpinnedNotifications: CustomerNotification[]\r\n}\r\n\r\nexport class NotificationPanel extends Component<{}, NotificationPanelState> {\r\n  state: NotificationPanelState = {\r\n    loading: false,\r\n    pinnedNotifications: [],\r\n    unpinnedNotifications: []\r\n  }\r\n\r\n  subscriptions = new Subscription()\r\n\r\n  componentDidMount() {\r\n    this.setState({ loading: true })\r\n    this.subscriptions.add(\r\n      CustomerNotificationsGet().subscribe(\r\n        results => {\r\n          const pinnedNotifications = results.Records?.filter(record => record.Pinned)\r\n          const unpinnedNotifications = results.Records?.filter(record => !record.Pinned)\r\n          this.setState({ notifications: results, pinnedNotifications, unpinnedNotifications, loading: false })\r\n        },\r\n        () => this.setState({ loading: false })\r\n      )\r\n    )\r\n  }\r\n\r\n  componentWillUnmount(){\r\n    this.subscriptions.unsubscribe()\r\n  }\r\n\r\n  render() {\r\n    if (this.state.loading) {\r\n      return <></>\r\n    }\r\n    return <div>\r\n      {this.state.pinnedNotifications.map((row: CustomerNotification, i: number) =>\r\n        <NotificationCard\r\n          key={`pinned_note_${i}`}\r\n          notification={row}\r\n          index={i}\r\n          count={this.state.pinnedNotifications.length}\r\n        />)}\r\n      {this.state.unpinnedNotifications.map((row: CustomerNotification, i: number) =>\r\n        <NotificationCard\r\n          key={`unpinned_note_${i}`}\r\n          notification={row}\r\n          index={i}\r\n          count={this.state.unpinnedNotifications.length}\r\n        />)}\r\n    </div>\r\n  }\r\n}\r\n","import CustomerNotifications from \"./Model/CustomerNotifications\"\r\nimport { ObservableFromFetch } from \"../ObservableFromFetch\"\r\n\r\nexport default function CustomerNotificationsGet() {\r\n  const params = JSON.stringify({\r\n    PageNumber: 1,\r\n    PageSize: 20,\r\n    ShowOnClinicPortal: true\r\n  })\r\n  return ObservableFromFetch<CustomerNotifications>(\"FFOrderCustomerNotifications/GetCustomerNotifications\", params)\r\n}\r\n","import React, { Component } from 'react'\r\nimport { Button, Col, Container, Form, Image, InputGroup, Row, Nav } from \"react-bootstrap\";\r\nimport { connect } from 'react-redux'\r\nimport { AppState } from \"../AppState\";\r\nimport { Action, Dispatch } from \"redux\";\r\nimport { AppPageWrapper } from \"../components/NavMenu/AppPageWrapper\";\r\nimport logoImage from \"../assets/images/logo.png\"\r\nimport { loginToWorkforce } from \"../actions/WorkforceOneLoginActions\";\r\nimport ForgotPassword from \"../components/Secuirty/ForgotPassword\";\r\nimport { FaEye, FaEyeSlash } from \"react-icons/fa\"\r\nimport { LoginNavMenu } from \"../components/NavMenu/LoginNavMenu\"\r\nimport { Home } from \"../config/Routes\"\r\nimport { ApiRootUrl } from \"../api/ApiUrl\"\r\nimport { NotificationPanel } from \"../components/Notification/NotificationPanel\"\r\n\r\nexport interface Workforce1LoginProps {\r\n  test?: boolean\r\n}\r\nexport interface Workforce1LoginAppStateProps {\r\n  foundToken: boolean\r\n}\r\nexport interface Workforce1LoginDispatchProps {\r\n  login: (username: string, password: string) => void\r\n}\r\nexport interface Workforce1LoginState {\r\n  username: string\r\n  password: string\r\n  showPass: boolean\r\n  inputType: string\r\n}\r\nexport class Workforce1Login extends Component<Workforce1LoginProps & Workforce1LoginAppStateProps & Workforce1LoginDispatchProps, Workforce1LoginState>{\r\n  state: Workforce1LoginState = {\r\n    username: \"\",\r\n    password: \"\",\r\n    showPass: false,\r\n    inputType: \"password\",\r\n  }\r\n  login = (e: React.FormEvent) => {\r\n    localStorage.removeItem(\"portalImage\");\r\n    localStorage.removeItem(\"consortiumCheckCompanies\");\r\n    e.preventDefault()\r\n    const userName = this.state.username.trim();\r\n    const password = this.state.password;\r\n    this.props.login(userName, password);\r\n  }\r\n\r\n  toggleShowPass = () => {\r\n    this.setState({ showPass: !this.state.showPass, inputType: this.state.showPass ? \"password\" : \"text\" })\r\n  }\r\n\r\n  render() {\r\n    const colProps = { lg: { span: 8, offset: 2 }, xl: { span: 6, offset: 3 } }\r\n    return <AppPageWrapper showNav={false} hideLogo={true} showSupportedBrowsers={true}>\r\n      <Container fluid>\r\n        <Form onSubmit={this.login} >\r\n          <Row>\r\n            <Col {...colProps}><Image className=\"mx-auto d-block m-4\" src={logoImage} alt=\"CRL OnTrack\" fluid /></Col>\r\n          </Row>\r\n          <Row>\r\n            <Col {...colProps}>\r\n              <LoginNavMenu active={Home} />\r\n            </Col>\r\n          </Row>\r\n        <Row>\r\n          <Col {...colProps}>\r\n            <Form.Group controlId=\"formBasicEmail\">\r\n              <InputGroup>\r\n                <InputGroup.Prepend>\r\n                  <InputGroup.Text className=\"fixed-w6_2\">Username</InputGroup.Text>\r\n                </InputGroup.Prepend>\r\n                <Form.Control onChange={(e) => { this.setState({ username: e.target.value }) }} value={this.state.username} type=\"text\" />\r\n              </InputGroup>\r\n            </Form.Group>\r\n          </Col>\r\n        </Row>\r\n        <Row>\r\n          <Col {...colProps}>\r\n            <Form.Group controlId=\"formBasicPassword\">\r\n              <InputGroup>\r\n                <InputGroup.Prepend>\r\n                  <InputGroup.Text className=\"fixed-w6_2\">Password</InputGroup.Text>\r\n                </InputGroup.Prepend>\r\n                <Form.Control onChange={(e) => { this.setState({ password: e.target.value }) }} value={this.state.password} type={this.state.inputType} />\r\n                <InputGroup.Append onClick={this.toggleShowPass}>\r\n                  <InputGroup.Text className=\"bg-transparent\">\r\n                    {this.state.showPass && <FaEye />}\r\n                    {!this.state.showPass && <FaEyeSlash />}\r\n                  </InputGroup.Text>\r\n                </InputGroup.Append>\r\n              </InputGroup>\r\n            </Form.Group>\r\n          </Col>\r\n        </Row>\r\n        <Row>\r\n          <Col {...colProps}>\r\n            <Form.Group className=\"text-center\">\r\n              <ForgotPassword userName={this.state.username} />\r\n            </Form.Group>\r\n          </Col>\r\n        </Row>\r\n        <Row>\r\n          <Col {...colProps}>\r\n            <Button block={true} variant=\"primary\" type=\"submit\">\r\n              Log In\r\n                </Button>\r\n          </Col>\r\n        </Row>\r\n        <Row>\r\n          <Col {...colProps}>\r\n            <NotificationPanel />\r\n            <div className=\"mt-4\">\r\n              <small>Access and use of this website is restricted to authorized users \r\n                (who have agreed to be bound by all the terms, requirements and conditions in  <a href={ApiRootUrl() + \"/Template/FFOrderDocs.pdf\"} target=\"_blank\">FormFox's Website Access License</a>).\r\n                 Unauthorized users should exit immediately to avoid possible civil or criminal liability. \r\n                 Unauthorized access to this facility, copying or any other reproduction of materials from this system is prohibited.</small>\r\n            </div>\r\n          </Col>\r\n        </Row>\r\n          </Form>\r\n        </Container>\r\n      </AppPageWrapper >\r\n    }\r\n}\r\nfunction mapStateToProps(state: AppState): Workforce1LoginAppStateProps {\r\n  return {\r\n    foundToken: !!state.Workforce1State.webToken\r\n  }\r\n}\r\nfunction mapDispatchProps(dispatch: Dispatch<Action>): Workforce1LoginDispatchProps {\r\n  return {\r\n    login: (username: string, password: string) => (dispatch(loginToWorkforce(username, password))),\r\n  }\r\n}\r\nconst connector = connect<Workforce1LoginAppStateProps, Workforce1LoginDispatchProps, Workforce1LoginProps, AppState>(\r\n  mapStateToProps, mapDispatchProps)(Workforce1Login);\r\nexport default connector;\r\n","import React, {Component} from 'react'\r\nimport {AppPageWrapper} from \"./NavMenu/AppPageWrapper\";\r\nimport {Container, Spinner} from \"react-bootstrap\";\r\n\r\nexport interface LoadingProps{\r\n    message: string\r\n    showNav?: boolean\r\n    delayedVisibility?: boolean\r\n    embedingMode?: boolean\r\n}\r\nexport default class PageLoading extends Component<LoadingProps>{\r\n    render() {\r\n        return (<AppPageWrapper showNav={this.props.showNav} embedingMode={!!this.props.embedingMode}>\r\n            <Container fluid={true} className={\"m-2\"}>\r\n                <div className={`text-center ${this.props.delayedVisibility ? \"delayedVisibility\" : \"\"}`}>\r\n                    <Spinner animation=\"border\" />\r\n                    <br />\r\n                    {this.props.message}\r\n                </div>\r\n            </Container>\r\n        </AppPageWrapper>);\r\n    }\r\n}\r\n","import { FullBaseUrl } from \"../api/ApiUrl\";\r\n\r\nexport const IDENTITY_CONFIG = {  \r\n  authority: \"https://auth.pingone.com/6b6ac0d9-059d-4001-86af-8580aa7e47cb/as\",   \r\n  client_id: \"9b8c8336-feaf-46c3-bfb5-2e7936c2f11a\",    \r\n  redirect_uri: `${window.location.origin}/clinicportal/ng/`,\r\n  response_type: \"token id_token\",   \r\n  scope: \"openid\",   \r\n  // scope: \"openid profile wf-2-api.full\",   \r\n  post_logout_redirect_uri: `${FullBaseUrl()}/sso`, }\r\n","import { UserManager } from \"oidc-client\"\r\nimport { IDENTITY_CONFIG } from \"../config/Identity\"\r\n\r\n\r\nexport default class AuthService {\r\n  userManager: UserManager\r\n\r\n  constructor() {\r\n    this.userManager = new UserManager({\r\n      ...IDENTITY_CONFIG\r\n    })\r\n    console.log(IDENTITY_CONFIG);\r\n  }\r\n\r\n  signinRedirectCallback = (url?: string) => {\r\n    return this.userManager.signinRedirectCallback(url)\r\n  }\r\n\r\n  getUser = () => {\r\n    return this.userManager.getUser()\r\n  }\r\n\r\n  signinRedirect = (provider?: string) => {\r\n    if (provider && provider !== \"\") {\r\n      return this.userManager.signinRedirect({\r\n        // TODO: Uncomment this to provide IDP name to PingOne\r\n        // extraQueryParams: {\r\n        //   acr_values: `idp:${provider}`\r\n        // }\r\n      })\r\n    } else {\r\n      return this.userManager.signinRedirect()\r\n    }\r\n  }\r\n}\r\n","import React, { Component } from \"react\"\r\nimport { RouteComponentProps } from \"react-router-dom\"\r\nimport { connect } from \"react-redux\"\r\nimport { toast } from \"react-toastify\"\r\nimport { APIError } from \"../api/ObservableFromFetch\"\r\nimport { AppState } from \"../AppState\";\r\nimport { Action, Dispatch } from \"redux\";\r\nimport PageLoading from \"../components/PageLoading\"\r\nimport { EmbeddedOrderModeEnabled, GetSSOAction, SetEmbeddedOrderMode, SetSiteSearchMode, SetSSOAction, SetSSOPayload, SiteSearchModeEnabled } from \"../storage/AuthToken\"\r\nimport AuthService from \"./AuthService\"\r\nimport { ssoTokenLoginToWorkforce, WorkforceOneUserLogOut } from \"../actions/WorkforceOneLoginActions\"\r\nimport { SSOOrderRoute, SSOSiteSearchRoute, SSOGetAuthFormRoute } from \"../config/Routes\"\r\n\r\nexport interface SSOWorkforce1LoginProps { }\r\nexport interface SSOWorkforce1LoginAppStateProps {\r\n  isLoggedIn: boolean\r\n  isLoading: boolean\r\n  userName?: string\r\n}\r\nexport interface SSOWorkforce1LoginDispatchProps {\r\n  login: (token: string, isSiteSearch: boolean, isEmbeddedOrder: boolean, action:string) => void\r\n  logout: () => void\r\n}\r\n\r\nexport interface SSOWorkforce1LoginState {\r\n  spinnerMessage: string\r\n}\r\n\r\nexport class SSOWorkforce1Login extends Component<SSOWorkforce1LoginProps & SSOWorkforce1LoginAppStateProps & SSOWorkforce1LoginDispatchProps & RouteComponentProps, SSOWorkforce1LoginState>{\r\n  state: SSOWorkforce1LoginState = { spinnerMessage: \"Authentication...\" }\r\n  token = \"\"\r\n  base64String = \"\"\r\n\r\n  componentDidMount() {\r\n    if (this.props.isLoggedIn) {\r\n      this.props.logout()\r\n    }\r\n    const searchParams = new URLSearchParams(this.props.location.search)\r\n    this.base64String = searchParams.get(\"payload\") || \"\"\r\n    this.token = searchParams.get(\"token\") || \"\"\r\n    const provider = searchParams.get(\"provider\") || undefined\r\n    const siteSearch = searchParams.get(\"sitesearch\") || false\r\n    const embeddedOrder = searchParams.get(\"order\") || false\r\n    const action = searchParams.get(\"action\") || \"\"\r\n    if (this.token != \"\") {\r\n      if (siteSearch) {\r\n        SetSiteSearchMode()\r\n      }\r\n      if (embeddedOrder) {\r\n        SetEmbeddedOrderMode()\r\n      }\r\n      SetSSOAction(action)\r\n      this.props.login(this.token, !!siteSearch, !!embeddedOrder, action);\r\n    }\r\n    else {\r\n      SetSSOPayload(this.base64String)\r\n      this.signIn(provider)\r\n    }\r\n  }\r\n\r\n  componentDidUpdate(prevProps: SSOWorkforce1LoginAppStateProps) {\r\n    const isSiteSearch = SiteSearchModeEnabled()\r\n    const isEmbeddedOrder = EmbeddedOrderModeEnabled()\r\n    const action = GetSSOAction()\r\n    if (this.props.isLoggedIn !== prevProps.isLoggedIn) {\r\n      if (isSiteSearch) {\r\n        this.props.history.push(SSOSiteSearchRoute)\r\n      }\r\n      if (isEmbeddedOrder) {\r\n        this.props.history.push(SSOOrderRoute)\r\n      }\r\n      if (action === \"getauthform\") {\r\n        this.props.history.push(SSOGetAuthFormRoute)\r\n      }\r\n    }\r\n    if (!this.props.isLoading && prevProps.isLoading && !this.props.userName) {\r\n      this.setState({spinnerMessage: 'Authentication error # 1'})\r\n    }\r\n  }\r\n\r\n  signIn = (provider?: string) => {\r\n    const authService = new AuthService()\r\n    authService.signinRedirect(provider).catch(() => {\r\n      this.setState({spinnerMessage: 'Authentication error # 2'})\r\n    })\r\n  }\r\n\r\n  handleAPIError = (error: Error | APIError) => {\r\n    error && toast.error((error as APIError)?.errorData?.message || error.message)\r\n  }\r\n\r\n  render() { return <>\r\n    <PageLoading message={this.state.spinnerMessage} showNav={true} embedingMode={true}/>\r\n  </>\r\n  }\r\n}\r\n\r\nfunction mapStateToProps(state: AppState): SSOWorkforce1LoginAppStateProps {\r\n  return {\r\n    isLoggedIn: state.Workforce1State.isLoggedIn,\r\n    isLoading: state.Workforce1State.isLoading,\r\n    userName: state.Workforce1State.userName\r\n  }\r\n}\r\n\r\nfunction mapDispatchProps(dispatch: Dispatch<Action>): SSOWorkforce1LoginDispatchProps {\r\n  return {\r\n    logout: () => (dispatch(WorkforceOneUserLogOut(true))),\r\n    login: (token: string, isSiteSearch: boolean, isEmbeddedOrder: boolean, action:string) => (dispatch(ssoTokenLoginToWorkforce(token, isSiteSearch, isEmbeddedOrder, action))),\r\n  }\r\n}\r\n\r\nexport default connect<SSOWorkforce1LoginAppStateProps, SSOWorkforce1LoginDispatchProps, SSOWorkforce1LoginProps, AppState>(\r\n  mapStateToProps, mapDispatchProps)(SSOWorkforce1Login)\r\n","import { Col, Form, Row } from \"react-bootstrap\"\r\nimport { AdditionalOptionsType } from \"./AdditionalOptions\"\r\n\r\nexport enum ForcePrimaryClinic {\r\n  NOT_SELECTED = '',\r\n  IF_AVAILABLE = '1',\r\n  ONLY = '2'\r\n}\r\n\r\nexport interface ForcePrimaryClinicOptionsProps {\r\n  selected?: string\r\n  onUpdate: (optionType: AdditionalOptionsType, value: string) => void\r\n}\r\n\r\nconst ForcePrimaryClinicOptions = (props: ForcePrimaryClinicOptionsProps) => {\r\n  const onChange = (e: React.ChangeEvent<HTMLInputElement>) => {\r\n    props.onUpdate(AdditionalOptionsType.FORCE_PRIMARY_CLINIC, e.target.checked\r\n      ? e.target.value\r\n      : ForcePrimaryClinic.NOT_SELECTED\r\n    )\r\n  }\r\n\r\n  return (\r\n    <>\r\n      <Row>\r\n        <Col>\r\n          <div className=\"h5\">Primary Clinics</div>\r\n        </Col>\r\n      </Row>\r\n      <Row>\r\n        <Col>\r\n          <Form.Check inline id=\"force-if-available\" type=\"checkbox\" className=\"with-label\"\r\n            label=\"Display Primary Clinics First\"\r\n            value={ForcePrimaryClinic.IF_AVAILABLE}\r\n            checked={props.selected === ForcePrimaryClinic.IF_AVAILABLE}\r\n            onChange={onChange} />\r\n          <Form.Text className=\"ml-4 d-block\">Only Primary clinics will be displayed; otherwise the full list of clinics that were found will be displayed.</Form.Text>\r\n        </Col>\r\n      </Row>\r\n      <Row>\r\n        <Col>\r\n          <Form.Check inline id=\"force-only\" type=\"checkbox\" className=\"with-label\"\r\n              label=\"Display Primary Clinics Only\"\r\n              value={ForcePrimaryClinic.ONLY}\r\n              checked={props.selected === ForcePrimaryClinic.ONLY}\r\n              onChange={onChange} />\r\n            <Form.Text className=\"ml-4 d-block\">Only the Primary clinics will be displayed.</Form.Text>\r\n        </Col>\r\n      </Row>\r\n    </>\r\n  )\r\n}\r\n\r\nexport default ForcePrimaryClinicOptions\r\n","import React from \"react\"\r\nimport { ConnectDragSource, ConnectDropTarget, DragSource, DragSourceConnector, DragSourceMonitor, DropTarget, DropTargetConnector, DropTargetMonitor } from \"react-dnd\"\r\nimport DraggableItemData from \"./DraggableItemData\"\r\nimport Checkbox from \"../Checkbox\"\r\nimport { Col, Row } from \"react-bootstrap\"\r\n\r\nexport const DraggableTypeItem = \"Item\"\r\n\r\ninterface DraggableItemProps {\r\n  item: DraggableItemData\r\n  moveItem: (id: string, to: number) => void\r\n  findItem: (id: string) => { index: number }\r\n  excludeItem: (id: string, exclude: boolean) => void\r\n}\r\n\r\ninterface DragDropItemProps extends DraggableItemProps {\r\n  connectDragSource: ConnectDragSource\r\n  isDragging: boolean\r\n  connectDropTarget: ConnectDropTarget\r\n}\r\n\r\nconst DraggableItemSource = {\r\n  beginDrag(props: DraggableItemProps) {\r\n    return {\r\n      id: props.item.id,\r\n      originalIndex: props.findItem(props.item.id).index\r\n    }\r\n  },\r\n  endDrag(props: DraggableItemProps, monitor: DragSourceMonitor) {\r\n    const item = monitor.getItem()\r\n    if (!monitor.didDrop()) {\r\n      props.moveItem(item.id, item.originalIndex)\r\n    }\r\n  }\r\n}\r\n\r\nconst DraggableItemCollect = (connect: DragSourceConnector, monitor: DragSourceMonitor) => ({\r\n  connectDragSource: connect.dragSource(),\r\n  isDragging: monitor.isDragging()\r\n})\r\n\r\nconst DroppableContainerTarget = {\r\n  canDrop: () => false,\r\n  hover(props: DraggableItemProps, monitor: DropTargetMonitor) {\r\n    const { id: draggedId } = monitor.getItem()\r\n    if (draggedId !== props.item.id) {\r\n      const { index: overIndex } = props.findItem(props.item.id)\r\n      props.moveItem(draggedId, overIndex)\r\n    }\r\n  }\r\n}\r\n\r\nconst DroppableContainerCollect = (connect: DropTargetConnector) => ({ connectDropTarget: connect.dropTarget() })\r\n\r\nclass DraggableItem extends React.Component<DragDropItemProps> {\r\n\r\n  render() {\r\n    const { item, isDragging, connectDragSource, connectDropTarget } = this.props\r\n    return connectDropTarget(connectDragSource(\r\n      <div className={`draggable-item${isDragging ? \" hovered\" : \"\"}`}>\r\n        <Row>\r\n        <Col lg={9}>{item.name}</Col>\r\n        {item.exclude !== undefined &&\r\n          <Col lg={3}>\r\n            <Checkbox id={`${item.id}_exclude`} name=\"Exclude\" label=\"Exclude\" checked={!!item.exclude} onChange={(e: React.ChangeEvent<HTMLInputElement>) => this.props.excludeItem(item.id, !!e.target.checked)}/>\r\n          </Col>}\r\n        </Row>\r\n      </div>\r\n    ))\r\n  }\r\n}\r\n\r\nexport default DropTarget(DraggableTypeItem, DroppableContainerTarget, DroppableContainerCollect)(DragSource(DraggableTypeItem, DraggableItemSource, DraggableItemCollect)(DraggableItem))\r\n","import React from \"react\"\r\nimport { ConnectDropTarget, DropTarget, DropTargetConnector } from \"react-dnd\"\r\nimport DraggableItem, { DraggableTypeItem } from \"./DraggableItem\"\r\nimport DraggableItemData from \"./DraggableItemData\"\r\n\r\nexport interface DroppableContainerProps {\r\n  items: DraggableItemData[]\r\n  onChangeItemsList: (items: DraggableItemData[]) => void\r\n}\r\n\r\ninterface DroppableContainerPropsExt extends DroppableContainerProps {\r\n  connectDropTarget: ConnectDropTarget\r\n}\r\n\r\nconst DroppableItemTarget = { canDrop: () => true }\r\n\r\nconst DroppableItemCollect = (connect: DropTargetConnector) => ({ connectDropTarget: connect.dropTarget() })\r\n\r\nclass DroppableContainer extends React.Component<DroppableContainerPropsExt> {\r\n  moveItem = (id: string, atIndex: number) => {\r\n    const { item, index } = this.findItem(id)\r\n    if (item) {\r\n      const newItems = [...this.props.items]\r\n      const prevItem = newItems.splice(atIndex, 1, item)\r\n      newItems.splice(index, 1, prevItem[0])\r\n      this.props.onChangeItemsList(newItems)\r\n    }\r\n  }\r\n\r\n  excludeItem = (id: string, exclude: boolean) => {\r\n    const { item, index } = this.findItem(id)\r\n    if (item) {\r\n      const newItems = [...this.props.items]\r\n      newItems[index].exclude = exclude\r\n      this.props.onChangeItemsList(newItems)\r\n    }\r\n  }\r\n\r\n  findItem = (id: string) => {\r\n    const item = this.props.items.filter((c) => c.id === id)[0]\r\n    return {\r\n      item: item,\r\n      index: this.props.items.indexOf(item),\r\n    }\r\n  }\r\n\r\n  render() {\r\n    const { connectDropTarget } = this.props\r\n    return connectDropTarget(\r\n      <div>\r\n        {this.props.items.map(item => <DraggableItem key={item.id}\r\n          item={item}\r\n          moveItem={this.moveItem}\r\n          findItem={this.findItem}\r\n          excludeItem={this.excludeItem}\r\n          />\r\n        )}\r\n      </div>\r\n    )\r\n  }\r\n}\r\n\r\nexport default DropTarget(DraggableTypeItem, DroppableItemTarget, DroppableItemCollect)(DroppableContainer)\r\n","import { useCallback, useEffect, useState } from \"react\"\r\nimport { Spinner } from \"react-bootstrap\"\r\nimport { finalize, map } from \"rxjs/operators\"\r\nimport { toast } from \"react-toastify\"\r\nimport { ClinicSearchAdditionalOptionsGetObservable, ClinicSearchAdditionalOptionsSetObservable } from \"../../../api/Clinics/ClinicOptionsGet\"\r\nimport ForcePrimaryClinicOptions from \"./ForcePrimaryClinicOptions\"\r\nimport FormatError from \"../../../formatters/FormatError\"\r\nimport { useEffectAfterMount } from \"../../../utils/hooks\"\r\n\r\nexport interface AdditionalOptionsProps {\r\n  isPortal: boolean\r\n  update: boolean\r\n  setSaving: (saving: boolean) => void\r\n}\r\n\r\nexport enum AdditionalOptionsType {\r\n  FORCE_PRIMARY_CLINIC = 1\r\n}\r\n\r\nexport interface AdditionalOption {\r\n  OptionTypeID: AdditionalOptionsType\r\n  OptionValue: string\r\n}\r\n\r\nconst AdditionalOptions = (props: AdditionalOptionsProps) => {\r\n  const { setSaving, update } = props\r\n  const [loading, setLoading] = useState(false)\r\n  const [options, setOptions] = useState<AdditionalOption[]>([])\r\n\r\n  useEffect(() => {\r\n    setLoading(true)\r\n    const sub = ClinicSearchAdditionalOptionsGetObservable()\r\n      .pipe(\r\n        map(options => options.map(\r\n          option => ({\r\n            OptionTypeID: option.ClinicSearchOptionTypeID,\r\n            OptionValue: option.Value\r\n          })\r\n        )),\r\n        finalize(() => setLoading(false))\r\n      )\r\n      .subscribe(\r\n        data => setOptions(data),\r\n        error => toast.error(FormatError(error))\r\n      )\r\n    return () => sub.unsubscribe()\r\n  }, [])\r\n\r\n  useEffectAfterMount(() => {\r\n    setSaving(true)\r\n    const sub = ClinicSearchAdditionalOptionsSetObservable(options)\r\n      .pipe(finalize(() => setSaving(false)))\r\n      .subscribe(\r\n        data => toast.success(data),\r\n        error => toast.error(FormatError(error))\r\n      )\r\n    return () => sub.unsubscribe()\r\n  }, [update, setSaving])\r\n\r\n  const onUpdateOption = useCallback((optionType: AdditionalOptionsType, value: string) => {\r\n    setOptions(prev => prev.map(obj => {\r\n      return obj.OptionTypeID === optionType\r\n        ? { ...obj, OptionValue: value }\r\n        : obj\r\n    }))\r\n  }, [])\r\n\r\n  const getOptionValue = useCallback((optionType: AdditionalOptionsType) => {\r\n    return options.find(o => o.OptionTypeID === optionType)?.OptionValue\r\n  }, [options])\r\n\r\n  return (\r\n    <>\r\n      {loading && <Spinner animation=\"border\" />}\r\n      {!loading && props.isPortal && <ForcePrimaryClinicOptions\r\n        selected={getOptionValue(AdditionalOptionsType.FORCE_PRIMARY_CLINIC)}\r\n        onUpdate={onUpdateOption}\r\n      />}\r\n    </>\r\n  )\r\n}\r\n\r\nexport default AdditionalOptions\r\n","import * as React from \"react\"\r\nimport { Container, Row, Col, Spinner, Button, Form } from \"react-bootstrap\"\r\nimport { toast } from \"react-toastify\"\r\nimport { Subscription } from \"rxjs\"\r\nimport { DndProvider } from \"react-dnd\"\r\nimport { HTML5Backend } from \"react-dnd-html5-backend\"\r\nimport ClinicSearchOptions from \"../../../api/Clinics/Models/ClinicSearchOptions\"\r\nimport { ClinicSearchOptionsGetObservable, ClinicSearchOptionsSetObservable, ClinicSearchPriceGetObservable, ClinicSearchPriceSetObservable } from \"../../../api/Clinics/ClinicOptionsGet\"\r\nimport ClinicSearchPrice from \"../../../api/Clinics/Models/ClinicSearchPrice\"\r\nimport ActionButton from \"../../ActionButton\"\r\nimport DraggableItemData from \"../../Draggable/DraggableItemData\"\r\nimport DroppableContainer from \"../../Draggable/DroppableContainer\"\r\nimport AdditionalOptions from \"./AdditionalOptions\"\r\nimport Checkbox from \"../../Checkbox\"\r\n\r\ninterface DefaultOptionsProps {\r\n  onCancel: () => void\r\n  isPortal: boolean\r\n}\r\n\r\ninterface DefaultOptionsState {\r\n  options?: ClinicSearchOptions\r\n  prices?: ClinicSearchPrice[]\r\n  radius1?: number\r\n  radius2?: number\r\n  mpSitesOnly: boolean\r\n  mpSitesOnlyPortalAdmin?: boolean\r\n  loadingOptions: boolean\r\n  loadingPrice: boolean\r\n  savingOptions: boolean\r\n  savingPrice: boolean\r\n  savingAdditionalOptions: boolean\r\n  updateAdditionalOptions: boolean\r\n}\r\n\r\nconst DefaultMinimumRadius = 15\r\nconst DefaultMaximumRadius = 50\r\nexport default class DefaultOptions extends React.PureComponent<DefaultOptionsProps, DefaultOptionsState> {\r\n  state: DefaultOptionsState = {\r\n    mpSitesOnly: false,\r\n    mpSitesOnlyPortalAdmin: false,\r\n    loadingOptions: false,\r\n    loadingPrice: false,\r\n    savingOptions: false,\r\n    savingPrice: false,\r\n    savingAdditionalOptions: false,\r\n    updateAdditionalOptions: false\r\n  }\r\n\r\n  loadOptionsSubscription?: Subscription\r\n  loadPriceSubscription?: Subscription\r\n  saveOptionsSubscription?: Subscription\r\n  savePriceSubscription?: Subscription\r\n\r\n  componentDidMount() {\r\n    this.setState({ loadingOptions: true })\r\n    this.loadOptionsSubscription = ClinicSearchOptionsGetObservable().subscribe(\r\n      data => this.setState({\r\n        options: data,\r\n        radius1: data.SearchRadius1 || DefaultMinimumRadius,\r\n        radius2: data.SearchRadius2 || DefaultMaximumRadius,\r\n        mpSitesOnly: data.mpSitesOnly || false,\r\n        mpSitesOnlyPortalAdmin: data.mpSitesOnlyPortalAdmin || false,\r\n        loadingOptions: false\r\n      }),\r\n      (error) => this.handleAPIError(error, { loadingOptions: false })\r\n    )\r\n    if (this.props.isPortal) {\r\n      this.setState({ loadingPrice: true })\r\n      this.loadPriceSubscription = ClinicSearchPriceGetObservable().subscribe(\r\n        data => this.setState({ prices: data, loadingPrice: false }),\r\n        (error) => this.handleAPIError(error, { loadingPrice: false })\r\n      )\r\n    }\r\n  }\r\n\r\n  componentWillUnmount() {\r\n    this.loadOptionsSubscription && this.loadOptionsSubscription.unsubscribe()\r\n    this.loadPriceSubscription && this.loadPriceSubscription.unsubscribe()\r\n    this.saveOptionsSubscription && this.saveOptionsSubscription.unsubscribe()\r\n    this.savePriceSubscription && this.savePriceSubscription.unsubscribe()\r\n  }\r\n\r\n  handleRadiusChange = (value: string, field: \"radius1\" | \"radius2\") => {\r\n    const digits = value.replace(/\\D/g, \"\")\r\n    this.setState({ ...{}, [field]: digits ? Number(digits) : undefined })\r\n  }\r\n\r\n  handleChangePriceItemsList = (items: DraggableItemData[]) => {\r\n    const { prices } = this.state\r\n    if (!prices?.length) {\r\n      return\r\n    }\r\n    const newPrices = items.map(item => {\r\n      const price = prices.find(price => price.PriceTierID.toString() === item.id)\r\n      return {...price, Exclude: item.exclude}\r\n    }\r\n    ).filter(item => !!item).map(item => ({ ...item } as ClinicSearchPrice))\r\n    this.setState({ prices: newPrices })\r\n  }\r\n\r\n  handleAPIError = (error: Error, stateChanges: object) => {\r\n    this.setState(stateChanges)\r\n    toast.error(error)\r\n  }\r\n\r\n  handleUpdate = () => {\r\n    this.setState({ savingOptions: true })\r\n    this.saveOptionsSubscription = ClinicSearchOptionsSetObservable(this.state.radius1 || 0, this.state.radius2 || 0, this.state.mpSitesOnly).subscribe(\r\n      (data) => toast.success(data),\r\n      (error) => this.handleAPIError(error, {}),\r\n      () => this.setState({ savingOptions: false })\r\n    )\r\n    if (this.props.isPortal) {\r\n      if (!!this.state.prices) {\r\n        this.savePriceSubscription = ClinicSearchPriceSetObservable(this.state.prices).subscribe(\r\n          (data) => toast.success(data),\r\n          (error) => this.handleAPIError(error, {}),\r\n          () => this.setState({ savingOptions: false })\r\n        )\r\n      }\r\n\r\n      this.setState(prev => ({ ...prev, updateAdditionalOptions: !prev.updateAdditionalOptions }))\r\n    }\r\n  }\r\n\r\n  handleSaveAdditionalOptions = (saving: boolean) => {\r\n    this.setState(prev => ({ ...prev, savingAdditionalOptions: saving }))\r\n  }\r\n\r\n  validationErrorsRadius1 = (): string[] => {\r\n    const { radius1 } = this.state\r\n    var errors: string[] = []\r\n    const minValue = this.minRadius1Value()\r\n    const maxValue = this.maxRadius1Value()\r\n    if (!!radius1 && (radius1 < minValue || radius1 > maxValue)) {\r\n      if (minValue === 1) {\r\n        errors.push(`Minimum radius should be positive and not exceed ${maxValue} Miles`)\r\n      } else {\r\n        errors.push(`Minimum radius should be at least ${minValue} and no more than ${maxValue} Miles`)\r\n      }\r\n    }\r\n    return errors\r\n  }\r\n\r\n  validationErrorsRadius2 = (): string[] => {\r\n    const { radius1, radius2 } = this.state\r\n    var errors: string[] = []\r\n    const maxValue = this.maxRadius2Value()\r\n    if (!!radius2 && !!radius1) {\r\n      if (radius2 > maxValue) {\r\n        errors.push(`Maximum radius should be greater than Minimum radius and not exceed ${maxValue} Miles`)\r\n      }\r\n      if (radius1 >= radius2) {\r\n        errors.push(\"Maximum radius should be greater than Minimum radius\")\r\n      }\r\n    }\r\n    return errors\r\n  }\r\n\r\n  minRadius1Value = () => this.state.options?.ParentRadius1 || 1\r\n  maxRadius1Value = () => this.state.options?.ParentRadius2 || this.state.options?.MaximumRadius || 50\r\n  maxRadius2Value = () => this.state.options?.ParentRadius2 || this.state.options?.MaximumRadius || 50\r\n\r\n  render() {\r\n    const { prices, radius1, radius2, loadingOptions, loadingPrice, savingOptions, savingPrice, savingAdditionalOptions } = this.state\r\n\r\n    const radius1Errors = this.validationErrorsRadius1()\r\n    const radius2Errors = this.validationErrorsRadius2()\r\n    const radius1Entered = radius1 ? radius1 > 0 : false\r\n    const radius2Entered = radius2 ? radius2 > 0 : false\r\n    const isPortal = this.props.isPortal\r\n\r\n    return <>\r\n      <Container fluid>\r\n        <Row><Col className=\"pt-0\">\r\n          <div className=\"h5\">Radius Defaults&nbsp;{loadingOptions && <Spinner animation=\"border\" variant=\"secondary\" size=\"sm\" className=\"mb-1\" />}</div>\r\n        </Col></Row>\r\n        {!loadingOptions && <Row>\r\n          <Col lg={8}>\r\n            <Container fluid className=\"p-0\">\r\n              <Row className=\"form-group\">\r\n                <Form.Label column xs={7} lg={3} htmlFor=\"searchRadius1\" className=\"text-right\">Minimum (Miles)</Form.Label>\r\n                <Col xs={5} lg={1} className=\"p-0\">\r\n                  <Form.Control id=\"searchRadius1\"\r\n                    type=\"text\"\r\n                    maxLength={2}\r\n                    isInvalid={!radius1Entered}\r\n                    className=\"no-invalid-icon\"\r\n                    value={radius1?.toString() || \"\"}\r\n                    onChange={e => this.handleRadiusChange(e.target.value, \"radius1\")} />\r\n                </Col>\r\n                <Form.Label column=\"sm\" lg={7} htmlFor=\"searchRadius1\" className=\"pl-1 pr-0 pt-0 pt-lg-2 text-right text-lg-left\">\r\n                  Integer between {this.minRadius1Value()} and {this.maxRadius1Value()} (inclusive)\r\n                </Form.Label>\r\n                <Col xs={12} className=\"text-right text-lg-center mt-0 pt-0 pr-0\">\r\n                  {radius1Errors.map((error, i) => <Form.Control.Feedback key={i} type=\"invalid\" className=\"d-block\">{error}</Form.Control.Feedback>)}\r\n                </Col>\r\n              </Row>\r\n              <Row className=\"form-group\">\r\n                <Form.Label column xs={7} lg={3} htmlFor=\"searchRadius2\" className=\"text-right\">Maximum (Miles)</Form.Label>\r\n                <Col xs={5} lg={1} className=\"p-0\">\r\n                  <Form.Control id=\"searchRadius2\"\r\n                    type=\"text\"\r\n                    maxLength={2}\r\n                    isInvalid={!radius2Entered}\r\n                    className=\"no-invalid-icon\"\r\n                    value={radius2?.toString() || \"\"}\r\n                    onChange={e => this.handleRadiusChange(e.target.value, \"radius2\")} />\r\n                </Col>\r\n                <Form.Label column=\"sm\" lg={7} htmlFor=\"searchRadius1\" className=\"pl-1 pr-0 pt-0 pt-lg-2 text-right text-lg-left\">\r\n                  Integer greater than minimum and no more than {this.maxRadius2Value()}\r\n                </Form.Label>\r\n                <Col xs={12} className=\"text-right text-lg-center mt-0 pt-0 pr-0\">\r\n                  {radius2Errors.map((error, i) => <Form.Control.Feedback key={i} type=\"invalid\" className=\"d-block\">{error}</Form.Control.Feedback>)}\r\n                </Col>\r\n              </Row>\r\n              <Row className=\"form-group\">\r\n                <Col>\r\n                  <Checkbox\r\n                    id=\"MPonly\"\r\n                    name=\"MPonly\"\r\n                    label=\"Marketplace Sites Only\"\r\n                    checked={this.state.mpSitesOnlyPortalAdmin || this.state.mpSitesOnly}\r\n                    disabled={this.state.mpSitesOnlyPortalAdmin}\r\n                    onChange={(e: React.ChangeEvent<HTMLInputElement>) => this.setState({mpSitesOnly: e.target.checked})} />\r\n                </Col>\r\n              </Row>\r\n            </Container>\r\n          </Col>\r\n          {isPortal && <Col lg={4}><em className=\"small\">When searching for clinic you can set a minimum and maximum radius default.</em></Col>}\r\n        </Row>}\r\n        {isPortal && <>\r\n          <AdditionalOptions\r\n            isPortal={isPortal}\r\n            update={this.state.updateAdditionalOptions}\r\n            setSaving={this.handleSaveAdditionalOptions} />\r\n          {(loadingPrice || !!prices?.length) && <>\r\n            <Row><Col>\r\n              <div className=\"h5\">Price Tier Display Order&nbsp;{loadingPrice && <Spinner animation=\"border\" variant=\"secondary\" size=\"sm\" className=\"mb-1\" />}</div>\r\n            </Col></Row>\r\n            {!loadingPrice && <Row>\r\n              <Col lg={8}>\r\n                <DndProvider backend={HTML5Backend}>\r\n                  <DroppableContainer items={this.state.prices?.map(item => ({ id: item.PriceTierID.toString(), name: item.DisplayName, exclude: item.Exclude })) || []} onChangeItemsList={this.handleChangePriceItemsList} />\r\n                </DndProvider>\r\n              </Col>\r\n              <Col lg={4}><em className=\"small\">Drag and drop Tier to set the sort order for Tier to be displayed.</em></Col>\r\n            </Row>}\r\n          </>}\r\n        </>}\r\n        <Row className=\"buttons-block\">\r\n          <Button variant=\"secondary\" onClick={this.props.onCancel} className=\"mr-1\">Cancel</Button>\r\n          <ActionButton variant=\"primary\"\r\n            disabled={radius1Errors.length + radius2Errors.length > 0 || !radius1Entered || !radius2Entered || loadingOptions || loadingPrice}\r\n            onClick={this.handleUpdate}\r\n            spin={savingOptions || savingPrice || savingAdditionalOptions}\r\n            disableOnSpin>Update</ActionButton>\r\n        </Row>\r\n      </Container >\r\n    </>\r\n  }\r\n}\r\n","import * as React from \"react\"\r\nimport { Row, Spinner, Button, Table, Modal, Col } from \"react-bootstrap\"\r\nimport Clinic from \"../../../api/Clinics/Models/Clinic\"\r\nimport Checkbox from \"../../Checkbox\"\r\nimport ActionButton from \"../../ActionButton\"\r\nimport { toast } from \"react-toastify\"\r\nimport { Subscription } from \"rxjs\"\r\nimport { RetrieveOwnedSitesObservable, UpdateOwnedSitesObservable } from \"../../../api/Clinics/ClinicOptionsGet\"\r\n\r\ninterface OwnedPrimarySitesProps {\r\n  onCancel: () => void\r\n}\r\n\r\ninterface OwnedPrimarySitesState {\r\n  clinics: Clinic[]\r\n  loading: boolean\r\n  saving: boolean\r\n  primarySitesOnly: boolean\r\n}\r\n\r\nexport default class OwnedPrimarySites extends React.PureComponent<OwnedPrimarySitesProps, OwnedPrimarySitesState> {\r\n  state: OwnedPrimarySitesState = {\r\n    clinics: [],\r\n    loading: false,\r\n    saving: false,\r\n    primarySitesOnly: false\r\n  }\r\n\r\n  loadSubscription?: Subscription\r\n  updateSubscription?: Subscription\r\n\r\n  componentDidMount() {\r\n    this.handleRetrieve()\r\n  }\r\n\r\n  componentWillUnmount() {\r\n    this.loadSubscription && this.loadSubscription.unsubscribe()\r\n    this.updateSubscription && this.updateSubscription.unsubscribe()\r\n  }\r\n\r\n  handleAPIError = (error: Error, stateChanges: object) => {\r\n    this.setState(stateChanges)\r\n    toast.error(error)\r\n  }\r\n\r\n  handleRetrieve = () => {\r\n    this.setState({ loading: true })\r\n    this.loadSubscription = RetrieveOwnedSitesObservable().subscribe(\r\n      (data) => {\r\n        this.setState({ clinics: data.Clinics, primarySitesOnly: data.UsePrimarySitesOnly, loading: false })\r\n      },\r\n      (error) => this.handleAPIError(error, { loading: false })\r\n    )\r\n  }\r\n\r\n  handleUpdate = () => {\r\n    this.setState({ saving: true })\r\n    this.updateSubscription = UpdateOwnedSitesObservable({UsePrimarySitesOnly: this.state.primarySitesOnly, Clinics: this.state.clinics}).subscribe(\r\n      (data) => {\r\n        toast.success(data)\r\n        this.setState({ saving: false })\r\n      },\r\n      (error) => this.handleAPIError(error, { saving: false })\r\n    )\r\n  }\r\n\r\n  findItem = (id: number) => {\r\n    const item = this.state.clinics.filter((c) => c.ClinicSearchListID === id)[0]\r\n    return {\r\n      item: item,\r\n      index: this.state.clinics.indexOf(item),\r\n    }\r\n  }\r\n\r\n  excludeItem = (id: number, exclude: boolean) => {\r\n    const { item, index } = this.findItem(id)\r\n    if (item) {\r\n      const newItems = [...this.state.clinics]\r\n      newItems[index].Exclude = !!exclude\r\n      this.setState({ clinics: newItems })\r\n    }\r\n  }\r\n\r\n  render() {\r\n    const { clinics, loading, saving, primarySitesOnly } = this.state\r\n\r\n    return <>\r\n      <Table className=\"table-sm dark mt-3\" borderless responsive>\r\n        <thead>\r\n          <tr>\r\n            <th>Site Name</th>\r\n            <th>Site Code</th>\r\n            <th>Exclude</th>\r\n          </tr>\r\n        </thead>\r\n        <tbody>\r\n          {loading && <tr><td colSpan={2} className=\"text-center\"><Spinner animation=\"border\" variant=\"secondary\" className=\"mb-1\" /></td></tr>}\r\n          {!loading && clinics.length === 0 && <tr><td colSpan={3}>No Private Sites Available</td></tr>}\r\n          {clinics.map(item => <tr key={item.ClinicSearchListID} className={`border-top`}>\r\n            <td>{item.Name}</td>\r\n            <td>{item.Code}</td>\r\n            <td><Checkbox id={`${item.ClinicSearchListID}_exclude`} name=\"Exclude\" label=\"\" checked={!!item.Exclude} onChange={(e: React.ChangeEvent<HTMLInputElement>) => this.excludeItem(item.ClinicSearchListID, !!e.target.checked)}/></td>\r\n          </tr>)}\r\n        </tbody>\r\n      </Table>\r\n      {!loading &&<Row className=\"form-group\">\r\n        <Col>\r\n          <Checkbox id=\"PrimaryOnly\" name=\"PrimaryOnly\" label=\"Use Private Sites Only\"\r\n                                checked={primarySitesOnly} onChange={(e: React.ChangeEvent<HTMLInputElement>) => this.setState({primarySitesOnly: e.target.checked})} />\r\n        </Col>\r\n      </Row>}\r\n      <Row className=\"buttons-block\">\r\n        <ActionButton variant=\"primary\" className=\"mr-1\" onClick={() => this.handleUpdate()} disabled={loading} spin={saving} disableOnSpin>Update</ActionButton>\r\n        <Button variant=\"secondary\" onClick={this.props.onCancel} className=\"ml-1\">Cancel</Button>\r\n      </Row>\r\n    </>\r\n  }\r\n}","import * as React from \"react\"\r\nimport { Row, Spinner, Button, Table, Modal } from \"react-bootstrap\"\r\nimport { toast } from \"react-toastify\"\r\nimport { concat, of, Subject, Subscription } from \"rxjs\"\r\nimport { catchError, map, switchMap } from \"rxjs/operators\"\r\nimport Clinic from \"../../../api/Clinics/Models/Clinic\"\r\nimport { ClinicGetObservable, ClinicSearchListRemoveObservable, ClinicSearchListAddObservable } from \"../../../api/Clinics/ClinicOptionsGet\"\r\nimport ActionButton from \"../../ActionButton\"\r\nimport SiteSearch from \"../../SiteSearch/SiteSearch\"\r\nimport CollectionSite from \"../../../api/Location/LocationModel/CollectionSite\"\r\nimport OwnedPrimarySites from \"./OwnedPrimarySites\"\r\n\r\ninterface ListOptionsProps {\r\n  headerText?: string\r\n  isCompany: boolean\r\n  clinicSearchListTypeID: number\r\n  IsPrimary: boolean\r\n  onCancel: () => void\r\n}\r\n\r\ninterface ListOptionsState {\r\n  clinics: Clinic[]\r\n  selected: Clinic[]\r\n  loading: boolean\r\n  adding: boolean\r\n  removing: boolean\r\n  showSiteSearchModal: boolean\r\n}\r\n\r\nexport default class ListOptions extends React.PureComponent<ListOptionsProps, ListOptionsState> {\r\n  state: ListOptionsState = {\r\n    clinics: [],\r\n    selected: [],\r\n    loading: false,\r\n    adding: false,\r\n    removing: false,\r\n    showSiteSearchModal: false\r\n  }\r\n\r\n  clinicSearchListTypeID$ = new Subject<number>()\r\n\r\n  loadSubscription?: Subscription\r\n  addSubscription?: Subscription\r\n  removeSubscription?: Subscription\r\n\r\n  componentDidMount() {\r\n    this.loadSubscription = this.clinicSearchListTypeID$.pipe(\r\n      switchMap(id => concat(\r\n        of({ loading: true }),\r\n        ClinicGetObservable(id).pipe(\r\n          map(result => ({ loading: false, result: result })),\r\n          catchError((error) => of({ loading: false, errorMessage: error.message }))\r\n        )\r\n      ))\r\n    ).subscribe(\r\n      (o: { loading: boolean, result?: Clinic[], errorMessage?: string }) => {\r\n        this.setState({ loading: o.loading, selected: [], clinics: o.result || [] })\r\n        if (o.errorMessage) {\r\n          toast.error(o.errorMessage)\r\n        }\r\n      },\r\n      (error) => this.handleAPIError(error, { loading: false, userInfo: undefined })\r\n    )\r\n    this.clinicSearchListTypeID$.next(this.props.clinicSearchListTypeID)\r\n  }\r\n\r\n  componentWillUnmount() {\r\n    this.loadSubscription && this.loadSubscription.unsubscribe()\r\n    this.addSubscription && this.addSubscription.unsubscribe()\r\n    this.removeSubscription && this.removeSubscription.unsubscribe()\r\n  }\r\n\r\n  handleAPIError = (error: Error, stateChanges: object) => {\r\n    this.setState(stateChanges)\r\n    toast.error(error)\r\n  }\r\n\r\n  handleClinicClick = (clinic: Clinic) => {\r\n    if (this.state.selected.includes(clinic)) {\r\n      this.setState({ selected: this.state.selected.filter(item => item !== clinic) })\r\n    } else {\r\n      this.setState({ selected: [...this.state.selected, clinic] })\r\n    }\r\n  }\r\n\r\n  handleRemove = () => {\r\n    const ids = this.state.selected.map(item => item.ClinicSearchListID)\r\n    this.setState({ removing: true })\r\n    this.removeSubscription = ClinicSearchListRemoveObservable(this.props.clinicSearchListTypeID, ids).subscribe(\r\n      (data) => {\r\n        toast.success(data)\r\n        this.setState({ removing: false })\r\n        this.clinicSearchListTypeID$.next(this.props.clinicSearchListTypeID)\r\n      },\r\n      (error) => this.handleAPIError(error, { removing: false })\r\n    )\r\n  }\r\n\r\n  handleAdd = (site: CollectionSite) => {\r\n    this.setState({ adding: true, showSiteSearchModal: false })\r\n    this.addSubscription = ClinicSearchListAddObservable(this.props.clinicSearchListTypeID, site.Code, site.Name).subscribe(\r\n      (data) => {\r\n        toast.success(data)\r\n        this.setState({ adding: false })\r\n        this.clinicSearchListTypeID$.next(this.props.clinicSearchListTypeID)\r\n      },\r\n      (error) => this.handleAPIError(error, { adding: false })\r\n    )\r\n  }\r\n\r\n  render() {\r\n    const { headerText } = this.props\r\n    const { clinics, selected, loading, adding, removing, showSiteSearchModal } = this.state\r\n    const disableRemove = selected.length === 0 || (this.props.isCompany && selected.length > 0 && !selected.every(el=> el.AccountID || 0 > 0))\r\n\r\n    return <>\r\n      {headerText && <h5 className=\"mb-0\">{headerText}</h5>}\r\n      <Table className={`table-sm dark ${headerText ? \"\" : \"mt-3\"}`} borderless responsive>\r\n        <thead>\r\n          <tr>\r\n            <th>Clinic Name</th>\r\n            <th>Clinic Code</th>\r\n          </tr>\r\n        </thead>\r\n        <tbody>\r\n          {loading && <tr><td colSpan={2} className=\"text-center\"><Spinner animation=\"border\" variant=\"secondary\" className=\"mb-1\" /></td></tr>}\r\n          {!loading && clinics.length === 0 && <tr><td colSpan={2}>NO DATA FOUND</td></tr>}\r\n          {clinics.map(item => <tr key={item.ClinicSearchListID} className={`border-top ${selected.includes(item) ? \"selected\" : \"\"}`} onClick={() => this.handleClinicClick(item)}>\r\n            <td>{item.Name}{this.props.isCompany && !item.AccountID ? \" (Configured for Portal)\" : \"\"}</td>\r\n            <td>{item.Code}</td>\r\n          </tr>)}\r\n        </tbody>\r\n      </Table>\r\n      <Row className=\"buttons-block\">\r\n        <ActionButton variant=\"primary\" className=\"mr-1\" onClick={() => this.setState({ showSiteSearchModal: true })} spin={adding} disableOnSpin>Site Search</ActionButton>\r\n        <ActionButton variant=\"secondary\" disabled={disableRemove} onClick={this.handleRemove} spin={removing} disableOnSpin>Remove</ActionButton>\r\n        {!this.props.IsPrimary && <Button variant=\"secondary\" onClick={this.props.onCancel} className=\"ml-1\">Cancel</Button>}\r\n      </Row>\r\n      {this.props.IsPrimary && <OwnedPrimarySites onCancel={this.props.onCancel} /> }\r\n      <Modal show={showSiteSearchModal} size=\"xl\" onHide={() => this.setState({ showSiteSearchModal: false })}>\r\n        <Modal.Header closeButton>\r\n          <Modal.Title className=\"text-uppercase\">SITE SEARCH</Modal.Title>\r\n        </Modal.Header>\r\n        <Modal.Body>\r\n          <SiteSearch onSiteSelect={this.handleAdd} />\r\n        </Modal.Body>\r\n      </Modal>\r\n    </>\r\n  }\r\n}\r\n","import { useCallback } from \"react\"\r\n\r\nimport { Col, Row } from \"react-bootstrap\"\r\n\r\nimport ClinicGroupFF from \"../../../../api/Clinics/Models/ClinicGroupFF\"\r\nimport ToggleSwitch from \"../../../FormattedInputs/ToggleSwitch\"\r\n\r\ninterface IFFClinicGroupRowProps {\r\n  group: ClinicGroupFF\r\n  onClick: (group: ClinicGroupFF, excluded: boolean) => void\r\n}\r\n\r\nfunction FFClinicGroupRow(props: IFFClinicGroupRowProps) {\r\n  const { group, onClick } = props\r\n\r\n  const handleExcludeGroup = useCallback(\r\n    (checked: boolean) => {\r\n      onClick(group, checked)\r\n    },\r\n    [group, onClick]\r\n  )\r\n\r\n  return (\r\n    <Row>\r\n      <Col sm={9} className=\"d-flex align-items-center\">\r\n        {group.Name}\r\n      </Col>\r\n      <Col sm={3} className=\"d-flex align-items-center\">\r\n        <ToggleSwitch\r\n          className=\"my-1 mx-auto\"\r\n          on=\"Yes\"\r\n          off=\"No\"\r\n          checked={group.excluded}\r\n          onCheck={handleExcludeGroup}\r\n        />\r\n      </Col>\r\n    </Row>\r\n  )\r\n}\r\n\r\nexport default FFClinicGroupRow\r\n","import { useCallback, useEffect, useRef, useState } from \"react\"\r\n\r\nimport { Button, Col, Modal, Row, Spinner } from \"react-bootstrap\"\r\nimport { toast } from \"react-toastify\"\r\nimport { Subscription } from \"rxjs\"\r\nimport { finalize } from \"rxjs/operators\"\r\n\r\nimport FFClinicGroupRow from \"./FFClinicGroupRow\"\r\nimport { GetFFClinicGroupsObservable, SetExcludedClinicGroupsObservable } from \"../../../../api/Clinics/ClinicGroupsGet\"\r\nimport ClinicGroup from \"../../../../api/Clinics/Models/ClinicGroup\"\r\nimport ClinicGroupFF from \"../../../../api/Clinics/Models/ClinicGroupFF\"\r\nimport FormatError from \"../../../../formatters/FormatError\"\r\nimport ActionButton from \"../../../ActionButton\"\r\n\r\ninterface IClinicGroupsFFModalProps {\r\n  excludedGroups: ClinicGroup[]\r\n  onHide?: () => void\r\n}\r\n\r\nfunction ClinicGroupsFFModal(props: IClinicGroupsFFModalProps) {\r\n  const { onHide, excludedGroups } = props\r\n  const [show, setShow] = useState(false)\r\n  const [groups, setGroups] = useState<ClinicGroupFF[]>([])\r\n  const [loadingGroups, setLoadingGroups] = useState(false)\r\n  const [savingGroups, setSavingGroups] = useState(false)\r\n\r\n  const subsRef = useRef({\r\n    subs: new Subscription(),\r\n  })\r\n\r\n  useEffect(() => {\r\n    const { subs } = subsRef.current\r\n    return () => subs.unsubscribe()\r\n  }, [])\r\n\r\n  useEffect(() => {\r\n    if (show) {\r\n      setLoadingGroups(true)\r\n      subsRef.current.subs.add(\r\n        GetFFClinicGroupsObservable()\r\n          .pipe(finalize(() => setLoadingGroups(false)))\r\n          .subscribe(\r\n            (data) => {\r\n              setGroups(\r\n                data.map<ClinicGroupFF>((group) => ({\r\n                  ...group,\r\n                  SearchRestrictID: excludedGroups.find((e) => e.RestrictCode === group.Id.toString())\r\n                    ?.SearchRestrictId,\r\n                  excluded: excludedGroups.some((e) => e.RestrictCode === group.Id.toString()),\r\n                }))\r\n              )\r\n            },\r\n            (error) => toast.error(FormatError(error))\r\n          )\r\n      )\r\n    }\r\n  }, [excludedGroups, show])\r\n\r\n  const handleHide = () => {\r\n    onHide?.()\r\n    setShow(false)\r\n  }\r\n\r\n  const handleSave = () => {\r\n    setSavingGroups(true)\r\n    SetExcludedClinicGroupsObservable(groups)\r\n      .pipe(finalize(() => setSavingGroups(false)))\r\n      .subscribe(\r\n        (data) => {\r\n          handleHide()\r\n          toast.success(data)\r\n        },\r\n        (error) => toast.error(FormatError(error))\r\n      )\r\n  }\r\n\r\n  const handleExcludeGroup = useCallback(\r\n    (group: ClinicGroupFF, excluded: boolean) => {\r\n      setGroups(groups.map((p) => (p.Id === group.Id && p.excluded !== excluded ? { ...p, excluded } : p)))\r\n    },\r\n    [groups]\r\n  )\r\n\r\n  return (\r\n    <>\r\n      <Button variant=\"primary\" className=\"mr-1\" disabled={loadingGroups} onClick={() => setShow(true)}>\r\n        Group Search\r\n      </Button>\r\n      {show && (\r\n        <Modal show onHide={handleHide} backdrop=\"static\">\r\n          <Modal.Header closeButton>\r\n            <Modal.Title>Clinic Group Name</Modal.Title>\r\n          </Modal.Header>\r\n          <Modal.Body>\r\n            <Row className=\"font-weight-bold mb-1\">\r\n              <Col sm={9}>Name</Col>\r\n              <Col sm={3} className=\"text-center\">\r\n                Excluded\r\n              </Col>\r\n            </Row>\r\n            {loadingGroups ? (\r\n              <Spinner animation=\"border\" variant=\"secondary\" className=\"mb-1\" />\r\n            ) : (\r\n              groups.map((group) => <FFClinicGroupRow key={group.Id} group={group} onClick={handleExcludeGroup} />)\r\n            )}\r\n          </Modal.Body>\r\n          <Modal.Footer>\r\n            <ActionButton\r\n              variant=\"primary\"\r\n              className=\"mr-1\"\r\n              spin={savingGroups}\r\n              disableOnSpin\r\n              disabled={loadingGroups || groups.length === 0}\r\n              onClick={handleSave}\r\n            >\r\n              Save\r\n            </ActionButton>\r\n            <Button variant=\"secondary\" className=\"mr-1\" disabled={loadingGroups} onClick={() => setShow(false)}>\r\n              Cancel\r\n            </Button>\r\n          </Modal.Footer>\r\n        </Modal>\r\n      )}\r\n    </>\r\n  )\r\n}\r\n\r\nClinicGroupsFFModal.defaultProps = {\r\n  onHide: undefined,\r\n}\r\n\r\nexport default ClinicGroupsFFModal\r\n","import { Observable } from \"rxjs\"\r\n\r\nimport ClinicGroup, { ClinicGroupSelected } from \"./Models/ClinicGroup\"\r\nimport ClinicGroupFF from \"./Models/ClinicGroupFF\"\r\nimport { ObservableFromFetch } from \"../ObservableFromFetch\"\r\n\r\nexport function GetExcludedClinicGroupsObservable(): Observable<ClinicGroup[]> {\r\n  return ObservableFromFetch<ClinicGroup[]>(\"WorkforceClinicGroups/GetExcludedClinicGroups\")\r\n}\r\n\r\nexport function GetFFClinicGroupsObservable(): Observable<ClinicGroupFF[]> {\r\n  return ObservableFromFetch<ClinicGroupFF[]>(\"WorkforceClinicGroups/GetFFClinicGroups\")\r\n}\r\n\r\nexport function SetExcludedClinicGroupsObservable(groups: ClinicGroupFF[]): Observable<string> {\r\n  const requestBody: string = JSON.stringify(groups)\r\n  return ObservableFromFetch<string>(\"WorkforceClinicGroups/ManageExcludedClinicGroups\", requestBody)\r\n}\r\n\r\nexport function DeleteExcludedClinicGroupsObservable(groups: ClinicGroupSelected[]): Observable<string> {\r\n  const requestBody: string = JSON.stringify(groups)\r\n  return ObservableFromFetch<string>(\"WorkforceClinicGroups/DeleteExcludedClinicGroups\", requestBody)\r\n}\r\n","import { ClinicGroupSelected } from \"../../../../api/Clinics/Models/ClinicGroup\"\r\n\r\ninterface IExcludeClinicGroupRowProps {\r\n  group: ClinicGroupSelected\r\n  onClick: (group: ClinicGroupSelected) => void\r\n}\r\n\r\nfunction ExcludeClinicGroupRow(props: IExcludeClinicGroupRowProps) {\r\n  const { group, onClick } = props\r\n\r\n  return (\r\n    <tr\r\n      key={group.SearchRestrictId}\r\n      role=\"button\"\r\n      className={`border-top ${group.selected ? \"selected\" : \"\"}`}\r\n      onClick={() => onClick(group)}\r\n    >\r\n      <td>{group.Name}</td>\r\n    </tr>\r\n  )\r\n}\r\n\r\nexport default ExcludeClinicGroupRow\r\n","import { Spinner, Table } from \"react-bootstrap\"\r\n\r\nimport ExcludeClinicGroupRow from \"./ExcludeClinicGroupRow\"\r\nimport { ClinicGroupSelected } from \"../../../../api/Clinics/Models/ClinicGroup\"\r\n\r\ninterface IExcludeClinicGroupTableProps {\r\n  groups: ClinicGroupSelected[]\r\n  loadingGroups: boolean\r\n  onSelectGroup: (group: ClinicGroupSelected) => void\r\n}\r\n\r\nfunction ExcludeClinicGroupTable(props: IExcludeClinicGroupTableProps) {\r\n  const { groups, loadingGroups, onSelectGroup } = props\r\n\r\n  return (\r\n    <Table className=\"table-sm dark my-0\" borderless responsive>\r\n      <thead>\r\n        <tr>\r\n          <th>Group Name</th>\r\n        </tr>\r\n      </thead>\r\n      <tbody>\r\n        {loadingGroups && (\r\n          <tr>\r\n            <td colSpan={2} className=\"text-center\">\r\n              <Spinner animation=\"border\" variant=\"secondary\" className=\"mb-1\" />\r\n            </td>\r\n          </tr>\r\n        )}\r\n        {!loadingGroups && groups.length === 0 && (\r\n          <tr>\r\n            <td>NO GROUPS FOUND</td>\r\n          </tr>\r\n        )}\r\n        {!loadingGroups &&\r\n          groups.map((group) => (\r\n            <ExcludeClinicGroupRow key={group.SearchRestrictId} group={group} onClick={onSelectGroup} />\r\n          ))}\r\n      </tbody>\r\n    </Table>\r\n  )\r\n}\r\n\r\nexport default ExcludeClinicGroupTable\r\n","import { useCallback, useEffect, useRef, useState } from \"react\"\r\n\r\nimport { Row } from \"react-bootstrap\"\r\nimport { toast } from \"react-toastify\"\r\nimport { Subscription } from \"rxjs\"\r\nimport { finalize } from \"rxjs/operators\"\r\n\r\nimport ClinicGroupsFFModal from \"./ClinicGroupsFFModal\"\r\nimport ExcludeClinicGroupTable from \"./ExcludeClinicGroupTable\"\r\nimport {\r\n  DeleteExcludedClinicGroupsObservable,\r\n  GetExcludedClinicGroupsObservable,\r\n} from \"../../../../api/Clinics/ClinicGroupsGet\"\r\nimport { ClinicGroupSelected } from \"../../../../api/Clinics/Models/ClinicGroup\"\r\nimport FormatError from \"../../../../formatters/FormatError\"\r\nimport ActionButton from \"../../../ActionButton\"\r\n\r\nfunction ExcludeClinicGroup() {\r\n  const [groups, setGroups] = useState<ClinicGroupSelected[]>([])\r\n  const [refresh, setRefresh] = useState(false)\r\n  const [loadingGroups, setLoadingGroup] = useState(false)\r\n  const [removingGroups, setRemovingGroups] = useState(false)\r\n\r\n  const subsRef = useRef({\r\n    subs: new Subscription(),\r\n  })\r\n\r\n  useEffect(() => {\r\n    const { subs } = subsRef.current\r\n    return () => subs.unsubscribe()\r\n  }, [])\r\n\r\n  useEffect(() => {\r\n    setLoadingGroup(true)\r\n    subsRef.current.subs.add(\r\n      GetExcludedClinicGroupsObservable()\r\n        .pipe(finalize(() => setLoadingGroup(false)))\r\n        .subscribe(\r\n          (data) =>\r\n            setGroups(\r\n              data.map<ClinicGroupSelected>((group) => ({\r\n                ...group,\r\n                selected: false,\r\n              }))\r\n            ),\r\n          (error) => toast.error(FormatError(error))\r\n        )\r\n    )\r\n  }, [refresh])\r\n\r\n  const handleHideClinicGroupsFFModal = useCallback(() => {\r\n    setRefresh((prev) => !prev)\r\n  }, [])\r\n\r\n  const handleGroupClick = useCallback((group: ClinicGroupSelected) => {\r\n    setGroups((prev) =>\r\n      prev.map((p) => (p.SearchRestrictId === group.SearchRestrictId ? { ...p, selected: !group.selected } : p))\r\n    )\r\n  }, [])\r\n\r\n  const handleRemoveGroup = useCallback(() => {\r\n    setRemovingGroups(true)\r\n    subsRef.current.subs.add(\r\n      DeleteExcludedClinicGroupsObservable(groups.filter((g) => g.selected))\r\n        .pipe(finalize(() => setRemovingGroups(false)))\r\n        .subscribe(\r\n          (data) => {\r\n            setGroups((prev) => prev.filter((g) => !g.selected))\r\n            toast.success(data)\r\n          },\r\n          (error) => toast.error(FormatError(error))\r\n        )\r\n    )\r\n  }, [groups])\r\n\r\n  return (\r\n    <>\r\n      <h5 className=\"mb-0\">Exclude by FormFox Clinic Group</h5>\r\n      <ExcludeClinicGroupTable onSelectGroup={handleGroupClick} loadingGroups={loadingGroups} groups={groups} />\r\n      <Row className=\"buttons-block\">\r\n        <ClinicGroupsFFModal onHide={handleHideClinicGroupsFFModal} excludedGroups={groups} />\r\n        <ActionButton\r\n          variant=\"secondary\"\r\n          className=\"mr-1\"\r\n          onClick={handleRemoveGroup}\r\n          disabled={groups.every((g) => !g.selected)}\r\n          spin={removingGroups}\r\n          disableOnSpin\r\n        >\r\n          Remove\r\n        </ActionButton>\r\n      </Row>\r\n    </>\r\n  )\r\n}\r\n\r\nexport default ExcludeClinicGroup\r\n","import * as React from \"react\"\r\nimport { Tab, Row, Col, Modal, Nav, Spinner } from \"react-bootstrap\"\r\nimport { Subscription } from \"rxjs\"\r\nimport { toast } from \"react-toastify\"\r\nimport ClinicSearchListType from \"../../api/Clinics/Models/ClinicSearchListType\"\r\nimport { ClinicSearchListTypesGetObservable } from \"../../api/Clinics/ClinicOptionsGet\"\r\nimport DefaultOptions from \"./ClinicSearchOptions/DefaultOptions\"\r\nimport ListOptions from \"./ClinicSearchOptions/ListOptions\"\r\nimport { AppState } from \"../../AppState\"\r\nimport { isCompanyAdmin, isPortalAdmin } from \"../../authentication/isAdminRole\"\r\nimport { connect } from \"react-redux\"\r\nimport { AppPageWrapper } from \"../NavMenu/AppPageWrapper\"\r\nimport { RouteComponentProps } from \"react-router\"\r\nimport { Home } from \"../../config/Routes\"\r\nimport ExcludeClinicGroup from \"./ClinicSearchOptions/ExcludeClinicGroup/ExcludeClinicGroup\"\r\n\r\nenum TabName {\r\n  DEFAULT = \"Default\", \r\n  BLACKLIST = \"Blacklist\"\r\n} \r\n\r\ninterface ListData {\r\n  name: string\r\n  title: string\r\n  tabName: string\r\n  headerText?: string\r\n  clinicSearchListTypeID: number\r\n  visible: (state: ClinicSearchOptionsState) => boolean\r\n}\r\n\r\nconst LISTS: ListData[] = [\r\n  {\r\n    name: \"Primary\",\r\n    title: \"Primary\",\r\n    tabName: \"Primary\",\r\n    clinicSearchListTypeID: 0,\r\n    visible: (state) => state.isPortal || state.isCompany\r\n  },\r\n  {\r\n    name: TabName.BLACKLIST,\r\n    title: \"Exclusion List\",\r\n    tabName: \"Exclusion List\",\r\n    clinicSearchListTypeID: 0,\r\n    headerText: \"Exclude by individual FormFox Site\",\r\n    visible: (state) => state.isPortal || state.isCompany,\r\n  },\r\n  {\r\n    name: \"Favorite\",\r\n    title: \"Favorite\",\r\n    tabName: \"Favorites\",\r\n    clinicSearchListTypeID: 0,\r\n    visible: (state) => false\r\n  }\r\n]\r\n\r\ninterface ClinicSearchOptionsProps {\r\n  appState: AppState\r\n}\r\n\r\ninterface ClinicSearchOptionsState {\r\n  currentTab: string\r\n  loading: boolean\r\n  lists: ListData[]\r\n  isPortal: boolean\r\n  isCompany: boolean\r\n}\r\n\r\nexport class ClinicSearchOptions extends React.PureComponent<ClinicSearchOptionsProps & RouteComponentProps, ClinicSearchOptionsState> {\r\n  state: ClinicSearchOptionsState = {\r\n    currentTab: TabName.DEFAULT,\r\n    loading: false,\r\n    lists: [],\r\n    isPortal: isPortalAdmin(this.props.appState),\r\n    isCompany: isCompanyAdmin(this.props.appState)\r\n  }\r\n\r\n  loadSubscription?: Subscription\r\n\r\n  componentDidMount() {\r\n    if (this.state.isPortal || this.state.isCompany) {\r\n      this.setState({ loading: true })\r\n      this.loadSubscription = ClinicSearchListTypesGetObservable().subscribe(\r\n        data => this.setState({ lists: this.buildVisibleLists(data), loading: false }),\r\n        (error) => toast.error(error.message),\r\n        () => this.setState({ loading: false })\r\n      )\r\n    }\r\n  }\r\n\r\n  componentWillUnmount() {\r\n    this.loadSubscription && this.loadSubscription.unsubscribe()\r\n  }\r\n\r\n  buildVisibleLists = (listTypes: ClinicSearchListType[]): ListData[] => {\r\n    const lists = LISTS.map(item => ({\r\n      ...item,\r\n      clinicSearchListTypeID: listTypes.find(listType => listType.Name === item.name)?.ClinicSearchListTypeID || 0\r\n    }))\r\n    return lists.filter(item => item.clinicSearchListTypeID > 0 && item.visible(this.state))\r\n  }\r\n\r\n  handleCancel = () => (this.props as RouteComponentProps).history?.push(Home)\r\n\r\n  render() {\r\n    const { currentTab, loading, lists, isPortal, isCompany } = this.state\r\n    return (\r\n      <AppPageWrapper showNav>\r\n        <Modal.Dialog size=\"xl\" >\r\n          <Modal.Header>\r\n            <Modal.Title>\r\n              Clinic Search Options/{lists.find((item) => item.name === currentTab)?.title || TabName.DEFAULT}\r\n            </Modal.Title>\r\n          </Modal.Header>\r\n          <Modal.Body className=\"pt-0\">\r\n            <Tab.Container defaultActiveKey={TabName.DEFAULT}>\r\n              <Row>\r\n                <Col lg={2} className=\"pt-2\">\r\n                  <Nav\r\n                    variant=\"pills\"\r\n                    className=\"flex-column pills-sm\"\r\n                    onSelect={(eventKey) => {\r\n                      eventKey && this.setState({ currentTab: eventKey })\r\n                    }}\r\n                  >\r\n                    <Nav.Item>\r\n                      <Nav.Link eventKey={TabName.DEFAULT}>Default</Nav.Link>\r\n                    </Nav.Item>\r\n                    {lists.map((item) => (\r\n                      <Nav.Item key={item.name}>\r\n                        <Nav.Link eventKey={item.name}>{item.tabName}</Nav.Link>\r\n                      </Nav.Item>\r\n                    ))}\r\n                  </Nav>\r\n                  {loading && (\r\n                    <div className=\"text-center\">\r\n                      <Spinner animation=\"border\" variant=\"secondary\" size=\"sm\" />\r\n                    </div>\r\n                  )}\r\n                  <em hidden={TabName.DEFAULT === currentTab} className=\"small\">\r\n                    To add, enter clinic information and click \"Site Search\" and you will be presented with a list site\r\n                    matching search criteria. Locate the desired site and click \"Select Site\" to add.\r\n                    <br />\r\n                    <br />\r\n                    To remove, highlight record and click \"Remove\".\r\n                  </em>\r\n                </Col>\r\n                <Col lg={10}>\r\n                  <Tab.Content>\r\n                    <Tab.Pane eventKey={TabName.DEFAULT}>\r\n                      {TabName.DEFAULT === currentTab && (\r\n                        <DefaultOptions onCancel={() => this.handleCancel()} isPortal={isPortal} />\r\n                      )}\r\n                    </Tab.Pane>\r\n                    {!loading &&\r\n                      lists.map((item) => (\r\n                        <Tab.Pane key={item.name} eventKey={item.name} title={item.tabName}>\r\n                          {item.name === currentTab && TabName.BLACKLIST === currentTab && isPortal && <ExcludeClinicGroup />}\r\n                          {item.name === currentTab && (\r\n                            <ListOptions\r\n                              isCompany={isCompany}\r\n                              IsPrimary={item.tabName === \"Primary\"}\r\n                              headerText={item.headerText}\r\n                              clinicSearchListTypeID={item.clinicSearchListTypeID}\r\n                              onCancel={() => this.handleCancel()}\r\n                            />\r\n                          )}\r\n                        </Tab.Pane>\r\n                      ))}\r\n                  </Tab.Content>\r\n                </Col>\r\n              </Row>\r\n            </Tab.Container>\r\n          </Modal.Body>\r\n        </Modal.Dialog>\r\n      </AppPageWrapper>\r\n    )\r\n  }\r\n}\r\n\r\nfunction mapStateToProps(state: AppState): { appState: AppState } {\r\n  return {\r\n    appState: state\r\n  }\r\n}\r\nconst ConnectedClinicSearchOptions = connect(mapStateToProps, null)(ClinicSearchOptions)\r\nexport default ConnectedClinicSearchOptions","import React, {Component} from 'react'\r\nimport {Button, Card, Col, Container, Form, Image, ListGroup, Row} from \"react-bootstrap\";\r\nimport { connect } from 'react-redux'\r\nimport {Action, Dispatch} from \"redux\";\r\nimport {AppPageWrapper} from \"../NavMenu/AppPageWrapper\";\r\nimport {AppState, AssignedClinic, WorkforceClinicPortal} from \"../../AppState\";\r\nimport {SelectCompany} from \"../../actions/WorkforceClinicAction\";\r\nimport { CompareAccounts, SelectedAccountName } from \"../../authentication/SelectedCompany/CompanySelectionDrivenSelectors\"\r\n\r\nexport interface CompanySelectionProps{\r\n\r\n}\r\nexport interface CompanySelectionAppStateProps{\r\n    selectableCompanies?: WorkforceClinicPortal[];\r\n}\r\nexport interface CompanySelectionDispatchProps{\r\n    selectCompany: (company: string, companyLink: string) => void\r\n}\r\nexport class CompanySelection extends Component<CompanySelectionProps & CompanySelectionAppStateProps& CompanySelectionDispatchProps>{\r\n\r\n    selectCompany = (company: AssignedClinic) => {\r\n        this.props.selectCompany(company.ParticipationID, company.Link);\r\n    }\r\n\r\n    selectPortal = (portal: WorkforceClinicPortal) => {\r\n        this.props.selectCompany(portal.ParticipationID || '', portal.Link || '');\r\n    }\r\n\r\n    render() {\r\n        const companies = (this.props.selectableCompanies?.sort((a, b) => (a.ImplementationName || \"\").localeCompare(b.ImplementationName || \"\")) || []).map(\r\n            (portal, portalIndex) => {\r\n                const childCompanies =  portal.AssignedClientDetailsOfClinic.filter(company => !company.LocationID).sort(CompareAccounts).map((clinic, clinicIndex) => {\r\n                    return (<ListGroup.Item key={portalIndex + \"-\" + clinicIndex}>\r\n                        <Button block={true} onClick={() => {\r\n                            this.selectCompany(clinic)\r\n                        }} variant=\"outline-primary\">{SelectedAccountName(clinic)}</Button>\r\n                    </ListGroup.Item>);\r\n                });\r\n                return <ListGroup key={`${portal.ImplementationName}-${portalIndex}`}>\r\n                        <ListGroup className=\"m-2\">\r\n                            {childCompanies}\r\n                        </ListGroup>\r\n                    </ListGroup>\r\n            }\r\n        );\r\n        return <AppPageWrapper showNav={false}  hideLogo={true} >\r\n            <Container fluid className=\"text-center\">\r\n                <div className=\"m-2\">\r\n                    <Row>\r\n                        <Col md={{ span: 4, offset: 4 }}>\r\n                            <Card>\r\n                                <Card.Header className=\"bg-light\">Company Selection</Card.Header>\r\n                                <Card.Body>\r\n                                    {companies}\r\n                                </Card.Body>\r\n                            </Card>\r\n                        </Col>\r\n                    </Row>\r\n                </div>\r\n            </Container>\r\n        </AppPageWrapper>\r\n    }\r\n}\r\nfunction mapStateToProps(state: AppState): CompanySelectionAppStateProps {\r\n    return {\r\n        selectableCompanies: state.Workforce1Companies.visibleCompanies\r\n    }\r\n}\r\nfunction mapDispatchProps(dispatch: Dispatch<Action>): CompanySelectionDispatchProps {\r\n    return {\r\n        selectCompany: (company: string, companyLink: string) => (dispatch(SelectCompany(company, companyLink))),\r\n    }\r\n}\r\nexport default connect<CompanySelectionAppStateProps, CompanySelectionDispatchProps,CompanySelectionProps, AppState>(\r\n    mapStateToProps, mapDispatchProps)(CompanySelection);\r\n","import RandomPersonnelGridOptions from \"./RandomPersonnelModel/RandomPersonnelGridOptions\"\r\nimport { ObservableFromFetch } from \"../ObservableFromFetch\"\r\nimport RandomPersonnelIdentifier from \"./RandomPersonnelModel/RandomPersonnelIdentifier\"\r\nimport RandomPersonnelGridRecord from \"./RandomPersonnelModel/RandomPersonnelGridRecord\"\r\nimport GridResponse from \"../GridResponse\"\r\nimport { ColumnFilters } from \"./RandomPersonnelModel/ColumnFilters\"\r\nimport { Filter } from \"../GridRequest\"\r\n\r\nexport type RandomPersonnelGridResponse = GridResponse<RandomPersonnelGridRecord> & ColumnFilters\r\n\r\nfunction filters(filters: Filter[] = []) {\r\n  return {\r\n    Company: filters.find((filter) => filter.column === \"Company\")?.values || [],\r\n    IDNumber: filters.find((filter) => filter.column === \"IDNumber\")?.values || [],\r\n    Inactive: filters.find((filter) => filter.column === \"Status\")?.values.map((value) => value === \"Inactive\") || [],\r\n    Location: filters.find((filter) => filter.column === \"Location\")?.values || [],\r\n    Name: filters.find((filter) => filter.column === \"Name\")?.values || [],\r\n    Region: filters.find((filter) => filter.column === \"Region\")?.values || [],\r\n    Reg: filters.find((filter) => filter.column === \"RegulatoryMode\")?.values || [],\r\n    Occupation: filters.find((filter) => filter.column === \"Occupation\")?.values || [],\r\n    Category: filters.find((filter) => filter.column === \"Category\")?.values || [],\r\n    Supervisor1: filters.find((filter) => filter.column === \"Supervisor1\")?.values || [],\r\n    Supervisor2: filters.find((filter) => filter.column === \"Supervisor2\")?.values || [],\r\n    HireDate: filters.find((filter) => filter.column === \"HireDate\")?.values || [],\r\n    TerminationDate: filters.find((filter) => filter.column === \"TerminationDate\")?.values || [],\r\n    PreEmploymentTestOnFile: filters.find((filter) => filter.column === \"PreEmploymentTestOnFile\")?.values || [],\r\n    Gender: filters.find((filter) => filter.column === \"Gender\")?.values || [],\r\n    DateOfBirth: filters.find((filter) => filter.column === \"DateOfBirth\")?.values || [],\r\n    AddressLine1: filters.find((filter) => filter.column === \"AddressLine1\")?.values || [],\r\n    City: filters.find((filter) => filter.column === \"City\")?.values || [],\r\n    State: filters.find((filter) => filter.column === \"State\")?.values || [],\r\n    Zip: filters.find((filter) => filter.column === \"Zip\")?.values || [],\r\n    WorkPhone: filters.find((filter) => filter.column === \"WorkPhone\")?.values || [],\r\n    CellPhone: filters.find((filter) => filter.column === \"CellPhone\")?.values || [],\r\n    Email: filters.find((filter) => filter.column === \"Email\")?.values || [],\r\n    User1: filters.find((filter) => filter.column === \"User1\")?.values || [],\r\n    User2: filters.find((filter) => filter.column === \"User2\")?.values || [],\r\n    User3: filters.find((filter) => filter.column === \"User3\")?.values || [],\r\n    User4: filters.find((filter) => filter.column === \"User4\")?.values || [],\r\n    User5: filters.find((filter) => filter.column === \"User5\")?.values || [],\r\n    User6: filters.find((filter) => filter.column === \"User6\")?.values || [],\r\n    User7: filters.find((filter) => filter.column === \"User7\")?.values || [],\r\n    User8: filters.find((filter) => filter.column === \"User8\")?.values || [],\r\n    User9: filters.find((filter) => filter.column === \"User9\")?.values || [],\r\n    User10: filters.find((filter) => filter.column === \"User10\")?.values || [],\r\n  }\r\n}\r\n\r\nfunction gridParams(options: RandomPersonnelGridOptions): string {\r\n  let result = JSON.stringify({\r\n    Exact: false,\r\n    Filters: filters(options.filters),\r\n    GridFilters: filters(options.columnFilters),\r\n    Mask: options.search.text,\r\n    PageNumber: options.pageNumber,\r\n    PageSize: options.pageSize || 20,\r\n    SearchBy: options.search.field || \"All Personnel IDs\",\r\n    SortGrid: {\r\n      SortColumn: options.sort?.column || \"\",\r\n      SortOrder: options.sort?.order.toUpperCase() === \"DESC\" ? \"DSC\" : options.sort?.order.toUpperCase(),\r\n    },\r\n    WithInactive: true,\r\n    IsConsortium: options.isConsortium,\r\n    ForceReload: options.forceReload,\r\n  })\r\n  return result\r\n}\r\n\r\nfunction checkExist(options: RandomPersonnelGridOptions){\r\n  return JSON.stringify({\r\n    Exact: false,\r\n    Filters: { Category: [], Company: [], IDNumber: [], Inactive: [], Location: [], Name: [], Region: [], Reg: [] },\r\n    IsAddIndividualSearch: true,\r\n    Mask: options.search.text,\r\n    PageNumber: options.pageNumber,\r\n    PageSize: options.pageSize,\r\n    SearchBy: options.search.field,\r\n    WithInactive: true,\r\n    SortGrid: { SortColumn: \"\", SortOrder: \"\" }\r\n  })\r\n}\r\n\r\nfunction exportParams(options: RandomPersonnelGridOptions): string {\r\n  return JSON.stringify({\r\n    Exact: false,\r\n    Filters: filters(options.filters),\r\n    GridFilters: filters(options.columnFilters),\r\n    IsSearch: !!options.search.text,\r\n    Mask: \"\",\r\n    SearchBy: options.search.field || \"All Personnel IDs\",\r\n    SearchString: options.search.text,\r\n    WithInactive: true,\r\n  })\r\n}\r\n\r\nfunction printParams(values: RandomPersonnelIdentifier[], options: RandomPersonnelGridOptions): string {\r\n  return JSON.stringify({\r\n    Filters: filters(options.filters),\r\n    IsSearch: !!options.search.text,\r\n    PersonnelID: values.map(value => { return {PersonID: value.PersonID, Mask: value.ID} }),\r\n    SearchBy: options.search.field || \"All Personnel IDs\",\r\n    SearchString: options.search.text\r\n  })\r\n}\r\n\r\nexport interface ConsortiumsMembership {\r\n  PersonAssignedToPoolID: number\r\n  PersonID: number\r\n  PoolID: number\r\n  Name: string\r\n  Active: boolean\r\n}\r\n\r\nexport function RetrieveConsortiumsMembership(PersonID: number) {\r\n  const requestBody: string = new URLSearchParams({\r\n    PersonID: PersonID.toString()\r\n  }).toString()\r\n\r\n  return ObservableFromFetch<ConsortiumsMembership[]>(\"WorkforceRandomTest/GetConsortiumsMembership?\" + requestBody)\r\n}\r\n\r\nexport function UpdateConsortiumsMembership(data: ConsortiumsMembership[]) {\r\n  const params: string = JSON.stringify({\r\n    Members: data\r\n  })\r\n\r\n  return ObservableFromFetch<string>(\"WorkforceRandomTest/UpdateConsortiumsMembership\", params)\r\n}\r\n\r\nexport const RandomPersonnelGridObservable = (params: RandomPersonnelGridOptions) => ObservableFromFetch<RandomPersonnelGridResponse>(\"WorkforceRandomTest/GetPersonnelGrid\", gridParams(params))\r\nexport const RandomPersonnelExportCsv = (params: RandomPersonnelGridOptions) => ObservableFromFetch<string>(\"WorkforceRandomTest/ExportPersonnelRecord\", exportParams(params))\r\nexport const RandomPersonnelPrint = (values: RandomPersonnelIdentifier[], params: RandomPersonnelGridOptions) => ObservableFromFetch<string>(\"WorkforceRandomTest/PrintPersonnelRecord\", printParams(values, params))\r\nexport const RandomPersonnelAddPersonObservable = (params: RandomPersonnelGridOptions) => ObservableFromFetch<RandomPersonnelGridResponse>(\"WorkforceRandomTest/GetPersonnelGrid\", checkExist(params))\r\n","import { Observable } from \"rxjs\"\r\nimport { ObservableFromFetch } from \"../ObservableFromFetch\"\r\nimport RandomPersonnelIdentifier from \"./RandomPersonnelModel/RandomPersonnelIdentifier\"\r\n\r\nexport default function RandomPersonnelRemoveObservable(persons: RandomPersonnelIdentifier[], force: boolean = false): Observable<string> {\r\n  const params: string = JSON.stringify({\r\n    PersonIDs: persons.map(item => ({ PersonID: item.PersonID, SSN: item.ID })),\r\n    force: force\r\n  })\r\n\r\n  return ObservableFromFetch<string>(\"RandomTest/RemovePerson\", params)\r\n}\r\n","import * as React from \"react\"\r\nimport { Modal, Button, Container, Col, Row } from \"react-bootstrap\"\r\nimport { FaAngleDown } from \"react-icons/fa\"\r\nimport { AsyncTypeahead, Typeahead } from \"react-bootstrap-typeahead\"\r\nimport 'react-bootstrap-typeahead/css/Typeahead.css'\r\nimport { BehaviorSubject, of, concat, Subscription, combineLatest } from \"rxjs\"\r\nimport { debounceTime, filter, map, pairwise, startWith, switchMap } from \"rxjs/operators\"\r\nimport CompanyInput from \"../FormattedInputs/CompanyInput\"\r\nimport AutoFilterCompaniesGetObservable from \"../../api/Companies/AutoFilterCompaniesGet\"\r\nimport AutoFilterCompany from \"../../api/Companies/CompanyModel/AutoFilterCompany\"\r\nimport AutoFilterRegionsGetObservable from \"../../api/Regions/AutoFilterRegionsGet\"\r\nimport AutoFilterRegion from \"../../api/Regions/Model/AutoFilterRegion\"\r\nimport AutoFilterLocationsGetObservable from \"../../api/Location/AutoFilterLocationsGet\"\r\nimport AutoFilterLocation from \"../../api/Location/LocationModel/AutoFilterLocation\"\r\nimport LabServiceRegulatoryModesGetObservable from \"../../api/LabService/LabServiceRegulatoryModesGet\"\r\nimport RegulatoryMode from \"../../api/LabService/LabServiceModel/RegulatoryMode\"\r\nimport EmployeeCategoriesGetObservable from \"../../api/LabService/EmployeeCategoriesGet\"\r\nimport EmployeeCategory from \"../../api/LabService/LabServiceModel/EmployeeCategory\"\r\n\r\ninterface AdvancedFiltersModalProps {\r\n  show: boolean\r\n  selectedCompanies: AutoFilterCompany[]\r\n  selectedRegions: AutoFilterRegion[]\r\n  selectedLocations: AutoFilterLocation[]\r\n  selectedRegulatoryModes: RegulatoryMode[]\r\n  selectedCategories: EmployeeCategory[]\r\n  accountType: string\r\n  onSave: (companies: AutoFilterCompany[], regions: AutoFilterRegion[], locations: AutoFilterLocation[], regulatoryModes: RegulatoryMode[], categories: EmployeeCategory[], close: boolean) => void\r\n  onClose: () => void\r\n}\r\n\r\ninterface AdvancedFiltersModalState {\r\n  companyTypeaheadKey: string\r\n  unfilteredCompanies: AutoFilterCompany[]\r\n  companies: AutoFilterCompany[]\r\n  isCompaniesLoading: boolean\r\n  selectedCompanies: AutoFilterCompany[]\r\n  regionTypeaheadKey: string\r\n  unfilteredRegions: AutoFilterRegion[]\r\n  regions: AutoFilterRegion[]\r\n  isRegionsLoading: boolean\r\n  selectedRegions: AutoFilterRegion[]\r\n  locationTypeaheadKey: string\r\n  unfilteredLocations: AutoFilterLocation[]\r\n  locations: AutoFilterLocation[]\r\n  isLocationsLoading: boolean\r\n  selectedLocations: AutoFilterLocation[]\r\n  availableRegulatoryModes?: RegulatoryMode[]\r\n  isRegulatoryModesLoading: boolean\r\n  selectedRegulatoryModes: RegulatoryMode[]\r\n  availableCategories?: EmployeeCategory[]\r\n  isCategoriesLoading: boolean\r\n  selectedCategories: EmployeeCategory[]\r\n  canEditCompanies: boolean\r\n  canEditRegions: boolean\r\n  canEditLocations: boolean\r\n}\r\n\r\nexport default class AdvancedFiltersModal extends React.Component<AdvancedFiltersModalProps, AdvancedFiltersModalState> {\r\n  state: AdvancedFiltersModalState = {\r\n    companyTypeaheadKey: \"company\",\r\n    unfilteredCompanies: [],\r\n    companies: [],\r\n    isCompaniesLoading: false,\r\n    selectedCompanies: this.props.selectedCompanies,\r\n    regionTypeaheadKey: \"region\",\r\n    unfilteredRegions: [],\r\n    regions: [],\r\n    isRegionsLoading: false,\r\n    selectedRegions: this.props.selectedRegions,\r\n    locationTypeaheadKey: \"location\",\r\n    unfilteredLocations: [],\r\n    locations: [],\r\n    isLocationsLoading: false,\r\n    selectedLocations: this.props.selectedLocations,\r\n    isRegulatoryModesLoading: false,\r\n    selectedRegulatoryModes: this.props.selectedRegulatoryModes,\r\n    isCategoriesLoading: false,\r\n    selectedCategories: [],\r\n    canEditCompanies: [\"master\"].includes(this.props.accountType),\r\n    canEditRegions: [\"master\", \"company\"].includes(this.props.accountType),\r\n    canEditLocations: [\"master\", \"company\", \"region\"].includes(this.props.accountType)\r\n  }\r\n\r\n  subscriptions = new Subscription()\r\n\r\n  searchCompany$ = new BehaviorSubject<string>(\"\")\r\n  searchRegion$ = new BehaviorSubject<string>(\"\")\r\n  searchLocation$ = new BehaviorSubject<string>(\"\")\r\n\r\n  selectedCompanies$ = new BehaviorSubject<AutoFilterCompany[]>([])\r\n  selectedRegions$ = new BehaviorSubject<AutoFilterRegion[]>([])\r\n\r\n  regionTypeahead = React.createRef<AsyncTypeahead<AutoFilterRegion>>()\r\n  locationTypeahead = React.createRef<AsyncTypeahead<AutoFilterLocation>>()\r\n  regulatoryModeTypeahead = React.createRef<Typeahead<RegulatoryMode>>()\r\n  categoryTypeahead = React.createRef<Typeahead<EmployeeCategory>>()\r\n\r\n  componentDidMount() {\r\n    this.subscriptions.add(AutoFilterCompaniesGetObservable(\"\", true).subscribe(\r\n      (data: AutoFilterCompany[]) => {\r\n        this.setState({\r\n          unfilteredCompanies: data,\r\n          isCompaniesLoading: false\r\n        })\r\n      },\r\n      () => this.setState({ isCompaniesLoading: false })\r\n    ))\r\n\r\n    this.subscriptions.add(LabServiceRegulatoryModesGetObservable().subscribe(\r\n      (data: RegulatoryMode[]) => {\r\n        this.setState({\r\n          availableRegulatoryModes: data,\r\n          isRegulatoryModesLoading: false\r\n        })\r\n      }\r\n    ))\r\n\r\n    this.subscriptions.add(EmployeeCategoriesGetObservable().subscribe(\r\n      (data: EmployeeCategory[]) => {\r\n        this.setState({\r\n          availableCategories: data,\r\n          isCategoriesLoading: false\r\n        })\r\n      }\r\n    ))\r\n\r\n    type SearchRegionsData = { company: number, filter: string, companyChanged: boolean, shouldRequestApi: boolean, shouldSetEmptyResult: boolean, shouldUpdateUnfilteredList: boolean, shouldFillFromUnfilteredResult: boolean }\r\n\r\n    this.subscriptions.add(combineLatest([\r\n      this.selectedCompanies$,\r\n      this.searchRegion$.pipe(debounceTime(500), map(text => text.trim())),\r\n      of(this.state.canEditCompanies)\r\n    ]).pipe(\r\n      startWith([[], \"\", false]),\r\n      pairwise(),\r\n      map(([[prevCompanies, prevFilter, _1], [companies, filter, companiesAllowed]]) => {\r\n        const prevC = prevCompanies as AutoFilterCompany[]\r\n        const c = companies as AutoFilterCompany[]\r\n        const filterLength = (filter as string).length\r\n        if (companiesAllowed as boolean) {\r\n          return {\r\n            company: c.length === 1 ? c[0]?.AccountID || 0 : 0,\r\n            filter: prevC.length !== c.length ? \"\" : filter,\r\n            companyChanged: prevC.length !== c.length,\r\n            shouldRequestApi: c.length === 1 && (prevC.length !== 1 || filterLength >= 3),\r\n            shouldSetEmptyResult: c.length !== 1,\r\n            shouldUpdateUnfilteredList: c.length === 1 && prevC.length !== 1,\r\n            shouldFillFromUnfilteredResult: c.length === 1 && prevC.length === 1 && filterLength < 3\r\n          } as SearchRegionsData\r\n        } else {\r\n          const isFirstTimeLoad = filterLength === 0 && (prevFilter as string).length === 0\r\n          return {\r\n            company: 0,\r\n            filter: filter,\r\n            companyChanged: false,\r\n            shouldRequestApi: filterLength >= 3 || isFirstTimeLoad,\r\n            shouldSetEmptyResult: false,\r\n            shouldUpdateUnfilteredList: isFirstTimeLoad,\r\n            shouldFillFromUnfilteredResult: filterLength < 3 && !isFirstTimeLoad\r\n          } as SearchRegionsData\r\n        }\r\n      }),\r\n      filter((o: SearchRegionsData) => o.shouldRequestApi || o.shouldFillFromUnfilteredResult || o.shouldSetEmptyResult),\r\n      switchMap((o: SearchRegionsData) =>\r\n        o.shouldFillFromUnfilteredResult || o.shouldSetEmptyResult\r\n          ? of({ isLoading: false, shouldFillFromUnfilteredResult: o.shouldFillFromUnfilteredResult, shouldSetEmptyResult: o.shouldSetEmptyResult, companyChanged: o.companyChanged })\r\n          : concat(\r\n            of({ isLoading: true }),\r\n            AutoFilterRegionsGetObservable(o.company, o.filter).pipe(\r\n              map((data) => ({ isLoading: false, result: data, shouldUpdateUnfilteredList: o.shouldUpdateUnfilteredList }))\r\n            )\r\n          ))\r\n    ).subscribe(\r\n      (data: { isLoading: boolean, result?: AutoFilterRegion[], shouldUpdateUnfilteredList?: boolean, shouldFillFromUnfilteredResult?: boolean, shouldSetEmptyResult?: boolean, companyChanged?: boolean }) => {\r\n        this.setState({\r\n          regionTypeaheadKey: !!data.companyChanged ? Math.random().toString() : this.state.regionTypeaheadKey,\r\n          isRegionsLoading: data.isLoading,\r\n          unfilteredRegions: !!data.shouldUpdateUnfilteredList ? data.result || [] : this.state.unfilteredRegions,\r\n          regions: !!data.shouldSetEmptyResult\r\n            ? []\r\n            : !!data.shouldFillFromUnfilteredResult\r\n              ? this.state.unfilteredRegions\r\n              : data.result || this.state.regions\r\n        })\r\n      }))\r\n\r\n    type SearchLocationsData = { company: number, region: number, filter: string, regionChanged: boolean, shouldRequestApi: boolean, shouldSetEmptyResult: boolean, shouldUpdateUnfilteredList: boolean, shouldFillFromUnfilteredResult: boolean }\r\n\r\n    this.subscriptions.add(combineLatest([\r\n      this.selectedCompanies$,\r\n      this.selectedRegions$,\r\n      this.searchLocation$.pipe(debounceTime(500), map(text => text.trim())),\r\n      of(this.state.canEditCompanies),\r\n      of(this.state.canEditRegions)\r\n    ]).pipe(\r\n      startWith([[], [], \"\", false, false]),\r\n      pairwise(),\r\n      map(([[prevCompanies, prevRegions, prevFilter, _1, _2], [companies, regions, filter, companiesAllowed, regionsAllowed]]) => {\r\n        const prevC = prevCompanies as AutoFilterCompany[]\r\n        const c = companies as AutoFilterCompany[]\r\n        const prevR = prevRegions as AutoFilterRegion[]\r\n        const r = prevC.length !== c.length ? [] : regions as AutoFilterRegion[]\r\n        const cAllowed = companiesAllowed as boolean\r\n        const rAllowed = regionsAllowed as boolean\r\n        const filterLength = (filter as string).length\r\n        if (!rAllowed) {\r\n          const isFirstTimeLoad = filterLength === 0 && (prevFilter as string).length === 0\r\n          return {\r\n            company: 0,\r\n            region: 0,\r\n            filter: filter,\r\n            regionChanged: false,\r\n            shouldRequestApi: filterLength >= 3 || isFirstTimeLoad,\r\n            shouldSetEmptyResult: false,\r\n            shouldUpdateUnfilteredList: isFirstTimeLoad,\r\n            shouldFillFromUnfilteredResult: filterLength < 3 && !isFirstTimeLoad\r\n          } as SearchLocationsData\r\n        } else if (!cAllowed) {\r\n          const isFirstTimeLoad = filterLength === 0 && (prevFilter as string).length === 0 && r.length === 0\r\n          return {\r\n            company: 0,\r\n            region: r.length === 1 ? r[0]?.XrefAccountMapping?.RegionID || 0 : 0,\r\n            filter: prevR.length !== r.length ? \"\" : filter,\r\n            regionChanged: prevR.length !== r.length,\r\n            shouldRequestApi: (r.length === 0 && prevR.length > 0) || (r.length === 1 && prevR.length !== 1) || filterLength >= 3 || isFirstTimeLoad,\r\n            shouldSetEmptyResult: r.length > 1,\r\n            shouldUpdateUnfilteredList: (r.length === 0 && prevR.length > 0) || (r.length === 1 && prevR.length !== 1) || isFirstTimeLoad,\r\n            shouldFillFromUnfilteredResult: ((r.length === 0 && prevR.length === 0) || (r.length === 1 && prevR.length === 1)) && filterLength < 3 && !isFirstTimeLoad\r\n          } as SearchLocationsData\r\n        } else {\r\n          return {\r\n            company: c.length === 1 ? c[0]?.AccountID || 0 : 0,\r\n            region: r.length === 1 ? r[0]?.XrefAccountMapping?.RegionID || 0 : 0,\r\n            filter: prevC.length !== c.length || prevR.length !== r.length ? \"\" : filter,\r\n            regionChanged: prevR.length !== r.length || prevC.length !== c.length,\r\n            shouldRequestApi: (c.length === 1 && ((r.length === 0 && prevR.length > 0) || (r.length === 1 && prevR.length !== 1) || prevC.length !== 1 || filterLength >= 3)),\r\n            shouldSetEmptyResult: r.length > 1,\r\n            shouldUpdateUnfilteredList: (r.length === 0 && prevR.length > 0) || (r.length === 1 && prevR.length !== 1) || (c.length === 1 && prevC.length !== 1),\r\n            shouldFillFromUnfilteredResult: ((r.length === 0 && prevR.length === 0) || (r.length === 1 && prevR.length === 1)) && (c.length === 1 && prevC.length === 1) && filterLength < 3\r\n          } as SearchLocationsData\r\n        }\r\n      }),\r\n      filter((o: SearchLocationsData) => o.shouldRequestApi || o.shouldFillFromUnfilteredResult || o.shouldSetEmptyResult || o.shouldFillFromUnfilteredResult),\r\n      switchMap((o: SearchLocationsData) =>\r\n        o.shouldFillFromUnfilteredResult || o.shouldSetEmptyResult\r\n          ? of({ isLoading: false, shouldFillFromUnfilteredResult: o.shouldFillFromUnfilteredResult, shouldSetEmptyResult: o.shouldSetEmptyResult, regionChanged: o.regionChanged })\r\n          : concat(\r\n            of({ isLoading: true }),\r\n            AutoFilterLocationsGetObservable(o.company, o.region, o.filter).pipe(\r\n              map((data) => ({ isLoading: false, result: data, shouldUpdateUnfilteredList: o.shouldUpdateUnfilteredList, regionChanged: o.regionChanged }))\r\n            )\r\n          ))\r\n    ).subscribe(\r\n      (data: { isLoading: boolean, result?: AutoFilterLocation[], shouldUpdateUnfilteredList?: boolean, shouldFillFromUnfilteredResult?: boolean, shouldSetEmptyResult?: boolean, regionChanged?: boolean }) => {\r\n        this.setState({\r\n          locationTypeaheadKey: !!data.regionChanged ? Math.random().toString() : this.state.locationTypeaheadKey,\r\n          isLocationsLoading: data.isLoading,\r\n          unfilteredLocations: !!data.shouldUpdateUnfilteredList ? data.result || [] : this.state.unfilteredLocations,\r\n          locations: !!data.shouldSetEmptyResult\r\n            ? []\r\n            : !!data.shouldFillFromUnfilteredResult\r\n              ? this.state.unfilteredLocations\r\n              : data.result || this.state.locations\r\n        })\r\n      }))\r\n\r\n    this.subscriptions.add(this.searchCompany$.pipe(\r\n      debounceTime(500),\r\n      map(filter => (filter ?? \"\").trim()),\r\n      filter(filter => filter.length >= 3 || filter.length === 0),\r\n      switchMap((filter) => filter.length === 0\r\n        ? of({ isLoading: false, items: this.state.unfilteredCompanies })\r\n        : concat(\r\n          of({ isLoading: true }),\r\n          AutoFilterCompaniesGetObservable(filter).pipe(\r\n            map((data) => ({ isLoading: false, items: data }))\r\n          )\r\n        ))\r\n    ).subscribe(\r\n      (state: { isLoading: boolean, items?: AutoFilterCompany[] }) => {\r\n        state.items\r\n          ? this.setState({ isCompaniesLoading: state.isLoading, companies: state.items })\r\n          : this.setState({ isCompaniesLoading: state.isLoading })\r\n      },\r\n      () => this.setState({ isCompaniesLoading: false })\r\n    ))\r\n  }\r\n\r\n  componentWillUnmount() {\r\n    this.subscriptions.unsubscribe()\r\n  }\r\n\r\n  componentDidUpdate(prevProps: AdvancedFiltersModalProps, prevState: AdvancedFiltersModalState) {\r\n    if (!(this.isCompaniesEqual(this.props.selectedCompanies, prevProps.selectedCompanies)\r\n      && this.isRegionsEqual(this.props.selectedRegions, prevProps.selectedRegions)\r\n      && this.isLocationsEqual(this.props.selectedLocations, prevProps.selectedLocations)\r\n      && this.isRegulatoryModesEqual(this.props.selectedRegulatoryModes, prevProps.selectedRegulatoryModes)\r\n      && this.isCategoriesEqual(this.props.selectedCategories, prevProps.selectedCategories))) {\r\n      this.setState({\r\n        selectedCompanies: this.props.selectedCompanies,\r\n        selectedRegions: this.props.selectedRegions,\r\n        selectedLocations: this.props.selectedLocations,\r\n        selectedRegulatoryModes: this.props.selectedRegulatoryModes,\r\n        selectedCategories: this.props.selectedCategories\r\n      })\r\n    } else {\r\n      if (!this.isCompaniesEqual(prevState.selectedCompanies, this.state.selectedCompanies)) {\r\n        this.searchCompany$.next(\"\")\r\n        this.selectedCompanies$.next(this.state.selectedCompanies)\r\n      }\r\n      if (!this.isRegionsEqual(prevState.selectedRegions, this.state.selectedRegions)) {\r\n        this.selectedRegions$.next(this.state.selectedRegions)\r\n      }\r\n    }\r\n  }\r\n\r\n  isCompaniesEqual = (items1: AutoFilterCompany[], items2: AutoFilterCompany[]) => {\r\n    const itemsString = (items: AutoFilterCompany[]) => items.map(item => item.AccountID).sort().join(\",\")\r\n    return itemsString(items1) === itemsString(items2)\r\n  }\r\n\r\n  isRegionsEqual = (items1: AutoFilterRegion[], items2: AutoFilterRegion[]) => {\r\n    const itemsString = (items: AutoFilterRegion[]) => items.map(item => item.Name).sort().join(\",\")\r\n    return itemsString(items1) === itemsString(items2)\r\n  }\r\n\r\n  isLocationsEqual = (items1: AutoFilterLocation[], items2: AutoFilterLocation[]) => {\r\n    const itemsString = (items: AutoFilterLocation[]) => items.map(item => item.Name).sort().join(\",\")\r\n    return itemsString(items1) === itemsString(items2)\r\n  }\r\n\r\n  isRegulatoryModesEqual = (items1: RegulatoryMode[], items2: RegulatoryMode[]) => {\r\n    const itemsString = (items: RegulatoryMode[]) => items.map(item => item.Name).sort().join(\",\")\r\n    return itemsString(items1) === itemsString(items2)\r\n  }\r\n\r\n  isCategoriesEqual = (items1: EmployeeCategory[], items2: EmployeeCategory[]) => {\r\n    const itemsString = (items: EmployeeCategory[]) => items.map(item => item.Name).sort().join(\",\")\r\n    return itemsString(items1) === itemsString(items2)\r\n  }\r\n\r\n  handleSave = () => {\r\n    const { selectedCompanies, selectedRegions, selectedLocations, selectedRegulatoryModes, selectedCategories } = this.state\r\n    this.props.onSave(selectedCompanies, selectedRegions, selectedLocations, selectedRegulatoryModes, selectedCategories, true)\r\n  }\r\n\r\n  handleClearAll = () => {\r\n    this.setState({ selectedCompanies: [], selectedRegions: [], selectedLocations: [], selectedRegulatoryModes: [], selectedCategories: [] })\r\n\r\n    const { selectedCompanies, selectedRegions, selectedLocations, selectedRegulatoryModes, selectedCategories } = this.props\r\n    const filterAlreadySet = selectedCompanies.length > 0 || selectedRegions.length > 0 || selectedLocations.length > 0 || selectedRegulatoryModes.length > 0 || selectedCategories.length > 0\r\n    if (filterAlreadySet) {\r\n      this.props.onSave([], [], [], [], [], false)\r\n    }\r\n  }\r\n\r\n  handleClose = () => {\r\n    this.setState({\r\n      selectedCompanies: this.props.selectedCompanies,\r\n      selectedRegions: this.props.selectedRegions,\r\n      selectedLocations: this.props.selectedLocations,\r\n      selectedRegulatoryModes: this.props.selectedRegulatoryModes,\r\n      selectedCategories: this.props.selectedCategories\r\n    })\r\n    this.props.onClose()\r\n  }\r\n\r\n  handleAddCompany = (items: AutoFilterCompany[]) => {\r\n    if (items[0] && !this.state.selectedCompanies.find(item => item.AccountID === items[0].AccountID)) {\r\n      this.setState({\r\n        companyTypeaheadKey: Math.random().toString(),\r\n        selectedCompanies: [...this.state.selectedCompanies, items[0]],\r\n        selectedRegions: [],\r\n        selectedLocations: []\r\n      })\r\n    }\r\n  }\r\n\r\n  handleRemoveCompany = (removeItem: AutoFilterCompany) => {\r\n    this.setState({\r\n      companyTypeaheadKey: Math.random().toString(),\r\n      selectedCompanies: this.state.selectedCompanies.filter(item => item.AccountID !== removeItem.AccountID)\r\n    })\r\n  }\r\n\r\n  handleAddRegion = (items: AutoFilterRegion[]) => {\r\n    if (items[0] && !this.state.selectedRegions.find(item => item.Name === items[0].Name)) {\r\n      this.setState({\r\n        regionTypeaheadKey: Math.random().toString(),\r\n        selectedRegions: [...this.state.selectedRegions, items[0]],\r\n        selectedLocations: []\r\n      })\r\n    }\r\n  }\r\n\r\n  handleRemoveRegion = (removeItem: AutoFilterRegion) => {\r\n    this.setState({\r\n      regionTypeaheadKey: Math.random().toString(),\r\n      selectedRegions: this.state.selectedRegions.filter(item => item.Name !== removeItem.Name)\r\n    })\r\n  }\r\n\r\n  handleAddLocation = (items: AutoFilterLocation[]) => {\r\n    if (items[0] && !this.state.selectedLocations.find(item => item.Name === items[0].Name)) {\r\n      this.setState({\r\n        locationTypeaheadKey: Math.random().toString(),\r\n        selectedLocations: [...this.state.selectedLocations, items[0]]\r\n      })\r\n    }\r\n  }\r\n\r\n  handleRemoveLocation = (removeItem: AutoFilterLocation) => {\r\n    this.setState({\r\n      locationTypeaheadKey: Math.random().toString(),\r\n      selectedLocations: this.state.selectedLocations.filter(item => item.Name !== removeItem.Name)\r\n    })\r\n  }\r\n\r\n  handleAddRegulatoryMode = (items: RegulatoryMode[]) => {\r\n    if (items[0]) {\r\n      this.setState({ selectedRegulatoryModes: [...this.state.selectedRegulatoryModes, items[0]] })\r\n    }\r\n  }\r\n\r\n  handleRemoveRegulatoryMode = (removeItem: RegulatoryMode) => {\r\n    this.setState({ selectedRegulatoryModes: this.state.selectedRegulatoryModes.filter(item => item.RegulatoryModeID !== removeItem.RegulatoryModeID) })\r\n  }\r\n\r\n  handleAddCategory = (items: EmployeeCategory[]) => {\r\n    if (items[0]) {\r\n      this.setState({ selectedCategories: [...this.state.selectedCategories, items[0]] })\r\n    }\r\n  }\r\n\r\n  handleRemoveCategory = (removeItem: EmployeeCategory) => {\r\n    this.setState({ selectedCategories: this.state.selectedCategories.filter(item => item.EmployeeCategoryID !== removeItem.EmployeeCategoryID) })\r\n  }\r\n\r\n  render() {\r\n    // TODO: Get name from Account data once Auth/Account will be implemented\r\n    const accountName = (): string => {\r\n      switch (this.props.accountType) {\r\n        case \"company\": return \"Company\"\r\n        case \"region\": return \"Region\"\r\n        case \"location\": return \"Location\"\r\n      }\r\n      return \"\"\r\n    }\r\n\r\n    const { selectedCompanies, selectedRegions, selectedLocations, selectedRegulatoryModes, selectedCategories,\r\n      canEditCompanies, canEditRegions, canEditLocations } = this.state\r\n\r\n    const showRegions = selectedCompanies.length === 1 || !canEditCompanies\r\n    const showLocations = showRegions && selectedRegions.length <= 1\r\n    const hasChanges = !(this.isCompaniesEqual(this.props.selectedCompanies, selectedCompanies)\r\n      && this.isRegionsEqual(this.props.selectedRegions, selectedRegions)\r\n      && this.isLocationsEqual(this.props.selectedLocations, selectedLocations)\r\n      && this.isRegulatoryModesEqual(this.props.selectedRegulatoryModes, selectedRegulatoryModes)\r\n      && this.isCategoriesEqual(this.props.selectedCategories, selectedCategories))\r\n    const canClearAll = hasChanges || selectedCompanies.length > 0\r\n      || selectedRegions.length > 0 || selectedLocations.length > 0\r\n      || selectedRegulatoryModes.length > 0 || selectedCategories.length > 0\r\n\r\n    return <Modal backdrop=\"static\" size=\"xl\" centered show={this.props.show} onHide={this.handleClose}>\r\n      <Modal.Header closeButton>\r\n        <Modal.Title>ADVANCED FILTERS</Modal.Title>\r\n      </Modal.Header>\r\n      <Modal.Body>\r\n        <Container fluid className=\"AdvancedFiltersModal\">\r\n          {(!canEditCompanies || !canEditRegions || !canEditLocations) && <Row><Col md={6}>{accountName()}</Col></Row>}\r\n          {canEditCompanies && <Row>\r\n            <Col md={6}>\r\n              <div className=\"typeahead\">\r\n                <CompanyInput onChange={this.handleAddCompany} placeholder=\"Company\" />\r\n              </div>\r\n              <div className=\"selection\">\r\n                {this.state.selectedCompanies.map(item => <div key={item.AccountID}>\r\n                  <span>{item.Name}</span>\r\n                  <span className=\"remove\" onClick={() => this.handleRemoveCompany(item)}>×</span>\r\n                </div>)}\r\n              </div>\r\n            </Col>\r\n          </Row>}\r\n          <Row>\r\n            {canEditRegions && <>\r\n              <Col md={6} hidden={showRegions}></Col>\r\n              <Col md={6} hidden={!showRegions}>\r\n                <div className=\"typeahead\">\r\n                  <AsyncTypeahead id=\"region\"\r\n                    key={this.state.regionTypeaheadKey}\r\n                    ref={this.regionTypeahead}\r\n                    labelKey=\"Name\"\r\n                    filterBy={(option, props) => !this.state.selectedRegions.find(item => item.Name === option.Name)}\r\n                    isLoading={this.state.isRegionsLoading}\r\n                    onSearch={() => { }}\r\n                    onInputChange={input => this.searchRegion$.next(input)}\r\n                    onChange={this.handleAddRegion}\r\n                    options={this.state.regions}\r\n                    selected={[]}\r\n                    minLength={0}\r\n                    emptyLabel=\"No Result Found\"\r\n                    placeholder=\"Region\"\r\n                    inputProps={{ autoComplete: \"chrome-off\" }}>\r\n                    {!this.state.isRegionsLoading &&\r\n                      <Button variant=\"toggle\" onClick={() => { this.regionTypeahead.current?.toggleMenu() }}>\r\n                        <FaAngleDown />\r\n                      </Button>}\r\n                  </AsyncTypeahead>\r\n                </div>\r\n                <div className=\"selection\">\r\n                  {this.state.selectedRegions.map(item => <div key={item.Name}>\r\n                    <span>{item.Name}</span>\r\n                    <span className=\"remove\" onClick={() => this.handleRemoveRegion(item)}>×</span>\r\n                  </div>)}\r\n                </div>\r\n              </Col>\r\n            </>}\r\n            {canEditLocations && <>\r\n              <Col md={6} hidden={showLocations}></Col>\r\n              <Col md={6} hidden={!showLocations}>\r\n                <div className=\"typeahead\">\r\n                  <AsyncTypeahead id=\"location\"\r\n                    key={this.state.locationTypeaheadKey}\r\n                    ref={this.locationTypeahead}\r\n                    labelKey=\"Name\"\r\n                    filterBy={(option, props) => !this.state.selectedLocations.find(item => item.Name === option.Name)}\r\n                    isLoading={this.state.isLocationsLoading}\r\n                    onSearch={() => { }}\r\n                    onInputChange={input => this.searchLocation$.next(input)}\r\n                    onChange={this.handleAddLocation}\r\n                    options={this.state.locations}\r\n                    selected={[]}\r\n                    minLength={0}\r\n                    emptyLabel=\"No Result Found\"\r\n                    placeholder=\"Location\">\r\n                    {!this.state.isLocationsLoading &&\r\n                      <Button variant=\"toggle\" onClick={() => { this.locationTypeahead.current?.toggleMenu() }}>\r\n                        <FaAngleDown />\r\n                      </Button>}\r\n                  </AsyncTypeahead>\r\n                </div>\r\n                <div className=\"selection\">\r\n                  {this.state.selectedLocations.map(item => <div key={item.Name}>\r\n                    <span>{item.Name}</span>\r\n                    <span className=\"remove\" onClick={() => this.handleRemoveLocation(item)}>×</span>\r\n                  </div>)}\r\n                </div>\r\n              </Col>\r\n            </>}\r\n          </Row>\r\n          <Row>\r\n            <Col md={6}>\r\n              <div className=\"typeahead\">\r\n                <Typeahead id=\"regMode\"\r\n                  ref={this.regulatoryModeTypeahead}\r\n                  labelKey=\"Name\"\r\n                  filterBy={(option, props) => {\r\n                    return props.selected.length > 0 || option.Name.toLowerCase().indexOf(props.text.toLowerCase()) !== -1;\r\n                  }}\r\n                  onChange={this.handleAddRegulatoryMode}\r\n                  disabled={this.state.isRegulatoryModesLoading}\r\n                  options={(this.state.availableRegulatoryModes || []).filter(item => !this.state.selectedRegulatoryModes.includes(item))}\r\n                  selected={[]}\r\n                  emptyLabel=\"No Result Found\"\r\n                  placeholder=\"Regulatory Mode\">\r\n                  <Button variant=\"toggle\" onClick={() => { this.regulatoryModeTypeahead.current?.toggleMenu() }}>\r\n                    <FaAngleDown />\r\n                  </Button>\r\n                </Typeahead>\r\n              </div>\r\n              <div className=\"selection\">\r\n                {this.state.selectedRegulatoryModes.map(item => <div key={item.RegulatoryModeID}>\r\n                  <span>{item.Name}</span>\r\n                  <span className=\"remove\" onClick={() => this.handleRemoveRegulatoryMode(item)}>×</span>\r\n                </div>)}\r\n              </div>\r\n            </Col>\r\n            <Col md={6}>\r\n              <div className=\"typeahead\">\r\n                <Typeahead id=\"category\"\r\n                  ref={this.categoryTypeahead}\r\n                  labelKey=\"Name\"\r\n                  filterBy={(option, props) => {\r\n                    return props.selected.length > 0 || option.Name.toLowerCase().indexOf(props.text.toLowerCase()) !== -1;\r\n                  }}\r\n                  onChange={this.handleAddCategory}\r\n                  disabled={this.state.isCategoriesLoading}\r\n                  options={(this.state.availableCategories || []).filter(item => !this.state.selectedCategories.includes(item))}\r\n                  selected={[]}\r\n                  emptyLabel=\"No Result Found\"\r\n                  placeholder=\"Category\">\r\n                  <Button variant=\"toggle\" onClick={() => { this.categoryTypeahead.current?.toggleMenu() }}>\r\n                    <FaAngleDown />\r\n                  </Button>\r\n                </Typeahead>\r\n              </div>\r\n              <div className=\"selection\">\r\n                {this.state.selectedCategories.map(item => <div key={item.EmployeeCategoryID}>\r\n                  <span>{item.Name}</span>\r\n                  <span className=\"remove\" onClick={() => this.handleRemoveCategory(item)}>×</span>\r\n                </div>)}\r\n              </div>\r\n            </Col>\r\n          </Row>\r\n        </Container>\r\n      </Modal.Body>\r\n      <Modal.Footer>\r\n        {hasChanges && <Button variant=\"primary\" onClick={() => this.handleSave()}>APPLY</Button>}\r\n        {canClearAll && <Button variant=\"primary\" onClick={() => this.handleClearAll()}>CLEAR ALL</Button>}\r\n        {!hasChanges && <Button variant=\"secondary\" onClick={() => this.handleClose()}>CLOSE</Button>}\r\n      </Modal.Footer>\r\n    </Modal >\r\n  }\r\n}\r\n","import { Observable } from \"rxjs\"\r\nimport EmploymentDetailsEdit from \"./RandomPersonnelModel/EmploymentDetailsEdit\"\r\nimport { ObservableFromFetch } from \"../ObservableFromFetch\"\r\nimport { GetUserId } from \"../../storage/UserId\"\r\nimport { UpdateMethodID } from \"../../config/Constants\"\r\n\r\nexport default function RandomPersonnelAdd(data: EmploymentDetailsEdit): Observable<string> {\r\n  const urlParams: string = new URLSearchParams({\r\n    loginID: `${GetUserId()}`,\r\n    updateMethodID: UpdateMethodID.toString()\r\n  }).toString()\r\n  const requestBody: string = JSON.stringify(data)\r\n\r\n  return ObservableFromFetch<string>(\"/RandomTest/AddPerson?\" + urlParams, requestBody)\r\n}","import * as React from \"react\"\r\nimport { Button, Row, Col, Form } from \"react-bootstrap\"\r\nimport { Typeahead } from \"react-bootstrap-typeahead\"\r\nimport 'react-bootstrap-typeahead/css/Typeahead.css'\r\nimport { FaAngleDown } from \"react-icons/fa\"\r\nimport { Subscription } from \"rxjs\"\r\nimport MaskedInput from \"react-maskedinput\"\r\nimport PhoneNumberMaskedInput from \"./FormattedInputs/PhoneNumberMaskedInput\"\r\nimport StateSelect from \"./FormattedInputs/StateSelect\"\r\nimport AutoFilterCompaniesGet from \"../api/Companies/AutoFilterCompaniesGet\"\r\nimport AutoFilterCompany from \"../api/Companies/CompanyModel/AutoFilterCompany\"\r\nimport AutoFilterLocation from \"../api/Location/LocationModel/AutoFilterLocation\"\r\nimport AutoFilterLocationsGet, { AutoFilterLocationWithRegionGetObservable } from \"../api/Location/AutoFilterLocationsGet\"\r\nimport AutoFilterRegion from \"../api/Regions/Model/AutoFilterRegion\"\r\nimport AutoFilterRegionsGet from \"../api/Regions/AutoFilterRegionsGet\"\r\nimport { StateObservable } from \"../api/OrderRequests/OrderRequestsConstraintGet\"\r\nimport EmploymentDetailsEdit from \"../api/Randoms/RandomPersonnelModel/EmploymentDetailsEdit\"\r\nimport State from \"../api/OrderRequests/OrderRequestsModel/State\"\r\nimport FormatSSN from \"../formatters/FormatSSN\"\r\nimport FormatZipCode from \"../formatters/FormatZipCode\"\r\nimport DatePicker from 'react-datepicker'\r\nimport 'react-datepicker/dist/react-datepicker.css'\r\nimport { EmailRegexp, PhoneRegexp } from \"../config/Constants\"\r\nimport { BirthdayInput } from \"./FormattedInputs/BirthdayInput\"\r\nimport ActionButton from \"./ActionButton\"\r\nimport { AppState } from \"../AppState\"\r\nimport { connect } from \"react-redux\"\r\nimport { GetSelectedAssignedClinic } from \"../authentication/SelectedCompany/CompanySelectionDrivenSelectors\"\r\nimport CompanyInput from \"./FormattedInputs/CompanyInput\"\r\nimport RegulatoryMode from \"../api/LabService/LabServiceModel/RegulatoryMode\"\r\nimport Category from \"../api/LabService/LabServiceModel/EmployeeCategory\"\r\nimport LabServiceRegulatoryModesGetObservable from \"../api/LabService/LabServiceRegulatoryModesGet\"\r\nimport FormatError from \"../formatters/FormatError\"\r\nimport { toast } from \"react-toastify\"\r\nimport EmployeeCategoriesGetObservable from \"../api/LabService/EmployeeCategoriesGet\"\r\nimport { PoolRegulatoryMode } from \"../api/Randoms/RandomsModel/PoolCompanyInfo\"\r\n\r\ninterface EmploymentDetailsAuthProps {\r\n  isLocation?: boolean\r\n}\r\n\r\ninterface EmploymentDetailsProps {\r\n  data: EmploymentDetailsEdit\r\n  isSaving: boolean\r\n  onSave: (data: EmploymentDetailsEdit) => void\r\n  onCancel: () => void\r\n}\r\n\r\ninterface EmploymentDetailsValidity {\r\n  isCompanyValid: boolean\r\n  isLastNameValid: boolean\r\n  isFirstNameValid: boolean\r\n  isEmployerIDValid: boolean\r\n  isSSNValid: boolean\r\n  isDriverIDValid: boolean\r\n  isAlternateIDValid: boolean\r\n  isWorkPhoneValid: boolean\r\n  isHomePhoneValid: boolean\r\n  isMobilePhoneValid: boolean\r\n  isEmailValid: boolean\r\n  isRegulatoryModeValid: boolean\r\n  isCategoryValid: boolean\r\n}\r\n\r\ninterface EmploymentDetailsState extends EmploymentDetailsEdit, EmploymentDetailsValidity {\r\n  companyTypeaheadKey: string\r\n  regionTypeaheadKey: string\r\n  locationTypeaheadKey: string\r\n  isCompaniesLoading: boolean\r\n  isRegionsLoading: boolean\r\n  isStatesLoading: boolean\r\n  isLocationsLoading: boolean\r\n  regions: AutoFilterRegion[]\r\n  nonRegionLocations: AutoFilterLocation[]\r\n  locations: AutoFilterLocation[]\r\n  companiesDetails: AutoFilterCompany[]\r\n  states: State[]\r\n  availableRegulatoryModes: PoolRegulatoryMode[]\r\n  isRegulatoryModesLoading: boolean\r\n  availableCategories: Category[]\r\n  isCategoriesLoading: boolean\r\n}\r\n\r\ninterface Gender {\r\n  Name: string\r\n  Code: string\r\n}\r\n\r\nconst genders: Gender[] = [{ Name: \"Male\", Code: \"M\" }, { Name: \"Female\", Code: \"F\" }]\r\n\r\nexport class EmploymentDetails extends React.Component<EmploymentDetailsProps & EmploymentDetailsAuthProps, EmploymentDetailsState> {\r\n  defaultState: EmploymentDetailsState = {\r\n    companyTypeaheadKey: \"company\",\r\n    regionTypeaheadKey: \"region\",\r\n    locationTypeaheadKey: \"location\",\r\n    isCompaniesLoading: false,\r\n    isRegionsLoading: false,\r\n    isLocationsLoading: false,\r\n    isStatesLoading: false,\r\n    nonRegionLocations: [],\r\n    regions: [],\r\n    locations: [],\r\n    companiesDetails: [],\r\n    isCompanyValid: true,\r\n    isLastNameValid: true,\r\n    isFirstNameValid: true,\r\n    isEmployerIDValid: true,\r\n    isSSNValid: true,\r\n    isDriverIDValid: true,\r\n    isAlternateIDValid: true,\r\n    isWorkPhoneValid: true,\r\n    isHomePhoneValid: true,\r\n    isMobilePhoneValid: true,\r\n    isEmailValid: true,\r\n    isRegulatoryModeValid: true,\r\n    isCategoryValid: true,\r\n    Employer: \"\",\r\n    Driver: \"\",\r\n    SSN: \"\",\r\n    Alternate: \"\",\r\n    Occupation: \"\",\r\n    Inactive: false,\r\n    FirstName: \"\",\r\n    LastName: \"\",\r\n    Address1: \"\",\r\n    Address2: \"\",\r\n    City: \"\",\r\n    Zip: \"\",\r\n    Province: \"\",\r\n    WPhone: \"\",\r\n    HPhone: \"\",\r\n    CPhone: \"\",\r\n    Email: \"\",\r\n    Gender: \"\",\r\n    states: [],\r\n    state: undefined,\r\n    isRegulatoryModesLoading: false,\r\n    availableRegulatoryModes: [],\r\n    selectedRegulatoryMode: undefined,\r\n    isCategoriesLoading: false,\r\n    availableCategories: [],\r\n    selectedCategory: undefined\r\n  }\r\n  state: EmploymentDetailsState = { ...this.defaultState }\r\n\r\n  subscriptions = new Subscription()\r\n\r\n  regionTypeahead = React.createRef<Typeahead<AutoFilterRegion>>()\r\n  locationTypeahead = React.createRef<Typeahead<AutoFilterLocation>>()\r\n  genderTypeahead = React.createRef<Typeahead<Gender>>()\r\n  hiredate = React.createRef<DatePicker>()\r\n  birthdate = React.createRef<DatePicker>()\r\n  regulatoryModeTypeahead = React.createRef<Typeahead<PoolRegulatoryMode>>()\r\n  categoryTypeahead= React.createRef<Typeahead<Category>>()\r\n\r\n  componentDidMount() {\r\n    this.setState({ isCompaniesLoading: true, isStatesLoading: true })\r\n\r\n    this.subscriptions.add(\r\n      AutoFilterCompaniesGet(\"\").subscribe(\r\n        data => {\r\n          const selectedCompany = data.length > 1 ? undefined : data[0]\r\n          this.setState({ companiesDetails: data, isCompaniesLoading: false, selectedCompany: selectedCompany })\r\n        },\r\n        () => this.setState({ isCompaniesLoading: false })\r\n      )\r\n    )\r\n\r\n    this.subscriptions.add(\r\n      StateObservable().subscribe(\r\n        (results: State[]) => this.setState({ states: results, isStatesLoading: false }),\r\n        () => { this.setState({ isStatesLoading: false }) }\r\n      )\r\n    )\r\n\r\n    this.subscriptions.add(LabServiceRegulatoryModesGetObservable().subscribe(\r\n      (data: RegulatoryMode[]) => {\r\n        const convertedRegs: PoolRegulatoryMode[] = data.map(item => ({\r\n          ID: item.RegulatoryModeID,\r\n          Description: item.Name\r\n        }));\r\n        this.setState({\r\n          availableRegulatoryModes: convertedRegs,\r\n          isRegulatoryModesLoading: false\r\n        })\r\n      },\r\n      (error) => {\r\n        toast.error(FormatError(error)),\r\n        this.setState({ isRegulatoryModesLoading: false })\r\n      }\r\n    ))\r\n\r\n  }\r\n\r\n  componentWillUnmount() {\r\n    this.subscriptions.unsubscribe()\r\n  }\r\n\r\n  loadAllRegions = (company?: AutoFilterCompany) => {\r\n    this.setState({ isRegionsLoading: true })\r\n    this.subscriptions.add(\r\n      AutoFilterRegionsGet(company?.AccountID || 0, \"\").subscribe(\r\n        data => this.setState({\r\n          regions: data,\r\n          isRegionsLoading: false,\r\n          regionTypeaheadKey: Math.random().toString()\r\n        }),\r\n        () => this.setState({ isRegionsLoading: false })\r\n      )\r\n    )\r\n  }\r\n\r\n  loadAllLocations = (company?: AutoFilterCompany, region?: AutoFilterRegion) => {\r\n    this.setState({ isLocationsLoading: true })\r\n    this.subscriptions.add(\r\n      AutoFilterLocationsGet(company?.AccountID || 0, region?.Code || \"\", \"\").subscribe(\r\n        data => {\r\n        if (this.props.isLocation) {\r\n          this.setState({locations: data, nonRegionLocations: data, isLocationsLoading: false, selectedLocation: data[0]})\r\n        }\r\n        else {\r\n          this.setState({locations: data, nonRegionLocations: data, isLocationsLoading: false, locationTypeaheadKey: Math.random().toString()\r\n          })\r\n        }\r\n      },\r\n        () => this.setState({ isLocationsLoading: false })\r\n      )\r\n    )\r\n  }\r\n\r\n  loadLocationsWithRegion = (company?: AutoFilterCompany, region?: AutoFilterRegion) => {\r\n    this.setState({ isLocationsLoading: true })\r\n    this.subscriptions.add(\r\n      AutoFilterLocationWithRegionGetObservable(region?.AccountID || 0, \"\").subscribe(\r\n        data => this.setState({\r\n          locations: data,\r\n          isLocationsLoading: false,\r\n          locationTypeaheadKey: Math.random().toString()\r\n        }),\r\n        () => this.setState({ isLocationsLoading: false })\r\n      )\r\n    )\r\n  }\r\n\r\n  loadCategories = (regulatoryMode: PoolRegulatoryMode) => {\r\n    this.setState({ isCategoriesLoading: true })\r\n    this.subscriptions.add(\r\n      EmployeeCategoriesGetObservable(regulatoryMode.ID).subscribe(\r\n        categories => this.setState({ availableCategories: categories, isCategoriesLoading: false }),\r\n        () => this.setState({ isCategoriesLoading: false })\r\n      )\r\n    )\r\n  }\r\n\r\n  ssnRequired = () => this.state.selectedCompany?.PrimaryIDType === \"SSN\"\r\n  employerIDRequired = () => this.state.selectedCompany?.PrimaryIDType === \"EmployerID\"\r\n  driverIDRequired = () => this.state.selectedCompany?.PrimaryIDType === \"DriverID\"\r\n  alternateIDRequired = () => this.state.selectedCompany?.PrimaryIDType === \"AlternateID\"\r\n\r\n  isEmailValid = (value: string) => {\r\n    if (value.length === 0) {\r\n      return true\r\n    }\r\n    return EmailRegexp.test(value)\r\n  }\r\n\r\n  isPhoneValid = (value: string) => value.length === 0 || PhoneRegexp.test(value) || value.toLowerCase() === \"n/p\"\r\n  isNotEmpty = (value: string, required: boolean) => !required || value.trim().length > 0\r\n  isSSNValid = (value: string, required: boolean) => (!required && value.length === 0) || value.replace(/\\D/g, \"\").length === 9\r\n\r\n  isValid = (state: EmploymentDetailsValidity) => {\r\n    return state.isCompanyValid && state.isLastNameValid && state.isFirstNameValid\r\n      && state.isEmployerIDValid && state.isSSNValid && state.isDriverIDValid && state.isAlternateIDValid\r\n      && state.isEmailValid && state.isWorkPhoneValid && state.isHomePhoneValid && state.isMobilePhoneValid\r\n  }\r\n\r\n  handleFormSubmit = (e: React.FormEvent) => {\r\n    e.preventDefault()\r\n    const changes: EmploymentDetailsValidity = {\r\n      isCompanyValid: !!this.state.selectedCompany,\r\n      isLastNameValid: this.state.LastName.trim().length > 0,\r\n      isFirstNameValid: this.state.FirstName.trim().length > 0,\r\n      isEmployerIDValid: this.isNotEmpty(this.state.Employer, this.employerIDRequired()),\r\n      isSSNValid: this.isSSNValid(this.state.SSN, this.ssnRequired()),\r\n      isDriverIDValid: this.isNotEmpty(this.state.Driver, this.driverIDRequired()),\r\n      isAlternateIDValid: this.isNotEmpty(this.state.Alternate, this.alternateIDRequired()),\r\n      isEmailValid: this.isEmailValid(this.state.Email),\r\n      isWorkPhoneValid: this.isPhoneValid(this.state.WPhone),\r\n      isHomePhoneValid: this.isPhoneValid(this.state.HPhone),\r\n      isMobilePhoneValid: this.isPhoneValid(this.state.CPhone),\r\n      isRegulatoryModeValid: !!this.state.selectedRegulatoryMode,\r\n      isCategoryValid: !!this.state.selectedCategory\r\n    }\r\n    const isValid = this.isValid(changes)\r\n\r\n    if (isValid) {\r\n      this.props.onSave(this.state as EmploymentDetailsEdit)\r\n    } else {\r\n      this.setState(changes)\r\n    }\r\n  }\r\n\r\n  handleClose = () => {\r\n    this.setState({ ...this.defaultState })\r\n    this.props.onCancel()\r\n  }\r\n\r\n  handleCompanyChange = (companies: AutoFilterCompany[]) => {\r\n    if (companies.length > 0) {\r\n      let selectedCompany = this.state.companiesDetails.find(i => i.AccountID === companies[0].AccountID )\r\n\r\n      if (![\"SSN\", \"EmployerID\", \"DriverID\", \"AlternateID\"].includes(companies[0].Name))\r\n        {\r\n          this.subscriptions.add(\r\n            AutoFilterCompaniesGet(companies[0].Name).subscribe(\r\n              data => {\r\n                selectedCompany = data.length > 1 ? selectedCompany : data[0]\r\n                this.setState({isCompaniesLoading: false, selectedCompany: selectedCompany})\r\n                this.loadAllRegions(selectedCompany)\r\n                this.loadAllLocations(selectedCompany, undefined)\r\n              },\r\n              () => this.setState({ isCompaniesLoading: false })\r\n            )\r\n          )\r\n        }\r\n\r\n      this.setState({\r\n        selectedCompany: selectedCompany,\r\n        isCompanyValid: true,\r\n        isSSNValid: true,\r\n        isEmployerIDValid: true,\r\n        isDriverIDValid: true,\r\n        isAlternateIDValid: true,\r\n        selectedRegion: undefined,\r\n        selectedLocation: undefined,\r\n        companyTypeaheadKey: Math.random().toString()\r\n      })\r\n      this.loadAllRegions(selectedCompany)\r\n      this.loadAllLocations(selectedCompany, undefined)\r\n    } else {\r\n      this.setState({\r\n        isRegionsLoading: false,\r\n        regions: [],\r\n        nonRegionLocations: [],\r\n        locations: [],\r\n        isSSNValid: true,\r\n        isEmployerIDValid: true,\r\n        isDriverIDValid: true,\r\n        isAlternateIDValid: true,\r\n        selectedCompany: undefined,\r\n        selectedRegion: undefined,\r\n        selectedLocation: undefined,\r\n        isCompanyValid: false\r\n      })\r\n    }\r\n  }\r\n\r\n  handleRegionChange = (regions: AutoFilterRegion[]) => {\r\n    if (regions.length > 0) {\r\n      this.setState({\r\n        selectedRegion: regions[0],\r\n        selectedLocation: undefined,\r\n        regionTypeaheadKey: Math.random().toString()\r\n      })\r\n\r\n      this.loadLocationsWithRegion(this.state.selectedCompany, regions[0])\r\n    } else {\r\n      this.setState({\r\n        isLocationsLoading: false,\r\n        locations: this.state.nonRegionLocations,\r\n        selectedRegion: undefined,\r\n        selectedLocation: undefined\r\n      })\r\n    }\r\n  }\r\n\r\n  handleRegulatoryModeChange = (items: PoolRegulatoryMode[]) => {\r\n    if (items.length > 0) {\r\n      this.setState({ selectedRegulatoryMode: items[0], selectedCategory: undefined, isRegulatoryModeValid: true })\r\n      this.loadCategories(items[0])\r\n    } else {\r\n      this.setState({selectedRegulatoryMode: undefined, selectedCategory: undefined })\r\n    }\r\n  }\r\n\r\n  handleCategoryChange = (items: Category[]) => this.setState({ selectedCategory: items[0], isCategoryValid: (items.length > 0 ? true : false) })\r\n\r\n  handleLocationChange = (locations: AutoFilterLocation[]) => this.setState({ selectedLocation: locations[0], locationTypeaheadKey: Math.random().toString() })\r\n  handlePhoneChange = (value: string, stateKey: string, stateValidKey: string) => this.setState({ ...{}, [stateKey]: value, [stateValidKey]: this.isPhoneValid(value) })\r\n  handleStateChange = (state: State) => this.setState({ state: state })\r\n\r\n  render() {\r\n    const employerIDRequired = this.employerIDRequired()\r\n    const driverIDRequired = this.driverIDRequired()\r\n    const ssnRequired = this.ssnRequired()\r\n    const alternateIDRequired = this.alternateIDRequired()\r\n\r\n    return <Form onSubmit={this.handleFormSubmit}>\r\n      <Row><Col><h5>EMPLOYMENT INFO</h5></Col></Row>\r\n      <Form.Row className={`form-group ${employerIDRequired ? \"required\" : \"\"}`}>\r\n        <Form.Label column sm={3}>EMPLOYER ID</Form.Label>\r\n        <Col md={9}>\r\n          <Form.Control type=\"text\" isInvalid={!this.state.isEmployerIDValid} value={this.state.Employer} onChange={(e) => { this.setState({ Employer: e.target.value, isEmployerIDValid: this.isNotEmpty(e.target.value, employerIDRequired) }) }} />\r\n        </Col>\r\n      </Form.Row>\r\n      <Form.Row className={`form-group ${driverIDRequired ? \"required\" : \"\"}`}>\r\n        <Form.Label column sm={3}>DRIVER ID</Form.Label>\r\n        <Col md={9}>\r\n          <Form.Control type=\"text\" isInvalid={!this.state.isDriverIDValid} value={this.state.Driver} onChange={(e) => { this.setState({ Driver: e.target.value, isDriverIDValid: this.isNotEmpty(e.target.value, driverIDRequired) }) }} />\r\n        </Col>\r\n      </Form.Row>\r\n      <Form.Row className={`form-group ${ssnRequired ? \"required\" : \"\"}`}>\r\n        <Form.Label column sm={3}>SSN</Form.Label>\r\n        <Col md={9}>\r\n          <Form.Control type=\"text\"\r\n            as={MaskedInput}\r\n            mask=\"111-11-1111\"\r\n            value={this.state.SSN}\r\n            onChange={(e) => {\r\n              const ssn = FormatSSN(e.target.value)\r\n              this.setState({ SSN: ssn, isSSNValid: this.isSSNValid(ssn, ssnRequired) })\r\n            }}\r\n            isInvalid={!this.state.isSSNValid} />\r\n        </Col>\r\n      </Form.Row>\r\n      <Form.Row className={`form-group ${alternateIDRequired ? \"required\" : \"\"}`}>\r\n        <Form.Label column sm={3}>ALTERNATE ID</Form.Label>\r\n        <Col md={9}>\r\n          <Form.Control type=\"text\" isInvalid={!this.state.isAlternateIDValid} value={this.state.Alternate} onChange={(e) => { this.setState({ Alternate: e.target.value, isAlternateIDValid: this.isNotEmpty(e.target.value, alternateIDRequired) }) }} />\r\n        </Col>\r\n      </Form.Row>\r\n      <Form.Row className=\"form-group required\">\r\n        <Form.Label column sm={3}>COMPANY</Form.Label>\r\n        { this.state.companiesDetails.length <= 1 && <Row><Col md={9}>{this.state.companiesDetails[0]?.Name}</Col></Row> }\r\n        { this.state.companiesDetails.length > 1 &&\r\n          <Col md={9}>\r\n            <CompanyInput filter onChange={ this.handleCompanyChange } placeholder=\"Select\" />\r\n          </Col>}\r\n      </Form.Row>\r\n      <Form.Row className=\"form-group\">\r\n        <Form.Label column sm={3}>REGION</Form.Label>\r\n        {!this.state.isRegionsLoading && this.state.regions.length === 0 && <Form.Label column sm={9}>None</Form.Label>}\r\n        {(this.state.isRegionsLoading || this.state.regions.length > 0) &&\r\n          <Col md={9}>\r\n            <div className=\"typeahead\">\r\n              <Typeahead id=\"region\"\r\n                key={this.state.regionTypeaheadKey}\r\n                ref={this.regionTypeahead}\r\n                labelKey=\"Name\"\r\n                filterBy={(option, props) => props.selected.length > 0 || option.Name.toLowerCase().indexOf(props.text.toLowerCase()) !== -1}\r\n                isLoading={this.state.isRegionsLoading}\r\n                onChange={this.handleRegionChange}\r\n                options={this.state.regions}\r\n                selected={this.state.selectedRegion ? [this.state.selectedRegion] : []}\r\n                emptyLabel=\"No Regions Found\"\r\n                placeholder=\"Select\"\r\n                inputProps={{ autoComplete: \"chrome-off\" }}>\r\n                {!this.state.isRegionsLoading &&\r\n                  <Button variant=\"toggle\" onClick={() => { this.regionTypeahead?.current?.toggleMenu() }}>\r\n                    <FaAngleDown />\r\n                  </Button>}\r\n              </Typeahead>\r\n            </div>\r\n          </Col>}\r\n      </Form.Row>\r\n      <Form.Row className=\"form-group\">\r\n        <Form.Label column sm={3}>LOCATION</Form.Label>\r\n        {!this.state.isLocationsLoading && this.state.locations.length === 0 && <Form.Label column sm={9}>None</Form.Label>}\r\n        {!this.state.isLocationsLoading && this.props.isLocation &&\r\n          <Col md={9}><Form.Control type=\"text\" value={this.state.selectedLocation?.Name || \"\"} disabled={true} onChange={() => { }} /></Col>}\r\n        {(this.state.isLocationsLoading || this.state.locations.length > 0) && !this.props.isLocation &&\r\n          <Col md={9}>\r\n            <div className=\"typeahead\">\r\n              <Typeahead id=\"location\"\r\n                key={this.state.locationTypeaheadKey}\r\n                ref={this.locationTypeahead}\r\n                labelKey=\"Name\"\r\n                filterBy={(option, props) => props.selected.length > 0 || option.Name.toLowerCase().indexOf(props.text.toLowerCase()) !== -1}\r\n                isLoading={this.state.isLocationsLoading}\r\n                onChange={this.handleLocationChange}\r\n                options={this.state.locations}\r\n                selected={this.state.selectedLocation ? [this.state.selectedLocation] : []}\r\n                emptyLabel=\"No Locations Found\"\r\n                placeholder=\"Select\">\r\n                {!this.state.isLocationsLoading &&\r\n                  <Button variant=\"toggle\" onClick={() => { this.locationTypeahead?.current?.toggleMenu() }}>\r\n                    <FaAngleDown />\r\n                  </Button>}\r\n              </Typeahead>\r\n            </div>\r\n          </Col>}\r\n      </Form.Row>\r\n      <Form.Row className=\"form-group\">\r\n        <Form.Label column sm={3}>OCCUPATION</Form.Label>\r\n        <Col md={9}>\r\n          <Form.Control type=\"text\" value={this.state.Occupation} onChange={(e) => { this.setState({ Occupation: e.target.value }) }} />\r\n        </Col>\r\n      </Form.Row>\r\n      <Form.Row className=\"form-group\">\r\n        <Form.Label column sm={3}>HIRE DATE</Form.Label>\r\n        <Col md={9}>\r\n          <DatePicker className=\"form-control\"\r\n            ref={this.hiredate}\r\n            peekNextMonth\r\n            showMonthDropdown\r\n            showYearDropdown\r\n            dropdownMode=\"select\"\r\n            maxDate={new Date()}\r\n            selected={this.state.HireDate as Date}\r\n            enableTabLoop={false}\r\n            onKeyDown={(e) => { if (this.hiredate && this.hiredate.current && e.key === 'Tab') { this.hiredate.current.setOpen(false) } }}\r\n            onChange={date => this.setState({ HireDate: date as Date || undefined })}\r\n            customInput={<BirthdayInput />} />\r\n        </Col>\r\n      </Form.Row>\r\n      <Form.Row className=\"form-group\">\r\n        <Form.Label column sm={3}>INACTIVE</Form.Label>\r\n        <Col md={9}>\r\n          <Form.Check checked={this.state.Inactive} onChange={(e: React.ChangeEvent<HTMLInputElement>) => this.setState({ Inactive: e.target.checked })} label=\"\" id=\"personnel_inactive\" className=\"mt-2\" />\r\n        </Col>\r\n      </Form.Row>\r\n      <Form.Row className=\"form-group\">\r\n        <Form.Label column sm={3}>REGULATORY MODE</Form.Label>\r\n        {!this.state.isRegulatoryModesLoading && this.state.availableRegulatoryModes.length === 0 && <Form.Label column sm={9}>LOADING...</Form.Label>}\r\n        {(this.state.isRegulatoryModesLoading || this.state.availableRegulatoryModes.length > 0) &&\r\n          <Col md={9}>\r\n            <Typeahead id=\"regMode\"\r\n              ref={this.regulatoryModeTypeahead}\r\n              labelKey=\"Description\"\r\n              filterBy={(option, props) => props.selected.length > 0 || option?.Description.toLowerCase().indexOf(props.text.toLowerCase()) !== -1}\r\n              onChange={this.handleRegulatoryModeChange}\r\n              disabled={this.state.isRegulatoryModesLoading}\r\n              isInvalid={!this.state.isRegulatoryModeValid}\r\n              options={this.state.availableRegulatoryModes}\r\n              selected={this.state.selectedRegulatoryMode ? [this.state.selectedRegulatoryMode] : []}\r\n              emptyLabel=\"No Regulatory Modes Found\"\r\n              placeholder=\"Select\">\r\n              <Button variant=\"toggle\" onClick={() => { this.regulatoryModeTypeahead.current?.toggleMenu() }}>\r\n                <FaAngleDown />\r\n              </Button>\r\n            </Typeahead>\r\n          </Col>}\r\n      </Form.Row>\r\n        <Form.Row className=\"form-group\">\r\n          <Form.Label column sm={3}>CATEGORY</Form.Label>\r\n          {!this.state.isCategoriesLoading && this.state.availableCategories.length === 0 && <Form.Label column sm={9}>None</Form.Label>}\r\n          {(this.state.isCategoriesLoading || this.state.availableCategories.length > 0) &&\r\n            <Col md={9}>\r\n              <Typeahead id=\"category\"\r\n                ref={this.categoryTypeahead}\r\n                labelKey=\"Name\"\r\n                filterBy={(option, props) => props.selected.length > 0 || option.Name.toLowerCase().indexOf(props.text.toLowerCase()) !== -1}\r\n                onChange={this.handleCategoryChange}\r\n                disabled={this.state.isCategoriesLoading}\r\n                isInvalid={!this.state.isCategoryValid}\r\n                options={this.state.availableCategories}\r\n                selected={this.state.selectedCategory ? [this.state.selectedCategory] : []}\r\n                emptyLabel=\"No Categories Found\"\r\n                placeholder=\"Select\">\r\n                <Button variant=\"toggle\" onClick={() => { this.categoryTypeahead.current?.toggleMenu() }}>\r\n                  <FaAngleDown />\r\n                </Button>\r\n              </Typeahead>\r\n            </Col>}\r\n        </Form.Row>\r\n      <Row><Col><h5>GENERAL</h5></Col></Row>\r\n      <Form.Row className=\"form-group required\">\r\n        <Form.Label column sm={3}>FIRST NAME</Form.Label>\r\n        <Col md={9}>\r\n          <Form.Control type=\"text\" isInvalid={!this.state.isFirstNameValid} maxLength={20} value={this.state.FirstName} onChange={(e) => { this.setState({ FirstName: e.target.value, isFirstNameValid: e.target.value.trim().length > 0 }) }} />\r\n        </Col>\r\n      </Form.Row>\r\n      <Form.Row className=\"form-group required\">\r\n        <Form.Label column sm={3}>LAST NAME</Form.Label>\r\n        <Col md={9}>\r\n          <Form.Control type=\"text\" isInvalid={!this.state.isLastNameValid} maxLength={20} value={this.state.LastName} onChange={(e) => { this.setState({ LastName: e.target.value, isLastNameValid: e.target.value.trim().length > 0 }) }} />\r\n        </Col>\r\n      </Form.Row>\r\n      <Form.Row className=\"form-group\">\r\n        <Form.Label column sm={3}>GENDER</Form.Label>\r\n        <Col md={9}>\r\n          <div className=\"typeahead\">\r\n            <Typeahead id=\"gender\"\r\n              ref={this.genderTypeahead}\r\n              labelKey=\"Name\"\r\n              filterBy={(option, props) => props.selected.length > 0 || option.Name.toLowerCase().indexOf(props.text.toLowerCase()) !== -1}\r\n              onChange={selected => this.setState({ Gender: selected[0]?.Code || \"\" })}\r\n              options={genders}\r\n              selected={this.state.Gender !== \"\" ? [genders.find((el) => el?.Code == this.state.Gender) || genders[0]] : []}\r\n              placeholder=\"Select\">\r\n              <Button variant=\"toggle\" onClick={() => { this.genderTypeahead.current?.toggleMenu() }}>\r\n                <FaAngleDown />\r\n              </Button>\r\n            </Typeahead>\r\n          </div>\r\n        </Col>\r\n      </Form.Row>\r\n      <Form.Row className=\"form-group\">\r\n        <Form.Label column sm={3}>DATE OF BIRTH</Form.Label>\r\n        <Col md={9}>\r\n          <DatePicker className=\"form-control\"\r\n            ref={this.birthdate}\r\n            peekNextMonth\r\n            showMonthDropdown\r\n            showYearDropdown\r\n            dropdownMode=\"select\"\r\n            maxDate={new Date()}\r\n            selected={this.state.DOB as Date}\r\n            enableTabLoop={false}\r\n            onKeyDown={(e) => { if (this.birthdate && this.birthdate.current && e.key === 'Tab') { this.birthdate.current.setOpen(false) } }}\r\n            onChange={date => this.setState({ DOB: date as Date || undefined })}\r\n            customInput={<BirthdayInput />} />\r\n        </Col>\r\n      </Form.Row>\r\n      <Row><Col><h5>CONTACT INFO</h5></Col></Row>\r\n      <Form.Row className=\"form-group\">\r\n        <Form.Label column sm={3}>ADDRESS LINE 1</Form.Label>\r\n        <Col md={9}>\r\n          <Form.Control type=\"text\" value={this.state.Address1} onChange={(e) => { this.setState({ Address1: e.target.value }) }} />\r\n        </Col>\r\n      </Form.Row>\r\n      <Form.Row className=\"form-group\">\r\n        <Form.Label column sm={3}>ADDRESS LINE 2</Form.Label>\r\n        <Col md={9}>\r\n          <Form.Control type=\"text\" value={this.state.Address2} onChange={(e) => { this.setState({ Address2: e.target.value }) }} />\r\n        </Col>\r\n      </Form.Row>\r\n      <Form.Row className=\"form-group\">\r\n        <Form.Label column sm={3}>CITY</Form.Label>\r\n        <Col md={9}>\r\n          <Form.Control type=\"text\" value={this.state.City} onChange={(e) => { this.setState({ City: e.target.value }) }} />\r\n        </Col>\r\n      </Form.Row>\r\n      <Form.Row className=\"form-group\">\r\n        <Form.Label column sm={3}>STATE</Form.Label>\r\n        <Col md={9}>\r\n          <StateSelect states={this.state.states} dropButtonIfInvalid selectedCode={this.state.state?.Abbreviation} onChange={(state) => this.handleStateChange(state)} />\r\n        </Col>\r\n      </Form.Row>\r\n      <Form.Row className=\"form-group\">\r\n        <Form.Label column sm={3}>ZIP</Form.Label>\r\n        <Col md={9}>\r\n          <Form.Control type=\"text\" value={this.state.Zip} onChange={(e) => { this.setState({ Zip: FormatZipCode(e.target.value) }) }} />\r\n        </Col>\r\n      </Form.Row>\r\n      <Form.Row className=\"form-group\">\r\n        <Form.Label column sm={3}>PROVINCE</Form.Label>\r\n        <Col md={9}>\r\n          <Form.Control type=\"text\" value={this.state.Province} onChange={(e) => { this.setState({ Province: e.target.value }) }} />\r\n        </Col>\r\n      </Form.Row>\r\n      <Form.Row className=\"form-group\">\r\n        <Form.Label column sm={3}>WORK PHONE</Form.Label>\r\n        <Col md={9}>\r\n          <PhoneNumberMaskedInput value={this.state.WPhone} onChange={(value: string) => this.handlePhoneChange(value, \"WPhone\", \"isWorkPhoneValid\")} isInvalid={!this.state.isWorkPhoneValid} />\r\n        </Col>\r\n      </Form.Row>\r\n      <Form.Row className=\"form-group\">\r\n        <Form.Label column sm={3}>HOME PHONE</Form.Label>\r\n        <Col md={9}>\r\n          <PhoneNumberMaskedInput value={this.state.HPhone} onChange={(value: string) => this.handlePhoneChange(value, \"HPhone\", \"isHomePhoneValid\")} isInvalid={!this.state.isHomePhoneValid} />\r\n        </Col>\r\n      </Form.Row>\r\n      <Form.Row className=\"form-group\">\r\n        <Form.Label column sm={3}>MOBILE PHONE</Form.Label>\r\n        <Col md={9}>\r\n          <PhoneNumberMaskedInput value={this.state.CPhone} onChange={(value: string) => this.handlePhoneChange(value, \"CPhone\", \"isMobilePhoneValid\")} isInvalid={!this.state.isMobilePhoneValid} />\r\n        </Col>\r\n      </Form.Row>\r\n      <Form.Row className=\"form-group\">\r\n        <Form.Label column sm={3}>EMAIL</Form.Label>\r\n        <Col md={9}>\r\n          <Form.Control type=\"text\" isInvalid={!this.state.isEmailValid} value={this.state.Email} onChange={(e) => { this.setState({ Email: e.target.value, isEmailValid: this.isEmailValid(e.target.value) }) }} />\r\n        </Col>\r\n      </Form.Row>\r\n      <Form.Row className=\"modal-footer\">\r\n        <Button variant=\"secondary\" onClick={() => this.handleClose()}>CANCEL</Button>\r\n        <ActionButton variant=\"primary\" type=\"submit\" disabled={!this.isValid(this.state)} spin={this.props.isSaving} disableOnSpin>SAVE</ActionButton>\r\n      </Form.Row>\r\n    </Form>\r\n  }\r\n}\r\n\r\nfunction mapStateToProps(state: AppState): EmploymentDetailsAuthProps {\r\n  return {\r\n    isLocation: (GetSelectedAssignedClinic(state)?.LocationID || 0) > 0\r\n  }\r\n}\r\nconst ConnectedEmploymentDetails = connect(mapStateToProps, null)(EmploymentDetails)\r\nexport default ConnectedEmploymentDetails","import * as React from \"react\"\r\nimport { Modal } from \"react-bootstrap\"\r\nimport { toast } from \"react-toastify\"\r\nimport { RandomPersonnelAddPersonObservable, RandomPersonnelGridResponse } from \"../../api/Randoms/RandomPersonnelListGet\"\r\nimport RandomPersonnelAdd from \"../../api/Randoms/RandomPersonnelAdd\"\r\nimport RandomPersonnelGridOptions from \"../../api/Randoms/RandomPersonnelModel/RandomPersonnelGridOptions\"\r\nimport EmploymentDetails from \"../EmploymentDetails\"\r\nimport EmploymentDetailsEdit from \"../../api/Randoms/RandomPersonnelModel/EmploymentDetailsEdit\"\r\nimport FormatDate from \"../../formatters/FormatDate\"\r\n\r\ninterface AddIndividualModalProps {\r\n  show: boolean\r\n  onAdd: (donorID?: number) => void\r\n  onCancel: () => void\r\n}\r\n\r\nexport default class AddIndividualModal extends React.Component<AddIndividualModalProps, { saving: boolean }> {\r\n  state = { saving: false }\r\n  emptyData: EmploymentDetailsEdit = {\r\n    Employer: \"\",\r\n    Driver: \"\",\r\n    SSN: \"\",\r\n    Alternate: \"\",\r\n    Occupation: \"\",\r\n    Inactive: false,\r\n    FirstName: \"\",\r\n    LastName: \"\",\r\n    Address1: \"\",\r\n    Address2: \"\",\r\n    City: \"\",\r\n    Zip: \"\",\r\n    Province: \"\",\r\n    WPhone: \"\",\r\n    HPhone: \"\",\r\n    CPhone: \"\",\r\n    Email: \"\",\r\n    Gender: \"\"\r\n  }\r\n\r\n  handleSave = (data: EmploymentDetailsEdit) => {\r\n    data.SSN = data.SSN.replace(/\\D/g, '')\r\n\r\n    const search = (data: EmploymentDetailsEdit): { field: string, text: string } => {\r\n      switch (data.selectedCompany?.PrimaryIDType || \"\") {\r\n        case \"EmployerID\":\r\n          return { field: \"Employer ID\", text: data.Employer }\r\n        case \"SSN\":\r\n          return { field: \"SSN\", text: data.SSN }\r\n        case \"DriverID\":\r\n          return { field: \"Driver ID\", text: data.Driver }\r\n        case \"AlternateID\":\r\n          return { field: \"Alternate ID\", text: data.Alternate }\r\n      }\r\n      return { field: \"\", text: \"\" }\r\n    }\r\n    const params: RandomPersonnelGridOptions = {\r\n      search: search(data),\r\n      sort: { column: \"\", order: \"\" },\r\n      filters: [],\r\n      columnFilters: [],\r\n      pageNumber: 1,\r\n      pageSize: 20,\r\n      isConsortium: false,\r\n      forceReload: false\r\n    }\r\n    this.setState({ saving: true })\r\n    RandomPersonnelAddPersonObservable(params).subscribe(\r\n      ((result: RandomPersonnelGridResponse) => {\r\n        if (result.Records.length > 0) {\r\n          this.setState({ saving: false })\r\n          toast.error(\"Person already present. Please add another.\")\r\n        } else {\r\n          this.addPersonnel(data)\r\n        }\r\n      }),\r\n      (error: string) => {\r\n        this.setState({ saving: false })\r\n        toast.error(error)\r\n      }\r\n    )\r\n  }\r\n\r\n  addPersonnel = (data: EmploymentDetailsEdit) => {\r\n    const phoneString = (phone: string): string => {\r\n      if (phone.toLowerCase() === \"np\" || phone.toLowerCase() === \"n/p\") {\r\n        return \"N/P\"\r\n      } else {\r\n        phone = phone.replace(/\\D/g, \"\")\r\n        return phone.length === 10 ? phone : \"N/P\"\r\n      }\r\n    }\r\n\r\n    const primaryIDKeys = (data: EmploymentDetailsEdit): { PrimaryIDType: string, PrimaryIDValue: string } => {\r\n      switch (data.selectedCompany?.PrimaryIDType || \"\") {\r\n        case \"EmployerID\":\r\n          return { PrimaryIDType: \"EmployerID\", PrimaryIDValue: data.Employer }\r\n        case \"SSN\":\r\n          return { PrimaryIDType: \"SSN\", PrimaryIDValue: data.SSN }\r\n        case \"DriverID\":\r\n          return { PrimaryIDType: \"DriverID\", PrimaryIDValue: data.Driver }\r\n        case \"AlternateID\":\r\n          return { PrimaryIDType: \"AlternateID\", PrimaryIDValue: data.Alternate }\r\n      }\r\n      return { PrimaryIDType: \"\", PrimaryIDValue: \"\" }\r\n    }\r\n\r\n    const params: EmploymentDetailsEdit = {\r\n      ...primaryIDKeys(data),\r\n      AccountID: data.selectedCompany?.AccountID || 0, // TODO VALUESTORAGE.ACCOUNT_ID\r\n      Employer: data.Employer,\r\n      Driver: data.Driver,\r\n      SSN: data.SSN.replace(/\\D/g, ''),\r\n      Alternate: data.Alternate,\r\n      Company:  data.selectedCompany?.Name || \"\",\r\n      CompanyID: data.selectedCompany?.AccountID || 0,\r\n      Region: data.selectedRegion?.Name || \"\",\r\n      RegionID: data.selectedRegion?.AccountID || 0,\r\n      Location: data.selectedLocation?.Name || \"\",\r\n      LocationID: data.selectedLocation?.AccountID || 0,\r\n      Supervisor1ID: data.selectedSupervisor1?.ContactID || 0,\r\n      Supervisor1: data.selectedSupervisor1?.FullName || \"\",\r\n      Supervisor2ID: data.selectedSupervisor2?.ContactID || 0,\r\n      Supervisor2: data.selectedSupervisor2?.FullName || \"\",\r\n      Occupation: data.Occupation,\r\n      HireDate: FormatDate(data.HireDate),\r\n      Inactive: data.Inactive,\r\n      FirstName: data.FirstName.replace(/^\\s+|\\s+$/gm, \"\").replace(/\\s+/g, \" \"),\r\n      LastName: data.LastName.replace(/^\\s+|\\s+$/gm, \"\").replace(/\\s+/g, \" \"),\r\n      Gender: data.Gender,\r\n      DOB: FormatDate(data.DOB),\r\n      Address1: data.Address1,\r\n      Address2: data.Address2,\r\n      City: data.City,\r\n      StateID: data.state?.StateProvinceTerritoryID || 0,\r\n      Zip: data.Zip,\r\n      Province: data.Province,\r\n      WPhone: phoneString(data.WPhone),\r\n      HPhone: phoneString(data.HPhone),\r\n      CPhone: phoneString(data.CPhone),\r\n      Email: data.Email,\r\n      PreEmploymentTest: false,\r\n      CompanyPrimaryID: null,\r\n      RegModeID: data.selectedRegulatoryMode?.ID || 0,\r\n      EmpCatID: data.selectedCategory?.EmployeeCategoryID\r\n    }\r\n    RandomPersonnelAdd(params).subscribe(\r\n      ((result) => {\r\n        this.setState({ saving: false })\r\n        if (Number(result) > 0) {\r\n          toast.success(\"Added member successfully.\")\r\n          this.props.onAdd(Number(result))\r\n        } else {\r\n          toast.error(result)\r\n        }\r\n      }),\r\n      (error: string) => {\r\n        this.setState({ saving: false })\r\n        toast.error(error)\r\n      }\r\n    )\r\n  }\r\n\r\n  render() {\r\n    return <Modal backdrop=\"static\" size=\"lg\" centered show={this.props.show} onHide={this.props.onCancel} >\r\n      <Modal.Header closeButton>\r\n        <Modal.Title>ADD INDIVIDUAL</Modal.Title>\r\n      </Modal.Header>\r\n      <Modal.Body>\r\n        <EmploymentDetails data={this.emptyData} isSaving={this.state.saving} onCancel={this.props.onCancel} onSave={this.handleSave} />\r\n      </Modal.Body>\r\n    </Modal >\r\n  }\r\n}\r\n","import { Observable } from \"rxjs\"\r\nimport { ObservableFromFetch } from \"../../ObservableFromFetch\"\r\nimport ImportJobActionResult from \"./Model/ImportJobActionResult\"\r\n\r\nexport default function ImportJobCreateAndPerformObservable(\r\n  base64string: string, hasHeaderRow: boolean, fileName?: string,\r\n  companyID?: number, poolID?: number,\r\n  isGovtPersonnel?: boolean, isCompanyCodeRequired?: boolean): Observable<ImportJobActionResult> {\r\n  const params: string = JSON.stringify({\r\n    AccountType: 2,\r\n    CSVFileBase64String: base64string,\r\n    FileName: fileName,\r\n    HasHeaderRow: hasHeaderRow,\r\n    UseTemplate: false,\r\n    ImportJobID: 0,\r\n    CompanyID: companyID || 0,\r\n    GovtPersonnel: isGovtPersonnel,\r\n    WorkforcePersonnel: !isGovtPersonnel,\r\n    PoolID: poolID || 0,\r\n    CompanyCodeRequired: isCompanyCodeRequired,\r\n    MultiplePools: false\r\n  })\r\n\r\n  return ObservableFromFetch<ImportJobActionResult>(\"WorkforceImport/CreateAndPerformImportJob\", params)\r\n}\r\n","import { useState } from \"react\"\r\n\r\nimport { Button, Modal } from \"react-bootstrap\"\r\n\r\nimport ImportErrorDetails from \"./ImportErrorDetails\"\r\n\r\ninterface ImportErrorDetailsProps {\r\n  show: boolean\r\n  importJobID: number\r\n  pageSize?: number\r\n  onClose?: () => void\r\n}\r\n\r\nfunction ImportErrorDetailsModal(props: ImportErrorDetailsProps) {\r\n  const { show, importJobID, pageSize, onClose } = props\r\n  const [showModal, setShowModal] = useState(show)\r\n\r\n  const handleClose = () => {\r\n    onClose?.()\r\n    setShowModal(false)\r\n  }\r\n\r\n  return (\r\n    <Modal\r\n      backdrop=\"static\"\r\n      centered\r\n      show={showModal}\r\n      onHide={() => handleClose()}\r\n      dialogClassName=\"modal-90w\"\r\n      size=\"xl\"\r\n    >\r\n      <Modal.Header closeButton>\r\n        <Modal.Title className=\"text-uppercase text-danger\">Import errors:</Modal.Title>\r\n      </Modal.Header>\r\n      <Modal.Body className=\"pt-3\">\r\n        <ImportErrorDetails importJobID={importJobID} pageSize={pageSize} />\r\n      </Modal.Body>\r\n      <Modal.Footer>\r\n        <Button variant=\"primary\" onClick={() => handleClose()}>\r\n          CLOSE\r\n        </Button>\r\n      </Modal.Footer>\r\n    </Modal>\r\n  )\r\n}\r\n\r\nImportErrorDetailsModal.defaultProps = {\r\n  pageSize: 10,\r\n  onClose: () => {},\r\n}\r\n\r\nexport default ImportErrorDetailsModal\r\n","import * as React from \"react\"\r\nimport { Container, Modal, Row, Col, Button, Form, Spinner, Table } from \"react-bootstrap\"\r\nimport { toast } from \"react-toastify\"\r\nimport { Subscription } from \"rxjs\"\r\nimport { APIError } from \"../../api/ObservableFromFetch\"\r\nimport ActionButton from \"../ActionButton\"\r\nimport { ConsortiumsMembership, RetrieveConsortiumsMembership, UpdateConsortiumsMembership } from \"../../api/Randoms/RandomPersonnelListGet\"\r\nimport Checkbox from \"../Checkbox\"\r\n\r\ninterface ConsortiumMembershipModalProps {\r\n  PersonID: number\r\n  onClose: () => void\r\n}\r\n\r\ninterface ConsortiumMembershipModalState {\r\n  saving: boolean\r\n  loading: boolean\r\n  data: ConsortiumsMembership[]\r\n}\r\n\r\nexport default class ConsortiumMembershipModal extends React.PureComponent<ConsortiumMembershipModalProps, {}> {\r\n  state: ConsortiumMembershipModalState = { saving: false, loading: false, data: [] }\r\n  loadSubscription?: Subscription\r\n  saveSubscription?: Subscription\r\n\r\n  componentDidMount() {\r\n    this.setState({ loading: true })\r\n    this.loadSubscription && this.loadSubscription.unsubscribe()\r\n    this.loadSubscription = RetrieveConsortiumsMembership(this.props.PersonID).subscribe(\r\n      result => this.setState({data: result, loading: false}),\r\n      error => this.handleAPIError(error, { loading: false })\r\n    )\r\n  }\r\n\r\n  componentWillUnmount() {\r\n    this.loadSubscription && this.loadSubscription.unsubscribe()\r\n    this.saveSubscription && this.saveSubscription.unsubscribe()\r\n  }\r\n\r\n  handleAPIError = (error: Error | APIError, stateChanges: object) => {\r\n    this.setState(stateChanges)\r\n    error && toast.error((error as APIError)?.errorData?.message || error.message)\r\n  }\r\n\r\n  save = () => {\r\n    this.setState({ saving: true })\r\n    this.saveSubscription && this.saveSubscription.unsubscribe()\r\n    this.saveSubscription = UpdateConsortiumsMembership(this.state.data).subscribe(\r\n      result => {\r\n        toast.success(result)\r\n        this.setState({saving: false})\r\n      },\r\n      error => this.handleAPIError(error, { saving: false })\r\n    )\r\n  }\r\n\r\n  DataRow = (data: ConsortiumsMembership, index: number) => {\r\n    return <tr key={data.PersonAssignedToPoolID}>\r\n      <td>{data.Name}</td>\r\n      <td><Checkbox id={`toggleActive${data.PersonAssignedToPoolID}`} checked={data.Active} onChange={() => this.toggleActive(index)} className=\"mr-auto\" /></td>\r\n    </tr>\r\n  }\r\n\r\n  toggleActive = (index: number) => {\r\n    const newData: ConsortiumsMembership[] = [...this.state.data]\r\n    newData[index].Active = !newData[index].Active\r\n    this.setState({ data: newData })\r\n  }\r\n\r\n  render() {\r\n    const { saving, loading, data } = this.state\r\n\r\n    return <Modal backdrop=\"static\" centered show onHide={() => this.props.onClose()} size=\"lg\">\r\n      <Modal.Header closeButton>\r\n        <Modal.Title>Consortiums Membership</Modal.Title>\r\n      </Modal.Header>\r\n      <Modal.Body>\r\n        <Form.Group as={Row}>\r\n          <Table responsive bordered className=\"dark text-center\">\r\n            <thead><tr><th className=\"w-75\">Consortium Name</th><th className=\"w-25\">Active</th></tr></thead>\r\n            <tbody>\r\n              {loading ? <tr><td colSpan={2}><Spinner animation=\"border\" size=\"sm\" /></td></tr> : data.map((cons, index) => this.DataRow(cons, index))}\r\n            </tbody>\r\n          </Table>\r\n        </Form.Group>\r\n      </Modal.Body>\r\n      <Modal.Footer>\r\n        <Button variant=\"secondary\" onClick={() => this.props.onClose()} className=\"mr-auto fixed-w5\">CANCEL</Button>\r\n        <ActionButton variant=\"primary\" onClick={() => this.save()} spin={saving} disableOnSpin className=\"fixed-w5\">UPDATE</ActionButton>\r\n      </Modal.Footer>\r\n    </Modal>\r\n  }\r\n}","import React from \"react\"\r\nimport { Container, Row, Col, Table, Spinner, Button, } from \"react-bootstrap\"\r\nimport { BehaviorSubject, Subscription, concat, of } from \"rxjs\"\r\nimport { catchError, map, switchMap } from \"rxjs/operators\"\r\nimport { toast } from \"react-toastify\"\r\nimport { FaPrint } from \"react-icons/fa\"\r\nimport FileSaver from \"file-saver\"\r\nimport RandomPersonnelGridRecord from \"../../api/Randoms/RandomPersonnelModel/RandomPersonnelGridRecord\"\r\nimport RandomPersonnelGridOptions from \"../../api/Randoms/RandomPersonnelModel/RandomPersonnelGridOptions\"\r\nimport RandomPersonnelIdentifier from \"../../api/Randoms/RandomPersonnelModel/RandomPersonnelIdentifier\"\r\nimport { RandomPersonnelGridObservable, RandomPersonnelExportCsv, RandomPersonnelPrint, RandomPersonnelGridResponse } from \"../../api/Randoms/RandomPersonnelListGet\"\r\nimport RandomPersonnelImport from \"../../api/Randoms/RandomPersonnelImport\"\r\nimport RandomPersonnelRemove from \"../../api/Randoms/RandomPersonnelRemove\"\r\nimport AutoFilterCompany from \"../../api/Companies/CompanyModel/AutoFilterCompany\"\r\nimport AutoFilterLocation from \"../../api/Location/LocationModel/AutoFilterLocation\"\r\nimport AutoFilterRegion from \"../../api/Regions/Model/AutoFilterRegion\"\r\nimport RegulatoryMode from \"../../api/LabService/LabServiceModel/RegulatoryMode\"  // LabServiceRegulatoryModesGet\r\nimport EmployeeCategory from \"../../api/LabService/LabServiceModel/EmployeeCategory\"\r\nimport RandomPersonnelSearchFieldsObservable from \"../../api/Randoms/RandomPersonnelSearchFieldsGet\"\r\nimport RandomPersonnelCheckbox from \"./RandomPersonnelCheckbox\"\r\nimport ColumnsCustomizeModal from \"../ColumnsCustomizeModal/ColumnsCustomizeModal\"\r\nimport EmployeeDetailsModal from \"../OrderResults/EmployeeDetailsModal\"\r\nimport TablePagination from \"../TablePagination\"\r\nimport ColumnHeaderFilter from \"../ColumnHeaderFilter\"\r\nimport SearchBar from \"../SearchBar\"\r\nimport SearchField from \"../../api/SearchField\"\r\nimport AdvancedFiltersModal from \"./AdvancedFiltersModal\"\r\nimport ConfirmationModal from \"../ConfirmationModal\"\r\nimport AddIndividualModal from \"./AddIndividualModal\"\r\nimport FormatSSN from \"../../formatters/FormatSSN\"\r\nimport FormatDate from \"../../formatters/FormatDate\"\r\nimport FormatTimestampFileName from \"../../formatters/FormatTimestampFileName\"\r\nimport ActionButton from \"../ActionButton\"\r\nimport Checkbox from \"../Checkbox\"\r\nimport { CustomizableFilterColumn } from \"../ColumnsCustomizeModal/CustomizableColumn\"\r\nimport { AppPageWrapper } from \"../NavMenu/AppPageWrapper\"\r\nimport { connect } from \"react-redux\"\r\nimport { AppState, AssignedClinic } from \"../../AppState\"\r\nimport RandomNav from \"./RandomNav\"\r\nimport { ColumnFilters } from \"../../api/Randoms/RandomPersonnelModel/ColumnFilters\"\r\nimport { StorageKey } from \"../../config/Constants\"\r\nimport { loadCustomized, saveCustomized } from \"../ColumnsCustomizeModal/ColumnsCustomizeModal\"\r\nimport { BuildUserAccess } from \"../../authentication/BuildUserAccess\"\r\nimport { GetSelectedAssignedClinic, GetSelectedPortal } from \"../../authentication/SelectedCompany/CompanySelectionDrivenSelectors\"\r\nimport ImportErrorDetails from \"./ImportErrorDetails\"\r\nimport { ImportJobValidationResult } from \"../../api/Randoms/Import/ImportJobValidationResultGet\"\r\nimport ImportJobCreateAndPerform from \"../../api/Randoms/Import/ImportJobCreateAndPerform\"\r\nimport ImportErrorDetailsModal from \"./ImportErrorDetailsModal\"\r\nimport ConsortiumMembershipModal from \"./ConsortiumMembershipModal\"\r\nimport { isPortalAdmin } from \"../../authentication/isAdminRole\"\r\nimport { csvHeader } from \"../../api/Randoms/ImportPersonnelTemplate\"\r\nimport GetDonorID, { GetDonorIDTitle } from \"../../formatters/RenderDonorID\"\r\n\r\ntype Column = CustomizableFilterColumn<keyof RandomPersonnelGridRecord, keyof ColumnFilters>\r\n\r\ninterface RandomPersonnelGridProps {\r\n  canEditPersonnel?: boolean\r\n  canManagePools?: boolean\r\n  canManagePersonnel?: boolean\r\n  canManageConsortiumPools?: boolean\r\n  isLocation?: boolean\r\n  isPortalAdmin?: boolean\r\n  isConsortium?: boolean\r\n  currentCompany?: AssignedClinic\r\n  unmaskDonorId?: number\r\n}\r\n\r\ninterface RandomPersonnelGridStateSelectedPersons {\r\n  selectedPrintRowIDs: RandomPersonnelIdentifier[]\r\n  selectedRemoveRowIDs: RandomPersonnelIdentifier[]\r\n  selectedChangeStatusRowIDs: RandomPersonnelIdentifier[]\r\n}\r\n\r\ninterface RandomPersonnelGridState extends RandomPersonnelGridStateSelectedPersons {\r\n  fileInputKey: string\r\n  loading: boolean\r\n  loadingCsv: boolean\r\n  importing: boolean\r\n  removing: boolean\r\n  data?: RandomPersonnelGridResponse\r\n  columns: Column[]\r\n  customizeModal: boolean\r\n  advancedFiltersModal: boolean\r\n  removeConfirmModal: boolean\r\n  forceRemoveConfirmModal: boolean\r\n  removePersonMessage: string\r\n  addIndividualModal: boolean\r\n  showConsortiumsModal: boolean\r\n  searchFields?: SearchField[]\r\n  selectedCompanies: AutoFilterCompany[]\r\n  selectedRegions: AutoFilterRegion[]\r\n  selectedLocations: AutoFilterLocation[]\r\n  selectedRegulatoryModes: RegulatoryMode[]\r\n  selectedCategories: EmployeeCategory[]\r\n  employeeDetails: boolean\r\n  details?: RandomPersonnelGridRecord\r\n  importJobID: number\r\n  jobResult: boolean\r\n}\r\n\r\nconst PageSize = 20\r\nconst CSV_FILE_NOT_CORRECT_FORMAT_CODE = \"-112\"\r\nconst SEARCH_FIELD_NAME_SSN = \"SSN\"\r\n\r\nclass RandomPersonnelGrid extends React.PureComponent<RandomPersonnelGridProps, RandomPersonnelGridState> {\r\n  defaultColumns: Column[] = [\r\n    { name: \"ID\", filter: \"IDNumber\", label: \"ID NUMBER\", visible: true, customize: false },\r\n    { name: \"Name\", filter: \"Name\", label: \"NAME\", visible: true, customize: true },\r\n    { name: \"Company\", filter: \"Company\", label: \"COMPANY\", visible: true, customize: true },\r\n    { name: \"Region\", filter: \"Region\", label: \"REGION\", visible: this.props.isConsortium ? false : true, customize: this.props.isConsortium ? false : true },\r\n    { name: \"Location\", filter: \"Location\", label: \"LOCATION\", visible: true, customize: true },\r\n    { name: \"Reg\", filter: \"RegulatoryMode\", label: \"REGULATORY MODE\", visible: true, customize: true },\r\n    { name: \"Category\", filter: \"Category\", label: \"CATEGORY\", visible: true, customize: true },\r\n    { name: \"Inactive\", filter: \"Status\", label: this.props.isConsortium ? \"EMPLOYMENT STATUS\" : \"STATUS\", visible: true, customize: true },\r\n    { name: \"ReasonForInactivation\", label: \"REASON FOR INACTIVATION\", visible: true, customize: true },\r\n    { name: \"Occupation\", filter: \"Occupation\", label: \"OCCUPATION\", visible: true, customize: true },\r\n    { name: \"Supervisor1\", filter: \"Supervisor1\", label: \"SUPERVISOR 1\", visible: false, customize: true },\r\n    { name: \"Supervisor2\", filter: \"Supervisor2\", label: \"SUPERVISOR 2\", visible: false, customize: true },\r\n    { name: \"HireDate\", filter: \"HireDate\", label: \"HIRE DATE\", visible: false, customize: true },\r\n    { name: \"TerminationDate\", filter: \"TerminationDate\", label: \"TERMINATION DATE\", visible: false, customize: true },\r\n    { name: \"PreEmploymentTestOnFile\", filter: \"PreEmploymentTestOnFile\", label: \"PRE-EMPLOYMENT TEST ON FILE\", visible: false, customize: true },\r\n    { name: \"Gender\", filter: \"Gender\", label: \"GENDER\", visible: false, customize: true },\r\n    { name: \"DateOfBirth\", filter: \"DateOfBirth\", label: \"DATE OF BIRTH\", visible: false, customize: true },\r\n    { name: \"AddressLine1\", filter: \"AddressLine1\", label: \"STREET ADDRESS\", visible: false, customize: true },\r\n    { name: \"City\", filter: \"City\", label: \"CITY\", visible: false, customize: true },\r\n    { name: \"State\", filter: \"State\", label: \"STATE\", visible: false, customize: true },\r\n    { name: \"Zip\", filter: \"Zip\", label: \"ZIP\", visible: false, customize: true },\r\n    { name: \"WorkPhone\", filter: \"WorkPhone\", label: \"WORK PHONE\", visible: false, customize: true },\r\n    { name: \"CellPhone\", filter: \"CellPhone\", label: \"MOBILE PHONE\", visible: false, customize: true },\r\n    { name: \"Email\", filter: \"Email\", label: \"EMAIL\", visible: false, customize: true },\r\n    { name: \"User1\", filter: \"User1\", label: \"USER 1\", visible: false, customize: true },\r\n    { name: \"User2\", filter: \"User2\", label: \"USER 2\", visible: false, customize: true },\r\n    { name: \"User3\", filter: \"User3\", label: \"USER 3\", visible: false, customize: true },\r\n    { name: \"User4\", filter: \"User4\", label: \"USER 4\", visible: false, customize: true },\r\n    { name: \"User5\", filter: \"User5\", label: \"USER 5\", visible: false, customize: true },\r\n    { name: \"User6\", filter: \"User6\", label: \"USER 6\", visible: false, customize: true },\r\n    { name: \"User7\", filter: \"User7\", label: \"USER 7\", visible: false, customize: true },\r\n    { name: \"User8\", filter: \"User8\", label: \"USER 8\", visible: false, customize: true },\r\n    { name: \"User9\", filter: \"User9\", label: \"USER 9\", visible: false, customize: true },\r\n    { name: \"User10\", filter: \"User10\", label: \"USER 10\", visible: false, customize: true },\r\n  ]\r\n\r\n  state: RandomPersonnelGridState = {\r\n    fileInputKey: \"file_input_key\",\r\n    loading: false,\r\n    loadingCsv: false,\r\n    importing: false,\r\n    removing: false,\r\n    columns: loadCustomized(StorageKey.RandomPersonnelGridColumns, this.defaultColumns) as Column[],\r\n    customizeModal: false,\r\n    advancedFiltersModal: false,\r\n    removeConfirmModal: false,\r\n    forceRemoveConfirmModal: false,\r\n    removePersonMessage: \"\",\r\n    addIndividualModal: false,\r\n    showConsortiumsModal: false,\r\n    selectedPrintRowIDs: [],\r\n    selectedRemoveRowIDs: [],\r\n    selectedChangeStatusRowIDs: [],\r\n    selectedCompanies: [],\r\n    selectedRegions: [],\r\n    selectedLocations: [],\r\n    selectedRegulatoryModes: [],\r\n    selectedCategories: [],\r\n    employeeDetails: false,\r\n    importJobID: -1,\r\n    jobResult: false\r\n  }\r\n  page$ = new BehaviorSubject<RandomPersonnelGridOptions>({\r\n    search: { field: \"\", text: \"\" },\r\n    sort: { column: \"\", order: \"\" },\r\n    filters: [],\r\n    columnFilters: [],\r\n    pageNumber: 1,\r\n    pageSize: PageSize,\r\n    isConsortium: !!this.props.isConsortium,\r\n    forceReload: false,\r\n  })\r\n  pageSubscription?: Subscription\r\n  searchFieldsSubscription?: Subscription\r\n  removeSubscription?: Subscription\r\n  importSubscription?: Subscription\r\n\r\n  file = React.createRef<HTMLInputElement>()\r\n\r\n  componentDidMount() {\r\n    this.pageSubscription = this.page$.pipe(\r\n      switchMap(params => concat(\r\n        of({ loading: true }),\r\n        RandomPersonnelGridObservable(params).pipe(\r\n          map((result: RandomPersonnelGridResponse) => ({ data: result, loading: false })),\r\n          catchError(() => of({ loading: false }))\r\n        )))\r\n    ).subscribe(\r\n      (newState: { loading: boolean, data?: RandomPersonnelGridResponse }) => {\r\n        if (newState.data) {\r\n          if (newState.data.HireDate?.length) {\r\n            newState.data.HireDate = newState.data.HireDate.map((dateString) => FormatDate(dateString))\r\n          }\r\n          if (newState.data.TerminationDate?.length) {\r\n            newState.data.TerminationDate = newState.data.TerminationDate.map((dateString) =>\r\n              FormatDate(dateString)\r\n            )\r\n          }\r\n          if (newState.data.DateOfBirth?.length) {\r\n            newState.data.DateOfBirth = newState.data.DateOfBirth.map((dateString) => FormatDate(dateString))\r\n          }\r\n          this.setState({ loading: newState.loading, data: newState.data, selectedPrintRowIDs: [], selectedRemoveRowIDs: [], selectedChangeStatusRowIDs: [] })\r\n        } else {\r\n          this.setState({ loading: newState.loading })\r\n        }\r\n      },\r\n      (error: string) => {\r\n        this.setState({ loading: false })\r\n        toast.error(error)\r\n      }\r\n    )\r\n    this.searchFieldsSubscription = RandomPersonnelSearchFieldsObservable().subscribe(\r\n      data => this.setState({ searchFields: data.map(value => { return { Name: value.Name, ID: value.Name } }) }),\r\n      error => toast.error(error)\r\n    )\r\n  }\r\n\r\n  componentWillUnmount() {\r\n    this.pageSubscription && this.pageSubscription.unsubscribe()\r\n    this.searchFieldsSubscription && this.searchFieldsSubscription.unsubscribe()\r\n    this.removeSubscription && this.removeSubscription.unsubscribe()\r\n    this.importSubscription && this.importSubscription.unsubscribe()\r\n  }\r\n\r\n  visibleColumns = () => this.state.columns.filter(col => col.visible)\r\n\r\n  renderCell = (row: RandomPersonnelGridRecord, colName: keyof RandomPersonnelGridRecord, key: number) => {\r\n    switch (colName) {\r\n      case \"ID\":\r\n        return (\r\n          <td key={key} className=\"align-text-top\">\r\n            <Button variant=\"link\" className=\"p-0\" onClick={() => this.showEmployeeDetails(row)}>\r\n              {GetDonorID(row[colName], row[\"MockID\"], this.props.unmaskDonorId ? this.props.unmaskDonorId : 0)}\r\n            </Button>\r\n          </td>\r\n        )\r\n      case \"Inactive\":\r\n        return (\r\n          <td key={key} className=\"align-text-top\">\r\n            {row[colName] ? \"Inactive\" : \"Active\"}\r\n          </td>\r\n        )\r\n      case \"DateActive\":\r\n      case \"HireDate\":\r\n      case \"TerminationDate\":\r\n      case \"DateOfBirth\":\r\n        return (\r\n          <td key={key} className=\"align-text-top\">\r\n            {FormatDate(row[colName])}\r\n          </td>\r\n        )\r\n      case \"PreEmploymentTestOnFile\":\r\n        return (\r\n          <td key={key} className=\"align-text-top\">\r\n            {row[colName] ? \"Yes\" : \"No\"}\r\n          </td>\r\n        )\r\n      default:\r\n        return (\r\n          <td key={key} className=\"align-text-top\">\r\n            {row[colName]}\r\n          </td>\r\n        )\r\n    }\r\n  }\r\n\r\n  sortGrid(column: string, order?: string) {\r\n    this.page$.next({ ...this.page$.value, sort: { column: column, order: order || \"\" }, forceReload: false })\r\n  }\r\n\r\n  filterGridColumn(column: string, items: string[]) {\r\n    const columnFilters = this.page$.value.columnFilters\r\n    const filter = { column: column, values: items }\r\n    let index = columnFilters.findIndex(item => item.column === filter.column)\r\n    if (index >= 0) {\r\n      columnFilters[index] = filter\r\n    } else {\r\n      columnFilters.push(filter)\r\n    }\r\n\r\n    this.page$.next({ ...this.page$.value, pageNumber: 1, columnFilters: columnFilters })\r\n  }\r\n\r\n  handleExportClick(fileName: string) {\r\n    this.setState({ loadingCsv: true })\r\n    RandomPersonnelExportCsv(this.page$.value).subscribe(\r\n      result => this.export(result, fileName),\r\n      error => {\r\n        toast.error(error)\r\n        this.setState({ loadingCsv: false })\r\n      },\r\n      (() => this.setState({ loadingCsv: false }))\r\n    )\r\n  }\r\n\r\n  export(csv: string, fileName: string) {\r\n    const csvData = new Blob([csv], { type: 'text/csv;charset=utf-8;' })\r\n    FileSaver.saveAs(csvData, FormatTimestampFileName(fileName, \"csv\", new Date()), true)\r\n    toast.success(\"CSV file downloaded successfully.\")\r\n  }\r\n\r\n  performImport(base64string: string, fileName: string = \"\") {\r\n    this.setState({ importing: true })\r\n    this.importSubscription && this.importSubscription.unsubscribe()\r\n    this.importSubscription = ImportJobCreateAndPerform(base64string, true, fileName, this.props.currentCompany?.AccountID, 0, false, true).subscribe(\r\n      result => {\r\n        this.setState({ importing: false, importJobID: result.ImportJobID, jobResult: result.Result})\r\n        if (result.Result) {\r\n          this.refreshGrid()\r\n          toast.success(\"File uploaded successfully.\")\r\n        }\r\n      },\r\n      error => {\r\n        this.setState({ importing: false })\r\n        if (error.errorData?.code !== CSV_FILE_NOT_CORRECT_FORMAT_CODE) {\r\n          this.refreshGrid()\r\n        }\r\n        toast.error(error.errorData?.message || error.message)\r\n      }\r\n    )\r\n\r\n  }\r\n\r\n  handleRemoveClick() {\r\n    this.setState({ removeConfirmModal: true })\r\n  }\r\n\r\n  performRemove = (force: boolean = false) => {\r\n    this.setState({ removeConfirmModal: false, removing: true })\r\n    this.removeSubscription && this.removeSubscription.unsubscribe()\r\n    this.removeSubscription = RandomPersonnelRemove(this.state.selectedRemoveRowIDs, force).subscribe(\r\n      data => {\r\n        this.setState({ removing: false, forceRemoveConfirmModal: false, selectedRemoveRowIDs: [] })\r\n        this.refreshGrid(true)\r\n        toast.success(data)\r\n      },\r\n      error => {\r\n        if (error.message == \"Conflict\") {\r\n          this.setState({ removing: false, forceRemoveConfirmModal: true, removePersonMessage: error.errorData?.message })\r\n        } else {\r\n          this.setState({ removing: false, forceRemoveConfirmModal: false })\r\n          toast.error(error.errorData?.message || error.message)\r\n        }\r\n      }\r\n    )\r\n  }\r\n\r\n  handlePrintClick() {\r\n    RandomPersonnelPrint(this.state.selectedPrintRowIDs, this.page$.value).subscribe(\r\n      data => !!data ? this.print(data) : toast.error(\"Data not found.\"),\r\n      error => toast.error(error)\r\n    )\r\n  }\r\n\r\n  print(base64pdf: string) {\r\n    const pdfWindow = window.open(\"\")\r\n    if (pdfWindow) {\r\n      pdfWindow.document.write(\"<iframe width='100%' height='100%' src='data:application/pdf;base64, \" + encodeURI(base64pdf) + \"'></iframe>\")\r\n    }\r\n  }\r\n\r\n  handlePrintSelectAllRowsChange = (e: React.ChangeEvent<HTMLInputElement>) => {\r\n    const selectedPrintRowIDs = e.target.checked && this.state.data && this.state.data.Records ? this.state.data.Records.map((row: RandomPersonnelGridRecord, i: number) => ({ PersonID: row.PersonID, ID: row.ID })) : []\r\n    this.setState({ selectedPrintRowIDs: selectedPrintRowIDs })\r\n  }\r\n\r\n  changePersonRowSelection = (person: RandomPersonnelIdentifier, checked: boolean, stateFieldName: keyof RandomPersonnelGridStateSelectedPersons) => {\r\n    let selectedRows = [...this.state[stateFieldName]]\r\n\r\n    const index = selectedRows.findIndex(item => item.PersonID === person.PersonID && item.ID === person.ID)\r\n    if (index > -1) {\r\n      selectedRows = [...selectedRows.slice(0, index), ...selectedRows.slice(index + 1)]\r\n    } else {\r\n      selectedRows.push(person)\r\n    }\r\n    this.setState({ ...{}, [stateFieldName]: selectedRows })\r\n  }\r\n\r\n  handlePrintSelectRowChange = (person: RandomPersonnelIdentifier, checked: boolean) => {\r\n    this.changePersonRowSelection(person, checked, \"selectedPrintRowIDs\")\r\n  }\r\n\r\n  handleRemoveSelectRowChange = (person: RandomPersonnelIdentifier, checked: boolean) => {\r\n    this.changePersonRowSelection(person, checked, \"selectedRemoveRowIDs\")\r\n  }\r\n\r\n  handleActivateInactivateClick = (data: RandomPersonnelGridRecord) => this.setState({showConsortiumsModal: true, details: data})\r\n\r\n  handleChangePage(pageNumber: number) {\r\n    this.page$.next({ ...this.page$.value, pageNumber: pageNumber })\r\n  }\r\n\r\n  handleSearch = (field: string, text: string) => {\r\n    if (field === SEARCH_FIELD_NAME_SSN) {\r\n      text = text.replace(/\\D/g, \"\")\r\n    }\r\n    this.page$.next({ ...this.page$.value, search: { field: field, text: text } })\r\n  }\r\n\r\n  handleAdvancedFiltersSave = (companies: AutoFilterCompany[], regions: AutoFilterRegion[], locations: AutoFilterLocation[], regulatoryModes: RegulatoryMode[], categories: EmployeeCategory[], closeModal: boolean) => {\r\n    this.setState({\r\n      selectedCompanies: companies,\r\n      selectedRegions: regions,\r\n      selectedLocations: locations,\r\n      selectedRegulatoryModes: regulatoryModes,\r\n      selectedCategories: categories,\r\n      advancedFiltersModal: !closeModal\r\n    })\r\n    const filters = [\r\n      { column: \"Company\", values: companies.map((item) => item.Name) },\r\n      { column: \"Region\", values: regions.map((item) => item.Name) },\r\n      { column: \"Location\", values: locations.map((item) => item.Name) },\r\n      { column: \"RegulatoryMode\", values: regulatoryModes.map((item) => item.Name) },\r\n      { column: \"Category\", values: categories.map((item) => item.Name) },\r\n    ]\r\n    this.page$.next({ ...this.page$.value, filters: filters })\r\n  }\r\n\r\n  handleAddIndividualSave = () => {\r\n    this.setState({ addIndividualModal: false })\r\n    this.refreshGrid()\r\n  }\r\n\r\n  handleHandleFileUpload = (e: React.ChangeEvent<HTMLInputElement>) => {\r\n    const file = e.target && e.target.files && e.target.files[0]\r\n    if (file) {\r\n      const ext = file.name.substring(file.name.lastIndexOf('.') + 1)\r\n      if (ext && ext.toLowerCase() === \"csv\") {\r\n        var reader = new FileReader()\r\n        const self = this\r\n        reader.onload = function (e) {\r\n          const result = e.target?.result as string || \"\"\r\n          const stringLength = result.indexOf('base64') + 7\r\n          self.performImport(result.slice(stringLength, result.length), file.name)\r\n        }\r\n        reader.onerror = function (error) { toast.error(error) }\r\n        reader.readAsDataURL(file)\r\n      } else {\r\n        toast.error(\"File type not allowed, Please upload CSV file.\")\r\n      }\r\n    }\r\n    this.setState({ fileInputKey: Math.random().toString() })\r\n  }\r\n\r\n  downloadTemplate = () => {\r\n    // const header = this.props.isPortalAdmin ? csvHeader : csvHeader.filter((item) => item.toUpperCase() !== \"MANAGER\")\r\n    const csvData = new Blob([csvHeader.join(\",\") + \"\\r\\n\"], { type: 'text/csv;charset=utf-8;' })\r\n    FileSaver.saveAs(csvData, \"import-list-template.csv\")\r\n  }\r\n\r\n  formatSearchString = (ID: string, value: string): string => {\r\n    return ID === SEARCH_FIELD_NAME_SSN ? FormatSSN(value) : value\r\n  }\r\n\r\n  showEmployeeDetails = (data: RandomPersonnelGridRecord) => this.setState({ employeeDetails: true, details: data })\r\n\r\n  refreshGrid = (forceReload: boolean = false ) => this.page$.next({ ...this.page$.value, forceReload: forceReload })\r\n\r\n  render() {\r\n    const isConsortium = !!this.props.isConsortium\r\n    const headerColumns = this.visibleColumns().map((col: Column, i) => {\r\n      const sort = this.page$.value.sort\r\n      const filterValues = this.page$.value.filters.find(filter => filter.column === col.name)?.values || []\r\n      // Removed Advanced Filters button due to decision made 05/28/2021 on SCRUM.\r\n      //\r\n      const message = filterValues.length > 0 ?\r\n         (<>\r\n           <div>Some options in this list may be hidden</div>\r\n           <div>because of the advanced filter configuration.</div>\r\n           <div>Click <span className=\"text-link\" onClick={() => this.setState({ advancedFiltersModal: true })}>filters</span> or ADVANCED FILTERS button to configure</div>\r\n         </>) :\r\n         <></>\r\n      const columnFilterValues = this.page$.value.columnFilters.find(filter => filter.column === col.filter)?.values || []\r\n      return (\r\n        <th key={col.name}>\r\n          {this.state.data && col.filter && col.filter in this.state.data && <ColumnHeaderFilter title={col.label || col.name}\r\n            filtered={columnFilterValues.length > 0}\r\n            filteredItems={columnFilterValues}\r\n            sort={sort && sort.column === col.name ? sort.order === \"asc\" ? \"asc\" : \"desc\" : undefined}\r\n            items={this.state.data[col.filter as keyof ColumnFilters] || []}\r\n            // message={message}\r\n            onSort={(order?: string) => this.sortGrid(col.name, order)}\r\n            onFilter={(items: string[]) => col.filter && this.filterGridColumn(col.filter, items)}\r\n          />}\r\n          {(!this.state.data || !col.filter) && (col.label || col.name)}\r\n        </th>\r\n      )\r\n    })\r\n    const allPrintChecked = !this.state.loading && !!this.state.data?.Records?.length && this.state.data?.Records?.length === this.state.selectedPrintRowIDs.length\r\n    return (<AppPageWrapper parentClassName=\"align-items-center\" showNav>\r\n      <RandomNav canManagePools={this.props.canManagePools && !this.props.isLocation} canManagePersonnel={this.props.canManagePersonnel} canManageConsortiumPools={this.props.canManageConsortiumPools} isConsortium={!!this.props.isConsortium} />\r\n      { this.state.employeeDetails && this.state.details && <EmployeeDetailsModal\r\n        personID={this.state.details.PersonID}\r\n        name={this.state.details.Name}\r\n        id={this.state.details.SSN}\r\n        onHide={(updated) => this.setState({ employeeDetails: false }, () => updated && this.refreshGrid())} />}\r\n      <ColumnsCustomizeModal show={this.state.customizeModal}\r\n        columns={this.state.columns}\r\n        storeKey={StorageKey.RandomPersonnelGridColumns}\r\n        onClose={() => this.setState({ customizeModal: false })}\r\n        onSave={(columns) => this.setState({ columns: columns as Column[], customizeModal: false })} />\r\n      {/*\r\n        Removed Advanced Filters button due to decision made 05/28/2021 on SCRUM.\r\n        \"d) Pass Column filters values via \"Filters\" parameter,\r\n        remove Advanced Filters button from the Personnel grid and address this issue later in future releases.\r\n        Change CSV Export and Print to work without filters (pass empty filters to requests)\"\r\n      */\r\n      <AdvancedFiltersModal show={this.state.advancedFiltersModal}\r\n        selectedCompanies={this.state.selectedCompanies}\r\n        selectedRegions={this.state.selectedRegions}\r\n        selectedLocations={this.state.selectedLocations}\r\n        selectedRegulatoryModes={this.state.selectedRegulatoryModes}\r\n        selectedCategories={this.state.selectedCategories}\r\n        accountType=\"\"\r\n        onClose={() => this.setState({ advancedFiltersModal: false })}\r\n        onSave={this.handleAdvancedFiltersSave} /> }\r\n      {<AddIndividualModal show={this.state.addIndividualModal}\r\n        onCancel={() => this.setState({ addIndividualModal: false })}\r\n        onAdd={this.handleAddIndividualSave} />}\r\n      <ConfirmationModal show={this.state.removeConfirmModal}\r\n        title=\"CONFIRM REMOVE\"\r\n        textTitle=\"Are you sure you want to remove selected record?\"\r\n        text=\"All the selected records will be removed permanently.\"\r\n        onConfirm={() => this.performRemove()}\r\n        onHide={() => this.setState({ removeConfirmModal: false })} />\r\n      <ConfirmationModal show={this.state.forceRemoveConfirmModal}\r\n        title=\"CONFIRM REMOVE\"\r\n        textTitle=\"Please confirm force remove selected personnel\"\r\n        text={this.state.removePersonMessage}\r\n        onConfirm={() => this.performRemove(true)}\r\n        onHide={() => this.setState({ forceRemoveConfirmModal: false })} />\r\n      {this.state.showConsortiumsModal && this.state.details && <ConsortiumMembershipModal PersonID={this.state.details.PersonID} onClose={() => this.setState({showConsortiumsModal: false, details: undefined})}/>}\r\n      <Container fluid className=\"grid-container\">\r\n        <Row className=\"pb-2\">\r\n          <Col>\r\n            <SearchBar onSearch={this.handleSearch} searchFields={this.state.searchFields || []} formatValue={this.formatSearchString} placeholder=\"All Personnel IDs\" />\r\n          </Col>\r\n          <Col lg={7} className=\"text-right\">\r\n            <Button variant=\"secondary\" size=\"sm\" className=\"mr-1\" onClick={() => this.setState({ customizeModal: true })}>CUSTOMIZE</Button>\r\n            {this.props.canEditPersonnel && !isConsortium && !this.props.isPortalAdmin && <Button variant=\"secondary\" size=\"sm\" className=\"mr-1\" onClick={() => this.setState({ addIndividualModal: true })}>ADD INDIVIDUAL</Button>}\r\n            {/*\r\n              Removed Advanced Filters button due to decision made 05/28/2021 on SCRUM.\r\n              \"d) Pass Column filters values via \"Filters\" parameter,\r\n              remove Advanced Filters button from the Personnel grid and address this issue later in future releases.\r\n              Change CSV Export and Print to work without filters (pass empty filters to requests)\"\r\n            */\r\n              <Button variant=\"secondary\" size=\"sm\" className=\"mr-1\" onClick={() => this.setState({ advancedFiltersModal: true })}>ADVANCED FILTERS</Button>\r\n            }\r\n            {this.props.canEditPersonnel && !this.props.isLocation && <Button variant=\"secondary\" size=\"sm\" className=\"mr-1\" onClick={() => this.downloadTemplate()}>DOWNLOAD TEMPLATE</Button>}\r\n            {this.props.canEditPersonnel && !isConsortium && !this.props.isLocation && !this.props.isPortalAdmin && <ActionButton variant=\"secondary\" size=\"sm\" className=\"mr-1\" onClick={() => { this.file?.current?.click() }} spin={this.state.importing} disableOnSpin>IMPORT LIST</ActionButton>}\r\n            <input type=\"file\" key={this.state.fileInputKey} ref={this.file} accept=\".csv\" onChange={this.handleHandleFileUpload} style={{ display: 'none' }} />\r\n            {!isConsortium && <ActionButton variant=\"secondary\" size=\"sm\" onClick={() => this.handleExportClick(\"Personnel\")} disabled={!this.state.data?.Records?.length} spin={this.state.loadingCsv} disableOnSpin>EXPORT CSV</ActionButton>}\r\n          </Col>\r\n        </Row>\r\n        <Row>\r\n          <Col>\r\n            <Table bordered responsive>\r\n              <thead>\r\n                <tr>\r\n                  {!isConsortium && <th className=\"text-center print-column\">\r\n                    <Checkbox id=\"print_all_personnel\" checked={allPrintChecked} onChange={this.handlePrintSelectAllRowsChange} />\r\n                    <Button variant=\"secondary\" size=\"sm\" onClick={() => this.handlePrintClick()} className=\"float-right\" disabled={this.state.selectedPrintRowIDs.length === 0}><FaPrint /></Button>\r\n                  </th>}\r\n                  {headerColumns}\r\n                  {this.props.canEditPersonnel && !isConsortium && <th className=\"text-center small-column\">\r\n                    <Button variant=\"secondary\" size=\"sm\" onClick={() => this.handleRemoveClick()} disabled={this.state.selectedRemoveRowIDs.length === 0}>Remove</Button>\r\n                  </th>}\r\n                  {isConsortium && <th className=\"text-center small-column\">Consortiums Member</th>}\r\n                </tr>\r\n              </thead>\r\n              <tbody>\r\n                {this.state.loading && <tr><td colSpan={this.visibleColumns().length + (this.props.canEditPersonnel ? 2 : 1)}><Spinner animation=\"border\" variant=\"secondary\" /></td></tr>}\r\n                {!this.state.loading && (this.state.data && this.state.data.Records && this.state.data.Records.length > 0\r\n                  ? this.state.data.Records.map((row: RandomPersonnelGridRecord, i: number) => {\r\n                    const person = { PersonID: row.PersonID, ID: row.ID }\r\n                    return (\r\n                      <tr key={`${person.PersonID}_${person.ID}_1_${i}`}>\r\n                        {!isConsortium && <td className=\"text-center\">\r\n                          <RandomPersonnelCheckbox\r\n                            id={`${person.PersonID}_${person.ID}_check1_${i}`}\r\n                            person={person}\r\n                            checked={!!this.state.selectedPrintRowIDs.find(item => person.PersonID === item.PersonID && person.ID === item.ID)}\r\n                            onChange={this.handlePrintSelectRowChange} />\r\n                        </td>}\r\n                        {this.visibleColumns().map((col, i) => this.renderCell(row, col.name as keyof RandomPersonnelGridRecord, i))}\r\n                        { this.props.canEditPersonnel && !isConsortium && <td className=\"text-center\">\r\n                          <RandomPersonnelCheckbox\r\n                            id={`${person.PersonID}_${person.ID}_check2_${i}`}\r\n                            person={person}\r\n                            checked={!!this.state.selectedRemoveRowIDs.find(item => person.PersonID === item.PersonID && person.ID === item.ID)}\r\n                            onChange={this.handleRemoveSelectRowChange} />\r\n                        </td>}\r\n                        {isConsortium && <td className=\"text-center\">\r\n                          <Button variant=\"secondary\" size=\"sm\" onClick={() => this.handleActivateInactivateClick(row)}>Activate/Inactivate</Button>\r\n                        </td>}\r\n                      </tr>)\r\n                  })\r\n                  : <tr><td colSpan={this.visibleColumns().length + (this.props.canEditPersonnel || isConsortium ? 2 : 1)}>NO DATA FOUND</td></tr>\r\n                )}\r\n              </tbody>\r\n            </Table>\r\n            {this.state.data && !this.state.loading && <span className=\"total-records\">Total records: {this.state.data.Total}</span>}\r\n            {this.state.data && <TablePagination pageNumber={this.page$.value.pageNumber} pages={this.state.data.Pages} onChange={pageNumber => this.handleChangePage(pageNumber)} />}\r\n          </Col>\r\n        </Row>\r\n      </Container>\r\n      {!this.state.importing &&\r\n        <ImportErrorDetailsModal\r\n          show={this.state.importJobID > 0 && !this.state.jobResult}\r\n          importJobID={this.state.importJobID}\r\n          onClose={() => this.setState({ importJobID: -1 })} />}\r\n    </AppPageWrapper>)\r\n  }\r\n}\r\nfunction mapStateToProps(state: AppState): RandomPersonnelGridProps {\r\n  const selectedCompany =  GetSelectedAssignedClinic(state)\r\n  const userAccess = BuildUserAccess(state)\r\n  const portal = GetSelectedPortal(state)\r\n  const unmaskDonorId = portal ? portal.UnmaskDonorID : 0\r\n\r\n  return {\r\n    canEditPersonnel: userAccess.canEditPersonnel,\r\n    canManagePools: userAccess.canManagePools,\r\n    canManagePersonnel: userAccess.canManagePersonnel,\r\n    canManageConsortiumPools: userAccess.CanManageConsortiumPools,\r\n    isLocation: (GetSelectedAssignedClinic(state)?.LocationID || 0) > 0,\r\n    currentCompany: selectedCompany || undefined,\r\n    isPortalAdmin: isPortalAdmin(state),\r\n    unmaskDonorId: unmaskDonorId\r\n  }\r\n}\r\nconst ConnectedRandomPersonnelGrid = connect(mapStateToProps, null)(RandomPersonnelGrid)\r\nexport default ConnectedRandomPersonnelGrid\r\n","import { Observable } from \"rxjs\"\r\nimport { ObservableFromFetch } from \"../ObservableFromFetch\"\r\nimport SearchField from \"../SearchField\"\r\n\r\nexport default function RandomPersonnelSearchFieldsObservable(): Observable<SearchField[]> {\r\n  return ObservableFromFetch<SearchField[]>(\"RandomTest/GetSearchDropdowns\")\r\n}\r\n","export default \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAH8AAAB/CAYAAADGvR0TAAAVjUlEQVR4Ae1dC3gVxRU+gcSEvC8kIeRhIggkWkRbfCIftohia7VVi2iVSrFoVWrFllatVKxisfiqfq1NsSK2QvFRRZHSaitFEDEWwRYDAUlqeCaQB3kSHv3+wbnMnbuP2b27925udr5vc3fncebM+c/MnDkzm004evToUfJDr5RAn17Zar/RTAI++L1YEXzwffB7sQR6cdP9nt+LwU9UafuW7Z/Rhx9vVskaN3nGjzmLcgKZcdMerYYogb+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3AF//0jCMGIOyHZSveonn3z7Rk4Mms++DLEnHpGQpw/pkjIjYAMc8vWrSYbp3yLbr26isj4tYHPyLxWS8MA/DiC85lBiCAtBK4gTe0tIgZePBTRBJ88CORnsWy3ADE/I8DmNgCthJg4FXX1Cl78Mxo2wIfGudf9mQABRiQnUEVT/6SWg60MQ+gGUhIh6No5dqPLHnwzOgqr/PbOg/SwxWLzej56SYSOKN8MI0edRqlJCfT7Nk/o5tv+xHhX7B/5eJLdEvCwIOjSD6Dp1tAMUEJ/LycbDr/jDJFkn42FQngQwnjx5zFAJ3zWAXlFxRongHkBt6Uay6n224O/e+mKvUY5Uk4yicio1x+mqsSuGHa7bTmgw100623hmwBM+AXLmAvWbzy5wXMX+AkIz74TkrTJq2Gxha64uob2HbszT+YEaQChxA2hmqrVkX0LZ0gQenGlsEn0fAfI5QAPIDYg4cBiEOXaSccZQYetmhX/KXCFeDBst/zIwTOyeJ/e3slfWvK7TT2nNOpqrqGpk+7zvJOnRV+/J5vRVou58UWMCx6LOmuumy84waezL6StS8X8p/dkwA8gLt276EZP5zu2suunPv/A/cGn3zuTb9KAAAAAElFTkSuQmCC\"","import { AccountTypeID } from \"../../config/Constants\"\r\nimport { Filter, Sort } from \"../GridRequest\"\r\nimport { ObservableFromFetch } from \"../ObservableFromFetch\"\r\nimport { SelectionInboxGridResponse } from \"./SelectionInboxModel/SelectionInboxGridResponse\"\r\n\r\nfunction columnFilters(filters: Filter[]) {\r\n  return {\r\n      AuthorizationID: filters.find(filter => filter.column === \"AuthorizationID\")?.values || [],\r\n      Company: filters.find(filter => filter.column === \"Company\")?.values || [],\r\n      Location: filters.find(filter => filter.column === \"Location\")?.values || [],\r\n      EventDate: filters.find(filter => filter.column === \"EventDate\")?.values || [],\r\n      IDNumber: filters.find(filter => filter.column === \"IDNumber\")?.values || [],\r\n      Name: filters.find(filter => filter.column === \"Name\")?.values || [],\r\n      NotificationDate: filters.find(filter => filter.column === \"NotificationDate\")?.values || [],\r\n      Pool: filters.find(filter => filter.column === \"Pool\")?.values || [],\r\n      Regulated: filters.find(filter => filter.column === \"Regulated\")?.values || [],\r\n      Selection: filters.find(filter => filter.column === \"Selection\")?.values || [],\r\n      Service: filters.find(filter => filter.column === \"Service\")?.values || [],\r\n      Site: filters.find(filter => filter.column === \"Site\")?.values || [],\r\n      Status: filters.find(filter => filter.column === \"Status\")?.values || [],\r\n      Occupation: filters.find(filter => filter.column === \"Occupation\")?.values || [],\r\n      RegulatoryMode: filters.find(filter => filter.column === \"RegulatoryMode\")?.values || [],\r\n      LastName: filters.find(filter => filter.column === \"LastName\")?.values || [],\r\n      MiddleInitial: filters.find(filter => filter.column === \"MiddleInitial\")?.values || [],\r\n      FirstName: filters.find(filter => filter.column === \"FirstName\")?.values || [],\r\n      Gender: filters.find(filter => filter.column === \"Gender\")?.values || [],\r\n      DateOfBirth: filters.find(filter => filter.column === \"DateOfBirth\")?.values || [],\r\n      PrimaryIDType: filters.find(filter => filter.column === \"PrimaryIDType\")?.values || [],\r\n      SSN: filters.find(filter => filter.column === \"SSN\")?.values || [],\r\n      DriverID: filters.find(filter => filter.column === \"DriverID\")?.values || [],\r\n      EmployerID: filters.find(filter => filter.column === \"EmployerID\")?.values || [],\r\n      AlternateID: filters.find(filter => filter.column === \"AlternateID\")?.values || [],\r\n      CRMUniqueID: filters.find(filter => filter.column === \"CRMUniqueID\")?.values || [],\r\n      HireDate: filters.find(filter => filter.column === \"HireDate\")?.values || [],\r\n      TerminationDate: filters.find(filter => filter.column === \"TerminationDate\")?.values || [],\r\n      CellPhone: filters.find(filter => filter.column === \"CellPhone\")?.values || [],\r\n      HomePhone: filters.find(filter => filter.column === \"HomePhone\")?.values || [],\r\n      WorkPhone: filters.find(filter => filter.column === \"WorkPhone\")?.values || [],\r\n      Inactive: filters.find(filter => filter.column === \"Inactive\")?.values || [],\r\n      RetireDate: filters.find(filter => filter.column === \"StRetireDateatus\")?.values || [],\r\n      Supervisor1: filters.find(filter => filter.column === \"Supervisor1\")?.values || [],\r\n      Supervisor2: filters.find(filter => filter.column === \"Supervisor2\")?.values || [],\r\n      Address: filters.find(filter => filter.column === \"Address\")?.values || [],\r\n      Province: filters.find(filter => filter.column === \"Province\")?.values || [],\r\n      Zip: filters.find(filter => filter.column === \"Zip\")?.values || [],\r\n      Country: filters.find(filter => filter.column === \"Country\")?.values || [],\r\n      StateCode: filters.find(filter => filter.column === \"StateCode\")?.values || [],\r\n      StateName: filters.find(filter => filter.column === \"StateName\")?.values || [],\r\n      Manager: filters.find(filter => filter.column === \"Manager\")?.values || [],\r\n  }\r\n}\r\n\r\nfunction gridParams(pageNumber: number, pageSize: number, sort: Sort, filters: Filter[], search: { field: string, text: string }): string {\r\n  return JSON.stringify({\r\n      AccountTypeID: AccountTypeID,\r\n      ColumnFilters: columnFilters(filters),\r\n      DateFrom: \"1/01/0001 00:00:00\",\r\n      DateTo: \"1/01/0001 00:00:00\",\r\n      Exact: false,\r\n      Filters: {\r\n          Company: [],\r\n          DateRange: \"\",\r\n          DateType: \"\",\r\n          EndDate: \"\",\r\n          Location: [],\r\n          Reason: [],\r\n          Region: [],\r\n          Regulated: \"Regulated & Non-Regulated\",\r\n          Service: [],\r\n          StartDate: \"\",\r\n          Status: \"In Process\"\r\n      },\r\n      IsSearch: true, // TODO: verify\r\n      IsMarketPlace: true,\r\n      Mask: search.text || \"\",\r\n      PageNumber: pageNumber,\r\n      PageSize: pageSize || 20,\r\n      Pending: true,\r\n      RoleID: 0,    // TODO: verify\r\n      TrackPersonID: [{Mask: \"\", TestDetailID: \"\", MockTestDetailID: 0}],  // TODO: verify\r\n      SearchBy: search.field || \"\",\r\n      SortGrid: { SortColumn: sort?.column || \"\", SortOrder: sort?.order.toUpperCase() === \"DESC\" ? \"DSC\" : sort?.order.toUpperCase() },\r\n      Type: \"All\"\r\n  })\r\n}\r\nexport const SelectionInboxGridObservable = (pageNumber: number, pageSize: number, sort: Sort, filters: Filter[], search: { field: string, text: string }) => ObservableFromFetch<SelectionInboxGridResponse>(\"RandomTest/GetRandomResult\", gridParams(pageNumber, pageSize, sort, filters, search))\r\nexport const SelectionInboxGridCsv = (pageNumber: number, pageSize: number, sort: Sort, filters: Filter[], search: { field: string, text: string }) => ObservableFromFetch<string>(\"RandomTest/ExportRandomTrackRecord\", gridParams(pageNumber, pageSize, sort, filters, search))\r\n","import { Observable } from \"rxjs\"\r\nimport { ObservableFromFetch } from \"../ObservableFromFetch\"\r\n\r\nexport default function EventExcuseObservable(testEventID: number, testDetailID: string, generateReplacement: boolean, comment: string, excuseReasonCode:string, excuseComment:string): Observable<string> {\r\n  const params: string = JSON.stringify({\r\n      TestDetailID: testDetailID,\r\n      TestEventID: testEventID,\r\n      GenerateReplacement:generateReplacement,\r\n      SchedulingNotes: comment,\r\n      ExcuseReasonCode:excuseReasonCode,\r\n      ExcuseComment:excuseComment\r\n  })\r\n\r\n  return ObservableFromFetch<string>(\"FFOrderPoolDefinition/ExcuseAnEvent\", params)\r\n}\r\n\r\nexport function CanSubstituteOnExcuseObservable( testDetailID: string) {\r\n  const requestBody: string = new URLSearchParams({\r\n    TestDetailID: testDetailID\r\n  }).toString()\r\n\r\n  return ObservableFromFetch<boolean>(\"FFOrderPoolDefinition/CanSubstituteOnExcuse?\" + requestBody)\r\n}\r\n\r\nexport function GetExcuseNotesObservable( testDetailID: string) {\r\n  const params: string = JSON.stringify({\r\n    TestDetailID: testDetailID\r\n  })\r\n\r\n  return ObservableFromFetch<string>(\"FFOrderPoolDefinition/GetSchedulingNote\", params)\r\n}\r\n\r\nexport function UpdateExcuseNotesObservable( testDetailID: string, comment: string) {\r\n  const params: string = JSON.stringify({\r\n    TestDetailID: testDetailID,\r\n    SchedulingNotes: comment\r\n  })\r\n\r\n  return ObservableFromFetch<string>(\"FFOrderPoolDefinition/UpdateSchedulingNote\", params)\r\n}\r\n\r\nexport function EventUnexcuseObservable(testEventID: number, testDetailID: string) {\r\n  const params: string = JSON.stringify({\r\n    TestDetailID: testDetailID,\r\n    TestEventID: testEventID\r\n  })\r\n\r\n  return ObservableFromFetch<string>(\"FFOrderPoolDefinition/UnexcuseAnEvent\", params)\r\n}\r\n\r\n\r\n","import * as React from \"react\"\r\nimport { Container, Modal, Row, Col, Button, Form } from \"react-bootstrap\"\r\nimport { toast } from \"react-toastify\"\r\nimport { Subscription } from \"rxjs\"\r\nimport { APIError } from \"../../api/ObservableFromFetch\"\r\nimport EventExcuseObservable, { CanSubstituteOnExcuseObservable } from \"../../api/Randoms/EventExcuse\"\r\nimport SelectionInboxGridRow from \"../../api/Randoms/SelectionInboxModel/SelectionInboxGridRow\"\r\nimport ConfirmationModal from \"../ConfirmationModal\"\r\nimport ActionButton from \"../ActionButton\"\r\nimport { IsOnTrack } from \"../../App\"\r\n\r\nimport ExcuseReason, { AlternateExcuseReasons, IsAltOtherExcuseReason } from \"../../api/Randoms/RandomsModel/ExcuseReason\"\r\n\r\ninterface ExcuseEventModalProps {\r\n  show: boolean\r\n  excuseDetails?: SelectionInboxGridRow\r\n  onClose: (success: boolean) => void\r\n}\r\n\r\ninterface ExcuseEventModalState {\r\n  comment: string\r\n  canExcuse: boolean\r\n  saving: boolean\r\n  loading: boolean\r\n  excuseMode: number\r\n  excuseReasonCode: string\r\n  excuseComment: string\r\n}\r\nconst ExcuseOnly: number = 1\r\nconst ExcuseAndAltrnate: number = 2\r\n\r\nexport default class ExcuseEventModal extends React.PureComponent<ExcuseEventModalProps, {}> {\r\n  state: ExcuseEventModalState = {\r\n    comment: \"\",\r\n    canExcuse: false,\r\n    saving: false,\r\n    loading: false,\r\n    excuseMode: 0,\r\n    excuseReasonCode: \"\",\r\n    excuseComment: \"\"\r\n  }\r\n  excuseSubscription?: Subscription\r\n  canExcuseSubscription?: Subscription\r\n\r\n  componentDidMount() {\r\n    const isOnTrack = IsOnTrack()\r\n    if (isOnTrack) {\r\n      return;\r\n    }\r\n    this.setState({ canExcuse: false, loading: true })\r\n    this.canExcuseSubscription && this.canExcuseSubscription.unsubscribe()\r\n    this.canExcuseSubscription = CanSubstituteOnExcuseObservable(this.props.excuseDetails!.TestDetailID).subscribe(\r\n      (result: boolean) => {\r\n        this.setState({\r\n          canExcuse: result,\r\n          loading: false\r\n        })\r\n      },\r\n\r\n      error => this.handleAPIError(error, { canExcuse: false, loading: false })\r\n    )\r\n\r\n  }\r\n\r\n  componentWillUnmount() {\r\n    this.excuseSubscription && this.excuseSubscription.unsubscribe()\r\n    this.canExcuseSubscription && this.canExcuseSubscription.unsubscribe()\r\n  }\r\n\r\n  excuse = (generateReplacement: boolean) => {\r\n    this.setState({ saving: true })\r\n    const excuseReasonCode: string = this.state.excuseReasonCode || \"\"\r\n    const excuseComment: string = this.state.excuseComment || \"\"\r\n    this.excuseSubscription && this.excuseSubscription.unsubscribe()\r\n    this.excuseSubscription = EventExcuseObservable(this.props.excuseDetails!.TestEventID, this.props.excuseDetails!.TestDetailID, generateReplacement, this.state.comment.trim(), excuseReasonCode, excuseComment).subscribe(\r\n      result => {\r\n        toast.success(result)\r\n        this.props.onClose(true)\r\n      },\r\n      error => this.handleAPIError(error, { saving: false })\r\n    )\r\n  }\r\n  handleAPIError = (error: Error | APIError, stateChanges: object) => {\r\n    this.setState(stateChanges)\r\n    error && toast.error((error as APIError)?.errorData?.message || error.message)\r\n  }\r\n  toggleAlternateExcuseOption = (excuseMode: number) => {\r\n    this.setState({ excuseMode: excuseMode })\r\n  }\r\n  onAltReasonChange = (value: string) => {\r\n    this.setState({ excuseReasonCode: value })\r\n  }\r\n\r\n  isAltOtherReasonSelectd = () => {\r\n    return IsAltOtherExcuseReason(this.state.excuseReasonCode)\r\n  }\r\n  render() {\r\n    const { excuseDetails, show } = this.props\r\n    const isOnTrack = IsOnTrack()\r\n\r\n    const { canExcuse, saving, loading, excuseMode } = this.state\r\n    const disableExcuse = (isOnTrack && (this.state.comment.trim().length === 0)) || loading || saving\r\n    const disableAltrnate = isOnTrack || loading || saving || (this.isAltOtherReasonSelectd() && this.state.excuseComment.trim().length == 0)\r\n    const disableExcuseButton = disableExcuse || (!isOnTrack && excuseMode !== ExcuseOnly) || (this.isAltOtherReasonSelectd() && this.state.excuseComment.trim().length == 0)\r\n    const disableExcuseAnAlternateButton = disableExcuse || !canExcuse || (!isOnTrack && excuseMode !== ExcuseAndAltrnate) || disableAltrnate\r\n    if (isOnTrack) {\r\n      return <ConfirmationModal show={this.props.show}\r\n        title=\"EXCUSE EVENTS\"\r\n        confirmButtonText=\"VERIFY\"\r\n        onConfirm={() => this.excuse(false)}\r\n        onHide={() => this.props.onClose(false)}\r\n        size=\"lg\"\r\n        disableConfirmButton={disableExcuseButton}\r\n        spinConfirmButton={this.state.saving}\r\n        disableConfirmOnSpin={true}>\r\n        <Form>\r\n          <Form.Row className=\"form-group\">\r\n            <Col>You have selected to excuse {excuseDetails?.FirstName} {excuseDetails?.LastName} from taking a pending {excuseDetails?.Service}. Doing so will remove this event from being tested for the associated pool and will affect the minimum required events to be completed for this selection period.  You are required to provide reason for excusal.</Col>\r\n          </Form.Row>\r\n          <Form.Row className=\"form-group required\">\r\n            <Form.Label column lg={3} htmlFor=\"comment\">Reason for excusing</Form.Label>\r\n            <Col lg={9}>\r\n              <Form.Control\r\n                id=\"comment\"\r\n                as=\"textarea\"\r\n                rows={3}\r\n                value={this.state.comment}\r\n                onChange={e => this.setState({ comment: e.target.value })} />\r\n            </Col>\r\n          </Form.Row>\r\n          <Form.Row>\r\n            <Col>Clicking Verify will mark the scheduling event status as “Excused”, will add the comments to the scheduling notes and will remove the event from the Random Selection Inbox grid.  Excused events can be filtered from the Results grid.</Col>\r\n          </Form.Row>\r\n        </Form>\r\n      </ConfirmationModal>\r\n    }\r\n    const donorName = excuseDetails?.DonorName || \"\"\r\n    const title = \"EXCUSE EVENTS\"\r\n    const size = \"xl\"\r\n    const exceuseButtonText = \"EXCUSE\"\r\n    const exceuseAndAlternateButtonText = \"EXCUSE + ALTERNATE\"\r\n    const showCloseButton = true\r\n    const showCancelButton = true\r\n    const spinConfirmButton = this.state.saving\r\n    const disableConfirmOnSpin = true\r\n    const cancelButtonText = \"CANCEL\"\r\n\r\n\r\n    return <Modal backdrop=\"static\" centered show={show} onHide={() => this.props.onClose(false)} size={size}>\r\n      <Modal.Header closeButton={showCloseButton}>\r\n        <Modal.Title>{title}</Modal.Title>\r\n      </Modal.Header>\r\n      <Modal.Body>\r\n        <Form>\r\n          <Form.Row className=\"form-group\">\r\n            <Col>You have selected to excuse {excuseDetails?.FirstName} {excuseDetails?.LastName} from taking a pending {excuseDetails?.Service}. Doing so will remove this event from being tested for the associated pool and will affect the minimum required events to be completed for this selection period. You are required to provide reason for excusal.</Col>\r\n          </Form.Row>\r\n          <Form.Row className=\"form-group\">\r\n            <Col>You have the option to excuse the donor from testing or excusing the donor and selecting an alternate donor from the current selection period.</Col>\r\n          </Form.Row>\r\n          <Form.Row className=\"form-group\">\r\n            <Col>Clicking “Excuse” will mark the scheduling event status as “Excused”, will add the comments to the scheduling notes and will remove the event from the Random Selection Inbox grid. Excused events can be filtered from the Results grid.</Col>\r\n          </Form.Row>\r\n          <Form.Row className=\"form-group\">\r\n            <Col>Clicking “Excuse + Alternate“ will excuse the current donor (same as above) and add an alternate donor to the Inbox grid with a status of “Pending ALT”.  Alternates can be scheduled for testing in the same way as “Pending”.</Col>\r\n          </Form.Row>\r\n          <Form.Row className=\"form-group\">\r\n            <Col>Please note that alternates with be created with same event types as the excused record. (i.e.  If a drug and alcohol were excused, then a drug and alcohol will be created for the alternate donor.)</Col>\r\n          </Form.Row>\r\n\r\n          <Form.Row className=\"form-group\">\r\n            <Col md={4} style={{ paddingTop: \"2px\" }}>\r\n              <Form.Check\r\n                type=\"radio\"\r\n                inline\r\n                id={\"ExcuseAndAltrnate\"}\r\n                label={exceuseAndAlternateButtonText}\r\n                name={\"ExcuseMode\"}\r\n                checked={this.state.excuseMode === ExcuseAndAltrnate}\r\n                onChange={(e: React.ChangeEvent<HTMLInputElement>) => this.toggleAlternateExcuseOption(ExcuseAndAltrnate)}\r\n                className=\"abc-radio abc-radio-primary\" />\r\n            </Col>\r\n\r\n            <Col md={4} style={{ paddingTop: \"2px\" }}>\r\n              <Form.Check\r\n                type=\"radio\"\r\n                inline\r\n                id={\"ExcuseOnly\"}\r\n                label={exceuseButtonText}\r\n                name={\"ExcuseMode\"}\r\n                checked={this.state.excuseMode === ExcuseOnly}\r\n                onChange={(e: React.ChangeEvent<HTMLInputElement>) => this.toggleAlternateExcuseOption(ExcuseOnly)}\r\n                className=\"abc-radio abc-radio-primary\" />\r\n            </Col>\r\n          </Form.Row>\r\n\r\n          <Form.Row className=\"form-group\">\r\n            <Col md={6} style={{ paddingTop: \"2px\" }}>\r\n              <Form.Control as=\"select\" value={this.state.excuseReasonCode || \"\"}\r\n                onChange={(e) => this.onAltReasonChange(e.target.value)}\r\n                isInvalid={this.state.excuseReasonCode === \"\"}\r\n                disabled={false}>\r\n                {AlternateExcuseReasons.map((item: ExcuseReason) => <option value={item.Code} key={item.Code}>{item.Description}</option>)}\r\n              </Form.Control>\r\n            </Col>\r\n          </Form.Row>\r\n\r\n          {this.isAltOtherReasonSelectd() &&\r\n            <Form.Row className=\"form-group required\">\r\n              <Form.Label column lg={3} htmlFor=\"alt_reason_comment\">Comment (required)</Form.Label>\r\n            </Form.Row>\r\n          }          \r\n          \r\n          {this.isAltOtherReasonSelectd() &&\r\n            <Form.Row className=\"form-group required\">\r\n              <Col md={6}>\r\n                <Form.Control\r\n                  id=\"alt_reason_comment\"\r\n                  as=\"textarea\"\r\n                  rows={3}\r\n                  value={this.state.excuseComment}\r\n                  onChange={e => this.setState({ excuseComment: e.target.value })} />\r\n              </Col>\r\n            </Form.Row>\r\n          }\r\n        </Form>\r\n      </Modal.Body>\r\n      <Modal.Footer>\r\n        {showCancelButton && <Button variant=\"secondary\" onClick={() => this.props.onClose(false)} className=\"mr-auto fixed-w5\">{cancelButtonText}</Button>}\r\n\r\n\r\n        <ActionButton variant=\"primary\" onClick={() => this.excuse(true)} disabled={disableExcuseAnAlternateButton} spin={spinConfirmButton} disableOnSpin={disableConfirmOnSpin} className=\"fixed-w5\">{exceuseAndAlternateButtonText}</ActionButton>\r\n        <ActionButton variant=\"primary\" onClick={() => this.excuse(false)} disabled={disableExcuseButton} spin={spinConfirmButton} disableOnSpin={disableConfirmOnSpin} className=\"fixed-w5\">{exceuseButtonText}</ActionButton>\r\n      </Modal.Footer>\r\n    </Modal>\r\n  }\r\n}","import * as React from \"react\"\r\nimport { Container, Modal, Row, Col, Button, Form } from \"react-bootstrap\"\r\nimport { toast } from \"react-toastify\"\r\nimport { Subscription } from \"rxjs\"\r\nimport { APIError } from \"../../api/ObservableFromFetch\"\r\nimport { EventUnexcuseObservable, GetExcuseNotesObservable, UpdateExcuseNotesObservable } from \"../../api/Randoms/EventExcuse\"\r\nimport SelectionInboxGridRow from \"../../api/Randoms/SelectionInboxModel/SelectionInboxGridRow\"\r\nimport ActionButton from \"../ActionButton\"\r\nimport FormatError from \"../../formatters/FormatError\"\r\n\r\ninterface UnexcuseEventModalModalProps {\r\n  show: boolean\r\n  excuseDetails?: SelectionInboxGridRow\r\n  onClose: (success: boolean) => void\r\n}\r\n\r\ninterface UnexcuseEventModalState {\r\n  comment: string\r\n  saving: boolean\r\n  loading: boolean\r\n}\r\n\r\nexport default class UnexcuseEventModalModal extends React.PureComponent<UnexcuseEventModalModalProps, {}> {\r\n  state: UnexcuseEventModalState = { comment: \"\", saving: false, loading: false }\r\n  saveSubscription?: Subscription\r\n  loadSubscription?: Subscription\r\n\r\n  componentDidMount() {\r\n    this.setState({ loading: true })\r\n    this.loadSubscription && this.loadSubscription.unsubscribe()\r\n    this.loadSubscription = GetExcuseNotesObservable(this.props.excuseDetails!.TestDetailID).subscribe(\r\n      (result: string) => this.setState({ comment: result, loading: false }),\r\n      error => this.handleAPIError(error, { loading: false })\r\n    )\r\n\r\n  }\r\n\r\n  componentWillUnmount() {\r\n    this.saveSubscription && this.saveSubscription.unsubscribe()\r\n    this.loadSubscription && this.loadSubscription.unsubscribe()\r\n  }\r\n\r\n  unexcuse = () => {\r\n    this.setState({ saving: true })\r\n    this.saveSubscription && this.saveSubscription.unsubscribe()\r\n    this.saveSubscription = EventUnexcuseObservable(this.props.excuseDetails!.TestEventID, this.props.excuseDetails!.TestDetailID).subscribe(\r\n      result => {\r\n        toast.success(result)\r\n        this.props.onClose(true)\r\n      },\r\n      error => this.handleAPIError(error, { saving: false })\r\n    )\r\n  }\r\n\r\n  updateComment = () => {\r\n    this.setState({ saving: true })\r\n    this.saveSubscription && this.saveSubscription.unsubscribe()\r\n    this.saveSubscription = UpdateExcuseNotesObservable(this.props.excuseDetails!.TestDetailID, this.state.comment.trim()).subscribe(\r\n      result => {\r\n        toast.success(result)\r\n        this.props.onClose(true)\r\n      },\r\n      error => this.handleAPIError(error, { saving: false })\r\n    )\r\n  }\r\n\r\n  handleAPIError = (error: Error | APIError, stateChanges: object) => {\r\n    this.setState(stateChanges)\r\n    error && toast.error(FormatError(error))\r\n  }\r\n\r\n  render() {\r\n    const { saving, loading } = this.state\r\n    const disableUpdateButton = (this.state.comment.trim().length === 0) || loading || saving\r\n\r\n    return <Modal backdrop=\"static\" centered show={this.props.show} onHide={() => this.props.onClose(false)} size=\"lg\">\r\n      <Modal.Header closeButton={true}>\r\n        <Modal.Title>UNEXCUSE EVENTS</Modal.Title>\r\n      </Modal.Header>\r\n      <Modal.Body>\r\n        <Form>\r\n          <Form.Row className=\"form-group required\">\r\n            <Form.Label column lg={3} htmlFor=\"comment\">Reason for excusing</Form.Label>\r\n            <Col lg={9}>\r\n              <Form.Control\r\n                id=\"comment\"\r\n                as=\"textarea\"\r\n                rows={3}\r\n                value={this.state.comment}\r\n                onChange={e => this.setState({ comment: e.target.value })} />\r\n            </Col>\r\n          </Form.Row>\r\n        </Form>\r\n      </Modal.Body>\r\n      <Modal.Footer>\r\n        <Button variant=\"secondary\" onClick={() => this.props.onClose(false)} className=\"mr-auto fixed-w5\">CANCEL</Button>\r\n        <ActionButton variant=\"primary\" onClick={() => this.updateComment()} disabled= {disableUpdateButton} spin={saving} disableOnSpin={true} className=\"fixed-w5\">UPDATE</ActionButton>\r\n        <ActionButton variant=\"primary\" onClick={() => this.unexcuse()} spin={saving} disableOnSpin={true} className=\"fixed-w5\">UNEXCUSE</ActionButton>\r\n      </Modal.Footer>\r\n    </Modal>\r\n  }\r\n}","import SelectionInboxGridRow from \"./SelectionInboxModel/SelectionInboxGridRow\"\r\nimport { ObservableFromFetch } from \"../ObservableFromFetch\"\r\n\r\nexport default function UpdateStatusToPending(data: SelectionInboxGridRow[]) {\r\n  const tests = data.map((d) => ({\r\n    TestEventID: d.TestEventID,\r\n    MockTestDetailID: d.TestDetailID,\r\n    FormFoxTestAN: d.FormFoxTestAN,\r\n  }))\r\n\r\n  const params: string = JSON.stringify(tests)\r\n  return ObservableFromFetch<string>(\"WorkforceRandomTest/UpdateStatusToPending\", params, \"put\")\r\n}\r\n","import React from \"react\"\r\nimport { Container, Row, Col, Table, Button, Spinner } from \"react-bootstrap\"\r\nimport { AppPageWrapper } from \"../NavMenu/AppPageWrapper\"\r\nimport { Subscription, BehaviorSubject, of, concat } from \"rxjs\"\r\nimport { distinctUntilChanged, switchMap, map, catchError } from \"rxjs/operators\"\r\nimport { toast } from \"react-toastify\"\r\nimport { FaSync } from \"react-icons/fa\"\r\nimport FileSaver from \"file-saver\"\r\nimport SearchBar from \"../SearchBar\"\r\nimport SearchField from \"../../api/SearchField\"\r\nimport ColumnsCustomizeModal from \"../ColumnsCustomizeModal/ColumnsCustomizeModal\"\r\nimport { CustomizableFilterColumn } from \"../ColumnsCustomizeModal/CustomizableColumn\"\r\nimport ColumnHeaderFilter from \"../ColumnHeaderFilter\"\r\nimport TablePagination from \"../TablePagination\"\r\nimport FormatTimestampFileName from \"../../formatters/FormatTimestampFileName\"\r\nimport downloadCsv from \"../../assets/images/download-csv.png\"\r\nimport { SelectionInboxGridObservable, SelectionInboxGridCsv } from \"../../api/Randoms/SelectionInboxGrid\"\r\nimport SelectionInboxGridRow from \"../../api/Randoms/SelectionInboxModel/SelectionInboxGridRow\"\r\nimport { ColumnFilters } from \"../../api/Randoms/SelectionInboxModel/ColumnFilters\"\r\nimport { SearchFieldsGet } from \"../../api/OrderResults/SearchFieldsGet\"\r\nimport FormatSSN from \"../../formatters/FormatSSN\"\r\nimport { Link } from \"react-router-dom\"\r\nimport FormatDate from \"../../formatters/FormatDate\"\r\nimport EmployeeDetailsModal from \"../OrderResults/EmployeeDetailsModal\"\r\nimport { SelectionInboxGridResponse } from \"../../api/Randoms/SelectionInboxModel/SelectionInboxGridResponse\"\r\nimport { Filter, Sort } from \"../../api/GridRequest\"\r\nimport { StorageKey } from \"../../config/Constants\"\r\nimport { loadCustomized, saveCustomized } from \"../ColumnsCustomizeModal/ColumnsCustomizeModal\"\r\nimport ExcuseEventModal from \"./ExcuseEventModal\"\r\nimport UnexcuseEventModal from \"./UnexcuseEventModal\"\r\nimport UpdateStatusToPending from \"../../api/Randoms/SelectionInboxPending\"\r\nimport { isPortalAdmin } from \"../../authentication/isAdminRole\"\r\nimport { connect } from \"react-redux\"\r\nimport { AppState } from \"../../AppState\"\r\nimport GetDonorID, { GetDonorIDTitle } from \"../../formatters/RenderDonorID\"\r\nimport { GetSelectedPortal } from \"../../authentication/SelectedCompany/CompanySelectionDrivenSelectors\"\r\n\r\ntype Column = CustomizableFilterColumn<keyof SelectionInboxGridRow, keyof ColumnFilters>\r\n\r\ninterface SelectionInboxProps {\r\n  isPortalAdmin: boolean\r\n  unmaskDonorId: number\r\n}\r\n\r\ninterface SelectionInboxState {\r\n  loading: boolean\r\n  data?: SelectionInboxGridResponse\r\n  columns: Column[]\r\n  loadingCsv?: boolean\r\n  customizeModal: boolean\r\n  searchFields?: SearchField[]\r\n  details?: SelectionInboxGridRow\r\n  excuseRow?: SelectionInboxGridRow\r\n  unexcuseRow?: SelectionInboxGridRow\r\n  employeeDetails: boolean\r\n}\r\n\r\nconst defaultColumns: Column[] = [\r\n  { name: \"Status\", filter: \"Status\", label: \"STATUS\", visible: true, customize: true, required: true },\r\n  { name: \"DonorID\", filter: \"IDNumber\", label: \"PERSONNEL ID\", visible: true, customize: true },\r\n  { name: \"DonorName\", filter: \"Name\", label: \"NAME\", visible: true, customize: true },\r\n  { name: \"Service\", filter: \"Service\", label: \"SERVICE\", visible: true, customize: true },\r\n  { name: \"PoolName\", filter: \"Pool\", label: \"POOL\", visible: true, customize: true },\r\n  { name: \"Selection\", filter: \"Selection\", label: \"SELECTION\", visible: true, customize: true },\r\n  { name: \"CompanyName\", filter: \"Company\", label: \"COMPANY\", visible: true, customize: true },\r\n  { name: \"LocationName\", filter: \"Location\", label: \"LOCATION\", visible: false, customize: true },\r\n  { name: \"Regulated\", filter: \"Regulated\", label: \"REGULATED\", visible: true, customize: true },\r\n  { name: \"EventDate\", filter: \"EventDate\", label: \"CREATED\", visible: true, customize: true },\r\n  { name: \"DateNotified\", filter: \"NotificationDate\", label: \"NOTIFIED\", visible: true, customize: true },\r\n  { name: \"FormFoxTestAN\", filter: \"AuthorizationID\", label: \"AUTHORIZATION ID\", visible: true, customize: true },\r\n  { name: \"SiteName\", filter: \"Site\", label: \"SITE\", visible: true, customize: true },\r\n  { name: \"RegulatoryMode\", filter: \"RegulatoryMode\", label: \"REGULATORY MODE\", visible: true, customize: true },\r\n  { name: \"Occupation\", filter: \"Occupation\", label: \"OCCUPATION\", visible: false, customize: true },\r\n  { name: \"LastName\", filter: \"LastName\", label: \"LAST NAME\", visible: false, customize: true },\r\n  { name: \"MiddleInitial\", filter: \"MiddleInitial\", label: \"MIDDLE INITIAL\", visible: false, customize: true },\r\n  { name: \"FirstName\", filter: \"FirstName\", label: \"FIRST NAME\", visible: false, customize: true },\r\n  { name: \"Gender\", filter: \"Gender\", label: \"GENDER\", visible: false, customize: true },\r\n  { name: \"DateOfBirth\", filter: \"DateOfBirth\", label: \"DOB\", visible: false, customize: true },\r\n  { name: \"PrimaryIDType\", filter: \"PrimaryIDType\", label: \"PRIMARY ID TYPE\", visible: false, customize: true },\r\n  { name: \"SSN\", filter: \"SSN\", label: \"SSN\", visible: false, customize: true },\r\n  { name: \"DriverID\", filter: \"DriverID\", label: \"DRIVER ID\", visible: false, customize: true },\r\n  { name: \"EmployerID\", filter: \"EmployerID\", label: \"EMPLOYER ID\", visible: false, customize: true },\r\n  { name: \"AlternateID\", filter: \"AlternateID\", label: \"ALTERNATE ID\", visible: false, customize: true },\r\n  { name: \"CRMUniqueID\", filter: \"CRMUniqueID\", label: \"CRM UNIQUE ID\", visible: false, customize: true },\r\n  { name: \"HireDate\", filter: \"HireDate\", label: \"HIRE DATE\", visible: false, customize: true },\r\n  { name: \"TerminationDate\", filter: \"TerminationDate\", label: \"TERMINATION DATE\", visible: false, customize: true },\r\n  { name: \"CellPhone\", filter: \"CellPhone\", label: \"CELL PHONE\", visible: false, customize: true },\r\n  { name: \"HomePhone\", filter: \"HomePhone\", label: \"HOME PHONE\", visible: false, customize: true },\r\n  { name: \"WorkPhone\", filter: \"WorkPhone\", label: \"WORK PHONE\", visible: false, customize: true },\r\n  { name: \"Email\", filter: \"Email\", label: \"EMAIL\", visible: false, customize: true },\r\n  { name: \"Inactive\", filter: \"Inactive\", label: \"INACTIVE\", visible: false, customize: true },\r\n  { name: \"RetireDate\", filter: \"RetireDate\", label: \"RETIRE DATE\", visible: false, customize: true },\r\n  { name: \"Supervisor1\", filter: \"Supervisor1\", label: \"SUPERVISOR 1\", visible: false, customize: true },\r\n  { name: \"Supervisor2\", filter: \"Supervisor2\", label: \"SUPERVISOR 2\", visible: false, customize: true },\r\n  { name: \"Address\", filter: \"Address\", label: \"ADDRESS\", visible: false, customize: true },\r\n  { name: \"Province\", filter: \"Province\", label: \"PROVINCE\", visible: false, customize: true },\r\n  { name: \"Zip\", filter: \"Zip\", label: \"ZIP\", visible: false, customize: true },\r\n  { name: \"Country\", filter: \"Country\", label: \"COUNTRY\", visible: false, customize: true },\r\n  { name: \"StateCode\", filter: \"StateCode\", label: \"STATE CODE\", visible: false, customize: true },\r\n  { name: \"StateName\", filter: \"StateName\", label: \"STATE NAME\", visible: false, customize: true },\r\n  { name: \"Manager\", filter: \"Manager\", label: \"MANAGER\", visible: false, customize: true },\r\n]\r\n\r\ninterface SelectionInboxSearchParams {\r\n  pageNumber: number\r\n  sort: Sort\r\n  filters: Filter[]\r\n  search: { field: string, text: string }\r\n}\r\n\r\nconst PageSize = 20\r\nexport class SelectionInbox extends React.PureComponent<SelectionInboxProps, SelectionInboxState> {\r\n  searchFieldsSubscription?: Subscription\r\n \r\n  state: SelectionInboxState = {\r\n    loading: false,\r\n    data: undefined,\r\n    columns: loadCustomized(StorageKey.SelectionInboxGridColumns, defaultColumns) as Column[],\r\n    customizeModal: false,\r\n    employeeDetails: false\r\n  }\r\n\r\n  page$ = new BehaviorSubject<SelectionInboxSearchParams>({\r\n    pageNumber: 1,\r\n    sort: { column: \"\", order: \"\" },\r\n    filters: [],\r\n    search: { field: \"\", text: \"\" }\r\n  })\r\n  pageSubscription?: Subscription\r\n  csvSubscription?: Subscription\r\n\r\n  componentDidMount() {\r\n    this.pageSubscription = this.page$.pipe(\r\n      distinctUntilChanged(),\r\n      switchMap(params => concat(\r\n        of({ loading: true }),\r\n        SelectionInboxGridObservable(params.pageNumber, PageSize, params.sort, params.filters, params.search).pipe(\r\n          map((result: SelectionInboxGridResponse) => ({ data: result, loading: false })),\r\n          catchError((error) => of({ loading: false }))\r\n        )\r\n      ))\r\n    ).subscribe(\r\n      (newState: { loading: boolean, data?: SelectionInboxGridResponse }) => {\r\n        if (newState.data) {\r\n          // Loads prev page in case of current non-first page is empty\r\n          if ((!newState.data.Records || newState.data.Records.length === 0) && this.page$.value.pageNumber > 1) {\r\n            this.page$.next({ ...this.page$.value, pageNumber: this.page$.value.pageNumber - 1 })\r\n          } else {\r\n            if (newState.data.Regulated?.length) {\r\n              newState.data.Regulated = newState.data.Regulated.map(regulated => regulated ? \"True\" : \"False\")\r\n            }\r\n\r\n            if (this.props.isPortalAdmin && newState.data.Manager?.length) {\r\n              newState.data.Manager = newState.data.Manager.map(manager => manager ? manager = \"TRUE\" : manager = \"FALSE\")\r\n              newState.data.Records = this.mapManager(newState.data.Records)\r\n            }\r\n            else {\r\n              this.setState({columns: this.state.columns.filter( x => x.name != \"Manager\")})\r\n            }\r\n\r\n            this.setState({ loading: newState.loading, data: newState.data })\r\n            \r\n          }\r\n        } else {\r\n          this.setState({ loading: newState.loading })\r\n        }\r\n\r\n      },\r\n      (error: string) => {\r\n        this.setState({ loading: false })\r\n        toast.error(error)\r\n      }\r\n    )\r\n\r\n    this.searchFieldsSubscription = SearchFieldsGet().subscribe(\r\n      (data: SearchField[]) => this.setState({ searchFields: data }),\r\n      error => toast.error(error)\r\n    )\r\n  }\r\n\r\n  mapManager = (records: SelectionInboxGridRow[][]): SelectionInboxGridRow[][] => {\r\n    return records.map((r) => {\r\n      return r.map((element) => {\r\n        element.Manager = (element.Manager || element.Manager == \"TRUE\") ? \"TRUE\" : \"FALSE\"\r\n        return element\r\n      })\r\n    })\r\n  }\r\n\r\n  componentWillUnmount() {\r\n    this.pageSubscription && this.pageSubscription.unsubscribe()\r\n    this.csvSubscription && this.csvSubscription.unsubscribe()\r\n    this.searchFieldsSubscription && this.searchFieldsSubscription.unsubscribe()\r\n    this.page$.unsubscribe()\r\n  }\r\n\r\n  pageChanged = (pageNumber: number) => {\r\n    this.page$.next({ ...this.page$.value, pageNumber: pageNumber })\r\n  }\r\n\r\n  sortGrid(column: string, order?: string) {\r\n    this.page$.next({ ...this.page$.value, sort: { column: column, order: order || \"\" } })\r\n  }\r\n\r\n  filterGrid(column: string, items: string[]) {\r\n    const filters = [...this.page$.value.filters]\r\n    const filter = { column: column, values: items }\r\n    let index = filters.findIndex(item => item.column === filter.column)\r\n    if (index >= 0) {\r\n      filters[index] = filter\r\n    } else {\r\n      filters.push(filter)\r\n    }\r\n\r\n    this.page$.next({ ...this.page$.value, pageNumber: 1, filters: filters })\r\n  }\r\n\r\n  clearFilters() {\r\n    this.page$.next({ ...this.page$.value, pageNumber: 1, filters: [] })\r\n  }\r\n\r\n  onSearch = (field: string, text: string) => {\r\n    this.page$.next({ ...this.page$.value, pageNumber: 1, search: { field: field, text: text } })\r\n  }\r\n\r\n  onExportClick = () => {\r\n    this.setState({ loadingCsv: true })\r\n    const value = this.page$.value\r\n    this.csvSubscription = SelectionInboxGridCsv(value.pageNumber, 0, value.sort, value.filters, value.search).subscribe(\r\n      result => this.export(result),\r\n      error => {\r\n        this.setState({ loadingCsv: false })\r\n        toast.error(error)\r\n      },\r\n      (() => this.setState({ loadingCsv: false }))\r\n    )\r\n  }\r\n\r\n  export(csv: string) {\r\n    const csvData = new Blob([csv], { type: 'text/csv;charset=utf-8;' })\r\n    FileSaver.saveAs(csvData, FormatTimestampFileName(\"Selection_Inbox\", \"csv\", new Date()), true)\r\n    toast.success(\"CSV file downloaded successfully.\")\r\n  }\r\n\r\n  print(base64pdf: string) {\r\n    const pdfWindow = window.open(\"\")\r\n    if (pdfWindow) {\r\n      pdfWindow.document.write(\"<iframe width='100%' height='100%' src='data:application/pdf;base64, \" + encodeURI(base64pdf) + \"'></iframe>\")\r\n    }\r\n  }\r\n\r\n  handleExcuseModalClose = (success: boolean) => {\r\n    this.setState({ excuseRow: undefined })\r\n    if (success) {\r\n      this.refreshGrid()\r\n    }\r\n  }\r\n\r\n  handleUnexcuseModalClose = (success: boolean) => {\r\n    this.setState({ unexcuseRow: undefined })\r\n    if (success) {\r\n      this.page$.next({ ...this.page$.value })\r\n    }\r\n  }\r\n\r\n  isCanExcuse = (row: SelectionInboxGridRow)=> {\r\n    return row.Status.startsWith(\"PENDING\")\r\n  }\r\n\r\n  isCanUnexcuse = (row: SelectionInboxGridRow)=> {\r\n    return row.Status.startsWith(\"EXCUSED\")\r\n  }\r\n\r\n  visibleColumns = () => this.state.columns.filter(col => col.visible)\r\n\r\n  statusButton = (row: SelectionInboxGridRow, group: SelectionInboxGridRow[]) => {\r\n    switch(row.Status) {\r\n      case \"ORDERED\":\r\n      case \"ORDERED ALT\":{\r\n          return <Button variant=\"link\" className=\"p-0 btn-icon-link\" onClick={() => this.setState({ details: row, employeeDetails: true })}>{row.Status}</Button>\r\n      }\r\n      case \"EXCUSED\":{\r\n          return <Button variant=\"link\" className=\"p-0 btn-icon-link\" onClick={() => this.setState({ unexcuseRow: row })}>{row.Status}</Button>\r\n      }\r\n      default:{\r\n          return <Link className=\"btn-link btn-icon-link\" to={{ pathname: \"/order\", state: { formData: group } }}>{row.Status}</Link>\r\n      }\r\n    }\r\n  }\r\n\r\n  setPending = (row: SelectionInboxGridRow, group: SelectionInboxGridRow[]) => {\r\n    if ([\"ORDERED\", \"ORDERED ALT\"].includes(row.Status))\r\n      return <Button\r\n       variant=\"link\"\r\n       className=\"text-left p-0 btn-icon-link\"\r\n       onClick={() => this.updateToPending(group)}>\r\n        [Set to PENDING]\r\n       </Button>\r\n    else\r\n      return \"\"\r\n  }\r\n\r\n  updateToPending = (group: SelectionInboxGridRow[]) => {\r\n    UpdateStatusToPending(group).subscribe(\r\n      result => this.refreshGrid(),\r\n      error => toast.error(error)\r\n    )\r\n  }\r\n\r\n  createdDateButton = (row: SelectionInboxGridRow) => {\r\n    if (this.isCanExcuse(row)) {\r\n      return <Button variant=\"link\" className=\"p-0 btn-icon-link\" onClick={() => this.setState({ excuseRow: row })}>{FormatDate(row[\"EventDate\"])}</Button>\r\n    }\r\n    else if (this.isCanUnexcuse(row)) {\r\n      return <Button variant=\"link\" className=\"p-0 btn-icon-link\" onClick={() => this.setState({ unexcuseRow: row })}>{FormatDate(row[\"EventDate\"])}</Button>\r\n    }\r\n    else {\r\n       return FormatDate(row[\"EventDate\"])\r\n    }\r\n  }\r\n\r\n  renderCell = (row: SelectionInboxGridRow, colName: keyof SelectionInboxGridRow, key: number, isFirstRow: boolean, isLastRow: boolean, group: SelectionInboxGridRow[]) => {\r\n    switch (colName) {\r\n      case \"DonorID\":\r\n        const idValue = GetDonorID(row[colName], row[\"ID\"], this.props.unmaskDonorId)\r\n        return <td key={key} className={`align-text-top group-cell ${isFirstRow ? \"first\" : \"\"} ${isLastRow ? \"last\" : \"\"}`}>{isFirstRow && idValue}</td>\r\n      case \"DonorName\":\r\n        return <td key={key} className={`align-text-top group-cell ${isFirstRow ? \"first\" : \"\"} ${isLastRow ? \"last\" : \"\"}`}>{isFirstRow && row[colName]}</td>\r\n      case \"Status\":\r\n        return <td key={key} className={`align-text-top group-cell ${isFirstRow ? \"first\" : \"\"} ${isLastRow ? \"last\" : \"\"}`}>\r\n          {isFirstRow && this.statusButton(row, group)}\r\n          {isFirstRow && this.setPending(row, group)}\r\n        </td>\r\n      case \"EventDate\":\r\n        return <td key={key} className=\"align-text-top\">{this.createdDateButton(row)}</td>\r\n      case \"DateNotified\":\r\n        return <td key={key} className=\"align-text-top\">{FormatDate(row[colName])}</td>\r\n      default:\r\n        return <td key={key} className=\"align-text-top\">{row[colName]}</td>\r\n    }\r\n  }\r\n\r\n  headerColumns = () => this.visibleColumns().map((col: Column, i) => {\r\n    const sort = this.page$.value.sort\r\n    return (\r\n      <th key={col.name}>\r\n        {this.state.data && col.filter && col.filter in this.state.data && <ColumnHeaderFilter\r\n          title={col.label || col.name}\r\n          filteredItems={this.page$.value.filters.find(item => item.column === col.filter)?.values || []}\r\n          sort={sort.column === col.name ? sort.order === \"asc\" ? \"asc\" : \"desc\" : undefined}\r\n          items={this.state.data[col.filter as keyof ColumnFilters]?.filter(item => !!item) || []}\r\n          onSort={(order?: string) => this.sortGrid(col.name, order)}\r\n          onFilter={(items: string[]) => col.filter && this.filterGrid(col.filter, items)}\r\n        />}\r\n        {(!this.state.data || !col.filter) && (col.label || col.name)}\r\n      </th>\r\n    )\r\n  })\r\n\r\n  formatSearchString = (ID: string, value: string): string => {\r\n    return ID === \"SSN\" ? FormatSSN(value) : value\r\n  }\r\n  \r\n  refreshGrid = () => this.page$.next({ ...this.page$.value })\r\n\r\n  render() {\r\n    const emptyRow = <tr><td colSpan={this.visibleColumns().length}>NO DATA FOUND</td></tr>\r\n    const groupedRows = (data: SelectionInboxGridResponse) => data.Records.map((rows: SelectionInboxGridRow[]) => dataRows(rows))\r\n    const dataRows = (rows: SelectionInboxGridRow[]) => rows.map((row: SelectionInboxGridRow, i: number) => <tr key={i}>{dataColumns(row, i === 0, i === rows.length - 1, rows)}</tr>)\r\n    const dataColumns = (row: SelectionInboxGridRow, isFirstRow: boolean, isLastRow: boolean, group: SelectionInboxGridRow[]) => this.visibleColumns().map((col, i) => this.renderCell(row, col.name as keyof SelectionInboxGridRow, i, isFirstRow, isLastRow, group))\r\n\r\n    return <>\r\n      <AppPageWrapper parentClassName={\"align-items-center\"} showNav>\r\n        {this.state.employeeDetails && this.state.details && <EmployeeDetailsModal\r\n          personID={this.state.details.PersonID}\r\n          name={this.state.details.DonorName}\r\n          id={this.state.details.DonorID}\r\n          onHide={(updated) => this.setState({ employeeDetails: false }, () => updated && this.refreshGrid())} />}\r\n        <Container fluid className=\"grid-container\">\r\n          <Row className=\"pb-2\">\r\n            <Col>\r\n              <SearchBar onSearch={this.onSearch} searchFields={this.state.searchFields || []} formatValue={this.formatSearchString} allowBlank placeholder=\"Select\" />\r\n            </Col>\r\n            <Col lg={6} className={\"text-right\"}>\r\n              <Button variant=\"secondary\" size=\"sm\" onClick={() => this.setState({ customizeModal: true })}>CUSTOMIZE</Button>\r\n              <Button variant=\"icon-link\" size=\"sm\" onClick={() => this.onExportClick()} className=\"text-dark\">\r\n                EXPORT CSV&nbsp;\r\n                {this.state.loadingCsv ? <Spinner animation=\"border\" size=\"sm\" /> : <img src={downloadCsv} alt=\"\" width=\"16\" height=\"16\" />}\r\n              </Button>\r\n              <Button variant=\"icon-link\" size=\"sm\" onClick={() => this.clearFilters()} className=\"text-dark\">CLEAR FILTERS<FaSync /></Button>\r\n              <ColumnsCustomizeModal show={this.state.customizeModal}\r\n                columns= {this.props.isPortalAdmin ? this.state.columns : this.state.columns.filter( x => x.name != \"Manager\")}\r\n                storeKey={StorageKey.SelectionInboxGridColumns}\r\n                onClose={() => this.setState({ customizeModal: false })}\r\n                onSave={columns => this.setState({ columns: columns as Column[], customizeModal: false })} />\r\n            </Col>\r\n          </Row>\r\n          <Row>\r\n            <Col>\r\n              <Table bordered responsive>\r\n                <thead>\r\n                  <tr>\r\n                    {this.headerColumns()}\r\n                  </tr>\r\n                </thead>\r\n                <tbody>\r\n                  {\r\n                    this.state.loading ?\r\n                      <tr><td colSpan={this.visibleColumns().length + 1}><Spinner animation=\"border\" variant=\"secondary\" /></td></tr> :\r\n                      this.state.data?.Records && this.state.data.Records.length > 0 ? groupedRows(this.state.data) : emptyRow\r\n                  }\r\n                </tbody>\r\n              </Table>\r\n              {this.state.data && !this.state.loading &&\r\n                <span className=\"total-records\">Total records: {this.state.data.Total}</span>}\r\n              {this.state.data && !this.state.loading &&\r\n                <TablePagination pageNumber={this.page$.value.pageNumber} pages={this.state.data.Pages} onChange={this.pageChanged} />}\r\n            </Col>\r\n          </Row>\r\n        </Container>\r\n      </AppPageWrapper>\r\n      {!!this.state.excuseRow && <ExcuseEventModal\r\n        show={!!this.state.excuseRow}\r\n        excuseDetails={this.state.excuseRow}\r\n        onClose={this.handleExcuseModalClose} />}\r\n      {!!this.state.unexcuseRow && <UnexcuseEventModal\r\n        show={!!this.state.unexcuseRow}\r\n        excuseDetails={this.state.unexcuseRow}\r\n        onClose={this.handleUnexcuseModalClose} />}\r\n    </>\r\n  }\r\n}\r\n\r\nfunction mapStateToProps(state: AppState): SelectionInboxProps {\r\n  const portal = GetSelectedPortal(state)\r\n  const unmaskDonorId = portal ? portal.UnmaskDonorID : 0\r\n  return {\r\n    isPortalAdmin: isPortalAdmin(state),\r\n    unmaskDonorId: unmaskDonorId\r\n  }\r\n}\r\nconst ConnectedSelectionInbox = connect(mapStateToProps)(SelectionInbox)\r\nexport default ConnectedSelectionInbox\r\n","import { ObservableFromFetch } from \"../ObservableFromFetch\"\r\nimport UserInformation from \"./Model/UserInformation\"\r\n\r\nexport function UserInformationObservable(userName: string, IsOrderSecurityOverride: boolean, exactMatch: boolean = true) {\r\n  const requestBody: string = JSON.stringify({ UserName: userName })\r\n  return ObservableFromFetch<UserInformation[]>(\"FFOrderUserFileMaintenance/GetUserInformation\", requestBody)\r\n}\r\n\r\nexport function UserNotificationInformationObservable(userName: string, IsOrderSecurityOverride: boolean, exactMatch: boolean = true) {\r\n  const requestBody: string = JSON.stringify({ UserName: userName })\r\n  return ObservableFromFetch<UserInformation[]>(\"FFOrderUserFileMaintenance/GetUserNotificationInformation\", requestBody)\r\n}\r\n\r\nexport function ActiveUserInformationGetObservable(userName: string, isActivateUser: boolean = false) {\r\n  const requestBody: string = JSON.stringify({ UserName: userName, IsActivateUser: isActivateUser })\r\n  return ObservableFromFetch<UserInformation[]>(\"FFOrderUserFileMaintenance/GetActiveUserInformation\", requestBody)\r\n}","import AssociatedData from \"./Model/AssociatedData\"\r\nimport RoleData from \"./Model/RoleData\"\r\nimport { ObservableFromFetch } from \"../ObservableFromFetch\"\r\n\r\nexport interface UpdateUserDetailParams {\r\n  ApplicationUserID: number\r\n  UserName: string\r\n  FirstName: string\r\n  LastName: string\r\n  EmailAddressList: AssociatedData[]\r\n  PhoneNumberList: AssociatedData[]\r\n  RoleList: RoleData[]\r\n  ModifiedBy: string\r\n  ParticipationID: number\r\n  Link: string\r\n  // Not Used: ParticipantNotificationDetails: any[]\r\n  IsUser: boolean\r\n  NotificationEventIDs: number[]\r\n  NotificationServiceIDs: number[]\r\n  NotificationMethodIDs: number[]\r\n  IsNotificationEnabled: boolean\r\n  isCollectorActive: boolean\r\n  timeZoneID: number\r\n  Inactive: boolean\r\n  AccountID: number\r\n  LocationID: number\r\n}\r\n\r\nexport default function UserNotificationInfoUpdate(params: UpdateUserDetailParams) {\r\n  const requestBody = JSON.stringify({\r\n    ApplicationUserID: params.ApplicationUserID,\r\n    EmailAddressList: params.EmailAddressList.map((item) => ({\r\n      EmailAddress: item.ContactDetail,\r\n      isActive: item.Active,\r\n      DeliveryType: \"EMAIL\",\r\n    })),\r\n    FirstName: params.FirstName,\r\n    IsNotificationEnabled: params.IsNotificationEnabled,\r\n    IsUser: params.IsUser,\r\n    LastName: params.LastName,\r\n    Link: params.Link,\r\n    ModifiedBy: params.ModifiedBy,\r\n    NotificationEventIDs: params.NotificationEventIDs,\r\n    NotificationServiceIDs: params.NotificationServiceIDs,\r\n    NotificationMethodIDs: params.NotificationMethodIDs,\r\n    ParticipationID: params.ParticipationID,\r\n    PhoneNumberList: params.PhoneNumberList.map((item) => ({\r\n      PhoneNumber: item.ContactDetail,\r\n      isActive: item.Active,\r\n      DeliveryType: item.DeliveryType,\r\n    })),\r\n    RoleList: params.RoleList.map((item) => ({\r\n      RoleID: item.RoleID,\r\n      RoleTitle: item.Title,\r\n      IsActive: item.Active,\r\n      Locations: item.Locations,\r\n    })),\r\n    UserName: params.UserName,\r\n    timeZoneID: params.timeZoneID,\r\n    isCollectorActive: params.isCollectorActive,\r\n    Inactive: params.Inactive,\r\n  })\r\n\r\n  return ObservableFromFetch<string>(\"FFOrderUserFileMaintenance/UpdateUserNotification\", requestBody)\r\n}\r\n","import { UpdateUserDetailParams } from \"./UserNotificationInfoUpdate\"\r\nimport { ObservableFromFetch } from \"../ObservableFromFetch\"\r\n\r\nexport default function CreateUser(params: UpdateUserDetailParams) {\r\n  const requestBody = JSON.stringify({\r\n    // ApplicationUserID: params.ApplicationUserID,\r\n    EmailAddressList: params.EmailAddressList.map((item) => ({\r\n      EmailAddress: item.ContactDetail,\r\n      isActive: item.Active,\r\n      DeliveryType: \"EMAIL\",\r\n    })),\r\n    FirstName: params.FirstName,\r\n    IsNotificationEnabled: params.IsNotificationEnabled,\r\n    // IsUser: params.IsUser,\r\n    LastName: params.LastName,\r\n    Link: window.location.hostname,\r\n    // ModifiedBy: params.ModifiedBy,\r\n    NotificationEventIDs: params.NotificationEventIDs,\r\n    NotificationServiceIDs: params.NotificationServiceIDs,\r\n    NotificationMethodIDs: params.NotificationMethodIDs,\r\n    ParticipationID: params.ParticipationID,\r\n    PhoneNumberList: params.PhoneNumberList.map((item) => ({\r\n      PhoneNumber: item.ContactDetail,\r\n      isActive: item.Active,\r\n      DeliveryType: item.DeliveryType,\r\n    })),\r\n    RoleList: params.RoleList.map((item) => ({ RoleID: item.RoleID, RoleTitle: item.Title, IsActive: item.Active })),\r\n    UserName: params.UserName,\r\n    timeZoneID: params.timeZoneID,\r\n    isCollectorActive: params.isCollectorActive,\r\n    AccountID: params.AccountID,\r\n    LocationID: params.LocationID,\r\n    Inactive: params.Inactive,\r\n  })\r\n\r\n  return ObservableFromFetch<string>(\"FFOrderUserFileMaintenance/CreateUser\", requestBody)\r\n}\r\n","import { ObservableFromFetch } from \"../ObservableFromFetch\"\r\n\r\nexport default function UserRevoke(applicationUserId: number) {\r\n  const requestBody: string = new URLSearchParams({\r\n    applicationUserId: applicationUserId.toString()\r\n  }).toString()\r\n\r\n  return ObservableFromFetch<string>(\"FFOrderUserFileMaintenance/RevokeUser?\" + requestBody)\r\n}","import { ObservableFromFetch } from \"../ObservableFromFetch\"\r\n\r\nexport default function RoleOrderSecurityCheckObservable(roleID: number) {\r\n  return ObservableFromFetch<boolean>(`FFOrderRoleOrderSecurity/CheckRoleOrderSecurity?roleID=${roleID}`)\r\n}\r\n","import { Spinner } from \"react-bootstrap\"\r\n\r\nimport NotificationSectionData from \"../../../api/Notifications/Model/NotificationOptionsData\"\r\nimport ToggleSwitch from \"../../FormattedInputs/ToggleSwitch\"\r\n\r\ninterface NotificationOptionsProps {\r\n  description: string\r\n  items: NotificationSectionData[]\r\n  selectedIDs: number[]\r\n  loading?: boolean\r\n  onChange: (itemId: number, checked: boolean) => void\r\n}\r\n\r\nfunction NotificationOptions(props: NotificationOptionsProps) {\r\n  const { description, items, selectedIDs, loading, onChange } = props\r\n\r\n  return (\r\n    <div className=\"w-50\">\r\n      <h4 className=\"mt-2\">\r\n        {description}&nbsp;{loading && <Spinner animation=\"border\" variant=\"secondary\" size=\"sm\" className=\"mb-1\" />}\r\n      </h4>\r\n      <table className=\"table table-sm\">\r\n        <tbody>\r\n          {!loading &&\r\n            items?.map((event) => (\r\n              <tr key={event.Id}>\r\n                <td className=\"align-middle\">{event.Description}</td>\r\n                <td className=\"pb-1 pt-2 text-right\">\r\n                  <ToggleSwitch\r\n                    on=\"Yes\"\r\n                    off=\"No\"\r\n                    className=\"mb-0\"\r\n                    checked={selectedIDs.includes(event.Id)}\r\n                    onCheck={(checked) => onChange(event.Id, checked)}\r\n                  />\r\n                </td>\r\n              </tr>\r\n            ))}\r\n          {!loading && items?.length === 0 && (\r\n            <tr>\r\n              <td colSpan={2} className=\"text-muted\">\r\n                No available options found.\r\n              </td>\r\n            </tr>\r\n          )}\r\n        </tbody>\r\n      </table>\r\n    </div>\r\n  )\r\n}\r\n\r\nNotificationOptions.defaultProps = {\r\n  loading: false,\r\n}\r\n\r\nexport default NotificationOptions\r\n","import { useEffect, useState } from \"react\"\r\n\r\nimport { toast } from \"react-toastify\"\r\nimport { finalize } from \"rxjs/operators\"\r\n\r\nimport NotificationOptions from \"./NotificationOptions\"\r\nimport NotificationOptionsData from \"../../../api/Notifications/Model/NotificationOptionsData\"\r\nimport NotificationSectionProps from \"../../../api/Notifications/Model/NotificationSectionProps\"\r\nimport { NotificationEventsGet } from \"../../../api/Notifications/NotificationDetailGet\"\r\nimport FormatError from \"../../../formatters/FormatError\"\r\n\r\ninterface NotificationEventSelectionProps extends NotificationSectionProps {\r\n  canViewOrderTrackingGrid?: boolean\r\n}\r\n\r\nfunction NotificationEventSelection(props: NotificationEventSelectionProps) {\r\n  const { selectedIDs, canViewOrderTrackingGrid, onChange } = props\r\n\r\n  const [loading, setLoading] = useState(false)\r\n  const [notificationEvents, setNotificationEvents] = useState<NotificationOptionsData[]>([])\r\n\r\n  useEffect(() => {\r\n    setLoading(true)\r\n    const subscription = NotificationEventsGet()\r\n      .pipe(finalize(() => setLoading(false)))\r\n      .subscribe(\r\n        (data) => {\r\n          setNotificationEvents(\r\n            data\r\n              .filter((event) => !(!canViewOrderTrackingGrid && event.Title === \"MRO_RES\"))\r\n              .map((event) => ({ Id: event.NotificationEventID, Code: event.Title, Description: event.Description }))\r\n          )\r\n        },\r\n        (error) => toast.error(FormatError(error))\r\n      )\r\n    return () => subscription?.unsubscribe()\r\n  }, [canViewOrderTrackingGrid])\r\n\r\n  return (\r\n    <NotificationOptions\r\n      items={notificationEvents}\r\n      selectedIDs={selectedIDs}\r\n      loading={loading}\r\n      onChange={onChange}\r\n      description=\"Status Updates\"\r\n    />\r\n  )\r\n}\r\n\r\nNotificationEventSelection.defaultProps = {\r\n  canViewOrderTrackingGrid: false,\r\n}\r\n\r\nexport default NotificationEventSelection\r\n","import { ObservableFromFetch } from \"../ObservableFromFetch\"\r\nimport NotificationDetails from \"./Model/NotificationDetails\"\r\nimport NotificationEvent from \"./Model/NotificationEvent\"\r\nimport NotificationMethod from \"./Model/NotificationMethod\"\r\nimport NotificationAccountService from \"./Model/NotificationAccountService\"\r\n\r\nexport default function NotificationDetailGet() {\r\n  return ObservableFromFetch<NotificationDetails>(\"FFOrderClinicStatus/GetNotificationDetail\")\r\n}\r\n\r\nexport function NotificationServicesGet(participationId?: number) {\r\n  const params = JSON.stringify({\r\n    ParticipationId: participationId\r\n  })\r\n  return ObservableFromFetch<NotificationAccountService[]>(\"WorkforceNotification/GetNotificationServices\", params)\r\n}\r\n\r\nexport function NotificationEventsGet() {\r\n  return ObservableFromFetch<NotificationEvent[]>(\"WorkforceNotification/GetNotificationEvents\")\r\n}\r\n\r\nexport function NotificationMethodsGet() {\r\n  return ObservableFromFetch<NotificationMethod[]>(\"WorkforceNotification/GetNotificationMethods\")\r\n}\r\n","import { useEffect, useState } from \"react\"\r\n\r\nimport { toast } from \"react-toastify\"\r\nimport { finalize } from \"rxjs/operators\"\r\n\r\nimport NotificationOptions from \"./NotificationOptions\"\r\nimport NotificationOptionsData from \"../../../api/Notifications/Model/NotificationOptionsData\"\r\nimport NotificationSectionProps from \"../../../api/Notifications/Model/NotificationSectionProps\"\r\nimport { NotificationMethodsGet } from \"../../../api/Notifications/NotificationDetailGet\"\r\nimport FormatError from \"../../../formatters/FormatError\"\r\n\r\nfunction NotificationMethodSelection(props: NotificationSectionProps) {\r\n  const { selectedIDs, onChange } = props\r\n\r\n  const [loading, setLoading] = useState(false)\r\n  const [notificationMethods, setNotificationMethods] = useState<NotificationOptionsData[]>([])\r\n\r\n  useEffect(() => {\r\n    setLoading(true)\r\n    const subscription = NotificationMethodsGet()\r\n      .pipe(finalize(() => setLoading(false)))\r\n      .subscribe(\r\n        (data) => {\r\n          setNotificationMethods(\r\n            data.map((method) => ({\r\n              Id: method.NotificationMethodID,\r\n              Code: method.Code,\r\n              Description: method.Description,\r\n            }))\r\n          )\r\n        },\r\n        (error) => toast.error(FormatError(error))\r\n      )\r\n    return () => subscription?.unsubscribe()\r\n  }, [])\r\n\r\n  return (\r\n    <NotificationOptions\r\n      items={notificationMethods}\r\n      selectedIDs={selectedIDs}\r\n      loading={loading}\r\n      onChange={onChange}\r\n      description=\"How would you like to be notified?\"\r\n    />\r\n  )\r\n}\r\n\r\nexport default NotificationMethodSelection\r\n","import { useEffect, useState } from \"react\"\r\n\r\nimport { toast } from \"react-toastify\"\r\nimport { finalize } from \"rxjs/operators\"\r\n\r\nimport NotificationOptions from \"./NotificationOptions\"\r\nimport NotificationOptionsData from \"../../../api/Notifications/Model/NotificationOptionsData\"\r\nimport NotificationSectionProps from \"../../../api/Notifications/Model/NotificationSectionProps\"\r\nimport { NotificationServicesGet } from \"../../../api/Notifications/NotificationDetailGet\"\r\nimport FormatError from \"../../../formatters/FormatError\"\r\n\r\ninterface NotificationServiceSelectionProps extends NotificationSectionProps {\r\n  participationId?: number\r\n}\r\n\r\nfunction NotificationServiceSelection(props: NotificationServiceSelectionProps) {\r\n  const { participationId, selectedIDs, onChange } = props\r\n\r\n  const [loading, setLoading] = useState(false)\r\n  const [notificationServices, setNotificationServices] = useState<NotificationOptionsData[]>([])\r\n\r\n  useEffect(() => {\r\n    setLoading(true)\r\n    const subscription = NotificationServicesGet(participationId)\r\n      .pipe(finalize(() => setLoading(false)))\r\n      .subscribe(\r\n        (data) =>\r\n          setNotificationServices(\r\n            data.map((method) => ({\r\n              Id: method.ServiceID,\r\n              Code: method.ServiceCode,\r\n              Description: method.ServiceDescription,\r\n            }))\r\n          ),\r\n        (error) => toast.error(FormatError(error))\r\n      )\r\n    return () => subscription?.unsubscribe()\r\n  }, [participationId])\r\n\r\n  return (\r\n    <NotificationOptions\r\n      items={notificationServices}\r\n      selectedIDs={selectedIDs}\r\n      loading={loading}\r\n      onChange={onChange}\r\n      description=\"Services\"\r\n    />\r\n  )\r\n}\r\n\r\nNotificationServiceSelection.defaultProps = {\r\n  participationId: undefined,\r\n}\r\n\r\nexport default NotificationServiceSelection\r\n","import { Col, Row } from \"react-bootstrap\"\r\n\r\nimport NotificationEventSelection from \"./NotificationEventSelection\"\r\nimport NotificationMethodSelection from \"./NotificationMethodSelection\"\r\nimport NotificationServiceSelection from \"./NotificationServiceSelection\"\r\nimport NotificationSettings from \"../../../api/Notifications/Model/NotificationSettings\"\r\nimport ToggleSwitch from \"../../FormattedInputs/ToggleSwitch\"\r\n\r\ninterface NotificationsSelectionProps extends NotificationSettings {\r\n  participationId?: number\r\n  canViewOrderTrackingGrid?: boolean\r\n  onCheckNotificationService: (notificationServiceId: number, value: boolean) => void\r\n  onCheckNotificationEvent: (notificationEventId: number, value: boolean) => void\r\n  onCheckNotificationMethod: (notificationMethodId: number, value: boolean) => void\r\n  onCheckShowNotifications: (value: boolean) => void\r\n}\r\n\r\nfunction NotificationSelection(props: NotificationsSelectionProps) {\r\n  const {\r\n    participationId,\r\n    showNotifications,\r\n    canViewOrderTrackingGrid,\r\n    checkedNotificationServiceIDs,\r\n    checkedNotificationEventIDs,\r\n    checkedNotificationMethodIDs,\r\n    onCheckNotificationService,\r\n    onCheckNotificationEvent,\r\n    onCheckNotificationMethod,\r\n    onCheckShowNotifications,\r\n  } = props\r\n\r\n  return (\r\n    <>\r\n      <Row>\r\n        <Col className=\"pb-2\">\r\n          <p className=\"mb-0\">\r\n            Should we notify you about services and events?\r\n            <ToggleSwitch\r\n              className=\"ml-2\"\r\n              on=\"Yes\"\r\n              off=\"No\"\r\n              checked={showNotifications}\r\n              onCheck={onCheckShowNotifications}\r\n            />\r\n          </p>\r\n          <em className=\"small\">\r\n            Note: Your ability to receive a notification will depend on your access level. Contact your Administrator if\r\n            you have questions about your access level.\r\n          </em>\r\n        </Col>\r\n      </Row>\r\n      {showNotifications && (\r\n        <>\r\n          <Row>\r\n            <Col>\r\n              <NotificationServiceSelection\r\n                participationId={participationId}\r\n                selectedIDs={checkedNotificationServiceIDs}\r\n                onChange={onCheckNotificationService}\r\n              />\r\n            </Col>\r\n          </Row>\r\n          <Row>\r\n            <Col>\r\n              <NotificationEventSelection\r\n                selectedIDs={checkedNotificationEventIDs}\r\n                canViewOrderTrackingGrid={canViewOrderTrackingGrid}\r\n                onChange={onCheckNotificationEvent}\r\n              />\r\n            </Col>\r\n          </Row>\r\n          <Row>\r\n            <Col>\r\n              <NotificationMethodSelection\r\n                selectedIDs={checkedNotificationMethodIDs}\r\n                onChange={onCheckNotificationMethod}\r\n              />\r\n            </Col>\r\n          </Row>\r\n        </>\r\n      )}\r\n    </>\r\n  )\r\n}\r\n\r\nNotificationSelection.defaultProps = {\r\n  canViewOrderTrackingGrid: false,\r\n  participationId: undefined,\r\n}\r\n\r\nexport default NotificationSelection\r\n","import React, { Component } from \"react\"\r\nimport { Modal, Row, Col, Button, Form } from \"react-bootstrap\"\r\nimport { FaPlus, FaMinus } from \"react-icons/fa\"\r\nimport { toast } from \"react-toastify\"\r\nimport { EmailRegexp, PhoneRegexp } from \"../../config/Constants\"\r\nimport Checkbox from \"../Checkbox\"\r\nimport AssociatedData from \"../../api/Administration/Model/AssociatedData\"\r\nimport PhoneNumberMaskedInput from \"../FormattedInputs/PhoneNumberMaskedInput\"\r\nimport FormatPhone from \"../../formatters/FormatPhone\"\r\nimport ConfirmationModal from \"../ConfirmationModal\"\r\n\r\nexport const EmptyAssociatedData: AssociatedData = {\r\n  Active: false,\r\n  ApplicationUserID: 0,\r\n  ContactDetail: \"\",\r\n  CreatedBy: \"\",\r\n  CreatedOn: \"\",\r\n  DeliveryType: \"\",\r\n  ModifiedBy: \"\",\r\n  ModifiedOn: \"\",\r\n  saved: false,\r\n  hidden: false\r\n}\r\n\r\nexport enum AssociatedDataType {\r\n  Email = \"EMAIL\",\r\n  Phone = \"PHONE\"\r\n}\r\n\r\nexport enum DeliveryType {\r\n  Text = \"TEXT\"\r\n}\r\n\r\ninterface AdditionalAssociatedDataModalProps {\r\n  show: boolean\r\n  type: AssociatedDataType\r\n  data: AssociatedData[]\r\n  onClose: () => void\r\n  onSave: (data: AssociatedData[]) => void\r\n}\r\n\r\ninterface AdditionalAssociatedDataModalState {\r\n  open: boolean\r\n  showInactive: boolean\r\n  data: AssociatedData[]\r\n  isValid: boolean\r\n  onlyOneCanBeActive: boolean\r\n  showConfirmText: boolean\r\n  selectedIndex: number\r\n}\r\n\r\nconst isEmailValid = (value: string) => EmailRegexp.test(value)\r\nconst isPhoneValid = (value: string) => PhoneRegexp.test(value)\r\n\r\nexport default class AdditionalAssociatedDataModal extends Component<AdditionalAssociatedDataModalProps, AdditionalAssociatedDataModalState> {\r\n  state: AdditionalAssociatedDataModalState = { \r\n    open: this.props.show, \r\n    showInactive: false, \r\n    data: [{ ...EmptyAssociatedData }], \r\n    isValid: true, \r\n    onlyOneCanBeActive: this.props.type === AssociatedDataType.Phone, \r\n    showConfirmText: false, \r\n    selectedIndex: -1 \r\n  }\r\n\r\n  componentDidUpdate(prevProps: AdditionalAssociatedDataModalProps) {\r\n    if (this.props.show !== prevProps.show) {\r\n      this.setState({ open: this.props.show, showInactive: false })\r\n    }\r\n    if (this.props.data !== prevProps.data) {\r\n      this.setState({ data: [...this.props.data.map(item => ({...item, prevValue: item.ContactDetail})), { ...this.emptyAssociatedData() }] })\r\n    }\r\n  }\r\n\r\n  emptyAssociatedData = () : AssociatedData => this.props.type === AssociatedDataType.Phone ? { ...EmptyAssociatedData, DeliveryType: DeliveryType.Text } : { ...EmptyAssociatedData }\r\n\r\n  isValid = () => {\r\n    const { data } = this.state\r\n    const hasActive = data.filter(item => item.ContactDetail !== \"\").some(item => item.Active)\r\n    const isUniq = Array.from(new Set(data.filter(item => !item.hidden).map(item => item.ContactDetail.toLowerCase()))).length === data.filter(item => !item.hidden).length\r\n    if (!hasActive) {\r\n      toast.error(`Please select at least one active ${this.props.type === AssociatedDataType.Email ? \"email address\" : \"phone number\"}`)\r\n    }\r\n    if (!isUniq) {\r\n      toast.error(`Duplicate ${this.props.type === AssociatedDataType.Email ? \"email address\" : \"phone number\"} found`)\r\n    }\r\n    return hasActive && isUniq\r\n  }\r\n\r\n  handleClose = () => {\r\n    const itemsOnInit = this.state.data.filter(data => data.ApplicationUserID > 0 || data.saved)\r\n    this.resetAttributes(itemsOnInit)\r\n    this.setState({ open: false, data: [...itemsOnInit, { ...this.emptyAssociatedData() }], selectedIndex: -1 })\r\n    this.props.onClose()\r\n  }\r\n\r\n  resetAttributes = (items: AssociatedData[]) => {\r\n    items.forEach(item => {\r\n      item.hidden = false\r\n      const relatedItem = this.props.data.find(el => el.ContactDetail === item.prevValue)\r\n      if (relatedItem) {\r\n        item.Active = relatedItem.Active\r\n        item.DeliveryType = relatedItem.DeliveryType\r\n        item.ContactDetail = relatedItem.ContactDetail\r\n      }\r\n    })\r\n  }\r\n\r\n  deactivateItems = (items: AssociatedData[], activeIndex: number) => {\r\n    for (let i = 0; i < items.length; i++) {\r\n      if (i != activeIndex) {\r\n        items[i].Active = false\r\n      }\r\n    }\r\n  }\r\n\r\n  handleSave = () => {\r\n    if (this.isValid()) {\r\n      var itemsToValidate = this.state.data.filter(data => data.ContactDetail !== \"\" && !data.hidden && !data.saved && data.ApplicationUserID === 0)\r\n      if(this.isNeedConfirmText(itemsToValidate)){\r\n        this.setState({showConfirmText:true});\r\n        return;\r\n      }\r\n      this.saveData();\r\n    }\r\n  }\r\n  saveData = () => {\r\n    var itemsToSave = this.state.data.filter(data => data.ContactDetail !== \"\" && !data.hidden)\r\n    itemsToSave.forEach(data => data.saved = true)\r\n    this.setState({ open: false, data: [...itemsToSave, { ...this.emptyAssociatedData() }], selectedIndex: -1   })\r\n    this.props.onSave(itemsToSave)\r\n\r\n  }\r\n\r\n  canAddEmail = (email: string): boolean => email.length > 0 && isEmailValid(email)\r\n  canAddMobile = (mobile: string): boolean => mobile.length > 0 && isPhoneValid(mobile)\r\n  addRow = (index: number) => this.setState({ data: [...this.state.data, { ...this.emptyAssociatedData() }] })\r\n  removeRow = (removedData: AssociatedData, index: number) => {\r\n    removedData.hidden = true\r\n    this.setState({ data: [...this.state.data] })\r\n  }\r\n  canAddRow = (data: AssociatedData) => !!data.DeliveryType.length && (this.props.type === AssociatedDataType.Email ? this.canAddEmail(data.ContactDetail) : this.canAddMobile(FormatPhone(data.ContactDetail)))\r\n  validData = (data: AssociatedData) => !data.ContactDetail.length || this.canAddRow(data)\r\n\r\n  changeContactDetail = (value: string, index: number) => {\r\n    const newData = [...this.state.data]\r\n    newData[index].ContactDetail = this.props.type === AssociatedDataType.Email ? value : value.replace(/\\D/g, \"\")\r\n    if (this.props.type === AssociatedDataType.Email) { newData[index].DeliveryType = this.props.type }\r\n    this.setState({ data: newData, isValid: this.validData(newData[index]) })\r\n  }\r\n\r\n  toggleActive = (index: number) => {\r\n    const newData = [...this.state.data]\r\n    newData[index].Active = !newData[index].Active\r\n    if (this.state.onlyOneCanBeActive && newData[index].Active) {\r\n      this.deactivateItems(newData, index)\r\n    }\r\n    this.setState({ data: newData, isValid: this.validData(newData[index]), selectedIndex: index  })\r\n  }\r\n  \r\n  toggleTextVoiceOption = (index: number, value: \"TEXT\" | \"VOICE\") => {\r\n    if(value === \"TEXT\"){\r\n      //this.setState({selectedIndex: index, showConfirmText:true});\r\n      //return;\r\n    }\r\n    this.setTextVoiceOption(index, value);\r\n  }\r\n  textConfirmed = () => {\r\n    this.setState({showConfirmText:false});\r\n    this.saveData();\r\n  }\r\n  textNotConfirmed = () => {\r\n    this.setState({showConfirmText:false});\r\n  }\r\n  setTextVoiceOption = (index: number, value: \"TEXT\" | \"VOICE\") => {\r\n    const newData = [...this.state.data]\r\n    newData[index].DeliveryType = value\r\n    this.setState({ data: newData, isValid: this.validData(newData[index]), selectedIndex: index })\r\n  }\r\n\r\n  isNeedConfirmText = (items: AssociatedData[]) => {\r\n    if (this.props.type != AssociatedDataType.Phone) {\r\n      return false;\r\n    }\r\n    for (let i = 0; i < items.length; i++) {\r\n      if (items[i].Active && items[i].DeliveryType === \"TEXT\") {\r\n        return true;\r\n      }\r\n    }\r\n    return false;\r\n  }\r\n\r\n  DataRow = (data: AssociatedData, index: number, editable: boolean, verified: boolean = false) => {\r\n    if (data.hidden) {\r\n      return <></>\r\n    }\r\n    return (\r\n      <Row key={index} className=\"my-2\" >\r\n        <Col md={this.props.type === AssociatedDataType.Email ? 2 : 1}>{ this.props.type === AssociatedDataType.Email ? \"Email Address\" : \"Phone\" }</Col>\r\n        <Col md={7}>\r\n          { this.props.type === AssociatedDataType.Email && <Form.Control size=\"sm\" type=\"text\" value={data.ContactDetail} onChange={e => this.changeContactDetail(e.target.value, index)} className=\"rounded-pill\" disabled={!editable} /> }\r\n          { this.props.type === AssociatedDataType.Phone && <PhoneNumberMaskedInput size=\"sm\" value={data.ContactDetail} onChange={e => this.changeContactDetail(e, index)} isInvalid={false} className=\"rounded-pill\" disabled={!editable} /> }\r\n        </Col>\r\n        <Col md={1} className=\"px-0\"><Checkbox id={`${verified ? \"verified\" : \"new\"}Active${index}`} label=\"Active\" checked={data.Active} onChange={(e: React.ChangeEvent<HTMLInputElement>) => this.toggleActive(index)} /></Col>\r\n        { this.props.type === AssociatedDataType.Phone && \r\n        <Col md={1} style={{paddingTop: \"2px\"}}>\r\n          <Form.Check \r\n          type=\"radio\" \r\n          inline \r\n          id={`${editable ? \"new\" : \"existing\"}TextOption${index}`} \r\n          label=\"Text\" \r\n          name={`${editable ? \"new\" : \"existing\"}TextVoiceOption${index}`} \r\n          checked={data.DeliveryType === \"TEXT\"} \r\n          onChange={(e: React.ChangeEvent<HTMLInputElement>) => this.toggleTextVoiceOption(index, \"TEXT\")} \r\n          className=\"abc-radio abc-radio-primary\" />\r\n          </Col> }\r\n        { this.props.type === AssociatedDataType.Phone && \r\n        <Col md={1} style={{paddingTop: \"2px\"}}>\r\n          <Form.Check \r\n          type=\"radio\" \r\n          inline id={`${editable ? \"new\" : \"existing\"}VoiceOption${index}`} \r\n          label=\"Voice\" name={`${editable ? \"new\" : \"existing\"}TextVoiceOption${index}`} \r\n          checked={data.DeliveryType === \"VOICE\"} \r\n          onChange={(e: React.ChangeEvent<HTMLInputElement>) => this.toggleTextVoiceOption(index, \"VOICE\")} \r\n          className=\"abc-radio abc-radio-primary\" />\r\n          </Col> }\r\n        <Col>\r\n          { editable && ((this.state.data.length === index + 1) ?\r\n          <Button variant=\"primary\" className=\"btn-sm btn-sm-icon\" onClick={ () => this.addRow(index) } disabled={ !this.canAddRow(data) }><FaPlus /></Button> :\r\n          <Button variant=\"primary\" className=\"btn-sm btn-sm-icon\" onClick={ () => this.removeRow(data, index) }><FaMinus /></Button>) }\r\n        </Col>\r\n      </Row>\r\n    )\r\n  }\r\n\r\n  render = () => {\r\n    if (!this.state.open || !this.state.data.length) {\r\n      return <></>\r\n    }\r\n    const { showInactive, data } = this.state\r\n    const { type } = this.props\r\n    const noInactive = !this.props.data.some(data => !data.Active)\r\n    return (\r\n      <>\r\n      <Modal show={this.state.open} onHide={() => this.handleClose()} size=\"xl\" backdrop=\"static\" dialogClassName=\"dark\">\r\n        <Modal.Header closeButton>\r\n          <Modal.Title>Enter { type === AssociatedDataType.Email ? \"Additional Email Address\" : \"Phone Number\" }</Modal.Title>\r\n        </Modal.Header>\r\n        <Modal.Body>\r\n          { !showInactive && this.props.data.map((data, index) => data.Active && !!data.CreatedOn.length && this.DataRow(this.state.data[index], index, false)) }\r\n          { !showInactive && this.state.data.map((data, index) => !data.CreatedOn.length && this.DataRow(this.state.data[index], index, true)) }\r\n          { showInactive && this.props.data.map((data, index) => !data.Active && !!data.CreatedOn.length && this.DataRow(this.state.data[index], index, false)) }\r\n          { showInactive && noInactive && <p className=\"text-center\">No Inactive { type === AssociatedDataType.Email ? \"Email Address\" : \"Phone Number\"} Found.</p> }\r\n          { showInactive && <Row className=\"mt-auto\">\r\n            <Col><strong>Note: Inactive records will be displayed after the verification.</strong></Col>\r\n          </Row> }\r\n        </Modal.Body>\r\n        <Modal.Footer>\r\n          <Checkbox id=\"toggleActive\" label={`Show Inactive ${type === AssociatedDataType.Email ? \"Email Addresses\" : \"Phone Numbers\"}`} checked={showInactive} onChange={() => this.setState({ showInactive: !this.state.showInactive })} className=\"mr-auto\" />\r\n          <Button size=\"sm\" variant=\"secondary\" onClick={() => this.handleClose()}>Cancel</Button>\r\n          <Button size=\"sm\" onClick={() => this.handleSave()} disabled={!this.state.isValid}>Confirm</Button>\r\n        </Modal.Footer>\r\n      </Modal>\r\n        <ConfirmationModal show={this.state.showConfirmText}\r\n          title=\"CONFIRM\"\r\n          textTitle=\"Be sure your phone accepts Text messaging.\"\r\n          text=\"\"\r\n          showImage={false}\r\n          onConfirm={() => this.textConfirmed()}\r\n          onHide={() => this.textNotConfirmed()} />\r\n      </>\r\n\r\n    )\r\n  }\r\n}\r\n","import React, { Component } from \"react\"\r\nimport { Form, Button, Overlay } from \"react-bootstrap\"\r\nimport { FaCaretDown, FaSearch } from \"react-icons/fa\"\r\nimport { List, ListRowProps } from \"react-virtualized\"\r\nimport Checkbox from \"./Checkbox\"\r\n\r\nexport interface Item {\r\n  label: string\r\n  value?: string\r\n  checked?: boolean\r\n}\r\n\r\nexport interface ListItem {\r\n  label: string\r\n  value: string\r\n  checked: boolean\r\n}\r\n\r\ninterface CheckboxListProps {\r\n  title: string\r\n  items: Item[]\r\n  selectedValues: string[]\r\n  onClose?: (items: string[]) => void\r\n  className: string\r\n  disabled: boolean\r\n}\r\n\r\ninterface CheckboxListState {\r\n  open: boolean\r\n  searchText: string\r\n  items: ListItem[]\r\n  filteredItems?: ListItem[]\r\n  filtered?: boolean\r\n}\r\n\r\nexport default class CheckboxList extends Component<CheckboxListProps, CheckboxListState> {\r\n  state: CheckboxListState = { \r\n    open: false,\r\n    items: this.props.items.map(i => { return {label: i.label, value: i.value || i.label, checked: !!i.checked } }),\r\n    searchText: \"\",\r\n    filteredItems: []\r\n  }\r\n  nameInput: HTMLInputElement | undefined\r\n  toggleElement = React.createRef<HTMLDivElement>()\r\n  listElement = React.createRef<List>()\r\n\r\n  componentDidMount() {\r\n    this.resetFilterItems(this.props.selectedValues)\r\n  }\r\n\r\n  componentDidUpdate(prevProps: CheckboxListProps) {\r\n    const arraysEqual = (a1: Item[], a2: Item[]): boolean => {\r\n      if (a1.length !== a2.length) {\r\n        return false\r\n      }\r\n      const a1Sorted = [...a1].filter(item => !!item).map(item => (item.value || item.label).toLowerCase()).sort()\r\n      const a2Sorted = [...a2].filter(item => !!item).map(item => (item.value || item.label).toLowerCase()).sort()\r\n      return a1Sorted.every((value, index) => value === a2Sorted[index])\r\n    }\r\n    if (this.props.disabled !== prevProps.disabled) {\r\n      this.resetFilterItems(this.props.selectedValues)\r\n    }\r\n    if (this.props.title !== prevProps.title) {\r\n      this.resetFilterItems(this.props.selectedValues)\r\n    } else {\r\n      if (!!this.props.selectedValues) {\r\n        let selectedItems = this.props.items.filter(i => this.props.selectedValues.includes(i.value || i.label)) || []\r\n        let prevSelectedItems = prevProps.items.filter(i => this.props.selectedValues.includes(i.value || i.label)) || []\r\n        if (!arraysEqual(selectedItems, prevSelectedItems) || !arraysEqual(this.props.items || [], prevProps.items || [])) {\r\n          this.resetFilterItems(this.props.selectedValues)\r\n        }\r\n      } else {\r\n        if (!arraysEqual(this.props.items, prevProps.items)) {\r\n          this.resetFilterItems(this.props.selectedValues)\r\n        }\r\n      }\r\n    }\r\n  }\r\n\r\n  resetFilterItems(checkedValues: string[]) {\r\n    const checkAll = checkedValues.length === this.props.items.length\r\n    \r\n    let items = this.props.items.map(i => { return {label: i.label, value: i.value || i.label, checked: checkedValues.includes(i.value || i.label) } })\r\n    items.unshift({label: \"(Select All)\", value: \"#ALL#\", checked: checkAll})\r\n    \r\n    this.setState({ items: items })\r\n  }\r\n\r\n  toggleDialog = () => {\r\n    this.setState({ open: !this.props.disabled && !this.state.open })\r\n  }\r\n  setData = () => {\r\n    this.props.onClose && this.props.onClose(this.state.items.filter(i => i.checked).map(i => i.value || i.label))\r\n    this.toggleDialog()\r\n  }\r\n  changeTextFilter = (value: string) => this.setState({ searchText: value })\r\n  checkboxChange = (e: React.ChangeEvent<HTMLInputElement>) => {\r\n    const value = e.target.value\r\n    const checked = e.target.checked\r\n    const index = this.state.items.findIndex(item => String(item.value) === value)\r\n    if (index === 0) {\r\n      this.setState(prevState => {\r\n        let newItems = [...prevState.items]\r\n        newItems.map(item => item.checked = checked)\r\n        return { items: newItems }\r\n      })\r\n    } else {\r\n      this.setState(prevState => {\r\n        const newItems = [...prevState.items]\r\n        newItems[index].checked = checked\r\n        newItems[0].checked = newItems.slice(1).every((item) => item.checked)\r\n        return { items: newItems }\r\n      })\r\n    }\r\n    this.listElement.current && this.listElement.current.forceUpdateGrid()\r\n  }\r\n\r\n  getFilteredItems = () => {\r\n    const { items, searchText } = this.state\r\n    if (searchText.length > 0) {\r\n      return items.filter(item => item.label.toString().toLowerCase().includes(searchText.toLowerCase()))\r\n    }\r\n    return items\r\n  }\r\n\r\n  rowRenderer = (props: ListRowProps) => {\r\n    const item = this.getFilteredItems()[props.index]\r\n    return (\r\n      <Checkbox className=\"pl-2\" id={item.value} label={item.label} value={item.value || item.label} key={item.value} checked={item.checked} onChange={this.checkboxChange} style={props.style} />\r\n    )\r\n  }\r\n\r\n  render() {\r\n    return (\r\n      <div className={`${this.props.className} ${this.props.disabled ? \"disabled\" : \"\"}`}>\r\n        <div onClick={this.toggleDialog} className=\"toggle\" ref={this.toggleElement}>\r\n          {this.props.title}\r\n          <FaCaretDown  />\r\n        </div>\r\n        <Overlay container={this.toggleElement} target={this.toggleElement.current} show={this.state.open} placement=\"bottom-start\" rootClose onHide={this.toggleDialog} popperConfig={{modifiers:[{name:\"offset\", options:{offset:[-13, 12]}}]}}>\r\n          <div id=\"list\" className=\"filter-section\">\r\n            <div className=\"search-box\">\r\n              <Form.Control autoFocus tabIndex={0} type=\"text\" size=\"sm\" placeholder=\"Search\" value={this.state.searchText} onChange={(e) => this.changeTextFilter(e.target.value)} ref={(input: HTMLInputElement) => input && input.focus()} />\r\n              <FaSearch />\r\n              <div className=\"search-box-items\">\r\n                <List ref={this.listElement} width={300} height={100} rowCount={this.getFilteredItems().length} rowHeight={20} rowRenderer={this.rowRenderer} />\r\n              </div>\r\n              <div className=\"pt-1\">\r\n                  <Button size=\"sm\" variant=\"secondary\" className=\"float-right ml-1\" onClick={this.toggleDialog}>CANCEL</Button>\r\n                  <Button size=\"sm\" variant=\"secondary\" className=\"float-right\" disabled={this.state.items.every((item) => !item.checked)} onClick={this.setData}>OK</Button>\r\n                </div>\r\n            </div>\r\n          </div>\r\n        </Overlay>\r\n      </div>\r\n    )\r\n  }\r\n\r\n  static defaultProps = { selectedValues: [], className: \"checkbox-list\", disabled: false }\r\n}\r\n","import { Component } from \"react\"\r\nimport { Modal, Button, Form, Table, Spinner } from \"react-bootstrap\"\r\nimport { Subscription } from \"rxjs\"\r\nimport RoleData from \"../../api/Administration/Model/RoleData\"\r\nimport { toast } from \"react-toastify\"\r\nimport GetAdditionalRoles from \"../../api/Roles/GetAdditionalRole\"\r\nimport Role from \"../../api/Roles/Model/Role\"\r\nimport Checkbox from \"../Checkbox\"\r\nimport TimeZoneData from \"../../api/Administration/Model/TimeZoneData\"\r\nimport AutoFilterLocationsGet, { GetUserLocationsAdministrators } from \"../../api/Location/AutoFilterLocationsGet\";\r\nimport AutoFilterLocation from \"../../api/Location/LocationModel/AutoFilterLocation\";\r\nimport {AppState} from \"../../AppState\";\r\nimport {GetSelectedAssignedClinic} from \"../../authentication/SelectedCompany/CompanySelectionDrivenSelectors\";\r\nimport {connect} from \"react-redux\";\r\nimport {isLocationAdmin, isPortalAdmin} from \"../../authentication/isAdminRole\";\r\nimport UserInformation from \"../../api/Administration/Model/UserInformation\";\r\nimport CheckboxList from \"../CheckboxList\"\r\n\r\ninterface AdditionalRoleModalProps {\r\n  show: boolean\r\n  data: RoleData[]\r\n  onClose: () => void\r\n  onSave: (data: RoleData[]) => void\r\n  onSaveTimeZoneId: (timeZoneId?: number) => void\r\n  timeZoneId?: number\r\n  timeZones: TimeZoneData[]\r\n  userInfo?: UserInformation\r\n}\r\n\r\ninterface AdditionalRoleModalAuthProps {\r\n  companyID: number\r\n  isPortalAdmin: boolean\r\n  isLocationAdmin: boolean\r\n}\r\n\r\ninterface AdditionalRoleModalState {\r\n  open: boolean\r\n  loading: boolean\r\n  roles: Role[]\r\n  data: RoleData[]\r\n  timeZoneId?: number\r\n  locations: AutoFilterLocation[]\r\n  selectedLocations: string[]\r\n}\r\n\r\nconst LocationAdministrator = \"Location Administrator\"\r\n\r\nexport class AdditionalRoleModal extends Component<AdditionalRoleModalProps & AdditionalRoleModalAuthProps, AdditionalRoleModalState> {\r\n  state: AdditionalRoleModalState = { open: this.props.show, loading: false, roles: [], data: [], timeZoneId: this.props.timeZoneId, locations: [], selectedLocations: [] }\r\n  subscription = new Subscription()\r\n\r\n  mapRolesToRoleData = (roles: Role[], data: RoleData[] = this.state.data): RoleData[] => roles.map(role => {\r\n    const existData = data.find((data: RoleData) => data.RoleID === role.RoleID)\r\n    if (existData) return { ...existData }\r\n    else return { RoleID: role.RoleID, Description: role.Description, Level: role.RoleID, Title: role.Title, Active: false }\r\n  })\r\n\r\n  componentDidMount() {\r\n    this.setState({ loading: true })\r\n    this.subscription.add(\r\n      GetAdditionalRoles().subscribe(\r\n      roles => this.setState({ roles: roles, data: this.mapRolesToRoleData(roles) }),\r\n      (error: string) => toast.error(error),\r\n      () => this.setState({ loading: false })\r\n    ))\r\n  }\r\n\r\n  loadLocations = () => {\r\n    if (this.props.userInfo) {\r\n      this.subscription.add(\r\n          AutoFilterLocationsGet(this.props.userInfo.CompanyID, \"\", \"\", this.props.userInfo.ImplementationID).subscribe(\r\n              data => this.setState({locations: data})\r\n          )\r\n      )\r\n\r\n      this.subscription.add(\r\n        GetUserLocationsAdministrators(this.props.userInfo.CompanyID, this.props.userInfo.ApplicationUserID).subscribe(\r\n          (data: string[]) => {\r\n            this.setState({selectedLocations: data})\r\n\r\n            const newData: RoleData[] = [...this.state.data]\r\n            const locationRole = newData.find(role => role.Description == LocationAdministrator)\r\n            if (locationRole) {\r\n              locationRole.Active = data.length > 0\r\n              locationRole.Locations = data\r\n              this.setState({ data: newData })\r\n            }\r\n          }\r\n        )\r\n      )\r\n    }\r\n  }\r\n\r\n  componentWillUnmount() {\r\n    this.subscription && this.subscription.unsubscribe()\r\n  }\r\n\r\n  componentDidUpdate(prevProps: AdditionalRoleModalProps) {\r\n    if (this.props.show !== prevProps.show) {\r\n      this.setState({ open: this.props.show })\r\n    }\r\n    if (this.props.timeZoneId !== prevProps.timeZoneId) {\r\n      this.setState({ timeZoneId: this.props.timeZoneId })\r\n    }\r\n\r\n    if (this.props.data !== prevProps.data) {\r\n      this.setState({ data: this.mapRolesToRoleData(this.state.roles, this.props.data) })\r\n    }\r\n\r\n    if (this.props.userInfo?.ApplicationUserID !== prevProps.userInfo?.ApplicationUserID) {\r\n      this.loadLocations()\r\n    }\r\n  }\r\n\r\n  handleClose = () => {\r\n    this.setState({ open: false, data: this.mapRolesToRoleData(this.state.roles, this.props.data) })\r\n    this.props.onClose()\r\n  }\r\n\r\n  handleCloseLocations = (items: string[]) => {\r\n    const newData: RoleData[] = [...this.state.data]\r\n    const locationRole = newData.find(role => role.Description == LocationAdministrator)\r\n    if (locationRole) {\r\n      locationRole.Active = items.length > 0\r\n      locationRole.Locations = items\r\n    }\r\n    this.setState({data: newData, selectedLocations: items})\r\n  }\r\n\r\n  handleSave = () => {\r\n    const data: RoleData[] = this.state.data\r\n    if (data.every(item => !item.Active)) {\r\n      toast.error(\"Please select at least one active role\")\r\n      return\r\n    }\r\n    data.forEach(i => { if (i.Title == LocationAdministrator && i.Active) { i.Locations = this.state.selectedLocations } })\r\n\r\n    this.props.onSaveTimeZoneId(this.state.timeZoneId == 0 ? this.props.timeZones[0].TimeZoneID : this.state.timeZoneId)\r\n    this.props.onSave(data)\r\n  }\r\n\r\n  handleTimeZoneChange = (event: React.ChangeEvent<HTMLSelectElement>) => {\r\n    this.setState({ timeZoneId: parseInt(event.target.value) })\r\n  }\r\n\r\n  toggleActive = (roleID: number) => {\r\n    const newData: RoleData[] = [...this.state.data]\r\n    const updatedRole = newData.find(role => role.RoleID === roleID)\r\n    if (updatedRole) {\r\n      updatedRole.Active = !updatedRole.Active\r\n      this.setState({ data: newData })\r\n    }\r\n  }\r\n\r\n  DataRow = (role: Role, index: number) => {\r\n    const data: RoleData[] = this.state.data\r\n    const item = data.find((data: RoleData) => data.RoleID === role.RoleID)\r\n    const checked = item?.Active\r\n    return <tr key={role.RoleID}>\r\n      <td className=\"align-middle\">{role.Title}</td>\r\n      <td className=\"align-middle\" ><Checkbox id={`toggleActive${role.RoleID}`} label=\"Active\" checked={checked} onChange={() => this.toggleActive(role.RoleID)} className=\"mr-auto\" /></td>\r\n      <td className=\"text-left align-middle\">\r\n        {role.Description === 'Collector' && <>\r\n          <Form.Label className=\"col-form-label\">Timezone</Form.Label>&nbsp;\r\n          <Form.Control style={{ width: \"40%\", display: \"inline\" }} onChange={this.handleTimeZoneChange} value={this.state.timeZoneId?.toString()} className=\"col-form-label\" id=\"timeZones\" as=\"select\" disabled={!item?.Active}>\r\n            {this.props.timeZones.map(tz => <option value={tz.TimeZoneID} key={tz.TimeZoneID}>{tz.Abbreviation}</option>)}\r\n          </Form.Control>\r\n        </>\r\n        }\r\n        {!this.props.isLocationAdmin && role.Description === LocationAdministrator &&\r\n          <CheckboxList\r\n            title='Locations'\r\n            items={this.state.locations.map(i => { return { label: i.Name, value: i.AccountID?.toString() }})}\r\n            selectedValues={this.state.selectedLocations.map(i => i.toString())}\r\n            onClose={items => this.handleCloseLocations(items)}\r\n            disabled={!checked}\r\n          />\r\n        }\r\n      </td>\r\n    </tr>\r\n  }\r\n\r\n  render = () => {\r\n    if (!this.state.open) {\r\n      return <></>\r\n    }\r\n    const roles: Role[] = this.state.roles\r\n\r\n    return (\r\n      <Modal show={this.state.open} onHide={this.handleClose} size=\"xl\" backdrop=\"static\" dialogClassName=\"dark\">\r\n        <Modal.Header closeButton>\r\n          <Modal.Title>Enter Additional Roles</Modal.Title>\r\n        </Modal.Header>\r\n        <Modal.Body>\r\n          <Table bordered responsive className=\"dark text-center\">\r\n            <thead><tr><th className=\"w-50\">Role</th><th className=\"w-40\">Status</th><th className=\"w-20\">&nbsp;</th></tr></thead>\r\n            <tbody>{this.state.loading ? <tr><td colSpan={2}><Spinner animation=\"border\" size=\"sm\" /></td></tr> :\r\n              roles.map((role, index) => this.DataRow(role, index))}</tbody>\r\n          </Table>\r\n        </Modal.Body>\r\n        <Modal.Footer>\r\n          <Button variant=\"secondary\" onClick={this.handleClose}>Cancel</Button>\r\n          <Button onClick={this.handleSave}>Confirm</Button>\r\n        </Modal.Footer>\r\n      </Modal>\r\n    )\r\n  }\r\n}\r\n\r\nfunction mapStateToProps(state: AppState): AdditionalRoleModalAuthProps {\r\n  const selectedCompany =  GetSelectedAssignedClinic(state)\r\n  return {\r\n    companyID: selectedCompany?.AccountID || 0,\r\n    isPortalAdmin: isPortalAdmin(state),\r\n    isLocationAdmin: isLocationAdmin(state)\r\n  }\r\n}\r\nexport default connect(mapStateToProps)(AdditionalRoleModal)","import { ObservableFromFetch } from \"../ObservableFromFetch\"\r\nimport Role from \"./Model/Role\"\r\n\r\nexport default function GetAdditionalRoles() {\r\n  return ObservableFromFetch<Role[]>(\"FFOrderUserInvitation/GetAdditionalRole\")\r\n}\r\n","import { ObservableFromFetch } from \"../ObservableFromFetch\"\r\nimport OrderSecurityOverrideRecord from \"./Model/OrderSecurityOverrideRecord\"\r\n\r\nexport default function OrderSecurityOverrideUpdateObservable(roleID: number, userID: string, orderSecurityException: OrderSecurityOverrideRecord[]) {\r\n  const requestBody: string = JSON.stringify({\r\n    RoleID: roleID,\r\n    MockApplicationUserIDFrom: userID,\r\n    ModifiedBy: \"\", // Kyle: MCP only and does not need to be considered\r\n    OrderSecurityException: orderSecurityException\r\n  })\r\n\r\n  return ObservableFromFetch<string>(\"FFOrderRoleOrderSecurity/SaveOrderSecurityException\", requestBody)\r\n}\r\n","import React from \"react\"\r\nimport { Modal, Form, Button, Table } from \"react-bootstrap\"\r\nimport DatePicker from \"react-datepicker\"\r\n\r\nexport interface DatePeriodItem {\r\n  id: string\r\n  name: string\r\n  from: string | null\r\n  to: string | null\r\n}\r\n\r\ninterface DatePeriodItemExt extends DatePeriodItem {\r\n  fromDate: Date | undefined\r\n  toDate: Date | undefined\r\n  valid: boolean\r\n}\r\n\r\ninterface SetDatePeriodProps {\r\n  show: boolean\r\n  items: DatePeriodItem[]\r\n  onCancel: () => void\r\n  onUpdate: (items: DatePeriodItem[]) => void\r\n}\r\n\r\n\r\ninterface SetDatePeriodState {\r\n  items: DatePeriodItemExt[]\r\n}\r\n\r\nexport default class SetDatePeriod extends React.PureComponent<SetDatePeriodProps, SetDatePeriodState> {\r\n  state: SetDatePeriodState = { items: [] }\r\n\r\n  componentDidMount() {\r\n    this.updateStateWithItems(this.props.items)\r\n  }\r\n\r\n  componentDidUpdate(prevProps: SetDatePeriodProps) {\r\n    if (this.props.show && !prevProps.show) {\r\n      this.updateStateWithItems(this.props.items)\r\n    }\r\n  }\r\n\r\n  updateStateWithItems = (items: DatePeriodItem[]) => {\r\n    const parseDate = (date: string | null): Date | undefined => !date || isNaN(Date.parse(date)) ? undefined : new Date(date)\r\n    const extItems = items.map(item => ({\r\n      ...item,\r\n      fromDate: parseDate(item.from),\r\n      toDate: parseDate(item.to),\r\n      valid: false\r\n    }))\r\n    extItems.forEach(item => this.setValidity(item))\r\n    this.setState({ items: extItems })\r\n  }\r\n\r\n  setValidity = (item: DatePeriodItemExt) => {\r\n    item.valid = (!item.fromDate && !item.toDate) || (!!item.fromDate && !!item.toDate && item.fromDate < item.toDate)\r\n  }\r\n\r\n  handleDateChange = (id: string, key: \"fromDate\" | \"toDate\", stringKey: \"from\" | \"to\", date: Date | null) => {\r\n    const { items } = this.state\r\n    const index = items.findIndex(item => item.id === id)\r\n    if (index >= 0) {\r\n      items[index] = { ...items[index], [key]: date || undefined, [stringKey]: date ? date.toISOString() : null }\r\n      this.setValidity(items[index])\r\n    }\r\n    this.setState({ items: items.map(item => ({ ...item })) })\r\n  }\r\n\r\n  render() {\r\n    const { items } = this.state\r\n    const canConfirm = items.every(item => item.valid)\r\n    return (\r\n      <Modal backdrop=\"static\" show={this.props.show} size=\"xl\">\r\n        <Modal.Header>\r\n          <Modal.Title className=\"text-uppercase\">SET DATE FORM</Modal.Title>\r\n        </Modal.Header>\r\n        <Modal.Body>\r\n          <Table className=\"table-sm dark\" borderless responsive>\r\n            <thead>\r\n              <tr>\r\n                <th>Email Address</th>\r\n                <th>Date From</th>\r\n                <th>Date To</th>\r\n              </tr>\r\n            </thead>\r\n            <tbody>\r\n              {items.map(item => <tr key={item.id}>\r\n                <td><Form.Control type=\"text\" defaultValue={item.name} readOnly className=\"bg-white\" /></td>\r\n                <td>\r\n                  <DatePicker className=\"form-control\"\r\n                    peekNextMonth\r\n                    showMonthDropdown\r\n                    showYearDropdown\r\n                    dropdownMode=\"select\"\r\n                    minDate={new Date()}\r\n                    selected={item.fromDate}\r\n                    enableTabLoop={false}\r\n                    onChange={date => this.handleDateChange(item.id, \"fromDate\", \"from\", date as Date)} />\r\n                  {item.toDate && !item.fromDate && <Form.Control.Feedback type=\"invalid\" className=\"d-block\">Date From should be specified</Form.Control.Feedback>}\r\n                </td>\r\n                <td>\r\n                  <DatePicker className=\"form-control\"\r\n                    peekNextMonth\r\n                    showMonthDropdown\r\n                    showYearDropdown\r\n                    dropdownMode=\"select\"\r\n                    popperPlacement=\"top-end\"\r\n                    minDate={new Date()}\r\n                    selected={item.toDate}\r\n                    enableTabLoop={false}\r\n                    onChange={date => this.handleDateChange(item.id, \"toDate\", \"to\", date as Date)} />\r\n                  {!item.toDate && item.fromDate && <Form.Control.Feedback type=\"invalid\" className=\"d-block\">Date To should be specified</Form.Control.Feedback>}\r\n                  {item.toDate && item.fromDate && item.fromDate >= item.toDate && <Form.Control.Feedback type=\"invalid\" className=\"d-block\">Date To should be later than Date From</Form.Control.Feedback>}\r\n                </td>\r\n              </tr>)}\r\n            </tbody>\r\n          </Table>\r\n        </Modal.Body>\r\n        <Modal.Footer>\r\n          <Button variant=\"secondary\" onClick={this.props.onCancel}>Cancel</Button>\r\n          <Button onClick={() => this.props.onUpdate(this.state.items)} disabled={!canConfirm} className=\"ml-1\">Confirm</Button>\r\n        </Modal.Footer>\r\n      </Modal>)\r\n  }\r\n}\r\n","import React from \"react\"\r\nimport { Modal, Form, Col, Row, Button, Container, InputGroup, Table, Spinner } from \"react-bootstrap\"\r\nimport { FaAngleDoubleDown, FaAngleDoubleLeft, FaAngleDoubleRight, FaAngleDoubleUp, FaAngleDown, FaAngleUp, FaChevronLeft, FaChevronRight } from \"react-icons/fa\"\r\nimport { toast } from \"react-toastify\"\r\nimport { concat, of, Subject, Subscription } from \"rxjs\"\r\nimport { catchError, filter, map, switchMap } from \"rxjs/operators\"\r\nimport { connect } from \"react-redux\"\r\nimport { isUser } from \"../../authentication/isAdminRole\"\r\nimport { AppState } from \"../../AppState\"\r\nimport ActionButton from \"../ActionButton\"\r\nimport UserInformation from \"../../api/Administration/Model/UserInformation\"\r\nimport { UserNotificationInformationObservable } from \"../../api/Administration/UserInformationGet\"\r\nimport OrderSecurityOverrideData from \"../../api/Administration/Model/OrderSecurityOverrideData\"\r\nimport OrderSecurityOverrideRecord from \"../../api/Administration/Model/OrderSecurityOverrideRecord\"\r\nimport OrderSecurityOverrideGet from \"../../api/Administration/OrderSecurityOverrideGet\"\r\nimport OrderSecurityOverrideUpdate from \"../../api/Administration/OrderSecurityOverrideUpdate\"\r\nimport RoleOrderSecurityCheck from \"../../api/Roles/RoleOrderSecurityCheck\"\r\nimport FormatDate from \"../../formatters/FormatDate\"\r\nimport SetDatePeriod, { DatePeriodItem } from \"./SetDatePeriod\"\r\nimport { APIError } from \"../../api/ObservableFromFetch\"\r\nimport FormatError from \"../../formatters/FormatError\"\r\n\r\ninterface OrderSecurityOverrideProps {\r\n  show: boolean\r\n  userInfo?: UserInformation\r\n  onClose: () => void\r\n}\r\n\r\ninterface OrderSecurityOverrideAuthProps {\r\n  isUser?: boolean\r\n}\r\n\r\ninterface OrderSecurityOverrideRecordExt extends OrderSecurityOverrideRecord {\r\n  id: string\r\n}\r\n\r\ninterface OrderSecurityOverrideState {\r\n  userInfo?: UserInformation\r\n  loginName: string\r\n  loading: boolean\r\n  saving: boolean\r\n  roleChecking: boolean\r\n  loadingOverrides: boolean\r\n  showSetDates: boolean\r\n  whoCanViewMyOrders: OrderSecurityOverrideRecordExt[]\r\n  whoCannotViewMyOrders: OrderSecurityOverrideRecordExt[]\r\n  selectionLeft: string[]\r\n  selectionRight: string[]\r\n}\r\n\r\nexport class OrderSecurityOverride extends React.PureComponent<OrderSecurityOverrideProps & OrderSecurityOverrideAuthProps, OrderSecurityOverrideState> {\r\n  state: OrderSecurityOverrideState = {\r\n    loginName: \"\",\r\n    loading: false,\r\n    saving: false,\r\n    roleChecking: false,\r\n    loadingOverrides: false,\r\n    showSetDates: false,\r\n    whoCanViewMyOrders: [],\r\n    whoCannotViewMyOrders: [],\r\n    selectionLeft: [],\r\n    selectionRight: [],\r\n  }\r\n\r\n  loadUserSubscription?: Subscription\r\n  roleSecurityCheckSubscription?: Subscription\r\n  loadOrderSecurityOverrideSubscription?: Subscription\r\n  saveSubscription?: Subscription\r\n\r\n  loginName$ = new Subject<string>()\r\n  roleCheck$ = new Subject<UserInformation | undefined>()\r\n  override$ = new Subject<UserInformation | undefined>()\r\n\r\n  componentDidMount() {\r\n    this.loadUserSubscription = this.loginName$.pipe(\r\n      map(name => name.trim()),\r\n      switchMap(name => concat(\r\n        of({ loading: true }),\r\n        UserNotificationInformationObservable(name, true).pipe(\r\n          map(result => ({ loading: false, result: result })),\r\n          catchError((error) => of({ loading: false, errorMessage: FormatError(error) }))\r\n        )\r\n      ))\r\n    ).subscribe(\r\n      (o: { loading: boolean, result?: UserInformation[], errorMessage?: string }) => {\r\n        this.setState({ loading: o.loading, whoCanViewMyOrders: [], whoCannotViewMyOrders: [], selectionLeft: [], selectionRight: [], userInfo: undefined })\r\n        if (o.errorMessage) {\r\n          toast.error(o.errorMessage)\r\n        } else {\r\n          const userInfo = o.result && o.result.length > 0 ? o.result[0] : undefined\r\n          this.roleCheck$.next(userInfo)\r\n        }\r\n      },\r\n      (error) => this.handleAPIError(error, { loading: false, userInfo: undefined })\r\n    )\r\n    this.roleSecurityCheckSubscription = this.roleCheck$.pipe(\r\n      filter(userInfo => userInfo !== undefined),\r\n      switchMap(userInfo => concat(\r\n        of({ loading: true, result: false }),\r\n        RoleOrderSecurityCheck(userInfo!.RoleID).pipe(\r\n          map(result => ({ loading: false, result: result, userInfo: userInfo })),\r\n          catchError((error) => of({ loading: false, result: false, errorMessage: FormatError(error) }))\r\n        )))\r\n    ).subscribe(\r\n      (o: { loading: boolean, result: boolean, userInfo?: UserInformation, errorMessage?: string }) => {\r\n        this.setState({ roleChecking: o.loading })\r\n        if (o.errorMessage) {\r\n          toast.error(o.errorMessage)\r\n        } else {\r\n          this.override$.next(o.userInfo)\r\n        }\r\n      },\r\n      (error) => this.handleAPIError(error, { roleChecking: false })\r\n    )\r\n    this.loadOrderSecurityOverrideSubscription = this.override$.pipe(\r\n      filter(userInfo => userInfo !== undefined),\r\n      switchMap(userInfo => concat(\r\n        of({ loading: true }),\r\n        OrderSecurityOverrideGet(userInfo!.RoleID, userInfo!.ApplicationUserID).pipe(\r\n          map(result => ({ loading: false, result: result, userInfo: userInfo })),\r\n          catchError((error) => of({ loading: false, errorMessage: FormatError(error) }))\r\n        )))\r\n    ).subscribe(\r\n      (o: { loading: boolean, result?: OrderSecurityOverrideData, userInfo?: UserInformation, errorMessage?: string }) => {\r\n        this.setState({\r\n          loadingOverrides: o.loading,\r\n          userInfo: o.userInfo,\r\n          loginName: o.userInfo ? o.userInfo.UserName : this.state.loginName,\r\n          whoCanViewMyOrders: o.result?.WhoCanViewMyOrders?.map(item => ({ ...item, id: Math.random().toString() })) || [],\r\n          whoCannotViewMyOrders: o.result?.WhoCannotViewMyOrders?.map(item => ({ ...item, id: Math.random().toString() })) || [],\r\n          selectionLeft: [],\r\n          selectionRight: []\r\n        })\r\n        o.errorMessage && toast.error(o.errorMessage)\r\n      },\r\n      (error) => this.handleAPIError(error, { loadingOverrides: false })\r\n    )\r\n    if (this.props.show && !!this.props.userInfo) {\r\n      this.roleCheck$.next(this.props.userInfo)\r\n    }\r\n  }\r\n\r\n  componentWillUnmount() {\r\n    this.loadUserSubscription && this.loadUserSubscription.unsubscribe()\r\n    this.roleSecurityCheckSubscription && this.roleSecurityCheckSubscription.unsubscribe()\r\n    this.loadOrderSecurityOverrideSubscription && this.loadOrderSecurityOverrideSubscription.unsubscribe()\r\n    this.saveSubscription && this.saveSubscription.unsubscribe()\r\n  }\r\n\r\n  componentDidUpdate(prevProps: OrderSecurityOverrideProps) {\r\n    if (this.props.show && !prevProps.show) {\r\n      if (!!this.props.userInfo) {\r\n        this.roleCheck$.next(this.props.userInfo)\r\n      }\r\n    }\r\n  }\r\n\r\n  handleLoginNameChange = (e: React.ChangeEvent<HTMLInputElement>) => this.setState({ loginName: e.target.value })\r\n\r\n  move(dir: \"ltr\" | \"rtl\", all?: boolean) {\r\n    if (dir === \"ltr\") {\r\n      const ids = !!all ? this.state.whoCannotViewMyOrders.map(item => item.id) : this.state.selectionLeft\r\n      this.setState({\r\n        selectionLeft: [],\r\n        whoCannotViewMyOrders: this.state.whoCannotViewMyOrders.filter(item => !ids.includes(item.id)),\r\n        whoCanViewMyOrders: [...this.state.whoCanViewMyOrders, ...this.state.whoCannotViewMyOrders.filter(item => ids.includes(item.id))]\r\n      })\r\n    } else {\r\n      const ids = !!all ? this.state.whoCanViewMyOrders.map(item => item.id) : this.state.selectionRight\r\n      this.setState({\r\n        selectionRight: [],\r\n        whoCannotViewMyOrders: [...this.state.whoCannotViewMyOrders, ...this.state.whoCanViewMyOrders.filter(item => ids.includes(item.id))],\r\n        whoCanViewMyOrders: this.state.whoCanViewMyOrders.filter(item => !ids.includes(item.id))\r\n      })\r\n    }\r\n  }\r\n\r\n  handleUpdate = () => {\r\n    const { userInfo, whoCanViewMyOrders } = this.state\r\n    if (!userInfo) {\r\n      return\r\n    }\r\n    this.setState({ saving: true })\r\n    this.saveSubscription && this.saveSubscription.unsubscribe()\r\n    this.saveSubscription = OrderSecurityOverrideUpdate(\r\n      userInfo?.RoleID,\r\n      userInfo?.MockApplicationUserID,\r\n      whoCanViewMyOrders\r\n    ).subscribe(\r\n      data => {\r\n        this.setState({ saving: false })\r\n        toast.success(data)\r\n      },\r\n      error => this.handleAPIError(error, { saving: false })\r\n    )\r\n  }\r\n\r\n  handleAPIError = (error: Error | APIError, stateChanges: object) => {\r\n    this.setState(stateChanges)\r\n    error && toast.error((error as APIError)?.errorData?.message || error.message)\r\n  }\r\n\r\n  handleRightItemClick = (id: string) => {\r\n    if (this.state.selectionRight.includes(id)) {\r\n      this.setState({ selectionRight: this.state.selectionRight.filter(item => item !== id) })\r\n    } else {\r\n      this.setState({ selectionRight: [...this.state.selectionRight, id] })\r\n    }\r\n  }\r\n\r\n  handleSetDatesUpdate = (datePeriodItems: DatePeriodItem[]) => {\r\n    const { whoCanViewMyOrders } = this.state\r\n    whoCanViewMyOrders.forEach(item => {\r\n      const datePeriodItem = datePeriodItems.find(datePeriodItem => datePeriodItem.id === item.id)\r\n      if (datePeriodItem) {\r\n        item.DateFrom = datePeriodItem.from\r\n        item.DateTo = datePeriodItem.to\r\n      }\r\n    })\r\n    this.setState({ showSetDates: false, whoCanViewMyOrders: whoCanViewMyOrders.map(item => ({ ...item })) })\r\n  }\r\n\r\n  render() {\r\n    const { userInfo, loginName, loading, saving, roleChecking, loadingOverrides,\r\n      whoCanViewMyOrders, whoCannotViewMyOrders, selectionLeft, selectionRight } = this.state\r\n    const { isUser } = this.props\r\n\r\n    const canFinish = !!whoCanViewMyOrders.length && whoCanViewMyOrders.every(item => !!item.DateFrom && !!item.DateTo)\r\n    return (<>\r\n      <Modal backdrop=\"static\" show={this.props.show} size=\"xl\">\r\n        <Modal.Header>\r\n          <Modal.Title className=\"text-uppercase\">Order View Security Override</Modal.Title>\r\n        </Modal.Header>\r\n        <Modal.Body className=\"px-0\">\r\n          <Container fluid className=\"px-4\">\r\n            <Row>\r\n              <Col xl={5} className=\"pl-1 pb-1 pb-lg-0\">\r\n                <InputGroup className=\"label-prepend\">\r\n                  <InputGroup.Prepend>\r\n                    <InputGroup.Text>User's Email</InputGroup.Text>\r\n                  </InputGroup.Prepend>\r\n                  <Form.Control type=\"text\" value={loginName}  disabled={isUser} onChange={this.handleLoginNameChange} />\r\n                  <InputGroup.Append>\r\n                    {!isUser && <ActionButton variant=\"secondary\"\r\n                      disabled={loginName.trim().length === 0}\r\n                      onClick={() => this.loginName$.next(this.state.loginName)}\r\n                      spin={loading || roleChecking || loadingOverrides}\r\n                      disableOnSpin>Retrieve</ActionButton>}\r\n                  </InputGroup.Append>\r\n                </InputGroup>\r\n              </Col>\r\n              <Col className=\"d-none d-xl-block\"></Col>\r\n              <Col xl={6} className=\"pl-1\">\r\n                <InputGroup className=\"label-prepend\">\r\n                  <InputGroup.Prepend>\r\n                    <InputGroup.Text>Role</InputGroup.Text>\r\n                  </InputGroup.Prepend>\r\n                  <Form.Control type=\"text\" defaultValue={userInfo?.RoleDescription} readOnly className=\"bg-white\" />\r\n                </InputGroup>\r\n              </Col>\r\n            </Row>\r\n          </Container>\r\n          <hr />\r\n          {isUser && (loading || roleChecking || loadingOverrides) && <Container fluid><Row><Col className=\"text-center\"><Spinner animation=\"border\" variant=\"secondary\" /></Col></Row></Container>}\r\n          <Form className=\"px-4\" hidden={isUser && (loading || roleChecking || loadingOverrides)}>\r\n            <Row className=\"d-none d-lg-flex\">\r\n              <Col lg={4}>Who cannot view my Orders</Col>\r\n              <Col lg={1} className=\"px-0\"></Col>\r\n              <Col lg={7} className=\"pl-lg-0\">Who can view my Orders</Col>\r\n            </Row>\r\n            <Row>\r\n              <Col className=\"d-lg-none\">Who cannot view my Orders</Col>\r\n              <Col lg={4} className=\"pr-lg-0\">\r\n                <Form.Control as=\"select\" multiple className=\"grey-selection\" style={{ height: \"100%\", overflowY: \"auto\" }}\r\n                  disabled={false}\r\n                  onChange={(e: React.ChangeEvent<HTMLSelectElement>) => { this.setState({ selectionLeft: Array.from(e.target.selectedOptions, option => option.value) }) }}>\r\n                  {whoCannotViewMyOrders.map(item => <option key={item.id} value={item.id}>{item.UserName}</option>)}\r\n                </Form.Control>\r\n              </Col>\r\n              <Col lg={1} className=\"px-0\">\r\n                <Container fluid>\r\n                  <Row>\r\n                    <Col className=\"px-1 text-center\">\r\n                      <Button className=\"btn-sm btn-sm-icon mb-lg-2 mt-lg-0 my-1\" disabled={!whoCannotViewMyOrders.length} onClick={() => this.move(\"ltr\", true)}>\r\n                        <FaAngleDoubleRight className=\"d-none d-lg-inline\" />\r\n                        <FaAngleDoubleDown className=\"d-lg-none\" />\r\n                      </Button>\r\n                    </Col>\r\n                    <Col className=\"px-1 text-center\">\r\n                      <Button className=\"btn-sm btn-sm-icon mb-lg-2 mt-lg-0 my-1\" disabled={!selectionLeft.length} onClick={() => this.move(\"ltr\")}>\r\n                        <FaChevronRight className=\"d-none d-lg-inline\" />\r\n                        <FaAngleDown className=\"d-lg-none\" />\r\n                      </Button>\r\n                    </Col>\r\n                    <Col className=\"px-1 text-center\">\r\n                      <Button className=\"btn-sm btn-sm-icon mb-lg-2 mt-lg-0 my-1\" disabled={!selectionRight.length} onClick={() => this.move(\"rtl\")}>\r\n                        <FaChevronLeft className=\"d-none d-lg-inline\" />\r\n                        <FaAngleUp className=\"d-lg-none\" />\r\n                      </Button>\r\n                    </Col>\r\n                    <Col className=\"px-1 text-center\">\r\n                      <Button className=\"btn-sm btn-sm-icon mb-lg-2 mt-lg-0 my-1\" disabled={!whoCanViewMyOrders.length} onClick={() => this.move(\"rtl\", true)}>\r\n                        <FaAngleDoubleLeft className=\"d-none d-lg-inline\" />\r\n                        <FaAngleDoubleUp className=\"d-lg-none\" />\r\n                      </Button>\r\n                    </Col>\r\n                  </Row>\r\n                </Container>\r\n              </Col>\r\n              <Col className=\"d-lg-none\">Who can view my Orders</Col>\r\n              <Col lg={7} className=\"pl-lg-0\">\r\n                <Table className=\"table-sm dark\" borderless responsive=\"bordered-h100p\">\r\n                  <thead>\r\n                    <tr>\r\n                      <th>User</th>\r\n                      <th>From</th>\r\n                      <th>To</th>\r\n                    </tr>\r\n                  </thead>\r\n                  <tbody>\r\n                    {whoCanViewMyOrders.map(item => <tr key={item.id} className={selectionRight.includes(item.id) ? \"selected\" : \"\"} onClick={() => this.handleRightItemClick(item.id)}>\r\n                      <td>{item.UserName}</td>\r\n                      <td>{FormatDate(item.DateFrom)}</td>\r\n                      <td>{FormatDate(item.DateTo)}</td>\r\n                    </tr>)}\r\n                  </tbody>\r\n                </Table>\r\n              </Col>\r\n            </Row>\r\n          </Form>\r\n        </Modal.Body>\r\n        <Modal.Footer>\r\n          <Button variant=\"secondary\" onClick={this.props.onClose}>Cancel</Button>\r\n          <Button onClick={() => this.setState({ showSetDates: true })} disabled={!whoCanViewMyOrders.length} className=\"ml-1\">Set Dates</Button>\r\n          <ActionButton onClick={this.handleUpdate} disabled={!canFinish} className=\"ml-1\" spin={saving} disableOnSpin>Finish</ActionButton>\r\n        </Modal.Footer>\r\n      </Modal>\r\n      <SetDatePeriod show={this.state.showSetDates}\r\n        items={whoCanViewMyOrders.map(item => ({ id: item.id, name: item.UserName, from: item.DateFrom, to: item.DateTo }))}\r\n        onCancel={() => this.setState({ showSetDates: false })}\r\n        onUpdate={this.handleSetDatesUpdate} />\r\n    </>)\r\n  }\r\n}\r\n\r\nfunction mapStateToProps(state: AppState): OrderSecurityOverrideAuthProps {\r\n  return {\r\n    isUser: isUser(state)\r\n  }\r\n}\r\n\r\nconst ConnectedOrderSecurityOverride = connect(mapStateToProps, null)(OrderSecurityOverride)\r\nexport default ConnectedOrderSecurityOverride","import { ObservableFromFetch } from \"../ObservableFromFetch\"\r\nimport OrderSecurityOverrideData from \"./Model/OrderSecurityOverrideData\"\r\n\r\nexport default function OrderSecurityOverrideGetObservable(roleID: number, userID: number) {\r\n  const requestBody: string = JSON.stringify({\r\n    RoleID: roleID,\r\n    ApplicationUserIDFrom: userID\r\n  })\r\n  return ObservableFromFetch<OrderSecurityOverrideData>(\"FFOrderRoleOrderSecurity/GetOrderSecurityOverride\", requestBody)\r\n}\r\n","import * as React from \"react\"\r\nimport { Button, Col, Form, Modal, Row, Spinner } from \"react-bootstrap\"\r\nimport { toast } from \"react-toastify\"\r\nimport { concat, of, Subject, Subscription } from \"rxjs\"\r\nimport { catchError, map, switchMap } from \"rxjs/operators\"\r\nimport {isCompanyAdmin, isLocationAdmin, isPortalAdmin, isSiteAdmin, isUser} from \"../../authentication/isAdminRole\"\r\nimport { AppState } from \"../../AppState\"\r\nimport { connect } from \"react-redux\"\r\nimport UserInformation from \"../../api/Administration/Model/UserInformation\"\r\nimport AssociatedData from \"../../api/Administration/Model/AssociatedData\"\r\nimport { UserInformationObservable, UserNotificationInformationObservable } from \"../../api/Administration/UserInformationGet\"\r\nimport UserNotificationInfoUpdate, { UpdateUserDetailParams } from \"../../api/Administration/UserNotificationInfoUpdate\"\r\nimport CreateUser from \"../../api/Administration/CreateUser\"\r\nimport UserPasswordReset from \"../../api/Administration/UserPasswordReset\"\r\nimport UserRevoke from \"../../api/Administration/UserRevoke\"\r\nimport RoleOrderSecurityCheck from \"../../api/Roles/RoleOrderSecurityCheck\"\r\nimport ActionButton from \"../ActionButton\"\r\nimport ConfirmationModal from \"../ConfirmationModal\"\r\nimport NotificationSelection from \"./Notification/NotificationSelection\"\r\nimport AdditionalAssociatedDataModal, { AssociatedDataType, EmptyAssociatedData } from \"./AdditionalAssociatedDataModal\"\r\nimport AdditionalRoleModal from \"./AdditionalRoleModal\"\r\nimport OrderSecurityOverride from \"../Administration/OrderSecurityOverride\"\r\nimport FormatPhone from \"../../formatters/FormatPhone\"\r\nimport { APIError } from \"../../api/ObservableFromFetch\"\r\nimport { getUserNameForSelectedCompany, RoleIdForSelectedCompany } from \"../../authentication/SelectedCompany/CompanySelectionDrivenSelectors\"\r\nimport TimeZoneListGet from \"../../api/Administration/TimeZoneListGet\"\r\nimport TimeZoneData from \"../../api/Administration/Model/TimeZoneData\"\r\nimport Checkbox from \"../Checkbox\"\r\nimport { EmailRegexp, PhoneRegexp, MaxFailedLoginAttempts } from \"../../config/Constants\"\r\nimport { Typeahead } from \"react-bootstrap-typeahead\"\r\nimport Role from \"../../api/Roles/Model/Role\"\r\nimport { GetRolesToInvite } from \"../../api/Roles/UserRolesGet\"\r\nimport MaskedInput from \"react-maskedinput\"\r\nimport CheckExistingUser from \"../../api/Invitation/CheckExistingUser\"\r\nimport RoleData from \"../../api/Administration/Model/RoleData\"\r\nimport AutoFilterCompany from '../../api/Companies/CompanyModel/AutoFilterCompany'\r\nimport CompanyInput from '../FormattedInputs/CompanyInput'\r\nimport AutoFilterCompaniesGet from '../../api/Companies/AutoFilterCompaniesGet';\r\nimport AutoFilterLocation from \"../../api/Location/LocationModel/AutoFilterLocation\"\r\nimport AutoFilterRegion from \"../../api/Regions/Model/AutoFilterRegion\"\r\nimport AutoFilterLocationsGet from \"../../api/Location/AutoFilterLocationsGet\"\r\nimport ResetLoginAttempts from \"../../api/Administration/ResetLoginAttempts\"\r\nimport RemoveDuplicateRoles from \"../../api/Administration/RemoveDuplicateRoles\"\r\nimport DeleteUser, { DeleteRole } from \"../../api/Administration/DeleteUser\"\r\nimport NotificationSettings from \"../../api/Notifications/Model/NotificationSettings\"\r\n\r\nexport enum UserInfoMode {\r\n  Team = \"Team\",\r\n  Personal = \"Personal\"\r\n}\r\n\r\ninterface UserInfoProps {\r\n  show: boolean\r\n  LoginName?: string\r\n  LoginAttempts?: number\r\n  details?: UserInformation\r\n  mode: UserInfoMode\r\n  onClose?: (updated: boolean) => void\r\n  participationId?: number\r\n  locationId?: number\r\n  timeZoneId?: number\r\n  roleId?: number\r\n  showNewUser?: boolean\r\n}\r\n\r\ninterface UserInfoAuthProps {\r\n  isLocationAdmin?: boolean\r\n  isCompanyAdmin?: boolean\r\n  isPortalAdmin?: boolean\r\n  isSiteAdmin?: boolean\r\n  isUser?: boolean\r\n  UserName?: string\r\n  PrimaryRoleID?: number\r\n}\r\n\r\ninterface UserInfoValidity {\r\n  emailValid: boolean\r\n  phoneValid: boolean\r\n  lastNameValid: boolean\r\n  firstNameValid: boolean\r\n  roleValid: boolean\r\n  companyValid: boolean\r\n}\r\n\r\nexport interface UserInfoData extends NotificationSettings {\r\n  userInfo?: UserInformation\r\n  firstName?: string\r\n  lastName?: string\r\n  email: string\r\n  phone: string\r\n  roleId: number\r\n  roles?: Role[]\r\n  inactive: boolean\r\n  companies?: AutoFilterCompany[]\r\n  locations?: AutoFilterLocation[]\r\n}\r\n\r\ninterface UserInfoState extends UserInfoData, UserInfoValidity {\r\n  showRevokeConfirmation: boolean\r\n  showResetPasswordConfirmation: boolean\r\n  showResetLoginAttemptsConfirmation: boolean\r\n  showRemoveDuplicateRolesConfirmation: boolean\r\n  showDeleteUserConfirmation: boolean\r\n  showDeleteRoleConfirmation: boolean\r\n  canShowDetailsToPerson: boolean\r\n  showOrderSecurityOverride: boolean\r\n  loading: boolean\r\n  saving: boolean\r\n  revoking: boolean\r\n  resettingPassword: boolean\r\n  performingResetLoginAttempts: boolean\r\n  performingRemoveDuplicateRoles: boolean\r\n  performingDeleteUser: boolean\r\n  performingDeleteRole: boolean\r\n  showAdditionalPhone: boolean\r\n  showAdditionalRoles: boolean\r\n  participationId?: number\r\n  timeZoneId?: number\r\n  timeZones: TimeZoneData[]\r\n  emailChecked: boolean\r\n  emailAvailable: boolean\r\n  selectedCompany?: AutoFilterCompany\r\n  selectedLocation?: AutoFilterLocation\r\n}\r\n\r\nexport class UserInfo extends React.Component<UserInfoProps & UserInfoAuthProps, UserInfoState> {\r\n  emptyData: UserInfoData = {\r\n    userInfo: undefined,\r\n    firstName: \"\",\r\n    lastName: \"\",\r\n    email: \"\",\r\n    phone: \"\",\r\n    roleId: 0,\r\n    inactive: false,\r\n    showNotifications: false,\r\n    checkedNotificationServiceIDs: [],\r\n    checkedNotificationEventIDs: [],\r\n    checkedNotificationMethodIDs: [],\r\n  }\r\n  emptyState: UserInfoState = {\r\n    ...this.emptyData,\r\n    lastNameValid: true,\r\n    firstNameValid: true,\r\n    emailValid: true,\r\n    phoneValid: true,\r\n    roleValid: true,\r\n    companyValid: true,\r\n    showRevokeConfirmation: false,\r\n    showResetPasswordConfirmation: false,\r\n    showResetLoginAttemptsConfirmation: false,\r\n    showRemoveDuplicateRolesConfirmation: false,\r\n    showDeleteUserConfirmation: false,\r\n    showDeleteRoleConfirmation: false,\r\n    canShowDetailsToPerson: false,\r\n    showOrderSecurityOverride: false,\r\n    loading: false,\r\n    saving: false,\r\n    revoking: false,\r\n    resettingPassword: false,\r\n    performingResetLoginAttempts: false,\r\n    performingRemoveDuplicateRoles: false,\r\n    performingDeleteUser: false,\r\n    performingDeleteRole: false,\r\n    showAdditionalPhone: false,\r\n    showAdditionalRoles: false,\r\n    timeZoneId: this.props.timeZoneId,\r\n    participationId: this.props.participationId,\r\n    timeZones: [],\r\n    emailChecked: false,\r\n    emailAvailable: false,\r\n    selectedCompany: undefined\r\n  }\r\n  state: UserInfoState = { ...this.emptyState }\r\n\r\n  rolesTypeahead = React.createRef<Typeahead<Role>>()\r\n  loadUserSubscription?: Subscription\r\n  roleSecurityCheckSubscription?: Subscription\r\n  saveSubscription?: Subscription\r\n  userRevokeSubscription?: Subscription\r\n  userPasswordResetSubscription?: Subscription\r\n  userRolesSubscription?: Subscription\r\n  existSubscription?: Subscription\r\n  companiesSubscription?: Subscription\r\n  locationsSubscription?: Subscription\r\n  removeRoleSubscription?: Subscription\r\n\r\n  loginName$ = new Subject<string>()\r\n  roleID$ = new Subject<number>()\r\n\r\n  timeZoneSubscription = new Subscription()\r\n\r\n  componentDidMount() {\r\n    this.timeZoneSubscription.add(\r\n      TimeZoneListGet().subscribe(\r\n        (results: TimeZoneData[]) => {\r\n          this.setState({ timeZones: results })\r\n        },\r\n        () => { }\r\n      )\r\n    )\r\n\r\n    this.userRolesSubscription = GetRolesToInvite().subscribe(data => this.setState({ roles: data }))\r\n\r\n    const observable = this.props.mode === UserInfoMode.Personal ? UserInformationObservable : UserNotificationInformationObservable\r\n    this.loadUserSubscription = this.loginName$.pipe(\r\n      map(name => name.trim()),\r\n      switchMap(name => concat(\r\n        of({ loading: true }),\r\n        observable(name, false).pipe(\r\n          map(result => ( { loading: false, result: result } )),\r\n          catchError(() => of({ loading: false }))\r\n        )\r\n      ))\r\n    ).subscribe(\r\n      (o: { loading: boolean, result?: UserInformation[] }) => {\r\n        this.setState({ loading: o.loading })\r\n        if (o.result) {\r\n          this.setState({ ...this.mapUserInfo(o.result.find(i => i.ParticipationID === this.props.participationId))})\r\n        }\r\n      },\r\n      error => this.handleAPIError(error, { loading: false, userInfo: undefined })\r\n    )\r\n    if (this.props.isUser && !this.props.isSiteAdmin) {\r\n      this.roleSecurityCheckSubscription = this.roleID$.pipe(\r\n        switchMap(roleID => concat(\r\n          of(false),\r\n          RoleOrderSecurityCheck(roleID).pipe(\r\n            catchError(_ => of(false))\r\n          )))\r\n      ).subscribe(\r\n        result => this.setState({ canShowDetailsToPerson: result }),\r\n        error => this.handleAPIError(error, { canShowDetailsToPerson: false })\r\n      )\r\n    }\r\n    if (this.props.show && !!this.props.LoginName) {\r\n      this.loginName$.next(this.props.LoginName)\r\n    }\r\n\r\n    if (this.props.isPortalAdmin || this.props.isCompanyAdmin) {\r\n      this.companiesSubscription = AutoFilterCompaniesGet(\"\").subscribe(\r\n        (results: AutoFilterCompany[]) => {\r\n          if (this.props.isCompanyAdmin && results.length > 0) {\r\n            this.loadAllLocations(results[0], undefined)\r\n          }\r\n          this.setState({ companies: results })\r\n        }\r\n      )\r\n    }\r\n  }\r\n\r\n  loadAllLocations = (company?: AutoFilterCompany, region?: AutoFilterRegion) => {\r\n    this.locationsSubscription = AutoFilterLocationsGet(company?.AccountID || 0, region?.Code || \"\", \"\").subscribe(\r\n      data => {\r\n        this.setState({ locations: data, selectedLocation: undefined })\r\n      }\r\n    )\r\n  }\r\n\r\n  handleLocationChange = (event: React.ChangeEvent<HTMLSelectElement>) => {\r\n    let location = (this.state.locations || []).find(l => l.AccountID === Number(event.target.value))\r\n    this.setState({ selectedLocation: location })\r\n  }\r\n\r\n  componentWillUnmount() {\r\n    this.saveSubscription?.unsubscribe();\r\n    this.userRevokeSubscription?.unsubscribe();\r\n    this.userPasswordResetSubscription?.unsubscribe();\r\n    this.loadUserSubscription?.unsubscribe();\r\n    this.roleSecurityCheckSubscription?.unsubscribe();\r\n    this.timeZoneSubscription?.unsubscribe();\r\n    this.userRolesSubscription?.unsubscribe();\r\n    this.existSubscription?.unsubscribe();\r\n    this.companiesSubscription?.unsubscribe();\r\n    this.locationsSubscription?.unsubscribe();\r\n    this.removeRoleSubscription?.unsubscribe();\r\n  }\r\n\r\n  componentDidUpdate(prevProps: UserInfoProps, prevState: UserInfoState) {\r\n    if (!this.props.show && prevProps.show) {\r\n      this.timeZoneSubscription.add(\r\n        TimeZoneListGet().subscribe(\r\n          (results: TimeZoneData[]) => this.setState({ timeZones: results }),\r\n          () => { }\r\n        )\r\n      )\r\n      this.setState({ ...this.emptyState })\r\n    }\r\n    if (this.props.show) {\r\n      if (!!this.props.LoginName && prevProps.LoginName !== this.props.LoginName) {\r\n        this.loginName$.next(this.props.LoginName)\r\n      }\r\n    }\r\n    if (!!this.state.userInfo && this.state.userInfo?.RoleID !== prevState.userInfo?.RoleID) {\r\n      this.roleID$.next(this.state.userInfo.RoleID)\r\n    }\r\n    if (this.props.timeZoneId !== prevProps.timeZoneId) {\r\n      this.setState({ timeZoneId: this.props.timeZoneId === 0 ? this.state.timeZones[0].TimeZoneID : this.props.timeZoneId })\r\n    }\r\n  }\r\n\r\n  performResetLoginAttempts = () => {\r\n    this.setState({ performingResetLoginAttempts: true })\r\n    ResetLoginAttempts(this.props.LoginName || \"\").subscribe(\r\n      data => {\r\n        this.setState({ performingResetLoginAttempts: false })\r\n        this.props.onClose && this.props.onClose(true)\r\n        toast.success(data)\r\n      },\r\n      error => this.handleAPIError(error, { performingResetLoginAttempts: false })\r\n    )\r\n  }\r\n\r\n  performRemoveDuplicateRoles = () => {\r\n    this.setState({ performingRemoveDuplicateRoles: true })\r\n    RemoveDuplicateRoles(this.props.LoginName || \"\").subscribe(\r\n      data => {\r\n        this.setState({ performingRemoveDuplicateRoles: false })\r\n        this.props.onClose && this.props.onClose(true)\r\n        toast.success(data)\r\n      },\r\n      error => this.handleAPIError(error, { performingRemoveDuplicateRoles: false })\r\n    )\r\n  }\r\n\r\n  performDeleteUser = () => {\r\n    this.setState({ performingDeleteUser: true })\r\n    DeleteUser(this.props.LoginName || \"\").subscribe(\r\n      data => {\r\n        this.setState({ performingDeleteUser: false })\r\n        this.props.onClose && this.props.onClose(true)\r\n        toast.success(data)\r\n      },\r\n      error => this.handleAPIError(error, { performingDeleteUser: false })\r\n    )\r\n  }\r\n\r\n  performDeleteRole = () => {\r\n    this.setState({ performingDeleteUser: true })\r\n    this.removeRoleSubscription = DeleteRole(this.state.userInfo?.ApplicationUserID || 0, this.props.participationId || 0).subscribe(\r\n      data => {\r\n        this.setState({ performingDeleteUser: false })\r\n        this.props.onClose && this.props.onClose(true)\r\n        toast.success(data)\r\n      },\r\n      error => this.handleAPIError(error, { performingDeleteUser: false, showDeleteRoleConfirmation: false })\r\n    )\r\n  }\r\n\r\n  mapUserInfo = (info?: UserInformation): UserInfoData => {\r\n    if (!info) {\r\n      return { ...this.emptyData }\r\n    }\r\n\r\n    const email = info.AssociatedEmail.filter(email => email.Active)[0]?.ContactDetail || \"\"\r\n    const phone = FormatPhone(info?.AssociatedPhone.filter(phone => phone.Active)[0]?.ContactDetail || \"\")\r\n\r\n    return {\r\n      userInfo: info!,\r\n      firstName: info.FirstName,\r\n      lastName: info.LastName,\r\n      email: email,\r\n      phone: phone,\r\n      roleId: info.RoleID,\r\n      inactive: !info.Active,\r\n      showNotifications: info.IsNotificationEnabled,\r\n      checkedNotificationServiceIDs: info.NotificationServiceIDs,\r\n      checkedNotificationEventIDs: info.NotificationEventIDs,\r\n      checkedNotificationMethodIDs: info.NotificationMethodIDs\r\n    }\r\n  }\r\n\r\n  isNameValid = (value?: string) => !!value && value.trim().length > 0\r\n  isEmailValid = (value: string) => EmailRegexp.test(value)\r\n  isPhoneValid = (value: string) => PhoneRegexp.test(value)\r\n\r\n  handleFirstNameChange = (e: React.ChangeEvent<HTMLInputElement>) => {\r\n    const value = e.target.value\r\n    this.setState({ firstName: value, firstNameValid: this.isNameValid(value) })\r\n  }\r\n\r\n  handleLastNameChange = (e: React.ChangeEvent<HTMLInputElement>) => {\r\n    const value = e.target.value\r\n    this.setState({ lastName: value, lastNameValid: this.isNameValid(value) })\r\n  }\r\n\r\n  handleRoleChange = (event: React.ChangeEvent<HTMLSelectElement>) => {\r\n    const role = Number(event.target.value)\r\n    this.setState({ roleId: role, roleValid: role > 0 })\r\n  }\r\n\r\n  handlePhoneChange = (e: React.ChangeEvent<HTMLInputElement>) => {\r\n    const value = e.target.value\r\n    const phoneIndex = this.state.userInfo?.AssociatedPhone.findIndex(phone => phone.Active) || 0\r\n    const items = this.state.userInfo?.AssociatedPhone || []\r\n    const newPhoneArray: AssociatedData[]  = [\r\n      ...items.slice(0, phoneIndex),\r\n      {\r\n        ...items[phoneIndex],\r\n        ContactDetail: value.replace(/-/g, \"\"),\r\n      },\r\n      ...items.slice(phoneIndex + 1)\r\n    ]\r\n    this.setState({ phone: value, userInfo: {...this.state.userInfo, AssociatedPhone: newPhoneArray } as UserInformation })\r\n  }\r\n\r\n  handlePhoneChangeByEditModal = (data: AssociatedData[]) => {\r\n    const newActivePhone = FormatPhone(data.find(phone => phone.Active)?.ContactDetail || \"\")\r\n\r\n    this.setState(prev => ({\r\n      ...prev,\r\n      showAdditionalPhone: false,\r\n      phone: newActivePhone !== \"\" && prev.phone !== newActivePhone ? newActivePhone : prev.phone,\r\n      userInfo: { ...prev.userInfo, AssociatedPhone: data || [] } as UserInformation\r\n    }))\r\n  } \r\n\r\n  isLocationAdministrator = () => {\r\n    let isLocationAdmin = false\r\n    if (this.state.roleId > 0) {\r\n      isLocationAdmin = this.state.roles?.find(r => r.Title === 'Location Administrator' && r.RoleID === this.state.roleId) !== undefined\r\n    }\r\n    return isLocationAdmin\r\n  }\r\n\r\n  handleEmailChange = (event: React.ChangeEvent<HTMLInputElement>) => {\r\n    const value = event.target.value\r\n    this.setState({\r\n      email: value,\r\n      emailValid: this.isEmailValid(value),\r\n      emailChecked: false,\r\n      emailAvailable: false\r\n    })\r\n  }\r\n\r\n  handleEmailBlur = (e: React.FocusEvent<HTMLInputElement>) => {\r\n    if (!this.props.showNewUser) {\r\n      return true\r\n    }\r\n    const email = e.target.value\r\n    if (this.isEmailValid(email)) {\r\n      const requestParams = { UserName: email }\r\n      this.existSubscription = CheckExistingUser(requestParams).subscribe(\r\n        (data?: string) => {\r\n          this.setState({ emailAvailable: !data, emailChecked: true })\r\n        },\r\n        (error: Error | APIError) => {\r\n          this.setState({ emailAvailable: false, emailChecked: false })\r\n          error && toast.error((error as APIError)?.errorData?.message || error.message)\r\n        }\r\n      )\r\n    }\r\n  }\r\n\r\n  handleInactiveChange = (e: React.ChangeEvent<HTMLInputElement>) => this.setState({ inactive: e.target.checked })\r\n\r\n  handleCompanyChange = (selected: AutoFilterCompany) => {\r\n    this.setState({ selectedCompany: selected })\r\n    this.loadAllLocations(selected, undefined)\r\n  }\r\n\r\n  isValid = (existingUser: boolean = false) => {\r\n    const { firstName, lastName, email, phone, roleId, selectedCompany } = this.state\r\n    const validity: UserInfoValidity = {\r\n      lastNameValid: existingUser || this.isNameValid(lastName),\r\n      firstNameValid: existingUser || this.isNameValid(firstName),\r\n      emailValid: this.isEmailValid(email),\r\n      phoneValid: existingUser || this.isPhoneValid(phone),\r\n      roleValid: roleId > 0,\r\n      companyValid: !this.props.isPortalAdmin || !this.props.showNewUser || !!selectedCompany\r\n    }\r\n    return Object.values(validity).every((valid: boolean) => valid)\r\n  }\r\n\r\n  handleSave = () => {\r\n    const { firstName, lastName, email, phone, roleId, timeZoneId, inactive, emailChecked, emailAvailable } = this.state\r\n    const { isUser, isSiteAdmin, showNewUser } = this.props\r\n    const emailExists = emailChecked && !emailAvailable && showNewUser\r\n\r\n    if (!this.isValid(emailExists)) {\r\n      return\r\n    }\r\n    this.setState({ saving: true })\r\n    const { userInfo, showNotifications, checkedNotificationServiceIDs, checkedNotificationEventIDs, checkedNotificationMethodIDs } = this.state\r\n    const isCollectorActive = (userInfo?.AssociatedRole || []).some(role => role.Active === true && role.Description === 'Collector')\r\n\r\n    const emailData: AssociatedData = { ...EmptyAssociatedData, ContactDetail: email, Active: true, DeliveryType: AssociatedDataType.Email }\r\n    const phoneData: AssociatedData = { ...EmptyAssociatedData, ContactDetail: phone.replace(/-/g, \"\"), Active: true, DeliveryType: AssociatedDataType.Phone }\r\n    const role = this.state.roles?.find(role => role.RoleID === roleId)\r\n    const roleData: RoleData = { Active: true, Description: role?.Description || \"\", Level: role?.Level || 0, RoleID: role?.RoleID || 0, Title: role?.Title || \"\" }\r\n\r\n    const updateData: UpdateUserDetailParams = {\r\n      Inactive: inactive,\r\n      ApplicationUserID: userInfo?.ApplicationUserID || 0,\r\n      UserName: showNewUser ? email : userInfo?.UserName || \"\",\r\n      FirstName: firstName || \"\",\r\n      LastName: lastName || \"\",\r\n      ModifiedBy: this.props.UserName || \"\",\r\n      ParticipationID: userInfo?.ParticipationID || 0,\r\n      EmailAddressList: showNewUser ? [emailData] : userInfo?.AssociatedEmail.filter(data => data.ContactDetail !== \"\") || [],\r\n      PhoneNumberList: showNewUser ? [phoneData] : userInfo?.AssociatedPhone.filter(data => data.ContactDetail !== \"\") || [],\r\n      RoleList: showNewUser ? [roleData] : userInfo?.AssociatedRole || [],\r\n      NotificationEventIDs: showNotifications ? checkedNotificationEventIDs : [],\r\n      NotificationServiceIDs: showNotifications ? checkedNotificationServiceIDs : [],\r\n      NotificationMethodIDs: showNotifications ? checkedNotificationMethodIDs : [],\r\n      Link: userInfo?.Link || \"\",\r\n      IsUser: this.props.mode === UserInfoMode.Personal && (isUser && !isSiteAdmin) || false,\r\n      IsNotificationEnabled: showNotifications,\r\n      isCollectorActive: isCollectorActive || false,\r\n      timeZoneID: timeZoneId || 0,\r\n      AccountID: this.state.selectedCompany?.AccountID || 0,\r\n      LocationID: this.state.selectedLocation?.AccountID || 0\r\n    }\r\n\r\n    const SaveMethod = (updateData: UpdateUserDetailParams) => userInfo?.ApplicationUserID ? UserNotificationInfoUpdate(updateData) : CreateUser(updateData)\r\n\r\n    this.saveSubscription && this.saveSubscription.unsubscribe()\r\n    this.saveSubscription = SaveMethod(updateData).subscribe(\r\n      data => {\r\n        this.setState({ saving: false })\r\n        toast.success(data)\r\n        if (this.props.showNewUser) {\r\n          this.props.onClose && this.props.onClose(true)\r\n        } else {\r\n          if (this.props.mode === UserInfoMode.Personal) {\r\n            this.state.userInfo && this.loginName$.next(this.state.userInfo.UserName)\r\n          } else {\r\n            this.props.onClose && this.props.onClose(true)\r\n          }\r\n        }\r\n      },\r\n      error => this.handleAPIError(error, { saving: false })\r\n    )\r\n  }\r\n\r\n  performRevoke = () => {\r\n    this.setState({ revoking: true, showRevokeConfirmation: false })\r\n    this.userRevokeSubscription && this.userRevokeSubscription.unsubscribe()\r\n    this.userRevokeSubscription = UserRevoke(this.state.userInfo?.ApplicationUserID || 0).subscribe(\r\n      data => {\r\n        this.setState({ revoking: false })\r\n        toast.success(data)\r\n        this.props.onClose && this.props.onClose(true)\r\n      },\r\n      error => this.handleAPIError(error, { revoking: false })\r\n    )\r\n  }\r\n\r\n  performPasswordReset = () => {\r\n    this.setState({ resettingPassword: true, showResetPasswordConfirmation: false })\r\n    this.userPasswordResetSubscription && this.userPasswordResetSubscription.unsubscribe()\r\n    this.userPasswordResetSubscription = UserPasswordReset(this.props.LoginName || \"\", this.state.userInfo?.Link || \"\").subscribe(\r\n      data => {\r\n        this.setState({ resettingPassword: false })\r\n        toast.success(data)\r\n      },\r\n      error => this.handleAPIError(error, { resettingPassword: false })\r\n    )\r\n  }\r\n\r\n  performClose = () => this.props.onClose && this.props.onClose(false)\r\n\r\n  handleAPIError = (error: Error | APIError, stateChanges: object) => {\r\n    this.setState(stateChanges)\r\n    error && toast.error((error as APIError)?.errorData?.message || error.message)\r\n  }\r\n\r\n  handleChangeNotificationService = (notificationServiceId: number, value: boolean) => {\r\n    this.setState((prev) => ({...prev, checkedNotificationServiceIDs: value\r\n      ? [...prev.checkedNotificationServiceIDs, notificationServiceId]\r\n      : prev.checkedNotificationServiceIDs.filter(id => id !== notificationServiceId)})\r\n    )\r\n  }\r\n\r\n  handleChangeNotificationEvent = (notificationEventId: number, value: boolean) => {\r\n    this.setState((prev) => ({...prev, checkedNotificationEventIDs: value\r\n      ? [...prev.checkedNotificationEventIDs, notificationEventId]\r\n      : prev.checkedNotificationEventIDs.filter(id => id !== notificationEventId)})\r\n    )\r\n  }\r\n\r\n  handleChangeNotificationMethod = (notificationMethodId: number, value: boolean) => {\r\n    this.setState((prev) => ({...prev, checkedNotificationMethodIDs: value\r\n      ? [...prev.checkedNotificationMethodIDs, notificationMethodId]\r\n      : prev.checkedNotificationMethodIDs.filter(id => id !== notificationMethodId)})\r\n    )\r\n  }\r\n\r\n  handleChangeShowNotifications = (value: boolean) => {\r\n    this.setState((prev) => ({...prev, showNotifications: value}))\r\n  }\r\n\r\n  render() {\r\n    const { isCompanyAdmin, isPortalAdmin, isUser, isSiteAdmin, LoginName, showNewUser } = this.props\r\n    const { loading, saving, firstName, firstNameValid, lastName, lastNameValid, roleId, roleValid, email, emailAvailable, emailChecked, emailValid,\r\n      roles, inactive, userInfo, revoking, resettingPassword, canShowDetailsToPerson, showAdditionalPhone, showAdditionalRoles, \r\n      performingResetLoginAttempts, performingRemoveDuplicateRoles, performingDeleteUser, performingDeleteRole, selectedLocation } = this.state\r\n    const disableButtons = loading || !userInfo\r\n    const { mode } = this.props\r\n    const isPersonal = mode === UserInfoMode.Personal\r\n    const title = isPersonal ? \"MY INFORMATION\" : \"OUR TEAM'S INFORMATION\"\r\n    const readonlyUserName = isPersonal || (isUser && !isSiteAdmin)\r\n    const phone = FormatPhone(this.state.phone)\r\n    const phoneValid = isSiteAdmin ? PhoneRegexp.test(phone) : true\r\n    const locationRequired = this.props.isPortalAdmin ? \"required\" : \"\"\r\n    const isShowAdditionalRole = !isPersonal && !isCompanyAdmin && !isPortalAdmin\r\n    const emailExists = emailChecked && !emailAvailable && showNewUser\r\n    const disableSaveButton = !emailExists ? loading || !this.isValid() || (!emailAvailable && showNewUser) || !phoneValid : loading || !this.isValid(true)\r\n    const roleID = this.props.roleId || this.state.roleId\r\n    \r\n    const formRows = <>\r\n      {isSiteAdmin && <Form.Group as={Row}>\r\n        <Form.Label column lg={3}>Failed Login Attempts: {this.props.LoginAttempts} of {MaxFailedLoginAttempts}</Form.Label>\r\n        <Col lg={3}>\r\n          <ActionButton className=\"fixed-w10\" onClick={() => this.setState({ showResetLoginAttemptsConfirmation: true })} spin={performingResetLoginAttempts} disableOnSpin>Reset</ActionButton>\r\n        </Col>\r\n      </Form.Group>}\r\n      {isSiteAdmin && <Form.Group as={Row}>\r\n        <Form.Label column lg={3}>Duplicate Roles</Form.Label>\r\n        <Col lg={3}>\r\n          <ActionButton className=\"fixed-w10\" onClick={() => this.setState({ showRemoveDuplicateRolesConfirmation: true })} spin={performingRemoveDuplicateRoles} disableOnSpin>Remove</ActionButton>\r\n        </Col>\r\n      </Form.Group>}\r\n      {isSiteAdmin && <Form.Group as={Row}>\r\n        <Form.Label column lg={3}>Delete User</Form.Label>\r\n        <Col lg={3}>\r\n          <ActionButton className=\"fixed-w10\" onClick={() => this.setState({ showDeleteUserConfirmation: true })} spin={performingDeleteUser} disableOnSpin>Delete</ActionButton>\r\n        </Col>\r\n      </Form.Group>}\r\n      {!isPersonal && !emailExists && <Row className=\"justify-content-end form-group\">\r\n        <Col sm={2}>\r\n          <Checkbox id=\"inactive\" label=\"Inactive\" onChange={this.handleInactiveChange} checked={inactive} />\r\n        </Col>\r\n      </Row>}\r\n      {!isPersonal && !showNewUser && <Form.Group as={Row} className=\"required\">\r\n        <Form.Label column lg={2}>Login Name</Form.Label>\r\n        <Col lg={7}>\r\n          <Form.Control type=\"text\" readOnly defaultValue={LoginName} className=\"bg-white\" />\r\n        </Col>\r\n      </Form.Group>}\r\n      <Form.Group as={Row} className=\"required\">\r\n        <Form.Label column lg={2}>User's Email</Form.Label>\r\n        <Col lg={7}>\r\n          {isPersonal && <Form.Control type=\"text\" readOnly={readonlyUserName} defaultValue={userInfo?.UserName} className=\"bg-white\" />}\r\n          {!isPersonal && <Form.Control type=\"text\" id=\"email\" readOnly={!showNewUser} defaultValue={email} className=\"bg-white\" onChange={this.handleEmailChange} onBlur={this.handleEmailBlur} isInvalid={!emailValid} />}\r\n          {showNewUser && <>\r\n            {!emailValid && <Form.Control.Feedback type=\"invalid\" className=\"d-block\">Please enter valid email</Form.Control.Feedback>}\r\n            {emailChecked && emailAvailable && < Form.Control.Feedback type=\"valid\" className=\"d-block\">Email is available</Form.Control.Feedback>}\r\n            {emailExists && <Form.Control.Feedback type=\"invalid\" className=\"d-block\">Email is already in use</Form.Control.Feedback>}\r\n          </>}\r\n        </Col>\r\n      </Form.Group>\r\n      {!emailExists && <Form.Group as={Row} className=\"required\">\r\n        <Form.Label column lg={2}>Personal Phone</Form.Label>\r\n        <Col lg={7}>\r\n          {isSiteAdmin || showNewUser && <Form.Control type=\"text\" as={MaskedInput} mask=\"111-111-1111\" value={phone} onChange={this.handlePhoneChange} className=\"bg-white\" isInvalid={!phoneValid} />}\r\n          {!isSiteAdmin && !showNewUser && <Form.Control type=\"text\" readOnly defaultValue={phone} value={phone} className=\"bg-white\" />}\r\n        </Col>\r\n        <Col lg={3} className=\"pt-1 pt-lg-0\">\r\n          <Button variant=\"secondary\" onClick={() => this.setState({ showAdditionalPhone: true })} disabled={disableButtons} className=\"fixed-w10\">Edit Phone Number</Button>\r\n        </Col>\r\n      </Form.Group>}\r\n      {!emailExists && <Form.Group as={Row} className=\"required\">\r\n        <Form.Label column lg={2}>First Name</Form.Label>\r\n        <Col lg={7}>\r\n          <Form.Control type=\"text\" value={firstName} className=\"bg-white\" onChange={this.handleFirstNameChange} isInvalid={!firstNameValid} />\r\n        </Col>\r\n        {!isPersonal && <Col lg={3} className=\"pt-1 pt-lg-0\">\r\n          <ActionButton variant=\"secondary\" disabled={disableButtons} className=\"fixed-w10\" onClick={() => this.setState({ showResetPasswordConfirmation: true })} spin={resettingPassword} disableOnSpin>Reset Password</ActionButton>\r\n        </Col>}\r\n      </Form.Group>}\r\n      {!emailExists && <Form.Group as={Row} className=\"required\">\r\n        <Form.Label column lg={2}>Last Name</Form.Label>\r\n        <Col lg={7}>\r\n          <Form.Control type=\"text\" value={lastName} className=\"bg-white\" onChange={this.handleLastNameChange} isInvalid={!lastNameValid} />\r\n        </Col>\r\n      </Form.Group>}\r\n      <Form.Group as={Row} className=\"required\">\r\n        <Form.Label column lg={2}>User's Role(s)</Form.Label>\r\n        <Col lg={7}>\r\n          {!showNewUser && <Form.Control type=\"text\" readOnly defaultValue={userInfo?.AssociatedRole && userInfo?.AssociatedRole.length > 0 ? userInfo?.AssociatedRole.find(i => i.RoleID === roleID)?.Title  : \"\"} className=\"bg-white\" />}\r\n          {showNewUser && <Form.Control id=\"role\" as=\"select\" onChange={this.handleRoleChange} value={roleId} isInvalid={!roleValid} className=\"bg-white\" >\r\n            <option value=\"\">Select</option>\r\n            {roles?.map((role: Role) => <option value={role.RoleID} key={role.RoleID}>{role.Title}</option>)}\r\n          </Form.Control>}\r\n        </Col>\r\n        {isShowAdditionalRole && <Col lg={3} className=\"pt-1 pt-lg-0\">\r\n          <Button variant=\"secondary\" onClick={() => this.setState({ showAdditionalRoles: true })} disabled={disableButtons} className=\"fixed-w10\">Additional Role</Button>\r\n        </Col>}\r\n        {!isPersonal && (isCompanyAdmin || isPortalAdmin) &&\r\n        <Col lg={3}>\r\n          <ActionButton className=\"fixed-w10\" onClick={() => this.setState({ showDeleteRoleConfirmation: true })} spin={performingDeleteRole} disableOnSpin>Delete Role</ActionButton>\r\n        </Col>}\r\n      </Form.Group>\r\n      {showNewUser && this.props.isPortalAdmin && <Form.Group as={Row} className=\"required\">\r\n        <Form.Label column sm={2} htmlFor=\"company\">Company</Form.Label>\r\n        <Col sm={7}>\r\n          <CompanyInput onChange={items => this.handleCompanyChange(items[0])} placeholder=\"Choose a company...\" />\r\n        </Col>\r\n      </Form.Group>}\r\n      {showNewUser && ((this.props.isPortalAdmin && this.isLocationAdministrator()) || !this.props.isPortalAdmin) && <Form.Group as={Row} className={locationRequired}>\r\n        <Form.Label column sm={2} htmlFor=\"Location\">Locations</Form.Label>\r\n        <Col sm={7}>\r\n          <Form.Control id=\"location\" as=\"select\" value={selectedLocation?.AccountID} onChange={this.handleLocationChange}>\r\n            <option value=\"\">Select</option>\r\n            {(this.state.locations || []).map(l => <option value={l.AccountID} key={l.AccountID}>{l.Name}</option>)}\r\n          </Form.Control>\r\n        </Col>\r\n      </Form.Group>}\r\n\r\n      {isPersonal && (isCompanyAdmin || (!isSiteAdmin && canShowDetailsToPerson)) && <Form.Group as={Row}>\r\n        <Col>\r\n          <span>Control who can view Orders placed by other users</span>\r\n          <Button variant=\"primary\" disabled={disableButtons} onClick={() => this.setState({ showOrderSecurityOverride: true })} className=\"ml-2\">Details to Person</Button>\r\n        </Col>\r\n      </Form.Group>}\r\n    </>\r\n    const modalContent = <>\r\n    <Modal.Header closeButton={!isPersonal}>\r\n      <Modal.Title>{title}</Modal.Title>\r\n    </Modal.Header>\r\n      <Modal.Body>\r\n        <Form>\r\n          {loading && <Row><Col className=\"text-center\"><Spinner animation=\"border\" variant=\"secondary\" /></Col></Row>}\r\n          {!loading && formRows}\r\n          {!loading && !emailExists && ((isSiteAdmin && !isPersonal) || !isSiteAdmin) && (\r\n            <NotificationSelection\r\n              participationId={this.state.userInfo?.ParticipationID}\r\n              showNotifications={this.state.showNotifications}\r\n              canViewOrderTrackingGrid={this.state.userInfo?.UserAccessViewModel?.CanViewOrderTrackingGrid}\r\n              checkedNotificationServiceIDs={this.state.checkedNotificationServiceIDs}\r\n              checkedNotificationEventIDs={this.state.checkedNotificationEventIDs}\r\n              checkedNotificationMethodIDs={this.state.checkedNotificationMethodIDs}\r\n              onCheckNotificationService={this.handleChangeNotificationService}\r\n              onCheckNotificationEvent={this.handleChangeNotificationEvent}\r\n              onCheckNotificationMethod={this.handleChangeNotificationMethod}\r\n              onCheckShowNotifications={this.handleChangeShowNotifications}\r\n            />\r\n          )}\r\n        </Form>\r\n      </Modal.Body>\r\n      <Modal.Footer>\r\n        {mode === UserInfoMode.Team && <>\r\n          {false && <ActionButton variant=\"secondary\" disabled={disableButtons} onClick={() => this.setState({ showRevokeConfirmation: true })} spin={revoking} disableOnSpin className=\"mr-2 fixed-w5\">Revoke</ActionButton>}\r\n          <Button variant=\"secondary\" onClick={this.performClose} className=\"mr-2 fixed-w5\">Cancel/Close</Button>\r\n        </>}\r\n        {isPersonal && <>\r\n          <Button variant=\"secondary\" onClick={this.performClose} className=\"mr-2 fixed-w5\">Cancel</Button>\r\n        </>}\r\n        <ActionButton variant=\"primary\" className=\"fixed-w5\" disabled={disableSaveButton} onClick={this.handleSave} spin={saving} disableOnSpin>{this.props.showNewUser ? 'Save' : 'Update'}</ActionButton>\r\n      </Modal.Footer>\r\n    </>\r\n\r\n    return <>\r\n      <AdditionalAssociatedDataModal data={userInfo?.AssociatedPhone || []} type={AssociatedDataType.Phone} show={showAdditionalPhone} onSave={this.handlePhoneChangeByEditModal} onClose={() => this.setState({ showAdditionalPhone: false })} />\r\n      <AdditionalRoleModal\r\n        onSaveTimeZoneId={timeZoneId => this.setState({ timeZoneId: timeZoneId })}\r\n        timeZones={this.state.timeZones}\r\n        timeZoneId={this.props.timeZoneId}\r\n        data={userInfo?.AssociatedRole || []}\r\n        show={showAdditionalRoles}\r\n        onSave={data => this.setState({ showAdditionalRoles: false, userInfo: { ...this.state?.userInfo, AssociatedRole: data || [] } as UserInformation })}\r\n        onClose={() => this.setState({ showAdditionalRoles: false })}\r\n        userInfo={userInfo}\r\n      />\r\n      {isPersonal && <Modal.Dialog size=\"xl\">{modalContent}</Modal.Dialog>}\r\n      {!isPersonal && <Modal backdrop=\"static\" size=\"xl\" show={this.props.show} onHide={this.performClose}>{modalContent}</Modal>}\r\n      <ConfirmationModal show={this.state.showRevokeConfirmation}\r\n        title=\"CONFIRM REVOKE\"\r\n        textTitle=\"Are you sure you want to revoke?\"\r\n        text=\"\"\r\n        onConfirm={this.performRevoke}\r\n        onHide={() => this.setState({ showRevokeConfirmation: false })} />\r\n      <ConfirmationModal show={this.state.showResetPasswordConfirmation}\r\n        title=\"CONFIRM PASSWORD RESET\"\r\n        textTitle=\"Are you sure you want to continue?\"\r\n        text=\"\"\r\n        onConfirm={this.performPasswordReset}\r\n        onHide={() => this.setState({ showResetPasswordConfirmation: false })} />\r\n      {this.state.showResetLoginAttemptsConfirmation && <ConfirmationModal show\r\n        title=\"CONFIRM RESET LOGIN ATTEMPTS\"\r\n        textTitle=\"Are you sure you want to continue?\"\r\n        text=\"All login attempts for this user will be reset\"\r\n        onConfirm={this.performResetLoginAttempts}\r\n        onHide={() => this.setState({ showResetLoginAttemptsConfirmation: false })} />}\r\n      {this.state.showRemoveDuplicateRolesConfirmation && <ConfirmationModal show\r\n        title=\"CONFIRM REMOVE DUPLICATE ROLES\"\r\n        textTitle=\"Are you sure you want to continue?\"\r\n        text=\"Roles will be reset to the initial state\"\r\n        onConfirm={this.performRemoveDuplicateRoles}\r\n        onHide={() => this.setState({ showRemoveDuplicateRolesConfirmation: false })} />}\r\n      {this.state.showDeleteUserConfirmation && <ConfirmationModal show\r\n        title=\"CONFIRM DELETE USER\"\r\n        textTitle=\"Are you sure you want to continue?\"\r\n        text=\"All user data will be erased\"\r\n        onConfirm={this.performDeleteUser}\r\n        onHide={() => this.setState({ showDeleteUserConfirmation: false })} />}\r\n      {this.state.showDeleteRoleConfirmation && <ConfirmationModal show\r\n        title=\"CONFIRM DELETE USER ROLE\"\r\n        textTitle=\"Are you sure you want to continue?\"\r\n        text=\"User role will be removed if it is not the only role for this user\"\r\n        onConfirm={this.performDeleteRole}\r\n        onHide={() => this.setState({ showDeleteRoleConfirmation: false })} />}\r\n      <OrderSecurityOverride show={this.state.showOrderSecurityOverride}\r\n        userInfo={this.state.userInfo}\r\n        onClose={() => this.setState({ showOrderSecurityOverride: false })} />\r\n    </>\r\n  }\r\n}\r\n\r\nfunction mapStateToProps(state: AppState): UserInfoAuthProps {\r\n  return {\r\n    isLocationAdmin: isLocationAdmin(state),\r\n    isCompanyAdmin: isCompanyAdmin(state),\r\n    isPortalAdmin: isPortalAdmin(state),\r\n    isSiteAdmin: isSiteAdmin(state),\r\n    isUser: isUser(state),\r\n    UserName: getUserNameForSelectedCompany(state),\r\n    PrimaryRoleID: RoleIdForSelectedCompany(state),\r\n  }\r\n}\r\nconst ConnectedUserInfo = connect(mapStateToProps, null)(UserInfo)\r\nexport default ConnectedUserInfo\r\n","import { ObservableFromFetch } from \"../ObservableFromFetch\"\r\nimport TimeZoneData from \"./Model/TimeZoneData\"\r\n\r\nexport default function TimeZoneListGet() {\r\n  return ObservableFromFetch<TimeZoneData[]>(\"Order/GetTimeZones\")\r\n}","import { ObservableFromFetch } from \"../ObservableFromFetch\"\r\nimport Role from \"./Model/Role\"\r\n\r\nexport default function UserRolesGetObservable(link?: string) {\r\n  const requestBody: string = JSON.stringify(link ? { Link: link } : {})\r\n  return ObservableFromFetch<Role[]>(\"FFOrderRolePermission/GetUserRoles\", requestBody)\r\n}\r\n\r\nexport function GetRolesToInvite() {\r\n  return ObservableFromFetch<Role[]>(\"FFOrderUserInvitation/GetRolesToInvite\")\r\n}\r\n\r\nexport function GetRoleDroplist(roleID: number) {\r\n  const requestBody: string = new URLSearchParams({\r\n    roleID: roleID.toString()\r\n  }).toString()\r\n\r\n  return ObservableFromFetch<Role[]>(\"FFOrderUserInvitation/GetRoleDroplistByID?\" + requestBody)\r\n}\r\n\r\nexport function GetRoles(roleID: number, link?: string) {\r\n  const requestParams = link ? { roleID: roleID.toString(), Link: link } : { roleID: roleID.toString() }\r\n  const requestBody: string = JSON.stringify(requestParams).toString()\r\n\r\n  return ObservableFromFetch<Role[]>(\"FFOrderUserInvitation/GetRole\", requestBody)\r\n}\r\n\r\nexport function GetRolesPerLink(link: string) {\r\n  const requestBody: string = JSON.stringify({ Link: link }).toString()\r\n  return ObservableFromFetch<Role[]>(\"FFOrderUserInvitation/GetRole\", requestBody)\r\n}\r\n","import { ObservableFromFetch } from \"../ObservableFromFetch\"\r\n\r\nexport default function CheckExistingUser(params: {UserName: string, Link?: string}) {\r\n  const requestBody = JSON.stringify(params)\r\n  return ObservableFromFetch<string>(\"FFOrderUserInvitation/CheckExistingUser\", requestBody)\r\n}","import { ObservableFromFetch } from \"../ObservableFromFetch\"\r\n\r\nexport default function ResetLoginAttempts(userName: string) {\r\n  const requestBody: string = new URLSearchParams({ UserName: userName.toString() }).toString()\r\n  return ObservableFromFetch<string>(\"WorkforceSuperUser/ResetLoginAttempts?\" + requestBody, \"post\")\r\n}\r\n","import { ObservableFromFetch } from \"../ObservableFromFetch\"\r\n\r\nexport default function RemoveDuplicateRoles(userName: string) {\r\n  const requestBody: string = new URLSearchParams({ UserName: userName.toString() }).toString()\r\n  return ObservableFromFetch<string>(\"WorkforceSuperUser/RemoveDuplicateRoles?\" + requestBody, \"post\")\r\n}\r\n","import { ObservableFromFetch } from \"../ObservableFromFetch\"\r\n\r\nexport default function DeleteUser(userName: string) {\r\n  const requestBody: string = new URLSearchParams({ UserName: userName.toString() }).toString()\r\n  return ObservableFromFetch<string>(\"WorkforceSuperUser/DeleteUser?\" + requestBody, \"post\")\r\n}\r\n\r\nexport function DeleteRole(applicationUserID: number, participationID: number) {\r\n  const requestBody = JSON.stringify({ ApplicationUserID: applicationUserID, ParticipationID: participationID }).toString()\r\n  return ObservableFromFetch<string>(\"FFOrderUserFileMaintenance/DeleteRole\", requestBody)\r\n}","import * as React from \"react\"\r\nimport { connect } from \"react-redux\"\r\nimport { RouteComponentProps } from \"react-router\"\r\nimport { AppState, AssignedClinic, WorkforceClinicPortal } from \"../../AppState\"\r\nimport { getUserNameForSelectedCompany, getLoggedInUserName, GetSelectedAssignedClinic, GetSelectedPortal } from \"../../authentication/SelectedCompany/CompanySelectionDrivenSelectors\"\r\nimport { Home } from \"../../config/Routes\"\r\nimport UserInfo, { UserInfoMode } from \"../Administration/UserInfo\"\r\nimport { AppPageWrapper } from \"../NavMenu/AppPageWrapper\"\r\n\r\ninterface MyInformationProps {\r\n  LoginName: string\r\n  AssignedClinic: AssignedClinic | null\r\n  Portal?: WorkforceClinicPortal\r\n}\r\n\r\nexport class MyInformation extends React.Component<MyInformationProps & RouteComponentProps> {\r\n  handleClose = () => (this.props as RouteComponentProps).history?.push(Home)\r\n\r\n  render() {\r\n    const locationID = this.props.AssignedClinic?.LocationID\r\n    const participationId = this.props.Portal?.ParticipationID || this.props.AssignedClinic?.ParticipationID\r\n\r\n    return <AppPageWrapper showNav>\r\n      <UserInfo mode={UserInfoMode.Personal} LoginName={this.props.LoginName} locationId={locationID} participationId={Number(participationId)} show onClose={() => this.handleClose()} />\r\n    </AppPageWrapper>\r\n  }\r\n}\r\n\r\nfunction mapStateToProps(state: AppState): MyInformationProps {\r\n  return {\r\n    LoginName: getLoggedInUserName(state),\r\n    AssignedClinic: GetSelectedAssignedClinic(state),\r\n    Portal: GetSelectedPortal(state)\r\n  }\r\n}\r\n\r\nconst ConnectedMyInformation = connect(mapStateToProps, null)(MyInformation)\r\nexport default ConnectedMyInformation\r\n","import UserDetail from \"./Model/UserDetail\"\r\nimport { ObservableFromFetch } from \"../ObservableFromFetch\"\r\nimport GridResponse from \"../GridResponse\"\r\nimport { Filter, Sort } from \"../GridRequest\"\r\n\r\nconst Columns = [\"Account\", \"InActive\", \"LastLogin\", \"LoginName\", \"Role\", \"UserName\", \"ProfileStatuses\", \"SendingFacility\", \"InvitationSent\", \"EnrollmentStarted\", \"Status\"] as const\r\ntype Column = typeof Columns[number]\r\n\r\nexport type ColumnFilters = Record<Column, string[]>\r\nexport type UserDetailGridResponse = GridResponse<UserDetail> & ColumnFilters\r\n\r\nfunction columnFilters(filters: Filter[]): ColumnFilters {\r\n  return {\r\n    Account: filters.find(filter => filter.column === \"Account\")?.values || [],\r\n    InActive: filters.find(filter => filter.column === \"InActive\")?.values.map(status => {return status === \"Inactive\" ? \"true\" : \"false\"}) || [],\r\n    LoginName: filters.find(filter => filter.column === \"LoginName\")?.values || [],\r\n    LastLogin: filters.find(filter => filter.column === \"LastLogin\")?.values || [],\r\n    Role: filters.find(filter => filter.column === \"Role\")?.values || [],\r\n    UserName: filters.find(filter => filter.column === \"UserName\")?.values || [],\r\n    ProfileStatuses: filters.find(filter => filter.column === \"ProfileStatuses\")?.values || [],\r\n    SendingFacility: filters.find(filter => filter.column === \"SendingFacility\")?.values || [],\r\n    InvitationSent: filters.find(filter => filter.column === \"ModifiedOn\")?.values || [],\r\n    EnrollmentStarted: filters.find(filter => filter.column === \"EnrollmentStarted\")?.values || [],\r\n    Status: filters.find(filter => filter.column === \"Status\")?.values || [],\r\n  }\r\n}\r\n\r\nexport default function UserDetailsObservable(pageNumber: number, pageSize: number, sort: Sort, filters: Filter[], implementationID: number | undefined = undefined, companyID: number | undefined = undefined) {\r\n  var params: object = {\r\n    Filters: columnFilters(filters),\r\n    IsQuickStart: false,\r\n    PageNumber: pageNumber,\r\n    PageSize: pageSize || 20,\r\n    SortGrid: { SortColumn: sort.column || \"\", SortOrder: sort.order.toUpperCase() === \"DESC\" ? \"DSC\" : sort.order.toUpperCase()},\r\n    ImplementationID: implementationID || 0,\r\n    CompanyID: companyID || 0\r\n  }\r\n\r\n  const requestBody: string = JSON.stringify(params)\r\n  return ObservableFromFetch<UserDetailGridResponse>(\"FFOrderUserFileMaintenance/GetUserDetails\", requestBody)\r\n}\r\n\r\nexport function UserDetailsCSVObservable(isSiteAdmin: boolean, pageNumber: number, pageSize: number, sort: Sort, filters: Filter[], implementationID: number | undefined = undefined, companyID: number | undefined = undefined) {\r\n  var params: object = {\r\n    Filters: columnFilters(filters),\r\n    IsQuickStart: false,\r\n    PageNumber: pageNumber,\r\n    PageSize: pageSize || 20,\r\n    isSiteAdmin: isSiteAdmin,\r\n    SortGrid: { SortColumn: sort.column || \"\", SortOrder: sort.order.toUpperCase() === \"DESC\" ? \"DSC\" : sort.order.toUpperCase() }\r\n  }\r\n  if (implementationID) {\r\n    params = { ...params, ImplementationID: implementationID }\r\n  }\r\n  if (companyID) {\r\n    params = { ...params, CompanyID: companyID }\r\n  }\r\n  const requestBody: string = JSON.stringify(params)\r\n  return ObservableFromFetch<string>(\"FFOrderUserFileMaintenance/GetUserDetailsCSV\", requestBody)\r\n}\r\n\r\n\r\n\r\n","import { ObservableFromFetch } from \"../ObservableFromFetch\"\r\nimport { ImplementationGroupID_Workforce } from \"../../config/Constants\"\r\nimport ImplementationData from \"./Model/ImplementationData\"\r\nimport GridResponse from \"../GridResponse\"\r\n\r\nexport type UserDetailGridResponse = GridResponse<ImplementationData>\r\n\r\nexport default function ImplementationsGetObservable() {\r\n  const requestBody: string = JSON.stringify({ ImplementationGroupID: ImplementationGroupID_Workforce, SortGrid: { SortColumn: \"Name\", SortOrder: \"ASC\" }, ReturnAll: true })\r\n  return ObservableFromFetch<UserDetailGridResponse>(\"/SuperUser/ImplementationDetails\", requestBody)\r\n}\r\n","// WARNING: \"Invite Status\" column filter values on the Invitation Status Grid are displayed when enum\r\n// keys are matching API response, modifying enum keys can lead to values being displayed incorrectly.\r\nexport enum InvitationStatus {\r\n  INVITATION_REQUESTED = 1,\r\n  INVITATION_STILL_IN_PROCESS = 2,\r\n  TOO_MANY_ATTEMPT = 3,\r\n  INVALID_URL = 4,\r\n  PENDING = 5,\r\n  EXPIRED = 6,\r\n  STARTED = 7,\r\n  PASSWORD_SET = 8,\r\n  USER_CONFIGURED = 9,\r\n  CLINIC_CONFIGURED = 10,\r\n  CLIENT_CONFIGURED = 11,\r\n  COMPLETED = 12,\r\n  VALIDATE_PIN = 13,\r\n  LINK_ALREADY_USED = 14,\r\n  INVITATION_IN_USE = 15\r\n}\r\n\r\nconst InvitationStatusMap = new Map<InvitationStatus, string>([\r\n  [InvitationStatus.INVITATION_REQUESTED, \"Invitation Requested\"],\r\n  [InvitationStatus.INVITATION_STILL_IN_PROCESS, \"Invitation Still In Process\"],\r\n  [InvitationStatus.TOO_MANY_ATTEMPT, \"Too Many Attempts\"],\r\n  [InvitationStatus.INVALID_URL, \"Invalid URL\"],\r\n  [InvitationStatus.PENDING, \"Pending\"],\r\n  [InvitationStatus.EXPIRED, \"Expired\"],\r\n  [InvitationStatus.STARTED, \"Started\"],\r\n  [InvitationStatus.PASSWORD_SET, \"Password Set\"],\r\n  [InvitationStatus.USER_CONFIGURED, \"User Configured\"],\r\n  [InvitationStatus.CLINIC_CONFIGURED, \"Portal Configured\"],\r\n  [InvitationStatus.CLIENT_CONFIGURED, \"Company Configured\"],\r\n  [InvitationStatus.COMPLETED, \"Complete\"]\r\n])\r\n\r\nconst InvitationInverseMap = new Map<string, InvitationStatus>(Array.from(InvitationStatusMap, entry => [entry[1], entry[0]]))\r\n\r\nexport function getStatusLabelByKey(key: InvitationStatus) {\r\n  return InvitationStatusMap.get(key) || \"\"\r\n}\r\n\r\nexport function getStatusKeyByLabel(label: string) {\r\n  const stringKey = InvitationInverseMap.get(label)\r\n  if (stringKey) {\r\n    return InvitationStatus[stringKey]\r\n  }\r\n}\r\n","import FileSaver from \"file-saver\"\r\nimport React from \"react\"\r\nimport { Modal, Form, Col, Row, Button, Container, ProgressBar } from \"react-bootstrap\"\r\nimport { toast } from \"react-toastify\"\r\nimport { Observable, Subject, Subscription, timer } from \"rxjs\"\r\nimport { scan, startWith, switchMap, takeWhile } from \"rxjs/operators\"\r\nimport { APIError } from \"../../api/ObservableFromFetch\"\r\nimport { MaxFileNameLength, MaxImageFileSize } from \"../../config/Constants\"\r\nimport ActionButton from \"../ActionButton\"\r\n\r\ninterface CSVUploadModalProps {\r\n  show: boolean\r\n  title: string\r\n  templateCSVUrl: string\r\n  children?: React.ReactNode\r\n  onCancel: () => void\r\n  onStartUpload: (fileName: string, fileContent: string) => Observable<string>\r\n  onUploaded: () => void\r\n}\r\n\r\ninterface CSVUploadModalState {\r\n  fileInputKey: string\r\n  fileName?: string\r\n  fileContent?: string\r\n  isFileNameValid: boolean\r\n  isFileSizeValid: boolean\r\n  uploadPercentage?: number\r\n  uploading: boolean\r\n  uploadStatus?: boolean\r\n}\r\n\r\nexport default class CSVUploadModal extends React.PureComponent<CSVUploadModalProps, CSVUploadModalState> {\r\n  state: CSVUploadModalState = {\r\n    fileInputKey: \"fileInputKey\",\r\n    fileName: undefined,\r\n    fileContent: undefined,\r\n    isFileNameValid: true,\r\n    isFileSizeValid: true,\r\n    uploadPercentage: undefined,\r\n    uploading: false\r\n  }\r\n\r\n  fileUploadProgressSubscription?: Subscription\r\n  fileUploadSubscription?: Subscription\r\n  fileUploadProgress$ = new Subject()\r\n  file = React.createRef<HTMLInputElement>()\r\n\r\n  componentDidMount() {\r\n    this.fileUploadProgressSubscription = this.fileUploadProgress$.pipe(\r\n      switchMap(value =>\r\n        timer(0, 300).pipe(\r\n          startWith(0),\r\n          scan((acc, curr) => acc + 5),\r\n          takeWhile(value => value <= 95 && this.state.uploadStatus === undefined)\r\n        ))\r\n    ).subscribe(\r\n      (value: number) => this.setState({ uploadPercentage: value })\r\n    )\r\n  }\r\n\r\n  componentWillUnmount() {\r\n    this.fileUploadProgressSubscription && this.fileUploadProgressSubscription.unsubscribe()\r\n    this.fileUploadSubscription && this.fileUploadSubscription.unsubscribe()\r\n  }\r\n\r\n  handleFileSelect = (e: React.ChangeEvent<HTMLInputElement>) => {\r\n    const file = e.target && e.target.files && e.target.files[0]\r\n    if (!file) {\r\n      return\r\n    }\r\n    const fileName = file.name\r\n    const isFileNameValid = fileName.length < MaxFileNameLength\r\n    const isFileSizeValid = file.size < MaxImageFileSize\r\n    this.setState({ isFileNameValid: isFileNameValid, isFileSizeValid: isFileSizeValid })\r\n    if (isFileNameValid && isFileSizeValid) {\r\n      const ext = file.name.substring(file.name.lastIndexOf('.') + 1)\r\n      if (ext && \"csv\" === ext.toLowerCase()) {\r\n        var reader = new FileReader()\r\n        const self = this\r\n        reader.onload = function (e) {\r\n          const result = e.target?.result as string || \"\"\r\n          const stringLength = result.indexOf('base64') + 7\r\n          const fileContent = result.slice(stringLength, result.length)\r\n          if (fileContent) {\r\n            self.setState({ fileName: file.name, fileContent: fileContent, uploadStatus: undefined, uploadPercentage: undefined })\r\n          } else {\r\n            toast.error(\"CSV file is empty.\")\r\n          }\r\n        }\r\n        reader.onerror = function (error) { toast.error(error) }\r\n        reader.readAsDataURL(file)\r\n      } else {\r\n        toast.error(\"Please upload only text documents. Download the Example Spreadsheet as a starter.\")\r\n      }\r\n    }\r\n  }\r\n\r\n  handleUpload = () => {\r\n    this.fileUploadSubscription && this.fileUploadSubscription.unsubscribe()\r\n    this.setState({ uploading: true, uploadStatus: undefined })\r\n    this.fileUploadSubscription = this.props.onStartUpload(this.state.fileName || \"\", this.state.fileContent || \"\").subscribe(\r\n      (data: string) => {\r\n        this.setState({ uploadStatus: true, uploadPercentage: 100, uploading: false })\r\n        this.export(data, this.state.fileName || \"data.csv\")\r\n        this.props.onUploaded()\r\n      },\r\n      error => this.handleAPIError(error, { uploadStatus: false, uploading: false })\r\n    )\r\n    this.fileUploadProgress$.next()\r\n  }\r\n\r\n  handleAPIError = (error: Error | APIError, stateChanges: object) => {\r\n    this.setState(stateChanges)\r\n    error && toast.error((error as APIError)?.errorData?.message || error.message)\r\n  }\r\n\r\n  export(csv: string, fileName: string) {\r\n    const csvData = new Blob([csv], { type: 'text/csv;charset=utf-8;' })\r\n    FileSaver.saveAs(csvData, fileName)\r\n    toast.success(\"CSV file downloaded successfully.\")\r\n  }\r\n\r\n  render() {\r\n    const { uploading, fileName, fileContent, isFileNameValid, isFileSizeValid, uploadPercentage, uploadStatus } = this.state\r\n    const disableUpload = !fileContent || !isFileNameValid || !isFileSizeValid || uploadPercentage !== undefined\r\n    return (\r\n      <Modal backdrop=\"static\" show={this.props.show} size=\"lg\">\r\n        <Modal.Header>\r\n          <Modal.Title className=\"text-uppercase\">{this.props.title}</Modal.Title>\r\n        </Modal.Header>\r\n        <Modal.Body>\r\n          <Container fluid>\r\n            <Row>\r\n              <Col lg={8}>{this.props.children}</Col>\r\n              <Col lg={4} className=\"text-right\">\r\n                <Button variant=\"primary\" href={this.props.templateCSVUrl}>Download Example<br />Spreadsheet</Button>\r\n              </Col>\r\n            </Row>\r\n            <Row className=\"form-group\">\r\n              <Col lg={8}><Form.Control type=\"text\" value={fileName || \"\"} readOnly className=\"bg-white border-0 shadow-none\" /></Col>\r\n              <Col lg={4} className=\"text-right\">\r\n                <input type=\"file\" ref={this.file} accept=\".csv\" onChange={this.handleFileSelect} style={{ display: 'none' }} />\r\n                <Button variant=\"secondary\" onClick={() => { this.file && this.file.current && this.file.current.click() }}>Browse</Button>\r\n              </Col>\r\n            </Row>\r\n            {!isFileNameValid && <Row><Col className=\"text-center error-message\">The file name should be less than 200 characters. Please rename the file.</Col></Row>}\r\n            {!isFileSizeValid && <Row><Col className=\"text-center error-message\">Please select file of size maximum 1 MB</Col></Row>}\r\n            {!!fileContent && !!uploadPercentage && <>\r\n              <Row className=\"form-group\">\r\n                <Col lg={{ span: 7, order: 2, offset: 3 }}>\r\n                  <ProgressBar now={uploadPercentage} label={uploadPercentage && uploadPercentage < 100 ? `${uploadPercentage}%` : \"Complete\"} />\r\n                </Col>\r\n              </Row>\r\n            </>}\r\n            {uploadStatus === false && <Row><Col className=\"text-center error-message\">Error Occurred</Col></Row>}\r\n          </Container>\r\n        </Modal.Body>\r\n        <Modal.Footer>\r\n          <Button variant=\"secondary\" onClick={this.props.onCancel} className=\"mr-2\">Cancel</Button>\r\n          <ActionButton variant=\"primary\" disabled={disableUpload} onClick={this.handleUpload} spin={uploading} disableOnSpin>Upload Spreadsheet</ActionButton>\r\n        </Modal.Footer>\r\n      </Modal>\r\n    )\r\n  }\r\n}\r\n","import { ObservableFromFetch } from \"../ObservableFromFetch\"\r\n\r\nexport function CreateSiteAdministrator(email: string, phone: string, link: string, roleId: number) {\r\n  const requestBody: string = JSON.stringify({\r\n    EmailAddress: email,\r\n    Link: link,\r\n    PhoneNumber: phone,\r\n    RoleID: roleId,\r\n  })\r\n\r\n  return ObservableFromFetch<string>(\"FFOrderClinicEnrollment/CreateSiteAdministrator\", requestBody)\r\n}\r\n\r\nexport interface UserInviteData {\r\n  EmailAddress: string\r\n  Link: string\r\n  ModifiedBy: string\r\n  RoleID: number\r\n  PhoneNumber: string\r\n  InvitationLink?: string\r\n}\r\n\r\nexport interface UserUploadData {\r\n  Base64String: string\r\n  IPAddress: string\r\n  Link: string\r\n  ModifiedBy: string\r\n  RoleID: number\r\n}\r\n\r\nexport function UserInvitation(data: UserInviteData) {\r\n  const requestBody: string = JSON.stringify(data)\r\n\r\n  return ObservableFromFetch<string>(\"FFOrderUserInvitation/UserInvitation\", requestBody)\r\n}\r\n\r\nexport function UserUpload(data: UserUploadData) {\r\n  const requestBody: string = JSON.stringify(data)\r\n\r\n  return ObservableFromFetch<string>(\"FFOrderUserInvitation/UploadUser\", requestBody)\r\n}\r\n\r\nexport function UserUploadV2(data: UserUploadData) {\r\n  const requestBody: string = JSON.stringify(data)\r\n\r\n  return ObservableFromFetch<string>(\"FFOrderUserInvitation/UploadUserV2\", requestBody)\r\n}\r\n\r\nexport interface PortalInviteData {\r\n  CompanyName: string\r\n  EmailAddress: string\r\n  Link: string\r\n  ModifiedBy: string\r\n  PhoneNumber: string\r\n  RoleID: number\r\n  IsExistingUser: boolean\r\n  ImplementationID: number\r\n  SubscriptionPlanID: number\r\n  IsGOVTPortal: boolean\r\n  Address1?: string,\r\n  Address2?: string,\r\n  City?: string,\r\n  State?: string,\r\n  Zip?: string,\r\n  OfficePhone?: string,\r\n  SubscriptionPlan?: string,\r\n  ImplementationType?: string,\r\n  FirstName?: string,\r\n  LastName?: string,\r\n  UnmaskDonorID: number\r\n}\r\n\r\nexport function PortalInvitation(data: PortalInviteData) {\r\n  const requestBody: string = JSON.stringify(data)\r\n\r\n  return ObservableFromFetch<string>(\"FFOrderClinicEnrollment/CreateInvitation\", requestBody)\r\n}\r\n\r\nexport interface CompanyInviteData {\r\n  ClientName: string\r\n  CompanyAdditionalRoleID: string\r\n  CompanyCode: string\r\n  CompanyID?: number\r\n  EmailAddress: string\r\n  InvitationLink?: string\r\n  Link: string\r\n  ModifiedBy: string\r\n  PhoneNumber: string\r\n  PortalAdditionalRoleID: string\r\n  RoleID?: number | string\r\n  ParentID?:  number\r\n  IsExistingUser?: boolean\r\n}\r\n\r\nexport function CompanyInvitationObserver(data: CompanyInviteData) {\r\n  const requestBody: string = JSON.stringify(data)\r\n  return ObservableFromFetch<string>(\"FFOrderClinicEnrollment/CreateInvitation\", requestBody)\r\n}\r\n\r\nexport interface CompanyUploadData {\r\n  Base64String: string\r\n  IPAddress: string\r\n  Link: string\r\n  ModifiedBy: string\r\n}\r\n\r\nexport function CompanyUpload(params: CompanyUploadData) {\r\n  const requestBody: string = JSON.stringify(params);\r\n  return ObservableFromFetch<string>(\"FFOrderClinicStatus/UploadClients\", requestBody)\r\n}\r\n","import * as React from \"react\"\r\nimport { OverlayTrigger, Popover } from \"react-bootstrap\";\r\nimport { FaInfoCircle } from \"react-icons/fa\";\r\nimport { UserProfileStatus } from \"../../api/Administration/Model/UserDetail\";\r\n\r\ninterface UserProfileStatusesProps {\r\n  statuses: UserProfileStatus[]\r\n}\r\n\r\nexport default function UserProfileStatuses(props: UserProfileStatusesProps) {\r\n  const { statuses } = props\r\n  return (<ul className=\"m-0 p-0 list-unstyled\">\r\n    {statuses.map((status, index) => <li key={`ups${index}`} className=\"text-nowrap\">\r\n      {status.Message}\r\n      {status.AdditionalInfo && status.AdditionalInfo.length > 0 &&\r\n        <OverlayTrigger placement=\"top\" delay={{ show: 100, hide: 400 }} overlay={\r\n          <Popover id=\"ups_popover\" className=\"p-2 mw-100\" >\r\n            <ul className=\"m-0 p-0 list-unstyled\">\r\n              {status.AdditionalInfo.map((info, i) => <li key={`ap${index}${i}`}>{info}</li>)}\r\n            </ul>\r\n          </Popover>}>\r\n          <FaInfoCircle className=\"info-icon-alt\" />\r\n        </OverlayTrigger>}\r\n    </li>)}\r\n  </ul>)\r\n}\r\n","import * as React from \"react\"\r\nimport { Container, Row, Col, Table, Button, Spinner } from \"react-bootstrap\"\r\nimport { Subscription, BehaviorSubject, of, concat, Observable } from \"rxjs\"\r\nimport { distinctUntilChanged, switchMap, map, catchError, filter } from \"rxjs/operators\"\r\nimport { toast } from \"react-toastify\"\r\nimport { isCompanyAdmin, isPortalAdmin, isSiteAdmin } from \"../../authentication/isAdminRole\"\r\nimport { AppState } from \"../../AppState\"\r\nimport { connect } from \"react-redux\"\r\nimport { APIError } from \"../../api/ObservableFromFetch\"\r\nimport { Typeahead } from \"react-bootstrap-typeahead\"\r\nimport { FaAngleDown } from \"react-icons/fa\"\r\nimport { AppPageWrapper } from \"../NavMenu/AppPageWrapper\"\r\nimport ColumnHeaderFilter from \"../ColumnHeaderFilter\"\r\nimport TablePagination from \"../TablePagination\"\r\nimport { CustomizableFilterColumn } from \"../ColumnsCustomizeModal/CustomizableColumn\"\r\nimport UserDetailsObservable, { ColumnFilters, UserDetailGridResponse, UserDetailsCSVObservable } from \"../../api/Administration/GetUserDetails\"\r\nimport UserDetail from \"../../api/Administration/Model/UserDetail\"\r\nimport UserInfo, { UserInfoMode } from \"./UserInfo\"\r\nimport FormatDate from \"../../formatters/FormatDate\"\r\nimport { Filter, Sort } from \"../../api/GridRequest\"\r\nimport ImplementationData from \"../../api/Implementations/Model/ImplementationData\"\r\nimport ImplementationsGetObservable from \"../../api/Implementations/ImplementationsGet\"\r\nimport SearchBar from \"../SearchBar\"\r\nimport SearchField from \"../../api/SearchField\"\r\nimport CSVUploadModal from \"../Invitation/CSVUploadModal\"\r\nimport { ApiRootUrl } from \"../../api/ApiUrl\"\r\nimport { UserUploadV2, UserUploadData } from \"../../api/Invitation/InvitationCreate\"\r\nimport { getUserNameForSelectedCompany, RoleIdForSelectedCompany } from \"../../authentication/SelectedCompany/CompanySelectionDrivenSelectors\"\r\nimport { IpifyUrl } from \"../../config/Constants\"\r\nimport UserProfileStatuses from \"./UserProfileStatuses\"\r\nimport downloadCsv from \"../../assets/images/download-csv.png\"\r\nimport FormatTimestampFileName from \"../../formatters/FormatTimestampFileName\"\r\nimport FileSaver from \"file-saver\"\r\nimport { getStatusLabelByKey, InvitationStatus } from \"../../api/Invitation/Model/InvitationStatus\"\r\n\r\ntype Column = CustomizableFilterColumn<keyof UserDetail, keyof ColumnFilters>\r\n\r\ninterface UserDetailsGridProps {\r\n  isSiteAdmin: boolean,\r\n  isPortalAdmin: boolean,\r\n  isCompanyAdmin: boolean,\r\n  UserName?: string\r\n  PrimaryRoleID?: number\r\n}\r\n\r\ninterface UserDetailsGridState {\r\n  loading: boolean\r\n  loadAll: boolean\r\n  loadingCsv?: boolean\r\n  data?: UserDetailGridResponse\r\n  pageNumber: number\r\n  columns: Column[]\r\n  sort?: Sort\r\n  filters: Filter[]\r\n  showUserInfoFor?: string,\r\n  showNewUser: boolean,\r\n  loginAttempts?: number\r\n  selectedImplementation?: ImplementationData\r\n  implementations?: ImplementationData[]\r\n  participationId?: number\r\n  roleId?: number\r\n  locationId?: number\r\n  timeZoneId?: number\r\n  searchField: string\r\n  searchFields?: SearchField[]\r\n  searchText: string\r\n  showUploadSpreadsheet: boolean\r\n  currentIP: string\r\n}\r\n\r\ninterface UserDetailSearchParams {\r\n  pageNumber: number\r\n  sort: Sort\r\n  filters: Filter[]\r\n}\r\n\r\nconst DEFAULT_COLUMNS: Column[] = [\r\n  { name: \"Account\", filter: \"Account\", label: \"Account\", visible: true },\r\n  { name: \"LoginName\", filter: \"LoginName\", label: \"Login Name\", visible: true },\r\n  { name: \"UserName\", filter: \"UserName\", label: \"User Name\", visible: true },\r\n  { name: \"PrimaryRoleTitle\", filter: \"Role\", label: \"Role\", visible: true },\r\n  { name: \"LastLoginDate\", filter: \"LastLogin\", label: \"Last Login\", visible: true },\r\n  { name: \"ProfileStatuses\", filter: \"ProfileStatuses\", label: \"Profile Status\", visible: false },\r\n  { name: \"SendingFacility\", filter: \"SendingFacility\", label: \"Sending Facility\", visible: false },\r\n  { name: \"InActive\", filter: \"InActive\", label: \"Active/Inactive\", visible: true },\r\n  { name: \"ModifiedOn\", filter: \"InvitationSent\", label: \"Invite Sent\", visible: true },\r\n  { name: \"EnrollmentStarted\", filter: \"EnrollmentStarted\", label: \"Enrollment Started\", visible: true},\r\n  { name: \"Status\", filter: \"Status\", label: \"Invite Status\", visible: true },\r\n  { name: \"Link\", label: \"Invite Link\", visible: false }\r\n\r\n\r\n]\r\n\r\nconst SEARCH_FIELDS: SearchField[] = [\r\n  { ID: \"Login\", Name: \"Login Name\" },\r\n  { ID: \"Name\", Name: \"User Name\" }\r\n]\r\n\r\nconst PageSize = 20\r\nexport class UserDetailsGrid extends React.PureComponent<UserDetailsGridProps, UserDetailsGridState> {\r\n  state: UserDetailsGridState = {\r\n    showUploadSpreadsheet: false,\r\n    showNewUser: false,\r\n    loading: false,\r\n    loadAll: false,\r\n    loadingCsv: false,\r\n    pageNumber: 1,\r\n    columns: DEFAULT_COLUMNS,\r\n    filters: [],\r\n    participationId: undefined,\r\n    locationId: undefined,\r\n    timeZoneId: undefined,\r\n    searchField: \"\",\r\n    searchText: \"\",\r\n    searchFields: SEARCH_FIELDS,\r\n    currentIP: \"\"\r\n  }\r\n  subscription?: Subscription\r\n  implementationsSubscription?: Subscription\r\n  exportToCSVSubscription?: Subscription\r\n\r\n  implementationsTypeahead = React.createRef<Typeahead<ImplementationData>>()\r\n\r\n  page$ = new BehaviorSubject<UserDetailSearchParams>({\r\n    pageNumber: 1,\r\n    sort: { column: \"\", order: \"\" },\r\n    filters: []\r\n  })\r\n\r\n  componentDidMount() {\r\n    this.setState({ columns: this.visibleGridColumns([\"ProfileStatuses\", \"SendingFacility\"], this.props.isSiteAdmin) })\r\n\r\n    this.subscription = this.page$.pipe(\r\n      distinctUntilChanged(),\r\n      filter(() => this.state.loadAll || !this.props.isSiteAdmin || !!this.state.selectedImplementation?.ImplementationID || this.state.searchText.length > 0),\r\n      switchMap(params => concat(\r\n        of({ loading: true }),\r\n        UserDetailsObservable(params.pageNumber, PageSize, params.sort, params.filters, this.state.selectedImplementation?.ImplementationID).pipe(\r\n          map((result: UserDetailGridResponse) => ({ data: result, pageNumber: params.pageNumber, loading: false })),\r\n          catchError(() => of({ loading: false }))\r\n        )\r\n      ))\r\n    ).subscribe(\r\n      (newState: { loading: boolean, data?: UserDetailGridResponse, pageNumber?: number }) => {\r\n        if (newState.data) {\r\n          if (newState.data.InActive?.length) {\r\n            newState.data.InActive = newState.data.InActive.map(inactiveString => inactiveString === \"true\" ? \"Inactive\" : \"Active\")\r\n          }\r\n          if (newState.data.LastLogin?.length) {\r\n            newState.data.LastLogin = newState.data.LastLogin.map(dateString => FormatDate(dateString))\r\n          }\r\n          this.setState(prevState => ({ loading: newState.loading, data: newState.data, pageNumber: newState.pageNumber || prevState.pageNumber }))\r\n        } else {\r\n          this.setState({ loading: newState.loading })\r\n        }\r\n      },\r\n      (error: string) => {\r\n        toast.error(error)\r\n        this.setState({ loading: false })\r\n      }\r\n    )\r\n    if (this.props.isSiteAdmin) {\r\n      this.implementationsSubscription = ImplementationsGetObservable().subscribe(\r\n        data => this.setState({ implementations: data.Records }),\r\n        error => toast.error((error as APIError)?.errorData?.message || error.message)\r\n      )\r\n    }\r\n  }\r\n\r\n  visibleGridColumns(columns: string[], visible: boolean) {\r\n    return this.state.columns.map(column => (columns.includes(column.name))\r\n      ? { ...column, visible: visible }\r\n      : column\r\n    )\r\n  }\r\n\r\n  componentWillUnmount() {\r\n    this.subscription && this.subscription.unsubscribe()\r\n    this.exportToCSVSubscription && this.exportToCSVSubscription.unsubscribe()\r\n    this.implementationsSubscription && this.implementationsSubscription.unsubscribe()\r\n  }\r\n\r\n  componentDidUpdate(prevProps: UserDetailsGridProps, prevState: UserDetailsGridState) {\r\n    if (!!this.state.selectedImplementation && prevState.selectedImplementation?.ImplementationID !== this.state.selectedImplementation.ImplementationID) {\r\n      this.page$.next({ pageNumber: 1, sort: { column: \"\", order: \"\" }, filters: [] })\r\n    }\r\n    else if (this.state.searchText !== prevState.searchText) {\r\n      const searchField = this.state.searchField\r\n      const searchText = this.state.searchText\r\n      const filters = []\r\n      if (searchField === \"Login\") { filters.push({ column: \"LoginName\", values: [searchText || \"\"] }) }\r\n      if (searchField === \"Name\") { filters.push({ column: \"UserName\", values: [searchText || \"\"] }) }\r\n      if (filters.length || this.state.selectedImplementation?.ImplementationID) {\r\n        this.page$.next({ pageNumber: 1, sort: { column: \"\", order: \"\" }, filters: filters })\r\n      }\r\n      else {\r\n        this.setState({ data: undefined })\r\n      }\r\n    }\r\n  }\r\n\r\n  UserIPGet = (): void => {\r\n    try {\r\n      const response = fetch(IpifyUrl).then(response => response.json())\r\n      response.then(data => this.setState({ currentIP: data.ip }))\r\n    } catch(error: unknown) {\r\n      this.setState({ currentIP: \"\" })\r\n    }\r\n  }\r\n\r\n  pageChanged = (pageNumber: number) => {\r\n    this.page$.next({ ...this.page$.getValue(), pageNumber: pageNumber })\r\n  }\r\n\r\n  onExportClick() {\r\n    this.setState({ loadingCsv: true })\r\n\r\n    this.exportToCSVSubscription = UserDetailsCSVObservable(this.props.isSiteAdmin, 1, PageSize, this.state.sort || { column: \"\", order: \"\" }, this.state.filters, this.state.selectedImplementation?.ImplementationID).subscribe(\r\n      (results: string) => {\r\n        this.setState({ loadingCsv: false })\r\n        this.exportToCSV(results)\r\n      },\r\n      (error) => {\r\n        this.setState({ loadingCsv: false })\r\n        toast.error(error)\r\n      }\r\n    )\r\n  }\r\n\r\n  exportToCSV(csv: string) {\r\n    const csvData = new Blob([csv], { type: 'text/csv;charset=utf-8;' })\r\n    FileSaver.saveAs(csvData, FormatTimestampFileName(\"OurTeam\", \"csv\", new Date()), true)\r\n    toast.success(\"CSV file downloaded successfully.\")\r\n  }\r\n\r\n\r\n  sort(column: string, order?: string) {\r\n    const newSort = { column: column, order: order || \"\" }\r\n    this.setState({ sort: newSort })\r\n    this.page$.next({ ...this.page$.getValue(), sort: newSort })\r\n  }\r\n\r\n  filter(column: string, items: string[]) {\r\n    this.setState(prevState => {\r\n      const filters = [...prevState.filters]\r\n      const filter = { column: column, values: items }\r\n      let index = filters.findIndex(item => item.column === filter.column)\r\n      if (index >= 0) {\r\n        filters[index] = filter\r\n      } else {\r\n        filters.push(filter)\r\n      }\r\n      return { filters: filters }\r\n    }, () => {\r\n      this.page$.next({ ...this.page$.getValue(), pageNumber: 1, filters: this.state.filters })\r\n    })\r\n  }\r\n\r\n  visibleColumns = () => this.state.columns.filter(col => col.visible)\r\n  showTeamInfoModal = (data: UserDetail) => this.setState({ showUserInfoFor: data.LoginName, roleId: data.PrimaryRoleID, participationId: data.ParticipationID, locationId: data.LocationID, timeZoneId: data.TimeZoneID, loginAttempts: data.LoginAttempts })\r\n  showNewTeamInfoModal = () => this.setState({ showUserInfoFor: undefined, showNewUser: true, participationId: undefined, timeZoneId: undefined })\r\n\r\n  renderCell(row: UserDetail, colName: keyof UserDetail, key: number) {\r\n    switch (colName) {\r\n      case \"LoginName\":\r\n        return <td key={key} className=\"align-text-top text-left p-0\" onClick={() => this.showTeamInfoModal(row)}><Button variant=\"link\">{row[colName]}</Button></td>\r\n      case \"InActive\":\r\n        return <td key={key} className=\"align-text-top\">{row[colName] ? \"Inactive\" : \"Active\"}</td>\r\n      case \"LastLoginDate\":\r\n        return <td key={key} className=\"align-text-top\">{FormatDate(row.LastLoginDate)}</td>\r\n      case \"ProfileStatuses\":\r\n        return <td key={key} className=\"align-text-top\"><UserProfileStatuses statuses={row.ProfileStatuses} /></td>\r\n        case \"ModifiedOn\":\r\n          return <td key={key} className=\"align-text-top\">{FormatDate(row.ModifiedOn)}</td>\r\n        case \"EnrollmentStarted\":\r\n          return <td key={key} className=\"align-text-top\">{FormatDate(row.EnrollmentStarted)}</td>\r\n        case \"Status\":\r\n          return <td key={key} className=\"align-text-top\">{getStatusLabelByKey(row.Status)}</td>\r\n        case \"Link\":\r\n          return <td key={key} className=\"align-text-top\"><Button variant=\"link\" onClick={() => this.onGoToInvitationLink(row.Link)} className=\"text-left p-0\">{row.Link}</Button></td>\r\n        default:\r\n        return <td key={key} className=\"align-text-top\">{row[colName]}</td>\r\n    }\r\n  }\r\n\r\n  handleInvitationSetupModalClose = (hasUpdates: boolean) => {\r\n    this.setState({ showUserInfoFor: undefined, showNewUser: false })\r\n    if (hasUpdates) {\r\n      this.pageChanged(1)\r\n    }\r\n  }\r\n\r\n  handleImplementationChange = (selected: ImplementationData[]) => this.setState({ selectedImplementation: selected[0], searchField: \"\", searchText: \"\" })\r\n  onSearch = (searchField?: string, searchText?: string) => this.setState({ searchField: searchField || \"\", searchText: searchText || \"\" })\r\n\r\n  handleOpenUpload = () => this.setState({ showUploadSpreadsheet: true })\r\n\r\n  handleStartUploading = (fileName: string, fileContent: string) => {\r\n    const userData: UserUploadData = {\r\n      Base64String: fileContent,\r\n      IPAddress: this.state.currentIP,\r\n      Link: window.location.hostname,\r\n      ModifiedBy: this.props.UserName || \"\",\r\n      RoleID: this.props.PrimaryRoleID || 0,\r\n    }\r\n    return UserUploadV2(userData)\r\n  }\r\n\r\n  handleBulkUploaded = () => {\r\n    this.setState({ showUploadSpreadsheet: false })\r\n  }\r\n\r\n  LoadAll = () => this.setState({ loadAll: true }, () => this.page$.next({ pageNumber: 1, sort: { column: \"\", order: \"\" }, filters: [] }))\r\n\r\n  onGoToInvitationLink = (url: string) => {\r\n    window.open(url, \"_blank\", \"noopener,noreferrer\")\r\n  }\r\n\r\n  render() {\r\n    const dataRows = (data: UserDetailGridResponse) => data.Records.map((row: UserDetail, i: number) => <tr key={i}>{dataColumns(row)}</tr>)\r\n    const dataColumns = (row: UserDetail) => this.visibleColumns().map((col, i) => this.renderCell(row, col.name as keyof UserDetail, i))\r\n    const emptyRow = <tr><td colSpan={this.visibleColumns().length}>NO DATA FOUND</td></tr>\r\n    const siteAdminEmptyRow = <tr><td className=\"text-center\" colSpan={this.visibleColumns().length}><Button variant=\"primary\" onClick={this.LoadAll}>Load for All Portals</Button></td></tr>\r\n\r\n    const headerColumns = this.visibleColumns().map((col: Column, i) => {\r\n      return (\r\n        <td key={i}>\r\n          {this.state.data && col.filter && col.filter in this.state.data && <ColumnHeaderFilter title={col.label || col.name}\r\n            filtered={this.state.filters.findIndex(item => item.column === col.filter) >= 0}\r\n            sort={this.state.sort && this.state.sort.column === col.name ? this.state.sort.order === \"asc\" ? \"asc\" : \"desc\" : undefined}\r\n            items={this.state.data[col.filter as keyof ColumnFilters] || []}\r\n            uppercase={false}\r\n            onSort={(order?: string) => this.sort(col.name, order)}\r\n            onFilter={(items: string[]) => col.filter && this.filter(col.filter, items)} />}\r\n          {(!this.state.data || !col.filter) && (col.label || col.name)}\r\n        </td>\r\n      )\r\n    })\r\n\r\n    return (<>\r\n      <AppPageWrapper showNav parentClassName={\"align-items-center\"}>\r\n        <Container fluid className=\"grid-container\">\r\n          {(this.props.isSiteAdmin) && <Row className=\"pb-2\">\r\n            <Col className=\"m-1\" lg={3}>\r\n              <SearchBar allowBlank searchFields={this.state.searchFields || []} onSearch={(searchField?: string, searchText?: string) => { this.onSearch(searchField, searchText) }} />\r\n            </Col>\r\n            {!this.state.loadAll && <Col className={\"text-right\"} lg={{span: 3, offset: 4}}>\r\n              <Typeahead id=\"implementation\"\r\n                ref={this.implementationsTypeahead}\r\n                labelKey=\"Name\"\r\n                filterBy={(option, props) => props.selected.length > 0 || option.Name.toLowerCase().indexOf(props.text.toLowerCase()) !== -1}\r\n                isLoading={!this.state.implementations}\r\n                onChange={this.handleImplementationChange}\r\n                options={this.state.implementations || []}\r\n                selected={this.state.selectedImplementation ? [this.state.selectedImplementation] : []}\r\n                emptyLabel=\"No Portals Found\"\r\n                placeholder=\"Type to select Portal\"\r\n                inputProps={{ autoComplete: \"chrome-off\" }}>\r\n                {this.state.implementations &&\r\n                  <Button variant=\"toggle\" onClick={() => { this.implementationsTypeahead.current?.toggleMenu() }}>\r\n                    <FaAngleDown />\r\n                  </Button>}\r\n              </Typeahead>\r\n            </Col>}\r\n            <Col className={\"text-right\"}>\r\n              {this.state.loadAll && <Button variant=\"primary\" size=\"sm\" className=\"mr-2 mt-1 fixed-w5\" onClick={() => this.setState({ loadAll: false, data: undefined })}>Show Portal Filter</Button>}\r\n              {!this.state.loadAll && <Button variant=\"primary\" size=\"sm\" className=\"mr-2 mt-1 fixed-w5\" onClick={() => this.setState({ loadAll: false, data: undefined, selectedImplementation: undefined })}>Reset Grid</Button>}\r\n              <Button variant=\"secondary\" size=\"sm\" className=\"mt-1 mr-2\" onClick={() => this.onExportClick()}>\r\n                  EXPORT CSV&nbsp;\r\n                  {this.state.loadingCsv ? <Spinner animation=\"border\" size=\"sm\" /> : <img src={downloadCsv} alt=\"\" width=\"16\" height=\"16\" />}\r\n              </Button>\r\n            </Col>\r\n          </Row>}\r\n          {(this.props.isPortalAdmin || this.props.isCompanyAdmin) && <Row className=\"buttons-block\">\r\n            <Button variant=\"primary\" size=\"sm\" className=\"float-right mr-2 fixed-w5\" onClick={this.handleOpenUpload}>Bulk Import Users</Button>\r\n            <Button variant=\"primary\" size=\"sm\" className=\"float-right mr-2 fixed-w5\" onClick={() => this.showNewTeamInfoModal()}>Add User</Button>\r\n            <Button variant=\"secondary\" size=\"sm\" className=\"mt-1 mr-2\" onClick={() => this.onExportClick()}>\r\n                  EXPORT CSV&nbsp;\r\n                  {this.state.loadingCsv ? <Spinner animation=\"border\" size=\"sm\" /> : <img src={downloadCsv} alt=\"\" width=\"16\" height=\"16\" />}\r\n              </Button>\r\n          </Row>}\r\n          <Row>\r\n            <Col>\r\n              <Table bordered responsive>\r\n                <thead>\r\n                  <tr>\r\n                    {headerColumns}\r\n                  </tr>\r\n                </thead>\r\n                <tbody>\r\n                  {\r\n                    this.state.loading ?\r\n                      <tr><td colSpan={this.visibleColumns().length}><Spinner animation=\"border\" variant=\"secondary\" /></td></tr> :\r\n                      this.state.data && this.state.data.Records.length > 0 ? dataRows(this.state.data) : (this.props.isSiteAdmin ? siteAdminEmptyRow : emptyRow)\r\n                  }\r\n                </tbody>\r\n              </Table>\r\n              {this.state.data && !this.state.loading && <React.Fragment>\r\n                <span className=\"total-records\">Total records: {this.state.data.Total}</span>\r\n                <TablePagination pageNumber={this.state.pageNumber} pages={this.state.data.Pages} onChange={this.pageChanged} />\r\n              </React.Fragment>}\r\n            </Col>\r\n          </Row>\r\n        </Container>\r\n        <UserInfo\r\n          show={!!this.state.showUserInfoFor || this.state.showNewUser}\r\n          mode={UserInfoMode.Team}\r\n          onClose={this.handleInvitationSetupModalClose}\r\n          LoginName={this.state.showUserInfoFor}\r\n          LoginAttempts={this.state.loginAttempts}\r\n          showNewUser={this.state.showNewUser}\r\n          participationId={this.state.participationId}\r\n          locationId={this.state.locationId}\r\n          roleId={this.state.roleId}\r\n          timeZoneId={this.state.timeZoneId} />\r\n        {this.state.showUploadSpreadsheet &&\r\n          <CSVUploadModal show={true}\r\n            title=\"USER INVITE BULK UPLOAD\"\r\n            templateCSVUrl={ApiRootUrl() + \"/Template/user-invite-template.csv\"}\r\n            onCancel={() => this.setState({ showUploadSpreadsheet: false })}\r\n            onStartUpload={this.handleStartUploading}\r\n            onUploaded={this.handleBulkUploaded}>\r\n            {(this.props.isPortalAdmin || this.props.isCompanyAdmin) && <p>\r\n              To send an invitation to multiple companies at once:\r\n                <ol>\r\n                  <li>\r\n                    Create a Spreadsheet with the following columns:\r\n                    <ol type=\"A\">\r\n                      <li>Company Name</li>\r\n                      <li>User's First Name</li>\r\n                      <li>User's Last Name</li>\r\n                      <li>User's Email Address</li>\r\n                      <li>User's Phone Number</li>\r\n                      <li>User's Role</li>\r\n                    </ol>\r\n                  </li>\r\n                  <li>Save the spreadsheet as a CSV text file.</li>\r\n                  <li>Upload the file here.</li>\r\n                </ol>\r\n            </p>}\r\n          </CSVUploadModal>}\r\n    </AppPageWrapper>\r\n    </>)\r\n  }\r\n}\r\n\r\nfunction mapStateToProps(state: AppState): UserDetailsGridProps {\r\n  return {\r\n    isSiteAdmin: isSiteAdmin(state),\r\n    isPortalAdmin: isPortalAdmin(state),\r\n    isCompanyAdmin: isCompanyAdmin(state),\r\n    UserName: getUserNameForSelectedCompany(state),\r\n    PrimaryRoleID: RoleIdForSelectedCompany(state)\r\n  }\r\n}\r\nconst ConnectedUserDetailsGrid = connect(mapStateToProps, null)(UserDetailsGrid)\r\nexport default ConnectedUserDetailsGrid\r\n","import { ObservableFromFetch } from \"../ObservableFromFetch\"\r\n\r\nexport function UserActivationObservable(ApplicationUserId: number, link: string) {\r\n  const requestBody: string = JSON.stringify({ ApplicationUserId: ApplicationUserId, InvitationLink: link })\r\n\r\n  return ObservableFromFetch<string>(\"FFOrderUserFileMaintenance/ReActivateUser\", requestBody)\r\n}\r\n\r\nexport function CompanyActivationObservable(ImplementationID: number, AccountId: number, isLocation: boolean = false) {\r\n  const requestBody: string = new URLSearchParams({\r\n    ImplementationID: ImplementationID.toString(),\r\n    AccountId: AccountId.toString(),\r\n    isLocation: isLocation.toString()\r\n  }).toString()\r\n\r\n  return ObservableFromFetch<string>(\"FFOrderClientFileMaintenance/ReActivateClient?\" + requestBody)\r\n}\r\n\r\nexport function PortalActivationObservable(ImplementationID: number) {\r\n  const requestBody: string = new URLSearchParams({\r\n    ImplementationID: ImplementationID.toString()\r\n  }).toString()\r\n\r\n  return ObservableFromFetch<string>(\"FFOrderClinicFileMaintenance/ReActivateClinic?\" + requestBody)\r\n}","import React from \"react\"\r\nimport { Button, Modal, Form, Col, InputGroup } from \"react-bootstrap\"\r\nimport { toast } from \"react-toastify\"\r\nimport { Subscription } from \"rxjs\"\r\nimport ActionButton from \"../ActionButton\"\r\nimport { UserActivationObservable } from \"../../api/Administration/ActivationProcess\"\r\nimport UserInformation from \"../../api/Administration/Model/UserInformation\"\r\nimport { ActiveUserInformationGetObservable } from \"../../api/Administration/UserInformationGet\"\r\nimport { EmailRegexp } from \"../../config/Constants\"\r\nimport { AppPageWrapper } from \"../NavMenu/AppPageWrapper\"\r\nimport { RouteComponentProps } from \"react-router\"\r\nimport { Home } from \"../../config/Routes\"\r\n\r\ninterface UserActivationProps { }\r\n\r\ninterface UserActivationState {\r\n  saving: boolean\r\n  loading: boolean\r\n  selectedUser?: UserInformation\r\n  isEmailValid: boolean\r\n  email: string\r\n}\r\n\r\nexport default class UserActivation extends React.PureComponent<UserActivationProps, UserActivationState> {\r\n  emptyState: UserActivationState = {\r\n    loading: false,\r\n    saving: false,\r\n    selectedUser: undefined,\r\n    isEmailValid: false,\r\n    email: \"\"\r\n  }\r\n  state: UserActivationState = { ...this.emptyState }\r\n\r\n  loadUserSubscription?: Subscription\r\n  saveUserSubscription?: Subscription\r\n\r\n  componentWillUnmount() {\r\n    this.saveUserSubscription && this.saveUserSubscription.unsubscribe()\r\n    this.loadUserSubscription && this.loadUserSubscription.unsubscribe()\r\n  }\r\n\r\n  handleCancel = () => (this.props as RouteComponentProps).history?.push(Home)\r\n\r\n  handleActivate = () => {\r\n    this.setState({ saving: true })\r\n    const { selectedUser } = this.state\r\n\r\n    this.saveUserSubscription = UserActivationObservable(selectedUser?.ApplicationUserID || 0, selectedUser?.Link || \"\").subscribe(\r\n      (data) => toast.success(data),\r\n      (error) => {\r\n        toast.error(error?.errorData?.message || error.message)\r\n        this.setState({ saving: false })\r\n      },\r\n      () => this.setState({ ...this.emptyState })\r\n    )\r\n  }\r\n\r\n  handleRetrieve = () => {\r\n    this.setState({ loading: true, selectedUser: undefined })\r\n    const { email } = this.state\r\n\r\n    this.loadUserSubscription = ActiveUserInformationGetObservable(email, true).subscribe(\r\n      (data: UserInformation[]) => this.setState({ selectedUser: data[0], loading: false }),\r\n      (error) => {\r\n        toast.error(error?.errorData?.message || error.message)\r\n        this.setState({ loading: false })\r\n      }\r\n    )\r\n  }\r\n\r\n  isEmailValid = (value: string) => {\r\n    if (value.length === 0) {\r\n      return false\r\n    }\r\n    return EmailRegexp.test(value)\r\n  }\r\n\r\n  render() {\r\n    const { selectedUser, saving, loading } = this.state\r\n\r\n    return (\r\n      <AppPageWrapper showNav>\r\n        <Modal.Dialog size=\"xl\">\r\n          <Modal.Header>\r\n            <Modal.Title className=\"text-uppercase\">Activate User</Modal.Title>\r\n          </Modal.Header>\r\n          <Modal.Body>\r\n            <Form>\r\n              <Form.Row className=\"form-group required\">\r\n                <Form.Label column lg={3} htmlFor=\"userName\">User's Email</Form.Label>\r\n                <Col lg={9}>\r\n                  <InputGroup>\r\n                    <Form.Control type=\"text\" value={this.state.email} className=\"bg-white\" onChange={(e) => { this.setState({ email: e.target.value, isEmailValid: this.isEmailValid(e.target.value) }) }} />\r\n                    <InputGroup.Append>\r\n                      <ActionButton variant=\"secondary\" onClick={this.handleRetrieve} disabled={!this.state.isEmailValid} spin={loading} disableOnSpin>Retrieve</ActionButton>\r\n                    </InputGroup.Append>\r\n                  </InputGroup>\r\n                </Col>\r\n              </Form.Row>\r\n              <Form.Row className=\"form-group\">\r\n                <Form.Label column lg={3} htmlFor=\"firstName\">First Name</Form.Label>\r\n                <Col lg={9}>\r\n                  <Form.Control id=\"firstName\" type=\"text\" disabled defaultValue={selectedUser?.FirstName} />\r\n                </Col>\r\n              </Form.Row>\r\n              <Form.Row className=\"form-group\">\r\n                <Form.Label column lg={3} htmlFor=\"lastName\">Last Name</Form.Label>\r\n                <Col lg={9}>\r\n                  <Form.Control id=\"lastName\" type=\"text\" disabled defaultValue={selectedUser?.LastName} />\r\n                </Col>\r\n              </Form.Row>\r\n            </Form>\r\n          </Modal.Body>\r\n          <Modal.Footer>\r\n            <ActionButton variant=\"primary\" onClick={() => this.handleActivate()} disabled={!selectedUser} spin={saving} disableOnSpin>Activate</ActionButton>\r\n            <Button variant=\"secondary\" className=\"mr-2\" onClick={() => this.handleCancel()}>Cancel</Button>\r\n          </Modal.Footer>\r\n        </Modal.Dialog>\r\n      </AppPageWrapper>\r\n    )\r\n  }\r\n}\r\n","import { ObservableFromFetch } from \"../ObservableFromFetch\"\r\nimport RegulatoryMode from \"./Model/RegulatoryMode\"\r\n\r\nexport default function GetRegulatoryModeDonorByID(id: number | string) {\r\n  return ObservableFromFetch<RegulatoryMode[]>(`FFOrderRegulatoryModeDonor/GetRegulatoryModeDonorByID?regulatoryModeID=${id}`)\r\n}","import { ObservableFromFetch } from \"../ObservableFromFetch\"\r\nimport RegulatoryMode from \"./Model/RegulatoryMode\"\r\n\r\nexport default function InsertRegulatoryModeDonor(regMode: RegulatoryMode) {\r\n    const requestBody = JSON.stringify(regMode)\r\n    return ObservableFromFetch<string>(\"FFOrderRegulatoryModeDonor/InsertRegulatoryModeDonor\", requestBody)\r\n}","import React from \"react\"\r\nimport { Button, Modal, Form, Col, InputGroup } from \"react-bootstrap\"\r\nimport { toast } from \"react-toastify\"\r\nimport { Subscription } from \"rxjs\"\r\nimport ActionButton from \"../ActionButton\"\r\nimport StateSelect from \"../FormattedInputs/StateSelect\"\r\nimport { CompanyActivationObservable, PortalActivationObservable } from \"../../api/Administration/ActivationProcess\"\r\nimport ImplementationSearchResult from \"../../api/Invitation/Model/ImplementationSearchResult\"\r\nimport { CompanyDataObservable, ImplementationSearchObservable } from \"../../api/Invitation/InformationGet\"\r\nimport CompanyData from \"../../api/Companies/CompanyModel/CompanyData\"\r\nimport { StateObservable } from \"../../api/OrderRequests/OrderRequestsConstraintGet\"\r\nimport State from \"../../api/OrderRequests/OrderRequestsModel/State\"\r\nimport { RouteComponentProps } from \"react-router\"\r\nimport { Home } from \"../../config/Routes\"\r\n\r\nexport enum ActivationType {\r\n  Portal = \"portal\",\r\n  Company = \"company\"\r\n}\r\n\r\ninterface EntityActivationProps {\r\n  type: ActivationType\r\n}\r\n\r\ninterface EntityActivationState {\r\n  isPortal: boolean\r\n  itemSaving: boolean\r\n  itemLoading: boolean\r\n  instanceName: string\r\n  isNameValid: boolean\r\n  selectedItem?: ImplementationSearchResult | CompanyData\r\n  states: State[]\r\n}\r\n\r\nexport default class EntityActivation extends React.Component<EntityActivationProps & RouteComponentProps, EntityActivationState> {\r\n  emptyState: EntityActivationState = {\r\n    isPortal: this.props.type === ActivationType.Portal,\r\n    itemSaving: false,\r\n    itemLoading: false,\r\n    instanceName: \"\",\r\n    isNameValid: false,\r\n    selectedItem: undefined,\r\n    states: []\r\n  }\r\n  state: EntityActivationState = { ...this.emptyState }\r\n\r\n  saveSubscription = new Subscription()\r\n  loadSubscription = new Subscription()\r\n\r\n  componentDidMount() {\r\n    this.loadSubscription.add(\r\n      StateObservable().subscribe(\r\n        (results: State[]) => this.setState({ states: results }),\r\n        (error) => {\r\n          toast.error(error?.errorData?.message || error.message)\r\n          this.setState({ states: [] })\r\n        }\r\n      )\r\n    )\r\n  }\r\n\r\n  componentWillUnmount() {\r\n    this.saveSubscription && this.saveSubscription.unsubscribe()\r\n    this.loadSubscription && this.loadSubscription.unsubscribe()\r\n  }\r\n\r\n  handleCancel = () => (this.props as RouteComponentProps).history?.push(Home)\r\n\r\n  handleActivate = () => {\r\n    this.setState({ itemSaving: true })\r\n    const { selectedItem, isPortal } = this.state\r\n\r\n    if (isPortal) {\r\n      this.saveSubscription = PortalActivationObservable(selectedItem?.ImplementationID || 0).subscribe(\r\n        (data) => toast.success(data),\r\n        (error) => {\r\n          toast.error(error?.errorData?.message || error.message)\r\n          this.setState({ itemSaving: false })\r\n        },\r\n        () => this.setState({ ...this.emptyState })\r\n      )\r\n    }\r\n    else {\r\n      this.saveSubscription = CompanyActivationObservable(selectedItem?.ImplementationID || 0, selectedItem?.AccountID || 0).subscribe(\r\n        (data) => toast.success(data),\r\n        (error) => {\r\n          toast.error(error?.errorData?.message || error.message)\r\n          this.setState({ itemSaving: false })\r\n        },\r\n        () => this.setState({ ...this.emptyState })\r\n      )\r\n    }\r\n  }\r\n\r\n  handleRetrieve = () => {\r\n    this.setState({ itemLoading: true, selectedItem: undefined })\r\n    const { instanceName, isPortal } = this.state\r\n\r\n    if (isPortal) {\r\n      this.loadSubscription = ImplementationSearchObservable(instanceName, true).subscribe(\r\n        (data: ImplementationSearchResult[]) => this.setState({ selectedItem: data[0] }),\r\n        (error) => {\r\n          toast.error(error?.errorData?.message || error.message)\r\n          this.setState({ itemLoading: false })\r\n        },\r\n        () => this.setState({ itemLoading: false })\r\n      )\r\n    }\r\n    else {\r\n      this.loadSubscription = CompanyDataObservable(instanceName, true).subscribe(\r\n        (data: CompanyData[]) => this.setState({ selectedItem: data[0] }),\r\n        (error) => {\r\n          toast.error(error?.errorData?.message || error.message)\r\n          this.setState({ itemLoading: false })\r\n        },\r\n        () => this.setState({ itemLoading: false })\r\n      )\r\n    }\r\n  }\r\n\r\n  isNameValid = (value: string) => {\r\n    if (value.length < 3) {\r\n      return false\r\n    }\r\n    return true\r\n  }\r\n\r\n  render() {\r\n    const { selectedItem, itemSaving, itemLoading, isPortal } = this.state\r\n\r\n    return (\r\n      <Modal.Dialog size=\"xl\">\r\n        <Modal.Header>\r\n          <Modal.Title className=\"text-uppercase\">{isPortal ? \"Activate Portal\" : \"Activate Company\"}</Modal.Title>\r\n        </Modal.Header>\r\n        <Modal.Body>\r\n          <Form>\r\n            <Form.Row className=\"form-group required\">\r\n              <Form.Label column lg={3} htmlFor=\"companyName\">{isPortal ? \"Clinic Name\" : \"Company Name\"}</Form.Label>\r\n              <Col lg={9}>\r\n                <InputGroup>\r\n                  <Form.Control id=\"companyName\" type=\"text\" value={this.state.instanceName} className=\"bg-white\" onChange={(e) => { this.setState({ instanceName: e.target.value, isNameValid: this.isNameValid(e.target.value) }) }} />\r\n                  <InputGroup.Append>\r\n                    <ActionButton variant=\"secondary\" onClick={this.handleRetrieve} disabled={!this.state.isNameValid} spin={itemLoading} disableOnSpin>Retrieve</ActionButton>\r\n                  </InputGroup.Append>\r\n                </InputGroup>\r\n              </Col>\r\n            </Form.Row>\r\n            <Form.Row className=\"form-group\">\r\n              <Form.Label column lg={3} htmlFor=\"companyCode\">{isPortal ? \"Clinic Lab Code/ID\" : \"Company Code/ID\"}</Form.Label>\r\n              <Col lg={9}>\r\n                <Form.Control id=\"companyCode\" type=\"text\" disabled={true} defaultValue=\"\" />\r\n              </Col>\r\n            </Form.Row>\r\n            <Form.Row className=\"form-group\">\r\n              <Form.Label column lg={3} htmlFor=\"streetAddress2\">Street Address 1</Form.Label>\r\n              <Col lg={9}>\r\n                <Form.Control id=\"streetAddress1\" type=\"text\" disabled={true} defaultValue={selectedItem?.Address1} />\r\n              </Col>\r\n            </Form.Row>\r\n            <Form.Row className=\"form-group\">\r\n              <Form.Label column lg={3} htmlFor=\"streetAddress2\">Street Address 2</Form.Label>\r\n              <Col lg={9}>\r\n                <Form.Control id=\"streetAddress2\" type=\"text\" disabled={true} defaultValue={selectedItem?.Address2} />\r\n              </Col>\r\n            </Form.Row>\r\n            <Form.Row className=\"form-group\">\r\n              <Form.Label column lg={3} htmlFor=\"city\">City</Form.Label>\r\n              <Col lg={9}>\r\n                <Form.Control id=\"city\" type=\"text\" disabled={true} defaultValue={selectedItem?.City} />\r\n              </Col>\r\n            </Form.Row>\r\n            <Form.Row className=\"form-group\">\r\n              <Form.Label column lg={3} htmlFor=\"state\">State</Form.Label>\r\n              <Col sm={6}>\r\n                <StateSelect selectedCode={this.state.states.find(item => item.StateProvinceTerritoryID === selectedItem?.StateProvinceTerritoryID)?.Abbreviation} states={this.state.states} isDisabled={true} onChange={() => { }} />\r\n              </Col>\r\n              <Form.Label column sm={1} htmlFor=\"zip\">ZIP</Form.Label>\r\n              <Col sm={2}>\r\n                <Form.Control id=\"zip\" type=\"text\" defaultValue={selectedItem?.Zip} disabled={true} />\r\n              </Col>\r\n            </Form.Row>\r\n          </Form>\r\n        </Modal.Body>\r\n        <Modal.Footer>\r\n          <ActionButton variant=\"primary\" onClick={this.handleActivate} disabled={!selectedItem} spin={itemSaving} disableOnSpin>Activate</ActionButton>\r\n          <Button variant=\"secondary\" className=\"mr-2\" onClick={this.handleCancel}>Cancel</Button>\r\n        </Modal.Footer>\r\n      </Modal.Dialog>\r\n    )\r\n  }\r\n}\r\n","import React, { Component } from \"react\"\r\nimport { Form } from \"react-bootstrap\"\r\nimport { toast } from \"react-toastify\"\r\nimport { Subscription } from \"rxjs\"\r\nimport RegulatoryMode from \"../../../api/LabService/LabServiceModel/RegulatoryMode\"\r\nimport LabServiceRegulatoryModesGetObservable from \"../../../api/LabService/LabServiceRegulatoryModesGet\"\r\n\r\nexport interface PersonnelRegulatoryModeProps {\r\n    onChange: (event: React.ChangeEvent<HTMLInputElement>) => void\r\n    selected?: number\r\n}\r\n\r\ninterface PersonnelRegulatoryModeState {\r\n    data?: RegulatoryMode[]\r\n}\r\n\r\nexport default class PersonnelRegulatoryMode extends Component<PersonnelRegulatoryModeProps, PersonnelRegulatoryModeState> {\r\n    state: PersonnelRegulatoryModeState = { data: [] }\r\n    loadSubscription?: Subscription\r\n\r\n    componentDidMount() {\r\n        this.loadSubscription = LabServiceRegulatoryModesGetObservable().subscribe(\r\n            data => this.setState({ data: data }),\r\n            error => toast.error(error.message)\r\n        )\r\n    }\r\n\r\n    componentWillUnmount() {\r\n        this.loadSubscription && this.loadSubscription.unsubscribe()\r\n    }\r\n\r\n    render = () => (\r\n        <Form.Control as=\"select\" name=\"RegulatoryModeID\" onChange={this.props.onChange} value={this.props.selected || \"\"}>\r\n            <option value=\"\">Select Mode</option>\r\n            {this.state.data?.map((item: any, key: number) => <option key={key} value={item.RegulatoryModeID}>{item.Name}</option>)}\r\n        </Form.Control>\r\n    );\r\n}\r\n","import React, {Component} from \"react\";\r\nimport {ButtonGroup, Dropdown, DropdownButton, FormGroup} from \"react-bootstrap\";\r\n\r\nexport interface RegulatoryModeNumberSelectProps {\r\n    onChange: (eventKey: string | null, e: React.SyntheticEvent<unknown>) => void;\r\n    value: number;\r\n}\r\n\r\nexport default class RegulatoryModeNumberSelect extends Component<RegulatoryModeNumberSelectProps> {\r\n\r\n    render = () =>(\r\n        <FormGroup>\r\n            <DropdownButton as={ButtonGroup} title={this.props.value|| \"\"} onSelect={this.props.onChange} className=\"fixed-w5\">\r\n                <Dropdown.Item active={this.props.value == 0} eventKey=\"0\">none</Dropdown.Item>\r\n                <Dropdown.Item active={this.props.value == 1} eventKey=\"1\">1</Dropdown.Item>\r\n                <Dropdown.Item active={this.props.value == 2} eventKey=\"2\">2</Dropdown.Item>\r\n                <Dropdown.Item active={this.props.value == 3} eventKey=\"3\">3</Dropdown.Item>\r\n                <Dropdown.Item active={this.props.value == 4} eventKey=\"4\">4</Dropdown.Item>\r\n            </DropdownButton>\r\n        </FormGroup>\r\n    );\r\n}\r\n","import React, { Component } from 'react';\r\nimport { Form, Col, Button, Modal } from 'react-bootstrap';\r\nimport { toast } from 'react-toastify';\r\nimport { Subscription } from 'rxjs';\r\nimport GetRegulatoryModeDonorByID from '../../../api/Administration/GetRegulatoryModeDonorByID';\r\nimport InsertRegulatoryModeDonor from '../../../api/Administration/InsertRegulatoryModeDonor';\r\nimport RegulatoryMode from '../../../api/Administration/Model/RegulatoryMode';\r\nimport Checkbox from '../../Checkbox';\r\nimport { AppPageWrapper } from '../../NavMenu/AppPageWrapper';\r\nimport PersonnelRegulatoryModes from \"./PersonnelRegulatoryModes\";\r\nimport RegulatoryModeNumberSelect from \"./RegulatoryModeNumberSelect\";\r\n\r\ntype RegulatoryModeNumberAttributes = keyof RegulatoryModeRanks;\r\ninterface RegulatoryModeRanks {\r\n    SSNRank: number;\r\n    AlternateIDRank: number;\r\n    EmployerIDRank: number;\r\n    CommercialLicenseRank: number;\r\n}\r\ninterface RegulatoryModeState extends RegulatoryModeRanks {\r\n    RegulatoryModeID: number;\r\n    SSNDescription: string;\r\n    EmployerDescription: string;\r\n    AltDescription: string;\r\n    CommercialLicenseDescription: string;\r\n    DisplayState: boolean;\r\n}\r\nconst DefaultRegulatoryModeOrder: RegulatoryModeState = {\r\n    RegulatoryModeID: 0,\r\n    SSNRank: 0, SSNDescription: \"\",\r\n    EmployerIDRank: 0, EmployerDescription: \"\",\r\n    AlternateIDRank: 0, AltDescription: \"\",\r\n    CommercialLicenseRank: 0, CommercialLicenseDescription: \"\",\r\n    DisplayState: true,\r\n};\r\nexport default class RegulatoryModeForm extends Component<{}, RegulatoryModeState> {\r\n    loadSubscription?: Subscription\r\n    saveSubscription?: Subscription\r\n    state: RegulatoryModeState = {\r\n        ...DefaultRegulatoryModeOrder\r\n    };\r\n\r\n    componentWillUnmount() {\r\n        this.loadSubscription && this.loadSubscription.unsubscribe()\r\n        this.saveSubscription && this.saveSubscription.unsubscribe()\r\n    }\r\n\r\n    resetForm = () => {\r\n        this.setState({ ...DefaultRegulatoryModeOrder });\r\n    }\r\n    changeRegulatoryMode = (event: React.ChangeEvent<HTMLInputElement>) => {\r\n        this.resetForm();\r\n        this.loadSubscription = GetRegulatoryModeDonorByID(event.target.value).subscribe(\r\n            data => this.setState({ ...data[0], DisplayState: true }),\r\n            error => toast.error(error.message)\r\n        )\r\n    }\r\n    handleInputChange = (event: React.ChangeEvent<HTMLInputElement>) => {\r\n        const target = event.target;\r\n        const value = target.type === 'checkbox' ? target.checked : target.value;\r\n        this.setState({ ...this.state, [target.name]: value });\r\n    }\r\n\r\n    checkAssignedRank(data: number[]) {\r\n        if (!data['includes'](1)) {\r\n            return true;\r\n        }\r\n    }\r\n\r\n    validate = () => {\r\n        let array = [this.state.SSNRank, this.state.EmployerIDRank, this.state.AlternateIDRank, this.state.CommercialLicenseRank];\r\n        let isRankOneAssigned = this.checkAssignedRank(array);\r\n        if (isRankOneAssigned) {\r\n            toast.error(\"Assign Rank 1\");\r\n            return false;\r\n        }\r\n        return true;\r\n    }\r\n    handleSubmit = (event: React.FormEvent<HTMLElement>) => {\r\n        event.preventDefault();\r\n        if (!this.validate()) {\r\n            return false;\r\n        }\r\n        this.saveSubscription = InsertRegulatoryModeDonor(this.state as RegulatoryMode).subscribe(\r\n            data => toast.success(data),\r\n            error => toast.error(error.message)\r\n        )\r\n    }\r\n\r\n    handleRankSelect = (name: RegulatoryModeNumberAttributes, eventKey: string | null) => {\r\n        const RegulatoryModeNumberAttributes: RegulatoryModeNumberAttributes[] = [\"SSNRank\", \"AlternateIDRank\", \"EmployerIDRank\", \"CommercialLicenseRank\"];\r\n        const foundEntry: number = parseInt(eventKey || \"0\");\r\n        const newState: RegulatoryModeState = { ...this.state, [name]: foundEntry };\r\n        const numbersToReset = RegulatoryModeNumberAttributes.filter((record) =>\r\n            record !== name && this.state[record] === foundEntry\r\n        );\r\n        numbersToReset.map(item => { newState[item] = 0 });\r\n        this.setState(newState);\r\n    }\r\n\r\n    RegulatoryField = (label: string, name: RegulatoryModeNumberAttributes, description: keyof RegulatoryModeState) => {\r\n        const inputChange = (e: React.ChangeEvent<HTMLInputElement>) => this.handleInputChange(e);\r\n        const getValue = (key: keyof RegulatoryModeState): string => ((this.state[key] || \"\").toString() || \"\");\r\n        const getNumberValue = (key: RegulatoryModeNumberAttributes) => parseInt((this.state[key] || \"\").toString());\r\n        const numberInputChange = (eventKey: string | null, _: React.SyntheticEvent<unknown>) => { this.handleRankSelect(name, eventKey); };\r\n        return <Form.Row>\r\n            <Form.Label column md={3}>{label}</Form.Label>\r\n            <Col>\r\n                <RegulatoryModeNumberSelect value={getNumberValue(name)} onChange={numberInputChange} />\r\n            </Col>\r\n            <Form.Label column md={2}>Display Description</Form.Label>\r\n            <Col md={6}>\r\n                <Form.Control type=\"text\" name={`${description}`} value={getValue(description)} onChange={inputChange} />\r\n            </Col>\r\n        </Form.Row>\r\n    }\r\n\r\n    render = () => {\r\n        return (\r\n            <AppPageWrapper showNav>\r\n                <Modal.Dialog size=\"xl\">\r\n                    <Modal.Header>\r\n                        <Modal.Title>REGULATORY MODE DONOR ID</Modal.Title>\r\n                    </Modal.Header>\r\n                    <Modal.Body>\r\n                        <Form>\r\n                            <Form.Row>\r\n                                <Form.Label column md={3} className=\"required\">Regulatory Mode</Form.Label>\r\n                                <Col md={9}>\r\n                                    <PersonnelRegulatoryModes\r\n                                      selected={this.state.RegulatoryModeID}\r\n                                      onChange={this.changeRegulatoryMode}\r\n                                    />\r\n                                </Col>\r\n                            </Form.Row>\r\n                            <Form.Row>\r\n                                <Col md={{ span: 1, offset: 3 }} className=\"rank\"><label>Rank</label></Col>\r\n                            </Form.Row>\r\n                            {this.RegulatoryField(\"Social Security #\", \"SSNRank\", \"SSNDescription\")}\r\n                            {this.RegulatoryField(\"Employer ID\", \"EmployerIDRank\", \"EmployerDescription\")}\r\n                            {this.RegulatoryField(\"Alternate ID\", \"AlternateIDRank\", \"AltDescription\")}\r\n                            {this.RegulatoryField(\"Commercial License\", \"CommercialLicenseRank\", \"CommercialLicenseDescription\")}\r\n                        </Form>\r\n                    </Modal.Body>\r\n                    <Modal.Footer>\r\n                        <Button variant=\"secondary\" onClick={() => this.resetForm()} className=\"fixed-w5\">Cancel</Button>\r\n                        <Button variant=\"primary\" onClick={(e) => this.handleSubmit(e)} disabled={!this.state.RegulatoryModeID} className=\"fixed-w5 ml-2\">Submit</Button>\r\n                    </Modal.Footer>\r\n                </Modal.Dialog>\r\n            </AppPageWrapper>\r\n        );\r\n    }\r\n}\r\n","import { ObservableFromFetch } from \"../ObservableFromFetch\"\r\nimport ImplementationSearchResult from \"../../api/Invitation/Model/ImplementationSearchResult\"\r\nimport CompanyData from \"../../api/Companies/CompanyModel/CompanyData\"\r\nimport { Addresses } from \"../OrderRequests/OrderRequestsModel/Addresses\"\r\n\r\nexport interface EmailCheckResponse {\r\n  IsEmailExists: boolean,\r\n  AllowAdditionalRole: boolean,\r\n  IsTCEmailExists: boolean\r\n}\r\n\r\nexport function CompanyDataObservable(clientName: string, isActivateClient: boolean = false) {\r\n  const requestBody: string = JSON.stringify({ clientName: clientName, IsActivateClient: isActivateClient })\r\n\r\n  return ObservableFromFetch<CompanyData[]>(\"FFOrderClientFileMaintenance/GetInactiveClientInformation\", requestBody)\r\n}\r\n\r\nexport function ImplementationSearchObservable(companyName: string, isActivateClinic: boolean = false) {\r\n  const requestBody: string = JSON.stringify({ CompanyName: companyName, IsActivateClinic: isActivateClinic })\r\n\r\n  return ObservableFromFetch<ImplementationSearchResult[]>(\"FFOrderClinicFileMaintenance/GetClinicInformation\", requestBody)\r\n}\r\n\r\nexport function EmailCheck(email: string, link?: string) {\r\n  const params = { EmailAddress: email }\r\n  const requestBody: string = JSON.stringify(link ? { ...params, Link: link } : params)\r\n\r\n  return ObservableFromFetch<EmailCheckResponse>(\"FFOrderClinicEnrollment/DoesEmailExists\", requestBody)\r\n}\r\n\r\nexport function CompanyNameCheck(name: string, link?: string, isClient?: boolean, implementationID?: number) {\r\n  var params: object = { InstanceName: name }\r\n  if (link) {\r\n    params = { ...params, Link: link }\r\n  }\r\n  if (implementationID) {\r\n    params = { ...params, ImplementationID: implementationID }\r\n  }\r\n  if (isClient) {\r\n    params = { ...params, IsClient: isClient }\r\n  }\r\n  const requestBody: string = JSON.stringify(params)\r\n\r\n  return ObservableFromFetch<Addresses | null>(\"FFOrderClinicEnrollment/DoesInstanceExists\", requestBody)\r\n}\r\n\r\nexport function CompanyCodeCheck(code: string, link?: string) {\r\n  const requestBody: string = JSON.stringify({\r\n    CompanyCode: code,\r\n    Link: link\r\n  })\r\n\r\n  return ObservableFromFetch<string>(\"FFOrderClinicEnrollment/DoesCompanyCodeExists\", requestBody)\r\n}\r\n\r\nexport function UrlCheck(url: string) {\r\n  const requestBody: string = new URLSearchParams({\r\n    url: url\r\n  }).toString()\r\n\r\n  return ObservableFromFetch<string>(\"FFOrderClinicEnrollment/DoesURLExists?\" + requestBody)\r\n}\r\n\r\nexport function AllImplementationsGet(name: string) {\r\n  const requestBody: string = new URLSearchParams({\r\n    implementationName: name\r\n  }).toString()\r\n\r\n  return ObservableFromFetch<ImplementationSearchResult[]>(\"FFOrderClinicFileMaintenance/GetAllImplementationName?\" + requestBody)\r\n}\r\n","import React from \"react\"\r\nimport { RouteComponentProps } from \"react-router\"\r\nimport { AppPageWrapper } from \"../NavMenu/AppPageWrapper\"\r\nimport EntityActivation, {ActivationType} from './EntityActivation'\r\n\r\nexport default class CompanyActivation extends React.Component {\r\n  render = () => {\r\n    return <AppPageWrapper showNav>\r\n      <EntityActivation {...this.props as RouteComponentProps} type={ActivationType.Company}/>\r\n    </AppPageWrapper>\r\n  }\r\n}\r\n","import React from \"react\"\r\nimport { RouteComponentProps } from \"react-router\"\r\nimport { AppPageWrapper } from \"../NavMenu/AppPageWrapper\"\r\nimport EntityActivation, {ActivationType} from './EntityActivation'\r\n\r\nexport default class PortalActivation extends React.Component {\r\n  render = () => {\r\n    return <AppPageWrapper showNav>\r\n      <EntityActivation {...this.props as RouteComponentProps} type={ActivationType.Portal}/>\r\n    </AppPageWrapper>\r\n  }\r\n}\r\n","import { Observable } from \"rxjs\"\r\nimport { ObservableFromFetch } from \"../ObservableFromFetch\"\r\nimport BusinessType from \"./BusinessType\"\r\n\r\nexport default function BusinessTypesGetObservable(link?: string): Observable<BusinessType[]> {\r\n  const requestBody: string = JSON.stringify(link ? { Link: link } : { })\r\n\r\n  return ObservableFromFetch<BusinessType[]>(\"FFOrderClinicEnrollment/GetBusinessType\", requestBody)\r\n}\r\n","import { Observable } from \"rxjs\"\r\nimport { ObservableFromFetch } from \"../ObservableFromFetch\"\r\n\r\nexport default function CompanyInactivateObservable(implementationID: number, accountID: number, isLocation: boolean = false): Observable<string> {\r\n  const requestBody: string = new URLSearchParams({\r\n    implementationID: implementationID.toString(),\r\n    accountId: accountID.toString(),\r\n    isLocation: isLocation.toString()\r\n  }).toString()\r\n\r\n  return ObservableFromFetch<string>(\"FFOrderClientFileMaintenance/InActivateClient?\" + requestBody)\r\n}\r\n","import { Observable } from \"rxjs\"\r\nimport { ObservableFromFetch } from \"../ObservableFromFetch\"\r\nimport CompanyEditData from \"./CompanyModel/CompanyEditData\"\r\n\r\nexport function CompanyUpdateObservable(data: CompanyEditData): Observable<string> {\r\n  const requestBody: string = JSON.stringify(data)\r\n  return ObservableFromFetch<string>(\"FFOrderClientFileMaintenance/UpdateClientInformation\", requestBody)\r\n}\r\n\r\nexport function CompanyCreateObservable(data: CompanyEditData): Observable<string> {\r\n  const requestBody: string = JSON.stringify(data)\r\n  return ObservableFromFetch<string>(\"FFOrderClientFileMaintenance/CreateCompany\", requestBody)\r\n}","import { Observable } from \"rxjs\"\r\nimport { ObservableFromFetch } from \"../ObservableFromFetch\"\r\nimport CompanyData from \"./CompanyModel/CompanyData\"\r\n\r\nexport default function CompaniesGetObservable(name: string, showInactive: boolean = false): Observable<CompanyData[]> {\r\n  const requestBody: string = JSON.stringify({ ClientName: name, IsActivateClient: showInactive })\r\n\r\n  return ObservableFromFetch<CompanyData[]>(\"FFOrderClientFileMaintenance/GetClientInformation\", requestBody)\r\n}\r\n\r\nexport function CompaniesDetailsExportCsv() {\r\n  return ObservableFromFetch<string>(\"FFOrderClinicFileMaintenance/ExportCompaniesDetails\")\r\n}\r\n\r\n","import React, { Component } from \"react\"\r\nimport { Subject, Subscription, of, concat } from \"rxjs\"\r\nimport { catchError, debounceTime, filter, map, switchMap } from \"rxjs/operators\"\r\nimport { AsyncTypeahead, InputProps } from \"react-bootstrap-typeahead\"\r\nimport LocationQueryGetObservable from \"../../api/Location/LocationQueryGet\"\r\nimport Address from \"../../api/Location/LocationModel/Address\"\r\n\r\nexport interface AddressInputProps {\r\n  id?: string\r\n  emptyLabel?: string\r\n  promptText?: string\r\n  minLength?: number\r\n  placeholder?: string\r\n  selected?: Address\r\n  inputProps?: InputProps\r\n  isInvalid?: boolean\r\n  disabled?: boolean,\r\n  disableSuggestions?: boolean,\r\n  onAddressChange: (address: Address | string | undefined) => void\r\n}\r\n\r\ninterface AddressInputState {\r\n  options: Address[],\r\n  isOptionsLoading: boolean\r\n}\r\n\r\nexport default class AddressInput extends Component<AddressInputProps, AddressInputState> {\r\n  state: AddressInputState = {\r\n    options: [],\r\n    isOptionsLoading: false\r\n  }\r\n  addressesQuery$?: Subject<string>\r\n  addressesSubscription?: Subscription\r\n\r\n  componentDidMount() {\r\n    this.addressesQuery$ = new Subject<string>()\r\n    this.addressesSubscription = this.addressesQuery$.pipe(\r\n      debounceTime(500),\r\n      filter(query => (query ?? \"\").trim().length >= (this.props.minLength || AddressInput.defaultProps.minLength)),\r\n      switchMap((query) => concat(\r\n        of({ isOptionsLoading: true }),\r\n        LocationQueryGetObservable(query).pipe(\r\n          map((options) => ({ isOptionsLoading: false, options: options })),\r\n          catchError(() =>\r\n            of({ isOptionsLoading: false })\r\n          )\r\n        )\r\n      ))\r\n    ).subscribe(\r\n      (state: { isOptionsLoading: boolean, options?: Address[] }) => {\r\n        state.options ?\r\n          this.setState({ isOptionsLoading: state.isOptionsLoading, options: state.options }) :\r\n          this.setState({ isOptionsLoading: state.isOptionsLoading })\r\n      },\r\n      () => this.setState({ isOptionsLoading: false })\r\n    )\r\n  }\r\n\r\n  componentWillUnmount() {\r\n    this.addressesSubscription && this.addressesSubscription.unsubscribe()\r\n  }\r\n\r\n  handleSearch = (query: string) => !this.props.disableSuggestions && this.addressesQuery$ && this.addressesQuery$.next(query)\r\n\r\n  render() {\r\n    return (\r\n      <AsyncTypeahead\r\n        id={this.props.id}\r\n        labelKey={option => option.Text || \"\"}\r\n        emptyLabel={this.props.emptyLabel}\r\n        minLength={0}\r\n        placeholder={this.props.placeholder}\r\n        promptText={this.props.promptText}\r\n        isLoading={this.state.isOptionsLoading}\r\n        onSearch={this.handleSearch}\r\n        open={!!this.props.disableSuggestions ? false : undefined}\r\n        options={this.state.options}\r\n        filterBy={() => true}\r\n        inputProps={this.props.inputProps}\r\n        isInvalid={this.props.isInvalid}\r\n        disabled={this.props.disabled}\r\n        onChange={selected => { if (selected[0]) {this.props.onAddressChange(selected[0])}}}\r\n        onInputChange={(input) => this.props.onAddressChange(input)}\r\n        selected={this.props.selected ? [this.props.selected] : undefined} />\r\n    )\r\n  }\r\n\r\n  static defaultProps = {\r\n    id: \"addressSearch\",\r\n    emptyLabel: \"No Result Found\",\r\n    minLength: 3,\r\n    disableSuggestions: true\r\n  }\r\n}\r\n","import * as React from \"react\"\r\nimport { Container, Modal, Form, Button, Row, Col, Table } from \"react-bootstrap\"\r\n\r\nexport interface AddressData {\r\n  ID: string\r\n  Address1: string\r\n  Zip: string\r\n}\r\n\r\ninterface AddressMatchModalProps {\r\n  show: boolean\r\n  addresses: AddressData[]\r\n  selectedID?: string\r\n  title: string\r\n  subTitle: string\r\n  message?: string\r\n  onClose: () => void\r\n  onAddressSelect: (address: AddressData) => void\r\n}\r\n\r\nexport default class AddressMatchModal extends React.PureComponent<AddressMatchModalProps> {\r\n  render() {\r\n    const { addresses, selectedID, title, subTitle, message } = this.props\r\n    return (\r\n      <Modal centered backdrop=\"static\" size=\"lg\" show={this.props.show} onHide={this.props.onClose}>\r\n        <Modal.Header closeButton>\r\n          <Modal.Title>{title}</Modal.Title>\r\n        </Modal.Header>\r\n        <Modal.Body>\r\n          <Container fluid>\r\n            <Row><Col><h5>{subTitle}</h5></Col></Row>\r\n            <Row><Col>\r\n              <Table className=\"table-sm dark\" responsive>\r\n                <thead>\r\n                  <tr>\r\n                    <th>&nbsp;</th>\r\n                    <th>Street Address</th>\r\n                    <th>Zip</th>\r\n                  </tr>\r\n                </thead>\r\n                <tbody>\r\n                  {addresses.map(item => <tr key={item.ID}>\r\n                    <td className=\"text-center\">\r\n                      <Form.Check type=\"radio\" label=\"\" id={`streetAddress_${item.ID}`} checked={item.ID === selectedID} className=\"abc-radio\" onChange={() => this.props.onAddressSelect(item)} />\r\n                    </td>\r\n                    <td>{item.Address1}</td>\r\n                    <td>{item.Zip}</td>\r\n                  </tr>)}\r\n                </tbody>\r\n              </Table>\r\n            </Col></Row>\r\n            <Row><Col>{message}</Col></Row>\r\n          </Container>\r\n        </Modal.Body>\r\n        <Modal.Footer>\r\n          <Button variant=\"secondary\" onClick={this.props.onClose}>Close</Button>\r\n        </Modal.Footer>\r\n      </Modal>\r\n    )\r\n  }\r\n}\r\n","import React from \"react\"\r\nimport { Modal, Form, Col, Row, Button } from \"react-bootstrap\"\r\nimport { connect } from \"react-redux\"\r\nimport { toast } from \"react-toastify\"\r\nimport { Subscription } from \"rxjs\"\r\nimport { APIError } from \"../../api/ObservableFromFetch\"\r\nimport { GetRoleOrderSecurity, SetRoleOrderSecurity, OrderViewSecurity, OrderSecurityException } from \"../../api/Roles/RoleOrderSecurityProcess\"\r\nimport { AppState } from \"../../AppState\"\r\nimport { RoleIdForSelectedCompany, getUserNameForSelectedCompany } from \"../../authentication/SelectedCompany/CompanySelectionDrivenSelectors\"\r\nimport ActionButton from \"../ActionButton\"\r\nimport DualListBox from \"../Administration/DualListBox\"\r\n\r\ninterface OrderSecurityAuthProps {\r\n  PrimaryRoleID?: number\r\n  UserName?: string\r\n}\r\n\r\ninterface OrderSecurityProps {\r\n  companyName: string\r\n  currentURL?: string\r\n  invitationMode?: boolean\r\n  override?: boolean\r\n  cancelText: string\r\n  submitText: string\r\n  cancelVariant?: string\r\n  onPrev: () => void\r\n  onNext: () => void\r\n}\r\n\r\ninterface OrderSecurityState {\r\n  loading: boolean\r\n  saving: boolean\r\n  overrideOrderSecurity?: boolean\r\n  showOrderSecurityForm: boolean\r\n  roles: OrderSecurityException[]\r\n  selection: OrderSecurityException[]\r\n  selectionLeft: string[]\r\n  selectionRight: string[]\r\n}\r\n\r\nexport class OrderSecurity extends React.PureComponent<OrderSecurityProps & OrderSecurityAuthProps, OrderSecurityState> {\r\n  userRolesSubscription?: Subscription\r\n  updateSubscription?: Subscription\r\n  state = { loading: false, saving: false, overrideOrderSecurity: this.props.override, showOrderSecurityForm: false, roles: [], selection: [], selectionLeft: [], selectionRight: [] }\r\n\r\n  componentDidMount() {\r\n    if (this.props.override) {\r\n      this.showSecurityForm()\r\n    }\r\n  }\r\n\r\n  componentWillUnmount() {\r\n    this.userRolesSubscription && this.userRolesSubscription.unsubscribe()\r\n    this.updateSubscription && this.updateSubscription.unsubscribe()\r\n  }\r\n\r\n  onCancel = () => {\r\n    if (this.state.overrideOrderSecurity) {\r\n      this.setState({ selection: [], selectionLeft: [], selectionRight: [] })\r\n    }\r\n    this.props.onPrev()\r\n  }\r\n\r\n  onSubmit = () => {\r\n    if (this.state.showOrderSecurityForm) {\r\n      this.updateOrderSecurity()\r\n      return\r\n    }\r\n    if (this.state.overrideOrderSecurity) {\r\n      this.showSecurityForm()\r\n    } else {\r\n      this.props.onNext()\r\n    }\r\n  }\r\n\r\n  showSecurityForm() {\r\n    const primaryRoleID = this.props.PrimaryRoleID || 0\r\n    this.setState({ showOrderSecurityForm: true, loading: true })\r\n    this.userRolesSubscription = GetRoleOrderSecurity(primaryRoleID, this.props.currentURL).subscribe(\r\n      (data: OrderViewSecurity) => {\r\n        this.setState({\r\n          roles: [...data.CanOnlySeeOrdersTheyHavePlacedRole, ...data.CanSeeOrdersAnyUserHasPlacedRole],\r\n          selection: data.CanOnlySeeOrdersTheyHavePlacedRole,\r\n          loading: false\r\n        })\r\n      },\r\n      error => {\r\n        toast.error(error)\r\n        this.setState({ loading: false })\r\n      }\r\n    )\r\n  }\r\n\r\n  updateOrderSecurity() {\r\n    this.setState({ saving: true })\r\n    const roles: OrderSecurityException[] = this.state.roles\r\n    const selection: OrderSecurityException[] = this.state.selection\r\n    const canSeeOrdersAnyUserHasPlacedRoles = roles.filter((role: OrderSecurityException) => !selection.includes(role))\r\n    const canOnlySeeOrdersTheyHavePlacedRoles = roles.filter((role: OrderSecurityException) => selection.includes(role))\r\n    const data = {\r\n      CanSeeOrdersAnyUserHasPlacedRole: canSeeOrdersAnyUserHasPlacedRoles,\r\n      CanOnlySeeOrdersTheyHavePlacedRole: canOnlySeeOrdersTheyHavePlacedRoles,\r\n      ModifiedBy: this.props.UserName || \"\",\r\n      Link: this.props.currentURL || \"\"\r\n    }\r\n    this.updateSubscription && this.updateSubscription.unsubscribe()\r\n    this.updateSubscription = SetRoleOrderSecurity(data).subscribe(\r\n      (data) => {\r\n        this.setState({ saving: false })\r\n        this.props.onNext()\r\n      },\r\n      (error) => this.handleAPIError(error, { saving: false })\r\n    )\r\n  }\r\n\r\n  handleAPIError = (error: Error | APIError, stateChanges: object) => {\r\n    this.setState(stateChanges)\r\n    error && toast.error((error as APIError)?.errorData?.message || error.message)\r\n  }\r\n\r\n  render() {\r\n    const { showOrderSecurityForm, loading, roles, selection } = this.state\r\n    const content = <>\r\n      <Modal.Header>\r\n        <Modal.Title className=\"text-uppercase\">Order Security</Modal.Title>\r\n      </Modal.Header>\r\n      <Modal.Body>\r\n        {!showOrderSecurityForm && <React.Fragment>\r\n          <Row><Col><p>Do you want certain user roles to be able to view Orders placed by other users?</p></Col></Row>\r\n          <Row className=\"d-flex justify-content-center\">\r\n            <Col md=\"auto\">\r\n              <Form.Check type=\"radio\" name=\"securityOption\" id=\"optionYes\" value=\"1\" label=\"Yes\" className=\"abc-radio\" onClick={() => this.setState({ overrideOrderSecurity: true })} />\r\n            </Col>\r\n            <Col md=\"auto\">\r\n              <Form.Check type=\"radio\" name=\"securityOption\" id=\"optionNo\" value=\"0\" label=\"No\" className=\"abc-radio\" onClick={() => this.setState({ overrideOrderSecurity: false })} />\r\n            </Col>\r\n          </Row>\r\n        </React.Fragment>}\r\n        {showOrderSecurityForm && <React.Fragment>\r\n          <Form className=\"px-4\">\r\n            <Form.Group as={Row}>\r\n              <Form.Label column=\"sm\" sm={3} className=\"text-lg-right\">Company</Form.Label>\r\n              <Col md={9}>\r\n                <Form.Control type=\"text\" size=\"sm\" defaultValue={this.props.companyName} disabled></Form.Control>\r\n              </Col>\r\n            </Form.Group>\r\n            <DualListBox\r\n              disabled={loading}\r\n              options={roles}\r\n              selected={selection}\r\n              idKey=\"RoleID\"\r\n              labelKey=\"Title\"\r\n              availableTitle=\"Can see Orders any user has placed\"\r\n              selectedTitle=\"Can only see Orders they have placed\"\r\n              onChange={selected => this.setState({ selection: [...selected] })}\r\n            />\r\n          </Form>\r\n        </React.Fragment>}\r\n      </Modal.Body>\r\n      <Modal.Footer>\r\n        <Button variant={this.props.cancelVariant} onClick={this.onCancel} className=\"px-4\">{this.props.cancelText}</Button>\r\n        <ActionButton variant=\"primary\" disabled={this.state.overrideOrderSecurity === undefined} onClick={this.onSubmit} className=\"px-4\" spin={this.state.saving} disableOnSpin>{this.props.submitText}</ActionButton>\r\n      </Modal.Footer>\r\n    </>\r\n\r\n    return <>\r\n      {this.props.invitationMode && <Modal.Dialog size=\"xl\">{content}</Modal.Dialog>}\r\n      {!this.props.invitationMode && <Modal backdrop=\"static\" show size=\"xl\">{content}</Modal>}\r\n    </>\r\n  }\r\n\r\n  static defaultProps = { cancelText: \"Previous\", submitText: \"Next\" }\r\n}\r\n\r\nfunction mapStateToProps(state: AppState): OrderSecurityAuthProps {\r\n  return {\r\n    PrimaryRoleID: RoleIdForSelectedCompany(state),\r\n    UserName: getUserNameForSelectedCompany(state)\r\n  }\r\n}\r\nconst ConnectedOrderSecurity = connect(mapStateToProps, null)(OrderSecurity)\r\nexport default ConnectedOrderSecurity","import { ObservableFromFetch } from \"../ObservableFromFetch\"\r\n\r\nexport interface OrderViewSecurity {\r\n  CanSeeOrdersAnyUserHasPlacedRole: OrderSecurityException[]\r\n  CanOnlySeeOrdersTheyHavePlacedRole: OrderSecurityException[]\r\n  ImplementationID?: number\r\n  ClientID?: number\r\n  ModifiedBy?: string\r\n  Link?: string\r\n}\r\n\r\nexport interface OrderSecurityException {\r\n  Title: string\r\n  Description: string\r\n  Level: number\r\n  RoleOrderSecurityID: number\r\n  ImplementationID: number\r\n  ClientID: number\r\n  RoleID: number\r\n  Active: boolean\r\n  ModifiedBy?: any\r\n  ModifiedOn: string\r\n}\r\n\r\nexport function GetRoleOrderSecurity(clientRoleID: number, link?: string) {\r\n  const params = { ClientRoleID: clientRoleID }\r\n  const requestBody: string = JSON.stringify(link ? { ...params, Link: link } : params)\r\n\r\n  return ObservableFromFetch<OrderViewSecurity>(\"FFOrderRoleOrderSecurity/GetRoleOrderSecurity\", requestBody)\r\n}\r\n\r\nexport  function SetRoleOrderSecurity(data: OrderViewSecurity) {\r\n  const requestBody = JSON.stringify(data)\r\n  return ObservableFromFetch<string>(\"FFOrderRoleOrderSecurity/SetRoleOrderSecurityOfClient\", requestBody)\r\n}\r\n\r\n\r\n","import { ObservableFromFetch } from \"../ObservableFromFetch\"\r\n\r\nexport interface LabCreate {\r\n  AccountId?: number\r\n  ImplementationClientFlag: string\r\n  ImplementationID?: number\r\n  LabAccount: string\r\n  LabCode: string\r\n  Link?: string\r\n}\r\n\r\nexport interface LabUpload {\r\n  Base64String: string\r\n  CompanyID?: number\r\n  ImplementationClientFlag: string\r\n  ImplementationID?: number\r\n  Link?: string\r\n}\r\n\r\nexport function LabAccountCreate(params: LabCreate) {\r\n  const requestBody: string = JSON.stringify(params);\r\n\r\n  return ObservableFromFetch<string>(\"FFOrderLaboratory/LaboratoryInsert\", requestBody)\r\n}\r\n\r\nexport function LabAccountUpload(params: LabUpload) {\r\n  const requestBody: string = JSON.stringify(params);\r\n\r\n  return ObservableFromFetch<string>(\"FFOrderLaboratory/UploadLab\", requestBody)\r\n}\r\n","import React from \"react\"\r\nimport { Modal, Form, Col, Row, Button } from \"react-bootstrap\"\r\nimport { toast } from \"react-toastify\"\r\nimport { Subscription } from \"rxjs\"\r\nimport ActionButton from \"../ActionButton\"\r\nimport CSVUploadModal from \"./CSVUploadModal\"\r\nimport { LabAccountLookup } from \"../../api/LabService/LabAccountsGet\"\r\nimport { LabAccountCreate, LabCreate, LabUpload, LabAccountUpload } from \"../../api/LabService/LabAccountCreate\"\r\nimport { APIError } from \"../../api/ObservableFromFetch\"\r\nimport { ApiRootUrl } from \"../../api/ApiUrl\"\r\nimport { LabAccountMaxLength } from \"../../config/Constants\"\r\n\r\ninterface LabAccountSelectionProps {\r\n  cancelText: string\r\n  isLabSet: boolean\r\n  isClinic: boolean\r\n  isLocation: boolean\r\n  implementationID?: number\r\n  accountID?: number\r\n  isLoggedIn?: boolean\r\n  currentURL?: string\r\n  onPrev: () => void\r\n  onNext: () => void\r\n  onUpdate: () => void\r\n}\r\n\r\ninterface LabAccountSelectionState {\r\n  showUploadSpreadsheet: boolean\r\n  lab: string\r\n  labAccount: string,\r\n  labAccountCode?: string\r\n  checking: boolean\r\n  saving: boolean\r\n}\r\n\r\nexport default class LabAccountSelection extends React.PureComponent<LabAccountSelectionProps, LabAccountSelectionState> {\r\n  state: LabAccountSelectionState = {\r\n    showUploadSpreadsheet: false,\r\n    lab: \"\",\r\n    labAccount: \"\",\r\n    checking: false,\r\n    saving: false\r\n  }\r\n\r\n  checkSubscription?: Subscription\r\n  saveSubscription?: Subscription\r\n\r\n  componentWillUnmount() {\r\n    this.checkSubscription && this.checkSubscription.unsubscribe()\r\n    this.saveSubscription && this.saveSubscription.unsubscribe()\r\n  }\r\n\r\n  handleLabChange = (e: React.ChangeEvent<HTMLSelectElement>) => this.setState({ lab: e.target.value, labAccountCode: undefined })\r\n  handleLabAccountChange = (e: React.ChangeEvent<HTMLInputElement>) => this.setState({ labAccount: e.target.value, labAccountCode: undefined })\r\n\r\n  handleLabCheck = () => {\r\n    this.setState({ checking: true })\r\n    this.checkSubscription = LabAccountLookup(this.state.labAccount, this.state.lab, false, this.props.currentURL || \"\").subscribe(\r\n      data => {\r\n        this.setState({ labAccountCode: data[0].Code, checking: false })\r\n        toast.success(\"Lab Account Found.\")\r\n      },\r\n      error => this.handleAPIError(error, { checking: false })\r\n    )\r\n  }\r\n\r\n  handleNext = () => {\r\n    this.setState({ saving: true })\r\n    this.saveSubscription && this.saveSubscription.unsubscribe()\r\n\r\n    var params: LabCreate = {\r\n      ImplementationClientFlag: this.props.isClinic ? \"1\" : this.props.isLocation ? \"4\" : \"2\",\r\n      LabAccount: this.state.labAccount.toUpperCase(),\r\n      LabCode: this.state.lab || \"\"\r\n    }\r\n\r\n    if (this.props.isLoggedIn) {\r\n      params.ImplementationID = this.props.implementationID || 0\r\n      params.AccountId = this.props.accountID || 0\r\n    }\r\n    else {\r\n      params.Link = this.props.currentURL || \"\"\r\n    }\r\n\r\n    this.saveSubscription = LabAccountCreate(params).subscribe(\r\n      (data) => {\r\n        toast.success(data)\r\n        this.setState({ lab: \"\", labAccount: \"\", labAccountCode: undefined, checking: false, saving: false })\r\n        this.props.onUpdate()\r\n      },\r\n      error => this.handleAPIError(error, { saving: false })\r\n    )\r\n  }\r\n\r\n  handleAPIError = (error: Error | APIError, stateChanges: object) => {\r\n    this.setState(stateChanges)\r\n    error && toast.error((error as APIError)?.errorData?.message || error.message)\r\n  }\r\n\r\n  handleOpenUpload = () => this.setState({ showUploadSpreadsheet: true })\r\n  handleBulkUploaded = () => {\r\n    this.setState({ showUploadSpreadsheet: false })\r\n    this.props.onUpdate()\r\n  }\r\n\r\n  handleStartUploading = (fileName: string, fileContent: string) => {\r\n    var params: LabUpload = {\r\n      ImplementationClientFlag: this.props.isClinic ? \"1\" : \"2\",\r\n      Base64String: fileContent\r\n    }\r\n\r\n    if (this.props.isLoggedIn) {\r\n      params.ImplementationID = this.props.implementationID || 0\r\n      if (!this.props.isClinic) { params.CompanyID = this.props.accountID || 0 }\r\n    }\r\n    else {\r\n      params.Link = this.props.currentURL || \"\"\r\n    }\r\n\r\n    return LabAccountUpload(params)\r\n  }\r\n\r\n  render() {\r\n    const { showUploadSpreadsheet, lab, labAccount, labAccountCode, checking, saving } = this.state\r\n    return (<>\r\n      <Modal backdrop=\"static\" show size=\"xl\">\r\n        <Modal.Header>\r\n          <Modal.Title className=\"text-uppercase\">LAB ACCOUNT SELECTION</Modal.Title>\r\n        </Modal.Header>\r\n        <Modal.Body>\r\n          <Form>\r\n            <Row><Col><p>Please select your lab and then enter your lab account</p></Col></Row>\r\n            <Form.Group as={Row} className=\"required\">\r\n              <Form.Label column sm={2} htmlFor=\"lab\" className=\"pt-1\">Select your Lab</Form.Label>\r\n              <Col sm={8}>\r\n                <Form.Control id=\"lab\" as=\"select\" onChange={this.handleLabChange} value={lab}>\r\n                  <option value=\"\">Select</option>\r\n                  <option value=\"CRL\">CRL</option>\r\n                  <option value=\"PSY\">Psychemedics</option>\r\n                  <option value=\"OMEGA\">Omega</option>\r\n                  \r\n                </Form.Control>\r\n              </Col>\r\n            </Form.Group>\r\n            <Form.Group as={Row} className=\"required\">\r\n              <Form.Label column sm={2} htmlFor=\"labAccount\" className=\"pt-1\">Lab Account</Form.Label>\r\n              <Col sm={8}>\r\n                <Form.Control type=\"text\" id=\"labAccount\" autoComplete=\"off\" value={labAccount} onChange={this.handleLabAccountChange} maxLength={LabAccountMaxLength}/>\r\n              </Col>\r\n              <Col sm={2}>\r\n                <ActionButton variant=\"secondary\" disabled={!lab || !labAccount} onClick={this.handleLabCheck} spin={checking} disableOnSpin>Check Account</ActionButton>\r\n              </Col>\r\n            </Form.Group>\r\n            <Form.Group as={Row} className=\"required\">\r\n              <Col sm={{ span: 8, order: 2, offset: 2 }}>\r\n                <Form.Control type=\"text\" className=\"bg-white\" readOnly value={labAccountCode || \"\"} />\r\n              </Col>\r\n            </Form.Group>\r\n          </Form>\r\n        </Modal.Body>\r\n        <Modal.Footer className=\"justify-content-between\">\r\n          {!this.props.isLocation && <Button variant=\"primary\" onClick={this.handleOpenUpload}>Upload Spreadsheet</Button>}\r\n          <div>\r\n            {!this.props.isLoggedIn && <Button variant=\"primary\" disabled={!this.props.isLabSet} onClick={this.props.onNext} className=\"mr-2\">No More For Now</Button>}\r\n            <Button variant=\"secondary\" onClick={this.props.onPrev} className=\"mr-2\">{this.props.cancelText}</Button>\r\n            <ActionButton variant=\"primary\" disabled={!labAccountCode} onClick={this.handleNext} spin={saving} disableOnSpin>Submit</ActionButton>\r\n          </div>\r\n        </Modal.Footer>\r\n      </Modal>\r\n      {showUploadSpreadsheet &&\r\n        <CSVUploadModal show={true}\r\n          title=\"CLINIC LABORATORY BULK UPLOAD\"\r\n          templateCSVUrl={ApiRootUrl() + \"/Template/lab-account-template.csv\"}\r\n          onCancel={() => this.setState({ showUploadSpreadsheet: false })}\r\n          onStartUpload={this.handleStartUploading}\r\n          onUploaded={this.handleBulkUploaded}>\r\n          <p>To create multiple lab codes for a company at once:<br />\r\n                1. Create a Spreadsheet with the following columns:<br />\r\n            <span className=\"pl-3\">A. Laboratory (CRL)</span><br />\r\n            <span className=\"pl-3\">B. Lab Code</span><br />\r\n                2. Save the Spreadsheet as a CSV text file.<br />\r\n                3. Upload the file here.</p>\r\n        </CSVUploadModal>}\r\n    </>)\r\n  }\r\n\r\n  static defaultProps = { cancelText: \"Previous\", isLoggedIn: false }\r\n}\r\n","import { ObservableFromFetch } from \"../ObservableFromFetch\"\r\nimport LabAccount from \"./Model/LabAccount\"\r\n\r\nexport default function LabAccountListGet(implementationID: number, accountID: number, isLocation: boolean) {\r\n  const requestBody: string = new URLSearchParams({\r\n    implementationID: implementationID.toString(),\r\n    accountID: accountID.toString(),\r\n    isLocation: isLocation.toString()\r\n  }).toString()\r\n\r\n  return ObservableFromFetch<{ActiveLabAccount: LabAccount[], InActiveLabAccount: LabAccount[]}>(\"FFOrderLaboratory/GetLabAccount?\" + requestBody)\r\n}","import { ObservableFromFetch } from \"../ObservableFromFetch\"\r\nimport LabAccount from \"./Model/LabAccount\"\r\n\r\nexport default function ActivateAndInActiveLabAccountObservable(activeLabAccounts: LabAccount[], inactiveLabAccounts: LabAccount[]) {\r\n  const requestBody = JSON.stringify({ ActiveLabAccount: activeLabAccounts, InActiveLabAccount: inactiveLabAccounts })\r\n\r\n  return ObservableFromFetch<string>(\"FFOrderLaboratory/ActivateAndInActiveLabAccount\", requestBody)\r\n}","import React from \"react\"\r\nimport { Modal, Form, Col, Row, Button, Table, Container } from \"react-bootstrap\"\r\nimport { FaChevronLeft, FaAngleDoubleLeft, FaAngleDoubleUp, FaAngleDown, FaAngleDoubleRight, FaAngleDoubleDown, FaChevronRight, FaAngleUp } from \"react-icons/fa\"\r\nimport { toast } from \"react-toastify\"\r\nimport { Subscription } from \"rxjs\"\r\nimport DualListBox from \"./DualListBox\"\r\nimport Checkbox from \"../Checkbox\"\r\nimport AddNewLabAccountSelection from \"../Invitation/LabAccountSelection\"\r\nimport LabAccountListGet from \"../../api/Administration/LabAccountListGet\"\r\nimport LabAccount from \"../../api/Administration/Model/LabAccount\"\r\nimport ActivateAndInActiveLabAccountObservable from \"../../api/Administration/ActivateAndInActiveLabAccount\"\r\nimport ActionButton from \"../ActionButton\"\r\nimport { APIError } from \"../../api/ObservableFromFetch\"\r\nimport { IsOnTrack } from \"../../App\";\r\nimport ConfirmationModal from \"../ConfirmationModal\"\r\n\r\ninterface LabAccountSelectionProps {\r\n  portalMode?: boolean\r\n  locationMode?: boolean\r\n  name: string\r\n  implementationID: number\r\n  accountID: number\r\n  show: boolean\r\n  onClose: () => void\r\n}\r\n\r\ninterface LabAccountSelectionState {\r\n  addNewLabAccountSelection: boolean\r\n  loading: boolean\r\n  saving: boolean\r\n  selectionLeft: number[]\r\n  selectionRight: number[]\r\n  leftItems: LabAccount[]\r\n  rightItems: LabAccount[]\r\n  showConfirmSave: boolean\r\n}\r\n\r\nexport default class LabAccountSelection extends React.PureComponent<LabAccountSelectionProps, LabAccountSelectionState> {\r\n  subscription?: Subscription\r\n  state: LabAccountSelectionState = {\r\n    addNewLabAccountSelection: false,\r\n    loading: false,\r\n    saving: false,\r\n    selectionLeft: [],\r\n    selectionRight: [],\r\n    leftItems: [],\r\n    rightItems: [],\r\n    showConfirmSave: false\r\n  }\r\n\r\n  componentDidUpdate(prevProps: LabAccountSelectionProps) {\r\n    if (this.props.show && this.props.show !== prevProps.show) {\r\n      this.loadLabAccounts()\r\n    }\r\n  }\r\n\r\n  componentWillUnmount() {\r\n    this.subscription && this.subscription.unsubscribe()\r\n  }\r\n\r\n  onCancel = () => {\r\n    this.props.onClose()\r\n    this.setState({ leftItems: [], rightItems: [],selectionLeft: [], selectionRight: [], saving:false, loading:false })\r\n  }\r\n\r\n  onSubmit = () => {\r\n    if(this.state.leftItems.length === 0){\r\n      this.saveData()\r\n      return\r\n    }\r\n    const visibleLabAccounts = this.state.leftItems.filter(item => !item.HideOnOrder)\r\n    if (visibleLabAccounts.length > 0){\r\n      this.saveData()\r\n    }\r\n    else {\r\n      this.setState({ showConfirmSave: true })\r\n    }\r\n  }\r\n  saveData = () => {\r\n    const activeLabAccounts = this.state.leftItems\r\n    const inActiveLabAccounts = this.state.rightItems\r\n\r\n    this.setState({ saving: true })\r\n    this.subscription = ActivateAndInActiveLabAccountObservable(activeLabAccounts, inActiveLabAccounts).subscribe(\r\n      data => {\r\n        this.setState({ saving: false })\r\n        toast.success(data)\r\n        this.loadLabAccounts()\r\n      },\r\n      error => this.handleAPIError(error, { saving: false })\r\n    )\r\n  }\r\n  handleConfirmSave = () => {\r\n    this.setState({ showConfirmSave: false })\r\n    this.saveData()\r\n  }\r\n  handleConfirmClose = () => {\r\n    this.setState({ showConfirmSave: false })\r\n  }\r\n  handleAPIError = (error: Error | APIError, stateChanges: object) => {\r\n    this.setState(stateChanges)\r\n    error && toast.error((error as APIError)?.errorData?.message || error.message)\r\n  }\r\n\r\n  loadLabAccounts() {\r\n    this.setState({ loading: true })\r\n    this.subscription = LabAccountListGet(this.props.implementationID, this.props.accountID, !!this.props.locationMode).subscribe(\r\n      (data: { ActiveLabAccount: LabAccount[], InActiveLabAccount: LabAccount[] }) => {\r\n        const leftItems = data.ActiveLabAccount.sort((a: LabAccount, b: LabAccount) => a.LabAccountNumber < b.LabAccountNumber ? -1 : a.LabAccountNumber > b.LabAccountNumber ? 1 : 0)\r\n        const rightItems = data.InActiveLabAccount.sort((a: LabAccount, b: LabAccount) => a.LabAccountNumber < b.LabAccountNumber ? -1 : a.LabAccountNumber > b.LabAccountNumber ? 1 : 0)\r\n        const availableLabAccounts = [...data.ActiveLabAccount, ...data.InActiveLabAccount].sort((a: LabAccount, b: LabAccount) => a.LabAccountNumber < b.LabAccountNumber ? -1 : a.LabAccountNumber > b.LabAccountNumber ? 1 : 0)\r\n        this.setState({ loading: false, leftItems: leftItems, rightItems: rightItems, selectionLeft: [], selectionRight: [] })\r\n      },\r\n      error => {\r\n        toast.error(error?.errorData?.message || error.message)\r\n        this.setState({ loading: false })\r\n      }\r\n    )\r\n  }\r\n  moveLeftToRight(all: boolean) {\r\n    const selectionLeft: number[] = []\r\n    const ids = all ? this.state.leftItems.map(item => item.ProviderMappingID) : this.state.selectionLeft\r\n    const leftItems = this.state.leftItems.filter(item => !ids.includes(item.ProviderMappingID))\r\n    const newRightItems = [...this.state.rightItems, ...this.state.leftItems.filter(item => ids.includes(item.ProviderMappingID))]\r\n    const rightItems = newRightItems.sort((a: LabAccount, b: LabAccount) => a.LabAccountNumber < b.LabAccountNumber ? -1 : a.LabAccountNumber > b.LabAccountNumber ? 1 : 0)\r\n    this.setState({ selectionLeft: selectionLeft, leftItems: leftItems, rightItems: rightItems })\r\n  }\r\n  moveRightToLeft(all: boolean) {\r\n    const selectionRight: number[] = []\r\n    const ids = all ? this.state.rightItems.map(item => item.ProviderMappingID) : this.state.selectionRight\r\n    const rightItems = this.state.rightItems.filter(item => !ids.includes(item.ProviderMappingID))\r\n    const newLeftItems = [...this.state.leftItems, ...this.state.rightItems.filter(item => ids.includes(item.ProviderMappingID))]\r\n    const leftItems = newLeftItems.sort((a: LabAccount, b: LabAccount) => a.LabAccountNumber < b.LabAccountNumber ? -1 : a.LabAccountNumber > b.LabAccountNumber ? 1 : 0)\r\n    this.setState({ selectionRight: selectionRight, leftItems: leftItems, rightItems: rightItems })\r\n  }\r\n  handleLeftItemClick = (event: React.MouseEvent<HTMLElement>, id: number) => {\r\n\r\n    if ((!event.shiftKey) && (!event.ctrlKey)) {\r\n      const selectionLeft: number[] = [id]\r\n      this.setState({ selectionLeft: selectionLeft })\r\n      return\r\n    }\r\n    if (this.state.selectionLeft.includes(id)) {\r\n      this.setState({ selectionLeft: this.state.selectionLeft.filter(item => item !== id) })\r\n    } else {\r\n      this.setState({ selectionLeft: [...this.state.selectionLeft, id] })\r\n    }\r\n  }\r\n  handleRightItemClick = (event: React.MouseEvent<HTMLElement>, id: number) => {\r\n    if ((!event.shiftKey) && (!event.ctrlKey)) {\r\n      const selectionRight: number[] = [id]\r\n      this.setState({ selectionRight: selectionRight })\r\n      return\r\n    }\r\n    if (this.state.selectionRight.includes(id)) {\r\n      this.setState({ selectionRight: this.state.selectionRight.filter(item => item !== id) })\r\n    } else {\r\n      this.setState({ selectionRight: [...this.state.selectionRight, id] })\r\n    }\r\n  }\r\n\r\n  itemsTable = (data: LabAccount[], isLeft: boolean, editable: boolean = false) => {\r\n    const { selectionLeft, selectionRight } = this.state\r\n    return (\r\n      <Table className=\"table-sm dark\" borderless responsive>\r\n        <tbody>\r\n          {data.map(item => <tr key={\"data_row_\" + item.ProviderMappingID} className={isLeft ? (selectionLeft.includes(item.ProviderMappingID) ? \"selected\" : \"\") : (selectionRight.includes(item.ProviderMappingID) ? \"selected\" : \"\")}>\r\n            <td\r\n              onClick={(e: React.MouseEvent<HTMLElement>) => isLeft ?\r\n                this.handleLeftItemClick(e, item.ProviderMappingID) :\r\n                this.handleRightItemClick(e, item.ProviderMappingID)}\r\n              style={{ userSelect: \"none\" }}\r\n            >\r\n              {item.LabAccountNumber}\r\n            </td>\r\n            {editable && <td className=\"py-0\">\r\n              <Checkbox\r\n                id={\"hide_on_order_\" + item.ProviderMappingID}\r\n                checked={item.HideOnOrder}\r\n                onChange={(e: React.ChangeEvent<HTMLInputElement>) => this.handleHideOnOrderChange(e, item.ProviderMappingID)}\r\n              />\r\n            </td>}\r\n          </tr>)}\r\n        </tbody>\r\n      </Table>\r\n    )\r\n  }\r\n  handleHideOnOrderChange = (event: React.ChangeEvent<HTMLInputElement>, itemId: number) => {\r\n    const selectedCode = event.target.value\r\n\r\n    const itemIndex = this.state.leftItems.findIndex(item => item.ProviderMappingID === itemId);\r\n    if (itemIndex < 0) {\r\n      return\r\n    }\r\n    const leftItems = [...this.state.leftItems]\r\n    leftItems[itemIndex].HideOnOrder = event.target.checked\r\n    this.setState({ leftItems: leftItems })\r\n\r\n  }\r\n\r\n  render() {\r\n    const { loading, saving, addNewLabAccountSelection, leftItems, rightItems, selectionLeft, selectionRight } = this.state\r\n    const { portalMode, name, locationMode } = this.props\r\n    const disabled = loading || saving\r\n    const isOnTrack = IsOnTrack()\r\n    const showConfirmSave = this.state.showConfirmSave\r\n\r\n\r\n    return (\r\n      <>\r\n        {addNewLabAccountSelection && <AddNewLabAccountSelection cancelText=\"Cancel\" isLabSet={false} isLoggedIn={true}\r\n          implementationID={this.props.implementationID} accountID={this.props.accountID} isClinic={!!this.props.portalMode} isLocation={!!this.props.locationMode}\r\n          onPrev={() => this.setState({ addNewLabAccountSelection: false })}\r\n          onNext={() => this.setState({ addNewLabAccountSelection: false })}\r\n          onUpdate={() => { this.setState({ addNewLabAccountSelection: false }); this.loadLabAccounts() }} />}\r\n        {showConfirmSave &&\r\n          <ConfirmationModal show={showConfirmSave}\r\n            title=\"WARNING\"\r\n            textTitle=\"Please note that all accounts are marked as hidden\"\r\n            text=\"\"\r\n            showImage={false}\r\n            onConfirm={() => this.handleConfirmSave()}\r\n            onHide={() => this.handleConfirmClose()} />\r\n        }\r\n\r\n        <Modal backdrop=\"static\" show={this.props.show} size=\"xl\">\r\n          <Modal.Header>\r\n            <Modal.Title className=\"text-uppercase\">Lab Accounts</Modal.Title>\r\n          </Modal.Header>\r\n          <Modal.Body>\r\n            <React.Fragment>\r\n              <Form className=\"px-4\">\r\n                <Form.Group as={Row}>\r\n                  {portalMode && <Form.Label column=\"sm\" sm={3} className=\"text-lg-right\">Clinic</Form.Label>}\r\n                  {!portalMode && !locationMode && <Form.Label column=\"sm\" sm={3} className=\"text-lg-right\">Company</Form.Label>}\r\n                  {!!locationMode && <Form.Label column=\"sm\" sm={3} className=\"text-lg-right\">Location</Form.Label>}\r\n                  <Col md={9}>\r\n                    <Form.Control type=\"text\" size=\"sm\" defaultValue={name} disabled></Form.Control>\r\n                  </Col>\r\n                </Form.Group>\r\n\r\n                <Form.Row>\r\n                  <Container fluid>\r\n                    <Row className=\"d-none d-lg-flex pt-4\">\r\n                      {isOnTrack && <Col lg={5}>Active Lab Accounts</Col>}\r\n                      {!isOnTrack && <Col lg={3}>Active Lab Accounts</Col>}\r\n                      {!isOnTrack && <Col lg={2} className=\"text-center\">Hide On Order</Col>}\r\n                      <Col className=\"px-0 text-center align-self-center\"></Col>\r\n                      <Col lg={5} className=\"pl-lg-0\">Inactive Lab Accounts</Col>\r\n                    </Row>\r\n                    <Row>\r\n                      <Col lg={5} className=\"px-0 border\" style={{ height: \"288px\", overflowY: \"auto\" }}>\r\n                        {this.itemsTable(leftItems, true, !isOnTrack)}\r\n                      </Col>\r\n\r\n                      <Col className=\"px-0 text-center align-self-center\">\r\n                        <Container fluid>\r\n                          <Row>\r\n                            <Col lg={12} xs={3} className=\"px-1 text-center\">\r\n                              <Button className=\"btn-sm btn-sm-icon mb-lg-2 mt-lg-0 my-1\" disabled={!leftItems.length || disabled} onClick={() => this.moveLeftToRight(true)}>\r\n                                <FaAngleDoubleRight className=\"d-none d-lg-inline\" />\r\n                                <FaAngleDoubleDown className=\"d-lg-none\" />\r\n                              </Button>\r\n                            </Col>\r\n                            <Col lg={12} xs={3} className=\"px-1 text-center\">\r\n                              <Button className=\"btn-sm btn-sm-icon mb-lg-2 mt-lg-0 my-1\" disabled={!selectionLeft.length || disabled} onClick={() => this.moveLeftToRight(false)}>\r\n                                <FaChevronRight className=\"d-none d-lg-inline\" />\r\n                                <FaAngleDown className=\"d-lg-none\" />\r\n                              </Button>\r\n                            </Col>\r\n                            <Col lg={12} xs={3} className=\"px-1 text-center\">\r\n                              <Button className=\"btn-sm btn-sm-icon mb-lg-2 mt-lg-0 my-1\" disabled={!selectionRight.length || disabled} onClick={() => this.moveRightToLeft(false)}>\r\n                                <FaChevronLeft className=\"d-none d-lg-inline\" />\r\n                                <FaAngleUp className=\"d-lg-none\" />\r\n                              </Button>\r\n                            </Col>\r\n                            <Col lg={12} xs={3} className=\"px-1 text-center\">\r\n                              <Button className=\"btn-sm btn-sm-icon mb-lg-2 mt-lg-0 my-1\" disabled={!rightItems.length || disabled} onClick={() => this.moveRightToLeft(true)}>\r\n                                <FaAngleDoubleLeft className=\"d-none d-lg-inline\" />\r\n                                <FaAngleDoubleUp className=\"d-lg-none\" />\r\n                              </Button>\r\n                            </Col>\r\n                          </Row>\r\n                        </Container>\r\n\r\n                      </Col>\r\n\r\n\r\n                      <Col lg={5} className=\"px-0 border\" style={{ height: \"288px\", overflowY: \"auto\" }}>\r\n                        {this.itemsTable(rightItems, false, false)}\r\n                      </Col>\r\n                    </Row>\r\n                  </Container>\r\n                </Form.Row>\r\n\r\n              </Form>\r\n            </React.Fragment>\r\n          </Modal.Body>\r\n          <Modal.Footer>\r\n            <Button variant=\"secondary\" onClick={this.onCancel} className=\"px-4\">Cancel</Button>\r\n            <Button onClick={() => this.setState({ addNewLabAccountSelection: true })} className=\"px-4\">Add New</Button>\r\n            <ActionButton onClick={this.onSubmit} className=\"px-4\" spin={saving} disableOnSpin>Submit</ActionButton>\r\n          </Modal.Footer>\r\n        </Modal>\r\n      </>\r\n    )\r\n  }\r\n\r\n}\r\n","import { ObservableFromFetch } from \"../ObservableFromFetch\"\r\nimport SubscriptionPlan from \"./Model/SubscriptionPlan\"\r\n\r\nexport default function GetSubscriptionPlans() {\r\n  return ObservableFromFetch<SubscriptionPlan[]>(\"FFOrderSubscriptionPermission/GetSubscriptionPlan\")\r\n}","import React from \"react\"\r\nimport { Modal, Form, Col, Row, Button } from \"react-bootstrap\"\r\nimport { toast } from \"react-toastify\"\r\nimport { Subscription } from \"rxjs\"\r\nimport GetSubscriptionPlans from \"../../api/Administration/GetSubscriptionPlans\"\r\nimport SubscriptionPlan from \"../../api/Administration/Model/SubscriptionPlan\"\r\nimport ActionButton from \"../ActionButton\"\r\n\r\ninterface SubscriptionModalProps {\r\n  show: boolean\r\n  subscriptionPlanID: number\r\n  onCancel: () => void\r\n  onSubmit: (subscriptionPlanID: number, subscriptionPlan: SubscriptionPlan) => void\r\n}\r\n\r\ninterface SubscriptionModalState {\r\n  availableSubscriptionPlans: SubscriptionPlan[]\r\n  loading: boolean\r\n  subscriptionPlanID: number\r\n}\r\n\r\nexport default class SubscriptionModal extends React.PureComponent<SubscriptionModalProps, SubscriptionModalState> {\r\n  subscription?: Subscription\r\n  state = { loading: false, subscriptionPlanID: this.props.subscriptionPlanID, availableSubscriptionPlans: [] }\r\n\r\n  componentDidUpdate(prevProps: SubscriptionModalProps) {\r\n    if (this.props.show && this.props.show !== prevProps.show) {\r\n      this.loadSubscriptionPlans()\r\n    }\r\n  }\r\n\r\n  componentWillUnmount() {\r\n    this.subscription && this.subscription.unsubscribe()\r\n  }\r\n\r\n  loadSubscriptionPlans = () => {\r\n    this.setState({ loading: true })\r\n    this.subscription = GetSubscriptionPlans().subscribe(\r\n      (data: SubscriptionPlan[]) => this.setState({ loading: false, availableSubscriptionPlans: data }),\r\n      (error) => {\r\n        toast.error(error?.errorData?.message || error.message)\r\n        this.setState({ loading: false })\r\n      },\r\n      () => this.setState({ loading: false })\r\n    )\r\n  }\r\n\r\n  onCancel = () => {\r\n    this.props.onCancel()\r\n  }\r\n\r\n  onSubmit = () => {\r\n    const selectedPlan: SubscriptionPlan = this.state.availableSubscriptionPlans.filter((plan: SubscriptionPlan) => plan.SubscriptionPlanID === this.state.subscriptionPlanID)[0]\r\n    this.props.onSubmit(this.state.subscriptionPlanID, selectedPlan)\r\n  }\r\n\r\n  render() {\r\n    const { availableSubscriptionPlans, loading, subscriptionPlanID,  } = this.state\r\n    const currentPlan: SubscriptionPlan = availableSubscriptionPlans.filter((plan: SubscriptionPlan) => plan.SubscriptionPlanID === this.props.subscriptionPlanID)[0]\r\n    return (\r\n      <>\r\n        <Modal backdrop=\"static\" show={ this.props.show } size=\"lg\" dialogClassName=\"dark\">\r\n          <Modal.Header>\r\n            <Modal.Title className=\"text-uppercase\">Change Subscription</Modal.Title>\r\n          </Modal.Header>\r\n          <Modal.Body>\r\n            <Form className=\"px-4\">\r\n              <Form.Group as={Row}>\r\n                <Form.Label column=\"sm\" sm={3} className=\"text-lg-right\">Current Subscription</Form.Label>\r\n                <Col md={9}>\r\n                  <Form.Control type=\"text\" size=\"sm\" defaultValue={currentPlan?.Title || \"\"} disabled></Form.Control>\r\n                </Col>\r\n              </Form.Group>\r\n              <Form.Group as={Row}>\r\n                <Form.Label column=\"sm\" sm={3} className=\"text-lg-right\">New Subscription</Form.Label>\r\n                <Col md={9}>\r\n                  <Form.Control as=\"select\" type=\"text\" size=\"sm\" defaultValue={ subscriptionPlanID }\r\n                    disabled={ loading }\r\n                    onChange={ (e: React.ChangeEvent<HTMLInputElement>) => this.setState({ subscriptionPlanID: Number(e.target.value) }) }>\r\n                    <option value=\"0\">Select Subscription</option>\r\n                    {this.state.availableSubscriptionPlans.map((plan: SubscriptionPlan) => <option key={plan.SubscriptionPlanID} value={plan.SubscriptionPlanID} title={plan.Description}>{plan.Title}</option> )}\r\n                  </Form.Control>\r\n                </Col>\r\n              </Form.Group>\r\n              <Form.Row>\r\n                <em className=\"small\">By Clicking the Change Button the Current Subscription will be Deactivated and the New Subscription will become the Active Subscription</em>\r\n              </Form.Row>\r\n            </Form>\r\n          </Modal.Body>\r\n          <Modal.Footer>\r\n            <Button variant=\"secondary\" onClick={ this.onCancel } className=\"px-4\">Close</Button>\r\n            <ActionButton variant=\"primary\" onClick={ this.onSubmit } disabled={ loading } disableOnSpin>Update</ActionButton>\r\n          </Modal.Footer>\r\n        </Modal>\r\n      </>\r\n    )\r\n  }\r\n\r\n}\r\n","import { Observable } from \"rxjs\"\r\nimport { AccountLimit } from \"../../config/Constants\"\r\nimport { ObservableFromFetch } from \"../ObservableFromFetch\"\r\n\r\nexport default function AutoFilterPortalsGetObservable(filter: string): Observable<string[]> {\r\n  const requestBody: string = JSON.stringify({ Name: filter, Limit: AccountLimit })\r\n  return ObservableFromFetch<string[]>(\"FFOrderClinicFileMaintenance/PortalWildcardSearch\", requestBody)\r\n}\r\n","import { Observable } from \"rxjs\"\r\nimport { ObservableFromFetch } from \"../ObservableFromFetch\"\r\nimport PortalData from \"./PortalModel/PortalData\"\r\n\r\nexport default function PortalsGetObservable(name: string, showInactive: boolean = false): Observable<PortalData[]> {\r\n  const requestBody: string = JSON.stringify({ CompanyName: name, ShowAll: showInactive })\r\n\r\n  return ObservableFromFetch<PortalData[]>(\"FFOrderClinicFileMaintenance/GetClinicInformation\", requestBody)\r\n}\r\n\r\nexport function PortalGetObservable(implementationId: number) {\r\n  const requestBody: string = new URLSearchParams({ ImplementationID: implementationId.toString() }).toString()\r\n\r\n  return ObservableFromFetch<PortalData>(\"FFOrderClinicFileMaintenance/GetPortal?\" + requestBody)\r\n}\r\n","import { Observable } from \"rxjs\"\r\nimport { ObservableFromFetch } from \"../ObservableFromFetch\"\r\nimport PortalEditData from \"./PortalModel/PortalEditData\"\r\n\r\nexport default function PortalUpdateObservable(data: PortalEditData): Observable<string> {\r\n  const requestBody: string = JSON.stringify(data)\r\n  return ObservableFromFetch<string>(\"FFOrderClinicFileMaintenance/UpdateClinicInformation\", requestBody)\r\n}\r\n","import { Observable } from \"rxjs\"\r\nimport { ObservableFromFetch } from \"../ObservableFromFetch\"\r\n\r\nexport default function PortalInactivateObservable(implementationID: number): Observable<string> {\r\n  const requestBody: string = new URLSearchParams({ implementationID: implementationID.toString() }).toString()\r\n\r\n  return ObservableFromFetch<string>(\"FFOrderClinicFileMaintenance/InActivateClinic?\" + requestBody)\r\n}\r\n","import { ObservableFromFetch } from \"../ObservableFromFetch\"\r\nimport ImplementationImage from \"./Model/ImplementationImage\"\r\n\r\nexport interface ImplementationImageData {\r\n  ImplementationActiveImages: ImplementationImage[]\r\n  ImplementationInActiveImages: ImplementationImage[]\r\n}\r\n\r\nexport default function GetAllImplementationImageByImplementationID(implementationID: number) {\r\n  const requestBody: string = new URLSearchParams({ ImplementationID: implementationID.toString() }).toString()\r\n  return ObservableFromFetch<ImplementationImageData>(\"FFOrderClientFileMaintenance/GetAllImplementationImageByImplementationID?\" + requestBody)\r\n}\r\n","import { format, parseISO } from \"date-fns\"\r\nimport { ObservableFromFetch } from \"../ObservableFromFetch\"\r\n\r\nexport default function UpdateBrandingImage(implementationID: number, implementationImageID: number, activeDate?: string, inactiveDate?: string) {\r\n  const requestBody: string = JSON.stringify({\r\n    ImplementationID: implementationID,\r\n    ImplementationImageID: implementationImageID,\r\n    ActiveDate: format(parseISO(activeDate || \"\"), \"MM/dd/yyyy\"),\r\n    InActiveDate: format(parseISO(inactiveDate || \"\"), \"MM/dd/yyyy\")\r\n  })\r\n\r\n  return ObservableFromFetch<string>(\"FFOrderClientFileMaintenance/UpdateImplementationImage\", requestBody)\r\n}\r\n","import React from \"react\"\r\nimport { Modal, Button, Col, Row, Form } from \"react-bootstrap\"\r\nimport DatePicker from \"react-datepicker\"\r\nimport { BirthdayInput } from \"../FormattedInputs/BirthdayInput\"\r\nimport { parseISO } from \"date-fns\"\r\n\r\ninterface EditActiveImageDateProps {\r\n  show: boolean\r\n  activeDate?: string\r\n  inactiveDate?: string\r\n  onCancel: () => void\r\n  onUpdate: (activeDate: Date, inactiveDate: Date) => void\r\n}\r\n\r\n\r\ninterface EditActiveImageDateState {\r\n  activeDate: Date\r\n  inactiveDate?: Date\r\n}\r\n\r\nexport default class EditActiveImageDate extends React.PureComponent<EditActiveImageDateProps, EditActiveImageDateState> {\r\n  state: EditActiveImageDateState = {\r\n    activeDate: parseISO(this.props.activeDate || \"\"),\r\n    inactiveDate: parseISO(this.props.inactiveDate || \"\"),\r\n  }\r\n\r\n  activeDate = React.createRef<DatePicker>()\r\n  inactiveDate = React.createRef<DatePicker>()\r\n\r\n  render() {\r\n    const { activeDate, inactiveDate } = this.state\r\n    const validActiveDate = !!activeDate\r\n    const validInactiveDate = !!inactiveDate && !!activeDate && activeDate <= inactiveDate\r\n    const canSave = validActiveDate && validInactiveDate\r\n    return (\r\n      <Modal backdrop=\"static\" show={this.props.show} size=\"xl\" className=\"dark\" onHide={this.props.onCancel}>\r\n        <Modal.Header closeButton>\r\n          <Modal.Title className=\"text-uppercase\">Edit Active Image Date</Modal.Title>\r\n        </Modal.Header>\r\n        <Modal.Body>\r\n          <Form>\r\n            <Form.Row className=\"form-group required\">\r\n              <Form.Label column lg={2} xs={6} className=\"text-lg-right\" htmlFor=\"fileName\">Active Date</Form.Label>\r\n              <Col lg={4} xs={6}>\r\n                <DatePicker className=\"form-control\"\r\n                  ref={this.activeDate}\r\n                  peekNextMonth\r\n                  showMonthDropdown\r\n                  showYearDropdown\r\n                  dropdownMode=\"select\"\r\n                  popperPlacement=\"top-end\"\r\n                  minDate={new Date()}\r\n                  selected={this.state.activeDate}\r\n                  enableTabLoop={false}\r\n                  onKeyDown={(e) => { if (this.activeDate && this.activeDate.current && e.key === 'Tab') { this.activeDate.current.setOpen(false) } }}\r\n                  onChange={date => this.setState({ activeDate: date as Date, inactiveDate: undefined })}\r\n                  customInput={<BirthdayInput isInvalid={!validActiveDate} />} />\r\n              </Col>\r\n              <Col xs={12} className=\"d-lg-none pt-2\"></Col>\r\n              <Form.Label column lg={2} xs={6} className=\"text-lg-right\" htmlFor=\"fileName\">Inactive Date</Form.Label>\r\n              <Col lg={4} xs={6}>\r\n                <DatePicker className=\"form-control\"\r\n                  ref={this.inactiveDate}\r\n                  peekNextMonth\r\n                  showMonthDropdown\r\n                  showYearDropdown\r\n                  dropdownMode=\"select\"\r\n                  popperPlacement=\"top-end\"\r\n                  minDate={this.state.activeDate}\r\n                  selected={this.state.inactiveDate}\r\n                  enableTabLoop={false}\r\n                  onKeyDown={(e) => { if (this.inactiveDate && this.inactiveDate.current && e.key === 'Tab') { this.inactiveDate.current.setOpen(false) } }}\r\n                  onChange={date => this.setState({ inactiveDate: date as Date })}\r\n                  customInput={<BirthdayInput isInvalid={!validInactiveDate} />} />\r\n              </Col>\r\n            </Form.Row>\r\n          </Form>\r\n        </Modal.Body>\r\n        <Modal.Footer>\r\n          <Button variant=\"secondary\" onClick={this.props.onCancel}>Cancel</Button>\r\n          <Button onClick={() => this.props.onUpdate(activeDate, inactiveDate!)} disabled={!canSave} className=\"ml-1\">Finish</Button>\r\n        </Modal.Footer>\r\n      </Modal>)\r\n  }\r\n}\r\n","import { ObservableFromFetch } from \"../ObservableFromFetch\"\r\nimport PortalLogoModel from \"./Model/PortalLogoModel\"\r\n\r\nexport default function PortalLogoInsert(logo: PortalLogoModel) {\r\n    const requestBody = JSON.stringify(logo)\r\n    return ObservableFromFetch<string>(\"FFOrderClinicEnrollment/InsertPortalLogo\", requestBody)\r\n}","import * as React from \"react\"\r\nimport { Modal, Form, Row, Col, Button, InputGroup, Table, Container, ProgressBar, Spinner } from \"react-bootstrap\"\r\nimport { toast } from \"react-toastify\"\r\nimport ActionButton from \"../ActionButton\"\r\nimport DatePicker from 'react-datepicker'\r\nimport \"react-datepicker/dist/react-datepicker.css\"\r\nimport { FaChevronLeft, FaChevronUp, FaEdit } from \"react-icons/fa\"\r\nimport { of, Subject, Subscription, timer } from \"rxjs\"\r\nimport { switchMap, startWith, scan, takeWhile, map } from \"rxjs/operators\"\r\nimport { BirthdayInput } from \"../FormattedInputs/BirthdayInput\"\r\nimport { APIError } from \"../../api/ObservableFromFetch\"\r\nimport { format } from \"date-fns\"\r\nimport { MaxFileNameLength, MaxImageFileSize, MaxLogoImageWidth, MaxLogoImageHeight } from \"../../config/Constants\"\r\nimport FormatDate from \"../../formatters/FormatDate\"\r\nimport ImplementationImage from \"../../api/Administration/Model/ImplementationImage\"\r\nimport GetAllImplementationImageByImplementationID, { ImplementationImageData } from \"../../api/Administration/GetAllImplementationImageByImplementationID\"\r\nimport UpdateBrandingImage from \"../../api/Administration/UpdateBrandingImage\"\r\nimport EditActiveImageDate from \"./EditActiveImageDate\"\r\nimport PortalLogoInsert from \"../../api/Invitation/PortalLogoInsert\"\r\nimport PortalLogoModel from \"../../api/Invitation/Model/PortalLogoModel\"\r\n\r\ninterface ManageImagesProps {\r\n  show: boolean\r\n  implementationID: number\r\n  onClose: () => void\r\n}\r\n\r\ninterface ManageImagesUploadingState {\r\n  fileName: string\r\n  progressBarKey: string\r\n  fileContent?: string\r\n  isFileNameValid: boolean\r\n  isFileSizeValid: boolean\r\n  isFileTypeValid: boolean\r\n  isLogoSizeValid: boolean\r\n  uploadPercentage?: number\r\n  uploading: boolean\r\n  uploadError: boolean\r\n  activeDate?: Date\r\n  inactiveDate?: Date\r\n  activeDateCanShowInvalid: boolean\r\n  inactiveDateCanShowInvalid: boolean\r\n}\r\n\r\ninterface ManageImagesSelectionState {\r\n  selectionRight?: number\r\n  activeImages: ImplementationImage[]\r\n  inactiveImages: ImplementationImage[]\r\n}\r\n\r\ninterface ManageImagesDatesEditState {\r\n  editActiveDate: boolean\r\n  data?: ImplementationImageData\r\n}\r\n\r\ninterface ManageImagesState extends ManageImagesUploadingState, ManageImagesSelectionState, ManageImagesDatesEditState {\r\n  loading: boolean\r\n  saving: boolean\r\n}\r\n\r\nexport default class ManageImages extends React.PureComponent<ManageImagesProps, ManageImagesState> {\r\n  emptyState: ManageImagesState = {\r\n    loading: false,\r\n    saving: false,\r\n    editActiveDate: false,\r\n    progressBarKey: \"progressBarKey\",\r\n    isFileNameValid: true,\r\n    isFileSizeValid: true,\r\n    isFileTypeValid: true,\r\n    isLogoSizeValid: true,\r\n    fileName: \"\",\r\n    uploadPercentage: undefined,\r\n    uploading: false,\r\n    uploadError: false,\r\n    activeDateCanShowInvalid: false,\r\n    inactiveDateCanShowInvalid: false,\r\n    activeDate: undefined,\r\n    inactiveDate: undefined,\r\n    activeImages: [],\r\n    inactiveImages: []\r\n  }\r\n  state: ManageImagesState = { ...this.emptyState }\r\n\r\n  file = React.createRef<HTMLInputElement>()\r\n  activeDate = React.createRef<DatePicker>()\r\n  inactiveDate = React.createRef<DatePicker>()\r\n  loadSubscription?: Subscription\r\n  saveSubscription?: Subscription\r\n  uploadSubscription?: Subscription\r\n  fileUploadSimulationSubscription?: Subscription\r\n  fileUploadSimulation$ = new Subject<boolean>()\r\n\r\n  componentDidMount() {\r\n    this.fileUploadSimulationSubscription = this.fileUploadSimulation$.pipe(\r\n      switchMap(enabled =>\r\n        enabled\r\n          ? timer(0, 500).pipe(\r\n            startWith(5),\r\n            scan((acc, curr) => acc + 5),\r\n            takeWhile(value => value <= 90 && this.state.uploading),\r\n            map(value => ({ value: value, write: true })))\r\n          : of({ value: 100, write: false })\r\n      )\r\n    ).subscribe(\r\n      (o: { value: number, write: boolean }) => o.write && this.setState({ uploadPercentage: o.value }),\r\n      () => { }\r\n    )\r\n    this.setState({ loading: true })\r\n  }\r\n\r\n  componentWillUnmount() {\r\n    this.loadSubscription && this.loadSubscription.unsubscribe()\r\n    this.saveSubscription && this.saveSubscription.unsubscribe()\r\n    this.uploadSubscription && this.uploadSubscription.unsubscribe()\r\n    this.fileUploadSimulationSubscription && this.fileUploadSimulationSubscription.unsubscribe()\r\n  }\r\n\r\n  componentDidUpdate(prevProps: ManageImagesProps, prevState: ManageImagesState) {\r\n    if (!prevState.uploading && this.state.uploading) {\r\n      this.fileUploadSimulation$.next(true)\r\n    } else if (prevState.uploading && !this.state.uploading) {\r\n      this.fileUploadSimulation$.next(false)\r\n    }\r\n    if (!prevState.loading && this.state.loading) {\r\n      this.loadImplementationImages()\r\n    }\r\n  }\r\n\r\n  handleAPIError = (error: Error | APIError, stateChanges: object) => {\r\n    this.setState(stateChanges)\r\n    error && toast.error((error as APIError)?.errorData?.message || error.message)\r\n  }\r\n\r\n  loadImplementationImages = () => {\r\n    this.loadSubscription && this.loadSubscription.unsubscribe()\r\n    this.loadSubscription = GetAllImplementationImageByImplementationID(this.props.implementationID).subscribe(\r\n      data => this.setState({\r\n        loading: false,\r\n        activeImages: data.ImplementationActiveImages || [],\r\n        inactiveImages: data.ImplementationInActiveImages || []\r\n      }),\r\n      error => this.handleAPIError(error, { loading: false })\r\n    )\r\n  }\r\n\r\n  handleFileSelect = (e: React.ChangeEvent<HTMLInputElement>) => {\r\n    const file = e.target && e.target.files && e.target.files[0]\r\n    if (!file) {\r\n      return\r\n    }\r\n    const fileName = file.name\r\n    const fileType = file.type\r\n    const ext = (fileName.lastIndexOf('.') >= 0) ? fileName.substring(fileName.lastIndexOf('.') + 1) : \"\"\r\n    const isFileNameValid = fileName.length < MaxFileNameLength\r\n    const isFileSizeValid = file.size < MaxImageFileSize\r\n    const isFileTypeValid = (((ext.toLowerCase() === \"bmp\") || (ext.toLowerCase() === \"jpg\") || (ext.toLowerCase() === \"jpeg\")) && ((fileType.toLowerCase() === \"image/bmp\") || (fileType.toLowerCase() === \"image/jpeg\")) )\r\n    this.setState({ isFileNameValid: isFileNameValid, isFileSizeValid: isFileSizeValid, isFileTypeValid: isFileTypeValid })\r\n    if (isFileNameValid && isFileSizeValid) {\r\n      if (isFileTypeValid) {\r\n        var reader = new FileReader()\r\n        const self = this\r\n        reader.onload = function (e) {\r\n          const result = e.target?.result as string || \"\"\r\n          const stringLength = result.indexOf('base64') + 7\r\n          const fileContent = result.slice(stringLength, result.length)\r\n          if (fileContent) {\r\n            const img = new Image()\r\n            img.onload = function () {\r\n              let prm = createImageBitmap(img)\r\n              prm.then(\r\n                result => {\r\n                  const width = result.width\r\n                  const height = result.height\r\n                  const isLogoSizeValid = ((width <= MaxLogoImageWidth) && (height <= MaxLogoImageHeight))\r\n                  if (isLogoSizeValid) {\r\n                    self.setState({ fileName: file.name, fileContent: fileContent, activeDate: undefined, inactiveDate: undefined, activeDateCanShowInvalid: true, inactiveDateCanShowInvalid: true, isLogoSizeValid: isLogoSizeValid })\r\n                  }\r\n                  else {\r\n                    self.setState({ isLogoSizeValid: isLogoSizeValid })\r\n                    toast.error(\"Image should be 100 x 100 pixels or lower.\")\r\n                  }\r\n                },\r\n                error => { toast.error(error) }\r\n              )\r\n            }\r\n            img.src = result\r\n          } else {\r\n            toast.error(\"Image file is empty.\")\r\n          }\r\n        }\r\n        reader.onerror = function (error) { toast.error(error) }\r\n        reader.readAsDataURL(file)\r\n      } else {\r\n        toast.error(\"Please upload only .bmp type of image files.\")\r\n      }\r\n    }\r\n  }\r\n\r\n  handleRightItemClick = (id?: number) => this.setState({ selectionRight: id })\r\n\r\n  handleClose = () => this.props.onClose()\r\n\r\n  handleSave = () => {\r\n    if (this.state.activeImages.length) {\r\n      const activeImage: ImplementationImage = this.state.activeImages[0]\r\n      this.setState({ saving: true })\r\n      this.saveSubscription && this.saveSubscription.unsubscribe()\r\n      this.saveSubscription = UpdateBrandingImage(this.props.implementationID, activeImage.ImplementationImageID, activeImage.ActiveDate, activeImage.InActiveDate).subscribe(\r\n        message => {\r\n          toast.success(message)\r\n          this.setState({ ...this.emptyState, loading: true })\r\n        },\r\n        error => this.handleAPIError(error, { loading: false }))\r\n    }\r\n  }\r\n\r\n  handleUploading = () => {\r\n    const { fileName, fileContent, activeDate, inactiveDate, } = this.state\r\n    if (!fileContent || !activeDate || !inactiveDate) {\r\n      return\r\n    }\r\n    this.setState({ uploading: true, uploadError: false, uploadPercentage: 5, progressBarKey: Math.random().toString() })\r\n    const logo: PortalLogoModel = {\r\n      ImageName: fileName,\r\n      ImageData: fileContent,\r\n      ActiveDate: format(activeDate, \"MM/dd/yyyy\"),\r\n      InActiveDate: format(inactiveDate, \"MM/dd/yyyy\"),\r\n      ImplementationID: this.props.implementationID\r\n    }\r\n\r\n    this.uploadSubscription && this.uploadSubscription.unsubscribe()\r\n    this.uploadSubscription = PortalLogoInsert(logo).subscribe(\r\n      () => this.setState({ uploading: false, uploadError: false, uploadPercentage: 100, loading: true }),\r\n      error => {\r\n        this.handleAPIError(error, { uploading: false, uploadError: true })\r\n        this.fileUploadSimulation$.error(undefined)\r\n      }\r\n    )\r\n  }\r\n\r\n  setActiveImage = (e: any) => {\r\n    const newActive = this.state.selectionRight\r\n    const { activeImages, inactiveImages } = this.state\r\n    const allImages = [...activeImages, ...inactiveImages]\r\n    const newActiveImages = allImages.filter((image: ImplementationImage) => image.ImplementationImageID === newActive)\r\n    const newInactiveImages = allImages.filter((image: ImplementationImage) => image.ImplementationImageID !== newActive)\r\n    this.setState({ activeImages: newActiveImages, inactiveImages: newInactiveImages, selectionRight: undefined })\r\n  }\r\n\r\n  handleActiveImageDatesUpdate = (activeDate: Date, inactiveDate: Date) => {\r\n    const activeDateString = format(activeDate, \"yyyy-MM-dd'T'HH:mm:ss\")\r\n    const inactiveDateString = format(inactiveDate, \"yyyy-MM-dd'T'HH:mm:ss\")\r\n    const activeImages = this.state.activeImages.map(item => ({ ...item, ActiveDate: activeDateString, InActiveDate: inactiveDateString }))\r\n    this.setState({ activeImages: activeImages, editActiveDate: false })\r\n  }\r\n\r\n  render() {\r\n    const {\r\n      loading, saving, editActiveDate,\r\n      fileName, activeImages, inactiveImages, selectionRight,\r\n      activeDate, inactiveDate, activeDateCanShowInvalid, inactiveDateCanShowInvalid,\r\n      progressBarKey, uploadPercentage, fileContent, uploadError, uploading, isFileNameValid, isFileSizeValid, isFileTypeValid, isLogoSizeValid\r\n    } = this.state\r\n\r\n    const validActiveDate = !!activeDate\r\n    const validInactiveDate = !!inactiveDate && !!activeDate && activeDate <= inactiveDate\r\n    const canUpload = !!fileContent && validActiveDate && validInactiveDate && isFileNameValid && isFileSizeValid && isFileTypeValid && isLogoSizeValid\r\n\r\n    const imageTable = (data: ImplementationImage[], editable: boolean = false) => <Table className=\"table-sm dark\" borderless responsive=\"bordered-h100p\">\r\n      <thead>\r\n        <tr>\r\n          <th>Image</th>\r\n          <th>Active</th>\r\n          <th>Inactive</th>\r\n          {editable && <th>Edit</th>}\r\n        </tr>\r\n      </thead>\r\n      <tbody>\r\n        {data.map(image => <tr key={image.ImplementationImageID} className={selectionRight && selectionRight === image.ImplementationImageID ? \"selected\" : \"\"} onClick={() => !editable && this.handleRightItemClick(image.ImplementationImageID)}>\r\n          <td>{image.ImageName}</td>\r\n          <td>{FormatDate(image.ActiveDate)}</td>\r\n          <td>{FormatDate(image.InActiveDate)}</td>\r\n          {editable && <td className=\"py-0\"><Button variant=\"link\" className=\"py-0\" onClick={() => this.setState({ editActiveDate: true })}><FaEdit /></Button></td>}\r\n        </tr>)}\r\n      </tbody>\r\n    </Table>\r\n\r\n    return (<>\r\n      <Modal backdrop=\"static\" size=\"xl\" show={this.props.show} onHide={this.handleClose}>\r\n        <Modal.Header>\r\n          <Modal.Title>Manage Images</Modal.Title>\r\n        </Modal.Header>\r\n        <Modal.Body>\r\n          <Form>\r\n            <Form.Row className=\"form-group\">\r\n              <Form.Label column lg={3} className=\"text-lg-right\" htmlFor=\"fileName\">Branding Image</Form.Label>\r\n              <Col lg={7}>\r\n                <InputGroup>\r\n                  <Form.Control type=\"text\" name=\"fileName\" defaultValue={fileName || \"\"} readOnly className=\"bg-white\" />\r\n                  <InputGroup.Append>\r\n                    <Button variant=\"secondary\" onClick={() => { this.file && this.file.current && this.file.current.click() }} disabled={uploading}>Browse</Button>\r\n                  </InputGroup.Append>\r\n                </InputGroup>\r\n                <Form.Control type=\"file\" ref={this.file} accept=\".bmp, .BMP, .jpg, .JPG, .jpeg, .JPEG\" onChange={this.handleFileSelect} style={{ display: 'none' }} />\r\n              </Col>\r\n            </Form.Row>\r\n            <Form.Row className=\"form-group\">\r\n              <Form.Label column xs={3} className=\"text-lg-right\" htmlFor=\"fileName\">Active Date</Form.Label>\r\n              <Col xs={9} lg={5} className=\"text-right text-lg-left\">\r\n                <DatePicker className=\"form-control\"\r\n                  ref={this.activeDate}\r\n                  peekNextMonth\r\n                  showMonthDropdown\r\n                  showYearDropdown\r\n                  dropdownMode=\"select\"\r\n                  popperPlacement=\"top-end\"\r\n                  minDate={new Date()}\r\n                  selected={this.state.activeDate}\r\n                  enableTabLoop={false}\r\n                  onKeyDown={(e) => { if (this.activeDate && this.activeDate.current && e.key === 'Tab') { this.activeDate.current.setOpen(false) } }}\r\n                  onChange={date => this.setState({ activeDate: date as Date, inactiveDate: undefined })}\r\n                  onBlur={() => this.setState({ activeDateCanShowInvalid: true })}\r\n                  customInput={<BirthdayInput isInvalid={activeDateCanShowInvalid && !validActiveDate} />} />\r\n              </Col>\r\n            </Form.Row>\r\n            <Form.Row className=\"form-group\">\r\n              <Form.Label column xs={3} className=\"text-lg-right\" htmlFor=\"fileName\">Inactive Date</Form.Label>\r\n              <Col xs={9} lg={5} className=\"text-right text-lg-left\">\r\n                <DatePicker className=\"form-control\"\r\n                  ref={this.inactiveDate}\r\n                  peekNextMonth\r\n                  showMonthDropdown\r\n                  showYearDropdown\r\n                  dropdownMode=\"select\"\r\n                  popperPlacement=\"top-end\"\r\n                  minDate={this.state.activeDate}\r\n                  selected={this.state.inactiveDate}\r\n                  enableTabLoop={false}\r\n                  onKeyDown={(e) => { if (this.inactiveDate && this.inactiveDate.current && e.key === 'Tab') { this.inactiveDate.current.setOpen(false) } }}\r\n                  onChange={date => this.setState({ inactiveDate: date as Date })}\r\n                  onBlur={() => this.setState({ inactiveDateCanShowInvalid: true })}\r\n                  customInput={<BirthdayInput isInvalid={inactiveDateCanShowInvalid && !validInactiveDate} />} />\r\n              </Col>\r\n              <Col lg={2} className=\"text-right pt-2 pt-lg-0\">\r\n                <Button variant=\"primary\" onClick={this.handleUploading} disabled={!canUpload}>Upload</Button>\r\n              </Col>\r\n            </Form.Row>\r\n            {!isFileSizeValid && <Form.Row><Col className=\"text-center error-message\">Please select file of size maximum 1 MB</Col></Form.Row>}\r\n            {!isFileNameValid && <Form.Row><Col className=\"text-center error-message\">The file name should be less than 200 characters. Please rename the file.</Col></Form.Row>}\r\n            {(!isFileTypeValid || !isLogoSizeValid) && <Form.Row><Col className=\"text-center error-message\">Please select BMP /JPG file 200 x 100 pixels or lower.</Col></Form.Row>}\r\n            {!!fileContent && uploadPercentage !== undefined && <>\r\n              <Form.Row className=\"form-group\">\r\n                <Col lg={{ span: 7, order: 2, offset: 3 }}>\r\n                  <ProgressBar key={progressBarKey} variant={uploadError ? \"danger\" : \"success\"} now={uploadPercentage} label={uploadPercentage && uploadPercentage < 100 ? `${uploadPercentage}%` : \"Complete\"} />\r\n                </Col>\r\n              </Form.Row>\r\n            </>}\r\n            {uploadError && <Form.Row><Col className=\"text-center error-message\">Error Occurred</Col></Form.Row>}\r\n            <Form.Row>\r\n              <Container fluid>\r\n                <Row className=\"d-none d-lg-flex pt-4\">\r\n                  <Col lg={6} className=\"text-center\">Active Image<p><em className=\"note-message\">Only 1 image can be Active at a time</em></p></Col>\r\n                  <Col className=\"px-0 text-center\">\r\n                    {loading && <Spinner animation=\"border\" variant=\"secondary\" />}\r\n                  </Col>\r\n                  <Col lg={5} className=\"text-center pl-lg-0\">Inactive Images</Col>\r\n                </Row>\r\n                <Row>\r\n                  <Col lg={6} className=\"d-lg-none px-0 text-center\">Active Image<p><em className=\"note-message\">Only 1 image can be Active at a time</em></p></Col>\r\n                  <Col lg={6} className=\"px-0\">{imageTable(activeImages, true)}</Col>\r\n                  <Col className=\"px-0 text-center align-self-center\">\r\n                    <Button className=\"px-3 my-2 my-lg-0\" disabled={!selectionRight} onClick={this.setActiveImage}>\r\n                      <FaChevronLeft className=\"d-none d-lg-flex\" />\r\n                      <FaChevronUp className=\"d-lg-none\" />\r\n                    </Button>\r\n                  </Col>\r\n                  <Col lg={5} className=\"d-lg-none px-0 text-center\">Inactive Images</Col>\r\n                  <Col lg={5} className=\"px-0\">{imageTable(inactiveImages)}</Col>\r\n                </Row>\r\n              </Container>\r\n            </Form.Row>\r\n          </Form>\r\n        </Modal.Body>\r\n        <Modal.Footer>\r\n          <Button variant=\"secondary\" onClick={this.handleClose}>Cancel</Button>\r\n          <ActionButton variant=\"primary\" className=\"ml-2\" onClick={this.handleSave} disabled={!activeImages.length} spin={saving} disableOnSpin>Submit</ActionButton>\r\n        </Modal.Footer>\r\n      </Modal>\r\n      {editActiveDate && activeImages[0] && <EditActiveImageDate show={editActiveDate}\r\n        activeDate={activeImages[0].ActiveDate || \"\"}\r\n        inactiveDate={activeImages[0].InActiveDate || \"\"}\r\n        onCancel={() => this.setState({ editActiveDate: false })}\r\n        onUpdate={this.handleActiveImageDatesUpdate} />}\r\n    </>)\r\n  }\r\n}\r\n","import { Observable } from \"rxjs\"\r\nimport { ObservableFromFetch } from \"../../ObservableFromFetch\"\r\nimport ImportJobData from \"./Model/ImportJobData\"\r\n\r\nexport default function ImportJobCreateObservable(csvBase64: string, fileName: string, companyID: number, importJobID?: number): Observable<ImportJobData> {\r\n  const params: string = JSON.stringify({\r\n    CSVFileBase64String: csvBase64,\r\n    FileName: fileName,\r\n    ImportJobID: importJobID || 0,\r\n    CompanyID: companyID\r\n  })\r\n  return ObservableFromFetch<ImportJobData>(\"WorkforceCompanyImport/CreateImportJob\", params)\r\n}\r\n\r\nexport function LocationImportJobCreateObservable(csvBase64: string, fileName: string, implementationID: number, companyID: number, importJobID?: number): Observable<ImportJobData> {\r\n  const params: string = JSON.stringify({\r\n    CSVFileBase64String: csvBase64,\r\n    FileName: fileName,\r\n    ImportJobID: importJobID || 0,\r\n    CompanyID: implementationID,\r\n    AccountID: companyID,\r\n    WorkforceLocation: true\r\n  })\r\n  return ObservableFromFetch<ImportJobData>(\"WorkforceCompanyImport/CreateImportJob\", params)\r\n}\r\n","import { ObservableFromFetch } from \"../../ObservableFromFetch\"\r\n\r\ninterface ValidationResultRow {\r\n  OriginalString: string\r\n  Items: string[]\r\n  Errors: string[] | null\r\n  Warnings: string[] | null\r\n  RowNum: number\r\n}\r\n\r\nexport interface ImportJobValidationResult {\r\n  Headers: string[]\r\n  Rows: ValidationResultRow[]\r\n  TotalRowsCount: number\r\n  ValidRowsCount: number\r\n}\r\n\r\nexport default function ImportJobValidateObservable(importJobID: number) {\r\n  const params: string = JSON.stringify({ ImportJobID: importJobID })\r\n  return ObservableFromFetch<ImportJobValidationResult>(\"WorkforceCompanyImport/StartValidation\", params)\r\n}\r\n","import { Observable } from \"rxjs\"\r\nimport { ObservableFromFetch } from \"../../ObservableFromFetch\"\r\nimport ImportJobActionResult from \"./Model/ImportJobActionResult\"\r\n\r\nexport default function ImportJobStartObservable(importJobID: number, poolID: number): Observable<ImportJobActionResult> {\r\n  const params: string = JSON.stringify({\r\n    ImportJobID: importJobID,\r\n    PoolID: poolID\r\n  })\r\n  return ObservableFromFetch<ImportJobActionResult>(\"WorkforceCompanyImport/StartImport\", params)\r\n}\r\n","import { Observable } from \"rxjs\"\r\nimport { ObservableFromFetch } from \"../../ObservableFromFetch\"\r\nimport ImportJobActionResult from \"./Model/ImportJobActionResult\"\r\n\r\nexport default function ImportJobCancelObservable(importJobID: number): Observable<ImportJobActionResult> {\r\n  const params: string = JSON.stringify({ ImportJobID: importJobID })\r\n  return ObservableFromFetch<ImportJobActionResult>(\"WorkforceCompanyImport/CancelImportJob\", params)\r\n}\r\n","import * as React from \"react\"\r\nimport { Button, Col, Form, Modal, Row, Table } from \"react-bootstrap\"\r\nimport { Subscription } from \"rxjs\"\r\nimport { toast } from \"react-toastify\"\r\nimport { ImportCSVMaxFileSize } from \"../../config/Constants\"\r\nimport ConfirmationModal from \"../ConfirmationModal\"\r\nimport ImportJobData from \"../../api/Administration/CompanyImport/Model/ImportJobData\"\r\nimport ImportJobCreateObservable from \"../../api/Administration/CompanyImport/ImportJobCreate\"\r\nimport ImportJobValidateObservable, { ImportJobValidationResult } from \"../../api/Administration/CompanyImport/ImportJobValidate\"\r\nimport ImportJobStartObservable from \"../../api/Administration/CompanyImport/ImportJobStart\"\r\nimport ImportJobCancelObservable from \"../../api/Administration/CompanyImport/ImportJobCancel\"\r\nimport ActionButton from \"../ActionButton\"\r\nimport { ApiRootUrl } from \"../../api/ApiUrl\"\r\n\r\ninterface CompanyImportProps {\r\n  portalID: number\r\n  onClose: () => void\r\n}\r\n\r\ninterface CompanyImportState {\r\n  step: \"file\" | \"mapping\" | \"import\"\r\n  fileInputKey: string\r\n  fileName?: string\r\n  fileContent?: string\r\n  importData?: ImportJobData\r\n  validationResult?: ImportJobValidationResult\r\n  isSaving: boolean\r\n  isCancelling: boolean\r\n  showCancelConfirmModal: boolean\r\n  showImportConfirmModal: boolean\r\n}\r\n\r\nexport default class CompanyImport extends React.Component<CompanyImportProps, CompanyImportState> {\r\n  emptyData: CompanyImportState = {\r\n    step: \"file\",\r\n    fileInputKey: \"file_input_key\",\r\n    fileName: undefined,\r\n    fileContent: undefined,\r\n    importData: undefined,\r\n    validationResult: undefined,\r\n    isSaving: false,\r\n    isCancelling: false,\r\n    showCancelConfirmModal: false,\r\n    showImportConfirmModal: false\r\n  }\r\n  state: CompanyImportState = { ...this.emptyData }\r\n\r\n  importJobCreateSubscription?: Subscription\r\n  importJobValidateSubscription?: Subscription\r\n  importJobStartSubscription?: Subscription\r\n  importJobCancelSubscription?: Subscription\r\n\r\n  componentDidMount() { }\r\n\r\n  componentWillUnmount() {\r\n    this.importJobCreateSubscription && this.importJobCreateSubscription.unsubscribe()\r\n    this.importJobValidateSubscription && this.importJobValidateSubscription.unsubscribe()\r\n    this.importJobStartSubscription && this.importJobStartSubscription.unsubscribe()\r\n    this.importJobCancelSubscription && this.importJobCancelSubscription.unsubscribe()\r\n  }\r\n\r\n  handleApiError = (error: Error) => {\r\n    this.setState({ isSaving: false, isCancelling: false })\r\n    toast.error(error)\r\n  }\r\n\r\n  handleFileStepNext = () => {\r\n    if (this.state.fileContent) {\r\n      this.setState({ isSaving: true })\r\n      this.importJobCreateSubscription && this.importJobCreateSubscription.unsubscribe()\r\n      this.importJobCreateSubscription = ImportJobCreateObservable(this.state.fileContent, this.state.fileName || \"\", this.props.portalID, this.state.importData?.ImportJobID).subscribe(\r\n        data => this.setState({\r\n          step: \"mapping\",\r\n          importData: data,\r\n          isSaving: false\r\n        }),\r\n        error => this.handleApiError(error)\r\n      )\r\n    }\r\n  }\r\n\r\n  handleStartImportValidation = () => {\r\n    if (!this.state.importData?.ImportJobID || !this.state.importData?.Records.length) {\r\n      return\r\n    }\r\n    this.setState({ isSaving: true })\r\n    this.importJobValidateSubscription && this.importJobValidateSubscription.unsubscribe()\r\n    this.importJobValidateSubscription = ImportJobValidateObservable(this.state.importData?.ImportJobID).subscribe(\r\n      validationErrors => this.setState({ step: \"import\", validationResult: validationErrors, isSaving: false }),\r\n      error => this.handleApiError(error)\r\n    )\r\n  }\r\n\r\n  performImport = () => {\r\n    this.setState({ isSaving: true, showImportConfirmModal: false })\r\n    this.importJobStartSubscription && this.importJobStartSubscription.unsubscribe()\r\n    this.importJobStartSubscription = ImportJobStartObservable(this.state.importData?.ImportJobID || 0, 0).subscribe(\r\n      (data) => {        \r\n        data.Result ? toast.success(\"Records imported successfully.\") : toast.error(\"Import completed with errors\")\r\n        this.props.onClose()\r\n      },\r\n      error => this.handleApiError(error)\r\n    )\r\n  }\r\n\r\n  performCancel = () => {\r\n    this.setState({ isCancelling: true })\r\n    this.importJobCancelSubscription && this.importJobCancelSubscription.unsubscribe()\r\n    this.importJobCancelSubscription = ImportJobCancelObservable(this.state.importData?.ImportJobID || 0).subscribe(\r\n      () => {\r\n        toast.success(\"Created job is cancelled successfully.\")\r\n        this.resetState()\r\n      },\r\n      error => this.handleApiError(error)\r\n    )\r\n  }\r\n\r\n  resetState = () => this.setState({ ...this.emptyData, fileInputKey: Math.random().toString() })\r\n\r\n  handleHandleFileUpload = (e: React.ChangeEvent<HTMLInputElement>) => {\r\n    const file = e.target && e.target.files && e.target.files[0]\r\n    if (file && file.size > 0 && file.size < ImportCSVMaxFileSize) {\r\n      const ext = file.name.substring(file.name.lastIndexOf(\".\") + 1)\r\n      if (ext && ext.toLowerCase() === \"csv\") {\r\n        var reader = new FileReader()\r\n        const self = this\r\n        reader.onload = function (e) {\r\n          const result = e.target?.result as string || \"\"\r\n          const stringLength = result.indexOf(\"base64\") + 7\r\n          const fileContent = result.slice(stringLength, result.length)\r\n          if (fileContent) {\r\n            self.setState({ fileName: file.name, fileContent: fileContent })\r\n          } else {\r\n            self.setState({ fileName: undefined, fileContent: undefined })\r\n            toast.error(\"CSV file is empty.\")\r\n          }\r\n        }\r\n        reader.onerror = function (error) { toast.error(error) }\r\n        reader.readAsDataURL(file)\r\n      } else {\r\n        toast.error(\"File type not allowed, Please upload CSV file.\")\r\n      }\r\n    } else {\r\n      this.setState({ fileName: undefined, fileContent: undefined })\r\n    }\r\n  }\r\n\r\n  calcColspan = (items: string[], i: number, tableColsCount: number) => {\r\n    if (i === items.length - 1) {\r\n      return Math.max(1, tableColsCount - i)\r\n    }\r\n    return 1\r\n  }\r\n\r\n  render() {\r\n    const { step, fileInputKey, fileContent,\r\n      importData, validationResult,\r\n      isSaving, isCancelling, showCancelConfirmModal, showImportConfirmModal\r\n    } = this.state\r\n\r\n    const previewTableColsCount = step === \"mapping\" && importData\r\n      ? Math.max(...importData.Records.map(item => item.length), importData.HeaderItems.length)\r\n      : 0\r\n    return <Modal size=\"xl\" backdrop=\"static\" show onHide={this.props.onClose} dialogClassName=\"modal-90w\">\r\n      <Modal.Header closeButton>\r\n        <Modal.Title>COMPANY IMPORT</Modal.Title>\r\n      </Modal.Header>\r\n      <Modal.Body className=\"pt-0 CompanyImport\">\r\n        {step === \"file\" &&\r\n          <Form>\r\n            <Form.Row><Col><h5>UPLOAD FILE</h5></Col></Form.Row>\r\n            <Form.Row>\r\n              <Col xs={5} md={3}><h6>Import CSV File</h6></Col>\r\n              <Col xs={7} md={9}>\r\n                <h6>\r\n                  <a className=\"text-link\" href={ApiRootUrl() + \"/Template/company-import-template.csv\"}>Download Example Spreadsheet</a>\r\n                </h6>\r\n              </Col>\r\n            </Form.Row>\r\n            <Form.Row className=\"form-group\">\r\n              <Form.Label column md={3}>Upload file:</Form.Label>\r\n              <Col md={9} className=\"form-label col-form-label\">\r\n                <input type=\"file\" key={fileInputKey} accept=\".csv\" onChange={this.handleHandleFileUpload} />\r\n              </Col>\r\n            </Form.Row>\r\n          </Form>}\r\n        {step === \"mapping\" &&\r\n          <Form>\r\n            <Row><Col><h5>PREVIEW</h5></Col></Row>\r\n            <Table className=\"mappings-table\" responsive bordered>\r\n              <thead>\r\n                {importData && importData.HeaderItems.length > 0 && <tr>{importData.HeaderItems.map((item, i) => <th key={`hr_${item}_${i}`} colSpan={this.calcColspan(importData.HeaderItems, i, previewTableColsCount)}>{item}</th>)}</tr>}\r\n              </thead>\r\n              <tbody>\r\n                {importData && importData.Records.length > 0 && importData.Records.map((row, i) => <tr key={`d_${i}`}>{row.map((item, j) => <td colSpan={this.calcColspan(row, j, previewTableColsCount)} key={`d_${j}_${i}`}>{item}</td>)}</tr>)}\r\n                {importData && importData.Records.length === 0 && <tr><td colSpan={previewTableColsCount}>NO DATA FOUND</td></tr>}\r\n              </tbody>\r\n            </Table>\r\n          </Form>}\r\n        {step === \"import\" &&\r\n          <Form>\r\n            <Row><Col><h5>IMPORT FILE VALIDATION</h5></Col></Row>\r\n            <Row><Col>Import file validation: ({(validationResult?.TotalRowsCount || 0) - (validationResult?.ValidRowsCount || 0)} of {validationResult?.TotalRowsCount || 0} have errors)</Col></Row>\r\n            {validationResult && validationResult.Rows.length > 0 &&\r\n              <Table className=\"table-sm\" responsive bordered>\r\n                <thead>\r\n                  <tr>\r\n                    <th>Line #</th>\r\n                    <th>Validation errors and warnings</th>\r\n                    {validationResult.Headers.map((item, i) => <th key={`h_${item}+${i}]`}>{item}</th>)}\r\n                  </tr>\r\n                </thead>\r\n                <tbody>\r\n                  {validationResult.Rows.map((row, i) => <tr key={`d_${i}`}>\r\n                    <td>{row.RowNum}</td>\r\n                    <td>\r\n                      {(row.Errors?.length || 0) > 0 && <div className=\"error-message\">\r\n                        <span className=\"font-weight-bold\">Error{row.Errors!.length > 1 ? `s (${row.Errors!.length}):` : \":\"}</span>\r\n                        {row.Errors!.map((item, i) => <div className=\"pt-1\" key={`err_${i}`}>{item}</div>)}\r\n                      </div>}\r\n                      {(row.Warnings?.length || 0) > 0 && <div className=\"warning-message\">\r\n                        <span className=\"font-weight-bold\">Warning{row.Warnings!.length > 1 ? `s (${row.Warnings!.length}):` : \":\"}</span>\r\n                        {row.Warnings!.map((item, i) => <div className=\"pt-1\" key={`warn_${i}`}>{item}</div>)}\r\n                      </div>}\r\n                    </td>\r\n                    {row.Items.length === validationResult.Headers.length && row.Items.map((item, j) => <td key={`d_${item}_${i}_${j}`}><span>{item}</span></td>)}\r\n                    {row.Items.length !== validationResult.Headers.length && <td colSpan={validationResult.Headers.length}><span className=\"font-weight-bold\">Original line:</span><div>{row.OriginalString}</div></td>}\r\n                  </tr>)}\r\n                </tbody>\r\n              </Table>}\r\n          </Form>}\r\n        <ConfirmationModal show={showCancelConfirmModal}\r\n          title=\"CANCEL CONFIRMATION\"\r\n          textTitle={`Are you sure you want to cancel importing ${validationResult?.ValidRowsCount || 0} of ${validationResult?.TotalRowsCount || 0} records?`}\r\n          text=\"\"\r\n          onConfirm={this.performCancel}\r\n          onHide={() => this.setState({ showCancelConfirmModal: false })} />\r\n        <ConfirmationModal show={showImportConfirmModal}\r\n          title=\"IMPORT CONFIRMATION\"\r\n          textTitle={`You are about to submit ${validationResult?.ValidRowsCount || 0} of ${validationResult?.TotalRowsCount || 0} records for import?`}\r\n          text=\"\"\r\n          onConfirm={this.performImport}\r\n          onHide={() => this.setState({ showImportConfirmModal: false })} />\r\n      </Modal.Body>\r\n      <Modal.Footer className=\"justify-content-between\">\r\n        <div>\r\n          {step === \"file\" && <Button type=\"reset\" variant=\"secondary\" className=\"fixed-w5\" onClick={this.resetState} disabled={isSaving}>RESET</Button>}\r\n        </div>\r\n        <div>\r\n          {step === \"file\" && <>\r\n            <Button variant=\"secondary\" className=\"fixed-w5\" onClick={this.props.onClose}>CANCEL</Button>\r\n            <ActionButton variant=\"primary\" className=\"fixed-w5 ml-1\" onClick={this.handleFileStepNext} disabled={!fileContent} spin={isSaving} disableOnSpin>NEXT</ActionButton>\r\n          </>}\r\n          {step === \"mapping\" && <>\r\n            <Button variant=\"secondary\" className=\"fixed-w5\" onClick={() => this.setState({ step: \"file\" })} disabled={isSaving}>BACK</Button>\r\n            <ActionButton variant=\"primary\" className=\"fixed-w5 ml-1\" onClick={this.handleStartImportValidation} disabled={!importData || importData.Records.length === 0} spin={isSaving} disableOnSpin>SUBMIT FOR VALIDATION</ActionButton>\r\n          </>}\r\n          {step === \"import\" && <>\r\n            <Button variant=\"secondary\" className=\"fixed-w5\" onClick={() => this.setState({ step: \"mapping\", validationResult: undefined })} disabled={isSaving || isCancelling}>BACK</Button>\r\n            <ActionButton variant=\"secondary\" className=\"fixed-w5 ml-1\" onClick={() => this.setState({ showCancelConfirmModal: true })} spin={isCancelling} disableOnSpin>CANCEL</ActionButton>\r\n            <ActionButton variant=\"primary\" className=\"fixed-w5 ml-1\" onClick={() => this.setState({ showImportConfirmModal: true })} disabled={isCancelling || !validationResult?.ValidRowsCount} spin={isSaving} disableOnSpin>IMPORT</ActionButton>\r\n          </>}\r\n        </div>\r\n      </Modal.Footer>\r\n    </Modal >\r\n  }\r\n\r\n  static defaultProps = { step: \"file\" }\r\n}\r\n","import * as React from \"react\"\r\nimport { Form, Col } from \"react-bootstrap\"\r\nimport { concat, of, Subject, Subscription } from \"rxjs\"\r\nimport { filter, map, switchMap } from \"rxjs/operators\"\r\nimport { toast } from \"react-toastify\"\r\nimport { connect } from \"react-redux\"\r\nimport { EmailRegexp, PhoneRegexp } from \"../../../config/Constants\";\r\nimport MaskedInput from \"react-maskedinput\"\r\nimport { Addresses } from \"../../../api/OrderRequests/OrderRequestsModel/Addresses\";\r\nimport { CompanyNameCheck, EmailCheck } from \"../../../api/Invitation/InformationGet\"\r\nimport { GetRoles } from \"../../../api/Roles/UserRolesGet\"\r\nimport Role from \"../../../api/Roles/Model/Role\"\r\nimport { APIError } from \"../../../api/ObservableFromFetch\"\r\nimport { AppState } from \"../../../AppState\"\r\nimport { RoleIdForSelectedCompany } from \"../../../authentication/SelectedCompany/CompanySelectionDrivenSelectors\"\r\nimport PortalAdminData from \"../../../api/Portals/PortalModel/PortalAdminData\";\r\n\r\ninterface PortalFieldsAuthProps {\r\n  PrimaryRoleID?: number\r\n}\r\n\r\ninterface PortalFieldsProps {\r\n  isValid: (data: PortalAdminData, valid: boolean) => void\r\n  onNameChange: (name: string) => void\r\n}\r\n\r\ninterface PortalFieldsValidity {\r\n  nameValid: boolean\r\n  emailValid: boolean\r\n  phoneValid: boolean\r\n  roleValid: boolean\r\n  firstNameValid: boolean\r\n  lastNameValid: boolean\r\n}\r\n\r\nexport interface PortalFieldsData {\r\n  name: string\r\n  email: string\r\n  phone: string\r\n  roleID?: number\r\n  firstName: string,\r\n  lastName: string,\r\n}\r\n\r\ninterface PortalFieldsModalState extends PortalFieldsData, PortalFieldsValidity {\r\n  nameChecking: boolean\r\n  nameAvailable?: boolean\r\n  emailChecking: boolean\r\n  emailAvailable?: boolean\r\n  rolesLoading: boolean\r\n  roles?: Role[]\r\n}\r\n\r\nexport class PortalFields extends React.PureComponent<PortalFieldsProps & PortalFieldsAuthProps, PortalFieldsModalState> {\r\n  emptyData: PortalFieldsData = {\r\n    name: \"\",\r\n    email: \"\",\r\n    phone: \"\",\r\n    roleID: undefined,\r\n    firstName: \"\",\r\n    lastName: \"\",\r\n  }\r\n  positiveValidity: PortalFieldsValidity = {\r\n    nameValid: true,\r\n    emailValid: true,\r\n    phoneValid: true,\r\n    roleValid: true,\r\n    firstNameValid: true,\r\n    lastNameValid: true\r\n  }\r\n  defaultState: PortalFieldsModalState = {\r\n    ...this.emptyData,\r\n    ...this.positiveValidity,\r\n    nameChecking: false,\r\n    nameAvailable: undefined,\r\n    emailChecking: false,\r\n    emailAvailable: undefined,\r\n    rolesLoading: false,\r\n  }\r\n  state: PortalFieldsModalState = { ...this.defaultState }\r\n\r\n  checkName$ = new Subject<string>()\r\n  checkEmail$ = new Subject<string>()\r\n\r\n  nameExistsSubscription?: Subscription\r\n  emailExistsSubscription?: Subscription\r\n  userRolesSubscription?: Subscription\r\n\r\n  componentDidMount() {\r\n    this.nameExistsSubscription = this.checkName$.pipe(\r\n      map(name => name.trim()),\r\n      filter(name => this.isNameValid(name)),\r\n      switchMap(name => concat(\r\n        of({ loading: true }),\r\n        CompanyNameCheck(name).pipe(\r\n          map(result => ({ loading: false, result: result }))\r\n        )\r\n      ))\r\n    ).subscribe(\r\n      (o: { loading: boolean, result?: Addresses | null }) => this.setState({\r\n          nameChecking: o.loading,\r\n          nameAvailable: !o.result\r\n        }, () => this.isValid()),\r\n      (error) => this.handleAPIError(error, { nameChecking: false, nameAvailable: undefined })\r\n    )\r\n\r\n    this.emailExistsSubscription = this.checkEmail$.pipe(\r\n      map(name => name.trim()),\r\n      filter(name => this.isEmailValid(name)),\r\n      switchMap(name => concat(\r\n        of({ loading: true }),\r\n        EmailCheck(name).pipe(\r\n          map(result => ({ loading: false, result: result.IsEmailExists }))\r\n        )\r\n      ))\r\n    ).subscribe(\r\n      (o: { loading: boolean, result?: boolean }) => this.setState({\r\n        emailChecking: o.loading,\r\n        emailAvailable: !o.result\r\n      }, () => this.isValid()),\r\n      (error) => this.handleAPIError(error, { emailChecking: false, emailAvailable: undefined })\r\n    )\r\n\r\n    const roleID = this.props.PrimaryRoleID || 0\r\n    this.setState({ rolesLoading: true })\r\n    this.userRolesSubscription = GetRoles(roleID).subscribe(\r\n      (data: Role[]) => this.setState({\r\n        roles: data,\r\n        roleID: data.length === 1 ? data[0].RoleID : undefined,\r\n        rolesLoading: false\r\n      }),\r\n      (error) => this.handleAPIError(error, { rolesLoading: false, emailAvailable: undefined })\r\n    )\r\n  }\r\n\r\n  componentWillUnmount() {\r\n    this.nameExistsSubscription && this.nameExistsSubscription.unsubscribe()\r\n    this.emailExistsSubscription && this.emailExistsSubscription.unsubscribe()\r\n    this.userRolesSubscription && this.userRolesSubscription.unsubscribe()\r\n  }\r\n\r\n  handleAPIError = (error: Error | APIError, stateChanges: object) => {\r\n    this.setState(stateChanges)\r\n    error && toast.error((error as APIError)?.errorData?.message || error.message)\r\n  }\r\n\r\n  isNameValid = (value: string) => value.trim().length > 4\r\n  isEmailValid = (value: string) => EmailRegexp.test(value)\r\n  isPhoneValid = (value: string) => PhoneRegexp.test(value)\r\n  isRoleValid = (value: number | undefined): boolean => !!value && !!this.state.roles?.find(item => item.RoleID === value)\r\n  isFirstNameValid = (value: string) => !!value.trim()\r\n  isLastNameValid = (value: string) => !!value.trim()\r\n\r\n  isFieldsValid = () => {\r\n    const {\r\n      name, nameValid, nameAvailable,\r\n      email, emailValid, emailAvailable,\r\n      phone, phoneValid,\r\n      roleID, roleValid,\r\n      firstName, firstNameValid,\r\n      lastName, lastNameValid,\r\n    } = this.state\r\n    return !!name && nameValid && !!nameAvailable && !!email && emailValid && !!emailAvailable && !!phone && phoneValid\r\n        && !!roleID && roleValid && !!firstName && firstNameValid && !!lastName && lastNameValid\r\n  }\r\n\r\n  isValid = () => {\r\n    const data: PortalAdminData = {\r\n      Name: this.state.name,\r\n      Email: this.state.email,\r\n      Phone: this.state.phone,\r\n      RoleID: this.state.roleID || 0,\r\n      FirstName: this.state.firstName,\r\n      LastName: this.state.lastName,\r\n    }\r\n    this.props.isValid(data, this.isFieldsValid())\r\n  }\r\n  handleNameChange = (e: React.ChangeEvent<HTMLInputElement>) => {\r\n    const value = e.target.value\r\n    this.setState({\r\n      name: value,\r\n      nameValid: this.isNameValid(value),\r\n      nameAvailable: undefined\r\n    }, () => this.props.onNameChange(value))\r\n  }\r\n\r\n  handleEmailChange = (e: React.ChangeEvent<HTMLInputElement>) => {\r\n    const value = e.target.value\r\n    this.setState({ email: value, emailValid: this.isEmailValid(value), emailAvailable: undefined })\r\n  }\r\n\r\n  handlePhoneChange = (e: React.ChangeEvent<HTMLInputElement>) => {\r\n    const value = e.target.value\r\n    this.setState(\r\n      { phone: value, phoneValid: this.isPhoneValid(value) },\r\n      () => this.isValid()\r\n    )\r\n  }\r\n\r\n  handleRoleChange = (e: React.ChangeEvent<HTMLSelectElement>) => {\r\n    const value = Number(e.target.value)\r\n    this.setState(\r\n      { roleID: value, roleValid: this.isRoleValid(value) },\r\n      () => this.isValid()\r\n    )\r\n  }\r\n\r\n  handleFirstNameChange = (e: React.ChangeEvent<HTMLInputElement>) => {\r\n    const value = e.target.value\r\n    this.setState(\r\n      { firstName: value, firstNameValid: this.isFirstNameValid(value) },\r\n      () => this.isValid()\r\n    )\r\n  }\r\n\r\n  handleLastNameChange = (e: React.ChangeEvent<HTMLInputElement>) => {\r\n    const value = e.target.value\r\n    this.setState(\r\n      { lastName: value, lastNameValid: this.isLastNameValid(value) },\r\n      () => this.isValid()\r\n    )\r\n  }\r\n\r\n  render() {\r\n    const {\r\n      name, nameValid, nameChecking, nameAvailable,\r\n      email, emailValid, emailChecking, emailAvailable,\r\n      phone, phoneValid,\r\n      roleID, roleValid, rolesLoading,\r\n      firstName, firstNameValid,\r\n      lastName, lastNameValid\r\n    } = this.state\r\n\r\n    return (\r\n      <>\r\n        <Form.Row className=\"form-group required\">\r\n          <Form.Label column sm={4} htmlFor=\"name\">Portal Name</Form.Label>\r\n          <Col sm={8}>\r\n            <Form.Control id=\"name\"\r\n              type=\"text\"\r\n              value={name}\r\n              onChange={this.handleNameChange}\r\n              onBlur={(e: React.FocusEvent<HTMLInputElement>) => this.checkName$.next(e.target.value)}\r\n              isInvalid={!nameValid}\r\n              disabled={nameChecking} />\r\n            {!nameChecking && !nameValid &&\r\n              <Form.Control.Feedback type=\"invalid\" className=\"d-block\">Please enter minimum 5 characters</Form.Control.Feedback>}\r\n            {!nameChecking && nameAvailable &&\r\n              <Form.Control.Feedback type=\"valid\" className=\"d-block\">Portal name is available</Form.Control.Feedback>}\r\n            {!nameChecking && nameAvailable === false &&\r\n              <Form.Control.Feedback type=\"invalid\" className=\"d-block\">Portal name is already in use</Form.Control.Feedback>}\r\n          </Col>\r\n        </Form.Row>\r\n        <Form.Row className=\"form-group required\">\r\n          <Form.Label column sm={4} htmlFor=\"email\">Portal Admin Email Address</Form.Label>\r\n          <Col sm={8}>\r\n            <Form.Control id=\"email\"\r\n              type=\"text\"\r\n              value={email}\r\n              onChange={this.handleEmailChange}\r\n              onBlur={(e: React.FocusEvent<HTMLInputElement>) => this.checkEmail$.next(e.target.value)}\r\n              isInvalid={!emailValid}\r\n              disabled={emailChecking} />\r\n            {!emailChecking && !emailValid &&\r\n              <Form.Control.Feedback type=\"invalid\" className=\"d-block\">Please enter valid email</Form.Control.Feedback>}\r\n            {!emailChecking && emailAvailable &&\r\n              <Form.Control.Feedback type=\"valid\" className=\"d-block\">Email is available</Form.Control.Feedback>}\r\n            {!emailChecking && emailAvailable === false &&\r\n              <Form.Control.Feedback type=\"invalid\" className=\"d-block\">Email is already in use</Form.Control.Feedback>}\r\n          </Col>\r\n        </Form.Row>\r\n        {emailAvailable !== false && <Form.Row className=\"form-group required\">\r\n          <Form.Label column sm={4} htmlFor=\"phone\">Portal Admin Personal Phone</Form.Label>\r\n          <Col sm={8}>\r\n            <Form.Control id=\"phone\" type=\"text\" as={MaskedInput} mask=\"111-111-1111\" value={phone}\r\n              onChange={this.handlePhoneChange} isInvalid={!phoneValid} />\r\n            <Form.Text>\r\n              This phone number will be used to validate the Administrator. Please provide a direct number or\r\n              mobile number (not a main company number or extension)\r\n            </Form.Text>\r\n          </Col>\r\n        </Form.Row>}\r\n        <Form.Row className=\"form-group required\">\r\n          <Form.Label column sm={4} htmlFor=\"role\">Portal Admin First Name</Form.Label>\r\n          <Col sm={8}>\r\n            <Form.Control id=\"firstName\"\r\n                          type=\"text\"\r\n                          value={firstName}\r\n                          onChange={this.handleFirstNameChange}\r\n                          onBlur={this.handleFirstNameChange}\r\n                          isInvalid={!firstNameValid}/>\r\n          </Col>\r\n        </Form.Row>\r\n        <Form.Row className=\"form-group required\">\r\n          <Form.Label column sm={4} htmlFor=\"role\">Portal Admin Last Name</Form.Label>\r\n          <Col sm={8}>\r\n            <Form.Control id=\"lastName\"\r\n                          type=\"text\"\r\n                          value={lastName}\r\n                          onChange={this.handleLastNameChange}\r\n                          onBlur={this.handleLastNameChange}\r\n                          isInvalid={!lastNameValid}/>\r\n          </Col>\r\n        </Form.Row>\r\n        <Form.Row className=\"form-group required\">\r\n          <Form.Label column sm={4} htmlFor=\"role\">User's Role</Form.Label>\r\n          <Col sm={8}>\r\n            <Form.Control id=\"role\" as=\"select\" onChange={this.handleRoleChange} value={roleID || \"\"} isInvalid={!roleValid} disabled={rolesLoading}>\r\n              {rolesLoading && <option value=\"\">Loading ...</option> }\r\n              {!rolesLoading && this.state.roles && this.state.roles.length > 1 && <option value=\"\">Select Role</option>}\r\n              {!rolesLoading && this.state.roles?.map(role => <option value={role.RoleID} key={role.RoleID}>{role.Title}</option>)}\r\n            </Form.Control>\r\n          </Col>\r\n        </Form.Row>\r\n      </>\r\n    )\r\n  }\r\n}\r\n\r\nfunction mapStateToProps(state: AppState): PortalFieldsAuthProps {\r\n  return {\r\n    PrimaryRoleID: RoleIdForSelectedCompany(state)\r\n  }\r\n}\r\n\r\nconst ConnectedPortalFields = connect(mapStateToProps, null)(PortalFields)\r\nexport default ConnectedPortalFields\r\n","import { Observable } from \"rxjs\"\r\nimport { ObservableFromFetch } from \"../ObservableFromFetch\"\r\nimport LocationData from \"./LocationModel/LocationData\"\r\n\r\nexport default function LocationUpdateObservable(data: LocationData): Observable<string> {\r\n  const requestBody: string = JSON.stringify(data)\r\n  return ObservableFromFetch<string>(\"FFOrderClientFileMaintenance/UpdateLocationInformation\", requestBody)\r\n}\r\n","import { Observable } from \"rxjs\"\r\nimport { ObservableFromFetch } from \"../ObservableFromFetch\"\r\nimport LocationData from \"./LocationModel/LocationData\"\r\n\r\nexport default function LocationCreateObservable(data: LocationData): Observable<string> {\r\n  const requestBody: string = JSON.stringify(data)\r\n  return ObservableFromFetch<string>(\"FFOrderClientFileMaintenance/CreateLocationInformation\", requestBody)\r\n}\r\n","import * as React from \"react\"\r\nimport { Modal } from \"react-bootstrap\"\r\nimport { LocationInformationForm } from \"./LocationInformationForm\"\r\n\r\ninterface AddLocationModalProps {\r\n  show: boolean\r\n  portalID: number\r\n  companyID: number\r\n  onHide: () => void\r\n  onSuccess: () => void\r\n}\r\n\r\nexport class AddLocationModal extends React.PureComponent<AddLocationModalProps> {\r\n  render() {\r\n    const { show, onHide, onSuccess, companyID, portalID } = this.props\r\n\r\n    return <Modal backdrop=\"static\" centered show={show} onHide={onHide} size=\"lg\">\r\n      <Modal.Header closeButton>\r\n        <Modal.Title>Create New Location</Modal.Title>\r\n      </Modal.Header>\r\n      <LocationInformationForm portalID={portalID} companyID={companyID} onCancel={onHide} add={true} onSuccess={onSuccess} />\r\n    </Modal>\r\n  }\r\n}\r\n","import React from \"react\"\r\nimport { Button, Col, Form, InputGroup, Modal } from \"react-bootstrap\"\r\nimport { AsyncTypeahead, Typeahead } from \"react-bootstrap-typeahead\"\r\nimport { FaAngleDown } from \"react-icons/fa\"\r\nimport { concat, of, Subject, BehaviorSubject , Subscription } from \"rxjs\"\r\nimport { catchError, debounceTime, filter, map, switchMap } from \"rxjs/operators\"\r\nimport MaskedInput from \"react-maskedinput\"\r\nimport { toast } from \"react-toastify\"\r\nimport { APIError } from \"../../api/ObservableFromFetch\"\r\nimport ActionButton from \"../ActionButton\"\r\nimport AddressInput from \"../FormattedInputs/AddressInput\"\r\nimport PhoneNumberMaskedInput from \"../FormattedInputs/PhoneNumberMaskedInput\"\r\nimport Address from \"../../api/Location/LocationModel/Address\"\r\nimport StateSelect from \"../FormattedInputs/StateSelect\"\r\nimport State from \"../../api/OrderRequests/OrderRequestsModel/State\"\r\nimport { StateObservable } from \"../../api/OrderRequests/OrderRequestsConstraintGet\"\r\nimport AutoFilterLocationsGetObservable from \"../../api/Location/AutoFilterLocationsGet\"\r\nimport AutoFilterLocation from \"../../api/Location/LocationModel/AutoFilterLocation\"\r\nimport LocationData from \"../../api/Location/LocationModel/LocationData\"\r\nimport LocationsGet from \"../../api/Location/LocationsGet\"\r\nimport { CompanyNameRegexp, PhoneRegexp, ZipRegexp } from \"../../config/Constants\"\r\nimport TimeZoneListGet from \"../../api/Administration/TimeZoneListGet\"\r\nimport TimeZoneData from \"../../api/Administration/Model/TimeZoneData\"\r\nimport AddressMatchModal, { AddressData } from \"../AddressMatchModal\"\r\nimport FormatError from \"../../formatters/FormatError\"\r\nimport LocationUpdate from \"../../api/Location/LocationUpdate\"\r\nimport LocationCreate from \"../../api/Location/LocationCreate\"\r\nimport { AddLocationModal } from \"./AddLocationModal\"\r\nimport { CheckLocationName, CheckLocationCode } from \"../../api/Location/CheckLocation\"\r\nimport LocationExists from \"../../api/Location/LocationModel/LocationExists\"\r\nimport ConfirmationModal from \"../ConfirmationModal\"\r\nimport CompanyInactivate from \"../../api/Companies/CompanyInactivate\"\r\nimport { CompanyActivationObservable } from \"../../api/Administration/ActivationProcess\"\r\nimport LabAccountSelection from \"./LabAccountSelection\"\r\nimport { ValidZipCode } from \"../../formatters/FormatZipCode\"\r\n\r\ninterface LocationInformationFormProps {\r\n  portalID: number\r\n  companyID: number\r\n  locationID?: number\r\n  adminMode?: boolean\r\n  onCancel: () => void\r\n  onSuccess?: () => void\r\n  add: boolean\r\n}\r\n\r\ninterface LocationInformationData {\r\n  name: string\r\n  code: string\r\n  streetAddress1: string\r\n  streetAddress2: string\r\n  city: string\r\n  state: string\r\n  zip: string\r\n  province?: string\r\n  country?: string\r\n  timeZoneID: number\r\n  webSiteURL?: string\r\n  fax: string\r\n  officePhone: string\r\n  locationData?: LocationData\r\n}\r\n\r\ninterface LocationInformationFormState extends LocationInformationData {\r\n  loading: boolean\r\n  saving: boolean\r\n  retrievedLocations?: LocationData[]\r\n  selectedLocation?: string\r\n  locations: string[]\r\n  statesLoading: boolean\r\n  states: State[]\r\n  timeZones?: TimeZoneData[]\r\n  timeZonesLoading: boolean\r\n  showAddLocation: boolean\r\n  nameChecking: boolean\r\n  nameAvailable?: boolean\r\n  codeChecking: boolean\r\n  codeAvailable?: boolean\r\n  inactivating: boolean\r\n  activating: boolean\r\n  showInactivateConfirmation: boolean\r\n  showLabAccountSelection: boolean\r\n  labAccountsLoading: boolean\r\n}\r\n\r\nexport class LocationInformationForm extends React.PureComponent<LocationInformationFormProps, LocationInformationFormState> {\r\n  emptyData: LocationInformationData = {\r\n    name: \"\",\r\n    code: \"\",\r\n    streetAddress1: \"\",\r\n    streetAddress2: \"\",\r\n    city: \"\",\r\n    state: \"\",\r\n    zip: \"\",\r\n    officePhone: \"\",\r\n    timeZoneID: 0,\r\n    fax: \"\",\r\n    locationData: undefined\r\n  }\r\n\r\n  emptyState: LocationInformationFormState = {\r\n    ...this.emptyData,\r\n    loading: false,\r\n    saving: false,\r\n    locations: [],\r\n    retrievedLocations: undefined,\r\n    statesLoading: false,\r\n    states: [],\r\n    timeZonesLoading: false,\r\n    showAddLocation: false,\r\n    nameChecking: false,\r\n    nameAvailable: undefined,\r\n    codeChecking: false,\r\n    codeAvailable: undefined,\r\n    inactivating: false,\r\n    activating: false,\r\n    showInactivateConfirmation: false,\r\n    showLabAccountSelection: false,\r\n    labAccountsLoading: false\r\n  }\r\n\r\n  state: LocationInformationFormState = { ...this.emptyState }\r\n\r\n  typeahead = React.createRef<Typeahead<string>>()\r\n\r\n  locationName$ = new Subject<string>()\r\n  checkName$ = new Subject<string>()\r\n  checkCode$ = new Subject<string>()\r\n\r\n  statesSubscription?: Subscription\r\n  timeZoneSubscription?: Subscription\r\n  searchLocationsSubscription?: Subscription\r\n  loadSubscription?: Subscription\r\n  saveSubscription?: Subscription\r\n  nameExistsSubscription?: Subscription\r\n  codeExistsSubscription?: Subscription\r\n  inactivateSubscription?: Subscription\r\n\r\n  componentDidMount() {\r\n    this.setState({ statesLoading: true, timeZonesLoading: true })\r\n    this.statesSubscription = StateObservable().subscribe(\r\n      (results: State[]) => this.setState(prevState => ({\r\n        states: results,\r\n        statesLoading: false,\r\n        state: prevState.locationData ? this.mapState(prevState.locationData, results) : prevState.state\r\n      })),\r\n      () => { this.setState({ statesLoading: false }) }\r\n    )\r\n\r\n    this.timeZoneSubscription = TimeZoneListGet().subscribe(\r\n      (data: TimeZoneData[]) => this.setState({ timeZones: data, timeZonesLoading: false }),\r\n      (error) => this.handleAPIError(error, { timeZonesLoading: false })\r\n    )\r\n\r\n    this.loadLocations()\r\n\r\n    this.loadSubscription = this.locationName$.pipe(\r\n      map(name => name.trim()),\r\n      switchMap(name => concat(\r\n        of({ loading: true }),\r\n        LocationsGet(this.props.portalID, this.props.companyID, name, true).pipe(\r\n          map(result => ({ loading: false, result: result })),\r\n          catchError((error) => of({ loading: false, error: error }))\r\n        )\r\n      ))\r\n    ).subscribe(\r\n      (o: { loading: boolean, result?: LocationData[], error?: Error | APIError }) => {\r\n        if (o.error) this.handleAPIError(o.error, {})\r\n        this.setState({\r\n          loading: o.loading,\r\n          retrievedLocations: o.result && o.result.length > 1 ? o.result : undefined,\r\n          ...this.mapLocationData(o.result)\r\n        })\r\n      },\r\n      (error) => this.handleAPIError(error, { loading: false })\r\n    )\r\n\r\n    this.nameExistsSubscription = this.checkName$.pipe(\r\n      map(name => name.trim()),\r\n      filter(name => this.isNameValid(name)),\r\n      switchMap(name => concat(\r\n        of({ checking: true }),\r\n        CheckLocationName(this.props.companyID, name).pipe(\r\n          map(result => ({ checking: false, result: result })),\r\n          catchError(() => of({ checking: false }))\r\n        )\r\n      ))\r\n    ).subscribe(\r\n      (o: { checking: boolean, result?: LocationExists }) => this.setState({\r\n        nameChecking: o.checking,\r\n        nameAvailable: (o.result?.LocationID || 0) === 0\r\n      }),\r\n      (error) => this.handleAPIError(error, { nameChecking: false, nameAvailable: undefined })\r\n    )\r\n\r\n    this.codeExistsSubscription = this.checkCode$.pipe(\r\n      map(code => code.trim()),\r\n      filter(code => this.isCodeValid(code)),\r\n      switchMap(code => concat(\r\n        of({ checking: true }),\r\n        CheckLocationCode(this.props.companyID, code).pipe(\r\n          map(result => ({ checking: false, result: result })),\r\n          catchError(() => of({ checking: false }))\r\n        )\r\n      ))\r\n    ).subscribe(\r\n      (o: { checking: boolean, result?: LocationExists }) => this.setState({\r\n        codeChecking: o.checking,\r\n        codeAvailable: (o.result?.LocationID || 0) === 0\r\n      }),\r\n      (error) => this.handleAPIError(error, { codeChecking: false, codeAvailable: undefined })\r\n    )\r\n  }\r\n\r\n  loadLocations = () => {\r\n    this.setState({ loading: true })\r\n    this.searchLocationsSubscription = AutoFilterLocationsGetObservable(this.props.companyID, \"\", \"\", this.props.portalID).subscribe(\r\n      ( result: AutoFilterLocation[]) => {\r\n        if (this.props.locationID) {\r\n          this.setState({ loading: false, locations: result.filter(loc => loc.AccountID === this.props.locationID).map(loc => loc.Name) || [] })\r\n        } else {\r\n          this.setState({ loading: false, locations: result.map(c => c.Name).filter((v, i, a) => a.indexOf(v) === i) || [] })\r\n        }\r\n      },\r\n      (error) => this.handleAPIError(error, { loading: false, locations: [] })\r\n    )\r\n  }\r\n\r\n  componentWillUnmount() {\r\n    this.statesSubscription && this.statesSubscription.unsubscribe()\r\n    this.timeZoneSubscription && this.timeZoneSubscription.unsubscribe()\r\n    this.loadSubscription && this.loadSubscription.unsubscribe()\r\n    this.searchLocationsSubscription && this.searchLocationsSubscription.unsubscribe()\r\n    this.saveSubscription && this.saveSubscription.unsubscribe()\r\n    this.nameExistsSubscription && this.nameExistsSubscription.unsubscribe()\r\n    this.codeExistsSubscription && this.codeExistsSubscription.unsubscribe()\r\n    this.inactivateSubscription && this.inactivateSubscription.unsubscribe()\r\n  }\r\n\r\n  componentDidUpdate(prevProps: LocationInformationFormProps, prevState: LocationInformationFormState) {\r\n    if (this.props.locationID && this.state.locations !== prevState.locations) {\r\n      this.handleLocationChange(this.state.locations)\r\n    }\r\n  }\r\n\r\n  handleAPIError = (error: Error | APIError, stateChanges: object) => {\r\n    this.setState(stateChanges)\r\n    error && toast.error(FormatError(error))\r\n  }\r\n\r\n  mapState = (info: LocationData, states: State[]): string => states.find(item => item.StateProvinceTerritoryID === info.StateProvinceTerritoryID)?.Abbreviation || info.State || \"\"\r\n\r\n  mapLocationData = (data?: LocationData[]): LocationInformationData => {\r\n    if (!data || data.length !== 1) {\r\n      return { ...this.emptyData, name: this.state.name }\r\n    }\r\n    const info = data[0]\r\n    return {\r\n      name: info.Name || \"\",\r\n      code: info.Code,\r\n      streetAddress1: info.Address1 || \"\",\r\n      streetAddress2: info.Address2 || \"\",\r\n      city: info.City || \"\",\r\n      state: this.mapState(info, this.state.states),\r\n      zip: info.Zip || \"\",\r\n      province: info.Province || \"\",\r\n      country: info.Country || \"\",\r\n      timeZoneID: info.TimeZoneID,\r\n      webSiteURL: info.WebsiteURL || \"\",\r\n      fax: info.Fax || \"\",\r\n      officePhone: info.Phone || \"\",\r\n      locationData: data[0]\r\n    }\r\n  }\r\n\r\n  handleLocationChange = (items: string[]) => {\r\n    const selectedLocation = items[0]\r\n    if (selectedLocation) {\r\n      this.setState({ selectedLocation: selectedLocation })\r\n      this.locationName$.next(selectedLocation)\r\n    } else {\r\n      this.setState({ selectedLocation: undefined })\r\n    }\r\n  }\r\n\r\n  handleRetrievedCompanyAddressSelect = () => this.setState({\r\n    retrievedLocations: undefined,\r\n    ...this.mapLocationData(this.state.locationData ? [this.state.locationData] : undefined)\r\n  })\r\n\r\n  handleAddressSelect = (address: Address | string | undefined) => {\r\n    if (address) {\r\n      if (typeof address === 'string') {\r\n        this.setState({ streetAddress1: address })\r\n      } else if (address as Address) {\r\n        this.setState({ streetAddress1: address.StreetLine || \"\", state: address.State || \"\", city: address.City || \"\" })\r\n      }\r\n    } else {\r\n      this.setState({ streetAddress1: \"\" })\r\n    }\r\n  }\r\n\r\n  performInactivate = () => {\r\n    this.setState({ inactivating: true, showInactivateConfirmation: false })\r\n    this.inactivateSubscription && this.inactivateSubscription.unsubscribe()\r\n    this.inactivateSubscription = CompanyInactivate(this.state.locationData?.ImplementationID || 0, this.state.locationData?.AccountID || 0, true)\r\n    .subscribe(\r\n      data => {\r\n        this.setState({ inactivating: false })\r\n        toast.success(data)\r\n      },\r\n      error => this.handleAPIError(error, { inactivating: false })\r\n    )\r\n  }\r\n\r\n  performActivate = () => {\r\n    this.setState({ activating: true })\r\n    this.inactivateSubscription && this.inactivateSubscription.unsubscribe()\r\n    this.inactivateSubscription = CompanyActivationObservable(this.state.locationData?.ImplementationID || 0, this.state.locationData?.AccountID || 0, true)\r\n    .subscribe(\r\n      data => {\r\n        this.setState({ activating: false })\r\n        toast.success(data)\r\n      },\r\n      error => this.handleAPIError(error, { activating: false })\r\n    )\r\n  }\r\n\r\n  handleCancel = () => this.props.onCancel()\r\n\r\n  handleUpdate = () => {\r\n    const { locationData, name, code, streetAddress1, streetAddress2, city, state, zip, officePhone, province, country, timeZoneID, webSiteURL, fax } = this.state\r\n    if (!this.props.add && !locationData) {\r\n      return\r\n    }\r\n\r\n    const saveData: LocationData = {\r\n      AccountID: this.props.add ? 0 : locationData?.AccountID || 0,\r\n      ImplementationID: this.props.portalID,\r\n      CompanyID: this.props.companyID,\r\n      Name: this.props.add ? name : locationData?.Name || \"\",\r\n      Code: this.props.add ? code : locationData?.Code || \"\",\r\n      Address1: streetAddress1,\r\n      Address2: streetAddress2,\r\n      City: city,\r\n      State: state,\r\n      Zip: zip,\r\n      Phone: officePhone.replace(/-/g, \"\"),\r\n      Province: province ? province : undefined,\r\n      Country: country ? country : undefined,\r\n      TimeZoneID: timeZoneID,\r\n      WebsiteURL: webSiteURL ? webSiteURL : undefined,\r\n      Fax: fax ? fax : undefined,\r\n      StateProvinceTerritoryID: 0,\r\n      Inactive: locationData?.Inactive || false\r\n    }\r\n\r\n    this.setState({ saving: true })\r\n    this.saveSubscription && this.saveSubscription.unsubscribe()\r\n    const observable = this.props.add ? LocationCreate : LocationUpdate\r\n    this.saveSubscription = observable(saveData).subscribe(\r\n      (data) => {\r\n        this.setState({ saving: false })\r\n        toast.success(data)\r\n        this.props.onSuccess && this.props.onSuccess()\r\n      },\r\n      (error) => this.handleAPIError(error, { saving: false })\r\n    )\r\n  }\r\n\r\n  handleHideAddLocation = () => {\r\n    this.setState({ showAddLocation: false })\r\n  }\r\n\r\n  handleLocationAddSuccess = () => {\r\n    this.handleHideAddLocation()\r\n    this.loadLocations()\r\n  }\r\n\r\n  isNameTextValid = (value: string) => {\r\n    const regexp = new RegExp(CompanyNameRegexp)\r\n    return regexp.test(value)\r\n  }\r\n  isNameLengthValid = (value: string) => {\r\n    const len = value.trim().length\r\n    return len >= 3 && len <= 32\r\n  }\r\n\r\n  isNameValid = (value: string) => this.isNameLengthValid(value) && this.isNameTextValid(value)\r\n  isCodeValid = (value: string) => value.length > 0\r\n\r\n  render() {\r\n    const { name, code, city, state, streetAddress1, streetAddress2, states, statesLoading, zip, province, country, officePhone, fax, timeZoneID, webSiteURL,\r\n      loading, saving, locationData, timeZonesLoading, timeZones, retrievedLocations, activating, inactivating,\r\n      nameChecking, nameAvailable, codeChecking, codeAvailable, showLabAccountSelection, labAccountsLoading } = this.state\r\n\r\n    const { add, locationID } = this.props\r\n\r\n    const disabled = !add && (!locationData || !!retrievedLocations)\r\n\r\n    const validName = disabled || !add || this.isNameValid(name) && nameAvailable\r\n    const validCode = disabled || !add || this.isCodeValid(code) && codeAvailable\r\n    const validStreetAddress1 = disabled || !!streetAddress1.length\r\n    const validCity = disabled || !!city.length\r\n    const validState = disabled || !!state\r\n    const validZip = disabled || (!!zip.length && ValidZipCode(zip))\r\n    const validPhone = disabled || (!!officePhone.length && (officePhone.replace(/\\D/g, \"\").length === 10 || PhoneRegexp.test(officePhone)))\r\n    const validFax = disabled || fax.length === 0 || (fax.replace(/\\D/g, \"\").length === 10 || PhoneRegexp.test(fax))\r\n\r\n    const formValid = validStreetAddress1 && validCity && validState && validZip && validPhone && validFax && validName && validCode\r\n\r\n    const saveButtonName = add ? \"Save\" : \"Update\"\r\n\r\n    return (<>\r\n      <Modal.Body>\r\n        <Form>\r\n          <Form.Row className=\"form-group required\">\r\n            <Col lg={4} className=\"col-form-label\">\r\n              <Form.Label className=\"mb-0\" htmlFor=\"locationName\">Location</Form.Label> {code && !add ? `(${code})` : \"\"}\r\n            </Col>\r\n            <Col lg={8}>\r\n              {add ? <>\r\n                <Form.Control \r\n                  id=\"locationName\"\r\n                  type=\"text\"\r\n                  value={name}\r\n                  isInvalid={!validName}\r\n                  disabled={disabled}\r\n                  autoComplete=\"new-password\"\r\n                  onChange={e => { this.setState({ name: e.target.value, nameAvailable: undefined }) }} \r\n                  onBlur={(e: React.FocusEvent<HTMLInputElement>) => { if (nameAvailable === undefined) this.checkName$.next(e.target.value)} }/>\r\n                  {!nameChecking && nameAvailable && <Form.Control.Feedback type=\"valid\" className=\"d-block\">Name is available</Form.Control.Feedback>}\r\n                  {!nameChecking && nameAvailable === false && <Form.Control.Feedback type=\"invalid\" className=\"d-block\">Name is already in use</Form.Control.Feedback>}\r\n                  {!nameChecking && !validName && <Form.Control.Feedback type=\"invalid\" className=\"d-block\">Location Name must be of 3 to 32 characters and cannot contain any special characters except apostrophe, dash, comma or dot  [ ' or - or , or . ]</Form.Control.Feedback>}\r\n                  </>\r\n                : (locationID ? <Form.Control id=\"locationName\" type=\"text\" value={name} isInvalid={!validName} disabled={true} autoComplete=\"new-password\" /> \r\n                : <InputGroup>\r\n                  <Typeahead id=\"location-select\"\r\n                    ref={this.typeahead}\r\n                    filterBy={(option, props) => props.selected.length > 0 || option.toLowerCase().indexOf(props.text.toLowerCase()) !== -1}\r\n                    isLoading={this.state.loading}\r\n                    onChange={this.handleLocationChange}\r\n                    options={this.state.locations || []}\r\n                    selected={this.state.selectedLocation ? [this.state.selectedLocation] : []}\r\n                    minLength={0}\r\n                    emptyLabel=\"No Locations Found\"\r\n                    placeholder=\"\"\r\n                    inputProps={{ autoComplete: \"chrome-off\" }}>\r\n                    {!loading &&\r\n                      <Button variant=\"toggle\" onClick={() => { this.typeahead && this.typeahead.current && (this.typeahead.current as any).toggleMenu() }}>\r\n                        <FaAngleDown />\r\n                      </Button>}\r\n                  </Typeahead>\r\n                </InputGroup>)}\r\n            </Col>\r\n          </Form.Row>\r\n          {add && <Form.Row className=\"form-group required\">\r\n            <Form.Label column lg={4} htmlFor=\"locationCode\">Code</Form.Label>\r\n            <Col lg={8}>\r\n              <Form.Control\r\n                id=\"locationCode\" type=\"text\"\r\n                value={code}\r\n                onChange={e => { this.setState({ code: e.target.value, codeAvailable: undefined }) }}\r\n                onBlur={(e: React.FocusEvent<HTMLInputElement>) => { if (codeAvailable === undefined) this.checkCode$.next(e.target.value) }}\r\n                autoComplete=\"new-password\"\r\n                isInvalid={!validCode}\r\n                disabled={disabled} />\r\n              {!codeChecking && codeAvailable && <Form.Control.Feedback type=\"valid\" className=\"d-block\">Code is available</Form.Control.Feedback>}\r\n              {!codeChecking && codeAvailable === false && <Form.Control.Feedback type=\"invalid\" className=\"d-block\">Code is already in use</Form.Control.Feedback>}\r\n            </Col>\r\n          </Form.Row>}\r\n          <Form.Row className=\"form-group required\">\r\n            <Form.Label column lg={4}>Street Address 1</Form.Label>\r\n            <Col lg={8}>\r\n              <AddressInput onAddressChange={this.handleAddressSelect}\r\n                isInvalid={!validStreetAddress1}\r\n                disabled={disabled}\r\n                selected={{ City: city, State: state, StreetLine: streetAddress1, Text: streetAddress1 }} />\r\n            </Col>\r\n          </Form.Row>\r\n          <Form.Row className=\"form-group\">\r\n            <Form.Label column lg={4} htmlFor=\"streetAddress2\">Street Address 2</Form.Label>\r\n            <Col lg={8}>\r\n              <Form.Control id=\"streetAddress2\" type=\"text\"\r\n                autoComplete=\"new-password\"\r\n                value={streetAddress2}\r\n                disabled={disabled}\r\n                onChange={e => this.setState({ streetAddress2: e.target.value })} />\r\n            </Col>\r\n          </Form.Row>\r\n          <Form.Row className=\"form-group required\">\r\n            <Form.Label column lg={4} htmlFor=\"city\">City</Form.Label>\r\n            <Col lg={8}>\r\n              <Form.Control id=\"city\" type=\"text\"\r\n                autoComplete=\"new-password\"\r\n                value={city}\r\n                onChange={e => this.setState({ city: e.target.value })}\r\n                disabled={disabled}\r\n                isInvalid={!validCity} />\r\n            </Col>\r\n          </Form.Row>\r\n          <Form.Row className=\"form-group required\">\r\n            <Form.Label column lg={4} htmlFor=\"state\">State</Form.Label>\r\n            <Col sm={5}>\r\n              <StateSelect selectedCode={state}\r\n                states={states}\r\n                onChange={selected => this.setState({ state: selected?.Abbreviation || \"\" })}\r\n                isDisabled={disabled || statesLoading}\r\n                isInvalid={!validState} />\r\n            </Col>\r\n            <Form.Label column sm={1} htmlFor=\"zip\">ZIP</Form.Label>\r\n            <Col sm={2}>\r\n              <Form.Control id=\"zip\" type=\"text\"\r\n                autoComplete=\"new-password\"\r\n                onChange={e => this.setState({ zip: e.target.value })}\r\n                value={zip}\r\n                disabled={disabled}\r\n                isInvalid={!validZip} />\r\n            </Col>\r\n          </Form.Row>\r\n          <Form.Row className=\"form-group\">\r\n            <Form.Label column lg={4} htmlFor=\"province\">Province</Form.Label>\r\n            <Col lg={8}>\r\n              <Form.Control id=\"province\" type=\"text\"\r\n                autoComplete=\"new-password\"\r\n                value={province || \"\"}\r\n                onChange={e => this.setState({ province: e.target.value })}\r\n                disabled={disabled} />\r\n            </Col>\r\n          </Form.Row>\r\n          <Form.Row className=\"form-group\">\r\n            <Form.Label column lg={4} htmlFor=\"country\">Country</Form.Label>\r\n            <Col lg={8}>\r\n              <Form.Control id=\"province\" type=\"text\"\r\n                autoComplete=\"new-password\"\r\n                value={country || \"\"}\r\n                onChange={e => this.setState({ country: e.target.value })}\r\n                disabled={disabled} />\r\n            </Col>\r\n          </Form.Row>\r\n          <Form.Row className=\"form-group required\">\r\n            <Form.Label column lg={4} htmlFor=\"officePhone\">Office Phone #</Form.Label>\r\n            <Col lg={8}>\r\n              <PhoneNumberMaskedInput\r\n                autoComplete=\"new-password\"\r\n                value={officePhone}\r\n                onChange={(value: string) => this.setState({ officePhone: value })}\r\n                disabled={disabled}\r\n                isInvalid={!validPhone} />\r\n            </Col>\r\n          </Form.Row>\r\n          <Form.Row className=\"form-group\">\r\n            <Form.Label column lg={4} htmlFor=\"faxPhone\">Fax Phone #</Form.Label>\r\n            <Col lg={8}>\r\n              <PhoneNumberMaskedInput\r\n                autoComplete=\"new-password\"\r\n                value={fax}\r\n                onChange={(value: string) => this.setState({ fax: value })}\r\n                disabled={disabled}\r\n                isInvalid={!validFax} />\r\n            </Col>\r\n          </Form.Row>\r\n          <Form.Row className=\"form-group\">\r\n            <Form.Label column lg={4}>Time Zone</Form.Label>\r\n            <Col lg={8}>\r\n              <Form.Control id=\"timeZones\" as=\"select\"\r\n                disabled={timeZonesLoading || disabled}\r\n                value={timeZoneID}\r\n                onChange={(e: React.ChangeEvent<HTMLSelectElement>) => { this.setState({ timeZoneID: Number(e.target.value) }) }}>\r\n                <option value={0} key={0}></option>\r\n                {timeZones?.map(tz => <option value={tz.TimeZoneID} key={tz.TimeZoneID}>{tz.Abbreviation}</option>)}\r\n              </Form.Control>\r\n            </Col>\r\n          </Form.Row>\r\n          <Form.Row className=\"form-group\">\r\n            <Form.Label column lg={4} htmlFor=\"website\">Website</Form.Label>\r\n            <Col lg={8}>\r\n              <Form.Control id=\"website\" type=\"text\"\r\n                autoComplete=\"new-password\"\r\n                value={webSiteURL || \"\"}\r\n                onChange={e => this.setState({ webSiteURL: e.target.value })}\r\n                disabled={disabled} />\r\n            </Col>\r\n          </Form.Row>\r\n          {!add &&\r\n            <Form.Row className=\"form-group\">\r\n              <Form.Label column lg={4} >Lab Accounts</Form.Label>\r\n              <Col lg={4}>\r\n                <ActionButton variant=\"secondary\" onClick={() => this.setState({ showLabAccountSelection: true })} disabled={disabled} spin={labAccountsLoading} disableOnSpin={false}>Lab Account Details</ActionButton>\r\n              </Col>\r\n            </Form.Row>}\r\n        </Form>\r\n      </Modal.Body>\r\n      <Modal.Footer className=\"justify-content-between\">\r\n        <div>\r\n          {!add && !locationID && <Button variant=\"primary\" onClick={() => this.setState({ showAddLocation: true })}>Add New Location</Button>}\r\n        </div>\r\n        <div>\r\n          {!!this.props.adminMode && <>\r\n            {!locationData?.Inactive && <ActionButton variant=\"secondary\" disabled={disabled} onClick={() => this.setState({ showInactivateConfirmation: true })} spin={inactivating} disableOnSpin className=\"mr-2\">Inactivate</ActionButton>}\r\n            {locationData?.Inactive && <ActionButton variant=\"secondary\" onClick={() => this.performActivate()} spin={activating} disableOnSpin className=\"mr-2\">Activate</ActionButton>}\r\n          </>}\r\n          <Button variant=\"secondary\" onClick={() => this.handleCancel()} className=\"mr-2\">Cancel</Button>\r\n          <ActionButton variant=\"primary\" onClick={this.handleUpdate} disabled={!formValid || disabled} spin={saving} disableOnSpin>{saveButtonName}</ActionButton>\r\n        </div>\r\n      </Modal.Footer>\r\n      {!add &&\r\n        <LabAccountSelection\r\n          locationMode\r\n          name={locationData?.Name || \"\"}\r\n          implementationID={locationData?.ImplementationID || 0}\r\n          accountID={locationData?.AccountID || 0}\r\n          show={showLabAccountSelection}\r\n          onClose={() => this.setState({ showLabAccountSelection: false })} />}\r\n      <ConfirmationModal show={this.state.showInactivateConfirmation}\r\n        title=\"CONFIRM INACTIVATE\"\r\n        textTitle=\"Are you sure you want to inactivate?\"\r\n        text=\"\"\r\n        onConfirm={this.performInactivate}\r\n        onHide={() => this.setState({ showInactivateConfirmation: false })} />\r\n      <AddressMatchModal\r\n        show={!!retrievedLocations && retrievedLocations.length > 1}\r\n        addresses={retrievedLocations?.map(item => ({ ID: item.AccountID.toString(), Address1: item.Address1, Zip: item.Zip } as AddressData)) || []}\r\n        selectedID={locationData?.AccountID.toString()}\r\n        title=\"EXISTING LOCATION ADDRESS\"\r\n        subTitle=\"The location name you have entered already exists as the following addresses:\"\r\n        message=\"Please select the address you want to activate\"\r\n        onAddressSelect={(selected: AddressData) => this.setState({ locationData: retrievedLocations?.find(item => item.AccountID.toString() === selected.ID) })}\r\n        onClose={this.handleRetrievedCompanyAddressSelect} />\r\n      {!this.props.add && <AddLocationModal portalID={this.props.portalID} companyID={this.props.companyID} show={this.state.showAddLocation}\r\n        onHide={this.handleHideAddLocation} onSuccess={this.handleLocationAddSuccess} />}\r\n    </>\r\n    )\r\n  }\r\n}\r\n","import { Observable } from \"rxjs\"\r\nimport { ObservableFromFetch } from \"../ObservableFromFetch\"\r\nimport LocationData from \"./LocationModel/LocationData\"\r\n\r\nexport default function LocationsGetObservable(portalID: number, companyID: number, name: string, showInactive: boolean = false): Observable<LocationData[]> {\r\n  const requestBody: string = JSON.stringify({ ImplementationID: portalID, CompanyID: companyID, LocationName: name, ShowInactive: showInactive })\r\n\r\n  return ObservableFromFetch<LocationData[]>(\"FFOrderClientFileMaintenance/GetLocationInformation\", requestBody)\r\n}\r\n","import { ObservableFromFetch } from \"../ObservableFromFetch\"\r\nimport LocationExists from \"./LocationModel/LocationExists\"\r\n\r\nexport function CheckLocationName(companyID: number, name: string) {\r\n  const requestBody: string = JSON.stringify({\r\n    CompanyID: companyID,\r\n    Name: name\r\n  })\r\n\r\n  return ObservableFromFetch<LocationExists>(\"FFOrderClientFileMaintenance/LocationExists\", requestBody)\r\n}\r\n\r\nexport function CheckLocationCode(companyID: number, code: string) {\r\n  const requestBody: string = JSON.stringify({\r\n    CompanyID: companyID,\r\n    Name: code\r\n  })\r\n\r\n  return ObservableFromFetch<LocationExists>(\"FFOrderClientFileMaintenance/LocationCodeExists\", requestBody)\r\n}\r\n","import * as React from \"react\"\r\nimport { Modal } from \"react-bootstrap\"\r\nimport { LocationInformationForm } from \"./LocationInformationForm\"\r\n\r\ninterface EditLocationInformationProps {\r\n  portalID: number\r\n  companyID: number\r\n  locationID?: number\r\n  adminMode?: boolean\r\n  onCancel: () => void\r\n}\r\n\r\nexport class EditLocationInformation extends React.PureComponent<EditLocationInformationProps> {\r\n  render() {\r\n    const { companyID, locationID, onCancel, portalID } = this.props\r\n\r\n    return <Modal.Dialog size=\"xl\">\r\n      <Modal.Header>\r\n        <Modal.Title className=\"text-uppercase\">Edit Location Information</Modal.Title>\r\n      </Modal.Header>\r\n      <LocationInformationForm adminMode={this.props.adminMode} portalID={portalID} companyID={companyID} locationID={locationID} onCancel={onCancel} add={false}/>\r\n    </Modal.Dialog>\r\n  }\r\n}","import React from \"react\"\r\nimport { Modal, Form, Col, Button } from \"react-bootstrap\"\r\nimport { FaAngleDown, FaPencilAlt, FaTimes } from \"react-icons/fa\"\r\nimport { toast } from \"react-toastify\"\r\nimport { Subscription } from \"rxjs\"\r\nimport { APIError } from \"../../api/ObservableFromFetch\"\r\nimport ActionButton from \"../ActionButton\"\r\nimport { Typeahead } from \"react-bootstrap-typeahead\"\r\nimport GovDevice, { ModifyGovDevice } from \"../../api/Randoms/GovPoolModel/GovDevice\"\r\nimport LabAccount from \"../../api/Administration/Model/LabAccount\"\r\nimport { DevicesGetObservable, GovDeviceModifyObservable } from \"../../api/Randoms/GovDevicesGet\"\r\nimport FormatDate from \"../../formatters/FormatDate\"\r\n\r\ninterface DeviceModalProps {\r\n  addNew?: boolean\r\n  labAccount?: LabAccount\r\n  currentDevices: number[]\r\n  details?: GovDevice\r\n  onHide: () => void\r\n  onSave: () => void\r\n}\r\n\r\ninterface DeviceModalState {\r\n  isDeviceValid?: boolean\r\n  devices: GovDevice[]\r\n  selectedDevice?: GovDevice\r\n  loading: boolean\r\n  saving: boolean\r\n  editing: boolean\r\n}\r\n\r\nexport default class DeviceModal extends React.PureComponent<DeviceModalProps, DeviceModalState> {\r\n  state: DeviceModalState = {\r\n    loading: false,\r\n    saving: false,\r\n    editing: false,\r\n    devices: []\r\n  }\r\n\r\n  loadSubscription?: Subscription\r\n  saveSubscription?: Subscription\r\n  deviceTypeahead = React.createRef<Typeahead<GovDevice>>()\r\n\r\n  componentDidMount() {\r\n    this.setState({...this.defaultStateFromProps(), loading: true})\r\n\r\n    this.loadSubscription = DevicesGetObservable().subscribe(\r\n      data  => this.setState({devices: this.filterDevices(this.props.labAccount?.LabAccountNumber || \"\", data), selectedDevice: data.find(el => el.DeviceID === this.props.details?.DeviceID), loading: false}),\r\n      error => this.handleAPIError(error, { loading: false})\r\n    )\r\n  }\r\n\r\n  componentWillUnmount() {\r\n    this.loadSubscription && this.loadSubscription.unsubscribe()\r\n    this.saveSubscription && this.saveSubscription.unsubscribe()\r\n  }\r\n\r\n  handleAPIError = (error: Error | APIError, stateChanges: object) => {\r\n    this.setState(stateChanges)\r\n    error && toast.error((error as APIError)?.errorData?.message || error.message)\r\n  }\r\n\r\n  onCancel = () => this.props.onHide()\r\n\r\n  onSubmit = () => {\r\n    this.setState({saving: true})\r\n    const selectedDevice = this.state.selectedDevice\r\n    const data: ModifyGovDevice = {\r\n      DeviceID: selectedDevice?.DeviceID || 0,\r\n      LabAccount: this.props.labAccount?.LabAccountNumber || \"\",\r\n      DeviceLabAccountXrefID: this.props.details?.DeviceLabAccountXrefID || 0,\r\n      Delete: false\r\n    }\r\n\r\n    this.saveSubscription = GovDeviceModifyObservable(data).subscribe(\r\n      data => {\r\n        this.setState({ saving: false })\r\n        toast.success(data)\r\n        this.props.onSave()\r\n      },\r\n      error => this.handleAPIError(error, { saving: false })\r\n    )\r\n  }\r\n\r\n  valueText = (text: string | number | undefined) => <Col xs={6} md={8} className=\"col-form-label\">{text}</Col>\r\n  rowClassName = (required: boolean = false) => required ? \"form-group required\" : \"form-group\"\r\n\r\n  isValid = () => !!this.state.selectedDevice\r\n\r\n  handleToggleEditMode = () => {\r\n    this.setState({editing: !this.state.editing, ...this.defaultStateFromProps()})\r\n  }\r\n\r\n  defaultStateFromProps = () => {\r\n    const data = this.props.details\r\n    return {\r\n      selectedDevice: this.state.devices.find(el => el.DeviceID === data?.DeviceID)\r\n    }\r\n  }\r\n\r\n  handleDeviceChange = (selected: GovDevice[]) => {\r\n    this.setState({selectedDevice: selected[0]})\r\n  }\r\n\r\n  filterDevices = (labAccount: string, data: GovDevice[]) => {\r\n    let filteredDevices = data\r\n    if (labAccount.split(\".\")[1].includes(\"CON\")) {\r\n      filteredDevices = data.filter(({SampleType}) => SampleType === \"UR\")\r\n    }\r\n    if (labAccount.split(\".\")[1].includes(\"OCO\")) {\r\n      filteredDevices = data.filter(({SampleType}) => SampleType === \"SL\")\r\n    }\r\n    return filteredDevices.filter(el => !this.props.currentDevices.includes(el.DeviceID))\r\n  }\r\n\r\n  render() {\r\n    const { loading, saving, selectedDevice, devices } = this.state\r\n    const editing = this.state.editing || !!this.props.addNew\r\n\r\n    return (\r\n      <Modal backdrop=\"static\" show size=\"lg\" dialogClassName=\"dark\">\r\n        <Modal.Header>\r\n          {!!this.props.addNew && <Modal.Title className=\"text-uppercase\">Add New Device</Modal.Title>}\r\n          {!editing && <Modal.Title className=\"text-uppercase\">Device</Modal.Title>}\r\n          {editing && !this.props.addNew && <Modal.Title className=\"text-uppercase\">Edit Device</Modal.Title>}\r\n        </Modal.Header>\r\n        <Modal.Body>\r\n          <Form className=\"px-4\">\r\n            {!this.props.addNew && false && <Form.Row>\r\n              <Col><h5>MODIFY DEVICE</h5></Col>\r\n              <Col sm={1} className={\"text-right\"}>\r\n                <h5>\r\n                  <Button variant=\"icon-link\" size=\"sm\" className=\"float-right mb-3 btn-icon-primary\" onClick={this.handleToggleEditMode}>\r\n                    {!this.state.editing && <FaPencilAlt />}\r\n                    {this.state.editing && <FaTimes />}\r\n                  </Button>\r\n                </h5>\r\n              </Col>\r\n            </Form.Row>}\r\n            <Form.Row className={this.rowClassName()}>\r\n              <Form.Label column xs={6} md={4}>Device</Form.Label>\r\n              {!editing && this.valueText(this.props.details?.Description)}\r\n              {editing &&\r\n                <Col xs={6} md={8}>\r\n                  <Typeahead id=\"device\"\r\n                    ref={this.deviceTypeahead}\r\n                    labelKey=\"Description\"\r\n                    emptyLabel=\"No Devices Found\"\r\n                    disabled={loading}\r\n                    filterBy={(option, props) => props.selected.length > 0 || option.Description.toLowerCase().indexOf(props.text.toLowerCase()) !== -1}\r\n                    onChange={this.handleDeviceChange}\r\n                    options={devices || []}\r\n                    selected={!!selectedDevice ? [selectedDevice] : []}\r\n                    placeholder=\"Enter the Device\">\r\n                    <Button variant=\"toggle\"\r\n                      disabled={loading}\r\n                      onClick={() => { this.deviceTypeahead.current?.toggleMenu() }}>\r\n                      <FaAngleDown />\r\n                    </Button>\r\n                  </Typeahead>\r\n                </Col>}\r\n            </Form.Row>\r\n            <Form.Row className={this.rowClassName()}>\r\n              <Form.Label column xs={6} md={4}>Code</Form.Label>\r\n              {this.valueText(selectedDevice?.Code)}\r\n            </Form.Row>\r\n            <Form.Row className={this.rowClassName()}>\r\n              <Form.Label column xs={6} md={4}>Sample Type</Form.Label>\r\n              {this.valueText(selectedDevice?.SampleType)}\r\n            </Form.Row>\r\n            <Form.Row className={this.rowClassName()}>\r\n              <Form.Label column xs={6} md={4}>Begin Effective Date</Form.Label>\r\n              {this.valueText(FormatDate(selectedDevice?.BeginEffectiveDate))}\r\n            </Form.Row>\r\n            <Form.Row className={this.rowClassName()}>\r\n              <Form.Label column xs={6} md={4}>End Effective Date</Form.Label>\r\n              {this.valueText(FormatDate(selectedDevice?.EndEffectiveDate))}\r\n            </Form.Row>\r\n            <Form.Row className={this.rowClassName()}>\r\n              <Form.Label column xs={6} md={4}>Manufacturer</Form.Label>\r\n              {this.valueText(selectedDevice?.Manufacturer)}\r\n            </Form.Row>\r\n          </Form>\r\n        </Modal.Body>\r\n        <Modal.Footer>\r\n          <Button variant=\"secondary\" onClick={ this.onCancel } className=\"px-4\">{editing ? \"Cancel\" : \"Close\"}</Button>\r\n          {editing && <ActionButton variant=\"primary\" onClick={ this.onSubmit } disabled={loading || !this.isValid()} spin={saving} disableOnSpin>{!!this.props.addNew ? \"Save\" : \"Update\"}</ActionButton>}\r\n        </Modal.Footer>\r\n      </Modal>\r\n    )\r\n  }\r\n}\r\n","import React from \"react\"\r\nimport { Modal, Form, Col, Button, Row, Table, Spinner } from \"react-bootstrap\"\r\nimport { toast } from \"react-toastify\"\r\nimport { Subscription } from \"rxjs\"\r\nimport LabAccount from \"../../api/Administration/Model/LabAccount\"\r\nimport { APIError } from \"../../api/ObservableFromFetch\"\r\nimport GovDevice, { ModifyGovDevice } from \"../../api/Randoms/GovPoolModel/GovDevice\"\r\nimport { DevicesGetObservable, GovDeviceModifyObservable } from \"../../api/Randoms/GovDevicesGet\"\r\nimport LabAccountListGet from \"../../api/Administration/LabAccountListGet\"\r\nimport { Typeahead } from \"react-bootstrap-typeahead\"\r\nimport { FaAngleDown } from \"react-icons/fa\"\r\nimport DeviceModal from \"./DeviceModal\"\r\nimport ConfirmationModal from \"../ConfirmationModal\"\r\n\r\ninterface DeviceSelectionProps {\r\n  portalMode?: boolean\r\n  implementationID: number\r\n  accountID: number\r\n  onClose: () => void\r\n}\r\n\r\ninterface  DeviceSelectionState {\r\n  addNewDevice: boolean\r\n  labAccounts: LabAccount[]\r\n  devices: GovDevice[]\r\n  selectedLab?: LabAccount\r\n  loading: boolean\r\n  deviceDetails: boolean\r\n  details?: GovDevice\r\n  confirmModal: boolean\r\n}\r\n\r\nexport default class  DeviceSelection extends React.PureComponent< DeviceSelectionProps,  DeviceSelectionState> {\r\n  labAccountSubscription?: Subscription\r\n  deviceSubscription?: Subscription\r\n  deleteSubscription?: Subscription\r\n  state:  DeviceSelectionState = {\r\n    addNewDevice: false,\r\n    labAccounts: [],\r\n    devices: [],\r\n    loading: false,\r\n    deviceDetails: false,\r\n    confirmModal: false\r\n  }\r\n\r\n  labAccountRef = React.createRef<Typeahead<LabAccount>>()\r\n\r\n  componentWillMount() {\r\n    this.loadLabAccounts()\r\n  }\r\n\r\n  componentWillUnmount() {\r\n    this.labAccountSubscription && this.labAccountSubscription.unsubscribe()\r\n    this.deviceSubscription && this.deviceSubscription.unsubscribe()\r\n    this.deleteSubscription && this.deleteSubscription.unsubscribe()\r\n  }\r\n\r\n  onCancel = () => {\r\n    this.props.onClose()\r\n  }\r\n\r\n  handleAPIError = (error: Error | APIError, stateChanges: object) => {\r\n    this.setState(stateChanges)\r\n    error && toast.error((error as APIError)?.errorData?.message || error.message)\r\n  }\r\n\r\n  loadLabAccounts = () => {\r\n    this.setState({ loading: true })\r\n    this.deviceSubscription = LabAccountListGet(this.props.implementationID, this.props.accountID, false).subscribe(\r\n      data => this.setState({ loading: false, labAccounts: [...data.ActiveLabAccount.filter(({LabAccountNumber}) => LabAccountNumber.split(\".\")[1].includes(\"CON\") || LabAccountNumber.split(\".\")[1].includes(\"OCO\"))] }),\r\n      error => this.handleAPIError(error, { loading: false })\r\n    )\r\n  }\r\n\r\n  loadDevices = (labAccount: string) => {\r\n    this.setState({ loading: true })\r\n    this.deviceSubscription = DevicesGetObservable(labAccount).subscribe(\r\n      data => this.setState({ loading: false, devices: data }),\r\n      error => this.handleAPIError(error, { loading: false })\r\n    )\r\n  }\r\n\r\n  handleLabChange = (items: LabAccount[]) => {\r\n    const selectedLab = items[0]\r\n    this.setState({ selectedLab: selectedLab, devices: [] }, () => {\r\n      if (!!selectedLab) this.loadDevices(selectedLab.LabAccountNumber)\r\n    })\r\n  }\r\n\r\n  hideModal = () => this.setState({ confirmModal: false, details: undefined })\r\n\r\n  confirmDelete = () => {\r\n    const { details, selectedLab } = this.state\r\n    const data: ModifyGovDevice = {\r\n      DeviceID: details?.DeviceID || 0,\r\n      LabAccount: selectedLab?.LabAccountNumber || \"\",\r\n      DeviceLabAccountXrefID: details?.DeviceLabAccountXrefID || 0,\r\n      Delete: true\r\n    }\r\n    this.hideModal()\r\n    this.deleteSubscription = GovDeviceModifyObservable(data).subscribe(\r\n      data => {\r\n        toast.success(data)\r\n        this.handleLabChange(!!this.state.selectedLab ? [this.state.selectedLab] : [])\r\n      },\r\n      error => this.handleAPIError(error, { saving: false })\r\n    )\r\n  }\r\n\r\n  showDeviceDetailsModal = (data: GovDevice) => this.setState({ deviceDetails: true, details: data })\r\n\r\n  onSave = () => {\r\n    this.setState({addNewDevice: false, deviceDetails: false, details: undefined})\r\n    this.handleLabChange(!!this.state.selectedLab ? [this.state.selectedLab] : [])\r\n  }\r\n\r\n  dataRows = (data: GovDevice[]) => data.map((row: GovDevice, i: number) => this.dataRow(row, i))\r\n\r\n  dataRow = (data: GovDevice, index: number) => {\r\n    return <tr key={index}>\r\n      <td className=\"align-middle\"><Button variant=\"underline-link\" onClick={() => this.showDeviceDetailsModal(data)}>{data.Description}</Button></td>\r\n      <td className=\"align-middle\">{data.Code}</td>\r\n      <td className=\"align-middle\">{data.SampleType}</td>\r\n      <td className=\"align-middle\"><Button variant=\"underline-link\" onClick={() => this.setState({ confirmModal: true, details: data})}>Delete</Button></td>\r\n    </tr>\r\n  }\r\n\r\n  devicePanelCodes = () =>\r\n    this.state.devices.reduce((res, el) => {\r\n      const key = el.DeviceID\r\n      res[key] = res[key] || []\r\n      res[key].push(el.PanelCode)\r\n      return res\r\n    }, Object.create(null))\r\n\r\n  render() {\r\n    const { loading, addNewDevice, labAccounts, devices, selectedLab, deviceDetails } = this.state\r\n\r\n    return (\r\n      <>\r\n        <Modal backdrop=\"static\" show size=\"lg\">\r\n          <Modal.Header>\r\n            <Modal.Title className=\"text-uppercase\">Devices</Modal.Title>\r\n          </Modal.Header>\r\n          <Modal.Body>\r\n            <Form.Row>\r\n              <Col className=\"pb-4\">\r\n                <Typeahead id=\"labAccount\"\r\n                  ref={this.labAccountRef}\r\n                  labelKey=\"LabAccountNumber\"\r\n                  emptyLabel=\"No Laboratory Accounts Found\"\r\n                  disabled={loading}\r\n                  filterBy={(option, props) => props.selected.length > 0 || option.LabAccountNumber.toLowerCase().indexOf(props.text.toLowerCase()) !== -1}\r\n                  onChange={this.handleLabChange}\r\n                  options={labAccounts || []}\r\n                  selected={selectedLab ? [selectedLab] : []}\r\n                  placeholder=\"Enter the Lab Account\">\r\n                  <Button variant=\"toggle\"\r\n                    disabled={loading}\r\n                    onClick={() => { this.labAccountRef.current?.toggleMenu() }}>\r\n                    <FaAngleDown />\r\n                  </Button>\r\n                </Typeahead>\r\n              </Col>\r\n            </Form.Row>\r\n            {!!selectedLab && <Form.Group as={Row}>\r\n              <Table responsive bordered className=\"dark text-center\">\r\n                <thead>\r\n                  <tr>\r\n                    <th className=\"w-25\">Device</th>\r\n                    <th className=\"w-25\">Code</th>\r\n                    <th className=\"w-25\">Sample Type</th>\r\n                    <th className=\"w-25\">Actions</th>\r\n                  </tr>\r\n                </thead>\r\n                <tbody>\r\n                  {loading && <><tr><td colSpan={4}><Spinner animation=\"border\" size=\"sm\" /></td></tr></>}\r\n                  {!loading && devices.length === 0 && <><tr><td colSpan={4}>NO DATA FOUND</td></tr></>}\r\n                  {this.dataRows(devices)}\r\n                </tbody>\r\n              </Table>\r\n            </Form.Group>}\r\n            {deviceDetails && <DeviceModal onHide={() => this.setState({ addNewDevice: false, deviceDetails: false, details: undefined })} \r\n              addNew={addNewDevice}\r\n              currentDevices={devices.map(el => el.DeviceID)}\r\n              labAccount={selectedLab}\r\n              details={this.state.details}\r\n              onSave={() => this.onSave()} />}\r\n            <ConfirmationModal show={this.state.confirmModal}\r\n                title=\"CONFIRM REMOVE\"\r\n                textTitle=\"Are you sure you want to remove selected record?\"\r\n                text=\"Selected record will be removed permanently.\"\r\n                onConfirm={this.confirmDelete}\r\n                onHide={this.hideModal} />\r\n          </Modal.Body>\r\n          <Modal.Footer>\r\n            <Button variant=\"secondary\" onClick={this.onCancel} className=\"px-4\">Cancel</Button>\r\n            <Button onClick={() => this.setState({ addNewDevice: true, deviceDetails: true })} className=\"px-4\" disabled={!selectedLab}>Add New Device</Button>\r\n          </Modal.Footer>\r\n        </Modal>\r\n      </>\r\n    )\r\n  }\r\n\r\n}\r\n","import * as React from \"react\"\r\nimport { Button, Col, Form, Modal, Row, Table } from \"react-bootstrap\"\r\nimport { Subscription } from \"rxjs\"\r\nimport { toast } from \"react-toastify\"\r\nimport { ImportCSVMaxFileSize } from \"../../config/Constants\"\r\nimport ConfirmationModal from \"../ConfirmationModal\"\r\nimport ImportJobData from \"../../api/Administration/CompanyImport/Model/ImportJobData\"\r\nimport { LocationImportJobCreateObservable } from \"../../api/Administration/CompanyImport/ImportJobCreate\"\r\nimport ImportJobValidateObservable, { ImportJobValidationResult } from \"../../api/Administration/CompanyImport/ImportJobValidate\"\r\nimport ImportJobStartObservable from \"../../api/Administration/CompanyImport/ImportJobStart\"\r\nimport ImportJobCancelObservable from \"../../api/Administration/CompanyImport/ImportJobCancel\"\r\nimport ActionButton from \"../ActionButton\"\r\nimport { ApiRootUrl } from \"../../api/ApiUrl\"\r\nimport FileSaver from \"file-saver\"\r\n\r\ninterface LocationImportProps {\r\n  portalID: number\r\n  companyID: number\r\n  onClose: () => void\r\n}\r\n\r\ninterface LocationImportState {\r\n  step: \"file\" | \"mapping\" | \"import\"\r\n  fileInputKey: string\r\n  fileName?: string\r\n  fileContent?: string\r\n  importData?: ImportJobData\r\n  validationResult?: ImportJobValidationResult\r\n  isSaving: boolean\r\n  isCancelling: boolean\r\n  showCancelConfirmModal: boolean\r\n  showImportConfirmModal: boolean\r\n}\r\n\r\nexport default class LocationImport extends React.Component<LocationImportProps, LocationImportState> {\r\n  emptyData: LocationImportState = {\r\n    step: \"file\",\r\n    fileInputKey: \"file_input_key\",\r\n    fileName: undefined,\r\n    fileContent: undefined,\r\n    importData: undefined,\r\n    validationResult: undefined,\r\n    isSaving: false,\r\n    isCancelling: false,\r\n    showCancelConfirmModal: false,\r\n    showImportConfirmModal: false\r\n  }\r\n  state: LocationImportState = { ...this.emptyData }\r\n\r\n  importJobCreateSubscription?: Subscription\r\n  importJobValidateSubscription?: Subscription\r\n  importJobStartSubscription?: Subscription\r\n  importJobCancelSubscription?: Subscription\r\n\r\n  componentDidMount() { }\r\n\r\n  componentWillUnmount() {\r\n    this.importJobCreateSubscription && this.importJobCreateSubscription.unsubscribe()\r\n    this.importJobValidateSubscription && this.importJobValidateSubscription.unsubscribe()\r\n    this.importJobStartSubscription && this.importJobStartSubscription.unsubscribe()\r\n    this.importJobCancelSubscription && this.importJobCancelSubscription.unsubscribe()\r\n  }\r\n\r\n  handleApiError = (error: Error) => {\r\n    this.setState({ isSaving: false, isCancelling: false })\r\n    toast.error(error)\r\n  }\r\n\r\n  handleFileStepNext = () => {\r\n    if (this.state.fileContent) {\r\n      this.setState({ isSaving: true })\r\n      this.importJobCreateSubscription && this.importJobCreateSubscription.unsubscribe()\r\n      this.importJobCreateSubscription = LocationImportJobCreateObservable(this.state.fileContent, this.state.fileName || \"\", this.props.portalID, this.props.companyID, this.state.importData?.ImportJobID).subscribe(\r\n        data => this.setState({\r\n          step: \"mapping\",\r\n          importData: data,\r\n          isSaving: false\r\n        }),\r\n        error => this.handleApiError(error)\r\n      )\r\n    }\r\n  }\r\n\r\n  handleStartImportValidation = () => {\r\n    if (!this.state.importData?.ImportJobID || !this.state.importData?.Records.length) {\r\n      return\r\n    }\r\n    this.setState({ isSaving: true })\r\n    this.importJobValidateSubscription && this.importJobValidateSubscription.unsubscribe()\r\n    this.importJobValidateSubscription = ImportJobValidateObservable(this.state.importData?.ImportJobID).subscribe(\r\n      validationErrors => this.setState({ step: \"import\", validationResult: validationErrors, isSaving: false }),\r\n      error => this.handleApiError(error)\r\n    )\r\n  }\r\n\r\n  performImport = () => {\r\n    this.setState({ isSaving: true, showImportConfirmModal: false })\r\n    this.importJobStartSubscription && this.importJobStartSubscription.unsubscribe()\r\n    this.importJobStartSubscription = ImportJobStartObservable(this.state.importData?.ImportJobID || 0, 0).subscribe(\r\n      (data) => {\r\n        data.Result ? toast.success(\"Records imported successfully.\") : toast.error(\"Import completed with errors\")\r\n        this.props.onClose()\r\n      },\r\n      error => this.handleApiError(error)\r\n    )\r\n  }\r\n\r\n  performCancel = () => {\r\n    this.setState({ isCancelling: true })\r\n    this.importJobCancelSubscription && this.importJobCancelSubscription.unsubscribe()\r\n    this.importJobCancelSubscription = ImportJobCancelObservable(this.state.importData?.ImportJobID || 0).subscribe(\r\n      () => {\r\n        toast.success(\"Created job is cancelled successfully.\")\r\n        this.resetState()\r\n      },\r\n      error => this.handleApiError(error)\r\n    )\r\n  }\r\n\r\n  resetState = () => this.setState({ ...this.emptyData, fileInputKey: Math.random().toString() })\r\n\r\n  handleHandleFileUpload = (e: React.ChangeEvent<HTMLInputElement>) => {\r\n    const file = e.target && e.target.files && e.target.files[0]\r\n    if (file && file.size > 0 && file.size < ImportCSVMaxFileSize) {\r\n      const ext = file.name.substring(file.name.lastIndexOf(\".\") + 1)\r\n      if (ext && ext.toLowerCase() === \"csv\") {\r\n        var reader = new FileReader()\r\n        const self = this\r\n        reader.onload = function (e) {\r\n          const result = e.target?.result as string || \"\"\r\n          const stringLength = result.indexOf(\"base64\") + 7\r\n          const fileContent = result.slice(stringLength, result.length)\r\n          if (fileContent) {\r\n            self.setState({ fileName: file.name, fileContent: fileContent })\r\n          } else {\r\n            self.setState({ fileName: undefined, fileContent: undefined })\r\n            toast.error(\"CSV file is empty.\")\r\n          }\r\n        }\r\n        reader.onerror = function (error) { toast.error(error) }\r\n        reader.readAsDataURL(file)\r\n      } else {\r\n        toast.error(\"File type not allowed, Please upload CSV file.\")\r\n      }\r\n    } else {\r\n      this.setState({ fileName: undefined, fileContent: undefined })\r\n    }\r\n  }\r\n\r\n  calcColspan = (items: string[], i: number, tableColsCount: number) => {\r\n    if (i === items.length - 1) {\r\n      return Math.max(1, tableColsCount - i)\r\n    }\r\n    return 1\r\n  }\r\n\r\n  downloadTemplate = () => {\r\n    const csvData = new Blob([\"Location Name,Location Code,Address 1,Address 2,City,State,Zip,Province,Country,Phone,Fax,Web Site URL,Time Zone,Lab Code,Lab Account Number\\r\\n\"], { type: 'text/csv;charset=utf-8;' })\r\n    FileSaver.saveAs(csvData, \"location-import-template.csv\")\r\n  }\r\n\r\n  render() {\r\n    const { step, fileInputKey, fileContent,\r\n      importData, validationResult,\r\n      isSaving, isCancelling, showCancelConfirmModal, showImportConfirmModal\r\n    } = this.state\r\n\r\n    const previewTableColsCount = step === \"mapping\" && importData\r\n      ? Math.max(...importData.Records.map(item => item.length), importData.HeaderItems.length)\r\n      : 0\r\n    return <Modal size=\"xl\" backdrop=\"static\" show onHide={this.props.onClose} dialogClassName=\"modal-90w\">\r\n      <Modal.Header closeButton>\r\n        <Modal.Title>LOCATION IMPORT</Modal.Title>\r\n      </Modal.Header>\r\n      <Modal.Body className=\"pt-0 LocationImport\">\r\n        {step === \"file\" &&\r\n          <Form>\r\n            <Form.Row><Col><h5>UPLOAD FILE</h5></Col></Form.Row>\r\n            <Form.Row>\r\n              <Col xs={5} md={3} className=\"mt-2\"><h6>Import CSV File</h6></Col>\r\n              <Col xs={7} md={9}>\r\n                <Button variant=\"underline-link\" onClick={() => this.downloadTemplate()}>Download Example Spreadsheet</Button>\r\n              </Col>\r\n            </Form.Row>\r\n            <Form.Row className=\"form-group\">\r\n              <Form.Label column md={3}>Upload file:</Form.Label>\r\n              <Col md={9} className=\"form-label col-form-label pl-3\">\r\n                <input type=\"file\" key={fileInputKey} accept=\".csv\" onChange={this.handleHandleFileUpload} />\r\n              </Col>\r\n            </Form.Row>\r\n          </Form>}\r\n        {step === \"mapping\" &&\r\n          <Form>\r\n            <Row><Col><h5>PREVIEW</h5></Col></Row>\r\n            <Table className=\"mappings-table\" responsive bordered>\r\n              <thead>\r\n                {importData && importData.HeaderItems.length > 0 && <tr>{importData.HeaderItems.map((item, i) => <th key={`hr_${item}_${i}`} colSpan={this.calcColspan(importData.HeaderItems, i, previewTableColsCount)}>{item}</th>)}</tr>}\r\n              </thead>\r\n              <tbody>\r\n                {importData && importData.Records.length > 0 && importData.Records.map((row, i) => <tr key={`d_${i}`}>{row.map((item, j) => <td colSpan={this.calcColspan(row, j, previewTableColsCount)} key={`d_${j}_${i}`}>{item}</td>)}</tr>)}\r\n                {importData && importData.Records.length === 0 && <tr><td colSpan={previewTableColsCount}>NO DATA FOUND</td></tr>}\r\n              </tbody>\r\n            </Table>\r\n          </Form>}\r\n        {step === \"import\" &&\r\n          <Form>\r\n            <Row><Col><h5>IMPORT FILE VALIDATION</h5></Col></Row>\r\n            <Row><Col>Import file validation: ({(validationResult?.TotalRowsCount || 0) - (validationResult?.ValidRowsCount || 0)} of {validationResult?.TotalRowsCount || 0} have errors)</Col></Row>\r\n            {validationResult && validationResult.Rows.length > 0 &&\r\n              <Table className=\"table-sm\" responsive bordered>\r\n                <thead>\r\n                  <tr>\r\n                    <th>Line #</th>\r\n                    <th>Validation errors and warnings</th>\r\n                    {validationResult.Headers.map((item, i) => <th key={`h_${item}+${i}]`}>{item}</th>)}\r\n                  </tr>\r\n                </thead>\r\n                <tbody>\r\n                  {validationResult.Rows.map((row, i) => <tr key={`d_${i}`}>\r\n                    <td>{row.RowNum}</td>\r\n                    <td>\r\n                      {(row.Errors?.length || 0) > 0 && <div className=\"error-message\">\r\n                        <span className=\"font-weight-bold\">Error{row.Errors!.length > 1 ? `s (${row.Errors!.length}):` : \":\"}</span>\r\n                        {row.Errors!.map((item, i) => <div className=\"pt-1\" key={`err_${i}`}>{item}</div>)}\r\n                      </div>}\r\n                      {(row.Warnings?.length || 0) > 0 && <div className=\"warning-message\">\r\n                        <span className=\"font-weight-bold\">Warning{row.Warnings!.length > 1 ? `s (${row.Warnings!.length}):` : \":\"}</span>\r\n                        {row.Warnings!.map((item, i) => <div className=\"pt-1\" key={`warn_${i}`}>{item}</div>)}\r\n                      </div>}\r\n                    </td>\r\n                    {row.Items.length === validationResult.Headers.length && row.Items.map((item, j) => <td key={`d_${item}_${i}_${j}`}><span>{item}</span></td>)}\r\n                    {row.Items.length !== validationResult.Headers.length && <td colSpan={validationResult.Headers.length}><span className=\"font-weight-bold\">Original line:</span><div>{row.OriginalString}</div></td>}\r\n                  </tr>)}\r\n                </tbody>\r\n              </Table>}\r\n          </Form>}\r\n        <ConfirmationModal show={showCancelConfirmModal}\r\n          title=\"CANCEL CONFIRMATION\"\r\n          textTitle={`Are you sure you want to cancel importing ${validationResult?.ValidRowsCount || 0} of ${validationResult?.TotalRowsCount || 0} records?`}\r\n          text=\"\"\r\n          onConfirm={this.performCancel}\r\n          onHide={() => this.setState({ showCancelConfirmModal: false })} />\r\n        <ConfirmationModal show={showImportConfirmModal}\r\n          title=\"IMPORT CONFIRMATION\"\r\n          textTitle={`You are about to submit ${validationResult?.ValidRowsCount || 0} of ${validationResult?.TotalRowsCount || 0} records for import?`}\r\n          text=\"\"\r\n          onConfirm={this.performImport}\r\n          onHide={() => this.setState({ showImportConfirmModal: false })} />\r\n      </Modal.Body>\r\n      <Modal.Footer className=\"justify-content-between\">\r\n        <div>\r\n          {step === \"file\" && <Button type=\"reset\" variant=\"secondary\" className=\"fixed-w5\" onClick={this.resetState} disabled={isSaving}>RESET</Button>}\r\n        </div>\r\n        <div>\r\n          {step === \"file\" && <>\r\n            <Button variant=\"secondary\" className=\"fixed-w5\" onClick={this.props.onClose}>CANCEL</Button>\r\n            <ActionButton variant=\"primary\" className=\"fixed-w5 ml-1\" onClick={this.handleFileStepNext} disabled={!fileContent} spin={isSaving} disableOnSpin>NEXT</ActionButton>\r\n          </>}\r\n          {step === \"mapping\" && <>\r\n            <Button variant=\"secondary\" className=\"fixed-w5\" onClick={() => this.setState({ step: \"file\" })} disabled={isSaving}>BACK</Button>\r\n            <ActionButton variant=\"primary\" className=\"fixed-w5 ml-1\" onClick={this.handleStartImportValidation} disabled={!importData || importData.Records.length === 0} spin={isSaving} disableOnSpin>SUBMIT FOR VALIDATION</ActionButton>\r\n          </>}\r\n          {step === \"import\" && <>\r\n            <Button variant=\"secondary\" className=\"fixed-w5\" onClick={() => this.setState({ step: \"mapping\", validationResult: undefined })} disabled={isSaving || isCancelling}>BACK</Button>\r\n            <ActionButton variant=\"secondary\" className=\"fixed-w5 ml-1\" onClick={() => this.setState({ showCancelConfirmModal: true })} spin={isCancelling} disableOnSpin>CANCEL</ActionButton>\r\n            <ActionButton variant=\"primary\" className=\"fixed-w5 ml-1\" onClick={() => this.setState({ showImportConfirmModal: true })} disabled={isCancelling || !validationResult?.ValidRowsCount} spin={isSaving} disableOnSpin>IMPORT</ActionButton>\r\n          </>}\r\n        </div>\r\n      </Modal.Footer>\r\n    </Modal >\r\n  }\r\n\r\n  static defaultProps = { step: \"file\" }\r\n}\r\n","import { ObservableFromFetch } from \"../ObservableFromFetch\"\r\n\r\nexport interface AdditionalTest {\r\n  AccountID: number\r\n  LabAccount: string\r\n  PanelCode: string\r\n  Inactive: boolean\r\n}\r\n\r\nexport function GetAdditionalTests(accountId: number, labAccount: string) {\r\n  return ObservableFromFetch<AdditionalTest[]>(`GovOrder/GetAdditionalTests?AccountID=${accountId}&LabAccount=${labAccount}`)\r\n}\r\n\r\nexport function UpdateAdditionalTests(accountId: number, labAccount: string, panels: string[], selectedPanels: string[]) {\r\n  const requestBody: string = JSON.stringify(panels.map(p => {return { AccountID: accountId, LabAccount: labAccount, PanelCode: p, Inactive: selectedPanels.indexOf(p) == -1 }} ))\r\n  return ObservableFromFetch<string>(\"GovOrder/UpdateAdditionalTests\", requestBody, \"PUT\")\r\n}\r\n","import React, { Dispatch } from \"react\"\r\nimport { Button, Col, Form, InputGroup, ListGroup, Modal, OverlayTrigger, Popover, Spinner } from \"react-bootstrap\"\r\nimport MaskedInput from \"react-maskedinput\"\r\nimport { toast } from \"react-toastify\"\r\nimport { concat, of, Subject, Subscription } from \"rxjs\"\r\nimport { catchError, debounceTime, filter, map, switchMap } from \"rxjs/operators\"\r\nimport { FaAngleDown, FaInfoCircle } from \"react-icons/fa\"\r\nimport { ImplementationTypeGovt, PhoneRegexp, SiteDomain, ZipRegexp, CompanyNameRegexp, ProtectedSites, MaxFileNameLength, MaxImageFileSize } from \"../../config/Constants\"\r\nimport { APIError } from \"../../api/ObservableFromFetch\"\r\nimport BusinessType from \"../../api/BusinessTypes/BusinessType\"\r\nimport BusinessTypesGet from \"../../api/BusinessTypes/BusinessTypesGet\"\r\nimport Address from \"../../api/Location/LocationModel/Address\"\r\nimport Role from \"../../api/Roles/Model/Role\"\r\nimport UserRolesGet from \"../../api/Roles/UserRolesGet\"\r\nimport PrimaryIDType from \"../../api/PrimaryIDTypes/PrimaryIDType\"\r\nimport PrimaryIDTypesGet from \"../../api/PrimaryIDTypes/PrimaryIDTypesGet\"\r\nimport CompanyInactivate from \"../../api/Companies/CompanyInactivate\"\r\nimport { CompanyUpdateObservable, CompanyCreateObservable } from \"../../api/Companies/CompanyUpdate\"\r\nimport CompanyData from \"../../api/Companies/CompanyModel/CompanyData\"\r\nimport CompaniesGet, { CompaniesDetailsExportCsv } from \"../../api/Companies/CompaniesGet\"\r\nimport { StateObservable } from \"../../api/OrderRequests/OrderRequestsConstraintGet\"\r\nimport State from \"../../api/OrderRequests/OrderRequestsModel/State\"\r\nimport AddressInput from \"../FormattedInputs/AddressInput\"\r\nimport PhoneNumberMaskedInput from \"../FormattedInputs/PhoneNumberMaskedInput\"\r\nimport StateSelect from \"../FormattedInputs/StateSelect\"\r\nimport ActionButton from \"../ActionButton\"\r\nimport AddressMatchModal, { AddressData } from \"../AddressMatchModal\"\r\nimport ConfirmationModal from \"../ConfirmationModal\"\r\nimport OrderSecurityOverride from \"../Administration/OrderSecurityOverride\"\r\nimport OrderSecurity from \"../Invitation/OrderSecurity\"\r\nimport LabAccountSelection from \"./LabAccountSelection\"\r\nimport { isCompanyAdmin, isPortalAdmin, isSiteAdmin } from \"../../authentication/isAdminRole\"\r\nimport { AppState, WorkforceClinicPortal } from \"../../AppState\"\r\nimport { connect } from \"react-redux\"\r\nimport { AppPageWrapper } from \"../NavMenu/AppPageWrapper\"\r\nimport CompanyEditData from \"../../api/Companies/CompanyModel/CompanyEditData\"\r\nimport SubscriptionPlan from \"../../api/Administration/Model/SubscriptionPlan\"\r\nimport SubscriptionModal from \"./SubscriptionModal\"\r\nimport { AsyncTypeahead } from \"react-bootstrap-typeahead\"\r\nimport AutoFilterPortalsGetObservable from \"../../api/Portals/AutoFilterPortalsGet\"\r\nimport PortalsGetObservable from \"../../api/Portals/PortalsGet\"\r\nimport GetSubscriptionPlans from \"../../api/Administration/GetSubscriptionPlans\"\r\nimport PortalUpdate from \"../../api/Portals/PortalUpdate\"\r\nimport PortalEditData from \"../../api/Portals/PortalModel/PortalEditData\"\r\nimport PortalData from \"../../api/Portals/PortalModel/PortalData\"\r\nimport PortalInactivateObservable from \"../../api/Portals/PortalInactivate\"\r\nimport { GetSelectedPortal, getUserNameForSelectedCompany, SelectedCompanyName, SelectedPortalName } from \"../../authentication/SelectedCompany/CompanySelectionDrivenSelectors\"\r\nimport { RouteComponentProps } from \"react-router\"\r\nimport { AddCompanyForPortalRoute, AddNewCompanyRoute, CompanyDetailsRoute, Home, MyOrganizationRoute, PortalAdministrationRoute, PortalDetailsRoute } from \"../../config/Routes\"\r\nimport ManageImages from \"./ManageImages\"\r\nimport CompanyImport from \"./CompanyImport\"\r\nimport UserAccessSettings from \"../../authentication/UserAccessSettings\"\r\nimport { BuildUserAccess } from \"../../authentication/BuildUserAccess\"\r\nimport AutoFilterCompany from \"../../api/Companies/CompanyModel/AutoFilterCompany\"\r\nimport TimeZoneListGet from \"../../api/Administration/TimeZoneListGet\"\r\nimport TimeZoneData from \"../../api/Administration/Model/TimeZoneData\"\r\nimport PortalFields from \"../Invitation/Portal/PortalFields\";\r\nimport PortalAdminData from \"../../api/Portals/PortalModel/PortalAdminData\"\r\nimport { PortalInvitation, PortalInviteData } from \"../../api/Invitation/InvitationCreate\";\r\nimport LabAccountListGet from \"../../api/Administration/LabAccountListGet\"\r\nimport { EditLocationInformation } from \"./EditLocationInformation\"\r\nimport GetAccountsByNameObservable from \"../../api/Companies/GetAccountsByName\"\r\nimport Checkbox from \"../Checkbox\"\r\nimport { CompanyCodeCheck, CompanyNameCheck, UrlCheck } from \"../../api/Invitation/InformationGet\"\r\nimport { Addresses } from \"../../api/OrderRequests/OrderRequestsModel/Addresses\"\r\nimport { IsOnTrack } from \"../../App\";\r\nimport { CompanyActivationObservable, PortalActivationObservable } from \"../../api/Administration/ActivationProcess\"\r\nimport FileSaver from \"file-saver\"\r\nimport FormatTimestampFileName from \"../../formatters/FormatTimestampFileName\"\r\nimport DeviceSelection from \"./DeviceSelection\"\r\nimport { ValidZipCode } from \"../../formatters/FormatZipCode\"\r\nimport LocationImport from \"./LocationImport\"\r\nimport AdditionalTesting from \"./CompanyInformation/AdditionalTesting\"\r\nimport { WorkforceReloadPortalsCompanies } from \"../../actions/WorkforceClinicAction\"\r\nimport { Action } from \"redux\"\r\n\r\n\r\nexport type CompanyInformationRouteParams = { name?: string, companyName?: string }\r\n\r\nexport interface CompanyInformationProps extends RouteComponentProps<CompanyInformationRouteParams> {\r\n  portalMode?: boolean\r\n  isNew?: boolean\r\n}\r\n\r\ninterface CompanyInformationAuthProps {\r\n  companyName?: string\r\n  portalName?: string\r\n  portal?: WorkforceClinicPortal\r\n  isCompanyAdmin?: boolean\r\n  isPortalAdmin?: boolean\r\n  isSiteAdmin?: boolean\r\n  userAccess?: UserAccessSettings\r\n  userName?: string\r\n}\r\n\r\ninterface CompanyInformationDispatchProps {\r\n  reload: () => void\r\n}\r\n\r\ninterface CompanyInformationData {\r\n  name: string\r\n  code: string\r\n  streetAddress1: string\r\n  streetAddress2: string\r\n  city: string\r\n  state: string\r\n  zip: string\r\n  province?: string\r\n  country?: string\r\n  timeZoneID: number\r\n  webSiteURL?: string\r\n  fax: string\r\n  officePhone: string\r\n  contactDerPhone: string\r\n  contactDerFirstName: string\r\n  contactDerLastName: string\r\n  contactPhone: string\r\n  contactFirstName: string\r\n  contactLastName: string\r\n  businessTypeId?: number\r\n  portalAdminRoleID: number | string\r\n  primaryIDType: number\r\n  companyData?: CompanyData\r\n  labAcctRequired: boolean\r\n  inactive: boolean\r\n}\r\n\r\ninterface PortalInformationData {\r\n  implementationID?: number\r\n  name: string\r\n  code: string\r\n  streetAddress1: string\r\n  streetAddress2: string\r\n  city: string\r\n  state: string\r\n  zip: string\r\n  officePhone: string\r\n  isTPA?: boolean\r\n  subscriptionPlanID: number\r\n  subscriptionPlan?: SubscriptionPlan\r\n  implementationType: string\r\n  portalData?: PortalData\r\n  portalAdminData?: PortalAdminData\r\n  url: string\r\n  mroFileContent?: string\r\n  inactive: boolean\r\n  unmaskDonorID: number\r\n}\r\n\r\ntype InformationData = CompanyInformationData & PortalInformationData\r\ninterface CompanyInformationState extends InformationData {\r\n  implementationID?: number\r\n  showInactivateConfirmation: boolean\r\n  showOrderSecurityOverride: boolean\r\n  showSubscriptions: boolean\r\n  showManageImages: boolean\r\n  formValidated: boolean\r\n  businessTypesLoading: boolean\r\n  businessTypes: BusinessType[]\r\n  loading: boolean\r\n  labAccountsLoading: boolean\r\n  inactivating: boolean\r\n  activating: boolean\r\n  saving: boolean\r\n  rolesLoading: boolean\r\n  roles?: Role[]\r\n  primaryIDTypesLoading: boolean\r\n  primaryIDTypes?: PrimaryIDType[]\r\n  statesLoading: boolean\r\n  states: State[]\r\n  subscriptionPlansLoading: boolean\r\n  subscriptionPlans: SubscriptionPlan[]\r\n  retrievedCompanies?: CompanyData[]\r\n  retrievedPortals?: PortalData[]\r\n  retrievedPortalPredictions?: string[]\r\n  showOrderSecurity: boolean\r\n  showLabAccountSelection: boolean\r\n  showDevices: boolean\r\n  showCompanyImport: boolean\r\n  showLocationImport: boolean\r\n  selectedCompany?: string\r\n  allCompanies: AutoFilterCompany[]\r\n  companies: string[]\r\n  timeZones?: TimeZoneData[]\r\n  timeZonesLoading: boolean\r\n  mroFileName: string\r\n  isPortalFieldsValid: boolean\r\n  isNameValid: boolean\r\n  isStreetAddress1Valid: boolean\r\n  isCityValid: boolean\r\n  isStateValid: boolean\r\n  isZipValid: boolean\r\n  isPhoneValid: boolean\r\n  isBusinessTypeValid: boolean\r\n  isPrimaryIDTypeValid: boolean\r\n  activeLabAccountsCount: number\r\n  showLocation: boolean,\r\n  showAdditionalTesting: boolean,\r\n  urlValid: boolean,\r\n  urlChecking: boolean\r\n  urlAvailable?: boolean\r\n  urlCheckMessage?: string\r\n  isNameChecking: boolean\r\n  isNameAvailable?: boolean\r\n  isNameLengthValid: boolean\r\n  isNameTextValid: boolean\r\n  isCodeValid: boolean\r\n  isCodeChecking: boolean\r\n  isCodeAvailable?: boolean\r\n  isMROFileSizeValid: boolean,\r\n  saved: boolean\r\n  showNewCompanyModal: boolean\r\n  loadingCsv: boolean\r\n}\r\n\r\nenum ImplementationType {\r\n  EMBEDDED = \"EMBEDDED\",\r\n  ServiceIndustry = \"Service Industry\",\r\n  Employer = \"Employer\",\r\n  OneSource = \"OneSource\",\r\n  MRO = \"MRO\",\r\n  NonTPA = \"NonTPA\",\r\n  GOVT = \"GOVT\",\r\n  TPA = \"TPA\",\r\n  ACCIO = \"ACCIO\"\r\n}\r\n\r\ntype T_ImplementationType = keyof typeof ImplementationType\r\nconst ImplementationTypes = (Object.keys(ImplementationType) as T_ImplementationType[])\r\n\r\n\r\ninterface NameData {\r\n  value: string\r\n  implementationID?: number\r\n}\r\n\r\nexport class CompanyInformation extends React.PureComponent<CompanyInformationProps & CompanyInformationAuthProps & CompanyInformationDispatchProps, CompanyInformationState> {\r\n  emptyData: InformationData = {\r\n    name: \"\",\r\n    code: \"\",\r\n    streetAddress1: \"\",\r\n    streetAddress2: \"\",\r\n    city: \"\",\r\n    state: \"\",\r\n    zip: \"\",\r\n    officePhone: \"\",\r\n    contactDerPhone: \"\",\r\n    contactDerFirstName: \"\",\r\n    contactDerLastName: \"\",\r\n    contactPhone: \"\",\r\n    contactFirstName: \"\",\r\n    contactLastName: \"\",\r\n    businessTypeId: undefined,\r\n    portalAdminRoleID: \"\",\r\n    primaryIDType: 0,\r\n    companyData: undefined,\r\n    isTPA: undefined,\r\n    subscriptionPlanID: 0,\r\n    subscriptionPlan: undefined,\r\n    implementationType: ImplementationType.NonTPA,\r\n    portalData: undefined,\r\n    timeZoneID: 0,\r\n    fax: \"\",\r\n    portalAdminData: undefined,\r\n    labAcctRequired: true,\r\n    url: \"\",\r\n    inactive: false,\r\n    unmaskDonorID:0,\r\n  }\r\n  emptyState: CompanyInformationState = {\r\n    ...this.emptyData,\r\n    showInactivateConfirmation: false,\r\n    showOrderSecurityOverride: false,\r\n    showSubscriptions: false,\r\n    showManageImages: false,\r\n    formValidated: false,\r\n    businessTypesLoading: false,\r\n    businessTypes: [],\r\n    loading: false,\r\n    labAccountsLoading: false,\r\n    inactivating: false,\r\n    activating: false,\r\n    saving: false,\r\n    rolesLoading: false,\r\n    primaryIDTypesLoading: false,\r\n    statesLoading: false,\r\n    states: [],\r\n    subscriptionPlansLoading: false,\r\n    subscriptionPlans: [],\r\n    retrievedCompanies: undefined,\r\n    showOrderSecurity: false,\r\n    showLabAccountSelection: false,\r\n    showDevices: false,\r\n    showCompanyImport: false,\r\n    showLocationImport: false,\r\n    selectedCompany: this.props.match.params.companyName,\r\n    companies: [],\r\n    allCompanies: [],\r\n    timeZonesLoading: false,\r\n    activeLabAccountsCount: 0,\r\n    showLocation: false,\r\n    showAdditionalTesting: false,\r\n    isNameValid: true,\r\n    isStreetAddress1Valid: true,\r\n    isPortalFieldsValid: false,\r\n    isCityValid: true,\r\n    isStateValid: true,\r\n    isZipValid: true,\r\n    isPhoneValid: true,\r\n    isBusinessTypeValid: true,\r\n    isPrimaryIDTypeValid: true,\r\n    urlValid: true,\r\n    urlChecking: false,\r\n    isNameChecking: false,\r\n    isNameLengthValid: true,\r\n    isNameTextValid: true,\r\n    isCodeChecking: false,\r\n    isCodeValid: true,\r\n    mroFileName: \"\",\r\n    isMROFileSizeValid: true,\r\n    saved: false,\r\n    showNewCompanyModal: false,\r\n    loadingCsv: false\r\n  }\r\n  state: CompanyInformationState = { ...this.emptyState }\r\n\r\n  searchPortalsSubscription?: Subscription\r\n  searchCompaniesSubscription?: Subscription\r\n  searchPortalsInitialSubscription?: Subscription\r\n  loadSubscription?: Subscription\r\n  saveSubscription?: Subscription\r\n  inactivateSubscription?: Subscription\r\n  businessTypesSubscription?: Subscription\r\n  userRolesSubscription?: Subscription\r\n  primaryIDTypesSubscription?: Subscription\r\n  statesSubscription?: Subscription\r\n  subscriptionPlansSubscription?: Subscription\r\n  loadCompaniesSubscription?: Subscription\r\n  timeZoneSubscription?: Subscription\r\n  loadLabAccountsSubscription?: Subscription\r\n  urlExistsSubscription?: Subscription\r\n  nameExistsSubscription?: Subscription\r\n  codeExistsSubscription?: Subscription\r\n\r\n  companyName$ = new Subject<string>()\r\n  implementationName$ = new Subject<string>()\r\n  searchImplementation$ = new Subject<string>()\r\n  searchCompany$ = new Subject<string>()\r\n  checkUrl$ = new Subject<string>()\r\n  checkName$ = new Subject<NameData>()\r\n  checkCode$ = new Subject<string>()\r\n\r\n  typeahead = React.createRef<AsyncTypeahead<string>>()\r\n  mroFile = React.createRef<HTMLInputElement>()\r\n\r\n  implementationName?: string = this.props.match.params.name\r\n  companyName?: string = this.props.match.params.companyName\r\n\r\n  componentDidMount() {\r\n    this.load()\r\n  }\r\n\r\n  componentDidUpdate(prevProps: CompanyInformationProps, prevState: CompanyInformationState) {\r\n    if (prevProps.match.params.name !== this.props.match.params.name) {\r\n      this.load()\r\n    }\r\n    if (!this.props.portalMode) {\r\n      if (this.state.companyData && !prevState.companyData) {\r\n        this.loadLabAccounts()\r\n      }\r\n    }\r\n  }\r\n\r\n  componentWillUnmount() {\r\n    this.searchPortalsSubscription && this.searchPortalsSubscription.unsubscribe()\r\n    this.searchCompaniesSubscription && this.searchCompaniesSubscription.unsubscribe()\r\n    this.searchPortalsInitialSubscription && this.searchPortalsInitialSubscription.unsubscribe()\r\n    this.loadSubscription && this.loadSubscription.unsubscribe()\r\n    this.saveSubscription && this.saveSubscription.unsubscribe()\r\n    this.loadCompaniesSubscription && this.loadCompaniesSubscription.unsubscribe()\r\n    this.inactivateSubscription && this.inactivateSubscription.unsubscribe()\r\n    this.businessTypesSubscription && this.businessTypesSubscription.unsubscribe()\r\n    this.primaryIDTypesSubscription && this.primaryIDTypesSubscription.unsubscribe()\r\n    this.statesSubscription && this.statesSubscription.unsubscribe()\r\n    this.subscriptionPlansSubscription && this.subscriptionPlansSubscription.unsubscribe()\r\n    this.timeZoneSubscription && this.timeZoneSubscription.unsubscribe()\r\n    this.loadLabAccountsSubscription && this.loadLabAccountsSubscription.unsubscribe()\r\n    this.urlExistsSubscription && this.urlExistsSubscription.unsubscribe()\r\n    this.nameExistsSubscription && this.nameExistsSubscription.unsubscribe()\r\n    this.codeExistsSubscription && this.codeExistsSubscription.unsubscribe()\r\n  }\r\n\r\n  load = () => {\r\n    this.setState({ statesLoading: true })\r\n    this.statesSubscription = StateObservable().subscribe(\r\n      (results: State[]) => this.setState(prevState => ({\r\n        states: results,\r\n        statesLoading: false,\r\n        state: prevState.companyData ? this.mapState(prevState.companyData, results) : prevState.state\r\n      })),\r\n      () => { this.setState({ statesLoading: false }) }\r\n    )\r\n\r\n    if (this.props.portalMode) {\r\n      if (this.props.isSiteAdmin) {\r\n        this.setState({ subscriptionPlansLoading: true })\r\n        this.subscriptionPlansSubscription = GetSubscriptionPlans().subscribe(\r\n          (results: SubscriptionPlan[]) => this.setState(prevState => ({\r\n            subscriptionPlans: results,\r\n            subscriptionPlansLoading: false,\r\n            subscriptionPlan: prevState.portalData ? this.mapSubscriptionPlan(prevState.portalData, results) : undefined\r\n          })),\r\n          () => { this.setState({ subscriptionPlansLoading: false }) }\r\n        )\r\n      }\r\n\r\n      this.searchPortalsSubscription = this.searchImplementation$.pipe(\r\n        debounceTime(500),\r\n        switchMap(name => concat(\r\n          of({ loading: true }),\r\n          AutoFilterPortalsGetObservable(name).pipe(\r\n            map(result => ({ loading: false, result: result })),\r\n            catchError(() => of({ loading: false }))\r\n          )\r\n        ))\r\n      ).subscribe(\r\n        (o: { loading: boolean, result?: string[] }) => this.setState({ loading: o.loading, retrievedPortalPredictions: o.result }),\r\n        (error) => this.handleAPIError(error, { loading: false, userInfo: undefined })\r\n      )\r\n\r\n      this.loadSubscription = this.implementationName$.pipe(\r\n        map(name => name.trim()),\r\n        switchMap(name => concat(\r\n          of({ loading: true }),\r\n          PortalsGetObservable(name, true).pipe(\r\n            map(result => ({ loading: false, result: result })),\r\n            catchError(() => of({ loading: false }))\r\n          )\r\n        ))\r\n      ).subscribe(\r\n        (o: { loading: boolean, result?: PortalData[] }) => this.setState({\r\n          loading: o.loading,\r\n          retrievedPortals: o.result && o.result.length > 1 ? o.result : undefined,\r\n          ...this.mapPortalData(o.result)\r\n        }),\r\n        (error) => this.handleAPIError(error, { loading: false, userInfo: undefined })\r\n      )\r\n      if (!this.props.isSiteAdmin && this.props.portalName) {\r\n        this.implementationName$.next(this.props.portalName)\r\n      } else if (this.implementationName) {\r\n        this.implementationName$.next(this.implementationName)\r\n      }\r\n\r\n      this.urlExistsSubscription = this.checkUrl$.pipe(\r\n        map(name => `${name.trim()}.${SiteDomain}`),\r\n        filter(name => this.isUrlValid(name)),\r\n        switchMap(name => concat(\r\n          of({ loading: true }),\r\n          UrlCheck(name).pipe(\r\n            map(result => ({ loading: false, result: true, message: result })),\r\n            catchError((error) =>\r\n              of({ loading: false, result: false, message: error?.errorData?.message || error.message })\r\n            )\r\n          )\r\n        ))\r\n      ).subscribe(\r\n        (o: { loading: boolean, result?: boolean, message?: string }) => this.setState({ urlChecking: o.loading, urlAvailable: o.result, urlCheckMessage: o.message }),\r\n        (error) => this.handleAPIError(error, { urlChecking: false, urlAvailable: undefined, urlCheckMessage: undefined })\r\n      )\r\n    } else {\r\n      this.setState({ rolesLoading: true, primaryIDTypesLoading: true, businessTypesLoading: true, timeZonesLoading: true })\r\n      this.businessTypesSubscription = BusinessTypesGet().subscribe(\r\n        (data) => this.setState({ businessTypes: data, businessTypesLoading: false }),\r\n        (error) => this.handleAPIError(error, { businessTypesLoading: false })\r\n      )\r\n      this.userRolesSubscription = UserRolesGet().subscribe(\r\n        (data: Role[]) => this.setState(prevState => ({\r\n          roles: data,\r\n          rolesLoading: false,\r\n          portalAdminRoleID: prevState.companyData ? this.mapRole(prevState.companyData, data) || 0 : prevState.portalAdminRoleID\r\n        })),\r\n        (error) => this.handleAPIError(error, { rolesLoading: false })\r\n      )\r\n      this.primaryIDTypesSubscription = PrimaryIDTypesGet().subscribe(\r\n        (data: PrimaryIDType[]) => this.setState(prevState => ({\r\n          primaryIDTypes: data,\r\n          primaryIDTypesLoading: false,\r\n          primaryIDType: prevState.companyData ? this.mapPrimaryIDType(prevState.companyData, data) || 0 : prevState.primaryIDType\r\n        })),\r\n        (error) => this.handleAPIError(error, { primaryIDTypesLoading: false })\r\n      )\r\n\r\n      this.timeZoneSubscription = TimeZoneListGet().subscribe(\r\n        (data: TimeZoneData[]) => this.setState({ timeZones: data, timeZonesLoading: false }),\r\n        (error) => this.handleAPIError(error, { timeZonesLoading: false })\r\n      )\r\n\r\n      this.searchCompaniesSubscription = this.searchCompany$.pipe(\r\n        debounceTime(500),\r\n        switchMap(name => concat(\r\n          of({ loading: true }),\r\n          GetAccountsByNameObservable(name, true).pipe(\r\n            map(result => ({ loading: false, result: result })),\r\n            catchError(() => of({ loading: false }))\r\n          )\r\n        ))\r\n      ).subscribe(\r\n        (o: { loading: boolean, result?: AutoFilterCompany[] }) => this.setState({ loading: o.loading, allCompanies: o.result || [], companies: o.result?.map(c => c.Name).filter((v, i, a) => a.indexOf(v) === i) || [] }),\r\n        (error) => this.handleAPIError(error, { loading: false, companies: [], allCompanies: [] })\r\n      )\r\n\r\n      this.loadSubscription = this.companyName$.pipe(\r\n        map(name => name.trim()),\r\n        switchMap(name => concat(\r\n          of({ loading: true }),\r\n          CompaniesGet(name, this.state.allCompanies.find(c => c.Name === name)?.Inactive || false).pipe(\r\n            map(result => ({ loading: false, result: result })),\r\n            catchError((error) => of({ loading: false, error: error }))\r\n          )\r\n        ))\r\n      ).subscribe(\r\n        (o: { loading: boolean, result?: CompanyData[], error?: Error | APIError }) => {\r\n          if (o.error) this.handleAPIError(o.error, {})\r\n          this.setState({\r\n            loading: o.loading,\r\n            retrievedCompanies: o.result && o.result.length > 1 ? o.result : undefined,\r\n            isNameAvailable: true, isCodeChecking: false, isCodeValid: true, isCodeAvailable: undefined,\r\n            ...this.mapCompanyData(o.result)\r\n          })\r\n        },\r\n        (error) => this.handleAPIError(error, { loading: false, userInfo: undefined })\r\n      )\r\n\r\n      this.nameExistsSubscription = this.checkName$.pipe(\r\n        map(data => { return {value: data.value.trim(), implementationID: data.implementationID} } ),\r\n        filter(data => this.isCompanyNameValid(data.value)),\r\n        switchMap(data => concat(\r\n          of({ loading: true }),\r\n          CompanyNameCheck(data.value, undefined, true, data.implementationID).pipe(\r\n            map(result => ({ loading: false, result: result })),\r\n            catchError(() => of({ loading: false }))\r\n          )\r\n        ))\r\n      ).subscribe(\r\n        (o: { loading: boolean, result?: Addresses | null }) => this.setState({\r\n          isNameChecking: o.loading,\r\n          isNameAvailable: !o.result || o.result?.ParentID === this.state.companyData?.AccountID\r\n        }),\r\n        (error) => this.handleAPIError(error, { nameChecking: false, nameAvailable: undefined })\r\n      )\r\n\r\n      this.codeExistsSubscription = this.checkCode$.pipe(\r\n        map(code => code),\r\n        filter(code => code.trim().length > 0 && this.isCodeValid(code)),\r\n        switchMap(code => concat(\r\n          of({ loading: true }),\r\n          CompanyCodeCheck(code).pipe(\r\n            map(result => ({ loading: false, result: result })),\r\n            catchError(() => of({ loading: false }))\r\n          )\r\n        ))\r\n      ).subscribe(\r\n        (o: { loading: boolean, result?: string }) => this.setState({ isCodeChecking: o.loading, isCodeAvailable: !o.result }),\r\n        (error) => this.handleAPIError(error, { codeChecking: false, codeAvailable: undefined })\r\n      )\r\n\r\n      this.loadSubscription = this.implementationName$.pipe(\r\n        map(name => name.trim()),\r\n        switchMap(name => concat(\r\n          of({ loading: true }),\r\n          PortalsGetObservable(name).pipe(\r\n            map(result => ({ loading: false, result: result })),\r\n            catchError(() => of({ loading: false }))\r\n          )\r\n        ))\r\n      ).subscribe(\r\n        (o: { loading: boolean, result?: PortalData[] }) => this.setState({\r\n            loading: o.loading\r\n          }, () => {\r\n              if (o.result && o.result.length > 0 ) {\r\n                const data = o.result[0]\r\n                this.setState({ portalData: { ...data, IsOnTrack: data?.ImplementationType === ImplementationTypeGovt }})\r\n              }\r\n          }),\r\n        (error) => this.handleAPIError(error, { loading: false, userInfo: undefined })\r\n      )\r\n\r\n      if (!this.isSiteAdminOrPortalAdmin() && this.props.companyName) {\r\n        this.companyName$.next(this.props.companyName)\r\n      } else if (this.implementationName) {\r\n        this.implementationName$.next(this.implementationName)\r\n      } else if (this.companyName) {\r\n        this.setState({companies: [this.companyName], selectedCompany: this.companyName, showNewCompanyModal: true})\r\n        this.companyName$.next(this.companyName)\r\n      }\r\n    }\r\n  }\r\n\r\n  isSiteAdminOrPortalAdmin = (): boolean => !!this.props.isPortalAdmin || !!this.props.isSiteAdmin\r\n  isDisabled = () => {\r\n    const { portalMode, isNew } = this.props\r\n    const { portalData, retrievedPortals, companyData, retrievedCompanies } = this.state\r\n    return portalMode\r\n      ? !(isNew && portalMode) && (!portalData || !!retrievedPortals)\r\n      : !isNew && (!companyData || !!retrievedCompanies)\r\n  }\r\n  isFormValid = () => {\r\n    const {\r\n      name, isNameValid, isNameAvailable,\r\n      code, isCodeValid, isCodeAvailable,\r\n      streetAddress1, isStreetAddress1Valid,\r\n      city, isCityValid,\r\n      state, isStateValid,\r\n      zip, isZipValid,\r\n      officePhone, isPhoneValid,\r\n      fax,\r\n      businessTypeId, isBusinessTypeValid,\r\n      primaryIDType, isPrimaryIDTypeValid,\r\n      isPortalFieldsValid,\r\n      subscriptionPlanID,\r\n      urlAvailable,\r\n      contactPhone, contactFirstName, contactLastName,\r\n      contactDerPhone, contactDerFirstName, contactDerLastName,\r\n      activeLabAccountsCount, labAcctRequired,\r\n      companyData, portalData,\r\n      isMROFileSizeValid\r\n    } = this.state\r\n    const { portalMode, isNew, isCompanyAdmin, isPortalAdmin, isSiteAdmin } = this.props\r\n    const commonFormValid =\r\n      !!streetAddress1 && isStreetAddress1Valid &&\r\n      !!city && isCityValid &&\r\n      !!state && isStateValid &&\r\n      !!zip && isZipValid &&\r\n      !!officePhone && isPhoneValid\r\n    const disableCodeEdit = (!!companyData?.Code && companyData?.Code.length > 0) || (!isPortalAdmin && !isSiteAdmin)\r\n\r\n    let valid = false\r\n    if (isCompanyAdmin) { // edit company\r\n      valid = !!name && isNameValid && isNameAvailable === true  &&\r\n      !!contactFirstName && !!contactLastName && !!contactPhone && this.isPhoneValid(contactPhone) &&\r\n      !!contactDerFirstName && !!contactDerLastName && !!contactDerPhone && this.isPhoneValid(contactDerPhone) &&\r\n      !!primaryIDType && isPrimaryIDTypeValid &&\r\n      (activeLabAccountsCount > 0 || !labAcctRequired) &&\r\n      (!fax || this.isPhoneValid(fax))\r\n    } else if (isPortalAdmin) {\r\n      if (portalMode) { // edit portal\r\n        valid = !!name && isNameValid &&\r\n        subscriptionPlanID > 0 &&\r\n        isMROFileSizeValid\r\n      } else {\r\n        if (isNew) { // create company\r\n          valid = !!name && isNameValid && isNameAvailable === true &&\r\n          (!code || (code.length > 0 && isCodeValid && isCodeAvailable === true)) &&\r\n          !!contactFirstName && !!contactLastName && !!contactPhone && this.isPhoneValid(contactPhone) &&\r\n          !!contactDerFirstName && !!contactDerLastName && !!contactDerPhone && this.isPhoneValid(contactDerPhone) &&\r\n          (portalData?.IsOnTrack || !!businessTypeId && isBusinessTypeValid)\r\n        } else { // edit company\r\n          valid = !!name && isNameValid && isNameAvailable === true &&\r\n          (!code || disableCodeEdit || (code.length > 0 && isCodeValid && isCodeAvailable === true)) &&\r\n          !!contactFirstName && !!contactLastName && !!contactPhone && this.isPhoneValid(contactPhone) &&\r\n          !!contactDerFirstName && !!contactDerLastName && !!contactDerPhone && this.isPhoneValid(contactDerPhone) &&\r\n          (activeLabAccountsCount > 0 || !labAcctRequired)\r\n        }\r\n      }\r\n    } else if (isSiteAdmin) {\r\n      if (portalMode) {\r\n        if (isNew) { // create portal\r\n          valid = isPortalFieldsValid &&\r\n          subscriptionPlanID > 0 &&\r\n          urlAvailable === true &&\r\n          isMROFileSizeValid\r\n        } else { // edit portal\r\n          valid = !!name && isNameValid &&\r\n          subscriptionPlanID > 0 &&\r\n          isMROFileSizeValid\r\n        }\r\n      } else {\r\n        if (isNew) { // create company\r\n          valid = !!name && isNameValid && isNameAvailable === true &&\r\n          (!code || (code.length > 0 && isCodeValid && isCodeAvailable === true)) &&\r\n          (portalData?.IsOnTrack || !!businessTypeId && isBusinessTypeValid)\r\n        } else { // edit company\r\n          valid = (activeLabAccountsCount > 0 || !labAcctRequired) &&\r\n          (!code || disableCodeEdit || (code.length > 0 && isCodeValid && isCodeAvailable === true))\r\n        }\r\n      }\r\n    }\r\n\r\n    return commonFormValid && valid\r\n  }\r\n  isNameValid = (value: string) => this.isDisabled() || (this.props.isNew && this.props.portalMode || value.trim().length > 4)\r\n  isStreetAddress1Valid = (value: string) => this.isDisabled() || !!value.length\r\n  isCityValid = (value: string) => this.isDisabled() || !!value.length\r\n  isStateValid = (value: string) => this.isDisabled() || !!value.length\r\n  isZipValid = (value: string) => this.isDisabled() || (!!value.length && ValidZipCode(value))\r\n  isPhoneValid = (value: string) => this.isDisabled() || (!!value.length && (value.replace(/\\D/g, \"\").length === 10 || PhoneRegexp.test(value)))\r\n  isBusinessTypeValid = (value?: number) => this.isDisabled() || !!value || !this.state.companyData?.IsOnTrack\r\n  isPrimaryIDTypeValid = (value: number) => this.isDisabled() || !isCompanyAdmin || value > 0\r\n\r\n  isUrlAllowed = (value: string) => !ProtectedSites.includes(value)\r\n  isUrlMaxLengthValid = (value: string) => value.trim().length <= 56\r\n  isUrlValid = (value: string) => value.trim().length > 0 && this.isUrlMaxLengthValid(value)\r\n\r\n  prepareUrl = (value: string) => value.replace(/[^a-zA-Z0-9_-]/g, \"\").toLowerCase()\r\n  changeUrlStatePart = (url: string) => ({ url: url, urlValid: this.isUrlValid(url), urlAvailable: undefined, urlCheckMessage: undefined })\r\n\r\n  isCompanyNameValid = (value: string) => {\r\n    return this.isNameLengthValid(value) && this.isNameTextValid(value)\r\n  }\r\n  isNameTextValid = (value: string) => {\r\n    const regexp = new RegExp(CompanyNameRegexp);\r\n    return regexp.test(value)\r\n  }\r\n  isNameLengthValid = (value: string) => {\r\n    const len = value.trim().length\r\n    return len >= 3 && len <= 32\r\n  }\r\n  isCodeValid = (value: string) => /^[a-zA-Z0-9]*$/.test(value) && value.trim().length <= 10\r\n\r\n  mapCompanyData = (data?: CompanyData[]): CompanyInformationData => {\r\n    if (!data || data.length !== 1) {\r\n      return { ...this.emptyData, name: this.state.name }\r\n    }\r\n    const info = data[0]\r\n    return {\r\n      name: info.Name,\r\n      code: info.Code,\r\n      streetAddress1: info.Address1 || \"\",\r\n      streetAddress2: info.Address2 || \"\",\r\n      city: info.City || \"\",\r\n      state: this.mapState(info, this.state.states),\r\n      zip: info.Zip || \"\",\r\n      province: info.Province,\r\n      country: info.Country,\r\n      timeZoneID: info.TimeZoneID,\r\n      webSiteURL: info.WebsiteURL,\r\n      fax: info.Fax || \"\",\r\n      officePhone: info.Phone || \"\",\r\n      contactDerPhone: info.ContactDerPhone || \"\",\r\n      contactDerFirstName: info.ContactDerFirstName || \"\",\r\n      contactDerLastName: info.ContactDerLastName || \"\",\r\n      contactPhone: info.ContactPhone || \"\",\r\n      contactFirstName: info.ContactFirstName || \"\",\r\n      contactLastName: info.ContactLastName || \"\",\r\n      businessTypeId: info.BusinessTypeID,\r\n      portalAdminRoleID: this.state.roles ? this.mapRole(info, this.state.roles) || 0 : 0,\r\n      primaryIDType: this.state.primaryIDTypes ? this.mapPrimaryIDType(info, this.state.primaryIDTypes) || 0 : 0,\r\n      companyData: data[0],\r\n      labAcctRequired: info.LabAcctRequired,\r\n      inactive: info.Inactive\r\n    }\r\n  }\r\n\r\n  mapPortalData = (data?: PortalData[]): PortalInformationData => {\r\n    if (!data || data.length !== 1) {\r\n      return { ...this.emptyData }\r\n    }\r\n    const info = data[0]\r\n    return {\r\n      implementationID: info.ImplementationID,\r\n      name: info.CompanyName || \"\",\r\n      code: \"\",\r\n      streetAddress1: info.Address1 || \"\",\r\n      streetAddress2: info.Address2 || \"\",\r\n      city: info.City || \"\",\r\n      state: this.mapState(info, this.state.states),\r\n      zip: info.Zip || \"\",\r\n      officePhone: info.Phone || \"\",\r\n      isTPA: info.ImplementationType === ImplementationType.TPA,\r\n      subscriptionPlanID: info.SubscriptionPlanID,\r\n      subscriptionPlan: this.state.subscriptionPlans ? this.mapSubscriptionPlan(info, this.state.subscriptionPlans) : undefined,\r\n      implementationType: info.ImplementationType || ImplementationType.NonTPA,\r\n      portalData: { ...data[0], IsOnTrack: location.host.includes(\"ontrack\") },\r\n      url: info.SubDomain || \"\",\r\n      inactive: info.InActive,\r\n      unmaskDonorID: info.UnmaskDonorID\r\n    }\r\n  }\r\n\r\n  mapRole = (info: CompanyData, roles: Role[]): number | undefined => roles.find(item => item.RoleID === info.PortalAdditionalRoleID)?.RoleID\r\n  mapPrimaryIDType = (info: CompanyData, types: PrimaryIDType[]): number | undefined => types.find(item => item.PrimaryIDType === info.PrimaryIDType)?.PrimaryTypeID\r\n  mapState = (info: CompanyData | PortalData, states: State[]): string => states.find(item => item.StateProvinceTerritoryID === info.StateProvinceTerritoryID)?.Abbreviation || info.State || \"\"\r\n  mapSubscriptionPlan = (info: PortalData, plans: SubscriptionPlan[]): SubscriptionPlan | undefined => plans.find(item => item.SubscriptionPlanID === info.SubscriptionPlanID)\r\n\r\n  handleAPIError = (error: Error | APIError, stateChanges: object) => {\r\n    this.setState(stateChanges)\r\n    error && toast.error((error as APIError)?.errorData?.message || error.message)\r\n  }\r\n\r\n  handleAddressSelect = (address: Address | string | undefined) => {\r\n    if (address) {\r\n      if (typeof address === 'string') {\r\n        this.setState({ streetAddress1: address, isStreetAddress1Valid: this.isStreetAddress1Valid(address) })\r\n      } else if (address as Address) {\r\n        const street = address.StreetLine || \"\"\r\n        const state = address.State || \"\"\r\n        const city = address.City || \"\"\r\n        this.setState({\r\n          streetAddress1: street, isStreetAddress1Valid: this.isStreetAddress1Valid(street),\r\n          state: state, isStateValid: this.isStateValid(state),\r\n          city: city, isCityValid: this.isCityValid(city)\r\n        })\r\n      }\r\n    } else {\r\n      this.setState({ streetAddress1: \"\", isStreetAddress1Valid: false })\r\n    }\r\n  }\r\n\r\n  handlePortalNameChange = (e: React.ChangeEvent<HTMLInputElement>) => {\r\n    if (!this.props.portalMode && this.isSiteAdminOrPortalAdmin()) {\r\n      this.setState({ ...this.emptyData, name: e.target.value, isNameValid: this.isNameValid(e.target.value) })\r\n    } else {\r\n      this.setState({ name: e.target.value, isNameValid: this.isCompanyNameValid(e.target.value) })\r\n    }\r\n  }\r\n\r\n  handleCompanyChange = (items: string[]) => {\r\n    const selectedCompany = items[0]\r\n    if (selectedCompany) {\r\n      this.setState({ selectedCompany: selectedCompany })\r\n      this.companyName$.next(selectedCompany)\r\n    }\r\n    else {\r\n      this.setState({ selectedCompany: undefined })\r\n    }\r\n  }\r\n\r\n  handleCompanyNameTyping = (company: string) => {\r\n    if (company == \"\") {\r\n      this.setState({ ...this.mapCompanyData(), selectedCompany: undefined, companies: [], allCompanies: [] })\r\n    }\r\n    else {\r\n      this.setState({ name: company })\r\n      this.searchCompany$.next(company)\r\n    }\r\n  }\r\n\r\n  handlePortalNameTyping = (name: string) => {\r\n    if (name == \"\") {\r\n      this.setState({ ...this.mapPortalData(), retrievedPortalPredictions: [] })\r\n    }\r\n    else {\r\n      this.searchImplementation$.next(name)\r\n    }\r\n  }\r\n\r\n  handleRetrievedCompanyAddressSelect = () => this.setState({\r\n    retrievedCompanies: undefined,\r\n    ...this.mapCompanyData(this.state.companyData ? [this.state.companyData] : undefined)\r\n  })\r\n\r\n  handleRetrievedPortalAddressSelect = () => this.setState({\r\n    retrievedPortals: undefined,\r\n    ...this.mapPortalData(this.state.portalData ? [this.state.portalData] : undefined)\r\n  })\r\n\r\n  performInactivate = () => {\r\n    this.setState({ inactivating: true, showInactivateConfirmation: false })\r\n    this.inactivateSubscription && this.inactivateSubscription.unsubscribe()\r\n    this.inactivateSubscription = (\r\n      this.props.portalMode\r\n        ? PortalInactivateObservable(this.state.portalData?.ImplementationID || 0)\r\n        : CompanyInactivate(this.state.companyData?.ImplementationID || 0, this.state.companyData?.AccountID || 0)\r\n    ).subscribe(\r\n      data => {\r\n        this.setState({ inactivating: false })\r\n        toast.success(data)\r\n      },\r\n      error => this.handleAPIError(error, { inactivating: false })\r\n    )\r\n  }\r\n\r\n  performActivate = () => {\r\n    this.setState({ activating: true })\r\n    this.inactivateSubscription && this.inactivateSubscription.unsubscribe()\r\n    this.inactivateSubscription = (\r\n      this.props.portalMode\r\n        ? PortalActivationObservable(this.state.portalData?.ImplementationID || 0)\r\n        : CompanyActivationObservable(this.state.companyData?.ImplementationID || 0, this.state.companyData?.AccountID || 0)\r\n    ).subscribe(\r\n      data => {\r\n        this.setState({ activating: false })\r\n        toast.success(data)\r\n      },\r\n      error => this.handleAPIError(error, { activating: false })\r\n    )\r\n  }\r\n\r\n  handleRetrievedObjectChoose = (selected: AddressData) => {\r\n    if (this.props.portalMode) {\r\n      this.setState({ portalData: this.state.retrievedPortals?.find(item => item.ImplementationID.toString() === selected.ID) })\r\n    } else {\r\n      this.setState({ companyData: this.state.retrievedCompanies?.find(item => item.AccountID.toString() === selected.ID) })\r\n    }\r\n  }\r\n\r\n  handleCancel = () => {\r\n    if (this.implementationName && this.props.portalMode) {\r\n      (this.props as RouteComponentProps).history?.push(PortalAdministrationRoute)\r\n    } else if (this.implementationName && !this.props.portalMode && this.props.isNew) {\r\n      (this.props as RouteComponentProps).history?.push(PortalDetailsRoute(this.implementationName))\r\n    } else if (!this.implementationName && !this.props.portalMode && this.props.isNew && !this.state.saved) {\r\n      (this.props as RouteComponentProps).history?.push(MyOrganizationRoute)\r\n    } else if (!this.implementationName && !this.props.portalMode && this.props.isNew && this.state.saved) {\r\n      (this.props as RouteComponentProps).history?.push(CompanyDetailsRoute(this.state.name))\r\n    } else {\r\n      (this.props as RouteComponentProps).history?.push(Home)\r\n    }\r\n  }\r\n\r\n  handleUpdate = () => {\r\n    this.props.portalMode && !this.props.isNew && this.updatePortal()\r\n    this.props.portalMode && this.props.isNew && this.createPortal()\r\n    !this.props.portalMode && this.updateCompany()\r\n  }\r\n\r\n  handlePortalFieldsValidation = (data: PortalAdminData, valid: boolean) => {\r\n    this.setState({ portalAdminData: data, isPortalFieldsValid: valid })\r\n  }\r\n\r\n  updateCompany = () => {\r\n    const { portalData, companyData, name, code, streetAddress1, streetAddress2, city, state, zip, officePhone, businessTypeId, roles, portalAdminRoleID, primaryIDType,\r\n      primaryIDTypes, contactDerPhone, contactDerFirstName, contactDerLastName, contactPhone, contactFirstName, contactLastName,\r\n      province, country, timeZoneID, webSiteURL, fax, labAcctRequired } = this.state\r\n    const { isPortalAdmin, isCompanyAdmin, isSiteAdmin, isNew } = this.props;\r\n\r\n    if (!companyData && !isNew) {\r\n      return\r\n    }\r\n    const codeValue = !code || code.length === 0 ? undefined : code.trim()\r\n\r\n    const updateData: CompanyEditData = {\r\n      AccountID: companyData?.AccountID || 0,\r\n      Name: name.trim(),\r\n      Code: codeValue,\r\n      Address1: streetAddress1,\r\n      Address2: streetAddress2,\r\n      City: city,\r\n      State: state,\r\n      Zip: zip,\r\n      Phone: officePhone.replace(/-/g, \"\"),\r\n      BusinessTypeID: businessTypeId!,\r\n      ImplementationID: companyData?.ImplementationID || portalData?.ImplementationID || this.state.implementationID || 0,\r\n      IsRandomization: !!companyData && companyData.IsRandomization,\r\n      Regulated: !!companyData && companyData.Regulated,\r\n      NonRegulated: !!companyData && companyData.NonRegulated,\r\n      PortalAdditionalRoleID: roles?.find(item => item.RoleID === portalAdminRoleID)?.RoleID || \"\",\r\n      PrimaryTypeID: primaryIDTypes?.find(item => item.PrimaryTypeID === primaryIDType)?.PrimaryIDType || \"\",\r\n      IsOnTrack: isNew ? (this.implementationName ? !!portalData?.IsOnTrack : IsOnTrack()) : companyData?.IsOnTrack || false,\r\n      ContactDerFirstName: contactDerFirstName,\r\n      ContactDerLastName: contactDerLastName,\r\n      ContactDerPhone: contactDerPhone.replace(/-/g, \"\"),\r\n      ContactFirstName: contactFirstName,\r\n      ContactLastName: contactLastName,\r\n      ContactPhone: contactPhone.replace(/-/g, \"\"),\r\n      UpdateAdditionalFields: this.showAdditionalFields(),\r\n      Province: province ? province : undefined,\r\n      Country: province ? country : undefined,\r\n      TimeZoneID: timeZoneID,\r\n      WebsiteURL: webSiteURL ? webSiteURL : undefined,\r\n      Fax: fax ? fax : undefined,\r\n      LabAcctRequired: isNew ? false : labAcctRequired\r\n    }\r\n\r\n    this.setState({ saving: true })\r\n    this.saveSubscription && this.saveSubscription.unsubscribe()\r\n    let observ = isNew ? CompanyCreateObservable : CompanyUpdateObservable\r\n    this.saveSubscription = observ(updateData).subscribe(\r\n      (data) => {\r\n        this.setState({ saving: false, saved: true })\r\n        toast.success(data)\r\n        this.props.reload()\r\n        if (isNew) {\r\n          this.handleCancel()\r\n        }\r\n        else {\r\n          this.companyName$.next(name.trim())\r\n        }\r\n      },\r\n      (error) => this.handleAPIError(error, { saving: false })\r\n    )\r\n  }\r\n\r\n  createPortal = () => {\r\n    const { streetAddress1, streetAddress2, city, state, zip, officePhone, subscriptionPlan, isTPA, portalAdminData, url, implementationType, unmaskDonorID } = this.state\r\n    if (!portalAdminData) {\r\n      return\r\n    }\r\n    const updateData: PortalInviteData = {\r\n      CompanyName: portalAdminData.Name,\r\n      EmailAddress: portalAdminData.Email,\r\n      PhoneNumber: portalAdminData.Phone.replace(/-/g, \"\"),\r\n      FirstName: portalAdminData.FirstName,\r\n      LastName: portalAdminData.LastName,\r\n      RoleID: portalAdminData.RoleID || 0,\r\n      SubscriptionPlanID: subscriptionPlan?.SubscriptionPlanID || 0,\r\n      IsGOVTPortal: (subscriptionPlan?.Title || \"\") === \"Government Program\",\r\n      Link: `${url}.${SiteDomain}`,\r\n      ModifiedBy: this.props?.userName || \"\",\r\n      IsExistingUser: false,\r\n      ImplementationID: 0,\r\n      Address1: streetAddress1,\r\n      Address2: streetAddress2,\r\n      City: city,\r\n      State: state,\r\n      Zip: zip,\r\n      OfficePhone: officePhone.replace(/-/g, \"\"),\r\n      ImplementationType: implementationType || ImplementationType.NonTPA,\r\n      UnmaskDonorID: unmaskDonorID,\r\n    }\r\n\r\n    this.setState({ saving: true })\r\n    this.saveSubscription && this.saveSubscription.unsubscribe()\r\n    this.saveSubscription = PortalInvitation(updateData).subscribe(\r\n      (result) => {\r\n        (this.props as RouteComponentProps).history?.push(PortalAdministrationRoute)\r\n        toast.success(result)\r\n      },\r\n      (error) => this.handleAPIError(error, { saving: false })\r\n    )\r\n  }\r\n\r\n  updatePortal = () => {\r\n    const { portalData, name, streetAddress1, streetAddress2, city, state, zip, officePhone, subscriptionPlan, isTPA, mroFileContent, implementationType, unmaskDonorID } = this.state\r\n    if (!portalData) {\r\n      return\r\n    }\r\n    const updateData: PortalEditData = {\r\n      CompanyName: name.trim(),\r\n      Address1: streetAddress1,\r\n      Address2: streetAddress2,\r\n      City: city,\r\n      State: state,\r\n      Zip: zip,\r\n      ImplementationName: name.trim(),\r\n      Phone: officePhone.replace(/-/g, \"\"),\r\n      SubscriptionPlanID: subscriptionPlan?.SubscriptionPlanID || portalData.SubscriptionPlanID,\r\n      SubscriptionPlan: subscriptionPlan?.Title || portalData.SubscriptionPlan || \"\",\r\n      ImplementationID: portalData.ImplementationID,\r\n      ImplementationType: implementationType || ImplementationType.NonTPA,\r\n      IsOnTrack: portalData.IsOnTrack,\r\n      MROLogoFile: mroFileContent,\r\n      UnmaskDonorID: unmaskDonorID,\r\n    }\r\n\r\n    this.setState({ saving: true })\r\n    this.saveSubscription && this.saveSubscription.unsubscribe()\r\n    this.saveSubscription = PortalUpdate(updateData).subscribe(\r\n      (data) => {\r\n        this.setState({ saving: false, mroFileName: \"\" })\r\n        this.updateSeletectPortal(updateData)\r\n        toast.success(data)\r\n      },\r\n      (error) => this.handleAPIError(error, { saving: false })\r\n    )\r\n  }\r\n\r\n  updateSeletectPortal = (updateData: PortalEditData) =>{\r\n    if(!updateData || !this.props.portal){\r\n      return\r\n    }\r\n    if(this.props.portal.ImplementationID !== updateData.ImplementationID){\r\n      return\r\n    }\r\n    this.props.portal.ImplementationName = updateData.ImplementationName\r\n    this.props.portal.UnmaskDonorID = updateData.UnmaskDonorID\r\n  }\r\n\r\n  showAdditionalFields = (): boolean => !this.props.portalMode && !this.props.isSiteAdmin\r\n\r\n  loadLabAccounts() {\r\n    const { companyData } = this.state\r\n    if (!companyData) {\r\n      return\r\n    }\r\n    this.setState({ labAccountsLoading: true, activeLabAccountsCount: 0 })\r\n    this.loadLabAccountsSubscription && this.loadLabAccountsSubscription.unsubscribe()\r\n    this.loadLabAccountsSubscription = LabAccountListGet(companyData.ImplementationID, companyData.AccountID, false).subscribe(\r\n      data => this.setState({ activeLabAccountsCount: data.ActiveLabAccount.length, labAccountsLoading: false }),\r\n      error => this.handleAPIError(error, { labAccountsLoading: false })\r\n    )\r\n  }\r\n\r\n  handleLabAccountsSelectionModalClose = () => {\r\n    this.setState({ showLabAccountSelection: false })\r\n    if (!this.props.portalMode) {\r\n      this.loadLabAccounts()\r\n    }\r\n  }\r\n\r\n  handleLabAccountsNotRequiredChange = (e: React.ChangeEvent<HTMLInputElement>) => this.setState({ labAcctRequired: !e.target.checked })\r\n\r\n  handleNameChange = (name: string) => {\r\n    const url = this.prepareUrl(name)\r\n    this.setState({\r\n      ...this.changeUrlStatePart(url)\r\n    })\r\n  }\r\n\r\n  handleCompanyNameChange = (e: React.ChangeEvent<HTMLInputElement>) => {\r\n    const value = e.target.value || \"\"\r\n    this.setState({\r\n      name: value,\r\n      isNameValid: this.isCompanyNameValid(value),\r\n      isNameLengthValid: this.isNameLengthValid(value),\r\n      isNameTextValid: this.isNameTextValid(value),\r\n      isNameAvailable: undefined\r\n    })\r\n  }\r\n  handleCompanyNameBlur = (e: React.ChangeEvent<HTMLInputElement>) => {\r\n    const value = (e.target.value || \"\").trim()\r\n    if(this.state.name !== value){\r\n      this.setState({name: value})\r\n    }\r\n\r\n    this.checkName$.next({ value: value, implementationID: this.state.portalData?.ImplementationID })\r\n  }\r\n  handleCodeChange = (e: React.ChangeEvent<HTMLInputElement>) => {\r\n    const value = e.target.value.replace(/[^a-zA-Z0-9]/g, \"\")\r\n    this.setState({ code: value, isCodeValid: this.isCodeValid(value), isCodeAvailable: undefined })\r\n  }\r\n\r\n  handleCompanyCodeBlur = (e: React.ChangeEvent<HTMLInputElement>) => {\r\n    this.checkCode$.next(e.target.value)\r\n  }\r\n\r\n  handleAddCompany = () => {\r\n    if (this.implementationName) {\r\n      (this.props as RouteComponentProps).history?.push(AddCompanyForPortalRoute(this.implementationName))\r\n    } else {\r\n      (this.props as RouteComponentProps).history?.push(AddNewCompanyRoute)\r\n    }\r\n  }\r\n\r\n  handleFileSelect = (e: React.ChangeEvent<HTMLInputElement>) => {\r\n    const file = e.target && e.target.files && e.target.files[0]\r\n    if (!file) {\r\n      this.setState({ mroFileName: \"\", mroFileContent: undefined, isMROFileSizeValid: true })\r\n      return\r\n    }\r\n\r\n    const isFileSizeValid = file.size < MaxImageFileSize\r\n    this.setState({ mroFileName: file.name, isMROFileSizeValid: isFileSizeValid })\r\n    if (isFileSizeValid) {\r\n      const ext = file.name.substring(file.name.lastIndexOf('.') + 1)\r\n      if (ext && [\"bmp\"].includes(ext.toLowerCase())) {\r\n        var reader = new FileReader()\r\n        const self = this\r\n        reader.onload = function (e) {\r\n          const result = e.target?.result as string || \"\"\r\n          const stringLength = result.indexOf('base64') + 7\r\n          const fileContent = result.slice(stringLength, result.length)\r\n          if (fileContent) {\r\n            self.setState({ mroFileContent: fileContent })\r\n          } else {\r\n            toast.error(\"Image file is empty.\")\r\n          }\r\n        }\r\n        reader.onerror = function (error) { toast.error(error) }\r\n        reader.readAsDataURL(file)\r\n      } else {\r\n        toast.error(\"Please upload only .bmp type of image files.\")\r\n      }\r\n    }\r\n  }\r\n\r\n  handleCompaniesExport = () => {\r\n    this.setState({ loadingCsv: true })\r\n    CompaniesDetailsExportCsv().subscribe(\r\n      data => {\r\n        this.export(data)\r\n        this.setState({ loadingCsv: false })\r\n      },\r\n      error => this.handleAPIError(error, { loadingCsv: false })\r\n    )\r\n  }\r\n\r\n  handleUnmackDonorIDChange = (e: React.ChangeEvent<HTMLInputElement>) => \r\n  {\r\n    this.setState({ unmaskDonorID: e.target.checked? 1 : 0})\r\n  }\r\n\r\n  export(csv: string) {\r\n    const csvData = new Blob([csv], { type: 'text/csv;charset=utf-8;' })\r\n    FileSaver.saveAs(csvData, FormatTimestampFileName(\"CompaniesDetails\", \"csv\", new Date()), true)\r\n    toast.success(\"CSV file downloaded successfully.\")\r\n  }\r\n\r\n  render() {\r\n    const { companyData, retrievedCompanies, portalData, retrievedPortals,\r\n      name, code, streetAddress1, streetAddress2, city, state, zip, province, country, timeZoneID, webSiteURL, fax, officePhone, contactPhone, contactFirstName, contactLastName,\r\n      contactDerPhone, contactDerFirstName, contactDerLastName,\r\n      isTPA, subscriptionPlan, subscriptionPlanID, implementationType, implementationID,\r\n      businessTypeId, businessTypesLoading, businessTypes,\r\n      portalAdminRoleID, roles, rolesLoading,\r\n      primaryIDType, primaryIDTypes, primaryIDTypesLoading,\r\n      states, statesLoading, activating,\r\n      loading, inactivating, saving,\r\n      timeZones, timeZonesLoading,\r\n      labAccountsLoading, activeLabAccountsCount, labAcctRequired,\r\n      showOrderSecurity, showOrderSecurityOverride, showLabAccountSelection, showSubscriptions, showManageImages, showCompanyImport, showLocation,\r\n      showAdditionalTesting, isNameValid, isNameChecking, isNameAvailable, isNameLengthValid, isNameTextValid, showLocationImport,\r\n      isCodeValid, isCodeChecking, isCodeAvailable,\r\n      isStreetAddress1Valid, isCityValid, isStateValid, isZipValid, isPhoneValid, isBusinessTypeValid, isPrimaryIDTypeValid,\r\n      url, urlChecking, urlAvailable, urlValid, urlCheckMessage, mroFileName, isMROFileSizeValid, loadingCsv, showDevices, unmaskDonorID } = this.state\r\n\r\n    const disableCheckUrl = !!url && (url.length === 0 || !urlValid || !!portalData?.ImplementationID || !this.isUrlAllowed(url))\r\n    const { portalMode, isCompanyAdmin, isPortalAdmin, isSiteAdmin, userAccess, isNew } = this.props\r\n\r\n    const disabled = this.isDisabled()\r\n    const allowAdditionalRole = !disabled && !!companyData?.AllowAdditionalRole\r\n    const validContactPhone = disabled || this.isPhoneValid(contactPhone)\r\n    const validContactFirstName = disabled || !!contactFirstName.length\r\n    const validContactLastName = disabled || !!contactLastName.length\r\n    const validContactDerPhone = disabled || this.isPhoneValid(contactDerPhone)\r\n    const validContactDerFirstName = disabled || !!contactDerFirstName.length\r\n    const validContactDerLastName = disabled || !!contactDerLastName.length\r\n    const labAccountsCountValid = portalMode || activeLabAccountsCount > 0 || !labAcctRequired\r\n    const canImport = ((portalMode || (isSiteAdmin && this.implementationName && !isNew)) && userAccess?.canCreateClient)\r\n    const canImportLocation = !portalMode && (isPortalAdmin || isCompanyAdmin || isSiteAdmin)\r\n    const isSiteAdminOrPortalAdmin = this.isSiteAdminOrPortalAdmin()\r\n    const showAdditionalFields = this.showAdditionalFields()\r\n    const showActivateButton =  (portalMode && portalData?.InActive) || companyData?.Inactive\r\n    const disableCodeEdit = (!!companyData?.Code && companyData?.Code.length > 0) || (!isPortalAdmin && !isSiteAdmin)\r\n\r\n    const isIntl11 = !!officePhone.length && (officePhone.replace(/\\D/g, \"\").length === 11)\r\n    const isFaxIntl11 = !!fax.length && (fax.replace(/\\D/g, \"\").length === 11)\r\n\r\n    return (<AppPageWrapper showNav>\r\n      {showOrderSecurity && <OrderSecurity override companyName={name} cancelText=\"Cancel\" submitText=\"Submit\" cancelVariant=\"secondary\"\r\n        onPrev={() => this.setState({ showOrderSecurity: false })} onNext={() => this.setState({ showOrderSecurity: false })} />}\r\n      {(isNew && portalMode || companyData || portalData) &&\r\n        <LabAccountSelection\r\n          portalMode={portalMode}\r\n          name={portalMode\r\n            ? portalData?.CompanyName || \"\"\r\n            : companyData?.Name || \"\"}\r\n          implementationID={portalMode\r\n            ? portalData?.ImplementationID || 0\r\n            : companyData?.ImplementationID || 0}\r\n          accountID={portalMode ? 0 : companyData?.AccountID || 0}\r\n          show={showLabAccountSelection}\r\n          onClose={this.handleLabAccountsSelectionModalClose} />}\r\n        {showDevices && <DeviceSelection\r\n          portalMode={portalMode}\r\n          implementationID={portalMode\r\n            ? portalData?.ImplementationID || 0\r\n            : companyData?.ImplementationID || 0}\r\n          accountID={portalMode ? 0 : companyData?.AccountID || 0}\r\n          onClose={() => this.setState({ showDevices: false })} />}\r\n      {!showLocation && <Modal.Dialog size=\"xl\">\r\n        <Modal.Header>\r\n          {portalMode && <Modal.Title className=\"text-uppercase\">EDIT MY ORGANIZATION</Modal.Title>}\r\n          {!portalMode && <Modal.Title className=\"text-uppercase\">Edit Company Information</Modal.Title>}\r\n        </Modal.Header>\r\n        <Modal.Body>\r\n          <Form>\r\n            {isNew && portalMode && <PortalFields isValid={(data, valid) => this.handlePortalFieldsValidation(data, valid)} onNameChange={this.handleNameChange} />}\r\n            {portalMode && !isNew && <Form.Row className=\"form-group required\">\r\n              <Form.Label column lg={4} htmlFor=\"companyName\">Organization Name</Form.Label>\r\n              <Col lg={8}>\r\n                {(!isSiteAdmin || this.implementationName) && <>\r\n                  {loading && <div className=\"py-2\"><Spinner animation=\"border\" size=\"sm\" variant=\"secondary\" /></div>}\r\n                  {!loading && <Form.Control id=\"companyName\" type=\"text\" value={name} isInvalid={!isNameValid} disabled={this.state.loading} autoComplete=\"off\" onChange={this.handlePortalNameChange} />}\r\n                </>}\r\n                {isSiteAdmin && !this.implementationName && <AsyncTypeahead id=\"implementation\"\r\n                  ref={this.typeahead}\r\n                  paginate={false}\r\n                  useCache={false}\r\n                  isLoading={this.state.loading}\r\n                  onSearch={() => { }}\r\n                  onInputChange={this.handlePortalNameTyping}\r\n                  onChange={selected => this.implementationName$.next(selected[0] || \"\")}\r\n                  options={this.state.retrievedPortalPredictions || []}\r\n                  selected={this.state.portalData ? [this.state.portalData.CompanyName || \"\"] : []}\r\n                  minLength={0}\r\n                  emptyLabel=\"No Portals Found\"\r\n                  placeholder=\"\"\r\n                  inputProps={{ autoComplete: \"chrome-off\" }}>\r\n                  {!this.state.loading &&\r\n                    <Button variant=\"toggle\" onClick={() => { this.typeahead.current?.toggleMenu() }}>\r\n                      <FaAngleDown />\r\n                    </Button>}\r\n                </AsyncTypeahead>}\r\n              </Col>\r\n            </Form.Row>}\r\n            {!portalMode &&\r\n            <Form.Row className=\"form-group required\">\r\n              <Col lg={4} className=\"col-form-label\">\r\n                {!isNew && <Form.Label className=\"mb-0\" htmlFor=\"companyName\">Company {companyData?.AccountID ? `(Account ID: ${companyData?.AccountID})` : \"\"}</Form.Label>}\r\n                {isNew && <Form.Label className=\"mb-0\" htmlFor=\"companyName\">Company's Name</Form.Label>}\r\n              </Col>\r\n              <Col lg={8}>\r\n                {!isNew &&\r\n                <InputGroup>\r\n                  {!isSiteAdminOrPortalAdmin && loading && <div className=\"py-2\"><Spinner animation=\"border\" size=\"sm\" variant=\"secondary\" /></div>}\r\n                  {isSiteAdminOrPortalAdmin &&\r\n                  <AsyncTypeahead id=\"company-select\"\r\n                    ref={this.typeahead}\r\n                    paginate={false}\r\n                    useCache={false}\r\n                    isLoading={this.state.loading}\r\n                    onSearch={() => { }}\r\n                    onInputChange={this.handleCompanyNameTyping}\r\n                    onChange={this.handleCompanyChange}\r\n                    options={this.state.companies || []}\r\n                    selected={this.state.selectedCompany ? [this.state.selectedCompany || \"\"] : []}\r\n                    minLength={0}\r\n                    emptyLabel=\"No Companies Found\"\r\n                    placeholder=\"\"\r\n                    inputProps={{ autoComplete: \"chrome-off\" }}>\r\n                    {!this.state.loading &&\r\n                      <Button variant=\"toggle\" onClick={() => { this.typeahead.current?.toggleMenu() }}>\r\n                        <FaAngleDown />\r\n                      </Button>}\r\n                  </AsyncTypeahead>}\r\n                </InputGroup>}\r\n                {!loading && (!isSiteAdminOrPortalAdmin || isNew ) && <>\r\n                  <Form.Control id=\"name\"\r\n                    type=\"text\"\r\n                    value={name}\r\n                    onChange={this.handleCompanyNameChange}\r\n                    onBlur={this.handleCompanyNameBlur}\r\n                    isInvalid={!isNameValid || !isNameAvailable}\r\n                    disabled={isNameChecking || !isSiteAdminOrPortalAdmin} />\r\n                  {!isNameChecking && !isNameValid && !isNameLengthValid && isNameTextValid && <Form.Control.Feedback type=\"invalid\" className=\"d-block\">Company Name must be of 3 to 32 characters.</Form.Control.Feedback>}\r\n                  {!isNameChecking && !isNameValid && isNameLengthValid && !isNameTextValid  && <Form.Control.Feedback type=\"invalid\" className=\"d-block\">Company name cannot contain any special characters except apostrophe, dash, comma or dot  [ ' or - or , or . ]</Form.Control.Feedback>}\r\n                  {!isNameChecking && !isNameValid && !isNameLengthValid && !isNameTextValid  && <Form.Control.Feedback type=\"invalid\" className=\"d-block\">Company Name must be of 3 to 32 characters. Company name cannot contain any special characters except apostrophe, dash, comma or dot  [ ' or - or , or . ]</Form.Control.Feedback>}\r\n                  {isNew && !isNameChecking && isNameAvailable && <Form.Control.Feedback type=\"valid\" className=\"d-block\">Company name is available</Form.Control.Feedback>}\r\n                  {!isNameChecking&& isNameAvailable === false && <Form.Control.Feedback type=\"invalid\" className=\"d-block\">Company name is already in use</Form.Control.Feedback>}\r\n                </>}\r\n              </Col>\r\n            </Form.Row>}\r\n            {isSiteAdmin && portalMode &&\r\n              <Form.Row className=\"form-group\">\r\n                <Form.Label column lg={4} htmlFor=\"companyCode\">Client Code/ID</Form.Label>\r\n                <Col lg={8}>\r\n                  {!isNew && <Form.Control id=\"codeCode\" type=\"text\" disabled={disabled} value={code} onChange={e => this.setState({ code: e.target.value })} />}\r\n                  {isNew && <>\r\n                    <Form.Control id=\"codeCode\"\r\n                      type=\"text\"\r\n                      value={code}\r\n                      onChange={this.handleCodeChange}\r\n                      onBlur={(e: React.FocusEvent<HTMLInputElement>) => this.checkCode$.next(e.target.value)}\r\n                      isInvalid={!isCodeValid}\r\n                      disabled={disabled} />\r\n                    {!isCodeChecking && !isCodeValid && <Form.Control.Feedback type=\"invalid\" className=\"d-block\">Please enter a valid client code/ID.</Form.Control.Feedback>}\r\n                    {!isCodeChecking && isCodeAvailable && <Form.Control.Feedback type=\"valid\" className=\"d-block\">Client code/ID is available.</Form.Control.Feedback>}\r\n                    {!isCodeChecking && isCodeAvailable === false && <Form.Control.Feedback type=\"invalid\" className=\"d-block\">The client code/ID is already in use, please enter a unique value.</Form.Control.Feedback>}\r\n                  </>}\r\n                </Col>\r\n              </Form.Row>}\r\n            {!portalMode &&\r\n              <Form.Row className=\"form-group\">\r\n                <Form.Label column lg={4} htmlFor=\"companyCode\">Company Code</Form.Label>\r\n                <Col lg={8}>\r\n                  <Form.Control id=\"companyCode\" type=\"text\" className={disabled || disableCodeEdit ? '' : 'bg-white'} onBlur={this.handleCompanyCodeBlur} value={code} disabled={disabled || disableCodeEdit} onChange={this.handleCodeChange} />\r\n                  {!isCodeChecking && !isCodeValid && <Form.Control.Feedback type=\"invalid\" className=\"d-block\">Please enter a valid company Code.</Form.Control.Feedback>}\r\n                  {!isCodeChecking && isCodeAvailable && <Form.Control.Feedback type=\"valid\" className=\"d-block\">Company Code is available.</Form.Control.Feedback>}\r\n                  {!isCodeChecking && isCodeAvailable === false && <Form.Control.Feedback type=\"invalid\" className=\"d-block\">The company Code is already in use, please enter a unique value.</Form.Control.Feedback>}\r\n                </Col>\r\n              </Form.Row>}\r\n            <Form.Row className=\"form-group required\">\r\n              <Form.Label column lg={4} htmlFor=\"streetAddress1\">Street Address 1</Form.Label>\r\n              <Col lg={8}>\r\n                <AddressInput onAddressChange={this.handleAddressSelect}\r\n                  isInvalid={!isStreetAddress1Valid}\r\n                  disabled={disabled}\r\n                  selected={{ City: city, State: state, StreetLine: streetAddress1, Text: streetAddress1 }} />\r\n              </Col>\r\n            </Form.Row>\r\n            <Form.Row className=\"form-group\">\r\n              <Form.Label column lg={4} htmlFor=\"streetAddress2\">Street Address 2</Form.Label>\r\n              <Col lg={8}>\r\n                <Form.Control id=\"streetAddress2\" type=\"text\"\r\n                  autoComplete=\"new-password\"\r\n                  value={streetAddress2}\r\n                  disabled={disabled}\r\n                  onChange={e => this.setState({ streetAddress2: e.target.value })} />\r\n              </Col>\r\n            </Form.Row>\r\n            <Form.Row className=\"form-group required\">\r\n              <Form.Label column lg={4} htmlFor=\"city\">City</Form.Label>\r\n              <Col lg={8}>\r\n                <Form.Control id=\"city\" type=\"text\"\r\n                  autoComplete=\"new-password\"\r\n                  value={city}\r\n                  onChange={e => this.setState({ city: e.target.value, isCityValid: this.isCityValid(e.target.value) })}\r\n                  disabled={disabled}\r\n                  isInvalid={!isCityValid} />\r\n              </Col>\r\n            </Form.Row>\r\n            <Form.Row className=\"form-group required\">\r\n              <Form.Label column lg={4} htmlFor=\"state\">State</Form.Label>\r\n              <Col sm={5}>\r\n                <StateSelect selectedCode={state}\r\n                  states={states}\r\n                  onChange={selected => this.setState({ state: selected?.Abbreviation || \"\", isStateValid: this.isStateValid(selected?.Abbreviation) })}\r\n                  isDisabled={disabled || statesLoading}\r\n                  isInvalid={!isStateValid} />\r\n              </Col>\r\n              <Form.Label column sm={1} htmlFor=\"zip\">ZIP</Form.Label>\r\n              <Col sm={2}>\r\n                <Form.Control id=\"zip\" type=\"text\"\r\n                  autoComplete=\"new-password\"\r\n                  onChange={e => this.setState({ zip: e.target.value, isZipValid: this.isZipValid(e.target.value) })}\r\n                  value={zip}\r\n                  disabled={disabled}\r\n                  isInvalid={!isZipValid} />\r\n              </Col>\r\n            </Form.Row>\r\n            {showAdditionalFields && <Form.Row className=\"form-group\">\r\n              <Form.Label column lg={4} htmlFor=\"province\">Province</Form.Label>\r\n              <Col lg={8}>\r\n                <Form.Control id=\"province\" type=\"text\"\r\n                  autoComplete=\"new-password\"\r\n                  value={province || \"\"}\r\n                  onChange={e => this.setState({ province: e.target.value })}\r\n                  disabled={disabled} />\r\n              </Col>\r\n            </Form.Row>}\r\n            {showAdditionalFields && <Form.Row className=\"form-group\">\r\n              <Form.Label column lg={4} htmlFor=\"country\">Country</Form.Label>\r\n              <Col lg={8}>\r\n                <Form.Control id=\"province\" type=\"text\"\r\n                  autoComplete=\"new-password\"\r\n                  value={country || \"\"}\r\n                  onChange={e => this.setState({ country: e.target.value })}\r\n                  disabled={disabled} />\r\n              </Col>\r\n            </Form.Row>}\r\n            <Form.Row className=\"form-group required\">\r\n              <Form.Label column lg={4} htmlFor=\"officePhone\">Office Phone #</Form.Label>\r\n              <Col lg={8}>\r\n                <PhoneNumberMaskedInput\r\n                  autoComplete=\"new-password\"\r\n                  value={officePhone}\r\n                  onChange={(value: string) => this.setState({ officePhone: value, isPhoneValid: this.isPhoneValid(value) })}\r\n                  disabled={disabled}\r\n                  isInvalid={!isPhoneValid}\r\n                  intl11={isIntl11} />\r\n              </Col>\r\n            </Form.Row>\r\n            {portalMode && <>\r\n              {!portalData?.IsOnTrack && <Form.Row className=\"form-group\">\r\n                <Form.Label column lg={4} htmlFor=\"tpa\">\r\n                  Are you a Third-Party Administrator?\r\n                  <OverlayTrigger placement=\"right\" delay={{ show: 100, hide: 400 }} overlay={\r\n                    <Popover id=\"tpa\" className=\"p-2\">\r\n                      Third-Party Administrator (TPA) or Consortium/Third-Party Administrators (C/TPAs)\r\n                      manage all, or part, of an employer's drug and alcohol testing program. This\r\n                      may include maintaining testing records and performing tasks to implement the\r\n                      testing program.\r\n                    </Popover>}>\r\n                    <FaInfoCircle className=\"info-icon\" />\r\n                  </OverlayTrigger>\r\n                </Form.Label>\r\n                <Form.Check inline id=\"tpa-yes\" name=\"tpa\" type=\"radio\" label=\"Yes\" className=\"abc-radio mx-2\" checked={isTPA === true} onChange={() => this.setState({ isTPA: true })} />\r\n                <Form.Check inline id=\"tpa-no\" name=\"tpa\" type=\"radio\" label=\"No\" className=\"abc-radio mx-2\" checked={isTPA === false} onChange={() => this.setState({ isTPA: false })} />\r\n              </Form.Row>}\r\n              {isSiteAdmin && <>\r\n                <Form.Row className=\"form-group required\">\r\n                  <Form.Label column lg={4} htmlFor=\"subscription\">Subscription</Form.Label>\r\n                  <Col lg={8}>\r\n                    <InputGroup>\r\n                      <Form.Control type=\"text\" disabled defaultValue={subscriptionPlan?.Title || \"\"} className=\"bg-white\" />\r\n                      <InputGroup.Append>\r\n                        <Button variant=\"secondary\" onClick={() => this.setState({ showSubscriptions: true })} disabled={disabled}>Change Subscription</Button>\r\n                      </InputGroup.Append>\r\n                    </InputGroup>\r\n                  </Col>\r\n                </Form.Row>\r\n                {(isNew || !!implementationID) &&<Form.Row className=\"form-group required\">\r\n                  <Form.Label column lg={4} htmlFor=\"type\">Implementation Type</Form.Label>\r\n                  <Col lg={8}>\r\n                    <Form.Control as=\"select\" type=\"text\" size=\"sm\" defaultValue={ this.state.implementationType }\r\n                      disabled={ isNew }\r\n                      onChange={ (e) => this.setState({ implementationType: e.target.value }) }>\r\n                      {ImplementationTypes.map((type) => <option key={type} value={ImplementationType[type]} title={ImplementationType[type]}>{ImplementationType[type]}</option> )}\r\n                    </Form.Control>\r\n                  </Col>\r\n                </Form.Row>}\r\n              </>\r\n              }\r\n              {portalMode && <>\r\n                <Form.Row className=\"mb-1 pb-1\">\r\n                  <Form.Label column lg={4} htmlFor=\"url\">URL of Portal Site</Form.Label>\r\n                  <Col lg={8}>\r\n                    <InputGroup>\r\n                      <Form.Control type=\"text\" className=\"text-right bg-white\" id=\"url\" value={url} isInvalid={!urlValid} readOnly={true} />\r\n                      <InputGroup.Append><InputGroup.Text>.{SiteDomain}</InputGroup.Text></InputGroup.Append>\r\n                    </InputGroup>\r\n                  </Col>\r\n                </Form.Row>\r\n                <Form.Row>\r\n                  <Col sm={12} className=\"text-right\">\r\n                    {!urlChecking && urlAvailable && <Form.Control.Feedback type=\"valid\" className=\"d-inline\">{urlCheckMessage}</Form.Control.Feedback>}\r\n                    {!urlChecking && urlAvailable === false && <Form.Control.Feedback type=\"invalid\" className=\"d-inline\">{urlCheckMessage}</Form.Control.Feedback>}\r\n                    {!this.isUrlAllowed(url) && <Form.Control.Feedback type=\"invalid\" className=\"d-inline\">Subdomain is protected</Form.Control.Feedback>}\r\n                    {!this.isUrlMaxLengthValid(url) && <Form.Control.Feedback type=\"invalid\" className=\"d-inline\">URL length will be up to 56 character</Form.Control.Feedback>}\r\n                    <ActionButton variant=\"secondary\" className=\"ml-2\" onClick={() => { this.checkUrl$.next(url)} } disabled={disableCheckUrl} spin={urlChecking} disableOnSpin>Check URL</ActionButton>\r\n                  </Col>\r\n                </Form.Row>\r\n              </>}\r\n            </>}\r\n            {!portalMode && <>\r\n              {showAdditionalFields && <Form.Row className=\"form-group\">\r\n                <Form.Label column lg={4} htmlFor=\"officeFax\">Office Fax #</Form.Label>\r\n                <Col lg={8}>\r\n                  <PhoneNumberMaskedInput\r\n                    autoComplete=\"new-password\"\r\n                    value={fax}\r\n                    onChange={(value: string) => this.setState({ fax: value })}\r\n                    disabled={disabled}\r\n                    isInvalid={(!disabled && (!!fax && !this.isPhoneValid(fax)))}\r\n                    intl11={isFaxIntl11} />\r\n                </Col>\r\n              </Form.Row>}\r\n              {!portalData?.IsOnTrack && !companyData?.IsOnTrack && isNew && <Form.Row className=\"form-group required\">\r\n                <Form.Label column lg={4} htmlFor=\"businessType\">\r\n                  Business Type\r\n                  <OverlayTrigger placement=\"right\" delay={{ show: 100, hide: 400 }} overlay={\r\n                    <Popover id=\"businessTypePopover\">\r\n                      <ListGroup>\r\n                        <ListGroup.Item>An employer is a person or organization that employs people.</ListGroup.Item>\r\n                        <ListGroup.Item>A Third-Party Administrator (TPA) or Consortium/Third-Party Administrators (C/TPAs) manages all, or part, of an employer's drug and alcohol testing program.</ListGroup.Item>\r\n                        <ListGroup.Item>An occupational health clinic collects specimens and/or performs required occupational health services.</ListGroup.Item>\r\n                        <ListGroup.Item>A laboratory receives, analyzes, and reports laboratory-confirmed results.</ListGroup.Item>\r\n                        <ListGroup.Item>A Medical Review Officer (MRO) is a licensed physician trained and certified to review lab results and to validate whether a test is positive.</ListGroup.Item>\r\n                      </ListGroup>\r\n                    </Popover>}>\r\n                    <FaInfoCircle className=\"info-icon\" />\r\n                  </OverlayTrigger>\r\n                </Form.Label>\r\n                <Col lg={8}>\r\n                  <Form.Control as=\"select\" id=\"businessType\" type=\"text\"\r\n                    disabled={businessTypesLoading || disabled}\r\n                    onChange={(e: React.ChangeEvent<HTMLSelectElement>) => {\r\n                      const businessTypeID = !!e.target.value ? Number(e.target.value) : undefined\r\n                      this.setState({ businessTypeId: businessTypeID, isBusinessTypeValid: this.isBusinessTypeValid(businessTypeID) })\r\n                    }}\r\n                    isInvalid={!isBusinessTypeValid}\r\n                    value={businessTypeId || \"0\"}>\r\n                    <option value=\"\">Select</option>\r\n                    {businessTypes.map((item: BusinessType, key: number) => <option key={key} value={item.BusinessTypeID}>{item.Description}</option>)}\r\n                  </Form.Control>\r\n                </Col>\r\n              </Form.Row> }\r\n              {showAdditionalFields && <>\r\n                <Form.Row className=\"form-group\">\r\n                  <Form.Label column lg={4}>Time Zone</Form.Label>\r\n                  <Col lg={8}>\r\n                    <Form.Control id=\"timeZones\" as=\"select\"\r\n                      disabled={timeZonesLoading || disabled}\r\n                      value={timeZoneID}\r\n                      onChange={(e: React.ChangeEvent<HTMLSelectElement>) => { this.setState({ timeZoneID: Number(e.target.value) })}}>\r\n                        <option value={0} key={0}></option>\r\n                        {timeZones?.map(tz => <option value={tz.TimeZoneID} key={tz.TimeZoneID}>{tz.Abbreviation}</option>)}\r\n                    </Form.Control>\r\n                  </Col>\r\n                </Form.Row>\r\n                <Form.Row className=\"form-group required\">\r\n                  <Form.Label column lg={4} htmlFor=\"contactFirstName\">Company Contact First\\Last Names</Form.Label>\r\n                    <Col lg={4}>\r\n                      <Form.Control id=\"contactFirstName\" type=\"text\"\r\n                        autoComplete=\"new-password\"\r\n                        value={contactFirstName}\r\n                        onChange={e => this.setState({ contactFirstName: e.target.value })}\r\n                        isInvalid={!validContactFirstName}\r\n                        disabled={disabled} />\r\n                    </Col>\r\n                    <Col lg={4}>\r\n                      <Form.Control id=\"contactLastName\" type=\"text\"\r\n                        autoComplete=\"new-password\"\r\n                        value={contactLastName}\r\n                        onChange={e => this.setState({ contactLastName: e.target.value })}\r\n                        isInvalid={!validContactLastName}\r\n                        disabled={disabled} />\r\n                    </Col>\r\n                </Form.Row>\r\n                <Form.Row className=\"form-group required\">\r\n                  <Form.Label column lg={4} htmlFor=\"contactPhone\">Company Contact Phone #</Form.Label>\r\n                    <Col lg={8}>\r\n                      <PhoneNumberMaskedInput\r\n                        autoComplete=\"new-password\"\r\n                        value={contactPhone}\r\n                        onChange={(value: string) => this.setState({ contactPhone: value })}\r\n                        disabled={disabled}\r\n                        isInvalid={!validContactPhone} />\r\n                    </Col>\r\n                  </Form.Row>\r\n                  <Form.Row className=\"form-group\">\r\n                    <Form.Label column lg={4} htmlFor=\"website\">Website</Form.Label>\r\n                    <Col lg={8}>\r\n                      <Form.Control id=\"website\" type=\"text\"\r\n                        autoComplete=\"new-password\"\r\n                        value={webSiteURL || \"\"}\r\n                        onChange={e => this.setState({ webSiteURL: e.target.value })}\r\n                        disabled={disabled} />\r\n                    </Col>\r\n                  </Form.Row></>}\r\n                  {isCompanyAdmin && <Form.Row className=\"form-group\">\r\n                    <Form.Label column lg={4} htmlFor=\"businessType\">Control who can view Orders placed by other users</Form.Label>\r\n                    <Col lg={8}>\r\n                      <Button variant=\"primary\" onClick={() => this.setState({ showOrderSecurity: true })} disabled={disabled}>User Role</Button>\r\n                      <Button variant=\"primary\" disabled={disabled} onClick={() => this.setState({ showOrderSecurityOverride: true })} className=\"ml-2\">Details to Person</Button>\r\n                    </Col>\r\n                  </Form.Row>}\r\n            </>}\r\n            {!isNew &&\r\n            <Form.Row className=\"form-group\">\r\n              <Form.Label column lg={4} className=\"required\">Lab Accounts</Form.Label>\r\n              <Col>\r\n                <ActionButton variant=\"secondary\" onClick={() => this.setState({ showLabAccountSelection: true })} disabled={disabled} spin={labAccountsLoading} disableOnSpin={false}>Lab Account Details</ActionButton>\r\n                {!portalMode && companyData && !labAccountsCountValid && !labAccountsLoading && <Form.Control.Feedback type=\"invalid\" className=\"d-block\">Lab Accounts required</Form.Control.Feedback>}\r\n                {isSiteAdmin && !portalMode && companyData?.IsOnTrack && <ActionButton variant=\"secondary\" className=\"ml-2\" onClick={() => this.setState({ showDevices: true })} disabled={disabled}>Devices</ActionButton>}\r\n              </Col>\r\n              {!portalMode &&\r\n                <Col>\r\n                  <Checkbox id=\"lab_accounts_not_required\" label=\"Lab Account Not Required\"\r\n                    className=\"m-2\" disabled={disabled}\r\n                    checked={!labAcctRequired} onChange={this.handleLabAccountsNotRequiredChange} />\r\n                </Col>\r\n              }\r\n            </Form.Row>}\r\n            {!portalMode && <>\r\n              {isPortalAdmin && allowAdditionalRole &&\r\n              <Form.Row className=\"form-group\">\r\n                <Form.Label column sm={4} htmlFor=\"portalAdminRole\">Portal Admin Additional Role</Form.Label>\r\n                <Col sm={8}>\r\n                  <Form.Control id=\"portalAdminRole\"\r\n                    as=\"select\"\r\n                    disabled={rolesLoading || disabled}\r\n                    value={portalAdminRoleID}\r\n                    onChange={(e: React.ChangeEvent<HTMLSelectElement>) => this.setState({ portalAdminRoleID: Number(e.target.value) })}>\r\n                    <option value=\"0\">Select</option>\r\n                    {roles?.map(role => <option value={role.RoleID} key={role.RoleID}>{role.Description}</option>)}\r\n                  </Form.Control>\r\n                </Col>\r\n              </Form.Row>}\r\n              <Form.Row className=\"form-group required\">\r\n                <Form.Label column sm={4} htmlFor=\"primaryIDType\">Primary ID Type</Form.Label>\r\n                <Col sm={8}>\r\n                  <Form.Control id=\"primaryIDType\"\r\n                    as=\"select\"\r\n                    disabled={primaryIDTypesLoading || disabled}\r\n                    value={primaryIDType}\r\n                    isInvalid={!isPrimaryIDTypeValid}\r\n                    onChange={(e: React.ChangeEvent<HTMLSelectElement>) => this.setState({ primaryIDType: Number(e.target.value), isPrimaryIDTypeValid: this.isPrimaryIDTypeValid(Number(e.target.value)) })}>\r\n                    <option value=\"0\">Select</option>\r\n                    {primaryIDTypes?.map(item => <option value={item.PrimaryTypeID} key={item.PrimaryTypeID}>{item.PrimaryIDType}</option>)}\r\n                  </Form.Control>\r\n                </Col>\r\n              </Form.Row>\r\n            </>}\r\n            {portalMode && !isNew && <>\r\n              <Form.Row className=\"form-group\">\r\n                <Form.Label column lg={4} htmlFor=\"primaryIDType\">Add corporate Logo to Workforce Portal</Form.Label>\r\n                <Col lg={8}>\r\n                  <InputGroup>\r\n                    <Form.Control type=\"text\" defaultValue=\"\" disabled className=\"bg-white\" />\r\n                    <InputGroup.Append>\r\n                      <Button variant=\"secondary\" disabled={disabled} onClick={() => this.setState({ showManageImages: true })}>Manage</Button>\r\n                    </InputGroup.Append>\r\n                  </InputGroup>\r\n                  <em className=\"small\">Ideal logo size should be 200 by 100 pixels and .jpg, .jpeg, .gif, .png file type</em>\r\n                </Col>\r\n              </Form.Row>\r\n              <Form.Row className=\"form-group\">\r\n                <Form.Label column lg={4} htmlFor=\"primaryIDType\">Add corporate Logo for MRO Results</Form.Label>\r\n                <Col lg={8}>\r\n                  <InputGroup>\r\n                    <Form.Control type=\"text\" name=\"fileName\" defaultValue={mroFileName || \"\"} readOnly className=\"bg-white\" isInvalid={!isMROFileSizeValid} />\r\n                    <InputGroup.Append>\r\n                      <Button variant=\"secondary\" onClick={() => { this.mroFile && this.mroFile.current && this.mroFile.current.click() }}>Browse</Button>\r\n                    </InputGroup.Append>\r\n                    <Form.Control.Feedback type=\"invalid\">\r\n                      The image size is invalid. Please resize the image size to less than {MaxImageFileSize / 1024} KB\r\n                    </Form.Control.Feedback>\r\n                  </InputGroup>\r\n                  <em className=\"small\">This option is only available for results reviewed by a Red Arrow integrated MRO</em>\r\n                  <Form.Control type=\"file\" ref={this.mroFile} accept=\".bmp, .BMP\" onChange={this.handleFileSelect} style={{ display: 'none' }} />\r\n                </Col>\r\n              </Form.Row>\r\n            </>}\r\n            {showAdditionalFields && <>\r\n              <Form.Row className=\"form-group required\">\r\n                <Form.Label column lg={4} htmlFor=\"contactDerFirstName\">\r\n                  DER Contact First\\Last Names\r\n                  <OverlayTrigger placement=\"right\" delay={{ show: 100, hide: 400 }} overlay={\r\n                      <Popover id=\"contactFirstNamePopover\">\r\n                        <ListGroup>\r\n                          <ListGroup.Item>The above information will print in the DER  area of the Marketplace Authorization form for all Marketplace orders.</ListGroup.Item>\r\n                        </ListGroup>\r\n                      </Popover>}>\r\n                      <FaInfoCircle className=\"info-icon\" />\r\n                    </OverlayTrigger>\r\n                </Form.Label>\r\n                <Col lg={4}>\r\n                  <Form.Control id=\"contactDerFirstName\" type=\"text\"\r\n                    autoComplete=\"new-password\"\r\n                    value={contactDerFirstName}\r\n                    onChange={e => this.setState({ contactDerFirstName: e.target.value })}\r\n                    disabled={disabled}\r\n                    isInvalid={!validContactDerFirstName} />\r\n                </Col>\r\n                <Col lg={4}>\r\n                  <Form.Control id=\"contactDerLastName\" type=\"text\"\r\n                    autoComplete=\"new-password\"\r\n                    value={contactDerLastName}\r\n                    onChange={e => this.setState({ contactDerLastName: e.target.value })}\r\n                    disabled={disabled}\r\n                    isInvalid={!validContactDerLastName} />\r\n                </Col>\r\n              </Form.Row>\r\n              <Form.Row className=\"form-group required\">\r\n                <Form.Label column lg={4} htmlFor=\"contactDerPhone\">\r\n                  DER Contact Phone #\r\n                  <OverlayTrigger placement=\"right\" delay={{ show: 100, hide: 400 }} overlay={\r\n                      <Popover id=\"contactPhonePopover\">\r\n                        <ListGroup>\r\n                          <ListGroup.Item>The above information will print in the DER  area of the Marketplace Authorization form for all Marketplace orders.</ListGroup.Item>\r\n                        </ListGroup>\r\n                      </Popover>}>\r\n                      <FaInfoCircle className=\"info-icon\" />\r\n                    </OverlayTrigger>\r\n                </Form.Label>\r\n                <Col lg={8}>\r\n                  <PhoneNumberMaskedInput\r\n                    autoComplete=\"new-password\"\r\n                    value={contactDerPhone}\r\n                    onChange={(value: string) => this.setState({ contactDerPhone: value })}\r\n                    disabled={disabled}\r\n                    isInvalid={!validContactDerPhone}\r\n                    intl11={isIntl11} />\r\n                </Col>\r\n              </Form.Row>\r\n            </>}\r\n            {!isNew && !portalMode && <Form.Row className=\"form-group\">\r\n              <Form.Label column lg={4}>Locations</Form.Label>\r\n              <Col lg={8}>\r\n                <Button variant=\"secondary\" onClick={() => this.setState({showLocation: true})} disabled={disabled}>Locations</Button>\r\n                {isSiteAdmin && <Button variant=\"secondary\" onClick={() => this.setState({showAdditionalTesting: true})} disabled={disabled} className=\"ml-2\">Additional Testing</Button>}\r\n              </Col>\r\n            </Form.Row>}\r\n            {portalMode && (isSiteAdmin || isPortalAdmin) && <Form.Row className=\"form-group\">\r\n              <Form.Label column lg={4}>Allow full Donor ID to print on CSV Export</Form.Label>\r\n                <Col>\r\n                  <Checkbox id=\"unmask_donor_id\" label=\"\"\r\n                    className=\"m-2\" disabled={false}\r\n                    checked={unmaskDonorID > 0} onChange={this.handleUnmackDonorIDChange} />\r\n                </Col>         \r\n            </Form.Row>}\r\n          </Form>\r\n        </Modal.Body>\r\n        <Modal.Footer className=\"justify-content-between\">\r\n          <div>\r\n            {canImport && <>\r\n              <Button variant=\"primary\" disabled={!portalData?.ImplementationID} onClick={() => this.setState({ showCompanyImport: true })} className=\"mr-2\">Company Import</Button>\r\n              <Button variant=\"primary\" disabled={disabled} onClick={this.handleAddCompany}>Add Company</Button>\r\n            </>}\r\n            {canImportLocation && <Button variant=\"primary\" disabled={!companyData?.AccountID} onClick={() => this.setState({ showLocationImport: true })} className=\"mr-2\">Location Import</Button>}\r\n            {!isNew && isPortalAdmin && portalMode &&\r\n              <Button variant=\"primary\" disabled={loadingCsv} onClick={this.handleCompaniesExport} className=\"ml-2\">\r\n                Companies Details Export\r\n                {loadingCsv ? <Spinner animation=\"border\" size=\"sm\" /> : \"\"}\r\n              </Button>\r\n            }\r\n          </div>\r\n          <div>\r\n            {!isNew && (isSiteAdmin || (isPortalAdmin && !portalMode)) && <>\r\n              {!showActivateButton && <ActionButton variant=\"secondary\" disabled={disabled} onClick={() => this.setState({ showInactivateConfirmation: true })} spin={inactivating} disableOnSpin className=\"mr-2\">Inactivate</ActionButton>}\r\n              {showActivateButton && <ActionButton variant=\"secondary\" onClick={() => this.performActivate()} spin={activating} disableOnSpin className=\"mr-2\">Activate</ActionButton>}\r\n            </>}\r\n            <Button variant=\"secondary\" onClick={() => this.handleCancel()} className=\"mr-2\">Cancel</Button>\r\n            <ActionButton variant=\"primary\" onClick={this.handleUpdate} disabled={!this.isFormValid() || disabled} spin={saving} disableOnSpin>{isNew ? \"Save\": \"Update\"}</ActionButton>\r\n          </div>\r\n        </Modal.Footer>\r\n      </Modal.Dialog>}\r\n      <ConfirmationModal show={this.state.showInactivateConfirmation}\r\n        title=\"CONFIRM INACTIVATE\"\r\n        textTitle=\"Are you sure you want to inactivate?\"\r\n        text=\"\"\r\n        onConfirm={this.performInactivate}\r\n        onHide={() => this.setState({ showInactivateConfirmation: false })} />\r\n      <ConfirmationModal show={this.state.showNewCompanyModal}\r\n          title=\"COMPANY WAS CREATED\"\r\n          textTitle=\"\"\r\n          text={`Please note that company ${this.props.match.params.companyName || \"\"} was created and Lab Accounts can be added now`}\r\n          showImage={false}\r\n          showCancelButton={false}\r\n          showCloseButton={false}\r\n          onConfirm={() => this.setState({ showNewCompanyModal: false})}\r\n          onHide={() => this.setState({ showNewCompanyModal: false})} />\r\n      {!portalMode && <AddressMatchModal\r\n        show={!!retrievedCompanies && retrievedCompanies.length > 1}\r\n        addresses={retrievedCompanies?.map(item => ({ ID: item.AccountID.toString(), Address1: item.Address1, Zip: item.Zip } as AddressData)) || []}\r\n        selectedID={companyData?.AccountID.toString()}\r\n        title=\"EXISTING COMPANY ADDRESS\"\r\n        subTitle=\"The company name you have entered already exists as the following addresses:\"\r\n        message=\"Please select the address you want to activate\"\r\n        onAddressSelect={(selected: AddressData) => this.setState({ companyData: this.state.retrievedCompanies?.find(item => item.AccountID.toString() === selected.ID) })}\r\n        onClose={this.handleRetrievedCompanyAddressSelect} />}\r\n      {showOrderSecurityOverride && <OrderSecurityOverride show={showOrderSecurityOverride}\r\n        onClose={() => this.setState({ showOrderSecurityOverride: false })} />}\r\n      {portalMode && <>\r\n        <AddressMatchModal\r\n          show={!!retrievedPortals && retrievedPortals.length > 1}\r\n          addresses={retrievedPortals?.map(item => ({ ID: item.ImplementationID.toString(), Address1: item.Address1, Zip: item.Zip } as AddressData)) || []}\r\n          selectedID={portalData?.ImplementationID.toString()}\r\n          title=\"EXISTING PORTAL ADDRESS\"\r\n          subTitle=\"The clinic name you have entered already exists at the following addresses:\"\r\n          message=\"Please select the address you want to activate\"\r\n          onAddressSelect={(selected: AddressData) => this.setState({ portalData: this.state.retrievedPortals?.find(item => item.ImplementationID.toString() === selected.ID) })}\r\n          onClose={this.handleRetrievedPortalAddressSelect} />\r\n        <SubscriptionModal show={showSubscriptions}\r\n          subscriptionPlanID={subscriptionPlanID}\r\n          onCancel={() => this.setState({ showSubscriptions: false })}\r\n          onSubmit={(subscriptionPlanID: number, subscriptionPlan: SubscriptionPlan) => this.setState({ showSubscriptions: false, subscriptionPlanID: subscriptionPlanID, subscriptionPlan: subscriptionPlan })} />\r\n        {showManageImages && portalData?.ImplementationID && <ManageImages show={showManageImages} implementationID={portalData.ImplementationID} onClose={() => this.setState({ showManageImages: false })} />}\r\n        {canImport && showCompanyImport && portalData?.ImplementationID && <CompanyImport portalID={portalData.ImplementationID} onClose={() => this.setState({ showCompanyImport: false })} />}\r\n      </>}\r\n      {canImportLocation && showLocationImport && !!companyData && <LocationImport portalID={companyData.ImplementationID} companyID={companyData.AccountID} onClose={() => this.setState({ showLocationImport: false })} />}\r\n      {companyData && showLocation && <EditLocationInformation adminMode portalID={companyData.ImplementationID} companyID={companyData.AccountID} onCancel={() => { this.setState({ showLocation: false })}}/>}\r\n      {companyData && showAdditionalTesting && <AdditionalTesting\r\n        accountID={companyData.AccountID}\r\n        implementationID={companyData.ImplementationID}\r\n        show={this.state.showAdditionalTesting}\r\n        onClose={() => { this.setState({ showAdditionalTesting: false })}} />}\r\n\r\n    </AppPageWrapper>\r\n    )\r\n  }\r\n}\r\n\r\nfunction mapStateToProps(state: AppState): CompanyInformationAuthProps {\r\n  return {\r\n    companyName: SelectedCompanyName(state),\r\n    portalName: SelectedPortalName(state),\r\n    portal: GetSelectedPortal(state),\r\n    isCompanyAdmin: isCompanyAdmin(state),\r\n    isPortalAdmin: isPortalAdmin(state),\r\n    isSiteAdmin: isSiteAdmin(state),\r\n    userAccess: BuildUserAccess(state),\r\n    userName: getUserNameForSelectedCompany(state)\r\n  }\r\n}\r\n\r\nfunction mapDispatchProps(dispatch: Dispatch<Action>): CompanyInformationDispatchProps {\r\n  return {\r\n    reload: () => (dispatch(WorkforceReloadPortalsCompanies(true)))\r\n  }\r\n}\r\n\r\nconst ConnectedCompanyInformation = connect(mapStateToProps, mapDispatchProps)(CompanyInformation)\r\nexport default ConnectedCompanyInformation\r\n","import React from \"react\"\r\nimport { Modal, Form, Col, Button, Spinner } from \"react-bootstrap\"\r\nimport { FaAngleDown } from \"react-icons/fa\"\r\nimport { toast } from \"react-toastify\"\r\nimport { Subscription } from \"rxjs\"\r\nimport Checkbox from \"../../Checkbox\"\r\nimport LabAccountListGet from \"../../../api/Administration/LabAccountListGet\"\r\nimport LabAccount from \"../../../api/Administration/Model/LabAccount\"\r\nimport ActionButton from \"../../ActionButton\"\r\nimport { APIError } from \"../../../api/ObservableFromFetch\"\r\nimport { Typeahead } from \"react-bootstrap-typeahead\"\r\nimport GovGetPanels from \"../../../api/Randoms/GovGetPanels\"\r\nimport { AdditionalTest, GetAdditionalTests, UpdateAdditionalTests } from \"../../../api/Administration/AdditionalTests\"\r\nimport { GovPanel, SampleType } from \"../../../api/Randoms/GovPoolModel/CollectionTypeResponse\"\r\n\r\ninterface AdditionalTestingProps {\r\n  portalMode?: boolean\r\n  locationMode?: boolean\r\n  implementationID: number\r\n  accountID: number\r\n  show: boolean\r\n  onClose: () => void\r\n}\r\n\r\ninterface AdditionalTestingState {\r\n  labAccountsLoading: boolean\r\n  labAccounts: LabAccount[]\r\n  labAccountSelection?: LabAccount\r\n  panelsLoading: boolean\r\n  panels: GovPanel[]\r\n  panelSelection: string[]\r\n  loading: boolean\r\n  saving: boolean\r\n  showConfirmSave: boolean\r\n}\r\n\r\nexport default class AdditionalTesting extends React.PureComponent<AdditionalTestingProps, AdditionalTestingState> {\r\n  subscription?: Subscription\r\n  loadLabAccountsSubscription?: Subscription\r\n  loadPanelSubscription?: Subscription\r\n  labAccountRef = React.createRef<Typeahead<LabAccount>>()\r\n  state: AdditionalTestingState = {\r\n    labAccountSelection: undefined,\r\n    labAccountsLoading: false,\r\n    panelsLoading: false,\r\n    panels: [],\r\n    panelSelection: [],\r\n    loading: false,\r\n    saving: false,\r\n    labAccounts: [],\r\n    showConfirmSave: false,\r\n  }\r\n\r\n  componentDidMount() {\r\n    this.loadLabAccounts()\r\n  }\r\n\r\n  componentDidUpdate(prevProps: AdditionalTestingProps) {\r\n    if (this.props.show && this.props.show !== prevProps.show) {\r\n      this.loadLabAccounts()\r\n    }\r\n  }\r\n\r\n  componentWillUnmount() {\r\n    this.loadLabAccountsSubscription && this.loadLabAccountsSubscription.unsubscribe()\r\n    this.loadPanelSubscription && this.loadPanelSubscription.unsubscribe()\r\n    this.subscription && this.subscription.unsubscribe()\r\n  }\r\n\r\n  onCancel = () => {\r\n    this.props.onClose()\r\n    this.setState({ saving:false, loading:false })\r\n  }\r\n\r\n  onSubmit = () => {\r\n    this.saveData()\r\n  }\r\n\r\n  saveData = () => {\r\n    if (!this.state.labAccountSelection?.LabAccountNumber) {\r\n      return\r\n    }\r\n    this.setState({ saving: true })\r\n    this.subscription = UpdateAdditionalTests(this.props.accountID, this.state.labAccountSelection?.LabAccountNumber, this.state.panels.map(p => p.ID), this.state.panelSelection).subscribe(\r\n      data => {\r\n        this.setState({ saving: false })\r\n        toast.success(data)\r\n        this.onCancel()\r\n      },\r\n      error => this.handleAPIError(error, { saving: false })\r\n    )\r\n  }\r\n\r\n  handleAPIError = (error: Error | APIError, stateChanges: object) => {\r\n    this.setState(stateChanges)\r\n    error && toast.error((error as APIError)?.errorData?.message || error.message)\r\n  }\r\n\r\n  loadLabAccounts() {\r\n    this.setState({ labAccountsLoading: true })\r\n    this.loadLabAccountsSubscription && this.loadLabAccountsSubscription.unsubscribe()\r\n    this.loadLabAccountsSubscription = LabAccountListGet(this.props.implementationID, this.props.accountID, false).subscribe(\r\n      data => this.setState({ labAccounts: data.ActiveLabAccount, labAccountsLoading: false }),\r\n      error => this.handleAPIError(error, { labAccountsLoading: false })\r\n    )\r\n  }\r\n\r\n  loadPanels = (selectedLabAccount?: LabAccount) => {\r\n    if (!selectedLabAccount) {\r\n      return\r\n    }\r\n\r\n    this.setState({ panelsLoading: true, panels: [] })\r\n    this.loadPanelSubscription && this.loadPanelSubscription.unsubscribe()\r\n    this.loadPanelSubscription = GovGetPanels(selectedLabAccount.LabAccountNumber).subscribe(\r\n      (data: SampleType[]) => this.setState({ panelsLoading: false, panels: data.map(st => st.Panels).reduce((acc, val) => acc.concat(val), []) }, () => {\r\n        this.loadAdditionalTests(selectedLabAccount.LabAccountNumber)\r\n      }),\r\n      (error) => this.handleAPIError(error, { panelsLoading: false })\r\n    )\r\n  }\r\n\r\n  loadAdditionalTests = (labAccountNumber: string) => {\r\n    this.setState({ loading: true })\r\n    this.subscription && this.subscription.unsubscribe()\r\n    this.subscription = GetAdditionalTests(this.props.accountID, labAccountNumber).subscribe(\r\n      (data: AdditionalTest[]) => this.setState({ loading: false, panelSelection: data.map(t => t.PanelCode) }),\r\n      (error) => this.handleAPIError(error, { loading: false })\r\n    )\r\n  }\r\n\r\n  handleLabChange = (items: LabAccount[]) => {\r\n    const selectedLab = items[0]\r\n    if (selectedLab === this.state.labAccountSelection) { return }\r\n    this.setState({ labAccounts: [...this.state.labAccounts], labAccountSelection: selectedLab }, () => {\r\n      this.loadPanels(selectedLab)\r\n    })\r\n  }\r\n\r\n  handlePanelChange = (panelId: string) => {\r\n    const newPanelSelection: string[] = this.state.panelSelection.includes(panelId) ? [...this.state.panelSelection.filter(p => p != panelId)] : [...this.state.panelSelection, panelId]\r\n    this.setState({ panelSelection: newPanelSelection })\r\n  }\r\n\r\n  render() {\r\n    const { labAccountsLoading, panelsLoading, loading, saving } = this.state\r\n    const disableSave = !this.state.labAccountSelection?.LabAccountNumber || labAccountsLoading || panelsLoading || loading\r\n\r\n    return (\r\n      <>\r\n        <Modal backdrop=\"static\" show={this.props.show} size=\"xl\">\r\n          <Modal.Header>\r\n            <Modal.Title className=\"text-uppercase\">Additional Testing</Modal.Title>\r\n          </Modal.Header>\r\n          <Modal.Body>\r\n            <div>Select the test codes that you want displayed as Additional Tests for this company</div>\r\n            <Form className=\"px-4\">\r\n              <Form.Row className=\"form-group align-items-center\">\r\n                <Form.Label column sm={4} htmlFor=\"labAccount\">Account Number</Form.Label>\r\n                <Col className=\"text-right\">{labAccountsLoading && <Spinner animation=\"border\" variant=\"secondary\" size=\"sm\" style={{ margin: \"auto\" }} />}</Col>\r\n                <Col sm={7}>\r\n                  {<Typeahead id=\"labAccount\"\r\n                    ref={this.labAccountRef}\r\n                    labelKey=\"LabAccountNumber\"\r\n                    emptyLabel=\"No Laboratory Accounts Found\"\r\n                    disabled={labAccountsLoading}\r\n                    //filterBy={(option, props) => showLabForSelectedCollectionType(option, this.state.sampleTypes.selected?.Description || \"\")}\r\n                    onChange={this.handleLabChange}\r\n                    options={this.state.labAccounts || []}\r\n                    selected={this.state.labAccountSelection ? [this.state.labAccountSelection] : []}\r\n                    placeholder=\"Enter the Lab Account\">\r\n                    <Button variant=\"toggle\"\r\n                      disabled={labAccountsLoading}\r\n                      onClick={() => { this.labAccountRef.current?.toggleMenu() }}>\r\n                      <FaAngleDown />\r\n                    </Button>\r\n                  </Typeahead>}\r\n                </Col>\r\n              </Form.Row>\r\n              {panelsLoading && <Spinner animation=\"border\" variant=\"secondary\" size=\"sm\" style={{ margin: \"auto\" }} />}\r\n              <Form.Row className=\"form-group align-items-center\">\r\n                {this.state.panels.map((item: GovPanel, key: number) => <Col md={6} key={key}><Checkbox key={`panel-${item.ID}`} id={`panel-${item.ID}`} label={item.Name} value={item.ID} onChange={(e) => this.handlePanelChange(e.target.value)} checked={this.state.panelSelection.includes(item.ID)} /></Col>)}\r\n              </Form.Row>\r\n              {(panelsLoading || loading) && <Spinner animation=\"border\" variant=\"secondary\" size=\"sm\" style={{ margin: \"auto\" }} />}\r\n            </Form>\r\n          </Modal.Body>\r\n          <Modal.Footer>\r\n            <Button variant=\"secondary\" onClick={this.onCancel} className=\"px-4\">Cancel</Button>\r\n            <ActionButton onClick={this.onSubmit} className=\"px-4\" spin={saving} disableOnSpin disabled={disableSave}>Update</ActionButton>\r\n          </Modal.Footer>\r\n        </Modal>\r\n      </>\r\n    )\r\n  }\r\n\r\n}\r\n","import React from \"react\"\r\nimport { connect } from \"react-redux\"\r\nimport { RouteComponentProps } from \"react-router\"\r\nimport { AppState } from \"../../AppState\"\r\nimport { GetSelectedAssignedClinic, GetSelectedPortal } from \"../../authentication/SelectedCompany/CompanySelectionDrivenSelectors\"\r\nimport { Home } from \"../../config/Routes\"\r\nimport { AppPageWrapper } from \"../NavMenu/AppPageWrapper\"\r\nimport { EditLocationInformation } from \"./EditLocationInformation\"\r\n\r\ninterface LocationInformationProps extends RouteComponentProps { }\r\n\r\ninterface LocationInformationAuthProps {\r\n  portalID: number\r\n  companyID: number\r\n  locationID: number\r\n}\r\n\r\nexport class LocationInformation extends React.PureComponent<LocationInformationProps & LocationInformationAuthProps> {\r\n  handleCancel = () => this.props.history.push(Home)\r\n\r\n  render() {\r\n    const { portalID, companyID, locationID } = this.props\r\n    return <AppPageWrapper showNav>\r\n      <EditLocationInformation adminMode={false} portalID={portalID} companyID={companyID} locationID={locationID} onCancel={this.handleCancel} />\r\n    </AppPageWrapper>\r\n  }\r\n} \r\n\r\nfunction mapStateToProps(state: AppState): LocationInformationAuthProps {\r\n  const selectedCompany =  GetSelectedAssignedClinic(state)\r\n  return {\r\n    portalID: GetSelectedPortal(state)?.ImplementationID || 0,\r\n    companyID: selectedCompany?.AccountID || 0,\r\n    locationID: selectedCompany?.LocationID || 0\r\n  }\r\n}\r\nexport default connect(mapStateToProps)(LocationInformation)\r\n","import * as React from \"react\"\r\nimport { RouteComponentProps } from \"react-router\"\r\nimport CompanyInformation from \"./CompanyInformation\"\r\n\r\nexport default class MyOrganization extends React.Component<RouteComponentProps> {\r\n  render() {\r\n    return <CompanyInformation {...this.props} portalMode />\r\n  }\r\n}\r\n","import OrphanedGridResponse from \"./Models/OrphanedGridResponse\"\r\nimport { Filter, Sort } from \"../GridRequest\"\r\nimport { ObservableFromFetch } from \"../ObservableFromFetch\"\r\n\r\nexport function OrphanedGridGet(pageNumber: number, pageSize: number, sort: Sort, filters: Filter[]) {\r\n  const requestBody = JSON.stringify({\r\n    Filters: {\r\n      DateCollected: filters.find(item => item.column === \"DateCollected\")?.values || [],\r\n      DonorID: filters.find(item => item.column === \"DonorID\")?.values || [],\r\n      FirstName: filters.find(item => item.column === \"FirstName\")?.values || [],\r\n      LabAccountNumber: filters.find(item => item.column === \"LabAccountNumber\")?.values || [],\r\n      LastName: filters.find(item => item.column === \"LastName\")?.values || [],\r\n      CompanyName: filters.find(item => item.column === \"CompanyName\")?.values || [],\r\n      Reason: filters.find(item => item.column === \"Reason\")?.values || [],\r\n      ReferenceID: filters.find(item => item.column === \"ReferenceID\")?.values || [],\r\n      TestType: filters.find(item => item.column === \"TestType\")?.values || [],\r\n      ImportException: filters.find(item => item.column === \"ImportException\")?.values || [],\r\n    },\r\n    PageNumber: pageNumber,\r\n    PageSize: pageSize,\r\n    SortGrid: { SortColumn: sort.column, SortOrder: sort.order }\r\n  })\r\n\r\n  return ObservableFromFetch<OrphanedGridResponse>(\"WorkforceTrack/GetOrphanedRecords\", requestBody)\r\n}\r\n\r\nexport function OrphanedAccept(tests: { TestDetailID: number | string, AccountID?: number, TestDetailClinicalID: number | string }[]) {\r\n  const requestBody = JSON.stringify(tests)\r\n\r\n  return ObservableFromFetch<OrphanedGridResponse>(\"WorkforceTrack/ResolveOrphanedRecords\", requestBody)\r\n}\r\n\r\nexport function OrphanedDelete(tests: { TestDetailID: number | string, TestDetailClinicalID: number | string }[]) {\r\n  const requestBody = JSON.stringify(tests)\r\n\r\n  return ObservableFromFetch<OrphanedGridResponse>(\"WorkforceTrack/DeleteOrphanedRecords\", requestBody)\r\n}\r\n\r\nexport function OrphanedRecordsCount() {\r\n  return ObservableFromFetch<number>(\"WorkforceTrack/GetOrphanedRecordsCount\")\r\n}\r\n","import { OrphanedDonor } from \"../../../api/OrderRequests/OrderRequestsModel/Donor\"\r\n\r\nfunction DonorIdsCell(donor: OrphanedDonor) {\r\n  const { SSN, EmployerID, DriverID, AlternateID } = donor\r\n\r\n  return (\r\n    <td>\r\n      {SSN && SSN.length > 0 && (\r\n        <div>\r\n          <b className=\"text-secondary fw-600\">SSN:</b> {SSN}\r\n        </div>\r\n      )}\r\n      {EmployerID && EmployerID.length > 0 && (\r\n        <div>\r\n          <b className=\"text-secondary fw-600\">EmployerID:</b> {EmployerID}\r\n        </div>\r\n      )}\r\n      {DriverID && DriverID.length > 0 && (\r\n        <div>\r\n          <b className=\"text-secondary fw-600\">DriverID:</b> {DriverID}\r\n        </div>\r\n      )}\r\n      {AlternateID && AlternateID.length > 0 && (\r\n        <div>\r\n          <b className=\"text-secondary fw-600\">AlternateID:</b> {AlternateID}\r\n        </div>\r\n      )}\r\n    </td>\r\n  )\r\n}\r\n\r\nexport default DonorIdsCell\r\n","import { ChangeEvent } from \"react\"\r\n\r\nimport { Form } from \"react-bootstrap\"\r\n\r\nimport DonorIdsCell from \"./DonorIdsCell\"\r\nimport { OrphanedDonor } from \"../../../api/OrderRequests/OrderRequestsModel/Donor\"\r\n\r\ninterface OrphanedDonorParams {\r\n  donor: OrphanedDonor\r\n  selected?: boolean\r\n  onSelectDonor: (donorId: number) => void\r\n}\r\n\r\nfunction DonorRow(params: OrphanedDonorParams) {\r\n  const { donor, selected, onSelectDonor } = params\r\n  const { PersonID, FirstName, LastName, Company, Location } = donor\r\n\r\n  const handleChange = (e: ChangeEvent<HTMLInputElement>) => {\r\n    onSelectDonor(Number(e.target.value))\r\n  }\r\n\r\n  return (\r\n    <tr>\r\n      <td>\r\n        <Form.Check\r\n          type=\"checkbox\"\r\n          name=\"orphaned-donor\"\r\n          id={`od_${PersonID}`}\r\n          className=\"abc-checkbox abc-checkbox-primary d-flex justify-content-center align-middle\"\r\n          value={PersonID}\r\n          label=\"\"\r\n          checked={selected}\r\n          onChange={handleChange}\r\n        />\r\n      </td>\r\n      <td>{FirstName}</td>\r\n      <td>{LastName}</td>\r\n      {DonorIdsCell(donor)}\r\n      <td>{Company}</td>\r\n      <td>{Location}</td>\r\n    </tr>\r\n  )\r\n}\r\n\r\nexport default DonorRow\r\n","enum ImportErrorType {\r\n  NoMatchingRandom = 0,\r\n  NoMatchingTest = 1,\r\n}\r\n\r\nexport default ImportErrorType\r\n","import DonorGridData from \"./Models/DonorGridData\"\r\nimport DonorGridOptions from \"./Models/DonorGridOptions\"\r\nimport ImportErrorType from \"./Models/NoMatchingErrorType\"\r\nimport OrphanedDonorAcceptOptions from \"./Models/OrphanedDonorAcceptOptions\"\r\nimport OrphanedRow from \"./Models/OrphanedRow\"\r\nimport PendingClinicalTest from \"./Models/PendingClinicalTest\"\r\nimport PendingClinicalTestGridData from \"./Models/PendingClinicalTestGridData\"\r\nimport PendingClinicalTestOptions from \"./Models/PendingClinicalTestOptions\"\r\nimport PendingDrugTest from \"./Models/PendingDrugTest\"\r\nimport PendingDrugTestGridData from \"./Models/PendingDrugTestGridData\"\r\nimport PendingDrugTestOptions from \"./Models/PendingDrugTestOptions\"\r\nimport { ObservableFromFetch } from \"../ObservableFromFetch\"\r\n\r\nexport function GetPendingDrugTestsObservable(options: PendingDrugTestOptions) {\r\n  const requestBody: string = JSON.stringify(options)\r\n  return ObservableFromFetch<PendingDrugTestGridData>(\"WorkforceResultExceptions/PendingDrugTests\", requestBody)\r\n}\r\n\r\nexport function GetPendingClinicalTestsObservable(options: PendingClinicalTestOptions) {\r\n  const requestBody: string = JSON.stringify(options)\r\n  return ObservableFromFetch<PendingClinicalTestGridData>(\"WorkforceResultExceptions/PendingClinicalTests\", requestBody)\r\n}\r\n\r\nexport function GetDonorsObservable(parameters: DonorGridOptions) {\r\n  const requestBody: string = JSON.stringify(parameters)\r\n  return ObservableFromFetch<DonorGridData>(\"WorkforceResultExceptions/SearchDonors\", requestBody)\r\n}\r\n\r\nexport function NoMatchingRandomAcceptObservable(importTestDetail: OrphanedRow, pendingTestDetail: PendingDrugTest) {\r\n  const requestBody: string = JSON.stringify({\r\n    ImportTestDetailID: importTestDetail.TestDetailID,\r\n    PendingTestDetailID: pendingTestDetail.TestDetailID,\r\n    KeepTestReason: importTestDetail.Reason === \"Random\" && pendingTestDetail.Reason !== \"RAN\",\r\n    ImportErrorType: ImportErrorType.NoMatchingRandom,\r\n    TestDetailImportID: importTestDetail.TestDetailImportID,\r\n    TestImportExceptionID: importTestDetail.TestImportExceptionID,\r\n  })\r\n  return ObservableFromFetch<string>(\"WorkforceResultExceptions/NoMatchingAccept\", requestBody)\r\n}\r\n\r\nexport function NoMatchingTestAcceptObservable(importTestDetail: OrphanedRow, pendingTestDetail: PendingDrugTest) {\r\n  const requestBody: string = JSON.stringify({\r\n    ImportTestDetailID: importTestDetail.TestDetailID,\r\n    PendingTestDetailID: pendingTestDetail.TestDetailID,\r\n    KeepTestReason: true,\r\n    ImportErrorType: ImportErrorType.NoMatchingTest,\r\n    TestDetailImportID: importTestDetail.TestDetailImportID,\r\n    TestImportExceptionID: importTestDetail.TestImportExceptionID,\r\n  })\r\n  return ObservableFromFetch<string>(\"WorkforceResultExceptions/NoMatchingAccept\", requestBody)\r\n}\r\nexport function NoMatchingTestAcceptClinicalObservable(\r\n  importTestDetail: OrphanedRow,\r\n  pendingTestDetail: PendingClinicalTest\r\n) {\r\n  const requestBody: string = JSON.stringify({\r\n    ImportTestDetailID: importTestDetail.TestDetailID,\r\n    PendingTestDetailClinicalID: pendingTestDetail.TestDetailClinicalID,\r\n    KeepTestReason: true,\r\n    ImportErrorType: ImportErrorType.NoMatchingTest,\r\n    TestDetailImportID: importTestDetail.TestDetailImportID,\r\n    TestImportExceptionID: importTestDetail.TestImportExceptionID,\r\n  })\r\n  return ObservableFromFetch<string>(\"WorkforceResultExceptions/NoMatchingAcceptClinical\", requestBody)\r\n}\r\n\r\nexport function NoAccountAcceptObservable(\r\n  labAccount: string,\r\n  accountID: number,\r\n  testDetailImportID: number,\r\n  testImportExceptionID: number\r\n) {\r\n  const requestBody: string = JSON.stringify({\r\n    LabAccount: labAccount,\r\n    AccountID: accountID,\r\n    TestDetailImportID: testDetailImportID,\r\n    TestImportExceptionID: testImportExceptionID,\r\n  })\r\n  return ObservableFromFetch<string>(\"WorkforceResultExceptions/NoAccountAccept\", requestBody)\r\n}\r\n\r\nexport function DonorNotFoundAcceptObservable(options: OrphanedDonorAcceptOptions) {\r\n  const requestBody: string = JSON.stringify(options)\r\n  return ObservableFromFetch<string>(\"WorkforceResultExceptions/DonorNotFoundAccept\", requestBody)\r\n}\r\n\r\nexport function NoMatchingCreateNewObservable(importTestDetail: OrphanedRow) {\r\n  const requestBody: string = JSON.stringify({\r\n    ImportTestDetailID: importTestDetail.TestDetailID,\r\n    TestDetailImportID: importTestDetail.TestDetailImportID,\r\n    TestImportExceptionID: importTestDetail.TestImportExceptionID,\r\n  })\r\n  return ObservableFromFetch<string>(\"WorkforceResultExceptions/NoMatchingCreateNew\", requestBody)\r\n}\r\n","import { Dispatch, SetStateAction, useEffect, useMemo, useState } from \"react\"\r\n\r\nimport { Spinner, Table } from \"react-bootstrap\"\r\nimport { toast } from \"react-toastify\"\r\nimport { BehaviorSubject } from \"rxjs\"\r\nimport { filter, finalize, switchMap } from \"rxjs/operators\"\r\n\r\nimport DonorRow from \"./DonorRow\"\r\nimport { OrphanedDonor } from \"../../../api/OrderRequests/OrderRequestsModel/Donor\"\r\nimport DonorGridData from \"../../../api/OrphanedResults/Models/DonorGridData\"\r\nimport DonorGridOptions from \"../../../api/OrphanedResults/Models/DonorGridOptions\"\r\nimport PendingDrugTest from \"../../../api/OrphanedResults/Models/PendingDrugTest\"\r\nimport { GetDonorsObservable } from \"../../../api/OrphanedResults/ResultExceptionsProcess\"\r\nimport FormatError from \"../../../formatters/FormatError\"\r\nimport TablePagination from \"../../TablePagination\"\r\n\r\nconst headerColumns = [\"First Name\", \"Last Name\", \"IDs\", \"Company\", \"Location\"]\r\nconst PageSize = 5\r\n\r\ninterface DonorGridParams {\r\n  search: { field: string; text: string }\r\n  donorId: number\r\n  testID: number\r\n  setDonorID: Dispatch<SetStateAction<number>>\r\n  setSelectedTest: Dispatch<SetStateAction<PendingDrugTest | undefined>>\r\n}\r\n\r\nfunction DonorGrid(props: DonorGridParams) {\r\n  const { search, donorId, testID, setDonorID, setSelectedTest } = props\r\n  const [gridData, setGridData] = useState<DonorGridData>({ Records: [], Pages: 0, Total: 0 })\r\n  const [loading, setLoading] = useState(false)\r\n  const page$ = useMemo(\r\n    () =>\r\n      new BehaviorSubject<DonorGridOptions>({\r\n        search,\r\n        testID,\r\n        pageNumber: 1,\r\n        pageSize: PageSize,\r\n      }),\r\n    [search, testID]\r\n  )\r\n\r\n  useEffect(() => {\r\n    setLoading(true)\r\n    const subs = page$\r\n      .pipe(\r\n        filter((params) => params.search.text.length > 0 || params.testID > 0),\r\n        switchMap((params) =>\r\n          GetDonorsObservable(params).pipe(\r\n            finalize(() => {\r\n              setLoading(false)\r\n            })\r\n          )\r\n        )\r\n      )\r\n      .subscribe(\r\n        (data) => {\r\n          setGridData(data)\r\n          if (data.Records.length === 1) {\r\n            setDonorID(data.Records[0].PersonID)\r\n          } else {\r\n            setDonorID(0)\r\n          }\r\n        },\r\n        (error) => toast.error(FormatError(error))\r\n      )\r\n    return () => subs.unsubscribe()\r\n  }, [page$, search.text, setDonorID])\r\n\r\n  const handleChangePage = (page: number) => {\r\n    setLoading(true)\r\n    page$.next({ ...page$.value, search, pageNumber: page })\r\n  }\r\n\r\n  const handleSelectDonor = (donorID: number) => {\r\n    setSelectedTest(undefined)\r\n    setDonorID(donorId === donorID ? 0 : donorID)\r\n  }\r\n\r\n  return (\r\n    <>\r\n      <Table className=\"table table-bordered\">\r\n        <thead className=\"thead-light\">\r\n          <tr>\r\n            <th className=\"col-1\" aria-label=\"...\" />\r\n            {headerColumns.map((el) => (\r\n              <th key={`dh_${el}`}>{el}</th>\r\n            ))}\r\n          </tr>\r\n        </thead>\r\n        <tbody className=\"bg-light\">\r\n          {loading && (\r\n            <tr>\r\n              <td colSpan={headerColumns.length + 1}>\r\n                <Spinner animation=\"border\" variant=\"secondary\" />\r\n              </td>\r\n            </tr>\r\n          )}\r\n          {!loading &&\r\n            (gridData.Records.length > 0 ? (\r\n              gridData.Records.map((row: OrphanedDonor) => (\r\n                <DonorRow\r\n                  key={`donor_${row.PersonID}`}\r\n                  donor={row}\r\n                  onSelectDonor={handleSelectDonor}\r\n                  selected={donorId === row.PersonID}\r\n                />\r\n              ))\r\n            ) : (\r\n              <tr>\r\n                <td colSpan={headerColumns.length + 1}>NO DATA FOUND</td>\r\n              </tr>\r\n            ))}\r\n        </tbody>\r\n      </Table>\r\n      {gridData.Records.length > 0 && (\r\n        <>\r\n          <span className=\"total-records\">Total records: {gridData.Total}</span>\r\n          <TablePagination pageNumber={page$.value.pageNumber} pages={gridData.Pages} onChange={handleChangePage} />\r\n        </>\r\n      )}\r\n    </>\r\n  )\r\n}\r\n\r\nexport default DonorGrid\r\n","import { ChangeEvent } from \"react\"\r\n\r\nimport { Form } from \"react-bootstrap\"\r\n\r\nimport PendingDrugTest from \"../../../api/OrphanedResults/Models/PendingDrugTest\"\r\nimport FormatDate from \"../../../formatters/FormatDate\"\r\n\r\ninterface PendingDrugTestProps {\r\n  test: PendingDrugTest\r\n  selected?: boolean\r\n  highlighted?: boolean\r\n  disabled?: boolean\r\n  hideCheckbox?: boolean\r\n  onSelect: (testId: string) => void\r\n}\r\n\r\nfunction PendingDrugTestRow({\r\n  test,\r\n  disabled = false,\r\n  hideCheckbox = false,\r\n  highlighted = false,\r\n  selected = false,\r\n  onSelect,\r\n}: PendingDrugTestProps) {\r\n  const handleChange = (e: ChangeEvent<HTMLInputElement>) => {\r\n    onSelect(e.target.value)\r\n  }\r\n\r\n  const isNotWithinCurrentProgramYear = () => {\r\n    const currentProgramYear = new Date().getFullYear()\r\n    const testProgramYear = test.ProgramStartDate?.getFullYear()\r\n    // const dateOrderedYear = test.DateOrdered?.getFullYear()\r\n    return !!testProgramYear && currentProgramYear !== testProgramYear\r\n  }\r\n\r\n  const isLess90Days = () => {\r\n    const createdDate = test.DateOrdered\r\n    if (createdDate !== undefined) {\r\n      const timeDiff = new Date().getTime() - createdDate.getTime()\r\n      const daysDiff = Math.round(timeDiff / (1000 * 3600 * 24))\r\n      return daysDiff < 90\r\n    }\r\n    return false\r\n  }\r\n\r\n  const rowClassName = () => {\r\n    const classes: string[] = []\r\n    const notCurrentYear = isNotWithinCurrentProgramYear()\r\n    if (notCurrentYear) classes.push(\"disabled\")\r\n    if (highlighted && isLess90Days() && !(notCurrentYear || disabled)) classes.push(\"bg-row-highlight\")\r\n\r\n    return classes.join(\" \")\r\n  }\r\n\r\n  return (\r\n    <tr\r\n      className={rowClassName()}\r\n      title={isNotWithinCurrentProgramYear() ? \"The test not within the current program year\" : \"\"}\r\n    >\r\n      <td className=\"align-middle\">\r\n        {!hideCheckbox && (\r\n          <Form.Check\r\n            type=\"checkbox\"\r\n            name=\"pending-test-detail\"\r\n            id={`ptd_${test.TestDetailID}`}\r\n            className=\"abc-checkbox abc-checkbox-primary d-flex justify-content-center align-middle\"\r\n            value={test.TestDetailID}\r\n            label=\"\"\r\n            disabled={disabled || isNotWithinCurrentProgramYear()}\r\n            checked={selected}\r\n            readOnly\r\n            onChangeCapture={handleChange}\r\n          />\r\n        )}\r\n      </td>\r\n      <td title={test.Reason}>{test.ReasonDescription}</td>\r\n      <td>{test.PoolID}</td>\r\n      <td>{test.Regulated}</td>\r\n      <td>{test.SampleType}</td>\r\n      <td>{FormatDate(test.DateOrdered)}</td>\r\n    </tr>\r\n  )\r\n}\r\n\r\nexport default PendingDrugTestRow\r\n","import { useEffect, useMemo, useState } from \"react\"\r\n\r\nimport { Col, Row } from \"react-bootstrap\"\r\nimport { BehaviorSubject, concat, of } from \"rxjs\"\r\nimport { catchError, distinctUntilChanged, map, switchMap } from \"rxjs/operators\"\r\n\r\nimport PendingDrugTestRow from \"./PendingDrugTestRow\"\r\nimport ApiResult from \"../../../api/ApiResult\"\r\nimport OrphanedRow from \"../../../api/OrphanedResults/Models/OrphanedRow\"\r\nimport PendingDrugTest from \"../../../api/OrphanedResults/Models/PendingDrugTest\"\r\nimport PendingDrugTestGridData from \"../../../api/OrphanedResults/Models/PendingDrugTestGridData\"\r\nimport PendingDrugTestOptions from \"../../../api/OrphanedResults/Models/PendingDrugTestOptions\"\r\nimport { GetPendingDrugTestsObservable } from \"../../../api/OrphanedResults/ResultExceptionsProcess\"\r\nimport handleAPIError from \"../../../utils/handleAPIError\"\r\nimport Checkbox from \"../../Checkbox\"\r\nimport LoadingTableBodyWrapper from \"../../LoadingTableBodyWrapper\"\r\nimport LoadingTableWrapper from \"../../LoadingTableWrapper\"\r\nimport TablePagination from \"../../TablePagination\"\r\n\r\nconst PageSize = 5\r\ninterface PendingDrugTestsProps {\r\n  donorId: number\r\n  importTest: OrphanedRow\r\n  selectedTest?: PendingDrugTest\r\n  showTitle?: boolean\r\n  onSelectTest: (test: PendingDrugTest | undefined) => void\r\n}\r\n\r\nfunction PendingDrugTests({\r\n  donorId,\r\n  importTest,\r\n  selectedTest = undefined,\r\n  showTitle = true,\r\n  onSelectTest,\r\n}: PendingDrugTestsProps) {\r\n  const [gridData, setGridData] = useState<PendingDrugTestGridData>({ Records: [], Pages: 0, Total: 0 })\r\n  const [loadingTests, setLoadingTests] = useState<boolean>(false)\r\n\r\n  const page$ = useMemo(\r\n    () =>\r\n      new BehaviorSubject<PendingDrugTestOptions>({\r\n        DonorID: donorId,\r\n        TestTypeID: importTest.TestTypeID,\r\n        SampleTypeCode: importTest.SampleTypeCode,\r\n        PageNumber: 1,\r\n        PageSize,\r\n      }),\r\n    [donorId, importTest.TestTypeID, importTest.SampleTypeCode]\r\n  )\r\n\r\n  useEffect(() => {\r\n    const subscription = page$\r\n      .pipe(\r\n        distinctUntilChanged(),\r\n        switchMap((params) =>\r\n          concat(\r\n            of({ loading: true }),\r\n            GetPendingDrugTestsObservable(params).pipe(\r\n              map((result) => ({ loading: false, result })),\r\n              catchError((error) => of({ loading: false, result: undefined, error }))\r\n            )\r\n          )\r\n        )\r\n      )\r\n      .subscribe(\r\n        ({ loading, result, error }: ApiResult<PendingDrugTestGridData>) => {\r\n          setLoadingTests(loading)\r\n\r\n          if (!loading) {\r\n            const parsedRecords = result?.Records.map((test) => ({\r\n              ...test,\r\n              DateOrdered: test.DateOrdered ? new Date(test.DateOrdered) : undefined,\r\n              ProgramStartDate: test.ProgramStartDate ? new Date(test.ProgramStartDate) : undefined,\r\n              ProgramEndDate: test.ProgramEndDate ? new Date(test.ProgramEndDate) : undefined,\r\n            }))\r\n\r\n            setGridData({\r\n              ...result,\r\n              Records: parsedRecords || [],\r\n              Pages: result?.Pages ?? 0,\r\n              Total: result?.Total ?? 0,\r\n            })\r\n          }\r\n\r\n          handleAPIError(error)\r\n        },\r\n        (error) => handleAPIError(error, () => setLoadingTests(false))\r\n      )\r\n    return () => subscription.unsubscribe()\r\n  }, [page$])\r\n\r\n  const handleSelectTest = (testId: string | undefined) => {\r\n    const selected = gridData.Records.find((t) => t.TestDetailID === testId)\r\n    onSelectTest(selected?.TestDetailID === selectedTest?.TestDetailID ? undefined : selected)\r\n  }\r\n\r\n  const handleChangePage = (page: number) => {\r\n    handleSelectTest(undefined)\r\n    page$.next({ ...page$.value, PageNumber: page })\r\n  }\r\n\r\n  return (\r\n    <>\r\n      <Row>\r\n        <Col>{showTitle && <h5 className=\"text-body\">Pending Drug Tests</h5>}</Col>\r\n      </Row>\r\n      <LoadingTableWrapper loading={loadingTests} variant=\"light\" withHeader>\r\n        <table className=\"table table-bordered\">\r\n          <thead className=\"thead-light\">\r\n            <tr>\r\n              <th className=\"text-center col-1\" aria-label=\"...\" />\r\n              <th className=\"text-nowrap\">Reason</th>\r\n              <th className=\"text-nowrap col-2\">PoolID</th>\r\n              <th className=\"text-nowrap col-2\">Regulated</th>\r\n              <th className=\"text-nowrap\">Type</th>\r\n              <th className=\"text-nowrap col-2\">Created</th>\r\n            </tr>\r\n          </thead>\r\n          <tbody className=\"bg-light\">\r\n            <LoadingTableBodyWrapper\r\n              loading={loadingTests}\r\n              recordsCount={gridData.Records.length}\r\n              columnsCount={6}\r\n              noDataText=\"No Tests Found\"\r\n            >\r\n              {gridData.Records.map((test: PendingDrugTest) => (\r\n                <PendingDrugTestRow\r\n                  key={`pdt_${test.TestDetailID}`}\r\n                  test={test}\r\n                  highlighted={importTest.Reason === test.ReasonDescription}\r\n                  hideCheckbox={test.ReasonDescription === \"Random\" && importTest.Reason !== test.ReasonDescription}\r\n                  selected={selectedTest?.TestDetailID === test.TestDetailID}\r\n                  onSelect={handleSelectTest}\r\n                />\r\n              ))}\r\n            </LoadingTableBodyWrapper>\r\n          </tbody>\r\n        </table>\r\n      </LoadingTableWrapper>\r\n      {gridData.Records.length > 0 && (\r\n        <Row>\r\n          <Col sm={2}>Total records: {gridData.Total}</Col>\r\n          <Col>\r\n            <TablePagination\r\n              pageNumber={page$.value.PageNumber}\r\n              pages={gridData.Pages}\r\n              onChange={handleChangePage}\r\n              className=\"mb-0\"\r\n            />\r\n          </Col>\r\n        </Row>\r\n      )}\r\n    </>\r\n  )\r\n}\r\n\r\nexport default PendingDrugTests\r\n","import { Button } from \"react-bootstrap\"\r\n\r\nimport PendingDrugTest from \"../../../api/OrphanedResults/Models/PendingDrugTest\"\r\nimport ActionButton from \"../../ActionButton\"\r\n\r\ninterface PendingDrugTestsButtonsProps {\r\n  selectedTest?: PendingDrugTest\r\n  selectedDonor?: boolean\r\n  disabled?: boolean\r\n  acceptSpin?: boolean\r\n  createNewSpin?: boolean\r\n  onCancel: () => void\r\n  onCreateNew: () => void\r\n  onAccept: () => void\r\n}\r\n\r\nfunction PendingDrugTestsButtons({\r\n  selectedTest = undefined,\r\n  selectedDonor = false,\r\n  disabled = false,\r\n  acceptSpin = false,\r\n  createNewSpin = false,\r\n  onCancel,\r\n  onCreateNew,\r\n  onAccept,\r\n}: PendingDrugTestsButtonsProps) {\r\n  return (\r\n    <>\r\n      <Button variant=\"primary\" onClick={onCancel}>\r\n        Cancel\r\n      </Button>\r\n      <ActionButton\r\n        variant=\"secondary\"\r\n        onClick={onCreateNew}\r\n        disabled={!!selectedTest || disabled || !!selectedDonor}\r\n        spin={createNewSpin}\r\n      >\r\n        Create New\r\n      </ActionButton>\r\n      <ActionButton\r\n        variant=\"secondary\"\r\n        onClick={onAccept}\r\n        disabled={(!selectedTest && !selectedDonor) || disabled}\r\n        spin={acceptSpin}\r\n      >\r\n        Accept\r\n      </ActionButton>\r\n    </>\r\n  )\r\n}\r\n\r\nexport default PendingDrugTestsButtons\r\n","export enum ImportExceptionSubType {\r\n    InvalidCompany = 1,\r\n    InvalidLocation = 2,\r\n    CompanyInactive = 3,\r\n    //  LabAccountNotFound = 4,\r\n    LabAccountAssignedMorethanOneCompany = 5,\r\n    LabAccountNotFoundorNotAssignedtoaCompany = 6,\r\n\r\n    InvalidReasonForTest = 1001,\r\n    MoreThanOneTestMatch = 1002,\r\n    TestDoesNotExist = 1003,\r\n    ExistingPendingRandom = 1004,\r\n    DonorDoesNotExist = 1005,\r\n    InvalidDonorID = 1006,\r\n    MoreThanOneDonorMatch = 1007,\r\n    MatchingDonorIsInactive = 1008,\r\n    DonorDoesNotMatch = 1009,\r\n\r\n    ChangeMROReportDate = 1501,\r\n    ChangeLabReportDate = 1502,\r\n    ChangeLabAccountTo = 1503,\r\n    ChangeLabCodeFrom = 1504,\r\n    ChangeMROResult = 1505,\r\n    ChangeLabResult = 1506,\r\n    ChangeCollectionDate = 1507,\r\n    ChangeSpecimenType = 1508,\r\n    ChangeReasonForTest = 1509,\r\n    ChangeFederalFlag = 1510,\r\n\r\n\r\n    InvalidCollectorName = 2001,\r\n    InvalidCollectionDate = 2002,\r\n    InvalidCollectionSite = 2003,\r\n    InvalidPanelCode = 2004,\r\n    InvalidDOTindicator = 2005,\r\n    InvalidOrderedDate = 2006, // obsolete??\r\n    InvalidLabCode = 2007,\r\n\r\n    InvalidFirstName = 2008,\r\n    InvalidLastName = 2009,\r\n    InvalidPerson = 2010,\r\n    InvalidLocationRelease = 2011,\r\n    InvalidMROCode = 2012\r\n}\r\n\r\n\r\n","import { useState } from \"react\"\r\n\r\nimport { Col, Modal, ModalBody, ModalTitle, Row } from \"react-bootstrap\"\r\nimport ModalHeader from \"react-bootstrap/esm/ModalHeader\"\r\nimport { toast } from \"react-toastify\"\r\nimport { finalize } from \"rxjs/operators\"\r\n\r\nimport DonorGrid from \"./DonorGrid\"\r\nimport OrphanedRow from \"../../../api/OrphanedResults/Models/OrphanedRow\"\r\nimport PendingDrugTest from \"../../../api/OrphanedResults/Models/PendingDrugTest\"\r\nimport { DonorNotFoundAcceptObservable } from \"../../../api/OrphanedResults/ResultExceptionsProcess\"\r\nimport FormatError from \"../../../formatters/FormatError\"\r\nimport AddIndividualModal from \"../../Randomization/AddIndividualModal\"\r\nimport { DraggableModalDialog } from \"../../Randomization/GovPools/RandomSchedulingExclusionsModal\"\r\nimport SearchBar from \"../../SearchBar\"\r\nimport PendingDrugTests from \"../PendingDrugTests/PendingDrugTests\"\r\nimport PendingDrugTestsButtons from \"../PendingDrugTests/PendingDrugTestsButtons\"\r\nimport { ImportExceptionSubType } from \"../../../api/OrphanedResults/Models/ImportExceptionSubType\"\r\n\r\n\r\ninterface DonorNotFoundErrorProps {\r\n  errorRow: OrphanedRow\r\n  onClose: (withUpdate: boolean) => void\r\n}\r\n\r\nconst searchFields = [\r\n  { Name: \"All Personnel IDs\" },\r\n  { Name: \"SSN\" },\r\n  { Name: \"Employer ID\" },\r\n  { Name: \"Driver ID\" },\r\n  { Name: \"Alternate ID\" },\r\n  { Name: \"First Name\" },\r\n  { Name: \"Last Name\" },\r\n  { Name: \"Company\" },\r\n  { Name: \"Location\" },\r\n].map((el) => {\r\n  return { Name: el.Name, ID: el.Name }\r\n})\r\n\r\nfunction DonorNotFoundError(props: DonorNotFoundErrorProps) {\r\n  const { errorRow, onClose } = props\r\n\r\n  const [DonorID, setDonorID] = useState(0)\r\n  const [AddNew, setAddNew] = useState(false)\r\n  const [Search, setSearch] = useState({ field: \"\", text: \"\" })\r\n  const [selectedTest, setSelectedTest] = useState<PendingDrugTest>()\r\n  const [acceptProc, setAcceptProc] = useState(false)\r\n  const testID = errorRow.TestDetailImportID\r\n\r\n  const onCancel = () => {\r\n    onClose(false)\r\n  }\r\n\r\n  const onAccept = () => {\r\n    setAcceptProc(true)\r\n    const acceptOptions = {\r\n      DonorID,\r\n      TestDetailID: errorRow.TestDetailID,\r\n      TestDetailClinicalID: errorRow.TestDetailClinicalID,\r\n      PendingTestDetailID: selectedTest?.TestDetailID,\r\n      PendingClinicalTestDetailID: selectedTest?.TestDetailClinicalID,\r\n      TestDetailImportID: errorRow.TestDetailImportID,\r\n      TestImportExceptionID: errorRow.TestImportExceptionID,\r\n    }\r\n    DonorNotFoundAcceptObservable(acceptOptions)\r\n      .pipe(finalize(() => setAcceptProc(false)))\r\n      .subscribe(\r\n        (data) => {\r\n          toast.success(data)\r\n          onClose(true)\r\n        },\r\n        (error) => toast.error(FormatError(error))\r\n      )\r\n  }\r\n\r\n  const onCreateNew = () => {\r\n    setAddNew(true)\r\n  }\r\n\r\n  const handleSearch = (field: string, text: string) => {\r\n    setSelectedTest(undefined)\r\n    setSearch({ field, text })\r\n  }\r\n\r\n  const handleSaveDonor = (donorID?: number) => {\r\n    setAddNew(false)\r\n    if (donorID) setSearch({ field: \"PersonID\", text: donorID.toString() })\r\n    // if (donorID) PageSubject.next({ ...PageSubject.value, search: { field: \"PersonID\", text: donorID.toString() } })\r\n  }\r\n\r\n  const dialogTitle = (row: OrphanedRow): string => {\r\n    const donorNotFound = \"Donor Not Found Error\" \r\n    const notMatchingRandom = \"No Matching Random Error\"\r\n    if(!row){\r\n      return donorNotFound\r\n    }\r\n    if (!row.ImportException) {\r\n      return donorNotFound\r\n    }\r\n    const importExceptionSubType = row.ImportExceptionSubTypeID\r\n    if ((importExceptionSubType === ImportExceptionSubType.TestDoesNotExist) ||\r\n      (importExceptionSubType === ImportExceptionSubType.MoreThanOneTestMatch)) {\r\n      if (row.ReasonCode?.toUpperCase() === \"RAN\") {\r\n        return notMatchingRandom\r\n      }\r\n    }\r\n    return donorNotFound\r\n  }\r\n  const modalTite = dialogTitle(errorRow)\r\n \r\n  return (\r\n    <Modal dialogAs={DraggableModalDialog} backdrop=\"static\" show size=\"xl\" dialogClassName=\"dark\" onHide={onClose}>\r\n      <ModalHeader closeButton>\r\n        <ModalTitle>{modalTite}</ModalTitle>\r\n      </ModalHeader>\r\n      <ModalBody>\r\n        <Row>\r\n          <Col>\r\n            Search for the Donor to assign to this result Or select Create New to create a new donor and test: .\r\n          </Col>\r\n        </Row>\r\n        <Row className=\"my-3\">\r\n          <Col>\r\n            <SearchBar onSearch={handleSearch} searchFields={searchFields} placeholder=\"All Personnel IDs\" />\r\n          </Col>\r\n        </Row>\r\n        <Row>\r\n          <Col>\r\n            <DonorGrid\r\n              search={Search}\r\n              donorId={DonorID}\r\n              testID={testID}\r\n              setDonorID={setDonorID}\r\n              setSelectedTest={setSelectedTest}\r\n            />\r\n          </Col>\r\n        </Row>\r\n        {DonorID > 0 && !errorRow.IsClinical && (\r\n          <Row>\r\n            <Col>\r\n              <PendingDrugTests\r\n                donorId={DonorID}\r\n                importTest={errorRow}\r\n                selectedTest={selectedTest}\r\n                onSelectTest={setSelectedTest}\r\n              />\r\n            </Col>\r\n          </Row>\r\n        )}\r\n        {AddNew && <AddIndividualModal onCancel={() => setAddNew(false)} show={AddNew} onAdd={handleSaveDonor} />}\r\n      </ModalBody>\r\n      <Modal.Footer>\r\n        <PendingDrugTestsButtons\r\n          selectedTest={selectedTest}\r\n          selectedDonor={DonorID > 0}\r\n          disabled={acceptProc || AddNew}\r\n          acceptSpin={acceptProc}\r\n          createNewSpin={AddNew}\r\n          onCancel={onCancel}\r\n          onAccept={onAccept}\r\n          onCreateNew={onCreateNew}\r\n        />\r\n      </Modal.Footer>\r\n    </Modal>\r\n  )\r\n}\r\n\r\nexport default DonorNotFoundError\r\n","import { useState } from \"react\"\r\n\r\nimport { Button, Col, Modal, Row } from \"react-bootstrap\"\r\nimport { toast } from \"react-toastify\"\r\nimport { finalize } from \"rxjs/operators\"\r\n\r\nimport OrphanedRow from \"../../../api/OrphanedResults/Models/OrphanedRow\"\r\nimport PendingDrugTest from \"../../../api/OrphanedResults/Models/PendingDrugTest\"\r\nimport {\r\n  NoMatchingCreateNewObservable,\r\n  NoMatchingRandomAcceptObservable,\r\n} from \"../../../api/OrphanedResults/ResultExceptionsProcess\"\r\nimport FormatError from \"../../../formatters/FormatError\"\r\nimport { DraggableModalDialog } from \"../../Randomization/GovPools/RandomSchedulingExclusionsModal\"\r\nimport DonorNotFoundError from \"../DonorNotFoundError/DonorNotFoundError\"\r\n\r\nimport PendingDrugTests from \"../PendingDrugTests/PendingDrugTests\"\r\nimport PendingDrugTestsButtons from \"../PendingDrugTests/PendingDrugTestsButtons\"\r\n\r\ninterface NoMatchingRandomErrorProps {\r\n  errorRow: OrphanedRow\r\n  onClose: (withUpdate: boolean) => void\r\n}\r\n\r\nfunction NoMatchingRandomError(props: NoMatchingRandomErrorProps) {\r\n  const { errorRow, onClose } = props\r\n\r\n  const [selectedTest, setSelectedTest] = useState<PendingDrugTest>()\r\n  const [acceptProc, setAcceptProc] = useState(false)\r\n  const [createNewProc, setCreateNewProc] = useState(false)\r\n  const [showDonorNotFound, setDonorNotFound] = useState(false)\r\n  const [hideModal, setHideModal] = useState(false)\r\n\r\n  const onCancel = () => {\r\n    onClose(false)\r\n  }\r\n\r\n  const onAccept = () => {\r\n    if (!selectedTest) {\r\n      return\r\n    }\r\n    setAcceptProc(true)\r\n    NoMatchingRandomAcceptObservable(errorRow, selectedTest)\r\n      .pipe(finalize(() => setAcceptProc(false)))\r\n      .subscribe(\r\n        (data) => {\r\n          toast.success(data)\r\n          onClose(true)\r\n        },\r\n        (error) => toast.error(FormatError(error))\r\n      )\r\n  }\r\n\r\n  const onCreateNew = () => {\r\n    setCreateNewProc(true)\r\n    NoMatchingCreateNewObservable(errorRow)\r\n      .pipe(finalize(() => setCreateNewProc(false)))\r\n      .subscribe(\r\n        (data) => {\r\n          toast.success(data)\r\n          onClose(true)\r\n        },\r\n        (error) => toast.error(FormatError(error))\r\n      )\r\n  }\r\n\r\n  const onChangeDonor = () => {\r\n    setHideModal(true)\r\n    setDonorNotFound(true)\r\n  }\r\n\r\n  const onCloseDonorNotFound = () => {\r\n    setDonorNotFound(false)\r\n    onClose(true)\r\n  }\r\n\r\n  return (\r\n    <>\r\n      {!hideModal && (\r\n        <Modal\r\n          dialogAs={DraggableModalDialog}\r\n          backdrop=\"static\"\r\n          show\r\n          size=\"xl\"\r\n          dialogClassName=\"dark\"\r\n          onHide={() => onClose(false)}\r\n        >\r\n          <Modal.Header closeButton>\r\n            <Modal.Title>No Matching Random Error</Modal.Title>\r\n          </Modal.Header>\r\n          <Modal.Body>\r\n            <Row>\r\n              <Col>Review the current Donors Pending tests and determine if there is a match or create a new test.</Col>\r\n            </Row>\r\n            <PendingDrugTests\r\n              donorId={errorRow.PersonID}\r\n              importTest={errorRow}\r\n              selectedTest={selectedTest}\r\n              onSelectTest={setSelectedTest}\r\n            />\r\n          </Modal.Body>\r\n          <Modal.Footer>\r\n            <PendingDrugTestsButtons\r\n              selectedTest={selectedTest}\r\n              disabled={createNewProc || acceptProc}\r\n              acceptSpin={acceptProc}\r\n              createNewSpin={createNewProc}\r\n              onCancel={onCancel}\r\n              onAccept={onAccept}\r\n              onCreateNew={onCreateNew}\r\n            />\r\n            <Button variant=\"secondary\" onClick={onChangeDonor}>\r\n              Change Donor\r\n            </Button>\r\n          </Modal.Footer>\r\n        </Modal>\r\n      )}\r\n      {errorRow && showDonorNotFound && <DonorNotFoundError errorRow={errorRow} onClose={onCloseDonorNotFound} />}\r\n    </>\r\n  )\r\n}\r\n\r\nexport default NoMatchingRandomError\r\n","import { ChangeEvent } from \"react\"\r\n\r\nimport { Form } from \"react-bootstrap\"\r\n\r\nimport PendingClinicalTest from \"../../../api/OrphanedResults/Models/PendingClinicalTest\"\r\nimport FormatDate from \"../../../formatters/FormatDate\"\r\n\r\ninterface PendingClinicalTestProps {\r\n  test: PendingClinicalTest\r\n  selected?: boolean\r\n  highlighted?: boolean\r\n  disabled?: boolean\r\n  hideCheckbox?: boolean\r\n  onSelect: (testId: string) => void\r\n}\r\n\r\nfunction PendingClinicalTestRow({\r\n  test,\r\n  disabled = false,\r\n  hideCheckbox = false,\r\n  highlighted = false,\r\n  selected = false,\r\n  onSelect,\r\n}: PendingClinicalTestProps) {\r\n  const handleChange = (e: ChangeEvent<HTMLInputElement>) => {\r\n    onSelect(e.target.value)\r\n  }\r\n\r\n  const isLess90Days = () => {\r\n    const createdDate = test.DateOrdered\r\n    if (createdDate !== undefined) {\r\n      const timeDiff = new Date().getTime() - createdDate.getTime()\r\n      const daysDiff = Math.round(timeDiff / (1000 * 3600 * 24))\r\n      return daysDiff < 90\r\n    }\r\n    return false\r\n  }\r\n\r\n  const rowClassName = () => {\r\n    const classes: string[] = []\r\n    if (highlighted && isLess90Days() && !disabled) classes.push(\"bg-row-highlight\")\r\n\r\n    return classes.join(\" \")\r\n  }\r\n\r\n  return (\r\n    <tr className={rowClassName()} title=\"\">\r\n      <td className=\"align-middle\">\r\n        {!hideCheckbox && (\r\n          <Form.Check\r\n            type=\"checkbox\"\r\n            name=\"pending-clinical-test-detail\"\r\n            id={`pct_${test.TestDetailClinicalID}`}\r\n            className=\"abc-checkbox abc-checkbox-primary d-flex justify-content-center align-middle\"\r\n            value={test.TestDetailClinicalID}\r\n            label=\"\"\r\n            disabled={disabled}\r\n            checked={selected}\r\n            readOnly\r\n            onChangeCapture={handleChange}\r\n          />\r\n        )}\r\n      </td>\r\n      <td>{test.FormFoxTestAN}</td>\r\n      <td title={test.Reason}>{test.ReasonDescription}</td>\r\n      <td>{test.SampleType}</td>\r\n      <td>{FormatDate(test.DateOrdered)}</td>\r\n    </tr>\r\n  )\r\n}\r\n\r\nexport default PendingClinicalTestRow\r\n","import { useEffect, useMemo, useState } from \"react\"\r\n\r\nimport { Col, Row } from \"react-bootstrap\"\r\nimport { BehaviorSubject, concat, of } from \"rxjs\"\r\nimport { catchError, distinctUntilChanged, map, switchMap } from \"rxjs/operators\"\r\n\r\nimport PendingClinicalTestRow from \"./PendingClinicalTestRow\"\r\nimport ApiResult from \"../../../api/ApiResult\"\r\nimport PendingClinicalTest from \"../../../api/OrphanedResults/Models/PendingClinicalTest\"\r\nimport PendingClinicalTestGridData from \"../../../api/OrphanedResults/Models/PendingClinicalTestGridData\"\r\nimport PendingClinicalTestOptions from \"../../../api/OrphanedResults/Models/PendingClinicalTestOptions\"\r\nimport { GetPendingClinicalTestsObservable } from \"../../../api/OrphanedResults/ResultExceptionsProcess\"\r\nimport handleAPIError from \"../../../utils/handleAPIError\"\r\nimport LoadingTableBodyWrapper from \"../../LoadingTableBodyWrapper\"\r\nimport LoadingTableWrapper from \"../../LoadingTableWrapper\"\r\nimport TablePagination from \"../../TablePagination\"\r\n\r\nconst PageSize = 5\r\ninterface PendingClinicalTestsProps {\r\n  donorId: number\r\n  selectedTest?: PendingClinicalTest\r\n  showTitle?: boolean\r\n  onSelectTest: (test: PendingClinicalTest | undefined) => void\r\n}\r\n\r\nfunction PendingClinicalTests({\r\n  donorId,\r\n  selectedTest = undefined,\r\n  showTitle = true,\r\n  onSelectTest,\r\n}: PendingClinicalTestsProps) {\r\n  const [gridData, setGridData] = useState<PendingClinicalTestGridData>({ Records: [], Pages: 0, Total: 0 })\r\n  const [loadingTests, setLoadingTests] = useState<boolean>(false)\r\n\r\n  const page$ = useMemo(\r\n    () =>\r\n      new BehaviorSubject<PendingClinicalTestOptions>({\r\n        DonorID: donorId,\r\n        PageNumber: 1,\r\n        PageSize,\r\n      }),\r\n    [donorId]\r\n  )\r\n\r\n  useEffect(() => {\r\n    const subscription = page$\r\n      .pipe(\r\n        distinctUntilChanged(),\r\n        switchMap((params) =>\r\n          concat(\r\n            of({ loading: true }),\r\n            GetPendingClinicalTestsObservable(params).pipe(\r\n              map((result) => ({ loading: false, result })),\r\n              catchError((error) => of({ loading: false, result: undefined, error }))\r\n            )\r\n          )\r\n        )\r\n      )\r\n      .subscribe(\r\n        ({ loading, result, error }: ApiResult<PendingClinicalTestGridData>) => {\r\n          setLoadingTests(loading)\r\n\r\n          if (!loading) {\r\n            const parsedRecords = result?.Records.map((test) => ({\r\n              ...test,\r\n              DateOrdered: test.DateOrdered ? new Date(test.DateOrdered) : undefined,\r\n            }))\r\n            setGridData({\r\n              ...result,\r\n              Records: parsedRecords || [],\r\n              Pages: result?.Pages ?? 0,\r\n              Total: result?.Total ?? 0,\r\n            })\r\n          }\r\n\r\n          handleAPIError(error)\r\n        },\r\n        (error) => handleAPIError(error, () => setLoadingTests(false))\r\n      )\r\n    return () => subscription.unsubscribe()\r\n  }, [page$])\r\n\r\n  const handleSelectTest = (testId: string | undefined) => {\r\n    const selected = gridData.Records.find((t) => t.TestDetailClinicalID === testId)\r\n    onSelectTest(selected?.TestDetailClinicalID === selectedTest?.TestDetailClinicalID ? undefined : selected)\r\n  }\r\n\r\n  const handleChangePage = (page: number) => {\r\n    handleSelectTest(undefined)\r\n    page$.next({ ...page$.value, PageNumber: page })\r\n  }\r\n\r\n  return (\r\n    <>\r\n      {showTitle && <h5 className=\"text-body\">Pending Clinical Tests</h5>}\r\n      <LoadingTableWrapper loading={loadingTests} variant=\"light\" withHeader>\r\n        <table className=\"table table-bordered\">\r\n          <thead className=\"thead-light\">\r\n            <tr>\r\n              <th className=\"text-center col-1\" aria-label=\"...\" />\r\n              <th className=\"text-nowrap\">Authorization ID</th>\r\n              <th className=\"text-nowrap\">Reason</th>\r\n              <th className=\"text-nowrap\">Type</th>\r\n              <th className=\"text-nowrap col-2\">Created</th>\r\n            </tr>\r\n          </thead>\r\n          <tbody className=\"bg-light\">\r\n            <LoadingTableBodyWrapper\r\n              loading={loadingTests}\r\n              recordsCount={gridData.Records.length}\r\n              columnsCount={6}\r\n              noDataText=\"No Tests Found\"\r\n            >\r\n              {gridData.Records.map((test: PendingClinicalTest) => (\r\n                <PendingClinicalTestRow\r\n                  key={`pct_${test.TestDetailClinicalID}`}\r\n                  test={test}\r\n                  highlighted={false}\r\n                  hideCheckbox={false}\r\n                  selected={selectedTest?.TestDetailClinicalID === test.TestDetailClinicalID}\r\n                  onSelect={handleSelectTest}\r\n                />\r\n              ))}\r\n            </LoadingTableBodyWrapper>\r\n          </tbody>\r\n        </table>\r\n      </LoadingTableWrapper>\r\n      {gridData.Records.length > 0 && (\r\n        <Row>\r\n          <Col sm={2}>Total records: {gridData.Total}</Col>\r\n          <Col>\r\n            <TablePagination\r\n              pageNumber={page$.value.PageNumber}\r\n              pages={gridData.Pages}\r\n              onChange={handleChangePage}\r\n              className=\"mb-0\"\r\n            />\r\n          </Col>\r\n        </Row>\r\n      )}\r\n    </>\r\n  )\r\n}\r\n\r\nexport default PendingClinicalTests\r\n","import { Button } from \"react-bootstrap\"\r\n\r\nimport PendingClinicalTest from \"../../../api/OrphanedResults/Models/PendingClinicalTest\"\r\nimport ActionButton from \"../../ActionButton\"\r\n\r\ninterface PendingClinicalTestsButtonsProps {\r\n  selectedTest?: PendingClinicalTest\r\n  selectedDonor?: boolean\r\n  disabled?: boolean\r\n  acceptSpin?: boolean\r\n  createNewSpin?: boolean\r\n  onCancel: () => void\r\n  onCreateNew: () => void\r\n  onAccept: () => void\r\n}\r\n\r\nfunction PendingClinicalTestsButtons({\r\n  selectedTest = undefined,\r\n  selectedDonor = false,\r\n  disabled = false,\r\n  acceptSpin = false,\r\n  createNewSpin = false,\r\n  onCancel,\r\n  onCreateNew,\r\n  onAccept,\r\n}: PendingClinicalTestsButtonsProps) {\r\n  return (\r\n    <>\r\n      <Button variant=\"primary\" onClick={onCancel}>\r\n        Cancel\r\n      </Button>\r\n      <ActionButton\r\n        variant=\"secondary\"\r\n        onClick={onCreateNew}\r\n        disabled={!!selectedTest || disabled || !!selectedDonor}\r\n        spin={createNewSpin}\r\n      >\r\n        Create New\r\n      </ActionButton>\r\n      <ActionButton\r\n        variant=\"secondary\"\r\n        onClick={onAccept}\r\n        disabled={(!selectedTest && !selectedDonor) || disabled}\r\n        spin={acceptSpin}\r\n      >\r\n        Accept\r\n      </ActionButton>\r\n    </>\r\n  )\r\n}\r\n\r\nexport default PendingClinicalTestsButtons\r\n","import { useState } from \"react\"\r\n\r\nimport { Col, Container, Modal, Row, Tab, Tabs } from \"react-bootstrap\"\r\nimport { toast } from \"react-toastify\"\r\nimport { finalize } from \"rxjs/operators\"\r\n\r\nimport OrphanedRow from \"../../../api/OrphanedResults/Models/OrphanedRow\"\r\nimport PendingClinicalTest from \"../../../api/OrphanedResults/Models/PendingClinicalTest\"\r\nimport PendingDrugTest from \"../../../api/OrphanedResults/Models/PendingDrugTest\"\r\nimport {\r\n  NoMatchingCreateNewObservable,\r\n  NoMatchingTestAcceptClinicalObservable,\r\n  NoMatchingTestAcceptObservable,\r\n} from \"../../../api/OrphanedResults/ResultExceptionsProcess\"\r\nimport FormatError from \"../../../formatters/FormatError\"\r\nimport { DraggableModalDialog } from \"../../Randomization/GovPools/RandomSchedulingExclusionsModal\"\r\nimport PendingClinicalTests from \"../PendingClinicalTests/PendingClinicalTests\"\r\nimport PendingClinicalTestsButtons from \"../PendingClinicalTests/PendingClinicalTestsButtons\"\r\nimport PendingDrugTests from \"../PendingDrugTests/PendingDrugTests\"\r\nimport PendingDrugTestsButtons from \"../PendingDrugTests/PendingDrugTestsButtons\"\r\n\r\ninterface NoMatchingTestErrorProps {\r\n  errorRow: OrphanedRow\r\n  onClose: (withUpdate: boolean) => void\r\n}\r\nconst DRUG_TESTS_TAB = \"drugTestsTab\"\r\nconst CLINICAL_TESTS_TAB = \"clinicalTestsTab\"\r\n\r\nfunction NoMatchingTestError(props: NoMatchingTestErrorProps) {\r\n  const { errorRow, onClose } = props\r\n\r\n  const [selectedTest, setSelectedTest] = useState<PendingDrugTest>()\r\n  const [acceptProc, setAcceptProc] = useState(false)\r\n  const [createNewProc, setCreateNewProc] = useState(false)\r\n  const [selectedClinicalTest, setSelectedClinicalTest] = useState<PendingClinicalTest>()\r\n  const [acceptClinicalProc, setAcceptClinicalProc] = useState(false)\r\n  const [createNewClinicalProc, setCreateNewClinicalProc] = useState(false)\r\n\r\n  const [currentTab, setCurrentTab] = useState(DRUG_TESTS_TAB)\r\n\r\n  const onCancel = () => {\r\n    onClose(false)\r\n  }\r\n\r\n  const onAccept = () => {\r\n    if (!selectedTest) {\r\n      return\r\n    }\r\n    setAcceptProc(true)\r\n    NoMatchingTestAcceptObservable(errorRow, selectedTest)\r\n      .pipe(finalize(() => setAcceptProc(false)))\r\n      .subscribe(\r\n        (data) => {\r\n          toast.success(data)\r\n          onClose(true)\r\n        },\r\n        (error) => toast.error(FormatError(error))\r\n      )\r\n  }\r\n\r\n  const onCreateNew = () => {\r\n    setCreateNewProc(true)\r\n    NoMatchingCreateNewObservable(errorRow)\r\n      .pipe(finalize(() => setCreateNewProc(false)))\r\n      .subscribe(\r\n        (data) => {\r\n          toast.success(data)\r\n          onClose(true)\r\n        },\r\n        (error) => toast.error(FormatError(error))\r\n      )\r\n  }\r\n\r\n  const onCancelClinical = () => {\r\n    onClose(false)\r\n  }\r\n\r\n  const onAcceptClinical = () => {\r\n    if (!selectedClinicalTest) {\r\n      return\r\n    }\r\n    setAcceptClinicalProc(true)\r\n    NoMatchingTestAcceptClinicalObservable(errorRow, selectedClinicalTest)\r\n      .pipe(finalize(() => setAcceptClinicalProc(false)))\r\n      .subscribe(\r\n        (data) => {\r\n          toast.success(data)\r\n          onClose(true)\r\n        },\r\n        (error) => toast.error(FormatError(error))\r\n      )\r\n  }\r\n\r\n  const onCreateNewClinical = () => {\r\n    setCreateNewClinicalProc(true)\r\n    NoMatchingCreateNewObservable(errorRow)\r\n      .pipe(finalize(() => setCreateNewClinicalProc(false)))\r\n      .subscribe(\r\n        (data) => {\r\n          toast.success(data)\r\n          onClose(true)\r\n        },\r\n        (error) => toast.error(FormatError(error))\r\n      )\r\n  }\r\n\r\n  const showDrugTestsTab = currentTab === DRUG_TESTS_TAB\r\n  const showClinicalTestsTab = currentTab === CLINICAL_TESTS_TAB\r\n\r\n  return (\r\n    <Modal dialogAs={DraggableModalDialog} backdrop=\"static\" show size=\"xl\" dialogClassName=\"dark\" onHide={onClose}>\r\n      <Modal.Header closeButton>\r\n        <Modal.Title>No Matching Test Error</Modal.Title>\r\n      </Modal.Header>\r\n      <Modal.Body className=\"mb-0\">\r\n        <Row>\r\n          <Col>Review the current Donors Pending tests and determine if there is a match or create a new test.</Col>\r\n        </Row>\r\n        <Container className=\"tab-container bg-transparent p-0\">\r\n          <Tabs\r\n            defaultActiveKey={DRUG_TESTS_TAB}\r\n            activeKey={currentTab}\r\n            className=\"mb-2 border-0 px-0\"\r\n            onSelect={(eventKey) => !!eventKey && setCurrentTab(eventKey)}\r\n          >\r\n            <Tab eventKey={DRUG_TESTS_TAB} title=\"Pending Drug Tests\" tabClassName=\"rounded-pill px-4\">\r\n              {showDrugTestsTab && (\r\n                <PendingDrugTests\r\n                  donorId={errorRow.PersonID}\r\n                  importTest={errorRow}\r\n                  showTitle={false}\r\n                  selectedTest={selectedTest}\r\n                  onSelectTest={setSelectedTest}\r\n                />\r\n              )}\r\n            </Tab>\r\n            <Tab eventKey={CLINICAL_TESTS_TAB} title=\"Pending Clinical Tests\" tabClassName=\"rounded-pill px-4\">\r\n              {showClinicalTestsTab && (\r\n                <PendingClinicalTests\r\n                  donorId={errorRow.PersonID}\r\n                  showTitle={false}\r\n                  selectedTest={selectedClinicalTest}\r\n                  onSelectTest={setSelectedClinicalTest}\r\n                />\r\n              )}\r\n            </Tab>\r\n          </Tabs>\r\n        </Container>\r\n      </Modal.Body>\r\n      <Modal.Footer>\r\n        {showDrugTestsTab && (\r\n          <PendingDrugTestsButtons\r\n            selectedTest={selectedTest}\r\n            disabled={createNewProc || acceptProc}\r\n            acceptSpin={acceptProc}\r\n            createNewSpin={createNewProc}\r\n            onCancel={onCancel}\r\n            onAccept={onAccept}\r\n            onCreateNew={onCreateNew}\r\n          />\r\n        )}\r\n        {showClinicalTestsTab && (\r\n          <PendingClinicalTestsButtons\r\n            selectedTest={selectedClinicalTest}\r\n            disabled={createNewClinicalProc || acceptClinicalProc}\r\n            acceptSpin={acceptClinicalProc}\r\n            createNewSpin={createNewClinicalProc}\r\n            onCancel={onCancelClinical}\r\n            onAccept={onAcceptClinical}\r\n            onCreateNew={onCreateNewClinical}\r\n          />\r\n        )}\r\n      </Modal.Footer>\r\n    </Modal>\r\n  )\r\n}\r\n\r\nexport default NoMatchingTestError\r\n","import { Button, Col, Modal, ModalBody, Row } from \"react-bootstrap\"\r\nimport ModalHeader from \"react-bootstrap/esm/ModalHeader\"\r\nimport CompanyInput from \"../../FormattedInputs/CompanyInput\"\r\nimport { useState } from \"react\"\r\nimport { Spinner } from \"react-bootstrap\"\r\nimport { finalize } from \"rxjs/operators\"\r\nimport { toast } from \"react-toastify\"\r\nimport { NoAccountAcceptObservable } from \"../../../api/OrphanedResults/ResultExceptionsProcess\"\r\nimport FormatError from \"../../../formatters/FormatError\"\r\nimport OrphanedRow from \"../../../api/OrphanedResults/Models/OrphanedRow\"\r\nimport { DraggableModalDialog } from \"../../Randomization/GovPools/RandomSchedulingExclusionsModal\"\r\n\r\ninterface AccountNotFoundErrorProps {\r\n  errorRow: OrphanedRow\r\n  onClose: (withUpdate: boolean) => void\r\n}\r\n\r\nfunction AccountNotFoundError(props: AccountNotFoundErrorProps) {\r\n  const { errorRow, onClose } = props\r\n  const [ AccountID, setAccountID ] = useState(0)\r\n  const [ saving, setSaving ] = useState(false)\r\n\r\n  const onCancel = () => {\r\n    onClose(false);\r\n  }\r\n\r\n  const onAccept = () => {\r\n    setSaving(true)\r\n    NoAccountAcceptObservable(errorRow.LabAccountNumber, AccountID, errorRow.TestDetailImportID, errorRow.TestImportExceptionID)\r\n    .pipe(finalize(() => setSaving(false)))\r\n    .subscribe(\r\n      data => {\r\n        toast.success(data)\r\n        onClose(true)\r\n      },\r\n      error => toast.error(FormatError(error))\r\n    )\r\n  }\r\n\r\n  return (\r\n    <Modal dialogAs={DraggableModalDialog} show size=\"lg\" dialogClassName=\"dark\" onHide={onClose}>\r\n      <ModalHeader closeButton>Account Not Found Error</ModalHeader>\r\n      <ModalBody>\r\n        <Row>\r\n          <Col className=\"mt-1\">\r\n            Select the company that owns this lab account\r\n          </Col>\r\n          <Col>\r\n            <CompanyInput onChange={ selected => setAccountID(selected[0]?.AccountID) }/>\r\n          </Col>\r\n        </Row>\r\n        <Row>\r\n          <Col>\r\n            <b>{errorRow.LabAccountNumber}</b>\r\n          </Col>\r\n        </Row>\r\n      </ModalBody>\r\n      <Modal.Footer>\r\n        {saving && <Spinner animation=\"border\" />}\r\n        {!saving && <>\r\n          <Button variant=\"primary\" onClick={onCancel}>\r\n            Cancel\r\n          </Button>\r\n          <Button variant=\"primary\" onClick={onAccept} disabled={!AccountID}>\r\n            Accept\r\n          </Button>\r\n        </>}\r\n      </Modal.Footer>\r\n    </Modal>\r\n  )\r\n}\r\n\r\nexport default AccountNotFoundError\r\n","import * as React from \"react\"\r\nimport { Container, Row, Col, Table, Spinner, Button } from \"react-bootstrap\"\r\nimport { Subscription, BehaviorSubject, of, concat } from \"rxjs\"\r\nimport { distinctUntilChanged, switchMap, map } from \"rxjs/operators\"\r\nimport { toast } from \"react-toastify\"\r\nimport { format, parseISO } from \"date-fns\"\r\nimport { AppPageWrapper } from \"../NavMenu/AppPageWrapper\"\r\nimport TablePagination from \"../TablePagination\"\r\nimport ColumnHeaderFilter from \"../ColumnHeaderFilter\"\r\nimport { OrphanedGridGet, OrphanedDelete } from \"../../api/OrphanedResults/OrphanedProcess\"\r\nimport OrphanedGridResponse from \"../../api/OrphanedResults/Models/OrphanedGridResponse\"\r\nimport OrphanedRow from \"../../api/OrphanedResults/Models/OrphanedRow\"\r\nimport ConfirmationModal from \"../ConfirmationModal\"\r\nimport Checkbox from \"../Checkbox\"\r\nimport { Filter, Sort } from \"../../api/GridRequest\"\r\nimport { setOrphanedResultsCount } from \"../../storage/LogInPortals\"\r\nimport DonorNotFoundError from \"./DonorNotFoundError/DonorNotFoundError\"\r\nimport NoMatchingRandomError from \"./NoMatchingRandomError/NoMatchingRandomError\"\r\nimport NoMatchingTestError from \"./NoMatchingTestError/NoMatchingTestError\"\r\nimport AccountNotFoundError from \"./AccountNotFoundError/AccountNotFoundError\"\r\nimport { ImportExceptionSubType } from \"../../api/OrphanedResults/Models/ImportExceptionSubType\"\r\nimport ImageCCF from \"../../assets/images/CCF.png\"\r\nimport { RAImage } from \"../../api/OrderResults/OrderResultModel/OrderResultRecord\"\r\nimport ImageGet, { ImageData } from \"../../api/OrderResults/GenerateCCFImage\"\r\n\r\nimport FormatTimestampFileName from \"../../formatters/FormatTimestampFileName\"\r\nimport FormatData from \"../../formatters/FormatBase64\"\r\nimport HorizontalScrollWrapper from \"../HorizontalScrollWrapper\"\r\nimport { connect } from \"react-redux\"\r\nimport { AppState } from \"../../AppState\"\r\nimport GetDonorID, { GetDonorIDTitle } from \"../../formatters/RenderDonorID\"\r\nimport { GetSelectedPortal } from \"../../authentication/SelectedCompany/CompanySelectionDrivenSelectors\"\r\n\r\ninterface OrphanedResultsProps {\r\n  unmaskDonorId: number\r\n}\r\n\r\ninterface OrphanedResultsState {\r\n  loading: boolean\r\n  data?: OrphanedGridResponse\r\n  selectAll: boolean\r\n  selectedList: { TestDetailID: number | string, AccountID?: number, TestDetailClinicalID: number | string }[]\r\n  confirmModal: boolean\r\n  recordCount: number\r\n  showDonorNotFoundError: boolean\r\n  showNoMatchingRandomError: boolean\r\n  showNoMatchingTestError: boolean\r\n  showAccountNotFoundError: boolean\r\n  errorRow?: OrphanedRow\r\n}\r\n\r\ninterface OrphanedResultsSearchParams {\r\n  pageNumber: number\r\n  sort: Sort\r\n  filters: Filter[]\r\n}\r\n\r\nconst PageSize = 10\r\n\r\ntype OrphanedColumn = keyof OrphanedRow | \"Checked\"\r\n\r\nconst DefaultColumns: { name: OrphanedColumn, label: string }[] = [\r\n  { name: \"Checked\", label: \"\" },\r\n  { name: \"DonorID\", label: \"Donor ID\" },\r\n  { name: \"FirstName\", label: \"First Name\" },\r\n  { name: \"LastName\", label: \"Last Name\" },\r\n  { name: \"CompanyName\", label: \"Company\" },\r\n  { name: \"Reason\", label: \"Reason\" },\r\n  { name: \"ReferenceID\", label: \"Sample ID\" },\r\n  { name: \"TestType\", label: \"Type\" },\r\n  { name: \"DateCollected\", label: \"Collected\" },\r\n  { name: \"RAImageID\", label: \"eDocs\" },\r\n  { name: \"ImportException\", label: \"Error\" }\r\n]\r\n\r\nexport class OrphanedResults extends React.PureComponent<OrphanedResultsProps, OrphanedResultsState> {\r\n  state: OrphanedResultsState = {\r\n    loading: false,\r\n    selectAll: false,\r\n    selectedList: [],\r\n    confirmModal: false,\r\n    recordCount: 0,\r\n    showDonorNotFoundError: false,\r\n    showNoMatchingRandomError: false,\r\n    showNoMatchingTestError: false,\r\n    showAccountNotFoundError: false,\r\n  }\r\n\r\n  gridRef = React.createRef<HTMLTableElement>()\r\n\r\n  page$ = new BehaviorSubject<OrphanedResultsSearchParams>({\r\n    pageNumber: 1,\r\n    sort: { column: \"\", order: \"\" },\r\n    filters: []\r\n  })\r\n  pageSubscription?: Subscription\r\n  actionsSubscription?: Subscription\r\n  loadImageSubscription?: Subscription\r\n\r\n  componentDidMount() {\r\n    //this.recordCountGet()\r\n    this.pageSubscription = this.page$.pipe(\r\n      distinctUntilChanged(),\r\n      switchMap(params => concat(\r\n        of({ loading: true }),\r\n        OrphanedGridGet(params.pageNumber, PageSize, params.sort, params.filters).pipe(\r\n          map((result: OrphanedGridResponse) => ({ data: result, loading: false })))\r\n      ))\r\n    ).subscribe(\r\n      (newState: { loading: boolean, data?: OrphanedGridResponse }) => {\r\n        if (newState.data) {\r\n          setOrphanedResultsCount(newState.data.Total)\r\n          this.setState({ loading: newState.loading, data: newState.data })\r\n        } else {\r\n          setOrphanedResultsCount(0)\r\n          this.setState({ loading: newState.loading, selectedList: [], selectAll: false })\r\n        }\r\n      },\r\n      (error: string) => {\r\n        this.setState({ loading: false })\r\n        toast.error(error)\r\n      }\r\n    )\r\n  }\r\n\r\n  componentWillUnmount() {\r\n    this.pageSubscription && this.pageSubscription.unsubscribe()\r\n    this.actionsSubscription && this.actionsSubscription.unsubscribe()\r\n    this.loadImageSubscription && this.loadImageSubscription.unsubscribe()\r\n    this.page$.unsubscribe()\r\n  }\r\n\r\n  pageChanged = (pageNumber: number) => {\r\n    this.page$.next({ ...this.page$.value, pageNumber: pageNumber })\r\n  }\r\n\r\n  sortGrid(column: string, order?: string) {\r\n    const newSort = { column: column, order: order || \"\" }\r\n    this.page$.next({ ...this.page$.value, sort: newSort })\r\n  }\r\n\r\n  filterGrid(column: string, items: string[]) {\r\n    const filters = [...this.page$.value.filters]\r\n    const filter = { column: column, values: items }\r\n    let index = filters.findIndex(item => item.column === filter.column)\r\n    if (index >= 0) {\r\n      filters[index] = filter\r\n    } else {\r\n      filters.push(filter)\r\n    }\r\n\r\n    this.page$.next({ ...this.page$.value, pageNumber: 1, filters: filters })\r\n  }\r\n\r\n  convertDate = (date?: string) => {\r\n    if (date) {\r\n      return format(parseISO(date), \"MM/dd/yyyy\")\r\n    } else {\r\n      return \"\"\r\n    }\r\n  }\r\n\r\n  handleAllTestDetailCheck = (e: React.ChangeEvent<HTMLInputElement>) => {\r\n    const checked = e.target.checked\r\n    const tests = checked && this.state.data ? this.state.data.Records.map((row: OrphanedRow) => ({ TestDetailID: row.TestDetailID, TestDetailClinicalID: row.TestDetailClinicalID })) : []\r\n    this.setState({ selectedList: tests, selectAll: checked })\r\n  }\r\n\r\n  handleTestDetailCheck = (e: React.ChangeEvent<HTMLInputElement>, isClinical: boolean) => {\r\n    const value = e.target.value\r\n    let tests = [...this.state.selectedList]\r\n\r\n    const index = tests.findIndex(test => isClinical ? test.TestDetailClinicalID === value : test.TestDetailID === value)\r\n    if (index > -1) {\r\n      tests = [...tests.slice(0, index), ...tests.slice(index + 1)]\r\n    } else {\r\n      tests.push({ TestDetailID: (isClinical ? 0 : value), TestDetailClinicalID: (isClinical ? value : 0) })\r\n    }\r\n    this.setState({ selectedList: tests })\r\n  }\r\n\r\n\r\n  handleCancel = () => {\r\n    //TODO\r\n  }\r\n\r\n  handleDelete = () => {\r\n    this.setState({ confirmModal: true })\r\n  }\r\n\r\n  hideModal = () => {\r\n    this.setState({ confirmModal: false })\r\n  }\r\n\r\n  confirmDelete = () => {\r\n    this.hideModal()\r\n    const deleteRecords = this.state.selectedList.map(item => {\r\n      return { TestDetailID: item.TestDetailID, TestDetailClinicalID: item.TestDetailClinicalID }\r\n    })\r\n    this.actionsSubscription = OrphanedDelete(deleteRecords).subscribe(\r\n      data => {\r\n        toast.success(data)\r\n        this.page$.next({ ...this.page$.value, pageNumber: 1 })\r\n      },\r\n      error => this.handleAPIError(error, { saving: false })\r\n    )\r\n  }\r\n\r\n  handleAPIError = (error: Error, stateChanges: object) => {\r\n    this.setState(stateChanges)\r\n    toast.error(error)\r\n  }\r\n\r\n  renderColumns = () => {\r\n    return DefaultColumns.map((col) => {\r\n      if (col.name === \"Checked\") {\r\n        return <th className=\"text-center font-weight-normal\" key={col.name}>\r\n          <Checkbox id=\"check_head\" label={col.label} onChange={this.handleAllTestDetailCheck} checked={this.state.selectAll} />\r\n        </th>\r\n      }\r\n      const sort = this.page$.value.sort\r\n      return (\r\n        <th className=\"text-nowrap font-weight-normal\" key={col.name}>\r\n          {this.state.data && col.name in this.state.data && <ColumnHeaderFilter\r\n            title={col.label}\r\n            sort={sort.column === col.name ? sort.order === \"asc\" ? \"asc\" : \"desc\" : undefined}\r\n            items={this.state.data[col.name]}\r\n            onSort={(order?: string) => this.sortGrid(col.name, order)}\r\n            onFilter={(items: string[]) => this.filterGrid(col.name, items)}\r\n          />}\r\n          {this.state.data && !(col.name in this.state.data) && (col.label?.toUpperCase())}\r\n        </th>\r\n      )\r\n    })\r\n  }\r\n\r\n  testDetailSelected = (id: string, clinicalId: string, isClinical: boolean) => {\r\n    return this.state.selectedList.findIndex(test => (isClinical ? test.TestDetailClinicalID === clinicalId : test.TestDetailID === id)) > -1\r\n  }\r\n\r\n  renderCell = (row: OrphanedRow, colName: OrphanedColumn) => {\r\n    switch (colName) {\r\n      case \"Checked\":\r\n        return <td className=\"text-center\" key={row.IsClinical ? row.TestDetailClinicalID : row.TestDetailID}>\r\n          <Checkbox id={`check_${row.TestDetailID}_${row.TestDetailClinicalID}`} label=\"\" value={row.IsClinical ? row.TestDetailClinicalID.toString() : row.TestDetailID.toString()} checked={this.testDetailSelected(row.TestDetailID, row.TestDetailClinicalID, row.IsClinical)} onChange={(e) => this.handleTestDetailCheck(e, row.IsClinical)} />\r\n        </td>\r\n      case \"DateCollected\":\r\n        return <td key={`${colName}_${row.TestDetailID}`}>{this.convertDate(row.DateCollected)}</td>\r\n      case \"RAImageID\":\r\n        const iconsVisibility = this.iconsVisibility(row)\r\n        return <td key={`ra_image_${row.TestDetailID}_${row.TestDetailClinicalID}`} className=\"align-text-top\" style={{ whiteSpace: \"nowrap\" }}>\r\n          {iconsVisibility ? this.mapCCFImages(row) : \"\"}\r\n        </td>\r\n\r\n      case \"ImportException\":\r\n        const linkVisible = this.isShowErrorDialog(row)\r\n        return <td key={`${colName}_${row.TestDetailID}`}>\r\n          {linkVisible ? <Button variant=\"underline-link\" onClick={() => this.showErrorDialog(row)}>{this.renderException(row)}</Button> : row.ImportException}\r\n        </td>\r\n      case \"DonorID\":\r\n        const idValue = row.DonorID || \"\"// GetDonorID(row.DonorID, row.MockDonorID, this.props.unmaskDonorId)\r\n        const idTitle = GetDonorIDTitle(row.DonorID, row.MockDonorID, this.props.unmaskDonorId)\r\n        return <td key={`${colName}_${row.TestDetailID}`} title={idTitle}>{idValue}</td>\r\n      default:\r\n        return <td key={`${colName}_${row.TestDetailID}`}>{row[colName]}</td>\r\n    }\r\n  }\r\n\r\n  renderException = (row: OrphanedRow) => {\r\n    const { ImportExceptionSubTypeID, ReasonCode, ImportException } = row;\r\n\r\n    if (\r\n      (ImportExceptionSubTypeID === ImportExceptionSubType.TestDoesNotExist ||\r\n      ImportExceptionSubTypeID === ImportExceptionSubType.MoreThanOneTestMatch) &&\r\n      ReasonCode?.toUpperCase() === \"RAN\"\r\n    ) {\r\n      return \"No Matching Random\";\r\n    }\r\n\r\n    return ImportException;\r\n  }\r\n\r\n  renderRows = () => {\r\n    if (this.state.data && this.state.data.Records.length) {\r\n      return this.state.data.Records.map((row: OrphanedRow, i: number) =>\r\n        <tr key={i}>\r\n          {DefaultColumns.map((col) => this.renderCell(row, col.name))}\r\n        </tr>)\r\n    } else {\r\n      return <tr><td colSpan={DefaultColumns.length}>No Records Found</td></tr>\r\n    }\r\n  }\r\n\r\n  refreshGrid = () => {\r\n    this.page$.next({ ...this.page$.value, pageNumber: 1 })\r\n  }\r\n\r\n  onCloseDonorNotFoundError = (withUpdate: boolean) => {\r\n    this.setState({ showDonorNotFoundError: false }, () => { if (withUpdate) this.refreshGrid })\r\n    this.refreshGrid()\r\n  }\r\n\r\n  onCloseAccountNotFoundError = (withUpdate: boolean) => {\r\n    this.setState({ showAccountNotFoundError: false }, () => { if (withUpdate) this.refreshGrid })\r\n    this.refreshGrid()\r\n  }\r\n\r\n  onCloseNoMatchingRandomError = () => {\r\n    this.setState({ showNoMatchingRandomError: false }, this.refreshGrid)\r\n    this.refreshGrid()\r\n  }\r\n\r\n  onCloseNoMatchingTestError = () => {\r\n    this.setState({ showNoMatchingTestError: false }, this.refreshGrid)\r\n    this.refreshGrid()\r\n  }\r\n\r\n  isShowDonorNotFoundError = (row: OrphanedRow): boolean => {\r\n    if (!row.ImportException) {\r\n      return false\r\n    }\r\n    const importExceptionSubType = row.ImportExceptionSubTypeID\r\n    if ((importExceptionSubType === ImportExceptionSubType.DonorDoesNotExist) ||\r\n      (importExceptionSubType === ImportExceptionSubType.MoreThanOneDonorMatch)) {\r\n      return true\r\n    }\r\n    return false\r\n  }\r\n\r\n  isShowNoMatchingRandomError = (row: OrphanedRow): boolean => {\r\n    if (!row.ImportException) {\r\n      return false\r\n    }\r\n    const importExceptionSubType = row.ImportExceptionSubTypeID\r\n    if ((importExceptionSubType === ImportExceptionSubType.TestDoesNotExist) ||\r\n      (importExceptionSubType === ImportExceptionSubType.MoreThanOneTestMatch)) {\r\n      if (row.ReasonCode?.toUpperCase() === \"RAN\") {\r\n        return true\r\n      }\r\n    }\r\n    return false\r\n  }\r\n  isShowNoMatchingTestError = (row: OrphanedRow): boolean => {\r\n    if (!row.ImportException) {\r\n      return false\r\n    }\r\n    const importExceptionSubType = row.ImportExceptionSubTypeID\r\n    if ((importExceptionSubType === ImportExceptionSubType.TestDoesNotExist) ||\r\n      (importExceptionSubType === ImportExceptionSubType.MoreThanOneTestMatch)) {\r\n      if (row.ReasonCode?.toUpperCase() !== \"RAN\") {\r\n        return true\r\n      }\r\n\r\n    }\r\n    return false\r\n  }\r\n  isShowAccountNotFoundError = (row: OrphanedRow): boolean => {\r\n    if (!row.ImportException) {\r\n      return false\r\n    }\r\n    const importExceptionSubType = row.ImportExceptionSubTypeID\r\n    if ((importExceptionSubType === ImportExceptionSubType.LabAccountNotFoundorNotAssignedtoaCompany) ||\r\n      (importExceptionSubType === ImportExceptionSubType.LabAccountAssignedMorethanOneCompany)) {\r\n      return true\r\n    }\r\n    return false\r\n\r\n  }\r\n  isShowErrorDialog = (row: OrphanedRow): boolean => {\r\n    if (!row.ImportException) {\r\n      return false\r\n    }\r\n    if (row.ImportExceptionSubTypeID === 0) {\r\n      return false\r\n    }\r\n    if (this.isShowDonorNotFoundError(row)) {\r\n      return true\r\n    }\r\n    if (this.isShowNoMatchingRandomError(row)) {\r\n      return true\r\n    }\r\n    if (this.isShowNoMatchingTestError(row)) {\r\n      return true\r\n    }\r\n    if (this.isShowAccountNotFoundError(row)) {\r\n      return true\r\n    }\r\n    return false\r\n  }\r\n\r\n  showErrorDialog = (row: OrphanedRow) => {\r\n    if (!this.isShowErrorDialog(row)) {\r\n      this.setState({\r\n        showDonorNotFoundError: false,\r\n        showNoMatchingRandomError: false,\r\n        showNoMatchingTestError: false,\r\n        showAccountNotFoundError: false,\r\n        errorRow: undefined\r\n      })\r\n      return\r\n    }\r\n\r\n    if (this.isShowDonorNotFoundError(row)) {\r\n      this.setState({\r\n        showDonorNotFoundError: true,\r\n        showNoMatchingRandomError: false,\r\n        showNoMatchingTestError: false,\r\n        showAccountNotFoundError: false,\r\n        errorRow: row\r\n      })\r\n      return\r\n    }\r\n    if (this.isShowNoMatchingRandomError(row)) {\r\n      this.setState({\r\n        showDonorNotFoundError: false,\r\n        showNoMatchingRandomError: true,\r\n        showNoMatchingTestError: false,\r\n        showAccountNotFoundError: false,\r\n        errorRow: row\r\n      })\r\n      return\r\n    }\r\n    if (this.isShowNoMatchingTestError(row)) {\r\n      this.setState({\r\n        showDonorNotFoundError: false,\r\n        showNoMatchingRandomError: false,\r\n        showNoMatchingTestError: true,\r\n        showAccountNotFoundError: false,\r\n        errorRow: row\r\n      })\r\n      return\r\n    }\r\n    if (this.isShowAccountNotFoundError(row)) {\r\n      this.setState({\r\n        showDonorNotFoundError: false,\r\n        showNoMatchingRandomError: false,\r\n        showNoMatchingTestError: false,\r\n        showAccountNotFoundError: true,\r\n        errorRow: row\r\n      })\r\n      return\r\n    }\r\n  }\r\n  iconsVisibility = (row: OrphanedRow): boolean => {\r\n    if (!row) {\r\n      return false\r\n    }\r\n    if (!Array.isArray(row.RAImage)) {\r\n      return false\r\n    }\r\n    if (row.RAImage.length === 0) {\r\n      return false\r\n    }\r\n    return true\r\n  }\r\n\r\n  /*\r\n    renderRows = () => {\r\n    if (this.state.data && this.state.data.Records.length) {\r\n      return this.state.data.Records.map((row: OrphanedRow, i: number) =>\r\n        <tr key={i}>\r\n          {DefaultColumns.map((col) => this.renderCell(row, col.name))}\r\n        </tr>)\r\n    } else {\r\n      return <tr><td colSpan={DefaultColumns.length}>No Records Found</td></tr>\r\n    }\r\n  }\r\n\r\n  */\r\n  mapCCFImages = (row: OrphanedRow) => {\r\n    const imgSrc = ImageCCF\r\n    if (!Array.isArray(row.RAImage)) {\r\n      return \"\"\r\n    }\r\n\r\n    return row.RAImage.map((item: RAImage, i: number) => \r\n      <span> \r\n      {this.mapCCFImage(row, item, i)}\r\n      </span>\r\n    )\r\n      \r\n    //return this.mapCCFImage(row, row.RAImage[0], 0)\r\n  }\r\n\r\n\r\n\r\n  mapCCFImage = (row: OrphanedRow, item: RAImage, i: number) => {\r\n    const imgSrc = ImageCCF\r\n    const space = i > 0 ? \"0.5em\" : \"0px\"\r\n\r\n    return <img key={'ra_image_' + item.RAImageID} onClick={() => this.generateCCFImage(item, row)} src={imgSrc} alt={this.ccfImageDescription(row, item)} title={this.ccfImageDescription(row, item)} style={{marginLeft:space}}/>\r\n  }\r\n\r\n  ccfImageDescription = (row: OrphanedRow, item: RAImage) => {\r\n    return item.Description\r\n  }\r\n\r\n  generateCCFImage = (image: RAImage, row: OrphanedRow) => {\r\n    this.loadImageSubscription && this.loadImageSubscription.unsubscribe()\r\n    const data = {\r\n      TestImageID: image.RAImageID,\r\n      TestDetailID: row.TestDetailID,\r\n      TestDetailClinicalID: row.TestDetailClinicalID || \"\",\r\n      IsMarketPlace: true,\r\n      TestDescription: image.Description\r\n    }\r\n\r\n    this.loadImageSubscription = ImageGet(data).subscribe(\r\n      (data: ImageData) => this.processCCF(data),\r\n      (error) => this.handleAPIError(error, {})\r\n    )\r\n  }\r\n\r\n  processCCF = (data: ImageData) => {\r\n    if (data && Array.isArray(data.Base64String)) {\r\n      if (data.Base64String.length == 0) {\r\n        toast.error(\"Service is not able to return CCF image for this record.\")\r\n        return\r\n      }\r\n      const currentDate = new Date()\r\n      data.Base64String.forEach((item, index) => {\r\n        const type = item.ImageType\r\n        const fileName = FormatTimestampFileName(\"CCF_Image_Report\" + index, type.split('/')[1], currentDate)\r\n        const fileData = new Blob([FormatData(item.Base64Strings)], { type: type || data.ImageType })\r\n        var fileURL = URL.createObjectURL(fileData)\r\n        window.open(fileURL)\r\n      })\r\n    } else {\r\n      toast.error(\"Service is not able to return CCF image for this record.\")\r\n    }\r\n  }\r\n\r\n  render() {\r\n    const {\r\n      errorRow,\r\n      showDonorNotFoundError,\r\n      showNoMatchingRandomError,\r\n      showNoMatchingTestError,\r\n      showAccountNotFoundError,\r\n    } = this.state\r\n\r\n    return (\r\n      <AppPageWrapper parentClassName={\"align-items-center\"} showNav>\r\n        <Container fluid className=\"grid-container pt-2\">\r\n          <Row>\r\n            <Col className=\"px-0\">\r\n              <HorizontalScrollWrapper\r\n              gridRef={this.gridRef}\r\n              visible={this.state.data && this.state.data?.Total > 0}\r\n              recalculateWidth={!this.state.loading}\r\n              offsetVertical={330}\r\n              >\r\n                <Table bordered className=\"mb-0\" ref={this.gridRef}>\r\n                  <thead>\r\n                    <tr>\r\n                      {this.renderColumns()}\r\n                    </tr>\r\n                  </thead>\r\n                  <tbody>\r\n                    {\r\n                      this.state.loading ?\r\n                        <tr>\r\n                          <td className=\"align-middle text-center\" colSpan={DefaultColumns.length}>\r\n                            <div className=\"d-flex justify-content-center text-secondary\" style={{ width: \"100vw\" }}>\r\n                                <Spinner animation=\"border\" variant=\"secondary\" role=\"status\" className=\"mr-2\" />\r\n                                <span>Loading...</span>\r\n                            </div>\r\n                          </td>\r\n                        </tr> : this.renderRows()\r\n                    }\r\n                  </tbody>\r\n                </Table>\r\n              </HorizontalScrollWrapper>\r\n            </Col>\r\n          </Row>\r\n          {this.state.data &&\r\n            <Row>\r\n              <Col className=\"px-0\">\r\n                <span>Total records: {this.state.data.Total}</span>\r\n                <TablePagination pageNumber={this.page$.value.pageNumber} pages={this.state.data.Pages} onChange={this.pageChanged} />\r\n              </Col>\r\n            </Row>}\r\n          <Row>\r\n            <Col className=\"text-right mb-2 px-0\">\r\n              <Button variant=\"secondary\" onClick={this.handleCancel} className=\"mr-2\">\r\n                Cancel\r\n              </Button>\r\n              <Button variant=\"primary\" onClick={this.handleDelete} disabled={this.state.selectedList.length === 0} className=\"mr-2\">\r\n                Delete\r\n              </Button>\r\n              <ConfirmationModal show={this.state.confirmModal}\r\n                title=\"CONFIRM REMOVE\"\r\n                textTitle=\"Are you sure you want to remove selected record?\"\r\n                text=\"Selected record will be removed permanently.\"\r\n                onConfirm={this.confirmDelete}\r\n                onHide={this.hideModal} />\r\n            </Col>\r\n          </Row>\r\n          {errorRow && showDonorNotFoundError && <DonorNotFoundError errorRow={errorRow} onClose={this.onCloseDonorNotFoundError} />}\r\n          {errorRow && showNoMatchingRandomError && <NoMatchingRandomError errorRow={errorRow} onClose={this.onCloseNoMatchingRandomError} />}\r\n          {errorRow && showNoMatchingTestError && <NoMatchingTestError errorRow={errorRow} onClose={this.onCloseNoMatchingTestError} />}\r\n          {errorRow && showAccountNotFoundError && <AccountNotFoundError errorRow={errorRow} onClose={this.onCloseAccountNotFoundError} />}\r\n        </Container>\r\n      </AppPageWrapper>\r\n    )\r\n  }\r\n}\r\n\r\nfunction mapStateToProps(state: AppState): OrphanedResultsProps {\r\n  const portal = GetSelectedPortal(state)\r\n  const unmaskDonorId = portal ? portal.UnmaskDonorID : 0\r\n  return {\r\n    unmaskDonorId: unmaskDonorId\r\n  }\r\n}\r\nconst ConnectedOrphanedResults = connect(mapStateToProps)(OrphanedResults)\r\nexport default ConnectedOrphanedResults\r\n","import { getStatusKeyByLabel } from \"../Invitation/Model/InvitationStatus\"\r\nimport { ObservableFromFetch } from \"../ObservableFromFetch\"\r\nimport { InvitationGridRequest } from \"./Model/InvitationGridRequest\"\r\nimport { InvitationGridResponse } from \"./Model/InvitationGridResponse\"\r\n\r\nfunction gridParams(options: InvitationGridRequest): string {\r\n  return JSON.stringify({\r\n    Filters: {\r\n      CompanyName: options.filters.find(filter => filter.column === \"CompanyName\")?.values || [],\r\n      EmailAddress: options.filters.find(filter => filter.column === \"EmailAddress\")?.values || [],\r\n      EnrollmentStarted: options.filters.find(filter => filter.column === \"EnrollmentStarted\")?.values || [],\r\n      InActive: options.filters.find(filter => filter.column === \"InActive\")?.values.map(value => value === \"Inactive\") || [],\r\n      InvitationSent: options.filters.find(filter => filter.column === \"InvitationSent\")?.values || [],\r\n      Role: options.filters.find(filter => filter.column === \"Role\")?.values || [],\r\n      Status: options.filters.find(filter => filter.column === \"Status\")?.values.map(getStatusKeyByLabel) || [],\r\n    },\r\n    IsQuickStart: false,\r\n    PageNumber: options.pageNumber,\r\n    PageSize: options.pageSize || 20,\r\n    SortGrid: { SortColumn: options.sort?.column || \"\", SortOrder: options.sort?.order.toUpperCase() === \"DESC\" ? \"DSC\" : options.sort?.order.toUpperCase() },\r\n    TimeZoneOffset: new Date().getTimezoneOffset()\r\n  })\r\n}\r\n\r\nexport default function InvitationStatusGrid(params: InvitationGridRequest) {\r\n  return ObservableFromFetch<InvitationGridResponse>(\"FFOrderClinicEnrollment/GetClinics\", gridParams(params))\r\n}\r\n","import { ObservableFromFetch } from \"../ObservableFromFetch\"\r\nimport ResendModel from \"./Model/ResendModel\"\r\n\r\nexport default function ResendInvitation(resend: ResendModel) {\r\n    const requestBody = JSON.stringify(resend)\r\n    return ObservableFromFetch<string>(\"FFOrderClinicEnrollment/ResendInvitation\", requestBody)\r\n}","import { ObservableFromFetch } from \"../ObservableFromFetch\"\r\nimport DeleteModel from \"./Model/DeleteModel\"\r\n\r\nexport default function DeleteInvitation(deleteModel: DeleteModel) {\r\n    const requestBody = JSON.stringify(deleteModel)\r\n    return ObservableFromFetch<string>(\"FFOrderClinicEnrollment/DeleteInvitation\", requestBody)\r\n}","import * as React from \"react\"\r\nimport { Modal, Form, Button } from \"react-bootstrap\"\r\nimport MaskedInput from \"react-maskedinput\"\r\nimport InvitationStatusGridRecord from \"../../api/InvitationStatus/Model/InvitationStatusGridRecord\"\r\nimport { EmailRegexp, PhoneRegexp } from \"../../config/Constants\"\r\nimport ResendInvitation from \"../../api/InvitationStatus/ResendInvitation\"\r\nimport ResendModel from \"../../api/InvitationStatus/Model/ResendModel\"\r\nimport { Subscription } from \"rxjs\"\r\nimport { toast } from \"react-toastify\"\r\nimport FormatPhone from \"../../formatters/FormatPhone\"\r\nimport DeleteModel from \"../../api/InvitationStatus/Model/DeleteModel\"\r\nimport DeleteInvitation from \"../../api/InvitationStatus/DeleteInvitation\"\r\nimport ActionButton from \"../ActionButton\"\r\n\r\ninterface ResendInvitationModalProps {\r\n  show: boolean\r\n  modalData?: InvitationStatusGridRecord\r\n  onHide: () => void\r\n  onDeleteInvitation: () => void\r\n  onResendInvitation: () => void\r\n}\r\n\r\ninterface ResendInvitationModalState {\r\n  email: string\r\n  phone: string\r\n  emailValid: boolean\r\n  phoneValid: boolean\r\n  deletingInvitation: boolean,\r\n  resendingtInvitation: boolean\r\n}\r\n\r\nexport default class ResendInvitationModal extends React.PureComponent<ResendInvitationModalProps, ResendInvitationModalState> {\r\n  resendInvitationSubscription?: Subscription\r\n  deleteInvitationSubscription?: Subscription\r\n\r\n  state: ResendInvitationModalState = {\r\n    email: \"\",\r\n    phone: \"\",\r\n    emailValid: false,\r\n    phoneValid: false,\r\n    deletingInvitation: false,\r\n    resendingtInvitation: false\r\n    \r\n  }\r\n\r\n  isEmailValid = (value: string) => EmailRegexp.test(value)\r\n\r\n  isPhoneValid = (value: string) => PhoneRegexp.test(value)\r\n\r\n  handleEmailChange = (e: React.ChangeEvent<HTMLInputElement>) => {\r\n    const value: string = e.target.value\r\n\r\n    this.setState({ email: value, emailValid: this.isEmailValid(value) })\r\n  }\r\n\r\n  handlePhoneChange = (e: React.ChangeEvent<HTMLInputElement>) => {\r\n    const value: string = e.target.value\r\n\r\n    this.setState({ phone: value, phoneValid: this.isPhoneValid(value) })\r\n  }\r\n\r\n  populateContacts = () => {\r\n    const email = this.props.modalData ? this.props.modalData.UserName : \"\"\r\n    const phone = this.props.modalData ? FormatPhone(this.props.modalData.ContactDetail) : \"\"\r\n\r\n    this.setState({ email: email, phone: phone, emailValid: this.isEmailValid(email), phoneValid: this.isPhoneValid(phone) })\r\n  }\r\n\r\n  resendInvitation = () => {\r\n    this.setState({ resendingtInvitation: true })\r\n    const resend: ResendModel = {\r\n      EmailAddress: this.state.email,\r\n      Link: this.props.modalData?.Link || \"\",\r\n      PhoneNumber: this.state.phone.replace(/-/g, \"\")\r\n    }\r\n    this.resendInvitationSubscription = ResendInvitation(resend).subscribe(\r\n      data => {\r\n        toast.success(data)\r\n        this.props.onResendInvitation()\r\n        this.setState({ resendingtInvitation: false })\r\n      },\r\n      error => {\r\n        toast.error(error.message)\r\n        this.setState({ resendingtInvitation: false })\r\n      },\r\n      () => this.setState({ resendingtInvitation: false })\r\n    )\r\n  }\r\n\r\n  deleteInvitation = () => {\r\n    this.setState({ deletingInvitation: true })\r\n\r\n    const deleteModel: DeleteModel = {\r\n      Link: this.props.modalData?.Link || \"\"\r\n    }\r\n    this.deleteInvitationSubscription = DeleteInvitation(deleteModel).subscribe(\r\n      data => {\r\n        toast.success(data)\r\n        this.props.onDeleteInvitation()\r\n        this.setState({ deletingInvitation: false })\r\n      },\r\n      (error) => {\r\n        toast.error(error.message)\r\n        this.setState({ deletingInvitation: false })\r\n      },\r\n      () => this.setState({ deletingInvitation: false })\r\n    )\r\n  }\r\n\r\n  componentDidMount() {\r\n    this.populateContacts()\r\n  }\r\n\r\n  componentWillUnmount() {\r\n    this.resendInvitationSubscription && this.resendInvitationSubscription.unsubscribe()\r\n    this.deleteInvitationSubscription && this.deleteInvitationSubscription.unsubscribe()\r\n  }\r\n\r\n  componentDidUpdate(prevProps: ResendInvitationModalProps) {\r\n    if (prevProps.modalData !== this.props.modalData) {\r\n      this.populateContacts()\r\n    }\r\n  }\r\n\r\n  render() {\r\n    const { show, onHide } = this.props;\r\n    const deletingInvitation = this.state.deletingInvitation;\r\n    const resendingtInvitation = this.state.resendingtInvitation;\r\n\r\n    return <Modal backdrop=\"static\" centered show={show} onHide={onHide}>\r\n      <Modal.Header closeButton>\r\n        <Modal.Title>Resend/Delete Invitation</Modal.Title>\r\n      </Modal.Header>\r\n      <Modal.Body>\r\n        <Form>\r\n          <Form.Group controlId=\"adminEmail\" className=\"required\">\r\n            <Form.Label>Email Address</Form.Label>\r\n            <Form.Control type=\"text\" isInvalid={!this.state.emailValid} onChange={this.handleEmailChange} value={this.state.email} />\r\n            <Form.Control.Feedback type=\"invalid\">Please enter valid email.</Form.Control.Feedback>\r\n          </Form.Group>\r\n          <Form.Group controlId=\"adminPhone\" className=\"required\">\r\n            <Form.Label>Personal Phone</Form.Label>\r\n            <Form.Control type=\"text\" as={MaskedInput} mask=\"111-111-1111\" isInvalid={!this.state.phoneValid} onChange={this.handlePhoneChange} value={this.state.phone} />\r\n            <Form.Text>This phone number will be used to validate the Administrator. Please provide a direct number or mobile number (not a main company number or extension)</Form.Text>\r\n            <Form.Control.Feedback type=\"invalid\">Please enter valid phone.</Form.Control.Feedback>\r\n          </Form.Group>\r\n        </Form>\r\n      </Modal.Body>\r\n      <Modal.Footer>\r\n        <ActionButton variant=\"primary\" onClick={() => this.deleteInvitation()} disabled={!this.state.emailValid || !this.state.phoneValid} spin={deletingInvitation} disableOnSpin>\r\n          Delete Invitation\r\n        </ActionButton>\r\n        <ActionButton variant=\"primary\" onClick={() => this.resendInvitation()} disabled={!this.state.emailValid || !this.state.phoneValid} spin={resendingtInvitation} disableOnSpin>\r\n          Resend Invitation\r\n        </ActionButton>\r\n        <Button variant=\"secondary\" onClick={onHide}>\r\n          Cancel\r\n        </Button>\r\n      </Modal.Footer>\r\n    </Modal>\r\n  }\r\n}\r\n","import * as React from \"react\"\r\nimport { Modal, Form, Button, Col } from \"react-bootstrap\"\r\nimport { concat, of, Subject, Subscription } from \"rxjs\"\r\nimport { filter, map, switchMap } from \"rxjs/operators\"\r\nimport { connect } from \"react-redux\"\r\nimport { toast } from \"react-toastify\"\r\nimport Role from \"../../api/Roles/Model/Role\"\r\nimport { GetRoleDroplist } from \"../../api/Roles/UserRolesGet\"\r\nimport { EmailRegexp, PhoneRegexp } from \"../../config/Constants\"\r\nimport { EmailCheck } from \"../../api/Invitation/InformationGet\"\r\nimport MaskedInput from \"react-maskedinput\"\r\nimport ActionButton from \"../ActionButton\"\r\nimport { CreateSiteAdministrator } from \"../../api/Invitation/InvitationCreate\"\r\nimport { AppState, AssignedClinic } from \"../../AppState\"\r\nimport { RoleIdForSelectedCompany } from \"../../authentication/SelectedCompany/CompanySelectionDrivenSelectors\"\r\nimport { APIError } from \"../../api/ObservableFromFetch\"\r\n\r\ninterface AdminSetupModalProps {\r\n  show: boolean\r\n  onClose: (created: boolean) => void\r\n}\r\n\r\ninterface  AdminSetupModalAuthProps {\r\n  PrimaryRoleID?: number\r\n}\r\n\r\ninterface AdminSetupModalValidity {\r\n  emailValid: boolean\r\n  phoneValid: boolean\r\n  roleValid: boolean\r\n}\r\n\r\nexport interface AdminSetupModalData {\r\n  email: string\r\n  phone: string\r\n  roleID?: number\r\n}\r\n\r\ninterface AdminSetupModalState extends AdminSetupModalData, AdminSetupModalValidity {\r\n  emailChecking: boolean\r\n  emailAvailable?: boolean\r\n  saving: boolean\r\n  rolesLoading: boolean\r\n  roles?: Role[]\r\n}\r\n\r\nexport class AdminSetupModal extends React.PureComponent<AdminSetupModalProps & AdminSetupModalAuthProps, AdminSetupModalState> {\r\n  emptyData: AdminSetupModalData = {\r\n    email: \"\",\r\n    phone: \"\",\r\n    roleID: undefined,\r\n  }\r\n  positiveValidity: AdminSetupModalValidity = {\r\n    emailValid: true,\r\n    phoneValid: true,\r\n    roleValid: true,\r\n  }\r\n  defaultState: AdminSetupModalState = {\r\n    ...this.emptyData,\r\n    ...this.positiveValidity,\r\n    emailChecking: false,\r\n    emailAvailable: undefined,\r\n    rolesLoading: false,\r\n    saving: false,\r\n  }\r\n  state: AdminSetupModalState = { ...this.defaultState }\r\n\r\n  checkEmail$ = new Subject<string>()\r\n\r\n  emailExistsSubscription?: Subscription\r\n  userRolesSubscription?: Subscription\r\n  saveSubscription?: Subscription\r\n\r\n  componentDidMount() {\r\n    this.emailExistsSubscription = this.checkEmail$.pipe(\r\n      map(name => name.trim()),\r\n      filter(name => this.isEmailValid(name)),\r\n      switchMap(name => concat(\r\n        of({ loading: true }),\r\n        EmailCheck(name).pipe(\r\n          map(result => ({ loading: false, result: result.IsEmailExists }))\r\n        )\r\n    ))\r\n    ).subscribe(\r\n      (o: { loading: boolean, result?: boolean }) => this.setState({ emailChecking: o.loading, emailAvailable: !o.result }),\r\n      (error) => this.handleAPIError(error, { emailChecking: false, emailAvailable: undefined })\r\n    )\r\n\r\n    //TODO: replace with correct RoleID\r\n    const roleID = this.props.PrimaryRoleID || 0\r\n    this.setState({ rolesLoading: true })\r\n    this.userRolesSubscription = GetRoleDroplist(roleID).subscribe(\r\n      (data: Role[]) => this.setState({ roles: data, roleID: data.length === 1 ? data[0].RoleID : undefined, rolesLoading: false }),\r\n      (error) => this.handleAPIError(error, { rolesLoading: false, emailAvailable: undefined })\r\n    )\r\n  }\r\n\r\n  componentWillUnmount() {\r\n    this.emailExistsSubscription && this.emailExistsSubscription.unsubscribe()\r\n    this.userRolesSubscription && this.userRolesSubscription.unsubscribe()\r\n    this.saveSubscription && this.saveSubscription.unsubscribe()\r\n  }\r\n\r\n  handleAPIError = (error: Error | APIError, stateChanges: object) => {\r\n    this.setState(stateChanges)\r\n    error && toast.error((error as APIError)?.errorData?.message || error.message)\r\n  }\r\n\r\n  isEmailValid = (value: string) => EmailRegexp.test(value)\r\n  isPhoneValid = (value: string) => PhoneRegexp.test(value)\r\n  isRoleValid = (value: number | undefined): boolean => !!value && !!this.state.roles?.find(item => item.RoleID === value)\r\n\r\n  handleEmailChange = (e: React.ChangeEvent<HTMLInputElement>) => {\r\n    const value = e.target.value\r\n    this.setState({ email: value, emailValid: this.isEmailValid(value), emailAvailable: undefined })\r\n  }\r\n\r\n  handlePhoneChange = (e: React.ChangeEvent<HTMLInputElement>) => {\r\n    const value = e.target.value\r\n    this.setState({ phone: value, phoneValid: this.isPhoneValid(value) })\r\n  }\r\n\r\n  handleRoleChange = (e: React.ChangeEvent<HTMLSelectElement>) => {\r\n    const value = Number(e.target.value)\r\n    this.setState({ roleID: value, roleValid: this.isRoleValid(value) })\r\n  }\r\n\r\n  handleClose = (hasChanges: boolean) => {\r\n    const { roles } = this.state\r\n    this.setState({ ...this.defaultState, roleID: roles && roles.length === 1 ? roles[0].RoleID : undefined })\r\n    this.props.onClose(hasChanges)\r\n  }\r\n\r\n  handleCreateClick = () => {\r\n    if (this.state.emailChecking || this.state.rolesLoading) {\r\n      return\r\n    }\r\n    const { email, emailAvailable, phone, roleID } = this.state\r\n    const validity: AdminSetupModalValidity = {\r\n      emailValid: this.isEmailValid(email),\r\n      phoneValid: this.isPhoneValid(phone),\r\n      roleValid: this.isRoleValid(roleID)\r\n    }\r\n    const isValid = Object.values(validity).every((valid: boolean) => valid)\r\n    if (!isValid) {\r\n      this.setState(validity)\r\n      return\r\n    }\r\n    if (!emailAvailable || emailAvailable === undefined) {\r\n      return\r\n    }\r\n\r\n    this.setState({ saving: true })\r\n    this.saveSubscription && this.saveSubscription.unsubscribe()\r\n    this.saveSubscription = CreateSiteAdministrator(email, phone.replace(/-/g, \"\"), window.location.hostname, roleID || 0).subscribe(\r\n      (data) => {\r\n        toast.success(data)\r\n        this.handleClose(true)\r\n      },\r\n      (error) => this.handleAPIError(error, { saving: false })\r\n    )\r\n  }\r\n\r\n  render() {\r\n    const { email, emailValid, emailChecking, emailAvailable, phone, phoneValid, roleID, roleValid, rolesLoading } = this.state\r\n\r\n    return (<>\r\n      <Modal centered backdrop=\"static\" size=\"xl\" show={this.props.show} onHide={this.props.onClose}>\r\n        <Modal.Header closeButton>\r\n          <Modal.Title>SITE ADMINISTRATOR SETUP</Modal.Title>\r\n        </Modal.Header>\r\n        <Modal.Body>\r\n          <Form>\r\n            <Form.Row className=\"form-group required\">\r\n              <Form.Label column sm={3} htmlFor=\"email\">Site Administrator Email Address</Form.Label>\r\n              <Col sm={9}>\r\n                <Form.Control id=\"email\"\r\n                  type=\"text\"\r\n                  value={email}\r\n                  onChange={this.handleEmailChange}\r\n                  onBlur={(e: React.FocusEvent<HTMLInputElement>) => this.checkEmail$.next(e.target.value)}\r\n                  isInvalid={!emailValid}\r\n                  disabled={emailChecking} />\r\n                {!emailChecking && !emailValid && <Form.Control.Feedback type=\"invalid\" className=\"d-block\">Please enter valid email</Form.Control.Feedback>}\r\n                {!emailChecking && emailAvailable && < Form.Control.Feedback type=\"valid\" className=\"d-block\">Email is available</Form.Control.Feedback>}\r\n                {!emailChecking && emailAvailable === false && <Form.Control.Feedback type=\"invalid\" className=\"d-block\">Email is already in use</Form.Control.Feedback>}\r\n              </Col>\r\n            </Form.Row>\r\n            <Form.Row className=\"form-group required\">\r\n              <Form.Label column sm={3} htmlFor=\"phone\">Site Administrator Personal Phone</Form.Label>\r\n              <Col sm={9}>\r\n                <Form.Control id=\"phone\" type=\"text\" as={MaskedInput} mask=\"111-111-1111\" value={phone} onChange={this.handlePhoneChange} isInvalid={!phoneValid} />\r\n                <Form.Text>This phone number will be used to validate the Administrator. Please provide a direct number or mobile number (not a main company number or extension)</Form.Text>\r\n              </Col>\r\n            </Form.Row>\r\n            <Form.Row className=\"form-group required\">\r\n              <Form.Label column sm={3} htmlFor=\"role\">Role</Form.Label>\r\n              <Col sm={9}>\r\n                <Form.Control id=\"role\" as=\"select\" onChange={this.handleRoleChange} value={roleID || \"\"} isInvalid={!roleValid}>\r\n                  {this.state.roles && this.state.roles.length > 1 && <option value=\"\">Select Role</option>}\r\n                  {this.state.roles?.map(role => <option value={role.RoleID} key={role.RoleID} title={role.Description}>{role.Title}</option>)}\r\n                </Form.Control>\r\n              </Col>\r\n            </Form.Row>\r\n          </Form>\r\n        </Modal.Body>\r\n        <Modal.Footer>\r\n          <Button variant=\"secondary\" onClick={() => this.handleClose(false)}>Cancel</Button>\r\n          <ActionButton variant=\"primary\" disabled={emailChecking || rolesLoading} onClick={this.handleCreateClick} spin={this.state.saving} disableOnSpin>Create</ActionButton>\r\n        </Modal.Footer>\r\n      </Modal>\r\n    </>\r\n    )\r\n  }\r\n}\r\n\r\nfunction mapStateToProps(state: AppState): AdminSetupModalAuthProps {\r\n  return {\r\n    PrimaryRoleID: RoleIdForSelectedCompany(state)\r\n  }\r\n}\r\n\r\nconst ConnectedAdminSetupModal = connect(mapStateToProps, null)(AdminSetupModal)\r\nexport default ConnectedAdminSetupModal\r\n","import * as React from \"react\"\r\nimport { Container, Row, Col, Table, Spinner, Button } from \"react-bootstrap\"\r\nimport { AppPageWrapper } from \"../NavMenu/AppPageWrapper\"\r\nimport { Subscription, BehaviorSubject, of, concat } from \"rxjs\"\r\nimport { distinctUntilChanged, switchMap, map, catchError } from \"rxjs/operators\"\r\nimport { toast } from \"react-toastify\"\r\nimport { InvitationGridRequest } from \"../../api/InvitationStatus/Model/InvitationGridRequest\"\r\nimport { ColumnFilters, InvitationGridResponse } from \"../../api/InvitationStatus/Model/InvitationGridResponse\"\r\nimport InvitationStatusListGet from \"../../api/InvitationStatus/InvitationStatusListGet\"\r\nimport InvitationStatusGridRecord from \"../../api/InvitationStatus/Model/InvitationStatusGridRecord\"\r\nimport TablePagination from \"../TablePagination\"\r\nimport { Filter, Sort } from \"../../api/GridRequest\"\r\nimport ResendInvitationModal from \"./ResendInvitationModal\"\r\nimport ColumnHeaderFilter from \"../ColumnHeaderFilter\"\r\nimport AdminSetupModal from \"../Invitation/AdminSetupModal\"\r\nimport { getStatusLabelByKey, InvitationStatus } from \"../../api/Invitation/Model/InvitationStatus\"\r\nimport FormatDate from \"../../formatters/FormatDate\"\r\nimport { CustomizableFilterColumn } from \"../ColumnsCustomizeModal/CustomizableColumn\"\r\nimport { isSiteAdmin } from \"../../authentication/isAdminRole\"\r\nimport { connect } from \"react-redux\"\r\nimport { AppState } from \"../../AppState\"\r\nimport ColumnsCustomizeModal, { loadCustomized } from \"../ColumnsCustomizeModal/ColumnsCustomizeModal\"\r\nimport { StorageKey } from \"../../config/Constants\"\r\n\r\ntype Column = CustomizableFilterColumn<keyof InvitationStatusGridRecord, keyof ColumnFilters>\r\n\r\ninterface InvitationStatusGridProps {\r\n  isSiteAdmin?: boolean\r\n}\r\n\r\ninterface InvitationStatusGridState {\r\n  data?: InvitationGridResponse\r\n  loading: boolean\r\n  modal: boolean\r\n  modalData?: InvitationStatusGridRecord\r\n  pageNumber: number\r\n  showAdminInvitation: boolean\r\n  customizeModal: boolean,\r\n  columns: Column[],\r\n  sort: Sort\r\n  filters: Filter[]\r\n}\r\n\r\nconst PageSize = 20\r\nconst ShowModalForStatus = [\r\n  InvitationStatus.INVITATION_REQUESTED,\r\n  InvitationStatus.TOO_MANY_ATTEMPT,\r\n  InvitationStatus.PENDING,\r\n  InvitationStatus.EXPIRED\r\n]\r\n\r\nconst defaultColumns: Column[] = [\r\n  { name: \"Name\", filter: \"CompanyName\", label: \"Company\", visible: true, customize: true },\r\n  { name: \"PrimaryRoleTitle\", filter: \"Role\", label: \"Role\", visible: true, customize: true },\r\n  { name: \"UserName\", filter: \"EmailAddress\", label: \"Email Address\", visible: true, customize: true },\r\n  { name: \"ModifiedOn\", filter: \"InvitationSent\", label: \"Invite Sent\", visible: true, customize: true },\r\n  { name: \"EnrollmentStarted\", filter: \"EnrollmentStarted\", label: \"Enrollment Started\", visible: true, customize: true },\r\n  { name: \"Status\", filter: \"Status\", label: \"Invite Status\", visible: true, customize: true },\r\n  { name: \"InActive\", filter: \"InActive\", label: \"Active/InActive\", visible: true, customize: true },\r\n  { name: \"Link\", label: \"Invite Link\", visible: false, customize: true }\r\n]\r\n\r\nexport class InvitationStatusGrid extends React.PureComponent<InvitationStatusGridProps, InvitationStatusGridState> {\r\n  state: InvitationStatusGridState = {\r\n    loading: false,\r\n    modal: false,\r\n    pageNumber: 1,\r\n    showAdminInvitation: false,\r\n    customizeModal: false,\r\n    columns: loadCustomized(StorageKey.InvitationStatusGridColumns, defaultColumns) as Column[],\r\n    sort: { column: \"ModifiedOn\", order: \"DSC\" },\r\n    filters: []\r\n  }\r\n\r\n  page$ = new BehaviorSubject<InvitationGridRequest>({\r\n    pageNumber: 1,\r\n    sort: { column: \"ModifiedOn\", order: \"DSC\" },\r\n    filters: [],\r\n    pageSize: PageSize\r\n  })\r\n\r\n  pageSubscription?: Subscription\r\n\r\n  pageChanged = (pageNumber: number) => {\r\n    this.setState({ pageNumber: pageNumber })\r\n    this.page$.next({ ...this.page$.getValue(), pageNumber: pageNumber })\r\n  }\r\n\r\n  componentDidMount() {\r\n    this.pageSubscription = this.page$.pipe(\r\n      distinctUntilChanged(),\r\n      switchMap(params => concat(\r\n        of({ loading: true }),\r\n        InvitationStatusListGet(params).pipe(\r\n          map((result: InvitationGridResponse) => ({ data: result, loading: false })),\r\n          catchError(() => of({ loading: false }))\r\n        )\r\n      ))\r\n    ).subscribe(\r\n      (newState: { loading: boolean, data?: InvitationGridResponse }) => {\r\n        if (newState.data) {\r\n          if (newState.data.InActive?.length) {\r\n            newState.data.InActive = newState.data.InActive.map(inactiveString => inactiveString === \"true\" ? \"Inactive\" : \"Active\")\r\n          }\r\n          if (newState.data.Status?.length) {\r\n            newState.data.Status = newState.data.Status.map(status => getStatusLabelByKey(InvitationStatus[status as keyof typeof InvitationStatus]))\r\n          }\r\n          this.setState({ loading: newState.loading, data: newState.data })\r\n        } else {\r\n          this.setState({ loading: newState.loading })\r\n        }\r\n      },\r\n      (error: string) => {\r\n        this.setState({ loading: false })\r\n        toast.error(error)\r\n      }\r\n    )\r\n  }\r\n\r\n  componentWillUnmount() {\r\n    this.pageSubscription && this.pageSubscription.unsubscribe()\r\n    this.page$.unsubscribe()\r\n  }\r\n\r\n  showModal = (row: InvitationStatusGridRecord) => this.setState({ modal: true, modalData: row })\r\n\r\n  hideModal = () => this.setState({ modal: false, modalData: undefined })\r\n\r\n  getUserName = (row: InvitationStatusGridRecord) => {\r\n    if (ShowModalForStatus.indexOf(row.Status) >= 0) {\r\n      return <Button variant=\"link\" className=\"text-left p-0\" onClick={() => this.showModal(row)}>{row.UserName}</Button>\r\n    } else {\r\n      return row.UserName\r\n    }\r\n  }\r\n\r\n  sortGrid(column: string, order?: string) {\r\n    const newSort = { column: column, order: order || \"\" }\r\n    this.setState({ sort: newSort })\r\n    this.page$.next({ ...this.page$.getValue(), sort: newSort })\r\n  }\r\n\r\n  filterGrid(column: string, items: string[]) {\r\n    this.setState(prevState => {\r\n      const filters = [...prevState.filters]\r\n      const filter = { column: column, values: items }\r\n      let index = filters.findIndex(item => item.column === filter.column)\r\n      if (index >= 0) {\r\n        filters[index] = filter\r\n      } else {\r\n        filters.push(filter)\r\n      }\r\n      return { filters: filters }\r\n    }, () => {\r\n      this.setState({ pageNumber: 1 })\r\n      this.page$.next({ ...this.page$.getValue(), pageNumber: 1, filters: this.state.filters })\r\n    })\r\n  }\r\n\r\n  visibleColumns = () => this.state.columns.filter(col => col.visible)\r\n\r\n  renderCell = (row: InvitationStatusGridRecord, colName: keyof InvitationStatusGridRecord, key: number) => {\r\n    let keyCell = `${key}_${colName}`\r\n    switch (colName) {\r\n      case \"UserName\":\r\n        return <td key={keyCell} className=\"align-text-top\">{this.getUserName(row)}</td>\r\n      case \"ModifiedOn\":\r\n        return <td key={keyCell} className=\"align-text-top\">{FormatDate(row.ModifiedOn)}</td>\r\n      case \"EnrollmentStarted\":\r\n        return <td key={keyCell} className=\"align-text-top\">{FormatDate(row.EnrollmentStarted)}</td>\r\n      case \"Status\":\r\n        return <td key={keyCell} className=\"align-text-top\">{getStatusLabelByKey(row.Status)}</td>\r\n      case \"InActive\":\r\n        return <td key={keyCell} className=\"align-text-top\">{row.InActive ? \"InActive\" : \"Active\"}</td>\r\n      case \"Link\":\r\n        return <td key={keyCell} className=\"align-text-top\"><Button variant=\"link\" onClick={() => this.onGoToInvitationLink(row.Link)} className=\"text-left p-0\">{row.Link}</Button></td>\r\n      default:\r\n        return <td key={keyCell} className=\"align-text-top\">{row[colName]}</td>\r\n    }\r\n  }\r\n\r\n  renderDataColumns = (row: InvitationStatusGridRecord) =>\r\n    this.visibleColumns().map((col, i) =>\r\n      this.renderCell(row, col.name as keyof InvitationStatusGridRecord, i))\r\n\r\n  renderRows = () => {\r\n    const { data } = this.state\r\n    if (data?.Records?.length) {\r\n      return data?.Records?.map((rows: InvitationStatusGridRecord[]) =>\r\n        rows.map((row: InvitationStatusGridRecord, i: number) =>\r\n          <tr key={`row_${i}`}>\r\n            {this.renderDataColumns(row)}\r\n          </tr>))\r\n    } else {\r\n      return <tr><td colSpan={this.visibleColumns().length + 1}>No Records Found</td></tr>\r\n    }\r\n  }\r\n\r\n  renderHeader = () => this.visibleColumns().map((column: Column) => {\r\n    const { sort, filters } = this.page$.value\r\n    const { data } = this.state\r\n    const { name, label, filter } = column\r\n    return (\r\n      <th key={name} className=\"text-nowrap font-weight-normal\">\r\n        {data && filter && filter in data &&\r\n          <ColumnHeaderFilter\r\n            uppercase={false}\r\n            title={label || name}\r\n            filteredItems={filters.find(item => item.column === filter)?.values || []}\r\n            sort={sort.column === name ? sort.order === \"asc\" ? \"asc\" : \"desc\" : undefined}\r\n            items={data[filter as keyof ColumnFilters]?.filter(item => !!item) || []}\r\n            onSort={(order?: string) => this.sortGrid(name, order)}\r\n            onFilter={(items: string[]) => filter && this.filterGrid(filter, items)}\r\n          />}\r\n        {(!data || !filter) && (label || name)}\r\n      </th>\r\n    )\r\n  })\r\n\r\n  deleteInvitation = () => {\r\n    this.hideModal()\r\n    this.page$.next({ ...this.page$.getValue() })\r\n  }\r\n\r\n  resendInvitation = () => {\r\n    this.hideModal()\r\n    this.page$.next({ ...this.page$.getValue() })\r\n  }\r\n\r\n  handleInvitationSetupModalClose = (hasUpdates: boolean) => {\r\n    this.setState({ showAdminInvitation: false })\r\n    if (hasUpdates) {\r\n      this.pageChanged(1)\r\n    }\r\n  }\r\n\r\n  onGoToInvitationLink = (url: string) => {\r\n    window.open(url, \"_blank\", \"noopener,noreferrer\")\r\n  }\r\n\r\n  render() {\r\n    const { isSiteAdmin } = this.props\r\n    return (\r\n      <AppPageWrapper showNav parentClassName={\"align-items-center\"}>\r\n        <ResendInvitationModal show={this.state.modal} modalData={this.state.modalData} onHide={this.hideModal}\r\n          onDeleteInvitation={this.deleteInvitation} onResendInvitation={this.resendInvitation} />\r\n        <Container fluid className=\"pt-5 grid-container\">\r\n          <Row className=\"pb-2\">\r\n            <Col className=\"text-md-right mt-2 mt-md-0\">\r\n              {isSiteAdmin && <>\r\n                <ColumnsCustomizeModal\r\n                  show={this.state.customizeModal}\r\n                  columns={this.state.columns}\r\n                  storeKey={StorageKey.InvitationStatusGridColumns}\r\n                  onClose={() => this.setState({ customizeModal: false })}\r\n                  onSave={columns => this.setState({ columns: columns as Column[], customizeModal: false })} />\r\n                <Button variant=\"secondary\" className=\"mr-1\" size=\"sm\" onClick={() => this.setState({ customizeModal: true })}>Customize</Button>\r\n                <Button variant=\"primary\" className=\"mr-1\" size=\"sm\" onClick={() => this.setState({ showAdminInvitation: true })}>Add New Site Administrator</Button>\r\n              </>}\r\n            </Col>\r\n          </Row>\r\n          <Row>\r\n            <Col>\r\n              <Table bordered responsive>\r\n                <thead className=\"thead-light bordered responsive\">\r\n                  <tr>\r\n                    {this.renderHeader()}\r\n                  </tr>\r\n                </thead>\r\n                <tbody>\r\n                  {\r\n                    this.state.loading ?\r\n                      <tr>\r\n                        <td className=\"text-center\" colSpan={this.visibleColumns().length + 1}>\r\n                          <Spinner animation=\"border\" variant=\"secondary\" />\r\n                        </td>\r\n                      </tr> : this.renderRows()\r\n                  }\r\n                </tbody>\r\n              </Table>\r\n            </Col>\r\n          </Row>\r\n          {this.state.data && !this.state.loading && <React.Fragment>\r\n            <span className=\"total-records\">Total records: {this.state.data.Total}</span>\r\n            <TablePagination pageNumber={this.state.pageNumber} pages={this.state.data.Pages} onChange={this.pageChanged} />\r\n          </React.Fragment>}\r\n        </Container>\r\n        { this.state.showAdminInvitation && <AdminSetupModal show={this.state.showAdminInvitation} onClose={this.handleInvitationSetupModalClose} />}\r\n      </AppPageWrapper>\r\n    )\r\n  }\r\n}\r\n\r\nfunction mapStateToProps(state: AppState): InvitationStatusGridProps {\r\n  return {\r\n    isSiteAdmin: isSiteAdmin(state)\r\n  }\r\n}\r\nconst ConnectedInvitationStatusGrid = connect(mapStateToProps, null)(InvitationStatusGrid)\r\nexport default ConnectedInvitationStatusGrid\r\n","import { ObservableFromFetch } from \"../ObservableFromFetch\"\r\nimport GlobalParameterData from \"./Model/GlobalParameterData\"\r\n\r\nexport function GetGlobalParameter(parameterTitle: string) {\r\n    const requestBody: string = new URLSearchParams({\r\n      parameterTitle: parameterTitle.toString()\r\n    }).toString()\r\n  \r\n    return ObservableFromFetch<GlobalParameterData>(\"FFOrderGlobalParameters/GetGlobalParameters?\" + requestBody)\r\n\r\n}\r\n\r\nexport function GlobalParameterUpdate(data: GlobalParameterData) {\r\n  const requestBody = JSON.stringify({\r\n\r\n    ParameterID: data.ParameterID ? data.ParameterID : undefined,\r\n    ParameterTitle: data.ParameterTitle,\r\n    ParameterDescription: data.ParameterDescription,\r\n    ParameterType: data.ParameterType,\r\n    ParameterValue: data.ParameterValue,\r\n    CreatedBy: '',\r\n    ModifiedBy: ''\r\n  })\r\n\r\n  return ObservableFromFetch<string>(\"FFOrderGlobalParameters/SetGlobalParameters\", requestBody)\r\n}\r\n","import { ObservableFromFetch } from \"../ObservableFromFetch\"\r\nimport ParameterTypeData from \"./Model/ParameterTypeData\"\r\n\r\n\r\nexport  function ParameterTypeUpdate(data: ParameterTypeData) {\r\n  const requestBody = JSON.stringify({\r\n            ParameterType: data.ParameterType,\r\n            ParameterTypeDescription: data.ParameterTypeDescription,\r\n            CreatedBy: data.CreatedBy,\r\n            ModifiedBy: data.ModifiedBy\r\n  })\r\n\r\n  return ObservableFromFetch<string>(\"FFOrderGlobalParameters/SetParameterType\", requestBody)\r\n}\r\n\r\nexport  function GetParameterType(parameterType: string) {\r\n  const requestBody: string = new URLSearchParams({\r\n      parameterType: parameterType.toString()\r\n    }).toString()\r\n  return ObservableFromFetch<ParameterTypeData>(\"FFOrderGlobalParameters/GetParameterByParameterType?\" + requestBody)\r\n}\r\n\r\nexport  function GetParameterTypes() {\r\n  return ObservableFromFetch<ParameterTypeData[]>(\"FFOrderGlobalParameters/GetParameterType\")\r\n}\r\n","import React from \"react\"\r\nimport { Modal, Form, Col, Row, Button } from \"react-bootstrap\"\r\nimport { toast } from \"react-toastify\"\r\nimport { Subscription } from \"rxjs\"\r\nimport { GetParameterType, ParameterTypeUpdate} from \"../../api/Administration/ParameterType\"\r\nimport ParameterTypeData from \"../../api/Administration/Model/ParameterTypeData\"\r\nimport ActionButton from \"../ActionButton\"\r\n\r\ninterface ParameterTypeModalProps {\r\n  show:boolean\r\n  LoginName:string\r\n  onCancel: () => void\r\n  onSubmit: (parameterType: string, parameterTypeDescription: string) => void\r\n}\r\n\r\ninterface ParameterTypeModalState {\r\n  parameterTypeID: number\r\n  parameterType: string\r\n  parameterTypeDescription: string\r\n  isTypeValid:boolean\r\n  isDescriptionValid:boolean\r\n  dataLoading:boolean\r\n  dataLoaded:boolean\r\n  dataSaving:boolean\r\n\r\n}\r\n\r\nexport default class ParameterTypeModal extends React.PureComponent<ParameterTypeModalProps, ParameterTypeModalState> {\r\n  \r\n  emptyState: ParameterTypeModalState = {\r\n    parameterTypeID:0,\r\n    parameterType: \"\",\r\n    parameterTypeDescription: \"\",\r\n    isTypeValid:false,\r\n    isDescriptionValid:false,\r\n    dataLoading:false,\r\n    dataLoaded:false,\r\n    dataSaving:false\r\n  }\r\n  state: ParameterTypeModalState = { ...this.emptyState }\r\n  subscription?: Subscription\r\n  saveSubscription?: Subscription\r\n\r\n  componentDidUpdate(prevProps: ParameterTypeModalProps) {\r\n    //if (this.props.show && this.props.show !== prevProps.show) {\r\n      //this.loadSubscriptionPlans()\r\n    //}\r\n  }\r\n\r\n  componentWillUnmount() {\r\n    this.subscription && this.subscription.unsubscribe()\r\n    this.saveSubscription && this.saveSubscription.unsubscribe()\r\n  }\r\n  handleTypeChange = ( value: string) => {\r\n    this.setState(\r\n      { \r\n        parameterType: value, \r\n        isTypeValid: this.isTypeValid(value),\r\n        parameterTypeDescription: \"\",\r\n        isDescriptionValid: this.isDescriptionValid(\"\"),\r\n        dataLoaded:false\r\n        \r\n    }) \r\n  }\r\n  handleDescriptionChange = ( value: string) => {\r\n    this.setState(\r\n      { \r\n        parameterTypeDescription: value,\r\n        isDescriptionValid: this.isDescriptionValid(value) \r\n      })\r\n  }\r\n  isTypeValid = (value: string) => {\r\n    if (value.length < 1) {\r\n      return false\r\n    }\r\n    return true;\r\n  }\r\n  isDescriptionValid = (value: string) => {\r\n    if (value.length < 1) {\r\n      return false\r\n    }\r\n    return true;\r\n  }\r\n  handleRetrieve = () => {\r\n    this.setState({ dataLoading: true, dataLoaded:false })\r\n    const { parameterType } = this.state\r\n\r\n      this.subscription = GetParameterType(parameterType).subscribe(\r\n        (data: ParameterTypeData) => {\r\n          this.setState({ \r\n            parameterTypeID: data.ParameterTypeID,\r\n            parameterType:  data.ParameterType,\r\n            parameterTypeDescription:  data.ParameterTypeDescription,\r\n            isTypeValid: this.isTypeValid(data.ParameterType),\r\n            isDescriptionValid: this.isDescriptionValid(data.ParameterTypeDescription),\r\n            dataLoading: false, \r\n            dataLoaded:true\r\n          })\r\n        },\r\n        (error) => {\r\n          toast.error(error?.errorData?.message || error.message)\r\n          this.setState({ dataLoading: false,dataLoaded:true })\r\n        },\r\n        () => {\r\n          this.setState({ dataLoading: false, dataLoaded:true })\r\n        }\r\n      )\r\n  }\r\n\r\n  handleSubmit = () => {\r\n    this.setState({ dataSaving: true, dataLoading:false })\r\n    const updateData = this.stateToData()\r\n    this.saveSubscription && this.saveSubscription.unsubscribe()\r\n    this.saveSubscription = ParameterTypeUpdate(updateData).subscribe(\r\n      data => {\r\n        this.setState({ dataSaving: false })\r\n        toast.success(data),\r\n        this.onSubmit()\r\n      },\r\n      (error) => {\r\n        toast.error(error?.errorData?.message || error.message)\r\n        this.setState({ dataSaving: false })\r\n      },\r\n      () => {\r\n        this.setState({ dataSaving: false })\r\n      }\r\n    )\r\n\r\n  }\r\n\r\n  loadSubscriptionPlans = () => {\r\n    this.setState({ dataLoading: true })\r\n    /*\r\n    this.subscription = GetSubscriptionPlans().subscribe(\r\n      (data: SubscriptionPlan[]) => this.setState({ loading: false, availableSubscriptionPlans: data }),\r\n      (error) => {\r\n        toast.error(error?.errorData?.message || error.message)\r\n        this.setState({ loading: false })\r\n      },\r\n      () => this.setState({ loading: false })\r\n    )\r\n    */\r\n  }\r\n\r\n  onCancel = () => {\r\n    this.props.onCancel()\r\n  }\r\n\r\n  onSubmit = () => {\r\n    this.props.onSubmit(this.state.parameterType, this.state.parameterTypeDescription)\r\n  }\r\n  render() {\r\n\r\n    const {parameterType, parameterTypeDescription, isTypeValid, isDescriptionValid, dataLoading, dataLoaded, dataSaving} = this.state\r\n    //const currentPlan: SubscriptionPlan = availableSubscriptionPlans.filter((plan: SubscriptionPlan) => plan.SubscriptionPlanID === this.props.subscriptionPlanID)[0]\r\n    return (\r\n      <>\r\n        <Modal backdrop=\"static\" show={ this.props.show } size=\"lg\" dialogClassName=\"dark\">\r\n          <Modal.Header>\r\n            <Modal.Title className=\"text-uppercase\">ADD / EDIT DATA TYPE</Modal.Title>\r\n          </Modal.Header>\r\n          <Modal.Body>\r\n            <Form >\r\n            <Form.Row className=\"form-group required\">\r\n              <Form.Label column lg={2} htmlFor=\"parameterType\">Type</Form.Label>\r\n              <Col lg={7}>\r\n                  <Form.Control \r\n                  id=\"parameterType\" \r\n                  className=\"bg-white\" \r\n                  type=\"text\" \r\n                  maxLength={1}\r\n                  value={this.state.parameterType} \r\n                  onChange={e => this.handleTypeChange(e.target.value)}\r\n                  />\r\n              </Col>\r\n              <Col lg={2}>\r\n                <ActionButton variant=\"secondary\" onClick={this.handleRetrieve} disabled={dataLoading || dataSaving || !isTypeValid} spin={dataLoading} disableOnSpin>Retrieve</ActionButton>\r\n              </Col>\r\n            </Form.Row>\r\n          <Form.Row className=\"form-group required\">\r\n              <Form.Label column lg={2} htmlFor=\"parameterDescription\">Description</Form.Label>\r\n              <Col lg={7}>\r\n                  <Form.Control \r\n                  id=\"parameterDescription\" \r\n                  className=\"bg-white\"  \r\n                  as=\"textarea\" \r\n                  rows={3} \r\n                  maxLength={25}\r\n                  value={this.state.parameterTypeDescription} \r\n                  onChange={e => this.handleDescriptionChange(e.target.value)}\r\n                  disabled={ dataLoading || dataSaving || !isTypeValid || !dataLoaded}\r\n                  />\r\n              </Col>\r\n              <Col lg={2}>\r\n              </Col>\r\n            </Form.Row>\r\n            </Form>\r\n          </Modal.Body>\r\n          <Modal.Footer>\r\n            <ActionButton \r\n            variant=\"primary\" \r\n            onClick={ this.handleSubmit } \r\n            disabled={ dataLoading || dataSaving || !isTypeValid || !isDescriptionValid} spin={ dataSaving } disableOnSpin>Submit</ActionButton>\r\n            <Button variant=\"secondary\" onClick={ this.onCancel } className=\"px-4\">Cancel</Button>\r\n          </Modal.Footer>\r\n        </Modal>\r\n      </>\r\n    )\r\n    }\r\n    \r\n    stateToData():ParameterTypeData {\r\n      return {\r\n        ParameterTypeID: this.state.parameterTypeID,\r\n        ParameterType: this.state.parameterType,\r\n        ParameterTypeDescription: this.state.parameterTypeDescription,\r\n        CreatedBy: this.props.LoginName,\r\n        ModifiedBy: this.props.LoginName\r\n      }\r\n    }\r\n  \r\n  \r\n}\r\n","import React from \"react\"\r\nimport { Button, Modal, Form, Col, InputGroup, Row, Spinner } from \"react-bootstrap\"\r\nimport { toast } from \"react-toastify\"\r\nimport { Subscription } from \"rxjs\"\r\nimport ActionButton from \"../ActionButton\"\r\nimport GlobalParameterData from \"../../api/Administration/Model/GlobalParameterData\"\r\nimport {GetGlobalParameter, GlobalParameterUpdate} from \"../../api/Administration/GlobalParameter\"\r\nimport ParameterTypeData from \"../../api/Administration/Model/ParameterTypeData\"\r\nimport {GetParameterTypes} from \"../../api/Administration/ParameterType\"\r\nimport { RouteComponentProps } from \"react-router\"\r\nimport { Home } from \"../../config/Routes\"\r\nimport { AppState } from \"../../AppState\"\r\nimport { connect } from \"react-redux\"\r\nimport ParameterTypeModal from \"./ParameterTypeModal\"\r\nimport {getLoggedInUserName } from \"../../authentication/SelectedCompany/CompanySelectionDrivenSelectors\"\r\nimport { AppPageWrapper } from \"../NavMenu/AppPageWrapper\"\r\n\r\ninterface GlobalParameterProps {\r\n  LoginName: string\r\n}\r\n\r\ninterface GlobalParameterState {\r\n  parameterID: number\r\n  parameterTitle: string\r\n  parameterDescription: string\r\n  parameterType: string\r\n  parameterValue: string\r\n  createdBy: string\r\n  modifiedBy: string\r\n  isTitleValid: boolean\r\n  isDescriptionValid: boolean\r\n  isTypeValid:boolean\r\n  isValueValid:boolean\r\n  dataLoading:boolean\r\n  dataSaving:boolean\r\n  parameterTypesLoading:boolean\r\n  parameterTypes: ParameterTypeData[]\r\n  selectedItem?: GlobalParameterData\r\n  showAddParameterType:boolean\r\n  parameterTypesSubmitted:number\r\n\r\n}\r\n\r\n\r\nexport class GlobalParameter extends React.Component<GlobalParameterProps & RouteComponentProps, GlobalParameterState> {\r\n  \r\n  emptyState: GlobalParameterState = {\r\n    parameterID:0,\r\n    parameterTitle: \"\",\r\n    parameterDescription: \"\",\r\n    parameterType: \"\",\r\n    parameterValue: \"\",\r\n    createdBy: \"\",\r\n    modifiedBy: \"\",\r\n    isTitleValid: false,\r\n    isDescriptionValid: false,\r\n    isTypeValid:false,\r\n    isValueValid:false,\r\n    dataLoading:false,\r\n    dataSaving:false,\r\n    parameterTypesLoading:false,\r\n    parameterTypes:[],\r\n    selectedItem: undefined,\r\n    showAddParameterType: false,\r\n    parameterTypesSubmitted:0\r\n  }\r\n  \r\n  state: GlobalParameterState = { ...this.emptyState }\r\n\r\n  saveSubscription?: Subscription\r\n  loadSubscription?: Subscription\r\n  loadParameterTypeSubscription?: Subscription\r\n\r\n  componentDidMount() {\r\n    this.setState({ parameterTypesLoading: true, parameterTypes:[], selectedItem: undefined })\r\n\r\n    this.loadParameterTypeSubscription = GetParameterTypes().subscribe(\r\n      (parameterTypes: ParameterTypeData[]) => {\r\n        this.setState({ \r\n          parameterTypes: parameterTypes,\r\n          parameterTypesLoading: false \r\n        })\r\n      },\r\n      (error) => {\r\n        toast.error(error?.errorData?.message || error.message)\r\n        this.setState({ parameterTypesLoading: false, parameterTypes:[]})\r\n      },\r\n      () => {\r\n        this.setState({ parameterTypesLoading: false })\r\n      }\r\n    )\r\n\r\n  }\r\n\r\n  componentWillUnmount() {\r\n    this.saveSubscription && this.saveSubscription.unsubscribe()\r\n    this.loadSubscription && this.loadSubscription.unsubscribe()\r\n    this.loadParameterTypeSubscription && this.loadParameterTypeSubscription.unsubscribe()\r\n  }\r\n  handleExit = () => {\r\n    (this.props as RouteComponentProps).history?.push(Home)\r\n  }\r\n  handleCancel = () => {\r\n    this.clearData()\r\n  }\r\n  handleSubmit = () => {\r\n    this.setState({ dataSaving: true })\r\n    const updateData = this.stateToData()\r\n    this.saveSubscription && this.saveSubscription.unsubscribe()\r\n    this.saveSubscription = GlobalParameterUpdate(updateData).subscribe(\r\n      data => {\r\n        this.setState({ dataSaving: false })\r\n        toast.success(data)\r\n      },\r\n      (error) => {\r\n        toast.error(error?.errorData?.message || error.message)\r\n        this.setState({ dataSaving: false })\r\n      },\r\n      () => {\r\n        this.setState({ dataSaving: false })\r\n      }\r\n    )\r\n\r\n  }\r\n\r\n  handleTitleChange = ( value: string) => {\r\n    this.setState(\r\n      { \r\n        parameterTitle: value, \r\n        isTitleValid: this.isTitleValid(value) \r\n    }) \r\n  }\r\n\r\n  handleDescriptionChange = ( value: string) => {\r\n    this.setState(\r\n      { \r\n        parameterDescription:value, \r\n        isDescriptionValid: this.isDescriptionValid(value)  \r\n      })\r\n  }\r\n  handleValueChange = ( value: string) => {\r\n    this.setState(\r\n      { \r\n        parameterValue:value,\r\n        isValueValid: this.isValueValid(value)  \r\n\r\n      })\r\n  }\r\n  handleParameterTypeChange = (e: React.ChangeEvent<HTMLInputElement>) => {\r\n    const pt = this.state.parameterTypes.find(item => item.ParameterType === String(e.target.value))\r\n    const value = pt?.ParameterType || \"\"\r\n    this.setState(\r\n      { \r\n        parameterType: value,\r\n        isTypeValid : this.isParameterTypeValid(value)\r\n    })\r\n  }\r\n  handleRetrieve = () => {\r\n    this.setState({ dataLoading: true, selectedItem: undefined })\r\n    const { parameterTitle} = this.state\r\n\r\n      this.loadSubscription = GetGlobalParameter(parameterTitle).subscribe(\r\n        (data: GlobalParameterData) => {\r\n          this.setState({ \r\n            selectedItem: data,\r\n            parameterID: data.ParameterID,\r\n            parameterTitle:  data.ParameterTitle,\r\n            parameterDescription:  data.ParameterDescription,\r\n            parameterType:  data.ParameterType,\r\n            parameterValue:  data.ParameterValue,\r\n            isTitleValid:  this.isValueValid(data.ParameterTitle),\r\n            isDescriptionValid:  this.isDescriptionValid(data.ParameterDescription),\r\n            isTypeValid: this.isParameterTypeValid(data.ParameterType),\r\n            isValueValid: this.isValueValid(data.ParameterValue),\r\n            dataLoading: false \r\n          })\r\n        },\r\n        (error) => {\r\n          toast.error(error?.errorData?.message || error.message)\r\n          this.setState({ dataLoading: false })\r\n        },\r\n        () => {\r\n          this.setState({ dataLoading: false })\r\n        }\r\n      )\r\n  }\r\n  handleAddParameterType = () => {\r\n    this.setState(\r\n      {\r\n        showAddParameterType:true,\r\n        parameterTypesSubmitted:0\r\n      })\r\n  }\r\n  isTitleValid = (value: string) => {\r\n    if (value.length < 1) {\r\n      return false\r\n    }\r\n    return true;\r\n  }\r\n  isDescriptionValid = (value: string) => {\r\n    if (value.length < 1) {\r\n      return false\r\n    }\r\n    return true;\r\n  }\r\n  isParameterTypeValid = (value: string) => {\r\n    if (value.length < 1) {\r\n      return false\r\n    }\r\n    return true;\r\n  }\r\n  isValueValid = (value: string) => {\r\n    if (value.length < 1) {\r\n      return false\r\n    }\r\n    return true;\r\n  }\r\n  clearData= () => {\r\n    const value = \"\"\r\n    this.setState({ \r\n      selectedItem: undefined,\r\n      parameterID: 0,\r\n      parameterTitle:  value,\r\n      parameterDescription:  value,\r\n      parameterType:  value,\r\n      parameterValue:  value,\r\n      isTitleValid:  this.isValueValid(value),\r\n      isDescriptionValid:  this.isDescriptionValid(value),\r\n      isTypeValid: this.isParameterTypeValid(value),\r\n      isValueValid: this.isValueValid(value)\r\n    })\r\n  }\r\n  addParameterType = (parameterType: string, parameterTypeDescription: string) => {\r\n    const parameterTypesSubmitted = this.state.parameterTypesSubmitted;\r\n    this.setState({parameterTypesSubmitted:parameterTypesSubmitted+1})\r\n  }\r\n  closeParameterType = () => {\r\n    this.setState({showAddParameterType: false})\r\n    if(this.state.parameterTypesSubmitted > 0){\r\n      this.loadParameterTypes();\r\n    }\r\n    this.setState({parameterTypesSubmitted:0})\r\n  }\r\n  loadParameterTypes() {\r\n    this.loadParameterTypeSubscription && this.loadParameterTypeSubscription.unsubscribe()\r\n    this.setState({ parameterTypesLoading: true, parameterTypes:[], selectedItem: undefined })\r\n\r\n    this.loadParameterTypeSubscription = GetParameterTypes().subscribe(\r\n      (parameterTypes: ParameterTypeData[]) => {\r\n        this.setState({ \r\n          parameterTypes: parameterTypes,\r\n          parameterTypesLoading: false \r\n        })\r\n      },\r\n      (error) => {\r\n        toast.error(error?.errorData?.message || error.message)\r\n        this.setState({ parameterTypesLoading: false, parameterTypes:[]})\r\n      },\r\n      () => {\r\n        this.setState({ parameterTypesLoading: false })\r\n      }\r\n    )\r\n\r\n  }\r\n\r\n  render() {\r\n    const {parameterID, parameterTitle,parameterDescription, parameterType, parameterValue, \r\n      isTitleValid, isDescriptionValid, isTypeValid, isValueValid, \r\n      dataLoading, dataSaving, parameterTypesLoading, \r\n      parameterTypes, selectedItem, showAddParameterType, parameterTypesSubmitted} = this.state;\r\n      const isDataValid = isTitleValid && isDescriptionValid && isTypeValid && isValueValid\r\n      const isLoadingOrSaving = dataLoading || dataSaving || parameterTypesLoading\r\n\r\n    return (\r\n      <AppPageWrapper showNav>\r\n      <Modal.Dialog size=\"xl\">\r\n        <Modal.Header>\r\n          <Modal.Title className=\"text-uppercase\">Add / Edit Global Parameters</Modal.Title>\r\n        </Modal.Header>\r\n        <Modal.Body>\r\n          <Form>\r\n          {parameterTypesLoading && <Row><Col className=\"text-center\"><Spinner animation=\"border\" variant=\"secondary\" /></Col></Row>}\r\n            <Form.Row className=\"form-group required\">\r\n              <Form.Label column lg={2} htmlFor=\"parameterTitle\">Title</Form.Label>\r\n              <Col lg={7}>\r\n                  <Form.Control \r\n                  id=\"parameterTitle\" \r\n                  className=\"bg-white\" \r\n                  type=\"text\" \r\n                  maxLength={50}\r\n                  value={this.state.parameterTitle} \r\n                  onChange={e => this.handleTitleChange(e.target.value)}\r\n                  disabled={isLoadingOrSaving}\r\n                  />\r\n              </Col>\r\n              <Col lg={2}>\r\n                <ActionButton \r\n                variant=\"secondary\" onClick={this.handleRetrieve} \r\n                disabled={isLoadingOrSaving || !this.state.isTitleValid} spin={dataLoading} disableOnSpin>Retrieve</ActionButton>\r\n              </Col>\r\n            </Form.Row>\r\n          <Form.Row className=\"form-group required\">\r\n              <Form.Label column lg={2} htmlFor=\"parameterDescription\">Description</Form.Label>\r\n              <Col lg={7}>\r\n                  <Form.Control \r\n                  id=\"parameterDescription\" \r\n                  className=\"bg-white\"  \r\n                  as=\"textarea\" \r\n                  rows={3} \r\n                  maxLength={255}\r\n                  value={this.state.parameterDescription} \r\n                  onChange={e => this.handleDescriptionChange(e.target.value)}\r\n                  disabled={isLoadingOrSaving}\r\n                  />\r\n              </Col>\r\n              <Col lg={2}>\r\n              </Col>\r\n            </Form.Row>\r\n            <Form.Row className=\"form-group required\">\r\n                <Form.Label column lg={2} htmlFor=\"parameterType\">Type</Form.Label>\r\n                <Col lg={7}>\r\n                  <Form.Control \r\n                  id=\"parameterType\" as=\"select\" \r\n                  value={parameterType.toString()} \r\n                  onChange={this.handleParameterTypeChange}\r\n                  disabled={isLoadingOrSaving}\r\n                  >\r\n                    <option value=\"\">Select Parameter Type</option>\r\n                    {parameterTypes && parameterTypes.map((pt: ParameterTypeData) => <option value={pt.ParameterType} key={pt.ParameterType}>{pt.ParameterTypeDescription}</option>)}\r\n                  </Form.Control>\r\n                </Col>\r\n                <Col lg={2} >\r\n                  <Button variant=\"secondary\" \r\n                  onClick={this.handleAddParameterType}\r\n                  disabled={isLoadingOrSaving}>Add New</Button>\r\n                </Col>\r\n              </Form.Row>\r\n            <Form.Row className=\"form-group required\">\r\n              <Form.Label column lg={2} htmlFor=\"parameterValue\">Value</Form.Label>\r\n              <Col lg={7}>\r\n                  <Form.Control \r\n                  id=\"parameterValue\" \r\n                  className=\"bg-white\"  \r\n                  type=\"textarea\" \r\n                  maxLength={255}\r\n                  value={this.state.parameterValue} \r\n                  onChange={e => this.handleValueChange(e.target.value)}\r\n                  disabled={isLoadingOrSaving}\r\n                  />\r\n              </Col>\r\n              <Col lg={2} >\r\n              </Col>\r\n            </Form.Row>\r\n          </Form>\r\n        </Modal.Body>\r\n        <Modal.Footer>\r\n          <Button variant=\"secondary\" onClick={this.handleExit} disabled={isLoadingOrSaving}>Exit</Button>\r\n          <ActionButton \r\n            variant=\"primary\" \r\n            onClick={this.handleSubmit}\r\n            disabled={isLoadingOrSaving || !isDataValid} spin={dataSaving} disableOnSpin>Submit</ActionButton>\r\n          <Button variant=\"secondary\" onClick={this.handleCancel} disabled={isLoadingOrSaving}>Cancel</Button>\r\n        </Modal.Footer>\r\n      </Modal.Dialog>\r\n\r\n{showAddParameterType && <ParameterTypeModal \r\n    show={showAddParameterType} \r\n    onCancel={() => this.closeParameterType()}\r\n    onSubmit={(parameterType: string, parameterTypeDescription: string) => this.addParameterType(parameterType, parameterTypeDescription)}\r\n    LoginName={this.props.LoginName} />}\r\n</AppPageWrapper>\r\n    )\r\n  }\r\n\r\n  stateToData():GlobalParameterData {\r\n    return {\r\n      ParameterID: this.state.parameterID,\r\n      ParameterTitle: this.state.parameterTitle,\r\n      ParameterDescription: this.state.parameterDescription,\r\n      ParameterType: this.state.parameterType,\r\n      ParameterValue: this.state.parameterValue,\r\n      CreatedBy: \"\",\r\n      ModifiedBy: \"\"\r\n    }\r\n  }\r\n}\r\n\r\nfunction mapStateToProps(state: AppState): GlobalParameterProps {\r\n  return {\r\n    LoginName: getLoggedInUserName(state),\r\n  }\r\n}\r\n\r\n\r\nconst ConnectedGlobalParameter = connect(mapStateToProps, null)(GlobalParameter)\r\nexport default ConnectedGlobalParameter\r\n","import React from \"react\"\r\nimport { Button, Modal, Table, Spinner, Col, Form, Row, OverlayTrigger, Popover } from \"react-bootstrap\"\r\nimport { toast } from \"react-toastify\"\r\nimport { connect } from \"react-redux\"\r\nimport { concat, of, Subject, Subscription, forkJoin } from \"rxjs\"\r\nimport { catchError, map, switchMap } from \"rxjs/operators\"\r\nimport ActionButton from \"../ActionButton\"\r\nimport { AppPageWrapper } from \"../NavMenu/AppPageWrapper\"\r\nimport { RouteComponentProps } from \"react-router\"\r\nimport { Home } from \"../../config/Routes\"\r\nimport Checkbox from \"../Checkbox\"\r\nimport { APIError } from \"../../api/ObservableFromFetch\"\r\nimport { AppState, WorkforceClinicPortal } from \"../../AppState\"\r\nimport { isPortalAdmin, isSiteAdmin } from \"../../authentication/isAdminRole\"\r\nimport { GetSelectedPortal, getUserNameForSelectedCompany } from \"../../authentication/SelectedCompany/CompanySelectionDrivenSelectors\"\r\nimport { Typeahead } from \"react-bootstrap-typeahead\"\r\nimport { FaAngleDown, FaInfoCircle } from \"react-icons/fa\"\r\nimport ServicesGet, { AccountServicesGet, AccountServicesSave, SaveServices } from \"../../api/Administration/OrderableServices\"\r\nimport AutoFilterCompany from \"../../api/Companies/CompanyModel/AutoFilterCompany\"\r\nimport Service from \"../../api/Administration/Model/Service\"\r\nimport AccountService from \"../../api/Administration/Model/AccountService\"\r\nimport CompanyInput from \"../FormattedInputs/CompanyInput\"\r\nimport ImplementationsGetObservable from \"../../api/Implementations/ImplementationsGet\"\r\nimport ImplementationData from \"../../api/Implementations/Model/ImplementationData\"\r\nimport FormatError from \"../../formatters/FormatError\"\r\nimport { DisabledDefaultOrderableService } from \"../../config/Constants\"\r\n\r\ninterface OrderableServicesModalAuthProps {\r\n  isPortalAdmin?: boolean\r\n  isSiteAdmin?: boolean\r\n  UserName?: string\r\n  Portal?: WorkforceClinicPortal\r\n}\r\n\r\ninterface OrderableServicesModalProps { }\r\n\r\ninterface OrderableServicesModalState {\r\n  saving: boolean\r\n  loading: boolean\r\n  loadingServices: boolean\r\n  services: Service[]\r\n  accountServices: AccountService[]\r\n  portalServices: AccountService[]\r\n  data: ServiceData[]\r\n  portals: ImplementationData[]\r\n  companies: AutoFilterCompany[]\r\n  selectedPortal?: ImplementationData\r\n  selectedCompany?: AutoFilterCompany\r\n  selectedCompanyID?: number\r\n}\r\n\r\ninterface ServiceData {\r\n  AccountServiceID?: number\r\n  ImplementationID?: number\r\n  AccountID?: number\r\n  ServiceID: number\r\n  ServiceName: string\r\n  Active: boolean\r\n  ActivateAll: boolean\r\n  IsDefault: boolean\r\n  Disabled?: boolean\r\n}\r\n\r\nexport class OrderableServicesModal extends React.PureComponent<OrderableServicesModalProps & OrderableServicesModalAuthProps, OrderableServicesModalState> {\r\n  emptyState: OrderableServicesModalState = {\r\n    loading: false,\r\n    loadingServices: false,\r\n    saving: false,\r\n    services: [],\r\n    accountServices: [],\r\n    portalServices: [],\r\n    data: [],\r\n    portals: [],\r\n    companies: [],\r\n    selectedPortal: undefined,\r\n    selectedCompany: undefined,\r\n    selectedCompanyID: undefined\r\n  }\r\n  state: OrderableServicesModalState = { ...this.emptyState }\r\n\r\n  portalTypeahead = React.createRef<Typeahead<ImplementationData>>()\r\n  companyTypeahead = React.createRef<Typeahead<AutoFilterCompany>>()\r\n  loadPortalsSubscription?: Subscription\r\n  loadSubscription?: Subscription\r\n  loadCompanyServicesSubscription?: Subscription\r\n  saveSubscription?: Subscription\r\n  implementationName$ = new Subject<string>()\r\n  company$ = new Subject<AutoFilterCompany>()\r\n\r\n  componentWillMount() {\r\n    if (this.props.isSiteAdmin) {\r\n      this.setState({loading: true})\r\n      this.loadPortalsSubscription = ImplementationsGetObservable().subscribe(\r\n        data => {\r\n          this.setState({ portals: data.Records, loading: false })\r\n        },\r\n        error =>  this.handleAPIError(error, { loading: false, portals: [] })\r\n      )\r\n    }\r\n\r\n    if (this.props.isPortalAdmin) {\r\n      this.loadCompanyServicesSubscription = this.company$.pipe(\r\n        switchMap(company => concat(\r\n          of({ loadingServices: true }),\r\n          AccountServicesGet(this.props.Portal?.ImplementationID || 0, company.AccountID).pipe(\r\n            map(result => ({ loadingServices: false, result: result })),\r\n            catchError(() => of({ loadingServices: false }))\r\n          )\r\n        ))\r\n      ).subscribe(\r\n        (o: { loadingServices: boolean, result?: AccountService[] }) => {\r\n          this.setState({ loadingServices: o.loadingServices, accountServices: o.result || [] })\r\n          this.populateServiceData()\r\n        },\r\n        (error) => this.handleAPIError(error, { loadingServices: false, accountServices: undefined })\r\n      )\r\n    }\r\n    this.loadInitialData()\r\n  }\r\n\r\n  componentWillUnmount() {\r\n    this.saveSubscription && this.saveSubscription.unsubscribe()\r\n    this.loadSubscription && this.loadSubscription.unsubscribe()\r\n    this.loadPortalsSubscription && this.loadPortalsSubscription.unsubscribe()\r\n    this.loadCompanyServicesSubscription && this.loadCompanyServicesSubscription.unsubscribe()\r\n  }\r\n\r\n  loadInitialData() {\r\n    this.loadSubscription && this.loadSubscription.unsubscribe()\r\n    this.setState({ loadingServices: true })\r\n\r\n    if (this.props.isPortalAdmin) {\r\n      this.loadSubscription = forkJoin({\r\n        services: ServicesGet(),\r\n        accountServices: AccountServicesGet(this.props.Portal?.ImplementationID || 0, this.state.selectedCompanyID)\r\n      }).subscribe(\r\n        ({ services, accountServices }) => {\r\n          this.setState({ services: services, accountServices: accountServices, loadingServices: false })\r\n          if (!this.state.selectedCompanyID) this.setState({ portalServices: accountServices })\r\n          this.populateServiceData()\r\n        },\r\n        (error) => this.handleAPIError(error, { loadingServices: false })\r\n      )\r\n    }\r\n\r\n    if (this.props.isSiteAdmin) {\r\n      if (this.state.selectedPortal) {\r\n        this.loadSubscription = forkJoin({\r\n          services: ServicesGet(),\r\n          accountServices: AccountServicesGet(this.state.selectedPortal.ImplementationID)\r\n        }).subscribe(\r\n          ({ services, accountServices }) => {\r\n            this.setState({ services: services, accountServices: accountServices, loadingServices: false })\r\n            this.populateServiceData()\r\n          },\r\n          (error) => this.handleAPIError(error, { loadingServices: false })\r\n        )\r\n      }\r\n      else {\r\n        this.loadSubscription = ServicesGet().subscribe(\r\n          (data) => {\r\n            this.setState({ services: data, loadingServices: false})\r\n            this.populateServiceData()\r\n          },\r\n          (error) => this.handleAPIError(error, { loadingServices: false, services: [] })\r\n        )\r\n      }\r\n    }\r\n\r\n  }\r\n\r\n  mapServiceToServiceData = (services: Service[]): ServiceData[] => services.map(service => {\r\n    return { ServiceID: service.ServiceID, Active: service.ActiveWorkForce, IsDefault: false, ServiceName: service.ServiceName || \"\", ActivateAll: service.ActivateAll }\r\n  })\r\n\r\n  mapAccountServiceToServiceData = (accountServices: AccountService[]): ServiceData[] => {\r\n    const { selectedCompanyID, portalServices } = this.state\r\n    var mappedServices: ServiceData[] = []\r\n    this.state.services.forEach(service => {\r\n      const accountService = accountServices.find(s => s.ServiceID == service.ServiceID)\r\n      const portalAccountService = portalServices.find(s => s.ServiceID == service.ServiceID)\r\n      const disabled = selectedCompanyID ? !service.ActiveWorkForce || (portalServices.length > 0 && !portalAccountService?.Active) : !service.ActiveWorkForce\r\n      if (accountService) {\r\n        mappedServices.push({ AccountServiceID: accountService.AccountServiceID, ServiceID: accountService.ServiceID, ServiceName: service.ServiceName || \"\", Active: service.ActiveWorkForce && !disabled ? accountService.Active : false, IsDefault: accountService.IsDefault, Disabled: disabled, ActivateAll: false })\r\n      }\r\n      else {\r\n        const active = (accountServices.length === 0 && !selectedCompanyID) || (!!selectedCompanyID && !!portalAccountService && portalAccountService.IsDefault)\r\n        mappedServices.push({ ServiceID: service.ServiceID, ServiceName: service.ServiceName || \"\", Active: !disabled && active, IsDefault: false, Disabled: disabled, ActivateAll: false })\r\n      }\r\n    })\r\n    return mappedServices\r\n  }\r\n\r\n  handleCancel = () => (this.props as RouteComponentProps).history?.push(Home)\r\n\r\n  handleSave = () => {\r\n    this.setState({ saving: true })\r\n\r\n    var saveObj: SaveServices = {\r\n      Services: [],\r\n      AccountServices: []\r\n    }\r\n\r\n    if (this.props.isSiteAdmin) {\r\n      if (this.state.selectedPortal) {\r\n        saveObj.AccountServices = this.state.data.map(service => { return { AccountServiceID: service.AccountServiceID, ServiceID: service.ServiceID, Active: service.Active, IsDefault: service.IsDefault } })\r\n        saveObj.ImplementationID = this.state.selectedPortal.ImplementationID\r\n      }\r\n      else {\r\n        saveObj.Services = this.state.data.map(service => { return { ServiceID: service.ServiceID, ActiveWorkForce: service.Active, ActivateAll: service.ActivateAll } })\r\n      }\r\n    }\r\n\r\n    if (this.props.isPortalAdmin) {\r\n      saveObj.AccountServices = this.state.data.map(service => { return { AccountServiceID: service.AccountServiceID, ServiceID: service.ServiceID, Active: service.Active, IsDefault: service.IsDefault } })\r\n      saveObj.ImplementationID = this.props.Portal?.ImplementationID\r\n      saveObj.AccountID = this.state.selectedCompanyID\r\n    }\r\n\r\n    this.saveSubscription = AccountServicesSave(saveObj).subscribe(\r\n      (data) => {\r\n        this.setState({saving: false})\r\n        toast.success(data)\r\n        this.loadInitialData()\r\n      },\r\n      (error) => this.handleAPIError(error, { saving: false })\r\n    )\r\n  }\r\n\r\n  handleAPIError = (error: Error | APIError, stateChanges: object) => {\r\n    this.setState(stateChanges)\r\n    error && toast.error(FormatError(error))\r\n  }\r\n\r\n  toggleActive = (index: number) => {\r\n    const newData: ServiceData[] = [...this.state.data]\r\n    newData[index].Active = !newData[index].Active\r\n    newData[index].IsDefault = false\r\n    newData[index].ActivateAll = false\r\n    this.setState({ data: newData })\r\n  }\r\n\r\n  toggleDefault = (index: number) => {\r\n    const newData: ServiceData[] = [...this.state.data]\r\n    newData[index].IsDefault = !newData[index].IsDefault\r\n    this.setState({ data: newData })\r\n  }\r\n\r\n  toggleActivate = (index: number) => {\r\n    const newData: ServiceData[] = [...this.state.data]\r\n    newData[index].ActivateAll = !newData[index].ActivateAll\r\n    this.setState({ data: newData })\r\n  }\r\n\r\n  handlePortalChange = (selected: ImplementationData[]) => {\r\n    const selectedPortal = selected[0]\r\n    this.setState({ selectedPortal: selectedPortal })\r\n\r\n    if (selectedPortal?.ImplementationID) {\r\n      this.setState({ loadingServices: true })\r\n      AccountServicesGet(selectedPortal?.ImplementationID).subscribe(\r\n        (data) => {\r\n          this.setState({ accountServices: data, loadingServices: false })\r\n          this.populateServiceData()\r\n        },\r\n        (error) => this.handleAPIError(error, { loadingServices: false, accountServices: [] })\r\n      )\r\n    }\r\n  }\r\n\r\n  handleCompanyChange = (selected: AutoFilterCompany[]) => {\r\n    const selectedCompany = selected[0]\r\n    this.setState({ selectedCompany: selectedCompany })\r\n    if (selectedCompany) {\r\n      this.setState({ selectedCompanyID: selectedCompany.AccountID })\r\n      this.company$.next(selectedCompany)\r\n    } else {\r\n      this.loadSubscription = AccountServicesGet(this.props.Portal?.ImplementationID || 0).subscribe(\r\n        (data) => {\r\n          this.setState({ accountServices: data, loadingServices: false, selectedCompanyID: undefined })\r\n          this.populateServiceData()\r\n        },\r\n        (error) => this.handleAPIError(error, { loadingServices: false, accountServices: [], selectedCompanyID: undefined })\r\n      )\r\n    }\r\n  }\r\n\r\n  handleEmptyPortal = (company: string) => {\r\n    if (company == \"\") {\r\n      this.loadSubscription = ServicesGet().subscribe(\r\n        (data) => {\r\n          this.setState({ services: data, loadingServices: false, selectedPortal: undefined })\r\n          this.populateServiceData()\r\n        },\r\n        (error) => this.handleAPIError(error, { loadingServices: false, services: [], selectedPortalID: undefined })\r\n      )\r\n    }\r\n  }\r\n\r\n  disableDefaultTooltip = () => {\r\n    return <OverlayTrigger placement=\"right\" delay={{ show: 100, hide: 400 }} overlay={\r\n      <Popover id=\"defaultDisable\">\r\n        {DisabledDefaultOrderableService}\r\n      </Popover>}>\r\n      <FaInfoCircle className=\"info-icon\" />\r\n    </OverlayTrigger>\r\n  }\r\n\r\n  populateServiceData = () => {\r\n    const { selectedPortal, selectedCompanyID, services, accountServices } = this.state\r\n    const { isSiteAdmin, isPortalAdmin } = this.props\r\n    var data: ServiceData[] = []\r\n    if (isSiteAdmin) {\r\n      data = selectedPortal ? this.mapAccountServiceToServiceData(accountServices.filter(s => !s.AccountID)) : this.mapServiceToServiceData(services)\r\n    }\r\n    if (isPortalAdmin) {\r\n      data = selectedCompanyID ? this.mapAccountServiceToServiceData(accountServices.filter(s => s.AccountID == selectedCompanyID)) : this.mapAccountServiceToServiceData(accountServices.filter(s => !s.AccountID))\r\n    }\r\n    this.setState({ data: data })\r\n  }\r\n\r\n  DataRow = (data: ServiceData, index: number) => {\r\n    const isSiteAdmin = !!this.props.isSiteAdmin\r\n    const showDefault = (this.props.isPortalAdmin && !this.state.selectedCompanyID) || (this.props.isSiteAdmin && !!this.state.selectedPortal)\r\n    const disable = this.props.isPortalAdmin && !!this.state.selectedCompanyID && !!this.state.portalServices.find(item => item.ServiceID === data.ServiceID)?.IsDefault\r\n    return <tr key={data.ServiceID}>\r\n      <td>{data.ServiceName}</td>\r\n      {disable && <td className=\"pl-0\">{this.disableDefaultTooltip()}</td>}\r\n      {!disable && <td className=\"text-center\"><Checkbox id={`toggleActive${data.ServiceID}`} checked={data.Active} disabled={data.Disabled || disable} onChange={() => this.toggleActive(index)} className=\"mr-auto\" /></td>}\r\n      {showDefault && <td className=\"text-center\"><Checkbox id={`toggleDefault${data.ServiceID}`} checked={data.IsDefault} disabled={data.Disabled || !data.Active} onChange={() => this.toggleDefault(index)} className=\"mr-auto\" /></td>}\r\n      {!showDefault && isSiteAdmin && <td className=\"text-center\"><Checkbox id={`toggleActivate${data.ServiceID}`} checked={data.ActivateAll} disabled={data.Disabled || !data.Active} onChange={() => this.toggleActivate(index)} className=\"mr-auto\" /></td>}\r\n    </tr>\r\n  }\r\n\r\n  render() {\r\n    const { saving, loading, loadingServices, data, selectedCompanyID, selectedPortal, portals } = this.state\r\n    const { isSiteAdmin, isPortalAdmin } = this.props\r\n    const showDefault = (isPortalAdmin && !selectedCompanyID) || (isSiteAdmin && !!selectedPortal)\r\n\r\n    return (\r\n      <AppPageWrapper showNav>\r\n        <Modal.Dialog size=\"lg\">\r\n          <Modal.Header>\r\n            <Modal.Title className=\"text-uppercase\">Orderable Services</Modal.Title>\r\n          </Modal.Header>\r\n          <Modal.Body>\r\n            <Form.Group as={Row}>\r\n              {isSiteAdmin && <Col>\r\n                <Typeahead id=\"portal\"\r\n                  ref={this.portalTypeahead}\r\n                  labelKey=\"Name\"\r\n                  filterBy={(option, props) => props.selected.length > 0 || option.Name.toLowerCase().indexOf(props.text.toLowerCase()) !== -1}\r\n                  isLoading={loading}\r\n                  onChange={this.handlePortalChange}\r\n                  onInputChange={text => this.handleEmptyPortal(text)}\r\n                  disabled={loading || loadingServices}\r\n                  options={portals || []}\r\n                  selected={selectedPortal ? [selectedPortal || \"\"] : []}\r\n                  placeholder=\"Select Portal\"\r\n                  emptyLabel=\"No Portals Found\">\r\n                  {!loading && <Button variant=\"toggle\" onClick={() => { this.portalTypeahead.current?.toggleMenu() }}>\r\n                    <FaAngleDown />\r\n                  </Button>}\r\n                </Typeahead>\r\n              </Col>}\r\n              {isPortalAdmin && <Col>\r\n                <CompanyInput disabled={loading || loadingServices} onChange={items => this.handleCompanyChange(items)} placeholder=\"Select Company\" />\r\n              </Col>}\r\n            </Form.Group>\r\n            <Form.Group as={Row}>\r\n              <Table responsive bordered className=\"dark mb-0\">\r\n                {showDefault && <><thead><tr><th className=\"w-50\">Service Name</th><th className=\"w-25 text-center\">Orderable</th><th className=\"w-25 text-center\">Default</th></tr></thead></>}\r\n                {!showDefault && !isSiteAdmin && <><thead><tr><th className=\"w-50\">Service Name</th><th className=\"w-50 text-center\">Orderable</th></tr></thead></>}\r\n                {!showDefault && isSiteAdmin && <><thead><tr><th className=\"w-50\">Service Name</th><th className=\"w-25 text-center\">Orderable</th><th className=\"w-25 text-center\">Activate For All Portals</th></tr></thead></>}\r\n                <tbody>{this.state.loadingServices ? <tr><td colSpan={2}><Spinner animation=\"border\" size=\"sm\" /></td></tr> :\r\n                  data.map((service, index) => this.DataRow(service, index))}</tbody>\r\n              </Table>\r\n            </Form.Group>\r\n          </Modal.Body>\r\n          <Modal.Footer>\r\n            <ActionButton variant=\"primary\" onClick={() => this.handleSave()} disabled={loading} spin={saving} disableOnSpin>Update</ActionButton>\r\n            <Button variant=\"secondary\" className=\"mr-2\" onClick={() => this.handleCancel()}>Cancel</Button>\r\n          </Modal.Footer>\r\n        </Modal.Dialog>\r\n      </AppPageWrapper>\r\n    )\r\n  }\r\n}\r\n\r\nfunction mapStateToProps(state: AppState): OrderableServicesModalAuthProps {\r\n  return {\r\n    isPortalAdmin: isPortalAdmin(state),\r\n    isSiteAdmin: isSiteAdmin(state),\r\n    UserName: getUserNameForSelectedCompany(state),\r\n    Portal: GetSelectedPortal(state)\r\n  }\r\n}\r\nconst ConnectedOrderableServicesModal = connect(mapStateToProps, null)(OrderableServicesModal)\r\nexport default ConnectedOrderableServicesModal\r\n","\r\nexport default interface CompanyUserCode {\r\n  AccountID: number\r\n  UserFieldType: string\r\n  Code: string\r\n  Description: string\r\n  UserDefinedCodeID: number\r\n  Dependents: number\r\n  ErrorMessage: string\r\n\r\n}\r\nexport function CreateEmptyCompanyUserCode(): CompanyUserCode {\r\n  const result: CompanyUserCode = {\r\n    AccountID: 0,\r\n    UserFieldType: \"\",\r\n    Code: \"\",\r\n    Description: \"\",\r\n    UserDefinedCodeID: 0,\r\n    Dependents: 0,\r\n    ErrorMessage: \"\"\r\n\r\n  }\r\n  return result\r\n}\r\n\r\nexport function  CopyCompanyUserCode(src: CompanyUserCode): CompanyUserCode{\r\n  const result = {...src}\r\n  return result\r\n\r\n}\r\nexport function CopyCompanyUserCodes(src: CompanyUserCode[]): CompanyUserCode[]{\r\n  const result = Array.from(src, item => CopyCompanyUserCode(item))\r\n  return result\r\n}\r\n\r\n\r\n","import { ObservableFromFetch } from \"../ObservableFromFetch\"\r\nimport CompanyUserCode from \"./Model/ComapnyUserCode\"\r\n\r\nexport default function GetCompanyUserCodes(accountID: number, userFieldType: string ) {\r\n  const requestBody = JSON.stringify({\r\n    AccountID: accountID,\r\n    UserFieldType: userFieldType\r\n  })\r\n  return ObservableFromFetch<CompanyUserCode[]>(\"FFOrderClientFileMaintenance/GetCompanyUserCodes\", requestBody)\r\n}\r\nexport  function SaveCompanyUserCode(companyUserCode: CompanyUserCode) {\r\n  const requestBody = JSON.stringify(companyUserCode)\r\n  return ObservableFromFetch<CompanyUserCode>(\"FFOrderClientFileMaintenance/SaveCompanyUserCode\", requestBody)\r\n}\r\nexport  function DeleteCompanyUserCode(companyUserCode: CompanyUserCode) {\r\n  const requestBody = JSON.stringify(companyUserCode)\r\n  return ObservableFromFetch<number>(\"FFOrderClientFileMaintenance/DeleteCompanyUserCode\", requestBody)\r\n}\r\n","import * as React from \"react\"\r\nimport { Container, Modal, Row, Col, Button, Form } from \"react-bootstrap\"\r\nimport { toast } from \"react-toastify\"\r\nimport { Subscription } from \"rxjs\"\r\nimport { APIError } from \"../../api/ObservableFromFetch\"\r\nimport ConfirmationModal from \"../ConfirmationModal\"\r\nimport CompanyUserCode, { CreateEmptyCompanyUserCode, CopyCompanyUserCode, CopyCompanyUserCodes } from \"../../api/Administration/Model/ComapnyUserCode\"\r\nimport { SaveCompanyUserCode } from \"../../api/Administration/CompanyUserCodes\"\r\n\r\ninterface CompanyUserCodeModalProps {\r\n  show: boolean\r\n  selectedUserCode: CompanyUserCode\r\n  onSave: (companyUserCode: CompanyUserCode) => void\r\n  onClose: () => void\r\n}\r\n\r\ninterface CompanyUserCodeModalState {\r\n  code: string\r\n  description: string\r\n  saving: boolean\r\n  showConfirmUpdate: false\r\n}\r\n\r\nexport default class CompanyUserCodeModal extends React.PureComponent<CompanyUserCodeModalProps, {}> {\r\n  state: CompanyUserCodeModalState = { code: this.props.selectedUserCode.Code, description: this.props.selectedUserCode.Description, saving: false, showConfirmUpdate: false }\r\n  subscription?: Subscription\r\n\r\n  componentWillUnmount() {\r\n    this.subscription && this.subscription.unsubscribe()\r\n  }\r\n\r\n  handleAPIError = (error: Error | APIError, stateChanges: object) => {\r\n    this.setState(stateChanges)\r\n    error && toast.error((error as APIError)?.errorData?.message || error.message)\r\n  }\r\n\r\n  handleSave = () => {\r\n    const companyUserCode = this.props.selectedUserCode\r\n    const isEditMode = companyUserCode.UserDefinedCodeID > 0\r\n    if (isEditMode) {\r\n      this.setState({ showConfirmUpdate: true })\r\n    }\r\n    else {\r\n      this.handleConfirmSave()\r\n    }\r\n  }\r\n  handleConfirmSave = () => {\r\n\r\n    this.setState({ saving: true, showConfirmUpdate: false })\r\n    this.subscription && this.subscription.unsubscribe()\r\n    const selectedUserCode = CopyCompanyUserCode(this.props.selectedUserCode)\r\n    selectedUserCode.Code = this.state.code\r\n    selectedUserCode.Description = this.state.description\r\n    this.subscription = SaveCompanyUserCode(selectedUserCode).subscribe(\r\n      (data: CompanyUserCode) => {\r\n        this.setState({ saving: false })\r\n        if (data.ErrorMessage === \"\") {\r\n          toast.success(\"Record saved successfully\")\r\n          this.props.onSave(data)\r\n        }\r\n        else {\r\n          toast.error(data.ErrorMessage)\r\n        }\r\n      },\r\n      error => this.handleAPIError(error, { saving: false })\r\n    )\r\n  }\r\n\r\n  handleConfirmClose = () => {\r\n    this.setState({ showConfirmUpdate: false })\r\n  }\r\n\r\n  render() {\r\n    const companyUserCode = this.props.selectedUserCode\r\n    const code = this.state.code\r\n    const description = this.state.description\r\n    const disableEditCode = companyUserCode.UserDefinedCodeID > 0\r\n    const title = (companyUserCode.UserDefinedCodeID > 0) ? \"Edit Code: \" + companyUserCode.UserFieldType : \"Add Code: \" + companyUserCode.UserFieldType\r\n    const showConfirmUpdate = this.state.showConfirmUpdate\r\n    return (\r\n      <>\r\n        {disableEditCode &&\r\n          <ConfirmationModal show={showConfirmUpdate}\r\n            title=\"\"\r\n            textTitle=\"\"\r\n            text=\"All historical records will use the new code change!  Do you want to continue?\"\r\n            showImage={false}\r\n            cancelButtonText=\"No\"\r\n            confirmButtonText=\"Yes\"\r\n            onConfirm={() => this.handleConfirmSave()}\r\n            onHide={() => this.handleConfirmClose()} />\r\n        }\r\n\r\n        <ConfirmationModal show={this.props.show}\r\n          title={title}\r\n          confirmButtonText=\"Save\"\r\n          onConfirm={this.handleSave}\r\n          onHide={() => this.props.onClose()}\r\n          size=\"lg\"\r\n          disableConfirmButton={(this.state.code.trim().length === 0) || (this.state.description.trim().length === 0)}\r\n          spinConfirmButton={this.state.saving}\r\n          disableConfirmOnSpin={true}>\r\n          <Form>\r\n            <Form.Row className=\"form-group required\">\r\n              <Form.Label column lg={3} htmlFor=\"company_user_code_code\">Code:</Form.Label>\r\n              <Col lg={9}>\r\n                <Form.Control\r\n                  id=\"company_user_code_code\"\r\n                  type=\"text\"\r\n                  disabled={disableEditCode}\r\n                  value={code}\r\n                  onChange={e => this.setState({ code: e.target.value })}\r\n                />\r\n              </Col>\r\n            </Form.Row>\r\n            <Form.Row className=\"form-group required\">\r\n              <Form.Label column lg={3} htmlFor=\"company_user_code_description\">Name:</Form.Label>\r\n              <Col lg={9}>\r\n                <Form.Control\r\n                  id=\"company_user_code_description\"\r\n                  type=\"text\"\r\n                  value={description}\r\n                  onChange={e => this.setState({ description: e.target.value })}\r\n                />\r\n              </Col>\r\n            </Form.Row>\r\n          </Form>\r\n        </ConfirmationModal>\r\n      </>\r\n    )\r\n  }\r\n}","import React from \"react\"\r\nimport { Button, Modal, Table, Spinner, Col, Form, Row, Image } from \"react-bootstrap\"\r\nimport { toast } from \"react-toastify\"\r\nimport { connect } from \"react-redux\"\r\nimport { concat, of, Subject, Subscription, forkJoin } from \"rxjs\"\r\nimport { catchError, map, switchMap } from \"rxjs/operators\"\r\nimport ActionButton from \"../ActionButton\"\r\nimport { AppPageWrapper } from \"../NavMenu/AppPageWrapper\"\r\nimport { RouteComponentProps } from \"react-router\"\r\nimport { Home } from \"../../config/Routes\"\r\nimport Checkbox from \"../Checkbox\"\r\nimport { APIError } from \"../../api/ObservableFromFetch\"\r\nimport { AppState, WorkforceClinicPortal, AssignedClinic } from \"../../AppState\"\r\nimport { isPortalAdmin, isCompanyAdmin } from \"../../authentication/isAdminRole\"\r\nimport { GetSelectedPortal, GetSelectedAssignedClinic, getUserNameForSelectedCompany } from \"../../authentication/SelectedCompany/CompanySelectionDrivenSelectors\"\r\nimport KeyValue from \"../../api/Administration/Model/KeyValue\"\r\nimport CompanyUserCode, { CreateEmptyCompanyUserCode, CopyCompanyUserCode, CopyCompanyUserCodes } from \"../../api/Administration/Model/ComapnyUserCode\"\r\nimport GetImplementationAliasFields from \"../../api/Administration/ImplementationAliasFields\"\r\nimport GetCompanyUserCodes from \"../../api/Administration/CompanyUserCodes\"\r\nimport DeleteQueryImg from '../../assets/images/delete_query.png'\r\nimport CompanyUserCodeModal from \"./CompanyUserCodeModal\"\r\nimport ConfirmationModal from \"../ConfirmationModal\"\r\nimport { DeleteCompanyUserCode } from \"../../api/Administration/CompanyUserCodes\"\r\nimport IdName from \"../../api/Administration/Model/IdName\"\r\nimport CompanyInput from \"../FormattedInputs/CompanyInput\"\r\nimport AutoFilterCompany from \"../../api/Companies/CompanyModel/AutoFilterCompany\"\r\n\r\ninterface UserCodesModalAuthProps {\r\n  isPortalAdmin?: boolean\r\n  isCompanyAdmin?: boolean\r\n  UserName?: string\r\n  Company?: AssignedClinic\r\n  Portal?: WorkforceClinicPortal\r\n}\r\n\r\ninterface UserCodesModalProps { }\r\n\r\ninterface UserCodesModalState {\r\n  loading: boolean\r\n  implementationFields: KeyValue[]\r\n  implementationFieldsLoading: boolean\r\n  selectedCompany?: AutoFilterCompany\r\n  selectedCompanyID: number\r\n  selectedCode: string\r\n  companyUserCodes: CompanyUserCode[]\r\n  companyUserCodesLoading: boolean\r\n  showCompanyUserCodeEditor: boolean\r\n  selectedIndex: number\r\n  selectedUserCode: CompanyUserCode\r\n  showOnDeleteConfirmation: boolean\r\n  deletingUserCode: boolean\r\n}\r\n\r\n\r\nexport class UserCodesModal extends React.PureComponent<UserCodesModalProps & UserCodesModalAuthProps, UserCodesModalState> {\r\n  emptyState: UserCodesModalState = {\r\n    loading: false,\r\n    implementationFields: [],\r\n    implementationFieldsLoading: false,\r\n    selectedCompany: undefined,\r\n    selectedCompanyID: 0,\r\n    selectedCode: \"\",\r\n    companyUserCodes: [],\r\n    companyUserCodesLoading: false,\r\n    showCompanyUserCodeEditor: false,\r\n    selectedIndex: -1,\r\n    selectedUserCode: CreateEmptyCompanyUserCode(),\r\n    showOnDeleteConfirmation: false,\r\n    deletingUserCode: false\r\n\r\n  }\r\n  state: UserCodesModalState = { ...this.emptyState }\r\n\r\n  deleteSubscription?: Subscription\r\n  loadImplementationFieldsSubscription?: Subscription\r\n  loadCompanyCodesSubscription?: Subscription\r\n\r\n  componentDidMount() {\r\n    this.loadInitialData()\r\n  }\r\n\r\n  componentWillUnmount() {\r\n    this.deleteSubscription && this.deleteSubscription.unsubscribe()\r\n    this.loadImplementationFieldsSubscription && this.loadImplementationFieldsSubscription.unsubscribe()\r\n    this.loadCompanyCodesSubscription && this.loadCompanyCodesSubscription.unsubscribe()\r\n  }\r\n\r\n  loadInitialData() {\r\n    this.loadImplementationFieldsSubscription && this.loadImplementationFieldsSubscription.unsubscribe()\r\n    this.loadCompanyCodesSubscription && this.loadCompanyCodesSubscription.unsubscribe()\r\n    let selectedCompanyID = 0\r\n    const selectedUserCode = CreateEmptyCompanyUserCode()\r\n    this.setState({\r\n      implementationFields: [],\r\n      implementationFieldsLoading: true,\r\n      selectedCode: \"\",\r\n      companyUserCodes: [],\r\n      companyUserCodesLoading: true,\r\n      selectedIndex: -1,\r\n      selectedUserCode: selectedUserCode\r\n    })\r\n\r\n    this.loadImplementationFieldsSubscription = GetImplementationAliasFields().subscribe(\r\n      (data: KeyValue[]) => {\r\n        const selectedCode = (data.length > 0) ? data[0].Key : \"\"\r\n        this.setState({ implementationFields: data, implementationFieldsLoading: false, selectedCode: selectedCode })\r\n        this.loadCompanyCodesSubscription = GetCompanyUserCodes(selectedCompanyID, selectedCode).subscribe(\r\n          (data: CompanyUserCode[]) => {\r\n            this.setState({ companyUserCodes: data, companyUserCodesLoading: false })\r\n          },\r\n          (error) => this.handleAPIError(error, { companyUserCodes: [], companyUserCodesLoading: false })\r\n        )\r\n      },\r\n      (error) => this.handleAPIError(error, { implementationFields: [], implementationFieldsLoading: false, companyUserCodesLoading: false })\r\n    )\r\n  }\r\n\r\n  handleCancel = () => (this.props as RouteComponentProps).history?.push(Home)\r\n\r\n  handleAdd = () => {\r\n    const itemIndex = -1\r\n    const selectedUserCode = this.getItemForEdit(itemIndex);\r\n    this.setState({ selectedIndex: itemIndex, selectedUserCode: selectedUserCode, showCompanyUserCodeEditor: true })\r\n\r\n  }\r\n\r\n  handleAPIError = (error: Error | APIError, stateChanges: object) => {\r\n    this.setState(stateChanges)\r\n    error && toast.error((error as APIError)?.errorData?.message || error.message)\r\n  }\r\n\r\n  handleImplementationFieldChange = (event: React.ChangeEvent<HTMLSelectElement>) => {\r\n    const selectedCode = event.target.value\r\n    const selectedCompany = this.state.selectedCompany\r\n    const selectedCompanyID = selectedCompany?.AccountID || 0\r\n    const selectedUserCode = CreateEmptyCompanyUserCode()\r\n    this.setState({ selectedCode: selectedCode, companyUserCodesLoading: true, selectedIndex: -1, selectedUserCode: selectedUserCode })\r\n    this.loadCompanyCodesSubscription && this.loadCompanyCodesSubscription.unsubscribe()\r\n    this.loadCompanyCodesSubscription = GetCompanyUserCodes(selectedCompanyID, selectedCode).subscribe(\r\n      (data: CompanyUserCode[]) => {\r\n        this.setState({ selectedCode: selectedCode, companyUserCodes: data, companyUserCodesLoading: false })\r\n      },\r\n      (error) => this.handleAPIError(error, { selectedCode: selectedCode, companyUserCodes: [], companyUserCodesLoading: false })\r\n    )\r\n  }\r\n\r\n  handleCompanyChange = (companies: AutoFilterCompany[]) => {\r\n    const selectedCode = this.state.selectedCode\r\n    const selectedCompany = companies[0]\r\n    const selectedCompanyID = selectedCompany?.AccountID || 0\r\n    const selectedUserCode = CreateEmptyCompanyUserCode()\r\n    this.setState({ companyUserCodesLoading: true, selectedIndex: -1, selectedUserCode: selectedUserCode })\r\n    this.loadCompanyCodesSubscription && this.loadCompanyCodesSubscription.unsubscribe()\r\n\r\n    this.loadCompanyCodesSubscription = GetCompanyUserCodes(selectedCompanyID, selectedCode).subscribe(\r\n      (data: CompanyUserCode[]) => {\r\n        this.setState({ selectedCompany: selectedCompany, selectedCompanyID: selectedCompanyID, companyUserCodes: data, companyUserCodesLoading: false })\r\n      },\r\n      (error) => this.handleAPIError(error, { selectedCompany: selectedCompany, selectedCompanyID: selectedCompanyID, companyUserCodes: [], companyUserCodesLoading: false })\r\n    )\r\n  }\r\n\r\n  getItemForEdit = (itemIndex: number) => {\r\n    if (itemIndex >= 0) {\r\n      return this.state.companyUserCodes[itemIndex]\r\n    }\r\n    const result = CreateEmptyCompanyUserCode()\r\n    result.AccountID = this.state.selectedCompanyID\r\n    result.UserFieldType = this.state.selectedCode\r\n    return result\r\n\r\n  }\r\n\r\n  userCodeClick = (itemIndex: number) => {\r\n    const selectedUserCode = this.getItemForEdit(itemIndex);\r\n    this.setState({ selectedIndex: itemIndex, selectedUserCode: selectedUserCode, showCompanyUserCodeEditor: true })\r\n  }\r\n  userCodeDeleteClick = (itemIndex: number) => {\r\n    const selectedUserCode = this.getItemForEdit(itemIndex);\r\n    this.setState({ selectedIndex: itemIndex, selectedUserCode: selectedUserCode, showOnDeleteConfirmation: true })\r\n  }\r\n  \r\n  DataRow = (data: CompanyUserCode, index: number) => {\r\n    return <tr key={data.UserDefinedCodeID}>\r\n      <td>\r\n        <Button variant=\"underline-link\" className=\"px-0 mx-0 \" onClick={() => this.userCodeClick(index)}>\r\n          {data.Code}\r\n        </Button>\r\n      </td>\r\n      <td>\r\n\r\n        <Button variant=\"underline-link\" className=\"px-0 mx-0 \" onClick={() => this.userCodeClick(index)}>\r\n          {data.Description}\r\n        </Button>\r\n\r\n      </td>\r\n      <td>\r\n        <Image src={DeleteQueryImg} title=\"Delete Query\" onClick={() => this.userCodeDeleteClick(index)} />\r\n      </td>\r\n    </tr>\r\n  }\r\n\r\n  handleCompanyUserCodeSave = (data: CompanyUserCode) => {\r\n\r\n    const selectedUserCode = CreateEmptyCompanyUserCode()\r\n    const userDefinedCodeID = data.UserDefinedCodeID\r\n    let companyUserCodes = CopyCompanyUserCodes(this.state.companyUserCodes)\r\n    const itemIndex = this.state.companyUserCodes.findIndex(item => item.UserDefinedCodeID === userDefinedCodeID)\r\n    if (itemIndex < 0) {\r\n      companyUserCodes.push(data)\r\n    }\r\n    else{\r\n      companyUserCodes[itemIndex].Description = data.Description\r\n    }\r\n    this.setState({ selectedIndex: -1, showCompanyUserCodeEditor: false, selectedUserCode: selectedUserCode, companyUserCodes: companyUserCodes })\r\n  }\r\n  handleCompanyUserCodeClose = () => {\r\n    const selectedUserCode = CreateEmptyCompanyUserCode()\r\n    this.setState({ selectedIndex: -1, showCompanyUserCodeEditor: false, selectedUserCode: selectedUserCode })\r\n  }\r\n  handleDeleteCompanyUserCode = () => {\r\n    this.setState({ deletingUserCode: true })\r\n    const emptyUserCode = CreateEmptyCompanyUserCode()\r\n    const selectedUserCode = this.state.selectedUserCode\r\n    this.deleteSubscription && this.deleteSubscription.unsubscribe()\r\n    this.deleteSubscription = DeleteCompanyUserCode(selectedUserCode).subscribe(\r\n      (data: number) => {\r\n        let items = CopyCompanyUserCodes(this.state.companyUserCodes)\r\n        const itemIndex = items.findIndex(item => item.UserDefinedCodeID === data);\r\n        if (itemIndex >= 0) {\r\n          items.splice(itemIndex, 1)\r\n        }\r\n        this.setState({ showOnDeleteConfirmation: false, deletingUserCode: false, selectedIndex: -1, selectedUserCode: emptyUserCode, companyUserCodes: items })\r\n        toast.success(\"Record deleted successfully\")\r\n      },\r\n      error => this.handleAPIError(error, { showOnDeleteConfirmation: false, deletingUserCode: false, selectedIndex: -1, selectedUserCode: emptyUserCode })\r\n    )\r\n\r\n\r\n  }\r\n  handleCloseDeleteConfirmation = () => {\r\n    const selectedUserCode = CreateEmptyCompanyUserCode()\r\n    this.setState({ selectedIndex: -1, selectedUserCode: selectedUserCode, showOnDeleteConfirmation: false, deletingUserCode: false })\r\n  }\r\n\r\n  render() {\r\n    const { implementationFields, implementationFieldsLoading, companyUserCodes, companyUserCodesLoading, showCompanyUserCodeEditor, selectedUserCode } = this.state\r\n    const loading = implementationFieldsLoading || companyUserCodesLoading\r\n\r\n    return (\r\n      <>\r\n        {showCompanyUserCodeEditor && <CompanyUserCodeModal\r\n          selectedUserCode={selectedUserCode}\r\n          show={showCompanyUserCodeEditor}\r\n          onSave={(companyUserCode) => this.handleCompanyUserCodeSave(companyUserCode)}\r\n          onClose={this.handleCompanyUserCodeClose} />\r\n        }\r\n        <ConfirmationModal show={this.state.showOnDeleteConfirmation}\r\n          title=\"\"\r\n          textTitle=\"\"\r\n          text=\"Are you sure you want to delete this record?\"\r\n          showImage={false}\r\n          cancelButtonText=\"No\"\r\n          confirmButtonText=\"Yes\"\r\n          spinConfirmButton={this.state.deletingUserCode}\r\n          onConfirm={() => this.handleDeleteCompanyUserCode()}\r\n          onHide={() => this.handleCloseDeleteConfirmation()} />\r\n        <AppPageWrapper showNav>\r\n          <Modal.Dialog size=\"lg\">\r\n            <Modal.Header>\r\n              <Modal.Title className=\"text-uppercase\">Company User Codes</Modal.Title>\r\n            </Modal.Header>\r\n            <Modal.Body>\r\n              <Form.Row className=\"form-group required\">\r\n                <Form.Label column sm={3} htmlFor=\"selectedCompany\">\r\n                  Company:\r\n                  {(companyUserCodesLoading) && <Spinner animation=\"border\" variant=\"secondary\" />}\r\n                </Form.Label>\r\n                <Col sm={9}>\r\n                  <CompanyInput id=\"selectedCompany\" onChange={items => this.handleCompanyChange(items)} />\r\n                </Col>\r\n              </Form.Row>\r\n\r\n              <Form.Row className=\"form-group required\">\r\n                <Form.Label column sm={3} htmlFor=\"implementationField\">\r\n                  User Code Type:\r\n                  {(implementationFieldsLoading) && <Spinner animation=\"border\" variant=\"secondary\" />}\r\n                </Form.Label>\r\n                <Col sm={9}>\r\n                  <Form.Control id=\"implementationField\" as=\"select\" onChange={this.handleImplementationFieldChange}>\r\n                    {implementationFields && implementationFields.map((keyValue: KeyValue) => <option value={keyValue.Key} key={keyValue.Key}>{keyValue.Value}</option>)}\r\n                  </Form.Control>\r\n                </Col>\r\n              </Form.Row>\r\n              <Form.Row>\r\n                <Table responsive bordered className=\"dark text-center\">\r\n                  <thead><tr><th className=\"w-50\">Code&nbsp;\r\n                    {(loading) && <Spinner animation=\"border\" variant=\"secondary\" />}\r\n\r\n                  </th><th className=\"w-50\">Name/Description</th><th>&nbsp;</th></tr></thead>\r\n                  <tbody>{companyUserCodesLoading ? <tr><td colSpan={3}><Spinner animation=\"border\" size=\"sm\" /></td></tr> :\r\n                    companyUserCodes.map((item, index) => this.DataRow(item, index))}</tbody>\r\n                </Table>\r\n              </Form.Row>\r\n            </Modal.Body>\r\n            <Modal.Footer>\r\n              <ActionButton variant=\"primary\" onClick={() => this.handleAdd()} disabled={loading} spin={loading} disableOnSpin>Add</ActionButton>\r\n              <Button variant=\"secondary\" className=\"mr-2\" onClick={() => this.handleCancel()}>Cancel</Button>\r\n            </Modal.Footer>\r\n          </Modal.Dialog>\r\n        </AppPageWrapper>\r\n      </>\r\n    )\r\n  }\r\n}\r\nfunction assignedClinicToIdName(src: AssignedClinic) : IdName{\r\n  const result : IdName = {\r\n    ID: src.AccountID || 0,\r\n    Name: src.Name || \"\"\r\n  }\r\n  return result\r\n}\r\nfunction assignedClinicsToIdNames(src: AssignedClinic[]) : IdName[]{\r\n  const result : IdName[] = []\r\n  for(let i = 0; i < src.length; i++)\r\n  {\r\n   const item = assignedClinicToIdName(src[i])\r\n   result.push(item)\r\n  }\r\n  return result\r\n}\r\n\r\nfunction mapStateToProps(state: AppState): UserCodesModalAuthProps {\r\n\r\n  let result: UserCodesModalAuthProps = {\r\n    isPortalAdmin: isPortalAdmin(state),\r\n    isCompanyAdmin: isCompanyAdmin(state),\r\n    UserName: getUserNameForSelectedCompany(state),\r\n    Company: GetSelectedAssignedClinic(state) || undefined,\r\n    Portal: GetSelectedPortal(state)\r\n  }\r\n  return result\r\n\r\n}\r\nconst ConnectedUserCodesModal = connect(mapStateToProps, null)(UserCodesModal)\r\nexport default ConnectedUserCodesModal","import { ObservableFromFetch } from \"../ObservableFromFetch\"\r\nimport KeyValue from \"./Model/KeyValue\"\r\n\r\nexport default function GetImplementationAliasFields() {\r\n  return ObservableFromFetch<KeyValue[]>(\"FFOrderClinicFileMaintenance/GetImplementationAliasFields\")\r\n}","import { ObservableFromFetch } from \"../ObservableFromFetch\"\r\nimport ImplementationUserLabels from \"./Model/ImplementationUserLabels\"\r\n\r\nexport default function GetImplementationUserLabels() {\r\n  return ObservableFromFetch<ImplementationUserLabels>(\"FFOrderClinicFileMaintenance/GetImplementationUserLabels\")\r\n}\r\n\r\nexport function SaveImplementationUserLabels(userLabels: ImplementationUserLabels) {\r\n  const requestBody = JSON.stringify(userLabels)\r\n  return ObservableFromFetch<ImplementationUserLabels>(\"FFOrderClinicFileMaintenance/SaveImplementationUserLabels\", requestBody)\r\n}\r\n","import React from \"react\"\r\nimport { Button, Modal, Col, Form } from \"react-bootstrap\"\r\nimport { toast } from \"react-toastify\"\r\nimport { Subscription } from \"rxjs\"\r\nimport ActionButton from \"../ActionButton\"\r\nimport { AppPageWrapper } from \"../NavMenu/AppPageWrapper\"\r\nimport { RouteComponentProps } from \"react-router\"\r\nimport { Home } from \"../../config/Routes\"\r\nimport { APIError } from \"../../api/ObservableFromFetch\"\r\nimport ImplementationUserLabels, { CreateEmptyImplementationUserLabels } from \"../../api/Administration/Model/ImplementationUserLabels\"\r\nimport GetImplementationUserLabels, { SaveImplementationUserLabels } from \"../../api/Administration/ImplementationUserLabels\"\r\n\r\ninterface UserLabelsModalProps { }\r\n\r\ninterface UserLabelsModalState {\r\n  loading: boolean\r\n  saving: boolean\r\n  User1: string\r\n  User2: string\r\n  User3: string\r\n  User4: string\r\n  User5: string\r\n  User6: string\r\n  User7: string\r\n  User8: string\r\n  User9: string\r\n  User10: string\r\n}\r\n\r\nexport default class UserLabelsModal extends React.PureComponent<UserLabelsModalProps, UserLabelsModalState> {\r\n  emptyState: UserLabelsModalState = {\r\n    loading: false,\r\n    saving: false,\r\n    User1: \"\",\r\n    User2: \"\",\r\n    User3: \"\",\r\n    User4: \"\",\r\n    User5: \"\",\r\n    User6: \"\",\r\n    User7: \"\",\r\n    User8: \"\",\r\n    User9: \"\",\r\n    User10: \"\"\r\n\r\n  }\r\n  state: UserLabelsModalState = { ...this.emptyState }\r\n\r\n  loadSubscription?: Subscription\r\n  saveSubscription?: Subscription\r\n\r\n  componentDidMount() {\r\n    this.loadInitialData()\r\n  }\r\n\r\n  componentWillUnmount() {\r\n    this.loadSubscription && this.loadSubscription.unsubscribe()\r\n    this.saveSubscription && this.saveSubscription.unsubscribe()\r\n  }\r\n\r\n  loadInitialData() {\r\n\r\n    this.loadSubscription && this.loadSubscription.unsubscribe()\r\n\r\n    this.setState({\r\n      loading: true, saving: false\r\n    })\r\n\r\n    this.loadSubscription = GetImplementationUserLabels().subscribe(\r\n      (data: ImplementationUserLabels) => {\r\n        this.onDataLoaded(data)\r\n      },\r\n      (error) => this.handleAPIError(error, { loading: false, saving: false })\r\n    )\r\n  }\r\n\r\n  onDataLoaded = (data: ImplementationUserLabels) => {\r\n    this.setState({\r\n      loading: false,\r\n      saving: false,\r\n      User1: data.User1,\r\n      User2: data.User2,\r\n      User3: data.User3,\r\n      User4: data.User4,\r\n      User5: data.User5,\r\n      User6: data.User6,\r\n      User7: data.User7,\r\n      User8: data.User8,\r\n      User9: data.User9,\r\n      User10: data.User10\r\n    })\r\n  }\r\n\r\n  dataFromState = (): ImplementationUserLabels => {\r\n    const result = CreateEmptyImplementationUserLabels()\r\n    result.User1 = this.state.User1\r\n    result.User2 = this.state.User2\r\n    result.User3 = this.state.User3\r\n    result.User4 = this.state.User4\r\n    result.User5 = this.state.User5\r\n    result.User6 = this.state.User6\r\n    result.User7 = this.state.User7\r\n    result.User8 = this.state.User8\r\n    result.User9 = this.state.User9\r\n    result.User10 = this.state.User10\r\n    return result\r\n  }\r\n  handleCancel = () => (this.props as RouteComponentProps).history?.push(Home)\r\n\r\n  handleSave = () => {\r\n    this.setState({ loading: false, saving: true })\r\n\r\n    const userLabels = this.dataFromState()\r\n    this.saveSubscription && this.saveSubscription.unsubscribe()\r\n    this.saveSubscription = SaveImplementationUserLabels(userLabels).subscribe(\r\n      (data: ImplementationUserLabels) => {\r\n        this.onDataLoaded(data)\r\n        toast.success(\"Record saved successfully\")\r\n      },\r\n      error => this.handleAPIError(error, { loading: false, saving: false })\r\n    )\r\n  }\r\n\r\n  handleAPIError = (error: Error | APIError, stateChanges: object) => {\r\n    this.setState(stateChanges)\r\n    error && toast.error((error as APIError)?.errorData?.message || error.message)\r\n  }\r\n\r\n  render() {\r\n    const { loading, saving, User1, User2, User3, User4, User5, User6, User7, User8, User9, User10 } = this.state\r\n    const inProgress = loading || saving\r\n    return (\r\n      <AppPageWrapper showNav>\r\n        <Modal.Dialog size=\"lg\">\r\n          <Modal.Header>\r\n            <Modal.Title className=\"text-uppercase\">User Code Labels</Modal.Title>\r\n          </Modal.Header>\r\n          <Modal.Body>\r\n            <Form.Row className=\"form-group\">\r\n              <Form.Label column sm={3} htmlFor=\"user_label_1\">User1Label:</Form.Label>\r\n              <Col sm={9}>\r\n                <Form.Control\r\n                  id=\"user_label_1\" type=\"text\" value={User1}\r\n                  onChange={e => this.setState({ User1: e.target.value })} />\r\n              </Col>\r\n            </Form.Row>\r\n            <Form.Row className=\"form-group\">\r\n              <Form.Label column sm={3} htmlFor=\"user_label_2\">User2Label:</Form.Label>\r\n              <Col sm={9}>\r\n                <Form.Control\r\n                  id=\"user_label_2\" type=\"text\" value={User2}\r\n                  onChange={e => this.setState({ User2: e.target.value })} />\r\n              </Col>\r\n            </Form.Row>\r\n            <Form.Row className=\"form-group\">\r\n              <Form.Label column sm={3} htmlFor=\"user_label_3\">User3Label:</Form.Label>\r\n              <Col sm={9}>\r\n                <Form.Control\r\n                  id=\"user_label_3\" type=\"text\" value={User3}\r\n                  onChange={e => this.setState({ User3: e.target.value })} />\r\n              </Col>\r\n            </Form.Row>\r\n            <Form.Row className=\"form-group\">\r\n              <Form.Label column sm={3} htmlFor=\"user_label_4\">User4Label:</Form.Label>\r\n              <Col sm={9}>\r\n                <Form.Control\r\n                  id=\"user_label_4\" type=\"text\" value={User4}\r\n                  onChange={e => this.setState({ User4: e.target.value })} />\r\n              </Col>\r\n            </Form.Row>\r\n            <Form.Row className=\"form-group\">\r\n              <Form.Label column sm={3} htmlFor=\"user_label_5\">User5Label:</Form.Label>\r\n              <Col sm={9}>\r\n                <Form.Control\r\n                  id=\"user_label_5\" type=\"text\" value={User5}\r\n                  onChange={e => this.setState({ User5: e.target.value })} />\r\n              </Col>\r\n            </Form.Row>\r\n            <Form.Row className=\"form-group\">\r\n              <Form.Label column sm={3} htmlFor=\"user_label_6\">User6Label:</Form.Label>\r\n              <Col sm={9}>\r\n                <Form.Control\r\n                  id=\"user_label_6\" type=\"text\" value={User6}\r\n                  onChange={e => this.setState({ User6: e.target.value })} />\r\n              </Col>\r\n            </Form.Row>\r\n            <Form.Row className=\"form-group\">\r\n              <Form.Label column sm={3} htmlFor=\"user_label_7\">User7Label:</Form.Label>\r\n              <Col sm={9}>\r\n                <Form.Control\r\n                  id=\"user_label_7\" type=\"text\" value={User7}\r\n                  onChange={e => this.setState({ User7: e.target.value })} />\r\n              </Col>\r\n            </Form.Row>\r\n            <Form.Row className=\"form-group\">\r\n              <Form.Label column sm={3} htmlFor=\"user_label_8\">User8Label:</Form.Label>\r\n              <Col sm={9}>\r\n                <Form.Control\r\n                  id=\"user_label_8\" type=\"text\" value={User8}\r\n                  onChange={e => this.setState({ User8: e.target.value })} />\r\n              </Col>\r\n            </Form.Row>\r\n            <Form.Row className=\"form-group\">\r\n              <Form.Label column sm={3} htmlFor=\"user_label_9\"><span style={{color: \"blue\"}}>*</span>&nbsp;User9Label:</Form.Label>\r\n              <Col sm={9}>\r\n                <Form.Control\r\n                  id=\"user_label_9\" type=\"text\" value={User9}\r\n                  onChange={e => this.setState({ User9: e.target.value })} />\r\n              </Col>\r\n            </Form.Row>\r\n            <Form.Row className=\"form-group\">\r\n              <Form.Label column sm={3} htmlFor=\"user_label_10\"><span style={{color: \"blue\"}}>*&nbsp;</span>User10Label:</Form.Label>\r\n              <Col sm={9}>\r\n                <Form.Control\r\n                  id=\"user_label_10\" type=\"text\" value={User10}\r\n                  onChange={e => this.setState({ User10: e.target.value })} />\r\n              </Col>\r\n            </Form.Row>\r\n            <Form.Row className=\"form-group\">\r\n              <Col sm={12}>\r\n              <span style={{color: \"blue\"}}>* These fields are free text fields, meaning they will not have codes defined for them.</span>\r\n              </Col>\r\n            </Form.Row>\r\n\r\n          </Modal.Body>\r\n          <Modal.Footer>\r\n            <ActionButton variant=\"primary\" onClick={() => this.handleSave()} disabled={inProgress} spin={inProgress} disableOnSpin>Save</ActionButton>\r\n            <Button variant=\"secondary\" className=\"mr-2\" onClick={() => this.handleCancel()}>Cancel</Button>\r\n          </Modal.Footer>\r\n        </Modal.Dialog>\r\n      </AppPageWrapper>\r\n    )\r\n  }\r\n}","\r\nexport default interface ImplementationUserLabels {\r\n  User1: string;\r\n  User2: string;\r\n  User3: string;\r\n  User4: string;\r\n  User5: string;\r\n  User6: string;\r\n  User7: string;\r\n  User8: string;\r\n  User9: string;\r\n  User10: string;\r\n}\r\n\r\n\r\n\r\nexport function CreateEmptyImplementationUserLabels(): ImplementationUserLabels {\r\n  const result: ImplementationUserLabels = {\r\n    User1: \"\",\r\n    User2: \"\",\r\n    User3: \"\",\r\n    User4: \"\",\r\n    User5: \"\",\r\n    User6: \"\",\r\n    User7: \"\",\r\n    User8: \"\",\r\n    User9: \"\",\r\n    User10: \"\"\r\n  }\r\n  return result\r\n}\r\n\r\n","import { ObservableFromFetch } from \"../ObservableFromFetch\"\r\nimport { ImplementationGroupID_Workforce } from \"../../config/Constants\"\r\nimport ImplementationLabResultsReporting from \"./Model/ImplementationLabResultsReporting\"\r\n\r\n\r\n\r\nexport default function ImplementationLabResultsReportingGet() {\r\n  const requestBody: string = new URLSearchParams({\r\n    implementationGroupId: ImplementationGroupID_Workforce.toString()\r\n  }).toString()\r\n  return ObservableFromFetch<ImplementationLabResultsReporting[]>(\"WorkforceLabResultsReporting/GetImplementations?\" + requestBody)\r\n}\r\n\r\nexport  function ImplementationLabResultReportingGet(implementationId: number) {\r\n  const requestBody: string = new URLSearchParams({\r\n    implementationId: implementationId.toString()\r\n  }).toString()\r\n  return ObservableFromFetch<ImplementationLabResultsReporting>(\"WorkforceLabResultsReporting/GetImplementation?\" + requestBody)\r\n}\r\n\r\nexport  function SetImplementationLabResultsReporting(data: ImplementationLabResultsReporting) {\r\n  const requestBody: string = JSON.stringify(data)\r\n\r\n  return ObservableFromFetch<string>(\"WorkforceLabResultsReporting/SetImplementationLabResultsReporting\", requestBody)\r\n}","import { ObservableFromFetch } from \"../ObservableFromFetch\"\r\nimport { ImplementationGroupID_Workforce } from \"../../config/Constants\"\r\nimport AccountLabResultsReporting from \"./CompanyModel/AccountLabResultsReporting\"\r\n\r\n\r\n\r\nexport default function AccountLabResultsReportingGet(implementationId: number) {\r\n  const requestBody: string = new URLSearchParams({\r\n    implementationId: implementationId.toString()\r\n  }).toString()\r\n  return ObservableFromFetch<AccountLabResultsReporting[]>(\"WorkforceLabResultsReporting/GetAccounts?\" + requestBody)\r\n}\r\n\r\nexport  function SetAccountLabResultsReporting(data: AccountLabResultsReporting) {\r\n  const requestBody: string = JSON.stringify(data)\r\n\r\n  return ObservableFromFetch<string>(\"WorkforceLabResultsReporting/SetAccountLabResultsReporting\", requestBody)\r\n}\r\n","import React from \"react\"\r\nimport { Button, Modal, Table, Spinner, Col, Form, Row, OverlayTrigger, Popover } from \"react-bootstrap\"\r\nimport { toast } from \"react-toastify\"\r\nimport { connect } from \"react-redux\"\r\nimport { concat, of, Subject, Subscription, forkJoin } from \"rxjs\"\r\nimport { catchError, map, switchMap } from \"rxjs/operators\"\r\nimport ActionButton from \"../ActionButton\"\r\nimport { AppPageWrapper } from \"../NavMenu/AppPageWrapper\"\r\nimport { RouteComponentProps } from \"react-router\"\r\nimport { Home } from \"../../config/Routes\"\r\nimport Checkbox from \"../Checkbox\"\r\nimport { APIError } from \"../../api/ObservableFromFetch\"\r\nimport { AppState, WorkforceClinicPortal } from \"../../AppState\"\r\nimport { isPortalAdmin, isSiteAdmin } from \"../../authentication/isAdminRole\"\r\nimport { GetSelectedPortal, getUserNameForSelectedCompany } from \"../../authentication/SelectedCompany/CompanySelectionDrivenSelectors\"\r\nimport { Typeahead } from \"react-bootstrap-typeahead\"\r\nimport { FaAngleDown, FaInfoCircle } from \"react-icons/fa\"\r\nimport FormatError from \"../../formatters/FormatError\"\r\nimport ImplementationLabResultsReporting from \"../../api/Implementations/Model/ImplementationLabResultsReporting\"\r\nimport AccountLabResultsReporting from \"../../api/Companies/CompanyModel/AccountLabResultsReporting\"\r\nimport ImplementationLabResultsReportingGet, { ImplementationLabResultReportingGet, SetImplementationLabResultsReporting } from \"../../api/Implementations/ImplementationLabResultsReporting\"\r\nimport AccountLabResultsReportingGet, { SetAccountLabResultsReporting } from \"../../api/Companies/AccountLabResultsReporting\"\r\n\r\ninterface LabResultsReportingModalAuthProps {\r\n  isPortalAdmin?: boolean\r\n  isSiteAdmin?: boolean\r\n  UserName?: string\r\n  Portal?: WorkforceClinicPortal\r\n}\r\n\r\ninterface LabResultsReportingModalProps { }\r\n\r\ninterface LabResultsReportingModalState {\r\n  saving: boolean\r\n  loading: boolean\r\n  portals: ImplementationLabResultsReporting[]\r\n  companies: AccountLabResultsReporting[]\r\n  selectedPortal?: ImplementationLabResultsReporting\r\n  selectedCompany?: AccountLabResultsReporting\r\n  MRONonDOTNeg: boolean\r\n  MRONonDOTPos: boolean\r\n  POCTRequireLab: boolean\r\n  POCTRequireMRO: boolean\r\n}\r\n\r\n\r\n\r\nexport class LabResultsReportingModal extends React.PureComponent<LabResultsReportingModalProps & LabResultsReportingModalAuthProps, LabResultsReportingModalState> {\r\n  emptyState: LabResultsReportingModalState = {\r\n    loading: false,\r\n    saving: false,\r\n    portals: [],\r\n    companies: [],\r\n    selectedPortal: undefined,\r\n    selectedCompany: undefined,\r\n    MRONonDOTNeg: false,\r\n    MRONonDOTPos: false,\r\n    POCTRequireLab: false,\r\n    POCTRequireMRO: false\r\n  }\r\n  state: LabResultsReportingModalState = { ...this.emptyState }\r\n\r\n  portalTypeahead = React.createRef<Typeahead<ImplementationLabResultsReporting>>()\r\n  companyTypeahead = React.createRef<Typeahead<AccountLabResultsReporting>>()\r\n  loadPortalsSubscription?: Subscription\r\n  loadPortalSubscription?: Subscription\r\n  loadCompaniesSubscription?: Subscription\r\n  saveSubscription?: Subscription\r\n\r\n  componentWillMount() {\r\n    this.setState({ loading: true, selectedPortal: undefined, portals: [], selectedCompany: undefined, companies: [] })\r\n    if (this.props.isSiteAdmin) {\r\n      this.loadPortalsSubscription = ImplementationLabResultsReportingGet().subscribe(\r\n        data => {\r\n          this.setState({ portals: data, loading: false })\r\n        },\r\n        error => this.handleAPIError(error, { loading: false })\r\n      )\r\n    }\r\n    if (this.props.isPortalAdmin) {\r\n      this.loadPortalSubscription = ImplementationLabResultReportingGet(this.props.Portal?.ImplementationID || 0).subscribe(\r\n        data => {\r\n          const implementationId = data?.ImplementationID || 0\r\n          if (implementationId > 0) {\r\n            this.setState({\r\n              selectedPortal: data,\r\n              MRONonDOTNeg: data.MRONonDOTNeg,\r\n              MRONonDOTPos: data.MRONonDOTPos,\r\n              POCTRequireLab: data.POCTRequireLab,\r\n              POCTRequireMRO: data.POCTRequireMRO,\r\n            })\r\n            this.loadCompaniesData(implementationId)\r\n          }\r\n          else {\r\n            this.setState({ selectedPortal: data, loading: false })\r\n          }\r\n        },\r\n        error => this.handleAPIError(error, { loading: false })\r\n      )\r\n    }\r\n  }\r\n\r\n  componentWillUnmount() {\r\n    this.loadPortalsSubscription && this.loadPortalsSubscription.unsubscribe()\r\n    this.loadPortalSubscription && this.loadPortalSubscription.unsubscribe()\r\n    this.loadCompaniesSubscription && this.loadCompaniesSubscription.unsubscribe()\r\n    this.saveSubscription && this.saveSubscription.unsubscribe()\r\n  }\r\n\r\n  loadCompaniesData = (implementationId: number) => {\r\n    this.loadCompaniesSubscription && this.loadCompaniesSubscription.unsubscribe()\r\n    this.loadCompaniesSubscription = AccountLabResultsReportingGet(implementationId).subscribe(\r\n      companies => this.setState({ companies: companies, loading: false }),\r\n      error => this.handleAPIError(error, { loading: false })\r\n    )\r\n  }\r\n\r\n  handleCancel = () => {\r\n    (this.props as RouteComponentProps).history?.push(Home)\r\n  }\r\n\r\n  handleSave = () => {\r\n    this.saveSubscription && this.saveSubscription.unsubscribe()\r\n    const { isSiteAdmin, isPortalAdmin } = this.props\r\n    if (!isSiteAdmin && !isPortalAdmin) {\r\n      return\r\n    }\r\n    const { saving, loading, selectedPortal, selectedCompany } = this.state\r\n    if (saving || loading) {\r\n      return\r\n    }\r\n    if (!selectedPortal) {\r\n      return\r\n    }\r\n    if (isSiteAdmin || (isPortalAdmin && !selectedCompany)) {\r\n      this.setState({ saving: true })\r\n      const saveObj = {\r\n        ImplementationID: selectedPortal.ImplementationID,\r\n        ImplementationName: selectedPortal.ImplementationName,\r\n        MRONonDOTNeg: this.state.MRONonDOTNeg,\r\n        MRONonDOTPos: this.state.MRONonDOTPos,\r\n        POCTRequireLab: this.state.POCTRequireLab,\r\n        POCTRequireMRO: this.state.POCTRequireMRO,\r\n        UpdateUserLoginID: selectedPortal.UpdateUserLoginID,\r\n        UpdateMethodID: selectedPortal.UpdateMethodID\r\n      }\r\n      this.saveSubscription = SetImplementationLabResultsReporting(saveObj).subscribe(\r\n        (data) => {\r\n          selectedPortal.MRONonDOTNeg = saveObj.MRONonDOTNeg\r\n          selectedPortal.MRONonDOTPos = saveObj.MRONonDOTPos\r\n          selectedPortal.POCTRequireLab = saveObj.POCTRequireLab\r\n          selectedPortal.POCTRequireMRO = saveObj.POCTRequireMRO\r\n          this.setState({ saving: false, selectedPortal: selectedPortal })\r\n          toast.success(data)\r\n          if (isPortalAdmin) this.loadCompaniesData(selectedPortal.ImplementationID)\r\n        },\r\n        (error) => this.handleAPIError(error, { saving: false })\r\n      )\r\n      return\r\n    }\r\n    if (isPortalAdmin && selectedCompany) {\r\n      this.setState({ saving: true })\r\n      const saveObj = {\r\n        AccountID: selectedCompany.AccountID,\r\n        ImplementationID: selectedCompany.ImplementationID,\r\n        Code: selectedCompany.Code || \"\",\r\n        Name: selectedCompany.Name,\r\n        MRONonDOTNeg: this.state.MRONonDOTNeg,\r\n        MRONonDOTPos: this.state.MRONonDOTPos,\r\n        POCTRequireLab: this.state.POCTRequireLab,\r\n        POCTRequireMRO: this.state.POCTRequireMRO,\r\n        UpdateUserLoginID: selectedCompany.UpdateUserLoginID,\r\n        UpdateMethodID: selectedCompany.UpdateMethodID\r\n      }\r\n      this.saveSubscription = SetAccountLabResultsReporting(saveObj).subscribe(\r\n        (data) => {\r\n          selectedCompany.MRONonDOTNeg = saveObj.MRONonDOTNeg\r\n          selectedCompany.MRONonDOTPos = saveObj.MRONonDOTPos\r\n          selectedCompany.POCTRequireLab = saveObj.POCTRequireLab\r\n          selectedCompany.POCTRequireMRO = saveObj.POCTRequireMRO\r\n          this.setState({ saving: false, selectedCompany: selectedCompany })\r\n          toast.success(data)\r\n        },\r\n        (error) => this.handleAPIError(error, { saving: false })\r\n      )\r\n      return\r\n    }\r\n  }\r\n\r\n  handleAPIError = (error: Error | APIError, stateChanges: object) => {\r\n    this.setState(stateChanges)\r\n    error && toast.error(FormatError(error))\r\n  }\r\n\r\n  handlePortalChange = (selected: ImplementationLabResultsReporting[]) => {\r\n    const selectedPortal = selected[0]\r\n    const mroNonDOTNeg = selectedPortal?.MRONonDOTNeg || false\r\n    const mroNonDOTPos = selectedPortal?.MRONonDOTPos || false\r\n    const poctRequireLab = selectedPortal?.POCTRequireLab || false\r\n    const poctRequireMRO = selectedPortal?.POCTRequireMRO || false\r\n    this.setState({\r\n      selectedPortal: selectedPortal,\r\n      selectedCompany: undefined,\r\n      companies: [],\r\n      MRONonDOTNeg: mroNonDOTNeg,\r\n      MRONonDOTPos: mroNonDOTPos,\r\n      POCTRequireLab: poctRequireLab,\r\n      POCTRequireMRO: poctRequireMRO\r\n    })\r\n  }\r\n\r\n  handleEmptyPortal = (company: string) => {\r\n  }\r\n\r\n  handleCompanyChange = (selected: AccountLabResultsReporting[]) => {\r\n    const selectedPortal = this.state.selectedPortal\r\n    const selectedCompany = selected[0]\r\n    const mroNonDOTNeg = selectedCompany?.MRONonDOTNeg || selectedPortal?.MRONonDOTNeg || false\r\n    const mroNonDOTPos = selectedCompany?.MRONonDOTPos || selectedPortal?.MRONonDOTPos || false\r\n    const poctRequireLab = selectedCompany?.POCTRequireLab || selectedPortal?.POCTRequireLab || false\r\n    const poctRequireMRO = selectedCompany?.POCTRequireMRO || selectedPortal?.POCTRequireMRO || false\r\n    this.setState({\r\n      selectedCompany: selectedCompany,\r\n      MRONonDOTNeg: mroNonDOTNeg,\r\n      MRONonDOTPos: mroNonDOTPos,\r\n      POCTRequireLab: poctRequireLab,\r\n      POCTRequireMRO: poctRequireMRO\r\n    })\r\n  }\r\n\r\n  handleEmptyCompany = (company: string) => {\r\n  }\r\n\r\n\r\n  toggleMRONONDOTNeg = (event: React.ChangeEvent<HTMLInputElement>) => {\r\n    const target = event.target\r\n    this.setState({ MRONonDOTNeg: target.checked })\r\n  }\r\n\r\n  toggleMRONONDOTPos = (event: React.ChangeEvent<HTMLInputElement>) => {\r\n    const target = event.target\r\n    this.setState({ MRONonDOTPos: target.checked })\r\n  }\r\n\r\n  togglePOCTReqLabConf = (event: React.ChangeEvent<HTMLInputElement>) => {\r\n    const target = event.target\r\n    this.setState({ POCTRequireLab: target.checked })\r\n  }\r\n\r\n  togglePOCTReqMRO = (event: React.ChangeEvent<HTMLInputElement>) => {\r\n    const target = event.target\r\n    this.setState({ POCTRequireMRO: target.checked })\r\n  }\r\n\r\n  render() {\r\n    const { saving, loading, selectedPortal, portals, selectedCompany, companies } = this.state\r\n    const { isSiteAdmin, isPortalAdmin } = this.props\r\n    const mroNonDOTNeg = this.state.MRONonDOTNeg\r\n    const mroNonDOTPos = this.state.MRONonDOTPos\r\n    const poctRequireLab = this.state.POCTRequireLab\r\n    const poctRequireMRO = this.state.POCTRequireMRO\r\n\r\n\r\n    return (\r\n      <AppPageWrapper showNav>\r\n        <Modal.Dialog size=\"lg\">\r\n          <Modal.Header>\r\n            <Modal.Title className=\"text-uppercase\">Lab Results Reporting</Modal.Title>\r\n          </Modal.Header>\r\n          <Modal.Body>\r\n            {isSiteAdmin &&\r\n              <Form.Group as={Row}>\r\n                <Col>\r\n                  <Typeahead id=\"portal\"\r\n                    ref={this.portalTypeahead}\r\n                    labelKey=\"ImplementationName\"\r\n                    filterBy={(option, props) => props.selected.length > 0 || option.ImplementationName.toLowerCase().indexOf(props.text.toLowerCase()) !== -1}\r\n                    isLoading={loading}\r\n                    onChange={this.handlePortalChange}\r\n                    onInputChange={text => this.handleEmptyPortal(text)}\r\n                    disabled={loading}\r\n                    options={portals || []}\r\n                    selected={selectedPortal ? [selectedPortal || \"\"] : []}\r\n                    placeholder=\"Select Portal\"\r\n                    emptyLabel=\"No Portals Found\">\r\n                    {!loading && <Button variant=\"toggle\" onClick={() => { this.portalTypeahead.current?.toggleMenu() }}>\r\n                      <FaAngleDown />\r\n                    </Button>}\r\n                  </Typeahead>\r\n                </Col>\r\n              </Form.Group>\r\n            }\r\n            {(isPortalAdmin && selectedPortal) &&\r\n              <Form.Group as={Row}>\r\n                <Col>\r\n                  <Typeahead id=\"company\"\r\n                    ref={this.companyTypeahead}\r\n                    labelKey=\"Name\"\r\n                    filterBy={(option, props) => props.selected.length > 0 || option.Name.toLowerCase().indexOf(props.text.toLowerCase()) !== -1}\r\n                    isLoading={loading}\r\n                    onChange={this.handleCompanyChange}\r\n                    onInputChange={text => this.handleEmptyCompany(text)}\r\n                    disabled={loading}\r\n                    options={companies || []}\r\n                    selected={selectedCompany ? [selectedCompany || \"\"] : []}\r\n                    placeholder=\"Select Company\"\r\n                    emptyLabel=\"No Companies Found\">\r\n                    {!loading && <Button variant=\"toggle\" onClick={() => { this.companyTypeahead.current?.toggleMenu() }}>\r\n                      <FaAngleDown />\r\n                    </Button>}\r\n                  </Typeahead>\r\n                </Col>\r\n              </Form.Group>\r\n            }\r\n            <Form.Group as={Row}>\r\n              <Table responsive bordered className=\"dark text-center\">\r\n                {this.state.loading &&\r\n                  <tbody>\r\n                    <tr><td colSpan={2}><Spinner animation=\"border\" size=\"sm\" /></td></tr>\r\n                  </tbody>\r\n                }\r\n                {(!this.state.loading && selectedPortal) &&\r\n                  <tbody>\r\n                    <tr><th>For non-federal lab-based testing:</th><th></th></tr>\r\n                    <tr key='trMRONonDOTNeg'><td>Require MRO for negative tests</td><td><Checkbox id='cbMRONonDOTNeg' checked={mroNonDOTNeg} onChange={(e: React.ChangeEvent<HTMLInputElement>) => this.toggleMRONONDOTNeg(e)} className=\"mr-auto\" /></td></tr>\r\n                    <tr key='trMRONonDOTPos'><td>Require MRO for non-negative tests</td><td><Checkbox id='cbMRONonDOTPoss' checked={mroNonDOTPos} onChange={(e: React.ChangeEvent<HTMLInputElement>) => this.toggleMRONONDOTPos(e)} className=\"mr-auto\" /></td></tr>\r\n                    <tr><th>For POCT or 'instant' testing:</th><th></th></tr>\r\n                    <tr key='trPOCTReqLabConf'><td>Require laboratory confirmation for non-negative screens</td><td><Checkbox id='cbPOCTReqLabConf' checked={poctRequireLab} onChange={(e: React.ChangeEvent<HTMLInputElement>) => this.togglePOCTReqLabConf(e)} className=\"mr-auto\" /></td></tr>\r\n                    <tr key='trPOCTReqMRO'><td>Require MRO for laboratory non-negative confirmations</td><td><Checkbox id='cbPOCTReqMRO' checked={poctRequireMRO} onChange={(e: React.ChangeEvent<HTMLInputElement>) => this.togglePOCTReqMRO(e)} className=\"mr-auto\" /></td></tr></tbody>\r\n                }\r\n\r\n              </Table>\r\n            </Form.Group>\r\n          </Modal.Body>\r\n          <Modal.Footer>\r\n            <ActionButton variant=\"primary\" onClick={() => this.handleSave()} disabled={loading || saving} spin={saving} disableOnSpin>Update</ActionButton>\r\n            <Button variant=\"secondary\" className=\"mr-2\" onClick={() => this.handleCancel()}>Cancel</Button>\r\n          </Modal.Footer>\r\n        </Modal.Dialog>\r\n      </AppPageWrapper >\r\n    )\r\n  }\r\n}\r\n\r\nfunction mapStateToProps(state: AppState): LabResultsReportingModalAuthProps {\r\n  return {\r\n    isPortalAdmin: isPortalAdmin(state),\r\n    isSiteAdmin: isSiteAdmin(state),\r\n    UserName: getUserNameForSelectedCompany(state),\r\n    Portal: GetSelectedPortal(state)\r\n  }\r\n}\r\nconst ConnectedLabResultsReportingModal = connect(mapStateToProps, null)(LabResultsReportingModal)\r\nexport default ConnectedLabResultsReportingModal","export enum InvitationType {\r\n  Unknown,\r\n  Portal,\r\n  Company,\r\n  Location,\r\n  User,\r\n  ConfigurePassword\r\n}\r\n","import { ObservableFromFetch } from \"../ObservableFromFetch\"\r\nimport CheckOneTimePIN from \"./Model/CheckOneTimePIN\"\r\n\r\nexport default function GetOneTimePIN(params: CheckOneTimePIN) {\r\n    const requestBody = JSON.stringify(params)\r\n    return ObservableFromFetch<number>(\"FFOrderClinicStatus/SendOTP\", requestBody)\r\n}\r\n","export enum ScoreStatus {\r\n  exceed = \"exceed\",\r\n  pass = \"pass\",\r\n  warn = \"warn\",\r\n  fail = \"fail\"\r\n}\r\n\r\nexport interface PasswordScore {\r\n  calculatedScore: number\r\n  numOfMidChar: number\r\n  noOfSymBonus: number\r\n  lcImgStatus: ScoreStatus\r\n  ucImgStatus: ScoreStatus\r\n  numImgStatus: ScoreStatus\r\n  symImgStatus: ScoreStatus\r\n  midImgStatus: ScoreStatus\r\n  reqImgStatus: ScoreStatus\r\n  pwdLenImgStatus: ScoreStatus\r\n  pwdLength: number\r\n  noOfLC: number\r\n  noOfUC: number\r\n  noOfNum: number\r\n  noOfSym: number\r\n  numOfRequirements: number\r\n  noOfCharBonus: number\r\n  noOfLCBonus: number\r\n  noOfUCBonus: number\r\n  noOfNumBonus: number\r\n  noOfMidBonus: number\r\n  noOfRequirementsBonus: number\r\n  noOfAlphasOnly: number\r\n  noOfNumbersOnly: number\r\n  noOfRepChar: number\r\n  noOfConsecAlphaUC: number\r\n  noOfConsecAlphaLC: number\r\n  noOfConsecNumber: number\r\n  noOfSeqAlpha: number\r\n  noOfSeqNumber: number\r\n  noOfSeqSymbol: number\r\n  alphasOnlyImgStatus: ScoreStatus\r\n  numbersOnlyImgStatus: ScoreStatus\r\n  repCharImgStatus: ScoreStatus\r\n  consecAlphaUCImgStatus: ScoreStatus\r\n  consecAlphaLCImgStatus: ScoreStatus\r\n  consecNumberImgStatus: ScoreStatus\r\n  seqAlphaImgStatus: ScoreStatus\r\n  seqNumberImgStatus: ScoreStatus\r\n  seqSymbolImgStatus: ScoreStatus\r\n  noOfAlphasOnlyBonus: number\r\n  noOfNumbersOnlyBonus: number\r\n  noOfRepCharBonus: number\r\n  noOfConsecAlphaUCBonus: number\r\n  noOfConsecAlphaLCBonus: number\r\n  noOfConsecNumberBonus: number\r\n  noOfSeqAlphaBonus: number\r\n  noOfSeqNumberBonus: number\r\n  noOfSeqSymbolBonus: number\r\n  nConsecSymbol: number\r\n  nConsecCharType: number\r\n  nSeqChar: number\r\n}\r\n\r\nexport default function CalculatePasswordScore(pwd: string): PasswordScore {\r\n  const result: PasswordScore = {\r\n    calculatedScore: 0,\r\n    numOfMidChar: 0,\r\n    noOfSymBonus: 0,\r\n    lcImgStatus: ScoreStatus.fail,\r\n    ucImgStatus: ScoreStatus.fail,\r\n    numImgStatus: ScoreStatus.fail,\r\n    symImgStatus: ScoreStatus.fail,\r\n    midImgStatus: ScoreStatus.fail,\r\n    reqImgStatus: ScoreStatus.fail,\r\n    pwdLenImgStatus: ScoreStatus.fail,\r\n    pwdLength: 0,\r\n    noOfLC: 0,\r\n    noOfUC: 0,\r\n    noOfNum: 0,\r\n    noOfSym: 0,\r\n    numOfRequirements: 0,\r\n    noOfCharBonus: 0,\r\n    noOfLCBonus: 0,\r\n    noOfUCBonus: 0,\r\n    noOfNumBonus: 0,\r\n    noOfMidBonus: 0,\r\n    noOfRequirementsBonus: 0,\r\n    noOfAlphasOnly: 0,\r\n    noOfNumbersOnly: 0,\r\n    noOfRepChar: 0,\r\n    noOfConsecAlphaUC: 0,\r\n    noOfConsecAlphaLC: 0,\r\n    noOfConsecNumber: 0,\r\n    noOfSeqAlpha: 0,\r\n    noOfSeqNumber: 0,\r\n    noOfSeqSymbol: 0,\r\n    alphasOnlyImgStatus: ScoreStatus.pass,\r\n    numbersOnlyImgStatus: ScoreStatus.pass,\r\n    repCharImgStatus: ScoreStatus.pass,\r\n    consecAlphaUCImgStatus: ScoreStatus.pass,\r\n    consecAlphaLCImgStatus: ScoreStatus.pass,\r\n    consecNumberImgStatus: ScoreStatus.pass,\r\n    seqAlphaImgStatus: ScoreStatus.pass,\r\n    seqNumberImgStatus: ScoreStatus.pass,\r\n    seqSymbolImgStatus: ScoreStatus.pass,\r\n    noOfAlphasOnlyBonus: 0,\r\n    noOfNumbersOnlyBonus: 0,\r\n    noOfRepCharBonus: 0,\r\n    noOfConsecAlphaUCBonus: 0,\r\n    noOfConsecAlphaLCBonus: 0,\r\n    noOfConsecNumberBonus: 0,\r\n    noOfSeqAlphaBonus: 0,\r\n    noOfSeqNumberBonus: 0,\r\n    noOfSeqSymbolBonus: 0,\r\n    nConsecSymbol: 0,\r\n    nConsecCharType: 0,\r\n    nSeqChar: 0\r\n  }\r\n  const reverse = (str: string): string => str.split(\"\").reverse().join(\"\")\r\n  let nScore: number = 0, nAlphaUC: number = 0, nAlphaLC: number = 0, nNumber: number = 0, nSymbol: number = 0,\r\n    nMidChar: number = 0, nRequirements: number = 0, nAlphasOnly: number = 0, nNumbersOnly: number = 0, nUnqChar: number = 0,\r\n    nRepChar: number = 0, nRepInc: number = 0, nConsecAlphaUC: number = 0, nConsecAlphaLC: number = 0, nConsecNumber: number = 0,\r\n    nConsecSymbol: number = 0, nConsecCharType: number = 0, nSeqAlpha: number = 0, nSeqNumber: number = 0, nSeqSymbol: number = 0,\r\n    nSeqChar: number = 0, nReqChar: number = 0\r\n  let nMultMidChar: number = 2, nMultConsecAlphaUC: number = 2, nMultConsecAlphaLC: number = 2,\r\n    nMultConsecNumber: number = 2\r\n  let nMultSeqAlpha: number = 3, nMultSeqNumber: number = 3, nMultSeqSymbol: number = 3\r\n  let nMultLength: number = 4, nMultNumber: number = 4\r\n  let nMultSymbol: number = 6\r\n  let nTmpAlphaUC: string = \"\", nTmpAlphaLC: string = \"\", nTmpNumber: string = \"\",\r\n    nTmpSymbol: string = \"\"\r\n  let sAlphaUC: string = \"0\", sAlphaLC: string = \"0\", sNumber: string = \"0\",\r\n    sSymbol: string = \"0\", sMidChar: string = \"0\", sRequirements: string = \"0\",\r\n    sAlphasOnly: string = \"0\", sNumbersOnly: string = \"0\", sRepChar: string = \"0\",\r\n    sConsecAlphaUC: string = \"0\", sConsecAlphaLC: string = \"0\",\r\n    sConsecNumber: string = \"0\", sSeqAlpha: string = \"0\",\r\n    sSeqNumber: string = \"0\", sSeqSymbol: string = \"0\"\r\n  let sAlphas: string = \"abcdefghijklmnopqrstuvwxyz\"\r\n  let sNumerics: string = \"01234567890\"\r\n  let sSymbols: string = \")!@#$%^&*()\"\r\n  let nMinPwdLen = 8\r\n  if (pwd) {\r\n    nScore = parseInt(String(pwd.length * nMultLength), 10)\r\n    result.pwdLength = pwd.length\r\n    let arrPwd = pwd.replace(/\\s+/g, \"\").split(/\\s*/)\r\n    let arrPwdLen = arrPwd.length\r\n\r\n    /* Loop through password to check for Symbol, Numeric, Lowercase and Uppercase\r\n     pattern matches\r\n     */\r\n    for (let charValue = 0; charValue < arrPwdLen; charValue++) {\r\n      if (arrPwd[charValue].match(/[A-Z]/g)) {\r\n        if (nTmpAlphaUC !== \"\") {\r\n          if ((parseInt(nTmpAlphaUC) + 1) === charValue) {\r\n            nConsecAlphaUC++\r\n            nConsecCharType++\r\n          }\r\n        }\r\n        nTmpAlphaUC = String(charValue)\r\n        nAlphaUC++\r\n      }\r\n      else if (arrPwd[charValue].match(/[a-z]/g)) {\r\n        if (nTmpAlphaLC !== \"\") {\r\n          if ((parseInt(nTmpAlphaLC) + 1) === charValue) {\r\n            nConsecAlphaLC++\r\n            nConsecCharType++\r\n          }\r\n        }\r\n        nTmpAlphaLC = String(charValue)\r\n        nAlphaLC++\r\n      }\r\n      else if (arrPwd[charValue].match(/[0-9]/g)) {\r\n        if (charValue > 0 && charValue < (arrPwdLen - 1)) {\r\n          nMidChar++\r\n        }\r\n        if (nTmpNumber !== \"\") {\r\n          if ((parseInt(nTmpNumber) + 1) === charValue) {\r\n            nConsecNumber++\r\n            nConsecCharType++\r\n          }\r\n        }\r\n        nTmpNumber = String(charValue)\r\n        nNumber++\r\n      }\r\n      else if (arrPwd[charValue].match(/[^a-zA-Z0-9_]/g)) {\r\n        if (charValue > 0 && charValue < (arrPwdLen - 1)) {\r\n          nMidChar++\r\n        }\r\n        if (nTmpSymbol !== \"\") {\r\n          if ((parseInt(nTmpSymbol) + 1) === charValue) {\r\n            nConsecSymbol++\r\n            nConsecCharType++\r\n          }\r\n        }\r\n        nTmpSymbol = String(charValue)\r\n        nSymbol++\r\n      }\r\n      /* Internal loop through password to check for repeat characters */\r\n      let bCharExists = false\r\n      for (let repeatedChar = 0; repeatedChar < arrPwdLen; repeatedChar++) {\r\n        if (arrPwd[charValue] === arrPwd[repeatedChar] && charValue !== repeatedChar) { /* repeat character exists */\r\n          bCharExists = true\r\n          /*\r\n           Calculate increment deduction based on proximity to identical characters\r\n           Deduction is incremented each time a new match is discovered\r\n           Deduction amount is based on total password length divided by the\r\n           difference of distance between currently selected match\r\n           */\r\n          nRepInc += Math.abs(arrPwdLen / (repeatedChar - charValue))\r\n        }\r\n      }\r\n      if (bCharExists) {\r\n        nRepChar++\r\n        nUnqChar = arrPwdLen - nRepChar\r\n        nRepInc = (nUnqChar) ? Math.ceil(nRepInc / nUnqChar) : Math.ceil(nRepInc)\r\n      }\r\n    }\r\n    /* Check for sequential alpha string patterns (forward and reverse) */\r\n    for (let sequentialAlpha = 0; sequentialAlpha < 23; sequentialAlpha++) {\r\n      let sFwd = sAlphas.substring(sequentialAlpha, parseInt(String(sequentialAlpha + 3), 10))\r\n      let sRev = reverse(sFwd)\r\n      if (pwd.toLowerCase().indexOf(sFwd) !== -1 ||\r\n        pwd.toLowerCase().indexOf(sRev) !== -1) {\r\n        nSeqAlpha++\r\n        nSeqChar++\r\n      }\r\n    }\r\n\r\n    /* Check for sequential numeric string patterns (forward and reverse) */\r\n    for (let sequentialNumeric = 0; sequentialNumeric < 8; sequentialNumeric++) {\r\n      let sFwd = sNumerics.substring(sequentialNumeric, parseInt(String(sequentialNumeric + 3), 10))\r\n      let sRev = reverse(sFwd)\r\n      if (pwd.toLowerCase().indexOf(sFwd) !== -1 ||\r\n        pwd.toLowerCase().indexOf(sRev) !== -1) {\r\n        nSeqNumber++\r\n        nSeqChar++\r\n      }\r\n    }\r\n\r\n    /* Check for sequential symbol string patterns (forward and reverse) */\r\n    for (let sequentialSymbol = 0; sequentialSymbol < 8; sequentialSymbol++) {\r\n      let sFwd = sSymbols.substring(sequentialSymbol, parseInt(String(sequentialSymbol + 3), 10))\r\n      let sRev = reverse(sFwd)\r\n      if (pwd.toLowerCase().indexOf(sFwd) !== -1 ||\r\n        pwd.toLowerCase().indexOf(sRev) !== -1) {\r\n        nSeqSymbol++\r\n        nSeqChar++\r\n      }\r\n    }\r\n\r\n    /* Modify overall score value based on usage vs requirements */\r\n\r\n    /* General point assignment */\r\n    result.noOfCharBonus = nScore\r\n    if (nAlphaUC > 0 && nAlphaUC < result.pwdLength) {\r\n      nScore = parseInt(String(nScore + ((result.pwdLength - nAlphaUC) * 2)), 10)\r\n      sAlphaUC = String((result.pwdLength - nAlphaUC) * 2)\r\n    }\r\n    if (nAlphaLC > 0 && nAlphaLC < result.pwdLength) {\r\n      nScore = parseInt(String(nScore + ((result.pwdLength - nAlphaLC) * 2)), 10)\r\n      sAlphaLC = String((result.pwdLength - nAlphaLC) * 2)\r\n    }\r\n    if (nNumber > 0 && nNumber < result.pwdLength) {\r\n      nScore = parseInt(String(nScore + (nNumber * nMultNumber)), 10)\r\n      sNumber = String(nNumber * nMultNumber)\r\n    }\r\n    if (nSymbol > 0) {\r\n      nScore = parseInt(String(nScore + (nSymbol * nMultSymbol)), 10)\r\n      sSymbol = String(nSymbol * nMultSymbol)\r\n    }\r\n    if (nMidChar > 0) {\r\n      nScore = parseInt(String(nScore + (nMidChar * nMultMidChar)), 10)\r\n      sMidChar = String(nMidChar * nMultMidChar)\r\n    }\r\n\r\n    result.noOfUCBonus = parseInt(sAlphaUC)\r\n    result.noOfLCBonus = parseInt(sAlphaLC)\r\n    result.noOfNumBonus = parseInt(sNumber)\r\n    result.noOfSymBonus = parseInt(sSymbol)\r\n    result.noOfMidBonus = parseInt(sMidChar)\r\n\r\n    /* Point deductions for poor practices */\r\n    if ((nAlphaLC > 0 || nAlphaUC > 0) && nSymbol === 0 && nNumber === 0) {  // Only Letters\r\n      nScore = parseInt(String(nScore - result.pwdLength), 10)\r\n      nAlphasOnly = result.pwdLength\r\n      sAlphasOnly = String(result.pwdLength)\r\n    }\r\n    if (nAlphaLC === 0 && nAlphaUC === 0 && nSymbol === 0 && nNumber > 0) {  // Only Numbers\r\n      nScore = parseInt(String(nScore - result.pwdLength), 10)\r\n      nNumbersOnly = result.pwdLength\r\n      sNumbersOnly = String(result.pwdLength)\r\n    }\r\n    if (nRepChar > 0) {  // Same character exists more than once\r\n      nScore = parseInt(String(nScore - nRepInc), 10)\r\n      sRepChar = String(nRepInc)\r\n    }\r\n    if (nConsecAlphaUC > 0) {  // Consecutive Uppercase Letters exist\r\n      nScore = parseInt(String(nScore - (nConsecAlphaUC * nMultConsecAlphaUC)), 10)\r\n      sConsecAlphaUC = String(nConsecAlphaUC * nMultConsecAlphaUC)\r\n    }\r\n    if (nConsecAlphaLC > 0) {  // Consecutive Lowercase Letters exist\r\n      nScore = parseInt(String(nScore - (nConsecAlphaLC * nMultConsecAlphaLC)), 10)\r\n      sConsecAlphaLC = String(nConsecAlphaLC * nMultConsecAlphaLC)\r\n    }\r\n    if (nConsecNumber > 0) {  // Consecutive Numbers exist\r\n      nScore = parseInt(String(nScore - (nConsecNumber * nMultConsecNumber)), 10)\r\n      sConsecNumber = String(nConsecNumber * nMultConsecNumber)\r\n    }\r\n    if (nSeqAlpha > 0) {  // Sequential alpha strings exist (3 characters or more)\r\n      nScore = parseInt(String(nScore - (nSeqAlpha * nMultSeqAlpha)), 10)\r\n      sSeqAlpha = String(nSeqAlpha * nMultSeqAlpha)\r\n    }\r\n    if (nSeqNumber > 0) {  // Sequential numeric strings exist (3 characters or more)\r\n      nScore = parseInt(String(nScore - (nSeqNumber * nMultSeqNumber)), 10)\r\n      sSeqNumber = String(nSeqNumber * nMultSeqNumber)\r\n    }\r\n    if (nSeqSymbol > 0) {  // Sequential symbol strings exist (3 characters or more)\r\n      nScore = parseInt(String(nScore - (nSeqSymbol * nMultSeqSymbol)), 10)\r\n      sSeqSymbol = String(nSeqSymbol * nMultSeqSymbol)\r\n    }\r\n    result.noOfAlphasOnlyBonus = parseInt(sAlphasOnly)\r\n    result.noOfNumbersOnlyBonus = parseInt(sNumbersOnly)\r\n    result.noOfRepCharBonus = parseInt(sRepChar)\r\n    result.noOfConsecAlphaUCBonus = parseInt(sConsecAlphaUC)\r\n    result.noOfConsecAlphaLCBonus = parseInt(sConsecAlphaLC)\r\n    result.noOfConsecNumberBonus = parseInt(sConsecNumber)\r\n    result.noOfSeqAlphaBonus = parseInt(sSeqAlpha)\r\n    result.noOfSeqNumberBonus = parseInt(sSeqNumber)\r\n    result.noOfSeqSymbolBonus = parseInt(sSeqSymbol)\r\n\r\n\r\n    /* Determine if mandatory requirements have been met and set image indicators\r\n     accordingly */\r\n    result.noOfUC = nAlphaUC\r\n    result.noOfLC = nAlphaLC\r\n    result.noOfNum = nNumber\r\n    result.noOfSym = nSymbol\r\n\r\n    if (result.pwdLength === 8) {\r\n      result.pwdLenImgStatus = ScoreStatus.pass\r\n      nReqChar++\r\n    }\r\n    else if (result.pwdLength > 8) {\r\n      result.pwdLenImgStatus = ScoreStatus.exceed\r\n      nReqChar++\r\n    }\r\n    else {\r\n      result.pwdLenImgStatus = ScoreStatus.fail\r\n    }\r\n\r\n    if (result.noOfUC === 1) {\r\n      result.ucImgStatus = ScoreStatus.pass\r\n      nReqChar++\r\n    }\r\n    else if (result.noOfUC > 1) {\r\n      result.ucImgStatus = ScoreStatus.exceed\r\n      nReqChar++\r\n    }\r\n    else {\r\n      result.ucImgStatus = ScoreStatus.fail\r\n    }\r\n\r\n    if (result.noOfLC === 1) {\r\n      result.lcImgStatus = ScoreStatus.pass\r\n      nReqChar++\r\n    }\r\n    else if (result.noOfLC > 1) {\r\n      result.lcImgStatus = ScoreStatus.exceed\r\n      nReqChar++\r\n    }\r\n    else {\r\n      result.lcImgStatus = ScoreStatus.fail\r\n    }\r\n\r\n    if (result.noOfNum === 1) {\r\n      result.numImgStatus = ScoreStatus.pass\r\n      nReqChar++\r\n    }\r\n    else if (result.noOfNum > 1) {\r\n      result.numImgStatus = ScoreStatus.exceed\r\n      nReqChar++\r\n    }\r\n    else {\r\n      result.numImgStatus = ScoreStatus.fail\r\n    }\r\n\r\n    if (result.noOfSym === 1) {\r\n      result.symImgStatus = ScoreStatus.pass\r\n      nReqChar++\r\n    }\r\n    else if (result.noOfSym > 1) {\r\n      result.symImgStatus = ScoreStatus.exceed\r\n      nReqChar++\r\n    }\r\n    else {\r\n      result.symImgStatus = ScoreStatus.fail\r\n    }\r\n\r\n    nRequirements = nReqChar\r\n    let nMinReqChars = 0\r\n    if (pwd.length >= nMinPwdLen) {\r\n      nMinReqChars = 3\r\n    } else {\r\n      nMinReqChars = 4\r\n    }\r\n    if (nRequirements > nMinReqChars) {  // One or more required characters exist\r\n      nScore = parseInt(String(nScore + (nRequirements * 2)), 10)\r\n      sRequirements = String(nRequirements * 2)\r\n    }\r\n    result.noOfRequirementsBonus = parseInt(sRequirements)\r\n\r\n    /* Determine if additional bonuses need to be applied and set image\r\n     indicators accordingly */\r\n\r\n    result.numOfMidChar = nMidChar\r\n    result.numOfRequirements = nRequirements\r\n\r\n    if (result.numOfMidChar === 1) {\r\n      result.midImgStatus = ScoreStatus.pass\r\n    }\r\n    else if (result.numOfMidChar > 1) {\r\n      result.midImgStatus = ScoreStatus.exceed\r\n    }\r\n    else {\r\n      result.midImgStatus = ScoreStatus.fail\r\n    }\r\n\r\n    if (result.numOfRequirements === nMinReqChars + 1) {\r\n      result.reqImgStatus = ScoreStatus.pass\r\n    }\r\n    else if (result.numOfRequirements > nMinReqChars + 1) {\r\n      result.reqImgStatus = ScoreStatus.exceed\r\n    }\r\n    else {\r\n      result.reqImgStatus = ScoreStatus.fail\r\n    }\r\n\r\n    /* Determine if suggested requirements have been met and set image indicators\r\n     accordingly */\r\n    result.noOfAlphasOnly = nAlphasOnly\r\n    result.noOfNumbersOnly = nNumbersOnly\r\n    result.noOfRepChar = nRepChar\r\n    result.noOfConsecAlphaUC = nConsecAlphaUC\r\n    result.noOfConsecAlphaLC = nConsecAlphaLC\r\n    result.noOfConsecNumber = nConsecNumber\r\n    result.noOfSeqAlpha = nSeqAlpha\r\n    result.noOfSeqNumber = nSeqNumber\r\n    result.noOfSeqSymbol = nSeqSymbol\r\n    result.nConsecSymbol = nConsecSymbol\r\n    result.nConsecCharType = nConsecCharType\r\n    result.nSeqChar = nSeqChar\r\n\r\n    if (result.noOfAlphasOnly > 0) {\r\n      result.alphasOnlyImgStatus = ScoreStatus.warn\r\n    }\r\n    else {\r\n      result.alphasOnlyImgStatus = ScoreStatus.pass\r\n    }\r\n\r\n    if (result.noOfNumbersOnly > 0) {\r\n      result.numbersOnlyImgStatus = ScoreStatus.warn\r\n    }\r\n    else {\r\n      result.numbersOnlyImgStatus = ScoreStatus.pass\r\n    }\r\n\r\n    if (result.noOfRepChar > 0) {\r\n      result.repCharImgStatus = ScoreStatus.warn\r\n    }\r\n    else {\r\n      result.repCharImgStatus = ScoreStatus.pass\r\n    }\r\n\r\n    if (result.noOfConsecAlphaUC > 0) {\r\n      result.consecAlphaUCImgStatus = ScoreStatus.warn\r\n    }\r\n    else {\r\n      result.consecAlphaUCImgStatus = ScoreStatus.pass\r\n    }\r\n\r\n    if (result.noOfConsecAlphaLC > 0) {\r\n      result.consecAlphaLCImgStatus = ScoreStatus.warn\r\n    }\r\n    else {\r\n      result.consecAlphaLCImgStatus = ScoreStatus.pass\r\n    }\r\n\r\n    if (result.noOfConsecNumber > 0) {\r\n      result.consecNumberImgStatus = ScoreStatus.warn\r\n    }\r\n    else {\r\n      result.consecNumberImgStatus = ScoreStatus.pass\r\n    }\r\n\r\n    if (result.noOfSeqAlpha > 0) {\r\n      result.seqAlphaImgStatus = ScoreStatus.warn\r\n    }\r\n    else {\r\n      result.seqAlphaImgStatus = ScoreStatus.pass\r\n    }\r\n\r\n    if (result.noOfSeqNumber > 0) {\r\n      result.seqNumberImgStatus = ScoreStatus.warn\r\n    }\r\n    else {\r\n      result.seqNumberImgStatus = ScoreStatus.pass\r\n    }\r\n\r\n    if (result.noOfSeqSymbol > 0) {\r\n      result.seqSymbolImgStatus = ScoreStatus.warn\r\n    }\r\n    else {\r\n      result.seqSymbolImgStatus = ScoreStatus.pass\r\n    }\r\n    result.calculatedScore = nScore\r\n  }\r\n\r\n  return result\r\n}\r\n","import React from \"react\"\r\nimport { Modal, Form, Col, Row, Button } from \"react-bootstrap\"\r\nimport ReCAPTCHA from \"react-google-recaptcha\"\r\nimport { toast } from \"react-toastify\"\r\nimport { GetInvitationAttempts } from \"../../api/Invitation/GetInvitationStatus\"\r\nimport GetOneTimePIN from \"../../api/Invitation/GetOneTimePIN\"\r\nimport CheckOneTimePIN from \"../../api/Invitation/Model/CheckOneTimePIN\"\r\nimport ValidatePINModel from \"../../api/Invitation/Model/ValidatePINModel\"\r\nimport ValidateOneTimePIN from \"../../api/Invitation/ValidateOneTimePIN\"\r\nimport { APIError } from \"../../api/ObservableFromFetch\"\r\nimport { ReCaptchaSiteKey } from \"../../config/Constants\"\r\nimport ActionButton from \"../ActionButton\"\r\n\r\ninterface ValidatePINProps {\r\n  currentURL: string\r\n  outboxAN: number\r\n  onSuccess: (pin: string) => void\r\n  onBack?: () => void\r\n}\r\n\r\ninterface ValidatePINState {\r\n  pinValid?: boolean\r\n  showValidatePIN: boolean\r\n  didNotReceivePIN: boolean\r\n  pinDidNotMatch: boolean\r\n  requestNewPIN: boolean\r\n  validCaptcha?: boolean\r\n  showTooManyAttempts: boolean\r\n  loading: boolean\r\n  outboxAN: number\r\n}\r\n\r\nexport default class ValidatePIN extends React.PureComponent<ValidatePINProps, ValidatePINState> {\r\n  currentPin: string = \"\"\r\n  state = { showValidatePIN: true, didNotReceivePIN: false, pinDidNotMatch: false, requestNewPIN: false, validCaptcha: false, showTooManyAttempts: false, loading: false, outboxAN: this.props.outboxAN }\r\n\r\n  validatePIN(e: React.KeyboardEvent<HTMLInputElement>) {\r\n    const enteredPIN = (e.target as HTMLInputElement).value\r\n    if (enteredPIN.length === 6) {\r\n      this.currentPin = enteredPIN\r\n      this.setState({ loading: true })\r\n      const data: ValidatePINModel = {\r\n        Link: this.props.currentURL,\r\n        OneTimePin: this.currentPin,\r\n        OutboxAN: this.state.outboxAN\r\n      }\r\n      ValidateOneTimePIN(data).subscribe(\r\n        data => {\r\n          this.setState({ loading: false })\r\n          this.validateOneTimePinSuccess(data)\r\n        },\r\n        error => {\r\n          GetInvitationAttempts(this.props.currentURL).subscribe(\r\n            data => {\r\n              if (data > 4) this.setState({ loading: false, showValidatePIN: false, showTooManyAttempts: true })\r\n              else this.setState({ loading: false, showValidatePIN: false, pinDidNotMatch: true })\r\n            },\r\n            error => {\r\n              this.handleAPIError(error)\r\n              this.setState({ loading: false })\r\n            }\r\n          )\r\n          this.handleAPIError(error)\r\n        }\r\n      )\r\n    }\r\n  }\r\n\r\n  // TODO: replace type\r\n  validateOneTimePinSuccess(data: any) {\r\n    // TODO: verify IsConfirmation logic\r\n    // TODO: verify configure-password logic\r\n    this.setState({ showValidatePIN: false })\r\n    toast.success(data)\r\n    this.props.onSuccess(this.currentPin)\r\n  }\r\n\r\n  goToLogin() {\r\n    window.location.hash = \"#/\"\r\n  }\r\n\r\n  requestNewPIN(): void {\r\n    const data: CheckOneTimePIN = { Link: this.props.currentURL, method: \"email\" }\r\n    this.setState({ loading: true })\r\n    GetOneTimePIN(data).subscribe(\r\n      data => this.sendOneTimePINSuccess(data),\r\n      error => {\r\n        this.setState({ loading: false })\r\n        this.handleAPIError(error)\r\n      }\r\n    )\r\n  }\r\n\r\n  sendOneTimePINSuccess(data: any) {\r\n    this.setState({ showValidatePIN: true, didNotReceivePIN: false, pinDidNotMatch: false, requestNewPIN: false, validCaptcha: false, loading: false, outboxAN: data })\r\n    toast.success(\"PIN sent successfully\")\r\n  }\r\n\r\n  handleAPIError = (error: Error | APIError) => {\r\n    error && toast.error((error as APIError)?.errorData?.message || error.message)\r\n  }\r\n\r\n  render() {\r\n    const { showValidatePIN, didNotReceivePIN, pinDidNotMatch, requestNewPIN, showTooManyAttempts, loading } = this.state\r\n    return (\r\n      <>\r\n        { showValidatePIN && <Modal.Dialog size=\"xl\">\r\n          <Modal.Header>\r\n            <Modal.Title className=\"text-uppercase\">Enter your PIN</Modal.Title>\r\n          </Modal.Header>\r\n          <Modal.Body>\r\n            <Row><Col><p>We are sending you a PIN. Please enter that PIN below:</p></Col></Row>\r\n            <Row>\r\n              <Col className=\"d-flex justify-content-center\">\r\n                <Form inline>\r\n                  <Form.Control type=\"text\" placeholder=\"XXXXXX\" size=\"sm\" disabled={loading} className=\"partial-pin-input\" maxLength={6} minLength={6} onKeyUp={(e: React.KeyboardEvent<HTMLInputElement>) => this.validatePIN(e)} />\r\n                </Form>\r\n              </Col>\r\n            </Row>\r\n          </Modal.Body>\r\n          <Modal.Footer className=\"button-block\">\r\n            <Button variant=\"link\" onClick={() => this.setState({ showValidatePIN: false, didNotReceivePIN: true })} className=\"mr-auto\">I didn't receive my PIN!</Button>\r\n            {!!this.props.onBack && <Button onClick={this.props.onBack}>Back</Button>}\r\n            <Button onClick={() => this.setState({ showValidatePIN: false, requestNewPIN: true })}>Resend</Button>\r\n            <Button onClick={() => this.goToLogin()} variant=\"secondary\">Cancel</Button>\r\n          </Modal.Footer>\r\n        </Modal.Dialog>}\r\n        { didNotReceivePIN && <Modal.Dialog size=\"xl\">\r\n          <Modal.Header>\r\n            <Modal.Title className=\"text-uppercase\">I Didn't Receive My PIN</Modal.Title>\r\n          </Modal.Header>\r\n          <Modal.Body>\r\n            <Row><Col><p>Our Apologies!</p></Col></Row>\r\n            <Row><Col><p>For security purposes, we need to deliver your PIN to the phone number created when you were invited.</p></Col></Row>\r\n            <Row><Col><p>If you believe the phone number set for your invitation is incorrect, or you are unable to receive a PIN at that number, please contact your administrator for assistance.</p></Col></Row>\r\n          </Modal.Body>\r\n          <Modal.Footer className=\"button-block\">\r\n            <Button onClick={() => this.goToLogin()}>Close</Button>\r\n          </Modal.Footer>\r\n        </Modal.Dialog>}\r\n        { pinDidNotMatch && <Modal.Dialog size=\"xl\">\r\n          <Modal.Header>\r\n            <Modal.Title className=\"text-uppercase\">PIN Did Not Match</Modal.Title>\r\n          </Modal.Header>\r\n          <Modal.Body>\r\n            <Row><Col><p>The PIN you entered did not match. Please request a new PIN</p></Col></Row>\r\n            <Row>\r\n              <Col>\r\n                <ReCAPTCHA sitekey={ReCaptchaSiteKey} onErrored={() => this.setState({ validCaptcha: false })} onExpired={() => this.setState({ validCaptcha: false })} onChange={(value: string | null) => this.setState({ validCaptcha: value !== null })} hl=\"en\" />\r\n              </Col>\r\n            </Row>\r\n          </Modal.Body>\r\n          <Modal.Footer className=\"button-block\">\r\n            <ActionButton disabled={!this.state.validCaptcha} onClick={() => this.requestNewPIN()} spin={loading} disableOnSpin>Request New PIN</ActionButton>\r\n          </Modal.Footer>\r\n        </Modal.Dialog>}\r\n        { requestNewPIN && <Modal.Dialog size=\"xl\">\r\n          <Modal.Header>\r\n            <Modal.Title className=\"text-uppercase\">Request New PIN</Modal.Title>\r\n          </Modal.Header>\r\n          <Modal.Body>\r\n            <Row><Col><p>We're sorry you did not receive the PIN. Please request a new PIN below.</p></Col></Row>\r\n            <Row>\r\n              <Col>\r\n                <ReCAPTCHA sitekey={ReCaptchaSiteKey} onErrored={() => this.setState({ validCaptcha: false })} onExpired={() => this.setState({ validCaptcha: false })} onChange={(value: string | null) => this.setState({ validCaptcha: value !== null })} hl=\"en\" />\r\n              </Col>\r\n            </Row>\r\n          </Modal.Body>\r\n          <Modal.Footer className=\"button-block\">\r\n            <ActionButton disabled={!this.state.validCaptcha} onClick={() => this.requestNewPIN()} spin={loading} disableOnSpin>Request New PIN</ActionButton>\r\n          </Modal.Footer>\r\n        </Modal.Dialog>}\r\n        { showTooManyAttempts && <Modal.Dialog size=\"xl\">\r\n          <Modal.Header>\r\n            <Modal.Title className=\"text-uppercase\">Exceeded PIN attempts</Modal.Title>\r\n          </Modal.Header>\r\n          <Modal.Body>\r\n          <Row><Col><p>Our Apologies!</p></Col></Row>\r\n            <Row><Col><p>For security purposes, we limit the number of times an invitation may be accepted.</p></Col></Row>\r\n            <Row><Col><p>In order to continue, your administrator will need to re-invite you. We have flagged your invitation to your administrator's attention.</p></Col></Row>\r\n            <Row><Col><p>To expedite this process, please contact your administrator for assistance.</p></Col></Row>\r\n          </Modal.Body>\r\n          <Modal.Footer className=\"button-block\">\r\n            <Button onClick={() => this.goToLogin()}>Close</Button>\r\n          </Modal.Footer>\r\n        </Modal.Dialog>}\r\n      </>\r\n    )\r\n  }\r\n}\r\n","import { ObservableFromFetch } from \"../ObservableFromFetch\"\r\nimport ValidatePINModel from \"./Model/ValidatePINModel\"\r\n\r\nexport default function ValidateOneTimePIN(params: ValidatePINModel) {\r\n    const requestBody = JSON.stringify(params)\r\n    return ObservableFromFetch<string>(\"FFOrderClinicStatus/ValidateOneTimePin\", requestBody)\r\n}\r\n","import InvitationStatusGridRecord from \"../InvitationStatus/Model/InvitationStatusGridRecord\"\r\nimport { ObservableFromFetch } from \"../ObservableFromFetch\"\r\n\r\nexport default function GetInvitationStatus(url: string) {\r\n    const requestBody = JSON.stringify({ URL: url })\r\n    return ObservableFromFetch<InvitationStatusGridRecord>(\"FFOrderClinicStatus/GetInvitationStatus\", requestBody)\r\n}\r\n\r\nexport function GetInvitationAttempts(url: string) {\r\n  const requestBody: string = new URLSearchParams({\r\n    url: url\r\n  }).toString()\r\n\r\n  return ObservableFromFetch<number>(\"FFOrderClinicStatus/GetInvitationAttempts?\" + requestBody)\r\n}","import React from \"react\"\r\nimport { Modal, Form, Col, Row, Button } from \"react-bootstrap\"\r\nimport { toast } from \"react-toastify\"\r\nimport { InvitationStatus } from \"../../api/Invitation/Model/InvitationStatus\"\r\n\r\nimport ValidatePIN from \"./ValidatePIN\"\r\nimport GetOneTimePIN from \"../../api/Invitation/GetOneTimePIN\"\r\n\r\nimport InvitationStatusGridRecord from \"../../api/InvitationStatus/Model/InvitationStatusGridRecord\"\r\n\r\ninterface ValidateIdentityProps {\r\n  currentURL: string\r\n  data: InvitationStatusGridRecord\r\n  status: InvitationStatus\r\n  userPhoneNumber?: string\r\n  userEmail?: string\r\n  onSuccess: (pin: string, outboxAN: number) => void\r\n}\r\n\r\ninterface ValidateIdentityState {\r\n\r\n  showContactForm: boolean\r\n  showSendPin: boolean\r\n  showValidatePIN: boolean\r\n  showLinkExpired: boolean\r\n  showTooManyAttempts: boolean\r\n  method: string\r\n}\r\n\r\nconst InvitationPage = (props: { title: string, children?: JSX.Element | JSX.Element[] }) => <Modal.Dialog size=\"xl\">\r\n  <Modal.Header>\r\n    <Modal.Title className=\"text-uppercase\">{props.title}</Modal.Title>\r\n  </Modal.Header>\r\n  { props.children }\r\n</Modal.Dialog>\r\n\r\nexport default class ValidateIdentity extends React.PureComponent<ValidateIdentityProps, ValidateIdentityState> {\r\n  userMobileNumber: string = this.props.userPhoneNumber || \"\"\r\n  currentOutboxAN: number = this.props.data.OutboxAN\r\n\r\n  state: ValidateIdentityState = {\r\n    showContactForm: [\r\n      InvitationStatus.PENDING,\r\n      InvitationStatus.STARTED,\r\n      InvitationStatus.INVITATION_IN_USE].includes(this.props.status),\r\n    showSendPin: false,\r\n    showValidatePIN: this.props.status === InvitationStatus.VALIDATE_PIN,\r\n    showLinkExpired: this.props.status === InvitationStatus.EXPIRED,\r\n    showTooManyAttempts: this.props.status === InvitationStatus.TOO_MANY_ATTEMPT,\r\n    method: \"EMAIL\"\r\n  }\r\n\r\n  getOneTimePIN = () => {\r\n    const data = {\r\n      Link: this.props.currentURL,\r\n      method: this.state.method\r\n    }\r\n    this.setState({showSendPin: false})\r\n    GetOneTimePIN(data).subscribe(\r\n      data => this.getOneTimePinSuccess(data),\r\n      error => this.getOneTimePinError(error)\r\n    )\r\n  }\r\n\r\n  getOneTimePinSuccess(data: number) {\r\n    this.currentOutboxAN = data\r\n    this.setState({ showContactForm: false, showValidatePIN: true })\r\n    toast.success(\"PIN sent successfully\")\r\n  }\r\n\r\n  getOneTimePinError(message: string) {\r\n    toast.error(message)\r\n  }\r\n\r\n  setMethod = (event: React.ChangeEvent<HTMLInputElement>) => {\r\n    this.setState({ method: event.target.value })\r\n  }\r\n\r\n  render() {\r\n    const userPhoneNumber = this.userMobileNumber\r\n    const { showContactForm, showSendPin, showLinkExpired, showTooManyAttempts } = this.state\r\n    const showByVoice = this.props.status !== InvitationStatus.INVITATION_IN_USE \r\n\r\n    return (\r\n      <>\r\n        { showLinkExpired && <InvitationPage title=\"Your Link is expired. Please contact with the Site Administrator.\" />}\r\n        { showContactForm && <InvitationPage title=\"How Should We Contact You\">\r\n          <Modal.Body>\r\n            <Row><Col><p>To proceed, we need to provide you with a PIN:</p></Col></Row>\r\n            <Row>\r\n              <Col sm={4} className=\"d-flex justify-content-end font-weight-bold\">Your information:</Col>\r\n              <Col sm={1} className=\"font-weight-bold\">Phone:</Col>\r\n              <Col className=\"font-weight-bold\">{ userPhoneNumber?.substring(0,3) }-{ userPhoneNumber?.substring(3,6) }-{ userPhoneNumber?.substring(6,10) }</Col>\r\n            </Row>\r\n            <Row>\r\n              <Col sm={4}></Col>\r\n              <Col sm={1} className=\"font-weight-bold\">eMail:</Col>\r\n              <Col className=\"font-weight-bold\">{ this.props.userEmail }</Col>\r\n            </Row>\r\n            <Row><Col><p>Please indicate how we should contact you:</p></Col></Row>\r\n            <Row className=\"d-flex justify-content-center\">\r\n              <Col md=\"auto\">\r\n                <Form.Check type=\"radio\" name=\"contactOption\" id=\"contactEmail\" value=\"EMAIL\" label=\"By eMail\" className=\"abc-radio\" defaultChecked onChange={this.setMethod}/>\r\n              </Col>\r\n              <Col md=\"auto\">\r\n                <Form.Check type=\"radio\" name=\"contactOption\" id=\"contactText\" value=\"TEXT\" label=\"Via Text Message\" className=\"abc-radio\" onChange={this.setMethod}/>\r\n              </Col>\r\n              {showByVoice && (\r\n                <Col md=\"auto\">\r\n                  <Form.Check type=\"radio\" name=\"contactOption\" id=\"contactVoice\" value=\"VOICE\" label=\"By Voice\" className=\"abc-radio\" onChange={this.setMethod}/>\r\n                </Col>\r\n              )}\r\n            </Row>\r\n            <Row className=\"buttons-block form-row\">\r\n              <Button variant=\"primary\" className=\"mr-2\" onClick={this.getOneTimePIN}>Send</Button>\r\n            </Row>\r\n          </Modal.Body>\r\n          <Modal.Footer>\r\n            <em>  *** Message and data rates may apply. 1 message per user request. For terms: <a href=\"https://www.formfox.com/SMSTermsOfService\"> https://www.formfox.com/SMSTermsOfService </a>. For privacy: <a href=\"https://www.formfox.com/PrivacyPolicy\"> https://www.formfox.com/PrivacyPolicy</a>. Text HELP to 52141 for help. Text STOP to 52141 to stop receiving texts. *** </em>\r\n          </Modal.Footer>\r\n        </InvitationPage> }\r\n        { showSendPin && <InvitationPage title=\"Confirmation Pin\">\r\n          <Modal.Body>\r\n            <Row><Col><p>A PIN must be texted to you for security confirmation:</p></Col></Row>\r\n            <Row className=\"buttons-block form-row\">\r\n              <Button variant=\"primary\" className=\"mx-auto\" onClick={this.getOneTimePIN}>TEXT PIN</Button>\r\n            </Row>\r\n          </Modal.Body>\r\n          <Modal.Footer>\r\n            <em>  *** Message and data rates may apply. 1 message per user request. For terms: <a href=\"https://www.formfox.com/SMSTermsOfService\"> https://www.formfox.com/SMSTermsOfService </a>. For privacy: <a href=\"https://www.formfox.com/PrivacyPolicy\"> https://www.formfox.com/PrivacyPolicy</a>. Text HELP to 52141 for help. Text STOP to 52141 to stop receiving texts. *** </em>\r\n          </Modal.Footer>\r\n        </InvitationPage> }\r\n        { showTooManyAttempts && <InvitationPage title=\"Too Many Attempts to Accept Invitation\">\r\n          <Modal.Body>\r\n            <Row><Col><p>Our Apologies!</p></Col></Row>\r\n            <Row><Col><p>For security purposes, we limit the number of times an invitation may be accepted.</p></Col></Row>\r\n            <Row><Col><p>In order to continue, your administrator will need to re-invite you. We have flagged your invitation to your administrator's attention.</p></Col></Row>\r\n            <Row><Col><p>To expedite this process, please contact your administrator for assistance.</p></Col></Row>\r\n          </Modal.Body>\r\n        </InvitationPage> }\r\n        { this.state.showValidatePIN && <ValidatePIN currentURL={this.props.currentURL} outboxAN={this.currentOutboxAN} onSuccess={(pin: string) => this.props.onSuccess(pin, this.currentOutboxAN)} onBack={() => this.setState({ showValidatePIN: false, showContactForm: true }) } /> }\r\n      </>\r\n    )\r\n  }\r\n}\r\n","import React from \"react\"\r\nimport { Modal, Button, Col, Row } from \"react-bootstrap\"\r\n\r\ninterface SetupCompleteProps {\r\n  title: string\r\n  url: string\r\n  onNext: () => void\r\n}\r\n\r\nexport default class SetupComplete extends React.PureComponent<SetupCompleteProps> {\r\n  render() {\r\n    return (\r\n      <Modal.Dialog size=\"xl\">\r\n        <Modal.Header>\r\n          <Modal.Title className=\"text-uppercase\">{this.props.title}</Modal.Title>\r\n        </Modal.Header>\r\n        <Modal.Body>\r\n          <Row><Col><p>Your account is activated and ready for use.</p></Col></Row>\r\n        </Modal.Body>\r\n        <Modal.Footer>\r\n          <Button onClick={this.props.onNext} className=\"px-4\">Finish</Button>\r\n        </Modal.Footer>\r\n      </Modal.Dialog>\r\n    )\r\n  }\r\n}\r\n","export default \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAABh0RVh0U29mdHdhcmUAQWRvYmUgRmlyZXdvcmtzT7MfTgAAABZ0RVh0Q3JlYXRpb24gVGltZQAwOC8yNS8wN/5In/YAAAKsSURBVDiNbZM9aBNhGMd/uSaX3CXpncVaozUYo1X8wl5EUYuKoA4FcalLQR1cpOAoiA4uDq7OUnBwqQjiJG6KFNE2+IGgxGjV9COtsXe59O6S+uYcYq4d+p8e/jz/5/m98Lwh3/cJXXhEW1fO7Br4Xrbv/Zi3d30v2wpApifpprsTn7dt7Lx2//nnVwD+2BAAodUDju9J5T9MVfpz27s53d/LjpSGDxRmLJ7lfzFRWCCXXf/u5afZ/vaQEENjAGztSToJRVZuXDDo0VXW0nRliVsPXtPREXKnyrYKtAYc2rlxsr4sjOtDOdRoBICnE9NB8NzBzUFtLtW5OzZBpyrn33yZy0mDh7MDk4WycfH0XpabEpYrsFwBwOjlLI/flgPPcgUhKczwqd1MFsrG4OHsQPjbrDW6Z2s3sizz4tNcsOn2+SwA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Jd9fkAAAAASUVORK5CYII=\"","import { ObservableFromFetch } from \"../ObservableFromFetch\"\r\nimport PasswordSetModel from \"./Model/PasswordSetModel\"\r\n\r\nexport default function SetPassword(password: PasswordSetModel) {\r\n    const requestBody = JSON.stringify(password)\r\n    return ObservableFromFetch<string>(\"FFOrderClinicStatus/SetPassword\", requestBody, 'put')\r\n}","import * as React from \"react\"\r\nimport \"../../assets/scss/App.scss\"\r\nimport { InvitationType } from \"../../api/Invitation/Model/InvitationType\"\r\nimport ValidateIdentity from \"./ValidateIdentity\"\r\nimport SetupComplete from \"./SetupComplete\"\r\nimport SetPassword from \"./SetPassword\"\r\nimport { toast } from \"react-toastify\"\r\nimport { RouteComponentProps } from \"react-router\"\r\nimport { Subscription } from \"rxjs\"\r\nimport GetInvitationStatus from \"../../api/Invitation/GetInvitationStatus\"\r\nimport InvitationStatusGridRecord from \"../../api/InvitationStatus/Model/InvitationStatusGridRecord\"\r\nimport CheckInactiveURL from \"../../api/Invitation/CheckInactiveURL\"\r\nimport { AppPageWrapper } from \"../NavMenu/AppPageWrapper\"\r\nimport { InvitationStatus } from \"../../api/Invitation/Model/InvitationStatus\"\r\nimport { Home } from \"../../config/Routes\"\r\n\r\nenum InvitationStep {\r\n  default,\r\n  validateIdentity,\r\n  setupComplete,\r\n  setPassword\r\n}\r\n\r\ninterface InvitationProcessProps extends RouteComponentProps {\r\n  linkId?: string\r\n  show?: boolean\r\n  onInvitationSetupClose?: (hasUpdates: boolean) => void\r\n}\r\n\r\ninterface InvitationProcessState {\r\n  data?: InvitationStatusGridRecord\r\n  invitationType?: InvitationType\r\n  invitationStep?: InvitationStep\r\n}\r\n\r\nexport default class InvitationProcess extends React.PureComponent<InvitationProcessProps, InvitationProcessState> {\r\n  subscription?: Subscription\r\n  checkInactiveSubscription?: Subscription\r\n  currentURL: string = window.location.href\r\n  currentPin: string = \"\"\r\n  currentOutboxAN?: number\r\n  state: InvitationProcessState = { }\r\n\r\n  componentDidMount() {\r\n    this.checkInactiveSubscription = CheckInactiveURL(this.currentURL).subscribe(\r\n      inactive => inactive ? this.navigateNotFound() : this.getInvitationStatus(),\r\n      error => toast.error(error)\r\n    )\r\n  }\r\n\r\n  componentWillUnmount() {\r\n    this.subscription && this.subscription.unsubscribe()\r\n  }\r\n\r\n  navigateNotFound() {\r\n    // TODO: this.router.navigate(['/page-not-found']);\r\n    toast.error(\"Page not found\")\r\n  }\r\n\r\n  getInvitationStatus() {\r\n    this.subscription = GetInvitationStatus(this.currentURL).subscribe(\r\n      data => {\r\n        if (!this.currentOutboxAN) {\r\n          this.currentOutboxAN = this.state.data?.OutboxAN\r\n        }\r\n        // if (data.Status === InvitationStatus.COMPLETED || (data.Status === InvitationStatus.USER_CONFIGURED && data.IsUser)) {\r\n        //   this.goToLogin()\r\n        //   return\r\n        // }\r\n        this.setState({\r\n          data: data,\r\n          invitationType: this.mapInvitationType(data),\r\n          invitationStep: this.mapStep(data)\r\n        })\r\n      },\r\n      error => toast.error(error)\r\n    )\r\n  }\r\n\r\n  mapInvitationType(status: InvitationStatusGridRecord): InvitationType {\r\n    if (status.IsClinic) {\r\n      return InvitationType.Portal\r\n    }\r\n    if (status.IsClient) {\r\n      return InvitationType.Company\r\n    }\r\n    if (status.IsUser) {\r\n      return InvitationType.User\r\n    }\r\n    if (status.IsLocation) {\r\n      return InvitationType.Location\r\n    }\r\n    if (status.IsConfigurePassword) {\r\n      return InvitationType.ConfigurePassword\r\n    }\r\n    return InvitationType.Unknown\r\n  }\r\n\r\n  mapStep(status: InvitationStatusGridRecord): InvitationStep {\r\n    switch (status.Status) {\r\n      case InvitationStatus.INVITATION_REQUESTED:\r\n      case InvitationStatus.INVITATION_STILL_IN_PROCESS:\r\n      case InvitationStatus.INVITATION_IN_USE:\r\n      case InvitationStatus.TOO_MANY_ATTEMPT:\r\n      case InvitationStatus.STARTED:\r\n        return this.currentPin.length ? InvitationStep.setPassword : InvitationStep.validateIdentity\r\n      case InvitationStatus.PASSWORD_SET:\r\n      case InvitationStatus.CLINIC_CONFIGURED:\r\n      case InvitationStatus.COMPLETED:\r\n        return InvitationStep.setupComplete\r\n      default:\r\n        return InvitationStep.validateIdentity\r\n    }\r\n  }\r\n\r\n  handleNext() {\r\n    switch (this.state.invitationType) {\r\n      case InvitationType.Portal:\r\n      case InvitationType.Company:\r\n      case InvitationType.Location:\r\n      case InvitationType.User: this.handleNextUser(); break\r\n      case InvitationType.ConfigurePassword: this.handleNextConfigurePassword(); break\r\n    }\r\n  }\r\n\r\n  handleNextConfigurePassword() {\r\n    switch (this.state.invitationStep) {\r\n      case InvitationStep.validateIdentity: this.setState({ invitationStep: InvitationStep.setPassword }); break\r\n      case InvitationStep.setPassword: this.goToLogin(); break\r\n    }\r\n  }\r\n\r\n  handleNextUser() {\r\n    switch (this.state.invitationStep) {\r\n      case InvitationStep.validateIdentity: this.setState({ invitationStep: InvitationStep.setPassword }); break\r\n      case InvitationStep.setPassword: this.setState({ invitationStep: InvitationStep.setupComplete }); break\r\n      case InvitationStep.setupComplete: this.goToLogin(); break\r\n    }\r\n  }\r\n\r\n  goToLogin = () => (this.props as RouteComponentProps).history.push(Home)\r\n\r\n  setupCompleteTitle() {\r\n    switch (this.state.invitationType) {\r\n      case InvitationType.Portal: return \"Portal\"\r\n      case InvitationType.Company: return \"Company\"\r\n      case InvitationType.User: return \"User\"\r\n    }\r\n    return \"\"\r\n  }\r\n\r\n  render() {\r\n    if (!this.props.show || !this.state.data) {\r\n      return <></>\r\n    }\r\n    const { invitationStep } = this.state\r\n    const userName = this.state.data.UserName\r\n\r\n    const url = `${window.location.hostname}${window.location.port ? `:${window.location.port}` : \"\"}${window.location.pathname}#/workforce-login`\r\n\r\n\r\n    return (<AppPageWrapper>\r\n      { invitationStep === InvitationStep.validateIdentity && <ValidateIdentity\r\n        currentURL={this.currentURL}\r\n        data={this.state.data}\r\n        status={this.state.data.Status}\r\n        userPhoneNumber={this.state.data.ContactDetail}\r\n        userEmail={this.state.data.UserName}\r\n        onSuccess={(pin: string, outboxAN: number) => { this.currentPin = pin; this.currentOutboxAN = outboxAN; this.handleNext() }} />}\r\n      { invitationStep === InvitationStep.setPassword && this.currentOutboxAN &&\r\n        <SetPassword userName={userName} PIN={this.currentPin} OutboxAN={this.currentOutboxAN} onSave={() => this.handleNext()} />}\r\n      { invitationStep === InvitationStep.setupComplete && <SetupComplete onNext={() => this.handleNext()} url={url} title={`${this.setupCompleteTitle()} Setup`} />}\r\n    </AppPageWrapper>)\r\n  }\r\n\r\n  static defaultProps = {\r\n    show: true\r\n  }\r\n}\r\n","import * as React from \"react\"\r\nimport { Container, Modal, Form, Image, Row, Col, Table, InputGroup } from \"react-bootstrap\"\r\nimport { toast } from \"react-toastify\"\r\nimport { Subscription } from \"rxjs\"\r\nimport ActionButton from \"../ActionButton\"\r\nimport CalculatePasswordScore, { PasswordScore, ScoreStatus } from \"./CalculatePasswordScore\"\r\nimport passwordStatus_Exceed from \"../../assets/images/img_status_exceed.png\"\r\nimport passwordStatus_Pass from \"../../assets/images/img_status_pass.png\"\r\nimport passwordStatus_Warn from \"../../assets/images/img_status_warn.png\"\r\nimport passwordStatus_Fail from \"../../assets/images/img_status_fail.png\"\r\nimport \"../../assets/scss/App.scss\"\r\nimport \"../../assets/scss/SetPassword.scss\"\r\nimport PasswordSetModel from \"../../api/Invitation/Model/PasswordSetModel\"\r\nimport PasswordSet from \"../../api/Invitation/PasswordSet\"\r\nimport Checkbox from \"../Checkbox\"\r\nimport { APIError } from \"../../api/ObservableFromFetch\"\r\n\r\ninterface SetPasswordProps {\r\n  PIN: string\r\n  userName: string\r\n  OutboxAN: number\r\n  onSave: (password: string) => void\r\n}\r\n\r\ninterface SetPasswordState {\r\n  saving: boolean\r\n  password: string\r\n  passwordScore?: PasswordScore\r\n  showPassword: boolean\r\n}\r\n\r\nexport default class SetPassword extends React.PureComponent<SetPasswordProps, SetPasswordState> {\r\n  state: SetPasswordState = {\r\n    saving: false,\r\n    password: \"\",\r\n    passwordScore: CalculatePasswordScore(\"\"),\r\n    showPassword: false\r\n  }\r\n  statusImages: { [key in keyof typeof ScoreStatus]: string } = {\r\n    [ScoreStatus.exceed]: passwordStatus_Exceed,\r\n    [ScoreStatus.pass]: passwordStatus_Pass,\r\n    [ScoreStatus.warn]: passwordStatus_Warn,\r\n    [ScoreStatus.fail]: passwordStatus_Fail\r\n  }\r\n\r\n  saveSubscription?: Subscription\r\n\r\n  componentWillUnmount() {\r\n    this.saveSubscription && this.saveSubscription.unsubscribe()\r\n  }\r\n\r\n  isValid = () => this.state.password.trim().length > 8\r\n\r\n  handlePasswordChange = (e: React.ChangeEvent<HTMLInputElement>) => {\r\n    const password = e.target.value\r\n    this.setState({ password: password, passwordScore: CalculatePasswordScore(password) })\r\n  }\r\n\r\n  handleSetPasswordClick = () => {\r\n    this.setState({ saving: true })\r\n    const password: PasswordSetModel = {\r\n      OutboxAN: this.props.OutboxAN,\r\n      Password: this.state.password,\r\n      UserName: this.props.userName,\r\n      PIN: this.props.PIN,\r\n      Link: window.location.href\r\n    }\r\n    //TODO check if we need to call haveIbeenPwnedURL: string = 'https://api.pwnedpasswords.com/range/';\r\n    this.saveSubscription = PasswordSet(password).subscribe(\r\n      data => {\r\n        this.setState({ saving: false })\r\n        toast.success(data)\r\n        this.setState({ password: \"\", showPassword: false })\r\n        this.props.onSave(password.Password)\r\n      },\r\n      error => {\r\n        this.setState({ saving: false })\r\n        this.handleAPIError(error)\r\n      }\r\n    )\r\n  }\r\n\r\n  handleAPIError = (error: Error | APIError) => {\r\n    error && toast.error((error as APIError)?.errorData?.message || error.message)\r\n  }\r\n\r\n  passwordComplexity = (score: number): string => {\r\n    if (score < 20) {\r\n      return \"Very Weak\"\r\n    } else if (score < 40) {\r\n      return \"Weak\"\r\n    } else if (score < 60) {\r\n      return \"Good\"\r\n    } else if (score < 80) {\r\n      return \"Strong\"\r\n    } else {\r\n      return \"Very Strong\"\r\n    }\r\n  }\r\n\r\n  statusImage = (status: ScoreStatus | undefined) => status && <Image src={this.statusImages[status]} />\r\n  scoreValue = (score: number | undefined, scoreSign: string) => (score || 0) > 0 ? `${scoreSign}${score}` : `${score}`\r\n\r\n  render() {\r\n    const { passwordScore, showPassword } = this.state\r\n\r\n    const requirements = <Table bordered className=\"requirements\">\r\n      <thead><tr><th>Minimum Requirements</th></tr></thead>\r\n      <tbody><tr><td>\r\n        <ul className=\"m-0\">\r\n          <li>Minimum 8 characters in length</li>\r\n          <li>Contains 3/4 of the following items:<br />\r\n            - Uppercase Letters<br />\r\n            - Lowercase Letters<br />\r\n            - Numbers<br />\r\n            - Symbols<br />\r\n          </li>\r\n        </ul>\r\n      </td></tr></tbody>\r\n    </Table>\r\n\r\n    const totalScore = Math.max(0, Math.min(100, passwordScore?.calculatedScore || 0))\r\n    return (\r\n      <Modal backdrop=\"static\" size=\"xl\" show>\r\n        <Modal.Header>\r\n          <Modal.Title>SET PASSWORD</Modal.Title>\r\n        </Modal.Header>\r\n        <Modal.Body>\r\n          <Container fluid className=\"set-password\">\r\n            <Row>\r\n              <Col sm={6}>\r\n                <div>Your User ID is:</div>\r\n                <div className=\"vertical-center pl-4\">{this.props.userName}</div>\r\n              </Col>\r\n              <Col sm={6} className=\"d-none d-xl-block\">{requirements}</Col>\r\n            </Row>\r\n            <Row>\r\n              <Col className=\"mb-4\">\r\n                <span className=\"float-left\">Please set a password for this account:</span>\r\n                <span className=\"float-right\">Characters: {this.state.password.length}/32</span>\r\n                <InputGroup>\r\n                  <Form.Control type={showPassword ? \"text\" : \"password\"} onChange={this.handlePasswordChange} maxLength={32} />\r\n                  <Checkbox className=\"show-password\" id=\"show-password\" label=\"Show Password\" checked={showPassword} onChange={(e: React.ChangeEvent<HTMLInputElement>) => this.setState({ showPassword: e.target.checked })} value=\"1\" />\r\n                </InputGroup>\r\n              </Col>\r\n            </Row>\r\n            <Row>\r\n              <Col xl={12}>\r\n                <Table bordered className=\"score-total\">\r\n                  <tbody>\r\n                    <tr>\r\n                      <td>Score:</td>\r\n                      <td>\r\n                        <div className=\"score-background\" style={{ backgroundPositionX: totalScore + \"%\" }}>{totalScore}%</div>\r\n                      </td>\r\n                    </tr>\r\n                    <tr>\r\n                      <td>Complexity:</td>\r\n                      <td>{this.passwordComplexity(this.state.passwordScore?.calculatedScore || 0)}</td>\r\n                    </tr>\r\n                  </tbody>\r\n                </Table>\r\n              </Col>\r\n            </Row>\r\n            <Row className=\"d-block d-xl-none\"><Col>{requirements}</Col></Row>\r\n          </Container >\r\n        </Modal.Body >\r\n        <Modal.Footer>\r\n          <ActionButton variant=\"primary\" disabled={!this.isValid()} onClick={this.handleSetPasswordClick} spin={this.state.saving} disableOnSpin>Set Password</ActionButton>\r\n        </Modal.Footer>\r\n      </Modal>\r\n    )\r\n  }\r\n}\r\n","import { ObservableFromFetch } from \"../ObservableFromFetch\"\r\n\r\nexport default function CheckInactiveURL(url: string) {\r\n    const requestBody = JSON.stringify({ url: url })\r\n    return ObservableFromFetch<boolean>(\"FFOrderClinicFileMaintenance/InActivateUrl\", requestBody)\r\n}\r\n","import {Component} from \"react\";\r\nimport {Button, Jumbotron} from \"react-bootstrap\";\r\nimport {Redirect} from \"react-router-dom\";\r\nimport {Home} from \"../../config/Routes\";\r\n\r\ninterface InvalidPasswordResetState{\r\n    goHome: boolean\r\n}\r\nexport default class InvalidPasswordReset extends Component<{}, InvalidPasswordResetState> {\r\n\r\n    state: InvalidPasswordResetState = {\r\n        goHome: false\r\n    }\r\n\r\n    render() {\r\n        return <Jumbotron className=\"text-center\">\r\n                <h1>\r\n                    Unknown Or Expired Link! Contact the site administrator if you feel this is an error.\r\n                </h1>\r\n                <Button onClick={() => {this.setState({goHome: true})}}>\r\n                    Return Home\r\n                </Button>\r\n                {this.state.goHome && <Redirect to={Home} /> }\r\n        </Jumbotron>\r\n    }\r\n}\r\n","import ApiResponse from \"../ApiResponse\";\r\nimport {ApiAuthRequestInterface, BuildAuthRequestFromAppState} from \"../../authentication/BuildAuthRequestInterface\";\r\nimport {ApiErrorReturn} from \"../ApiError\";\r\nimport ApiUrl, {PortalSource} from \"../ApiUrl\";\r\n\r\ntype ChangeUserPasswordResponse = ApiResponse<string>;\r\n\r\nconst buildFetchRequest = (body: string, apiAuth: ApiAuthRequestInterface): RequestInit => {\r\n    return {\r\n        method: 'post',\r\n        headers: new Headers({\r\n            'auth_token': apiAuth?.auth_token,\r\n            'IsMarketPlace': apiAuth.IsMarketPlace,\r\n            'Agent': apiAuth.Agent,\r\n            'api_version' :apiAuth.api_version,\r\n            'Accept': 'application/json',\r\n            'Content-Type': 'application/json',\r\n        }),\r\n        body,\r\n    }}\r\n// public string Source { get; set; }\r\n// public string UserName { get; set; }\r\n\r\n// public string Phone { get; set; }\r\n\r\ntype TokenToRefresh = 'RequestEmail' | 'RequestEmailForgotPassword' | 'RequestVoicePin' | 'RequestTextPin';\r\ntype BooleanResponse = 'True' | 'False';\r\ninterface TokenForRefreshType {\r\n    RequestEmail: BooleanResponse\r\n    Forgot: BooleanResponse\r\n    RequestVoice: BooleanResponse\r\n    RequestText: BooleanResponse\r\n}\r\nconst defaultTokens: TokenForRefreshType = {\r\n    RequestEmail: 'False',\r\n    Forgot: 'False',\r\n    RequestVoice: 'False',\r\n    RequestText: 'False',\r\n}\r\nfunction GetRefreshTypeForApi(RefreshType: TokenToRefresh){\r\n    switch(RefreshType){\r\n        case \"RequestEmail\":{\r\n            return {...defaultTokens, RequestEmail: 'True'};\r\n        }\r\n        case \"RequestVoicePin\":{\r\n            return {...defaultTokens, RequestVoice: 'True'};\r\n        }\r\n        case \"RequestTextPin\":{\r\n            return {...defaultTokens, RequestText: 'True'};\r\n        }\r\n        default:{\r\n            return {...defaultTokens, RequestEmail: 'True'};\r\n        }\r\n    }\r\n}\r\n\r\n\r\nexport async function UpdateUserPasswordToken(RefreshType: TokenToRefresh, UserName: string, Phone: string, errorHandling: ApiErrorReturn): Promise<ChangeUserPasswordResponse | null>{\r\n    const apiAuth = BuildAuthRequestFromAppState(undefined);\r\n    const Source = PortalSource();\r\n    const body = JSON.stringify({\r\n        ...GetRefreshTypeForApi(RefreshType),\r\n        Source,\r\n        Phone,\r\n        UserName\r\n    });\r\n    try {\r\n        const response = await fetch(ApiUrl() + \"FFOrderAccount/UpdateUserPasswordToken\", buildFetchRequest(body, apiAuth));\r\n        return await response.json() as ChangeUserPasswordResponse;\r\n    }catch(error: unknown){\r\n        errorHandling(error);\r\n        return null;\r\n    }\r\n}\r\n","import {Component} from \"react\";\r\nimport {\r\n    Button,\r\n    Card,\r\n    Col, DropdownButton,\r\n    Dropdown,\r\n    Form,\r\n    Row\r\n} from \"react-bootstrap\";\r\nimport {UpdateUserPasswordToken} from \"../../api/Secuirty/UpdatedUserPasswordToken\";\r\nimport {toast} from \"react-toastify\";\r\n\r\nexport interface RequestPhonePinProps{\r\n    requestedPhone?: ()=> void;\r\n    resend?: boolean\r\n    skinny?: boolean\r\n    userName?: string\r\n}\r\ninterface RequestPhonePinState{\r\n    requestingPhone: boolean\r\n    requestText: boolean\r\n}\r\nexport default class RequestPhonePin extends Component<RequestPhonePinProps, RequestPhonePinState> {\r\n\r\n    state: RequestPhonePinState ={\r\n        requestingPhone: false,\r\n        requestText: true\r\n    }\r\n\r\n    requestNewPhonePin = () => {\r\n        if(this.state.requestingPhone){\r\n            this.requestNewPhonePinVoice();\r\n        }else{\r\n            this.requestNewPhonePinText();\r\n        }\r\n    }\r\n    requestNewPhonePinVoice = () => {\r\n        UpdateUserPasswordToken('RequestVoicePin',this.props.userName || '', '', () => {}).then(()=> {});\r\n        toast.success(\"Pin Requested.\")\r\n        if(this.props.requestedPhone) {\r\n            this.props.requestedPhone();\r\n        }\r\n    }\r\n    requestNewPhonePinText = () => {\r\n        UpdateUserPasswordToken('RequestTextPin',this.props.userName|| '', '', () => {}).then(()=> {});\r\n        toast.success(\"Pin Requested.\")\r\n        if(this.props.requestedPhone) {\r\n            this.props.requestedPhone();\r\n        }\r\n    }\r\n\r\n    render() {\r\n        return <>{this.props.skinny ?\r\n            <>\r\n                <DropdownButton id=\"dropdown-new-pin-button\" title=\"Request New Pin\">\r\n                    <Dropdown.Item onClick={()=>{this.requestNewPhonePinText()}}>{this.props.resend ? \"Resend Pin As Text\": \"Send Pin As Text\" }</Dropdown.Item>\r\n                    <Dropdown.Item onClick={()=>{this.requestNewPhonePinVoice()}}>{this.props.resend ? \"Resend Pin As Voice\": \"Send Pin As Voice\" }</Dropdown.Item>\r\n                </DropdownButton>\r\n            </>\r\n            : <>\r\n                <Row>\r\n                    <Col md={{span: 6, offset: 3}}>\r\n                        <Card>\r\n                            <Card.Header className=\"text-center\">\r\n                                {this.props.resend ? \"Resend Pin\" : \"Change Password One Time Pin Communication\"}\r\n                            </Card.Header>\r\n                            <Card.Body>\r\n                                <Row>\r\n                                    <Col md={{span: 2, offset: 4}}>\r\n                                        <Form.Check onChange={(e)=> {this.setState({requestingPhone: e.target.checked})}}\r\n                                                    name=\"pin-request-type\"\r\n                                                    value='voice' type='radio'\r\n                                                    id='voice-pin-request'\r\n                                                    label='Voice Call Pin'/>\r\n                                    </Col>\r\n                                </Row>\r\n                                <Row>\r\n                                    <Col md={{span: 2, offset: 4}}>\r\n                                        <Form.Check onChange={(e)=> {this.setState({requestingPhone: e.target.checked})}}\r\n                                                    defaultChecked={true}\r\n                                                    name=\"pin-request-type\"\r\n                                                    value='text' type='radio'\r\n                                                    id='text-pin-request'\r\n                                                    label='Text Pin'/>\r\n                                    </Col>\r\n                                </Row>\r\n                            </Card.Body>\r\n                            <Card.Footer>\r\n                                <Button onClick={(e) => {\r\n                                    e.preventDefault();\r\n                                    this.requestNewPhonePin();\r\n                                }} block={true} variant='primary'>\r\n                                    Send Pin\r\n                                </Button>\r\n                            </Card.Footer>\r\n                        </Card>\r\n                    </Col>\r\n                </Row>\r\n            </>\r\n        }\r\n        </>\r\n    }\r\n}\r\n","import {Component} from \"react\";\r\nimport {Button, Modal} from \"react-bootstrap\";\r\n\r\ninterface NoPinState{\r\n    show: boolean\r\n}\r\nexport default class NoPin extends Component<{}, NoPinState> {\r\n    state: NoPinState = {\r\n        show: false,\r\n    }\r\n\r\n    render() {\r\n        return <>\r\n            <Button variant=\"link\" onClick={() => {this.setState({show:true})}}>\r\n                I didn't receive my PIN!\r\n            </Button>\r\n\r\n            <Modal show={this.state.show} onHide={() => {this.setState({show:false})}}>\r\n                <Modal.Header closeButton>\r\n                    <Modal.Title>Our Apologies!</Modal.Title>\r\n                </Modal.Header>\r\n                <Modal.Body>\r\n                    <p>\r\n                        For security purposes, we need to deliver your PIN to the phone number created when you were\r\n                        invited.\r\n                    </p>\r\n                    <p>\r\n                        If you believe the phone number set for your invitation is incorrect, or you are unable to\r\n                        receive a PIN at that number, please contact your administrator for assistance.\r\n                    </p>\r\n                </Modal.Body>\r\n                <Modal.Footer>\r\n                    <Button variant=\"secondary\" onClick={() => {this.setState({show:false})}}>\r\n                        Close\r\n                    </Button>\r\n                </Modal.Footer>\r\n            </Modal>\r\n        </>\r\n    }\r\n}\r\n","import {Component} from \"react\";\r\nimport RequestPhonePin from \"./RequestPhonePin\";\r\nimport {Button, Card, FormText, Form} from \"react-bootstrap\";\r\nimport NoPin from \"./NoPin\";\r\nimport {Home} from \"../../config/Routes\";\r\nimport {Redirect} from \"react-router-dom\";\r\nimport {toast} from \"react-toastify\";\r\n\r\nexport interface EnterPhonePinProps {\r\n    pin: string\r\n    changePin: (pin: string) => void\r\n    submitPin: () => void\r\n    userName?: string\r\n}\r\nexport interface EnterPhonePinState {\r\n    goHome: boolean\r\n}\r\nexport default class EnterPhonePin extends Component<EnterPhonePinProps, EnterPhonePinState> {\r\n\r\n    state: EnterPhonePinState ={\r\n        goHome: false\r\n    }\r\n\r\n    doesPinLookValid = (): boolean => {\r\n        if(this.props.pin && this.props.pin.length === 6){\r\n            const pinNumberFound = parseInt(this.props.pin);\r\n            return !isNaN(pinNumberFound);\r\n        }\r\n        return false;\r\n    }\r\n\r\n    submitPin = () => {\r\n        if(this.doesPinLookValid()){\r\n            this.props.submitPin();\r\n        }else{\r\n            toast.error(\"PIN Appears To Be Invalid!\");\r\n        }\r\n    }\r\n\r\n    render() {\r\n        return <>\r\n            <div className=\"col d-flex justify-content-center\">\r\n                {this.state.goHome && <Redirect to={Home} /> }\r\n                <Card style={{ width: '60rem' }}>\r\n                    <Card.Header>ENTER COMMUNICATED PIN <div className=\"float-right\"><NoPin /></div></Card.Header>\r\n                    <Form onSubmit={(e)=>{e.preventDefault();this.submitPin()}}>\r\n                        <Card.Body>\r\n                            <FormText>\r\n                                <Form.Group className=\"mb-3\" controlId=\"frmBasicPin\">\r\n                                    <Form.Control autoFocus={true}  value={this.props.pin}\r\n                                                  onChange={(e) => {this.props.changePin(e.target.value)}}\r\n                                                  type=\"text\" placeholder=\"Numeric Pin\" />\r\n                                </Form.Group>\r\n                            </FormText>\r\n                            <RequestPhonePin resend={true} skinny={true} userName={this.props.userName}/>\r\n                        </Card.Body>\r\n                        <Card.Footer>\r\n                            <Button className=\"m-2\" variant='outline-secondary' onClick={() => {this.setState({goHome: true})}}>\r\n                                Return Home\r\n                            </Button>\r\n                            <Button type=\"submit\" className=\"float-right\" variant='primary'>\r\n                                Submit Pin\r\n                            </Button>\r\n                        </Card.Footer>\r\n                    </Form>\r\n                </Card>\r\n            </div>\r\n        </>\r\n    }\r\n}\r\n","\r\nexport const PassScoreStatus = 'pass';\r\nexport const FailScoreStatus = 'fail';\r\nexport const WarnScoreStatus = 'warn';\r\nexport const ExceedScoreStatus = 'exceed';\r\nexport type ScoreStatus = 'exceed' | 'pass' | 'warn' | 'fail';\r\n\r\ntype PasswordRequirementAdditionNames = 'NumberOfCharacters'\r\n    | 'UppercaseLetters' | 'LowercaseLetters'| 'Numbers'| 'Symbols'\r\n    | 'MiddleNumbersOrSymbols' | 'Requirements';\r\ntype PasswordRequirementDeductionNames = 'LettersOnly' | 'NumbersOnly' | 'RepeatCharacters'\r\n    | 'ConsecutiveUppercaseLetters' | 'ConsecutiveLowercaseLetters' | 'ConsecutiveNumbers'\r\n    | 'SequentialLetters' | 'SequentialNumbers' | 'SequentialSymbols' ;\r\nexport type PasswordRequirementNames = PasswordRequirementAdditionNames | PasswordRequirementDeductionNames;\r\n\r\nexport interface PasswordScore{\r\n    calculatedAsANumber: number\r\n    requirements: {[key in PasswordRequirementNames]: PasswordRequirement}\r\n}\r\nexport interface PasswordRequirement{\r\n    name: PasswordRequirementNames\r\n    status: ScoreStatus\r\n    count: number\r\n    score: number\r\n}\r\nconst DefaultFailRequirement: PasswordRequirement = {\r\n    name: 'Symbols',\r\n    status: FailScoreStatus,\r\n    count: 0,\r\n    score: 0,\r\n}\r\nconst DefaultPassedRequirement: PasswordRequirement = {\r\n    name: 'Symbols',\r\n    status: PassScoreStatus,\r\n    count: 0,\r\n    score: 0,\r\n}\r\n\r\nexport const DefaultPasswordScore: PasswordScore= {\r\n    calculatedAsANumber: 0,\r\n    requirements:{\r\n        'NumberOfCharacters': {...DefaultFailRequirement, name:'NumberOfCharacters'},\r\n        'UppercaseLetters': {...DefaultFailRequirement, name:'UppercaseLetters'} ,\r\n        'LowercaseLetters': {...DefaultFailRequirement, name:'LowercaseLetters'},\r\n        'Numbers': {...DefaultFailRequirement, name:'Numbers'},\r\n        'Symbols': {...DefaultFailRequirement, name:'Symbols'},\r\n\r\n        'MiddleNumbersOrSymbols': {...DefaultFailRequirement, name:'MiddleNumbersOrSymbols'} ,\r\n        'Requirements': {...DefaultFailRequirement, name:'Requirements'},\r\n\r\n        'LettersOnly': {...DefaultPassedRequirement, name:'LettersOnly'} ,\r\n        'NumbersOnly': {...DefaultPassedRequirement, name:'NumbersOnly'} ,\r\n\r\n        'RepeatCharacters': {...DefaultPassedRequirement, name:'RepeatCharacters'},\r\n\r\n        'ConsecutiveUppercaseLetters': {...DefaultPassedRequirement, name:'ConsecutiveUppercaseLetters'},\r\n        'ConsecutiveLowercaseLetters': {...DefaultPassedRequirement, name:'ConsecutiveLowercaseLetters'},\r\n        'ConsecutiveNumbers': {...DefaultPassedRequirement, name:'ConsecutiveNumbers'},\r\n\r\n        'SequentialLetters': {...DefaultPassedRequirement, name:'SequentialLetters'},\r\n        'SequentialNumbers': {...DefaultPassedRequirement, name:'SequentialNumbers'} ,\r\n        'SequentialSymbols': {...DefaultPassedRequirement, name:'SequentialSymbols'},\r\n    }\r\n};\r\n\r\nconst passwordScoreMultipliers = {\r\n    SequentialLetters: 3,\r\n    SequentialNumber: 3,\r\n    SequentialSymbol: 3,\r\n    ConsecutiveNumbers: 2,\r\n    ConsecutiveUpperCaseLetters: 2,\r\n    ConsecutiveLowerCaseLetters: 2,\r\n    BaseLength: 4,\r\n    NumbersInPassword: 4,\r\n    SymbolsInPassword: 6,\r\n    IncrementalNumbers: 2,\r\n}\r\nconst allUpperCaseLettersRegex = /[A-Z]/g;\r\nconst allLowerCaseLettersRegex = /[a-z]/g;\r\nconst allNumbersRegex = /[0-9]/g;\r\nconst allSymbolsRegex = /[^a-zA-Z0-9_]/g;\r\n\r\ninterface CardinalityStateOfPasswordCharLookUp{\r\n    lastUpperCaseLetterCharValue: string\r\n    UpperCaseLetterCount: number\r\n    ConsecutiveUpperCaseLetterCount: number\r\n\r\n    lastLowerCaseLetterCharValue: string\r\n    ConsecutiveLowerCaseLetterCount: number\r\n    LowerCaseLetterCount: number\r\n\r\n    lastNumberCharValue: string\r\n    ConsecutiveNumberCount: number\r\n    numberCount: number\r\n\r\n    lastSymbolCharValue: string,\r\n    ConsecutiveSymbolCount: number\r\n    symbolCount: number\r\n\r\n    ConsecutiveCount: number\r\n    middleCharacterCount: number\r\n    repetitionIncrement: number\r\n    repetitionCharacter: number\r\n    passwordLength: number\r\n}\r\n\r\nfunction determineCardinalityOfPassword(password: string): CardinalityStateOfPasswordCharLookUp{\r\n    const cardinality: CardinalityStateOfPasswordCharLookUp = {\r\n        lastUpperCaseLetterCharValue: '',\r\n        lastLowerCaseLetterCharValue: '',\r\n        lastNumberCharValue: '',\r\n        lastSymbolCharValue: '',\r\n        ConsecutiveSymbolCount: 0,\r\n        UpperCaseLetterCount: 0,\r\n        ConsecutiveUpperCaseLetterCount:0,\r\n        ConsecutiveLowerCaseLetterCount: 0,\r\n        LowerCaseLetterCount: 0,\r\n        ConsecutiveNumberCount: 0,\r\n        ConsecutiveCount: 0,\r\n        middleCharacterCount: 0,\r\n        numberCount: 0,\r\n        symbolCount: 0,\r\n        repetitionIncrement: 0,\r\n        repetitionCharacter: 0,\r\n        passwordLength: password.length\r\n    }\r\n    // Loop through password to check for Symbol, Numeric, Lowercase and Uppercase pattern matches\r\n    const stringArrayOfPassword = password.replace(/\\s+/g, \"\").split(/\\s*/)\r\n\r\n    for (let indexOfCharValue = 0; indexOfCharValue < cardinality.passwordLength; indexOfCharValue++) {\r\n        if (stringArrayOfPassword[indexOfCharValue].match(allUpperCaseLettersRegex)) {\r\n            if (cardinality.lastUpperCaseLetterCharValue !== \"\") {\r\n                if ((parseInt(cardinality.lastUpperCaseLetterCharValue) + 1) === indexOfCharValue) {\r\n                    cardinality.ConsecutiveUpperCaseLetterCount++\r\n                    cardinality.ConsecutiveCount++\r\n                }\r\n            }\r\n            cardinality.lastUpperCaseLetterCharValue = String(indexOfCharValue)\r\n            cardinality.UpperCaseLetterCount++\r\n        }\r\n        else if (stringArrayOfPassword[indexOfCharValue].match(allLowerCaseLettersRegex)) {\r\n            if (cardinality.lastLowerCaseLetterCharValue !== \"\") {\r\n                if ((parseInt(cardinality.lastLowerCaseLetterCharValue) + 1) === indexOfCharValue) {\r\n                    cardinality.ConsecutiveLowerCaseLetterCount++\r\n                    cardinality.ConsecutiveCount++\r\n                }\r\n            }\r\n            cardinality.lastLowerCaseLetterCharValue  = String(indexOfCharValue)\r\n            cardinality.LowerCaseLetterCount ++\r\n        }\r\n        else if (stringArrayOfPassword[indexOfCharValue].match(allNumbersRegex)) {\r\n            if (indexOfCharValue > 0 && indexOfCharValue < (cardinality.passwordLength - 1)) {\r\n                cardinality.middleCharacterCount++\r\n            }\r\n            if (cardinality.lastNumberCharValue !== \"\") {\r\n                if ((parseInt(cardinality.lastNumberCharValue) + 1) === indexOfCharValue) {\r\n                    cardinality.ConsecutiveNumberCount++\r\n                    cardinality.ConsecutiveCount++\r\n                }\r\n            }\r\n            cardinality.lastNumberCharValue = String(indexOfCharValue)\r\n            cardinality.numberCount++\r\n        }\r\n        else if (stringArrayOfPassword[indexOfCharValue].match(allSymbolsRegex)) {\r\n            if (indexOfCharValue > 0 && indexOfCharValue < (cardinality.passwordLength - 1)) {\r\n                cardinality.middleCharacterCount++\r\n            }\r\n            if (cardinality.lastSymbolCharValue !== \"\") {\r\n                if ((parseInt(cardinality.lastSymbolCharValue) + 1) === indexOfCharValue) {\r\n                    cardinality.ConsecutiveSymbolCount++\r\n                    cardinality.ConsecutiveCount++\r\n                }\r\n            }\r\n            cardinality.lastSymbolCharValue = String(indexOfCharValue)\r\n            cardinality.symbolCount++\r\n        }\r\n\r\n\r\n        // Internal loop through password to check for repeat characters\r\n        let repeatCharacterExists = false\r\n        for (let repeatedChar = 0; repeatedChar < cardinality.passwordLength; repeatedChar++) {\r\n            if (stringArrayOfPassword[indexOfCharValue] === stringArrayOfPassword[repeatedChar] && indexOfCharValue !== repeatedChar) {\r\n                repeatCharacterExists = true\r\n\r\n                 // Calculate increment deduction based on proximity to identical characters\r\n                 // Deduction is incremented each time a new match is discovered\r\n                 // Deduction amount is based on total password length divided by the\r\n                 // difference of distance between currently selected match\r\n                cardinality.repetitionIncrement += Math.abs(cardinality.passwordLength / (repeatedChar - indexOfCharValue))\r\n            }\r\n        }\r\n        if (repeatCharacterExists) {\r\n            cardinality.repetitionCharacter++\r\n            const numberForUniqueCharacters = cardinality.passwordLength - cardinality.repetitionCharacter\r\n            cardinality.repetitionIncrement = (numberForUniqueCharacters) ?\r\n                Math.ceil(cardinality.repetitionIncrement / numberForUniqueCharacters) :\r\n                Math.ceil(numberForUniqueCharacters)\r\n        }\r\n    }\r\n    return cardinality;\r\n}\r\n\r\nfunction determinePasswordScoreFromPasswordCardinality(initialScore: number, cardinality: CardinalityStateOfPasswordCharLookUp): number{\r\n    const passwordLength = cardinality.passwordLength;\r\n    let currentScore = initialScore;\r\n\r\n    if (cardinality.UpperCaseLetterCount > 0 && cardinality.UpperCaseLetterCount < passwordLength) {\r\n        currentScore = parseInt(String(currentScore + ((passwordLength - cardinality.UpperCaseLetterCount) * 2)), 10)\r\n        // sAlphaUC = String((passwordLength - cardinality.UpperCaseLetterCount) * 2)\r\n    }\r\n    if (cardinality.LowerCaseLetterCount > 0 && cardinality.LowerCaseLetterCount < passwordLength) {\r\n        currentScore = parseInt(String(currentScore + ((passwordLength - cardinality.LowerCaseLetterCount) * 2)), 10)\r\n        // sAlphaLC = String((passwordLength - cardinality.LowerCaseLetterCount) * 2)\r\n    }\r\n    if (cardinality.numberCount > 0 && cardinality.numberCount < passwordLength) {\r\n        currentScore = parseInt(String(currentScore + (cardinality.numberCount * passwordScoreMultipliers.NumbersInPassword)), 10)\r\n        // sNumber = String(cardinality.numberCount * passwordScoreMultipliers.NumbersInPassword)\r\n    }\r\n    if (cardinality.symbolCount > 0) {\r\n        currentScore = parseInt(String(currentScore + (cardinality.symbolCount * passwordScoreMultipliers.SymbolsInPassword)), 10)\r\n        //sSymbol = String(cardinality.symbolCount * passwordScoreMultipliers.SymbolsInPassword)\r\n    }\r\n    if (cardinality.middleCharacterCount > 0) {\r\n        currentScore = parseInt(String(currentScore + (cardinality.middleCharacterCount * passwordScoreMultipliers.IncrementalNumbers)), 10)\r\n        //sMidChar = String(cardinality.middleCharacterCount * passwordScoreMultipliers.IncrementalNumbers)\r\n    }\r\n    return currentScore;\r\n}\r\n\r\nfunction reverseText(str: string): string{\r\n    return str.split(\"\").reverse().join(\"\")\r\n}\r\nfunction CheckForSequentialPatterns(pattern: string, sizeOfPatternToCheck: number, password: string): number{\r\n    // Check for sequential string patterns (forward and reverse)\r\n    let sequenceCount = 0;\r\n    for (let sequentialAlpha = 0; sequentialAlpha < sizeOfPatternToCheck; sequentialAlpha++) {\r\n        let sFwd = pattern.substring(sequentialAlpha, parseInt(String(sequentialAlpha + 3), 10))\r\n        let sRev = reverseText(sFwd)\r\n        if (password.toLowerCase().indexOf(sFwd) !== -1 ||\r\n            password.toLowerCase().indexOf(sRev) !== -1) {\r\n            sequenceCount++;\r\n        }\r\n    }\r\n    return sequenceCount;\r\n}\r\ninterface SequenceChecks{\r\n    AlphaSequenceDuplicates: number,\r\n    NumericSequenceDuplicates: number,\r\n    SequenceSymbolDuplicates: number,\r\n    SequenceCount: number\r\n}\r\nfunction RunSequenceChecks(password: string): SequenceChecks{\r\n    const result = {\r\n        AlphaSequenceDuplicates: 0,// nSeqAlpha++\r\n        NumericSequenceDuplicates:0,// nSeqNumber++\r\n        SequenceSymbolDuplicates: 0,// nSeqSymbol++\r\n        SequenceCount: 0,// nSeqChar++\r\n    }\r\n    const alphaSequence: string = \"abcdefghijklmnopqrstuvwxyz\"\r\n    result.AlphaSequenceDuplicates = CheckForSequentialPatterns(alphaSequence,23,password);\r\n    const numberSequence: string = \"01234567890\"\r\n    result.NumericSequenceDuplicates = CheckForSequentialPatterns(numberSequence,8,password);\r\n    let SequenceSymbols: string = \")!@#$%^&*()\"\r\n    result.SequenceSymbolDuplicates = CheckForSequentialPatterns(SequenceSymbols,8,password);\r\n\r\n    result.SequenceCount = result.SequenceSymbolDuplicates+  result.NumericSequenceDuplicates+ result.AlphaSequenceDuplicates;\r\n    return result;\r\n}\r\n\r\nconst decimalNumberRadix = 10;\r\nfunction checkIfPasswordMissesRequirements(cardinality: CardinalityStateOfPasswordCharLookUp, sequenceChecksResults:SequenceChecks, currentPasswordScore: number): PasswordScore{\r\n    const result: PasswordScore = JSON.parse(JSON.stringify(DefaultPasswordScore));\r\n    const passwordLength = cardinality.passwordLength;\r\n    let passwordScore = currentPasswordScore;\r\n    if ((cardinality.LowerCaseLetterCount > 0 || cardinality.UpperCaseLetterCount > 0) && cardinality.symbolCount === 0 && cardinality.numberCount === 0) {  // Only Letters\r\n        passwordScore = parseInt(String(passwordScore - passwordLength), decimalNumberRadix);\r\n        result.requirements[\"LettersOnly\"].status = FailScoreStatus;\r\n        result.requirements[\"LettersOnly\"].count = passwordLength;\r\n        result.requirements[\"LettersOnly\"].score = passwordLength;\r\n    }\r\n    if (cardinality.LowerCaseLetterCount === 0 && cardinality.UpperCaseLetterCount === 0 && cardinality.symbolCount === 0 && cardinality.numberCount > 0) {  // Only Numbers\r\n        passwordScore = parseInt(String(passwordScore - passwordLength), decimalNumberRadix);\r\n        result.requirements[\"NumbersOnly\"].status = FailScoreStatus;\r\n        result.requirements[\"NumbersOnly\"].count = passwordLength;\r\n        result.requirements[\"NumbersOnly\"].score = passwordLength;\r\n    }\r\n\r\n    if (cardinality.repetitionCharacter > 0) {  // Same character exists more than once\r\n        passwordScore = parseInt(String(passwordScore - cardinality.repetitionIncrement), decimalNumberRadix);\r\n        result.requirements[\"RepeatCharacters\"].status = PassScoreStatus;\r\n        result.requirements[\"RepeatCharacters\"].count = cardinality.repetitionCharacter;\r\n        result.requirements[\"RepeatCharacters\"].score = cardinality.repetitionIncrement;\r\n    }\r\n    if (cardinality.ConsecutiveUpperCaseLetterCount > 0) {  // Consecutive Uppercase Letters exist\r\n        result.requirements[\"ConsecutiveUppercaseLetters\"].score = cardinality.ConsecutiveUpperCaseLetterCount * passwordScoreMultipliers.ConsecutiveUpperCaseLetters;\r\n        passwordScore = parseInt(String(passwordScore - result.requirements[\"ConsecutiveUppercaseLetters\"].score), decimalNumberRadix);\r\n        result.requirements[\"ConsecutiveUppercaseLetters\"].count = cardinality.ConsecutiveUpperCaseLetterCount ;\r\n        result.requirements[\"ConsecutiveUppercaseLetters\"].status = FailScoreStatus;\r\n    }\r\n    if (cardinality.ConsecutiveLowerCaseLetterCount  > 0) {  // Consecutive Lowercase Letters exist\r\n        result.requirements[\"ConsecutiveLowercaseLetters\"].score = cardinality.ConsecutiveLowerCaseLetterCount * passwordScoreMultipliers.ConsecutiveLowerCaseLetters;\r\n        passwordScore = parseInt(String(passwordScore - result.requirements[\"ConsecutiveLowercaseLetters\"].score ), decimalNumberRadix);\r\n        result.requirements[\"ConsecutiveLowercaseLetters\"].count = cardinality.ConsecutiveLowerCaseLetterCount ;\r\n        result.requirements[\"ConsecutiveLowercaseLetters\"].status = FailScoreStatus;\r\n    }\r\n    if (cardinality.ConsecutiveNumberCount  > 0) {  // Consecutive Numbers exist\r\n        result.requirements[\"ConsecutiveNumbers\"].score = cardinality.ConsecutiveNumberCount * passwordScoreMultipliers.ConsecutiveNumbers;\r\n        passwordScore = parseInt(String(passwordScore -  result.requirements[\"ConsecutiveNumbers\"].score), decimalNumberRadix);\r\n        result.requirements[\"ConsecutiveNumbers\"].count = cardinality.ConsecutiveNumberCount ;\r\n        result.requirements[\"ConsecutiveNumbers\"].status = FailScoreStatus;\r\n    }\r\n\r\n    if (sequenceChecksResults.AlphaSequenceDuplicates > 0) {  // Sequential alpha strings exist (3 characters or more)\r\n        result.requirements[\"SequentialLetters\"].score = sequenceChecksResults.AlphaSequenceDuplicates * passwordScoreMultipliers.SequentialLetters;\r\n        passwordScore = parseInt(String(passwordScore -  result.requirements[\"SequentialLetters\"].score), decimalNumberRadix);\r\n        result.requirements[\"SequentialLetters\"].count = sequenceChecksResults.AlphaSequenceDuplicates ;\r\n        result.requirements[\"SequentialLetters\"].status = FailScoreStatus;\r\n    }\r\n\r\n    if (sequenceChecksResults.NumericSequenceDuplicates > 0) {  // Sequential numeric strings exist (3 characters or more)\r\n        result.requirements[\"SequentialNumbers\"].score = sequenceChecksResults.NumericSequenceDuplicates * passwordScoreMultipliers.SequentialNumber;\r\n        passwordScore = parseInt(String(passwordScore -  result.requirements[\"SequentialNumbers\"].score), decimalNumberRadix);\r\n        result.requirements[\"SequentialNumbers\"].count = sequenceChecksResults.NumericSequenceDuplicates ;\r\n        result.requirements[\"SequentialNumbers\"].status = FailScoreStatus;\r\n\r\n    }\r\n    if (sequenceChecksResults.SequenceSymbolDuplicates > 0) {  // Sequential symbol strings exist (3 characters or more)\r\n        result.requirements[\"SequentialSymbols\"].score = sequenceChecksResults.SequenceSymbolDuplicates * passwordScoreMultipliers.SequentialSymbol;\r\n        passwordScore = parseInt(String(passwordScore -  result.requirements[\"SequentialSymbols\"].score), decimalNumberRadix);\r\n        result.requirements[\"SequentialSymbols\"].count = sequenceChecksResults.SequenceSymbolDuplicates ;\r\n        result.requirements[\"SequentialSymbols\"].status = FailScoreStatus;\r\n\r\n    }\r\n    let requirementsMet = 0;\r\n    if (passwordLength === 8) {\r\n        result.requirements[\"NumberOfCharacters\"].status = PassScoreStatus;\r\n        result.requirements[\"NumberOfCharacters\"].count = passwordLength;\r\n        requirementsMet++;\r\n    }\r\n    else if (passwordLength > 8) {\r\n        result.requirements[\"NumberOfCharacters\"].status = ExceedScoreStatus;\r\n        result.requirements[\"NumberOfCharacters\"].count = passwordLength;\r\n        requirementsMet++;\r\n    }\r\n\r\n    if(cardinality.UpperCaseLetterCount > 0){\r\n        result.requirements[\"UppercaseLetters\"].status = PassScoreStatus;\r\n        result.requirements[\"UppercaseLetters\"].count = cardinality.UpperCaseLetterCount;\r\n        requirementsMet++;\r\n    }\r\n    if(cardinality.LowerCaseLetterCount > 0){\r\n        result.requirements[\"LowercaseLetters\"].status = PassScoreStatus;\r\n        result.requirements[\"LowercaseLetters\"].count = cardinality.LowerCaseLetterCount;\r\n        requirementsMet++;\r\n    }\r\n    if(cardinality.numberCount > 0){\r\n        result.requirements[\"Numbers\"].status = PassScoreStatus;\r\n        result.requirements[\"Numbers\"].count = cardinality.numberCount;\r\n        requirementsMet++;\r\n    }\r\n    if(cardinality.symbolCount > 0){\r\n        result.requirements[\"Symbols\"].status = PassScoreStatus;\r\n        result.requirements[\"Symbols\"].count = cardinality.symbolCount;\r\n        requirementsMet++;\r\n    }\r\n    if(cardinality.middleCharacterCount > 0){\r\n        result.requirements[\"MiddleNumbersOrSymbols\"].status = PassScoreStatus;\r\n        result.requirements[\"MiddleNumbersOrSymbols\"].count = cardinality.middleCharacterCount;\r\n        requirementsMet++;\r\n    }\r\n    const neededRequirements = passwordLength > 3 ? 3 : 4;\r\n    result.requirements[\"Requirements\"].count = requirementsMet;\r\n    const metRequirements = (requirementsMet > neededRequirements);\r\n    if(metRequirements){\r\n        passwordScore = parseInt(String(passwordScore + (requirementsMet * 2)), decimalNumberRadix)\r\n        result.requirements[\"Requirements\"].status = (neededRequirements+1) > requirementsMet ?\r\n            PassScoreStatus :\r\n            ExceedScoreStatus;\r\n    }\r\n    result.calculatedAsANumber = passwordScore;\r\n    return result;\r\n}\r\n\r\nexport default function CalculatePasswordScore(pwd: string): PasswordScore {\r\n    if (pwd) {\r\n        let passwordScoreAsNumber = parseInt(String(pwd.length * passwordScoreMultipliers.BaseLength), 10);\r\n        const passwordCardinality = determineCardinalityOfPassword(pwd);\r\n        const sequenceChecks = RunSequenceChecks(pwd);\r\n        passwordScoreAsNumber = determinePasswordScoreFromPasswordCardinality(passwordScoreAsNumber, passwordCardinality);\r\n        return checkIfPasswordMissesRequirements(passwordCardinality, sequenceChecks, passwordScoreAsNumber);\r\n    }\r\n    return JSON.parse(JSON.stringify(DefaultPasswordScore));\r\n}\r\n","import {ExceedScoreStatus, PassScoreStatus, ScoreStatus, WarnScoreStatus} from \"../CalculatePasswordScore\";\r\nimport passwordStatus_Exceed from \"../../../assets/images/img_status_exceed.png\"\r\nimport passwordStatus_Pass from \"../../../assets/images/img_status_pass.png\"\r\nimport passwordStatus_Warn from \"../../../assets/images/img_status_warn.png\"\r\nimport passwordStatus_Fail from \"../../../assets/images/img_status_fail.png\"\r\nimport {Image} from \"react-bootstrap\";\r\nimport * as React from \"react\";\r\n\r\nexport interface PasswordCheckStatusImageProps {status: ScoreStatus};\r\nexport default function PasswordCheckStatusImage(props: PasswordCheckStatusImageProps){\r\n    switch(props.status){\r\n        case PassScoreStatus:{\r\n            return <Image src={passwordStatus_Pass} />\r\n        }\r\n        case ExceedScoreStatus:{\r\n            return <Image src={passwordStatus_Exceed} />\r\n        }\r\n        case WarnScoreStatus:{\r\n            return <Image src={passwordStatus_Warn} />\r\n        }\r\n        default: {\r\n            return <Image src={passwordStatus_Fail} />\r\n        }\r\n    }\r\n}\r\n","import {Component} from \"react\";\r\nimport {Table} from \"react-bootstrap\";\r\nimport PasswordCheckStatusImage from \"./PasswordCheckStatusImage\";\r\nimport {PasswordRequirementNames, PasswordScore} from \"../CalculatePasswordScore\";\r\n\r\nexport interface PasswordDeductionsProps{\r\n    score: PasswordScore\r\n}\r\nexport default class PasswordDeductions extends Component<PasswordDeductionsProps> {\r\n\r\n    render() {\r\n        const showScore = (score: number | undefined) => (score || 0) > 0 ? `-${score}` : `${score}`;\r\n        const requirementsTableRow = (requirement: PasswordRequirementNames, otherRows: JSX.Element) => {\r\n            return <>\r\n                <td><PasswordCheckStatusImage status={this.props.score.requirements[requirement].status} /></td>\r\n                {otherRows}\r\n                <td><div>{this.props.score.requirements[requirement].count}</div></td>\r\n                <td className={this.props.score.requirements[requirement].status}>{showScore(this.props.score.requirements[requirement].score)}</td>\r\n            </>\r\n        }\r\n        return <>\r\n            <Table bordered className=\"score-details\">\r\n                <thead>\r\n                <tr>\r\n                    <th colSpan={2}>Deductions</th>\r\n                    <th>Type</th>\r\n                    <th>Rate</th>\r\n                    <th>Count</th>\r\n                    <th>Bonus</th>\r\n                </tr>\r\n                </thead>\r\n                <tbody>\r\n                <tr>\r\n                    {requirementsTableRow('LettersOnly',<>\r\n                        <td>Letters Only</td>\r\n                        <td>Flat</td>\r\n                        <td>-n</td>\r\n                    </>)}\r\n                </tr>\r\n                <tr>\r\n                    {requirementsTableRow('NumbersOnly',<>\r\n                        <td>Numbers Only</td>\r\n                        <td>Flat</td>\r\n                        <td>-n</td>\r\n                    </>)}\r\n                </tr>\r\n                <tr>\r\n                    {requirementsTableRow('RepeatCharacters',<>\r\n                        <td>Repeat Characters (Case Insensitive)</td>\r\n                        <td>Comp</td>\r\n                        <td>&nbsp;-</td>\r\n                    </>)}\r\n                </tr>\r\n                <tr>\r\n                    {requirementsTableRow('ConsecutiveUppercaseLetters',<>\r\n                        <td>Consecutive Uppercase Letters</td>\r\n                        <td>Flat</td>\r\n                        <td>-(n*2)</td>\r\n                    </>)}\r\n                </tr>\r\n                <tr>\r\n                    {requirementsTableRow('ConsecutiveLowercaseLetters',<>\r\n                        <td>Consecutive Lowercase Letters</td>\r\n                        <td>Flat</td>\r\n                        <td>-(n*2)</td>\r\n                    </>)}\r\n                </tr>\r\n                <tr>\r\n                    {requirementsTableRow('ConsecutiveNumbers',<>\r\n                        <td>Consecutive Numbers</td>\r\n                        <td>Flat</td>\r\n                        <td>-(n*2)</td>\r\n                    </>)}\r\n                </tr>\r\n                <tr>\r\n                    {requirementsTableRow('SequentialLetters',<>\r\n                        <td>Sequential Letters (3+)</td>\r\n                        <td>Flat</td>\r\n                        <td>-(n*3)</td>\r\n                    </>)}\r\n                </tr>\r\n                <tr>\r\n                    {requirementsTableRow('SequentialNumbers',<>\r\n                        <td>Sequential Numbers (3+)</td>\r\n                        <td>Flat</td>\r\n                        <td>-(n*3)</td>\r\n                    </>)}\r\n                </tr>\r\n                <tr>\r\n                    {requirementsTableRow('SequentialSymbols',<>\r\n                        <td>Sequential Symbols (3+)</td>\r\n                        <td>Flat</td>\r\n                        <td>-(n*3)</td>\r\n                    </>)}\r\n                </tr>\r\n                </tbody >\r\n            </Table >\r\n        </>\r\n    }\r\n}\r\n","import {Component} from \"react\";\r\nimport {Table} from \"react-bootstrap\";\r\nimport {PasswordRequirementNames, PasswordScore} from \"../CalculatePasswordScore\";\r\nimport PasswordCheckStatusImage from \"./PasswordCheckStatusImage\";\r\n\r\nexport interface PasswordScoreAdditionsProps{\r\n    score: PasswordScore\r\n}\r\nexport default class PasswordScoreAdditions extends Component<PasswordScoreAdditionsProps> {\r\n\r\n    render() {\r\n        const showScore = (score: number | undefined) => (score || 0) > 0 ? `+${score}` : `${score}`;\r\n        const requirementsTableRow = (requirement: PasswordRequirementNames, otherRows: JSX.Element) => {\r\n            return <>\r\n                <td><PasswordCheckStatusImage status={this.props.score.requirements[requirement].status} /></td>\r\n                {otherRows}\r\n                <td><div>{this.props.score.requirements[requirement].count}</div></td>\r\n                <td className={this.props.score.requirements[requirement].status}>{showScore(this.props.score.requirements[requirement].score)}</td>\r\n            </>\r\n        }\r\n        return <>\r\n            <Table bordered className=\"score-details\">\r\n                <thead>\r\n                <tr>\r\n                    <th colSpan={2}>Additions</th>\r\n                    <th>Type</th>\r\n                    <th>Rate</th>\r\n                    <th>Count</th>\r\n                    <th>Bonus</th>\r\n                </tr>\r\n                </thead>\r\n                <tbody>\r\n                <tr>\r\n                    {requirementsTableRow('NumberOfCharacters',<>\r\n                        <td>Number of Characters</td>\r\n                        <td>Flat</td>\r\n                        <td>+(n*4)</td>\r\n                    </>)}\r\n                </tr>\r\n                <tr>\r\n                    {requirementsTableRow('UppercaseLetters',<>\r\n                        <td>Uppercase Letters</td>\r\n                        <td>Cond/Incr</td>\r\n                        <td>+((len-n)*2)</td>\r\n                    </>)}\r\n                </tr>\r\n                <tr>\r\n                    {requirementsTableRow('LowercaseLetters',<>\r\n                        <td>Lowercase Letters</td>\r\n                        <td>Cond/Incr</td>\r\n                        <td>+((len-n)*2)</td>\r\n                    </>)}\r\n                </tr>\r\n                <tr>\r\n                    {requirementsTableRow('Numbers',<>\r\n                        <td>Numbers</td>\r\n                        <td>Cond</td>\r\n                        <td>+(n*4)</td>\r\n                    </>)}\r\n                </tr>\r\n                <tr>\r\n                    {requirementsTableRow('Symbols',<>\r\n                        <td>Symbols</td>\r\n                        <td>Flat</td>\r\n                        <td>+(n*6)</td>\r\n                    </>)}\r\n                </tr>\r\n                <tr>\r\n                    {requirementsTableRow('MiddleNumbersOrSymbols',<>\r\n                        <td>Middle Numbers or Symbols</td>\r\n                        <td>Flat</td>\r\n                        <td>+(n*2)</td>\r\n                    </>)}\r\n                </tr>\r\n                <tr>\r\n                    {requirementsTableRow('Requirements',<>\r\n                        <td>Requirements</td>\r\n                        <td>Flat</td>\r\n                        <td>+(n*2)</td>\r\n                    </>)}\r\n                </tr>\r\n                </tbody >\r\n            </Table >\r\n        </>\r\n    }\r\n}\r\n","import {Component} from \"react\";\r\nimport {Button, Card, Col, Form, FormText, Row, Table} from \"react-bootstrap\";\r\nimport {Redirect} from \"react-router-dom\";\r\nimport {Home} from \"../../../config/Routes\";\r\nimport {toast} from \"react-toastify\";\r\nimport \"../../../assets/scss/SetPassword.scss\"\r\nimport PasswordDeductions from \"./PasswordDeductions\";\r\nimport PasswordScoreAdditions from \"./PasswordScoreAdditions\";\r\nimport CalculatePasswordScore, {DefaultPasswordScore, PasswordScore} from \"../CalculatePasswordScore\";\r\nimport {FaEye, FaEyeSlash} from \"react-icons/all\";\r\n\r\nexport interface NewPasswordProps{\r\n    submitPassword: (password: string)=> void\r\n}\r\ninterface NewPasswordState{\r\n    password: string\r\n    goHome: boolean\r\n    score: PasswordScore\r\n    showPasswordText: boolean\r\n}\r\nexport default class NewPassword extends Component<NewPasswordProps, NewPasswordState> {\r\n\r\n    state: NewPasswordState ={\r\n        goHome: false,\r\n        password: '',\r\n        showPasswordText: false,\r\n        score: DefaultPasswordScore\r\n    }\r\n    passwordAppearsValid = (): boolean => {\r\n        return true;\r\n    }\r\n    submitPassword = ()=> {\r\n        if(this.passwordAppearsValid()){\r\n            this.props.submitPassword(this.state.password);\r\n        }else{\r\n            toast.error(\"Password strength does not meet minimum strength requirements!\")\r\n        }\r\n    }\r\n    changePassword = (password: string): void => {\r\n        const score =  CalculatePasswordScore(password);\r\n        this.setState({password, score});\r\n    }\r\n\r\n    render() {\r\n        return <div className=\"col d-flex justify-content-center\">\r\n            {this.state.goHome && <Redirect to={Home} /> }\r\n            <Card style={{ width: '120rem' }}>\r\n                <Card.Header>Enter New Password</Card.Header>\r\n                <Form onSubmit={(e)=>{e.preventDefault();this.submitPassword()}}>\r\n                    <Card.Body>\r\n                        <Row>\r\n                            <Col md={6}>\r\n                                <PasswordScoreAdditions score={this.state.score} />\r\n                            </Col >\r\n                            <Col md={6}>\r\n                                <PasswordDeductions score={this.state.score} />\r\n                            </Col>\r\n                        </Row>\r\n                        <Row>\r\n                            <Col md={1}>\r\n                                {this.state.showPasswordText  && <FaEye size={32} onClick={()=>{this.setState({showPasswordText: false})}}/> }\r\n                                {!this.state.showPasswordText  && <FaEyeSlash size={32} onClick={()=>{this.setState({showPasswordText: true})}}/>}\r\n                            </Col>\r\n                            <Col md={11}>\r\n                                <FormText>\r\n                                    <Form.Group className=\"mb-3\" controlId=\"frmBasicPassword\">\r\n                                        <Form.Control autoFocus={true} value={this.state.password}\r\n                                                      autoComplete=\"off\"\r\n                                                      onChange={(e) => {this.changePassword(e.target.value)}}\r\n                                                      type={this.state.showPasswordText ?'text' :'password'} placeholder=\"New Password\" />\r\n                                    </Form.Group>\r\n                                </FormText>\r\n                            </Col>\r\n                        </Row>\r\n                    </Card.Body>\r\n                    <Card.Footer>\r\n                        <Button className=\"m-2\" variant='outline-secondary' onClick={() => {this.setState({goHome: true})}}>\r\n                            Return Home\r\n                        </Button>\r\n                        <Button type=\"submit\" className=\"float-right\" variant='primary'>\r\n                            Change Password\r\n                        </Button>\r\n                    </Card.Footer>\r\n                </Form>\r\n            </Card>\r\n        </div>\r\n    }\r\n}\r\n","import ApiResponse from \"../ApiResponse\";\r\nimport {ApiAuthRequestInterface, BuildAuthRequestFromAppState} from \"../../authentication/BuildAuthRequestInterface\";\r\nimport {ApiErrorReturn} from \"../ApiError\";\r\nimport ApiUrl, {PortalSource} from \"../ApiUrl\";\r\n\r\ntype ChangeUserPasswordResponse = ApiResponse<string>;\r\n\r\nconst buildFetchRequest = (body: string, apiAuth: ApiAuthRequestInterface): RequestInit => {\r\n    return {\r\n        method: 'post',\r\n        headers: new Headers({\r\n            'auth_token': apiAuth?.auth_token,\r\n            'IsMarketPlace': apiAuth.IsMarketPlace,\r\n            'Agent': apiAuth.Agent,\r\n            'api_version' :apiAuth.api_version,\r\n            'Accept': 'application/json',\r\n            'Content-Type': 'application/json',\r\n        }),\r\n        body,\r\n    }}\r\nexport async function UpdateUserPassword(UserName: string, EmailSecret: string, Pin: string, NewPassword: string, Phone: string, errorHandling: ApiErrorReturn): Promise<ChangeUserPasswordResponse | null>{\r\n    const apiAuth = BuildAuthRequestFromAppState(undefined);\r\n    const Source = PortalSource();\r\n    const body = JSON.stringify({\r\n        Source,\r\n        UserName,\r\n        EmailSecret,\r\n        Pin,\r\n        Phone,\r\n        NewPassword,\r\n        OldPassword: '',\r\n\r\n    });\r\n    try {\r\n        const response = await fetch(ApiUrl() + \"FFOrderAccount/UpdateUserPassword\", buildFetchRequest(body, apiAuth));\r\n        return await response.json() as ChangeUserPasswordResponse;\r\n    }catch(error: unknown){\r\n        errorHandling(error);\r\n        return null;\r\n    }\r\n}\r\n","import {Component} from \"react\";\r\nimport {AppPageWrapper} from \"../NavMenu/AppPageWrapper\";\r\nimport {Spinner} from \"react-bootstrap\";\r\nimport InvalidPasswordReset from \"./InvalidPasswordReset\";\r\nimport RequestPhonePin from \"./RequestPhonePin\";\r\nimport EnterPhonePin from \"./EnterPhonePin\";\r\nimport NewPassword from \"./PasswordInputs/NewPassword\";\r\nimport {Home} from \"../../config/Routes\";\r\nimport {Redirect} from \"react-router-dom\";\r\nimport {UpdateUserPassword} from \"../../api/Secuirty/UpdateUserPassword\";\r\nimport {toast} from \"react-toastify\";\r\n\r\nfunction addDays(date: Date, days: number) {\r\n    const result = new Date(date);\r\n    result.setDate(result.getDate() + days);\r\n    return result;\r\n}\r\n\r\nexport interface PasswordResetRouteLandingRoute{\r\n    linkId?: string\r\n    linkTime?: string\r\n    userName?: string\r\n}\r\ninterface PasswordResetRouteLandingState{\r\n    requestedPhonePinSend: boolean\r\n    pin: string\r\n    showPassword: boolean\r\n    changingPassword: boolean\r\n    goHome: boolean\r\n}\r\nexport default class PasswordResetLanding extends Component<PasswordResetRouteLandingRoute, PasswordResetRouteLandingState> {\r\n\r\n    state: PasswordResetRouteLandingState = {\r\n        requestedPhonePinSend: false,\r\n        pin: '',\r\n        showPassword: false,\r\n        changingPassword: false,\r\n        goHome: false,\r\n    }\r\n\r\n    isPasswordTimeInvalid = (): boolean => {\r\n        const linkTime = parseInt(this.props.linkTime || '');\r\n        if(!this.props.linkTime || isNaN(linkTime)){\r\n            return true;\r\n        }\r\n        const linkCreatedEpochTimeMS = linkTime * 1000;\r\n        const currentDate = new Date(Date.now());\r\n        const expireDate = addDays(new Date(linkCreatedEpochTimeMS), 1);\r\n        const timeBetweenDate = expireDate.getUTCMilliseconds() - currentDate.getUTCMilliseconds();\r\n        return timeBetweenDate < 1;\r\n    }\r\n\r\n    pinRequested = (): void => {\r\n        this.setState({requestedPhonePinSend: true})\r\n    }\r\n\r\n    pinChanged = (pin: string): void => {\r\n        this.setState({pin})\r\n    }\r\n\r\n    pinSubmitted = (): void => {\r\n        this.setState({showPassword: true});\r\n    }\r\n\r\n    requestPasswordChange = (newPassword: string): void => {\r\n        const reportError = () => {\r\n            toast.error(\"Unknown Error Updating Password! Password May Have Been To Similar!\")\r\n            this.setState({changingPassword: false, showPassword: true});\r\n        }\r\n        const passwordChanged = () => {\r\n            toast.success(\"Password Changed!\")\r\n            this.setState({goHome: true});\r\n        }\r\n        UpdateUserPassword(this.props.userName || '', this.props.linkId || '', this.state.pin, newPassword, '', reportError).then(passwordChanged);\r\n        this.setState({changingPassword: true});\r\n    }\r\n\r\n    render() {\r\n        const validLinkTime = this.isPasswordTimeInvalid();\r\n        return<AppPageWrapper showNav={false}>\r\n            <div className=\"m-2\">\r\n                {this.state.goHome && <Redirect to={Home} /> }\r\n                {!validLinkTime &&\r\n                    <InvalidPasswordReset />\r\n                }\r\n                {!this.state.changingPassword && validLinkTime && !this.state.requestedPhonePinSend &&\r\n                    <RequestPhonePin userName={this.props.userName} requestedPhone={this.pinRequested}/>\r\n                }\r\n                {!this.state.changingPassword && validLinkTime && !this.state.showPassword && this.state.requestedPhonePinSend  &&\r\n                    <EnterPhonePin pin={this.state.pin}\r\n                                   userName={this.props.userName}\r\n                                   changePin={(e) => {this.pinChanged(e)}}\r\n                                   submitPin={()=>{this.pinSubmitted()}}  />\r\n                }\r\n                {!this.state.changingPassword && validLinkTime && this.state.showPassword &&\r\n                    <NewPassword submitPassword={(password)=>{this.requestPasswordChange(password)}}/>\r\n                }\r\n                {validLinkTime && this.state.changingPassword && <>\r\n                    <Spinner animation=\"border\"/>\r\n                    <br/>\r\n                    Updating Password..\r\n                </>}\r\n            </div>\r\n            </AppPageWrapper>\r\n    }\r\n}\r\n","import { RoleData } from \"../../components/Administration/RolesPermissions/PermissionsRoleModal\"\r\nimport { ObservableFromFetch } from \"../ObservableFromFetch\"\r\nimport Role from \"../Roles/Model/Role\"\r\n\r\nexport interface Permission {\r\n  PermissionID: number\r\n  Title: string\r\n  Description?: string\r\n  RecordStatusType?: string\r\n  ActiveDate?: string\r\n  InActiveDate?: string\r\n  ModifiedBy?: string\r\n  UpdateDate?: string\r\n  ApprovedBy?: string\r\n  ApprovedOn?: string\r\n  Role?: string\r\n  Permission?: string\r\n  SubscriptionPlan?: string\r\n  SubscriptionPlanID?: number\r\n}\r\n\r\n// Subscription\r\nexport default function PermissionsGet() {\r\n  return ObservableFromFetch<Permission[]>(\"FFOrderPermissionSubscription/GetPermission\")\r\n}\r\n\r\nexport function UnassignedSubscriptionPermissionsGet() {\r\n  return ObservableFromFetch<Permission[]>(\"FFOrderSubscriptionPermission/GetNotAssignedPermission\")\r\n}\r\n\r\nexport function PermissionsOfSubscriptionPlanGet(id: number, title: string) {\r\n  const requestBody: string = new URLSearchParams({\r\n    subscriptionPlanID: id.toString(),\r\n    subscriptionPlanTitle: title\r\n  }).toString()\r\n\r\n  return ObservableFromFetch<Permission[]>(\"FFOrderSubscriptionPermission/GetAssignedPermissionOfSubscriptionPlan?\" + requestBody)\r\n}\r\n\r\nexport function NotAssignedPermissionsOfSubscriptionPlanGet(id: number, title: string) {\r\n  const requestBody: string = new URLSearchParams({\r\n    subscriptionPlanID: id.toString(),\r\n    subscriptionPlanTitle: title\r\n  }).toString()\r\n\r\n  return ObservableFromFetch<Permission[]>(\"FFOrderSubscriptionPermission/GetNotAssignedPermissionOfSubscriptionPlan?\" + requestBody)\r\n}\r\n\r\nexport function SubscriptionPlanPermissionSave(subscriptionPlanID: number, description: string, modifiedBy: string, permissions: Permission[]) {\r\n  const requestBody: string = JSON.stringify({\r\n    SubscriptionPlanID: subscriptionPlanID,\r\n    Description: description,\r\n    ModifiedBy: modifiedBy,\r\n    AssignedPermission: permissions\r\n  })\r\n\r\n  return ObservableFromFetch<string>(\"FFOrderSubscriptionPermission/SaveSubscriptionPlanPermission\", requestBody)\r\n}\r\n\r\n// Permissions Approval\r\nexport function PendingPermissionsGet() {\r\n  return ObservableFromFetch<Permission[]>(\"FFOrderPermissionApproval/GetPendingPermission\")\r\n}\r\n\r\nexport function InactivePermissionsGet() {\r\n  return ObservableFromFetch<Permission[]>(\"FFOrderPermissionApproval/GetInActivePermission\")\r\n}\r\n\r\nexport function PermissionsApprove(permissions: Permission[], approvedBy: string) {\r\n  const requestBody = JSON.stringify({\r\n    ApprovePermission: permissions,\r\n    ApprovedBy: approvedBy\r\n  })\r\n  return ObservableFromFetch<string>(\"FFOrderPermissionApproval/ApprovedPermission\", requestBody)\r\n}\r\n\r\n// Role\r\nexport function RolesGet() {\r\n  return ObservableFromFetch<Role[]>(\"FFOrderRolePermission/GetRole\")\r\n}\r\n\r\nexport function PermissionsOfRoleGet(id: number, title: string) {\r\n  const requestBody: string = new URLSearchParams({\r\n    roleID: id.toString(),\r\n    roleTitle: title\r\n  }).toString()\r\n\r\n  return ObservableFromFetch<Permission[]>(\"FFOrderRolePermission/GetAssignedPermissionOfRole?\" + requestBody)\r\n}\r\n\r\nexport function NotAssignedPermissionsOfRoleGet(id: number, title: string) {\r\n  const requestBody: string = new URLSearchParams({\r\n    roleID: id.toString(),\r\n    roleTitle: title\r\n  }).toString()\r\n\r\n  return ObservableFromFetch<Permission[]>(\"FFOrderRolePermission/GetNotAssignedPermissionOfRole?\" + requestBody)\r\n}\r\n\r\nexport function RoleCreate(data: RoleData) {\r\n  const requestBody: string = JSON.stringify(data)\r\n  return ObservableFromFetch<string>(\"FFOrderRolePermission/CreateRole\", requestBody)\r\n}\r\n\r\nexport function PermissionInRoleSave(data: RoleData | undefined, permissions: Permission[]) {\r\n  const requestBody: string = JSON.stringify({\r\n    RoleID: data?.RoleID,\r\n    ModifiedBy: data?.ModifiedBy,\r\n    Level: data?.Level,\r\n    Description: data?.Description,\r\n    ActiveDate: data?.ActiveDate,\r\n    InActiveDate: data?.InActiveDate,\r\n    AssignedPermission: permissions,\r\n  })\r\n\r\n  return ObservableFromFetch<string>(\"FFOrderRolePermission/SavePermissionInRole\", requestBody)\r\n}\r\n\r\n// Subscriptions/Permissions Relationship\r\nexport function PendingSubscriptionsPermissionsMappingGet() {\r\n  return ObservableFromFetch<Permission[]>(\"FFOrderSubscriptionPermissionApproval/GetPendingSubscriptionPlanPermissionMapping\")\r\n}\r\n\r\nexport function InactiveSubscriptionsPermissionsMappingGet() {\r\n  return ObservableFromFetch<Permission[]>(\"FFOrderSubscriptionPermissionApproval/GetInActiveSubscriptionPlanPermissionMapping\")\r\n}\r\n\r\nexport function SubscriptionsPermissionsMappingApprove(permissions: Permission[], approvedBy: string) {\r\n  const requestBody = JSON.stringify({\r\n    ApproveSubscriptionPlanPermission: permissions,\r\n    ApprovedBy: approvedBy\r\n  })\r\n  return ObservableFromFetch<string>(\"FFOrderSubscriptionPermissionApproval/ApprovedSubscriptionPlanPermissionMapping\", requestBody)\r\n}\r\n\r\n// Role Permissions Approval\r\nexport function PendingRolePermissionsGet() {\r\n  return ObservableFromFetch<Permission[]>(\"FFOrderRolePermissionApproval/GetPendingRolePermissionMapping\")\r\n}\r\n\r\nexport function InactiveRolePermissionsGet() {\r\n  return ObservableFromFetch<Permission[]>(\"FFOrderRolePermissionApproval/GetInActiveRolePermissionMapping\")\r\n}\r\n\r\nexport function RolePermissionsApprove(permissions: Permission[], approvedBy: string) {\r\n  const requestBody = JSON.stringify({\r\n    ApproveRolePermission: permissions,\r\n    ApprovedBy: approvedBy\r\n  })\r\n  return ObservableFromFetch<string>(\"FFOrderRolePermissionApproval/ApprovedRolePermissionMapping\", requestBody)\r\n}","import { ObservableFromFetch } from \"../ObservableFromFetch\"\r\n\r\nexport default function SubscriptionPlanCreate(title: string, description: string, username: string) {\r\n  const requestBody: string = JSON.stringify({\r\n    Title: title,\r\n    Description: description,\r\n    ModifiedBy: username\r\n  })\r\n\r\n  return ObservableFromFetch<string>(\"FFOrderSubscriptionPermission/CreateSubscriptionPlan\", requestBody)\r\n}\r\n","import React from \"react\"\r\nimport { Modal, Form, Col, Button, Row, Table, Container, Image } from \"react-bootstrap\"\r\nimport { toast } from \"react-toastify\"\r\nimport ActionButton from \"../../ActionButton\"\r\nimport { APIError } from \"../../../api/ObservableFromFetch\"\r\nimport SubscriptionPlan from \"../../../api/Administration/Model/SubscriptionPlan\"\r\nimport SubscriptionPermissionsGet, { PermissionsOfSubscriptionPlanGet, NotAssignedPermissionsOfSubscriptionPlanGet, Permission, UnassignedSubscriptionPermissionsGet } from \"../../../api/Administration/Permissions\"\r\nimport { forkJoin, Subscription } from \"rxjs\"\r\nimport GetSubscriptionPlans from \"../../../api/Administration/GetSubscriptionPlans\"\r\nimport { FaAngleDoubleDown, FaAngleDoubleLeft, FaAngleDoubleRight, FaAngleDoubleUp, FaAngleDown, FaAngleUp, FaChevronLeft, FaChevronRight, FaPencilAlt } from \"react-icons/fa\"\r\nimport FormatDate from \"../../../formatters/FormatDate\"\r\nimport DatePicker from 'react-datepicker'\r\nimport { parseISO, format } from \"date-fns\"\r\nimport { BirthdayInput } from \"../../FormattedInputs/BirthdayInput\"\r\nimport { SubscriptionPlanPermissionSave } from \"../../../api/Administration/Permissions\"\r\nimport SubscriptionPlanCreate from \"../../../api/Administration/SubscriptionPlanCreate\"\r\n\r\ninterface PermissionsSubscriptionModalProps {\r\n  onCancel: () => void\r\n  userName?: string\r\n}\r\n\r\ninterface PermissionsSubscriptionModalState {\r\n  loading: boolean\r\n  saving: boolean\r\n  selectedSubscription?: SubscriptionData\r\n  editPermission?: EditPermission\r\n  subscriptions: SubscriptionPlan[]\r\n  permissions: Permission[]\r\n  unassigned: Permission[]\r\n  assigned: Permission[]\r\n  notassigned: Permission[]\r\n  selectionLeft: number[]\r\n  selectionRight: number[]\r\n  showAddNewModal: boolean\r\n  showEditModal: boolean\r\n  newSubscription?: SubscriptionData\r\n}\r\n\r\nexport interface EditPermission {\r\n  ID?: number\r\n  ActiveDate?: Date\r\n  InactiveDate?: Date\r\n  Title?: string\r\n}\r\n\r\ninterface SubscriptionData {\r\n  Description?: string\r\n  SubscriptionPlanID?: number\r\n  Title?: string\r\n}\r\n\r\nexport default class PermissionsSubscriptionModal extends React.PureComponent<PermissionsSubscriptionModalProps, PermissionsSubscriptionModalState> {\r\n  state: PermissionsSubscriptionModalState = {\r\n    loading: false,\r\n    saving: false,\r\n    selectedSubscription: undefined,\r\n    editPermission: undefined,\r\n    subscriptions: [],\r\n    permissions: [],\r\n    unassigned: [],\r\n    assigned: [],\r\n    notassigned: [],\r\n    selectionLeft: [],\r\n    selectionRight: [],\r\n    showAddNewModal: false,\r\n    showEditModal: false,\r\n    newSubscription: undefined\r\n  }\r\n\r\n  initialLoadSubscriptions?: Subscription\r\n  loadSubscription?: Subscription\r\n  updateSubscription?: Subscription\r\n  activedate = React.createRef<DatePicker>()\r\n  inactivedate = React.createRef<DatePicker>()\r\n\r\n  componentDidMount() {\r\n    this.loadInitialData()\r\n  }\r\n\r\n  loadInitialData() {\r\n    this.initialLoadSubscriptions && this.initialLoadSubscriptions.unsubscribe()\r\n    this.setState({ loading: true })\r\n    this.initialLoadSubscriptions = forkJoin({\r\n      subscriptions: GetSubscriptionPlans(),\r\n      permissions: SubscriptionPermissionsGet(),\r\n      unassigned: UnassignedSubscriptionPermissionsGet()\r\n    })\r\n      .subscribe(\r\n        ({ subscriptions, permissions, unassigned }) => {\r\n          const subscriptionPlanID = this.state.selectedSubscription?.SubscriptionPlanID\r\n          this.setState({ subscriptions: [...subscriptions], permissions: [...permissions], unassigned: [...unassigned], loading: false, selectedSubscription: undefined, selectionLeft: [], selectionRight: [] })\r\n          if (subscriptionPlanID) this.selectSubscription(subscriptionPlanID)\r\n        },\r\n        (error) => {\r\n          this.handleAPIError(error, { loading: false })\r\n        }\r\n      )\r\n  }\r\n\r\n  componentWillUnmount() {\r\n    this.initialLoadSubscriptions && this.initialLoadSubscriptions.unsubscribe()\r\n    this.loadSubscription && this.loadSubscription.unsubscribe()\r\n    this.updateSubscription && this.updateSubscription.unsubscribe()\r\n  }\r\n\r\n  handleAPIError = (error: Error | APIError, stateChanges: object) => {\r\n    this.setState(stateChanges)\r\n    error && toast.error((error as APIError)?.errorData?.message || error.message)\r\n  }\r\n\r\n  selectSubscription = (id: number) => {\r\n    const subs = this.state.subscriptions.find(item => item.SubscriptionPlanID === id)\r\n    if (subs) {\r\n      this.setState({ selectedSubscription: {Title: subs.Title, Description: subs.Description, SubscriptionPlanID: subs.SubscriptionPlanID} })\r\n\r\n      this.loadSubscription && this.loadSubscription.unsubscribe()\r\n      this.loadSubscription = forkJoin({\r\n        assigned: PermissionsOfSubscriptionPlanGet(subs?.SubscriptionPlanID || 0, subs?.Title || \"\"),\r\n        notassigned: NotAssignedPermissionsOfSubscriptionPlanGet(subs?.SubscriptionPlanID || 0, subs?.Title || \"\")\r\n      })\r\n        .subscribe(\r\n          ({ assigned, notassigned }) => this.setState({ assigned: [...assigned], notassigned: [...notassigned], loading: false }),\r\n          (error) => {\r\n            this.handleAPIError(error, { loading: false })\r\n          }\r\n        )\r\n    }\r\n    else {this.setState({ selectedSubscription: undefined })}\r\n  }\r\n\r\n  handleAddNewCancel = () => this.setState({ showAddNewModal: false, newSubscription: undefined })\r\n  handleEditCancel = () => this.setState({ showEditModal: false, editPermission: undefined })\r\n  handleSubmit = () => {\r\n    this.updateSubscription && this.updateSubscription.unsubscribe()\r\n    this.setState({ saving: true })\r\n    const { selectedSubscription, assigned } = this.state\r\n\r\n    const subscriptionPlanID = selectedSubscription?.SubscriptionPlanID || 0\r\n    const subscriptionPlanDescription = selectedSubscription?.Description || \"\"\r\n    this.updateSubscription = SubscriptionPlanPermissionSave(subscriptionPlanID, subscriptionPlanDescription, this.props.userName || \"\", assigned).subscribe(\r\n      data => {\r\n        this.setState({ saving: false })\r\n        toast.success(data)\r\n        this.loadInitialData()\r\n      },\r\n      error => this.handleAPIError(error, { saving: false })\r\n    )\r\n  }\r\n  handleAddNewSubmit = () => {\r\n    this.updateSubscription && this.updateSubscription.unsubscribe()\r\n    this.setState({ saving: true })\r\n    const { newSubscription } = this.state\r\n\r\n    this.updateSubscription = SubscriptionPlanCreate(newSubscription?.Title || \"\", newSubscription?.Description || \"\", this.props.userName || \"\").subscribe(\r\n      data => {\r\n        this.setState({ saving: false, showAddNewModal: false, loading: true })\r\n        toast.success(data)\r\n        GetSubscriptionPlans().subscribe(\r\n          data => this.setState({ subscriptions: data, loading: false, selectedSubscription: undefined }),\r\n          error => this.handleAPIError(error, { loading: false })\r\n        )\r\n      },\r\n      error => this.handleAPIError(error, { saving: false })\r\n    )\r\n  }\r\n  handleEditSubmit = () => {\r\n    const { editPermission, assigned } = this.state\r\n    const relatedPermission = assigned.find(item => item.PermissionID === editPermission?.ID)\r\n\r\n    if (relatedPermission) {\r\n      relatedPermission.ActiveDate = format(editPermission?.ActiveDate || 0, \"yyyy-MM-dd'T'HH:mm:ss\")\r\n      relatedPermission.InActiveDate = format(editPermission?.InactiveDate || 0, \"yyyy-MM-dd'T'HH:mm:ss\")\r\n    }\r\n\r\n    this.setState({ showEditModal: false, editPermission: undefined })\r\n  }\r\n  handleAddNew = () => this.setState({ showAddNewModal: true })\r\n  handleEdit = (permission: Permission) => this.setState({ showEditModal: true, editPermission: { ID: permission.PermissionID, Title: permission.Title, ActiveDate: parseISO(permission.ActiveDate || \"\"), InactiveDate: parseISO(permission.InActiveDate || \"\") } })\r\n\r\n  addNewValid = () => {\r\n    const { newSubscription } = this.state\r\n    return !!newSubscription && !!newSubscription.Title && !!newSubscription.Description\r\n   }\r\n  editValid = () => {\r\n    const { editPermission } = this.state\r\n    return !!editPermission && !!editPermission.ActiveDate && !!editPermission.InactiveDate\r\n  }\r\n  validSubmit = () => {\r\n    const { selectedSubscription } = this.state\r\n    return !!selectedSubscription && !!selectedSubscription.Description\r\n  }\r\n\r\n\r\n  handleActiveDateChange = (date: Date) => {\r\n    const inactiveDate = this.state.editPermission?.InactiveDate\r\n    const dateiInPast: boolean = inactiveDate instanceof Date && inactiveDate < new Date\r\n    const allowChange = inactiveDate instanceof Date ? date < inactiveDate || dateiInPast : true\r\n    this.setState({ editPermission: { ...this.state.editPermission, ActiveDate: allowChange ? date : undefined, InactiveDate: dateiInPast ? undefined : inactiveDate } })\r\n  }\r\n\r\n  handleInActiveDateChange = (date: Date) => {\r\n    const activeDate = this.state.editPermission?.ActiveDate\r\n    const allowChange = activeDate instanceof Date ? date > activeDate : true\r\n    this.setState({ editPermission: { ...this.state.editPermission, InactiveDate: allowChange ? date : undefined } })\r\n  }\r\n\r\n  move(dir: \"ltr\" | \"rtl\", all?: boolean) {\r\n    if (dir === \"ltr\") {\r\n      const ids = !!all ? this.state.notassigned.map(item => item.PermissionID) : this.state.selectionLeft\r\n      this.setState({\r\n        selectionLeft: [],\r\n        notassigned: this.state.notassigned.filter(item => !ids.includes(item.PermissionID)),\r\n        assigned: [...this.state.assigned, ...this.state.notassigned.filter(item => ids.includes(item.PermissionID))]\r\n      })\r\n    } else {\r\n      const ids = !!all ? this.state.assigned.map(item => item.PermissionID) : this.state.selectionRight\r\n      this.setState({\r\n        selectionRight: [],\r\n        notassigned: [...this.state.notassigned, ...this.state.assigned.filter(item => ids.includes(item.PermissionID))],\r\n        assigned: this.state.assigned.filter(item => !ids.includes(item.PermissionID))\r\n      })\r\n    }\r\n  }\r\n\r\n  handleRightItemClick = (id: number) => {\r\n    if (this.state.selectionRight.includes(id)) {\r\n      this.setState({ selectionRight: this.state.selectionRight.filter(item => item !== id) })\r\n    } else {\r\n      this.setState({ selectionRight: [...this.state.selectionRight, id] })\r\n    }\r\n  }\r\n\r\n  render() {\r\n    const { loading, saving, selectedSubscription, editPermission, subscriptions, selectionLeft, selectionRight, showAddNewModal, showEditModal, newSubscription } = this.state\r\n    const left = !selectedSubscription ? this.state.unassigned : this.state.notassigned\r\n    const right = !selectedSubscription ? [] : this.state.assigned\r\n    const disabled = !selectedSubscription || loading\r\n\r\n    return (\r\n      <>\r\n        <Modal.Dialog size=\"xl\">\r\n          <Modal.Header>\r\n            <Modal.Title className=\"text-uppercase\">Subscription/Permission</Modal.Title>\r\n          </Modal.Header>\r\n          <Modal.Body>\r\n            <React.Fragment>\r\n              <Form.Row className=\"form-group\">\r\n                <Form.Label column sm={2} htmlFor=\"subscriptionPlan\">Subscription</Form.Label>\r\n                <Col sm={4}>\r\n                  <Form.Control id=\"subscriptionPlan\" as=\"select\" value={selectedSubscription?.SubscriptionPlanID?.toString()} onChange={(e) => this.selectSubscription(Number(e.target.value))}>\r\n                    <option value=\"\">Select Subscription</option>\r\n                    {subscriptions && subscriptions.map((plan: SubscriptionPlan) => <option value={plan.SubscriptionPlanID} key={plan.SubscriptionPlanID}>{plan.Title}</option>)}\r\n                  </Form.Control>\r\n                </Col>\r\n              </Form.Row>\r\n              <Form.Row className=\"form-group\">\r\n                <Form.Label column sm={2} htmlFor=\"subscriptionDesc\">Description</Form.Label>\r\n                <Col sm={9}>\r\n                  <Form.Control as=\"textarea\"\r\n                    rows={4}\r\n                    isInvalid={selectedSubscription && !selectedSubscription.Description}\r\n                    disabled={!selectedSubscription}\r\n                    value={selectedSubscription?.Description || \"\"}\r\n                    onChange={(e) => this.setState({ selectedSubscription: {...selectedSubscription, Description: e.target.value}})} />\r\n                </Col>\r\n              </Form.Row>\r\n              <hr />\r\n              <Form className=\"px-4\" hidden={loading}>\r\n                <Row className=\"d-none d-lg-flex\">\r\n                  <Col lg={4}>Permissions Not Assigned</Col>\r\n                  <Col lg={1} className=\"px-0\"></Col>\r\n                  <Col lg={7} className=\"pl-lg-0\">Permissions Assigned</Col>\r\n                </Row>\r\n                <Row>\r\n                  <Col className=\"d-lg-none\">Permissions Not Assigned</Col>\r\n                  <Col lg={4} className=\"pr-lg-0\">\r\n                    <Form.Control as=\"select\" multiple className=\"grey-selection\" style={{ height: \"288px\", boxShadow: \"none\" }}\r\n                      disabled={false}\r\n                      onChange={(e: React.ChangeEvent<HTMLSelectElement>) => { this.setState({ selectionLeft: Array.from(e.target.selectedOptions, option => Number(option.value)) }) }}>\r\n                      {left.map(item => <option key={item.PermissionID} value={item.PermissionID}>{item.Title}</option>)}\r\n                    </Form.Control>\r\n                  </Col>\r\n                  <Col lg={1} className=\"px-0\">\r\n                    <Container fluid>\r\n                      <Row>\r\n                        <Col className=\"px-1 text-center\">\r\n                          <Button className=\"btn-sm btn-sm-icon mb-lg-2 mt-lg-0 my-1\" disabled={!left.length || disabled} onClick={() => this.move(\"ltr\", true)}>\r\n                            <FaAngleDoubleRight className=\"d-none d-lg-inline\" />\r\n                            <FaAngleDoubleDown className=\"d-lg-none\" />\r\n                          </Button>\r\n                        </Col>\r\n                        <Col className=\"px-1 text-center\">\r\n                          <Button className=\"btn-sm btn-sm-icon mb-lg-2 mt-lg-0 my-1\" disabled={!selectionLeft.length || disabled} onClick={() => this.move(\"ltr\")}>\r\n                            <FaChevronRight className=\"d-none d-lg-inline\" />\r\n                            <FaAngleDown className=\"d-lg-none\" />\r\n                          </Button>\r\n                        </Col>\r\n                        <Col className=\"px-1 text-center\">\r\n                          <Button className=\"btn-sm btn-sm-icon mb-lg-2 mt-lg-0 my-1\" disabled={!selectionRight.length || disabled} onClick={() => this.move(\"rtl\")}>\r\n                            <FaChevronLeft className=\"d-none d-lg-inline\" />\r\n                            <FaAngleUp className=\"d-lg-none\" />\r\n                          </Button>\r\n                        </Col>\r\n                        <Col className=\"px-1 text-center\">\r\n                          <Button className=\"btn-sm btn-sm-icon mb-lg-2 mt-lg-0 my-1\" disabled={!right.length || disabled} onClick={() => this.move(\"rtl\", true)}>\r\n                            <FaAngleDoubleLeft className=\"d-none d-lg-inline\" />\r\n                            <FaAngleDoubleUp className=\"d-lg-none\" />\r\n                          </Button>\r\n                        </Col>\r\n                      </Row>\r\n                    </Container>\r\n                  </Col>\r\n                  <Col className=\"d-lg-none\">Permissions Assigned</Col>\r\n                  <Col lg={7} className=\"pl-lg-0\" style={{ height: \"288px\", overflowY: \"auto\" }}>\r\n                    <Table className=\"table-sm dark\" borderless responsive>\r\n                      <thead>\r\n                        <tr>\r\n                          <th>Permission</th>\r\n                          <th>Status</th>\r\n                          <th>Active</th>\r\n                          <th>Inactive</th>\r\n                          <th>Edit</th>\r\n                        </tr>\r\n                      </thead>\r\n                      <tbody>\r\n                        {right.map(item => <tr key={item.PermissionID} className={selectionRight.includes(item.PermissionID) ? \"selected\" : \"\"} onClick={() => this.handleRightItemClick(item.PermissionID)}>\r\n                          <td>{item.Title}</td>\r\n                          <td>{item.RecordStatusType}</td>\r\n                          <td>{FormatDate(item.ActiveDate)}</td>\r\n                          <td>{FormatDate(item.InActiveDate)}</td>\r\n                          <td>\r\n                            <Button variant=\"icon-link\" size=\"sm\" className=\"btn-icon-primary\" onClick={() => { this.handleEdit(item) }}>\r\n                              <FaPencilAlt />\r\n                            </Button>\r\n                          </td>\r\n                        </tr>)}\r\n                      </tbody>\r\n                    </Table>\r\n                  </Col>\r\n                </Row>\r\n              </Form>\r\n            </React.Fragment>\r\n          </Modal.Body>\r\n          <Modal.Footer>\r\n            <ActionButton variant=\"primary\" onClick={this.handleAddNew} disabled={!!this.state.selectedSubscription} >Add New</ActionButton>\r\n            <Button variant=\"secondary\" className=\"mr-2\" onClick={() => this.props.onCancel()}>Cancel</Button>\r\n            <ActionButton variant=\"primary\" onClick={this.handleSubmit} disabled={loading || !this.validSubmit()} spin={saving} disableOnSpin>Submit</ActionButton>\r\n          </Modal.Footer>\r\n        </Modal.Dialog>\r\n\r\n        <Modal show={showAddNewModal} onHide={() => this.handleAddNewCancel()} size=\"lg\" backdrop=\"static\" dialogClassName=\"dark\">\r\n          <Modal.Header>\r\n            <Modal.Title className=\"text-uppercase\">Add New Subscription</Modal.Title>\r\n          </Modal.Header>\r\n          <Modal.Body>\r\n            <Form.Row className=\"form-group required\">\r\n              <Form.Label column lg={3} htmlFor=\"newName\">Subscription </Form.Label>\r\n              <Col lg={9}>\r\n                <Form.Control id=\"newName\" type=\"text\"\r\n                  value={newSubscription?.Title}\r\n                  isInvalid={newSubscription && !newSubscription.Title}\r\n                  onChange={(e) => this.setState({ newSubscription: { ...newSubscription, Title: e.target.value } })} />\r\n              </Col>\r\n            </Form.Row>\r\n            <Form.Row className=\"form-group required\">\r\n              <Form.Label column lg={3} htmlFor=\"newDescription\">Description</Form.Label>\r\n              <Col lg={9}>\r\n                <Form.Control as=\"textarea\"\r\n                  rows={4}\r\n                  isInvalid={newSubscription && !newSubscription.Description}\r\n                  value={newSubscription?.Description}\r\n                  onChange={(e) => this.setState({ newSubscription: { ...newSubscription, Description: e.target.value } })} />\r\n              </Col>\r\n            </Form.Row>\r\n          </Modal.Body>\r\n          <Modal.Footer>\r\n            <Button variant=\"secondary\" className=\"mr-2\" onClick={() => this.handleAddNewCancel()}>Cancel</Button>\r\n            <ActionButton variant=\"primary\" onClick={() => this.handleAddNewSubmit()} disabled={!this.addNewValid()} spin={saving} disableOnSpin>Next</ActionButton>\r\n          </Modal.Footer>\r\n        </Modal>\r\n\r\n        {!!editPermission && <Modal show={showEditModal} onHide={() => this.handleEditCancel()} size=\"lg\" backdrop=\"static\" dialogClassName=\"dark\">\r\n          <Modal.Header>\r\n            <Modal.Title className=\"text-uppercase\">Edit Subscription</Modal.Title>\r\n          </Modal.Header>\r\n          <Modal.Body>\r\n            <Form.Row className=\"form-group required\">\r\n              <Form.Label column lg={2} htmlFor=\"editSubs\" className=\"required\">Subscription</Form.Label>\r\n              <Col lg={4}>\r\n                <Form.Control id=\"editSubs\" type=\"text\" defaultValue={selectedSubscription?.Title} disabled={true} />\r\n              </Col>\r\n              <Col lg={1}></Col>\r\n              <Form.Label column lg={2} htmlFor=\"editActive\">Active Date</Form.Label>\r\n              <Col lg={3}>\r\n                <DatePicker className=\"form-control\"\r\n                  ref={this.activedate}\r\n                  required={true}\r\n                  showMonthDropdown\r\n                  showYearDropdown\r\n                  minDate={new Date()}\r\n                  dropdownMode=\"select\"\r\n                  popperPlacement=\"right\"\r\n                  selected={editPermission?.ActiveDate}\r\n                  enableTabLoop={false}\r\n                  onKeyDown={(e) => { if (this.activedate && this.activedate.current && e.key === 'Tab') { this.activedate.current.setOpen(false) } }}\r\n                  onChange={date => this.handleActiveDateChange(date as Date)}\r\n                  customInput={<BirthdayInput />} />\r\n              </Col>\r\n            </Form.Row>\r\n            <Form.Row className=\"form-group required\">\r\n              <Form.Label column lg={2} htmlFor=\"editPerm\" className=\"required\">Permission</Form.Label>\r\n              <Col lg={4}>\r\n                <Form.Control id=\"editPerm\" type=\"text\" defaultValue={editPermission?.Title} disabled={true} />\r\n              </Col>\r\n              <Col lg={1}></Col>\r\n              <Form.Label column lg={2} htmlFor=\"editInactive\">Inactive Date</Form.Label>\r\n              <Col lg={3}>\r\n                <DatePicker className=\"form-control\"\r\n                  ref={this.inactivedate}\r\n                  required={true}\r\n                  showMonthDropdown\r\n                  showYearDropdown\r\n                  dropdownMode=\"select\"\r\n                  popperPlacement=\"right\"\r\n                  minDate={editPermission?.ActiveDate instanceof Date ? editPermission?.ActiveDate : new Date()}\r\n                  selected={editPermission?.InactiveDate}\r\n                  enableTabLoop={false}\r\n                  onKeyDown={(e) => { if (this.inactivedate && this.inactivedate.current && e.key === 'Tab') { this.inactivedate.current.setOpen(false) } }}\r\n                  onChange={date => this.handleInActiveDateChange(date as Date)}\r\n                  customInput={<BirthdayInput />} />\r\n              </Col>\r\n            </Form.Row>\r\n          </Modal.Body>\r\n          <Modal.Footer>\r\n            <Button variant=\"secondary\" className=\"mr-2\" onClick={() => this.handleEditCancel()}>Cancel</Button>\r\n            <ActionButton variant=\"primary\" onClick={() => this.handleEditSubmit()} disabled={!this.editValid()} spin={saving} disableOnSpin>Finish</ActionButton>\r\n          </Modal.Footer>\r\n        </Modal>}\r\n      </>\r\n    )\r\n  }\r\n}\r\n","import React, { ReactFragment } from \"react\"\r\nimport { Col, Row, Button, Container, Table } from \"react-bootstrap\"\r\nimport { FaAngleDoubleDown, FaAngleDoubleLeft, FaAngleDoubleRight, FaAngleDoubleUp, FaAngleDown, FaAngleUp, FaChevronLeft, FaChevronRight } from \"react-icons/fa\"\r\nimport _lodash from \"lodash\"\r\n\r\nexport interface ColumnDefinition<T> {\r\n  title: string\r\n  value: keyof T | ((data: T) => ReactFragment)\r\n}\r\n\r\ninterface DualTableBoxProps<T> {\r\n  disabled?: boolean\r\n  idKey: keyof T\r\n  options: T[]\r\n  optionsAtRight: T[]\r\n  leftTitle: string\r\n  rightTitle: string\r\n  leftColumns: ColumnDefinition<T>[]\r\n  rightColumns: ColumnDefinition<T>[]\r\n  hideLeftHeader?: boolean\r\n  hideRightHeader?: boolean\r\n  onChange: (selected: T[]) => void\r\n}\r\n\r\ninterface DualTableBoxSelection<T> {\r\n  optionsAtRight: T[]\r\n  selectionLeft: T[]\r\n  selectionRight: T[]\r\n}\r\n\r\ninterface DualTableBoxState<T> extends DualTableBoxSelection<T> {\r\n  optionsAtRight: T[]\r\n}\r\n\r\nexport default class DualTableBox<T extends object> extends React.PureComponent<DualTableBoxProps<T>, DualTableBoxState<T>> {\r\n  state: DualTableBoxState<T> = {\r\n    optionsAtRight: [...this.props.optionsAtRight],\r\n    selectionLeft: [],\r\n    selectionRight: []\r\n  }\r\n\r\n  componentDidUpdate(prevProps: DualTableBoxProps<T>, prevState: DualTableBoxState<T>) {\r\n    if (!_lodash.isEqual(this.props.optionsAtRight, prevProps.optionsAtRight)) {\r\n      this.setState({ optionsAtRight: [...this.props.optionsAtRight] })\r\n    }\r\n    if (!_lodash.isEqual(this.state.optionsAtRight, prevState.optionsAtRight)) {\r\n      const selection = this.props.options.filter(option => this.state.optionsAtRight.includes(option))\r\n      this.props.onChange(selection)\r\n    }\r\n  }\r\n\r\n  move(dir: \"ltr\" | \"rtl\", all?: boolean) {\r\n    const { selectionLeft, selectionRight, optionsAtRight } = this.state\r\n    const newSelection = all\r\n      ? (dir === \"ltr\")\r\n        ? this.props.options\r\n        : []\r\n      : (dir === \"ltr\")\r\n        ? [...optionsAtRight, ...selectionLeft]\r\n        : optionsAtRight.filter(option => !selectionRight.includes(option))\r\n\r\n    dir === \"ltr\"\r\n      ? this.setState({ selectionLeft: [], optionsAtRight: newSelection })\r\n      : this.setState({ selectionRight: [], optionsAtRight: newSelection })\r\n  }\r\n\r\n  columnValue = (column: ColumnDefinition<T>, data: T) => {\r\n    if (typeof column.value === \"string\" && column.value in data) {\r\n      return data[column.value as keyof T]\r\n    } else if (typeof column.value === \"function\") {\r\n      const columnFn = (column.value as ((data: T) => ReactFragment))\r\n      return columnFn(data)\r\n    }\r\n    return \"\"\r\n  }\r\n\r\n  handleItemClick = (clicked: T, fieldName: keyof DualTableBoxSelection<T>) => {\r\n    if (this.state[fieldName].includes(clicked)) {\r\n      this.setState({ ...{}, [fieldName]: this.state[fieldName].filter(item => item !== clicked) })\r\n    } else {\r\n      this.setState({ ...{}, [fieldName]: [...this.state[fieldName], clicked] })\r\n    }\r\n  }\r\n\r\n  render() {\r\n    const table = (options: T[], columns: ColumnDefinition<T>[], selectionFieldName: keyof DualTableBoxSelection<T>, showHeader: boolean) =>\r\n      <Table className=\"table-sm dark\" borderless responsive>\r\n        {showHeader && <thead>\r\n          <tr>\r\n            {columns.map((item, i) => <th key={`${item.title}_${i}`}>{item.title}</th>)}\r\n          </tr>\r\n        </thead>}\r\n        <tbody>\r\n          {options.map((item, i) =>\r\n            <tr key={`${item[this.props.idKey]}_${i}`} className={this.state[selectionFieldName].includes(item) ? \"selected\" : \"\"} onClick={() => this.handleItemClick(item, selectionFieldName)}>\r\n              {columns.map((col, j) => <td key={`${item[this.props.idKey]}_${i}_${j}`}>{this.columnValue(col, item)}</td>)}\r\n            </tr>)}\r\n        </tbody>\r\n      </Table>\r\n    const { selectionLeft, selectionRight, optionsAtRight } = this.state\r\n    const options: T[] = this.props.options\r\n    const availableOptions = options.filter(option => !optionsAtRight.includes(option))\r\n    return (\r\n      <>\r\n        <Container fluid>\r\n          <Row className=\"d-none d-lg-flex\">\r\n            <Col lg={5}>{this.props.leftTitle}</Col>\r\n            <Col lg={2} className=\"px-0\"></Col>\r\n            <Col lg={5} className=\"pl-lg-0\">{this.props.rightTitle}</Col>\r\n          </Row>\r\n          <Row>\r\n            <Col className=\"d-lg-none\">{this.props.leftTitle}</Col>\r\n            <Col lg={5} className=\"pr-lg-0\">\r\n              {table(availableOptions, this.props.leftColumns, \"selectionLeft\", !this.props.hideLeftHeader)}\r\n            </Col>\r\n            <Col lg={2} className=\"px-0 text-center align-self-center\">\r\n              <Container fluid>\r\n                <Row>\r\n                  <Col lg={12} xs={3} className=\"px-1 text-center\">\r\n                    <Button className=\"btn-sm btn-sm-icon mb-lg-2 mt-lg-0 my-1\" disabled={!availableOptions.length || this.props.disabled}\r\n                      onClick={() => this.move(\"ltr\", true)}>\r\n                      <FaAngleDoubleRight className=\"d-none d-lg-inline\" />\r\n                      <FaAngleDoubleDown className=\"d-lg-none\" />\r\n                    </Button>\r\n                  </Col>\r\n                  <Col lg={12} xs={3} className=\"px-1 text-center\">\r\n                    <Button className=\"btn-sm btn-sm-icon mb-lg-2 mt-lg-0 my-1\" disabled={!selectionLeft.length || this.props.disabled}\r\n                      onClick={() => this.move(\"ltr\")}>\r\n                      <FaChevronRight className=\"d-none d-lg-inline\" />\r\n                      <FaAngleDown className=\"d-lg-none\" />\r\n                    </Button>\r\n                  </Col>\r\n                  <Col lg={12} xs={3} className=\"px-1 text-center\">\r\n                    <Button className=\"btn-sm btn-sm-icon mb-lg-2 mt-lg-0 my-1\" disabled={!selectionRight.length || this.props.disabled}\r\n                      onClick={() => this.move(\"rtl\")}>\r\n                      <FaChevronLeft className=\"d-none d-lg-inline\" />\r\n                      <FaAngleUp className=\"d-lg-none\" />\r\n                    </Button>\r\n                  </Col>\r\n                  <Col lg={12} xs={3} className=\"px-1 text-center\">\r\n                    <Button className=\"btn-sm btn-sm-icon mb-lg-2 mt-lg-0 my-1\" disabled={!optionsAtRight.length || this.props.disabled}\r\n                      onClick={() => this.move(\"rtl\", true)}>\r\n                      <FaAngleDoubleLeft className=\"d-none d-lg-inline\" />\r\n                      <FaAngleDoubleUp className=\"d-lg-none\" />\r\n                    </Button>\r\n                  </Col>\r\n                </Row>\r\n              </Container>\r\n            </Col>\r\n            <Col className=\"d-lg-none\">{this.props.rightTitle}</Col>\r\n            <Col lg={5} className=\"pl-lg-0\">\r\n              {table(optionsAtRight, this.props.rightColumns, \"selectionRight\", !this.props.hideRightHeader)}\r\n            </Col>\r\n          </Row>\r\n        </Container>\r\n      </>\r\n    )\r\n  }\r\n\r\n  static defaultProps = { selected: [] }\r\n}\r\n","import React from \"react\"\r\nimport { Modal, Form, Col, Button } from \"react-bootstrap\"\r\nimport { toast } from \"react-toastify\"\r\nimport { connect } from \"react-redux\"\r\nimport ActionButton from \"../ActionButton\"\r\nimport { APIError } from \"../../api/ObservableFromFetch\"\r\nimport { RouteComponentProps } from \"react-router\"\r\nimport { Home } from \"../../config/Routes\"\r\nimport { AppPageWrapper } from \"../NavMenu/AppPageWrapper\"\r\nimport PermissionsSubscriptionModal from \"./RolesPermissions/PermissionsSubscriptionModal\"\r\nimport { AppState } from \"../../AppState\"\r\nimport { getUserNameForSelectedCompany } from \"../../authentication/SelectedCompany/CompanySelectionDrivenSelectors\"\r\nimport ApproveNewPermissionsModal from \"./RolesPermissions/ApproveNewPermissionsModal\"\r\nimport PermissionsRoleModal from \"./RolesPermissions/PermissionsRoleModal\"\r\nimport ApproveRolePermissionsModal from \"./RolesPermissions/ApproveRolePermissionsModal\"\r\nimport ApproveSubscriptionRelationshipsModal from \"./RolesPermissions/ApproveSubscriptionRelationshipsModal\"\r\n\r\ninterface PermissionsSelectionProps {\r\n}\r\n\r\ninterface PermissionsSelectionAuthProps {\r\n  UserName?: string\r\n}\r\n\r\nenum PermissionSelectionType {\r\n  PermissionsSubscription = \"permSubs\",\r\n  PermissionsRole = \"permRole\",\r\n  ApproveNewPermissions = \"approvePerms\",\r\n  ApproveSubscriptions = \"approveSubs\",\r\n  ApproveRoles = \"approveRoles\",\r\n  NoSelection = \"\"\r\n}\r\n\r\ninterface PermissionsSelectionState {\r\n  selected: PermissionSelectionType\r\n  showSelection: boolean\r\n  showPermissionsSubscriptionModal: boolean\r\n  showPermissionsRoleModal: boolean\r\n  showApproveNewPermissionsModal: boolean\r\n  showApproveSubscriptionsModal: boolean\r\n  showApproveRolesModal: boolean\r\n}\r\n\r\nexport class PermissionsSelection extends React.PureComponent<PermissionsSelectionProps & PermissionsSelectionAuthProps, PermissionsSelectionState> {\r\n  emptyState: PermissionsSelectionState = {\r\n    selected: PermissionSelectionType.NoSelection,\r\n    showSelection: true,\r\n    showPermissionsSubscriptionModal: false,\r\n    showPermissionsRoleModal: false,\r\n    showApproveNewPermissionsModal: false,\r\n    showApproveSubscriptionsModal: false,\r\n    showApproveRolesModal: false\r\n  }\r\n  state: PermissionsSelectionState = { ... this.emptyState }\r\n\r\n  handleAPIError = (error: Error | APIError, stateChanges: object) => {\r\n    this.setState(stateChanges)\r\n    error && toast.error((error as APIError)?.errorData?.message || error.message)\r\n  }\r\n\r\n  handleCancel = () => (this.props as RouteComponentProps).history?.push(Home)\r\n  handleSelect = (e: React.ChangeEvent<HTMLInputElement>) => this.setState({ selected: e.target.value as PermissionSelectionType })\r\n  handleNext = () => {\r\n    this.setState({\r\n      showSelection: false,\r\n      showPermissionsSubscriptionModal: this.state.selected === PermissionSelectionType.PermissionsSubscription,\r\n      showPermissionsRoleModal: this.state.selected === PermissionSelectionType.PermissionsRole,\r\n      showApproveNewPermissionsModal: this.state.selected === PermissionSelectionType.ApproveNewPermissions,\r\n      showApproveSubscriptionsModal: this.state.selected === PermissionSelectionType.ApproveSubscriptions,\r\n      showApproveRolesModal: this.state.selected === PermissionSelectionType.ApproveRoles\r\n    })\r\n  }\r\n\r\n  handleModalCancel = () => this.setState({ ... this.emptyState })\r\n\r\n  render() {\r\n    const { selected, showSelection, showPermissionsSubscriptionModal, showApproveNewPermissionsModal, showApproveSubscriptionsModal, showPermissionsRoleModal, showApproveRolesModal } = this.state\r\n\r\n    return (\r\n      <AppPageWrapper showNav>\r\n        {showSelection && <Modal.Dialog size=\"lg\">\r\n          <Modal.Header>\r\n            <Modal.Title className=\"text-uppercase\">Subscription/Role/Permission Selection</Modal.Title>\r\n          </Modal.Header>\r\n          <Modal.Body>\r\n            <Form.Row className=\"form-group\">\r\n              <Col lg={2}>I Would Like To:</Col>\r\n            </Form.Row>\r\n            <Form.Row className=\"form-group\">\r\n              <Col lg={2}></Col>\r\n              <Col lg={7}>\r\n                <Form.Group className=\"section-border\">\r\n                  <Form.Check label=\"Add Permissions to a Subscription\"\r\n                    id=\"permtosubs-radio\"\r\n                    type=\"radio\"\r\n                    name=\"selectionType\"\r\n                    className=\"abc-radio p-1\"\r\n                    value={PermissionSelectionType.PermissionsSubscription}\r\n                    checked={selected === PermissionSelectionType.PermissionsSubscription}\r\n                    onChange={this.handleSelect} />\r\n                  <Form.Check label=\"Add Permissions to a Role\"\r\n                    id=\"permtorole-radio\"\r\n                    type=\"radio\"\r\n                    name=\"selectionType\"\r\n                    className=\"abc-radio p-1\"\r\n                    value={PermissionSelectionType.PermissionsRole}\r\n                    checked={selected === PermissionSelectionType.PermissionsRole}\r\n                    onChange={this.handleSelect} />\r\n                  <Form.Check label=\"Approve New Permissions\"\r\n                    id=\"newperm-radio\"\r\n                    type=\"radio\"\r\n                    name=\"selectionType\"\r\n                    className=\"abc-radio p-1\"\r\n                    value={PermissionSelectionType.ApproveNewPermissions}\r\n                    checked={selected === PermissionSelectionType.ApproveNewPermissions}\r\n                    onChange={this.handleSelect} />\r\n                  <Form.Check label=\"Approve Subscriptions/Permissions Relationship\"\r\n                    id=\"approvesubs-radio\"\r\n                    type=\"radio\"\r\n                    name=\"selectionType\"\r\n                    className=\"abc-radio p-1\"\r\n                    value={PermissionSelectionType.ApproveSubscriptions}\r\n                    checked={selected === PermissionSelectionType.ApproveSubscriptions}\r\n                    onChange={this.handleSelect} />\r\n                  <Form.Check label=\"Approve Roles/Permissions Relationship\"\r\n                    id=\"approverole-radio\"\r\n                    type=\"radio\"\r\n                    name=\"selectionType\"\r\n                    className=\"abc-radio p-1\"\r\n                    value={PermissionSelectionType.ApproveRoles}\r\n                    checked={selected === PermissionSelectionType.ApproveRoles}\r\n                    onChange={this.handleSelect} />\r\n                </Form.Group>\r\n              </Col>\r\n            </Form.Row>\r\n          </Modal.Body>\r\n          <Modal.Footer>\r\n            <Button variant=\"secondary\" className=\"mr-2\" onClick={() => this.handleCancel()}>Cancel</Button>\r\n            <ActionButton variant=\"primary\" onClick={() => this.handleNext()} disabled={!selected} >Next</ActionButton>\r\n          </Modal.Footer>\r\n        </Modal.Dialog>}\r\n\r\n        {showPermissionsSubscriptionModal && <PermissionsSubscriptionModal onCancel={() => this.handleModalCancel()} userName={this.props.UserName} />}\r\n        {showApproveNewPermissionsModal && <ApproveNewPermissionsModal onCancel={this.handleModalCancel} userName={this.props.UserName} />}\r\n        {showApproveSubscriptionsModal && <ApproveSubscriptionRelationshipsModal onCancel={this.handleModalCancel} userName={this.props.UserName} />}\r\n        {showPermissionsRoleModal && <PermissionsRoleModal onCancel={() => this.handleModalCancel()} userName={this.props.UserName} />}\r\n        {showApproveRolesModal && <ApproveRolePermissionsModal onCancel={() => this.handleModalCancel()} userName={this.props.UserName} />}\r\n      </AppPageWrapper>\r\n    )\r\n  }\r\n\r\n}\r\n\r\nfunction mapStateToProps(state: AppState): PermissionsSelectionProps {\r\n  return {\r\n    UserName: getUserNameForSelectedCompany(state)\r\n  }\r\n}\r\nconst ConnectedPermissionsSelection = connect(mapStateToProps, null)(PermissionsSelection)\r\nexport default ConnectedPermissionsSelection","import React from \"react\"\r\nimport { Modal, Col, Button, Row, Container, Spinner } from \"react-bootstrap\"\r\nimport { Subject, concat, of, Subscription } from \"rxjs\"\r\nimport { catchError, map, switchMap } from \"rxjs/operators\"\r\nimport { toast } from \"react-toastify\"\r\nimport ActionButton from \"../../ActionButton\"\r\nimport { APIError } from \"../../../api/ObservableFromFetch\"\r\nimport { Permission, PendingPermissionsGet, InactivePermissionsGet, PermissionsApprove } from \"../../../api/Administration/Permissions\"\r\nimport DualTableBox from \"../DualTableBox\"\r\nimport Checkbox from \"../../Checkbox\"\r\n\r\ninterface ApproveNewPermissionsModalProps {\r\n  onCancel: () => void\r\n  userName?: string\r\n}\r\n\r\ninterface ApproveNewPermissionsModalState {\r\n  loading: boolean\r\n  saving: boolean\r\n  showInactive: boolean\r\n  permissions: Permission[]\r\n  selectedPermissions: Permission[]\r\n}\r\n\r\nexport default class ApproveNewPermissionsModal extends React.PureComponent<ApproveNewPermissionsModalProps, ApproveNewPermissionsModalState> {\r\n  state: ApproveNewPermissionsModalState = {\r\n    loading: false,\r\n    saving: false,\r\n    showInactive: false,\r\n    permissions: [],\r\n    selectedPermissions: []\r\n  }\r\n\r\n  showInactivePermissions$ = new Subject<boolean>()\r\n  loadSubscription?: Subscription\r\n  saveSubscription?: Subscription\r\n\r\n  componentDidMount() {\r\n    this.loadSubscription = this.showInactivePermissions$.pipe(\r\n      switchMap(showInactive => concat(\r\n        of({ loading: true, showInactive: showInactive }),\r\n        (showInactive\r\n          ? InactivePermissionsGet\r\n          : PendingPermissionsGet\r\n        )().pipe(\r\n          map(result => ({ loading: false, result: result })),\r\n          catchError(() => of({ loading: false }))\r\n        )\r\n      ))\r\n    ).subscribe(\r\n      (o: { loading: boolean, showInactive?: boolean, result?: Permission[] }) => this.setState(prevState => ({\r\n        loading: o.loading,\r\n        showInactive: o.showInactive === undefined ? prevState.showInactive : o.showInactive,\r\n        permissions: o.result || prevState.permissions,\r\n        selectedPermissions: []\r\n      })),\r\n      (error) => this.handleAPIError(error, { loading: false })\r\n    )\r\n    this.showInactivePermissions$.next(this.state.showInactive)\r\n  }\r\n\r\n  componentWillUnmount() {\r\n    this.loadSubscription && this.loadSubscription.unsubscribe()\r\n    this.saveSubscription && this.saveSubscription.unsubscribe()\r\n  }\r\n\r\n  componentDidUpdate(prevProps: ApproveNewPermissionsModalProps, prevState: ApproveNewPermissionsModalState) {\r\n    if (prevState.saving && !this.state.saving) {\r\n      this.showInactivePermissions$.next(this.state.showInactive)\r\n    }\r\n  }\r\n\r\n  handleAPIError = (error: Error | APIError, stateChanges: object) => {\r\n    this.setState(stateChanges)\r\n    error && toast.error((error as APIError)?.errorData?.message || error.message)\r\n  }\r\n\r\n  handleApprove = () => {\r\n    this.setState({ saving: true })\r\n    this.saveSubscription && this.saveSubscription.unsubscribe()\r\n    this.saveSubscription = PermissionsApprove(this.state.selectedPermissions, this.props.userName || \"\").subscribe(\r\n      data => {\r\n        this.setState({ saving: false, permissions: [], selectedPermissions: [] })\r\n        toast.success(data)\r\n      },\r\n      error => this.handleAPIError(error, { saving: false })\r\n    )\r\n  }\r\n\r\n  render() {\r\n    const { loading, saving, showInactive, permissions, selectedPermissions } = this.state\r\n\r\n    return (<>\r\n      <Modal.Dialog size=\"xl\">\r\n        <Modal.Header>\r\n          <Modal.Title className=\"text-uppercase\">APPROVE PERMISSIONS {loading && <Spinner animation=\"border\" />}</Modal.Title>\r\n        </Modal.Header>\r\n        <Modal.Body className=\"px-0\">\r\n          <DualTableBox idKey=\"PermissionID\"\r\n            leftTitle=\"Pending Approval\"\r\n            rightTitle=\"To Be Approved\"\r\n            leftColumns={[{ title: \"PERMISSION\", value: \"Title\" }, { title: \"STATUS\", value: \"RecordStatusType\" }]}\r\n            rightColumns={[{ title: \"PERMISSION\", value: \"Title\" }, { title: \"STATUS\", value: \"RecordStatusType\" }]}\r\n            options={permissions}\r\n            optionsAtRight={selectedPermissions}\r\n            onChange={(options: Permission[]) => this.setState({ selectedPermissions: options })} />\r\n          <Container fluid>\r\n            <Row>\r\n              <Col>\r\n                <Checkbox id=\"showInactive\"\r\n                  label=\"Reactivate Permission\"\r\n                  checked={showInactive}\r\n                  onChange={(e: React.ChangeEvent<HTMLInputElement>) => this.showInactivePermissions$.next(e.target.checked)} />\r\n              </Col>\r\n            </Row>\r\n          </Container>\r\n        </Modal.Body>\r\n        <Modal.Footer>\r\n          <Button variant=\"secondary\" className=\"mr-2\" onClick={this.props.onCancel}>Cancel</Button>\r\n          <ActionButton variant=\"primary\" onClick={this.handleApprove} disabled={loading || saving || selectedPermissions.length === 0} spin={saving} disableOnSpin >Approve</ActionButton>\r\n        </Modal.Footer>\r\n      </Modal.Dialog>\r\n    </>)\r\n  }\r\n}\r\n","import React from \"react\"\r\nimport { Modal, Form, Col, Button, Row, Table, Container, Image } from \"react-bootstrap\"\r\nimport { toast } from \"react-toastify\"\r\nimport ActionButton from \"../../ActionButton\"\r\nimport { APIError } from \"../../../api/ObservableFromFetch\"\r\nimport { NotAssignedPermissionsOfRoleGet, Permission, PermissionInRoleSave, PermissionsOfRoleGet, RoleCreate, RolesGet, UnassignedSubscriptionPermissionsGet } from \"../../../api/Administration/Permissions\"\r\nimport { forkJoin, Subscription } from \"rxjs\"\r\nimport { parseISO, format } from \"date-fns\"\r\nimport DatePicker from 'react-datepicker'\r\nimport Role from \"../../../api/Roles/Model/Role\"\r\nimport { EditPermission } from \"./PermissionsSubscriptionModal\"\r\nimport { BirthdayInput } from \"../../FormattedInputs/BirthdayInput\"\r\nimport NumericInput from 'react-numeric-input'\r\nimport { FaAngleDoubleDown, FaAngleDoubleLeft, FaAngleDoubleRight, FaAngleDoubleUp, FaAngleDown, FaAngleUp, FaChevronLeft, FaChevronRight, FaPencilAlt } from \"react-icons/fa\"\r\nimport FormatDate from \"../../../formatters/FormatDate\"\r\n\r\ninterface PermissionsRoleModalProps {\r\n  onCancel: () => void\r\n  userName?: string\r\n}\r\n\r\ninterface PermissionsRoleModalState {\r\n  loading: boolean\r\n  saving: boolean\r\n  roles: Role[]\r\n  selectedRole?: RoleData\r\n  unassigned: Permission[]\r\n  assigned: Permission[]\r\n  notassigned: Permission[]\r\n  editPermission?: EditPermission\r\n  showAddNewModal: boolean\r\n  showEditModal: boolean\r\n  newRole?: RoleData\r\n  titleDuplicated: boolean\r\n  selectionLeft: number[]\r\n  selectionRight: number[]\r\n}\r\n\r\nexport interface RoleData {\r\n  RoleID?: number\r\n  Description?: string\r\n  Level?: number\r\n  Title?: string\r\n  ActiveDate?: Date\r\n  InActiveDate?: Date\r\n  ModifiedBy?: string\r\n}\r\n\r\nexport default class PermissionsRoleModalModal extends React.PureComponent<PermissionsRoleModalProps, PermissionsRoleModalState> {\r\n  state: PermissionsRoleModalState = {\r\n    loading: false,\r\n    saving: false,\r\n    roles: [],\r\n    selectedRole: undefined,\r\n    unassigned: [],\r\n    assigned: [],\r\n    notassigned: [],\r\n    showAddNewModal: false,\r\n    showEditModal: false,\r\n    editPermission: undefined,\r\n    newRole: undefined,\r\n    titleDuplicated: false,\r\n    selectionLeft: [],\r\n    selectionRight: []\r\n  }\r\n\r\n  initialLoadSubscriptions?: Subscription\r\n  loadSubscription?: Subscription\r\n  updateSubscription?: Subscription\r\n  activedate = React.createRef<DatePicker>()\r\n  inactivedate = React.createRef<DatePicker>()\r\n  roleActivedate = React.createRef<DatePicker>()\r\n  roleInactivedate = React.createRef<DatePicker>()\r\n  newRoleActivedate = React.createRef<DatePicker>()\r\n  newRoleInactivedate = React.createRef<DatePicker>()\r\n\r\n  componentDidMount() {\r\n    this.loadInitialData()\r\n  }\r\n\r\n  componentWillUnmount() {\r\n    this.initialLoadSubscriptions && this.initialLoadSubscriptions.unsubscribe()\r\n    this.loadSubscription && this.loadSubscription.unsubscribe()\r\n    this.updateSubscription && this.updateSubscription.unsubscribe()\r\n  }\r\n\r\n  loadInitialData() {\r\n    this.initialLoadSubscriptions && this.initialLoadSubscriptions.unsubscribe()\r\n    this.setState({ loading: true })\r\n    this.initialLoadSubscriptions = forkJoin({\r\n      roles: RolesGet(),\r\n      unassigned: UnassignedSubscriptionPermissionsGet()\r\n    })\r\n      .subscribe(\r\n        ({ roles, unassigned }) => {\r\n          const roleID = this.state.selectedRole?.RoleID\r\n          this.setState({ roles: [...roles], unassigned: [...unassigned], loading: false, selectedRole: undefined, selectionLeft: [], selectionRight: [] })\r\n          if (roleID) this.selectRole(roleID)\r\n        },\r\n        (error) => {\r\n          this.handleAPIError(error, { loading: false })\r\n        }\r\n      )\r\n  }\r\n\r\n  selectRole = (id: number) => {\r\n    const role = this.state.roles.find(item => item.RoleID === id)\r\n    if (role) {\r\n      this.setState({ selectedRole: { RoleID: role?.RoleID, Title: role?.Title, Description: role?.Description, ActiveDate: parseISO(role?.ActiveDate || \"\"), InActiveDate: parseISO(role?.InActiveDate || \"\"), Level: role?.Level, ModifiedBy: this.props.userName || \"\" } })\r\n\r\n      this.loadSubscription && this.loadSubscription.unsubscribe()\r\n      this.loadSubscription = forkJoin({\r\n        assigned: PermissionsOfRoleGet(role?.RoleID || 0, role?.Title || \"\"),\r\n        notassigned: NotAssignedPermissionsOfRoleGet(role?.RoleID || 0, role?.Title || \"\")\r\n      })\r\n        .subscribe(\r\n          ({ assigned, notassigned }) => this.setState({ assigned: [...assigned], notassigned: [...notassigned], loading: false }),\r\n          (error) => {\r\n            this.handleAPIError(error, { loading: false })\r\n          }\r\n        )\r\n    }\r\n    else {this.setState({ selectedRole: undefined})}\r\n  }\r\n\r\n  handleAPIError = (error: Error | APIError, stateChanges: object) => {\r\n    this.setState(stateChanges)\r\n    error && toast.error((error as APIError)?.errorData?.message || error.message)\r\n  }\r\n\r\n  handleSubmit = () => {\r\n    this.updateSubscription && this.updateSubscription.unsubscribe()\r\n    this.setState({ saving: true })\r\n    const { selectedRole, assigned } = this.state\r\n\r\n    this.updateSubscription = PermissionInRoleSave(selectedRole, assigned).subscribe(\r\n      data => {\r\n        this.setState({ saving: false })\r\n        toast.success(data)\r\n        this.loadInitialData()\r\n      },\r\n      error => this.handleAPIError(error, { saving: false })\r\n    )\r\n   }\r\n\r\n  validSubmit = () => {\r\n    const { selectedRole } = this.state\r\n    return !!selectedRole && !!selectedRole.Title && !!selectedRole.Description && !!selectedRole.ActiveDate && !!selectedRole.InActiveDate && !!selectedRole.Level\r\n  }\r\n\r\n  handleEdit = (permission: Permission) => this.setState({ showEditModal: true, editPermission: { ID: permission.PermissionID, Title: permission.Title, ActiveDate: parseISO(permission.ActiveDate || \"\"), InactiveDate: parseISO(permission.InActiveDate || \"\") } })\r\n  handleEditCancel = () => { this.setState({ showEditModal: false, editPermission: undefined }) }\r\n  handleEditSubmit = () => {\r\n    const { editPermission, assigned } = this.state\r\n    const relatedPermission = assigned.find(item => item.PermissionID === editPermission?.ID)\r\n\r\n    if (relatedPermission) {\r\n      relatedPermission.ActiveDate = format(editPermission?.ActiveDate || 0, \"yyyy-MM-dd'T'HH:mm:ss\")\r\n      relatedPermission.InActiveDate = format(editPermission?.InactiveDate || 0, \"yyyy-MM-dd'T'HH:mm:ss\")\r\n    }\r\n\r\n    this.setState({ showEditModal: false, editPermission: undefined })\r\n  }\r\n\r\n  editValid = () => {\r\n    const { editPermission } = this.state\r\n    return !!editPermission && !!editPermission.ActiveDate && !!editPermission.InactiveDate\r\n   }\r\n\r\n  handleAddNew = () => { this.setState({ showAddNewModal: true }) }\r\n  handleAddNewCancel = () => { this.setState({ showAddNewModal: false, newRole: undefined }) }\r\n  handleAddNewSubmit = () => {\r\n    this.updateSubscription && this.updateSubscription.unsubscribe()\r\n    this.setState({ saving: true })\r\n    const { newRole } = this.state\r\n    const data = {\r\n      Description: newRole?.Description,\r\n      Level: newRole?.Level,\r\n      Title: newRole?.Title,\r\n      ActiveDate: newRole?.ActiveDate,\r\n      InActiveDate: newRole?.InActiveDate,\r\n      ModifiedBy: this.props.userName\r\n    }\r\n\r\n    this.updateSubscription = RoleCreate(data).subscribe(\r\n      data => {\r\n        this.setState({ saving: false, showAddNewModal: false, loading: true })\r\n        toast.success(data)\r\n        RolesGet().subscribe(\r\n          data => this.setState({ roles: data, loading: false, selectedRole: undefined }),\r\n          error => this.handleAPIError(error, { loading: false })\r\n        )\r\n      },\r\n      error => this.handleAPIError(error, { saving: false })\r\n    )\r\n  }\r\n\r\n  addNewValid = () => {\r\n    const { newRole, titleDuplicated } = this.state\r\n    return !!newRole && !!newRole.Title && !!newRole.Description && !!newRole.ActiveDate && !!newRole.InActiveDate && !!newRole.Level && !titleDuplicated\r\n  }\r\n\r\n   handleNewTitleChange = (title: string) => {\r\n    this.setState({ newRole: {...this.state.newRole, Title: title}, titleDuplicated: this.validateTitle(title)})\r\n   }\r\n\r\n   validateTitle = (title: string) => { return this.state.roles.some(role => role.Title === title) }\r\n\r\n  handleRoleActiveDateChange = (date: Date) => {\r\n    const { selectedRole } = this.state\r\n    if (selectedRole) {\r\n      const inactiveDate = selectedRole?.InActiveDate\r\n      const dateiInPast: boolean = inactiveDate instanceof Date && inactiveDate < new Date\r\n      const allowChange = inactiveDate instanceof Date ? date < inactiveDate || dateiInPast : true\r\n      this.setState({ selectedRole: {...selectedRole, ActiveDate: (allowChange ? date : undefined), InActiveDate: (dateiInPast ? undefined : inactiveDate)}})\r\n    }\r\n  }\r\n\r\n  handleRoleInActiveDateChange = (date: Date) => {\r\n    const { selectedRole } = this.state\r\n    if (selectedRole) {\r\n      const activeDate = selectedRole?.ActiveDate\r\n      const allowChange = activeDate instanceof Date ?  date > activeDate : true\r\n      this.setState({ selectedRole: {...selectedRole, InActiveDate: (allowChange ? date : undefined)}})\r\n    }\r\n  }\r\n\r\n  handleActiveDateChange = (date: Date) => {\r\n    const inactiveDate = this.state.editPermission?.InactiveDate\r\n    const dateiInPast: boolean = inactiveDate instanceof Date && inactiveDate < new Date\r\n    const allowChange = inactiveDate instanceof Date ? date < inactiveDate || dateiInPast : true\r\n    this.setState({ editPermission: { ...this.state.editPermission, ActiveDate: allowChange ? date : undefined, InactiveDate: dateiInPast ? undefined : inactiveDate } })\r\n  }\r\n\r\n  handleInActiveDateChange = (date: Date) => {\r\n    const activeDate = this.state.editPermission?.ActiveDate\r\n    const allowChange = activeDate instanceof Date ? date > activeDate : true\r\n    this.setState({ editPermission: { ...this.state.editPermission, InactiveDate: allowChange ? date : undefined } })\r\n  }\r\n\r\n  move(dir: \"ltr\" | \"rtl\", all?: boolean) {\r\n    if (dir === \"ltr\") {\r\n      const ids = !!all ? this.state.notassigned.map(item => item.PermissionID) : this.state.selectionLeft\r\n      this.setState({\r\n        selectionLeft: [],\r\n        notassigned: this.state.notassigned.filter(item => !ids.includes(item.PermissionID)),\r\n        assigned: [...this.state.assigned, ...this.state.notassigned.filter(item => ids.includes(item.PermissionID))]\r\n      })\r\n    } else {\r\n      const ids = !!all ? this.state.assigned.map(item => item.PermissionID) : this.state.selectionRight\r\n      this.setState({\r\n        selectionRight: [],\r\n        notassigned: [...this.state.notassigned, ...this.state.assigned.filter(item => ids.includes(item.PermissionID))],\r\n        assigned: this.state.assigned.filter(item => !ids.includes(item.PermissionID))\r\n      })\r\n    }\r\n  }\r\n\r\n  handleRightItemClick = (id: number) => {\r\n    if (this.state.selectionRight.includes(id)) {\r\n      this.setState({ selectionRight: this.state.selectionRight.filter(item => item !== id) })\r\n    } else {\r\n      this.setState({ selectionRight: [...this.state.selectionRight, id] })\r\n    }\r\n  }\r\n\r\n  render() {\r\n    const { loading, saving, selectedRole, roles, showAddNewModal, showEditModal, editPermission, newRole, titleDuplicated, selectionRight, selectionLeft } = this.state\r\n    const left = !selectedRole ? this.state.unassigned : this.state.notassigned\r\n    const right = !selectedRole ? [] : this.state.assigned\r\n    const disabled = !selectedRole || loading\r\n\r\n    return (\r\n      <>\r\n        <Modal.Dialog size=\"xl\">\r\n          <Modal.Header>\r\n            <Modal.Title className=\"text-uppercase\">Role/Permissions</Modal.Title>\r\n          </Modal.Header>\r\n          <Modal.Body>\r\n            <Form.Row className=\"form-group\">\r\n              <Form.Label column sm={2} htmlFor=\"role\">Role</Form.Label>\r\n              <Col sm={3}>\r\n                <Form.Control id=\"role\" as=\"select\" value={selectedRole?.RoleID?.toString()} onChange={(e) => this.selectRole(Number(e.target.value))}>\r\n                  <option value=\"\">Select Role</option>\r\n                  {roles && roles.map((role: Role) => <option value={role.RoleID} key={role.RoleID}>{role.Title}</option>)}\r\n                </Form.Control>\r\n              </Col>\r\n              <Col sm={1}></Col>\r\n              <Form.Label column sm={2} htmlFor=\"roleActivedate\">Active Date</Form.Label>\r\n              <Col sm={3}>\r\n                <DatePicker className=\"form-control\"\r\n                    ref={this.roleActivedate}\r\n                    required={!!selectedRole}\r\n                    showMonthDropdown\r\n                    showYearDropdown\r\n                    disabled={!selectedRole}\r\n                    minDate={new Date()}\r\n                    dropdownMode=\"select\"\r\n                    popperPlacement=\"right\"\r\n                    selected={selectedRole ? selectedRole?.ActiveDate : undefined}\r\n                    enableTabLoop={false}\r\n                    onKeyDown={(e) => { if (this.roleActivedate && this.roleActivedate.current && e.key === 'Tab') { this.roleActivedate.current.setOpen(false) } }}\r\n                    onChange={date => this.handleRoleActiveDateChange(date as Date)}\r\n                    customInput={<BirthdayInput />} />\r\n              </Col>\r\n            </Form.Row>\r\n            <Form.Row className=\"form-group\">\r\n              <Form.Label column sm={2} htmlFor=\"roleLevel\">Level</Form.Label>\r\n              <Col sm={3}>\r\n                <Form.Control as={NumericInput} id=\"roleLevel\" min={0} value={selectedRole?.Level} disabled={!selectedRole} isInvalid={selectedRole && selectedRole.Level === undefined} strict onChange={(value: any) => this.setState({ selectedRole: {...selectedRole, Level: value as number}})} />\r\n              </Col>\r\n              <Col sm={1}></Col>\r\n              <Form.Label column sm={2} htmlFor=\"roleInActivedate\">Inactive Date</Form.Label>\r\n              <Col sm={3}>\r\n                <DatePicker className=\"form-control\"\r\n                    ref={this.roleInactivedate}\r\n                    required={!!selectedRole}\r\n                    showMonthDropdown\r\n                    showYearDropdown\r\n                    disabled={!selectedRole}\r\n                    minDate={selectedRole?.ActiveDate instanceof Date ? selectedRole?.ActiveDate : new Date()}\r\n                    dropdownMode=\"select\"\r\n                    popperPlacement=\"right\"\r\n                    selected={selectedRole ? selectedRole?.InActiveDate : undefined}\r\n                    enableTabLoop={false}\r\n                    onKeyDown={(e) => { if (this.roleInactivedate && this.roleInactivedate.current && e.key === 'Tab') { this.roleInactivedate.current.setOpen(false) } }}\r\n                    onChange={date => this.handleRoleInActiveDateChange(date as Date)}\r\n                    customInput={<BirthdayInput />} />\r\n              </Col>\r\n            </Form.Row>\r\n            <Form.Row className=\"form-group\">\r\n              <Form.Label column sm={2} htmlFor=\"roleDesc\">Description</Form.Label>\r\n              <Col sm={9}>\r\n                <Form.Control as=\"textarea\"\r\n                  rows={4}\r\n                  isInvalid={selectedRole && selectedRole.Description === \"\"}\r\n                  disabled={!selectedRole}\r\n                  value={selectedRole?.Description || \"\"}\r\n                  onChange={(e) => this.setState({ selectedRole: {...selectedRole, Description: e.target.value}})} />\r\n              </Col>\r\n            </Form.Row>\r\n            <hr />\r\n            <Form className=\"px-4\" hidden={loading}>\r\n              <Row className=\"d-none d-lg-flex\">\r\n                <Col lg={4}>Permissions Not Assigned</Col>\r\n                <Col lg={1} className=\"px-0\"></Col>\r\n                <Col lg={7} className=\"pl-lg-0\">Permissions Assigned</Col>\r\n              </Row>\r\n              <Row>\r\n                <Col className=\"d-lg-none\">Permissions Not Assigned</Col>\r\n                <Col lg={4} className=\"pr-lg-0\">\r\n                  <Form.Control as=\"select\" multiple className=\"grey-selection\" style={{ height: \"288px\", boxShadow: \"none\" }}\r\n                    disabled={false}\r\n                    onChange={(e: React.ChangeEvent<HTMLSelectElement>) => { this.setState({ selectionLeft: Array.from(e.target.selectedOptions, option => Number(option.value)) }) }}>\r\n                    {left.map(item => <option key={item.PermissionID} value={item.PermissionID}>{item.Title}</option>)}\r\n                  </Form.Control>\r\n                </Col>\r\n                <Col lg={1} className=\"px-0\">\r\n                  <Container fluid>\r\n                    <Row>\r\n                      <Col className=\"px-1 text-center\">\r\n                        <Button className=\"btn-sm btn-sm-icon mb-lg-2 mt-lg-0 my-1\" disabled={!left.length || disabled} onClick={() => this.move(\"ltr\", true)}>\r\n                          <FaAngleDoubleRight className=\"d-none d-lg-inline\" />\r\n                          <FaAngleDoubleDown className=\"d-lg-none\" />\r\n                        </Button>\r\n                      </Col>\r\n                      <Col className=\"px-1 text-center\">\r\n                        <Button className=\"btn-sm btn-sm-icon mb-lg-2 mt-lg-0 my-1\" disabled={!selectionLeft.length || disabled} onClick={() => this.move(\"ltr\")}>\r\n                          <FaChevronRight className=\"d-none d-lg-inline\" />\r\n                          <FaAngleDown className=\"d-lg-none\" />\r\n                        </Button>\r\n                      </Col>\r\n                      <Col className=\"px-1 text-center\">\r\n                        <Button className=\"btn-sm btn-sm-icon mb-lg-2 mt-lg-0 my-1\" disabled={!selectionRight.length || disabled} onClick={() => this.move(\"rtl\")}>\r\n                          <FaChevronLeft className=\"d-none d-lg-inline\" />\r\n                          <FaAngleUp className=\"d-lg-none\" />\r\n                        </Button>\r\n                      </Col>\r\n                      <Col className=\"px-1 text-center\">\r\n                        <Button className=\"btn-sm btn-sm-icon mb-lg-2 mt-lg-0 my-1\" disabled={!right.length || disabled} onClick={() => this.move(\"rtl\", true)}>\r\n                          <FaAngleDoubleLeft className=\"d-none d-lg-inline\" />\r\n                          <FaAngleDoubleUp className=\"d-lg-none\" />\r\n                        </Button>\r\n                      </Col>\r\n                    </Row>\r\n                  </Container>\r\n                </Col>\r\n                <Col className=\"d-lg-none\">Permissions Assigned</Col>\r\n                <Col lg={7} className=\"pl-lg-0\" style={{ height: \"288px\", overflowY: \"auto\" }}>\r\n                  <Table className=\"table-sm dark\" borderless responsive>\r\n                    <thead>\r\n                      <tr>\r\n                        <th>Permission</th>\r\n                        <th>Status</th>\r\n                        <th>Active</th>\r\n                        <th>Inactive</th>\r\n                        <th>Edit</th>\r\n                      </tr>\r\n                    </thead>\r\n                    <tbody>\r\n                      {right.map(item => <tr key={item.PermissionID} className={selectionRight.includes(item.PermissionID) ? \"selected\" : \"\"} onClick={() => this.handleRightItemClick(item.PermissionID)}>\r\n                        <td>{item.Title}</td>\r\n                        <td>{item.RecordStatusType}</td>\r\n                        <td>{FormatDate(item.ActiveDate)}</td>\r\n                        <td>{FormatDate(item.InActiveDate)}</td>\r\n                        <td>\r\n                          <Button variant=\"icon-link\" size=\"sm\" className=\"btn-icon-primary\" onClick={() => { this.handleEdit(item) }}>\r\n                            <FaPencilAlt />\r\n                          </Button>\r\n                        </td>\r\n                      </tr>)}\r\n                    </tbody>\r\n                  </Table>\r\n                </Col>\r\n              </Row>\r\n            </Form>\r\n          </Modal.Body>\r\n          <Modal.Footer>\r\n            <ActionButton variant=\"primary\" onClick={this.handleAddNew} disabled={!!this.state.selectedRole} >Add New</ActionButton>\r\n            <Button variant=\"secondary\" className=\"mr-2\" onClick={() => this.props.onCancel()}>Cancel</Button>\r\n            <ActionButton variant=\"primary\" onClick={this.handleSubmit} disabled={loading || saving || !this.validSubmit()} >Submit</ActionButton>\r\n          </Modal.Footer>\r\n        </Modal.Dialog>\r\n\r\n        <Modal show={showAddNewModal} onHide={() => this.handleAddNewCancel()} size=\"lg\" backdrop=\"static\" dialogClassName=\"dark\">\r\n          <Modal.Header>\r\n            <Modal.Title className=\"text-uppercase\">Add New Role</Modal.Title>\r\n          </Modal.Header>\r\n          <Modal.Body>\r\n            <Form.Row className=\"form-group required\">\r\n              <Form.Label column sm={2} htmlFor=\"newName\">Role</Form.Label>\r\n              <Col sm={3}>\r\n                <Form.Control id=\"newName\" type=\"text\" value={newRole?.Title} isInvalid={(newRole && !newRole.Title) || titleDuplicated} onChange={(e) => this.handleNewTitleChange(e.target.value)} />\r\n                {titleDuplicated && <Form.Control.Feedback type=\"invalid\" className=\"d-block\">The Role Already Exists. Please reenter or modify and press the next button.\"</Form.Control.Feedback>}\r\n              </Col>\r\n              <Col sm={1}></Col>\r\n              <Form.Label column sm={2} htmlFor=\"newRoleActivedate\">Active Date</Form.Label>\r\n              <Col sm={3}>\r\n                <DatePicker className=\"form-control\"\r\n                    ref={this.newRoleActivedate}\r\n                    required={!!newRole}\r\n                    showMonthDropdown\r\n                    showYearDropdown\r\n                    minDate={new Date()}\r\n                    maxDate={newRole?.InActiveDate}\r\n                    dropdownMode=\"select\"\r\n                    popperPlacement=\"right\"\r\n                    selected={newRole ? newRole?.ActiveDate : undefined}\r\n                    enableTabLoop={false}\r\n                    onKeyDown={(e) => { if (this.newRoleActivedate && this.newRoleActivedate.current && e.key === 'Tab') { this.newRoleActivedate.current.setOpen(false) } }}\r\n                    onChange={date => this.setState({ newRole: {...newRole, ActiveDate: date as Date}})}\r\n                    customInput={<BirthdayInput />} />\r\n              </Col>\r\n            </Form.Row>\r\n            <Form.Row className=\"form-group required\">\r\n              <Form.Label column sm={2} htmlFor=\"newLevel\">Level</Form.Label>\r\n              <Col sm={3}>\r\n                <Form.Control as={NumericInput} id=\"newLevel\" min={0} value={newRole?.Level} isInvalid={newRole && newRole.Level === undefined} required={!!newRole} strict onChange={(value: any) => this.setState({ newRole: {...newRole, Level: value as number}})} />\r\n              </Col>\r\n              <Col sm={1}></Col>\r\n              <Form.Label column sm={2} htmlFor=\"newRoleInActivedate\">Inactive Date</Form.Label>\r\n              <Col sm={3}>\r\n                <DatePicker className=\"form-control\"\r\n                    ref={this.newRoleInactivedate}\r\n                    required={!!newRole}\r\n                    showMonthDropdown\r\n                    showYearDropdown\r\n                    minDate={newRole?.ActiveDate}\r\n                    dropdownMode=\"select\"\r\n                    popperPlacement=\"right\"\r\n                    selected={newRole ? newRole?.InActiveDate : undefined}\r\n                    enableTabLoop={false}\r\n                    onKeyDown={(e) => { if (this.newRoleInactivedate && this.newRoleInactivedate.current && e.key === 'Tab') { this.newRoleInactivedate.current.setOpen(false) } }}\r\n                    onChange={date => this.setState({ newRole: {...newRole, InActiveDate: date as Date}})}\r\n                    customInput={<BirthdayInput />} />\r\n              </Col>\r\n            </Form.Row>\r\n            <Form.Row className=\"form-group required\">\r\n              <Form.Label column sm={2} htmlFor=\"newDescription\">Description</Form.Label>\r\n                <Col sm={9}>\r\n                  <Form.Control as=\"textarea\"\r\n                    rows={4}\r\n                    isInvalid={newRole && !newRole.Description}\r\n                    value={newRole?.Description}\r\n                    onChange={(e) => this.setState({ newRole: {...newRole, Description: e.target.value} })} />\r\n                </Col>\r\n            </Form.Row>\r\n          </Modal.Body>\r\n          <Modal.Footer>\r\n            <Button variant=\"secondary\" className=\"mr-2\" onClick={() => this.handleAddNewCancel()}>Cancel</Button>\r\n            <ActionButton variant=\"primary\" onClick={() => this.handleAddNewSubmit()} disabled={!this.addNewValid()} spin={saving} disableOnSpin>Next</ActionButton>\r\n          </Modal.Footer>\r\n        </Modal>\r\n\r\n        {!!editPermission && <Modal show={showEditModal} onHide={() => this.handleEditCancel()} size=\"lg\" backdrop=\"static\" dialogClassName=\"dark\">\r\n          <Modal.Header>\r\n            <Modal.Title className=\"text-uppercase\">Edit Permission</Modal.Title>\r\n          </Modal.Header>\r\n          <Modal.Body>\r\n            <Form.Row className=\"form-group required\">\r\n              <Form.Label column lg={2} htmlFor=\"editSubs\" className=\"required\">Role</Form.Label>\r\n              <Col lg={4}>\r\n                <Form.Control id=\"editSubs\" type=\"text\" defaultValue={selectedRole?.Title} disabled={true} />\r\n              </Col>\r\n              <Col lg={1}></Col>\r\n              <Form.Label column lg={2} htmlFor=\"editActive\">Active Date</Form.Label>\r\n              <Col lg={3}>\r\n                <DatePicker className=\"form-control\"\r\n                  ref={this.activedate}\r\n                  required={true}\r\n                  showMonthDropdown\r\n                  showYearDropdown\r\n                  minDate={new Date()}\r\n                  dropdownMode=\"select\"\r\n                  popperPlacement=\"right\"\r\n                  selected={editPermission?.ActiveDate}\r\n                  enableTabLoop={false}\r\n                  onKeyDown={(e) => { if (this.activedate && this.activedate.current && e.key === 'Tab') { this.activedate.current.setOpen(false) } }}\r\n                  onChange={date => this.handleActiveDateChange(date as Date)}\r\n                  customInput={<BirthdayInput />} />\r\n              </Col>\r\n            </Form.Row>\r\n            <Form.Row className=\"form-group required\">\r\n              <Form.Label column lg={2} htmlFor=\"editPerm\" className=\"required\">Permission</Form.Label>\r\n              <Col lg={4}>\r\n                <Form.Control id=\"editPerm\" type=\"text\" defaultValue={editPermission?.Title} disabled={true} />\r\n              </Col>\r\n              <Col lg={1}></Col>\r\n              <Form.Label column lg={2} htmlFor=\"editInactive\">Inactive Date</Form.Label>\r\n              <Col lg={3}>\r\n                <DatePicker className=\"form-control\"\r\n                  ref={this.inactivedate}\r\n                  required={true}\r\n                  showMonthDropdown\r\n                  showYearDropdown\r\n                  dropdownMode=\"select\"\r\n                  popperPlacement=\"right\"\r\n                  minDate={editPermission?.ActiveDate instanceof Date ? editPermission?.ActiveDate : new Date()}\r\n                  selected={editPermission?.InactiveDate}\r\n                  enableTabLoop={false}\r\n                  onKeyDown={(e) => { if (this.inactivedate && this.inactivedate.current && e.key === 'Tab') { this.inactivedate.current.setOpen(false) } }}\r\n                  onChange={date => this.handleInActiveDateChange(date as Date)}\r\n                  customInput={<BirthdayInput />} />\r\n              </Col>\r\n            </Form.Row>\r\n          </Modal.Body>\r\n          <Modal.Footer>\r\n            <Button variant=\"secondary\" className=\"mr-2\" onClick={() => this.handleEditCancel()}>Cancel</Button>\r\n            <ActionButton variant=\"primary\" onClick={() => this.handleEditSubmit()} disabled={!this.editValid()} spin={saving} disableOnSpin>Finish</ActionButton>\r\n          </Modal.Footer>\r\n        </Modal>}\r\n      </>\r\n    )\r\n  }\r\n}\r\n","import React from \"react\"\r\nimport { Modal, Col, Button, Row, Container, Spinner } from \"react-bootstrap\"\r\nimport { Subject, concat, of, Subscription } from \"rxjs\"\r\nimport { catchError, map, switchMap } from \"rxjs/operators\"\r\nimport { toast } from \"react-toastify\"\r\nimport ActionButton from \"../../ActionButton\"\r\nimport { APIError } from \"../../../api/ObservableFromFetch\"\r\nimport { Permission, PendingRolePermissionsGet, InactiveRolePermissionsGet, RolePermissionsApprove } from \"../../../api/Administration/Permissions\"\r\nimport DualTableBox from \"../DualTableBox\"\r\nimport Checkbox from \"../../Checkbox\"\r\n\r\ninterface ApproveRolePermissionsModalProps {\r\n  onCancel: () => void\r\n  userName?: string\r\n}\r\n\r\ninterface ApproveRolePermissionsModalState {\r\n  loading: boolean\r\n  saving: boolean\r\n  showInactive: boolean\r\n  permissions: Permission[]\r\n  selectedPermissions: Permission[]\r\n}\r\n\r\nexport default class ApproveRolePermissionsModal extends React.PureComponent<ApproveRolePermissionsModalProps, ApproveRolePermissionsModalState> {\r\n  state: ApproveRolePermissionsModalState = {\r\n    loading: false,\r\n    saving: false,\r\n    showInactive: false,\r\n    permissions: [],\r\n    selectedPermissions: []\r\n  }\r\n\r\n  showInactivePermissions$ = new Subject<boolean>()\r\n  loadSubscription?: Subscription\r\n  saveSubscription?: Subscription\r\n\r\n  componentDidMount() {\r\n    this.loadSubscription = this.showInactivePermissions$.pipe(\r\n      switchMap(showInactive => concat(\r\n        of({ loading: true, showInactive: showInactive }),\r\n        (showInactive\r\n          ? InactiveRolePermissionsGet\r\n          : PendingRolePermissionsGet\r\n        )().pipe(\r\n          map(result => ({ loading: false, result: result })),\r\n          catchError(() => of({ loading: false }))\r\n        )\r\n      ))\r\n    ).subscribe(\r\n      (o: { loading: boolean, showInactive?: boolean, result?: Permission[] }) => this.setState(prevState => ({\r\n        loading: o.loading,\r\n        showInactive: o.showInactive === undefined ? prevState.showInactive : o.showInactive,\r\n        permissions: o.result || prevState.permissions,\r\n        selectedPermissions: []\r\n      })),\r\n      (error) => this.handleAPIError(error, { loading: false })\r\n    )\r\n    this.showInactivePermissions$.next(this.state.showInactive)\r\n  }\r\n\r\n  componentWillUnmount() {\r\n    this.loadSubscription && this.loadSubscription.unsubscribe()\r\n    this.saveSubscription && this.saveSubscription.unsubscribe()\r\n  }\r\n\r\n  componentDidUpdate(prevProps: ApproveRolePermissionsModalProps, prevState: ApproveRolePermissionsModalState) {\r\n    if (prevState.saving && !this.state.saving) {\r\n      this.showInactivePermissions$.next(this.state.showInactive)\r\n    }\r\n  }\r\n\r\n  handleAPIError = (error: Error | APIError, stateChanges: object) => {\r\n    this.setState(stateChanges)\r\n    error && toast.error((error as APIError)?.errorData?.message || error.message)\r\n  }\r\n\r\n  handleApprove = () => {\r\n    this.setState({ saving: true })\r\n    this.saveSubscription && this.saveSubscription.unsubscribe()\r\n    this.saveSubscription = RolePermissionsApprove(this.state.selectedPermissions, this.props.userName || \"\").subscribe(\r\n      data => {\r\n        this.setState({ saving: false, permissions: [], selectedPermissions: [] })\r\n        toast.success(data)\r\n      },\r\n      error => this.handleAPIError(error, { saving: false })\r\n    )\r\n  }\r\n\r\n  render() {\r\n    const { loading, saving, showInactive, permissions, selectedPermissions } = this.state\r\n\r\n    return (<>\r\n      <Modal.Dialog size=\"xl\">\r\n        <Modal.Header>\r\n          <Modal.Title className=\"text-uppercase\">Approve Roles/Permissions {loading && <Spinner animation=\"border\" />}</Modal.Title>\r\n        </Modal.Header>\r\n        <Modal.Body className=\"px-0\">\r\n          <DualTableBox idKey=\"PermissionID\"\r\n            leftTitle=\"Pending Approval\"\r\n            rightTitle=\"To Be Approved\"\r\n            leftColumns={[{ title: \"Role\", value: \"Role\" }, { title: \"Permission\", value: \"Permission\" }, { title: \"Status\", value: \"RecordStatusType\" }]}\r\n            rightColumns={[{ title: \"Role\", value: \"Role\" }, { title: \"Permission\", value: \"Permission\" }, { title: \"Status\", value: \"RecordStatusType\" }]}\r\n            options={permissions}\r\n            optionsAtRight={selectedPermissions}\r\n            onChange={(options: Permission[]) => this.setState({ selectedPermissions: options })} />\r\n          <Container fluid>\r\n            <Row>\r\n              <Col>\r\n                <Checkbox id=\"showInactive\"\r\n                  label=\"Reactivate Roles/Permission\"\r\n                  checked={showInactive}\r\n                  onChange={(e: React.ChangeEvent<HTMLInputElement>) => this.showInactivePermissions$.next(e.target.checked)} />\r\n              </Col>\r\n            </Row>\r\n          </Container>\r\n        </Modal.Body>\r\n        <Modal.Footer>\r\n          <Button variant=\"secondary\" className=\"mr-2\" onClick={() => this.props.onCancel()}>Cancel</Button>\r\n          <ActionButton variant=\"primary\" onClick={this.handleApprove} disabled={loading || saving || selectedPermissions.length === 0} spin={saving} disableOnSpin >Approve</ActionButton>\r\n        </Modal.Footer>\r\n      </Modal.Dialog>\r\n    </>)\r\n  }\r\n}\r\n","import React from \"react\"\r\nimport { Modal, Col, Button, Row, Container, Spinner } from \"react-bootstrap\"\r\nimport { Subject, concat, of, Subscription } from \"rxjs\"\r\nimport { catchError, map, switchMap } from \"rxjs/operators\"\r\nimport { toast } from \"react-toastify\"\r\nimport ActionButton from \"../../ActionButton\"\r\nimport { APIError } from \"../../../api/ObservableFromFetch\"\r\nimport { Permission, PendingSubscriptionsPermissionsMappingGet, InactiveSubscriptionsPermissionsMappingGet, SubscriptionsPermissionsMappingApprove } from \"../../../api/Administration/Permissions\"\r\nimport DualTableBox from \"../DualTableBox\"\r\nimport Checkbox from \"../../Checkbox\"\r\n\r\ninterface ApproveSubscriptionRelationshipsModalProps {\r\n  onCancel: () => void\r\n  userName?: string\r\n}\r\n\r\ninterface ApproveSubscriptionRelationshipsModalState {\r\n  loading: boolean\r\n  saving: boolean\r\n  showInactive: boolean\r\n  permissions: Permission[]\r\n  selectedPermissions: Permission[]\r\n}\r\n\r\nexport default class ApproveSubscriptionRelationshipsModal extends React.PureComponent<ApproveSubscriptionRelationshipsModalProps, ApproveSubscriptionRelationshipsModalState> {\r\n  state: ApproveSubscriptionRelationshipsModalState = {\r\n    loading: false,\r\n    saving: false,\r\n    showInactive: false,\r\n    permissions: [],\r\n    selectedPermissions: []\r\n  }\r\n\r\n  showInactivePermissions$ = new Subject<boolean>()\r\n  loadSubscription?: Subscription\r\n  saveSubscription?: Subscription\r\n\r\n  componentDidMount() {\r\n    this.loadSubscription = this.showInactivePermissions$.pipe(\r\n      switchMap(showInactive => concat(\r\n        of({ loading: true, showInactive: showInactive }),\r\n        (showInactive\r\n          ? InactiveSubscriptionsPermissionsMappingGet\r\n          : PendingSubscriptionsPermissionsMappingGet\r\n        )().pipe(\r\n          map(result => ({ loading: false, result: result })),\r\n          catchError(() => of({ loading: false }))\r\n        )\r\n      ))\r\n    ).subscribe(\r\n      (o: { loading: boolean, showInactive?: boolean, result?: Permission[] }) => this.setState(prevState => ({\r\n        loading: o.loading,\r\n        showInactive: o.showInactive === undefined ? prevState.showInactive : o.showInactive,\r\n        permissions: o.result || prevState.permissions,\r\n        selectedPermissions: []\r\n      })),\r\n      (error) => this.handleAPIError(error, { loading: false })\r\n    )\r\n    this.showInactivePermissions$.next(this.state.showInactive)\r\n  }\r\n\r\n  componentWillUnmount() {\r\n    this.loadSubscription && this.loadSubscription.unsubscribe()\r\n    this.saveSubscription && this.saveSubscription.unsubscribe()\r\n  }\r\n\r\n  componentDidUpdate(prevProps: ApproveSubscriptionRelationshipsModalProps, prevState: ApproveSubscriptionRelationshipsModalState) {\r\n    if (prevState.saving && !this.state.saving) {\r\n      this.showInactivePermissions$.next(this.state.showInactive)\r\n    }\r\n  }\r\n\r\n  handleAPIError = (error: Error | APIError, stateChanges: object) => {\r\n    this.setState(stateChanges)\r\n    error && toast.error((error as APIError)?.errorData?.message || error.message)\r\n  }\r\n\r\n  handleApprove = () => {\r\n    this.setState({ saving: true })\r\n    this.saveSubscription && this.saveSubscription.unsubscribe()\r\n    this.saveSubscription = SubscriptionsPermissionsMappingApprove(this.state.selectedPermissions, this.props.userName || \"\").subscribe(\r\n      data => {\r\n        this.setState({ saving: false, permissions: [], selectedPermissions: [] })\r\n        toast.success(data)\r\n      },\r\n      error => this.handleAPIError(error, { saving: false })\r\n    )\r\n  }\r\n\r\n  render() {\r\n    const { loading, saving, showInactive, permissions, selectedPermissions } = this.state\r\n\r\n    return (<>\r\n      <Modal.Dialog size=\"xl\">\r\n        <Modal.Header>\r\n          <Modal.Title className=\"text-uppercase\">APPROVE SUBSCRIPTION/PERMISSIONS {loading && <Spinner animation=\"border\" />}</Modal.Title>\r\n        </Modal.Header>\r\n        <Modal.Body className=\"px-0\">\r\n          <DualTableBox idKey=\"PermissionID\"\r\n            leftTitle=\"Pending Approval\"\r\n            rightTitle=\"To Be Approved\"\r\n            leftColumns={[{ title: \"Subscription\", value: \"SubscriptionPlan\" }, { title: \"Permission\", value: \"Permission\" }, { title: \"Status\", value: \"RecordStatusType\" }]}\r\n            rightColumns={[{ title: \"Subscription\", value: \"SubscriptionPlan\" }, { title: \"Permission\", value: \"Permission\" }, { title: \"Status\", value: \"RecordStatusType\" }]}\r\n            options={permissions}\r\n            optionsAtRight={selectedPermissions}\r\n            onChange={(options: Permission[]) => this.setState({ selectedPermissions: options })} />\r\n          <Container fluid>\r\n            <Row>\r\n              <Col>\r\n                <Checkbox id=\"showInactive\"\r\n                  label=\"Reactivate Subscription/Permission\"\r\n                  checked={showInactive}\r\n                  onChange={(e: React.ChangeEvent<HTMLInputElement>) => this.showInactivePermissions$.next(e.target.checked)} />\r\n              </Col>\r\n            </Row>\r\n          </Container>\r\n        </Modal.Body>\r\n        <Modal.Footer>\r\n          <Button variant=\"secondary\" className=\"mr-2\" onClick={this.props.onCancel}>Cancel</Button>\r\n          <ActionButton variant=\"primary\" onClick={this.handleApprove} disabled={loading || saving || selectedPermissions.length === 0} spin={saving} disableOnSpin >Approve</ActionButton>\r\n        </Modal.Footer>\r\n      </Modal.Dialog>\r\n    </>)\r\n  }\r\n}\r\n","import { Component } from \"react\"\r\nimport { Redirect, Route, RouteProps } from \"react-router-dom\"\r\nimport UserAccessSettings from \"../authentication/UserAccessSettings\"\r\nimport UserState from \"../authentication/UserState\"\r\nimport HasAccessToRoute, { HasAccessToAtLeastOneRoute } from \"../authentication/hasAccessToRoute\"\r\nimport { Home } from \"../config/Routes\"\r\n\r\nexport interface ProtectedRouteProps {\r\n  userAccess: UserAccessSettings\r\n  userState: UserState\r\n}\r\n\r\nexport default class ProtectedRoute extends Component<ProtectedRouteProps & RouteProps>{\r\n  render() {\r\n    const { path, userAccess, userState } = this.props\r\n    const hasAccess = !!path && Array.isArray(path)\r\n      ? HasAccessToAtLeastOneRoute(path, userAccess, userState)\r\n      : HasAccessToRoute(path as string | undefined, userAccess, userState)\r\n    return hasAccess ? <Route {...this.props} /> : <Redirect to={Home} />\r\n  }\r\n}\r\n","import { PortalAdministrationRoute, MyInformationRoute, OrdersRoute, OrderRoute, SSOOrderRoute, SSOSiteSearchRoute, SSOGetAuthFormRoute } from \"../config/Routes\"\r\nimport HasAccessToRoute from \"./hasAccessToRoute\"\r\nimport UserAccessSettings from \"./UserAccessSettings\"\r\nimport UserState from \"./UserState\"\r\n\r\nexport function GetUserDefaultRoute(userAccess: UserAccessSettings, userState: UserState): string {\r\n  const isSSO = userState.ssoToken !== \"\"\r\n  const routes = userAccess.isSiteAdmin ? [PortalAdministrationRoute, MyInformationRoute] : (isSSO ? [SSOSiteSearchRoute, SSOOrderRoute, SSOGetAuthFormRoute] : [OrdersRoute, OrderRoute, MyInformationRoute])\r\n  return routes.find(route => HasAccessToRoute(route, userAccess, userState)) || \"\"\r\n}\r\n","import React, { Component } from \"react\"\r\nimport { Table, Image } from \"react-bootstrap\"\r\nimport dotImage from \"../../assets/images/dot-img.png\"\r\nimport { GovServiceDataModel } from \"./OrderModels\"\r\n\r\nexport interface GovOrderedServicesProps {\r\n  service?: GovServiceDataModel,\r\n}\r\n\r\nexport default class GovOrderedServices extends Component<GovOrderedServicesProps> {\r\n  render() {\r\n    const { service } = this.props\r\n    return (\r\n      <div>\r\n        <Table className=\"table-sm dark\" responsive>\r\n          <thead>\r\n            <tr>\r\n              <th>SERVICE TYPE</th>\r\n              <th></th>\r\n              <th>ACCOUNT</th>\r\n              <th>TEST TO BE PERFORMED</th>\r\n            </tr>\r\n          </thead>\r\n          <tbody>\r\n              <tr key={service?.id}>\r\n                <td className=\"justify-content-between\">\r\n                  <span>{service?.serviceType}</span>\r\n                </td>\r\n                <td><Image className=\"ml-auto\" src={dotImage} hidden={service?.isDOT !== true} /></td>\r\n                <td>{service?.labAccount}</td>\r\n                <td>{service?.testToPerform}</td>\r\n              </tr>\r\n          </tbody>\r\n        </Table>\r\n      </div>\r\n    )\r\n  }\r\n}\r\n","const FormatGender = (gender: string = \"\") => {\r\n  switch (gender) {\r\n    case \"M\":\r\n      return \"Male\"\r\n    case \"F\":\r\n      return \"Female\"\r\n    default:\r\n      return \"Unknown\"\r\n  }\r\n}\r\n\r\nexport default FormatGender\r\n","import { Col, Container, Row } from \"react-bootstrap\"\r\nimport FormatDate from \"../../formatters/FormatDate\"\r\nimport FormatGender from \"../../formatters/FormatGender\"\r\nimport { DonorInformationModel } from \"./OrderModels\"\r\nimport FormatPhone from \"../../formatters/FormatPhone\"\r\n\r\nexport interface GovOrderDonorInfo extends DonorInformationModel {\r\n  accessCode?: number\r\n}\r\n\r\nconst GovOrderDonorInfo = (props: GovOrderDonorInfo) => {\r\n  const {\r\n    donorId,\r\n    firstName,\r\n    lastName,\r\n    accessCode,\r\n    birthdate,\r\n    gender,\r\n    daytimePhone\r\n  } = props\r\n\r\n  return (\r\n    <Container fluid className=\"px-0 mb-3\">\r\n      <Row>\r\n        <Col md={2}>\r\n          <span className=\"h6\">ID:</span> {donorId}\r\n        </Col>\r\n        <Col md={2}>\r\n          <span className=\"h6\">First Name:</span> {firstName}\r\n        </Col>\r\n        <Col md={2}>\r\n          <span className=\"h6\">Last Name:</span> {lastName}\r\n        </Col>\r\n        <Col md={2}>\r\n          <span className=\"h6\">Access Code:</span> {accessCode}\r\n        </Col>\r\n        <Col></Col>\r\n      </Row>\r\n      <Row>\r\n        <Col md={2}>\r\n          <span className=\"h6\">DOB:</span> {FormatDate(birthdate)}\r\n        </Col>\r\n        <Col md={2}>\r\n          <span className=\"h6\">Gender:</span> {FormatGender(gender)}\r\n        </Col>\r\n        <Col></Col>\r\n      </Row>\r\n      <Row>\r\n        <Col md={12}>\r\n          <span className=\"h6\">Phone:</span> {FormatPhone(daytimePhone || \"\")}\r\n        </Col>\r\n      </Row>\r\n    </Container>\r\n  )\r\n}\r\n\r\nexport default GovOrderDonorInfo\r\n","import { Component } from \"react\"\r\nimport { toast } from \"react-toastify\"\r\nimport { Container, Row, Col, Button, Form } from \"react-bootstrap\"\r\nimport { RouteComponentProps } from \"react-router\"\r\nimport { Subscription } from \"rxjs\"\r\nimport DonorInformation from \"./DonorInformation\"\r\nimport { DonorInformationModel, OTHER_REASON_TEXT, GetRegulatoryModeDonor, GovServiceDataModel, GovLabModel, GovPanelModel, ServiceTypeOld } from \"./OrderModels\"\r\nimport OrderRequestsHeader, { StepData } from \"./OrderRequestsHeader\"\r\nimport PotentialDonorMatchModal from \"./PotentialDonorMatchModal\"\r\nimport FormatDate from \"../../formatters/FormatDate\"\r\nimport FormatPhone from \"../../formatters/FormatPhone\"\r\nimport ActionButton from \"../ActionButton\"\r\nimport { AppPageWrapper } from \"../NavMenu/AppPageWrapper\"\r\nimport { TestReasonsObservable, RegulatoryModeObservable } from \"../../api/OrderRequests/OrderRequestsConstraintGet\"\r\nimport { TestReasonType } from \"../../api/OrderRequests/OrderRequestsModel/TestReasonType\"\r\nimport { AdvanceSearchDonorGetObservable } from \"../../api/OrderRequests/SearchDonorGet\"\r\nimport { Donor } from \"../../api/OrderRequests/OrderRequestsModel/Donor\"\r\nimport OrderData from \"../../api/OrderRequests/OrderRequestsModel/OrderData\"\r\nimport { EventType, MaxDonorIdLength, StorageKey } from \"../../config/Constants\"\r\nimport GovCollection from \"./GovCollection\"\r\nimport GovOrderedService from \"./GovOrderedService\"\r\nimport { GovPanel, SampleType } from \"../../api/Randoms/GovPoolModel/CollectionTypeResponse\"\r\nimport LabAccount from \"../../api/LabService/LabServiceModel/LabAccount\"\r\nimport ConfirmationModal from \"../ConfirmationModal\"\r\nimport SaveOrder from \"../../api/OrderRequests/OrderRequestsModel/SaveOrder\"\r\nimport OrderSubmitObservable from \"../../api/OrderRequests/OrderSubmit\"\r\nimport AutoFilterCompany from \"../../api/Companies/CompanyModel/AutoFilterCompany\"\r\nimport AutoFilterCompaniesGetObservable from \"../../api/Companies/AutoFilterCompaniesGet\"\r\nimport GridRow from \"../../api/GovDonor/GridRow\"\r\nimport GovDevice from \"../../api/Randoms/GovPoolModel/GovDevice\"\r\nimport { OrdersRoute } from \"../../config/Routes\"\r\nimport FormatError from \"../../formatters/FormatError\"\r\nimport { addProcessingCollectionTest } from \"../../api/CachedCollectionTest\"\r\nimport GovPerformCollection, { GovPerformCollectionProps } from \"./GovPerformCollection\"\r\nimport { FullBaseUrl } from \"../../api/ApiUrl\"\r\nimport GovOrderDonorInfo from \"./GovOrderDonorInfo\"\r\n\r\ninterface GovOrderRequestProps {\r\n  location: {\r\n    state?: {\r\n      formData?: GridRow[],\r\n      pendingRandom?: boolean\r\n    },\r\n  }\r\n}\r\n\r\ninterface GovOrderRequestData {\r\n  company?: string,\r\n  selectedCompany?: AutoFilterCompany\r\n  companyID: number,\r\n  reasonObj?: TestReasonType,\r\n  reasonOther?: string\r\n  reason?: string\r\n  donor: DonorInformationModel\r\n}\r\n\r\ninterface GovOrderRequestState extends GovOrderRequestData {\r\n  formKey: string\r\n  step: number\r\n  infoHtml?: string\r\n  isDonorInfoSuccess: boolean\r\n  showPotentialMatches: boolean\r\n  potentialDonorMatchList: Donor[]\r\n  isDonorValid: boolean\r\n  reasonsLoading: boolean\r\n  companies: AutoFilterCompany[]\r\n  reasons: TestReasonType[]\r\n  idTypes: GetRegulatoryModeDonor[]\r\n  orderSubmitting: boolean\r\n  submittedOrder: boolean\r\n  authorizationID?: number\r\n  accessCode?: number\r\n  showConfirmation: boolean\r\n  serviceDOT?: boolean\r\n  sampleType?: SampleType\r\n  isPOCTDevice: boolean\r\n  labAccount?: LabAccount\r\n  panel?: GovPanel\r\n  device?: GovDevice\r\n  testDetailID: string\r\n  showPerformCollection: boolean\r\n}\r\n\r\nexport interface DonorData {\r\n  PersonID: number\r\n  FirstName: string\r\n  LastName: string\r\n  DonorID: string\r\n  IDType: string\r\n  MockDonorID: string\r\n}\r\n\r\nconst RandomReason = \"Random\"\r\n\r\nconst emptyDonor: DonorInformationModel = {\r\n  idType: undefined,\r\n  idTypeObj: undefined,\r\n  state: undefined,\r\n  stateCode: undefined,\r\n  donorId: undefined,\r\n  firstName: undefined,\r\n  middleInitial: undefined,\r\n  lastName: undefined,\r\n  eveningPhone: undefined,\r\n  daytimePhone: undefined,\r\n  birthdate: undefined,\r\n  gender: undefined\r\n}\r\n\r\nconst emptyData: GovOrderRequestData = {\r\n  company: undefined,\r\n  companyID: 0,\r\n  selectedCompany: undefined,\r\n  reasonObj: undefined,\r\n  reasonOther: undefined,\r\n  reason: undefined,\r\n  donor: { ...emptyDonor }\r\n}\r\n\r\nconst buildOrderRequestData = (orderFormData?: GridRow[]) => ({\r\n  ...emptyData,\r\n  company: orderFormData ? orderFormData[0]?.CompanyName : undefined,\r\n  reason: orderFormData ? RandomReason : undefined,\r\n  donor: {\r\n    ...emptyDonor,\r\n    idType: \"EmployerID\",\r\n    donorId: orderFormData ? orderFormData[0]?.EmployerID.toString() : undefined,\r\n  }\r\n})\r\n\r\nexport default class GovOrderRequest extends Component<GovOrderRequestProps, GovOrderRequestState> {\r\n  completingPendingOrders: boolean = false\r\n  pendingRandom?: boolean\r\n  serviceDOT?: boolean\r\n  sampleType?: SampleType\r\n  labAccount?: LabAccount\r\n  panel?: GovPanel\r\n  device?: GovDevice\r\n  orderFormData?: GridRow[]\r\n  testDetailID: string\r\n  donorData?: DonorData\r\n  accessCode?: number\r\n\r\n  constructor(props: GovOrderRequestProps) {\r\n    super(props)\r\n\r\n    this.orderFormData = props.location.state?.formData\r\n    this.pendingRandom = props.location.state?.pendingRandom\r\n    if (this.orderFormData) {\r\n      this.completingPendingOrders = (typeof this.pendingRandom === 'undefined') ? true : this.pendingRandom\r\n      this.donorData = {\r\n        PersonID: this.orderFormData[0].PersonID,\r\n        FirstName: this.orderFormData[0].FirstName,\r\n        LastName: this.orderFormData[0].LastName,\r\n        DonorID: (this.orderFormData[0].EmployerID || \"\").toString(),\r\n        IDType: \"EmployerID\",\r\n        MockDonorID: (this.orderFormData[0].DonorID || \"\").toString(),\r\n      }\r\n      this.serviceDOT = this.orderFormData[0].DOT\r\n      this.sampleType = { SampleTypeID: this.orderFormData[0].SampleTypeID } as SampleType\r\n      this.labAccount = { LabAccount: this.orderFormData[0].LabAccountNumber } as LabAccount\r\n      this.panel = { ID: this.orderFormData[0].Panel } as GovPanel\r\n      this.device = { Code: this.orderFormData[0].Device } as GovDevice\r\n      // If ad-hoc order, do not try to use an existing test detail id from a pending random test\r\n      this.testDetailID = (this.completingPendingOrders == false) ? \"\" : (this.orderFormData[0].TestDetailID || \"\").toString() // TODO: verify\r\n      this.accessCode = this.orderFormData[0].GovAccessCode\r\n    } else {\r\n      this.completingPendingOrders = false\r\n      this.testDetailID = \"\"\r\n      this.accessCode = 0 // TODO: pull from donor info endpoint\r\n    }\r\n\r\n    const data = buildOrderRequestData(this.orderFormData)\r\n    this.state = {\r\n      ...data,\r\n      formKey: \"GovOrderRequestForm\",\r\n      step: 1,\r\n      infoHtml: undefined,\r\n      isDonorInfoSuccess: false,\r\n      showPotentialMatches: false,\r\n      potentialDonorMatchList: [],\r\n      isDonorValid: false,\r\n      companies: [],\r\n      reasonsLoading: false,\r\n      reasons: [],\r\n      idTypes: [],\r\n      submittedOrder: false,\r\n      orderSubmitting: false,\r\n      showConfirmation: false,\r\n      serviceDOT: this.serviceDOT,\r\n      panel: this.panel,\r\n      device: this.device,\r\n      sampleType: this.sampleType,\r\n      labAccount: this.labAccount,\r\n      testDetailID: this.testDetailID,\r\n      accessCode: this.accessCode,\r\n      isPOCTDevice: false,\r\n      showPerformCollection: false\r\n    }\r\n  }\r\n\r\n  subscriptions = new Subscription()\r\n  advanceSearchDonorSubscription?: Subscription\r\n\r\n  componentDidMount() {\r\n    this.setState({ reasonsLoading: true })\r\n    this.subscriptions.add(AutoFilterCompaniesGetObservable(\"\").subscribe(\r\n      (data: AutoFilterCompany[]) => {\r\n        const companyName = this.state.company || data[0]?.Name || \"\"\r\n        this.setState({\r\n          companies: data,\r\n          company: companyName,\r\n          companyID: data[0]?.AccountID || 0,\r\n          selectedCompany: data.find((item: AutoFilterCompany) => item.Name === companyName)\r\n        })\r\n      }\r\n    ))\r\n\r\n    this.subscriptions.add(\r\n      RegulatoryModeObservable(this.regulatoryModeFromServices()).subscribe(\r\n        results => this.setState({ idTypes: results }),\r\n        error => toast.error(error)\r\n      )\r\n    )\r\n\r\n    this.subscriptions.add(\r\n      TestReasonsObservable().subscribe(\r\n        (results: TestReasonType[]) => this.setState({\r\n          reasons: results,\r\n          reasonsLoading: false,\r\n          reasonObj: this.orderFormData && results.find(item => item.Description === \"Random\")\r\n        }),\r\n        error => toast.error(error)\r\n      )\r\n    )\r\n  }\r\n\r\n  componentWillUnmount() {\r\n    this.subscriptions.unsubscribe()\r\n    this.advanceSearchDonorSubscription && this.advanceSearchDonorSubscription.unsubscribe()\r\n  }\r\n\r\n  resetForm = () => {\r\n    const data = buildOrderRequestData(this.orderFormData)\r\n    const reasonObj = data.reason ? this.state.reasons.find(item => item.Description === data.reason) : undefined\r\n    const idTypeObj = data.donor.idType ? this.state.idTypes.find(item => item.PrimaryIDType === data.donor.idType) : undefined\r\n\r\n    this.setState({\r\n      ...data,\r\n      formKey: Math.random().toString(),\r\n      reasonObj: reasonObj,\r\n      donor: { ...data.donor, idTypeObj: idTypeObj },\r\n      step: 1,\r\n      infoHtml: undefined,\r\n      isDonorInfoSuccess: false,\r\n      showPotentialMatches: false,\r\n      potentialDonorMatchList: [],\r\n      isDonorValid: false,\r\n      submittedOrder: false,\r\n      orderSubmitting: false,\r\n      isPOCTDevice: false,\r\n      panel: this.panel,\r\n      device: this.device,\r\n      sampleType: this.sampleType,\r\n      labAccount: this.labAccount,\r\n    })\r\n  }\r\n\r\n  onReasonChange = (value: string) => {\r\n    const reasonObject = this.state.reasons?.find((item: TestReasonType) => item.Description === value)\r\n    this.setState({ reason: reasonObject?.Description, reasonObj: reasonObject, submittedOrder: false })\r\n  }\r\n  onDonorChange = (donor: DonorInformationModel, isValid: boolean, isDonorInfoSuccess: boolean) => this.setState({ donor: donor, accessCode: donor.accessCode, isDonorValid: isValid, isDonorInfoSuccess: isDonorInfoSuccess, submittedOrder: false })\r\n  onInfoHtmlChange = (infoHtml?: string) => this.setState({ infoHtml: infoHtml, submittedOrder: false })\r\n\r\n  onTypeChange = (type?: SampleType, isPOCTDevice?: boolean) => this.setState({ isPOCTDevice: !!isPOCTDevice, sampleType: type, labAccount: undefined, panel: undefined, device: undefined })\r\n  onLabChange = (lab?: LabAccount) => this.setState({ labAccount: lab, panel: undefined, device: undefined })\r\n  onPanelChange = (panel?: GovPanel) => this.setState({ panel: panel })\r\n  onDeviceChange = (device?: GovDevice) => this.setState({ device: device })\r\n\r\n  // Navigation methods\r\n  onCancel = () => {\r\n    localStorage.removeItem(StorageKey.SavedOrderData)\r\n    localStorage.removeItem(StorageKey.CanViewOrderFinish)\r\n    if (this.props.location.state?.formData) {\r\n      (this.props as RouteComponentProps).history.goBack()\r\n    } else {\r\n      this.resetForm()\r\n    }\r\n  }\r\n\r\n  onGoToStep1 = () => this.setState({ step: 1 })\r\n  onGoToStep2 = () => this.setState({ step: 2 })\r\n\r\n  onSubmit = () => {\r\n    if (this.state.isDonorInfoSuccess) {\r\n      this.saveOrder()\r\n    }\r\n    else {\r\n      this.advanceSearchDonorSubscription && this.advanceSearchDonorSubscription.unsubscribe()\r\n      const params = {\r\n        CompanyID: this.state.selectedCompany?.AccountID || 0,\r\n        DayTimePhone: this.state.donor?.daytimePhone || \"\",\r\n        EveningPhone: this.state.donor?.eveningPhone || \"\",\r\n        Mobile: null,\r\n        RegulatoryModeID: this.regulatoryModeFromServices(),\r\n        LastName: this.state.donor?.lastName,\r\n        DateOfBirth: this.state.donor?.birthdate ? FormatDate(this.state.donor?.birthdate) : undefined\r\n      }\r\n      this.advanceSearchDonorSubscription = AdvanceSearchDonorGetObservable(params).subscribe(\r\n        (response: Donor[]) => {\r\n          if (response.length) {\r\n            this.setState({ potentialDonorMatchList: response, showPotentialMatches: true })\r\n          }\r\n          else {\r\n            this.saveOrder()\r\n          }\r\n        },\r\n        (error: string) => toast.error(error)\r\n      )\r\n    }\r\n  }\r\n\r\n  regulatoryModeFromServices = () => 0  // TODO: verify\r\n  getSampleTypeCode = (sampleType: string, isPOCT: boolean): EventType => {\r\n    return sampleType.indexOf(EventType.Urine) !== -1 ?\r\n      (isPOCT ? EventType.UrinePOCT : EventType.Urine) :\r\n      (isPOCT ? EventType.SalivaDrugPOCT : EventType.SalivaDrug)\r\n  }\r\n\r\n  saveOrder() {\r\n    const formatPhone = (phone?: string) => {\r\n      if (!phone || phone === \"np\" || phone === \"n/p\" || phone === \"NP\" || phone === \"N/P\") {\r\n        return \"N/P\"\r\n      }\r\n      return phone.replace(/-/g, \"\")\r\n    }\r\n\r\n    const formatDate = (date?: Date) => {\r\n      if (!date) {\r\n        return \"\"\r\n      }\r\n      return FormatDate(date)\r\n    }\r\n\r\n\r\n    const sampleTypeCode = this.getSampleTypeCode(this.state.sampleType?.LabCode?.toUpperCase() || \"\", this.state.isPOCTDevice)\r\n    const order: SaveOrder = {\r\n      MultipleDrug: [],\r\n      MultipleAlcohol: [],\r\n      MultiplePOCT: [],\r\n      MultipleClinical: [],\r\n      MultiplePhysical: {},\r\n      POCTCount: 0,\r\n      CollectionVendorID: \"\",\r\n      FormFoxVendorAN: 0,\r\n      Collector: {\r\n        VendorID: 0,\r\n        ParentVendorID: null,\r\n        FFID: \"\",\r\n        Name: \"\",\r\n        Code: \"\",\r\n        Type: null,\r\n        Address1: \"\",\r\n        Address2: \"\",\r\n        City: \"\",\r\n        State: \"\",\r\n        Zip: \"\",\r\n        Phone: \"\",\r\n        HoursOfOperation: \"\",\r\n        Private: false,\r\n        Distance: 0,\r\n        Latitude: 0,\r\n        Longitude: 0,\r\n        UseDOTForm: false,\r\n        FFEnabled: false,\r\n        OutOfNetwork: false,\r\n        iVendorID: 0,\r\n        SiteID: null,\r\n        Fax: \"\"\r\n      },\r\n      CollectorPhone: null,\r\n      CollectorVendorName: \"\",\r\n      ConfirmDeviceCode: \"\",\r\n      ConfirmDeviceDescription: \"\",\r\n      ConfirmDeviceExpirationDate: null,\r\n      ConfirmDeviceID: null,\r\n      ConfirmDeviceSerialNumber: \"\",\r\n      EventData: {\r\n        AccountID: this.state.selectedCompany?.AccountID || 0,\r\n        CompanyID: this.state.selectedCompany?.AccountID || 0,\r\n        CompanyCode: this.state.selectedCompany?.Code || \"\",\r\n        CompanyFullName: this.state.selectedCompany?.Code ? `${this.state.selectedCompany?.Name || \"\"} (${this.state.selectedCompany?.Code || \"\"})` : \"\",\r\n        CompanyName: this.state.selectedCompany?.Name || \"\",\r\n        DateOrdered: \"\",\r\n        DateScheduled: \"\",\r\n        ExpirationDate: \"\",\r\n        LocationID: \"\",\r\n        PrimaryID: (this.state.donor.donorId || \"\").replace(/-/g, \"\"),\r\n        PrimaryIDRank: this.state.donor.idTypeObj?.Rank || 0,\r\n        PrimaryIDType: this.state.donor.idTypeObj?.PrimaryIDType || \"\",\r\n        RegulatoryModeID: this.regulatoryModeFromServices(),\r\n        RegionID: \"\",\r\n        RegionName: \"\",\r\n        TimeZone: \"\",\r\n        ProceedImmediately:false,\r\n        ExtendExpirationHours: 0\r\n      },\r\n      Panel: {\r\n        PanelID: \"\",\r\n        Description: \"\",\r\n        Code: \"\",\r\n        ClientID: \"\",\r\n        BeginEffectiveDate: \"\",\r\n        EndEffectiveDate: \"\",\r\n        UserLogin: \"\",\r\n        UpdateMethod: \"\",\r\n        UpdateDate: \"\"\r\n      },\r\n      PanelDescription: \"\",\r\n      IsAlcohol: \"\",\r\n      IsAssociatedWithPool: false,\r\n      IsCompleted: false,\r\n      IsDrug: \"\",\r\n      IsBackground: false,\r\n      IsNew: false,\r\n      IsPhysical: false,\r\n      IsAudiogram: false,\r\n      IsPoct: false,\r\n      IsRandom: false,\r\n      IsReleased: false,\r\n      LaboratoryVendorCode: \"\",\r\n      LaboratoryVendorID: \"\",\r\n      LaboratoryVendorName: \"\",\r\n      LabPanelID: 0,\r\n      TestReasonID: this.state.reasonObj?.TestReasonID || 0,\r\n      TestReasonDescription: this.state.reasonObj?.Description || \"\",\r\n      TestTypeDescription: \"Drug\",\r\n      TestTypeID: 1,\r\n      SampleTypeID: \"\",\r\n      SampleTypeDescription: \"\",\r\n      Labbased: true,\r\n      OrderComment: \"\",\r\n      SplitSpecimen: \"\",\r\n      Observed: \"\",\r\n      DOT: false,\r\n      Normal: \"\",\r\n      SampleTypeCode: sampleTypeCode,\r\n      PersonDetail: {\r\n        PersonID: this.state.donor.personId || 0,\r\n        DateOfBirth: formatDate(this.state.donor.birthdate),\r\n        HomePhone: \"\",\r\n        CellPhone: formatPhone(this.state.donor.daytimePhone),\r\n        WorkPhone: formatPhone(this.state.donor.eveningPhone),\r\n        MiddleInitial: this.state.donor.middleInitial || \"\",\r\n        AlternateID: \"\",\r\n        DriverID: \"\",\r\n        EmployerID: this.state.donor.donorId || \"\",\r\n        SSN: \"\",\r\n        FirstName: this.state.donor.firstName || \"\",\r\n        LastName: this.state.donor.lastName || \"\",\r\n        CCFPersonnelID: (this.state.donor.donorId || \"\").replace(/-/g, \"\"),\r\n        DriverLicStateOfIssue: this.state.donor?.stateCode || this.state.donor?.state?.Abbreviation || \"\",\r\n        Gender: this.state.donor.gender,\r\n        Email: this.state.donor.email || \"\"\r\n      },\r\n      MockAlcoholTestDetailID: \"\",\r\n      MockDrugTestDetailID: this.state.testDetailID,\r\n      SSOToken: \"\",\r\n      BaseUrl:  FullBaseUrl(),\r\n      //TODO: verify PoolMembersID: this.orderFormData ? this.orderFormData[0]?.PoolMembersID : undefined\r\n    }\r\n\r\n    order.MultipleDrug.push(\r\n      {\r\n        DOT: this.state.labAccount?.Regulated === \"Yes\",\r\n        IsPoct: false,\r\n        SplitSpecimen: false,\r\n        Observed: false,\r\n        Normal: true,\r\n        RegulatoryModeID: \"\",\r\n        RegulatoryModeName: \"\",\r\n        EmployeeCategoryID: \"\",\r\n        EmployeeCategoryName: \"\",\r\n        LabAccountNumber: this.state.labAccount?.LabAccount || \"\",\r\n        LaboratoryVendorCode: this.state.labAccount?.LabCode || \"\",\r\n        LaboratoryVendorID: this.state.labAccount?.LabClientMemberId || 0,\r\n        LabPanelID: this.state.panel?.Name || \"\",\r\n        PanelDescription: this.state.panel?.Name || \"\",\r\n        PanelCode: this.state.panel?.ID || \"\",\r\n        SampleTypeCode: sampleTypeCode,\r\n        Device: this.state.device?.Code || \"\"\r\n      }\r\n    )\r\n\r\n    this.setState({ orderSubmitting: true })\r\n    this.subscriptions.add(\r\n      OrderSubmitObservable(order).subscribe(\r\n        (results: OrderData) => {\r\n          this.setState({ submittedOrder: true, orderSubmitting: false, accessCode: results.GovAccessCode })\r\n          this.saveSuccess(results)\r\n\r\n        },\r\n        error => {\r\n          this.setState({ submittedOrder: false, orderSubmitting: false })\r\n          toast.error(FormatError(error))\r\n        }\r\n      )\r\n    )\r\n  }\r\n\r\n  saveSuccess = (orderFinishData: OrderData) => {\r\n    localStorage.setItem(StorageKey.SavedOrderData, JSON.stringify(orderFinishData))\r\n    if (orderFinishData.FormFoxTestAN > 0 || orderFinishData.ProfileNumber) {\r\n      if (orderFinishData.FormFoxTestAN === 0) {\r\n        toast.error(orderFinishData.FFresult)\r\n      }\r\n      localStorage.setItem(StorageKey.CanViewOrderFinish, JSON.stringify(true))\r\n      localStorage.setItem(StorageKey.FromSelectionInbox, JSON.stringify(!!this.orderFormData))\r\n    } else {\r\n      toast.error(orderFinishData.FFresult)\r\n    }\r\n    this.setState({ authorizationID: orderFinishData.FormFoxTestAN })\r\n    if (orderFinishData.FormFoxTestAN > 0) {\r\n      this.setState({ showConfirmation: true })\r\n    }\r\n  }\r\n\r\n  closePotentialDonorMatchModal = () => {\r\n    //this.PersonID = 0\r\n    toast.error(\"Donor was not found. New donor will be created.\")\r\n    this.setState({ showPotentialMatches: false }, () => this.saveOrder())\r\n  }\r\n\r\n  submitPotentialDonorMatchModal = (response: Donor) => {\r\n    toast.success(\"Your Order will be placed with the selected ID Type.\")\r\n    const fetchedDate = response.DateOfBirth ? new Date(response.DateOfBirth) : undefined\r\n    const validDate = fetchedDate && fetchedDate.getTime && !isNaN(fetchedDate.getTime())\r\n    const newDonor: DonorInformationModel = {\r\n      ...this.state.donor,\r\n      personId: response.PersonID,\r\n      firstName: response.FirstName,\r\n      middleInitial: response.MiddleInitial,\r\n      lastName: response.LastName,\r\n      eveningPhone: FormatPhone(response.WorkPhone),\r\n      daytimePhone: FormatPhone(response.CellPhone),\r\n      birthdate: validDate ? fetchedDate : undefined,\r\n\r\n      firstNameReadOnly: !!response.FirstName,\r\n      middleInitialReadOnly: !!response.MiddleInitial,\r\n      lastNameReadOnly: !!response.LastName,\r\n      homePhoneReadOnly: !!(response.HomePhone && response.HomePhone !== \"N/P\"),\r\n      workPhoneReadOnly: !!(response.WorkPhone && response.WorkPhone !== \"N/P\"),\r\n      state: undefined,\r\n      stateCode: response.DriverLICStateOfIssue ? response.DriverLICStateOfIssue : undefined\r\n    }\r\n    this.setState({\r\n      donor: newDonor,\r\n      showPotentialMatches: false\r\n    }, () => this.saveOrder())\r\n  }\r\n\r\n  performCollection = () => {\r\n    this.setState({ showConfirmation: false, showPerformCollection: true })\r\n  }\r\n\r\n  closeConfirmation = () => {\r\n    this.setState({ showConfirmation: false })\r\n    this.onCancel();\r\n    (this.props as RouteComponentProps).history.push(OrdersRoute)\r\n  }\r\n\r\n  closePerformCollection = () => {\r\n    this.setState({ showPerformCollection: false });\r\n    (this.props as RouteComponentProps).history?.push(OrdersRoute)\r\n  }\r\n\r\n  createGovPerformCollectionProps = (): GovPerformCollectionProps => {\r\n\r\n\r\n    let testDetailID: number = 0\r\n    let testDetailIDHash: string = \"\"\r\n    let referenceID: number = 0\r\n    let labCode: string = \"\"\r\n    let sampleID: string = \"\"\r\n    let tempInRange: number = 0\r\n    let personID: number = 0\r\n    let firstName: string = \"\"\r\n    let lastName: string = \"\"\r\n    let dateOfBirth: Date | undefined\r\n    let gender: string = \"\"\r\n    let sampleTypeCode = this.getSampleTypeCode(this.state.sampleType?.LabCode?.toUpperCase() || \"\", this.state.isPOCTDevice)\r\n    let DeviceID: number = 0\r\n    let AccountID: number = 0\r\n\r\n    const authorizationID: number = this.state.authorizationID || 0\r\n    if (authorizationID > 0) {\r\n\r\n      const orderString = localStorage.getItem(StorageKey.SavedOrderData) || \"\"\r\n      const orderData: OrderData = JSON.parse(orderString)\r\n      if (orderData) {\r\n\r\n        testDetailID = orderData.TestDetailID || 0\r\n        if (testDetailID === 0) {\r\n          testDetailID = orderData.DrugTestDetailID || 0\r\n        }\r\n        if (testDetailID === 0) {\r\n          if (Array.isArray(orderData.DrugTestDetailIDList)) {\r\n            if (orderData.DrugTestDetailIDList.length > 0) {\r\n              testDetailID = orderData.DrugTestDetailIDList[0]\r\n            }\r\n          }\r\n        }\r\n      }\r\n      testDetailIDHash = this.state.testDetailID || this.testDetailID\r\n      referenceID = this.state.authorizationID || 0\r\n      labCode = this.state.labAccount?.LabAccount || \"\"\r\n      sampleID = \"\"\r\n      tempInRange = 0\r\n      personID = this.state.donor.personId || 0\r\n      firstName = this.state.donor.firstName || \"\"\r\n      lastName = this.state.donor.lastName || \"\"\r\n      dateOfBirth = this.state.donor.birthdate\r\n      gender = this.state.donor.gender || \"\"\r\n      DeviceID = this.state.device?.DeviceID || 0\r\n      AccountID = this.state.companyID\r\n    }\r\n    const result: GovPerformCollectionProps = {\r\n      testDetailID: testDetailID,\r\n      testDetailIDHash: testDetailIDHash,\r\n      referenceID: referenceID,\r\n      sampleTypeCode: sampleTypeCode,\r\n      sampleTypeID: 0,\r\n      labCode: labCode,\r\n      sampleID: sampleID,\r\n      tempInRange: tempInRange,\r\n      personID: personID,\r\n      firstName: firstName,\r\n      lastName: lastName,\r\n      dateOfBirth: dateOfBirth,\r\n      gender: gender,\r\n      onHide: () => this.closePerformCollection(),\r\n      DeviceID: DeviceID,\r\n      AccountID: AccountID\r\n    }\r\n    return result\r\n  }\r\n\r\n  render() {\r\n    const { reasonObj, reasonOther, submittedOrder, isPOCTDevice, sampleType, labAccount, panel, device } = this.state\r\n    const isIssuerValid = !!reasonObj && (reasonObj?.Description !== OTHER_REASON_TEXT || !!reasonOther)\r\n    const panelSelected = !!panel?.ID && (!isPOCTDevice || (isPOCTDevice && !!device?.Code))\r\n    const isPanelValid = !!sampleType?.SampleTypeID && !!labAccount?.LabAccount && panelSelected\r\n    const canGoToOrderFeatures = isIssuerValid && isPanelValid && this.state.isDonorValid\r\n    const isStep2Available = this.state.step !== 2 && canGoToOrderFeatures\r\n    const isOrderCanBeSubmitted = canGoToOrderFeatures && !submittedOrder\r\n    const isBirthDateRequired = true\r\n\r\n    const performCollectionProps = this.createGovPerformCollectionProps()\r\n\r\n\r\n    const headerSteps: StepData[] = [\r\n      {\r\n        title: '1',\r\n        disabled: this.state.step === 1,\r\n        current: this.state.step === 1,\r\n        onClick: () => this.setState({ step: 1 })\r\n      },\r\n      {\r\n        title: '2',\r\n        disabled: !isStep2Available,\r\n        current: this.state.step === 2,\r\n        onClick: () => this.setState({ step: 2 })\r\n      }\r\n    ]\r\n\r\n    const service: GovServiceDataModel = {\r\n      serviceType: ServiceTypeOld.Drug,\r\n      sampleType: sampleType?.LabCode,\r\n      isDOT: labAccount?.Regulated === \"Yes\",\r\n      panelCode: panel?.ID,\r\n      panelDescription: panel?.Name,\r\n      testToPerform: panel?.Name,\r\n      labAccount: labAccount?.LabAccount,\r\n      labCode: labAccount?.LabCode || \"\",\r\n      labClientMemberId: labAccount?.LabClientMemberId || 0\r\n    }\r\n\r\n    return (<>\r\n      <AppPageWrapper parentClassName=\"OrderRequest\" showNav={true}>\r\n        <PotentialDonorMatchModal\r\n          potentialDonorMatchList={this.state.potentialDonorMatchList}\r\n          show={this.state.showPotentialMatches}\r\n          onClose={this.closePotentialDonorMatchModal}\r\n          onSubmit={this.submitPotentialDonorMatchModal} />\r\n        <Container fluid className=\"OrderRequests\" key={this.state.formKey}>\r\n          <Row>\r\n            <Col md={12}>\r\n              <Container fluid className=\"mb-4\">\r\n                <Row>\r\n                  <Col xs={12} md={6} className=\"p-0 px-2 mx-1\">\r\n                    <OrderRequestsHeader steps={headerSteps} />\r\n                  </Col>\r\n                  <Col xs={12} md={6} hidden={!this.state.infoHtml}>\r\n                    <div className=\"ServiceLongDescription\" dangerouslySetInnerHTML={{ __html: this.state.infoHtml || \"\" }} />\r\n                  </Col>\r\n                </Row>\r\n              </Container>\r\n            </Col>\r\n          </Row>\r\n          <Row>\r\n            <Col className=\"p-0\" hidden={this.state.step !== 1}>\r\n              <Container fluid>\r\n                <Col xs={12} sm={12} md={6}>\r\n                  <DonorInformation companyId={this.state.selectedCompany?.AccountID}\r\n                    completingPendingOrders={!!this.orderFormData}\r\n                    orderFormData={this.donorData}\r\n                    donor={this.state.donor}\r\n                    onDonorChange={this.onDonorChange}\r\n                    isBirthDateRequired={isBirthDateRequired}\r\n                    idTypes={this.state.idTypes}\r\n                    showIdType={false}\r\n                    showMiddleInitial={false}\r\n                    eveningPhoneLabel=\"WORK PHONE\"\r\n                    daytimePhoneLabel=\"MOBILE PHONE\"\r\n                    eveningPhoneField=\"WorkPhone\"\r\n                    daytimePhoneField=\"CellPhone\"\r\n                    daytimePhoneRequired={false}\r\n                    maxDonorIdLength={MaxDonorIdLength}\r\n                    showGenderField\r\n                    validateDonorIdFormat\r\n                  />\r\n                </Col>\r\n              </Container>\r\n            </Col>\r\n          </Row>\r\n          <Row>\r\n            <Col hidden={this.state.step !== 1}>\r\n              <Container fluid>\r\n                <Row>\r\n                  <Col sm={12} md={6} lg={4}>\r\n                    <Form>\r\n                      <Form.Group>\r\n                        <Form.Label className=\"font-weight-bold required\">REASON</Form.Label>\r\n                        <Form.Control as=\"select\" value={this.state.reasonObj?.Description}\r\n                          onChange={(e) => this.onReasonChange(e.target.value)}\r\n                          disabled={this.state.reasonsLoading || this.completingPendingOrders}>\r\n                          <option />\r\n                          {this.state.reasons.map((item: TestReasonType) => <option value={item.Description} key={item.Description}>{item.Description}</option>)}\r\n                        </Form.Control>\r\n                      </Form.Group>\r\n                      <Form.Group hidden={this.state.reasonObj?.Description !== OTHER_REASON_TEXT}>\r\n                        <Form.Label className=\"font-weight-bold required\">OTHER REASON</Form.Label>\r\n                        <Form.Control type=\"text\"\r\n                          value={this.state.reasonOther || \"\"}\r\n                          onChange={(e) => this.setState({ reasonOther: e.target.value })} />\r\n                      </Form.Group>\r\n                      {!!this.state.selectedCompany && <GovCollection showHeading\r\n                        labelClassName=\"text-uppercase font-weight-bold\"\r\n                        editing\r\n                        pendingRandom={this.pendingRandom}\r\n                        labAccount={this.state.labAccount?.LabAccount}\r\n                        serviceDOT={this.state.serviceDOT || false}\r\n                        sampleTypeID={this.state.sampleType?.SampleTypeID}\r\n                        panel={this.state.panel?.ID}\r\n                        device={this.state.device?.Code}\r\n                        companyID={this.state.companyID}\r\n                        onTypeChange={this.onTypeChange}\r\n                        onLabChange={this.onLabChange}\r\n                        onPanelChange={this.onPanelChange}\r\n                        onDeviceChange={this.onDeviceChange}\r\n                      />}\r\n                    </Form>\r\n                  </Col>\r\n                </Row>\r\n              </Container>\r\n            </Col>\r\n          </Row>\r\n          <Row hidden={this.state.step !== 2}>\r\n            <Col>\r\n              <h4 className=\"primary text-uppercase\">\r\n                <span>AUTHORIZATION # </span>\r\n                <span className=\"authorizationNumber\"> ({this.state.authorizationID})</span>\r\n              </h4>\r\n            </Col>\r\n          </Row>\r\n          {this.state.step === 2 && <GovOrderDonorInfo {...this.state.donor} accessCode={this.state.accessCode} />}\r\n          <Row hidden={this.state.step !== 2}>\r\n            <Col sm={12} md={6} lg={8} className=\"d-flex align-items-center\">\r\n              <GovOrderedService service={service} />\r\n            </Col>\r\n          </Row>\r\n          <Row hidden={this.state.step !== 2}>\r\n            <Col md={12} className=\"test-property\">Confirm your order</Col>\r\n          </Row>\r\n          <Container fluid>\r\n            <Row>\r\n              <Col xs={12} md={6} lg={6} className=\"d-flex pt-2 pr-1\">\r\n                <Button hidden={this.state.step !== 1} onClick={this.onCancel} variant=\"secondary\" className=\"mr-auto fixed-w10\">CANCEL</Button>\r\n                <Button hidden={this.state.step !== 2} onClick={this.onGoToStep1} variant=\"secondary\" className=\"mr-auto fixed-w10\">BACK</Button>\r\n                <Button hidden={this.state.step !== 1} onClick={this.onGoToStep2} disabled={!isStep2Available} variant=\"primary\" className=\"ml-auto fixed-w10\">NEXT</Button>\r\n                <ActionButton hidden={this.state.step !== 2} onClick={this.onSubmit} disabled={!isOrderCanBeSubmitted} spin={this.state.orderSubmitting} variant=\"primary\" className=\"ml-auto fixed-w10\" disableOnSpin>FINISH</ActionButton>\r\n              </Col>\r\n            </Row>\r\n          </Container>\r\n        </Container>\r\n        <ConfirmationModal show={this.state.showConfirmation}\r\n          title=\"\"\r\n          textTitle=\"\"\r\n          text=\"Do you want to perform the collection now?\"\r\n          showImage={false}\r\n          cancelButtonText=\"No\"\r\n          confirmButtonText=\"Yes\"\r\n          onConfirm={() => this.performCollection()}\r\n          onHide={() => this.closeConfirmation()} />\r\n        {this.state.showPerformCollection && this.state.authorizationID &&\r\n          <GovPerformCollection\r\n            testName={service.panelDescription}\r\n            testDetailID={performCollectionProps.testDetailID}\r\n            testDetailIDHash={performCollectionProps.testDetailIDHash}\r\n            referenceID={performCollectionProps.referenceID}\r\n            sampleTypeCode={performCollectionProps.sampleTypeCode}\r\n            sampleTypeID={performCollectionProps.sampleTypeID}\r\n            labCode={performCollectionProps.labCode}\r\n            sampleID={performCollectionProps.sampleID}\r\n            tempInRange={performCollectionProps.tempInRange}\r\n            firstName={performCollectionProps.firstName}\r\n            lastName={performCollectionProps.lastName}\r\n            dateOfBirth={performCollectionProps.dateOfBirth}\r\n            gender={performCollectionProps.gender}\r\n            onHide={() => performCollectionProps.onHide()}\r\n            DeviceID={performCollectionProps.DeviceID}\r\n            AccountID={performCollectionProps.AccountID}>\r\n          </GovPerformCollection>}\r\n      </AppPageWrapper>\r\n    </>)\r\n  }\r\n}\r\n","import * as React from \"react\"\r\nimport { toast } from \"react-toastify\"\r\nimport CollectionSite from \"../../api/Location/LocationModel/CollectionSite\"\r\nimport { stateAbbreviationsToCommonWealthState, StateToTimeZone } from \"../../api/Location/LocationModel/CommonWealthStateTextMapping\"\r\nimport { APIError } from \"../../api/ObservableFromFetch\"\r\nimport { GetOrderRequest, SetFFTestDetailVendor, SetTestDetailVendor, SetTestDetailVendorParameters } from \"../../api/OrderRequests/SSOOrderRequest\"\r\nimport { StorageKey } from \"../../config/Constants\"\r\nimport { GetSSOToken } from \"../../storage/AuthToken\"\r\nimport { AppPageWrapper } from \"../NavMenu/AppPageWrapper\"\r\nimport OrderFinish from \"../OrderRequests/OrderFinish\"\r\nimport ProcessingModal from \"../ProcessingModal\"\r\nimport SiteSearch from \"../SiteSearch/SiteSearch\"\r\nimport {AuthFormByToken} from \"../../api/OrderResults/AuthForm\"\r\nimport { Subscription } from \"rxjs\"\r\nimport printPdf,{showPdf} from \"../../utils/printPdf\"\r\n\r\ninterface GetAuthFormPageState {\r\n  formFoxTestAN: number\r\n  isLoading: boolean\r\n  ssoToken: string\r\n  spinnerMessage: string\r\n}\r\nexport default class GetAuthFormPage extends React.PureComponent<{}, GetAuthFormPageState> {\r\n  state: GetAuthFormPageState = {\r\n    formFoxTestAN: 0,\r\n    isLoading: true,\r\n    ssoToken: GetSSOToken(),\r\n    spinnerMessage: \"Data is loading...\"\r\n  }\r\n  loadSubscription?: Subscription\r\n\r\n  componentWillUnmount() {\r\n    this.loadSubscription && this.loadSubscription.unsubscribe()\r\n  }\r\n  componentDidMount() {\r\n    this.loadAuthFormPdf()\r\n  }\r\n\r\n  loadAuthFormPdf = () => {\r\n    this.setState({isLoading:true, spinnerMessage: \"Data is loading...\"})\r\n    this.loadSubscription && this.loadSubscription.unsubscribe()\r\n    const params = {\r\n      requestToken: this.state.ssoToken,\r\n      FormFoxTestAN: 0\r\n    }\r\n    this.loadSubscription = AuthFormByToken(params).subscribe(\r\n      data => {\r\n        this.setState({isLoading:false, spinnerMessage:\"\"})\r\n        showPdf(data)\r\n      },\r\n      error => {\r\n        this.handleAPIError(error, { isLoading: false, spinnerMessage: \"\" })\r\n      }\r\n    )\r\n}\r\n\r\n\r\n  handleAPIError = (error: Error | APIError, stateChanges: object) => {\r\n    this.setState(stateChanges)\r\n    error && toast.error((error as APIError)?.errorData?.message || error.message)\r\n  }\r\n\r\n  render() {\r\n    const { isLoading, formFoxTestAN } = this.state;\r\n    return <AppPageWrapper showNav={false}>\r\n      {(isLoading) && <ProcessingModal message={this.state.spinnerMessage} />}\r\n    </AppPageWrapper>\r\n  }\r\n}\r\n","import React, { Component } from \"react\"\r\nimport { RouteComponentProps } from 'react-router-dom'\r\nimport AuthService from \"./AuthService\"\r\nimport { AppState } from \"../AppState\"\r\nimport { Action, Dispatch } from \"redux\"\r\nimport { connect } from 'react-redux'\r\nimport { ssoOrderRequest } from \"../actions/WorkforceOneLoginActions\"\r\nimport { GetSSOPayload, SetEmbeddedOrderMode, SetSiteSearchMode } from \"../storage/AuthToken\"\r\nimport PageLoading from \"../components/PageLoading\"\r\nimport FormatData from \"../formatters/FormatBase64\"\r\n\r\nexport interface SSOCallbackState {\r\n  spinnerMessage: string\r\n}\r\nexport interface SSOCallbackAppStateProps { }\r\nexport interface SSOCallbackDispatchProps {\r\n  login: (ssoToken: string, data?: string) => void\r\n}\r\n\r\nexport class SSOCallback extends Component<SSOCallbackAppStateProps & SSOCallbackDispatchProps & RouteComponentProps, SSOCallbackState>{\r\n  state: SSOCallbackState = { spinnerMessage: \"Logging in...\" }\r\n\r\n  componentDidMount() {\r\n    const data = GetSSOPayload()\r\n    const payload = parsePayload(data)\r\n    if (payload && (payload as { Target: string }).Target === 'site-search') {\r\n      SetSiteSearchMode()\r\n    }\r\n    if (payload && (payload as { Target: string }).Target === 'order') {\r\n      SetEmbeddedOrderMode()\r\n    }\r\n    const authService = new AuthService()\r\n    authService.signinRedirectCallback(this.props.location.pathname?.replace(\"/access_token=\", \"/&access_token=\")).then((user) => {\r\n      if (user) {\r\n        this.props.login(user.access_token, data)\r\n      }\r\n    }).catch(() => {\r\n      this.setState({ spinnerMessage: \"Logging in error...\" })\r\n    })\r\n  }\r\n\r\n  render() { return <>\r\n    <PageLoading message={this.state.spinnerMessage} showNav={true} embedingMode={true}/>\r\n  </>\r\n  }\r\n}\r\n\r\nfunction parsePayload(base64String: string): object | undefined {\r\n  try {\r\n    const bytes = FormatData(base64String)\r\n    const str = new TextDecoder().decode(bytes)\r\n    return JSON.parse(str)\r\n  } catch (error) {\r\n    return undefined\r\n  }\r\n}\r\n\r\nfunction mapStateToProps(state: AppState): SSOCallbackAppStateProps {\r\n  return {\r\n  }\r\n}\r\n\r\nfunction mapDispatchProps(dispatch: Dispatch<Action>): SSOCallbackDispatchProps {\r\n  return {\r\n    login: (ssoToken: string, data?: string) => (dispatch(ssoOrderRequest(ssoToken, data)))\r\n  }\r\n}\r\n\r\nexport default connect<SSOCallbackAppStateProps, SSOCallbackDispatchProps, {}, AppState>(\r\n  mapStateToProps, mapDispatchProps)(SSOCallback)\r\n","import { \r\n  ReportSpecimenPositivityRoute, \r\n  ReportTestingSummaryRoute, \r\n  ReportDrugDetailRoute, \r\n  ReportDailySummaryRoute, \r\n  ReportIvrCallInComplianceRoute, \r\n  ReportNoShowRoute \r\n} from \"../../config/Routes\";\r\n\r\nexport enum OnTrackReportType {\r\n  IVRCallInCompliance = 1,\r\n  DailySummary = 2,\r\n  TestSummary = 3,\r\n  SpecimenPositivity = 4,\r\n  DrugDetail = 5,\r\n  NoShow = 6\r\n}\r\nconst Reports = [\r\n  ReportSpecimenPositivityRoute, \r\n  ReportTestingSummaryRoute, \r\n  ReportDrugDetailRoute, \r\n  ReportDailySummaryRoute, \r\n  ReportIvrCallInComplianceRoute,\r\n  ReportNoShowRoute\r\n] as const\r\nexport type Report = typeof Reports[number]\r\nexport type OnTrackReportRecord = {\r\n  type: OnTrackReportType\r\n  title: string\r\n}\r\nexport type OnTrackReport = Record<Report, OnTrackReportRecord>\r\n\r\nexport default function getOnTrackReport(report: Report) {\r\n  const OnTrackReports: OnTrackReport = {\r\n    [ReportTestingSummaryRoute]: { type: OnTrackReportType.TestSummary, title: \"Testing Summary\" },\r\n    [ReportSpecimenPositivityRoute]: { type: OnTrackReportType.SpecimenPositivity, title: \"Specimen Positivity\" },\r\n    [ReportDrugDetailRoute]: { type: OnTrackReportType.DrugDetail, title: \"Drug Detail\" },\r\n    [ReportDailySummaryRoute]: { type: OnTrackReportType.DailySummary, title: \"Daily Summary\" },\r\n    [ReportIvrCallInComplianceRoute]: { type: OnTrackReportType.IVRCallInCompliance, title: \"IVR Call-In Compliance\" },\r\n    [ReportNoShowRoute]: { type: OnTrackReportType.NoShow, title: \"No Show\" }\r\n  }\r\n  return OnTrackReports[report]\r\n}\r\n","import { ObservableFromFetch } from \"../ObservableFromFetch\"\r\nimport { OnTrackReportType } from \"./OnTrackReport\"\r\n\r\nexport interface ReportParameters {\r\n  reportType: OnTrackReportType\r\n  fromDate?: string\r\n  toDate?: string\r\n  accountID?: number\r\n  groupID?: number\r\n  personID?: number\r\n}\r\n\r\nexport function GovReportsObservable(parameters: ReportParameters) {\r\n  const requestBody: string = JSON.stringify(parameters)\r\n\r\n  return ObservableFromFetch<string>(\"Report/OnTrackGetReport\", requestBody)\r\n}\r\n","import * as React from \"react\"\r\nimport { connect } from \"react-redux\";\r\nimport { toast } from \"react-toastify\";\r\nimport DatePicker from \"react-datepicker\";\r\nimport { AppPageWrapper } from \"../NavMenu/AppPageWrapper\";\r\nimport { Button, Col, Form, InputGroup, Modal, ModalBody, Spinner } from \"react-bootstrap\";\r\nimport { FaAngleDown, FaSearch } from \"react-icons/fa\";\r\nimport 'react-datepicker/dist/react-datepicker.css'\r\nimport { AsyncTypeahead } from \"react-bootstrap-typeahead\";\r\nimport { Subscription } from \"rxjs\";\r\nimport ActionButton from \"../ActionButton\";\r\nimport TextFormControl from \"../OrderRequests/TextFormControl\";\r\nimport { DonorIdRegexp, InvalidDonorId, MaxDonorIdLength } from \"../../config/Constants\";\r\nimport { SearchDonorGetObservable } from \"../../api/OrderRequests/SearchDonorGet\";\r\nimport { BirthdayInput } from \"../FormattedInputs/BirthdayInput\";\r\nimport { GovReportsObservable } from \"../../api/GovReports/GovReportsObservable\";\r\nimport CompanyInput from \"../FormattedInputs/CompanyInput\";\r\nimport AutoFilterCompany from \"../../api/Companies/CompanyModel/AutoFilterCompany\";\r\nimport { AppState } from \"../../AppState\";\r\nimport { isCompanyAdmin, isLocationAdmin, isPortalAdmin } from \"../../authentication/isAdminRole\";\r\nimport GovPoolGet from \"../../api/Randoms/GovPoolGet\";\r\nimport GovPoolData from \"../../api/Randoms/RandomsModel/GovPoolData\";\r\nimport FormatError from \"../../formatters/FormatError\";\r\nimport { GetSelectedAssignedClinic } from \"../../authentication/SelectedCompany/CompanySelectionDrivenSelectors\";\r\nimport { Donor } from \"../../api/OrderRequests/OrderRequestsModel/Donor\";\r\nimport { RegulatoryModeObservable } from \"../../api/OrderRequests/OrderRequestsConstraintGet\";\r\nimport { GetRegulatoryModeDonor } from \"../OrderRequests/OrderModels\";\r\nimport { RouteComponentProps } from \"react-router\";\r\nimport { Home } from \"../../config/Routes\";\r\nimport getOnTrackReport, { OnTrackReportRecord, Report } from \"../../api/GovReports/OnTrackReport\";\r\nimport { IsOnTrack } from \"../../App\";\r\nimport { LogOut } from \"../../AppStore\";\r\nimport FormatDate from \"../../formatters/FormatDate\";\r\nimport AutoFilterLocation from '../../api/Location/LocationModel/AutoFilterLocation';\r\nimport AutoFilterRegion from '../../api/Regions/Model/AutoFilterRegion';\r\nimport AutoFilterLocationsGet from '../../api/Location/AutoFilterLocationsGet';\r\n\r\ninterface ReportParametersProps {\r\n  isLocationAdmin?: boolean\r\n  isCompanyAdmin?: boolean\r\n  isPortalAdmin?: boolean\r\n  company?: number\r\n}\r\n\r\ninterface ReportParametersState {\r\n  report: OnTrackReportRecord\r\n  from?: Date\r\n  to?: Date\r\n  donorId?: string\r\n  donor?: Donor\r\n  companies: AutoFilterCompany[]\r\n  locations: AutoFilterLocation[]\r\n  idType?: GetRegulatoryModeDonor\r\n  selectedCompany?: AutoFilterCompany\r\n  selectedLocation?: AutoFilterLocation\r\n  locationsLoading: boolean\r\n  groups: GovPoolData[]\r\n  selectedGroup?: GovPoolData\r\n  groupLoading: boolean\r\n  donorLoading: boolean\r\n  regulatoryModeLoading: boolean\r\n  companyChecked: boolean\r\n  groupChecked: boolean\r\n  donorChecked: boolean\r\n  loading?: boolean\r\n}\r\n\r\nclass ReportParameters extends React.PureComponent<ReportParametersProps & RouteComponentProps, ReportParametersState> {\r\n  state: ReportParametersState = {\r\n    report: getOnTrackReport(this.props.location.pathname as Report),\r\n    companies: [],\r\n    locations: [],\r\n    groups: [],\r\n    locationsLoading: false,\r\n    groupLoading: false,\r\n    donorLoading: false,\r\n    regulatoryModeLoading: false,\r\n    companyChecked: true,\r\n    groupChecked: false,\r\n    donorChecked: false\r\n  }\r\n\r\n  typeaheadGroup = React.createRef<AsyncTypeahead<GovPoolData>>()\r\n\r\n  subscriptions = new Subscription()\r\n  printSubscription?: Subscription\r\n  donorSubscription?: Subscription\r\n\r\n  handleCompanyChange = (companies: AutoFilterCompany[]) => {\r\n    this.setState({ companies: companies, selectedCompany: companies[0] })\r\n    this.loadAllLocations(companies[0])\r\n  }\r\n  handleLocationChange = (event: React.ChangeEvent<HTMLSelectElement>) => {\r\n    let location = this.state.locations.find(l => l.AccountID === Number(event.target.value))\r\n    this.setState({ selectedLocation: location })\r\n  }\r\n  handleGroupChange = (selected: GovPoolData) => this.setState({ selectedGroup: selected })\r\n  handleDonorIdChange = (value: string) => this.setState({ donorId: value })\r\n\r\n  handleCompanyChecked = (e: React.ChangeEvent<HTMLInputElement>) => {\r\n    this.setState({ companyChecked: e.target.checked, selectedCompany: this.state.companies[0], groupChecked: false, donorChecked: false, selectedGroup: undefined, donorId: undefined, donor: undefined  })\r\n  }\r\n\r\n  handleGroupChecked = (e: React.ChangeEvent<HTMLInputElement>) => {\r\n    this.setState({ companyChecked: false, groupChecked: e.target.checked, donorChecked: false, selectedCompany: undefined, donorId: undefined, donor: undefined })\r\n  }\r\n\r\n  handleDonorChecked = (e: React.ChangeEvent<HTMLInputElement>) => {\r\n    this.setState({ companyChecked: false, groupChecked: false, donorChecked: e.target.checked, selectedGroup: undefined, selectedCompany: undefined })\r\n  }\r\n\r\n  handleGenerateReportClick = () => {\r\n    this.setState({ loading: true })\r\n    this.printSubscription && this.printSubscription.unsubscribe()\r\n    let accountID = this.state.selectedLocation?.AccountID || this.state.selectedCompany?.AccountID\r\n    this.printSubscription = GovReportsObservable({\r\n      reportType: this.state.report.type,\r\n      fromDate: FormatDate(this.state.from),\r\n      toDate: FormatDate(this.state.to),\r\n      accountID: this.state.companyChecked ? accountID : undefined,\r\n      groupID: this.state.groupChecked ? this.state.selectedGroup?.GovPoolId : undefined,\r\n      personID: this.state.donorChecked ? this.state.donor?.PersonID : undefined\r\n    }).subscribe(\r\n      data => {\r\n        this.setState({ loading: false })\r\n        this.print(data)\r\n      },\r\n      error => {\r\n        this.setState({ loading: false })\r\n        toast.error(FormatError(error))\r\n      }\r\n    )\r\n  }\r\n\r\n  handleCancelClick = () => (this.props as RouteComponentProps).history?.push(Home)\r\n\r\n  print(base64pdf: string) {\r\n    const pdfWindow = window.open('about:blank')\r\n    if (pdfWindow) {\r\n      pdfWindow.document.write(\"<iframe width='100%' height='100%' src='data:application/pdf;base64, \" + encodeURI(base64pdf) + \"'></iframe>\")\r\n    }\r\n  }\r\n\r\n  validateDonorFormat = () => {\r\n    const donorId = this.state.donorId || \"\"\r\n    return !this.state.donorChecked || (donorId.length > 0 && donorId.length <= MaxDonorIdLength && DonorIdRegexp.test(donorId))\r\n  }\r\n\r\n  isParamsValid = () => {\r\n    const { selectedCompany, selectedGroup, donor, companyChecked, groupChecked, donorChecked, from, to } = this.state\r\n    return from && to && ((companyChecked && selectedCompany) || (groupChecked && selectedGroup) || (donorChecked && donor))\r\n  }\r\n\r\n  onDonorSearch = () => {\r\n    this.donorSubscription && this.donorSubscription.unsubscribe()\r\n    this.donorSubscription = SearchDonorGetObservable({\r\n      CompanyID: this.props.company || 0,\r\n      Identifier: this.state.donorId,\r\n      IdentifierType: this.state.idType?.Rank,\r\n      RegulatoryModeID: 0,\r\n      isPortalAdmin: this.props.isPortalAdmin\r\n    }).subscribe(\r\n    (result: Donor[]) => {\r\n      this.setState({ donorLoading: false, donor: result[0] })\r\n      !result.length && toast.error(\"Donor was not found.\")\r\n    },\r\n    (error) => {\r\n      this.setState({ donorLoading: false })\r\n      toast.error(FormatError(error))\r\n    })\r\n  }\r\n\r\n  componentDidUpdate(prevProps: ReportParametersProps & RouteComponentProps) {\r\n    if (this.props.location.pathname !== prevProps.location.pathname) {\r\n      this.setState(prev => ({\r\n        ...prev,\r\n        report: getOnTrackReport(this.props.location.pathname as Report),\r\n        selectedCompany: this.props.isPortalAdmin ? undefined : prev.selectedCompany,\r\n        selectedGroup: undefined,\r\n        donorId: undefined,\r\n        donor: undefined\r\n      }))\r\n    }\r\n  }\r\n\r\n  componentDidMount() {\r\n    if(!IsOnTrack()) {\r\n      toast.error(\"The request is unauthorized.\")\r\n      LogOut()\r\n    }\r\n    this.setState({ groupLoading: true, regulatoryModeLoading: true })\r\n\r\n    this.subscriptions.add(\r\n      RegulatoryModeObservable(0).subscribe(\r\n        results => this.setState({ idType: results.find(item => item.PrimaryIDType === \"EmployerID\"), regulatoryModeLoading: false }),\r\n        error => {\r\n          this.setState({ regulatoryModeLoading: false })\r\n          toast.error(error)\r\n        }\r\n      )\r\n    )\r\n\r\n    this.subscriptions.add(\r\n      GovPoolGet().subscribe(\r\n        (results: GovPoolData[]) => this.setState({ groups: results, groupLoading: false }),\r\n        (error) => {\r\n          this.setState({ groupLoading: false })\r\n          toast.error(FormatError(error))\r\n        }\r\n      )\r\n    )\r\n  }\r\n\r\n  componentWillUnmount() {\r\n    this.subscriptions && this.subscriptions.unsubscribe()\r\n    this.donorSubscription && this.donorSubscription.unsubscribe()\r\n    this.printSubscription && this.printSubscription.unsubscribe()\r\n  }\r\n\r\n  loadAllLocations = (company?: AutoFilterCompany, region?: AutoFilterRegion) => {\r\n    this.setState({ locationsLoading: true })\r\n    this.subscriptions.add(\r\n      AutoFilterLocationsGet(company?.AccountID || 0, region?.Code || \"\", \"\").subscribe(\r\n      data =>\r\n        {\r\n          let location = undefined\r\n          if (this.props.isLocationAdmin)\r\n          {\r\n            location = data[0]\r\n          }\r\n          this.setState({ locations: data, locationsLoading: false, selectedLocation: location })\r\n        },\r\n   () => this.setState({ locationsLoading: false })\r\n      )\r\n    )\r\n  }\r\n\r\n  render() {\r\n    const { report, donorId, donor, donorLoading, companyChecked, groupChecked, donorChecked, from, to } = this.state\r\n\r\n    return (<AppPageWrapper parentClassName={\"align-items-center\"} showNav>\r\n      <Modal.Dialog size=\"lg\">\r\n        <Modal.Header>\r\n          <Modal.Title className=\"text-uppercase\">Report Parameters for {report.title}</Modal.Title>\r\n        </Modal.Header>\r\n        <ModalBody>\r\n          <Form>\r\n            <Form.Row className=\"form-group\">\r\n              <Form.Label column lg={2} htmlFor=\"dateCollected\">Date Collected</Form.Label>\r\n              <Form.Label column lg={1} htmlFor=\"from\" className=\"required\">From</Form.Label>\r\n              <Col lg={4}>\r\n                <DatePicker id=\"from\"\r\n                  className=\"form-control\"\r\n                  showMonthDropdown\r\n                  showYearDropdown\r\n                  dropdownMode=\"select\"\r\n                  enableTabLoop={false}\r\n                  selected={from}\r\n                  maxDate={to || new Date()}\r\n                  onChange={date => this.setState({ from: date as Date })}\r\n                  customInput={<BirthdayInput />}\r\n                />\r\n              </Col>\r\n              <Form.Label column lg={1} htmlFor=\"to\" className=\"required\">To</Form.Label>\r\n              <Col lg={4}>\r\n                <DatePicker id=\"to\"\r\n                  className=\"form-control\"\r\n                  showMonthDropdown\r\n                  showYearDropdown\r\n                  dropdownMode=\"select\"\r\n                  enableTabLoop={false}\r\n                  selected={to}\r\n                  minDate={from}\r\n                  maxDate={new Date()}\r\n                  onChange={date => this.setState({ to: date as Date })}\r\n                  customInput={<BirthdayInput />}\r\n                />\r\n              </Col>\r\n            </Form.Row>\r\n            <Form.Row className=\"form-group\">\r\n              <Form.Label column lg={12}>Filter by:</Form.Label>\r\n            </Form.Row>\r\n            <Form.Row className=\"form-group\">\r\n              <Col md={1}>\r\n                <Form.Check id=\"filter-by-company\" name=\"filter-by\"\r\n                  type=\"radio\"\r\n                  label=\"\"\r\n                  className=\"abc-radio mx-2\"\r\n                  inline\r\n                  checked={companyChecked} onChange={(e) => this.handleCompanyChecked(e)}\r\n                />\r\n              </Col>\r\n              <Form.Label column lg={2} htmlFor=\"filter-by-company\">Company</Form.Label>\r\n              <Col lg={9}>\r\n                <CompanyInput disabled={!companyChecked} onChange={this.handleCompanyChange} />\r\n              </Col>\r\n            </Form.Row>\r\n            <Form.Row className=\"form-group\">\r\n              <Col md={1}>\r\n                <div className=\"abc-radio mx-2 form-check form-check-inline\">&nbsp;</div>\r\n              </Col>\r\n              <Form.Label column lg={2} htmlFor=\"filter-by-company\">Location</Form.Label>\r\n              <Col lg={9}>\r\n                <Form.Control id=\"location\" as=\"select\" value={this.state.selectedLocation?.AccountID} onChange={this.handleLocationChange} disabled={!companyChecked}>\r\n                  {!this.props.isLocationAdmin && <option value=\"\">Select</option>}\r\n                  {this.state.locations.map(l => <option value={l.AccountID} key={l.AccountID}>{l.Name}</option>)}\r\n                </Form.Control>\r\n              </Col>\r\n            </Form.Row>\r\n            <Form.Row className=\"form-group\">\r\n              <Col md={1}>\r\n                <Form.Check id=\"filter-by-group\" name=\"filter-by\"\r\n                  type=\"radio\"\r\n                  label=\"\"\r\n                  className=\"abc-radio mx-2\"\r\n                  inline\r\n                  checked={groupChecked} onChange={(e) => this.handleGroupChecked(e)}\r\n                />\r\n              </Col>\r\n              <Form.Label column lg={2} htmlFor=\"filter-by-group\">Group</Form.Label>\r\n              <Col lg={9}>\r\n                <AsyncTypeahead id=\"group-select\"\r\n                  emptyLabel=\"No Groups Found\"\r\n                  ref={this.typeaheadGroup}\r\n                  filterBy={() => true}\r\n                  isLoading={this.state.groupLoading}\r\n                  onChange={items => this.handleGroupChange(items[0])}\r\n                  onSearch={() => { }}\r\n                  options={this.state.groups}\r\n                  selected={this.state.selectedGroup ? [this.state.selectedGroup] : []}\r\n                  minLength={0}\r\n                  labelKey=\"Name\"\r\n                  disabled={!groupChecked}\r\n                  placeholder=\"Enter the Group name\"\r\n                  inputProps={{ autoComplete: \"chrome-off\" }}>\r\n                  {!this.state.groupLoading && groupChecked &&\r\n                    <Button variant=\"toggle\" onClick={() => this.typeaheadGroup.current?.toggleMenu()}>\r\n                      <FaAngleDown />\r\n                    </Button>}\r\n                </AsyncTypeahead>\r\n              </Col>\r\n            </Form.Row>\r\n            <Form.Row>\r\n              <Col md={1}>\r\n                <Form.Check id=\"filter-by-donor\" name=\"filter-by\"\r\n                  type=\"radio\"\r\n                  label=\"\"\r\n                  className=\"abc-radio mx-2\"\r\n                  inline\r\n                  checked={donorChecked} onChange={(e) => this.handleDonorChecked(e)}\r\n                />\r\n              </Col>\r\n              <Form.Label column lg={2} htmlFor=\"filter-by-donor\">Donor ID</Form.Label>\r\n              <Col lg={5}>\r\n                <InputGroup className=\"mb-3\">\r\n                  <TextFormControl value={donorId}\r\n                    disabled={!donorChecked}\r\n                    maxLength={MaxDonorIdLength}\r\n                    changeHandler={(value) => this.handleDonorIdChange(value)}\r\n                    isValid={() => this.validateDonorFormat()}\r\n                    enterTapHandler={this.onDonorSearch} />\r\n                  <Form.Control.Feedback className=\"order-last\" type=\"invalid\">{InvalidDonorId}</Form.Control.Feedback>\r\n                  <InputGroup.Append>\r\n                    <Button className=\"btn-rounded-right\" onClick={() => this.onDonorSearch()} disabled={!donorId}>\r\n                      {this.state.donorLoading ? <Spinner size=\"sm\" animation=\"border\" /> : <FaSearch />}\r\n                    </Button>\r\n                  </InputGroup.Append>\r\n                </InputGroup>\r\n                {!donorLoading && donor && <Form.Text muted>Donor: {donor.FirstName} {donor.LastName} was found.</Form.Text>}\r\n              </Col>\r\n            </Form.Row>\r\n          </Form>\r\n        </ModalBody>\r\n        <Modal.Footer className=\"justify-content-between\">\r\n          <Button variant=\"secondary\" onClick={() => this.handleCancelClick()}>Cancel</Button>\r\n          <ActionButton variant=\"primary\" disabled={!this.isParamsValid()} onClick={() => this.handleGenerateReportClick()} spin={this.state.loading} disableOnSpin>Continue</ActionButton>\r\n        </Modal.Footer>\r\n      </Modal.Dialog>\r\n    </AppPageWrapper>)\r\n  }\r\n}\r\n\r\nfunction mapStateToProps(state: AppState): ReportParametersProps {\r\n  return {\r\n    isLocationAdmin: isLocationAdmin(state),\r\n    isCompanyAdmin: isCompanyAdmin(state),\r\n    isPortalAdmin: isPortalAdmin(state),\r\n    company: GetSelectedAssignedClinic(state)?.AccountID\r\n  }\r\n}\r\n\r\nconst ConnectedReportParameters = connect(mapStateToProps, null)(ReportParameters)\r\nexport default ConnectedReportParameters\r\n","import * as React from \"react\"\r\nimport { Modal, Form, Button, Col } from \"react-bootstrap\"\r\nimport { concat, of, Subject, Subscription } from \"rxjs\"\r\nimport { debounceTime, filter, map, switchMap } from \"rxjs/operators\"\r\nimport { toast } from \"react-toastify\"\r\nimport { connect } from \"react-redux\"\r\nimport { FaAngleDown } from \"react-icons/fa\"\r\nimport { EmailRegexp, PhoneRegexp, SiteDomain } from \"../../../config/Constants\"\r\nimport { AsyncTypeahead } from \"react-bootstrap-typeahead\"\r\nimport MaskedInput from \"react-maskedinput\"\r\nimport ActionButton from \"../../ActionButton\"\r\nimport { EmailCheck } from \"../../../api/Invitation/InformationGet\"\r\nimport { GetRoles } from \"../../../api/Roles/UserRolesGet\"\r\nimport Role from \"../../../api/Roles/Model/Role\"\r\nimport ImplementationSearchResult from \"../../../api/Invitation/Model/ImplementationSearchResult\"\r\nimport { AllImplementationsGet } from \"../../../api/Invitation/InformationGet\"\r\nimport { PortalInvitation } from \"../../../api/Invitation/InvitationCreate\"\r\nimport { APIError } from \"../../../api/ObservableFromFetch\"\r\nimport { AppState } from \"../../../AppState\"\r\nimport { getUserNameForSelectedCompany, RoleIdForSelectedCompany } from \"../../../authentication/SelectedCompany/CompanySelectionDrivenSelectors\"\r\nimport FormatError from \"../../../formatters/FormatError\"\r\n\r\ninterface AddNewAdminModalProps {\r\n  show: boolean\r\n  onClose: (created: boolean) => void\r\n}\r\n\r\ninterface AddNewAdminAuthProps {\r\n  PrimaryRoleID?: number\r\n  UserName?: string\r\n}\r\n\r\ninterface AddNewAdminModalValidity {\r\n  implementationValid: boolean\r\n  emailValid: boolean\r\n  phoneValid: boolean\r\n  roleValid: boolean\r\n  firstNameValid: boolean\r\n  lastNameValid: boolean\r\n}\r\n\r\nexport interface AddNewAdminModalData {\r\n  implementationID?: number\r\n  email: string\r\n  phone: string\r\n  firstName: string\r\n  lastName: string\r\n  roleID?: number\r\n}\r\n\r\ninterface AddNewAdminModalState extends AddNewAdminModalData, AddNewAdminModalValidity {\r\n  emailChecking: boolean\r\n  emailAvailable?: boolean\r\n  saving: boolean\r\n  rolesLoading: boolean\r\n  roles?: Role[]\r\n  implementationsLoading: boolean\r\n  implementations: ImplementationSearchResult[]\r\n  selectedImplementation?: ImplementationSearchResult\r\n}\r\n\r\nexport class AddNewAdminModal extends React.PureComponent<AddNewAdminModalProps & AddNewAdminAuthProps, AddNewAdminModalState> {\r\n  emptyData: AddNewAdminModalData = {\r\n    implementationID: undefined,\r\n    email: \"\",\r\n    phone: \"\",\r\n    firstName: \"\",\r\n    lastName: \"\",\r\n    roleID: undefined\r\n  }\r\n  positiveValidity: AddNewAdminModalValidity = {\r\n    implementationValid: true,\r\n    emailValid: true,\r\n    phoneValid: true,\r\n    roleValid: true,\r\n    firstNameValid: true,\r\n    lastNameValid: true\r\n  }\r\n  defaultState: AddNewAdminModalState = {\r\n    ...this.emptyData,\r\n    ...this.positiveValidity,\r\n    emailChecking: false,\r\n    emailAvailable: undefined,\r\n    rolesLoading: false,\r\n    saving: false,\r\n    implementationsLoading: false,\r\n    implementations: []\r\n  }\r\n  state: AddNewAdminModalState = { ...this.defaultState }\r\n\r\n  checkEmail$ = new Subject<string>()\r\n  emailExistsSubscription?: Subscription\r\n  userRolesSubscription?: Subscription\r\n  saveSubscription?: Subscription\r\n  implementationsSubscription?: Subscription\r\n\r\n  searchImplementation$ = new Subject<string>()\r\n  typeahead = React.createRef<AsyncTypeahead<ImplementationSearchResult>>()\r\n\r\n  componentDidMount() {\r\n    this.emailExistsSubscription = this.checkEmail$.pipe(\r\n      map(name => name.trim()),\r\n      filter(name => this.isEmailValid(name)),\r\n      switchMap(name => concat(\r\n        of({ loading: true }),\r\n        EmailCheck(name).pipe(\r\n          map(result => ({ loading: false, result: result.IsEmailExists }))\r\n        )\r\n      ))\r\n    ).subscribe(\r\n      (o: { loading: boolean, result?: boolean }) => this.setState({ emailChecking: o.loading, emailAvailable: !o.result }),\r\n      (error) => this.handleAPIError(error, { emailChecking: false, emailAvailable: undefined })\r\n    )\r\n\r\n    //TODO: replace with correct RoleID\r\n    const roleID = this.props.PrimaryRoleID || 0\r\n    this.setState({ rolesLoading: true })\r\n    this.userRolesSubscription = GetRoles(roleID).subscribe(\r\n      (data: Role[]) => this.setState({ roles: data, roleID: data.length === 1 ? data[0].RoleID : undefined, rolesLoading: false }),\r\n      (error) => this.handleAPIError(error, { rolesLoading: false, emailAvailable: undefined })\r\n    )\r\n\r\n    this.implementationsSubscription = this.searchImplementation$.pipe(\r\n      filter(filter => filter.length >= 3),\r\n      debounceTime(500),\r\n      map(filter => (filter ?? \"\").trim()),\r\n      switchMap((filter) => concat(\r\n        of({ isLoading: true }),\r\n        AllImplementationsGet(filter).pipe(\r\n          map((data) => ({ isLoading: false, items: data }))\r\n        )\r\n      ))\r\n    ).subscribe(\r\n      (state: { isLoading: boolean, items?: ImplementationSearchResult[] }) => {\r\n        state.items\r\n          ? this.setState({ implementationsLoading: state.isLoading, implementations: state.items })\r\n          : this.setState({ implementationsLoading: state.isLoading })\r\n      },\r\n      (error) => this.handleAPIError(error, { isImplementationsLoading: false })\r\n    )\r\n\r\n  }\r\n\r\n  componentWillUnmount() {\r\n    this.emailExistsSubscription && this.emailExistsSubscription.unsubscribe()\r\n    this.userRolesSubscription && this.userRolesSubscription.unsubscribe()\r\n    this.saveSubscription && this.saveSubscription.unsubscribe()\r\n    this.implementationsSubscription && this.implementationsSubscription.unsubscribe()\r\n  }\r\n\r\n  handleAPIError = (error: Error | APIError, stateChanges: object) => {\r\n    this.setState(stateChanges)\r\n    error && toast.error(FormatError(error))\r\n  }\r\n\r\n  isEmailValid = (value: string) => EmailRegexp.test(value)\r\n  isPhoneValid = (value: string) => PhoneRegexp.test(value)\r\n  isRoleValid = (value: number | undefined): boolean => !!value && !!this.state.roles?.find(item => item.RoleID === value)\r\n  isNameValid = (value: string) => !!value.trim()\r\n\r\n  handleImplementationChange = (items: ImplementationSearchResult[]) => {\r\n    this.setState({\r\n      selectedImplementation: items[0],\r\n      implementationID: items[0]?.ImplementationID || 0,\r\n      implementationValid: !!items[0],\r\n    })\r\n  }\r\n\r\n  handleEmailChange = (e: React.ChangeEvent<HTMLInputElement>) => {\r\n    const value = e.target.value\r\n    this.setState({ email: value, emailValid: this.isEmailValid(value), emailAvailable: undefined })\r\n  }\r\n\r\n  handlePhoneChange = (e: React.ChangeEvent<HTMLInputElement>) => {\r\n    const value = e.target.value\r\n    this.setState({ phone: value, phoneValid: this.isPhoneValid(value) })\r\n  }\r\n\r\n  handleRoleChange = (e: React.ChangeEvent<HTMLSelectElement>) => {\r\n    const value = Number(e.target.value)\r\n    this.setState({ roleID: value, roleValid: this.isRoleValid(value) })\r\n  }\r\n\r\n  handleClose = (hasChanges: boolean) => {\r\n    const { roles } = this.state\r\n    this.setState({ ...this.defaultState, roleID: roles && roles.length === 1 ? roles[0].RoleID : undefined })\r\n    this.props.onClose(hasChanges)\r\n  }\r\n\r\n  getPortalSetupModalValidity = () =>{\r\n    const { implementationID, email, emailAvailable, phone, roleID, lastName, firstName } = this.state\r\n    const validity: AddNewAdminModalValidity = {\r\n      implementationValid: !!implementationID,\r\n      emailValid: this.isEmailValid(email) && !!emailAvailable,\r\n      phoneValid: this.isPhoneValid(phone),\r\n      roleValid: this.isRoleValid(roleID),\r\n      firstNameValid: this.isNameValid(firstName),\r\n      lastNameValid: this.isNameValid(lastName)\r\n    }\r\n    return validity\r\n  }\r\n\r\n  prepareUrl = (value: string) => value.replace(/[^a-zA-Z0-9_-]/g, \"\").toLowerCase()\r\n\r\n  handleCreateClick = () => {\r\n    if (this.state.emailChecking || this.state.rolesLoading || this.state.implementationsLoading) {\r\n      return\r\n    }\r\n    const { implementationID, email, emailAvailable, phone, roleID, selectedImplementation, firstName, lastName } = this.state\r\n    const validity = this.getPortalSetupModalValidity()\r\n    const isValid = Object.values(validity).every((valid: boolean) => valid)\r\n    if (!isValid) {\r\n      this.setState(validity)\r\n      return\r\n    }\r\n\r\n    const name = selectedImplementation?.ImplementationName || \"\"\r\n    const subdomain = selectedImplementation?.SubDomain.split('.')[0] || \"\"\r\n    const unmaskDonorID = selectedImplementation?.UnmaskDonorID || 0\r\n\r\n    this.setState({ saving: true })\r\n    this.saveSubscription && this.saveSubscription.unsubscribe()\r\n    this.saveSubscription = PortalInvitation({\r\n      CompanyName: name,\r\n      EmailAddress: email,\r\n      Link: `${this.prepareUrl(subdomain)}.${SiteDomain}`,\r\n      ModifiedBy: this.props.UserName || \"\",\r\n      PhoneNumber: phone.replace(/-/g, \"\"),\r\n      RoleID: roleID || 0,\r\n      IsExistingUser: !emailAvailable,\r\n      ImplementationID: implementationID || 0,\r\n      SubscriptionPlanID: 0,\r\n      IsGOVTPortal: false,\r\n      LastName: lastName,\r\n      FirstName: firstName,\r\n      UnmaskDonorID:unmaskDonorID\r\n    }).subscribe(\r\n      (result) => {\r\n        this.setState({ saving: false })\r\n        toast.success(result)\r\n        this.handleClose(true)\r\n      },\r\n      (error) => this.handleAPIError(error, { saving: false })\r\n    )\r\n  }\r\n\r\n  handleFirstNameChange = (e: React.ChangeEvent<HTMLInputElement>) => {\r\n    const value = e.target.value\r\n    this.setState({ firstName: value, firstNameValid: this.isNameValid(value) })\r\n  }\r\n\r\n  handleLastNameChange = (e: React.ChangeEvent<HTMLInputElement>) => {\r\n    const value = e.target.value\r\n    this.setState({ lastName: value, lastNameValid: this.isNameValid(value) })\r\n  }\r\n\r\n  render() {\r\n    const { implementationValid, email, emailValid, emailChecking, emailAvailable, \r\n      phone, phoneValid,\r\n      roleID, roleValid, rolesLoading,\r\n      firstName, firstNameValid, lastName, lastNameValid } = this.state\r\n    let disableCreate = emailChecking || rolesLoading\r\n\r\n    if (!disableCreate){\r\n        const validity = this.getPortalSetupModalValidity()\r\n        const isValid = Object.values(validity).every((valid: boolean) => valid)\r\n        disableCreate = !isValid\r\n      }\r\n    return (<>\r\n      <Modal centered backdrop=\"static\" size=\"lg\" show={this.props.show} onHide={this.props.onClose}>\r\n        <Modal.Header closeButton>\r\n          <Modal.Title>ADD NEW PORTAL ADMIN</Modal.Title>\r\n        </Modal.Header>\r\n        <Modal.Body>\r\n          <Form>\r\n            <Form.Row className=\"form-group required\">\r\n              <Form.Label column sm={4} htmlFor=\"name\">Portal Name</Form.Label>\r\n              <Col sm={8}>\r\n                <AsyncTypeahead id=\"implementation\"\r\n                  ref={this.typeahead}\r\n                  labelKey=\"ImplementationName\"\r\n                  filterBy={() => true}\r\n                  isLoading={this.state.implementationsLoading}\r\n                  onSearch={() => { }}\r\n                  onInputChange={input => this.searchImplementation$.next(input)}\r\n                  onChange={this.handleImplementationChange}\r\n                  options={this.state.implementations}\r\n                  selected={this.state.selectedImplementation ? [this.state.selectedImplementation] : []}\r\n                  minLength={3}\r\n                  emptyLabel=\"No Portals Found\"\r\n                  placeholder=\"\"\r\n                  isInvalid={!implementationValid}\r\n                  inputProps={{ autoComplete: \"chrome-off\" }}>\r\n                  {!this.state.implementationsLoading &&\r\n                    <Button variant=\"toggle\" onClick={() => { this.typeahead.current?.toggleMenu() }}>\r\n                      <FaAngleDown />\r\n                    </Button>}\r\n                </AsyncTypeahead>\r\n              </Col>\r\n            </Form.Row>\r\n            <Form.Row className=\"form-group required\">\r\n              <Form.Label column sm={4} htmlFor=\"email\">Portal Admin Email Address</Form.Label>\r\n              <Col sm={8}>\r\n                <Form.Control id=\"email\"\r\n                  type=\"text\"\r\n                  value={email}\r\n                  onChange={this.handleEmailChange}\r\n                  onBlur={(e: React.FocusEvent<HTMLInputElement>) => this.checkEmail$.next(e.target.value)}\r\n                  isInvalid={!emailValid}\r\n                  disabled={emailChecking} />\r\n                {!emailChecking && !emailValid && <Form.Control.Feedback type=\"invalid\" className=\"d-block\">Please enter valid email</Form.Control.Feedback>}\r\n                {!emailChecking && emailAvailable && < Form.Control.Feedback type=\"valid\" className=\"d-block\">Email is available</Form.Control.Feedback>}\r\n                {!emailChecking && emailAvailable === false && <Form.Control.Feedback type=\"invalid\" className=\"d-block\">Email is already in use</Form.Control.Feedback>}\r\n              </Col>\r\n            </Form.Row>\r\n            <Form.Row className=\"form-group required\">\r\n              <Form.Label column sm={4} htmlFor=\"phone\">Portal Admin Personal Phone</Form.Label>\r\n              <Col sm={8}>\r\n                <Form.Control id=\"phone\" type=\"text\" as={MaskedInput} mask=\"111-111-1111\" value={phone} onChange={this.handlePhoneChange} isInvalid={!phoneValid} />\r\n                <Form.Text>This phone number will be used to validate the Administrator. Please provide a direct number or mobile number (not a main company number or extension)</Form.Text>\r\n              </Col>\r\n            </Form.Row>\r\n            <Form.Row className=\"form-group required\">\r\n              <Form.Label column sm={4} htmlFor=\"role\">Portal Admin First Name</Form.Label>\r\n              <Col sm={8}>\r\n                <Form.Control id=\"firstName\"\r\n                              type=\"text\"\r\n                              maxLength={20}\r\n                              value={firstName}\r\n                              onChange={this.handleFirstNameChange}\r\n                              onBlur={this.handleFirstNameChange}\r\n                              isInvalid={!firstNameValid}/>\r\n              </Col>\r\n            </Form.Row>\r\n            <Form.Row className=\"form-group required\">\r\n              <Form.Label column sm={4} htmlFor=\"role\">Portal Admin Last Name</Form.Label>\r\n              <Col sm={8}>\r\n                <Form.Control id=\"lastName\"\r\n                              type=\"text\"\r\n                              maxLength={20} \r\n                              value={lastName}\r\n                              onChange={this.handleLastNameChange}\r\n                              onBlur={this.handleLastNameChange}\r\n                              isInvalid={!lastNameValid}/>\r\n              </Col>\r\n            </Form.Row>\r\n            <Form.Row className=\"form-group required\">\r\n              <Form.Label column sm={4} htmlFor=\"role\">User's Role</Form.Label>\r\n              <Col sm={8}>\r\n                <Form.Control id=\"role\" as=\"select\" onChange={this.handleRoleChange} value={roleID || \"\"} isInvalid={!roleValid}>\r\n                  {this.state.roles && this.state.roles.length > 1 && <option value=\"\">Select Role</option>}\r\n                  {this.state.roles?.map(role => <option value={role.RoleID} key={role.RoleID}>{role.Title}</option>)}\r\n                </Form.Control>\r\n              </Col>\r\n            </Form.Row>\r\n          </Form>\r\n        </Modal.Body>\r\n        <Modal.Footer>\r\n          <Button variant=\"secondary\" onClick={() => this.handleClose(false)}>Cancel</Button>\r\n          <ActionButton variant=\"primary\" disabled={disableCreate} onClick={this.handleCreateClick} spin={this.state.saving} disableOnSpin>Create</ActionButton>\r\n        </Modal.Footer>\r\n      </Modal>\r\n    </>\r\n    )\r\n  }\r\n}\r\n\r\nfunction mapStateToProps(state: AppState): AddNewAdminAuthProps {\r\n  return {\r\n    PrimaryRoleID: RoleIdForSelectedCompany(state),\r\n    UserName: getUserNameForSelectedCompany(state)\r\n  }\r\n}\r\n\r\nconst ConnectedPortalSetupModal = connect(mapStateToProps, null)(AddNewAdminModal)\r\nexport default ConnectedPortalSetupModal\r\n","import React, { PureComponent } from 'react'\r\nimport { Button, Col, Container, Row, Spinner, Table } from 'react-bootstrap'\r\nimport { Subscription, BehaviorSubject, of, concat } from \"rxjs\"\r\nimport { distinctUntilChanged, switchMap, map, catchError } from \"rxjs/operators\"\r\nimport { toast } from \"react-toastify\"\r\nimport { connect } from \"react-redux\"\r\nimport { AppState } from '../../../AppState'\r\nimport { Filter, Sort } from \"../../../api/GridRequest\"\r\nimport { CustomizableFilterColumn } from '../../ColumnsCustomizeModal/CustomizableColumn'\r\nimport { AppPageWrapper } from '../../NavMenu/AppPageWrapper'\r\nimport TablePagination from '../../TablePagination'\r\nimport SearchField from '../../../api/SearchField'\r\nimport SearchBar from '../../SearchBar'\r\nimport FormatError from '../../../formatters/FormatError'\r\nimport ColumnHeaderFilter from '../../ColumnHeaderFilter'\r\nimport PortalGridRow from '../../../api/Invitation/Portal/PortalGridRow'\r\nimport { PortalColumnFilter } from '../../../api/Invitation/Portal/PortalColumnFilter'\r\nimport PortalGridData from '../../../api/Invitation/Portal/PortalGridData'\r\nimport { PortalGridGetObservable } from '../../../api/Invitation/Portal/PortalGridGetObservable'\r\nimport { isSiteAdmin } from '../../../authentication/isAdminRole'\r\nimport UserInfo, { UserInfoMode } from '../../Administration/UserInfo'\r\nimport { ImplementationGroupID_Workforce } from '../../../config/Constants'\r\nimport { AddNewPortalRoute, PortalDetailsRoute } from '../../../config/Routes'\r\nimport { Link } from 'react-router-dom'\r\nimport FormatPhone from '../../../formatters/FormatPhone'\r\nimport FormatZipCode from '../../../formatters/FormatZipCode'\r\nimport {RouteComponentProps} from \"react-router\";\r\nimport AddNewAdminModal from './AddNewAdminModal'\r\n\r\ntype Column = CustomizableFilterColumn<keyof PortalGridRow, keyof PortalColumnFilter>\r\n\r\ninterface PortalGridState {\r\n  loading: boolean\r\n  data?: PortalGridData\r\n  details?: PortalGridRow\r\n  columns: Column[]\r\n  showUserInfo: boolean\r\n  showUserInfoFor?: string\r\n  participationId?: number\r\n  showAddAdmin: boolean\r\n}\r\n\r\ninterface PortalGridProps {\r\n  isSiteAdmin?: boolean\r\n}\r\n\r\nconst PageSize = 30\r\n\r\nconst DefaultSearchFields: SearchField[] = [\r\n  { ID: \"ImplementationName\", Name: \"Portal Name\" },\r\n  { ID: \"Email\", Name: \"Email\" }\r\n]\r\n\r\nconst DefaultColumns: Column[] = [\r\n  { name: \"ImplementationName\", label: \"Portal Name\", visible: true},\r\n  { name: \"ImplementationType\", label: \"Type\", visible: true },\r\n  { name: \"CompanyName\", label: \"Company Name\", visible: true },\r\n  { name: \"Address\", label: \"Address\", visible: true },\r\n  { name: \"City\", label: \"City\", visible: true },\r\n  { name: \"StateCode\", label: \"State\", visible: true },\r\n  { name: \"Zip\", label: \"Zip\", visible: true },\r\n  { name: \"Email\", label: \"Admin Email\", visible: true },\r\n  { name: \"Phone\", label: \"Admin Phone\", visible: true },\r\n  { name: \"Inactive\", label: \"Active/Inactive\", visible: true }\r\n]\r\n\r\ninterface GridSearchParams {\r\n  pageNumber: number\r\n  sort: Sort\r\n  filters: Filter[]\r\n  search: { field: string, text: string }\r\n}\r\n\r\nclass PortalGrid extends PureComponent<PortalGridProps, PortalGridState> {\r\n  state: PortalGridState = {\r\n    loading: false,\r\n    columns: DefaultColumns,\r\n    showUserInfo: false,\r\n    showAddAdmin: false\r\n  }\r\n\r\n  page$ = new BehaviorSubject<GridSearchParams>({\r\n    pageNumber: 1,\r\n    sort: { column: \"\", order: \"\" },\r\n    filters: [],\r\n    search: { field: \"\", text: \"\" }\r\n  })\r\n\r\n  sortGrid(column: string, order?: string) {\r\n    const newSort = { column: column, order: order || \"\" }\r\n    this.page$.next({ ...this.page$.value, sort: newSort })\r\n  }\r\n\r\n  filterGrid(column: string, items: string[]) {\r\n    const filters = [...this.page$.value.filters]\r\n    const filter = { column: column, values: items }\r\n    let index = filters.findIndex(item => item.column === filter.column)\r\n    if (index >= 0) {\r\n      filters[index] = filter\r\n    } else {\r\n      filters.push(filter)\r\n    }\r\n\r\n    this.page$.next({ ...this.page$.value, pageNumber: 1, filters: filters })\r\n  }\r\n\r\n  onSearch = (field: string, text: string) => this.page$.next({ ...this.page$.value, pageNumber: 1, search: { field: field, text: text } })\r\n  handlePageChange = (pageNumber: number) => this.page$.next({ ...this.page$.value, pageNumber: pageNumber })\r\n  handleAddPortal = () => (this.props as RouteComponentProps).history?.push(AddNewPortalRoute)\r\n  reload = () => this.page$.next({ ...this.page$.value, pageNumber: 1 })\r\n  hideUserInfo = () => this.setState({ showUserInfoFor: undefined, showUserInfo: false })\r\n  showUserInfo = (data: PortalGridRow) => {\r\n    this.setState({ showUserInfoFor: data.UserName, participationId: data.ParticipationID, showUserInfo: true })\r\n  }\r\n  handleAddAdminModalClose = (hasUpdates: boolean) => {\r\n    this.setState({ showAddAdmin: false })\r\n    if (hasUpdates) {\r\n      this.handlePageChange(1)\r\n    }\r\n  }\r\n\r\n  pageSubscription?: Subscription\r\n\r\n  componentDidMount() {\r\n    this.pageSubscription = this.page$.pipe(\r\n      distinctUntilChanged(),\r\n      switchMap((params: GridSearchParams) => concat(\r\n        of({ loading: true }),\r\n        PortalGridGetObservable(params.pageNumber, PageSize, params.sort, params.filters, params.search, ImplementationGroupID_Workforce).pipe(\r\n          map((result: PortalGridData) => ({ data: result, loading: false })),\r\n          catchError((error) => of({ loading: false, errorMessage: FormatError(error) }))\r\n        )))\r\n    ).subscribe(\r\n      (newState: { loading: boolean, data?: PortalGridData, errorMessage?: string }) => {\r\n        if (newState.data) {\r\n          this.setState({ loading: newState.loading, data: newState.data })\r\n        } else {\r\n          this.setState({ loading: newState.loading })\r\n        }\r\n        newState.errorMessage && toast.error(newState.errorMessage)\r\n      },\r\n      (error) => {\r\n        this.setState({ loading: false })\r\n        toast.error(FormatError(error))\r\n      }\r\n    )\r\n  }\r\n\r\n  componentWillUnmount() {\r\n    this.pageSubscription && this.pageSubscription.unsubscribe()\r\n    this.page$.unsubscribe()\r\n  }\r\n\r\n  visibleColumns = () => this.state.columns.filter(col => col.visible)\r\n\r\n  renderHeader = () => this.visibleColumns().map((col: Column, i) => {\r\n    const sort = this.page$.value.sort\r\n    return (\r\n      <th key={col.name}>\r\n        {this.state.data && col.filter && col.filter in this.state.data && <ColumnHeaderFilter\r\n          title={col.label || col.name}\r\n          filteredItems={this.page$.value.filters.find(item => item.column === col.filter)?.values || []}\r\n          sort={sort.column === col.name ? sort.order === \"asc\" ? \"asc\" : \"desc\" : undefined}\r\n          items={this.state.data[col.filter as keyof PortalColumnFilter]?.filter(item => !!item) || []}\r\n          onSort={(order?: string) => this.sortGrid(col.name, order)}\r\n          onFilter={(items: string[]) => col.filter && this.filterGrid(col.filter, items)}\r\n        />}\r\n        {(this.state.data && !col.filter) && <span className=\"column-header-title text-uppercase mr-1\">{col.label || col.name}</span>}\r\n      </th>\r\n    )\r\n  })\r\n\r\n  renderRows = () => {\r\n    if (this.state.data?.Records && this.state.data?.Records.length) {\r\n      return this.state.data.Records.map((row: PortalGridRow, i: number) =>\r\n        <tr key={i}>\r\n          <td><Link className=\"btn-link btn-icon-link\" to={{ pathname: PortalDetailsRoute(row.ImplementationName) }}>{row.ImplementationName}</Link></td>\r\n          <td>{row.ImplementationType}</td>\r\n          <td>{row.CompanyName}</td>\r\n          <td>{row.Address}</td>\r\n          <td>{row.City}</td>\r\n          <td>{row.StateCode}</td>\r\n          <td>{FormatZipCode(row.Zip)}</td>\r\n          <td><Button variant=\"link\" onClick={() => this.showUserInfo(row)} className=\"p-0\">{row.Email}</Button></td>\r\n          <td>{FormatPhone(row.Phone)}</td>\r\n          <td>{row.Inactive ? \"Inactive\" : \"Active\"}</td>\r\n        </tr>)\r\n    } else {\r\n      return <tr><td colSpan={9}>No Records Found</td></tr>\r\n    }\r\n  }\r\n\r\n  render() {\r\n    return (\r\n      <AppPageWrapper parentClassName={\"align-items-center\"} showNav>\r\n        <Container fluid className=\"grid-container\">\r\n          <Row className=\"pb-2\">\r\n            <Col>\r\n              <UserInfo\r\n                show={!!this.state.showUserInfoFor}\r\n                mode={UserInfoMode.Team}\r\n                onClose={this.hideUserInfo}\r\n                LoginName={this.state.showUserInfoFor}\r\n                participationId={this.state.participationId} />\r\n              <SearchBar\r\n                allowBlank\r\n                resetButton\r\n                onSearch={this.onSearch}\r\n                searchFields={DefaultSearchFields}\r\n                loading={this.state.loading}\r\n              />\r\n            </Col>\r\n            <Col md={8} className=\"text-md-right mt-2 mt-md-0\">\r\n              <Button variant=\"primary\" size=\"sm\" onClick={this.handleAddPortal} className=\"mr-2\">Add Portal</Button>\r\n              <Button variant=\"primary\" size=\"sm\" onClick={() => this.setState({ showAddAdmin: true })}>Add Portal Admin</Button>\r\n            </Col>\r\n          </Row>\r\n          <Row>\r\n            <Col>\r\n              <Table bordered responsive>\r\n                <thead>\r\n                  <tr>\r\n                    {this.renderHeader()}\r\n                  </tr>\r\n                </thead>\r\n                <tbody>\r\n                  {\r\n                    this.state.loading ?\r\n                      <tr>\r\n                        <td className=\"text-center\" colSpan={9}>\r\n                          <Spinner animation=\"border\" variant=\"secondary\" />\r\n                        </td>\r\n                      </tr> : this.renderRows()\r\n                  }\r\n                </tbody>\r\n              </Table>\r\n            </Col>\r\n          </Row>\r\n          {this.state.data ?\r\n            <Row>\r\n              <Col>\r\n                <span className=\"total-records\">Total records: {this.state.loading ? \" ... \" : this.state.data.Total}</span>\r\n                <TablePagination pageNumber={this.page$.value.pageNumber} pages={this.state.data.Pages} onChange={this.handlePageChange} />\r\n              </Col>\r\n            </Row> : undefined}\r\n        </Container>\r\n        {this.state.showAddAdmin && <AddNewAdminModal show={this.state.showAddAdmin} onClose={this.handleAddAdminModalClose}/>}\r\n      </AppPageWrapper>\r\n    )\r\n  }\r\n}\r\n\r\nfunction mapStateToProps(state: AppState): PortalGridProps {\r\n  return {\r\n    isSiteAdmin: isSiteAdmin(state)\r\n  }\r\n}\r\nconst ConnectedPortalGrid = connect(mapStateToProps, null)(PortalGrid)\r\nexport default ConnectedPortalGrid\r\n","import { ObservableFromFetch } from \"../../ObservableFromFetch\"\r\nimport { Filter, Sort } from \"../../GridRequest\"\r\nimport PortalGridData from \"./PortalGridData\"\r\n\r\nexport function PortalGridGetObservable(pageNumber: number, pageSize: number, sort: Sort, filters: Filter[], search: { field: string, text: string }, implementationGroupID?: number) {\r\n  const requestBody: string = JSON.stringify({\r\n    ImplementationGroupID: implementationGroupID,\r\n    PageNumber: pageNumber,\r\n    PageSize: pageSize,\r\n    SearchBy: search.field || \"\",\r\n    SearchText: search.text || \"\",\r\n    SortGrid: { SortColumn: sort.column, SortOrder: sort.order.toUpperCase() }\r\n  })\r\n\r\n  return ObservableFromFetch<PortalGridData>(\"WorkforceSuperUser/PortalDetails\", requestBody)\r\n}\r\n","import * as React from \"react\"\r\nimport { RouteComponentProps } from \"react-router\"\r\nimport CompanyInformation from \"../../Administration/CompanyInformation\";\r\n\r\nexport default class AddNewPortal extends React.PureComponent<RouteComponentProps> {\r\n  render() {\r\n    return <CompanyInformation {...this.props} portalMode isNew />\r\n  }\r\n}","import * as React from \"react\"\r\nimport { Typeahead, AsyncTypeahead } from \"react-bootstrap-typeahead\"\r\nimport { Button, Form } from \"react-bootstrap\"\r\nimport { FaAngleDown } from \"react-icons/fa\"\r\nimport AutoFilterCompany from \"../../api/Companies/CompanyModel/AutoFilterCompany\"\r\nimport { concat, of, Subject, Subscription } from \"rxjs\"\r\nimport { catchError, debounceTime, filter, map, switchMap } from \"rxjs/operators\"\r\nimport { DataLoader } from \"../OrderRequests/GovCollection\"\r\nimport GetAccountsByNameObservable from \"../../api/Companies/GetAccountsByName\"\r\nimport { RouteComponentProps, withRouter } from \"react-router\"\r\nimport { WorkforceClinicPortal } from \"../../AppState\"\r\nimport { AccountType } from \"../../config/Constants\"\r\n\r\ninterface AccountInputState {\r\n  accounts: DataLoader<AutoFilterCompany>\r\n}\r\n\r\ninterface AccountInputProps {\r\n  defaultValue?: string\r\n  forceEdit?: boolean\r\n  id?: string\r\n  disabled?: boolean\r\n  filter?: boolean\r\n  placeholder?: string\r\n  emptyLabel?: string\r\n  accountType: AccountType\r\n  onChange?: (items: AutoFilterCompany[]) => void\r\n}\r\n\r\nclass AccountInput extends React.PureComponent<AccountInputProps & RouteComponentProps, AccountInputState> {\r\n  accountAsyncTypeahead = React.createRef<AsyncTypeahead<AutoFilterCompany>>()\r\n  accountTypeahead = React.createRef<Typeahead<AutoFilterCompany>>()\r\n  accounts$ = new Subject<string>()\r\n  subscription?: Subscription\r\n  state: AccountInputState = { accounts: {} }\r\n  defaultAccountName: string = this.props.defaultValue || this.getAccountName()\r\n\r\n  componentDidMount() {\r\n    this.subcribeAccounts()\r\n    this.onInputChange(this.defaultAccountName)\r\n  }\r\n\r\n  componentDidUpdate(prevProps: AccountInputProps & RouteComponentProps, prevState: AccountInputState) {\r\n    if ((this.props.accountType !== prevProps.accountType) || !this.defaultAccountName && this.props.location.pathname !== prevProps.location.pathname) {\r\n      this.accountAsyncTypeahead?.current?.clear()\r\n      this.onInputChange(\"\")\r\n    }\r\n  }\r\n\r\n  componentWillUnmount() {\r\n    this.subscription && this.subscription.unsubscribe()\r\n  }\r\n\r\n  onInputChange(value: string) {\r\n    if (value === \"\") {\r\n      this.setState({ accounts: { selected: undefined } }, () => this.props.onChange && this.props.onChange([]))\r\n    }\r\n    else {\r\n      this.accounts$.next(value)\r\n    }\r\n  }\r\n\r\n  getAccountName() {\r\n\r\n    const participation = sessionStorage.getItem(\"company-selection\")\r\n    const portals: WorkforceClinicPortal[] = JSON.parse(sessionStorage.getItem(\"wf2-STRY0045127-portals\") || \"{}\")\r\n    var account = undefined\r\n    for (const p of portals) {\r\n      for (const c of p.AssignedClientDetailsOfClinic) {\r\n        if (c.ParticipationID.toString() == participation) {\r\n          account = c\r\n          break\r\n        }\r\n      }\r\n      if (account) {\r\n        break\r\n      }\r\n    }\r\n    return account?.Name || \"\"\r\n  }\r\n\r\n  onChange = (accounts: AutoFilterCompany[]) => {\r\n    this.setState({ accounts: { ...this.state.accounts, selected: accounts[0] } })\r\n    this.props.onChange && this.props.onChange(accounts)\r\n  }\r\n\r\n  subcribeAccounts() {\r\n    this.subscription = this.accounts$.pipe(\r\n      debounceTime(500),\r\n      filter(filter => filter.length >= 1 || filter.length === 0),\r\n      switchMap((filter) => filter.length === 0 ?\r\n        of({ loading: false, accounts: this.state.accounts.data }) :\r\n        concat(\r\n          of({ loading: true }),\r\n          GetAccountsByNameObservable(filter, undefined, this.props.accountType).pipe(\r\n            map((data) => ({ loading: false, accounts: data })),\r\n            catchError(() => of({ loading: false }))\r\n          )\r\n        )\r\n      )\r\n    ).subscribe(\r\n      (state: { loading: boolean, accounts?: AutoFilterCompany[] }) => {\r\n        state.accounts ?\r\n          this.setState({ accounts: { loading: state.loading, data: state.accounts, selected: this.defaultAccountName ? state.accounts[0] : undefined } }, () => this.defaultAccountName && this.onChange((state.accounts || []))) :\r\n          this.setState({ accounts: { loading: state.loading } })\r\n      },\r\n      () => this.setState({ accounts: { loading: false } })\r\n    )\r\n  }\r\n\r\n  render() {\r\n    return (\r\n      <>\r\n        {(!this.defaultAccountName || this.props.forceEdit) ? <AsyncTypeahead\r\n          useCache={false}\r\n          disabled={this.props.disabled}\r\n          emptyLabel={this.props.emptyLabel || \"No \" + AccountType[this.props.accountType] + \" Found\"}\r\n          filterBy={(option, props) => this.props.filter ? props.selected.length > 0 || option.Name.toLowerCase().indexOf(props.text.toLowerCase()) !== -1 : true}\r\n          id={this.props.id || AccountType[this.props.accountType]}\r\n          isLoading={!!this.state.accounts.loading}\r\n          labelKey=\"Name\"\r\n          minLength={0}\r\n          onInputChange={input => this.onInputChange(input)}\r\n          onChange={items => this.onChange(items)}\r\n          onSearch={() => { }}\r\n          options={this.state.accounts.data || []}\r\n          placeholder={this.props.placeholder || \"Enter the \" + AccountType[this.props.accountType] + \" name\"}\r\n          ref={this.accountAsyncTypeahead}\r\n          selected={this.state.accounts.selected ? [this.state.accounts.selected] : []}>\r\n          {!this.state.accounts.loading && !this.props.disabled &&\r\n            <Button variant=\"toggle\" onClick={() => { this.accountAsyncTypeahead?.current?.toggleMenu() }}>\r\n              <FaAngleDown />\r\n            </Button>}\r\n        </AsyncTypeahead> : <Form.Control type=\"text\" disabled defaultValue={this.state.accounts.selected?.Name || \"\"} />}\r\n      </>\r\n    )\r\n  }\r\n}\r\n\r\nexport default withRouter(AccountInput)\r\n","import { Observable } from \"rxjs\"\r\nimport { ObservableFromFetch } from \"../ObservableFromFetch\"\r\n\r\nexport default function DriverCertificationReportGet(reportID: number, company: number, donorStatus: number): Observable<string> {\r\n  const requestBody: string = JSON.stringify({\r\n    ClientDetails: {},\r\n    ReportID: reportID,\r\n    Company: [company],\r\n    DonorStatus: donorStatus,\r\n    BreakByCompanies: true\r\n  })\r\n\r\n  return ObservableFromFetch<string>(\"WorkforceReport/DriverReport\", requestBody)\r\n}\r\n","import * as React from \"react\"\r\nimport { connect } from \"react-redux\"\r\nimport { toast } from \"react-toastify\"\r\nimport { RouteComponentProps } from \"react-router\"\r\nimport { AppPageWrapper } from \"../NavMenu/AppPageWrapper\"\r\nimport { Button, Col, Form, InputGroup, Modal, ModalBody, Spinner } from \"react-bootstrap\"\r\nimport { Subscription } from \"rxjs\"\r\nimport ActionButton from \"../ActionButton\"\r\nimport AccountInput from \"../FormattedInputs/AccountInput\"\r\nimport AutoFilterCompany from \"../../api/Companies/CompanyModel/AutoFilterCompany\"\r\nimport { AppState } from \"../../AppState\"\r\nimport FormatError from \"../../formatters/FormatError\"\r\nimport { Home } from \"../../config/Routes\"\r\nimport { isCompanyAdmin, isLocationAdmin, isPortalAdmin, isSiteAdmin } from \"../../authentication/isAdminRole\"\r\nimport getWorkforceReport, { WorkforceReportRecord, Report, WorkforceReportType, RegulatoryModesGet, YearListGet, ManagementSummaryReport, MISReport, ManagementSummaryReportGenerate, MISReportGenerate, SelectedNotTestedReportGenerate } from \"../../api/Reports/WorkforceReport\"\r\nimport { GetSelectedAssignedClinic } from \"../../authentication/SelectedCompany/CompanySelectionDrivenSelectors\"\r\nimport ToggleSwitch from \"../FormattedInputs/ToggleSwitch\"\r\nimport FromToDates from \"./FromToDates\"\r\nimport FormatDate from \"../../formatters/FormatDate\"\r\nimport { AccountTypeID, DonorIdRegexp, InvalidDonorId, MaxDonorIdLength } from \"../../config/Constants\"\r\nimport DriverCertificationReportGet from \"../../api/Reports/DriverCertificationReportGet\"\r\nimport printPdf from \"../../utils/printPdf\"\r\nimport { AccountType } from \"../../config/Constants\"\r\nimport DualListBox from \"../../components/Administration/DualListBox\"\r\nimport { GetAllAccountsByNameObservable } from \"../../api/Companies/GetAccountsByName\"\r\nimport LocationInput from \"../FormattedInputs/LocationInput\"\r\nimport { Pool } from \"../../api/Randoms/RandomsModel/PoolData\"\r\nimport TextFormControl from \"../OrderRequests/TextFormControl\"\r\nimport { FaAngleDown, FaSearch } from \"react-icons/fa\"\r\nimport { SearchDonorGetObservable } from \"../../api/OrderRequests/SearchDonorGet\"\r\nimport { Donor } from \"../../api/OrderRequests/OrderRequestsModel/Donor\"\r\nimport { GetRegulatoryModeDonor } from \"../OrderRequests/OrderModels\"\r\nimport { RegulatoryModeObservable } from \"../../api/OrderRequests/OrderRequestsConstraintGet\"\r\nimport CompanyInput from \"../FormattedInputs/CompanyInput\"\r\nimport { AsyncTypeahead } from \"react-bootstrap-typeahead\"\r\nimport { PoolsGetObservable } from \"../../api/Randoms/PoolGeneralInfoGet\"\r\nimport { FaFileCsv, FaFilePdf} from \"react-icons/fa\"\r\nimport exportCsv from \"../../utils/exportCsv\"\r\nimport FormatTimestampFileName from \"../../formatters/FormatTimestampFileName\"\r\n\r\ninterface WorkforceReportParametersProps {\r\n  isLocationAdmin?: boolean\r\n  isCompanyAdmin?: boolean\r\n  isPortalAdmin?: boolean\r\n  isSiteAdmin?: boolean\r\n  company?: number\r\n}\r\n\r\ninterface WorkforceReportParametersState {\r\n  report: WorkforceReportRecord\r\n  from?: Date\r\n  to?: Date\r\n  regulatoryModes: string[]\r\n  statuses: { name: string, value: number }[]\r\n  years: number[]\r\n  ranges: string[]\r\n  selectedLocation?: AutoFilterCompany\r\n  selectedCompany?: AutoFilterCompany\r\n  selectedPool?: Pool\r\n  pools: Pool[]\r\n  donor?: Donor\r\n  donorId?: string\r\n  idType?: GetRegulatoryModeDonor\r\n  selectedStatus: number\r\n  selectedMode?: string\r\n  selectedYear?: number\r\n  selectedRange: string\r\n  regulatoryModeLoading: boolean\r\n  yearsLoading: boolean\r\n  includeAlcohol: boolean\r\n  rangeChecked: boolean\r\n  yearChecked: boolean\r\n  donorChecked: boolean\r\n  donorLoading: boolean\r\n  poolChecked: boolean\r\n  allPoolsChecked: boolean\r\n  poolLoading: boolean\r\n  companyChecked: boolean\r\n  allCompaniesChecked: boolean\r\n  accountType: AccountType\r\n  loading: boolean\r\n  saving: boolean\r\n  selectedCompanies: AutoFilterCompany[]\r\n  companies: AutoFilterCompany[]\r\n  companiesLoading: boolean\r\n}\r\n\r\n\r\nclass WorkforceReportParameters extends React.PureComponent<WorkforceReportParametersProps & RouteComponentProps, WorkforceReportParametersState> {\r\n  statuses = [{ name: \"All\", value: 1 }, { name: \"Active\", value: 2 }, { name: \"Inactive\", value: 3 }]\r\n  ranges = [\"Collected\", \"Reviewed\", \"Ordered\", \"Scheduled\"]\r\n\r\n  state: WorkforceReportParametersState = {\r\n    report: getWorkforceReport(this.props.location.pathname as Report),\r\n    statuses: this.statuses,\r\n    years: [],\r\n    pools: [],\r\n    ranges: this.ranges,\r\n    regulatoryModes: [],\r\n    selectedStatus: this.statuses[0].value,\r\n    selectedRange: this.ranges[0],\r\n    regulatoryModeLoading: false,\r\n    yearsLoading: false,\r\n    includeAlcohol: false,\r\n    rangeChecked: false,\r\n    yearChecked: true,\r\n    companyChecked: false,\r\n    allCompaniesChecked: false,\r\n    donorChecked: false,\r\n    donorLoading: false,\r\n    poolLoading: false,\r\n    poolChecked: false,\r\n    allPoolsChecked: false,\r\n    accountType: AccountType.Company,\r\n    loading: false,\r\n    saving: false,\r\n    selectedCompanies: [],\r\n    companies: [],\r\n    companiesLoading: false\r\n  }\r\n\r\n  typeaheadPool = React.createRef<AsyncTypeahead<Pool>>()\r\n  subscriptions = new Subscription()\r\n  donorSubscription?: Subscription\r\n  printSubscription?: Subscription\r\n\r\n  handleCompanyChange = (selected: AutoFilterCompany[]) => this.setState({ selectedCompany: selected[0] })\r\n  handleLocationChange = (locations: AutoFilterCompany[]) => this.setState({ selectedLocation: locations[0] })\r\n  handlePoolChange = (selected: Pool) => this.setState({ selectedPool: selected })\r\n  handleDonorStatusChange = (event: React.ChangeEvent<HTMLSelectElement>) => this.setState({ selectedStatus: parseInt(event.target.value) })\r\n  handleRegModeChange = (event: React.ChangeEvent<HTMLSelectElement>) => this.setState({ selectedMode: event.target.value })\r\n  handleYearChange = (event: React.ChangeEvent<HTMLSelectElement>) => this.setState({ selectedYear: parseInt(event.target.value) })\r\n  handleDateRangeChange = (event: React.ChangeEvent<HTMLSelectElement>) => this.setState({ selectedRange: event.target.value })\r\n  handleDonorChecked = (e: React.ChangeEvent<HTMLInputElement>) => this.switchRadioButton(false, e.target.checked, false, false, false)\r\n  handlePoolChecked = (e: React.ChangeEvent<HTMLInputElement>) => this.switchRadioButton(false, false, e.target.checked, false, false)\r\n  handleCompanyChecked = (e: React.ChangeEvent<HTMLInputElement>) => this.switchRadioButton(e.target.checked, false, false, false, false)\r\n  handleAllPoolsChecked = (e: React.ChangeEvent<HTMLInputElement>) => this.switchRadioButton(false, false, false, false, e.target.checked)\r\n  handleAllCompaniesChecked = (e: React.ChangeEvent<HTMLInputElement>) => this.switchRadioButton(false, false, false, e.target.checked, false)\r\n\r\n  switchRadioButton = (companyChecked: boolean, donorChecked: boolean, poolChecked: boolean, allCompaniesChecked:boolean, allPoolsChecked:boolean) => {\r\n    const currentCompany = !!this.props.isCompanyAdmin || !!this.props.isLocationAdmin ? this.state.selectedCompany : undefined\r\n    const currentLocation = !!this.props.isLocationAdmin ? this.state.selectedLocation : undefined\r\n    this.setState({ poolChecked: poolChecked, companyChecked: companyChecked, donorChecked: donorChecked, \r\n      selectedPool: undefined, selectedCompany: currentCompany, selectedLocation: currentLocation, \r\n      donorId: undefined, donor: undefined, allCompaniesChecked:allCompaniesChecked, allPoolsChecked:allPoolsChecked })\r\n  }\r\n\r\n  handleDonorIdChange = (value: string) => this.setState({ donorId: value })\r\n\r\n  onDonorSearch = () => {\r\n    this.donorSubscription && this.donorSubscription.unsubscribe()\r\n    this.donorSubscription = SearchDonorGetObservable({\r\n      CompanyID: this.props.company || 0,\r\n      Identifier: this.state.donorId,\r\n      IdentifierType: this.state.idType?.Rank,\r\n      RegulatoryModeID: 0,\r\n      isPortalAdmin: this.props.isPortalAdmin\r\n    }).subscribe(\r\n    (result: Donor[]) => {\r\n      this.setState({ donorLoading: false, donor: result[0] })\r\n      !result.length && toast.error(\"Donor was not found.\")\r\n    },\r\n    (error) => {\r\n      this.setState({ donorLoading: false })\r\n      toast.error(FormatError(error))\r\n    })\r\n  }\r\n\r\n  handleAccountTypeChanged = (e: React.ChangeEvent<HTMLInputElement>) => {\r\n    let at = e.target.value === AccountType.Company.toString() ? AccountType.Company : AccountType.MasterAccount\r\n    this.setState({ accountType: at, selectedCompany: undefined })\r\n  }\r\n\r\n  handleYearChecked = (e: React.ChangeEvent<HTMLInputElement>) => {\r\n    this.setState({ yearChecked: e.target.checked, rangeChecked: false })\r\n  }\r\n\r\n  handleRangeChecked = (e: React.ChangeEvent<HTMLInputElement>) => {\r\n    this.setState({ yearChecked: false, rangeChecked: e.target.checked })\r\n  }\r\n\r\n  handleCancelClick = () => (this.props as RouteComponentProps).history?.push(Home)\r\n\r\n  handleClearClick = () => {\r\n    const report = getWorkforceReport(this.props.location.pathname as Report)\r\n    this.setState({\r\n      report: report,\r\n      selectedCompany: (this.props.isPortalAdmin ? undefined : this.state.selectedCompany),\r\n      accountType: AccountType.Company,\r\n      selectedMode: this.state.regulatoryModes[0],\r\n      selectedStatus: this.state.statuses[0].value,\r\n      from: undefined,\r\n      to: undefined,\r\n      selectedYear: this.currentYear(),\r\n      selectedRange: this.state.ranges[0],\r\n      rangeChecked: false,\r\n      donorChecked: false,\r\n      poolChecked: false,\r\n      allPoolsChecked:false,\r\n      companyChecked: false,\r\n      allCompaniesChecked:false,\r\n      yearChecked: true,\r\n      includeAlcohol: false\r\n    })\r\n  }\r\n\r\n  handleGenerateReportClick = () => {\r\n    const { report } = this.state\r\n    switch (report.type) {\r\n      case WorkforceReportType.CertificationRenewal:\r\n      case WorkforceReportType.CertificationStatus:\r\n        this.generateDriverCertification(report.type)\r\n        break\r\n      case WorkforceReportType.ManagementSummary:\r\n        this.generateManagementSummary()\r\n        break\r\n      case WorkforceReportType.MIS:\r\n        this.generateMIS()\r\n        break\r\n      case WorkforceReportType.SelectedNotTested:\r\n        this.generateSNTPDF()\r\n        break\r\n      default:\r\n        break\r\n    }\r\n  }\r\n\r\n  generateDriverCertification = (reportID: number) => {\r\n    this.setState({ saving: true })\r\n\r\n    const { selectedCompany, selectedStatus } = this.state\r\n\r\n    DriverCertificationReportGet(reportID, selectedCompany?.AccountID || 0, selectedStatus).subscribe(\r\n      (base64pdf: string) => {\r\n        this.setState({ saving: false })\r\n        printPdf(base64pdf)\r\n      },\r\n      error => {\r\n        this.setState({ saving: false })\r\n        toast.error(FormatError(error))\r\n      }\r\n    )\r\n  }\r\n\r\n  generateCertificationStatus = () => {\r\n    this.setState({ saving: true })\r\n  }\r\n\r\n  generateManagementSummary = () => {\r\n    this.setState({ saving: true })\r\n    const { report, from, to, selectedRange, includeAlcohol, companies, selectedCompanies } = this.state\r\n\r\n    let companyIds: number[] = selectedCompanies?.map(a => a.AccountID) || []\r\n    if (this.isAccountType(AccountType.MasterAccount)) {\r\n      companyIds =  companies?.map(a => a.AccountID) || []\r\n    } \r\n    \r\n    const params: ManagementSummaryReport = {\r\n      AccountTypeID: AccountTypeID,\r\n      BreakByCompanies: true,\r\n      BreakByLocations: false,\r\n      ClientDetails: {},\r\n      Company: companyIds,\r\n      DateFrom: FormatDate(from),\r\n      DateTo: FormatDate(to),\r\n      DateType: selectedRange,\r\n      IncludeAlcoholTests: includeAlcohol,\r\n      MasterAccount: null,\r\n      ReportID: report.type\r\n    }\r\n\r\n    this.subscriptions.add(\r\n      ManagementSummaryReportGenerate(params).subscribe(\r\n        (base64pdf: string) => {\r\n          this.setState({ saving: false })\r\n          printPdf(base64pdf)\r\n        },\r\n        (error) => {\r\n          this.setState({ saving: false })\r\n          toast.error(FormatError(error))\r\n        }\r\n      )\r\n    )\r\n  }\r\n\r\n  generateMIS = () => {\r\n    this.setState({ saving: true })\r\n    const { from, to, selectedYear, yearChecked, selectedMode, companies, selectedCompanies } = this.state\r\n    let companyIds: number[] = selectedCompanies?.map(a => a.AccountID) || []\r\n    if (this.isAccountType(AccountType.MasterAccount)) {\r\n      companyIds =  companies?.map(a => a.AccountID) || []\r\n    } \r\n    const params: MISReport = {\r\n      AccountType: AccountType.Company,\r\n      AccountID: companyIds[0] || 0,\r\n      DtFromDate: FormatDate(from),\r\n      DtToDate: FormatDate(to),\r\n      RegMode: selectedMode || \"\",\r\n      ReportMode: yearChecked ? 1 : 2,\r\n      Year: yearChecked ? selectedYear?.toString() || \"\" : \"\",\r\n      Company: companyIds\r\n    }\r\n\r\n    this.subscriptions.add(\r\n      MISReportGenerate(params).subscribe(\r\n        (base64pdf: string) => {\r\n          this.setState({ saving: false })\r\n          printPdf(base64pdf)\r\n        },\r\n        (error) => {\r\n          this.setState({ saving: false })\r\n          toast.error(FormatError(error))\r\n        }\r\n      )\r\n    )\r\n  }\r\n  generateSNTPDF = () => {\r\n    this.generateSNT(\"pdf\")\r\n  }\r\n  generateSNTCSV = () => {\r\n    this.generateSNT(\"csv\")\r\n  }\r\n\r\n  generateSNT = (outputFormat: string) => {\r\n    this.setState({ loading: true })\r\n    this.printSubscription && this.printSubscription.unsubscribe()\r\n    const {companyChecked, poolChecked, donorChecked, allCompaniesChecked, allPoolsChecked, selectedCompany, selectedLocation, selectedPool, from, to, donor} = this.state\r\n    const accountID = selectedLocation?.AccountID || selectedCompany?.AccountID\r\n    this.printSubscription = SelectedNotTestedReportGenerate({\r\n      fromDate: FormatDate(from),\r\n      toDate: FormatDate(to),\r\n      accountID: companyChecked ? accountID : undefined,\r\n      poolID: poolChecked ? selectedPool?.PoolID : undefined,\r\n      personID: donorChecked ? donor?.PersonID : undefined,\r\n      CompanyName: selectedCompany?.Name || \"\",\r\n      LocationName: selectedLocation?.Name || \"\",\r\n      PoolName: selectedPool?.PoolName || \"\",\r\n      DonorName: (donorChecked ? `${donor?.FirstName} ${donor?.LastName}` : \"\"),\r\n      OutputFormat:outputFormat\r\n    }).subscribe(\r\n      data => {\r\n        this.setState({ loading: false })\r\n        if(outputFormat === \"csv\"){\r\n          exportCsv(data, FormatTimestampFileName(\"SelectedNotTestedReport\", \"csv\", new Date()))\r\n        }\r\n        else\r\n        {\r\n          printPdf(data)\r\n        }\r\n      },\r\n      error => {\r\n        this.setState({ loading: false })\r\n        toast.error(FormatError(error))\r\n      }\r\n    )\r\n  }\r\n\r\n  validateDonorFormat = () => {\r\n    const donorId = this.state.donorId || \"\"\r\n    return !this.state.donorChecked || (donorId.length > 0 && donorId.length <= MaxDonorIdLength && DonorIdRegexp.test(donorId))\r\n  }\r\n\r\n  isAccountType = (type: AccountType) => this.state.accountType === type\r\n\r\n  isReportParametersValid = () => {\r\n    const { report, selectedCompany, selectedStatus, selectedRange, from, to, selectedMode, selectedYear, \r\n      companyChecked, poolChecked, allCompaniesChecked, allPoolsChecked, donorChecked, yearChecked, rangeChecked, \r\n      selectedPool, donor, companies, selectedCompanies } = this.state\r\n    let companyIds: number[] = selectedCompanies?.map(a => a.AccountID) || []\r\n    if (this.isAccountType(AccountType.MasterAccount)) {\r\n      companyIds =  companies?.map(a => a.AccountID) || []\r\n    }\r\n    let companiesSelected: boolean = companyIds.length > 0\r\n    switch (report.type) {\r\n      case WorkforceReportType.CertificationRenewal:\r\n      case WorkforceReportType.CertificationStatus:\r\n        return !!selectedCompany && !!selectedStatus\r\n      case WorkforceReportType.ManagementSummary:\r\n        return companiesSelected && !!selectedRange && !!from && !!to\r\n      case WorkforceReportType.MIS:\r\n        return (companiesSelected || this.isAccountType(AccountType.MasterAccount)) && !!selectedMode && ((!!from && !!to && rangeChecked) || (yearChecked && !!selectedYear))\r\n      case WorkforceReportType.SelectedNotTested:\r\n        return !!from && !!to && ((companyChecked && !!selectedCompany) || allCompaniesChecked || (poolChecked && !!selectedPool) || allPoolsChecked || (donorChecked && !!donor))\r\n      default:\r\n        return false\r\n    }\r\n  }\r\n\r\n  showDonorStatusSection = () => {\r\n    const { report } = this.state\r\n    return [WorkforceReportType.CertificationRenewal, WorkforceReportType.CertificationStatus].some(item => report.type === item)\r\n  }\r\n\r\n  showDonorSelector = () => false\r\n\r\n  showSummarySection = () => this.state.report.type === WorkforceReportType.ManagementSummary\r\n\r\n  showDatesSection = () => this.state.rangeChecked\r\n\r\n  showMISSection = () => this.state.report.type === WorkforceReportType.MIS\r\n\r\n  showSNTSection = () => this.state.report.type === WorkforceReportType.SelectedNotTested\r\n\r\n  showAcountInput = () => {\r\n    if (this.isAccountType(AccountType.MasterAccount)) {\r\n      return false\r\n    }\r\n    const reportType = this.state.report.type\r\n    if ((reportType === WorkforceReportType.ManagementSummary) || (reportType === WorkforceReportType.MIS) || (reportType === WorkforceReportType.SelectedNotTested)) {\r\n      return false\r\n    }\r\n    return true\r\n  }\r\n\r\n  showCompanySelection = () => {\r\n    if (this.isAccountType(AccountType.MasterAccount)) {\r\n      return false\r\n    }\r\n    const reportType = this.state.report.type\r\n    if ((reportType === WorkforceReportType.ManagementSummary) || (reportType === WorkforceReportType.MIS)) {\r\n      return true\r\n    }\r\n    return false\r\n  }\r\n\r\n  currentYear = () => (new Date).getFullYear()\r\n\r\n  needLoadCompanies = () => {\r\n    const reportType = this.state.report.type\r\n    const companies = this.state.companies\r\n    if (((reportType === WorkforceReportType.ManagementSummary) || (reportType === WorkforceReportType.MIS)) && companies.length === 0) {\r\n      return true\r\n    }\r\n    return false\r\n  }\r\n\r\n  loadCompanies = () => {\r\n    if (this.needLoadCompanies()) {\r\n      this.subscriptions.add(\r\n        GetAllAccountsByNameObservable(\"\", undefined, AccountType.Company).subscribe(\r\n          (results) => {\r\n            this.setState({ companies: results, companiesLoading: false })\r\n          },\r\n          (error) => {\r\n            this.setState({ companiesLoading: false })\r\n            toast.error(FormatError(error))\r\n          }\r\n        )\r\n      )\r\n    }\r\n  }\r\n\r\n  componentDidMount() {\r\n    if (this.needLoadCompanies()) {\r\n      this.setState({ regulatoryModeLoading: true, yearsLoading: true, companiesLoading: true })\r\n    }\r\n    else {\r\n      this.setState({ regulatoryModeLoading: true, yearsLoading: true, companiesLoading: false })\r\n    }\r\n\r\n    this.loadCompanies()\r\n\r\n    this.subscriptions.add(\r\n      YearListGet().subscribe(\r\n        (results) => this.setState({ years: results, yearsLoading: false, selectedYear: this.currentYear() }),\r\n        (error) => {\r\n          this.setState({ yearsLoading: false })\r\n          toast.error(FormatError(error))\r\n        }\r\n      )\r\n    )\r\n\r\n    this.subscriptions.add(\r\n      RegulatoryModesGet().subscribe(\r\n        (results) => this.setState({ regulatoryModes: results, selectedMode: results[0], regulatoryModeLoading: false }),\r\n        (error) => {\r\n          this.setState({ regulatoryModeLoading: false })\r\n          toast.error(FormatError(error))\r\n        }\r\n      )\r\n    )\r\n\r\n    this.subscriptions.add(\r\n      RegulatoryModeObservable(0).subscribe(\r\n        results => this.setState({ idType: results.find(item => item.PrimaryIDType === \"EmployerID\"), regulatoryModeLoading: false }),\r\n        error => {\r\n          this.setState({ regulatoryModeLoading: false })\r\n          toast.error(FormatError(error))\r\n        }\r\n      )\r\n    )\r\n\r\n    this.subscriptions.add(\r\n      PoolsGetObservable().subscribe(\r\n        (results: Pool[]) => this.setState({ pools: results, poolLoading: false }),\r\n        (error) => {\r\n          this.setState({ poolLoading: false })\r\n          toast.error(FormatError(error))\r\n        }\r\n      )\r\n    )\r\n  }\r\n\r\n  componentWillUnmount() {\r\n    this.subscriptions && this.subscriptions.unsubscribe()\r\n    this.donorSubscription && this.donorSubscription.unsubscribe()\r\n    this.printSubscription && this.printSubscription.unsubscribe()\r\n  }\r\n\r\n  componentDidUpdate(prevProps: WorkforceReportParametersProps & RouteComponentProps) {\r\n    if (this.props.location.pathname !== prevProps.location.pathname) {\r\n      this.handleClearClick()\r\n    }\r\n    this.loadCompanies()\r\n  }\r\n  onCompanyChange = (selected: AutoFilterCompany[]) => {\r\n    this.setState({ selectedCompanies: selected || [] })\r\n  }\r\n  render() {\r\n    const { report, selectedStatus, includeAlcohol, selectedMode, selectedCompany, from, to, yearChecked, rangeChecked, \r\n      donorChecked, donorLoading, donor, poolChecked, companyChecked, donorId, selectedYear, selectedRange, regulatoryModeLoading, \r\n      yearsLoading, allCompaniesChecked, allPoolsChecked } = this.state\r\n    const showCompanyLabel = ((!this.showMISSection() && !this.showSummarySection()) || !!this.props.isCompanyAdmin) && !this.showSNTSection()\r\n    const showFilterByCompany = ((this.showMISSection() || this.showSummarySection()) && (this.props.isPortalAdmin || this.props.isSiteAdmin)) && !this.showSNTSection()\r\n    const showFilterByMasterAccount = ((this.showMISSection() || this.showSummarySection()) && (this.props.isPortalAdmin || this.props.isSiteAdmin)) && !this.showSNTSection()\r\n    //const generateReportText = this.showSNTSection() ? \"Export PDF\" : \"Continue\"\r\n    const isSNT = this.showSNTSection()\r\n    const showAllCompanies = isSNT && this.props.isPortalAdmin\r\n    const showAllPools = isSNT && this.props.isPortalAdmin\r\n    return (<AppPageWrapper parentClassName={\"align-items-center\"} showNav>\r\n      <Modal.Dialog size=\"lg\">\r\n        <Modal.Header>\r\n          <Modal.Title className=\"text-uppercase\">{report.title}</Modal.Title>\r\n        </Modal.Header>\r\n        <ModalBody>\r\n          <Form>\r\n            <Form.Row className=\"form-group\">\r\n              {showCompanyLabel && <Form.Label column className=\"m-1\" lg={3}>Company</Form.Label>}\r\n              {showFilterByCompany &&\r\n                <Col lg={3}>\r\n                  <Form.Check\r\n                    id=\"filter-by-company\"\r\n                    name=\"filter-by-account\"\r\n                    type=\"radio\"\r\n                    label=\"Company\"\r\n                    className=\"abc-radio mt-2\"\r\n                    inline\r\n                    value={AccountType.Company}\r\n                    checked={this.isAccountType(AccountType.Company)}\r\n                    onChange={this.handleAccountTypeChanged}\r\n                  />\r\n                </Col>}\r\n              {this.showAcountInput() && <Col lg={8}>\r\n                <AccountInput\r\n                  accountType={this.state.accountType}\r\n                  filter\r\n                  disabled={!!this.props.isCompanyAdmin || this.isAccountType(AccountType.MasterAccount)}\r\n                  onChange={this.handleCompanyChange} />\r\n              </Col>}\r\n            </Form.Row>\r\n            <Form.Row>\r\n              {this.showCompanySelection() && <Col lg={11}>\r\n                <DualListBox\r\n                  disabled={false}\r\n                  options={this.state.companies || []}\r\n                  selected={this.state.selectedCompanies || []}\r\n                  idKey=\"AccountID\"\r\n                  labelKey=\"Name\"\r\n                  availableTitle=\"Available\"\r\n                  selectedTitle=\"Selected\"\r\n                  onChange={this.onCompanyChange}                //isConsortium={true}\r\n                />\r\n              </Col>}\r\n            </Form.Row>\r\n            {showFilterByMasterAccount &&\r\n              <Form.Row className=\"form-group\">\r\n                <Col lg={3}>\r\n                  <Form.Check id=\"filter-by-masteraccount\"\r\n                    name=\"filter-by-account\"\r\n                    type=\"radio\"\r\n                    label=\"Master Portal\"\r\n                    className=\"abc-radio mt-2\"\r\n                    inline\r\n                    value={AccountType.MasterAccount}\r\n                    checked={this.isAccountType(AccountType.MasterAccount)}\r\n                    onChange={this.handleAccountTypeChanged}\r\n                  />\r\n                </Col>\r\n              </Form.Row>}\r\n\r\n            {this.showSNTSection() && <>\r\n            <Form.Row className=\"form-group\">\r\n              <Col lg={3}>Date Collected</Col>\r\n              <Col lg={8}>\r\n                <FromToDates from={from} to={to} onChangeFrom={(date: Date) => {this.setState({from: date})}} onChangeTo={(date: Date) => {this.setState({to: date})}}/>\r\n              </Col>\r\n            </Form.Row>\r\n            <Form.Row className=\"form-group\"><Col lg={3}>Filter By:</Col></Form.Row>\r\n            <Form.Row className=\"form-group\">\r\n              <Col lg={3}>\r\n                  <Form.Check\r\n                    id=\"filter-by-company\"\r\n                    name=\"filter-by\"\r\n                    type=\"radio\"\r\n                    label=\"Company\"\r\n                    className=\"abc-radio mt-2\"\r\n                    inline\r\n                    checked={companyChecked}\r\n                    onChange={(e) => this.handleCompanyChecked(e)}\r\n                    />\r\n                </Col>\r\n                <Col lg={8}>\r\n                  {companyChecked && <CompanyInput disabled={!companyChecked} onChange={this.handleCompanyChange} />}\r\n                </Col>\r\n            </Form.Row>\r\n            {companyChecked && !!selectedCompany && <Form.Row className=\"form-group\">\r\n              <Col lg={{span: 8, offset: !!this.props.isLocationAdmin ? 0 : 3}}>\r\n                  <LocationInput\r\n                    hideInactive\r\n                    filter\r\n                    companyID={selectedCompany?.AccountID || 0}\r\n                    disabled={!!this.props.isLocationAdmin}\r\n                    onChange={this.handleLocationChange} />\r\n              </Col>\r\n              </Form.Row>}\r\n              {showAllCompanies && <Form.Row className=\"form-group\">\r\n              <Col lg={3}>\r\n                  <Form.Check\r\n                    id=\"filter-by-all-companies\"\r\n                    name=\"filter-by\"\r\n                    type=\"radio\"\r\n                    label=\"ALL Companies\"\r\n                    className=\"abc-radio mt-2\"\r\n                    inline\r\n                    checked={allCompaniesChecked}\r\n                    onChange={(e) => this.handleAllCompaniesChecked(e)}\r\n                    />\r\n                </Col>\r\n                <Col lg={8}>\r\n                  &nbsp;\r\n                </Col>\r\n              </Form.Row>}\r\n\r\n              {this.showDonorSelector() && <Form.Row className=\"form-group\">\r\n                <Col lg={3}>\r\n                  <Form.Check id=\"filter-by-donor\" name=\"filter-by\"\r\n                    type=\"radio\"\r\n                    label=\"Donor ID\"\r\n                    className=\"abc-radio mt-2\"\r\n                    inline\r\n                    checked={donorChecked} onChange={(e) => this.handleDonorChecked(e)}\r\n                  />\r\n                </Col>\r\n                <Col lg={8}>\r\n                  {donorChecked && <InputGroup className=\"mb-3\">\r\n                    <TextFormControl value={donorId}\r\n                      disabled={!donorChecked}\r\n                      maxLength={MaxDonorIdLength}\r\n                      changeHandler={(value) => this.handleDonorIdChange(value)}\r\n                      isValid={() => this.validateDonorFormat()}\r\n                      enterTapHandler={this.onDonorSearch} />\r\n                    <Form.Control.Feedback className=\"order-last\" type=\"invalid\">{InvalidDonorId}</Form.Control.Feedback>\r\n                    <InputGroup.Append>\r\n                      <Button className=\"btn-rounded-right\" onClick={() => this.onDonorSearch()} disabled={!donorId}>\r\n                        {this.state.donorLoading ? <Spinner size=\"sm\" animation=\"border\" /> : <FaSearch />}\r\n                      </Button>\r\n                    </InputGroup.Append>\r\n                  </InputGroup>}\r\n                  {!donorLoading && donor && <Form.Text muted>Donor: {donor.FirstName} {donor.LastName} was found.</Form.Text>}\r\n                </Col>\r\n              </Form.Row>}\r\n              <Form.Row className=\"form-group\">\r\n                <Col lg={3}>\r\n                  <Form.Check id=\"filter-by-pool\" name=\"filter-by\"\r\n                    type=\"radio\"\r\n                    label=\"Pool Name\"\r\n                    className=\"abc-radio mt-2\"\r\n                    inline\r\n                    checked={poolChecked} onChange={(e) => this.handlePoolChecked(e)}\r\n                  />\r\n                </Col>\r\n                <Col lg={8}>\r\n                  {poolChecked && <AsyncTypeahead id=\"pool-select\"\r\n                  emptyLabel=\"No Pools Found\"\r\n                  ref={this.typeaheadPool}\r\n                  filterBy={(option, props) => props.selected.length > 0 || option.PoolName.toLowerCase().indexOf(props.text.toLowerCase()) !== -1 || option.Code.toLowerCase().indexOf(props.text.toLowerCase()) !== -1}\r\n                  isLoading={this.state.poolLoading}\r\n                  onChange={items => this.handlePoolChange(items[0])}\r\n                  onSearch={() => { }}\r\n                  options={this.state.pools}\r\n                  selected={this.state.selectedPool ? [this.state.selectedPool] : []}\r\n                  minLength={0}\r\n                  labelKey={(option) => `${option.PoolName} (${option.Code})${ option.IsConsortium ? \" - Consortium Pool\" : \"\"}`}\r\n                  disabled={!poolChecked}\r\n                  placeholder=\"Enter the Pool name or Code\"\r\n                  inputProps={{ autoComplete: \"chrome-off\" }}>\r\n                  {!this.state.poolLoading && poolChecked &&\r\n                    <Button variant=\"toggle\" onClick={() => this.typeaheadPool.current?.toggleMenu()}>\r\n                      <FaAngleDown />\r\n                    </Button>}\r\n                </AsyncTypeahead>}\r\n                </Col>\r\n              </Form.Row>\r\n              {showAllPools && <Form.Row className=\"form-group\">\r\n                <Col lg={3}>\r\n                  <Form.Check id=\"filter-by-all-pools\" name=\"filter-by\"\r\n                    type=\"radio\"\r\n                    label=\"ALL Pools\"\r\n                    className=\"abc-radio mt-2\"\r\n                    inline\r\n                    checked={allPoolsChecked} onChange={(e) => this.handleAllPoolsChecked(e)}\r\n                  />\r\n                </Col>\r\n                <Col lg={8}>\r\n                  &nbsp;\r\n                </Col>\r\n              </Form.Row>}\r\n            </>}\r\n\r\n            {this.showDonorStatusSection() && <Form.Row className=\"form-group\">\r\n              <Form.Label className=\"m-1\" column lg={3}>Donor Status</Form.Label>\r\n              <Col lg={8}>\r\n                <Form.Control id=\"donor\" as=\"select\" onChange={this.handleDonorStatusChange} value={selectedStatus || \"\"}>\r\n                  {this.state.statuses?.map(s => <option value={s.value} key={s.name} selected={s.value === selectedStatus}>{s.name}</option>)}\r\n                </Form.Control>\r\n              </Col>\r\n            </Form.Row>}\r\n            {this.showSummarySection() && <Form.Row className=\"form-group\">\r\n              <Form.Label column className=\"m-1\" lg={3}>Include Alcohol Tests</Form.Label>\r\n              <ToggleSwitch className=\"m-2\" on=\"Yes\" off=\"No\" checked={includeAlcohol} onCheck={checked => this.setState({ includeAlcohol: checked })} />\r\n            </Form.Row>}\r\n            {this.showMISSection() && <Form.Row className=\"form-group\">\r\n              <Form.Label column className=\"m-1\" lg={3}>Regulatory Mode</Form.Label>\r\n              <Col lg={8}>\r\n                <Form.Control id=\"reg-mode\" as=\"select\" onChange={this.handleRegModeChange} value={selectedMode || \"\"} disabled={regulatoryModeLoading}>\r\n                  {this.state.regulatoryModes?.map(m => <option value={m} key={m} selected={m === selectedMode}>{m}</option>)}\r\n                </Form.Control>\r\n              </Col>\r\n            </Form.Row>}\r\n            {(this.showMISSection()) && <>\r\n              <Form.Row className=\"form-group\">\r\n                <Col lg={3}>\r\n                  <Form.Check id=\"filter-by-year\" name=\"filter-by\"\r\n                    type=\"radio\"\r\n                    label=\"By Calendar Year\"\r\n                    className=\"abc-radio mt-2\"\r\n                    inline\r\n                    checked={yearChecked}\r\n                    onChange={this.handleYearChecked}\r\n                  />\r\n                </Col>\r\n                <Col lg={8} className=\"mx-2\">\r\n                  <Form.Control id=\"years\" as=\"select\" onChange={this.handleYearChange} value={selectedYear || \"\"} disabled={!yearChecked || yearsLoading}>\r\n                    <option value={undefined} key={0} selected={selectedYear === undefined}>Select Year</option>\r\n                    {this.state.years?.map(y => <option value={y} key={y} selected={y === selectedYear}>{y}</option>)}\r\n                  </Form.Control>\r\n                </Col>\r\n              </Form.Row>\r\n              <Form.Row className=\"form-group\">\r\n                <Col lg={3}>\r\n                  <Form.Check id=\"filter-by-range\" name=\"filter-by\"\r\n                    type=\"radio\"\r\n                    label=\"By Date Range\"\r\n                    className=\"abc-radio mt-2\"\r\n                    inline\r\n                    checked={rangeChecked}\r\n                    onChange={this.handleRangeChecked}\r\n                  />\r\n                </Col>\r\n                <Col lg={8} className=\"mx-2\">\r\n                  {this.showDatesSection() && <FromToDates from={from} to={to} onChangeFrom={(date: Date) => { this.setState({ from: date }) }} onChangeTo={(date: Date) => { this.setState({ to: date }) }} />}\r\n                </Col>\r\n              </Form.Row>\r\n            </>}\r\n            {(this.showSummarySection()) && <>\r\n              <Form.Row className=\"form-group\">\r\n                <Form.Label column className=\"m-1\" lg={3}>By Date Range</Form.Label>\r\n                <Col lg={8}>\r\n                  <Form.Control id=\"date-range\" as=\"select\" onChange={this.handleDateRangeChange} value={selectedRange || \"\"}>\r\n                    {this.state.ranges?.map(r => <option value={r} key={r} selected={r === selectedRange}>{r}</option>)}\r\n                  </Form.Control>\r\n                </Col>\r\n              </Form.Row>\r\n              <Form.Row>\r\n                <Col lg={3} className=\"m-1\"></Col>\r\n                <Col lg={8}>\r\n                  <FromToDates from={from} to={to} onChangeFrom={(date: Date) => { this.setState({ from: date }) }} onChangeTo={(date: Date) => { this.setState({ to: date }) }} />\r\n                </Col>\r\n              </Form.Row>\r\n            </>}\r\n          </Form>\r\n        </ModalBody>\r\n        <Modal.Footer className=\"justify-content-between\">\r\n          <Button variant=\"secondary\" onClick={this.handleCancelClick}>Cancel</Button>\r\n          <Button variant=\"secondary\" onClick={this.handleClearClick}>Clear Filter</Button>\r\n          {!isSNT && <ActionButton variant=\"primary\" disabled={!this.isReportParametersValid()} onClick={this.handleGenerateReportClick} spin={this.state.loading || this.state.saving} disableOnSpin>Continue</ActionButton>}\r\n          {isSNT && <ActionButton variant=\"secondary\" disabled={!this.isReportParametersValid()} onClick={this.generateSNTPDF} spin={this.state.loading || this.state.saving} disableOnSpin>Export PDF&nbsp;<FaFilePdf /></ActionButton>}\r\n          {isSNT && <ActionButton variant=\"primary\" disabled={!this.isReportParametersValid()} onClick={this.generateSNTCSV} spin={this.state.loading || this.state.saving} disableOnSpin>Export CSV&nbsp;<FaFileCsv /></ActionButton>}\r\n        </Modal.Footer>\r\n      </Modal.Dialog>\r\n    </AppPageWrapper>)\r\n  }\r\n}\r\n\r\nfunction mapStateToProps(state: AppState): WorkforceReportParametersProps {\r\n  return {\r\n    isLocationAdmin: isLocationAdmin(state),\r\n    isCompanyAdmin: isCompanyAdmin(state),\r\n    isPortalAdmin: isPortalAdmin(state),\r\n    isSiteAdmin: isSiteAdmin(state),\r\n    company: GetSelectedAssignedClinic(state)?.AccountID\r\n  }\r\n}\r\n\r\nconst ConnectedWorkforceReportParameters = connect(mapStateToProps, null)(WorkforceReportParameters)\r\nexport default ConnectedWorkforceReportParameters","import { Observable } from \"rxjs\"\r\nimport { ObservableFromFetch } from \"../ObservableFromFetch\"\r\n\r\nconst mapParams = (params: SummaryReportParams) => {\r\n  return {\r\n    AccountTypeID: params.AccountTypeID,\r\n    ColumnFilters: {},\r\n    DateFrom: '',\r\n    DateTo: '',\r\n    Exact: false,\r\n    Filters: {\r\n      Company: params.Company,\r\n      DateRange: params.DateRange,\r\n      DateType: params.DateType,\r\n      EndDate: params.DateTo,\r\n      Location: [],\r\n      Reason: [],\r\n      Region: [],\r\n      Regulated: \"Regulated & Non-Regulated\",\r\n      Service: [],\r\n      StartDate: params.DateFrom,\r\n      Status: \"In Process\"\r\n    },\r\n    InProcessStatus: true,\r\n    IsMarketPlace: true,\r\n    IsReviewed: false,\r\n    IncludeArchived: params.IncludeArchived,\r\n    Mask: \"\",\r\n    Pending: true,\r\n    SearchBy: \"AllIDs\",\r\n    Type: \"All\"\r\n  }\r\n}\r\n\r\nexport interface SummaryReportParams {\r\n  AccountTypeID: number,\r\n  Company: string[],\r\n  DateRange: string,\r\n  DateType: string,\r\n  DateFrom: string,\r\n  DateTo: string,\r\n  IncludeArchived: boolean\r\n}\r\n\r\nexport function SummaryReportGetCsv(params: SummaryReportParams): Observable<string> {\r\n  const requestBody: string = JSON.stringify(mapParams(params))\r\n  return ObservableFromFetch<string>(\"WorkforceTrack/ExportTrackRecord\", requestBody)\r\n}\r\n\r\nexport default function SummaryReportPdf(params: SummaryReportParams): Observable<string> {\r\n  const requestBody: string = JSON.stringify(mapParams(params))\r\n  return ObservableFromFetch<string>(\"WorkforceReport/SummaryReport\", requestBody)\r\n}\r\n","import { Dispatch, SetStateAction } from \"react\"\r\n\r\nimport { Form } from \"react-bootstrap\"\r\n\r\ninterface IncludeArchivedOrdersProps {\r\n  value: boolean\r\n  onChange: Dispatch<SetStateAction<boolean>>\r\n}\r\n\r\nfunction IncludeArchivedOrders(props: IncludeArchivedOrdersProps) {\r\n  const { value, onChange } = props\r\n\r\n  const onChangeIncludeArchived = (event: React.ChangeEvent<HTMLInputElement>) => {\r\n    const { checked } = event.target\r\n    onChange(checked)\r\n  }\r\n\r\n  return (\r\n    <>\r\n      <Form.Label htmlFor=\"include_archived\" className=\"mr-3\">\r\n        Include Archived Orders\r\n      </Form.Label>\r\n      <Form.Check\r\n        id=\"include_archived\"\r\n        type=\"checkbox\"\r\n        inline\r\n        className=\"abc-checkbox abc-checkbox-inline\"\r\n        label=\"\"\r\n        value={value ? 1 : 0}\r\n        checked={value}\r\n        onChange={onChangeIncludeArchived}\r\n      />\r\n    </>\r\n  )\r\n}\r\n\r\nexport default IncludeArchivedOrders\r\n","import { useEffect, useState } from \"react\"\r\nimport { Form, Col, Modal, ModalBody, Button, Row } from \"react-bootstrap\"\r\nimport { AppPageWrapper } from \"../../NavMenu/AppPageWrapper\"\r\nimport ActionButton from \"../../ActionButton\"\r\nimport FromToDates from \"../FromToDates\"\r\nimport { useHistory } from \"react-router\"\r\nimport { Home } from \"../../../config/Routes\"\r\nimport DualListBox from \"../../Administration/DualListBox\"\r\nimport { AccountTypeID } from \"../../../config/Constants\"\r\nimport AutoFilterCompany from \"../../../api/Companies/CompanyModel/AutoFilterCompany\"\r\nimport { useSelector } from \"react-redux\"\r\nimport { isCompanyAdmin, isPortalAdmin } from \"../../../authentication/isAdminRole\"\r\nimport { AppState } from \"../../../AppState\"\r\nimport { GetSelectedAssignedClinic } from \"../../../authentication/SelectedCompany/CompanySelectionDrivenSelectors\"\r\nimport { FaFileCsv, FaFilePdf, FaSync, FaSyncAlt } from \"react-icons/fa\"\r\nimport printPdf from \"../../../utils/printPdf\"\r\nimport FormatDate from \"../../../formatters/FormatDate\"\r\nimport SummaryReportGetPdf, { SummaryReportGetCsv, SummaryReportParams } from \"../../../api/Reports/SummaryReportGet\"\r\nimport FormatTimestampFileName from \"../../../formatters/FormatTimestampFileName\"\r\nimport exportCsv from \"../../../utils/exportCsv\"\r\nimport AutoFilterCompaniesGet from \"../../../api/Companies/AutoFilterCompaniesGet\"\r\nimport handleAPIError from \"../../../utils/handleAPIError\"\r\nimport { CompanyDataLoader } from \"../../../api/Reports/CompanyDataLoader\"\r\nimport IncludeArchivedOrders from \"./IncludeArchivedOrders\"\r\n\r\nenum DateRange {\r\n  CURRENT_MONTH = \"Current Month\",\r\n  PREVIOUS_MONTH = \"Previous Month\",\r\n  LAST_30_DAYS = \"Last 30 Days\",\r\n  FROM_BEGINNING_OF_YEAR = \"From beginning of year\",\r\n  CUSTOM_FILTER = \"Custom\"\r\n}\r\n\r\nenum DateType {\r\n  EVENTED = \"Event Date\",\r\n  REVIEWED = \"Reviewed Date\",\r\n  ORDERED = \"Order Date\",\r\n  TESTED = \"Date Tested\",\r\n  SCHEDULED = \"Schedule Date\"\r\n}\r\n\r\nconst DateTypeLabel = new Map<DateType, string>([\r\n  [DateType.EVENTED, 'Collection Date'],\r\n  [DateType.REVIEWED, DateType.REVIEWED],\r\n  [DateType.ORDERED, DateType.ORDERED],\r\n  [DateType.TESTED, DateType.TESTED],\r\n  [DateType.SCHEDULED, DateType.SCHEDULED]\r\n]);\r\n\r\nconst SummaryReport = () => {\r\n  const portalAdmin = useSelector((state: AppState) => isPortalAdmin(state))\r\n  const clinic = useSelector((state: AppState) => GetSelectedAssignedClinic(state))\r\n  const history = useHistory();\r\n\r\n  const [generatingCsv, setGeneratingCsv] = useState(false)\r\n  const [generatingPdf, setGeneratingPdf] = useState(false)\r\n  const [companies, setCompanies] = useState<CompanyDataLoader>({ data: [], loading: false })\r\n  const [selectedCompanies, setSelectedCompanies] = useState<AutoFilterCompany[]>([])\r\n  const [selectedDateType, setDateType] = useState<string>(DateType.ORDERED)\r\n  const [selectedDateRange, setDateRange] = useState<string>(DateRange.CUSTOM_FILTER)\r\n  const [from, setFrom] = useState<Date>()\r\n  const [to, setTo] = useState<Date>()\r\n  const [includeArchivedOrders, setIncludeArchivedOrders] = useState<boolean>(true)\r\n\r\n  useEffect(() => {\r\n    setCompanies(prev => ({ data: prev.data, loading: true }))\r\n    const sub = AutoFilterCompaniesGet(\"\").subscribe(\r\n      res => setCompanies({ data: res, loading: false }),\r\n      error => handleAPIError(error, () => setCompanies(prev => ({ ...prev, loading: false })))\r\n    )\r\n    return () => sub.unsubscribe()\r\n  }, []);\r\n\r\n  useEffect(() => {\r\n    setSelectedCompanies(companies.data)\r\n  }, [companies.data]);\r\n\r\n  useEffect(() => {\r\n    let from, to\r\n    const toDay = new Date()\r\n    const currentYear = toDay.getFullYear()\r\n    const currentMonth = toDay.getMonth()\r\n    switch (selectedDateRange) {\r\n      case DateRange.CURRENT_MONTH:\r\n        from = new Date(currentYear, currentMonth, 1)\r\n        to = new Date(currentYear, currentMonth + 1, 0)\r\n        break;\r\n      case DateRange.PREVIOUS_MONTH:\r\n        from = new Date(currentYear, currentMonth - 1, 1)\r\n        to = new Date(currentYear, currentMonth, 0)\r\n        break;\r\n      case DateRange.FROM_BEGINNING_OF_YEAR:\r\n        from = new Date(currentYear, 0, 1)\r\n        to = new Date(currentYear, currentMonth, toDay.getDate())\r\n        break;\r\n      case DateRange.LAST_30_DAYS:\r\n        from = new Date(toDay.setDate(toDay.getDate() - 30))\r\n        to = new Date(currentYear, currentMonth, toDay.getDate())\r\n        break;\r\n      default:\r\n        break;\r\n    }\r\n    setFrom(from)\r\n    setTo(to)\r\n  }, [selectedDateRange])\r\n\r\n  const isParamsValid = () => (\r\n    selectedCompanies.length > 0 &&\r\n    !!selectedDateRange &&\r\n    !!selectedDateType &&\r\n    (selectedDateRange !== DateRange.CUSTOM_FILTER || (!!from && !!to))\r\n  )\r\n\r\n  const getReportParams = (): SummaryReportParams => ({\r\n    AccountTypeID: portalAdmin ? 0 : AccountTypeID,\r\n    Company: !portalAdmin || selectedCompanies.length != companies.data.length ? selectedCompanies?.map(a => a.Name) : [],\r\n    DateRange: selectedDateRange,\r\n    DateType: selectedDateType,\r\n    DateFrom: FormatDate(from),\r\n    DateTo: FormatDate(to),\r\n    IncludeArchived: includeArchivedOrders\r\n  })\r\n\r\n  const handleCancelClick = () => history.push(Home)\r\n  const handleClearClick = () => {\r\n    setSelectedCompanies(companies.data)\r\n    setDateRange(DateRange.CUSTOM_FILTER)\r\n    setDateType(DateType.ORDERED)\r\n    setFrom(undefined)\r\n    setTo(undefined)\r\n    setIncludeArchivedOrders(true)\r\n  }\r\n\r\n  const handleDateTypeChange = (event: React.ChangeEvent<HTMLSelectElement>) => setDateType(event.target.value)\r\n  const handleDateRangeChange = (event: React.ChangeEvent<HTMLSelectElement>) => setDateRange(event.target.value)\r\n\r\n  const handleGenerateCsvClick = () => {\r\n    setGeneratingCsv(true)\r\n    SummaryReportGetCsv(getReportParams()).subscribe(\r\n      (results: string) => {\r\n        setGeneratingCsv(false)\r\n        exportCsv(results, FormatTimestampFileName(\"SummaryReport\", \"csv\", new Date()))\r\n      },\r\n      error => handleAPIError(error, () => setGeneratingCsv(false))\r\n    )\r\n  }\r\n\r\n  const handleGeneratePdfClick = () => {\r\n    setGeneratingPdf(true)\r\n    SummaryReportGetPdf(getReportParams()).subscribe(\r\n      (results: string) => {\r\n        setGeneratingPdf(false)\r\n        printPdf(results)\r\n      },\r\n      error => handleAPIError(error, () => setGeneratingPdf(false))\r\n    )\r\n  }\r\n\r\n  return (\r\n    <AppPageWrapper parentClassName={\"align-items-center\"} showNav>\r\n      <Modal.Dialog size=\"lg\">\r\n        <Modal.Header>\r\n          <Modal.Title className=\"text-uppercase\">Summary Report</Modal.Title>\r\n        </Modal.Header>\r\n        <ModalBody>\r\n          <Form>\r\n            {portalAdmin && <Form.Row>\r\n              <Col>\r\n                <Form.Label className=\"required\">Companies</Form.Label>\r\n                <DualListBox\r\n                  disabled={companies.loading}\r\n                  options={companies.data}\r\n                  selected={selectedCompanies}\r\n                  idKey=\"AccountID\"\r\n                  labelKey=\"Name\"\r\n                  availableTitle=\"Available\"\r\n                  selectedTitle=\"Selected\"\r\n                  onChange={setSelectedCompanies}\r\n                />\r\n              </Col>\r\n            </Form.Row>}\r\n            {!portalAdmin && <Form.Row className=\"form-group\">\r\n              <Form.Label column sm={2}>Company</Form.Label>\r\n              <Col><Form.Control as=\"input\" readOnly value={clinic?.Name} /></Col>\r\n            </Form.Row>}\r\n            <Form.Row className=\"form-group\">\r\n              <Form.Label column sm={2} className=\"required\">Date Type</Form.Label>\r\n              <Col>\r\n                <Form.Control id=\"date-type\" as=\"select\" onChange={handleDateTypeChange} value={selectedDateType}>\r\n                  {Array.from(DateTypeLabel).map(([k, v]) => <option value={k} key={k} selected={k == selectedDateType}>{v}</option>)}\r\n                </Form.Control>\r\n              </Col>\r\n              <Col sm={1}></Col>\r\n            </Form.Row>\r\n            <Form.Row className=\"form-group\">\r\n              <Form.Label column sm={2} className=\"required\">Date Range</Form.Label>\r\n              <Col>\r\n                <Form.Control id=\"date-range\" as=\"select\" onChange={handleDateRangeChange} value={selectedDateRange}>\r\n                  {Object.values(DateRange).map(r => <option value={r} key={r} selected={r === selectedDateRange}>{r}</option>)}\r\n                </Form.Control>\r\n              </Col>\r\n              <Col sm={1}></Col>\r\n            </Form.Row>\r\n            {selectedDateRange === DateRange.CUSTOM_FILTER && <Form.Row>\r\n              <Col sm={2}></Col>\r\n              <Col>\r\n                <FromToDates from={from} to={to} onChangeFrom={setFrom} onChangeTo={setTo} />\r\n              </Col>\r\n              <Col sm={1}></Col>\r\n            </Form.Row>}\r\n            <Form.Row>\r\n              <Col>\r\n                <IncludeArchivedOrders\r\n                  value={includeArchivedOrders}\r\n                  onChange={setIncludeArchivedOrders}\r\n                />\r\n              </Col>\r\n            </Form.Row>\r\n          </Form>\r\n        </ModalBody>\r\n        <Modal.Footer>\r\n          <Button variant=\"secondary\" onClick={handleCancelClick}>Cancel</Button>\r\n          <Button variant=\"secondary\" className=\"mr-auto\" onClick={handleClearClick}>Clear Filter&nbsp;<FaSync /></Button>\r\n          <ActionButton variant=\"secondary\" disabled={companies.loading || !isParamsValid()} onClick={handleGeneratePdfClick} spin={generatingPdf} disableOnSpin>Export PDF&nbsp;<FaFilePdf /></ActionButton>\r\n          <ActionButton variant=\"primary\" disabled={companies.loading || !isParamsValid()} onClick={handleGenerateCsvClick} spin={generatingCsv} disableOnSpin>Export CSV&nbsp;<FaFileCsv /></ActionButton>\r\n        </Modal.Footer>\r\n      </Modal.Dialog>\r\n    </AppPageWrapper >)\r\n}\r\nexport default SummaryReport\r\n","import React from \"react\"\r\nimport { Button, Modal, Table, Spinner, Col, Form, Row } from \"react-bootstrap\"\r\nimport { toast } from \"react-toastify\"\r\nimport { Subscription, forkJoin } from \"rxjs\"\r\nimport ActionButton from \"../ActionButton\"\r\nimport { AppPageWrapper } from \"../NavMenu/AppPageWrapper\"\r\nimport { RouteComponentProps } from \"react-router\"\r\nimport { Home } from \"../../config/Routes\"\r\nimport Checkbox from \"../Checkbox\"\r\nimport { APIError } from \"../../api/ObservableFromFetch\"\r\nimport { Typeahead } from \"react-bootstrap-typeahead\"\r\nimport { FaAngleDown } from \"react-icons/fa\"\r\nimport AutoFilterCompany from \"../../api/Companies/CompanyModel/AutoFilterCompany\"\r\nimport FormatError from \"../../formatters/FormatError\"\r\nimport OrderDefaultsGet, { OrderDefault, OrderDefaultsReset, OrderDefaultsSave, SaveOrderDefaults } from \"../../api/Administration/OrderDefaults\"\r\nimport LabServiceRegulatoryModesGetObservable from \"../../api/LabService/LabServiceRegulatoryModesGet\"\r\nimport RegulatoryMode from \"../../api/LabService/LabServiceModel/RegulatoryMode\"\r\nimport EmployeeCategoriesGetObservable from \"../../api/LabService/EmployeeCategoriesGet\"\r\nimport EmployeeCategory from \"../../api/LabService/LabServiceModel/EmployeeCategory\"\r\nimport { TestReasonsObservable } from \"../../api/OrderRequests/OrderRequestsConstraintGet\"\r\nimport { TestReasonType } from \"../../api/OrderRequests/OrderRequestsModel/TestReasonType\"\r\nimport NumericInput from \"react-numeric-input\"\r\nimport { AppState } from \"../../AppState\"\r\nimport { connect } from \"react-redux\"\r\nimport { isSiteAdmin, isPortalAdmin } from \"../../authentication/isAdminRole\"\r\nimport ImplementationsGetObservable from \"../../api/Implementations/ImplementationsGet\"\r\nimport ImplementationData from \"../../api/Implementations/Model/ImplementationData\"\r\nimport CompanyInput from \"../FormattedInputs/CompanyInput\"\r\nimport { EventType } from \"../../config/Constants\"\r\nimport { DefaultLookupCode } from \"../../api/LookupCodes/DefaultLookupCode\"\r\nimport { SampleType } from \"../../api/LookupCodes/SampleType\"\r\n\r\n\r\ninterface Lookup {\r\n  Code: DefaultLookupCode\r\n  Label: string\r\n  IsInput: boolean\r\n  IsNumeric: boolean\r\n}\r\n\r\nconst LookupMap: Lookup[] = [\r\n  {Code: DefaultLookupCode.RegMode, Label: \"Regulatory Mode\", IsInput: false, IsNumeric: false},\r\n  {Code: DefaultLookupCode.TestReason, Label: \"Reason\", IsInput: false, IsNumeric: false},\r\n  {Code: DefaultLookupCode.ExpTime, Label: \"Hours Until Order Expires\", IsInput: true, IsNumeric: true},\r\n  {Code: DefaultLookupCode.FAAEmployee, Label: \"FAA Employee Category\", IsInput: false, IsNumeric: false},\r\n  {Code: DefaultLookupCode.DOTSampleType, Label: \"Regulated Drug Test Sample Type\", IsInput: false, IsNumeric: false},\r\n  {Code: DefaultLookupCode.NonDOTSampleType, Label: \"Non-Regulated Drug Test Sample Type\", IsInput: false, IsNumeric: false},\r\n]\r\n\r\ninterface OrderDefaultsAuthProps {\r\n  isPortalAdmin?: boolean\r\n  isSiteAdmin?: boolean\r\n}\r\n\r\ninterface OrderDefaultsProps { }\r\n\r\ninterface OrderDefaultsState {\r\n  saving: boolean\r\n  loading: boolean\r\n  resetting: boolean\r\n  loadingDefaults: boolean\r\n  portalDefaults: OrderDefault[]\r\n  defaults: OrderDefault[]\r\n  data: OrderDefault[]\r\n  portals: ImplementationData[]\r\n  selectedPortal?: ImplementationData\r\n  selectedCompany?: AutoFilterCompany\r\n  selectedLookup?: Lookup\r\n  showWarning: boolean\r\n}\r\n\r\nexport class OrderDefaults extends React.PureComponent<OrderDefaultsProps & OrderDefaultsAuthProps, OrderDefaultsState> {\r\n  emptyState: OrderDefaultsState = {\r\n    loading: false,\r\n    saving: false,\r\n    resetting: false,\r\n    loadingDefaults: false,\r\n    portalDefaults: [],\r\n    defaults: [],\r\n    data: [],\r\n    portals: [],\r\n    selectedPortal: undefined,\r\n    selectedCompany: undefined,\r\n    selectedLookup: undefined,\r\n    showWarning: false\r\n  }\r\n  state: OrderDefaultsState = { ...this.emptyState }\r\n\r\n  portalTypeahead = React.createRef<Typeahead<ImplementationData>>()\r\n  loadPortalsSubscription?: Subscription\r\n  loadCompanyDefaultsSubscription?: Subscription\r\n  loadPortalDefaultsSubscription?: Subscription\r\n  saveSubscription?: Subscription\r\n\r\n  componentDidMount() {\r\n    this.setState({loading: true})\r\n\r\n    if (this.props.isSiteAdmin) {\r\n      this.loadPortalsSubscription = ImplementationsGetObservable().subscribe(\r\n        data => this.setState({ portals: data.Records, loading: false }),\r\n        error =>  this.handleAPIError(error, { loading: false, portals: [] })\r\n      )\r\n    }\r\n\r\n\r\n    if (this.props.isPortalAdmin) {\r\n      this.loadPortalDefaultsSubscription = OrderDefaultsGet({ImplementationID: 0, AccountID: 0, LookupCode: \"\"})\r\n      .subscribe(\r\n        data => this.setState({portalDefaults: data, loading: false}),\r\n        error => this.handleAPIError(error, {})\r\n      )\r\n    }\r\n  }\r\n\r\n  componentWillUnmount() {\r\n    this.saveSubscription && this.saveSubscription.unsubscribe()\r\n    this.loadPortalsSubscription && this.loadPortalsSubscription.unsubscribe()\r\n    this.loadPortalDefaultsSubscription && this.loadPortalDefaultsSubscription.unsubscribe()\r\n    this.loadCompanyDefaultsSubscription && this.loadCompanyDefaultsSubscription.unsubscribe()\r\n  }\r\n\r\n  loadDefaults = (lookup?: Lookup) => {\r\n    this.setState({loadingDefaults: true})\r\n    let defaults: OrderDefault[] = []\r\n    const requestData = { ImplementationID: this.state.selectedPortal?.ImplementationID || 0, AccountID: this.state.selectedCompany?.AccountID, LookupCode: lookup?.Code || \"\" }\r\n    switch (lookup?.Code) {\r\n      case DefaultLookupCode.RegMode:\r\n        this.loadCompanyDefaultsSubscription = forkJoin({\r\n          modes: LabServiceRegulatoryModesGetObservable(true),\r\n          modeDefaults: OrderDefaultsGet(requestData)\r\n        }).subscribe(\r\n          ({ modes, modeDefaults }) => {\r\n            defaults = this.remapToOrderDefault(modes, modeDefaults, lookup.Code)\r\n            this.setState({loadingDefaults: false, defaults: defaults, data: defaults, showWarning: modeDefaults.length === 0})\r\n          },\r\n          (error) => this.handleAPIError(error, { loadingDefaults: false, defaults: [] })\r\n        )\r\n        break\r\n      case DefaultLookupCode.TestReason:\r\n        this.loadCompanyDefaultsSubscription = forkJoin({\r\n          reasons: TestReasonsObservable(),\r\n          reasonDefaults: OrderDefaultsGet(requestData)\r\n        }).subscribe(\r\n          ({ reasons, reasonDefaults }) => {\r\n            defaults = this.remapToOrderDefault(reasons, reasonDefaults, lookup.Code)\r\n            this.setState({loadingDefaults: false, defaults: defaults, data: defaults, showWarning: reasonDefaults.length === 0})\r\n          },\r\n          (error) => this.handleAPIError(error, { loadingDefaults: false, defaults: [] })\r\n        )\r\n        break\r\n      case DefaultLookupCode.ExpTime:\r\n          this.loadCompanyDefaultsSubscription = OrderDefaultsGet(requestData)\r\n          .subscribe(\r\n            (timeDefaults) => {\r\n              defaults = this.singleDefault(lookup.Label, timeDefaults, lookup.Code)\r\n              this.setState({loadingDefaults: false, defaults: defaults, data: defaults, showWarning: timeDefaults.length === 0})\r\n            },\r\n            (error) => this.handleAPIError(error, { loadingDefaults: false, defaults: [] })\r\n          )\r\n          break\r\n      case DefaultLookupCode.FAAEmployee:\r\n          this.loadCompanyDefaultsSubscription = forkJoin({\r\n            categories: EmployeeCategoriesGetObservable(3), //3 to get FAA employee categories\r\n            categoryDefaults: OrderDefaultsGet(requestData)\r\n          }).subscribe(\r\n            ({ categories, categoryDefaults }) => {\r\n              defaults = this.remapToOrderDefault(categories, categoryDefaults, lookup.Code)\r\n              this.setState({loadingDefaults: false, defaults: defaults, data: defaults, showWarning: categoryDefaults.length === 0})\r\n            },\r\n            (error) => this.handleAPIError(error, { loadingDefaults: false, defaults: [] })\r\n          )\r\n          break\r\n      case DefaultLookupCode.DOTSampleType:\r\n      case DefaultLookupCode.NonDOTSampleType:\r\n          this.loadCompanyDefaultsSubscription = OrderDefaultsGet(requestData)\r\n          .subscribe(\r\n            (sampleDefaults) => {\r\n              defaults = this.sampleDefaults(sampleDefaults, lookup.Code)\r\n              this.setState({loadingDefaults: false, defaults: defaults, data: defaults, showWarning: sampleDefaults.length === 0})\r\n            },\r\n            (error) => this.handleAPIError(error, { loadingDefaults: false, defaults: [] })\r\n          )\r\n          break\r\n      default:\r\n        this.setState({loadingDefaults: false, defaults: [], data: []})\r\n        break\r\n    }\r\n  }\r\n\r\n  createOrderDefaultElement = (fieldName: string, lookup: string, existingDefault?: OrderDefault): OrderDefault => {\r\n    return {\r\n      OrderDefaultID: existingDefault?.OrderDefaultID,\r\n      ImplementationID:  existingDefault?.ImplementationID || this.state.selectedPortal?.ImplementationID || 0,\r\n      AccountID: existingDefault?.AccountID || this.state.selectedCompany?.AccountID,\r\n      LookupCode: existingDefault?.LookupCode || lookup,\r\n      FieldName: fieldName,\r\n      DefaultValue: existingDefault?.DefaultValue,\r\n      Show: existingDefault?.Show || false,\r\n      IsDefault: existingDefault?.IsDefault || false,\r\n      Disable: !this.elementVisibleOnPortalLevel(existingDefault?.LookupCode || lookup, fieldName)\r\n    }\r\n  }\r\n\r\n  elementVisibleOnPortalLevel = (lookup: string, fieldName: string) => {\r\n    if (this.state.portalDefaults.length === 0) {\r\n      return true\r\n    }\r\n    const relatedDefault = this.state.portalDefaults.find(el => el.LookupCode === lookup && el.FieldName === fieldName)\r\n    if (relatedDefault) {\r\n      return relatedDefault.Show\r\n    }\r\n    else {\r\n      return true\r\n    }\r\n  }\r\n\r\n  singleDefault = (fieldName: string, defaults: OrderDefault[], lookup: string) => {\r\n    const savedDefault = defaults.find(x => x.FieldName === fieldName)\r\n    const newEl = this.createOrderDefaultElement(fieldName, lookup, savedDefault)\r\n    return [newEl]\r\n  }\r\n\r\n  sampleDefaults = (defaults: OrderDefault[], lookup: string) => {\r\n    const savedDefaults = defaults.filter(x => x.LookupCode === lookup)\r\n    const newUrineEl = this.createOrderDefaultElement(SampleType.UR, lookup, savedDefaults.find(x => x.FieldName === SampleType.UR))\r\n    const newOralEl = this.createOrderDefaultElement(SampleType.SD, lookup, savedDefaults.find(x => x.FieldName === SampleType.SD))\r\n    return [newUrineEl, newOralEl]\r\n  }\r\n\r\n  remapToOrderDefault = (objects: RegulatoryMode[] | TestReasonType[] | EmployeeCategory[], defaults: OrderDefault[], lookup: string) : OrderDefault[]  => {\r\n    let result: OrderDefault[] = []\r\n    objects.forEach((obj: RegulatoryMode | TestReasonType | EmployeeCategory) => {\r\n      let FieldName = \"\"\r\n\r\n      if (\"Name\" in obj) {\r\n        FieldName = obj.Name\r\n      }\r\n      else if (\"Description\" in obj) {\r\n        FieldName = obj.Description\r\n      }\r\n\r\n      let savedDefault = defaults.find(x => x.FieldName === FieldName)\r\n      let newEl = this.createOrderDefaultElement(FieldName, lookup, savedDefault)\r\n      result.push(newEl)\r\n    })\r\n\r\n    return result\r\n  }\r\n\r\n  handleCancel = () => (this.props as RouteComponentProps).history?.push(Home)\r\n\r\n  handleSave = () => {\r\n    this.saveSubscription && this.saveSubscription.unsubscribe()\r\n    this.setState({ saving: true })\r\n\r\n    var saveObj: SaveOrderDefaults = {\r\n      Defaults: this.state.data\r\n    }\r\n    this.saveSubscription = OrderDefaultsSave(saveObj).subscribe(\r\n      (data) => {\r\n        this.setState({saving: false, showWarning: false})\r\n        this.loadDefaults(this.state.selectedLookup)\r\n        toast.success(data)\r\n      },\r\n      (error) => this.handleAPIError(error, { saving: false })\r\n    )\r\n  }\r\n\r\n  handleReset = () => {\r\n    this.saveSubscription && this.saveSubscription.unsubscribe()\r\n    this.setState({ resetting: true })\r\n    this.saveSubscription = OrderDefaultsReset({ImplementationID: this.state.selectedPortal?.ImplementationID || 0, AccountID: this.state.selectedCompany?.AccountID, LookupCode: this.state.selectedLookup?.Code || \"\"}).subscribe(\r\n      (data) => {\r\n        this.setState({resetting: false, selectedLookup: undefined, data: [], defaults: []})\r\n        toast.success(data)\r\n      },\r\n      (error) => this.handleAPIError(error, { resetting: false })\r\n    )\r\n  }\r\n\r\n  handleAPIError = (error: Error | APIError, stateChanges: object) => {\r\n    this.setState(stateChanges)\r\n    error && toast.error(FormatError(error))\r\n  }\r\n\r\n  toggleShow = (index: number) => {\r\n    const newData: OrderDefault[] = [...this.state.data]\r\n    newData[index].Show = !newData[index].Show\r\n    newData[index].IsDefault = false\r\n    this.setState({ data: newData })\r\n  }\r\n\r\n  toggleDefault = (index: number) => {\r\n    const newData: OrderDefault[] = [...this.state.data]\r\n    const defaultValue = !newData[index].IsDefault\r\n    newData.forEach(el => el.IsDefault = false)\r\n    newData[index].IsDefault = defaultValue\r\n    this.setState({ data: newData })\r\n  }\r\n\r\n  handleCompanyChange = (selected: AutoFilterCompany[]) => {\r\n    const selectedCompany = selected[0]\r\n    this.setState({ selectedCompany: selectedCompany })\r\n    if (selectedCompany) {\r\n      this.setState({ selectedLookup: undefined, defaults: [], data: [], showWarning: false })\r\n    }\r\n  }\r\n\r\n  handleEmpty = (company: string) => {\r\n    if (company == \"\") {\r\n       this.setState({ defaults: [], data: [], selectedPortal: undefined, selectedLookup: undefined, showWarning: false })\r\n    }\r\n  }\r\n\r\n  handlePortalChange = (selected: ImplementationData[]) => {\r\n    const selectedPortal = selected[0]\r\n    this.setState({ selectedPortal: selectedPortal })\r\n    if (selectedPortal) {\r\n      this.setState({ selectedLookup: undefined, defaults: [], data: [], showWarning: false })\r\n    }\r\n  }\r\n\r\n  handleLookupChange = (selected: string) => {\r\n    const lookup = LookupMap.find(el => el.Code === selected)\r\n    this.setState({ selectedLookup: lookup })\r\n    if (!!lookup) {\r\n      this.loadDefaults(lookup)\r\n    }\r\n    else {\r\n      this.setState({ defaults: [], data: [], showWarning: false })\r\n    }\r\n  }\r\n\r\n  handleDefaultValueChange = (value: string, index: number) => {\r\n    const newData: OrderDefault[] = [...this.state.data]\r\n    newData[index].DefaultValue = value\r\n    this.setState({ data: newData })\r\n  }\r\n\r\n  isAnyShowSelected = () => this.state.data.some(el => !!el.Show)\r\n\r\n  DataRow = (data: OrderDefault, index: number, lookup?: Lookup) => {\r\n    return <tr key={`defaultRow${index}`}>\r\n      <td className=\"align-middle\">{data.FieldName}</td>\r\n      {!lookup?.IsInput && <>\r\n        <td><Checkbox id={`toggleShow${index}`} checked={data.Show} disabled={data.Disable} onChange={() => this.toggleShow(index)} className=\"mr-auto\" /></td>\r\n        <td><Checkbox id={`toggleDefault${index}`} checked={data.IsDefault} disabled={!data.Show} onChange={() => this.toggleDefault(index)} className=\"mr-auto\" /></td>\r\n      </>}\r\n      {lookup?.IsInput && !lookup?.IsNumeric && <td><Form.Control id={`input${index}`} className=\"bg-white\" type=\"text\" value={data.DefaultValue || \"\"} onChange={e => this.handleDefaultValueChange(e.target.value, index)}/></td>}\r\n      {lookup?.IsInput && lookup?.IsNumeric && <td><Form.Control as={NumericInput} id={`input${index}`} min={1} max={999} value={data.DefaultValue} strict onChange={(value: any) => this.handleDefaultValueChange(value, index)} /></td>}\r\n    </tr>\r\n  }\r\n\r\n  render() {\r\n    const { saving, loading, resetting, loadingDefaults, data, selectedCompany, selectedPortal, selectedLookup, portals, showWarning } = this.state\r\n    const disableButtons = (!selectedCompany && !selectedPortal) || !selectedLookup || loading || saving || resetting || loadingDefaults\r\n    const { isSiteAdmin, isPortalAdmin } = this.props\r\n    const showSaveWarning = data.length > 0 && !this.isAnyShowSelected() && !this.state.selectedLookup?.IsInput\r\n\r\n    return (\r\n      <AppPageWrapper showNav>\r\n        <Modal.Dialog size=\"lg\">\r\n          <Modal.Header>\r\n            <Modal.Title className=\"text-uppercase\">Order Defaults</Modal.Title>\r\n          </Modal.Header>\r\n          <Modal.Body>\r\n            {isPortalAdmin && <Form.Group as={Row}>\r\n              <Form.Label column lg={2}>Company:</Form.Label>\r\n              <Col>\r\n                <CompanyInput filter disabled={loading || loadingDefaults} onChange={this.handleCompanyChange} />\r\n              </Col>\r\n            </Form.Group>}\r\n            {isSiteAdmin && <Form.Group as={Row}>\r\n              <Form.Label column lg={2}>Portal:</Form.Label>\r\n                <Col>\r\n                  <Typeahead id=\"portal\"\r\n                    ref={this.portalTypeahead}\r\n                    labelKey=\"Name\"\r\n                    filterBy={(option, props) => props.selected.length > 0 || option.Name.toLowerCase().indexOf(props.text.toLowerCase()) !== -1}\r\n                    isLoading={loading}\r\n                    onChange={this.handlePortalChange}\r\n                    onInputChange={text => this.handleEmpty(text)}\r\n                    disabled={loading || loadingDefaults}\r\n                    options={portals || []}\r\n                    selected={selectedPortal ? [selectedPortal || \"\"] : []}\r\n                    placeholder=\"Select Portal\"\r\n                    emptyLabel=\"No Portals Found\">\r\n                    {!loading && <Button variant=\"toggle\" onClick={() => { this.portalTypeahead.current?.toggleMenu() }}>\r\n                      <FaAngleDown />\r\n                    </Button>}\r\n                  </Typeahead>\r\n                </Col>\r\n              </Form.Group>}\r\n            <Form.Group as={Row}>\r\n              <Form.Label column lg={2}>Order Field:</Form.Label>\r\n              <Col>\r\n                <Form.Control id=\"lookupCode\"\r\n                  as=\"select\"\r\n                  disabled={(!selectedCompany && !selectedPortal) || loading || loadingDefaults}\r\n                  value={selectedLookup?.Code || \"\"}\r\n                  onChange={e => this.handleLookupChange(e.target.value)}>\r\n                  <option value=\"\">Select</option>\r\n                  {LookupMap.map(el => <option value={el.Code} key={el.Code}>{el.Label}</option>)}\r\n                </Form.Control>\r\n              </Col>\r\n            </Form.Group>\r\n            {showWarning && <Form.Group><Col className=\"note-message font-italic px-3 text-center\">No defaults configured for selected Order Field</Col></Form.Group>}\r\n            {showSaveWarning && <Form.Group><Col className=\"note-message font-italic px-3 text-center\">At least one option should be selected to Show before update</Col></Form.Group>}\r\n            {data.length > 0 && <Form.Group as={Row}>\r\n              <Table responsive bordered className=\"dark text-center\">\r\n                <thead>\r\n                  <tr>\r\n                    {!selectedLookup?.IsInput && <><th className=\"w-50\">Field Value</th><th className=\"w-25\">Show</th><th className=\"w-25\">Make Default</th></>}\r\n                    {selectedLookup?.IsInput && <><th className=\"w-50\">Field</th><th className=\"w-50\">Default Value</th></>}\r\n                  </tr>\r\n                </thead>\r\n                <tbody>{this.state.loadingDefaults ? <tr><td colSpan={2}><Spinner animation=\"border\" size=\"sm\" /></td></tr> :\r\n                  data.map((value, index) => this.DataRow(value, index, this.state.selectedLookup))}</tbody>\r\n              </Table>\r\n            </Form.Group>}\r\n          </Modal.Body>\r\n          <Modal.Footer>\r\n            <ActionButton variant=\"primary\" onClick={() => this.handleReset()} disabled={disableButtons || showWarning} spin={resetting}>Reset Defaults</ActionButton>\r\n            <ActionButton variant=\"primary\" onClick={() => this.handleSave()} disabled={disableButtons || showSaveWarning} spin={saving}>Update</ActionButton>\r\n            <Button variant=\"secondary\" className=\"mr-2\" onClick={() => this.handleCancel()}>Cancel</Button>\r\n          </Modal.Footer>\r\n        </Modal.Dialog>\r\n      </AppPageWrapper>\r\n    )\r\n  }\r\n}\r\n\r\nfunction mapStateToProps(state: AppState): OrderDefaultsAuthProps {\r\n  return {\r\n    isPortalAdmin: isPortalAdmin(state),\r\n    isSiteAdmin: isSiteAdmin(state)\r\n  }\r\n}\r\nconst ConnectedOrderDefaults = connect(mapStateToProps, null)(OrderDefaults)\r\nexport default ConnectedOrderDefaults\r\n","import React, { Component } from 'react'\r\nimport { Button, Col, Container, Dropdown, Modal, Row } from \"react-bootstrap\"\r\nimport { connect } from 'react-redux'\r\nimport { RouteComponentProps } from \"react-router-dom\"\r\nimport { AppState, WorkforceClinicPortal } from \"../../AppState\"\r\n\r\nexport interface PortalSelectionProps { }\r\n\r\nexport interface PortalSelectionAppStateProps {\r\n  portals?: WorkforceClinicPortal[];\r\n}\r\n\r\nexport class PortalSelectionModal extends Component<PortalSelectionProps & PortalSelectionAppStateProps & RouteComponentProps>{\r\n\r\n  selectPortal = (portal: WorkforceClinicPortal) => {\r\n    const link = portal.Link || portal.AssignedClientDetailsOfClinic[0]?.Link\r\n    link && window.location.replace(link.split('#')[0])\r\n  }\r\n\r\n  render() {\r\n    const portals = this.props.portals?.sort((a, b) => (a.ImplementationName || \"\").localeCompare(b.ImplementationName || \"\")) || []\r\n    return <Modal backdrop=\"static\" centered show={true}>\r\n      <Modal.Header>\r\n        <Modal.Title>Invalid Login</Modal.Title>\r\n      </Modal.Header>\r\n      <Modal.Body>\r\n        <Container fluid>\r\n          <Row>\r\n            <Col>\r\n              <h5>The username and password you entered do not belong to this portal.</h5>\r\n              <p>Please try to login using the below portal.</p>\r\n            </Col>\r\n          </Row>\r\n        </Container>\r\n      </Modal.Body>\r\n      <Modal.Footer>\r\n        <Dropdown>\r\n          <Dropdown.Toggle variant=\"secondary\">Select Portal</Dropdown.Toggle>\r\n          <Dropdown.Menu className='secondary'>\r\n            {portals.map((portal, i) => <Dropdown.Item as={Button}\r\n              onClick={() => this.selectPortal(portal)}\r\n              key={`${portal.ImplementationID}_${i}`}\r\n              eventKey={`${portal.ImplementationID}_${i}`}\r\n              variant=\"menu-item\">\r\n              {portal.ImplementationName}\r\n            </Dropdown.Item>)}\r\n          </Dropdown.Menu>\r\n        </Dropdown>\r\n      </Modal.Footer>\r\n    </Modal>\r\n  }\r\n}\r\n\r\nfunction mapStateToProps(state: AppState): PortalSelectionAppStateProps {\r\n  return {\r\n    portals: state.Workforce1Companies.visibleCompanies\r\n  }\r\n}\r\n\r\nexport default connect(mapStateToProps, null)(PortalSelectionModal)\r\n","import * as React from \"react\"\r\nimport { RouteComponentProps } from \"react-router\"\r\nimport CompanyInformation from \"../Administration/CompanyInformation\";\r\n\r\nexport default class AddNewCompany extends React.PureComponent<RouteComponentProps> {\r\n  render() {\r\n    return <CompanyInformation {...this.props} isNew/>\r\n  }\r\n}","import * as React from \"react\"\r\nimport { WorkforceOneUserLogOut } from \"../../actions/WorkforceOneLoginActions\"\r\nimport { AppState } from \"../../AppState\"\r\nimport { connect } from \"react-redux\"\r\nimport { Action, Dispatch } from \"redux\";\r\nimport ConfirmationModal from \"../ConfirmationModal\"\r\nimport { GetSelectedAssignedClinic } from \"../../authentication/SelectedCompany/CompanySelectionDrivenSelectors\"\r\n\r\ninterface RequireCompleteSetupModalProps {\r\n  link?: string\r\n}\r\n\r\ninterface RequireCompleteSetupModalDispatchProps {\r\n  logout: () => void\r\n}\r\n\r\nexport class RequireCompleteSetupModal extends React.PureComponent<RequireCompleteSetupModalProps & RequireCompleteSetupModalDispatchProps> {\r\n  openInvitation = () =>{\r\n    if (this.props.link) {\r\n      this.props.logout()\r\n      window.location.replace(this.props.link)\r\n    }\r\n  }\r\n\r\n  render() {\r\n    return <ConfirmationModal show={true}\r\n      title=\"Continue Invitation Process\"\r\n      confirmButtonText=\"Yes\"\r\n      cancelButtonText=\"No\"\r\n      textTitle=\"Your Invitation Process has not been completed, would you like to continue?\"\r\n      text=\"If you chose not to continue you will be logged off.\"\r\n      showImage={false}\r\n      onConfirm={this.openInvitation}\r\n      onHide={this.props.logout}\r\n      showCloseButton={false} />\r\n  }\r\n}\r\n\r\nfunction mapStateToProps(state: AppState): RequireCompleteSetupModalProps {\r\n  return {\r\n    link: GetSelectedAssignedClinic(state)?.Link || state.Workforce1State.link || \"\"\r\n  }\r\n}\r\n\r\nfunction mapDispatchProps(dispatch: Dispatch<Action>): RequireCompleteSetupModalDispatchProps {\r\n  return {\r\n    logout: () => (dispatch(WorkforceOneUserLogOut(true)))\r\n  }\r\n}\r\n\r\nexport default connect<RequireCompleteSetupModalProps, RequireCompleteSetupModalDispatchProps, RequireCompleteSetupModalProps, AppState>(\r\n  mapStateToProps, mapDispatchProps)(RequireCompleteSetupModal)\r\n","import { ObservableFromFetch } from \"../ObservableFromFetch\"\r\n\r\ninterface LogData {\r\n  Url?: string,\r\n  Message?: string\r\n  Exception?: string\r\n  Stack?: string | string[]\r\n  ComponentStack?: string\r\n  WindowWidth: number\r\n  WindowHeight: number\r\n}\r\n\r\nexport default function LogErrorToServer(error: Error, info?: React.ErrorInfo) {\r\n  PostLogData(error, info)\r\n}\r\n\r\nfunction PostLogData(error: Error, info?: React.ErrorInfo) {\r\n  const data: LogData = {\r\n    Url: location.href,\r\n    Exception: error.message,\r\n    Stack: error.stack,\r\n    ComponentStack: info?.componentStack,\r\n    WindowWidth: window.screen.availWidth,\r\n    WindowHeight: window.screen.availHeight\r\n  }\r\n  const requestBody = JSON.stringify(data)\r\n  return ObservableFromFetch<string>(\"Log/WriteUILog\", requestBody).subscribe(() => { }, error => { } )\r\n}\r\n\r\nwindow.onerror = function (event: Event | string, source?: string, lineno?: number, colno?: number, error?: Error) {\r\n  // if (__DEVELOPMENT__) { // default error handling of the browser\r\n  //   return false;\r\n  // }\r\n  if (!error) {\r\n    return\r\n  }\r\n  PostLogData(error)\r\n\r\n  return true;\r\n};\r\n","import { ObservableFromFetch } from \"../ObservableFromFetch\"\r\nimport GridResponse from \"../GridResponse\"\r\nimport { Filter, Sort } from \"../GridRequest\"\r\nimport SendingFacilityRecord from \"./Model/SendingFacilityRecord\"\r\nimport Timezone from \"./Model/Timezone\"\r\n\r\nconst Columns = [\"SendingFacility\", \"WS_Url\", \"Namespace\", \"SendingFacility_Code\"] as const\r\ntype Column = typeof Columns[number]\r\n\r\nexport type ColumnFilters = Record<Column, string[]>\r\nexport type SendingFacilityGridResponse = GridResponse<SendingFacilityRecord> & ColumnFilters\r\n\r\nfunction columnFilters(filters: Filter[]): ColumnFilters {\r\n  return {\r\n    SendingFacility: filters.find(filter => filter.column === \"SendingFacility\")?.values || [],\r\n    WS_Url: filters.find(filter => filter.column === \"WS_Url\")?.values || [],\r\n    Namespace: filters.find(filter => filter.column === \"Namespace\")?.values || [],\r\n    SendingFacility_Code: filters.find(filter => filter.column === \"SendingFacility_Code\")?.values || []\r\n  }\r\n}\r\n\r\nexport default function SendingFacilityObservable(pageNumber: number, pageSize: number, filters: Filter[], sort?: Sort) {\r\n  var params: object = {\r\n    Filters: columnFilters(filters),\r\n    PageNumber: pageNumber,\r\n    PageSize: pageSize || 20,\r\n    SortGrid: { SortColumn: sort?.column || \"\", SortOrder: sort?.order.toUpperCase() === \"DESC\" ? \"DSC\" : sort?.order.toUpperCase() }\r\n  }\r\n\r\n  const requestBody: string = JSON.stringify(params)\r\n  return ObservableFromFetch<SendingFacilityGridResponse>(\"SendingFacility/GetSendingFacilities\", requestBody)\r\n}\r\n\r\nexport function TimezoneObservable() {\r\n  return ObservableFromFetch<Timezone[]>(\"CommonData/GetTimezones\")\r\n}\r\n\r\nexport function SaveSendingFacilityObservable(model: SendingFacilityRecord) {\r\n  const requestBody: string = JSON.stringify(model)\r\n\r\n  return ObservableFromFetch<SendingFacilityGridResponse>(\"SendingFacility/SetSendingFacility\", requestBody)\r\n}","export enum DateType {\r\n  COLLECTED = \"DATE_COLLECTED\",\r\n  MRO_REPORTED = \"MRO_REPORTED_DATE\",\r\n  LAB_REPORTED = \"LAB_REPORTED_DATE\",\r\n}\r\n\r\nexport const DateTypeLabel = new Map<DateType, string>([\r\n  [DateType.COLLECTED, \"Collected Date\"],\r\n  [DateType.MRO_REPORTED, \"MRO Reported Date\"],\r\n  [DateType.LAB_REPORTED, \"Lab Reported Date\"],\r\n])\r\n","import React from \"react\"\r\nimport { Modal, Form, Col, Button } from \"react-bootstrap\"\r\nimport { FaAngleDown, FaPencilAlt, FaTimes } from \"react-icons/fa\"\r\nimport { toast } from \"react-toastify\"\r\nimport { concat, of, Subject, Subscription } from \"rxjs\"\r\nimport { catchError, debounceTime, filter, map, switchMap } from \"rxjs/operators\"\r\nimport SendingFacilityRecord from \"../../api/Administration/Model/SendingFacilityRecord\"\r\nimport Timezone from \"../../api/Administration/Model/Timezone\"\r\nimport { APIError } from \"../../api/ObservableFromFetch\"\r\nimport AutoFilterPortalsGetObservable from \"../../api/Portals/AutoFilterPortalsGet\"\r\nimport PortalData from \"../../api/Portals/PortalModel/PortalData\"\r\nimport PortalsGetObservable, { PortalGetObservable } from \"../../api/Portals/PortalsGet\"\r\nimport ActionButton from \"../ActionButton\"\r\nimport { AsyncTypeahead, Typeahead } from \"react-bootstrap-typeahead\"\r\nimport ToggleSwitch from \"../FormattedInputs/ToggleSwitch\"\r\nimport { SaveSendingFacilityObservable } from \"../../api/Administration/SendingFacilities\"\r\n\r\ninterface SendingFacilityModalProps {\r\n  addNew?: boolean\r\n  timezones: Timezone[]\r\n  details?: SendingFacilityRecord\r\n  onHide: () => void\r\n  onSave: () => void\r\n}\r\n\r\ninterface SendingFacilityModalState {\r\n  isSendingFacilityValid: boolean,\r\n  loading: boolean\r\n  saving: boolean\r\n  editing: boolean\r\n  currentPortal?: PortalData\r\n  initialPortalData?: PortalData\r\n  retrievedPortalPredictions?: string[]\r\n  retrievedPortals?: PortalData[]\r\n  SendingFacility: string\r\n  WS_Url?: string\r\n  UserName?: string\r\n  Password?: string\r\n  SOAPVersion?: string\r\n  Namespace?: string\r\n  SendingFacility_Code?: string\r\n  TimeZoneAN?: number\r\n  WSUserName?: string\r\n  WSPassword?: string\r\n  MaskPos?: boolean\r\n  SendImages?: boolean\r\n  ImplementationID?: number\r\n  CRMUpdates?: boolean\r\n  InstallationId?: string\r\n}\r\n\r\nexport default class SendingFacilityModal extends React.PureComponent<SendingFacilityModalProps, SendingFacilityModalState> {\r\n  state: SendingFacilityModalState = {\r\n    loading: false,\r\n    saving: false,\r\n    editing: false,\r\n    SendingFacility: \"\",\r\n    isSendingFacilityValid: true\r\n  }\r\n\r\n  subscription?: Subscription\r\n  loadSubscription?: Subscription\r\n  saveSubscription?: Subscription\r\n  loadPortalNameSubscription?: Subscription\r\n  implementationName$ = new Subject<string>()\r\n  searchImplementation$ = new Subject<string>()\r\n  timezoneTypeahead = React.createRef<Typeahead<Timezone>>()\r\n  portalTypeahead = React.createRef<AsyncTypeahead<string>>()\r\n\r\n  componentDidMount() {\r\n    this.setState({...this.defaultStateFromProps()})\r\n\r\n    this.subscription = this.searchImplementation$.pipe(\r\n      debounceTime(500),\r\n      filter(name => name.length >= 3),\r\n      map(name => name.trim()),\r\n      switchMap(name => concat(\r\n        of({ loading: true }),\r\n        AutoFilterPortalsGetObservable(name).pipe(\r\n          map(result => ({ loading: false, result: result })),\r\n          catchError(() => of({ loading: false }))\r\n        )\r\n      ))\r\n    ).subscribe(\r\n      (o: { loading: boolean, result?: string[] }) => this.setState({ loading: o.loading, retrievedPortalPredictions: o.result }),\r\n      (error) => this.handleAPIError(error, { loading: false })\r\n    )\r\n\r\n    this.loadSubscription = this.implementationName$.pipe(\r\n      map(name => name.trim()),\r\n      switchMap(name => concat(\r\n        of({ loading: true }),\r\n        PortalsGetObservable(name).pipe(\r\n          map(result => ({ loading: false, result: result })),\r\n          catchError(() => of({ loading: false }))\r\n        )\r\n      ))\r\n    ).subscribe(\r\n      (o: { loading: boolean, result?: PortalData[] }) => this.setState({\r\n        loading: o.loading,\r\n        retrievedPortals: o.result && o.result.length > 1 ? o.result : undefined,\r\n        ImplementationID: o.result && o.result.length === 1 ? o.result[0].ImplementationID : undefined,\r\n        currentPortal: o.result && o.result.length === 1 ? o.result[0] : undefined\r\n      }),\r\n      (error) => this.handleAPIError(error, { loading: false })\r\n    )\r\n\r\n    if (this.props.details?.ImplementationID) {\r\n      this.loadPortalNameSubscription = PortalGetObservable(this.props.details?.ImplementationID).subscribe(\r\n        data  => this.setState({initialPortalData: data, currentPortal: data}),\r\n        error => this.handleAPIError(error, {})\r\n      )\r\n    }\r\n  }\r\n\r\n  componentWillUnmount() {\r\n    this.subscription && this.subscription.unsubscribe()\r\n    this.loadSubscription && this.loadSubscription.unsubscribe()\r\n    this.saveSubscription && this.saveSubscription.unsubscribe()\r\n    this.loadPortalNameSubscription && this.loadPortalNameSubscription.unsubscribe()\r\n  }\r\n\r\n  handleAPIError = (error: Error | APIError, stateChanges: object) => {\r\n    this.setState(stateChanges)\r\n    error && toast.error((error as APIError)?.errorData?.message || error.message)\r\n  }\r\n\r\n  onCancel = () => this.props.onHide()\r\n\r\n  onSubmit = () => {\r\n    this.setState({saving: true})\r\n    const data: SendingFacilityRecord = {\r\n      SendingFacilityAN: this.props.details?.SendingFacilityAN,\r\n      SendingFacility: this.state.SendingFacility,\r\n      WS_Url: this.state.WS_Url,\r\n      UserName: this.state.UserName,\r\n      Password: this.state.Password,\r\n      SOAPVersion: this.state.SOAPVersion,\r\n      Namespace: this.state.Namespace,\r\n      SendingFacility_Code: this.state.SendingFacility_Code,\r\n      TimeZoneAN: this.state.TimeZoneAN,\r\n      WSUserName: this.state.WSUserName,\r\n      WSPassword: this.state.WSPassword,\r\n      MaskPos: this.state.MaskPos,\r\n      SendImages: this.state.SendImages,\r\n      ImplementationID: this.state.ImplementationID,\r\n      CRMUpdates: this.state.CRMUpdates,\r\n      InstallationId: this.state.InstallationId\r\n    }\r\n\r\n    this.saveSubscription = SaveSendingFacilityObservable(data).subscribe(\r\n      data => {\r\n        this.setState({ saving: false })\r\n        toast.success(data)\r\n        this.props.onSave()\r\n      },\r\n      error => this.handleAPIError(error, { saving: false })\r\n    )\r\n  }\r\n\r\n  timezoneValue = () => this.props.timezones.find(zone => zone.TimeZoneID === this.state.TimeZoneAN) || undefined\r\n  valueText = (text: string | number | undefined) => <Col xs={6} md={8} className=\"col-form-label\">{text}</Col>\r\n  rowClassName = (required: boolean = false) => required ? \"form-group required\" : \"form-group\"\r\n\r\n  isValid = () => this.state.isSendingFacilityValid && this.state.SendingFacility.length > 0\r\n\r\n  handleToggleEditMode = () => {\r\n    this.setState({editing: !this.state.editing, ...this.defaultStateFromProps()})\r\n  }\r\n\r\n  defaultStateFromProps = () => {\r\n    const data = this.props.details\r\n    return {\r\n      SendingFacility: data?.SendingFacility || \"\",\r\n      WS_Url: data?.WS_Url,\r\n      UserName: data?.UserName,\r\n      Password: undefined,\r\n      SOAPVersion: data?.SOAPVersion,\r\n      Namespace: data?.Namespace,\r\n      SendingFacility_Code: data?.SendingFacility_Code,\r\n      TimeZoneAN: data?.TimeZoneAN,\r\n      WSUserName: data?.WSUserName,\r\n      WSPassword: undefined,\r\n      MaskPos: data?.MaskPos,\r\n      SendImages: data?.SendImages,\r\n      ImplementationID: data?.ImplementationID,\r\n      CRMUpdates: data?.CRMUpdates,\r\n      InstallationId: data?.InstallationId,\r\n      currentPortal: this.state.initialPortalData\r\n    }\r\n  }\r\n\r\n  handleSendingFacilityChange = (event: React.ChangeEvent<HTMLInputElement>) => {\r\n    const value = event.target.value\r\n    this.setState({ SendingFacility: value, isSendingFacilityValid: value.length >= 1 })\r\n  }\r\n\r\n  handleImplementationChange = (selected: string[]) => {\r\n    if (selected[0]) {\r\n      this.implementationName$.next(selected[0])\r\n    }\r\n    else {\r\n      this.setState({currentPortal: undefined, ImplementationID: undefined})\r\n    }\r\n  }\r\n\r\n  render() {\r\n    const { loading, saving, currentPortal, SendingFacility, MaskPos, WS_Url, UserName, SOAPVersion,\r\n      Namespace, SendingFacility_Code, WSUserName, SendImages, CRMUpdates, InstallationId, Password, WSPassword } = this.state\r\n    const editing = this.state.editing || !!this.props.addNew\r\n    const timezone = this.timezoneValue()\r\n\r\n    return (\r\n      <Modal backdrop=\"static\" show size=\"lg\" dialogClassName=\"dark\">\r\n        <Modal.Header>\r\n          {!!this.props.addNew && <Modal.Title className=\"text-uppercase\">Add New Sending Facility</Modal.Title>}\r\n          {!editing && <Modal.Title className=\"text-uppercase\">Sending Facility</Modal.Title>}\r\n          {editing && !this.props.addNew && <Modal.Title className=\"text-uppercase\">Edit Sending Facility</Modal.Title>}\r\n        </Modal.Header>\r\n        <Modal.Body>\r\n          <Form className=\"px-4\">\r\n            {!this.props.addNew && <Form.Row>\r\n              <Col><h5>MODIFY SENDING FACILITY</h5></Col>\r\n              <Col sm={1} className={\"text-right\"}>\r\n                <h5>\r\n                  <Button variant=\"icon-link\" size=\"sm\" className=\"float-right mb-3 btn-icon-primary\" onClick={this.handleToggleEditMode}>\r\n                    {!this.state.editing && <FaPencilAlt />}\r\n                    {this.state.editing && <FaTimes />}\r\n                  </Button>\r\n                </h5>\r\n              </Col>\r\n            </Form.Row>}\r\n            <Form.Row className={this.rowClassName(editing)}>\r\n              <Form.Label column xs={6} md={4}>Sending Facility</Form.Label>\r\n              {!editing && this.valueText(SendingFacility)}\r\n              {editing &&\r\n                <Col xs={6} md={8}>\r\n                  <Form.Control type=\"text\" value={SendingFacility} maxLength={50} onChange={this.handleSendingFacilityChange} isInvalid={!this.state.isSendingFacilityValid} />\r\n                </Col>}\r\n            </Form.Row>\r\n            <Form.Row className={this.rowClassName()}>\r\n              <Form.Label column xs={6} md={4}>Namespace</Form.Label>\r\n              {!editing && this.valueText(Namespace)}\r\n              {editing &&\r\n                <Col xs={6} md={8}>\r\n                  <Form.Control type=\"text\" value={Namespace} maxLength={255} onChange={e => this.setState({ Namespace: e.target.value })} />\r\n                </Col>}\r\n            </Form.Row>\r\n            <Form.Row className={this.rowClassName()}>\r\n              <Form.Label column xs={6} md={4}>Code</Form.Label>\r\n              {!editing && this.valueText(SendingFacility_Code)}\r\n              {editing &&\r\n                <Col xs={6} md={8}>\r\n                  <Form.Control type=\"text\" value={SendingFacility_Code} maxLength={15} onChange={e => this.setState({ SendingFacility_Code: e.target.value })} />\r\n                </Col>}\r\n            </Form.Row>\r\n            <Form.Row className={this.rowClassName()}>\r\n              <Form.Label column xs={6} md={4}>WS Url</Form.Label>\r\n              {!editing && this.valueText(WS_Url)}\r\n              {editing &&\r\n                <Col xs={6} md={8}>\r\n                  <Form.Control type=\"text\" value={WS_Url} maxLength={255} onChange={e => this.setState({ WS_Url: e.target.value })} />\r\n                </Col>}\r\n            </Form.Row>\r\n            <Form.Row className={this.rowClassName()}>\r\n              <Form.Label column xs={6} md={4}>UserName</Form.Label>\r\n              {!editing && this.valueText(UserName)}\r\n              {editing &&\r\n                <Col xs={6} md={8}>\r\n                  <Form.Control type=\"text\" value={UserName} maxLength={50} onChange={e => this.setState({ UserName: e.target.value })} />\r\n                </Col>}\r\n            </Form.Row>\r\n            {editing && <Form.Row className={this.rowClassName()}>\r\n              <Form.Label column xs={6} md={4}>Password</Form.Label>\r\n                <Col xs={6} md={8}>\r\n                  <Form.Control type=\"text\" value={Password} placeholder={this.props.addNew ? \"\" : \"Enter new password to update existing\"} maxLength={50} onChange={e => this.setState({ Password: e.target.value })} />\r\n                </Col>\r\n            </Form.Row>}\r\n            <Form.Row className={this.rowClassName()}>\r\n              <Form.Label column xs={6} md={4}>WS UserName</Form.Label>\r\n              {!editing && this.valueText(WSUserName)}\r\n              {editing &&\r\n                <Col xs={6} md={8}>\r\n                  <Form.Control type=\"text\" value={WSUserName} maxLength={50} onChange={e => this.setState({ WSUserName: e.target.value })} />\r\n                </Col>}\r\n            </Form.Row>\r\n            {editing && <Form.Row className={this.rowClassName()}>\r\n              <Form.Label column xs={6} md={4}>WS Password</Form.Label>\r\n                <Col xs={6} md={8}>\r\n                  <Form.Control type=\"text\" value={WSPassword} placeholder={this.props.addNew ? \"\" : \"Enter new password to update existing\"} maxLength={50} onChange={e => this.setState({ WSPassword: e.target.value })} />\r\n                </Col>\r\n            </Form.Row>}\r\n            <Form.Row className={this.rowClassName()}>\r\n              <Form.Label column xs={6} md={4}>Timezone</Form.Label>\r\n              {!editing && this.valueText(timezone?.Description)}\r\n              {editing &&\r\n                <Col xs={6} md={8}>\r\n                  <Typeahead id=\"timezone\"\r\n                    ref={this.timezoneTypeahead}\r\n                    labelKey=\"Description\"\r\n                    filterBy={() => true}\r\n                    onChange={(items: Timezone[]) => this.setState({TimeZoneAN: items[0]?.TimeZoneID || undefined})}\r\n                    options={this.props.timezones}\r\n                    selected={timezone ? [timezone] : []}\r\n                    emptyLabel=\"No Timezone\"\r\n                    placeholder=\"Select\">\r\n                    <Button variant=\"toggle\" onClick={() => { this.timezoneTypeahead && this.timezoneTypeahead.current && (this.timezoneTypeahead.current as any).toggleMenu() }}>\r\n                      <FaAngleDown />\r\n                    </Button>\r\n                  </Typeahead>\r\n                </Col>}\r\n            </Form.Row>\r\n            <Form.Row className={this.rowClassName()}>\r\n              <Form.Label column xs={6} md={4}>Implementation</Form.Label>\r\n              {!editing && this.valueText(currentPortal?.CompanyName)}\r\n              {editing &&\r\n                <Col xs={6} md={8}>\r\n                  <AsyncTypeahead id=\"implementation\"\r\n                    ref={this.portalTypeahead}\r\n                    filterBy={() => true}\r\n                    isLoading={loading}\r\n                    onSearch={() => { }}\r\n                    onInputChange={input => this.searchImplementation$.next(input)}\r\n                    onChange={selected => this.handleImplementationChange(selected)}\r\n                    options={this.state.retrievedPortalPredictions || []}\r\n                    selected={currentPortal ? [currentPortal.CompanyName || \"\"] : []}\r\n                    minLength={0}\r\n                    emptyLabel=\"No Portals Found\"\r\n                    placeholder=\"\"\r\n                    inputProps={{ autoComplete: \"chrome-off\" }}>\r\n                    {!loading &&\r\n                      <Button variant=\"toggle\" onClick={() => { this.portalTypeahead && this.portalTypeahead.current && (this.portalTypeahead.current as any).toggleMenu() }}>\r\n                        <FaAngleDown />\r\n                      </Button>}\r\n                  </AsyncTypeahead>\r\n                </Col>}\r\n            </Form.Row>\r\n            <Form.Row className={this.rowClassName()}>\r\n              <Form.Label column xs={6} md={4}>Mask Pos</Form.Label>\r\n              <Col xs={6} md={8}>\r\n                <ToggleSwitch className=\"ml-0 mt-2\" on=\"Yes\" off=\"No\" disabled={!editing} checked={MaskPos} onCheck={() => this.setState({MaskPos: !this.state.MaskPos})} />\r\n              </Col>\r\n            </Form.Row>\r\n            <Form.Row className={this.rowClassName()}>\r\n              <Form.Label column xs={6} md={4}>Send Images</Form.Label>\r\n              <Col xs={6} md={8}>\r\n                <ToggleSwitch className=\"ml-0 mt-2\" on=\"Yes\" off=\"No\" disabled={!editing} checked={SendImages} onCheck={() => this.setState({SendImages: !this.state.SendImages})} />\r\n              </Col>\r\n            </Form.Row>\r\n            <Form.Row className={this.rowClassName()}>\r\n              <Form.Label column xs={6} md={4}>CRM Updates</Form.Label>\r\n              <Col xs={6} md={8}>\r\n                <ToggleSwitch className=\"ml-0 mt-2\" on=\"Yes\" off=\"No\" disabled={!editing} checked={CRMUpdates} onCheck={() => this.setState({CRMUpdates: !this.state.CRMUpdates})} />\r\n              </Col>\r\n            </Form.Row>\r\n            <Form.Row className={this.rowClassName()}>\r\n              <Form.Label column xs={6} md={4}>SOAP Version</Form.Label>\r\n              {!editing && this.valueText(SOAPVersion)}\r\n              {editing &&\r\n                <Col xs={6} md={8}>\r\n                  <Form.Control type=\"text\" value={SOAPVersion} maxLength={2} onChange={e => this.setState({ SOAPVersion: e.target.value })} />\r\n                </Col>}\r\n            </Form.Row>\r\n            <Form.Row className={this.rowClassName()}>\r\n              <Form.Label column xs={6} md={4}>Installation Id</Form.Label>\r\n              {!editing && this.valueText(InstallationId)}\r\n              {editing &&\r\n                <Col xs={6} md={8}>\r\n                  <Form.Control type=\"text\" value={InstallationId} maxLength={50} onChange={e => this.setState({ InstallationId: e.target.value })} />\r\n                </Col>}\r\n            </Form.Row>\r\n          </Form>\r\n        </Modal.Body>\r\n        <Modal.Footer>\r\n          <Button variant=\"secondary\" onClick={ this.onCancel } className=\"px-4\">{editing ? \"Cancel\" : \"Close\"}</Button>\r\n          {editing && <ActionButton variant=\"primary\" onClick={ this.onSubmit } disabled={loading || !this.isValid()} spin={saving} disableOnSpin>{!!this.props.addNew ? \"Save\" : \"Update\"}</ActionButton>}\r\n        </Modal.Footer>\r\n      </Modal>\r\n    )\r\n  }\r\n}\r\n","import React from \"react\"\r\nimport { Subscription } from \"rxjs\"\r\nimport { Sort, Filter } from \"../../api/GridRequest\"\r\nimport { APIError } from \"../../api/ObservableFromFetch\"\r\nimport { toast } from \"react-toastify\"\r\nimport { Container, Row, Col, Table, Button, Spinner } from \"react-bootstrap\"\r\nimport { FaSync } from \"react-icons/fa\"\r\nimport ColumnHeaderFilter from \"../ColumnHeaderFilter\"\r\nimport TablePagination from \"../TablePagination\"\r\nimport { AppPageWrapper } from \"../NavMenu/AppPageWrapper\"\r\nimport SendingFacilityRecord from \"../../api/Administration/Model/SendingFacilityRecord\"\r\nimport SendingFacilityObservable, { ColumnFilters, SendingFacilityGridResponse, TimezoneObservable } from \"../../api/Administration/SendingFacilities\"\r\nimport { CustomizableFilterColumn } from \"../ColumnsCustomizeModal/CustomizableColumn\"\r\nimport SendingFacilityModal from \"./SendingFacilityModal\"\r\nimport Timezone from \"../../api/Administration/Model/Timezone\"\r\n\r\ntype Column = CustomizableFilterColumn<keyof SendingFacilityRecord, keyof ColumnFilters>\r\n\r\ninterface SendingFacilityProps {\r\n\r\n}\r\n\r\ninterface SendingFacilityState {\r\n  loading: boolean\r\n  data?: SendingFacilityGridResponse\r\n  timezones: Timezone[]\r\n  columns: Column[]\r\n  sort?: Sort\r\n  filters: Filter[]\r\n  pageNumber: number\r\n  sendingFacilityDetails: boolean\r\n  details?: SendingFacilityRecord\r\n  addNew: boolean\r\n}\r\n\r\nconst defaultColumns: Column[] = [\r\n  { name: \"SendingFacility\", filter: \"SendingFacility\", label: \"Sending Facility\" },\r\n  { name: \"Namespace\", filter: \"Namespace\", label: \"Namespace\" },\r\n  { name: \"SendingFacility_Code\", filter: \"SendingFacility_Code\", label: \"SendingFacility_Code\" },\r\n  { name: \"WS_Url\", filter: \"WS_Url\", label: \"WS_Url\" },\r\n]\r\n\r\nconst PageSize = 20\r\n\r\nexport default class SendingFacilityPage extends React.PureComponent<SendingFacilityProps, SendingFacilityState> {\r\n  commonSubscription?: Subscription\r\n  subscription?: Subscription\r\n\r\n  state: SendingFacilityState = {\r\n    loading: false,\r\n    data: undefined,\r\n    timezones: [],\r\n    details: undefined,\r\n    columns: defaultColumns,\r\n    sort: undefined,\r\n    filters: [],\r\n    pageNumber: 1,\r\n    sendingFacilityDetails: false,\r\n    addNew: false\r\n  }\r\n\r\n  componentDidMount() {\r\n    this.commonSubscription = TimezoneObservable().subscribe(\r\n      data  => this.setState({ timezones: data }),\r\n      error => this.handleAPIError(error, { })\r\n    )\r\n    this.refreshGrid()\r\n  }\r\n\r\n  componentWillUnmount() {\r\n    this.subscription && this.subscription.unsubscribe()\r\n    this.commonSubscription && this.commonSubscription.unsubscribe()\r\n  }\r\n\r\n  componentDidUpdate(prevProps: SendingFacilityProps, prevState: SendingFacilityState) {\r\n    if (this.state.sort !== prevState.sort ||\r\n      this.state.filters !== prevState.filters ||\r\n      this.state.pageNumber !== prevState.pageNumber) {\r\n      this.refreshGrid()\r\n    }\r\n  }\r\n\r\n  refreshGrid() {\r\n    this.setState({ loading: true })\r\n    this.subscription && this.subscription.unsubscribe()\r\n    this.subscription = SendingFacilityObservable(this.state.pageNumber, PageSize, this.state.filters, this.state.sort).subscribe(\r\n      (data: SendingFacilityGridResponse) => this.setState({ data: data, loading: false }),\r\n      error => this.handleAPIError(error, { loading: false })\r\n    )\r\n  }\r\n\r\n  pageChanged = (pageNumber: number) => this.setState({ pageNumber: pageNumber })\r\n  sortGrid = (column: string, order?: string) => this.setState({ sort: { column: column, order: order || \"\" }, pageNumber: 1 })\r\n\r\n  filterGrid(column: string, items: string[]) {\r\n    this.setState(prevState => {\r\n      const filters = [...prevState.filters]\r\n      const filter = { column: column, values: items }\r\n      let index = filters.findIndex(item => item.column === filter.column)\r\n      if (index >= 0) {\r\n        filters[index] = filter\r\n      } else {\r\n        filters.push(filter)\r\n      }\r\n      return { filters: filters, pageNumber: 1 }\r\n    })\r\n  }\r\n\r\n  handleAPIError = (error: Error | APIError, stateChanges: object) => {\r\n    this.setState(stateChanges)\r\n    error && toast.error((error as APIError)?.errorData?.message || error.message)\r\n  }\r\n\r\n  onSave = () => {\r\n    this.setState({addNew: false, sendingFacilityDetails: false, details: undefined, filters: []})\r\n  }\r\n\r\n  showSendingFacilityDetailsModal = (data: SendingFacilityRecord) => this.setState({ sendingFacilityDetails: true, details: data })\r\n\r\n  renderCell(row: SendingFacilityRecord, colName: keyof SendingFacilityRecord, key: number) {\r\n    switch (colName) {\r\n      case \"SendingFacility\":\r\n        return <td key={key}><Button variant=\"underline-link\" onClick={() => this.showSendingFacilityDetailsModal(row)}>{row[colName]}</Button></td>\r\n      default:\r\n        return <td key={key} className=\"align-middle\">{row[colName]}</td>\r\n    }\r\n  }\r\n\r\n  render() {\r\n    const headerColumns = this.state.columns.map((col: Column, i) => {\r\n      return (\r\n        <td key={i}>\r\n          {this.state.data && col.filter && col.filter in this.state.data && <ColumnHeaderFilter title={col.label || col.name}\r\n            filtered={this.state.filters.findIndex(item => item.column === col.filter) >= 0}\r\n            sort={this.state.sort && this.state.sort.column === col.name ? this.state.sort.order === \"asc\" ? \"asc\" : \"desc\" : undefined}\r\n            items={this.state.data[col.filter as keyof ColumnFilters] || []}\r\n            onSort={(order?: string) => this.sortGrid(col.name, order)}\r\n            onFilter={(items: string[]) => col.filter && this.filterGrid(col.filter, items)}\r\n            offsetTop={19}\r\n          />}\r\n          {(!this.state.data || !col.filter) && (col.label || col.name)}\r\n        </td>\r\n      )\r\n    })\r\n\r\n    const dataRows = (data: SendingFacilityGridResponse) => data.Records.map((row: SendingFacilityRecord, i: number) => <tr key={i}>{dataColumns(row)}</tr>)\r\n    const dataColumns = (row: SendingFacilityRecord) => this.state.columns.map((col, i) => this.renderCell(row, col.name as keyof SendingFacilityRecord, i))\r\n\r\n    const { loading, data, sendingFacilityDetails, pageNumber, addNew, timezones } = this.state\r\n\r\n    const emptyRow = <tr><td colSpan={this.state.columns.length}>NO DATA FOUND</td></tr>\r\n    return (\r\n      <AppPageWrapper parentClassName={\"align-items-center\"} showNav={true}>\r\n        <Container fluid className=\"grid-container\">\r\n          <Row className=\"pb-2\">\r\n            <Col lg={12} className={\"text-right\"}>\r\n              <Button variant=\"icon-link\" size=\"sm\" onClick={() => this.setState({ filters: [] })} className=\"text-dark\">CLEAR FILTERS<FaSync /></Button>\r\n              <Button variant=\"primary\" size=\"sm\" className=\"mr-1\" onClick={() => this.setState({ addNew: true })}>Create New</Button>\r\n              {addNew && <SendingFacilityModal addNew onHide={() => this.setState({ addNew: false })} timezones={timezones} onSave={() => this.onSave()}/>}\r\n              {sendingFacilityDetails && <SendingFacilityModal onHide={() => this.setState({ sendingFacilityDetails: false, details: undefined })} timezones={timezones} details={this.state.details} onSave={() => this.onSave()} />}\r\n            </Col>\r\n          </Row>\r\n          <Row>\r\n            <Col>\r\n              {loading ? <tr><td colSpan={this.state.columns.length}><Spinner animation=\"border\" variant=\"secondary\" /></td></tr> :\r\n              <Table bordered responsive>\r\n                <thead>\r\n                  <tr>{headerColumns}</tr>\r\n                </thead>\r\n                <tbody>\r\n                  { data?.Records && data.Records.length > 0 ? dataRows(data) : emptyRow }\r\n                </tbody>\r\n              </Table>}\r\n              {data && !loading &&\r\n                <span className=\"total-records\">Total records: {data.Total}</span>}\r\n              {data && !loading &&\r\n                <TablePagination pageNumber={pageNumber} pages={data.Pages} onChange={this.pageChanged} />}\r\n            </Col>\r\n          </Row>\r\n        </Container>\r\n      </AppPageWrapper>\r\n    )\r\n  }\r\n}\r\n","import * as React from \"react\"\r\nimport RandomPools from \"./RandomPools\"\r\n\r\nexport default class ConsortiumPools extends React.PureComponent {\r\n  render() {\r\n    return <RandomPools isConsortium />\r\n  }\r\n}","import * as React from \"react\"\r\nimport RandomPersonnelGrid from \"./RandomPersonnelGrid\"\r\n\r\nexport default class ConsortiumPersonnel extends React.PureComponent {\r\n  render() {\r\n    return <RandomPersonnelGrid isConsortium />\r\n  }\r\n}","import * as React from \"react\"\r\nimport { toast } from \"react-toastify\"\r\nimport { APIError } from \"../../api/ObservableFromFetch\"\r\nimport { AppPageWrapper } from \"../NavMenu/AppPageWrapper\"\r\nimport { Button, Col, Container, Form, Modal, Spinner, Table } from \"react-bootstrap\"\r\nimport TablePagination from \"../TablePagination\"\r\nimport { FaSync } from \"react-icons/fa\"\r\nimport downloadCsv from \"../../assets/images/download-csv.png\"\r\nimport { Subscription } from \"rxjs\"\r\nimport FromToDates from \"./FromToDates\"\r\nimport FormatDate from \"../../formatters/FormatDate\"\r\nimport { PositiveReportExport, PositiveReportLoad, PositiveReportRow } from \"../../api/Reports/WorkforceReport\"\r\nimport { GenerateMROReport } from \"../../api/OrderResults/GenerateCCFImage\"\r\nimport FormatTimestampFileName from \"../../formatters/FormatTimestampFileName\"\r\nimport FileSaver from \"file-saver\"\r\nimport printPdf from \"../../utils/printPdf\"\r\nimport ImageMRO from \"../../assets/images/MRO.png\"\r\nimport GridResponse from \"../../api/GridResponse\"\r\nimport AutoFilterCompany from \"../../api/Companies/CompanyModel/AutoFilterCompany\"\r\nimport { GetAllAccountsByNameObservable } from \"../../api/Companies/GetAccountsByName\"\r\nimport { AccountType } from \"../../config/Constants\"\r\nimport DualListBox from \"../Administration/DualListBox\"\r\nimport ActionButton from \"../ActionButton\"\r\n\r\ninterface PositiveReportProps {\r\n}\r\n\r\ninterface PositiveReportState {\r\n  isLoading: boolean\r\n  pageNumber: number\r\n  ranges: string[]\r\n  selectedRange: string\r\n  selectedCompanies: AutoFilterCompany[]\r\n  companies: AutoFilterCompany[]\r\n  companiesLoading: boolean\r\n  loadingCSV: boolean\r\n  from?: Date\r\n  to?: Date\r\n  data?: GridResponse<PositiveReportRow>\r\n}\r\n\r\nconst PageSize = 20\r\n\r\nexport default class PositiveReport extends React.PureComponent<PositiveReportProps, PositiveReportState> {\r\n  ranges = [\"Collected\", \"Reported\"]\r\n\r\n  state: PositiveReportState = {\r\n    isLoading: false,\r\n    loadingCSV: false,\r\n    pageNumber: 1,\r\n    ranges: this.ranges,\r\n    selectedRange: this.ranges[0],\r\n    selectedCompanies: [],\r\n    companies: [],\r\n    companiesLoading: false\r\n  }\r\n\r\n  subscriptions = new Subscription()\r\n  exportSubscription?: Subscription\r\n  loadImageSubscription?: Subscription\r\n  loadReportSubscription?: Subscription\r\n\r\n  componentDidMount() {\r\n    this.setState({ companiesLoading: true })\r\n    this.subscriptions.add(\r\n      GetAllAccountsByNameObservable(\"\", undefined, AccountType.Company).subscribe(\r\n        (results) => this.setState({ companies: results, companiesLoading: false }),\r\n        (error) =>  this.handleAPIError(error, { companiesLoading: false})\r\n      )\r\n    )\r\n  }\r\n\r\n  componentWillUnmount() {\r\n    this.subscriptions && this.subscriptions.unsubscribe()\r\n    this.exportSubscription && this.exportSubscription.unsubscribe()\r\n    this.loadImageSubscription && this.loadImageSubscription.unsubscribe()\r\n    this.loadReportSubscription && this.loadReportSubscription.unsubscribe()\r\n  }\r\n\r\n  componentDidUpdate(prevProps: PositiveReportProps, prevState: PositiveReportState) {\r\n    if (this.state.pageNumber !== prevState.pageNumber) {\r\n      this.refreshGrid(this.state.pageNumber)\r\n    }\r\n  }\r\n\r\n  refreshGrid(pageNumber: number) {\r\n    this.setState({ isLoading: true })\r\n    this.loadReportSubscription && this.loadReportSubscription.unsubscribe()\r\n    const companyIds: number[] = this.state.selectedCompanies?.map(a => a.AccountID) || []\r\n\r\n    this.loadReportSubscription = PositiveReportLoad({\r\n      DateFrom: FormatDate(this.state.from),\r\n      DateTo: FormatDate(this.state.to),\r\n      DateType: this.state.selectedRange,\r\n      PageNumber: pageNumber,\r\n      CompanyIds: companyIds,\r\n      PageSize: PageSize\r\n    }).subscribe(\r\n      data => this.setState({ data: data, isLoading: false }),\r\n      error => this.handleAPIError(error, { isLoading: false})\r\n    )\r\n  }\r\n\r\n  handleDateRangeChange = (event: React.ChangeEvent<HTMLSelectElement>) => this.setState({ selectedRange: event.target.value })\r\n\r\n  onCompanyChange = (selected: AutoFilterCompany[]) => {\r\n    this.setState({ selectedCompanies: selected || [] })\r\n  }\r\n\r\n  pageChanged = (pageNumber: number) => {\r\n    this.setState({ pageNumber: pageNumber })\r\n  }\r\n\r\n  handleClearClick = () => {\r\n    this.setState({\r\n      selectedCompanies: [],\r\n      from: undefined,\r\n      to: undefined,\r\n      selectedRange: this.state.ranges[0]\r\n     })\r\n  }\r\n\r\n  export(csv: string) {\r\n    const csvData = new Blob([csv], { type: 'text/csv;charset=utf-8;' })\r\n    FileSaver.saveAs(csvData, FormatTimestampFileName(\"Positive_report\", \"csv\", new Date()), true)\r\n    toast.success(\"CSV file downloaded successfully.\")\r\n  }\r\n\r\n  printMROReport = (row: PositiveReportRow) => {\r\n    this.loadReportSubscription && this.loadReportSubscription.unsubscribe()\r\n    this.loadReportSubscription = GenerateMROReport(row.TestDetailID).subscribe(\r\n      (data) => this.processReport(data),\r\n      (error) => this.handleAPIError(error, {})\r\n    )\r\n  }\r\n\r\n  processReport = (data: string) => {\r\n    if (data && data !== \"\") {\r\n      printPdf(data)\r\n    } else {\r\n      toast.error(\"Data not found.\")\r\n    }\r\n  }\r\n\r\n  handleLoadClick = () => {\r\n    this.refreshGrid(1)\r\n  }\r\n\r\n  handleExportClick = () => {\r\n    this.setState({ loadingCSV: true })\r\n    const companyIds: number[] = this.state.selectedCompanies?.map(a => a.AccountID) || []\r\n    PositiveReportExport({\r\n      DateFrom: FormatDate(this.state.from),\r\n      DateTo: FormatDate(this.state.to),\r\n      DateType: this.state.selectedRange,\r\n      CompanyIds: companyIds,\r\n    }).subscribe(\r\n      (data: string) => {\r\n        this.export(data)\r\n        this.setState({ loadingCSV: false })\r\n      } ,\r\n      error => this.handleAPIError(error, {loadingCSV: false})\r\n    )\r\n  }\r\n\r\n  isReportParametersValid = () => {\r\n    const { from, to, selectedCompanies } = this.state\r\n    return (!!from && !!to && selectedCompanies.length > 0)\r\n  }\r\n\r\n  handleAPIError = (error: Error | APIError, stateChanges: object) => {\r\n    this.setState(stateChanges)\r\n    error && toast.error((error as APIError)?.errorData?.message || error.message)\r\n  }\r\n\r\n  mapMROReport = (row: PositiveReportRow) => {\r\n    return <img onClick={() => this.printMROReport(row)} src={ImageMRO} alt={\"MRO Report\"} title={\"MRO Report\"} />\r\n  }\r\n\r\n  renderRow = (row: PositiveReportRow) => {\r\n    return <>\r\n      <td>{row.CompanyName}</td>\r\n      <td>{row.LocationName}</td>\r\n      <td>{row.RegulatoryMode}</td>\r\n      <td>{row.EmployeeCategory}</td>\r\n      <td>{row.ReferenceID}</td>\r\n      <td>{row.DonorID}</td>\r\n      <td>{row.DonorFirstName}</td>\r\n      <td>{row.DonorLastName}</td>\r\n      <td>{row.ResultDescription}</td>\r\n      <td>{row.TestType}</td>\r\n      <td className=\"align-text-top\">{FormatDate(row.DateCollected)}</td>\r\n      <td className=\"align-text-top\">{FormatDate(row.MROReportDate)}</td>\r\n      <td>{row.Reason}</td>\r\n      <td>{row.Regulated}</td>\r\n      <td>{row.PositiveDrugList}</td>\r\n      <td>{this.mapMROReport(row) }</td>\r\n    </>\r\n  }\r\n\r\n  render() {\r\n    const { isLoading, data, pageNumber, from, to, selectedRange, companiesLoading, loadingCSV } = this.state\r\n    const emptyRow = <tr><td colSpan={16}>NO DATA FOUND</td></tr>\r\n    const dataRows = (rows: PositiveReportRow[]) => rows.map((row: PositiveReportRow, i: number) =>\r\n      <tr key={i}>\r\n        {this.renderRow(row)}\r\n      </tr>)\r\n\r\n    return <AppPageWrapper showNav={true}>\r\n      <Modal.Dialog size=\"xl\">\r\n        <Modal.Header>\r\n          <Modal.Title className=\"text-uppercase\">POSITIVE ONLY REPORT</Modal.Title>\r\n        </Modal.Header>\r\n        <Modal.Body>\r\n        <Form.Row>\r\n          <Col lg={6}><Form.Label column>Companies Filter:</Form.Label></Col>\r\n          <Col lg={{span: 5, offset: 1}}><Form.Label className=\"pl-1\" column>Date Range Filter:</Form.Label></Col>\r\n        </Form.Row>\r\n        <Form.Row className=\"ml-2\">\r\n          <Col lg={6}>{!companiesLoading && <DualListBox\r\n              disabled={false}\r\n              options={this.state.companies || []}\r\n              selected={this.state.selectedCompanies || []}\r\n              idKey=\"AccountID\"\r\n              labelKey=\"Name\"\r\n              availableTitle=\"Available\"\r\n              selectedTitle=\"Selected\"\r\n              onChange={this.onCompanyChange}\r\n            />}</Col>\r\n          <Col lg={{span: 5, offset: 1}} className=\"mt-3\">\r\n            <Form.Row className=\"form-group\">\r\n              <Col lg={8}>\r\n                <Form.Control id=\"date-range\" as=\"select\" onChange={this.handleDateRangeChange} value={selectedRange || \"\"}>\r\n                  {this.state.ranges?.map(r => <option value={r} key={r} selected={r === selectedRange}>{r}</option>)}\r\n                </Form.Control>\r\n              </Col>\r\n            </Form.Row>\r\n            <Form.Row className=\"form-group\">\r\n              <Col>\r\n                <FromToDates from={from} to={to} onChangeFrom={(date: Date) => {this.setState({from: date})}} onChangeTo={(date: Date) => {this.setState({to: date})}}/>\r\n              </Col>\r\n            </Form.Row>\r\n          </Col>\r\n        </Form.Row>\r\n        </Modal.Body>\r\n        <Modal.Footer>\r\n          <ActionButton size=\"sm\" className=\"mr-auto\" onClick={() => this.handleLoadClick()} disabled={!this.isReportParametersValid()} spin={this.state.isLoading} disableOnSpin>LOAD</ActionButton>\r\n          <Button variant=\"secondary\" size=\"sm\" className=\"mr-1\" onClick={() => this.handleExportClick()} disabled={!this.isReportParametersValid()}>\r\n            EXPORT CSV&nbsp;\r\n            {loadingCSV ? <Spinner animation=\"border\" size=\"sm\" /> : <img src={downloadCsv} alt=\"\" width=\"16\" height=\"16\" />}\r\n          </Button>\r\n          <Button variant=\"secondary\" size=\"sm\" className=\"mr-1\" onClick={() => this.handleClearClick()}>CLEAR FILTERS&nbsp;<FaSync /></Button>\r\n        </Modal.Footer>\r\n      </Modal.Dialog>\r\n      <Container fluid className=\"grid-container\">\r\n          <Col>\r\n            <Table bordered responsive>\r\n              <thead>\r\n                <tr>\r\n                  <td>Company</td>\r\n                  <td>Location</td>\r\n                  <td>Regulatory Mode</td>\r\n                  <td>Employee Category</td>\r\n                  <td>CCF#</td>\r\n                  <td>DonorID</td>\r\n                  <td>Donor First Name</td>\r\n                  <td>Donor Last Name</td>\r\n                  <td>Result</td>\r\n                  <td>Test Type</td>\r\n                  <td>Date Collected</td>\r\n                  <td>Date Reported</td>\r\n                  <td>Reason For Test</td>\r\n                  <td>Regulated</td>\r\n                  <td>PositiveDrugList</td>\r\n                  <td></td>\r\n                </tr>\r\n              </thead>\r\n              <tbody>\r\n                {\r\n                  isLoading ?\r\n                    <tr><td colSpan={16}><Spinner animation=\"border\" variant=\"secondary\" /></td></tr> :\r\n                    data?.Records && data.Records.length > 0 ? dataRows(data.Records) : emptyRow\r\n                }\r\n              </tbody>\r\n            </Table>\r\n            {data && !isLoading &&\r\n              <span className=\"total-records\">Total records: {data.Total}</span>}\r\n            {data && !isLoading &&\r\n              <TablePagination pageNumber={pageNumber} pages={data.Pages} onChange={this.pageChanged} />}\r\n          </Col>\r\n          </Container>\r\n    </AppPageWrapper>\r\n  }\r\n}\r\n","import { Col, Form } from \"react-bootstrap\"\r\n\r\nimport { DateType, DateTypeLabel } from \"../../../api/Reports/UnmergedRandomResultsReport/DateType\"\r\n\r\ninterface DateTypeSelectionProps {\r\n  selectedType: DateType\r\n  required?: boolean\r\n  onChange: (event: React.ChangeEvent<HTMLSelectElement>) => void\r\n}\r\n\r\nfunction DateTypeSelection(props: DateTypeSelectionProps) {\r\n  const { selectedType, required, onChange } = props\r\n\r\n  return (\r\n    <>\r\n      <Form.Label column sm={2} className={required ? \"required\" : \"\"}>\r\n        Date Type\r\n      </Form.Label>\r\n      <Col>\r\n        <Form.Control as=\"select\" onChange={onChange} value={selectedType}>\r\n          {Array.from(DateTypeLabel).map(([k, v]) => (\r\n            <option value={k} key={k} selected={k === selectedType}>\r\n              {v}\r\n            </option>\r\n          ))}\r\n        </Form.Control>\r\n      </Col>\r\n    </>\r\n  )\r\n}\r\nDateTypeSelection.defaultProps = {\r\n  required: true,\r\n}\r\nexport default DateTypeSelection\r\n","import { useEffect, useState } from \"react\"\r\n\r\nimport { Button, Col, Form, Modal, ModalBody } from \"react-bootstrap\"\r\nimport { FaSync } from \"react-icons/fa\"\r\nimport { useSelector } from \"react-redux\"\r\nimport { useHistory } from \"react-router\"\r\n\r\nimport DateTypeSelection from \"./DateTypeSelection\"\r\nimport AutoFilterCompaniesGet from \"../../../api/Companies/AutoFilterCompaniesGet\"\r\nimport AutoFilterCompany from \"../../../api/Companies/CompanyModel/AutoFilterCompany\"\r\nimport { CompanyDataLoader } from \"../../../api/Reports/CompanyDataLoader\"\r\nimport { DateType } from \"../../../api/Reports/UnmergedRandomResultsReport/DateType\"\r\nimport {\r\n  UnmergedRandomResultsReportParams,\r\n  UnmergedRandomResultsReportPdf,\r\n} from \"../../../api/Reports/UnmergedRandomResultsReportGet\"\r\nimport { AppState } from \"../../../AppState\"\r\nimport { isPortalAdmin } from \"../../../authentication/isAdminRole\"\r\nimport { GetSelectedAssignedClinic } from \"../../../authentication/SelectedCompany/CompanySelectionDrivenSelectors\"\r\nimport { Home } from \"../../../config/Routes\"\r\nimport FormatDate from \"../../../formatters/FormatDate\"\r\nimport handleAPIError from \"../../../utils/handleAPIError\"\r\nimport printPdf from \"../../../utils/printPdf\"\r\nimport ActionButton from \"../../ActionButton\"\r\nimport DualListBox from \"../../Administration/DualListBox\"\r\nimport { AppPageWrapper } from \"../../NavMenu/AppPageWrapper\"\r\nimport FromToDates from \"../FromToDates\"\r\n\r\nfunction UnmergedRandomResultsReport() {\r\n  const portalAdmin = useSelector((state: AppState) => isPortalAdmin(state))\r\n  const clinic = useSelector((state: AppState) => GetSelectedAssignedClinic(state))\r\n  const history = useHistory()\r\n\r\n  const [generatingPdf, setGeneratingPdf] = useState(false)\r\n  const [companies, setCompanies] = useState<CompanyDataLoader>({ data: [], loading: false })\r\n  const [selectedCompanies, setSelectedCompanies] = useState<AutoFilterCompany[]>([])\r\n  const [selectedDateType, setDateType] = useState<DateType>(DateType.COLLECTED)\r\n  const [from, setFrom] = useState<Date>()\r\n  const [to, setTo] = useState<Date>()\r\n\r\n  useEffect(() => {\r\n    setCompanies((prev) => ({ data: prev.data, loading: true }))\r\n    const sub = AutoFilterCompaniesGet(\"\").subscribe(\r\n      (res) => setCompanies({ data: res, loading: false }),\r\n      (error) => handleAPIError(error, () => setCompanies((prev) => ({ ...prev, loading: false })))\r\n    )\r\n    return () => sub.unsubscribe()\r\n  }, [])\r\n\r\n  useEffect(() => {\r\n    setSelectedCompanies(companies.data)\r\n  }, [companies.data])\r\n\r\n  const isParamsValid = () => selectedCompanies.length > 0 && !!selectedDateType && !!from && !!to\r\n\r\n  const getReportParams = (): UnmergedRandomResultsReportParams => {\r\n    return {\r\n      CompanyIds: selectedCompanies?.map((a) => a.AccountID) || [],\r\n      DateType: selectedDateType,\r\n      DateFrom: FormatDate(from),\r\n      DateTo: FormatDate(to),\r\n    }\r\n  }\r\n\r\n  const handleCancelClick = () => history.push(Home)\r\n\r\n  const handleClearClick = () => {\r\n    setSelectedCompanies(companies.data)\r\n    setDateType(DateType.COLLECTED)\r\n    setFrom(undefined)\r\n    setTo(undefined)\r\n  }\r\n\r\n  const handleDateTypeChange = (event: React.ChangeEvent<HTMLSelectElement>) =>\r\n    setDateType(event.target.value as DateType)\r\n\r\n  const handleGeneratePdfClick = () => {\r\n    setGeneratingPdf(true)\r\n    UnmergedRandomResultsReportPdf(getReportParams()).subscribe(\r\n      (results: string) => {\r\n        setGeneratingPdf(false)\r\n        printPdf(results)\r\n      },\r\n      (error) => handleAPIError(error, () => setGeneratingPdf(false))\r\n    )\r\n  }\r\n\r\n  return (\r\n    <AppPageWrapper parentClassName=\"align-items-center\" showNav>\r\n      <Modal.Dialog size=\"lg\">\r\n        <Modal.Header>\r\n          <Modal.Title className=\"text-uppercase\">Unmerged Random Results</Modal.Title>\r\n        </Modal.Header>\r\n        <ModalBody>\r\n          <Form>\r\n            {portalAdmin && (\r\n              <Form.Row>\r\n                <Col>\r\n                  <Form.Label className=\"required\">Companies</Form.Label>\r\n                  <DualListBox\r\n                    disabled={companies.loading}\r\n                    options={companies.data}\r\n                    selected={selectedCompanies}\r\n                    idKey=\"AccountID\"\r\n                    labelKey=\"Name\"\r\n                    availableTitle=\"Available\"\r\n                    selectedTitle=\"Selected\"\r\n                    onChange={setSelectedCompanies}\r\n                  />\r\n                </Col>\r\n              </Form.Row>\r\n            )}\r\n            {!portalAdmin && (\r\n              <Form.Row className=\"form-group\">\r\n                <Form.Label column sm={2}>\r\n                  Company\r\n                </Form.Label>\r\n                <Col>\r\n                  <Form.Control as=\"input\" readOnly value={clinic?.Name} />\r\n                </Col>\r\n              </Form.Row>\r\n            )}\r\n            <Form.Row className=\"form-group\">\r\n              <DateTypeSelection selectedType={selectedDateType} onChange={handleDateTypeChange} />\r\n              <Col sm={1} />\r\n            </Form.Row>\r\n            <Form.Row className=\"form-group\">\r\n              <Col sm={2} />\r\n              <Col>\r\n                <FromToDates from={from} to={to} onChangeFrom={setFrom} onChangeTo={setTo} />\r\n              </Col>\r\n              <Col sm={1} />\r\n            </Form.Row>\r\n          </Form>\r\n        </ModalBody>\r\n        <Modal.Footer>\r\n          <Button variant=\"secondary\" onClick={handleCancelClick}>\r\n            Cancel\r\n          </Button>\r\n          <Button variant=\"secondary\" className=\"mr-auto\" onClick={handleClearClick}>\r\n            Clear Filter&nbsp;\r\n            <FaSync />\r\n          </Button>\r\n          <ActionButton\r\n            variant=\"primary\"\r\n            disabled={companies.loading || !isParamsValid()}\r\n            onClick={handleGeneratePdfClick}\r\n            spin={generatingPdf}\r\n            disableOnSpin\r\n          >\r\n            Continue\r\n          </ActionButton>\r\n        </Modal.Footer>\r\n      </Modal.Dialog>\r\n    </AppPageWrapper>\r\n  )\r\n}\r\nexport default UnmergedRandomResultsReport\r\n","import { DateType } from \"./UnmergedRandomResultsReport/DateType\"\r\nimport { ObservableFromFetch } from \"../ObservableFromFetch\"\r\n\r\nexport interface UnmergedRandomResultsReportParams {\r\n  DateFrom: string\r\n  DateTo: string\r\n  DateType: DateType\r\n  CompanyIds: number[]\r\n}\r\n\r\nexport function UnmergedRandomResultsReportPdf(parameters: UnmergedRandomResultsReportParams) {\r\n  const requestBody: string = JSON.stringify(parameters)\r\n\r\n  return ObservableFromFetch<string>(\"WorkforceReport/UnmergedRandomResultsReport\", requestBody)\r\n}\r\n","import { Component } from \"react\";\r\nimport { Action, Dispatch } from \"redux\";\r\nimport { connect } from \"react-redux\"\r\nimport { HashRouter as Router, Redirect, Route, RouteComponentProps, Switch } from \"react-router-dom\"\r\nimport { AppState } from \"./AppState\"\r\nimport RandomPools from \"./components/Randomization/RandomPools\"\r\nimport RandomGovPools from \"./components/Randomization/GovPools/RandomGovPools\"\r\nimport GovDonor from \"./components/GovDonor/GovDonorGrid\"\r\nimport OrderRequest from \"./components/OrderRequests/OrderRequest\"\r\nimport OrderFinish from \"./components/OrderRequests/OrderFinish\"\r\nimport OrderResults from \"./components/OrderResults/OrderTracking\"\r\nimport SiteSearchPage from \"./components/SiteSearch/SiteSearchPage\"\r\nimport \"./App.scss\"\r\nimport ConnectedWorkforce1Login from \"./authentication/Workforce1Login\"\r\nimport ConnectedSSOWorkforce1Login from \"./authentication/SSOWorkforce1Login\"\r\nimport PageLoading from \"./components/PageLoading\"\r\nimport { PageLoaded } from \"./actions/WorkforceOnePageActions\"\r\nimport ClinicSearchOptions from \"./components/Administration/ClinicSearchOptions\"\r\nimport ConnectedCompanySelection from \"./components/Companies/CompanySelection\"\r\nimport RandomPersonnelGrid from \"./components/Randomization/RandomPersonnelGrid\"\r\nimport SelectionInbox from \"./components/Randomization/SelectionInbox\"\r\nimport MyInformation from \"./components/Accounts/MyInformation\"\r\nimport UserDetailsGrid from \"./components/Administration/UserDetailsGrid\"\r\nimport UserActivation from \"./components/Administration/UserActivation\"\r\nimport RegulatoryModeForm from \"./components/Accounts/RegulatoryMode/RegulatoryModeForm\"\r\nimport CompanyActivation from \"./components/Administration/CompanyActivation\"\r\nimport PortalActivation from \"./components/Administration/PortalActivation\"\r\nimport CompanyInformation from \"./components/Administration/CompanyInformation\"\r\nimport LocationInformation from \"./components/Administration/LocationInformation\"\r\nimport MyOrganization from \"./components/Administration/MyOrganization\"\r\nimport OrphanedResults from \"./components/OrphanedResults/OrphanedResults\"\r\nimport InvitationStatusGrid from \"./components/InvitationStatus/InvitationStatusGrid\"\r\nimport GlobalParameter from \"./components/Administration/GlobalParameter\"\r\nimport OrderableServicesModal from \"./components/Administration/OrderableServicesModal\"\r\nimport UserCodesModal from \"./components/Administration/UserCodesModal\"\r\nimport UserLabelsModal from \"./components/Administration/UserLabelsModal\"\r\nimport LabResultsReportingModal from \"./components/Administration/LabResultsReportingModal\"\r\nimport {\r\n  Home,\r\n  WorkforceOnePswUpdate,\r\n  OrderFinishRoute,\r\n  OrderRoute,\r\n  OrdersRoute,\r\n  RandomsPersonnelRoute,\r\n  RandomsRoute,\r\n  SelectionInboxRoute,\r\n  SiteSearchOptionsRoute,\r\n  SiteSearchRoute,\r\n  ActivateCompanyRoute,\r\n  ActivatePortalRoute,\r\n  MyOrganizationRoute,\r\n  MyOrganizationNameRoute,\r\n  CompanyInformationRoute,\r\n  LocationInformationRoute,\r\n  InviteStatusRoute,\r\n  MyInformationRoute,\r\n  OrphanedResultsRoute,\r\n  OurTeamStatusRoute,\r\n  RegulatoryModeRoute,\r\n  PermissionsRoute,\r\n  LegacyWorkforceUserInvitationRoute,\r\n  LegacyWorkforcePortalInvitationRoute,\r\n  LegacyWorkforceCompanyInvitationRoute,\r\n  GlobalParameterRoute,\r\n  OrderableServicesRoute,\r\n  UserCodesRoute,\r\n  WorkforceOnePswConfigureRoute,\r\n  GovDonorRoute,\r\n  RandomsGovRoute,\r\n  GovOrderRoute,\r\n  SSOOrderRoute,\r\n  SSOOrderFinishRoute,\r\n  SSOSiteSearchRoute,\r\n  SSOGetAuthFormRoute,\r\n  SSOHome,\r\n  SSOCallbackRoute,\r\n  ReportPositiveRoute,\r\n  ReportTestingSummaryRoute,\r\n  ReportDrugDetailRoute,\r\n  ReportDailySummaryRoute,\r\n  ReportSpecimenPositivityRoute,\r\n  ReportIvrCallInComplianceRoute,\r\n  ReportNoShowRoute,\r\n  UserLabelsRoute,\r\n  ReportCertificationRenewalRoute,\r\n  ReportCertificationStatusRoute,\r\n  ReportManagementSummaryRoute,\r\n  ReportMISRoute,\r\n  ReportSummaryRoute,\r\n  PortalAdministrationRoute,\r\n  AddNewPortalRoute,\r\n  ActivateUserRoute,\r\n  ConfigureOrderDefaultsRoute,\r\n  AddNewCompanyRoute,\r\n  AddNewCompanyNameRoute,\r\n  SendingFacilityRoute,\r\n  ConsortiumsRoute,\r\n  ConsortiumPersonnelRoute,\r\n  CompanyInformationNameRoute,\r\n  ReportSelectedNotTestedRoute,\r\n  LabResultsReportingRoute,\r\n  ReportUnmergedRandomResultsRoute\r\n} from \"./config/Routes\"\r\nimport InvitationProcess from \"./components/Invitation/InvitationProcess\"\r\nimport PasswordResetLanding from \"./components/Secuirty/PasswordResetLanding\";\r\nimport Permissions from \"./components/Administration/Permissions\"\r\nimport UserAccessSettings from \"./authentication/UserAccessSettings\"\r\nimport { BuildUserAccess } from \"./authentication/BuildUserAccess\"\r\nimport UserState from \"./authentication/UserState\"\r\nimport { BuildUserState } from \"./authentication/BuildUserState\"\r\nimport ProtectedRoute from \"./components/ProtectedRoute\"\r\nimport { GetUserDefaultRoute } from \"./authentication/GetUserDefaultRoute\";\r\nimport GovOrderRequest from \"./components/OrderRequests/GovOrderRequest\";\r\nimport SSOSiteSearchPage from \"./components/sso/SiteSearchPage\";\r\nimport SSOGetAuthFormPage from \"./components/sso/GetAuthFormPage\";\r\nimport SSOCallback from \"./authentication/SSOCallback\"\r\nimport { GetAuthToken } from \"./storage/AuthToken\";\r\nimport ReportParameters from \"./components/Reports/ReportParameters\";\r\nimport { ImplementationTypeGovt, StorageKey } from \"./config/Constants\";\r\nimport PortalGrid from \"./components/Invitation/Portal/PortalGrid\";\r\nimport AddNewPortal from \"./components/Invitation/Portal/AddNewPortal\";\r\nimport { AppPageWrapper } from \"./components/NavMenu/AppPageWrapper\"\r\nimport ProcessingModal from \"./components/ProcessingModal\"\r\nimport packageJson from '../package.json'\r\nimport WorkforceReportParameters from \"./components/Reports/WorkforceReportParameters\";\r\nimport SummaryReport from \"./components/Reports/SummaryReport/SummaryReport\";\r\nimport OrderDefaults from \"./components/Administration/OrderDefaults\";\r\nimport PortalSelectionModal from \"./components/Companies/PortalSelectionModal\";\r\nimport AddNewCompany from \"./components/Invitation/AddNewCompany\";\r\nimport RequireCompleteSetupModal from \"./components/Invitation/RequireCompleteSetupModal\"\r\nimport LogErrorToServer from \"./api/Logging/LogErrorToServer\";\r\nimport { Button } from \"react-bootstrap\";\r\nimport SendingFacilityPage from \"./components/Administration/SendingFacilityPage\";\r\nimport ConsortiumPools from \"./components/Randomization/ConsortiumPools\";\r\nimport ConsortiumPersonnel from \"./components/Randomization/ConsortiumPersonnel\";\r\nimport PositiveReport from \"./components/Reports/PositiveReport\";\r\nimport UnmergedRandomResultsReport from \"./components/Reports/UnmergedRandomResultsReport/UnmergedRandomResultsReport\";\r\n\r\nrequire('source-map-support').install({\r\n  handleUncaughtExceptions: false\r\n});\r\n\r\nexport interface GlobalAppStateProps {\r\n  PageLoading: boolean\r\n  loadedUserPermission: boolean\r\n  selectedCompany: boolean\r\n  authenticated: boolean\r\n  requireCompleteSetup: boolean\r\n  userAccess: UserAccessSettings\r\n  userState: UserState\r\n  loadingCompany?: string\r\n  link: string\r\n  wrongUrl: boolean\r\n  showCompanySelection: boolean\r\n}\r\nexport interface AppStateDispatchProps {\r\n  pageLoaded: () => void\r\n}\r\n\r\nexport function IsOnTrack() {\r\n  return sessionStorage.getItem(StorageKey.ImplementationType) === ImplementationTypeGovt\r\n}\r\n\r\ninterface GlobalAppState {\r\n  error?: Error\r\n}\r\nexport type AppProps = GlobalAppStateProps & AppStateDispatchProps;\r\nexport class App extends Component<AppProps, GlobalAppState>{\r\n  state: GlobalAppState = { error: undefined }\r\n\r\n  constructor(props: AppProps) {\r\n    super(props)\r\n    this.props.pageLoaded()\r\n    this.checkAppVersionAndReload()\r\n  }\r\n\r\n  checkAppVersionAndReload = () => {\r\n    const appVersion = packageJson.version\r\n    fetch('meta.json')\r\n      .then((response) => response.json())\r\n      .then((meta) => {\r\n        const latestVersion = meta.version\r\n        const currentVersion = appVersion\r\n        const shouldForceRefresh = this.appVerGreaterThan(latestVersion, currentVersion)\r\n        if (shouldForceRefresh) {\r\n          this.loadNewAppVersion()\r\n        }\r\n      })\r\n  }\r\n\r\n  appVerGreaterThan = (latestVersion: string, currentVersion: string) => {\r\n    const versionsA = latestVersion.split(/\\./g)\r\n    const versionsB = currentVersion.split(/\\./g)\r\n\r\n    while (versionsA.length || versionsB.length) {\r\n      const a = Number(versionsA.shift())\r\n      const b = Number(versionsB.shift())\r\n\r\n      if (a === b) continue\r\n      return a > b || isNaN(b)\r\n    }\r\n    return false\r\n  }\r\n\r\n  loadNewAppVersion = () => {\r\n    if ('caches' in window) {\r\n      caches.keys().then((names) => {\r\n        names.forEach(async (name) => {\r\n          await caches.delete(name)\r\n        })\r\n      })\r\n      location.reload()\r\n    }\r\n  }\r\n\r\n  componentDidCatch(error: Error, info: React.ErrorInfo) {\r\n    this.setState({ error: error })\r\n    LogErrorToServer(error, info);\r\n  }\r\n\r\n  render() {\r\n    const token = GetAuthToken()\r\n    const { authenticated, selectedCompany, userAccess, userState, requireCompleteSetup, wrongUrl, showCompanySelection } = this.props\r\n    const authenticatedAndCompanySelected = this.props?.authenticated && this.props?.selectedCompany\r\n    const authenticatedAndSelectedAndUserAccessLoaded = authenticatedAndCompanySelected && this.props?.loadedUserPermission\r\n\r\n    if (!!token && !(authenticated && !selectedCompany) && (!this.props?.loadedUserPermission || this.props.loadingCompany)) {\r\n      return <AppPageWrapper showNav={true}>\r\n        <ProcessingModal message=\"Loading...\" />\r\n      </AppPageWrapper>\r\n    }\r\n\r\n    return <>\r\n      <Router>\r\n        <Switch>\r\n          {this.state.error && <Route path='*' exact render={() =>\r\n            <AppPageWrapper showNav={false}>\r\n              <div role=\"alert\">\r\n                <p>Something went wrong:</p>\r\n                <pre>{this.state.error?.message}</pre>\r\n                <Button variant=\"primary\" onClick={() => location.reload()}>Try again</Button>\r\n              </div>\r\n            </AppPageWrapper>\r\n          } />}\r\n          <Route path={SSOHome} exact component={ConnectedSSOWorkforce1Login} />\r\n          {/* Invitation process */}\r\n          <Route exact path={LegacyWorkforceUserInvitationRoute + \"/:linkId?\"} render={(props) => <InvitationProcess linkId={props.match.params.linkId} {...(props as RouteComponentProps)} />} />\r\n          <Route exact path={LegacyWorkforceCompanyInvitationRoute + \"/:linkId?\"} render={(props) => <InvitationProcess linkId={props.match.params.linkId} {...(props as RouteComponentProps)} />} />\r\n          <Route exact path={LegacyWorkforcePortalInvitationRoute + \"/:linkId?\"} render={(props) => <InvitationProcess linkId={props.match.params.linkId} {...(props as RouteComponentProps)} />} />\r\n          <Route exact path={WorkforceOnePswConfigureRoute + \"/:linkId?\"} render={(props) => <InvitationProcess linkId={props.match.params.linkId} {...(props as RouteComponentProps)} />} />\r\n          <Route exact path={WorkforceOnePswUpdate + \"/:linkId/:linkTime/:username\"}\r\n            render={(props) =>\r\n              <PasswordResetLanding linkId={props.match.params.linkId}\r\n                linkTime={props.match.params.linkTime}\r\n                userName={props.match.params.username} />} />\r\n\r\n          {authenticated && requireCompleteSetup && <Route path='*' component={RequireCompleteSetupModal} />}\r\n          {authenticated && wrongUrl && <Route path='*' component={PortalSelectionModal} />}\r\n          {/* Authorized user routes */}\r\n          <ProtectedRoute exact path={MyInformationRoute} component={MyInformation} userAccess={userAccess} userState={userState} />\r\n          <ProtectedRoute exact path={InviteStatusRoute} component={InvitationStatusGrid} userAccess={userAccess} userState={userState} />\r\n          <ProtectedRoute exact path={RandomsRoute} component={RandomPools} userAccess={userAccess} userState={userState} />\r\n          <ProtectedRoute exact path={RandomsPersonnelRoute} component={RandomPersonnelGrid} userAccess={userAccess} userState={userState} />\r\n          <ProtectedRoute exact path={SelectionInboxRoute} component={SelectionInbox} userAccess={userAccess} userState={userState} />\r\n          <ProtectedRoute exact path={OrderRoute} component={OrderRequest} userAccess={userAccess} userState={userState} />\r\n          <ProtectedRoute exact path={OrderFinishRoute} component={OrderFinish} userAccess={userAccess} userState={userState} />\r\n          <ProtectedRoute exact path={SiteSearchRoute} component={SiteSearchPage} userAccess={userAccess} userState={userState} />\r\n          <ProtectedRoute exact path={OrdersRoute} component={OrderResults} userAccess={userAccess} userState={userState} />\r\n          <ProtectedRoute exact path={OurTeamStatusRoute} component={UserDetailsGrid} userAccess={userAccess} userState={userState} />\r\n          <ProtectedRoute exact path={CompanyInformationRoute} component={CompanyInformation} userAccess={userAccess} userState={userState} />\r\n          <ProtectedRoute exact path={LocationInformationRoute} component={LocationInformation} userAccess={userAccess} userState={userState} />\r\n          <ProtectedRoute exact path={ActivateUserRoute} component={UserActivation} userAccess={userAccess} userState={userState} />\r\n          <ProtectedRoute exact path={OrphanedResultsRoute} component={OrphanedResults} userAccess={userAccess} userState={userState} />\r\n          <ProtectedRoute exact path={MyOrganizationRoute} component={MyOrganization} userAccess={userAccess} userState={userState} />\r\n          <ProtectedRoute exact path={AddNewPortalRoute} component={AddNewPortal} userAccess={userAccess} userState={userState} />\r\n          <ProtectedRoute exact path={MyOrganizationNameRoute} component={MyOrganization} userAccess={userAccess} userState={userState} />\r\n          <ProtectedRoute exact path={CompanyInformationNameRoute} component={CompanyInformation} userAccess={userAccess} userState={userState} />\r\n          <ProtectedRoute exact path={AddNewCompanyRoute} component={AddNewCompany} userAccess={userAccess} userState={userState} />\r\n          <ProtectedRoute exact path={AddNewCompanyNameRoute} component={AddNewCompany} userAccess={userAccess} userState={userState} />\r\n          <ProtectedRoute exact path={PortalAdministrationRoute} component={PortalGrid} userAccess={userAccess} userState={userState} />\r\n          <ProtectedRoute exact path={ActivateCompanyRoute} component={CompanyActivation} userAccess={userAccess} userState={userState} />\r\n          <ProtectedRoute exact path={SiteSearchOptionsRoute} component={ClinicSearchOptions} userAccess={userAccess} userState={userState} />\r\n          <ProtectedRoute exact path={GlobalParameterRoute} component={GlobalParameter} userAccess={userAccess} userState={userState} />\r\n          <ProtectedRoute exact path={ActivatePortalRoute} component={PortalActivation} userAccess={userAccess} userState={userState} />\r\n          <ProtectedRoute exact path={RegulatoryModeRoute} component={RegulatoryModeForm} userAccess={userAccess} userState={userState} />\r\n          <ProtectedRoute exact path={PermissionsRoute} component={Permissions} userAccess={userAccess} userState={userState} />\r\n          <ProtectedRoute exact path={OrderableServicesRoute} component={OrderableServicesModal} userAccess={userAccess} userState={userState} />\r\n          <ProtectedRoute exact path={UserCodesRoute} component={UserCodesModal} userAccess={userAccess} userState={userState} />\r\n          <ProtectedRoute exact path={RandomsGovRoute} component={RandomGovPools} userAccess={userAccess} userState={userState} />\r\n          <ProtectedRoute exact path={ConsortiumsRoute} component={ConsortiumPools} userAccess={userAccess} userState={userState} />\r\n          <ProtectedRoute exact path={ConsortiumPersonnelRoute} component={ConsortiumPersonnel} userAccess={userAccess} userState={userState} />\r\n          <ProtectedRoute exact path={GovDonorRoute} component={GovDonor} userAccess={userAccess} userState={userState} />\r\n          <ProtectedRoute exact path={GovOrderRoute} component={GovOrderRequest} userAccess={userAccess} userState={userState} />\r\n          <ProtectedRoute exact path={SSOOrderRoute} component={OrderRequest} userAccess={userAccess} userState={userState} />\r\n          <ProtectedRoute exact path={SSOOrderFinishRoute} component={OrderFinish} userAccess={userAccess} userState={userState} />\r\n          <ProtectedRoute exact path={SSOSiteSearchRoute} component={SSOSiteSearchPage} userAccess={userAccess} userState={userState} />\r\n          <ProtectedRoute exact path={SSOGetAuthFormRoute} component={SSOGetAuthFormPage} userAccess={userAccess} userState={userState} />\r\n          <ProtectedRoute exact path={ReportPositiveRoute} component={PositiveReport} userAccess={userAccess} userState={userState} />\r\n          <ProtectedRoute exact path={ReportTestingSummaryRoute} component={ReportParameters} userAccess={userAccess} userState={userState} />\r\n          <ProtectedRoute exact path={ReportDrugDetailRoute} component={ReportParameters} userAccess={userAccess} userState={userState} />\r\n          <ProtectedRoute exact path={ReportDailySummaryRoute} component={ReportParameters} userAccess={userAccess} userState={userState} />\r\n          <ProtectedRoute exact path={ReportSpecimenPositivityRoute} component={ReportParameters} userAccess={userAccess} userState={userState} />\r\n          <ProtectedRoute exact path={ReportIvrCallInComplianceRoute} component={ReportParameters} userAccess={userAccess} userState={userState} />\r\n          <ProtectedRoute exact path={ReportNoShowRoute} component={ReportParameters} userAccess={userAccess} userState={userState} />\r\n          <ProtectedRoute exact path={UserLabelsRoute} component={UserLabelsModal} userAccess={userAccess} userState={userState} />\r\n          <ProtectedRoute exact path={ReportCertificationRenewalRoute} component={WorkforceReportParameters} userAccess={userAccess} userState={userState} />\r\n          <ProtectedRoute exact path={ReportCertificationStatusRoute} component={WorkforceReportParameters} userAccess={userAccess} userState={userState} />\r\n          <ProtectedRoute exact path={ReportManagementSummaryRoute} component={WorkforceReportParameters} userAccess={userAccess} userState={userState} />\r\n          <ProtectedRoute exact path={ReportMISRoute} component={WorkforceReportParameters} userAccess={userAccess} userState={userState} />\r\n          <ProtectedRoute exact path={ReportSelectedNotTestedRoute} component={WorkforceReportParameters} userAccess={userAccess} userState={userState} />\r\n          <ProtectedRoute exact path={ReportSummaryRoute} component={SummaryReport} userAccess={userAccess} userState={userState} />\r\n          <ProtectedRoute exact path={ReportUnmergedRandomResultsRoute} component={UnmergedRandomResultsReport} userAccess={userAccess} userState={userState} />\r\n          <ProtectedRoute exact path={ConfigureOrderDefaultsRoute} component={OrderDefaults} userAccess={userAccess} userState={userState} />\r\n          <ProtectedRoute exact path={SendingFacilityRoute} component={SendingFacilityPage} userAccess={userAccess} userState={userState} />\r\n          <ProtectedRoute exact path={LabResultsReportingRoute} component={LabResultsReportingModal} userAccess={userAccess} userState={userState} />\r\n\r\n          {/* Loading and Company selection */}\r\n          {this.props?.PageLoading && <Route path='*' exact render={() => <PageLoading message={\"Loading..\"} />} />}\r\n          {authenticated && !selectedCompany && showCompanySelection && <Route path='*' exact render={() => <ConnectedCompanySelection />} />}\r\n          {authenticatedAndCompanySelected && !this.props?.loadedUserPermission && <Route path='*' exact render={() => <PageLoading showNav delayedVisibility message={\"Loading Users Profile..\"} />} />}\r\n\r\n          {/* Authorized user's Default page */}\r\n          {authenticatedAndSelectedAndUserAccessLoaded && <Route path='*' exact render={() => <Redirect to={GetUserDefaultRoute(userAccess, userState)} />} />}\r\n\r\n          {/* Login page and redirect to Home */}\r\n          {/*<Route path={AboutRoute} exact component={About} />*/}\r\n          {!authenticated && <Route path={Home} exact render={() => <ConnectedWorkforce1Login />} />}\r\n          <Route path='*' exact render={(props: RouteComponentProps) => {\r\n            const path = props?.location?.pathname || \"\"\r\n            if (path.startsWith(\"/access_token=\")) {\r\n              return <SSOCallback {...props} />\r\n            } else {\r\n              return <Redirect to={Home} />\r\n            }\r\n          }\r\n          } />\r\n        </Switch>\r\n      </Router>\r\n    </>\r\n  }\r\n}\r\nfunction mapStateToProps(state: AppState): GlobalAppStateProps {\r\n  return {\r\n    PageLoading: state.Workforce1State.isLoading ?? true,\r\n    loadedUserPermission: state.Workforce1State.loadedSelectedCompanyPermission,\r\n    selectedCompany: !!state.Workforce1State.selectedCompany,\r\n    authenticated: !!state.Workforce1State && state.Workforce1State.isLoggedIn,\r\n    requireCompleteSetup: !!state.Workforce1State.requireCompleteSetup,\r\n    link: state.Workforce1State.link || \"\",\r\n    userAccess: BuildUserAccess(state),\r\n    userState: BuildUserState(state),\r\n    showCompanySelection: state.Workforce1State.showCompanySelection,\r\n    loadingCompany: state.Workforce1State.loadingCompany,\r\n    wrongUrl: !!state.Workforce1State.loginResultMessage // Copied this logic from an Angular app: the presence of a message means there's an invalid url\r\n  }\r\n}\r\nfunction mapDispatchProps(dispatch: Dispatch<Action>): AppStateDispatchProps {\r\n  return {\r\n    pageLoaded: () => dispatch(PageLoaded()),\r\n  }\r\n}\r\n\r\nconst ConnectedApp = connect<GlobalAppStateProps, AppStateDispatchProps, {}, AppState>(mapStateToProps, mapDispatchProps)(App)\r\nexport default ConnectedApp\r\n","import React from 'react';\r\nimport ReactDOM from 'react-dom';\r\nimport './index.css';\r\nimport reportWebVitals from './reportWebVitals';\r\nimport { Provider } from 'react-redux';\r\nimport ConnectedApp from \"./App\";\r\nimport store from \"./AppStore\";\r\n\r\nReactDOM.render(\r\n    <Provider store={store}>\r\n        <ConnectedApp />\r\n    </Provider>,\r\n    document.getElementById('root')\r\n);\r\n\r\n// If you want to start measuring performance in your app, pass a function\r\n// to log results (for example: reportWebVitals(console.log))\r\n// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals\r\nreportWebVitals();\r\n"],"sourceRoot":""}