{"version":3,"file":"index-66e45ec6.js","sources":["../../../projects/web-app/src/lib/supabase-errors.ts","../../../projects/web-app/src/data/supabase.ts","../../../projects/web-app/src/data/SupabaseRequests/webapp-api/getUserData.ts","../../../projects/web-app/src/data/auth.tsx","../../../projects/web-app/src/lib/utils.ts","../../../projects/web-app/src/components/primitives/Card.tsx","../../../projects/web-app/src/data/AuthService.ts","../../../projects/web-app/src/components/primitives/Button.tsx","../../../projects/web-app/src/components/primitives/Label.tsx","../../../projects/web-app/src/components/primitives/Form.tsx","../../../projects/web-app/src/components/primitives/Input.tsx","../../../projects/web-app/src/pages/auth/SignInForm.tsx","../../../projects/web-app/src/pages/auth/CreateAccountForm.tsx","../../../projects/web-app/src/pages/auth/CreateOrganizationForm.tsx","../../../projects/web-app/src/pages/auth/SendResetEmailForm.tsx","../../../projects/web-app/src/pages/auth/EmailVerification.tsx","../../../projects/web-app/src/pages/auth/AuthPage.tsx","../../../projects/web-app/src/pages/public/EulaBody.tsx","../../../projects/web-app/src/pages/public/EulaPage.tsx","../../../projects/web-app/src/assets/lucidity/logo.png","../../../projects/web-app/src/layout/SideBar/Header.tsx","../../../projects/web-app/src/layout/SideBar/PageLink.tsx","../../../projects/web-app/src/layout/SideBar/NavLinks.tsx","../../../projects/web-app/src/layout/SideBar/Footer.tsx","../../../projects/web-app/src/layout/SideBar/SideBarContainer.tsx","../../../projects/web-app/src/components/primitives/Toast.tsx","../../../projects/web-app/src/components/primitives/useToast.ts","../../../projects/web-app/src/components/primitives/Toaster.tsx","../../../projects/web-app/src/layout/StandardLayout.tsx","../../../projects/web-app/src/pages/dashboard/_functions/assignColors.ts","../../../projects/web-app/src/data/SupabaseRequests/dashboard-api/getStores.ts","../../../projects/web-app/src/data/SupabaseRequests/analytics-api/getGraphData.ts","../../../projects/web-app/src/pages/dashboard/graphs/_helpers.ts","../../../projects/web-app/src/pages/dashboard/graphs/DeliveriesGraph.tsx","../../../projects/web-app/src/pages/dashboard/graphs/MissingPercentageGraph.tsx","../../../projects/web-app/src/pages/dashboard/graphs/OveragePercentageGraph.tsx","../../../projects/web-app/src/pages/dashboard/graphs/GraphsContainer.tsx","../../../projects/web-app/src/data/SupabaseRequests/dashboard-api/getDashboardPins.ts","../../../projects/web-app/src/pages/dashboard/mapFeatures/Pin.tsx","../../../projects/web-app/src/helpers/parseGeocode.ts","../../../projects/web-app/src/pages/dashboard/mapFeatures/getRoundedLine.ts","../../../projects/web-app/src/pages/dashboard/mapFeatures/lineFeatures.ts","../../../projects/web-app/src/common/hooks/useOutsideClick.ts","../../../projects/web-app/src/data/SupabaseRequests/dashboard-api/getStoreDeliveryInfo.ts","../../../projects/web-app/src/pages/dashboard/mapFeatures/StorePin.tsx","../../../projects/web-app/src/pages/dashboard/mapFeatures/Legend.tsx","../../../projects/web-app/src/components/map-features/polygon/getRoundedPolygonFilled.ts","../../../projects/web-app/src/components/map-features/polygon/getRoundedPolygonEdges.ts","../../../projects/web-app/src/components/map-features/polygon/getPolygonNameCentered.ts","../../../projects/web-app/src/components/map-features/polygon/defaultLayerStyles.ts","../../../projects/web-app/src/pages/dashboard/mapFeatures/regionColors.ts","../../../projects/web-app/src/components/map-features/helpers/darkenHSLColor.ts","../../../projects/web-app/src/pages/dashboard/DashboardMap.tsx","../../../projects/web-app/src/pages/dashboard/DashboardAnalytics.tsx","../../../projects/web-app/src/pages/dashboard/DashboardPage.tsx","../../../projects/web-app/src/pages/error/Error404.tsx","../../../projects/web-app/src/components/primitives/PageTitle.tsx","../../../projects/web-app/src/components/primitives/Tooltip.tsx","../../../projects/web-app/src/components/TooltipWrapper.tsx","../../../projects/web-app/src/components/NavBar.tsx","../../../projects/web-app/src/layout/PageHeader.tsx","../../../projects/web-app/src/components/primitives/Table.tsx","../../../projects/web-app/src/data/SupabaseRequests/organization-api/getAllUsers.ts","../../../projects/web-app/src/layout/Loading.tsx","../../../projects/web-app/src/pages/organization/users/UserFilters.tsx","../../../projects/web-app/src/components/primitives/Badge.tsx","../../../projects/web-app/src/common/classes/LUDate.ts","../../../projects/web-app/src/pages/organization/users/LastLoginCell.tsx","../../../projects/web-app/src/components/primitives/Popover.tsx","../../../projects/web-app/src/pages/organization/users/StationsCell.tsx","../../../projects/web-app/src/pages/organization/users/PermissionsCell.tsx","../../../projects/web-app/src/data/SupabaseRequests/organization-api/deleteUser.ts","../../../projects/web-app/src/pages/organization/users/UserRow.tsx","../../../projects/web-app/src/pages/organization/users/UsersTable.tsx","../../../projects/web-app/src/data/SupabaseRequests/organization-api/getShippers.ts","../../../projects/web-app/src/data/SupabaseRequests/organization-api/connectWithShipper.ts","../../../projects/web-app/src/pages/organization/profile/Carrier.tsx","../../../projects/web-app/src/data/SupabaseRequests/organization-api/fetchInviteCode.ts","../../../projects/web-app/src/pages/organization/profile/InviteCodeGenerator.tsx","../../../projects/web-app/src/data/SupabaseRequests/organization-api/getCarriers.ts","../../../projects/web-app/src/pages/organization/profile/Shipper.tsx","../../../projects/web-app/src/pages/organization/profile/ShipperCarrier.tsx","../../../projects/web-app/src/pages/organization/OrganizationPage.tsx","../../../projects/web-app/src/pages/dispatch/contexts/useSelected.tsx","../../../projects/web-app/src/components/primitives/Checkbox.tsx","../../../projects/web-app/src/helpers/Weight.ts","../../../projects/web-app/src/pages/dispatch/components/Stops/StopSummary.tsx","../../../projects/web-app/src/pages/dispatch/contexts/useDispatchURL.tsx","../../../projects/web-app/src/data/SupabaseRequests/dispatch-api/combineStops.ts","../../../projects/web-app/src/pages/dispatch/mutations/useMergeStops.ts","../../../projects/web-app/src/data/SupabaseRequests/dispatch-api/moveStopsToRoute.ts","../../../projects/web-app/src/pages/dispatch/mutations/useMoveToUnnassigned.ts","../../../projects/web-app/src/pages/dispatch/components/Stops/StopCard.tsx","../../../projects/web-app/src/pages/dispatch/mutations/useAddStopsToRoute.ts","../../../projects/web-app/src/pages/dispatch/components/Routes/AddStopsToRoute.tsx","../../../projects/web-app/src/pages/dispatch/components/Stops/UnnassignedStops.tsx","../../../projects/web-app/src/data/SupabaseRequests/dispatch-api/updateStopPriority.ts","../../../projects/web-app/src/pages/dispatch/components/Stops/DraggableStopCard.tsx","../../../projects/web-app/src/pages/dispatch/components/Routes/RouteStops.tsx","../../../projects/web-app/src/components/primitives/DropdownMenu.tsx","../../../projects/web-app/src/pages/dispatch/components/Manifest/RouteManifest/RouteManifestButton.tsx","../../../projects/web-app/src/components/primitives/Calendar.tsx","../../../projects/web-app/src/data/SupabaseRequests/dispatch-api/updateRoute.ts","../../../projects/web-app/src/pages/dispatch/mutations/useEditRoute.ts","../../../projects/web-app/src/data/SupabaseRequests/dispatch-api/deleteRoute.ts","../../../projects/web-app/src/pages/dispatch/mutations/useDeleteRoute.ts","../../../projects/web-app/src/pages/dispatch/components/Routes/RouteActions.tsx","../../../projects/web-app/src/pages/dispatch/components/Routes/EditableRouteName.tsx","../../../projects/web-app/src/data/SupabaseRequests/dispatch-api/getDrivers.ts","../../../projects/web-app/src/pages/dispatch/components/Routes/EditableDriver.tsx","../../../projects/web-app/src/data/SupabaseRequests/dispatch-api/createRoute.ts","../../../projects/web-app/src/pages/dispatch/mutations/useAddRoute.ts","../../../projects/web-app/src/data/SupabaseRequests/dispatch-api/getRouteManifestData.ts","../../../projects/web-app/src/pages/dispatch/components/Manifest/StopManifest/ShipmentsSection.tsx","../../../projects/web-app/src/pages/dispatch/components/Manifest/StopManifest/HeaderSection.tsx","../../../projects/web-app/src/pages/dispatch/components/Manifest/StopManifest/ProblemShipmentsSection.tsx","../../../projects/web-app/src/pages/dispatch/components/Manifest/StopManifest/ProofOfStopSection.tsx","../../../projects/web-app/src/pages/dispatch/components/Manifest/StopManifest/TotalsSection.tsx","../../../projects/web-app/src/pages/dispatch/components/Manifest/StopManifest/StopManifestDocument.tsx","../../../projects/web-app/src/pages/dispatch/components/Manifest/RouteManifest/RouteManifestCoverHeader.tsx","../../../projects/web-app/src/pages/dispatch/components/Manifest/models.ts","../../../projects/web-app/src/pages/dispatch/components/Manifest/RouteManifest/RouteManifestCoverStops.tsx","../../../projects/web-app/src/pages/dispatch/components/Manifest/RouteManifest/RouteManifestCover.tsx","../../../projects/web-app/src/pages/dispatch/components/Manifest/RouteManifest/RouteManifestMain.tsx","../../../projects/web-app/src/pages/dispatch/components/Routes/RouteComponent.tsx","../../../projects/web-app/src/pages/dispatch/components/Routes/RoutesSection.tsx","../../../projects/web-app/src/data/SupabaseRequests/dispatch-api/getDispatchDataForDay.ts","../../../projects/web-app/src/pages/dispatch/factoryFunctions/getCurrentDayData.ts","../../../projects/web-app/src/components/primitives/Dialog.tsx","../../../projects/web-app/src/data/SupabaseRequests/dispatch-api/upsertDeliveryTimes.ts","../../../projects/web-app/src/data/SupabaseRequests/dispatch-api/upsertPOS.ts","../../../projects/web-app/src/data/SupabaseRequests/dispatch-api/getDetailsForStop.ts","../../../projects/web-app/src/data/SupabaseRequests/dispatch-api/importRoutes.ts","../../../projects/web-app/src/data/SupabaseRequests/dispatch-api/newStop.ts","../../../projects/web-app/src/data/SupabaseRequests/dispatch-api/getDeliveryPDFInfo.ts","../../../projects/web-app/src/data/SupabaseRequests/dispatch-api/getStopManifestShipments.ts","../../../projects/web-app/src/data/SupabaseRequests/dispatch-api/shipmentSearch.ts","../../../projects/web-app/src/data/SupabaseRequests/dispatch-api/getShipmentsForStop.ts","../../../projects/web-app/src/data/SupabaseRequests/dispatch-api/getWeeklyOverview.ts","../../../projects/web-app/src/pages/dispatch/import_routes/Warnings.tsx","../../../projects/web-app/src/pages/dispatch/import_routes/RoutePreview.tsx","../../../projects/web-app/src/pages/dispatch/import_routes/ImportRoutesModal.tsx","../../../projects/web-app/src/data/SupabaseRequests/webapp-api/getStations.ts","../../../projects/web-app/src/pages/dispatch/components/Routes/DispatchToolbar.tsx","../../../projects/web-app/src/pages/dispatch/components/Calendar/DaySelector.tsx","../../../projects/web-app/src/pages/dispatch/components/Calendar/WeekSelector.tsx","../../../projects/web-app/src/pages/dispatch/components/Stops/StopsKey.tsx","../../../projects/web-app/src/pages/dispatch/CurrentDayContent.tsx","../../../projects/web-app/src/pages/dispatch/factoryFunctions/getDetailsForStop.ts","../../../projects/web-app/src/pages/dispatch/contexts/StopShipments.tsx","../../../projects/web-app/src/pages/dispatch/components/IndividualStop/ShipmentCard.tsx","../../../projects/web-app/src/pages/dispatch/mutations/useRemoveShipmentsFromRoute.ts","../../../projects/web-app/src/pages/dispatch/components/Manifest/StopManifest/StopManifestMain.tsx","../../../projects/web-app/src/pages/dispatch/components/Manifest/StopManifest/ManifestPDFButton.tsx","../../../projects/web-app/src/pages/dispatch/mutations/useUpdateShipments.ts","../../../projects/web-app/src/pages/dispatch/components/IndividualStop/ShipmentsToolbar.tsx","../../../projects/web-app/src/pages/dispatch/components/IndividualStop/ShipmentSection.tsx","../../../projects/web-app/src/components/primitives/Textarea.tsx","../../../projects/web-app/src/pages/dispatch/mutations/useAddPOD.ts","../../../projects/web-app/src/pages/dispatch/components/IndividualStop/PODSection.tsx","../../../projects/web-app/src/pages/dispatch/components/IndividualStop/IndividualStopPage.tsx","../../../projects/web-app/src/pages/dispatch/components/IndividualStop/StopDetailsModal.tsx","../../../projects/web-app/src/pages/dispatch/DispatchPage.tsx","../../../projects/web-app/src/common/hooks/useDebounce.ts","../../../projects/web-app/src/pages/dispatch/contexts/useShipmentSearch.tsx","../../../projects/web-app/src/pages/dispatch/DispatchPageWrapper.tsx","../../../projects/web-app/src/data/SupabaseRequests/reports-api/sallyScans.ts","../../../projects/web-app/src/common/functions/downloadFile.ts","../../../projects/web-app/src/pages/reports/TabContent/functions/downloadScans.ts","../../../projects/web-app/src/pages/reports/TabContent/SallyScanning/ScanningTable.tsx","../../../projects/web-app/src/pages/reports/TabContent/SallyScanning/SallyScanning.tsx","../../../projects/web-app/src/pages/reports/TabContent/SallyInvoice/DataTable.tsx","../../../projects/web-app/src/pages/reports/TabContent/SallyInvoice/Success.tsx","../../../projects/web-app/src/pages/reports/TabContent/SallyInvoice/BillingColumns.tsx","../../../projects/web-app/src/pages/reports/TabContent/SallyInvoice/_models.ts","../../../projects/web-app/src/pages/reports/TabContent/SallyInvoice/downloadTemplate.ts","../../../projects/web-app/src/pages/reports/TabContent/SallyInvoice/parseFile.ts","../../../projects/web-app/src/pages/reports/TabContent/SallyInvoice/DateControl.tsx","../../../projects/web-app/src/data/SupabaseRequests/reports-api/createSallyEdi.ts","../../../projects/web-app/src/pages/reports/TabContent/SallyInvoice/downloadAsCSV.ts","../../../projects/web-app/src/pages/reports/TabContent/SallyInvoice/SallyInvoicing.tsx","../../../projects/web-app/src/pages/reports/ReportsPageWrapper.tsx","../../../projects/web-app/src/pages/shipment_search/SearchContainer.tsx","../../../projects/web-app/src/pages/shipment_search/ShipmentDetails.tsx","../../../projects/web-app/src/pages/shipment_search/ShipmentTrackingHistory.tsx","../../../projects/web-app/src/pages/shipment_search/ShipmentTrackingCard.tsx","../../../projects/web-app/src/pages/shipment_search/SearchResultView.tsx","../../../projects/web-app/src/data/SupabaseRequests/shipment-search-api/fetchShipmentTrackingData.ts","../../../projects/web-app/src/pages/shipment_search/SearchView.tsx","../../../projects/web-app/src/pages/shipment_search/ShipmentSearchPage.tsx","../../../projects/web-app/src/components/VerticalStateSelector.tsx","../../../projects/web-app/src/pages/carriers/CarriersPage.tsx","../../../projects/web-app/src/layout/LandingLayout.tsx","../../../projects/web-app/src/pages/downloads/DownloadFromBucket.tsx","../../../projects/web-app/src/pages/downloads/DownloadOptions.tsx","../../../projects/web-app/src/pages/downloads/DownloadsPage.tsx","../../../projects/web-app/src/pages/warehouse/Shared/StateBadge.tsx","../../../projects/web-app/src/pages/warehouse/Shared/ArrivalProgressBar.tsx","../../../projects/web-app/src/pages/warehouse/Shared/ProgressBar.tsx","../../../projects/web-app/src/data/SupabaseRequests/warehouse-webapp-api/verifyASN.ts","../../../projects/web-app/src/data/SupabaseRequests/warehouse-webapp-api/fetchOSDByType.ts","../../../projects/web-app/src/data/SupabaseRequests/warehouse-webapp-api/loadScanReport.ts","../../../projects/web-app/src/data/SupabaseRequests/warehouse-webapp-api/resolveMissing.ts","../../../projects/web-app/src/data/SupabaseRequests/warehouse-webapp-api/fetchNewScanCount.ts","../../../projects/web-app/src/data/SupabaseRequests/warehouse-webapp-api/fetchASNTemplates.ts","../../../projects/web-app/src/data/SupabaseRequests/warehouse-webapp-api/updateOverageStore.ts","../../../projects/web-app/src/data/SupabaseRequests/warehouse-webapp-api/fetchUnscannedShipments.ts","../../../projects/web-app/src/data/SupabaseRequests/warehouse-webapp-api/resolveOverage.ts","../../../projects/web-app/src/data/SupabaseRequests/warehouse-webapp-api/fetchUnresolvedOSNDShipments.ts","../../../projects/web-app/src/data/SupabaseRequests/warehouse-webapp-api/handleBadScan.ts","../../../projects/web-app/src/data/SupabaseRequests/warehouse-webapp-api/completeSort.ts","../../../projects/web-app/src/data/SupabaseRequests/warehouse-webapp-api/assignUnrecognizedToStore.ts","../../../projects/web-app/src/data/SupabaseRequests/warehouse-webapp-api/insertTemplate.ts","../../../projects/web-app/src/data/SupabaseRequests/warehouse-webapp-api/fetchStores.ts","../../../projects/web-app/src/data/SupabaseRequests/warehouse-webapp-api/arriveLoad.ts","../../../projects/web-app/src/data/SupabaseRequests/warehouse-webapp-api/beginSort.ts","../../../projects/web-app/src/data/SupabaseRequests/warehouse-webapp-api/fetchOSDCount.ts","../../../projects/web-app/src/data/SupabaseRequests/warehouse-webapp-api/fetchShipperLoads.ts","../../../projects/web-app/src/data/SupabaseRequests/warehouse-webapp-api/resolveDamaged.ts","../../../projects/web-app/src/data/SupabaseRequests/warehouse-webapp-api/fetchScannedShipments.ts","../../../projects/web-app/src/data/SupabaseRequests/warehouse-webapp-api/fetchCarrierLoads.ts","../../../projects/web-app/src/data/SupabaseRequests/warehouse-webapp-api/uploadASN.ts","../../../projects/web-app/src/data/SupabaseRequests/warehouse-webapp-api/createStops.ts","../../../projects/web-app/src/pages/warehouse/Shared/os&d_view/OsdPillMini.tsx","../../../projects/web-app/src/pages/warehouse/Shared/os&d_view/OSDWidget.tsx","../../../projects/web-app/src/pages/warehouse/Shared/os&d_view/OsdPill.tsx","../../../projects/web-app/src/pages/warehouse/Shared/os&d_view/OsdListView.tsx","../../../projects/web-app/src/pages/warehouse/Shared/os&d_view/OS&DContainer.tsx","../../../projects/web-app/src/pages/warehouse/WarehouseURLContext.tsx","../../../projects/web-app/src/pages/warehouse/CarrierWarehouse/LoadCardView.tsx","../../../projects/web-app/src/pages/warehouse/Shared/LoadHeader.tsx","../../../projects/web-app/src/pages/warehouse/CarrierWarehouse/VertainerLeftCarrier.tsx","../../../projects/web-app/src/pages/warehouse/ShipperWarehouse/RightVertainer/LoadScanReport.tsx","../../../projects/web-app/src/common/functions/dateString.ts","../../../projects/web-app/src/pages/warehouse/CarrierWarehouse/ScannedShipmentsTable.tsx","../../../projects/web-app/src/pages/warehouse/CarrierWarehouse/ScannedShipmentsContent.tsx","../../../projects/web-app/src/pages/warehouse/CarrierWarehouse/DetailedLoadViews/LoadShipments.tsx","../../../projects/web-app/src/components/primitives/Menubar.tsx","../../../projects/web-app/src/components/primitives/Command.tsx","../../../projects/web-app/src/pages/warehouse/Shared/os&d_view/mutations/updateOverageExceptions.ts","../../../projects/web-app/src/pages/warehouse/FactoryFunctions/fetchStores.ts","../../../projects/web-app/src/pages/warehouse/Shared/os&d_view/osnd_table/OverageStoreSelector.tsx","../../../projects/web-app/src/pages/warehouse/Shared/os&d_view/osnd_table/OverageResolutions.tsx","../../../projects/web-app/src/pages/warehouse/Shared/os&d_view/mutations/updateMissingExceptions.ts","../../../projects/web-app/src/pages/warehouse/Shared/os&d_view/osnd_table/MissingResolutions.tsx","../../../projects/web-app/src/pages/warehouse/Shared/os&d_view/mutations/updateDamagedExceptions.ts","../../../projects/web-app/src/pages/warehouse/Shared/os&d_view/osnd_table/DamagedResolutions.tsx","../../../projects/web-app/src/pages/warehouse/Shared/os&d_view/osnd_table/CarrierShipmentRow.tsx","../../../projects/web-app/src/pages/warehouse/Shared/os&d_view/osnd_table/ShipperShipmentRow.tsx","../../../projects/web-app/src/pages/warehouse/FactoryFunctions/fetchOSDByType.ts","../../../projects/web-app/src/pages/warehouse/Shared/os&d_view/osnd_table/OSDTable.tsx","../../../projects/web-app/src/pages/warehouse/CarrierWarehouse/functions/updateLoadState.ts","../../../projects/web-app/src/pages/warehouse/_models.ts","../../../projects/web-app/src/pages/warehouse/Shared/CompleteLoad/MissingRow.tsx","../../../projects/web-app/src/pages/warehouse/Shared/CompleteLoad/MissingShipments.tsx","../../../projects/web-app/src/pages/warehouse/Shared/CompleteLoad/UnresolvedExceptionRow.tsx","../../../projects/web-app/src/pages/warehouse/Shared/CompleteLoad/UnresolvedExceptionHeader.tsx","../../../projects/web-app/src/pages/warehouse/FactoryFunctions/fetchUnresolvedOSNDShipments.ts","../../../projects/web-app/src/pages/warehouse/Shared/CompleteLoad/CompleteSort.tsx","../../../projects/web-app/src/pages/warehouse/Shared/LoadArrivedForm.tsx","../../../projects/web-app/src/pages/warehouse/CarrierWarehouse/CarrierLoadDataContainer.tsx","../../../projects/web-app/src/pages/warehouse/FactoryFunctions/fetchCarrierLoads.ts","../../../projects/web-app/src/pages/warehouse/CarrierWarehouse/CarrierWarehouse.tsx","../../../projects/web-app/src/pages/warehouse/ShipperWarehouse/LeftVertainer/LeftLoadCard.tsx","../../../projects/web-app/src/pages/warehouse/ShipperWarehouse/LeftVertainer/ShipperVertainerLeft.tsx","../../../projects/web-app/src/pages/warehouse/ShipperWarehouse/RightVertainer/ShipperLoadDataContainer.tsx","../../../projects/web-app/src/pages/warehouse/FactoryFunctions/fetchShipperLoads.ts","../../../projects/web-app/src/pages/warehouse/ShipperWarehouse/RightVertainer/UploadASN/UploadAsnContext.tsx","../../../projects/web-app/src/components/primitives/Select.tsx","../../../projects/web-app/src/pages/warehouse/ShipperWarehouse/RightVertainer/UploadASN/UploadFile.tsx","../../../projects/web-app/src/pages/warehouse/ShipperWarehouse/RightVertainer/UploadASN/AddTemplate.tsx","../../../projects/web-app/src/pages/warehouse/ShipperWarehouse/RightVertainer/UploadASN/UploadInvalidTemplate.tsx","../../../projects/web-app/src/pages/warehouse/ShipperWarehouse/RightVertainer/UploadASN/TemplateView.tsx","../../../projects/web-app/src/pages/warehouse/ShipperWarehouse/RightVertainer/UploadASN/DisplayErrorsAndUpload.tsx","../../../projects/web-app/src/pages/warehouse/ShipperWarehouse/RightVertainer/UploadASN/DisplayASNVerificationErrors.tsx","../../../projects/web-app/src/pages/warehouse/ShipperWarehouse/RightVertainer/UploadASN/UploadASN.tsx","../../../projects/web-app/src/pages/warehouse/ShipperWarehouse/ShipperWarehouse.tsx","../../../projects/web-app/src/pages/warehouse/WarehousePage.tsx","../../../projects/web-app/src/pages/station/StationURLContext.tsx","../../../projects/web-app/src/components/primitives/Tabs.tsx","../../../projects/web-app/src/data/SupabaseRequests/stations-api/getStationUsers.ts","../../../projects/web-app/src/data/permissions.ts","../../../projects/web-app/src/components/Password.tsx","../../../projects/web-app/src/data/SupabaseRequests/stations-api/inviteUsername.ts","../../../projects/web-app/src/data/SupabaseRequests/stations-api/removeUserFromStation.ts","../../../projects/web-app/src/data/SupabaseRequests/webapp-api/inviteUser.ts","../../../projects/web-app/src/pages/station/SelectedStation/tab/Users/mutations/addOrRemoveUserMutation.tsx","../../../projects/web-app/src/pages/station/SelectedStation/tab/Users/AddUserRow.tsx","../../../projects/web-app/src/data/SupabaseRequests/stations-api/updateUserPermission.ts","../../../projects/web-app/src/pages/station/SelectedStation/tab/Users/mutations/addOrRemoveUserPermissionMutation.tsx","../../../projects/web-app/src/pages/station/SelectedStation/tab/Users/Dropdown/ChangePermissions.tsx","../../../projects/web-app/src/data/SupabaseRequests/stations-api/changePassword.ts","../../../projects/web-app/src/pages/station/SelectedStation/tab/Users/Dropdown/ResetPassword.tsx","../../../projects/web-app/src/data/SupabaseRequests/stations-api/resendOtpEmail.ts","../../../projects/web-app/src/pages/station/SelectedStation/tab/Users/UserRow.tsx","../../../projects/web-app/src/pages/station/SelectedStation/tab/Users/StationUsers.tsx","../../../projects/web-app/src/data/SupabaseRequests/stations-api/getStores.ts","../../../projects/web-app/src/pages/station/SelectedStation/tab/Stores/StationStores.tsx","../../../projects/web-app/src/data/SupabaseRequests/stations-api/getRegions.ts","../../../projects/web-app/src/pages/station/SelectedStation/tab/Regions/RegionOptionsMenu.tsx","../../../projects/web-app/src/data/SupabaseRequests/stations-api/getDestinationStations.ts","../../../projects/web-app/src/data/SupabaseRequests/stations-api/updateRegion.ts","../../../projects/web-app/src/data/SupabaseRequests/stations-api/addRegion.ts","../../../projects/web-app/src/pages/station/SelectedStation/tab/Regions/RegionCard.tsx","../../../projects/web-app/src/pages/station/SelectedStation/tab/Regions/RegionList.tsx","../../../projects/web-app/src/data/SupabaseRequests/stations-api/getStoresByRegion.ts","../../../projects/web-app/src/pages/station/SelectedStation/tab/Regions/StoreOptionsMenu.tsx","../../../projects/web-app/src/pages/station/SelectedStation/tab/Regions/StoreCard.tsx","../../../projects/web-app/src/pages/station/SelectedStation/tab/Regions/RegionStores.tsx","../../../projects/web-app/src/data/SupabaseRequests/stations-api/uploadStores.ts","../../../projects/web-app/src/pages/station/SelectedStation/tab/Regions/UploadStores/PreviewStores.tsx","../../../projects/web-app/src/pages/station/SelectedStation/tab/Regions/UploadStores/UploadDropzone.tsx","../../../projects/web-app/src/pages/station/SelectedStation/tab/Regions/UploadStores/ErrorList.tsx","../../../projects/web-app/src/pages/station/SelectedStation/tab/Regions/UploadStores/_models.ts","../../../projects/web-app/src/pages/station/SelectedStation/tab/Regions/UploadStores/MappingForm.tsx","../../../projects/web-app/src/pages/station/SelectedStation/tab/Regions/UploadStores/UploadStoresModalMain.tsx","../../../projects/web-app/src/pages/station/SelectedStation/tab/Regions/UploadStores/UploadStoresModal.tsx","../../../projects/web-app/src/pages/station/SelectedStation/tab/Regions/StationRegions.tsx","../../../projects/web-app/src/data/SupabaseRequests/stations-api/getStationInfo.ts","../../../projects/web-app/src/pages/station/SelectedStation/SelectedStationPage.tsx","../../../projects/web-app/src/data/SupabaseRequests/stations-api/getStationsLatLong.ts","../../../projects/web-app/src/data/SupabaseRequests/stations-api/getShipperStationPinsAndInfo.ts","../../../projects/web-app/src/components/map-features/helpers/getCenter.ts","../../../projects/web-app/src/components/map-features/helpers/jarvisMarch.ts","../../../projects/web-app/src/pages/station/functions/getPolygon.ts","../../../projects/web-app/src/components/map-features/helpers/isPointInPolygon.ts","../../../projects/web-app/src/common/types/parseMapboxEvent.ts","../../../projects/web-app/src/pages/station/NewStationForm.tsx","../../../projects/web-app/src/data/SupabaseRequests/stations-api/uploadStation.ts","../../../projects/web-app/src/pages/station/mutations.tsx","../../../projects/web-app/src/components/primitives/RadioGroup.tsx","../../../projects/web-app/src/pages/station/NewStoreForm.tsx","../../../projects/web-app/src/components/map-features/helpers/calculateDistance.ts","../../../projects/web-app/src/pages/station/ShipperMap.tsx","../../../projects/web-app/src/data/SupabaseRequests/stations-api/getCarrierStationPinsAndInfo.ts","../../../projects/web-app/src/pages/station/CarrierMap.tsx","../../../projects/web-app/src/pages/station/StationPage.tsx","../../../projects/web-app/src/pages/station/StationPageWrapper.tsx","../../../projects/web-app/src/data/SupabaseRequests/claims-api/getClaimableShipments.ts","../../../projects/web-app/src/pages/claims/ClaimsPage.tsx","../../../projects/web-app/src/pages/analytics/useAnalyticsURL.tsx","../../../projects/web-app/src/pages/analytics/StoreMarker.tsx","../../../projects/web-app/src/pages/analytics/StationPin.tsx","../../../projects/web-app/src/pages/analytics/mapFunctions/geoJsonUtils.ts","../../../projects/web-app/src/data/SupabaseRequests/analytics-api/getCoords.ts","../../../projects/web-app/src/pages/analytics/getCoordsWrapper.ts","../../../projects/web-app/src/data/SupabaseRequests/analytics-api/getStoreCoords.ts","../../../projects/web-app/src/pages/analytics/AnalyticsMap.tsx","../../../projects/web-app/src/pages/analytics/graphs/_helpers.ts","../../../projects/web-app/src/pages/analytics/graphs/DeliveriesGraph.tsx","../../../projects/web-app/src/pages/analytics/graphs/MissingPercentageGraph.tsx","../../../projects/web-app/src/pages/analytics/graphs/OveragePercentageGraph.tsx","../../../projects/web-app/src/pages/analytics/graphs/GraphsContainer.tsx","../../../projects/web-app/src/pages/analytics/graphs/GraphToolbar.tsx","../../../projects/web-app/src/pages/analytics/AnalyticsPage.tsx","../../../projects/web-app/src/pages/analytics/AnalyticsPageWrapper.tsx","../../../projects/web-app/src/pages/auth/CreateForgottenPassword.tsx","../../../projects/web-app/src/pages/pallets/PalletsPDF.tsx","../../../projects/web-app/src/pages/pallets/PalletPrinting.tsx","../../../projects/web-app/src/PrivateRoutes.tsx","../../../projects/web-app/src/data/SupabaseRequests/webapp-api/signupUser.ts","../../../projects/web-app/src/pages/public/UserSignup.tsx","../../../projects/web-app/src/data/OldSupabaseRequests/carrierSignup.ts","../../../projects/web-app/src/pages/public/CarrierSignupPage.tsx","../../../projects/web-app/src/pages/public/PrivacyPolicyBody.tsx","../../../projects/web-app/src/pages/public/PrivacyPolicy.tsx","../../../projects/web-app/src/App.tsx","../../../projects/web-app/src/main.tsx"],"sourcesContent":["import { AuthError } from '@supabase/supabase-js';\n\nexport function authErrorMessage(error: AuthError | null): string | null {\n if (error) {\n console.error(error);\n } else {\n return null;\n }\n\n switch (error?.message) {\n case 'Invalid login credentials':\n return 'Wrong email or password';\n\n case 'Email not confirmed':\n return 'Email address not confirmed';\n\n default:\n return error?.message || 'An unknown error occurred';\n }\n}\n","import { createClient } from '@supabase/supabase-js';\n\nexport const supabaseURL = import.meta.env.VITE_SUPABASE_URL as string;\nexport const supabaseKey = import.meta.env.VITE_SUPABASE_KEY as string;\n\nexport const supabase = createClient(supabaseURL, supabaseKey);\n","import { supabase } from \"../../supabase\";\n\n// To regenerate this file, run the CLI command `deno run --allow-read --allow-write --allow-sys schema_to_ts.ts`. The script is located in the supabase-functions directory.\n\n\n/**\n * This interface was referenced by `Interface`'s JSON-Schema\n * via the `definition` \"getUserDataParams\".\n */\nexport interface GetUserDataParams {\n function: \"get-user-data\";\n}\n/**\n * This interface was referenced by `Interface`'s JSON-Schema\n * via the `definition` \"getUserDataResponse\".\n */\nexport interface GetUserDataResponse {\n user: {\n id: string;\n email: string;\n name: string;\n org_type: \"shipper\" | \"carrier\";\n };\n permissions: (\n | \"super-admin\"\n | \"admin\"\n | \"warehouse-app\"\n | \"driver-app\"\n | \"dispatch\"\n | \"warehouse\"\n | \"reports\"\n | \"webapp\"\n | \"stations\"\n )[];\n stations: string[];\n}\n\n\nexport async function getUserData(\n params: Omit,\n){\n try {\n const result = await supabase.functions.invoke( \n 'webapp-api',\n { body: { ...params, function: 'get-user-data' }},\n );\n\n if (!result.error && result.data) {\n return result.data;\n } else if (result.error) {\n throw new Error(\"Error Fetching Result in webapp-api/getUserData:\" + result.error);\n } else {\n throw new Error('Unknown error: result does not contain data or error.');\n }\n } catch (error) {\n console.error('Error:', error);\n throw error;\n }\n}\n","import React, {\n ReactNode,\n createContext,\n useContext,\n useEffect,\n useState,\n} from 'react';\n\nimport { authErrorMessage } from '@/lib/supabase-errors';\nimport { supabase } from './supabase';\nimport { Permissions, UserInformation } from './_models';\nimport { getUserData } from './SupabaseRequests/webapp-api/getUserData';\nimport { Permission } from './permissions';\nimport { User } from './_models';\n\ntype AuthContextProps = {\n /**\n * undefined: auth state unknown\n *\n * null: not signed in\n */\n permissions: Permissions;\n stations: string[];\n user: UserInformation | null;\n loading: boolean;\n};\n\n/**\n *\n */\nconst AuthContext = createContext({\n loading: true,\n permissions: { permissions: [], hasPermission: () => false },\n stations: [],\n user: null,\n});\n\nexport const useAuth = () => useContext(AuthContext);\n\n/**\n *\n * @param param0\n * @returns\n */\nexport function AuthProvider({ children }: { children: ReactNode }) {\n const [loading, setLoading] = useState(true);\n const [user, setUser] = useState({\n permissions: { permissions: [], hasPermission: () => false },\n user: null,\n stations: [],\n });\n\n useEffect(() => {\n supabase.auth.getSession().then(async ({ error, data }) => {\n if (error) console.error('Error getting session:', error);\n if (data.session?.user) {\n await updateUserState();\n }\n setLoading(false);\n });\n\n const {\n data: { subscription },\n } = supabase.auth.onAuthStateChange((_event, session) => {\n if (session?.user) {\n updateUserState();\n } else {\n resetUserState();\n }\n });\n\n return subscription.unsubscribe;\n }, []);\n\n async function updateUserState() {\n const dbUserData = await getUserData({});\n\n setUser({\n permissions: {\n permissions: dbUserData.permissions,\n hasPermission: (requiredPermissions: Permission[]) =>\n hasPermissionHelper(dbUserData.permissions, requiredPermissions),\n },\n user: dbUserData.user,\n stations: dbUserData.stations,\n });\n }\n\n function resetUserState() {\n setUser({\n permissions: { permissions: [], hasPermission: () => false },\n user: null,\n stations: [],\n });\n }\n\n return (\n \n {children}\n \n );\n}\n\n/**\n *\n * @param email\n * @returns\n */\nexport const sendPasswordResetEmail = async (email: string) => {\n const { error } = await supabase.auth.resetPasswordForEmail(email, {\n redirectTo: 'https://lucidity.lu.app/reset-password',\n });\n\n if (error) {\n return authErrorMessage(error);\n }\n return null;\n};\n\n/**\n *\n * @param password\n * @returns\n */\nexport const updatePassword = async (password: string) => {\n const { error } = await supabase.auth.updateUser({ password });\n\n if (error) {\n return authErrorMessage(error);\n }\n return null;\n};\n\nconst hasPermissionHelper = (\n userPermissions: Permission[],\n requiredPermissions: Permission[],\n) => {\n if (\n userPermissions.includes('super-admin') ||\n userPermissions.includes('admin')\n ) {\n return true;\n }\n return userPermissions.some((permission) =>\n requiredPermissions.includes(permission),\n );\n};\n","import { clsx, type ClassValue } from 'clsx';\nimport { twMerge } from 'tailwind-merge';\n\nconst TWENTY_FOUR_HOURS = 24;\nconst SECONDS = 60;\nconst MINUTES = 60;\nconst DAYS = 6;\nconst MILLISECONDS = 1000;\n\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n\n/**\n * \n * @param date \n * @returns \n */\nexport function getWeekStartAndEnd(date: Date) {\n const day = date.getDay();\n\n const start = new Date(date.getTime() - day * TWENTY_FOUR_HOURS * MINUTES * SECONDS * MILLISECONDS);\n const end = new Date(start.getTime() + DAYS * TWENTY_FOUR_HOURS * MINUTES * SECONDS * MILLISECONDS);\n\n return [start, end];\n}\n","import * as React from 'react';\n\nimport { cn } from '@/lib/utils';\n\nconst Card = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes\n>(({ className, ...props }, ref) => (\n \n));\nCard.displayName = 'Card';\n\nconst CardHeader = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes\n>(({ className, ...props }, ref) => (\n \n));\nCardHeader.displayName = 'CardHeader';\n\nconst CardTitleClassname = 'text-lg font-semibold leading-none tracking-tight';\nconst CardTitle = React.forwardRef<\n HTMLParagraphElement,\n React.HTMLAttributes\n>(({ className, ...props }, ref) => (\n

\n {props.children}\n

\n));\nCardTitle.displayName = 'CardTitle';\n\nconst CardDescription = React.forwardRef<\n HTMLParagraphElement,\n React.HTMLAttributes\n>(({ className, ...props }, ref) => (\n \n));\nCardDescription.displayName = 'CardDescription';\n\nconst CardContent = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes\n>(({ className, ...props }, ref) => (\n
\n));\nCardContent.displayName = 'CardContent';\n\nconst CardFooter = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes\n>(({ className, ...props }, ref) => (\n \n));\nCardFooter.displayName = 'CardFooter';\n\nexport {\n Card,\n CardHeader,\n CardFooter,\n CardTitle,\n CardTitleClassname,\n CardDescription,\n CardContent,\n};\n","import { AuthError } from '@supabase/supabase-js';\nimport { supabase } from './supabase';\n\nlet handleExpiredSession: () => void | null;\n\ntype AuthService = {\n login: (email: string, password: string) => Promise;\n logout: () => Promise;\n refreshSession: () => Promise;\n setHandleExpiredSession: (handler: () => void | null) => void;\n};\n\nconst SupabaseAuthService: AuthService = {\n login: async (email: string, password: string) => {\n try {\n const { error } = await supabase.auth.signInWithPassword({\n email,\n password,\n });\n if (error) {\n return error;\n }\n } catch (e) {\n console.error(e);\n }\n },\n logout: async () => {\n try {\n const { error } = await supabase.auth.signOut();\n if (error) {\n console.error('unable to signout: ', error);\n await supabase.auth.refreshSession();\n }\n } catch (e) {\n console.log('An unknown error occurred');\n }\n },\n refreshSession: async () => {\n try {\n const data = await supabase.auth.refreshSession();\n if (data.error) {\n handleExpiredSession();\n return false;\n }\n return true;\n } catch (error) {\n handleExpiredSession(); \n return false;\n }\n },\n setHandleExpiredSession: (handler) => handleExpiredSession = handler,\n\n} as const;\n\nexport const AuthService: AuthService = SupabaseAuthService;\n","import * as React from 'react';\nimport { Slot } from '@radix-ui/react-slot';\nimport { cva, type VariantProps } from 'class-variance-authority';\n\nimport { cn } from '@/lib/utils';\nimport { Loader2 } from 'lucide-react';\n\nconst buttonVariants = cva(\n 'inline-flex items-center justify-center rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:opacity-50 disabled:pointer-events-none ring-offset-background',\n {\n variants: {\n variant: {\n // default: 'bg-lupurple text-primary-foreground hover:bg-lupurple-dark',\n default:\n 'bg-lupurple text-white hover:bg-lupurple-medium shadow-button active:shadow-button-pressed active:bg-lupurple-dark',\n destructive:\n 'bg-destructive text-destructive-foreground hover:bg-destructive/90 shadow-button active:shadow-button-pressed active:bg-lupurple-dark',\n outline:\n 'border border-input hover:bg-accent hover:text-accent-foreground shadow-button active:shadow-button-pressed active:bg-lupurple-dark',\n secondary:\n 'bg-lupurple-medium text-card-foreground hover:bg-lupurple-light shadow-button active:shadow-button-pressed active:bg-lupurple-dark shadow-button active:shadow-button-pressed active:bg-lupurple-dark',\n tertiary: 'text-primary hover:text-accent', // TODO: Add tertiary variant\n ghost:\n 'hover:bg-accent hover:text-accent-foreground shadow-button active:shadow-button-pressed active:bg-lupurple-dark',\n link: 'underline-offset-4 hover:underline text-primary',\n cancel: 'bg-lupurple-lighter hover:bg-lupurple-light ',\n },\n size: {\n default: 'h-10 py-2 px-4',\n sm: 'h-9 px-3 rounded-md',\n lg: 'h-11 px-8 rounded-md',\n xl: 'h-18 px-10 rounded-md',\n },\n },\n defaultVariants: {\n variant: 'default',\n size: 'default',\n },\n },\n);\n\nexport interface ButtonProps\n extends React.ButtonHTMLAttributes,\n VariantProps {\n asChild?: boolean;\n loading?: boolean;\n}\n\nconst Loading = () => (\n \n \n \n);\n\nconst Button = React.forwardRef(\n (\n {\n className,\n variant,\n size,\n asChild = false,\n loading,\n children,\n disabled,\n ...props\n },\n ref,\n ) => {\n const Comp = asChild ? Slot : 'button';\n return (\n \n {children}\n {loading && }\n \n }\n {...props}\n />\n );\n },\n);\nButton.displayName = 'Button';\n\nexport { Button, buttonVariants };\n","'use client';\n\nimport * as React from 'react';\nimport * as LabelPrimitive from '@radix-ui/react-label';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { cn } from '@/lib/utils';\n\nconst labelVariants = cva(\n 'text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70'\n);\n\nconst Label = React.forwardRef<\n React.ElementRef,\n React.ComponentPropsWithoutRef &\n VariantProps\n>(({ className, ...props }, ref) => (\n \n));\nLabel.displayName = LabelPrimitive.Root.displayName;\n\nexport { Label };\n","import * as React from 'react';\nimport * as LabelPrimitive from '@radix-ui/react-label';\nimport { Slot } from '@radix-ui/react-slot';\nimport {\n Controller,\n ControllerProps,\n FieldPath,\n FieldValues,\n FormProvider,\n useFormContext,\n} from 'react-hook-form';\n\nimport { cn } from '@/lib/utils';\nimport { Label } from '@/components/primitives/Label';\n\nconst Form = FormProvider;\n\ntype FormFieldContextValue<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath = FieldPath\n> = {\n name: TName;\n};\n\nconst FormFieldContext = React.createContext(\n {} as FormFieldContextValue\n);\n\nconst FormField = <\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath = FieldPath\n>({\n ...props\n}: ControllerProps) => {\n return (\n \n \n \n );\n};\n\nconst useFormField = () => {\n const fieldContext = React.useContext(FormFieldContext);\n const itemContext = React.useContext(FormItemContext);\n const { getFieldState, formState } = useFormContext();\n\n const fieldState = getFieldState(fieldContext.name, formState);\n\n if (!fieldContext) {\n throw new Error('useFormField should be used within ');\n }\n\n const { id } = itemContext;\n\n return {\n id,\n name: fieldContext.name,\n formItemId: `${id}-form-item`,\n formDescriptionId: `${id}-form-item-description`,\n formMessageId: `${id}-form-item-message`,\n ...fieldState,\n };\n};\n\ntype FormItemContextValue = {\n id: string;\n};\n\nconst FormItemContext = React.createContext(\n {} as FormItemContextValue\n);\n\nconst FormItem = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes\n>(({ className, ...props }, ref) => {\n const id = React.useId();\n\n return (\n \n
\n \n );\n});\nFormItem.displayName = 'FormItem';\n\nconst FormLabel = React.forwardRef<\n React.ElementRef,\n React.ComponentPropsWithoutRef\n>(({ className, ...props }, ref) => {\n const { error, formItemId } = useFormField();\n\n return (\n \n );\n});\nFormLabel.displayName = 'FormLabel';\n\nconst FormControl = React.forwardRef<\n React.ElementRef,\n React.ComponentPropsWithoutRef\n>(({ ...props }, ref) => {\n const { error, formItemId, formDescriptionId, formMessageId } =\n useFormField();\n\n return (\n \n );\n});\nFormControl.displayName = 'FormControl';\n\nconst FormDescription = React.forwardRef<\n HTMLParagraphElement,\n React.HTMLAttributes\n>(({ className, ...props }, ref) => {\n const { formDescriptionId } = useFormField();\n\n return (\n \n );\n});\nFormDescription.displayName = 'FormDescription';\n\nconst FormMessage = React.forwardRef<\n HTMLParagraphElement,\n React.HTMLAttributes\n>(({ className, children, ...props }, ref) => {\n const { error, formMessageId } = useFormField();\n const body = error ? String(error?.message) : children;\n\n if (!body) {\n return null;\n }\n\n return (\n \n {body}\n

\n );\n});\nFormMessage.displayName = 'FormMessage';\n\nconst FormRootError = React.forwardRef<\n HTMLParagraphElement,\n React.HTMLAttributes\n>(({ className, children, ...props }, ref) => {\n const {\n formState: {\n errors: { root },\n },\n } = useFormContext();\n const body = root ? String(root?.message) : children;\n\n if (!body) {\n return null;\n }\n\n return (\n \n {body}\n

\n );\n});\nFormRootError.displayName = 'FormRootError';\n\nexport {\n useFormField,\n Form,\n FormItem,\n FormLabel,\n FormControl,\n FormDescription,\n FormMessage,\n FormRootError,\n FormField,\n};\n","import * as React from 'react';\n\nimport { cn } from '@/lib/utils';\n\nexport type InputProps = React.InputHTMLAttributes & {\n label?: string;\n labeldir?: 'vertical' | 'horizontal';\n disabled_opac?: number; //This is used for organization address book\n};\n\nexport const InputClassName = `h-10 w-full rounded-md border border-input bg-transparent px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed `;\n\nconst Input = React.forwardRef(\n ({ className, ...props }, ref) => {\n return (\n \n {props.label && }\n \n
\n );\n }\n);\nInput.displayName = 'Input';\n\nexport { Input };\n","import React from 'react';\nimport { Link, useLocation } from 'react-router-dom';\nimport { useForm } from 'react-hook-form';\n\nimport * as z from 'zod';\nimport { zodResolver } from '@hookform/resolvers/zod';\n\nimport { AuthService } from '@/data/AuthService';\n\nimport { Button } from '@/components/primitives/Button';\nimport {\n Form,\n FormControl,\n FormField,\n FormItem,\n FormLabel,\n FormMessage,\n FormRootError,\n} from '@/components/primitives/Form';\nimport { Input } from '@/components/primitives/Input';\nimport {\n CardContent,\n CardFooter,\n CardTitle,\n} from '@/components/primitives/Card';\nimport { EyeIcon } from 'lucide-react';\nimport { AuthError } from '@supabase/supabase-js';\n\nconst formSchema = z.object({\n email: z.string(),\n password: z.string(),\n});\n\nexport function SignInForm() {\n const [showPassword, setShowPassword] = React.useState(false);\n const [error, setError] = React.useState(null);\n\n const togglePassword = () => {\n setShowPassword((prev) => !prev);\n };\n const { search } = useLocation();\n\n const params = new URLSearchParams(search);\n\n const form = useForm>({\n resolver: zodResolver(formSchema),\n defaultValues: {\n email: params.get('email') ?? '',\n password: '',\n },\n });\n\n async function onSubmit(data: z.infer) {\n if (!data.email.includes('@')) {\n const username = data.email + '@lucidityusername.com';\n const error = await AuthService.login(username, data.password);\n if (error) {\n setError(error);\n }\n } else {\n const error = await AuthService.login(data.email, data.password);\n if (error) {\n setError(error);\n }\n }\n }\n\n return (\n
\n Sign In\n\n \n \n \n (\n \n Email\n \n \n \n \n \n )}\n />\n (\n \n Password\n \n
\n \n {form.getValues('password').length > 0 && (\n \n )}\n
\n
\n \n
\n )}\n />\n\n \n \n Forgot password?\n \n \n
\n\n \n {error && {error.message}}\n \n \n
\n \n );\n}\n","import React from 'react';\n\nimport * as z from 'zod';\nimport { zodResolver } from '@hookform/resolvers/zod';\nimport { useForm } from 'react-hook-form';\n\nimport { useAuth } from '@/data/auth';\nimport { Button } from '@/components/primitives/Button';\nimport {\n Form,\n FormControl,\n FormField,\n FormItem,\n FormLabel,\n FormMessage,\n FormRootError,\n} from '@/components/primitives/Form';\nimport { Input } from '@/components/primitives/Input';\nimport {\n CardContent,\n CardDescription,\n CardFooter,\n CardHeader,\n CardTitle,\n} from '@/components/primitives/Card';\nimport { Link, Navigate, useLocation } from 'react-router-dom';\nimport { signupUser } from '@/data/SupabaseRequests/webapp-api/signupUser';\n\nconst formSchema = z\n .object({\n email: z.string().email(),\n password: z.string(),\n confirmPassword: z.string(),\n })\n .refine((data) => data.password === data.confirmPassword, {\n message: \"Passwords don't match\",\n path: ['confirmPassword'], // path of error\n });\n\nexport function CreateAccountForm() {\n const { search } = useLocation();\n const params = new URLSearchParams(search);\n const emailParam = params.get('email');\n const orgIdParam = params.get('orgId');\n\n const form = useForm>({\n resolver: zodResolver(formSchema),\n defaultValues: {\n email: emailParam ?? '',\n password: '',\n confirmPassword: '',\n },\n });\n\n // get rid of this when users can create their own organizations\n if (!orgIdParam) {\n return ;\n }\n\n async function onSubmit(data: z.infer) {\n // await signupUser({\n // id: '',\n // email: data.email,\n // password: data.password,\n // orgId: orgIdParam,\n // firstName: '',\n // lastName: '',\n // })\n // if (error) {\n // form.setError('root', {\n // type: 'custom',\n // message: error,\n // });\n // }\n }\n\n return (\n
\n \n Create Account\n \n Already have an account?\n \n \n \n\n \n \n \n (\n \n Email\n \n \n \n \n \n )}\n />\n (\n \n Password\n \n \n \n \n \n )}\n />\n (\n \n Confirm Password\n \n \n \n \n \n )}\n />\n \n\n \n \n \n
\n \n );\n}\n","import React from 'react';\n\nimport * as z from 'zod';\nimport { zodResolver } from '@hookform/resolvers/zod';\nimport { useForm } from 'react-hook-form';\nimport { useAuth } from '@/data/auth';\n\nimport { Button } from '@/components/primitives/Button';\nimport {\n Form,\n FormControl,\n FormField,\n FormItem,\n FormLabel,\n FormMessage,\n FormRootError,\n} from '@/components/primitives/Form';\nimport { Input } from '@/components/primitives/Input';\nimport {\n CardContent,\n CardDescription,\n CardFooter,\n CardHeader,\n CardTitle,\n} from '@/components/primitives/Card';\nimport { Link } from 'react-router-dom';\n\nconst formSchema = z\n .object({\n email: z.string().email(),\n password: z.string(),\n confirmPassword: z.string(),\n })\n .refine((data) => data.password === data.confirmPassword, {\n message: \"Passwords don't match\",\n path: ['confirmPassword'], // path of error\n });\n\nexport function CreateOrganizationForm() {\n const form = useForm>({\n resolver: zodResolver(formSchema),\n defaultValues: {\n email: '',\n password: '',\n confirmPassword: '',\n },\n });\n\n //const { signup } = useAuth();\n\n async function onSubmit(data: z.infer) {\n const error = ''; //removing errors\n if (error) {\n form.setError('root', {\n type: 'custom',\n message: error,\n });\n }\n }\n\n return (\n
\n \n Add Organization\n \n \n \n \n\n \n \n \n (\n \n Email\n \n \n \n \n \n )}\n />\n (\n \n Password\n \n \n \n \n \n )}\n />\n (\n \n Confirm Password\n \n \n \n \n \n )}\n />\n \n\n \n \n \n
\n \n );\n}\n","import React, { useState } from 'react';\nimport { Link, useLocation } from 'react-router-dom';\nimport { useForm } from 'react-hook-form';\nimport * as z from 'zod';\n\nimport { Button } from '@/components/primitives/Button';\nimport {\n CardContent,\n CardDescription,\n CardFooter,\n CardHeader,\n CardTitle,\n} from '@/components/primitives/Card';\nimport { zodResolver } from '@hookform/resolvers/zod';\n\nimport { sendPasswordResetEmail } from '@/data/auth';\nimport {\n Form,\n FormControl,\n FormField,\n FormItem,\n FormLabel,\n FormMessage,\n FormRootError,\n} from '@/components/primitives/Form';\nimport { Input } from '@/components/primitives/Input';\n\nconst formSchema = z.object({\n email: z.string().email(),\n});\n\nexport function SendResetEmailForm() {\n const { search } = useLocation();\n\n const params = new URLSearchParams(search);\n const emailParam = params.get('email');\n\n const [emailSent, setEmailSent] = useState(false);\n\n const form = useForm>({\n resolver: zodResolver(formSchema),\n defaultValues: {\n email: emailParam ?? '',\n },\n });\n\n async function onSubmit(data: z.infer) {\n const error = await sendPasswordResetEmail(data.email);\n if (error) {\n form.setError('root', {\n type: 'custom',\n message: error,\n });\n } else {\n setEmailSent(true);\n }\n }\n\n if (emailSent) {\n return (\n <>\n \n Reset Password\n An email was sent to your inbox\n \n \n Check {form.getValues().email} for a password recovery email.\n \n \n \n \n \n );\n }\n\n return (\n
\n \n Reset Password\n\n \n Get a link to reset your password\n \n \n\n \n \n \n (\n \n Email\n \n \n \n \n \n )}\n />\n \n\n \n \n \n \n
\n \n );\n}\n","import React from 'react';\n\nimport {\n CardContent,\n CardFooter,\n CardHeader,\n CardTitle,\n} from '@/components/primitives/Card';\nimport { Button } from '@/components/primitives/Button';\nimport { Link } from 'react-router-dom';\n\nexport function EmailVerification() {\n return (\n <>\n \n Confirmation Email Sent\n \n \n

Check your email for a link to confirm your account creation.

\n
\n \n \n \n \n \n \n );\n}\n","import React from 'react';\nimport { Navigate, Outlet, Route, Routes } from 'react-router';\nimport { useAuth } from '../../data/auth';\nimport { Card } from '@/components/primitives/Card';\nimport { SignInForm } from './SignInForm';\nimport { CreateAccountForm } from './CreateAccountForm';\nimport { CreateOrganizationForm } from './CreateOrganizationForm';\nimport { SendResetEmailForm } from './SendResetEmailForm';\nimport { EmailVerification } from './EmailVerification';\n\nexport function AuthPage() {\n const auth = useAuth();\n\n if (auth.user) {\n return ;\n }\n\n const AuthCardWrapper = () => (\n
\n \n \n \n
\n );\n\n return (\n \n }>\n } />\n } />\n\n }\n />\n } />\n } />\n } />\n \n \n );\n}\n","export const EulaBody = () => (\n
\n End-User License Agreement\n\n

End-User License Agreement (EULA)

\n\n

Last Updated: 10/16/2024

\n
\n

\n Please read this End-User License Agreement (\"Agreement\") carefully before\n using Lu App (\"Software\") provided by Lucidity (\"Company\"). This Agreement\n sets forth the terms and conditions that govern your use of the Software.\n

\n
\n

\n By downloading, installing, or using the Software, you agree to be bound\n by the terms and conditions of this Agreement. If you do not agree to the\n terms of this Agreement, do not use the Software.\n

\n
\n

1. License Grant

\n
\n

\n The Company grants you a non-exclusive, non-transferable, limited license\n to use the Software solely for your personal or internal business\n purposes. This license does not grant you any ownership rights to the\n Software, and you may not modify, reverse engineer, decompile,\n disassemble, or create derivative works based on the Software.\n

\n
\n

2. Restrictions

\n
\n

\n You may not:
\n a. Rent, lease, lend, sell, sublicense, or distribute the Software to any\n third party.
\n b. Remove, alter, or obscure any proprietary notices or labels on the\n Software.
\n c. Use the Software in any manner that violates applicable laws or\n regulations.\n

\n
\n\n

3. Intellectual Property

\n
\n

\n The Software, including but not limited to any content, images, text, and\n logos, is protected by intellectual property laws and is owned by the\n Company. You acknowledge and agree that the Company retains all rights,\n title, and interest in the Software.\n

\n
\n\n

4. Warranty Disclaimer

\n
\n

\n The Software is provided \"as is\" without warranty of any kind, either\n express or implied, including, but not limited to, the implied warranties\n of merchantability, fitness for a particular purpose, or non-infringement.\n The Company does not warrant that the Software will be error-free or\n uninterrupted.\n

\n
\n\n

5. Limitation of Liability

\n
\n

\n To the extent permitted by law, in no event shall the Company be liable\n for any direct, indirect, incidental, special, consequential, or exemplary\n damages, including but not limited to, damages for loss of profits,\n goodwill, use, data, or other intangible losses arising out of or in\n connection with your use of the Software.\n

\n
\n

6. Termination

\n
\n

\n This Agreement is effective until terminated by you or the Company. The\n Company may terminate this Agreement at any time without notice if you\n fail to comply with any term or condition of this Agreement. Upon\n termination, you must cease all use of the Software and destroy any copies\n in your possession.\n

\n
\n\n

7. Governing Law

\n
\n

\n This Agreement shall be governed by and construed in accordance with the\n laws of Delaware. Any disputes arising under or in connection with this\n Agreement shall be subject to the exclusive jurisdiction of the state and\n federal courts located in Delaware.\n

\n
\n\n

8. Changes to Agreement

\n
\n

\n The Company reserves the right to modify this Agreement at any time. Any\n changes will be effective upon posting the updated Agreement on the\n Company's website or within the Software. Your continued use of the\n Software after any such changes shall constitute your consent to such\n changes.\n

\n
\n\n

9. Entire Agreement

\n
\n

\n This Agreement constitutes the entire agreement between you and the\n Company regarding the Software and supersedes all prior or contemporaneous\n agreements, understandings, and communications, whether oral or written.\n

\n
\n\n

\n By using the Software, you acknowledge that you have read and understood\n this Agreement and agree to be bound by its terms and conditions.\n

\n
\n\n

If you have any questions about this Agreement, please contact us at

\n
\n\n

Lucidity

\n
\n\n

Date of Last Update: 10/16/2024

\n
\n);\n","import {\n Card,\n CardContent,\n CardHeader,\n CardTitle,\n} from '@/components/primitives/Card';\nimport { EulaBody } from './EulaBody';\n\nexport const EulaPage = () => (\n
\n \n \n End-User License Agreement\n \n \n \n \n \n
\n);\n","export default \"__VITE_ASSET__ab211233__\"","import LucidityLogo from '@/assets/lucidity/logo.png';\nimport { cn } from '@/lib/utils';\nimport { Link } from 'react-router-dom';\n\nexport function Header() {\n return (\n \n
\n {' '}\n \n Lucidity\n

\n
\n \n );\n}\n","import { Permission } from '@/data/permissions';\nimport {\n WarehouseIcon,\n Building2Icon,\n GitPullRequest,\n LineChart,\n HomeIcon,\n PackageSearchIcon,\n BarChart,\n Clipboard,\n ScanText,\n} from 'lucide-react';\n\nconst ICON_SIZE = 25;\nconst ICON_STROKE = 1.5;\n\nexport type PageLink = {\n icon: React.ReactNode;\n pageName: { shipper: string; carrier: string };\n navPath: { shipper: string; carrier: string };\n possiblePermissions: Set;\n orgType?: 'shipper' | 'carrier';\n};\n\n/**\n * IMPORTANT: If you add a link to the array, make sure it populates to the permissions in the roles tab of the organization page\n * This is why we have the export, so don't delete it\n */\nexport const shipperSideBarItems: PageLink[] = [];\n\nexport const links: PageLink[] = [\n {\n icon: ,\n pageName: { shipper: 'Dashboard', carrier: 'Dashboard' },\n navPath: { shipper: 'home', carrier: 'home' },\n possiblePermissions: new Set([\n 'webapp',\n 'stations',\n 'dispatch',\n 'reports',\n 'warehouse',\n 'shipment-search',\n 'analytics',\n 'claims',\n ]),\n },\n {\n icon: ,\n pageName: { shipper: 'Distribution Centers', carrier: 'Stations' },\n navPath: { shipper: 'distribution-center', carrier: 'stations' },\n possiblePermissions: new Set(['stations']),\n },\n {\n icon: ,\n pageName: { shipper: 'Reports', carrier: 'Reports' },\n navPath: { shipper: 'reports', carrier: 'reports' },\n possiblePermissions: new Set(['reports']),\n },\n {\n icon: ,\n pageName: { shipper: 'Dispatch', carrier: 'Dispatch' },\n navPath: { shipper: 'dispatch', carrier: 'dispatch' },\n possiblePermissions: new Set(['dispatch']),\n orgType: 'carrier',\n },\n {\n icon: ,\n pageName: { shipper: 'Outbound Loads', carrier: 'Inbound' },\n navPath: { shipper: 'outbound', carrier: 'inbound' },\n possiblePermissions: new Set(['warehouse']),\n },\n {\n icon: ,\n pageName: { shipper: 'Shipment Search', carrier: 'Shipment Search' },\n navPath: { shipper: 'shipment_search', carrier: 'shipment_search' },\n possiblePermissions: new Set(['shipment-search']),\n },\n {\n icon: ,\n pageName: { shipper: 'Organization', carrier: 'Organization' },\n navPath: { shipper: 'organization', carrier: 'organization' },\n possiblePermissions: new Set(['admin']),\n },\n {\n icon: ,\n pageName: { shipper: 'Analytics', carrier: 'Analytics' },\n navPath: { shipper: 'analytics', carrier: 'analytics' },\n possiblePermissions: new Set(['analytics']),\n },\n {\n icon: ,\n pageName: { shipper: 'Claims', carrier: 'Claims' },\n navPath: { shipper: 'claims', carrier: 'claims' },\n possiblePermissions: new Set(['claims']),\n },\n {\n icon: ,\n pageName: { shipper: 'Pallet Printing', carrier: 'Pallet Printing' },\n navPath: { shipper: 'pallets', carrier: 'pallets' },\n possiblePermissions: new Set(['admin', 'warehouse']),\n orgType: 'carrier',\n },\n];\n","import { useLocation, useNavigate } from 'react-router-dom';\n\nimport { PageLink, links } from './PageLink';\nimport { useAuth } from '@/data/auth';\nimport { cn } from '@/lib/utils';\n\ntype Props = {\n permissions: string[] | undefined;\n};\n\nexport function NavLinks({ permissions }: Props) {\n //different styling for active\n const location = useLocation();\n const navigate = useNavigate();\n\n const { user } = useAuth();\n\n const org_type = user?.org_type;\n\n return (\n
\n {links.map((link) => {\n if (\n !hasPermission(permissions, link.possiblePermissions) ||\n !isType(org_type + '', link.orgType)\n ) {\n return
;\n }\n const activeLink = location.pathname.includes(\n org_type === 'carrier' ? link.navPath.carrier : link.navPath.shipper,\n );\n\n return (\n
{\n e.stopPropagation();\n navigate(\n org_type === 'carrier'\n ? link.navPath.carrier\n : link.navPath.shipper,\n );\n }}\n >\n
{link.icon}
\n\n
\n {getPageName(link, org_type + '')}\n
\n
\n );\n })}\n
\n );\n}\n\n/**different than user.hasPermission because you can have multiple permissions that unlock a page\n * We can later add this to user.hasPermission but I dont think its necessary\n */\nconst hasPermission = (\n userPermissions: string[] | undefined,\n requiredPermissions: Set,\n) => {\n if (\n userPermissions?.includes('super-admin') ||\n userPermissions?.includes('admin')\n ) {\n return true;\n }\n if (requiredPermissions.has('all')) {\n return true;\n }\n if (!userPermissions) {\n return false;\n }\n let ret = false;\n for (const permission of requiredPermissions) {\n if (userPermissions.includes(permission)) {\n ret = true;\n }\n }\n return ret;\n};\n\nconst isType = (org_type: string, expected_type: string | undefined) => {\n if (expected_type === undefined) {\n return true;\n }\n\n if (org_type.localeCompare(expected_type) === 0) {\n return true;\n }\n return false;\n};\n\nconst getPageName = (link: PageLink, orgType: string) => {\n return orgType === 'carrier' ? link.pageName.carrier : link.pageName.shipper;\n};\n","import { AuthService } from '@/data/AuthService';\nimport { UserInformation } from '@/data/_models';\nimport { LogOut } from 'lucide-react';\nconst ICON_SIZE = 25;\nconst ICON_STROKE = 1.5;\n\nexport function Footer() {\n const handleLogout = (e: React.MouseEvent) => {\n e.stopPropagation();\n AuthService.logout();\n };\n\n return (\n
\n \n
\n \n
\n
Logout
\n \n
\n );\n}\n","import { useAuth } from '@/data/auth';\nimport { Header } from './Header';\nimport { NavLinks } from './NavLinks';\nimport { Footer } from './Footer';\nimport { cn } from '@/lib/utils';\n\n/**Main component */\nexport const SideBarContainer = () => {\n const { permissions } = useAuth();\n\n return (\n <>\n {/*
*/}\n \n
\n
\n\n {permissions && (\n
\n \n
\n )}\n
\n\n
\n
\n \n );\n};\n","import * as React from 'react';\nimport * as ToastPrimitives from '@radix-ui/react-toast';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { Check, Info, X } from 'lucide-react';\n\nimport { cn } from '@/lib/utils';\n\nconst ToastProvider = ToastPrimitives.Provider;\n\nconst ToastViewport = React.forwardRef<\n React.ElementRef,\n React.ComponentPropsWithoutRef\n>(({ className, ...props }, ref) => (\n \n));\nToastViewport.displayName = ToastPrimitives.Viewport.displayName;\n\nconst toastVariants = cva(\n 'data-[swipe=move]:transition-none group relative pointer-events-auto flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border p-6 pr-8 shadow-lg transition-all data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full data-[state=closed]:slide-out-to-right-full',\n {\n variants: {\n variant: {\n default: 'bg-background border',\n success: '',\n error: '',\n // 'group destructive border-destructive bg-destructive text-destructive-foreground',\n },\n },\n defaultVariants: {\n variant: 'default',\n },\n },\n);\n\nconst Toast = React.forwardRef<\n React.ElementRef,\n React.ComponentPropsWithoutRef &\n VariantProps\n>(({ className, variant, ...props }, ref) => {\n return (\n \n {variant === 'error' && (\n
\n \n
\n )}\n {variant === 'success' && (\n
\n \n
\n )}\n\n {props.children}\n \n );\n});\nToast.displayName = ToastPrimitives.Root.displayName;\n\nconst ToastAction = React.forwardRef<\n React.ElementRef,\n React.ComponentPropsWithoutRef\n>(({ className, ...props }, ref) => (\n \n));\nToastAction.displayName = ToastPrimitives.Action.displayName;\n\nconst ToastClose = React.forwardRef<\n React.ElementRef,\n React.ComponentPropsWithoutRef\n>(({ className, ...props }, ref) => (\n \n \n \n));\nToastClose.displayName = ToastPrimitives.Close.displayName;\n\nconst ToastTitle = React.forwardRef<\n React.ElementRef,\n React.ComponentPropsWithoutRef\n>(({ className, ...props }, ref) => (\n \n));\nToastTitle.displayName = ToastPrimitives.Title.displayName;\n\nconst ToastDescription = React.forwardRef<\n React.ElementRef,\n React.ComponentPropsWithoutRef\n>(({ className, ...props }, ref) => (\n \n));\nToastDescription.displayName = ToastPrimitives.Description.displayName;\n\ntype ToastProps = React.ComponentPropsWithoutRef;\n\ntype ToastActionElement = React.ReactElement;\n\nexport {\n type ToastProps,\n type ToastActionElement,\n ToastProvider,\n ToastViewport,\n Toast,\n ToastTitle,\n ToastDescription,\n ToastClose,\n ToastAction,\n};\n","// Inspired by react-hot-toast library\nimport * as React from 'react';\n\nimport type {\n ToastActionElement,\n ToastProps,\n} from '@/components/primitives/Toast';\n\nconst TOAST_LIMIT = 3;\nconst TOAST_REMOVE_DELAY = 1000000;\n\ntype ToasterToast = ToastProps & {\n id: string;\n title?: React.ReactNode;\n description?: React.ReactNode;\n action?: ToastActionElement;\n time?: number;\n};\n\nconst actionTypes = {\n ADD_TOAST: 'ADD_TOAST',\n UPDATE_TOAST: 'UPDATE_TOAST',\n DISMISS_TOAST: 'DISMISS_TOAST',\n REMOVE_TOAST: 'REMOVE_TOAST',\n} as const;\n\nlet count = 0;\n\nfunction genId() {\n count = (count + 1) % Number.MAX_VALUE;\n return count.toString();\n}\n\ntype ActionType = typeof actionTypes;\n\ntype Action =\n | {\n type: ActionType['ADD_TOAST'];\n toast: ToasterToast;\n }\n | {\n type: ActionType['UPDATE_TOAST'];\n toast: Partial;\n }\n | {\n type: ActionType['DISMISS_TOAST'];\n toastId?: ToasterToast['id'];\n }\n | {\n type: ActionType['REMOVE_TOAST'];\n toastId?: ToasterToast['id'];\n };\n\ninterface State {\n toasts: ToasterToast[];\n}\n\nconst toastTimeouts = new Map>();\n\nconst addToRemoveQueue = (toastId: string, time?: number) => {\n if (toastTimeouts.has(toastId)) {\n return;\n }\n\n const timeout = setTimeout(() => {\n toastTimeouts.delete(toastId);\n dispatch({\n type: 'REMOVE_TOAST',\n toastId: toastId,\n });\n }, time || TOAST_REMOVE_DELAY);\n\n toastTimeouts.set(toastId, timeout);\n};\n\nexport const reducer = (state: State, action: Action): State => {\n switch (action.type) {\n case 'ADD_TOAST':\n return {\n ...state,\n toasts: [action.toast, ...state.toasts].slice(0, TOAST_LIMIT),\n };\n\n case 'UPDATE_TOAST':\n return {\n ...state,\n toasts: state.toasts.map((t) =>\n t.id === action.toast.id ? { ...t, ...action.toast } : t\n ),\n };\n\n case 'DISMISS_TOAST': {\n const { toastId } = action;\n\n // ! Side effects ! - This could be extracted into a dismissToast() action,\n // but I'll keep it here for simplicity\n if (toastId) {\n addToRemoveQueue(toastId);\n } else {\n state.toasts.forEach((toast) => {\n addToRemoveQueue(toast.id);\n });\n }\n\n return {\n ...state,\n toasts: state.toasts.map((t) =>\n t.id === toastId || toastId === undefined\n ? {\n ...t,\n open: false,\n }\n : t\n ),\n };\n }\n case 'REMOVE_TOAST':\n if (action.toastId === undefined) {\n return {\n ...state,\n toasts: [],\n };\n }\n return {\n ...state,\n toasts: state.toasts.filter((t) => t.id !== action.toastId),\n };\n }\n};\n\nconst listeners: Array<(state: State) => void> = [];\n\nlet memoryState: State = { toasts: [] };\n\nfunction dispatch(action: Action) {\n memoryState = reducer(memoryState, action);\n listeners.forEach((listener) => {\n listener(memoryState);\n });\n}\n\ntype Toast = Omit;\n\nfunction toast({ ...props }: Toast) {\n const id = genId();\n\n const update = (props: ToasterToast) =>\n dispatch({\n type: 'UPDATE_TOAST',\n toast: { ...props, id },\n });\n const dismiss = () => dispatch({ type: 'DISMISS_TOAST', toastId: id });\n\n dispatch({\n type: 'ADD_TOAST',\n toast: {\n ...props,\n id,\n open: true,\n onOpenChange: (open) => {\n if (!open) dismiss();\n },\n },\n });\n\n addToRemoveQueue(id, props.time);\n\n return {\n id: id,\n dismiss,\n update,\n };\n}\n\nfunction useToast() {\n const [state, setState] = React.useState(memoryState);\n\n React.useEffect(() => {\n listeners.push(setState);\n return () => {\n const index = listeners.indexOf(setState);\n if (index > -1) {\n listeners.splice(index, 1);\n }\n };\n }, [state]);\n\n return {\n ...state,\n toast,\n dismiss: (toastId?: string) => dispatch({ type: 'DISMISS_TOAST', toastId }),\n };\n}\n\nexport { useToast, toast };\n","import {\n Toast,\n ToastClose,\n ToastDescription,\n ToastProvider,\n ToastTitle,\n ToastViewport,\n} from './Toast';\nimport { useToast } from './useToast';\n\nexport function Toaster() {\n const { toasts } = useToast();\n\n return (\n \n {toasts.map(function ({ id, title, description, action, ...props }) {\n return (\n \n
\n {title && {title}}\n {description && (\n {description}\n )}\n
\n {action}\n \n
\n );\n })}\n \n
\n );\n}\n","import React from 'react';\nimport { Outlet } from 'react-router';\n\nimport { SideBarContainer } from './SideBar/SideBarContainer';\nimport { Toaster } from '@/components/primitives/Toaster';\n\nexport function StandardLayout() {\n return (\n
\n
\n \n
\n\n
\n \n
\n\n {/* Positioning the Toaster at the bottom */}\n
\n \n
\n
\n );\n}\n","import { GetStoresResponse } from '@/data/SupabaseRequests/dashboard-api/getStores';\nimport { Store } from '../_models';\n\n/**\n * Assign different colors based off region ids\n * @param stores\n * @returns Store[]\n */\nexport function assignColors(\n stores: GetStoresResponse,\n type: 'shipper' | 'carrier',\n): Store[] {\n const colors = [\n '#FF5733', // Orange-red\n '#3399FF', // Blue\n '#66CC66', // Green\n '#FFD700', // Gold\n '#9932CC', // Purple\n '#FF6347', // Tomato\n '#8B4513', // Saddle Brown\n '#4169E1', // Royal Blue\n '#2E8B57', // Sea Green\n '#FF1493', // Deep Pink\n '#20B2AA', // Light Sea Green\n '#BA55D3', // Medium Orchid\n '#CD853F', // Peru\n '#6495ED', // Cornflower Blue\n '#DC143C', // Crimson\n ];\n\n // Get unique regions\n const uniqueRegions = new Set(\n stores.map((store) =>\n type === 'shipper' ? store.region_id : store.region_name,\n ),\n );\n\n // Create a mapping of region to color\n const regionColorMap = new Map();\n Array.from(uniqueRegions).forEach((region, index) => {\n regionColorMap.set(region, colors[index % colors.length]);\n });\n\n // Assign colors to stores based on their region\n const storesWithColors = stores.map((store) => {\n const regionKey = type === 'shipper' ? store.region_id : store.region_name;\n const color = regionColorMap.get(regionKey) || 'black'; // fallback to black if we somehow run out of colors\n return { ...store, color };\n });\n\n return storesWithColors;\n}\n","import { supabase } from \"../../supabase\";\n\n// To regenerate this file, run the CLI command `deno run --allow-read --allow-write --allow-sys schema_to_ts.ts`. The script is located in the supabase-functions directory.\n\n/**\n * This interface was referenced by `Interface`'s JSON-Schema\n * via the `definition` \"getStoresResponse\".\n */\nexport type GetStoresResponse = {\n region_id: string;\n region_name: string;\n latitude: number;\n longitude: number;\n}[];\n\n\n/**\n * This interface was referenced by `Interface`'s JSON-Schema\n * via the `definition` \"getStoresParams\".\n */\nexport interface GetStoresParams {\n function: \"get-stores\";\n}\n\n\nexport async function getStores(\n params: Omit,\n){\n try {\n const result = await supabase.functions.invoke( \n 'dashboard-api',\n { body: { ...params, function: 'get-stores' }},\n );\n\n if (!result.error && result.data) {\n return result.data;\n } else if (result.error) {\n throw new Error(\"Error Fetching Result in dashboard-api/getStores:\" + result.error);\n } else {\n throw new Error('Unknown error: result does not contain data or error.');\n }\n } catch (error) {\n console.error('Error:', error);\n throw error;\n }\n}\n","import { supabase } from \"../../supabase\";\n\n// To regenerate this file, run the CLI command `deno run --allow-read --allow-write --allow-sys schema_to_ts.ts`. The script is located in the supabase-functions directory.\n\n/**\n * This interface was referenced by `Interface`'s JSON-Schema\n * via the `definition` \"getGraphDataResponse\".\n */\nexport type GetGraphDataResponse = PeriodGraphData[];\n\n\n/**\n * This interface was referenced by `Interface`'s JSON-Schema\n * via the `definition` \"periodGraphData\".\n */\nexport interface PeriodGraphData {\n date: string;\n deliveredShipments: number;\n avgServiceTimeDays: number;\n missingShortage: number;\n missingLost: number;\n damagesTorn: number;\n damagesCrushed: number;\n damagesWet: number;\n damagesOpen: number;\n overageInArea: number;\n overageOutOfArea: number;\n overageStore: number;\n overageStop: number;\n}\n/**\n * This interface was referenced by `Interface`'s JSON-Schema\n * via the `definition` \"getGraphDataParams\".\n */\nexport interface GetGraphDataParams {\n function: \"get-graph-data\";\n stationId?: string;\n regionId?: string;\n storeId?: string;\n period: \"1_month\" | \"3_month\" | \"6_month\" | \"1_year\" | \"all\";\n}\n\n\nexport async function getGraphData(\n params: Omit,\n){\n try {\n const result = await supabase.functions.invoke( \n 'analytics-api',\n { body: { ...params, function: 'get-graph-data' }},\n );\n\n if (!result.error && result.data) {\n return result.data;\n } else if (result.error) {\n throw new Error(\"Error Fetching Result in analytics-api/getGraphData:\" + result.error);\n } else {\n throw new Error('Unknown error: result does not contain data or error.');\n }\n } catch (error) {\n console.error('Error:', error);\n throw error;\n }\n}\n","export function formatDateString(dateString: string): string {\n return new Date(dateString.replace('Z', '')).toLocaleDateString('en-US', {\n month: 'short',\n day: 'numeric',\n });\n}\n","import {\n CartesianGrid,\n Legend,\n Line,\n LineChart,\n ResponsiveContainer,\n Tooltip,\n XAxis,\n YAxis,\n} from 'recharts';\nimport React from 'react';\nimport { GetGraphDataResponse } from '@/data/SupabaseRequests/analytics-api/getGraphData';\nimport { formatDateString } from './_helpers';\n\ntype Props = {\n data: GetGraphDataResponse;\n};\n\nexport const DeliveriesGraph: React.FC = (props) => {\n const { data } = props;\n\n const max = data.reduce((acc, curr) => {\n return Math.max(curr.deliveredShipments, acc);\n }, 0);\n\n return (\n
\n \n \n \n \n \n \n \n \n \n
\n );\n};\n","import {\n LineChart,\n Line,\n XAxis,\n YAxis,\n CartesianGrid,\n Tooltip,\n ResponsiveContainer,\n} from 'recharts';\nimport { formatDateString } from './_helpers';\n\ntype Props = {\n data: { date: string; missing: number }[];\n};\n\nexport function MissingPercentageGraph({ data }: Props) {\n return (\n
\n \n \n \n \n \n \n \n \n \n
\n );\n}\n","import {\n LineChart,\n Line,\n XAxis,\n YAxis,\n CartesianGrid,\n Tooltip,\n Legend,\n ResponsiveContainer,\n} from 'recharts';\nimport { formatDateString } from './_helpers';\n\ntype Props = {\n data: { date: string; overages: number }[];\n};\n\nexport function OveragesGraph({ data }: Props) {\n return (\n
\n \n \n \n \n \n \n \n \n \n
\n );\n}\n","import React from 'react';\nimport { useQuery } from 'react-query';\nimport { getGraphData } from '@/data/SupabaseRequests/analytics-api/getGraphData';\nimport { DeliveriesGraph } from './DeliveriesGraph';\nimport { MissingPercentageGraph } from './MissingPercentageGraph';\nimport { OveragesGraph } from './OveragePercentageGraph';\n\nexport const GraphsContainer: React.FC = () => {\n const { data } = useQuery({\n queryFn: () =>\n getGraphData({\n period: '3_month',\n }),\n queryKey: ['home', 'graph-data', '3_month'],\n });\n\n const missingData = data?.map((d) => {\n const lost =\n Math.round((d.missingLost / d.deliveredShipments) * 10000) / 100;\n const shortage =\n Math.round((d.missingShortage / d.deliveredShipments) * 10000) / 100;\n\n return {\n date: d.date,\n missing: lost + shortage, // Sum of percentages\n lost,\n shortage,\n };\n });\n\n const overageData = data?.map((d) => {\n const outOfArea =\n Math.round((d.overageOutOfArea / d.deliveredShipments) * 10000) / 100;\n const inArea =\n Math.round((d.overageInArea / d.deliveredShipments) * 10000) / 100;\n\n return {\n date: d.date,\n overages: outOfArea + inArea, // Sum of percentages\n outOfArea,\n inArea,\n };\n });\n\n return (\n
\n \n \n \n
\n );\n};\n","import { supabase } from \"../../supabase\";\n\n// To regenerate this file, run the CLI command `deno run --allow-read --allow-write --allow-sys schema_to_ts.ts`. The script is located in the supabase-functions directory.\n\n\n/**\n * This interface was referenced by `Interface`'s JSON-Schema\n * via the `definition` \"store\".\n */\nexport interface Store {\n stopId: string;\n storeNum: string;\n regionId: string;\n deliveryStatus: \"planned\" | \"out-for-delivery\" | \"delivered\";\n geocode: string;\n}\n/**\n * This interface was referenced by `Interface`'s JSON-Schema\n * via the `definition` \"stationLink\".\n */\nexport interface StationLink {\n source_station_id: string;\n source_station_name: string;\n dest_station_id: string;\n dest_station_name: string;\n source_station_geocode: string;\n dest_station_geocode: string;\n}\n/**\n * This interface was referenced by `Interface`'s JSON-Schema\n * via the `definition` \"loadData\".\n */\nexport interface LoadData {\n id: string;\n name: string;\n percentage: number;\n source_station_id: string;\n dest_station_id: string;\n}\n/**\n * This interface was referenced by `Interface`'s JSON-Schema\n * via the `definition` \"regionData\".\n */\nexport interface RegionData {\n id: string;\n name: string;\n bounds: number[][];\n center: number[];\n}\n/**\n * This interface was referenced by `Interface`'s JSON-Schema\n * via the `definition` \"getDashboardPinsParams\".\n */\nexport interface GetDashboardPinsParams {\n function: \"get-dashboard-pins\";\n}\n/**\n * This interface was referenced by `Interface`'s JSON-Schema\n * via the `definition` \"getDashboardPinsResponse\".\n */\nexport interface GetDashboardPinsResponse {\n loads: LoadData[];\n regions: RegionData[];\n stationLinks: StationLink[];\n stores: Store[];\n}\n\n\nexport async function getDashboardPins(\n params: Omit,\n){\n try {\n const result = await supabase.functions.invoke( \n 'dashboard-api',\n { body: { ...params, function: 'get-dashboard-pins' }},\n );\n\n if (!result.error && result.data) {\n return result.data;\n } else if (result.error) {\n throw new Error(\"Error Fetching Result in dashboard-api/getDashboardPins:\" + result.error);\n } else {\n throw new Error('Unknown error: result does not contain data or error.');\n }\n } catch (error) {\n console.error('Error:', error);\n throw error;\n }\n}\n","import { Marker } from 'react-map-gl';\nimport { Warehouse, Truck, Store, Package, MapPin } from 'lucide-react'; // Add more icons as needed\nimport { cn } from '@/lib/utils';\n\ntype IconType = 'warehouse' | 'truck' | 'store' | 'package' | 'pin';\n\ntype PinProps = {\n icon: IconType;\n latitude: number;\n longitude: number;\n color?: string;\n isSelected?: boolean;\n size?: number;\n};\n\nconst ICONS = {\n warehouse: Warehouse,\n truck: Truck,\n store: Store,\n package: Package,\n pin: MapPin,\n};\n\nexport function Pin({\n icon,\n latitude,\n longitude,\n color = 'black',\n isSelected = false,\n size = 24,\n}: PinProps) {\n const IconComponent = ICONS[icon] || MapPin; // Fallback to MapPin if not found\n\n return (\n \n \n {icon === 'store' ? (\n \n ) : (\n \n )}\n
\n \n );\n}\n","import { Buffer } from 'buffer';\n/**\n *\n * @param geocode\n * @returns { latitude: number, longitude: number }\n */\nexport function parseGeocode(geocode: string) {\n if (!geocode || geocode.length < 40) {\n throw new Error('Invalid WKB geocode' + geocode);\n }\n\n try {\n // Convert the hex string into a buffer\n const buffer = Buffer.from(geocode, 'hex');\n\n // Extract longitude and latitude (double precision floats, little-endian)\n const longitude = buffer.readDoubleLE(9); // Bytes 9–16\n const latitude = buffer.readDoubleLE(17); // Bytes 17–24\n\n return { latitude, longitude };\n } catch (error) {\n throw new Error('Invalid WKB geocode' + geocode);\n }\n}\n","import { lineString } from '@turf/helpers';\nimport { along, bezierSpline, length } from '@turf/turf';\n\nexport const getRoundedLine = (\n points: [number, number][],\n percentages: number[],\n): {\n roundedLine: GeoJSON.FeatureCollection;\n pins: { latitude: number; longitude: number }[];\n} => {\n const SCALING_FACTOR = 0.5;\n // Ensure exactly two points are provided to calculate the triangle\n if (points.length !== 2) {\n throw new Error('Exactly two points are required to calculate a triangle');\n }\n\n const [start, end] = points;\n\n // Calculate the midpoint of the base\n const midLat = (start[1] + end[1]) / 2;\n const midLong = (start[0] + end[0]) / 2;\n\n // Calculate the direction vector of the base\n const dx = end[0] - start[0];\n const dy = end[1] - start[1];\n\n // Calculate the perpendicular vector (normalize and scale it)\n const baseLength = Math.sqrt(dx * dx + dy * dy);\n const height = (baseLength / 2) * SCALING_FACTOR; // Set height as half the base length\n const perpDx = -dy / baseLength;\n const perpDy = dx / baseLength;\n\n // Calculate the apex of the triangle\n const apex: [number, number] = [\n midLong + perpDx * height,\n midLat + perpDy * height,\n ];\n\n // Create the triangle points: start -> apex -> end\n const trianglePoints: [number, number][] = [start, apex, end];\n\n // Create a LineString using the triangle points\n const rawLine = lineString(trianglePoints);\n\n // Generate a slightly smoothed line using bezierSpline\n const smoothedLine = bezierSpline(rawLine);\n\n const pinsOnLine = percentages.map((p) => {\n const distance = p * length(rawLine);\n const point = along(smoothedLine, distance);\n\n return {\n latitude: point.geometry.coordinates[1],\n longitude: point.geometry.coordinates[0],\n };\n });\n\n return {\n pins: pinsOnLine,\n roundedLine: {\n type: 'FeatureCollection',\n features: [\n {\n type: 'Feature',\n geometry: smoothedLine.geometry,\n properties: {\n color: 'black',\n },\n },\n ],\n },\n };\n};\n","import {\n StationLink,\n LoadData,\n} from '@/data/SupabaseRequests/dashboard-api/getDashboardPins';\nimport { parseGeocode } from '@/helpers/parseGeocode';\nimport { getRoundedLine } from './getRoundedLine';\ntype LineFeature = {\n roundedLine: any; // Adjust this type based on the actual return type of getRoundedLine\n pins: { latitude: number; longitude: number }[];\n};\n\nexport const getLineFeatures = (\n stationLinks: StationLink[],\n loads: LoadData[],\n): LineFeature[] => {\n if (!stationLinks || !loads) return [];\n\n return stationLinks\n .filter((link) =>\n loads.some(\n (load) =>\n load.source_station_id === link.source_station_id &&\n load.dest_station_id === link.dest_station_id,\n ),\n )\n .map((item) => {\n const { latitude: sourceLat, longitude: sourceLong } = parseGeocode(\n item.source_station_geocode,\n );\n const { latitude: destLat, longitude: destLong } = parseGeocode(\n item.dest_station_geocode,\n );\n\n const percentages: number[] = loads\n .filter(\n (load) =>\n load.source_station_id === item.source_station_id &&\n load.dest_station_id === item.dest_station_id,\n )\n .map((load) => load.percentage);\n\n // Use getRoundedLine to create a smoothed line between the points\n return getRoundedLine(\n [\n [sourceLong, sourceLat],\n [destLong, destLat],\n ],\n percentages,\n );\n });\n};\n","/**This will detect a click outside component */\n\n/**Using this hook from a component */\n/* \nexport default function OutsideAlerter(props) {\n const wrapperRef = useRef(null);\n useOutsideAlerter(wrapperRef);\n \n return
{props.children}
;\n }\n SeePopper.tsx for example\n*/\n\nimport { MutableRefObject, useEffect } from 'react';\n//Feel free to redeclare the fn parameter\nexport function useOutsideClick(\n ref: MutableRefObject,\n fn: () => void,\n) {\n useEffect(() => {\n /**\n * Alert if clicked on outside of element\n */\n function handleClickOutside(event: any) {\n if (ref.current && event.target && !ref.current.contains(event?.target)) {\n fn();\n }\n }\n\n // Bind the event listener\n document.addEventListener('mousedown', handleClickOutside);\n return () => {\n // Unbind the event listener on clean up\n document.removeEventListener('mousedown', handleClickOutside);\n };\n }, [ref, fn]);\n}\n","import { supabase } from \"../../supabase\";\n\n// To regenerate this file, run the CLI command `deno run --allow-read --allow-write --allow-sys schema_to_ts.ts`. The script is located in the supabase-functions directory.\n\n\n/**\n * This interface was referenced by `Interface`'s JSON-Schema\n * via the `definition` \"storeDetails\".\n */\nexport interface StoreDetails {\n storeNumber: string;\n storeName: string;\n city: string;\n state: string;\n zip: string;\n cartonCount: string;\n carrierName: string;\n carrierAbv: string;\n}\n/**\n * This interface was referenced by `Interface`'s JSON-Schema\n * via the `definition` \"getStoreDeliveryInfoParams\".\n */\nexport interface GetStoreDeliveryInfoParams {\n function: \"get-store-delivery-info\";\n stopId: string;\n}\n/**\n * This interface was referenced by `Interface`'s JSON-Schema\n * via the `definition` \"getStoreDeliveryInfoResponse\".\n */\nexport interface GetStoreDeliveryInfoResponse {\n storeDetails: StoreDetails;\n}\n\n\nexport async function getStoreDeliveryInfo(\n params: Omit,\n){\n try {\n const result = await supabase.functions.invoke( \n 'dashboard-api',\n { body: { ...params, function: 'get-store-delivery-info' }},\n );\n\n if (!result.error && result.data) {\n return result.data;\n } else if (result.error) {\n throw new Error(\"Error Fetching Result in dashboard-api/getStoreDeliveryInfo:\" + result.error);\n } else {\n throw new Error('Unknown error: result does not contain data or error.');\n }\n } catch (error) {\n console.error('Error:', error);\n throw error;\n }\n}\n","import { useOutsideClick } from '@/common/hooks/useOutsideClick';\nimport {\n getStoreDeliveryInfo,\n Store,\n} from '@/data/SupabaseRequests/dashboard-api/_index';\nimport { parseGeocode } from '@/helpers/parseGeocode';\nimport { Loader } from 'lucide-react';\nimport { useRef, useState } from 'react';\nimport { Marker, Popup } from 'react-map-gl';\nimport { useQuery } from 'react-query';\n\n/**\n * \n * @param param0 export interface Store {\n id: string;\n storeNum: string;\n regionId: string;\n deliveryStatus: \"planned\" | \"out-for-delivery\" | \"delivered\";\n geocode: string;\n}\n * @returns \n */\n\nexport function StorePin({ store }: { store: Store }) {\n const [showPopup, setShowPopup] = useState(false);\n const { latitude, longitude } = parseGeocode(store.geocode);\n\n const divRef = useRef(null);\n\n useOutsideClick(divRef, () => {\n if (showPopup) {\n setShowPopup(false);\n }\n });\n\n const {\n data: storeData,\n isLoading,\n isError,\n } = useQuery({\n queryKey: ['dashboard', 'stores', store.stopId],\n queryFn: () => getStoreDeliveryInfo({ stopId: store.stopId }),\n enabled: showPopup,\n });\n\n const color =\n store.deliveryStatus === 'out-for-delivery'\n ? 'orange'\n : store.deliveryStatus === 'delivered'\n ? 'green'\n : 'black';\n\n return (\n <>\n setShowPopup(true)}\n >\n \n \n {showPopup && (\n setShowPopup(false)}\n anchor=\"bottom-right\"\n >\n
\n {isLoading ? (\n
\n \n
\n ) : isError ? (\n

Failed to load data

\n ) : (\n <>\n

\n {storeData?.storeDetails?.storeName} (\n {storeData?.storeDetails?.storeNumber})\n

\n

\n {storeData?.storeDetails?.city},{' '}\n {storeData?.storeDetails?.state}{' '}\n {storeData?.storeDetails?.zip}\n

\n
\n
\n Cartons:\n {storeData?.storeDetails?.cartonCount}\n
\n
\n Carrier:\n \n {storeData?.storeDetails?.carrierName} (\n {storeData?.storeDetails?.carrierAbv})\n \n
\n
\n \n )}\n
\n \n )}\n \n );\n}\n","import { Truck, Warehouse } from 'lucide-react';\n\ntype Visibility = {\n source: boolean;\n destination: boolean;\n deliveredStore: boolean;\n outForDeliveryStore: boolean;\n unplannedStore: boolean;\n regions: boolean;\n linehaul: boolean;\n};\n\ntype Props = {\n visibility: Visibility;\n toggleVisibility: (key: keyof Visibility) => void;\n};\n\nexport function Legend({ visibility, toggleVisibility }: Props) {\n return (\n
\n

Map Key

\n
    \n {/* Source Station */}\n toggleVisibility('source')}\n >\n \n Distribution Center\n \n\n {/* Destination Station */}\n toggleVisibility('destination')}\n >\n \n Destination Station\n \n toggleVisibility('linehaul')}\n >\n \n Linehaul\n \n\n {/* Delivered Store */}\n\n {/* Delivered Store */}\n toggleVisibility('deliveredStore')}\n >\n \n Delivered Store\n \n\n {/* Out for Delivery */}\n toggleVisibility('outForDeliveryStore')}\n >\n \n Out for Delivery\n \n\n {/* Unplanned Store */}\n toggleVisibility('unplannedStore')}\n >\n \n Planned Store\n \n\n {/* Regions */}\n toggleVisibility('regions')}\n >\n
\n Region\n \n \n
\n );\n}\n","import { bezierSpline, lineString, simplify } from '@turf/turf';\nimport { PolygonPoints } from './_models';\n\nexport const getRoundedPolygonFilled = (\n poly: PolygonPoints,\n roundedTolerance: number,\n color: string,\n): GeoJSON.Feature => {\n // Convert points to [longitude, latitude] format required by GeoJSON\n const coords = poly.bounds.map((bound) => [bound[0], bound[1]]);\n\n coords.push(coords[0]); // Close the loop by appending the first point at the end\n\n const simplifiedLine = simplify(lineString(coords), {\n tolerance: roundedTolerance,\n highQuality: true,\n });\n\n // Smooth the Polygon using bezierSpline\n const smoothedPolygon = bezierSpline(\n lineString(simplifiedLine.geometry.coordinates),\n );\n\n // Extract smoothed coordinates and ensure it's a closed loop\n const smoothedCoords = smoothedPolygon.geometry.coordinates;\n\n return {\n type: 'Feature',\n geometry: {\n type: 'Polygon',\n coordinates: [smoothedCoords], // Wrap in an array to define the boundary\n },\n properties: {\n id: poly.id,\n color: color,\n },\n };\n};\n","import { bezierSpline, lineString, simplify } from '@turf/turf';\nimport { PolygonPoints } from './_models';\n\nexport const getPolygonEdgesRounded = (\n polygon: PolygonPoints,\n roundedTolerance: number,\n color: string,\n): GeoJSON.Feature => {\n // Convert points to [longitude, latitude] format required by GeoJSON\n const coords = polygon.bounds.map((bound) => [bound[0], bound[1]]);\n\n // Close the loop by appending the first point at the end\n coords.push(coords[0]);\n\n // Smooth the LineString using bezierSpline\n const simplifiedLine = simplify(lineString(coords), {\n tolerance: roundedTolerance,\n highQuality: true,\n });\n const smoothedLine = bezierSpline(simplifiedLine);\n\n // Extract smoothed coordinates and ensure it's a closed loop\n const smoothedCoords = smoothedLine.geometry.coordinates;\n\n return {\n type: 'Feature',\n geometry: {\n type: 'Polygon',\n coordinates: [smoothedCoords], // Wrap in an array to define the boundary\n },\n properties: {\n id: polygon.id,\n color: color,\n },\n };\n};\n","import { PolygonName } from './_models';\n\nexport const getPolygonNameCentered = (\n polygon: PolygonName,\n color: string,\n): GeoJSON.Feature => {\n return {\n type: 'Feature',\n geometry: {\n type: 'Point',\n coordinates: polygon.center,\n },\n properties: {\n id: polygon.id,\n name: polygon.name, // Label for the region\n color: color,\n },\n };\n};\n","import { LayerProps } from 'react-map-gl';\n\nexport const getPolygonLayerStyle = (): LayerProps => ({\n id: 'ploygon-layer',\n type: 'fill',\n layout: {\n visibility: 'visible',\n },\n paint: {\n 'fill-color': ['get', 'color'],\n 'fill-opacity': 0.2,\n },\n});\n\nexport const getPolygonLabelLayerStyle = (): LayerProps => ({\n id: 'polygon-label',\n type: 'symbol',\n layout: {\n 'text-field': ['get', 'name'],\n 'text-font': ['Open Sans Bold', 'Arial Unicode MS Bold'],\n 'text-size': 14,\n 'text-anchor': 'center',\n },\n paint: {\n 'text-color': ['get', 'color'],\n 'text-halo-color': '#ffffff',\n 'text-halo-width': 1.5,\n },\n});\n\nexport const getPolygonEdgeLayerStyle = (): LayerProps => ({\n id: 'polygon-edges',\n type: 'line',\n layout: {\n 'line-cap': 'round',\n 'line-join': 'round',\n 'line-round-limit': 2,\n },\n paint: {\n 'line-color': ['get', 'color'], // Use the color defined in the edge properties\n 'line-width': 1, // Thickness of the edges\n },\n});\n","export function generateColorFromId(id: string): string {\n let hash = 0;\n for (let i = 0; i < id.length; i++) {\n hash = id.charCodeAt(i) + ((hash << 5) - hash);\n hash = hash & hash; // Convert to 32-bit integer\n }\n const hue = Math.abs(hash % 360); // Map hash to 0-359 (hue)\n return `hsl(${hue}, 100%, 50%)`;\n}\n","export function darkenHSLColor(hslColor: string, amount: number): string {\n const regex = /hsl\\((\\d+),\\s*(\\d+)%,\\s*(\\d+)%\\)/;\n const match = hslColor.match(regex);\n\n if (!match) return hslColor; // Return the original color if parsing fails\n\n const [_, hue, saturation, lightness] = match.map(Number);\n const darkerLightness = Math.max(lightness - amount, 0); // Ensure lightness doesn't go below 0\n\n return `hsl(${hue}, ${saturation}%, ${darkerLightness}%)`;\n}\n","/* eslint-disable react-hooks/exhaustive-deps */\nimport { getDashboardPins } from '@/data/SupabaseRequests/dashboard-api/getDashboardPins';\nimport { useMemo, useRef, useState } from 'react';\nimport Map, {\n FullscreenControl,\n Layer,\n MapRef,\n NavigationControl,\n Projection,\n Source,\n} from 'react-map-gl';\nimport { useQuery } from 'react-query';\nimport { Pin } from './mapFeatures/Pin'; // Import the Pin component\nimport { parseGeocode } from '@/helpers/parseGeocode';\nimport { getLineFeatures } from './mapFeatures/lineFeatures';\nimport { StorePin } from './mapFeatures/StorePin';\nimport { Legend } from './mapFeatures/Legend';\nimport {\n getPolygonEdgeLayerStyle,\n getPolygonEdgesRounded,\n getPolygonLabelLayerStyle,\n getPolygonLayerStyle,\n getPolygonNameCentered,\n getRoundedPolygonFilled,\n} from '@/components/map-features/polygon';\nimport { generateColorFromId } from './mapFeatures/regionColors';\nimport { darkenHSLColor } from '@/components/map-features/helpers/darkenHSLColor';\n\n//NOTE: Next time you are messing with the map, try using getPolygon(), you may have to adjust the query or reshape the data\n\nexport function DashboardMap() {\n const [visibility, setVisibility] = useState({\n source: true,\n destination: true,\n deliveredStore: true,\n outForDeliveryStore: true,\n unplannedStore: true,\n regions: true,\n linehaul: true,\n });\n\n // Toggle visibility for a specific element type\n const toggleVisibility = (key: keyof typeof visibility) => {\n setVisibility((prev) => ({ ...prev, [key]: !prev[key] }));\n };\n\n const { data } = useQuery({\n queryKey: ['dashboard', 'loads'],\n queryFn: () => getDashboardPins({}),\n });\n const mapRef = useRef(null);\n\n const stationLinks = useMemo(() => {\n if (!data) return null;\n\n const lineFeatures = getLineFeatures(data.stationLinks, data.loads);\n const lineGeoJSON: GeoJSON.FeatureCollection = {\n type: 'FeatureCollection',\n features: lineFeatures.flatMap((fc) => fc.roundedLine.features),\n };\n\n return {\n lineFeatures,\n lineGeoJSON,\n };\n }, [data]);\n\n const polygons = useMemo(() => {\n if (!data?.regions) return null;\n\n return {\n polygons: data.regions.map((region) =>\n getRoundedPolygonFilled(region, 0.435, generateColorFromId(region.id)),\n ),\n names: data.regions.map((region) =>\n getPolygonNameCentered(\n {\n id: region.id,\n name: region.name,\n center: [region.center[0], region.center[1]],\n },\n darkenHSLColor(generateColorFromId(region.id), 5),\n ),\n ),\n edges: data.regions.map((region) => {\n return getPolygonEdgesRounded(\n region,\n 0.435,\n darkenHSLColor(generateColorFromId(region.id), 3),\n );\n }),\n };\n }, [data]);\n\n return (\n
\n \n {/* Map Controls */}\n \n \n\n {/* Station Pins */}\n {visibility.source &&\n data?.stationLinks.map((item) => {\n const { latitude: sourceLat, longitude: sourceLong } = parseGeocode(\n item.source_station_geocode,\n );\n return (\n \n );\n })}\n {visibility.destination &&\n data?.stationLinks.map((item) => {\n const { latitude: destLat, longitude: destLong } = parseGeocode(\n item.dest_station_geocode,\n );\n return (\n \n );\n })}\n\n {stationLinks?.lineGeoJSON && visibility.linehaul && (\n \n \n \n )}\n {visibility.linehaul &&\n stationLinks?.lineFeatures.map((feature, index) =>\n feature.pins.map((pin, pinIndex) => (\n \n )),\n )}\n\n {/* Store Pins */}\n {visibility.deliveredStore &&\n data?.stores\n .filter((store) => store.deliveryStatus === 'delivered')\n .map((store) => )}\n {visibility.outForDeliveryStore &&\n data?.stores\n .filter((store) => store.deliveryStatus === 'out-for-delivery')\n .map((store) => )}\n {visibility.unplannedStore &&\n data?.stores\n .filter((store) => store.deliveryStatus === 'planned')\n .map((store) => )}\n\n {/* Regions */}\n {visibility.regions && (\n <>\n {polygons?.polygons && (\n \n \n \n )}\n {polygons?.edges && (\n \n \n \n )}\n {polygons?.names && (\n \n \n \n )}\n \n )}\n\n {/* Legend */}\n \n \n
\n );\n}\n","/* eslint-disable react-hooks/exhaustive-deps */\nimport { useQuery } from 'react-query';\nimport { useAuth } from '@/data/auth';\nimport { useEffect, useState } from 'react';\nimport { assignColors } from './_functions/assignColors';\nimport { Store } from './_models';\nimport { getStores } from '@/data/SupabaseRequests/dashboard-api/getStores';\nimport { GraphsContainer } from './graphs/GraphsContainer';\nimport { DashboardMap } from './DashboardMap';\n/**\n * Dashboard landing page\n * @returns React Component\n */\nexport function DashboardAnalytics() {\n const [stores, setStores] = useState(null);\n\n const { user } = useAuth();\n\n const { data } = useQuery({\n queryKey: [user?.id, 'stores'],\n queryFn: () => getStores({}),\n });\n\n useEffect(() => {\n if (data) {\n setStores(\n assignColors(\n data,\n user?.org_type === 'shipper' ? 'shipper' : 'carrier',\n ),\n );\n }\n }, [data]);\n\n return (\n
\n
\n \n
\n
\n \n
\n
\n );\n}\n","import { Button } from '@/components/primitives/Button';\nimport { DashboardAnalytics } from './DashboardAnalytics';\n\nexport function DashboardPage() {\n return ;\n}\n","import React from 'react';\n\nexport function Error404() {\n return
Error 404: Page Not Found
;\n}\n","import React from 'react';\nimport { cn } from '@/lib/utils';\n\ntype Props = { children: React.ReactNode; className?: string };\n\nfunction PageTitle({ children, className }: Props) {\n return (\n \n {children}\n \n );\n}\n\nexport { PageTitle };\n","import * as React from 'react';\nimport * as TooltipPrimitive from '@radix-ui/react-tooltip';\n\nimport { cn } from '@/lib/utils';\n\nconst TooltipProvider = TooltipPrimitive.Provider;\n\nconst Tooltip = TooltipPrimitive.Root;\n\nconst TooltipTrigger = TooltipPrimitive.Trigger;\n\nconst TooltipContent = React.forwardRef<\n React.ElementRef,\n React.ComponentPropsWithoutRef\n>(({ className, sideOffset = 4, ...props }, ref) => (\n \n));\nTooltipContent.displayName = TooltipPrimitive.Content.displayName;\n\nexport { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider };\n","import React from 'react';\n\nimport {\n Tooltip,\n TooltipContent,\n TooltipProvider,\n TooltipTrigger,\n} from '@/components/primitives/Tooltip';\n\ntype Props = {\n children: React.ReactNode;\n message: string | React.ReactNode;\n position?: 'top' | 'bottom' | 'left' | 'right';\n positionOffset?: number;\n className?: string;\n delayDuration?: number;\n};\n\nexport const TooltipWrapper: React.FC = ({\n children,\n message,\n position = 'top',\n positionOffset = 0,\n className = '',\n delayDuration = 0,\n}) => {\n return (\n \n \n {children}\n\n \n {message}\n \n \n \n );\n};\n","import React from 'react';\nimport { NavLink } from 'react-router-dom';\nimport { cn } from '@/lib/utils';\nimport { buttonVariants } from '@/components/primitives/Button';\nimport { useAuth } from '@/data/auth';\nimport { TooltipWrapper } from './TooltipWrapper';\nimport { Permission } from '@/data/permissions';\n\ninterface NavBarProps extends React.HTMLAttributes {\n items: {\n href: string;\n title: string;\n permissions?: string[]; //we need to know whether a user has permission or not, if so something special needs to be shown\n //for the user\n }[];\n orientation?: 'vertical' | 'horizontal';\n}\n\nexport function NavBar({\n className,\n items,\n orientation = 'horizontal',\n ...props\n}: NavBarProps) {\n const { permissions } = useAuth();\n return (\n \n {items.map((item) =>\n item.permissions &&\n permissions?.hasPermission(item.permissions as Permission[]) ? (\n \n cn(\n buttonVariants({ variant: 'ghost', size: 'sm' }),\n isActive\n ? 'border underline hover:bg-lupurple-light bg-lupurple-light'\n : 'hover:bg-lupurple-light hover:underline ',\n 'justify-start',\n )\n }\n >\n {item.title}\n \n ) : (\n //if the user does not have permission, show a tooltip and no NavLink\n \n
{item.title}
\n \n ),\n )}\n \n );\n}\n","import React from 'react';\nimport { PageTitle } from '../components/primitives/PageTitle';\nimport { NavBar } from '../components/NavBar';\nimport { cn } from '@/lib/utils';\n\ninterface PageHeaderProps extends React.HTMLAttributes {\n pages?: {\n href: string;\n title: string;\n has_permission?: boolean;\n }[];\n children?: React.ReactNode;\n}\n\nexport function PageHeader({\n pages = [],\n children,\n className,\n ...props\n}: PageHeaderProps) {\n return (\n
\n
\n \n {children}\n \n
\n
\n \n
\n
\n );\n}\n","import * as React from 'react';\n\nimport { cn } from '@/lib/utils';\n\nconst Table = React.forwardRef<\n HTMLTableElement,\n React.HTMLAttributes\n>(({ className, ...props }, ref) => (\n
\n \n
\n));\nTable.displayName = 'Table';\n\nconst TableHeader = React.forwardRef<\n HTMLTableSectionElement,\n React.HTMLAttributes\n>(({ className, ...props }, ref) => (\n \n));\nTableHeader.displayName = 'TableHeader';\n\nconst TableBody = React.forwardRef<\n HTMLTableSectionElement,\n React.HTMLAttributes\n>(({ className, ...props }, ref) => (\n \n));\nTableBody.displayName = 'TableBody';\n\nconst TableFooter = React.forwardRef<\n HTMLTableSectionElement,\n React.HTMLAttributes\n>(({ className, ...props }, ref) => (\n \n));\nTableFooter.displayName = 'TableFooter';\n\nconst TableRow = React.forwardRef<\n HTMLTableRowElement,\n React.HTMLAttributes\n>(({ className, ...props }, ref) => (\n \n));\nTableRow.displayName = 'TableRow';\n\nconst TableHead = React.forwardRef<\n HTMLTableCellElement,\n React.ThHTMLAttributes\n>(({ className, ...props }, ref) => (\n \n));\nTableHead.displayName = 'TableHead';\n\nconst TableCell = React.forwardRef<\n HTMLTableCellElement,\n React.TdHTMLAttributes\n>(({ className, ...props }, ref) => (\n \n));\nTableCell.displayName = 'TableCell';\n\nconst TableCaption = React.forwardRef<\n HTMLTableCaptionElement,\n React.HTMLAttributes\n>(({ className, ...props }, ref) => (\n \n));\nTableCaption.displayName = 'TableCaption';\n\nexport {\n Table,\n TableHeader,\n TableBody,\n TableFooter,\n TableHead,\n TableRow,\n TableCell,\n TableCaption,\n};\n","import { supabase } from \"../../supabase\";\n\n// To regenerate this file, run the CLI command `deno run --allow-read --allow-write --allow-sys schema_to_ts.ts`. The script is located in the supabase-functions directory.\n\n/**\n * This interface was referenced by `Interface`'s JSON-Schema\n * via the `definition` \"getAllUsersResponse\".\n */\nexport type GetAllUsersResponse = OrganizationUser[];\n\n\n/**\n * This interface was referenced by `Interface`'s JSON-Schema\n * via the `definition` \"organizationUser\".\n */\nexport interface OrganizationUser {\n id: string;\n email: string;\n firstName: string;\n lastName: string;\n permissions: string[];\n stations: string[];\n lastLogin: string;\n}\n/**\n * This interface was referenced by `Interface`'s JSON-Schema\n * via the `definition` \"getAllUsersParams\".\n */\nexport interface GetAllUsersParams {\n function: \"get-all-users\";\n}\n\n\nexport async function getAllUsers(\n params: Omit,\n){\n try {\n const result = await supabase.functions.invoke( \n 'organization-api',\n { body: { ...params, function: 'get-all-users' }},\n );\n\n if (!result.error && result.data) {\n return result.data;\n } else if (result.error) {\n throw new Error(\"Error Fetching Result in organization-api/getAllUsers:\" + result.error);\n } else {\n throw new Error('Unknown error: result does not contain data or error.');\n }\n } catch (error) {\n console.error('Error:', error);\n throw error;\n }\n}\n","interface LoadingProps {\n size?: string;\n spacing?: string;\n}\n\nexport function Loading({ size = '4', spacing = '2' }: LoadingProps) {\n return (\n
\n \n \n \n
\n );\n}\n\n// const [imageURL, setImageURL] = useState('');\n// useEffect(() => {\n// fetchBucketData(supabase, 'logos', 'png', 'Lucidity', ['Lucidity']).then(\n// (result) => {\n// setImageURL(result?.publicUrl + '');\n// }\n// );\n// }, []);\n\n//
\n// \n// \n//

{'Loading...'}

\n//
\n//
\n","import { Input } from '@/components/primitives/Input';\n\ninterface UserFiltersProps {\n searchQuery: string;\n setSearchQuery: (value: string) => void;\n filter: 'All' | 'Admin User' | 'App User' | 'User';\n setFilter: (value: 'All' | 'Admin User' | 'App User' | 'User') => void;\n}\n\nexport function UserFilters({\n searchQuery,\n setSearchQuery,\n filter,\n setFilter,\n}: UserFiltersProps) {\n return (\n
\n setSearchQuery(e.target.value)}\n className=\"border rounded p-2 w-[300px]\"\n />\n {['All', 'Admin User', 'App User', 'User'].map((type) => (\n setFilter(type as typeof filter)}\n className={`px-4 py-2 rounded-lg ${\n filter === type\n ? 'bg-lupurple text-white'\n : 'bg-gray-200 text-gray-700'\n }`}\n >\n {type}\n \n ))}\n
\n );\n}\n","import * as React from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\n\nimport { cn } from '@/lib/utils';\n\nconst badgeVariants = cva(\n 'inline-flex items-center border rounded-full px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2',\n {\n variants: {\n variant: {\n default: 'bg-lupurple text-white hover:text-black',\n secondary:\n 'bg-secondary hover:bg-secondary/80 border-transparent text-secondary-foreground',\n destructive:\n 'bg-destructive hover:bg-destructive/80 border-transparent text-destructive-foreground',\n outline: 'text-foreground',\n green:\n 'bg-green-200 hover:bg-green-400 border-transparent text-secondary-foreground',\n yellow:\n 'bg-amber-200 hover:bg-amber-400 border-transparent text-secondary-foreground',\n red: 'bg-red-200 hover:bg-red-400 border-transparent text-secondary-foreground',\n blue: 'bg-blue-200 hover:bg-blue-400 border-transparent text-secondary-foreground',\n orange:\n 'bg-orange-200 hover:bg-orange-400 border-transparent text-secondary-foreground',\n pink: 'bg-pink-200 hover:bg-pink-400 border-transparent text-secondary-foreground',\n gray: 'bg-gray-200 hover:bg-gray-400 border-transparent text-secondary-foreground',\n },\n },\n defaultVariants: {\n variant: 'default',\n },\n },\n);\n\nexport interface BadgeProps\n extends React.HTMLAttributes,\n VariantProps {}\n\nfunction Badge({ className, variant, ...props }: BadgeProps) {\n return (\n
\n );\n}\n\nexport { Badge, badgeVariants };\n","import * as z from 'zod';\n\nexport const LUDateSchema = z.custom((v) => LUDate.isLUDate(v), {\n message: 'Must be a LUDate',\n});\n\nexport class LUDate extends Date {\n static isLUDate(date: any): date is LUDate {\n return (\n date?.isLUDate && typeof date.isLUDate === 'function' && date.isLUDate()\n );\n }\n isLUDate() {\n return true;\n }\n\n /** The number of milliseconds in a 24 hours */\n static MSInDay = 86400000 as const;\n\n /**\n * This function is for getting the Sunday's LUDate from the calculated week.\n *\n * @param offset The number of weeks to offset the starting date from.\n * An offset of 0 will be used if not provided\n * @param date The starting date a the offset will be calculated from. The current\n * date will be used if not provided\n *\n * @returns Sunday before calculated date from the given offset and date.\n */\n static getSunday = (offset?: number, date?: Date): LUDate => {\n if (!date) date = new Date();\n if (!offset) offset = 0;\n const resultDate = new LUDate(date);\n resultDate.setDate(resultDate.getDate() - resultDate.getDay() + offset * 7);\n\n return resultDate;\n };\n\n /**\n * This function is for getting the Sunday's LUDate from the calculated week.\n *\n * @param offset The number of weeks to offset from the current date.\n * An offset of 0 will be used if not provided\n *\n * @returns The result week's Sunday calculated from the given offset from this date.\n */\n getSunday(offset?: number): LUDate {\n return LUDate.getSunday(offset, this);\n }\n\n static isBusinessDay(date: Date): boolean {\n return date.getDay() !== 0 && date.getDay() !== 6;\n }\n\n static getNextBusinessDay(date: Date): LUDate {\n const nextDay = new LUDate(date);\n if (LUDate.isBusinessDay(nextDay)) {\n return nextDay;\n }\n\n nextDay.setDate(nextDay.getDate() + 1);\n if (nextDay.getDay() === 0) {\n nextDay.setDate(nextDay.getDate() + 1);\n } else if (nextDay.getDay() === 6) {\n nextDay.setDate(nextDay.getDate() + 2);\n }\n return nextDay;\n }\n\n getNextBusinessDay(): LUDate {\n return LUDate.getNextBusinessDay(this);\n }\n\n /**\n *\n * @param dateString a string in the format MMDDYY\n * @param separator optional separator character which the M D and Y are separated by\n * @returns a LUDate object\n */\n static convertStringToDate(dateString: string, separator?: string) {\n if (!separator) {\n const month = parseInt(dateString.substring(0, 2));\n const day = parseInt(dateString.substring(2, 4));\n const year = 2000 + parseInt(dateString.substring(4, 6));\n return new LUDate(year, month - 1, day);\n } else {\n const dateSeparated = dateString.split(separator);\n const month = parseInt(dateSeparated[0]);\n const day = parseInt(dateSeparated[1]);\n const year = 2000 + parseInt(dateSeparated[2]);\n return new LUDate(year, month - 1, day);\n }\n }\n\n static convertFromHTMLInputValue(dateString: string) {\n const dateSeparated = dateString.split('-');\n const year = parseInt(dateSeparated[0]);\n const month = parseInt(dateSeparated[1]);\n const day = parseInt(dateSeparated[2]);\n return new LUDate(year, month - 1, day);\n }\n\n /**\n * @param offset The number of weeks before of after the current week you want the key for.\n * ex. 0 is this week and -1 for last week\n * @returns They key for the schedule to get the DaysOfTheWeek for the specified week\n */\n static getWeekKey(offset?: number, date?: Date): number {\n const dateKey = LUDate.getSunday(offset, date);\n return (\n dateKey.getFullYear() * 10000 +\n (dateKey.getMonth() + 1) * 100 +\n dateKey.getDate()\n );\n }\n\n /**\n * Generates the string representation of the date.\n *\n * @param includeYear If true then the year will be included in the result string\n * ex: 10/21 vs. 10/21/22 or 10/21/2022\n * @param useDash If true then the separator will be the '-' character instead of the '/'\n * ex: 10-21 vs. 10/21\n * @param addZeroes If true then months and days will be padded with leading zeros\n * ex: 10-21 vs. 10-02\n * @param fullYear If true then the full year will be included instead of just the last two digits\n * ex: 10-21-2022 vs. 10-21-22\n *\n * @returns The date in the desired format represented as a string.\n */\n toString(\n includeYear = false,\n useDash = false,\n addZeroes = false,\n fullYear = false,\n ): string {\n const sep = useDash ? '-' : '/';\n\n // Add leading zeroes if needed\n let month = (this.getMonth() + 1).toString();\n let day = this.getDate().toString();\n\n if (addZeroes) {\n month = month.padStart(2, '0');\n day = day.padStart(2, '0');\n }\n\n // Format the year\n const year = fullYear\n ? this.getFullYear().toString()\n : (this.getFullYear() % 100).toString();\n\n // Construct the result string\n return `${month}${sep}${day}${includeYear ? `${sep}${year}` : ''}`;\n }\n\n /**\n *\n * @param offset Number of weeks to offset the start of the week from.\n * @returns An array of LUDates for the week offset from the current week by the given offset.\n */\n static getWeekDates = (offset?: number): Array => {\n const sundayDate = LUDate.getSunday(offset);\n const dayOff = (off: number) => {\n return new LUDate(sundayDate.getTime() + off * LUDate.MSInDay);\n };\n return [\n sundayDate,\n dayOff(1),\n dayOff(2),\n dayOff(3),\n dayOff(4),\n dayOff(5),\n dayOff(6),\n ];\n };\n\n /**\n * Determines if the two dates are on the same day.\n * @param date1 First day to be used for the comparison\n * @param date2 Second day to be used for the comparison\n * @returns True only if the two provided dates are on the same day.\n */\n static sameDay(date1: Date, date2: Date) {\n return (\n date1.getDate() === date2.getDate() &&\n date1.getMonth() === date2.getMonth() &&\n date1.getFullYear() === date2.getFullYear()\n );\n }\n\n /**\n * Takes an array of dates and converts them to grouped ranges as a string\n * Ex: [9/3, 9/4, 9/5, 9/10] => \"9/3-9/5, 9/10\"\n * @param dates An array of dates\n * @returns\n */\n static getDateRangeString(dates: Array) {\n if (dates.length === 0) return 'None';\n\n dates.sort((date1, date2) => date1.getTime() - date2.getTime());\n const LUDates = dates.map((date) => new LUDate(date));\n const ranges: Array<[LUDate, LUDate]> = [[LUDates[0], LUDates[0]]];\n for (let i = 1; i < LUDates.length; i++) {\n const date = LUDates[i];\n const lastDate = ranges[ranges.length - 1][1];\n if (lastDate.sameDay(date)) continue;\n if (lastDate.addDays(1).sameDay(date)) {\n ranges[ranges.length - 1][1] = date;\n } else {\n ranges.push([date, date]);\n }\n }\n\n const groups = ranges.map(([start, end]) => {\n return start.sameDay(end)\n ? start.toString()\n : `${start.toString()}-${end.toString()}`;\n });\n return groups.join(', ');\n }\n\n /**\n * Determines if the date is the same as this date.\n * @param date The date to compare to the current date to.\n * @returns True only if the provided date is the same day as this date's day.\n */\n sameDay(date: Date): boolean {\n return LUDate.sameDay(this, date);\n }\n\n /**\n * Determines if the date is today.\n * @returns True if this date is the current day.\n */\n isToday(): boolean {\n return this.sameDay(new Date(Date.now()));\n }\n\n /**\n *\n * Sorts an array of dates\n * @param Array\n * @returns a sorted array of dates\n *\n */\n static sortDates(dates: Array, reverse = false): Array {\n return dates.sort(function (a: Date, b: Date) {\n return (b.getTime() - a.getTime()) * (reverse ? -1 : 1);\n });\n }\n\n static fromHTMLInputValue(value: string, time = false): LUDate {\n if (time) {\n return new LUDate(value);\n }\n return new LUDate(value + 'T12:00');\n }\n\n /**\n * Adds days to the date\n * @param days Whole number of days to add to the current date.\n * @returns A new LUDate that is the number of days offset from this date.\n */\n addDays(days: number): LUDate {\n const newDate = new LUDate(this);\n newDate.setDate(this.getDate() + days);\n return newDate;\n }\n\n addHours(hours: number): LUDate {\n return new LUDate(this.getTime() + hours * 3600000);\n }\n\n /**\n * Gets the start of the current date's day.\n * @returns A new date at 12:00 AM of the same day.\n */\n startOfDay(): LUDate {\n const msInDay =\n 3600000 * this.getHours() +\n 60000 * this.getMinutes() +\n 1000 * this.getSeconds() +\n this.getMilliseconds();\n return new LUDate(this.getTime() - msInDay);\n }\n\n /**\n * Gets the end of the current date's day.\n * @returns A new date 1 ms 12:00 AM of the next day.\n */\n endOfDay(): LUDate {\n return new LUDate(this.startOfDay().getTime() + LUDate.MSInDay - 1);\n }\n\n /**\n *\n * @returns A string of the format DDMMYYYY using UTC timezone\n */\n asKey(): string {\n const day = (this.getUTCDate() + 100).toString().slice(-2);\n const month = (this.getUTCMonth() + 101).toString().slice(-2); // +101 since month is returned 0-11\n const year = this.getUTCFullYear().toString();\n return day + month + year;\n }\n\n /**\n *\n * @returns A string of the format DDMMYYYY Using the local timezone\n */\n asLocaleKey(): string {\n const day = (this.getDate() + 100).toString().slice(-2);\n const month = (this.getMonth() + 101).toString().slice(-2); // +101 since month is returned 0-11\n const year = this.getFullYear().toString();\n return day + month + year;\n }\n\n /**\n * @returns A string formatted YYYY-MM-DD for the html input field element\n */\n asHTMLInputValue(): string {\n const day = (this.getDate() + 100).toString().slice(-2);\n const month = (this.getMonth() + 101).toString().slice(-2); // +101 since month is returned 0-11\n const year = this.getFullYear().toString();\n return `${year}-${month}-${day}`;\n }\n\n /**\n *\n * @returns A string formatted MM/DD/YYYY\n */\n toDisplayString(): string {\n const day = (this.getDate() + 100).toString().slice(-2);\n const month = (this.getMonth() + 101).toString().slice(-2); // +101 since month is returned 0-11\n const year = this.getFullYear().toString();\n\n return `${month}/${day}/${year}`;\n }\n toDateTimeLocalInputString(): string {\n const day = (this.getDate() + 100).toString().slice(-2);\n const month = (this.getMonth() + 101).toString().slice(-2); // +101 since month is returned 0-11\n const year = this.getFullYear().toString();\n const hours = (this.getHours() + 100).toString().slice(-2);\n const minutes = (this.getMinutes() + 100).toString().slice(-2);\n return `${year}-${month}-${day}T${hours}:${minutes}`;\n }\n\n /**\n *\n *\n * @returns the month as a string\n *\n */\n getMonthString(): string {\n const month = this.getMonth();\n switch (month) {\n case 0:\n return 'January';\n case 1:\n return 'February';\n case 2:\n return 'March';\n case 3:\n return 'April';\n case 4:\n return 'May';\n case 5:\n return 'June';\n case 6:\n return 'July';\n case 7:\n return 'August';\n case 8:\n return 'September';\n case 9:\n return 'October';\n case 10:\n return 'November';\n default:\n return 'December';\n }\n }\n\n /**\n *\n * @returns the day as a string\n */\n getDayString(): string {\n const day = this.getDay();\n switch (day) {\n case 0:\n return 'Sunday';\n case 1:\n return 'Monday';\n case 2:\n return 'Tuesday';\n case 3:\n return 'Wednesday';\n case 4:\n return 'Thursday';\n case 5:\n return 'Friday';\n default:\n return 'Saturday';\n }\n }\n\n getTimezone(): string {\n return Intl.DateTimeFormat().resolvedOptions().timeZone;\n }\n\n static getTimezone(): string {\n return Intl.DateTimeFormat().resolvedOptions().timeZone;\n }\n\n // compares two dates used for sorting\n compare(date: Date): number {\n return this.getTime() - date.getTime();\n }\n\n isBefore(date: Date): boolean {\n return this.compare(date) < 0;\n }\n\n isAfter(date: Date): boolean {\n return this.compare(date) > 0;\n }\n isSameDay(date: LUDate): boolean {\n return (\n this.getMonth() === date.getMonth() &&\n this.getDate() === date.getDate() &&\n this.getFullYear() === date.getFullYear()\n );\n }\n\n timeDifferenceString(later_date?: LUDate): string {\n const date_to_compare = later_date ? later_date : new LUDate();\n const differenceInMilliseconds = this.getTime() - date_to_compare.getTime();\n const differenceInMinutes =\n Math.abs(differenceInMilliseconds) / (1000 * 60);\n const differenceInHours = differenceInMinutes / 60;\n const differenceInDays = differenceInHours / 24;\n\n if (differenceInMinutes < 60) {\n return differenceInMilliseconds > 0\n ? `in ${Math.floor(differenceInMinutes)} minutes`\n : `${Math.floor(differenceInMinutes)} minutes ago`;\n } else if (differenceInHours < 24) {\n return differenceInMilliseconds > 0\n ? `in ${Math.floor(differenceInHours)} hours`\n : `${Math.floor(differenceInHours)} hours ago`;\n } else {\n return differenceInMilliseconds > 0\n ? `in ${Math.floor(differenceInDays)} days`\n : `${Math.floor(differenceInDays)} days ago`;\n }\n }\n}\n","import { TableCell } from '@/components/primitives/Table';\nimport { LUDate } from '@/common/classes/LUDate';\n\ninterface LastLoginCellProps {\n lastLogin: string | null;\n}\n\nexport function LastLoginCell({ lastLogin }: LastLoginCellProps) {\n if (!lastLogin) return Never;\n\n const lastLoginDate = new LUDate(lastLogin);\n const timeDiffString = lastLoginDate.timeDifferenceString();\n\n const match = timeDiffString.match(/(\\d+)\\s+days?/i);\n const daysAgo = match ? parseInt(match[1], 10) : 0;\n\n let textColor = '';\n if (daysAgo > 90) {\n textColor = 'text-red-500';\n } else if (daysAgo > 30) {\n textColor = 'text-yellow-500';\n }\n\n return (\n \n {timeDiffString}\n \n );\n}\n","'use client';\n\nimport * as React from 'react';\nimport * as PopoverPrimitive from '@radix-ui/react-popover';\n\nimport { cn } from '@/lib/utils';\n\nconst Popover = PopoverPrimitive.Root;\n\nconst PopoverTrigger = PopoverPrimitive.Trigger;\n\nconst PopoverContent = React.forwardRef<\n React.ElementRef,\n React.ComponentPropsWithoutRef\n>(({ className, align = 'center', sideOffset = 4, ...props }, ref) => (\n \n \n \n));\nPopoverContent.displayName = PopoverPrimitive.Content.displayName;\n\nexport { Popover, PopoverTrigger, PopoverContent };\n","import { Badge } from '@/components/primitives/Badge';\nimport {\n Popover,\n PopoverContent,\n PopoverTrigger,\n} from '@/components/primitives/Popover';\nimport { TableCell } from '@/components/primitives/Table';\n\ninterface StationsCellProps {\n stations: string[];\n isAdmin: boolean;\n}\n\nexport function StationsCell({ stations, isAdmin }: StationsCellProps) {\n if (isAdmin) {\n return (\n \n All\n \n );\n }\n\n if (stations.length === 1) {\n return {stations[0]};\n }\n\n return (\n \n \n \n \n \n \n
    \n {stations.map((station, index) => (\n
  • \n {station}\n
  • \n ))}\n
\n
\n
\n
\n );\n}\n","import { Badge } from '@/components/primitives/Badge';\nimport { TableCell } from '@/components/primitives/Table';\nimport {\n Popover,\n PopoverTrigger,\n PopoverContent,\n} from '@/components/primitives/Popover';\nimport { useState } from 'react';\n\ninterface PermissionsCellProps {\n permissions: string[];\n isAdmin: boolean;\n}\n\nexport function PermissionsCell({\n permissions,\n isAdmin,\n}: PermissionsCellProps) {\n const [open, setOpen] = useState(false);\n\n if (isAdmin) {\n return (\n \n All\n \n );\n }\n\n if (permissions.length === 1) {\n return {permissions[0]};\n }\n\n return (\n \n \n setOpen(true)}\n onMouseLeave={() => setOpen(false)}\n >\n \n \n setOpen(true)}\n onMouseLeave={() => setOpen(false)}\n >\n
    \n {permissions.map((permission, index) => (\n
  • \n {permission}\n
  • \n ))}\n
\n \n
\n
\n );\n}\n","import { supabase } from \"../../supabase\";\n\n// To regenerate this file, run the CLI command `deno run --allow-read --allow-write --allow-sys schema_to_ts.ts`. The script is located in the supabase-functions directory.\n\n/**\n * This interface was referenced by `Interface`'s JSON-Schema\n * via the `definition` \"deleteUserResponse\".\n */\nexport type DeleteUserResponse = string;\n\n\n/**\n * This interface was referenced by `Interface`'s JSON-Schema\n * via the `definition` \"deleteUserParams\".\n */\nexport interface DeleteUserParams {\n function: \"delete-user\";\n userID: string;\n}\n\n\nexport async function deleteUser(\n params: Omit,\n){\n try {\n const result = await supabase.functions.invoke( \n 'organization-api',\n { body: { ...params, function: 'delete-user' }},\n );\n\n if (!result.error && result.data) {\n return result.data;\n } else if (result.error) {\n throw new Error(\"Error Fetching Result in organization-api/deleteUser:\" + result.error);\n } else {\n throw new Error('Unknown error: result does not contain data or error.');\n }\n } catch (error) {\n console.error('Error:', error);\n throw error;\n }\n}\n","import { Badge } from '@/components/primitives/Badge';\nimport { TableCell, TableRow } from '@/components/primitives/Table';\nimport { LastLoginCell } from './LastLoginCell';\nimport { OrganizationUser } from '@/data/SupabaseRequests/organization-api/getAllUsers';\nimport { UserType } from './_models';\nimport { StationsCell } from './StationsCell';\nimport { PermissionsCell } from './PermissionsCell';\nimport { useAuth } from '@/data/auth';\nimport { Trash2Icon } from 'lucide-react';\nimport { deleteUser } from '@/data/SupabaseRequests/organization-api/deleteUser';\nimport { useState } from 'react';\nimport {\n Popover,\n PopoverContent,\n PopoverTrigger,\n} from '@/components/primitives/Popover';\nimport { Button } from '@/components/primitives/Button';\n\ninterface UserRowProps {\n user: OrganizationUser;\n getUserType: (permissions: string[]) => UserType;\n}\n\nexport function UserRow({ user, getUserType }: UserRowProps) {\n const { permissions } = useAuth();\n const { type, variant } = getUserType(user.permissions);\n const [isPopoverOpen, setIsPopoverOpen] = useState(false);\n\n const isAdmin =\n user.permissions.includes('admin') ||\n user.permissions.includes('super-admin');\n\n async function onDeleteConfirm() {\n await deleteUser({ userID: user.id });\n setIsPopoverOpen(false); // Close popover after deletion\n }\n\n return (\n \n \n {permissions.hasPermission(['admin', 'super-admin']) && (\n \n \n setIsPopoverOpen(true)}\n />\n \n\n \n

\n Are you sure you want to delete{' '}\n {`${user.firstName} ${user.lastName}`}?\n

\n
\n setIsPopoverOpen(false)}\n >\n Cancel\n \n \n Confirm\n \n
\n \n
\n )}\n
\n\n {`${user.firstName} ${user.lastName}`}\n {user.email}\n \n \n \n {type}\n \n \n
\n );\n}\n","import {\n Card,\n CardContent,\n CardHeader,\n CardTitle,\n} from '@/components/primitives/Card';\nimport {\n Table,\n TableBody,\n TableHead,\n TableHeader,\n TableRow,\n} from '@/components/primitives/Table';\nimport { useAuth } from '@/data/auth';\nimport { getAllUsers } from '@/data/SupabaseRequests/organization-api/getAllUsers';\nimport { Loading } from '@/layout/Loading';\nimport { useQuery } from 'react-query';\nimport { useState, useMemo } from 'react';\nimport { UserFilters } from './UserFilters';\nimport { UserRow } from './UserRow';\nimport { UserType } from './_models';\n\nexport function UsersTable() {\n const { user } = useAuth();\n const [searchQuery, setSearchQuery] = useState('');\n const [filter, setFilter] = useState<\n 'All' | 'Admin User' | 'App User' | 'User'\n >('All');\n\n const { data: users, isLoading } = useQuery({\n queryKey: [user?.id, 'organization', 'users'],\n queryFn: () => getAllUsers({}),\n });\n\n const getUserType = (permissions: string[]): UserType => {\n if (permissions.includes('admin') || permissions.includes('super-admin')) {\n return { type: 'Admin User', variant: 'green', priority: 1 };\n }\n if (\n permissions.includes('driver-app') ||\n permissions.includes('warehouse-app')\n ) {\n return { type: 'App User', variant: 'secondary', priority: 3 };\n }\n return { type: 'User', variant: 'default', priority: 2 };\n };\n\n const filteredAndSortedUsers = useMemo(() => {\n if (!users) return [];\n return users\n .filter((user) => {\n const { type } = getUserType(user.permissions);\n return (\n (filter === 'All' || type === filter) &&\n (user.firstName.toLowerCase().includes(searchQuery.toLowerCase()) ||\n user.lastName.toLowerCase().includes(searchQuery.toLowerCase()) ||\n user.email.toLowerCase().includes(searchQuery.toLowerCase()))\n );\n })\n .sort((a, b) => {\n const typeA = getUserType(a.permissions);\n const typeB = getUserType(b.permissions);\n return typeA.priority !== typeB.priority\n ? typeA.priority - typeB.priority\n : a.firstName.localeCompare(b.firstName);\n });\n }, [users, filter, searchQuery]);\n\n return (\n \n {isLoading ? (\n \n ) : (\n <>\n \n Users\n \n \n\n \n
\n \n \n \n Delete\n Name\n Email\n Permissions\n Stations\n User Type\n Last Logged In\n \n \n \n {filteredAndSortedUsers.map((user) => (\n \n ))}\n \n
\n
\n
\n \n )}\n
\n );\n}\n","import { supabase } from \"../../supabase\";\n\n// To regenerate this file, run the CLI command `deno run --allow-read --allow-write --allow-sys schema_to_ts.ts`. The script is located in the supabase-functions directory.\n\n/**\n * This interface was referenced by `Interface`'s JSON-Schema\n * via the `definition` \"getShippersResponse\".\n */\nexport type GetShippersResponse = {\n id: string;\n name: string;\n}[];\n\n\n/**\n * This interface was referenced by `Interface`'s JSON-Schema\n * via the `definition` \"getShippersParams\".\n */\nexport interface GetShippersParams {\n function: \"get-shippers\";\n}\n\n\nexport async function getShippers(\n params: Omit,\n){\n try {\n const result = await supabase.functions.invoke( \n 'organization-api',\n { body: { ...params, function: 'get-shippers' }},\n );\n\n if (!result.error && result.data) {\n return result.data;\n } else if (result.error) {\n throw new Error(\"Error Fetching Result in organization-api/getShippers:\" + result.error);\n } else {\n throw new Error('Unknown error: result does not contain data or error.');\n }\n } catch (error) {\n console.error('Error:', error);\n throw error;\n }\n}\n","import { supabase } from \"../../supabase\";\n\n// To regenerate this file, run the CLI command `deno run --allow-read --allow-write --allow-sys schema_to_ts.ts`. The script is located in the supabase-functions directory.\n\n\n/**\n * This interface was referenced by `Interface`'s JSON-Schema\n * via the `definition` \"connectWithShipperParams\".\n */\nexport interface ConnectWithShipperParams {\n function: \"connect-with-shipper\";\n code: string;\n}\n\n\nexport async function connectWithShipper(\n params: Omit,\n): Promise{\n try {\n const result = await supabase.functions.invoke( \n 'organization-api',\n { body: { ...params, function: 'connect-with-shipper' }},\n );\n\n if (!result.error && result.data) {\n return;\n } else if (result.error) {\n throw new Error(\"Error Fetching Result in organization-api/connectWithShipper:\" + result.error);\n } else {\n throw new Error('Unknown error: result does not contain data or error.');\n }\n } catch (error) {\n console.error('Error:', error);\n throw error;\n }\n}\n","import { Card, CardContent, CardHeader } from '@/components/primitives/Card';\nimport { useAuth } from '@/data/auth';\nimport React from 'react';\nimport { useQuery } from 'react-query';\nimport { Organization } from './models';\nimport { Input } from '@/components/primitives/Input';\nimport { CheckCircle } from 'lucide-react';\nimport { getShippers } from '@/data/SupabaseRequests/organization-api/getShippers';\nimport { connectWithShipper } from '@/data/SupabaseRequests/organization-api/connectWithShipper';\nimport { Button } from '@/components/primitives/Button';\n\nexport default function Carrier() {\n const [enteredCode, setEnteredCode] = React.useState('');\n const { data: other_orgs } = useQuery({\n queryKey: ['shippers'],\n queryFn: () => getShippers({}),\n });\n\n const onCheckClick = async () => {\n await connectWithShipper({\n code: enteredCode,\n });\n };\n\n const code_is_valid = enteredCode.length === 36 && enteredCode.includes('-');\n return (\n \n Customers\n \n
\n {other_orgs?.map((org) => {\n return
{org.name}
;\n })}\n
\n\n
\n setEnteredCode(e.target.value)}\n />\n {code_is_valid && (\n \n )}\n
\n
\n
\n );\n}\n","import { supabase } from \"../../supabase\";\n\n// To regenerate this file, run the CLI command `deno run --allow-read --allow-write --allow-sys schema_to_ts.ts`. The script is located in the supabase-functions directory.\n\n/**\n * This interface was referenced by `Interface`'s JSON-Schema\n * via the `definition` \"fetchInviteCodeResponse\".\n */\nexport type FetchInviteCodeResponse = string;\n\n\n/**\n * This interface was referenced by `Interface`'s JSON-Schema\n * via the `definition` \"fetchInviteCodeParams\".\n */\nexport interface FetchInviteCodeParams {\n function: \"fetch-invite-code\";\n}\n\n\nexport async function fetchInviteCode(\n params: Omit,\n){\n try {\n const result = await supabase.functions.invoke( \n 'organization-api',\n { body: { ...params, function: 'fetch-invite-code' }},\n );\n\n if (!result.error && result.data) {\n return result.data;\n } else if (result.error) {\n throw new Error(\"Error Fetching Result in organization-api/fetchInviteCode:\" + result.error);\n } else {\n throw new Error('Unknown error: result does not contain data or error.');\n }\n } catch (error) {\n console.error('Error:', error);\n throw error;\n }\n}\n","/* eslint-disable @typescript-eslint/no-non-null-assertion */\nimport React from 'react';\nimport { useQuery, useQueryClient } from 'react-query';\n\nimport { ClipboardIcon, RefreshCw } from 'lucide-react';\nimport { TooltipWrapper } from '@/components/TooltipWrapper';\nimport { fetchInviteCode } from '@/data/SupabaseRequests/organization-api/fetchInviteCode';\nimport { Input } from '@/components/primitives/Input';\n\nexport default function InviteCodeGenerator() {\n const [copied, setCopied] = React.useState(false);\n const queryClient = useQueryClient();\n\n const { data: inviteCode } = useQuery({\n queryKey: ['invite_code'],\n queryFn: () => fetchInviteCode({}),\n });\n\n const copyToClipboard = () => {\n if (inviteCode) {\n navigator.clipboard.writeText(inviteCode).then(() => {\n setCopied(true);\n setTimeout(() => {\n setCopied(false);\n }, 2000);\n });\n }\n };\n\n return (\n
\n {' '}\n {/* Set a fixed width for the container */}\n
\n {inviteCode && (\n
\n \n \n
\n )}\n
\n {copied ? (\n Copied To Clipboard!\n ) : (\n \n Send this code to a carrier you would like to work with\n \n )}\n
\n );\n}\n","import { supabase } from \"../../supabase\";\n\n// To regenerate this file, run the CLI command `deno run --allow-read --allow-write --allow-sys schema_to_ts.ts`. The script is located in the supabase-functions directory.\n\n/**\n * This interface was referenced by `Interface`'s JSON-Schema\n * via the `definition` \"getCarriersResponse\".\n */\nexport type GetCarriersResponse = {\n id: string;\n name: string;\n}[];\n\n\n/**\n * This interface was referenced by `Interface`'s JSON-Schema\n * via the `definition` \"getCarriersParams\".\n */\nexport interface GetCarriersParams {\n function: \"get-carriers\";\n}\n\n\nexport async function getCarriers(\n params: Omit,\n){\n try {\n const result = await supabase.functions.invoke( \n 'organization-api',\n { body: { ...params, function: 'get-carriers' }},\n );\n\n if (!result.error && result.data) {\n return result.data;\n } else if (result.error) {\n throw new Error(\"Error Fetching Result in organization-api/getCarriers:\" + result.error);\n } else {\n throw new Error('Unknown error: result does not contain data or error.');\n }\n } catch (error) {\n console.error('Error:', error);\n throw error;\n }\n}\n","import { Card, CardContent, CardHeader } from '@/components/primitives/Card';\nimport React from 'react';\nimport { useQuery } from 'react-query';\nimport { Organization } from './models';\nimport InviteCodeGenerator from './InviteCodeGenerator';\nimport { getCarriers } from '@/data/SupabaseRequests/organization-api/getCarriers';\n\nexport default function Shipper() {\n const { data: other_orgs } = useQuery({\n queryKey: ['carriers'],\n queryFn: () => getCarriers({}),\n });\n\n return (\n \n \n
\n Carriers\n \n
\n
\n \n
\n {other_orgs?.map((org) => {\n return
{org.name}
;\n })}\n
\n
\n
\n );\n}\n","import { Card } from '@/components/primitives/Card';\nimport { useAuth } from '@/data/auth';\nimport React from 'react';\nimport Carrier from './Carrier';\nimport Shipper from './Shipper';\n\nexport default function ShipperCarrier() {\n const { user } = useAuth();\n\n const type = user?.org_type as 'carrier' | 'shipper';\n return {type === 'carrier' ? : };\n}\n","import { PageHeader } from '@/layout/PageHeader';\nimport { UsersTable } from './users/UsersTable';\nimport ShipperCarrier from './profile/ShipperCarrier';\n\n/**\n * Organization landing page\n * @returns React component\n */\nexport function OrganizationPage() {\n return (\n
\n \n
\n \n \n
\n
\n );\n}\n","import { createContext, ReactNode, useContext, useMemo, useState } from 'react';\n\ninterface ISelectedContext {\n selectedStops: string[];\n selectedStoreToMerge: string;\n addOrRemoveSelectedStop: (stop: string, store: string) => void;\n removeAllSelectedStops: () => void;\n}\n\nconst SelectedContext = createContext({\n selectedStops: [],\n addOrRemoveSelectedStop: () => {\n console.log('addOrRemoveSelectedStop not implemented');\n },\n selectedStoreToMerge: '',\n removeAllSelectedStops: () => {\n console.log('removeAllSelectedStops not implemented');\n },\n});\n\nexport const useSelectedStops = () => {\n const {\n selectedStops,\n addOrRemoveSelectedStop,\n selectedStoreToMerge,\n removeAllSelectedStops,\n } = useContext(SelectedContext);\n return {\n selectedStops,\n addOrRemoveSelectedStop,\n selectedStoreToMerge,\n removeAllSelectedStops,\n };\n};\n\nexport function SelectedProvider({ children }: { children: ReactNode }) {\n const [selectedStops, setSelectedStops] = useState([]);\n const [selectedStoreToMerge, setSelectedStoreToMerge] = useState(\n [],\n );\n\n // Compute a single store if all stores in selectedStoreToMerge are identical\n const store = useMemo(() => {\n if (\n selectedStoreToMerge.length > 0 &&\n selectedStoreToMerge.every((val, i, arr) => val === arr[0])\n ) {\n return selectedStoreToMerge[0];\n }\n return ''; // Return an empty string if stores are not the same\n }, [selectedStoreToMerge]);\n\n const addOrRemoveSelectedStop = (stops: string, stores: string) => {\n const stopIndex = selectedStops.indexOf(stops);\n if (stopIndex === -1) {\n setSelectedStops([...selectedStops, stops]);\n setSelectedStoreToMerge([...selectedStoreToMerge, stores]);\n } else {\n setSelectedStops([\n ...selectedStops.slice(0, stopIndex),\n ...selectedStops.slice(stopIndex + 1),\n ]);\n setSelectedStoreToMerge([\n ...selectedStoreToMerge.slice(0, stopIndex),\n ...selectedStoreToMerge.slice(stopIndex + 1),\n ]);\n }\n };\n\n const removeAllSelectedStops = () => {\n setSelectedStops([]);\n setSelectedStoreToMerge([]);\n };\n\n return (\n \n {children}\n \n );\n}\n","import * as React from 'react';\nimport * as CheckboxPrimitive from '@radix-ui/react-checkbox';\nimport { Check } from 'lucide-react';\n\nimport { cn } from '@/lib/utils';\n\nconst Checkbox = React.forwardRef<\n React.ElementRef,\n React.ComponentPropsWithoutRef\n>(({ className, ...props }, ref) => (\n \n \n \n \n \n));\nCheckbox.displayName = CheckboxPrimitive.Root.displayName;\n\nexport { Checkbox };\n","export class Weight {\n static KILOS_IN_POUND = 2.2;\n static GRAMS_IN_KILOS = 1000;\n static GRAMS_IN_POUNDS = 453.592;\n static myUnit: string;\n static myWeight: number;\n #weightInGrams: number;\n\n\n /**\n * Constructor for Weight Unit conversion\n * @param theWeight \n * @param theUnit \n */\n constructor(theWeight: number, theUnit: \"KG\"| \"G\" | \"LB\" = \"G\") {\n switch(theUnit) {\n case \"KG\": \n this.#weightInGrams = Math.round(theWeight * Weight.GRAMS_IN_KILOS);\n break;\n case \"G\":\n this.#weightInGrams = theWeight;\n break;\n case \"LB\":\n this.#weightInGrams = Math.round(theWeight * Weight.GRAMS_IN_POUNDS);\n break;\n }\n }\n\n /**Get pounds from grams to one decimal place*/\n get inPounds() {\n return Math.round((this.#weightInGrams / Weight.GRAMS_IN_POUNDS) * 10) / 10;\n }\n\n /**Get Kilos from grams */\n get inKilos () {\n return this.#weightInGrams / Weight.GRAMS_IN_KILOS;\n }\n\n /**Get grams*/\n get inGrams() {\n return this.#weightInGrams;\n }\n}\n\n","import React from 'react';\nimport { Stop } from '../../_models';\nimport { LUDate } from '@/common/classes/LUDate';\nimport { Weight } from '@/helpers/Weight';\n\ntype Props = {\n stop: Stop;\n};\n\nexport function StopSummary({ stop }: Props) {\n const weight = new Weight(stop.weight).inPounds;\n\n // Format the weight\n const weightText =\n weight > 1000 ? `${(weight / 1000).toFixed(1)}k lb` : `${weight} lb`;\n\n return (\n <>\n
\n
\n {stop.city + ', ' + stop.state}\n
\n
\n\n
\n
\n
{stop.shipments + 'pc'}
\n
\n
\n
{weightText}
\n
\n
\n
\n {new LUDate(stop.date).toString(false, false, false)}\n
\n
\n
\n \n );\n}\n","import React, {\n createContext,\n useContext,\n useEffect,\n useState,\n ReactNode,\n} from 'react';\nimport { useLocation, useSearchParams } from 'react-router-dom';\nimport { LUDate } from '@/common/classes/LUDate';\n\ninterface DispatchURLContextProps {\n detailedStop: string | null;\n search: string;\n currentDay: string;\n setDetailedStop: (stop: string | null) => void;\n setSearch: (search: string) => void;\n setCurrentDay: (day: string) => void;\n}\n\nconst DispatchURLContext = createContext(\n undefined,\n);\n\nexport const useDispatchURL = () => {\n const context = useContext(DispatchURLContext);\n if (!context) {\n throw new Error('useDispatchURL must be used within a DispatchProvider');\n }\n return context;\n};\n\nexport const DispatchURLProvider = ({ children }: { children: ReactNode }) => {\n const location = useLocation();\n const [searchParams, setSearchParams] = useSearchParams();\n\n const [detailedStop, setDetailedStop] = useState(\n searchParams.get('stop_id') || null,\n );\n const [search, setSearch] = useState(\n searchParams.get('search') || '',\n );\n const [currentDay, setCurrentDay] = useState(\n searchParams.get('day') || new LUDate().asHTMLInputValue(),\n );\n\n // Ensure required parameters are in the URL and set defaults if missing\n useEffect(() => {\n const params = new URLSearchParams(location.search);\n\n if (!params.has('day')) {\n params.set('day', new LUDate().asHTMLInputValue());\n }\n\n if (!params.has('search')) {\n params.set('search', '');\n }\n\n if (!params.has('stop_id')) {\n params.set('stop_id', '');\n }\n\n // Reorder params: day -> search -> stop_id\n const reorderedParams = new URLSearchParams();\n if (params.has('day')) reorderedParams.set('day', params.get('day')!);\n if (params.has('search'))\n reorderedParams.set('search', params.get('search')!);\n if (params.has('stop_id'))\n reorderedParams.set('stop_id', params.get('stop_id')!);\n\n setSearchParams(reorderedParams);\n }, []); // Runs only once on mount\n\n // Synchronize state with URL params\n useEffect(() => {\n const stopParam = searchParams.get('stop_id') || null;\n const searchParam = searchParams.get('search') || '';\n const dayParam = searchParams.get('day') || new LUDate().asHTMLInputValue();\n\n if (detailedStop !== stopParam) {\n setDetailedStop(stopParam);\n }\n\n if (search !== searchParam) {\n setSearch(searchParam);\n }\n\n if (currentDay !== dayParam) {\n setCurrentDay(dayParam);\n }\n }, [location.search]);\n\n // Update URL params when state changes\n useEffect(() => {\n const params = new URLSearchParams();\n\n // Add in the desired order: day -> search -> stop_id\n if (currentDay) {\n params.set('day', currentDay);\n }\n\n if (search) {\n params.set('search', search);\n }\n\n if (detailedStop) {\n params.set('stop_id', detailedStop);\n }\n\n setSearchParams(params);\n }, [detailedStop, search, currentDay, setSearchParams]);\n\n // Custom function to reset state when setting a new active stop\n const handleSetDetailedStop = (stop: string | null) => {\n setDetailedStop(stop);\n // Keep current day and search values from the URL\n };\n\n return (\n \n {children}\n \n );\n};\n","import { supabase } from \"../../supabase\";\n\n// To regenerate this file, run the CLI command `deno run --allow-read --allow-write --allow-sys schema_to_ts.ts`. The script is located in the supabase-functions directory.\n\n\n/**\n * This interface was referenced by `Interface`'s JSON-Schema\n * via the `definition` \"combineStopsParams\".\n */\nexport interface CombineStopsParams {\n function: \"combine-stops\";\n stop_ids: string[];\n}\n/**\n * This interface was referenced by `Interface`'s JSON-Schema\n * via the `definition` \"combineStopsResponse\".\n */\nexport interface CombineStopsResponse {\n success: boolean;\n}\n/**\n * This interface was referenced by `Interface`'s JSON-Schema\n * via the `definition` \"stopsResponse\".\n */\nexport interface StopsResponse {\n location_id: number;\n pos_id: boolean;\n}\n/**\n * This interface was referenced by `Interface`'s JSON-Schema\n * via the `definition` \"shipmentsResponse\".\n */\nexport interface ShipmentsResponse {\n shipment_id: string;\n}\n\n\nexport async function combineStops(\n params: Omit,\n){\n try {\n const result = await supabase.functions.invoke( \n 'dispatch-api',\n { body: { ...params, function: 'combine-stops' }},\n );\n\n if (!result.error && result.data) {\n return result.data;\n } else if (result.error) {\n throw new Error(\"Error Fetching Result in dispatch-api/combineStops:\" + result.error);\n } else {\n throw new Error('Unknown error: result does not contain data or error.');\n }\n } catch (error) {\n console.error('Error:', error);\n throw error;\n }\n}\n","import { useSelectedStops } from '../contexts/useSelected';\nimport { useMutation, useQueryClient } from 'react-query';\nimport { CurrentDayData } from '../_models';\nimport { combineStops } from '@/data/SupabaseRequests/dispatch-api/combineStops';\nimport { useDispatchURL } from '../contexts/useDispatchURL';\nimport { useAuth } from '@/data/auth';\n\nexport function useMergeStops() {\n const queryClient = useQueryClient();\n const { currentDay } = useDispatchURL();\n const { stations } = useAuth();\n const { selectedStops, removeAllSelectedStops } = useSelectedStops();\n\n return useMutation(async ({ stop_id }: { stop_id: string }) => {\n // Retrieve the original data from the cache\n const originalData: CurrentDayData | undefined = queryClient.getQueryData([\n currentDay,\n stations,\n ]);\n\n // Collect all stops from routes and unnassigned stops\n const allStops =\n originalData?.routes\n .flatMap((route) => route.stops)\n .concat(originalData?.unnassigned_stops) || [];\n\n // Filter out the stops to merge (selected stops excluding the stop_id)\n const stopsToMerge = allStops.filter(\n (stop) => selectedStops.includes(stop.id) && stop.id !== stop_id,\n );\n\n // Calculate total weight and piece count for the merged stop\n const totalWeight = stopsToMerge.reduce(\n (acc, stop) => acc + (stop.weight || 0),\n 0,\n );\n const totalPieces = stopsToMerge.reduce(\n (acc, stop) => acc + (stop.shipments || 0),\n 0,\n );\n\n // Find and update the target stop (either in unnassigned stops or within routes)\n let updatedUnnassignedStops = originalData?.unnassigned_stops.map((stop) =>\n stop.id === stop_id\n ? {\n ...stop,\n weight: (stop.weight || 0) + totalWeight,\n shipments: (stop.shipments || 0) + totalPieces,\n }\n : stop,\n );\n\n let updatedRoutes = originalData?.routes.map((route) => ({\n ...route,\n stops: route.stops.map((stop) =>\n stop.id === stop_id\n ? {\n ...stop,\n weight: (stop.weight || 0) + totalWeight,\n shipments: (stop.shipments || 0) + totalPieces,\n }\n : stop,\n ),\n }));\n\n // Remove all selected stops except the stop_id from unnassigned stops and routes\n updatedUnnassignedStops = updatedUnnassignedStops?.filter(\n (stop) => !selectedStops.includes(stop.id) || stop.id === stop_id,\n );\n\n updatedRoutes = updatedRoutes?.map((route) => ({\n ...route,\n stops: route.stops.filter(\n (stop) => !selectedStops.includes(stop.id) || stop.id === stop_id,\n ),\n }));\n\n try {\n await combineStops({\n stop_ids: [stop_id, ...selectedStops],\n });\n\n removeAllSelectedStops();\n // Set the updated data in the query client\n queryClient.setQueryData(\n [currentDay, stations],\n (oldData) => {\n if (!oldData) {\n return oldData;\n }\n\n return {\n unnassigned_stops: updatedUnnassignedStops || [],\n routes: updatedRoutes || [],\n };\n },\n );\n } catch (error) {\n console.error('Failed to merge stops', error);\n }\n });\n}\n","import { supabase } from \"../../supabase\";\n\n// To regenerate this file, run the CLI command `deno run --allow-read --allow-write --allow-sys schema_to_ts.ts`. The script is located in the supabase-functions directory.\n\n\n/**\n * This interface was referenced by `Interface`'s JSON-Schema\n * via the `definition` \"moveStopsToRouteParams\".\n */\nexport interface MoveStopsToRouteParams {\n function: \"move-stops-to-route\";\n stop_ids: string[];\n route_id: string | null;\n}\n/**\n * This interface was referenced by `Interface`'s JSON-Schema\n * via the `definition` \"moveStopsToRouteResponse\".\n */\nexport interface MoveStopsToRouteResponse {\n success: boolean;\n}\n\n\nexport async function moveStopsToRoute(\n params: Omit,\n){\n try {\n const result = await supabase.functions.invoke( \n 'dispatch-api',\n { body: { ...params, function: 'move-stops-to-route' }},\n );\n\n if (!result.error && result.data) {\n return result.data;\n } else if (result.error) {\n throw new Error(\"Error Fetching Result in dispatch-api/moveStopsToRoute:\" + result.error);\n } else {\n throw new Error('Unknown error: result does not contain data or error.');\n }\n } catch (error) {\n console.error('Error:', error);\n throw error;\n }\n}\n","import { useMutation, useQueryClient } from 'react-query';\nimport { CurrentDayData } from '../_models';\nimport { moveStopsToRoute } from '@/data/SupabaseRequests/dispatch-api/moveStopsToRoute';\nimport { GetWeeklyOverviewResponse } from '@/data/SupabaseRequests/dispatch-api/getWeeklyOverview';\nimport { useDispatchURL } from '../contexts/useDispatchURL';\nimport { LUDate } from '@/common/classes/LUDate';\nimport { useAuth } from '@/data/auth';\n\nexport function useMoveToUnnassigned() {\n const queryClient = useQueryClient();\n const { stations } = useAuth();\n const { currentDay } = useDispatchURL();\n\n return useMutation(async ({ stop_id }: { stop_id: string }) => {\n const originalData: CurrentDayData | undefined = queryClient.getQueryData([\n currentDay,\n stations,\n ]);\n\n //remove the stop from the route\n const updatedRoutes =\n originalData?.routes\n .flatMap((route) => route.stops)\n .filter((stop) => stop.id !== stop_id) || [];\n\n //add the stop to the unnassigned stops\n const updatedUnnassignedStops =\n originalData?.unnassigned_stops.concat(\n originalData?.routes\n .flatMap((route) => route.stops)\n .filter((stop) => stop.id === stop_id),\n ) || [];\n\n try {\n await moveStopsToRoute({\n route_id: null,\n stop_ids: [stop_id],\n });\n\n queryClient.setQueryData(\n [currentDay, stations],\n (oldData) => {\n if (!oldData) {\n return oldData;\n }\n\n return {\n ...oldData,\n routes: oldData.routes.map((route) => {\n return {\n ...route,\n stops: updatedRoutes.filter(\n (stop) => stop.route_id === route.id,\n ),\n };\n }),\n unnassigned_stops: updatedUnnassignedStops,\n };\n },\n );\n\n queryClient.setQueryData(\n ['weekly-overview', new LUDate(currentDay).addDays(-3)],\n (oldData) => {\n if (!oldData) {\n return oldData;\n }\n\n return oldData.map((item, index) => {\n if (item.date === currentDay) {\n return {\n ...item,\n stop_count: item.stop_count ? item.stop_count - 1 : 0,\n };\n }\n return item;\n });\n },\n );\n } catch (error) {\n console.error(error);\n }\n });\n}\n","/* eslint-disable react/jsx-no-useless-fragment */\nimport { Stop } from '../../_models';\nimport { useSelectedStops } from '../../contexts/useSelected';\nimport { Checkbox } from '@/components/primitives/Checkbox';\nimport { useState } from 'react';\nimport { StopSummary } from './StopSummary';\nimport { EyeIcon, MergeIcon, XIcon } from 'lucide-react';\nimport { useDispatchURL } from '../../contexts/useDispatchURL';\nimport { useMergeStops } from '../../mutations/useMergeStops';\nimport { useMoveToUnnassigned } from '../../mutations/useMoveToUnnassigned';\nimport { LUDate } from '@/common/classes/LUDate';\n\n// Tailwind classes for background colors\n// bg-blue-500 bg-lupurple-light bg-yellow-400 bg-green-400\n\ntype Props = {\n stop: Stop;\n};\n\nexport default function StopCard({ stop }: Props) {\n const { addOrRemoveSelectedStop, selectedStops, selectedStoreToMerge } =\n useSelectedStops();\n\n const { search } = useDispatchURL();\n const [headerHovered, setHeaderHovered] = useState(false);\n const [bodyHovered, setBodyHovered] = useState(false);\n const { setDetailedStop } = useDispatchURL();\n const mergeStops = useMergeStops();\n const unnassignStop = useMoveToUnnassigned();\n\n function getHeaderColor() {\n if (selectedStops.includes(stop.id)) {\n return 'border-blue-500';\n }\n if (\n new LUDate().addDays(-7).isAfter(new LUDate(stop.date)) &&\n stop.status !== 'complete'\n ) {\n return 'border-red-400';\n }\n switch (stop.status) {\n case 'not-started':\n return 'border-lupurple-light'; // Ensure Tailwind has this class available\n case 'in-progress':\n return 'border-yellow-400'; // Ensure Tailwind has this class available\n case 'complete':\n return 'border-green-400'; // Ensure Tailwind has this class available\n default:\n return 'border-gray-200'; // Fallback color\n }\n }\n\n const showMerge =\n !selectedStops.includes(stop.id) &&\n selectedStoreToMerge &&\n selectedStoreToMerge === stop.store_num;\n\n return (\n \n {\n addOrRemoveSelectedStop(stop.id, stop.store_num);\n e.stopPropagation();\n }}\n onMouseEnter={() => setHeaderHovered(true)}\n onMouseLeave={() => setHeaderHovered(false)}\n >\n
\n \n
\n 0 && 'text-red-500'}`}>\n ({stop.lost_count})\n {' '}\n ({stop.shipper}) {highlightMatch(stop.store_num, search)}\n
\n
\n
\n setBodyHovered(true)}\n onMouseLeave={() => setBodyHovered(false)}\n >\n {bodyHovered && !showMerge && (\n <>\n {stop.route_id ? (\n // If stop has a route_id, show two sections\n
\n unnassignStop.mutate({ stop_id: stop.id })} // Replace with your actual logic\n >\n \n
\n {/* Eye Icon Section */}\n setDetailedStop(stop.id)}\n >\n \n \n {/* Red X Section */}\n \n ) : (\n // If stop has no route_id, show only the eye icon\n setDetailedStop(stop.id)}\n >\n \n \n )}\n \n )}\n\n {showMerge && (\n \n mergeStops.mutate({\n stop_id: stop.id,\n })\n }\n >\n \n \n )}\n\n
\n \n
\n \n \n );\n}\n\nfunction highlightMatch(storeNum: string, search: string) {\n if (!search) return storeNum; // If no search, return the full store_num as is\n\n const regex = new RegExp(`(${search})`, 'i'); // Case-insensitive regex to find the search term\n const parts = storeNum.split(regex); // Split the store_num into parts based on the search\n\n return (\n <>\n {parts.map((part, index) =>\n regex.test(part) ? (\n \n {part}\n \n ) : (\n part\n ),\n )}\n \n );\n}\n","import { useMutation, useQueryClient } from 'react-query';\nimport { useSelectedStops } from '../contexts/useSelected';\nimport { CurrentDayData } from '../_models';\nimport { moveStopsToRoute } from '@/data/SupabaseRequests/dispatch-api/moveStopsToRoute';\nimport { useDispatchURL } from '../contexts/useDispatchURL';\nimport { useAuth } from '@/data/auth';\n\nexport function useAddStopsToRoute() {\n const queryClient = useQueryClient();\n const { currentDay } = useDispatchURL();\n const { stations } = useAuth();\n const { removeAllSelectedStops, selectedStops } = useSelectedStops();\n\n return useMutation(async ({ route_id }: { route_id: string | null }) => {\n const originalData: CurrentDayData | undefined = queryClient.getQueryData([\n currentDay,\n stations,\n ]);\n\n // Identify the old route that contains the selected stops\n const oldRoutes = originalData?.routes.filter((route) =>\n route.stops.some((stop) => selectedStops.includes(stop.id)),\n );\n\n const updatedStops =\n originalData?.unnassigned_stops\n .concat(originalData?.routes.flatMap((route) => route.stops))\n .map((stop) => {\n if (selectedStops.includes(stop.id)) {\n return {\n ...stop,\n route_id: route_id, // Set new route_id for the selected stops\n };\n }\n return stop;\n }) || [];\n\n try {\n // Move the selected stops to the new route in the backend\n await moveStopsToRoute({\n route_id,\n stop_ids: selectedStops,\n });\n\n removeAllSelectedStops();\n\n queryClient.setQueryData(\n [currentDay, stations],\n (oldData) => {\n if (!oldData) {\n return oldData;\n }\n\n // Remove the stops from their old route\n const routesWithoutSelectedStops = oldData.routes.map((route) => {\n if (oldRoutes?.some((oldRoute) => oldRoute.id === route.id)) {\n return {\n ...route,\n stops: route.stops.filter(\n (stop) => !selectedStops.includes(stop.id),\n ),\n };\n }\n return route;\n });\n\n // Add the stops to the new route\n const newRoutes = routesWithoutSelectedStops.map((route) => {\n if (route.id === route_id) {\n return {\n ...route,\n stops: updatedStops.filter(\n (stop) => stop.route_id === route_id,\n ),\n };\n }\n return route;\n });\n\n return {\n ...oldData,\n unnassigned_stops: updatedStops.filter(\n (stop) => stop.route_id === null,\n ),\n routes: newRoutes,\n };\n },\n );\n } catch (error) {\n // Revert to original data in case of an error\n queryClient.setQueryData([currentDay, stations], originalData);\n throw error;\n }\n });\n}\n","import { Plus } from 'lucide-react';\nimport React from 'react';\nimport { useSelectedStops } from '../../contexts/useSelected';\nimport { useAddStopsToRoute } from '../../mutations/useAddStopsToRoute';\n\ntype Props = {\n route_id: string | null;\n};\n\nexport default function AddStopsToRoute({ route_id }: Props) {\n const { selectedStops } = useSelectedStops();\n const mutation = useAddStopsToRoute();\n\n const handleAddStops = () => {\n // Call the mutation with the route_id\n if (selectedStops.length > 0) {\n mutation.mutate({ route_id });\n } else {\n console.log('No stops selected');\n }\n };\n\n return (\n \n \n \n );\n}\n","import StopCard from './StopCard';\nimport { Stop } from '../../_models';\nimport { useSelectedStops } from '../../contexts/useSelected';\nimport AddStopsToRoute from '../Routes/AddStopsToRoute';\nimport { StopsKey } from './StopsKey';\n\ntype Props = {\n stops: Stop[];\n};\n\nexport function UnnassignedStops({ stops }: Props) {\n const { selectedStops } = useSelectedStops();\n return (\n
\n
\n {stops?.map((stop) => (\n \n \n
\n ))}\n {stops.length === 0 && (\n

\n No Stops Available To Dispatch{' '}\n

\n )}\n {selectedStops.length > 0 && (\n
\n \n
\n )}\n
\n \n );\n}\n","import { supabase } from \"../../supabase\";\n\n// To regenerate this file, run the CLI command `deno run --allow-read --allow-write --allow-sys schema_to_ts.ts`. The script is located in the supabase-functions directory.\n\n\n/**\n * This interface was referenced by `Interface`'s JSON-Schema\n * via the `definition` \"updateStopPriorityParams\".\n */\nexport interface UpdateStopPriorityParams {\n function: \"update-stop-priority\";\n stop_id: string;\n priority: number;\n}\n\n\nexport async function updateStopPriority(\n params: Omit,\n): Promise{\n try {\n const result = await supabase.functions.invoke( \n 'dispatch-api',\n { body: { ...params, function: 'update-stop-priority' }},\n );\n\n if (!result.error && result.data) {\n return;\n } else if (result.error) {\n throw new Error(\"Error Fetching Result in dispatch-api/updateStopPriority:\" + result.error);\n } else {\n throw new Error('Unknown error: result does not contain data or error.');\n }\n } catch (error) {\n console.error('Error:', error);\n throw error;\n }\n}\n","import { useDrag, useDrop } from 'react-dnd';\nimport { DragItem, Stop } from '../../_models';\nimport StopCard from './StopCard';\nimport { updateStopPriority } from '@/data/SupabaseRequests/dispatch-api/updateStopPriority';\n\n// DraggableStopCard Component\ntype DraggableStopCardProps = {\n stop: Stop;\n index: number;\n moveStop: (dragIndex: number, hoverIndex: number) => void;\n};\n\nexport function DraggableStopCard({\n stop,\n index,\n moveStop,\n}: DraggableStopCardProps) {\n const [{ isDragging }, drag] = useDrag({\n type: 'STOP', // Use a generic type for stops so they can move between routes\n item: { index, stop }, // Pass the stop object along with the index\n collect: (monitor) => ({\n isDragging: monitor.isDragging(),\n }),\n });\n\n const [, drop] = useDrop({\n accept: 'STOP', // Accept any stop\n hover: (item: DragItem) => {\n moveStop(item.index, index);\n item.index = index;\n },\n\n drop: (item: DragItem) => {\n //add a funciton here to update Stop Position in the database\n updateStopPriority({\n stop_id: item.stop.id,\n priority: index,\n });\n },\n });\n\n return (\n drag(drop(node))}\n className={`${isDragging && 'opacity-50'} `}\n style={{ cursor: 'move' }}\n >\n \n \n );\n}\n","import { useState } from 'react';\nimport { Stop } from '../../_models';\nimport { DraggableStopCard } from '../Stops/DraggableStopCard';\nimport StopCard from '../Stops/StopCard';\nimport AddStopsToRoute from './AddStopsToRoute';\nimport { useSelectedStops } from '../../contexts/useSelected';\n\ntype Props = {\n stops: Stop[];\n isFiltered: boolean;\n route_id: string;\n};\n\nexport default function RouteStops({ stops, isFiltered, route_id }: Props) {\n const [updatedStops, setUpdatedStops] = useState(\n [...stops].sort((a, b) => a.priority - b.priority),\n );\n const { selectedStops } = useSelectedStops();\n\n const moveStop = (dragIndex: number, hoverIndex: number) => {\n const draggedStop = updatedStops[dragIndex];\n const updatedList = [...updatedStops];\n\n // Remove the dragged stop from its original position\n updatedList.splice(dragIndex, 1);\n\n // Insert it at the new hover position\n updatedList.splice(hoverIndex, 0, draggedStop);\n\n // Update the priority of the stops based on their new position\n const reorderedStops = updatedList.map((stop, index) => ({\n ...stop,\n priority: index + 1, // Update priority to be 1-based\n }));\n\n setUpdatedStops(reorderedStops);\n };\n\n return (\n
\n {updatedStops.map((stop, index) => (\n
\n {isFiltered ? (\n
\n \n
\n ) : (\n \n )}\n
\n ))}\n {selectedStops.length > 0 && }\n
\n );\n}\n","import * as React from 'react';\nimport * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';\nimport { Check, ChevronRight, Circle } from 'lucide-react';\n\nimport { cn } from '@/lib/utils';\n\nconst DropdownMenu = DropdownMenuPrimitive.Root;\n\nconst DropdownMenuTrigger = DropdownMenuPrimitive.Trigger;\n\nconst DropdownMenuGroup = DropdownMenuPrimitive.Group;\n\nconst DropdownMenuPortal = DropdownMenuPrimitive.Portal;\n\nconst DropdownMenuSub = DropdownMenuPrimitive.Sub;\n\nconst DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup;\n\nconst DropdownMenuSubTrigger = React.forwardRef<\n React.ElementRef,\n React.ComponentPropsWithoutRef & {\n inset?: boolean;\n }\n>(({ className, inset, children, ...props }, ref) => (\n \n {children}\n \n \n));\nDropdownMenuSubTrigger.displayName =\n DropdownMenuPrimitive.SubTrigger.displayName;\n\nconst DropdownMenuSubContent = React.forwardRef<\n React.ElementRef,\n React.ComponentPropsWithoutRef\n>(({ className, ...props }, ref) => (\n \n));\nDropdownMenuSubContent.displayName =\n DropdownMenuPrimitive.SubContent.displayName;\n\nconst DropdownMenuContent = React.forwardRef<\n React.ElementRef,\n React.ComponentPropsWithoutRef\n>(({ className, sideOffset = 4, ...props }, ref) => (\n \n \n \n));\nDropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;\n\nconst DropdownMenuItem = React.forwardRef<\n React.ElementRef,\n React.ComponentPropsWithoutRef & {\n inset?: boolean;\n }\n>(({ className, inset, ...props }, ref) => (\n \n));\nDropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;\n\nconst DropdownMenuCheckboxItem = React.forwardRef<\n React.ElementRef,\n React.ComponentPropsWithoutRef\n>(({ className, children, checked, ...props }, ref) => (\n \n \n \n \n \n \n {children}\n \n));\nDropdownMenuCheckboxItem.displayName =\n DropdownMenuPrimitive.CheckboxItem.displayName;\n\nconst DropdownMenuRadioItem = React.forwardRef<\n React.ElementRef,\n React.ComponentPropsWithoutRef\n>(({ className, children, ...props }, ref) => (\n \n \n \n \n \n \n {children}\n \n));\nDropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName;\n\nconst DropdownMenuLabel = React.forwardRef<\n React.ElementRef,\n React.ComponentPropsWithoutRef & {\n inset?: boolean;\n }\n>(({ className, inset, ...props }, ref) => (\n \n));\nDropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName;\n\nconst DropdownMenuSeparator = React.forwardRef<\n React.ElementRef,\n React.ComponentPropsWithoutRef\n>(({ className, ...props }, ref) => (\n \n));\nDropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName;\n\nconst DropdownMenuShortcut = ({\n className,\n ...props\n}: React.HTMLAttributes) => {\n return (\n \n );\n};\nDropdownMenuShortcut.displayName = 'DropdownMenuShortcut';\n\nexport {\n DropdownMenu,\n DropdownMenuTrigger,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuCheckboxItem,\n DropdownMenuRadioItem,\n DropdownMenuLabel,\n DropdownMenuSeparator,\n DropdownMenuShortcut,\n DropdownMenuGroup,\n DropdownMenuPortal,\n DropdownMenuSub,\n DropdownMenuSubContent,\n DropdownMenuSubTrigger,\n DropdownMenuRadioGroup,\n};\n","import { Printer } from 'lucide-react';\nimport { DropdownMenuItem } from '@/components/primitives/DropdownMenu';\n\ntype Props = {\n route_id: string;\n setShowManifest: (showing: boolean) => void;\n};\n\nexport default function RouteManifestButton({\n route_id,\n setShowManifest,\n}: Props) {\n return (\n \n setShowManifest(true)}\n >\n \n Manifest\n \n \n );\n}\n","'use client';\n\nimport * as React from 'react';\nimport { ChevronLeft, ChevronRight } from 'lucide-react';\nimport { DayPicker } from 'react-day-picker';\n\nimport { cn } from '@/lib/utils';\nimport { buttonVariants } from '@/components/primitives/Button';\n\nexport type CalendarProps = React.ComponentProps;\n\nfunction Calendar({\n className,\n classNames,\n showOutsideDays = true,\n ...props\n}: CalendarProps) {\n return (\n ,\n IconRight: ({ ...props }) => ,\n }}\n {...props}\n />\n );\n}\nCalendar.displayName = 'Calendar';\n\nexport { Calendar };\n","import { supabase } from \"../../supabase\";\n\n// To regenerate this file, run the CLI command `deno run --allow-read --allow-write --allow-sys schema_to_ts.ts`. The script is located in the supabase-functions directory.\n\n\n/**\n * This interface was referenced by `Interface`'s JSON-Schema\n * via the `definition` \"updateRouteParams\".\n */\nexport interface UpdateRouteParams {\n function: \"update-route\";\n driver_id: string | null;\n route_name: string | null;\n route_date: string | null;\n route_id: string;\n}\n\n\nexport async function updateRoute(\n params: Omit,\n): Promise{\n try {\n const result = await supabase.functions.invoke( \n 'dispatch-api',\n { body: { ...params, function: 'update-route' }},\n );\n\n if (!result.error && result.data) {\n return;\n } else if (result.error) {\n throw new Error(\"Error Fetching Result in dispatch-api/updateRoute:\" + result.error);\n } else {\n throw new Error('Unknown error: result does not contain data or error.');\n }\n } catch (error) {\n console.error('Error:', error);\n throw error;\n }\n}\n","import { useMutation, useQueryClient } from 'react-query';\nimport { CurrentDayData, EditableRouteFields } from '../_models';\nimport { updateRoute } from '@/data/SupabaseRequests/dispatch-api/updateRoute';\nimport { useDispatchURL } from '../contexts/useDispatchURL';\nimport { useAuth } from '@/data/auth';\n\nexport function useEditRoute() {\n const queryClient = useQueryClient();\n\n const { stations } = useAuth();\n const { currentDay } = useDispatchURL();\n\n return useMutation(\n async ({\n route_id,\n route_details,\n }: {\n route_id: string;\n route_details: EditableRouteFields;\n }) => {\n const originalData: CurrentDayData | undefined = queryClient.getQueryData(\n [currentDay, stations],\n );\n\n if (!originalData) {\n console.error('Original data not found');\n return;\n }\n\n const originalRoutes = originalData.routes || [];\n const originalRoute = originalRoutes.find(\n (route) => route.id === route_id,\n );\n\n if (!originalRoute) {\n console.error('Original route not found');\n return;\n }\n\n // Check if the route date is being changed (moving the route)\n const isDateChange = route_details.date !== null;\n\n let updatedRoutes = originalRoutes;\n\n if (isDateChange) {\n // Remove the route from the current list\n if (route_details.date !== currentDay) {\n updatedRoutes = originalRoutes.filter(\n (route) => route.id !== route_id,\n );\n }\n } else {\n // Update the route in place\n updatedRoutes = originalRoutes.map((route) =>\n route.id === route_id\n ? {\n ...route,\n name: route_details.name ?? route.name,\n driver: route_details.driver ?? route.driver,\n }\n : route,\n );\n }\n\n const updatedData = {\n ...originalData,\n routes: updatedRoutes,\n unnassigned_stops: originalData.unnassigned_stops || [],\n };\n\n try {\n // Update the route in the backend\n await updateRoute({\n driver_id: route_details.driver?.id || null,\n route_date: route_details.date || null,\n route_id: route_id,\n route_name: route_details.name || null,\n });\n\n // Update the cache with the updated data\n queryClient.setQueryData(\n [currentDay, stations],\n updatedData,\n );\n } catch (error) {\n console.error(error);\n }\n },\n );\n}\n","import { supabase } from \"../../supabase\";\n\n// To regenerate this file, run the CLI command `deno run --allow-read --allow-write --allow-sys schema_to_ts.ts`. The script is located in the supabase-functions directory.\n\n\n/**\n * This interface was referenced by `Interface`'s JSON-Schema\n * via the `definition` \"deleteRouteParams\".\n */\nexport interface DeleteRouteParams {\n function: \"delete-route\";\n route_id: string;\n}\n\n\nexport async function deleteRoute(\n params: Omit,\n): Promise{\n try {\n const result = await supabase.functions.invoke( \n 'dispatch-api',\n { body: { ...params, function: 'delete-route' }},\n );\n\n if (!result.error && result.data) {\n return;\n } else if (result.error) {\n throw new Error(\"Error Fetching Result in dispatch-api/deleteRoute:\" + result.error);\n } else {\n throw new Error('Unknown error: result does not contain data or error.');\n }\n } catch (error) {\n console.error('Error:', error);\n throw error;\n }\n}\n","import { useMutation, useQueryClient } from 'react-query';\nimport { useDispatchURL } from '../contexts/useDispatchURL';\nimport { CurrentDayData } from '../_models';\nimport { deleteRoute } from '@/data/SupabaseRequests/dispatch-api/deleteRoute';\nimport { useAuth } from '@/data/auth';\n\nexport function useDeleteRoute() {\n const queryClient = useQueryClient();\n const { currentDay } = useDispatchURL();\n const { stations } = useAuth();\n\n return useMutation(async ({ route_id }: { route_id: string }) => {\n const originalData: CurrentDayData | undefined = queryClient.getQueryData([\n currentDay,\n stations,\n ]);\n\n const updatedRoutes = originalData?.routes.filter(\n (route) => route.id !== route_id,\n );\n\n //need to find the route that is being deleted and move the stops to unnassigned_stops\n const routeToDelete = originalData?.routes.find(\n (route) => route.id === route_id,\n );\n\n const updatedStops = originalData?.unnassigned_stops.concat(\n routeToDelete?.stops || [],\n );\n\n try {\n await deleteRoute({ route_id });\n queryClient.setQueryData(\n [currentDay, stations],\n (oldData) => {\n if (!oldData) {\n return oldData;\n }\n\n return {\n unnassigned_stops: updatedStops || [],\n routes: updatedRoutes || [],\n };\n },\n );\n } catch (error) {\n console.error(error);\n }\n });\n}\n","import React from 'react';\nimport { MoreVertical, CalendarIcon, Trash2 } from 'lucide-react';\nimport RouteManifestButton from '../Manifest/RouteManifest/RouteManifestButton';\nimport {\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuSub,\n DropdownMenuSubContent,\n DropdownMenuSubTrigger,\n DropdownMenuTrigger,\n} from '@/components/primitives/DropdownMenu';\nimport { Calendar } from '@/components/primitives/Calendar';\nimport { LUDate } from '@/common/classes/LUDate';\nimport { useEditRoute } from '../../mutations/useEditRoute';\nimport { useDeleteRoute } from '../../mutations/useDeleteRoute';\n\ntype Props = {\n route_id: string;\n setShowManifest: (showing: boolean) => void;\n};\n\nexport default function RouteActions({ route_id, setShowManifest }: Props) {\n const editRoute = useEditRoute();\n const deleteRoute = useDeleteRoute();\n\n const changeDate = (date: LUDate) => {\n editRoute.mutate({\n route_id: route_id,\n route_details: {\n name: null,\n date: date.asHTMLInputValue(),\n driver: null,\n },\n });\n };\n\n const onDeleteRoute = async () => {\n await deleteRoute.mutateAsync({ route_id });\n };\n\n return (\n \n \n \n \n \n {/* Move To with Calendar as a Submenu */}\n \n \n
\n \n Move To\n
\n
\n \n changeDate(new LUDate(e))} />\n \n
\n\n {/* Manifest */}\n\n \n\n {/* Delete Route */}\n \n
\n \n Delete Route\n
\n
\n
\n
\n );\n}\n","import React, { useState, useRef } from 'react';\nimport { Input } from '@/components/primitives/Input';\nimport { useOutsideClick } from '@/common/hooks/useOutsideClick';\nimport { useDispatchURL } from '../../contexts/useDispatchURL';\n\ntype Props = {\n name: string;\n onSubmit: (name: string) => void;\n};\n\nexport default function EditableRouteName({ name, onSubmit }: Props) {\n const [isEditing, setIsEditing] = useState(false);\n const [inputValue, setInputValue] = useState(name);\n const { search } = useDispatchURL();\n const inputRef = useRef(null);\n\n // Handle click outside to submit and exit edit mode\n useOutsideClick(inputRef, () => handleSubmit());\n\n const handleSubmit = () => {\n if (inputValue !== name) {\n onSubmit(inputValue); // Call the onSubmit function if the name has changed\n }\n setIsEditing(false); // Exit edit mode\n };\n\n const handleKeyDown = (event: React.KeyboardEvent) => {\n if (event.key === 'Enter') {\n handleSubmit();\n }\n };\n\n return (\n
\n {isEditing ? (\n setInputValue(e.target.value)}\n onKeyDown={handleKeyDown}\n onBlur={handleSubmit} // Handle onBlur to submit when focus is lost\n autoFocus\n className=\"font-bold\"\n />\n ) : (\n setIsEditing(true)}\n >\n {highlightMatch(name, search)}\n
\n )}\n \n );\n}\n\nfunction highlightMatch(routeName: string, search: string) {\n const name = routeName.trim() === '' ? 'Unnamed Route' : routeName; // If the route name is empty, display 'Unnamed Route'\n if (!search) return name; // If no search, return the full store_num as is\n\n const regex = new RegExp(`(${search})`, 'i'); // Case-insensitive regex to find the search term\n const parts = name.split(regex); // Split the store_num into parts based on the search\n\n return (\n <>\n {parts.map((part, index) =>\n regex.test(part) ? (\n \n {part}\n \n ) : (\n part\n ),\n )}\n \n );\n}\n","import { supabase } from \"../../supabase\";\n\n// To regenerate this file, run the CLI command `deno run --allow-read --allow-write --allow-sys schema_to_ts.ts`. The script is located in the supabase-functions directory.\n\n/**\n * This interface was referenced by `Interface`'s JSON-Schema\n * via the `definition` \"getDriversResponse\".\n */\nexport type GetDriversResponse = {\n id: string;\n name: string;\n}[];\n\n\n/**\n * This interface was referenced by `Interface`'s JSON-Schema\n * via the `definition` \"getDriversParams\".\n */\nexport interface GetDriversParams {\n function: \"get-drivers\";\n}\n\n\nexport async function getDrivers(\n params: Omit,\n){\n try {\n const result = await supabase.functions.invoke( \n 'dispatch-api',\n { body: { ...params, function: 'get-drivers' }},\n );\n\n if (!result.error && result.data) {\n return result.data;\n } else if (result.error) {\n throw new Error(\"Error Fetching Result in dispatch-api/getDrivers:\" + result.error);\n } else {\n throw new Error('Unknown error: result does not contain data or error.');\n }\n } catch (error) {\n console.error('Error:', error);\n throw error;\n }\n}\n","import { useState, useRef } from 'react';\nimport { NamedReference } from '@/common/types/NamedReference';\nimport { getDrivers } from '@/data/SupabaseRequests/dispatch-api/getDrivers';\nimport { useQuery } from 'react-query';\nimport { useOutsideClick } from '@/common/hooks/useOutsideClick';\nimport { Input } from '@/components/primitives/Input';\n\ntype Props = {\n driver: NamedReference | null;\n onSubmit: (driver: NamedReference) => void;\n};\n\nexport default function EditableDriver({ driver, onSubmit }: Props) {\n const [isEditing, setIsEditing] = useState(false);\n const [selectedDriver, setSelectedDriver] = useState(driver);\n const [searchTerm, setSearchTerm] = useState('');\n const dropdownRef = useRef(null);\n\n // Close the dropdown and submit the driver if clicked outside\n useOutsideClick(dropdownRef, () => {\n if (isEditing && selectedDriver) {\n if (selectedDriver?.id !== driver?.id) {\n onSubmit(selectedDriver);\n }\n }\n setIsEditing(false);\n });\n\n const { data: driversList } = useQuery({\n queryKey: ['drivers'],\n queryFn: () => getDrivers({}),\n enabled: isEditing,\n });\n\n const handleDriverChange = (newDriver: NamedReference) => {\n setSelectedDriver(newDriver);\n setSearchTerm(newDriver.name); // Update the search term to reflect the selected driver\n if (driver?.id !== newDriver.id) {\n onSubmit(newDriver);\n }\n setIsEditing(false); // Close editing after selection\n };\n\n const filteredDrivers = driversList?.filter((driver) =>\n driver.name.toLowerCase().includes(searchTerm.toLowerCase()),\n );\n\n return (\n
\n {isEditing ? (\n
\n {/* Search Input */}\n setSearchTerm(e.target.value)}\n className=\"border p-1 rounded w-full bg-white\"\n placeholder=\"Search drivers...\"\n />\n\n {/* Filtered Drivers List */}\n {filteredDrivers?.length ? (\n
    \n {filteredDrivers.map((driver) => (\n handleDriverChange(driver)}\n className=\"p-2 cursor-pointer hover:bg-gray-100\"\n >\n {driver.name}\n \n ))}\n
\n ) : (\n
\n No drivers found\n
\n )}\n
\n ) : (\n setIsEditing(true)}\n >\n {driver?.name || 'No Driver Assigned'}\n
\n )}\n \n );\n}\n","import { supabase } from \"../../supabase\";\n\n// To regenerate this file, run the CLI command `deno run --allow-read --allow-write --allow-sys schema_to_ts.ts`. The script is located in the supabase-functions directory.\n\n/**\n * This interface was referenced by `Interface`'s JSON-Schema\n * via the `definition` \"createRouteResponse\".\n */\nexport type CreateRouteResponse = string;\n\n\n/**\n * This interface was referenced by `Interface`'s JSON-Schema\n * via the `definition` \"createRouteParams\".\n */\nexport interface CreateRouteParams {\n function: \"create-route\";\n date: string;\n name: string | null;\n driver_id: string | null;\n station_id: string;\n}\n\n\nexport async function createRoute(\n params: Omit,\n){\n try {\n const result = await supabase.functions.invoke( \n 'dispatch-api',\n { body: { ...params, function: 'create-route' }},\n );\n\n if (!result.error && result.data) {\n return result.data;\n } else if (result.error) {\n throw new Error(\"Error Fetching Result in dispatch-api/createRoute:\" + result.error);\n } else {\n throw new Error('Unknown error: result does not contain data or error.');\n }\n } catch (error) {\n console.error('Error:', error);\n throw error;\n }\n}\n","import { useMutation, useQueryClient } from 'react-query';\nimport { CurrentDayData, Route } from '../_models';\nimport { createRoute } from '@/data/SupabaseRequests/dispatch-api/createRoute';\nimport { useDispatchURL } from '../contexts/useDispatchURL';\nimport { useAuth } from '@/data/auth';\n\nexport function useAddLocalRoute() {\n const queryClient = useQueryClient();\n const { currentDay } = useDispatchURL();\n const { stations } = useAuth();\n\n return useMutation(async ({ stationID }: { stationID: string }) => {\n const newRoute: Route = {\n id: new Date().toISOString(),\n name: 'New Route',\n driver: null,\n state: 'Building',\n started_at: null,\n completed_at: null,\n stops: [],\n isNew: true,\n station_id: stationID,\n };\n\n try {\n queryClient.setQueryData(\n [currentDay, stations],\n (oldData) => {\n if (!oldData) {\n return oldData;\n }\n\n return {\n ...oldData,\n routes: [newRoute, ...oldData.routes],\n };\n },\n );\n } catch (error) {\n console.error(error);\n }\n });\n}\n\nexport function useAddRoute() {\n const queryClient = useQueryClient();\n const { stations } = useAuth();\n const { currentDay } = useDispatchURL();\n\n return useMutation(\n async ({\n stationID,\n name,\n driver_id,\n route_id,\n }: {\n stationID: string;\n name: string | null;\n driver_id: string | null;\n route_id: string;\n }) => {\n try {\n const new_route_id = await createRoute({\n station_id: stationID,\n date: currentDay,\n name: name,\n driver_id: driver_id,\n });\n\n const updatedRoute = {\n id: new_route_id,\n name: name ?? 'New Route',\n driver: driver_id ? { id: driver_id, name: '' } : null,\n state: 'Building' as Route['state'],\n started_at: null,\n completed_at: null,\n stops: [],\n isNew: false,\n station_id: stationID,\n };\n\n queryClient.setQueryData(\n [currentDay, stations],\n (oldData) => {\n if (!oldData) {\n return oldData;\n }\n\n return {\n ...oldData,\n routes: [\n updatedRoute,\n ...oldData.routes.filter((route) => route.id !== route_id),\n ],\n };\n },\n );\n } catch (error) {\n console.error(error);\n }\n },\n );\n}\n","import { supabase } from \"../../supabase\";\n\n// To regenerate this file, run the CLI command `deno run --allow-read --allow-write --allow-sys schema_to_ts.ts`. The script is located in the supabase-functions directory.\n\n\n/**\n * This interface was referenced by `Interface`'s JSON-Schema\n * via the `definition` \"getRouteManifestDataParams\".\n */\nexport interface GetRouteManifestDataParams {\n function: \"get-route-manifest-data\";\n route_id: string;\n}\n/**\n * This interface was referenced by `Interface`'s JSON-Schema\n * via the `definition` \"getRouteManifestDataResponse\".\n */\nexport interface GetRouteManifestDataResponse {\n manifests: {\n stop_info: {\n line_1: string;\n line_2: string;\n city: string;\n state: string;\n zip: string;\n store_number: string;\n };\n pos?: {\n name?: string;\n signature?: string;\n driver_name?: string;\n time_of_delivery?: string;\n notes?: string;\n };\n shipper_info: {\n abv: string;\n name: string;\n };\n carrier_info: {\n abv: string;\n name: string;\n line_1: string;\n line_2: string;\n city: string;\n state: string;\n zip: string;\n };\n shipments: {\n tracking_id: string;\n delivered: string | null;\n bol: string;\n missing: string | null;\n weight: number;\n overage: string | null;\n damaged: boolean;\n load: string;\n }[];\n }[];\n}\n\n\nexport async function getRouteManifestData(\n params: Omit,\n){\n try {\n const result = await supabase.functions.invoke( \n 'dispatch-api',\n { body: { ...params, function: 'get-route-manifest-data' }},\n );\n\n if (!result.error && result.data) {\n return result.data;\n } else if (result.error) {\n throw new Error(\"Error Fetching Result in dispatch-api/getRouteManifestData:\" + result.error);\n } else {\n throw new Error('Unknown error: result does not contain data or error.');\n }\n } catch (error) {\n console.error('Error:', error);\n throw error;\n }\n}\n","import { View, Text, StyleSheet } from '@react-pdf/renderer';\nimport { ManifestShipment } from '../models';\n\ntype Props = {\n shipments: ManifestShipment[];\n};\n\nconst styles = StyleSheet.create({\n container: {\n border: 'solid black', // Border around the entire ShipmentsSection\n borderWidth: 0.5,\n margin: 20,\n },\n grid: {\n display: 'flex',\n flexDirection: 'row',\n flexWrap: 'wrap', // Allows items to wrap into rows\n },\n column: {\n width: '25%', // Three columns, each taking up 1/3 of the width\n padding: 5,\n },\n trackingText: {\n fontSize: 8,\n fontWeight: 700,\n },\n scanText: {\n fontSize: 8, // Small text size\n },\n totalInfoContainer: {\n marginTop: 20, // Add some space above the total info section\n marginLeft: 10,\n marginRight: 10,\n marginBottom: 5,\n borderTop: '1pt solid black', // Optional border above the total info section\n paddingTop: 5,\n display: 'flex',\n flexDirection: 'row', // Makes the total info side by side\n justifyContent: 'space-between', // Ensures even spacing between them\n },\n infoBox: {\n width: '48%', // Each item takes up half of the space with some margin\n },\n totalInfoText: {\n fontSize: 10,\n fontWeight: 700,\n marginBottom: 2,\n },\n underline: {\n borderBottom: '1pt solid black', // Underline style\n paddingBottom: 2, // Space between text and underline\n },\n});\n\nexport function ShipmentsSection({ shipments }: Props) {\n return (\n \n \n {shipments.map((shipment) => (\n \n {shipment.tracking_id}\n \n ))}\n \n \n );\n}\n","import React from 'react';\nimport { StyleSheet, Text, View } from '@react-pdf/renderer';\nimport { LUDate } from '@/common/classes/LUDate';\nimport { PDFProps } from '../models';\n\ntype Props = {\n carrier_info: PDFProps['carrier_info'];\n shipper_info: PDFProps['shipper_info'];\n stop_info: PDFProps['stop_info'];\n date: string;\n bols: string[];\n trailers: string[];\n};\n\nconst styles = StyleSheet.create({\n headerContainer: {\n padding: 20,\n },\n title: {\n textAlign: 'center',\n fontSize: 12,\n fontWeight: 'bold',\n marginBottom: 10,\n },\n row: {\n display: 'flex',\n flexDirection: 'row',\n justifyContent: 'space-between',\n alignItems: 'flex-start',\n },\n block: {\n width: '30%', // Ensure three sections fit side by side\n },\n textLine: {\n fontSize: 9,\n marginBottom: 2,\n },\n boldText: {\n fontSize: 12,\n fontWeight: 'bold',\n },\n});\n\nexport default function HeaderSection({\n carrier_info,\n shipper_info,\n stop_info,\n date,\n bols,\n trailers,\n}: Props) {\n const dateString = new LUDate(date)\n .addDays(1)\n .toString(true, false, true, true);\n\n const storeNumberStr = stop_info.store_number.replace(/^0+/, '');\n\n const isBSG =\n storeNumberStr.startsWith('9') || storeNumberStr.startsWith('8');\n\n return (\n \n {/* Main Header */}\n \n {isBSG ? 'CosmoProf' : shipper_info.name} (\n {isBSG ? 'BSG' : shipper_info.abv}) - Store {stop_info.store_number}\n \n\n {/* Row with three sections */}\n \n {/* Deliver To Section */}\n \n Deliver To:\n \n {isBSG ? 'CosmoProf' : shipper_info.name} (\n {isBSG ? 'BSG' : shipper_info.abv})\n \n {stop_info.line_1}\n \n {stop_info.city}, {stop_info.state} {stop_info.zip}\n \n {/* {stop_info.phone} */}\n \n\n {/* Center Section (Delivery Date, BOL, etc.) */}\n \n Delivery Date: {dateString}\n BOL: {bols.join(', ')}\n Trailer: {trailers.join(', ')}\n \n\n {/* Carrier Section */}\n \n Carrier:\n {/* \n {carrier_info.name} ({carrier_info.abv})\n \n {carrier_info.line_1}\n \n {carrier_info.city}, {carrier_info.state} {carrier_info.zip}\n */}\n {/* {carrier_info.phone} */}\n \n \n \n );\n}\n","import React from 'react';\nimport { Text, View, StyleSheet } from '@react-pdf/renderer';\nimport { ManifestProblemShipment } from '../models';\n\ntype Props = {\n shipments: ManifestProblemShipment[];\n};\n\nconst styles = StyleSheet.create({\n container: {\n margin: 20,\n marginTop: 30,\n },\n row: {\n display: 'flex',\n flexDirection: 'row',\n },\n bottomRowBox: {\n border: 'solid black',\n borderWidth: 0.5,\n minHeight: 300,\n width: '33.33%',\n display: 'flex',\n flexDirection: 'column',\n padding: 10,\n },\n totalDeliveredBox: {\n border: 'solid black',\n borderWidth: 0.5,\n minHeight: 100,\n width: '33.33%',\n display: 'flex',\n flexDirection: 'column',\n },\n titleContainer: {\n marginBottom: 10,\n },\n totalDeliveredContainer: {\n minHeight: 50,\n },\n divider: {\n width: '100%',\n height: 1,\n backgroundColor: 'black',\n },\n boxTitle: {\n fontSize: 10,\n fontWeight: 'bold',\n textAlign: 'center',\n marginTop: 5,\n },\n shipmentText: {\n fontSize: 10,\n textAlign: 'center',\n marginTop: 5, // Ensures proper spacing below the divider\n },\n largeBox: {\n width: '66.67%',\n },\n lastBox: {\n borderRight: 'solid black',\n borderWidth: 0.5,\n },\n});\n\nexport default function ProblemShipmentsSection({ shipments }: Props) {\n // Remove from overage and missing if they exist in both\n const filteredShipments = shipments.filter(\n (shipment) => !shipment.overage && !shipment.missing,\n );\n\n // Filter shipments by their respective problems\n const overageShipments = filteredShipments.filter(\n (shipment) => shipment.overage,\n );\n const missingShipments = filteredShipments.filter(\n (shipment) => shipment.missing,\n );\n const damagedShipments = filteredShipments.filter(\n (shipment) => shipment.damage,\n );\n\n return (\n \n {/* Row containing Total Delivered and Comments */}\n \n {/* Total Delivered Box */}\n \n {/* Title at the top */}\n \n Total Delivered\n \n {/* Divider Line */}\n \n {/* Text directly below the line */}\n \n No. Of Cartons Returned\n \n \n\n {/* Comments Box */}\n \n Comments\n \n \n\n {/* Row containing the three boxes */}\n \n {/* Overage Box */}\n \n Overage\n {overageShipments.length > 0 &&\n overageShipments.map((shipment) => (\n \n {shipment.tracking_id}\n \n ))}\n \n\n {/* Missing Box */}\n \n Missing\n {missingShipments.length > 0 &&\n missingShipments.map((shipment) => (\n \n {shipment.tracking_id}\n \n ))}\n \n\n {/* Damaged Box */}\n \n Damaged\n {damagedShipments.length > 0 &&\n damagedShipments.map((shipment) => (\n \n {shipment.tracking_id}\n \n ))}\n \n \n \n );\n}\n","import React from 'react';\nimport { StyleSheet, View, Text, Image } from '@react-pdf/renderer';\nimport { PDFProps } from '../models';\nimport { LUDate } from '@/common/classes/LUDate';\n\ntype Props = {\n pos: PDFProps['pos'];\n};\n\nconst styles = StyleSheet.create({\n container: {\n display: 'flex',\n flexDirection: 'row',\n marginTop: 20,\n marginHorizontal: 10,\n marginLeft: 20,\n },\n column: {\n width: '50%', // Split into two equal columns\n marginHorizontal: 10,\n },\n fieldContainer: {\n marginBottom: 25,\n },\n underline: {\n borderBottom: 'solid black', // Underline style\n borderBottomWidth: 0.5,\n paddingBottom: 2,\n marginBottom: 5,\n },\n fieldName: {\n fontSize: 10, // Small font for field name below underline\n fontWeight: 300,\n },\n signatureImage: {\n width: '100%', // Full width of the container\n height: 40,\n objectFit: 'contain', // Ensure the image fits well\n },\n});\n\nexport function ProofOfStopSection({ pos }: Props) {\n return (\n \n {/* First Column */}\n \n {/* Driver Name */}\n \n {pos?.driver_name || ''}\n Driver Name\n \n\n {/* Driver Signature */}\n \n {pos?.signature ? (\n \n ) : (\n \n )}\n Driver Signature\n \n\n {/* Date Of Delivery */}\n \n \n {pos?.time_of_delivery\n ? new LUDate(pos.time_of_delivery).toLocaleString()\n : ''}\n \n Date Of Delivery\n \n \n\n {/* Second Column */}\n \n {/* Manager Name */}\n \n {pos?.name || ''}\n Manager Name\n \n\n {/* Manager Signature */}\n \n {pos?.signature ? (\n \n ) : (\n \n )}\n Manager Signature\n \n\n {/* Time Of Delivery */}\n \n {pos?.notes || ''}\n Time Of Delivery\n \n \n \n );\n}\n","import { View, Text, StyleSheet } from '@react-pdf/renderer';\n\ntype Props = {\n totalCartons: number;\n totalWeight: number;\n};\n\nconst styles = StyleSheet.create({\n totalInfoContainer: {\n marginTop: 5, // Add some space above the total info section\n marginHorizontal: 20,\n display: 'flex',\n flexDirection: 'row', // Makes the boxes side by side\n justifyContent: 'space-between', // Ensures even spacing between them\n },\n infoBox: {\n width: '48%', // Each box takes up half of the space\n border: 'solid black', // Border around the entire ShipmentsSection\n borderWidth: 0.5,\n padding: 5, // Padding inside the box\n textAlign: 'center', // Center the text horizontally\n },\n infoText: {\n fontSize: 10,\n fontWeight: 'bold',\n },\n});\n\nexport function TotalsSection({ totalCartons, totalWeight }: Props) {\n return (\n \n \n Total Cartons: {totalCartons}\n \n \n Total Weight: {totalWeight} lbs\n \n \n );\n}\n","import React from 'react';\nimport { Page, Document } from '@react-pdf/renderer';\nimport { ShipmentsSection } from './ShipmentsSection';\nimport HeaderSection from './HeaderSection';\nimport ProblemShipmentsSection from './ProblemShipmentsSection';\nimport { ProofOfStopSection } from './ProofOfStopSection';\nimport { PDFProps, ManifestProblemShipment, ManifestShipment } from '../models';\nimport { TotalsSection } from './TotalsSection';\n\nconst FIRST_PAGE_SHIPMENTS = 120;\nconst REMAINING_SHIPMENTS = 180;\n\ntype Props = {\n pdfProps: PDFProps;\n stop_shipments: ManifestShipment[];\n problem_shipments: ManifestProblemShipment[];\n date: string;\n};\n\nexport default function StopManifestDocument({\n pdfProps,\n stop_shipments,\n problem_shipments,\n date,\n}: Props) {\n const bols = stop_shipments.map((shipment) => shipment.bol);\n const trailers = stop_shipments.map((shipment) => shipment.load_trailer);\n\n const bolSet = new Set(bols);\n const trailerSet = new Set(trailers);\n\n // Split shipments: First 64 for the first page, and groups of 80 for subsequent pages\n const firstPageShipments = stop_shipments.slice(0, FIRST_PAGE_SHIPMENTS);\n const remainingShipments = stop_shipments.slice(REMAINING_SHIPMENTS);\n const paginatedShipments = [];\n for (let i = 0; i < remainingShipments.length; i += REMAINING_SHIPMENTS) {\n paginatedShipments.push(\n remainingShipments.slice(i, i + REMAINING_SHIPMENTS),\n );\n }\n\n const totalCartons = stop_shipments.length;\n const totalWeight = stop_shipments.reduce(\n (acc, shipment) => acc + shipment.weight,\n 0,\n );\n\n return (\n <>\n \n \n \n {paginatedShipments.length === 0 && (\n \n )}\n \n\n {/* Remaining pages */}\n {paginatedShipments.map((shipmentGroup, index) => (\n \n \n \n \n ))}\n \n \n \n\n \n \n \n );\n}\n","import { Text, View, StyleSheet } from '@react-pdf/renderer';\n\nconst styles = StyleSheet.create({\n page: {\n padding: 20,\n },\n header: {\n fontSize: 18,\n textAlign: 'center',\n marginBottom: 10,\n },\n section: {\n marginBottom: 15,\n },\n label: {\n fontSize: 12,\n color: '#555',\n },\n value: {\n fontSize: 14,\n marginBottom: 5,\n },\n infoRow: {\n flexDirection: 'row',\n justifyContent: 'space-between',\n marginBottom: 5,\n },\n carrierInfo: {\n fontSize: 12,\n },\n});\n\ntype RouteManifestCover = {\n driver_name: string;\n route_name: string;\n stops: number;\n pieces: number;\n carrier_info: {\n name: string;\n abv: string;\n };\n};\n\ntype Props = {\n coverProps: RouteManifestCover;\n};\n\nexport default function RouteManifestCoverHeader({ coverProps }: Props) {\n const { driver_name, route_name, stops, pieces, carrier_info } = coverProps;\n\n return (\n \n Route Manifest\n\n \n Driver Name:\n {driver_name}\n \n\n \n Route Name:\n {route_name}\n \n\n \n \n Total Stops:\n {stops}\n \n\n \n Total Pieces:\n {pieces}\n \n \n\n \n Carrier Information:\n {/* \n {carrier_info.name} ({carrier_info.abv})\n */}\n \n \n );\n}\n","import { GetDeliveryPDFInfoResponse } from '@/data/SupabaseRequests/dispatch-api/getDeliveryPDFInfo';\nimport { GetRouteManifestDataResponse } from '@/data/SupabaseRequests/dispatch-api/getRouteManifestData';\n\nexport type PDFProps = GetDeliveryPDFInfoResponse;\n\nexport type ManifestProblemShipment = {\n tracking_id: string;\n overage: boolean;\n missing: boolean;\n damage: boolean;\n};\n\nexport type ManifestShipment = {\n tracking_id: string;\n scanned_at: string | null;\n weight: number;\n bol: string;\n load_trailer: string;\n};\n\nexport type RouteManifestCover = {\n driver_name: string;\n route_name: string;\n stops: number;\n pieces: number;\n carrier_info: {\n name: string;\n abv: string;\n };\n};\n\nexport type RouteManifestStops = {\n shipmentsCount: number;\n totalWeight: number;\n line_1: string;\n line_2: string;\n city: string;\n state: string;\n zip: string;\n store_number: string;\n}[];\n\nexport function manifestConverter(data: GetRouteManifestDataResponse) {\n return {\n driver_name: data.manifests[0].pos?.driver_name ?? '',\n route_name: data.manifests[0].shipper_info.name,\n stops: data.manifests.length,\n pieces: data.manifests.reduce(\n (acc, curr) => acc + curr.shipments.length,\n 0,\n ),\n carrier_info: {\n name: data.manifests[0].carrier_info.name,\n abv: data.manifests[0].carrier_info.abv,\n },\n };\n}\n","import { Text, View, StyleSheet } from '@react-pdf/renderer';\nimport React from 'react';\nimport { RouteManifestStops } from '../models';\n\ntype Props = {\n stops: RouteManifestStops;\n};\n\nconst styles = StyleSheet.create({\n page: {\n padding: 20,\n },\n stopContainer: {\n marginBottom: 10,\n padding: 10,\n borderBottom: '1px solid #ccc',\n width: '100%', // Default width for single-column layout\n },\n stopHeader: {\n fontSize: 14,\n fontWeight: 'bold',\n marginBottom: 4,\n },\n stopInfo: {\n fontSize: 12,\n marginBottom: 2,\n },\n columnLayout: {\n flexDirection: 'row',\n flexWrap: 'wrap', // Wrap to create multiple rows when needed\n justifyContent: 'space-between', // Distribute columns evenly\n },\n twoColumn: {\n width: '48%', // Each column takes up about half the width\n },\n threeColumn: {\n width: '32%', // Each column takes up about a third of the width\n },\n});\n\nexport function RouteManifestCoverStops({ stops }: Props) {\n // Determine the column layout based on the number of stops\n let columnStyle = styles.stopContainer;\n if (stops.length > 4 && stops.length <= 8) {\n columnStyle = { ...styles.stopContainer, ...styles.twoColumn };\n } else if (stops.length > 8) {\n columnStyle = { ...styles.stopContainer, ...styles.threeColumn };\n }\n\n return (\n \n \n Route Manifest - Stops\n \n\n \n {stops.map((stop, index) => (\n \n \n Stop {index + 1} - Store #{stop.store_number}\n \n {stop.line_1}\n {stop.line_2 && {stop.line_2}}\n \n {stop.city}, {stop.state} {stop.zip}\n \n \n Shipments (Pieces): {stop.shipmentsCount}\n \n \n Total Weight: {stop.totalWeight} lbs\n \n \n ))}\n \n \n );\n}\n","import { GetRouteManifestDataResponse } from '@/data/SupabaseRequests/dispatch-api/getRouteManifestData';\nimport { Page } from '@react-pdf/renderer';\nimport React from 'react';\nimport RouteManifestCoverHeader from './RouteManifestCoverHeader';\nimport { manifestConverter } from '../models';\nimport { RouteManifestCoverStops } from './RouteManifestCoverStops';\n\ntype Props = {\n manifestProps: GetRouteManifestDataResponse;\n};\n\nexport default function RouteManifestCover({ manifestProps }: Props) {\n const stopsWithShipments = manifestProps.manifests.flatMap((manifest) => {\n // Ensure we're working with an array of stop_info, map through them\n // Calculate total shipments and weight for the current stop\n const shipmentsForStop = manifest.shipments;\n const stop = manifest.stop_info;\n const shipmentsCount = shipmentsForStop.length;\n const totalWeight = shipmentsForStop.reduce(\n (total, shipment) => total + shipment.weight,\n 0,\n );\n\n // Return the stop info with the additional data\n return {\n ...stop,\n shipmentsCount,\n totalWeight,\n };\n });\n return (\n \n \n \n \n );\n}\n","import { Dialog, DialogContent } from '@/components/primitives/Dialog';\nimport { GetRouteManifestDataResponse } from '@/data/SupabaseRequests/dispatch-api/getRouteManifestData';\nimport { PDFViewer, Document } from '@react-pdf/renderer';\nimport { X } from 'lucide-react';\nimport ReactDOM from 'react-dom';\nimport { Weight } from '@/helpers/Weight';\nimport StopManifestDocument from '../StopManifest/StopManifestDocument';\nimport RouteManifestCover from './RouteManifestCover';\nimport { useDispatchURL } from '@/pages/dispatch/contexts/useDispatchURL';\n\ntype Props = {\n manifestProps: GetRouteManifestDataResponse;\n handleClose: () => void;\n};\n\nexport function RouteMainfestMain({ manifestProps, handleClose }: Props) {\n const { currentDay } = useDispatchURL();\n return ReactDOM.createPortal(\n
\n {/* Close button \n Theres a lot of styling here because i am covering up the built in toolbar with this X, and it is \n covering up the more options button on the toolbar. \n */}\n
\n
\n \n
\n
\n\n \n \n \n {manifestProps?.manifests.map((manifest) => (\n {\n return {\n tracking_id: shipment.tracking_id,\n scanned_at: shipment.delivered,\n weight: new Weight(shipment.weight).inPounds,\n bol: shipment.bol,\n load_trailer: shipment.load,\n };\n })}\n problem_shipments={[]}\n />\n ))}\n \n \n
,\n\n document.body, // Ensure it's rendered at the root level\n );\n}\n","import React from 'react';\nimport { Route, RouteStopFilters } from '../../_models';\nimport RouteStops from './RouteStops';\nimport RouteActions from './RouteActions';\nimport EditableRouteName from './EditableRouteName';\nimport { NamedReference } from '@/common/types/NamedReference';\nimport EditableDriver from './EditableDriver';\nimport { useEditRoute } from '../../mutations/useEditRoute';\nimport { useAddRoute } from '../../mutations/useAddRoute';\nimport { useQuery } from 'react-query';\nimport { getRouteManifestData } from '@/data/SupabaseRequests/dispatch-api/getRouteManifestData';\nimport { RouteMainfestMain } from '../Manifest/RouteManifest/RouteManifestMain';\n\ntype Props = {\n route: Route;\n};\n\nexport function RouteComponent({ route }: Props) {\n const [stopsFilter, setStopsFilter] = React.useState([]);\n const [showManifest, setShowManifest] = React.useState(false); //couldnt make this within the options\n\n const editRoute = useEditRoute();\n const addRoute = useAddRoute();\n\n const filteredStops = route.stops.filter((stop) => {\n if (stopsFilter.length === 0) {\n return true; // No filters applied, return all stops\n }\n return stopsFilter.includes(stop.status as RouteStopFilters[number]);\n });\n\n const { data: manifestProps } = useQuery({\n queryKey: [route.id, 'manifestProps'],\n queryFn: () => getRouteManifestData({ route_id: route.id ?? '' }),\n enabled: !!showManifest,\n });\n\n const changeName = (name: string) => {\n if (route.isNew) {\n addRoute.mutate({\n stationID: route.station_id,\n name: name === '' ? 'New Route' : name,\n driver_id: null,\n route_id: route.id,\n });\n return;\n }\n editRoute.mutate({\n route_id: route.id,\n route_details: {\n name: name,\n date: null,\n driver: null,\n },\n });\n };\n\n const changeDriver = (driver: NamedReference) => {\n if (route.isNew) {\n addRoute.mutate({\n stationID: route.station_id,\n name: null,\n driver_id: driver.id,\n route_id: route.id,\n });\n return;\n }\n editRoute.mutate({\n route_id: route.id,\n route_details: {\n name: null,\n date: null,\n driver: driver,\n },\n });\n };\n\n const handleClose = () => {\n setShowManifest(false);\n };\n\n const border = route.isNew\n ? ' border-blue-500'\n : route.state === 'Out For Delivery'\n ? 'border-yellow-500'\n : route.state === 'Complete'\n ? 'border-green-500'\n : 'border-transparent';\n\n return (\n \n {/* Route Actions Overlay - Circular Button at Top-Left */}\n
\n \n
\n {manifestProps && showManifest && (\n \n )}\n\n {/* Grid layout with 3 rows and 3 columns */}\n
\n {/* Row 1, Column 1 - Route Name */}\n
\n \n
\n \n
\n
\n\n {/* Row 1, Column 3 - Route Started At and Route Finished At */}\n
\n
{route.state}
\n
\n {getTimeAgo(route.started_at, route.completed_at)}\n
\n
\n\n {/* Row 2 - Stops Section (Only if there are stops) */}\n
\n 0}\n route_id={route.id}\n />\n
\n
\n \n );\n}\n\nfunction getTimeAgo(started_at: string | null, completed_at: string | null) {\n if (completed_at) {\n return `Completed at ${new Date(completed_at).toLocaleTimeString()}`;\n }\n if (started_at) {\n return `Started at ${new Date(started_at).toLocaleTimeString()}`;\n }\n return 'Not Started Yet';\n}\n","import { RouteComponent } from './RouteComponent';\nimport { Route } from '../../_models';\nimport { DndProvider } from 'react-dnd';\nimport { HTML5Backend } from 'react-dnd-html5-backend';\n\ntype Props = {\n routes: Route[];\n};\n\nexport function RoutesSection({ routes }: Props) {\n return (\n
\n {routes.length === 0 ? (\n

\n No Routes For Today\n

\n ) : (\n routes.map((route) => (\n
\n \n \n \n
\n ))\n )}\n
\n );\n}\n","import { supabase } from \"../../supabase\";\n\n// To regenerate this file, run the CLI command `deno run --allow-read --allow-write --allow-sys schema_to_ts.ts`. The script is located in the supabase-functions directory.\n\n\n/**\n * This interface was referenced by `Interface`'s JSON-Schema\n * via the `definition` \"getDispatchDataForDayParams\".\n */\nexport interface GetDispatchDataForDayParams {\n function: \"get-dispatch-data\";\n date: string;\n stations: string[];\n}\n/**\n * This interface was referenced by `Interface`'s JSON-Schema\n * via the `definition` \"getDispatchDataForDayResponse\".\n */\nexport interface GetDispatchDataForDayResponse {\n routes: {\n name: string;\n driver: {\n name: string;\n id: string;\n } | null;\n state:\n | \"Building\"\n | \"Ready To Load\"\n | \"Loading\"\n | \"Ready For Delivery\"\n | \"Out For Delivery\"\n | \"Unloading\"\n | \"Complete\";\n started_at: string | null;\n station_id: string;\n completed_at: string | null;\n id: string;\n }[];\n stops: {\n store_num: string;\n status: \"complete\" | \"in-progress\" | \"not-started\";\n id: string;\n station_id: string;\n priority: number;\n route_id: string | null;\n weight: number;\n shipper: string;\n city: string;\n state: string;\n zip: string;\n date: string;\n shipments: number;\n lost_count: number;\n }[];\n}\n\n\nexport async function getDispatchDataForDay(\n params: Omit,\n){\n try {\n const result = await supabase.functions.invoke( \n 'dispatch-api',\n { body: { ...params, function: 'get-dispatch-data' }},\n );\n\n if (!result.error && result.data) {\n return result.data;\n } else if (result.error) {\n throw new Error(\"Error Fetching Result in dispatch-api/getDispatchDataForDay:\" + result.error);\n } else {\n throw new Error('Unknown error: result does not contain data or error.');\n }\n } catch (error) {\n console.error('Error:', error);\n throw error;\n }\n}\n","import { CurrentDayData } from '../_models';\nimport {\n getDispatchDataForDay,\n GetDispatchDataForDayResponse,\n} from '@/data/SupabaseRequests/dispatch-api/getDispatchDataForDay';\n\nexport async function getCurrentDayData(\n date: string,\n stations: string[],\n): Promise {\n const result: GetDispatchDataForDayResponse = await getDispatchDataForDay({\n date: date,\n stations: stations,\n });\n\n const unnassigned_stops = result.stops.filter(\n (stop) => stop.route_id === null,\n );\n\n const routes = result.routes.map((route) => {\n return {\n ...route,\n isNew: false,\n stops: result.stops.filter((stop) => stop.route_id === route.id),\n };\n });\n\n return {\n unnassigned_stops: unnassigned_stops,\n routes: routes,\n };\n}\n","'use client';\n\nimport * as React from 'react';\nimport * as DialogPrimitive from '@radix-ui/react-dialog';\nimport { X } from 'lucide-react';\n\nimport { cn } from '@/lib/utils';\n\nconst Dialog = DialogPrimitive.Root;\n\nconst DialogTrigger = DialogPrimitive.Trigger;\n\nconst DialogPortal = ({\n children,\n ...props\n}: DialogPrimitive.DialogPortalProps) => (\n \n
\n {children}\n
\n
\n);\nDialogPortal.displayName = DialogPrimitive.Portal.displayName;\n\nconst DialogOverlay = React.forwardRef<\n React.ElementRef,\n React.ComponentPropsWithoutRef\n>(({ className, ...props }, ref) => (\n \n));\nDialogOverlay.displayName = DialogPrimitive.Overlay.displayName;\n\nconst DialogContent = React.forwardRef<\n React.ElementRef,\n React.ComponentPropsWithoutRef\n>(({ className, children, ...props }, ref) => (\n \n \n e.stopPropagation()}\n className={cn(\n 'fixed z-50 grid w-full gap-4 rounded-b-lg border bg-background p-6 shadow-lg animate-in data-[state=open]:fade-in-90 data-[state=open]:slide-in-from-bottom-10 sm:max-w-lg sm:rounded-lg sm:zoom-in-90 data-[state=open]:sm:slide-in-from-bottom-0',\n className,\n )}\n {...props}\n >\n {children}\n \n \n Close\n \n \n \n));\nDialogContent.displayName = DialogPrimitive.Content.displayName;\n\nconst DialogHeader = ({\n className,\n ...props\n}: React.HTMLAttributes) => (\n \n);\nDialogHeader.displayName = 'DialogHeader';\n\nconst DialogFooter = ({\n className,\n ...props\n}: React.HTMLAttributes) => (\n \n);\nDialogFooter.displayName = 'DialogFooter';\n\nconst DialogTitle = React.forwardRef<\n React.ElementRef,\n React.ComponentPropsWithoutRef\n>(({ className, ...props }, ref) => (\n \n));\nDialogTitle.displayName = DialogPrimitive.Title.displayName;\n\nconst DialogDescription = React.forwardRef<\n React.ElementRef,\n React.ComponentPropsWithoutRef\n>(({ className, ...props }, ref) => (\n \n));\nDialogDescription.displayName = DialogPrimitive.Description.displayName;\n\nexport {\n Dialog,\n DialogTrigger,\n DialogContent,\n DialogHeader,\n DialogFooter,\n DialogTitle,\n DialogDescription,\n};\n","import { supabase } from \"../../supabase\";\n\n// To regenerate this file, run the CLI command `deno run --allow-read --allow-write --allow-sys schema_to_ts.ts`. The script is located in the supabase-functions directory.\n\n\n/**\n * This interface was referenced by `Interface`'s JSON-Schema\n * via the `definition` \"upsertDeliveryTimesParams\".\n */\nexport interface UpsertDeliveryTimesParams {\n function: \"upsert-delivery-times\";\n shipment_ids: string[];\n delivery_time: string;\n}\n\n\nexport async function upsertDeliveryTimes(\n params: Omit,\n): Promise{\n try {\n const result = await supabase.functions.invoke( \n 'dispatch-api',\n { body: { ...params, function: 'upsert-delivery-times' }},\n );\n\n if (!result.error && result.data) {\n return;\n } else if (result.error) {\n throw new Error(\"Error Fetching Result in dispatch-api/upsertDeliveryTimes:\" + result.error);\n } else {\n throw new Error('Unknown error: result does not contain data or error.');\n }\n } catch (error) {\n console.error('Error:', error);\n throw error;\n }\n}\n","import { supabase } from \"../../supabase\";\n\n// To regenerate this file, run the CLI command `deno run --allow-read --allow-write --allow-sys schema_to_ts.ts`. The script is located in the supabase-functions directory.\n\n/**\n * This interface was referenced by `Interface`'s JSON-Schema\n * via the `definition` \"upsertPOSResponse\".\n */\nexport type UpsertPOSResponse = string;\n\n\n/**\n * This interface was referenced by `Interface`'s JSON-Schema\n * via the `definition` \"upsertPOSParams\".\n */\nexport interface UpsertPOSParams {\n function: \"upsert-pos\";\n stop_id: string;\n pos: {\n notes: string | null;\n signature: string | null;\n signee: string | null;\n completed_at: string | null;\n };\n}\n\n\nexport async function upsertPOS(\n params: Omit,\n){\n try {\n const result = await supabase.functions.invoke( \n 'dispatch-api',\n { body: { ...params, function: 'upsert-pos' }},\n );\n\n if (!result.error && result.data) {\n return result.data;\n } else if (result.error) {\n throw new Error(\"Error Fetching Result in dispatch-api/upsertPOS:\" + result.error);\n } else {\n throw new Error('Unknown error: result does not contain data or error.');\n }\n } catch (error) {\n console.error('Error:', error);\n throw error;\n }\n}\n","import { supabase } from \"../../supabase\";\n\n// To regenerate this file, run the CLI command `deno run --allow-read --allow-write --allow-sys schema_to_ts.ts`. The script is located in the supabase-functions directory.\n\n\n/**\n * This interface was referenced by `Interface`'s JSON-Schema\n * via the `definition` \"getDetailsForStopParams\".\n */\nexport interface GetDetailsForStopParams {\n function: \"get-details-for-stop\";\n stop_id: string;\n}\n/**\n * This interface was referenced by `Interface`'s JSON-Schema\n * via the `definition` \"getDetailsForStopResponse\".\n */\nexport interface GetDetailsForStopResponse {\n completed_by: {\n name: string;\n id: string;\n } | null;\n customer_name: string;\n store_num: string;\n store_name: string;\n line_1: string;\n line_2: string;\n city: string;\n state: string;\n zip: string;\n signee: string;\n notes: string;\n outcome: string;\n signature: string;\n route_started_at: string;\n completed_at: string;\n photo_hrefs: string[];\n}\n\n\nexport async function getDetailsForStop(\n params: Omit,\n){\n try {\n const result = await supabase.functions.invoke( \n 'dispatch-api',\n { body: { ...params, function: 'get-details-for-stop' }},\n );\n\n if (!result.error && result.data) {\n return result.data;\n } else if (result.error) {\n throw new Error(\"Error Fetching Result in dispatch-api/getDetailsForStop:\" + result.error);\n } else {\n throw new Error('Unknown error: result does not contain data or error.');\n }\n } catch (error) {\n console.error('Error:', error);\n throw error;\n }\n}\n","import { supabase } from \"../../supabase\";\n\n// To regenerate this file, run the CLI command `deno run --allow-read --allow-write --allow-sys schema_to_ts.ts`. The script is located in the supabase-functions directory.\n\n/**\n * This interface was referenced by `Interface`'s JSON-Schema\n * via the `definition` \"warning\".\n */\nexport type Warning = DuplicateStoreWarning | DriverMatchFailureWarning | MissingStoreWarning;\n\n\n/**\n * This interface was referenced by `Interface`'s JSON-Schema\n * via the `definition` \"importRoutesParams\".\n */\nexport interface ImportRoutesParams {\n function: \"import-routes\";\n csv: string;\n useAIRouteName?: boolean;\n}\n/**\n * This interface was referenced by `Interface`'s JSON-Schema\n * via the `definition` \"stop\".\n */\nexport interface Stop {\n id: string;\n shipperABV?: string;\n storeRefId?: string;\n pieces: number;\n weight: number;\n address: {\n name: string;\n line1: string;\n line2: string;\n city: string;\n state: string;\n zip: string;\n };\n}\n/**\n * This interface was referenced by `Interface`'s JSON-Schema\n * via the `definition` \"route\".\n */\nexport interface Route {\n name: string;\n driver: {\n id: string;\n name: string;\n };\n stationName: string;\n stationId: string;\n stops: Stop[];\n}\n/**\n * This interface was referenced by `Interface`'s JSON-Schema\n * via the `definition` \"duplicateStoreWarning\".\n */\nexport interface DuplicateStoreWarning {\n type: \"duplicate-store\";\n storeRefId: string;\n occurrences: number;\n}\n/**\n * This interface was referenced by `Interface`'s JSON-Schema\n * via the `definition` \"driverMatchFailureWarning\".\n */\nexport interface DriverMatchFailureWarning {\n type: \"driver-match-failure\";\n}\n/**\n * This interface was referenced by `Interface`'s JSON-Schema\n * via the `definition` \"missingStoreWarning\".\n */\nexport interface MissingStoreWarning {\n type: \"missing-store\";\n storeRefId: string;\n}\n/**\n * This interface was referenced by `Interface`'s JSON-Schema\n * via the `definition` \"importRoutesResponse\".\n */\nexport interface ImportRoutesResponse {\n routes: Route[];\n warnings: Warning[];\n}\n\n\nexport async function importRoutes(\n params: Omit,\n){\n try {\n const result = await supabase.functions.invoke( \n 'dispatch-api',\n { body: { ...params, function: 'import-routes' }},\n );\n\n if (!result.error && result.data) {\n return result.data;\n } else if (result.error) {\n throw new Error(\"Error Fetching Result in dispatch-api/importRoutes:\" + result.error);\n } else {\n throw new Error('Unknown error: result does not contain data or error.');\n }\n } catch (error) {\n console.error('Error:', error);\n throw error;\n }\n}\n","import { supabase } from \"../../supabase\";\n\n// To regenerate this file, run the CLI command `deno run --allow-read --allow-write --allow-sys schema_to_ts.ts`. The script is located in the supabase-functions directory.\n\n/**\n * This interface was referenced by `Interface`'s JSON-Schema\n * via the `definition` \"newStopResponse\".\n */\nexport type NewStopResponse = string;\n\n\n/**\n * This interface was referenced by `Interface`'s JSON-Schema\n * via the `definition` \"newStopParams\".\n */\nexport interface NewStopParams {\n function: \"new-stop\";\n stop_id: string;\n shipments?: string[];\n}\n\n\nexport async function newStop(\n params: Omit,\n){\n try {\n const result = await supabase.functions.invoke( \n 'dispatch-api',\n { body: { ...params, function: 'new-stop' }},\n );\n\n if (!result.error && result.data) {\n return result.data;\n } else if (result.error) {\n throw new Error(\"Error Fetching Result in dispatch-api/newStop:\" + result.error);\n } else {\n throw new Error('Unknown error: result does not contain data or error.');\n }\n } catch (error) {\n console.error('Error:', error);\n throw error;\n }\n}\n","import { supabase } from \"../../supabase\";\n\n// To regenerate this file, run the CLI command `deno run --allow-read --allow-write --allow-sys schema_to_ts.ts`. The script is located in the supabase-functions directory.\n\n\n/**\n * This interface was referenced by `Interface`'s JSON-Schema\n * via the `definition` \"getDeliveryPDFInfoParams\".\n */\nexport interface GetDeliveryPDFInfoParams {\n function: \"get-delivery-pdf-info\";\n stop_id: string;\n}\n/**\n * This interface was referenced by `Interface`'s JSON-Schema\n * via the `definition` \"getDeliveryPDFInfoResponse\".\n */\nexport interface GetDeliveryPDFInfoResponse {\n stop_info: {\n line_1: string;\n line_2: string;\n city: string;\n state: string;\n zip: string;\n store_number: string;\n };\n pos?: {\n name?: string;\n signature?: string;\n driver_name?: string;\n time_of_delivery?: string;\n notes?: string;\n };\n shipper_info: {\n abv: string;\n name: string;\n };\n carrier_info: {\n abv: string;\n name: string;\n line_1: string;\n line_2: string;\n city: string;\n state: string;\n zip: string;\n };\n}\n\n\nexport async function getDeliveryPDFInfo(\n params: Omit,\n){\n try {\n const result = await supabase.functions.invoke( \n 'dispatch-api',\n { body: { ...params, function: 'get-delivery-pdf-info' }},\n );\n\n if (!result.error && result.data) {\n return result.data;\n } else if (result.error) {\n throw new Error(\"Error Fetching Result in dispatch-api/getDeliveryPDFInfo:\" + result.error);\n } else {\n throw new Error('Unknown error: result does not contain data or error.');\n }\n } catch (error) {\n console.error('Error:', error);\n throw error;\n }\n}\n","import { supabase } from \"../../supabase\";\n\n// To regenerate this file, run the CLI command `deno run --allow-read --allow-write --allow-sys schema_to_ts.ts`. The script is located in the supabase-functions directory.\n\n/**\n * This interface was referenced by `Interface`'s JSON-Schema\n * via the `definition` \"getStopManifestShipmentsResponse\".\n */\nexport type GetStopManifestShipmentsResponse = {\n tracking_id: string;\n delivered: string | null;\n bol: string;\n missing: string | null;\n weight: number;\n overage: string | null;\n damaged: boolean;\n load: string;\n}[];\n\n\n/**\n * This interface was referenced by `Interface`'s JSON-Schema\n * via the `definition` \"getStopManifestShipmentsParams\".\n */\nexport interface GetStopManifestShipmentsParams {\n function: \"get-stop-manifest-shipments\";\n stopId: string;\n}\n\n\nexport async function getStopManifestShipments(\n params: Omit,\n){\n try {\n const result = await supabase.functions.invoke( \n 'dispatch-api',\n { body: { ...params, function: 'get-stop-manifest-shipments' }},\n );\n\n if (!result.error && result.data) {\n return result.data;\n } else if (result.error) {\n throw new Error(\"Error Fetching Result in dispatch-api/getStopManifestShipments:\" + result.error);\n } else {\n throw new Error('Unknown error: result does not contain data or error.');\n }\n } catch (error) {\n console.error('Error:', error);\n throw error;\n }\n}\n","import { supabase } from \"../../supabase\";\n\n// To regenerate this file, run the CLI command `deno run --allow-read --allow-write --allow-sys schema_to_ts.ts`. The script is located in the supabase-functions directory.\n\n/**\n * This interface was referenced by `Interface`'s JSON-Schema\n * via the `definition` \"shipmentSearchResponse\".\n */\nexport type ShipmentSearchResponse = {\n date: string | null;\n stop_id: string;\n tracking_id: string;\n}[];\n\n\n/**\n * This interface was referenced by `Interface`'s JSON-Schema\n * via the `definition` \"shipmentSearchParams\".\n */\nexport interface ShipmentSearchParams {\n function: \"search-shipments\";\n search: string;\n}\n\n\nexport async function shipmentSearch(\n params: Omit,\n){\n try {\n const result = await supabase.functions.invoke( \n 'dispatch-api',\n { body: { ...params, function: 'search-shipments' }},\n );\n\n if (!result.error && result.data) {\n return result.data;\n } else if (result.error) {\n throw new Error(\"Error Fetching Result in dispatch-api/shipmentSearch:\" + result.error);\n } else {\n throw new Error('Unknown error: result does not contain data or error.');\n }\n } catch (error) {\n console.error('Error:', error);\n throw error;\n }\n}\n","import { supabase } from \"../../supabase\";\n\n// To regenerate this file, run the CLI command `deno run --allow-read --allow-write --allow-sys schema_to_ts.ts`. The script is located in the supabase-functions directory.\n\n/**\n * This interface was referenced by `Interface`'s JSON-Schema\n * via the `definition` \"getShipmentsForStopResponse\".\n */\nexport type GetShipmentsForStopResponse = {\n tracking_id: string;\n delivered: string | null;\n missing: string;\n notes: string;\n pieces: number;\n weight: number;\n overage: string;\n scanner: string;\n unscanned: boolean;\n damaged: boolean;\n id: string;\n}[];\n\n\n/**\n * This interface was referenced by `Interface`'s JSON-Schema\n * via the `definition` \"getShipmentsForStopParams\".\n */\nexport interface GetShipmentsForStopParams {\n function: \"get-shipments-for-stop\";\n stop_id: string;\n}\n\n\nexport async function getShipmentsForStop(\n params: Omit,\n){\n try {\n const result = await supabase.functions.invoke( \n 'dispatch-api',\n { body: { ...params, function: 'get-shipments-for-stop' }},\n );\n\n if (!result.error && result.data) {\n return result.data;\n } else if (result.error) {\n throw new Error(\"Error Fetching Result in dispatch-api/getShipmentsForStop:\" + result.error);\n } else {\n throw new Error('Unknown error: result does not contain data or error.');\n }\n } catch (error) {\n console.error('Error:', error);\n throw error;\n }\n}\n","import { supabase } from \"../../supabase\";\n\n// To regenerate this file, run the CLI command `deno run --allow-read --allow-write --allow-sys schema_to_ts.ts`. The script is located in the supabase-functions directory.\n\n/**\n * This interface was referenced by `Interface`'s JSON-Schema\n * via the `definition` \"getWeeklyOverviewResponse\".\n */\nexport type GetWeeklyOverviewResponse = {\n date: string;\n stop_count: number;\n}[];\n\n\n/**\n * This interface was referenced by `Interface`'s JSON-Schema\n * via the `definition` \"getWeeklyOverviewParams\".\n */\nexport interface GetWeeklyOverviewParams {\n function: \"get-week-overview\";\n date: string;\n stations: string[];\n}\n\n\nexport async function getWeeklyOverview(\n params: Omit,\n){\n try {\n const result = await supabase.functions.invoke( \n 'dispatch-api',\n { body: { ...params, function: 'get-week-overview' }},\n );\n\n if (!result.error && result.data) {\n return result.data;\n } else if (result.error) {\n throw new Error(\"Error Fetching Result in dispatch-api/getWeeklyOverview:\" + result.error);\n } else {\n throw new Error('Unknown error: result does not contain data or error.');\n }\n } catch (error) {\n console.error('Error:', error);\n throw error;\n }\n}\n","import { Warning } from '@/data/SupabaseRequests/dispatch-api/importRoutes';\nimport { Dot } from 'lucide-react';\nimport React from 'react';\n\ntype Props = {\n warnings: Warning[];\n};\n\nexport const Warnings: React.FC = ({ warnings }) => {\n return (\n
\n
\n
\n Warning{warnings.length > 1 && 's'}:\n {warnings.map((warning, index) => (\n
\n \n {getWarningDetails(warning)}\n
\n ))}\n
\n
\n
\n );\n};\n\nfunction getWarningDetails(warning: Warning): React.ReactElement {\n switch (warning.type) {\n case 'driver-match-failure':\n return (\n

Search error when looking for users that match carrier names.

\n );\n case 'duplicate-store':\n return (\n

\n Store {warning.storeRefId} found{' '}\n {warning.occurrences} times. Using\n only the first occurrence.\n

\n );\n case 'missing-store':\n return (\n

\n No unassigned stop found for\n {' ' + warning.storeRefId}.\n

\n );\n }\n}\n","import React from 'react';\nimport { Route, Stop } from '@/data/SupabaseRequests/dispatch-api/importRoutes';\nimport { Weight } from '@/helpers/Weight';\nimport { Button } from '@/components/primitives/Button';\nimport { GitPullRequestCreate } from 'lucide-react';\n\ntype Props = {\n route: Route;\n isLoading: boolean;\n handleCreate: () => void;\n};\n\nexport const RoutePreview: React.FC = (props) => {\n const { route, isLoading, handleCreate } = props;\n return (\n
\n
\n
\n

{route.name}

\n {route.driver?.name && (\n

{route.driver?.name}

\n )}\n {!route.driver?.name && (\n

No Driver Assigned

\n )}\n
\n
\n
\n

\n Station: {route.stationName}\n

\n \n
\n
\n
\n
\n {route.stops.map((stop, index) => (\n \n ))}\n
\n
\n );\n};\n\nconst StopPreview: React.FC<{ stop: Stop }> = ({ stop }) => {\n return (\n
\n
{`(${stop.shipperABV}) ${stop.storeRefId}`}
\n
\n
\n

{stop.address.line1}

\n

\n {stop.address.city}, {stop.address.state}\n

\n
\n
\n

{stop.pieces} pcs

\n

{new Weight(stop.weight).inPounds} lbs

\n
\n
\n
\n );\n};\n","import { Button } from '@/components/primitives/Button';\nimport {\n Dialog,\n DialogTrigger,\n DialogContent,\n} from '@/components/primitives/Dialog';\nimport { Input } from '@/components/primitives/Input';\nimport { Loading } from '@/layout/Loading';\nimport { Import, ListPlus, Upload } from 'lucide-react';\nimport React, { useState } from 'react';\n\nimport {\n importRoutes,\n ImportRoutesResponse,\n createRoute,\n moveStopsToRoute,\n} from '@/data/SupabaseRequests/dispatch-api/_index';\nimport { Warnings } from './Warnings';\nimport { v4 } from 'uuid';\nimport { RoutePreview } from './RoutePreview';\nimport { Label } from '@radix-ui/react-label';\nimport { toast } from '@/components/primitives/useToast';\nimport { useQueryClient } from 'react-query';\nimport { useDispatchURL } from '../contexts/useDispatchURL';\nimport { useAuth } from '@/data/auth';\n\nexport const ImportRoutesModal: React.FC = (props) => {\n const [isLoading, setIsLoading] = useState(false);\n const [error, setError] = useState(null);\n const [response, setResponse] = useState(null);\n const [creatingAllRoutes, setCreatingAllRoutes] = useState(false);\n const [creatingRoutes, setCreatingRoutes] = useState>([]);\n const [routesCreated, setRoutesCreated] = useState(0);\n const { stations } = useAuth();\n const { currentDay } = useDispatchURL();\n const queryClient = useQueryClient();\n\n async function handleFileUpload(e: React.ChangeEvent) {\n setIsLoading(true);\n setError(null);\n setResponse(null);\n setCreatingAllRoutes(false);\n setCreatingRoutes([]);\n setRoutesCreated(0);\n let fileText: string | undefined;\n try {\n fileText = await e.target.files?.[0]?.text();\n if (!fileText) throw new Error('No file uploaded');\n } catch (error) {\n console.error(error);\n const errorMessage =\n error instanceof Error ? error.message : 'An unknown error occurred.';\n setError(errorMessage);\n setIsLoading(false);\n return;\n }\n\n try {\n const response = await importRoutes({\n csv: fileText,\n });\n setCreatingRoutes(new Array(response.routes.length).fill(false));\n setResponse(response);\n } catch (error) {\n console.error(error);\n setError('An error occurred while processing the CSV file.');\n }\n setIsLoading(false);\n }\n\n async function handleCreateRoute(routeIndex: number) {\n const route = response?.routes[routeIndex];\n if (!route) return;\n\n setCreatingRoutes((prev) => {\n const newRoutes = [...prev];\n newRoutes[routeIndex] = true;\n return newRoutes;\n });\n\n try {\n const newRouteId = await createRoute({\n name: route.name,\n driver_id: route.driver?.id ?? null,\n date: new Date().toISOString(),\n station_id: route.stationId,\n });\n await moveStopsToRoute({\n route_id: newRouteId,\n stop_ids: route.stops.map((stop) => stop.id),\n });\n setCreatingRoutes((prev) => {\n return prev.filter((_, i) => i !== routeIndex);\n });\n setResponse((prev) => {\n if (!prev) return null;\n const newRoutes = prev.routes.filter((_, i) => i !== routeIndex);\n return {\n ...prev,\n routes: newRoutes,\n };\n });\n setRoutesCreated((prev) => prev + 1);\n queryClient.invalidateQueries([currentDay, stations]);\n } catch (error) {\n console.error(error);\n const errorMessage =\n error instanceof Error ? error.message : 'Unknown error occurred.';\n toast({\n title: `Error Creating Route ${route.name}`,\n description: errorMessage,\n });\n }\n }\n\n async function handleCreateAllRoutes() {\n if (!response) return;\n setCreatingAllRoutes(true);\n setCreatingRoutes(new Array(response?.routes.length).fill(true));\n const promises = response.routes.map(async (route) => {\n try {\n const newRouteId = await createRoute({\n name: route.name,\n driver_id: route.driver?.id ?? null,\n date: new Date().toISOString(),\n station_id: route.stationId,\n });\n await moveStopsToRoute({\n route_id: newRouteId,\n stop_ids: route.stops.map((stop) => stop.id),\n });\n setRoutesCreated((prev) => prev + 1);\n setCreatingRoutes((prev) => [...prev].splice(1));\n setResponse((prev) => {\n if (!prev) return null;\n return {\n ...prev,\n routes: prev.routes.filter((r) => r.name !== route.name),\n };\n });\n return null;\n } catch (error) {\n console.error(error);\n return route.name;\n }\n });\n\n const errorRouteNames = (await Promise.all(promises)).filter(\n (e) => e !== null,\n );\n queryClient.invalidateQueries([currentDay, stations]);\n setCreatingRoutes((prev) => prev.map(() => false));\n setCreatingAllRoutes(false);\n if (errorRouteNames.length > 0) {\n toast({\n title: 'Error Creating Routes',\n description: `Failed to create the following routes: ${errorRouteNames.join(\n ', ',\n )}`,\n });\n }\n }\n\n return (\n \n \n \n \n \n
\n
\n Import Routes\n
\n {routesCreated > 0 && (\n
\n

\n {routesCreated} route{routesCreated > 1 ? 's' : ''} created\n successfully.\n

\n
\n )}\n {response ? (\n
\n
\n \n \n Upload New\n \n \n acc || curr, false)\n }\n loading={creatingAllRoutes}\n >\n \n Create All Routes\n \n
\n\n {response.warnings.length > 0 && (\n \n )}\n {response.routes.map((route, i) => (\n handleCreateRoute(i)}\n />\n ))}\n {response.routes.length === 0 && (\n
\n

No routes found in the CSV file.

\n
\n )}\n
\n ) : (\n
\n
\n {isLoading ? (\n \n ) : error ? (\n

{error}

\n ) : (\n

Upload a CSV file to import routes.

\n )}\n \n
\n
\n )}\n
\n
\n
\n );\n};\n","import { supabase } from \"../../supabase\";\n\n// To regenerate this file, run the CLI command `deno run --allow-read --allow-write --allow-sys schema_to_ts.ts`. The script is located in the supabase-functions directory.\n\n/**\n * This interface was referenced by `Interface`'s JSON-Schema\n * via the `definition` \"getStationsResponse\".\n */\nexport type GetStationsResponse = {\n id: string;\n name: string;\n abbreviation: string;\n}[];\n\n\n/**\n * This interface was referenced by `Interface`'s JSON-Schema\n * via the `definition` \"getStationsParams\".\n */\nexport interface GetStationsParams {\n function: \"get-stations\";\n}\n\n\nexport async function getStations(\n params: Omit,\n){\n try {\n const result = await supabase.functions.invoke( \n 'webapp-api',\n { body: { ...params, function: 'get-stations' }},\n );\n\n if (!result.error && result.data) {\n return result.data;\n } else if (result.error) {\n throw new Error(\"Error Fetching Result in webapp-api/getStations:\" + result.error);\n } else {\n throw new Error('Unknown error: result does not contain data or error.');\n }\n } catch (error) {\n console.error('Error:', error);\n throw error;\n }\n}\n","import { useState } from 'react';\nimport { SortAsc, Filter, PlusCircle } from 'lucide-react';\n\nimport {\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuGroup,\n DropdownMenuItem,\n DropdownMenuLabel,\n DropdownMenuPortal,\n DropdownMenuSeparator,\n DropdownMenuSub,\n DropdownMenuSubContent,\n DropdownMenuSubTrigger,\n DropdownMenuTrigger,\n} from '@/components/primitives/DropdownMenu';\nimport { Input } from '@/components/primitives/Input';\nimport { Button } from '@/components/primitives/Button';\nimport { RouteFilters, RouteSort, RouteStopFilters } from '../../_models';\nimport { useDispatchURL } from '../../contexts/useDispatchURL';\nimport { ImportRoutesModal } from '../../import_routes/ImportRoutesModal';\nimport { useQuery } from 'react-query';\nimport { getStations } from '@/data/SupabaseRequests/webapp-api/getStations';\n\ntype Props = {\n onSort: (field: RouteSort) => void;\n onFilter: (filter: RouteFilters[number]) => void;\n onStopRouteFilter: (filter: RouteStopFilters[number]) => void;\n onCreateRoute: (station_id: string) => void;\n onStationChange: (station_id: string) => void;\n};\n\nexport default function DispatchToolbar({\n onSort,\n onCreateRoute,\n onFilter,\n onStopRouteFilter,\n onStationChange,\n}: Props) {\n const { search, setSearch } = useDispatchURL();\n const [activeFilters, setActiveFilters] = useState([]);\n const [selectedStationId, setSelectedStationId] = useState(\n null,\n );\n\n const {\n data: stations,\n isLoading,\n isError,\n } = useQuery({\n queryKey: 'stations',\n queryFn: () => getStations({}),\n });\n\n const toggleRouteFilter = (filter: RouteFilters[number]) => {\n setActiveFilters((prev) =>\n prev.includes(filter)\n ? prev.filter((f) => f !== filter)\n : [...prev, filter],\n );\n onFilter(filter);\n };\n\n const toggleStopFilter = (filter: RouteStopFilters[number]) => {\n setActiveFilters((prev) =>\n prev.includes(filter)\n ? prev.filter((f) => f !== filter)\n : [...prev, filter],\n );\n onStopRouteFilter(filter);\n };\n\n const handleStationChange = (stationId: string) => {\n setSelectedStationId(stationId);\n onStationChange(stationId);\n };\n\n function capitalizeFirstLetter(string: string) {\n return string.charAt(0).toUpperCase() + string.slice(1);\n }\n\n const routeFilters: RouteFilters = [\n 'Building',\n 'Out For Delivery',\n 'Complete',\n ];\n\n const sortOptions: RouteSort[] = ['progress', 'name'];\n\n const stopFilters: RouteStopFilters = [\n 'complete',\n 'in-progress',\n 'not-started',\n ];\n\n return (\n
\n {/* Search Bar */}\n e.preventDefault()} // Prevent default form submission\n className=\"flex w-full sm:w-auto md:w-auto\"\n >\n setSearch(e.target.value)}\n onKeyDown={(e) => {\n if (e.key === 'Enter') {\n e.preventDefault(); // Prevent form submission on Enter\n }\n }}\n className=\"w-full max-w-xs\"\n />\n \n\n {/* Stops Key */}\n\n {/* Filters, Sort, and Create Route */}\n
\n {/* Sort Dropdown */}\n \n \n \n \n \n Sort by\n \n {sortOptions.map((sort) => (\n onSort(sort)}>\n {capitalizeFirstLetter(sort)}\n \n ))}\n \n \n\n {/* Filter Dropdown */}\n \n \n \n \n \n Filter Options\n \n \n \n Station\n \n \n {stations?.map((station) => (\n handleStationChange(station.id)}\n >\n {station.name}\n {selectedStationId === station.id && (\n \n )}\n \n ))}\n \n \n \n \n Route\n \n \n {routeFilters.map((filter) => (\n toggleRouteFilter(filter)}\n >\n {capitalizeFirstLetter(filter)}\n {activeFilters.includes(filter) && (\n \n )}\n \n ))}\n \n \n \n \n Stop\n \n \n {stopFilters.map((filter) => (\n toggleStopFilter(filter)}\n >\n {capitalizeFirstLetter(filter)}\n {activeFilters.includes(filter) && (\n \n )}\n \n ))}\n \n \n \n \n \n \n\n {/* Create Route Dropdown */}\n \n \n \n \n \n \n Select A Station\n \n {stations?.map((station) => (\n onCreateRoute(station.id)}\n >\n {station.name}\n \n ))}\n \n \n
\n
\n );\n}\n","import { LUDate } from '@/common/classes/LUDate';\nimport { useDispatchURL } from '../../contexts/useDispatchURL';\n\ntype Props = {\n date: LUDate;\n dayOfWeek: DayOfWeek;\n stop_count: number;\n};\n\ntype DayOfWeek =\n | 'Monday'\n | 'Tuesday'\n | 'Wednesday'\n | 'Thursday'\n | 'Friday'\n | 'Saturday'\n | 'Sunday';\n\nexport default function DaySelector({ date, dayOfWeek, stop_count }: Props) {\n const { setCurrentDay, currentDay } = useDispatchURL();\n\n const type = isPastPresentOrCurrent(date);\n\n const active = currentDay === date.asHTMLInputValue();\n const isComplete = stop_count === 0;\n\n /**These are the options for the day */\n const getClassname = () => {\n let returnString = '';\n /**Active days will always be purple */\n if (active) {\n returnString += `border-lupurple bg-slate-200 `;\n }\n /**past will be red or green depending on if there are past resolutions */\n\n if (type === 'present') {\n /**Present should have blue text indicating that it is today\n * You are also able to move routes/stops on present days\n */\n returnString += 'text-blue-500 ';\n if (!active) returnString += 'text-blue-500 ';\n }\n\n return returnString;\n };\n\n const className = `text-center border-2 rounded-xl cursor-pointer ${getClassname()} hover:bg-slate-200 `;\n\n return (\n
\n setCurrentDay(date.asHTMLInputValue())}\n >\n
\n {
{weekAbbreviation(dayOfWeek)}
}\n\n {
{date.getDate()}
}\n
\n
\n {type === 'past' && !isComplete && (\n
\n )}\n \n );\n}\n/** will tell you if a date is in the past or the present */\nconst isPastPresentOrCurrent = (date: LUDate) => {\n const today = new LUDate();\n\n if (date.isToday()) return 'present';\n if (date.isBefore(today)) {\n return 'past';\n } else {\n return 'future';\n }\n};\n\nfunction weekAbbreviation(weekday: DayOfWeek) {\n return weekday.slice(0, 2);\n}\n","import React, { useMemo, useState } from 'react';\nimport { ChevronLeft, ChevronRight } from 'lucide-react';\nimport DaySelector from './DaySelector';\nimport { useQuery } from 'react-query';\nimport { LUDate } from '@/common/classes/LUDate';\nimport {\n GetWeeklyOverviewResponse,\n getWeeklyOverview,\n} from '@/data/SupabaseRequests/dispatch-api/getWeeklyOverview';\nimport { DayOfWeek } from '../../_models';\nimport { useAuth } from '@/data/auth';\n\nconst ARROW_SIZE = 60;\n\nexport default function WeekSelector() {\n const { stations } = useAuth();\n\n // Initialize today as the current day\n const today = useMemo(() => new LUDate(), []);\n const [weekStart, setWeekStart] = useState(today.addDays(-3)); // Ensure \"today\" is in the middle\n\n const handleWeekChange = (next: boolean) => {\n setWeekStart((prev) => prev.addDays(next ? 7 : -7));\n };\n\n const monthString = useMemo(() => {\n const startMonth = weekStart.getMonthString();\n const endMonth = weekStart.addDays(6).getMonthString();\n return startMonth === endMonth ? startMonth : `${startMonth} - ${endMonth}`;\n }, [weekStart]);\n\n const weekDays = useMemo(() => {\n return Array.from({ length: 7 }, (_, i) => weekStart.addDays(i));\n }, [weekStart]);\n\n const { data: overview } = useQuery({\n queryKey: ['weekly-overview', weekStart.asHTMLInputValue()],\n queryFn: () =>\n getWeeklyOverview({\n date: weekStart.asHTMLInputValue(),\n stations: stations,\n }),\n });\n\n return (\n
\n {/* Month Display */}\n
\n
\n {monthString}\n
\n
\n\n {/* Week Navigation and Day Grid */}\n
\n handleWeekChange(false)}\n size={ARROW_SIZE}\n strokeWidth={1}\n className=\"hover:text-lupurple cursor-pointer\"\n />\n\n
\n {weekDays.map((day, ix) => (\n
\n \n
\n ))}\n
\n\n handleWeekChange(true)}\n size={ARROW_SIZE}\n strokeWidth={1}\n className=\"hover:text-lupurple cursor-pointer\"\n />\n
\n
\n );\n}\n","export function StopsKey() {\n return (\n
\n
\n
Not Started
\n
\n
A Week Old
\n
\n
In Progress
\n
\n
Completed
\n
\n );\n}\n","import { LUDate } from '@/common/classes/LUDate';\nimport { useQuery } from 'react-query';\nimport { UnnassignedStops } from './components/Stops/UnnassignedStops';\nimport { RoutesSection } from './components/Routes/RoutesSection';\nimport { SelectedProvider } from './contexts/useSelected';\nimport { getCurrentDayData } from './factoryFunctions/getCurrentDayData';\nimport DispatchToolbar from './components/Routes/DispatchToolbar';\nimport { RouteSort, RouteFilters, RouteStopFilters, Route } from './_models';\nimport { useEffect, useState } from 'react';\nimport { useAddLocalRoute } from './mutations/useAddRoute';\nimport WeekSelector from './components/Calendar/WeekSelector';\nimport { Loading } from '@/layout/Loading';\nimport { useDispatchURL } from './contexts/useDispatchURL';\nimport { ChevronLeft, ChevronRight } from 'lucide-react';\nimport { StopsKey } from './components/Stops/StopsKey';\n\nimport { useAuth } from '@/data/auth';\nexport default function CurrentDayContent() {\n const [routeSort, setRouteSort] = useState('progress');\n const [routeFilters, setRouteFilters] = useState([]);\n const [routeStopFilters, setRouteStopFilters] = useState(\n [],\n );\n const [showStops, setShowStops] = useState(false);\n const [station, setStation] = useState(null);\n\n const { currentDay, search } = useDispatchURL();\n const mutation = useAddLocalRoute();\n const { stations } = useAuth();\n\n const { data: stopsAndRoutes, isLoading } = useQuery({\n queryKey: [currentDay, stations],\n queryFn: () => getCurrentDayData(currentDay, stations),\n });\n\n const isPastDay = getIsPastDay(currentDay, new LUDate().asHTMLInputValue());\n\n useEffect(() => {\n if (isPastDay || stopsAndRoutes?.unnassigned_stops.length === 0) {\n setShowStops(false);\n } else {\n setShowStops(true);\n }\n }, [isPastDay, currentDay]);\n\n const stops = stopsAndRoutes?.unnassigned_stops ?? [];\n const routes = stopsAndRoutes?.routes ?? [];\n\n function addRoute(station_id: string) {\n mutation.mutate({ stationID: station_id });\n }\n\n function toggleRouteFilter(filter: RouteFilters[number]) {\n if (routeFilters.includes(filter)) {\n setRouteFilters(routeFilters.filter((f) => f !== filter));\n } else {\n setRouteFilters([...routeFilters, filter]);\n }\n }\n\n function toggleRouteStopFilter(filter: RouteStopFilters[number]) {\n if (routeStopFilters.includes(filter)) {\n setRouteStopFilters(routeStopFilters.filter((f) => f !== filter));\n } else {\n setRouteStopFilters([...routeStopFilters, filter]);\n }\n }\n\n const stateOrder = [\n 'Ready To Load',\n 'Building',\n 'Loading',\n 'Ready For Delivery',\n 'Out For Delivery',\n 'Unloading',\n 'Complete',\n ];\n\n const filteredRoutes = routes\n .map((route) => ({\n ...route,\n stops:\n routeStopFilters.length === 0\n ? route.stops\n : route.stops.filter((stop) =>\n routeStopFilters.includes(stop.status),\n ),\n }))\n .filter((route) => {\n //Route search function first\n const matchesSearch = routeSearchFunction(route, search);\n\n // If no filters are applied, return everything that matches search\n if (routeFilters.length === 0) {\n return matchesSearch;\n }\n\n // If filters are applied, only include matching search and filter criteria\n return (\n matchesSearch &&\n routeFilters.includes(route.state as RouteFilters[number])\n );\n })\n .sort((a, b) => {\n const aMatchesSearch = routeSearchFunction(a, search);\n const bMatchesSearch = routeSearchFunction(b, search);\n\n if (aMatchesSearch && !bMatchesSearch) return -1;\n if (!aMatchesSearch && bMatchesSearch) return 1;\n\n if (routeSort === 'progress') {\n const stateA = stateOrder.indexOf(a.state);\n const stateB = stateOrder.indexOf(b.state);\n if (stateA !== stateB) return stateA - stateB;\n if (a.started_at && b.started_at) {\n return new LUDate(a.started_at).isBefore(new LUDate(b.started_at))\n ? -1\n : 1;\n }\n if (a.started_at) return -1;\n if (b.started_at) return 1;\n }\n\n return a.name.localeCompare(b.name);\n });\n\n const filteredStops = stops\n .filter((stop) => {\n if (station && stop.station_id !== station) return false;\n return true;\n })\n .sort((a, b) => {\n // Check if search term is included in store_num for both stops\n const aIncludesSearch = a.store_num\n .toLowerCase()\n .includes(search.toLowerCase());\n const bIncludesSearch = b.store_num\n .toLowerCase()\n .includes(search.toLowerCase());\n\n // Prioritize stops that include the search term\n if (aIncludesSearch && !bIncludesSearch) {\n return -1; // a comes first\n }\n if (!aIncludesSearch && bIncludesSearch) {\n return 1; // b comes first\n }\n\n // If both or neither includes the search term, sort by store_num\n return a.store_num.localeCompare(b.store_num);\n });\n\n return (\n
\n {currentDay && }\n\n \n {/* Sticky Toolbar Across the Top */}\n
\n \n
\n \n
\n\n {stops.length === 0 && !isLoading && (\n
\n All Stops Have Been Assigned\n
\n )}\n
\n {isLoading ? (\n \n ) : (\n
\n {/* Toggle Button */}\n setShowStops(!showStops)}\n >\n {showStops ? (\n \n ) : (\n \n )}\n
\n\n {/* Unassigned Stops */}\n {showStops && (\n 5\n ? 'w-[40%]'\n : stops.length > 0\n ? 'w-[20%]'\n : 'w-0'\n }`}\n >\n \n
\n )}\n\n {/* Routes Section */}\n 5\n ? 'w-[60%]'\n : 'w-[80%]'\n }`}\n >\n \n
\n
\n )}\n \n
\n );\n}\n\nfunction routeSearchFunction(route: Route, searchTerm: string) {\n if (searchTerm === '') return true; // If there's no search term, don't filter anything.\n\n const lowerCaseSearch = searchTerm.toLowerCase();\n\n // Check if route name contains the search term\n if (route.name.toLowerCase().includes(lowerCaseSearch)) {\n return true;\n }\n\n // Check if any stop store number contains the search term\n return route.stops.some((stop) =>\n stop.store_num.toLowerCase().includes(lowerCaseSearch),\n );\n}\n\n//inputs are 2024-11-02\nfunction getIsPastDay(dateOne: string, dateTwo: string) {\n const [yearOne, monthOne, dayOne] = dateOne.split('-').map(Number);\n const [yearTwo, monthTwo, dayTwo] = dateTwo.split('-').map(Number);\n if (yearOne < yearTwo) {\n return true;\n }\n if (yearOne === yearTwo && monthOne < monthTwo) {\n return true;\n }\n if (yearOne === yearTwo && monthOne === monthTwo && dayOne < dayTwo) {\n return true;\n }\n return false;\n}\n","import {\n GetDetailsForStopParams,\n GetDetailsForStopResponse,\n getDetailsForStop,\n} from '@/data/SupabaseRequests/dispatch-api/getDetailsForStop';\nimport { StopDetails } from '../_models';\nimport { LUDate } from '@/common/classes/LUDate';\n\nexport async function getDetailsForStopWrapper(\n params: Omit,\n): Promise {\n const stop_details: GetDetailsForStopResponse =\n await getDetailsForStop(params);\n\n return {\n customer_name: stop_details.customer_name,\n customer_abv: stop_details.customer_name,\n address: {\n city: stop_details.city,\n state: stop_details.state,\n zip: stop_details.zip,\n street: stop_details.line_1 + ' ' + stop_details.line_2,\n store_num: stop_details.store_num,\n store_name: stop_details.store_name,\n },\n pos: {\n signee: stop_details.signee,\n notes: stop_details.notes,\n signature: stop_details.signature,\n completed_at: stop_details.completed_at\n ? new LUDate(stop_details.completed_at).toISOString()\n : null,\n completed_by: stop_details.completed_by,\n },\n };\n}\n","import { createContext, useContext, useState } from 'react';\nimport { ShipmentFilters } from '../_models';\n\ninterface IStopShipmentsContext {\n selectedShipments: string[];\n selectShipments: (shipmentIds: string[]) => void;\n filters: ShipmentFilters;\n setFilter: (filter: string) => void;\n editingMode: boolean;\n setEditingMode: (editingMode: boolean) => void;\n}\n\nconst StopShipmentsContext = createContext({\n selectedShipments: [],\n selectShipments: (shipmentIds: string[]) => {\n console.log('selectShipment not implemented');\n },\n filters: {\n search: '',\n delivered: false,\n unscanned: false,\n missing: false,\n overage: false,\n },\n setFilter: (filter: string) => {\n console.log('setFilter not implemented');\n },\n editingMode: false,\n setEditingMode: (editingMode: boolean) => {\n console.log('setEditingMode not implemented');\n },\n});\n\nexport const useStopShipments = () => {\n const {\n selectedShipments,\n selectShipments,\n filters,\n setFilter,\n editingMode,\n setEditingMode,\n } = useContext(StopShipmentsContext);\n return {\n selectedShipments,\n selectShipments,\n filters,\n setFilter,\n editingMode,\n setEditingMode,\n };\n};\n\nexport function StopShipmentsProvider({\n children,\n}: {\n children: React.ReactNode;\n}) {\n const [selectedShipments, setSelectedShipments] = useState([]);\n const [editingMode, setEditingMode] = useState(false);\n const [filters, setFilters] = useState({\n search: '',\n delivered: false,\n unscanned: false,\n missing: false,\n overage: false,\n });\n\n const selectShipments = (shipmentIds: string[]) => {\n setSelectedShipments((prev) => {\n // Check if all shipmentIds are already selected\n const allSelected = shipmentIds.every((shipmentId) =>\n prev.includes(shipmentId),\n );\n\n if (allSelected) {\n // Remove shipmentIds if all are already selected\n return prev.filter((id) => !shipmentIds.includes(id));\n } else {\n // Add shipmentIds if not all are selected\n return [\n ...prev,\n ...shipmentIds.filter((shipmentId) => !prev.includes(shipmentId)),\n ];\n }\n });\n };\n\n const setFilter = (searchOrKey: string) => {\n const booleanKeys = Object.keys(filters).filter(\n (key) => key !== 'search',\n ) as (keyof Omit)[];\n\n // Check if the provided key is one of the boolean keys\n if (\n booleanKeys.includes(searchOrKey as keyof Omit)\n ) {\n setFilters((prev) => ({\n ...prev,\n [searchOrKey]:\n !prev[searchOrKey as keyof Omit],\n }));\n } else {\n // Treat as search string\n setFilters((prev) => ({\n ...prev,\n search: searchOrKey,\n }));\n }\n };\n\n return (\n \n {children}\n \n );\n}\n","import React from 'react';\nimport { Shipment } from '../../_models';\nimport { LUDate } from '@/common/classes/LUDate';\nimport { useStopShipments } from '../../contexts/StopShipments';\nimport { Input } from '@/components/primitives/Input';\n\ntype Props = {\n shipment: Shipment;\n};\n\nexport function ShipmentCard({ shipment }: Props) {\n const { selectedShipments } = useStopShipments();\n function getBorderColor() {\n if (shipment.delivered) {\n return 'border-green-500';\n }\n\n if (shipment.overage) {\n return 'border-yellow-500';\n }\n\n if (shipment.missing) {\n return 'border-red-500';\n }\n\n if (shipment.unscanned) {\n return 'border-slate-300';\n }\n\n return 'border-gray-200';\n }\n\n const date = shipment.delivered ? new LUDate(shipment.delivered) : null;\n\n return (\n \n {/* Top row: Tracking ID with missing/overage */}\n
\n \n {shipment.tracking_id}\n \n
\n {shipment.missing && (\n \n {'Missing: ' + shipment.missing}\n \n )}\n {shipment.overage && (\n \n {'Overage: ' + shipment.overage}\n \n )}\n
\n
\n\n {/* Bottom section: Weight, Scanner, and Time */}\n
\n {/* Weight */}\n
\n {shipment.weight.inPounds + ' lbs'}\n
\n\n {/* Scanner and Time */}\n
\n
{shipment.scanner}
\n\n
\n {date\n ? date.toString(false, false, false) +\n ' ' +\n date.toTimeString().slice(0, 8)\n : ''}\n
\n
\n
\n
\n );\n}\n","import { GetShipmentsForStopResponse } from '@/data/SupabaseRequests/dispatch-api/getShipmentsForStop';\nimport { newStop } from '@/data/SupabaseRequests/dispatch-api/newStop';\nimport { useMutation, useQueryClient } from 'react-query';\n\nexport function useRemoveShipmentsFromRoute() {\n const queryClient = useQueryClient();\n\n return useMutation(\n async ({\n stop_id,\n shipment_ids,\n }: {\n stop_id: string;\n shipment_ids: string[];\n }) => {\n const originalData: GetShipmentsForStopResponse | undefined =\n queryClient.getQueryData([stop_id, 'shipments']);\n\n const updatedData = originalData?.filter((shipment) => {\n return !shipment_ids.includes(shipment.tracking_id);\n });\n\n try {\n newStop({\n stop_id: stop_id,\n shipments: shipment_ids,\n });\n\n queryClient.setQueryData([stop_id, 'shipments'], updatedData);\n } catch (error) {\n console.log('error', error);\n\n queryClient.setQueryData([stop_id, 'shipments'], originalData);\n throw error;\n }\n },\n );\n}\n","import React from 'react';\nimport { ManifestProblemShipment, ManifestShipment, PDFProps } from '../models';\nimport { PDFViewer, Document } from '@react-pdf/renderer';\nimport { Dialog } from '@/components/primitives/Dialog';\nimport { DialogContent } from '@radix-ui/react-dialog';\nimport ReactDOM from 'react-dom';\nimport { X } from 'lucide-react';\n\nimport { useQuery } from 'react-query';\nimport { Weight } from '@/helpers/Weight';\nimport StopManifestDocument from './StopManifestDocument';\nimport { useDispatchURL } from '@/pages/dispatch/contexts/useDispatchURL';\nimport {\n getStopManifestShipments,\n GetStopManifestShipmentsResponse,\n} from '@/data/SupabaseRequests/dispatch-api/getStopManifestShipments';\nimport { is } from 'date-fns/locale';\n\ntype Props = {\n pdfProps: PDFProps;\n isOpen: boolean;\n handleClose: () => void;\n date: string;\n};\n\nexport function ManifestPDFMain({\n pdfProps,\n isOpen,\n handleClose,\n date,\n}: Props) {\n const { detailedStop: stopID } = useDispatchURL();\n\n const { data: shipments, isLoading } =\n useQuery({\n queryKey: [stopID, 'shipments', 'manifest'],\n queryFn: () => getStopManifestShipments({ stopId: stopID! }),\n enabled: !!stopID,\n });\n\n const stop_shipments: ManifestShipment[] =\n shipments?.map((shipment) => {\n return {\n tracking_id: shipment.tracking_id,\n scanned_at: shipment.delivered,\n weight: new Weight(shipment.weight).inPounds,\n bol: shipment.bol,\n load_trailer: shipment.load,\n };\n }) ?? [];\n\n const problem_shipments: ManifestProblemShipment[] = (\n shipments?.filter(\n (shipment) => shipment.missing || shipment.overage || shipment.damaged,\n ) ?? []\n ).map((shipment) => {\n return {\n tracking_id: shipment.tracking_id,\n overage: true && shipment.overage !== null,\n missing: true && shipment.delivered === null,\n damage: shipment.damaged,\n };\n });\n\n if (isLoading) return null;\n return ReactDOM.createPortal(\n \n {/* Close button \n Theres a lot of styling here because i am covering up the built in toolbar with this X, and it is \n covering up the more options button on the toolbar. \n */}\n
\n
\n \n
\n
\n \n \n \n \n \n
,\n document.body, // Ensure it's rendered at the root level\n );\n}\n","import React, { useState } from 'react';\nimport { Button } from '@/components/primitives/Button';\nimport { getDeliveryPDFInfo } from '@/data/SupabaseRequests/dispatch-api/_index';\nimport { useQuery } from 'react-query';\nimport { ManifestPDFMain } from './StopManifestMain';\nimport { useDispatchURL } from '@/pages/dispatch/contexts/useDispatchURL';\n\nexport default function ManifestPDF() {\n const [showPDF, setShowPDF] = useState(false);\n const { detailedStop: stopID, currentDay } = useDispatchURL();\n\n const { data: pdfProps } = useQuery({\n queryKey: [stopID, 'pdfProps'],\n queryFn: () => getDeliveryPDFInfo({ stop_id: stopID ?? '' }),\n enabled: !!showPDF,\n });\n\n const handleClose = () => setShowPDF(false);\n\n return (\n
\n {pdfProps && showPDF && currentDay ? (\n \n ) : (\n \n )}\n
\n );\n}\n","import { useMutation, useQueryClient } from 'react-query';\nimport { useDispatchURL } from '../contexts/useDispatchURL';\nimport { useStopShipments } from '../contexts/StopShipments';\nimport { GetShipmentsForStopResponse } from '@/data/SupabaseRequests/dispatch-api/getShipmentsForStop';\nimport { tr } from 'date-fns/locale';\nimport { upsertDeliveryTimes } from '@/data/SupabaseRequests/dispatch-api/upsertDeliveryTimes';\nimport { useAuth } from '@/data/auth';\n\nexport function useUpdateShipments() {\n const queryClient = useQueryClient();\n const { detailedStop } = useDispatchURL();\n const { selectedShipments: tracking_ids } = useStopShipments();\n const { user } = useAuth();\n\n return useMutation(async ({ date }: { date: string }) => {\n const originalData: GetShipmentsForStopResponse | undefined =\n queryClient.getQueryData([detailedStop, 'shipments']);\n\n const ids = tracking_ids.map(\n (tracking_id) =>\n originalData?.find((shipment) => shipment.tracking_id === tracking_id)\n ?.id,\n );\n\n try {\n if (ids) {\n await upsertDeliveryTimes({\n shipment_ids: ids.filter((id): id is string => id !== undefined),\n delivery_time: date,\n });\n }\n\n queryClient.setQueryData(\n [detailedStop, 'shipments'],\n (oldData) => {\n if (oldData) {\n return oldData.map((shipment) => {\n if (ids?.includes(shipment?.id)) {\n return {\n ...shipment,\n delivered: date,\n scanner: user?.name,\n };\n }\n return shipment;\n }) as GetShipmentsForStopResponse;\n }\n return oldData;\n },\n );\n } catch (error) {\n console.error('Error:', error);\n throw error;\n }\n });\n}\n","import {\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuLabel,\n DropdownMenuSeparator,\n DropdownMenuTrigger,\n} from '@/components/primitives/DropdownMenu';\nimport {\n Search,\n Filter,\n Split,\n ChevronRight,\n Pencil,\n Check,\n} from 'lucide-react';\nimport { Checkbox } from '@/components/primitives/Checkbox';\nimport { Button } from '@/components/primitives/Button';\nimport { Input } from '@/components/primitives/Input';\nimport { useStopShipments } from '../../contexts/StopShipments';\nimport { useRemoveShipmentsFromRoute } from '../../mutations/useRemoveShipmentsFromRoute';\nimport { LUDate } from '@/common/classes/LUDate';\nimport ManifestPDFButton from '../Manifest/StopManifest/ManifestPDFButton';\nimport { Badge } from '@/components/primitives/Badge';\nimport { useDispatchURL } from '../../contexts/useDispatchURL';\nimport { upsertDeliveryTimes } from '@/data/SupabaseRequests/dispatch-api/upsertDeliveryTimes';\nimport { useState } from 'react';\nimport { useUpdateShipments } from '../../mutations/useUpdateShipments';\n\ntype Props = {\n selectShipmentsByStatus: (status: string) => void;\n first_scan?: LUDate;\n last_scan?: LUDate;\n counts: {\n missing: number;\n overage: number;\n delivered: number;\n unscanned: number;\n total: number;\n };\n};\n\nexport default function ShipmentsToolbar({\n selectShipmentsByStatus,\n first_scan,\n last_scan,\n counts,\n}: Props) {\n const [selectedDate, setSelectedDate] = useState(new LUDate());\n const { setFilter, filters, selectedShipments, editingMode, setEditingMode } =\n useStopShipments();\n\n const mutation = useRemoveShipmentsFromRoute();\n\n const { detailedStop: stopID } = useDispatchURL();\n\n const shipmentsMutation = useUpdateShipments();\n\n const handleDateChange = (e: React.ChangeEvent) => {\n setSelectedDate(new LUDate(e.target.value));\n };\n\n const handleSubmit = async () => {\n if (selectedDate) {\n setEditingMode(false);\n shipmentsMutation.mutate({ date: selectedDate.toISOString() });\n }\n };\n const selectedCount = selectedShipments.length;\n\n return (\n
\n
\n
\n
\n
\n Missing ({counts.missing})\n
\n\n
\n
\n Overage ({counts.overage})\n
\n\n
\n
\n Delivered ({counts.delivered})\n
\n\n
\n
\n Unscanned ({counts.unscanned})\n
\n
\n {first_scan && last_scan ? (\n
\n \n \n Scanning Duration:{' '}\n {first_scan.timeDifferenceString(last_scan).replace(' ago', '')}\n \n \n \n {'Last Scan: ' + last_scan?.timeDifferenceString()}\n \n {counts.total + ' Total Shipments'}\n
\n ) : (\n
Scanning has not yet started
\n )}\n
\n\n
\n
\n \n {\n setFilter(value.target.value);\n }}\n />\n
\n \n {\n e.stopPropagation(); // Prevent modal from interpreting this click\n }}\n >\n \n \n \n Filter by State\n \n \n setFilter('missing')}\n />\n \n \n \n setFilter('overage')}\n />\n \n \n \n setFilter('delivered')}\n />\n \n \n \n setFilter('unscanned')}\n />\n \n \n \n \n
\n {editingMode ? (\n
\n \n \n \n Confirm\n \n
\n ) : (\n setEditingMode(true)}\n >\n \n Update Scans ({selectedCount})\n \n )}\n\n \n mutation.mutate({\n stop_id: stopID ?? 'Not available',\n shipment_ids: selectedShipments,\n })\n }\n >\n \n Split ({selectedCount})\n \n \n \n \n \n \n \n selectShipmentsByStatus('unscanned')}\n >\n Unscanned\n \n {\n selectShipmentsByStatus('missing');\n console.log('missing');\n e.preventDefault();\n e.stopPropagation();\n }}\n >\n Missing\n \n selectShipmentsByStatus('delivered')}\n >\n Delivered\n \n selectShipmentsByStatus('overage')}\n >\n Overages\n \n \n \n
\n
\n
\n );\n}\n","import React, { useState } from 'react';\nimport { Shipment } from '../../_models';\nimport { ShipmentCard } from './ShipmentCard';\nimport ShipmentsToolbar from './ShipmentsToolbar';\nimport { useStopShipments } from '../../contexts/StopShipments';\nimport { LUDate } from '@/common/classes/LUDate';\nimport { set } from 'date-fns';\n\ntype Props = {\n shipments: Shipment[];\n};\n\nexport default function ShipmentSection({ shipments }: Props) {\n const [lastSelectedIndex, setLastSelectedIndex] = useState(\n null,\n );\n const { filters, selectShipments, selectedShipments } = useStopShipments();\n\n const filteredShipments = shipments.filter((shipment) => {\n // Start with a match if the search term matches or is empty\n let matchesSearch = true;\n if (filters.search) {\n matchesSearch = shipment.tracking_id.includes(filters.search);\n }\n\n // Accumulate the conditions for the boolean filters\n let matchesBooleanFilters = false;\n\n if (filters.delivered && shipment.delivered) {\n matchesBooleanFilters = true;\n }\n\n if (filters.unscanned && shipment.unscanned) {\n matchesBooleanFilters = true;\n }\n\n if (filters.missing && shipment.missing) {\n matchesBooleanFilters = true;\n }\n\n if (filters.overage && shipment.overage) {\n matchesBooleanFilters = true;\n }\n\n // If no boolean filters are active, default to true (show all)\n const isAnyBooleanFilterActive =\n filters.delivered ||\n filters.unscanned ||\n filters.missing ||\n filters.overage;\n\n // If no boolean filters are active, the match is based on search, otherwise check both search and boolean filters\n return (\n matchesSearch && (matchesBooleanFilters || !isAnyBooleanFilterActive)\n );\n });\n\n // Get the first scanned shipment time\n const first_scanned_shipment_time = shipments.reduce(\n (acc: LUDate | null, shipment) => {\n const date = shipment.delivered ? new LUDate(shipment.delivered) : null;\n if (date && (!acc || date < acc)) {\n return date;\n }\n return acc;\n },\n null,\n );\n\n // Get the last scanned shipment time\n const last_scanned_shipment_time = shipments.reduce(\n (acc: LUDate | null, shipment) => {\n const date = shipment.delivered ? new LUDate(shipment.delivered) : null;\n if (date && (!acc || date > acc)) {\n return date;\n }\n return acc;\n },\n null,\n );\n\n const handleSelectShipment = (\n event: React.MouseEvent,\n trackingId: string,\n index: number,\n ) => {\n const isShiftPressed = event.shiftKey;\n const newSelected = new Set(selectedShipments);\n\n if (isShiftPressed && lastSelectedIndex !== null) {\n // Get the range of shipments to toggle\n const start = Math.min(lastSelectedIndex, index);\n const end = Math.max(lastSelectedIndex, index);\n\n // Check if majority in range is selected to decide whether to select or unselect\n const rangeShipments = filteredShipments.slice(start, end + 1);\n const majoritySelected =\n rangeShipments.filter((s) => newSelected.has(s.tracking_id)).length >\n rangeShipments.length / 2;\n\n rangeShipments.forEach((shipment) => {\n if (majoritySelected) {\n newSelected.delete(shipment.tracking_id); // Unselect\n } else {\n newSelected.add(shipment.tracking_id); // Select\n }\n });\n } else {\n // Toggle single shipment selection\n if (newSelected.has(trackingId)) {\n newSelected.delete(trackingId); // Unselect if already selected\n } else {\n newSelected.add(trackingId); // Select if not already selected\n }\n\n // Update last selected index\n setLastSelectedIndex(index);\n }\n\n selectShipments(Array.from(newSelected));\n };\n\n const selectShipmentsByStatus = (status: string) => {\n const shipmentIds = shipments\n .filter((shipment) => {\n if (status === 'delivered') {\n return shipment.delivered;\n }\n\n if (status === 'unscanned') {\n return shipment.unscanned;\n }\n\n if (status === 'missing') {\n return shipment.missing;\n }\n\n if (status === 'overage') {\n return shipment.overage;\n }\n\n return false;\n })\n .map((shipment) => shipment.tracking_id);\n\n selectShipments(shipmentIds);\n };\n\n const show_shipments = filteredShipments.length > 0;\n return (\n
\n shipment.delivered).length,\n unscanned: shipments.filter((shipment) => shipment.unscanned).length,\n missing: shipments.filter((shipment) => shipment.missing).length,\n overage: shipments.filter((shipment) => shipment.overage).length,\n total: shipments.length,\n }}\n />\n
\n {show_shipments ? (\n filteredShipments.map((shipment, index) => (\n \n handleSelectShipment(event, shipment.tracking_id, index)\n }\n >\n \n
\n ))\n ) : (\n
\n No Shipments Found\n
\n )}\n
\n \n );\n}\n","import * as React from 'react';\n\nimport { cn } from '@/lib/utils';\n\nexport type TextareaProps = React.TextareaHTMLAttributes;\n\nconst Textarea = React.forwardRef(\n ({ className, ...props }, ref) => {\n return (\n \n );\n }\n);\nTextarea.displayName = 'Textarea';\n\nexport { Textarea };\n","import { useMutation, useQueryClient } from 'react-query';\nimport { CurrentDayData, Stop } from '../_models';\nimport { useDispatchURL } from '../contexts/useDispatchURL';\nimport { useAuth } from '@/data/auth';\n\nexport function useAddPOD() {\n const queryClient = useQueryClient();\n const { currentDay } = useDispatchURL();\n const { stations } = useAuth();\n\n return useMutation(async ({ stop_id }: { stop_id: string }) => {\n const originalData: CurrentDayData | undefined = queryClient.getQueryData([\n currentDay,\n stations,\n ]);\n\n const updatedStops = originalData?.unnassigned_stops.map((stop) => {\n if (stop.id === stop_id) {\n return {\n ...stop,\n pod: true,\n };\n }\n return stop;\n });\n\n const updatedRoutes = originalData?.routes.map((route) => {\n return {\n ...route,\n stops: route.stops.map((stop) => {\n if (stop.id === stop_id) {\n return {\n ...stop,\n status: 'complete' as Stop['status'],\n };\n }\n return stop;\n }),\n };\n });\n\n try {\n queryClient.setQueryData(\n [currentDay, stations],\n (oldData) => {\n if (!oldData) {\n return oldData;\n }\n\n return {\n ...oldData,\n unnassigned_stops: updatedStops || [],\n routes: updatedRoutes || [],\n };\n },\n );\n } catch (error) {\n console.error(error);\n }\n });\n}\n","import { useState } from 'react';\nimport { PODData, StopDetails } from '../../_models';\nimport {\n Card,\n CardContent,\n CardFooter,\n CardHeader,\n CardTitle,\n} from '@/components/primitives/Card';\nimport { Button } from '@/components/primitives/Button';\nimport { Pencil } from 'lucide-react';\nimport { Label } from '@/components/primitives/Label';\nimport { Input } from '@/components/primitives/Input';\nimport { Textarea } from '@/components/primitives/Textarea';\nimport { LUDate } from '@/common/classes/LUDate';\nimport { upsertPOS } from '@/data/SupabaseRequests/dispatch-api/upsertPOS';\nimport { useAddPOD } from '../../mutations/useAddPOD';\nimport { useDispatchURL } from '../../contexts/useDispatchURL';\n\ntype Props = {\n pod: StopDetails['pos'];\n};\nexport default function PODSection({ pod }: Props) {\n const [podData, setPodData] = useState(pod);\n const [isEditing, setIsEditing] = useState(() => pod.completed_at === null);\n const [editedData, setEditedData] =\n useState>(pod);\n const addPODMutation = useAddPOD();\n\n const handleEdit = () => {\n setIsEditing(true);\n };\n\n const { detailedStop: stopID } = useDispatchURL();\n\n function getTimeAsInputDisplay() {\n if (isEditing) {\n return editedData.completed_at\n ? new LUDate(editedData.completed_at).toDateTimeLocalInputString()\n : new LUDate().toDateTimeLocalInputString();\n } else {\n return podData?.completed_at\n ? new LUDate(podData?.completed_at).toDateTimeLocalInputString()\n : new LUDate().toDateTimeLocalInputString();\n }\n }\n\n const handleSave = () => {\n setPodData({ ...podData, ...editedData } as StopDetails['pos']);\n setIsEditing(false);\n\n const posParams = {\n notes: editedData.notes ?? podData?.notes ?? '',\n signee: editedData.signee ?? podData?.signee ?? '',\n completed_at: editedData.completed_at\n ? new LUDate(editedData.completed_at).toISOString()\n : podData?.completed_at\n ? new LUDate(podData.completed_at).toISOString()\n : null,\n signature: editedData.signature ?? podData?.signature ?? '',\n };\n addPODMutation.mutate({ stop_id: stopID ?? 'No Stop ID available' });\n\n upsertPOS({ stop_id: stopID ?? 'No Stop ID available', pos: posParams });\n };\n\n const handleCancel = () => {\n setEditedData(podData as PODData);\n setIsEditing(false);\n };\n\n const handleChange = (field: keyof PODData, value: string | Date) => {\n if (field === 'completed_at') {\n setEditedData({\n ...editedData,\n [field]: new LUDate(value).toDateTimeLocalInputString(),\n });\n }\n setEditedData({ ...editedData, [field]: value });\n };\n\n return (\n \n \n \n Proof of Delivery\n {!isEditing && (\n \n )}\n \n \n \n
\n
\n
\n \n handleChange('signee', e.target.value)}\n disabled={!isEditing}\n />\n
\n
\n \n {\n e.stopPropagation(); // Ensure the modal doesn't close on click\n }}\n onChange={(e) => {\n handleChange('completed_at', e.target.value);\n }}\n disabled={!isEditing}\n />\n
\n
\n \n \n
\n
\n
\n
\n \n {podData?.signature ? (\n
\n \n
\n ) : (\n {\n const file = e.target.files?.[0];\n if (file) {\n const reader = new FileReader();\n reader.onloadend = () => {\n handleChange('signature', reader.result as string);\n };\n reader.readAsDataURL(file);\n }\n }}\n disabled={true}\n />\n )}\n
\n
\n \n handleChange('notes', e.target.value)}\n disabled={!isEditing}\n placeholder=\"Add any additional notes here...\"\n className=\"min-h-[120px]\"\n />\n
\n
\n
\n
\n \n {isEditing && (\n <>\n \n \n \n )}\n \n
\n );\n}\n","import { useQuery } from 'react-query';\nimport { Button } from '@/components/primitives/Button';\nimport { ChevronLeft } from 'lucide-react';\nimport { Card, CardHeader, CardContent } from '@/components/primitives/Card';\nimport {\n GetShipmentsForStopResponse,\n getShipmentsForStop,\n} from '@/data/SupabaseRequests/dispatch-api/getShipmentsForStop';\nimport { getDetailsForStopWrapper } from '../../factoryFunctions/getDetailsForStop';\nimport ShipmentSection from './ShipmentSection';\nimport { StopShipmentsProvider } from '../../contexts/StopShipments';\nimport { Weight } from '@/helpers/Weight';\nimport { Shipment } from '../../_models';\nimport PODSection from './PODSection';\nimport { useDispatchURL } from '../../contexts/useDispatchURL';\n\nexport function IndividualStopPage() {\n const { setDetailedStop, detailedStop: stopID } = useDispatchURL();\n\n const handleBackClick = () => {\n setDetailedStop(null);\n };\n\n const { data: db_shipments } = useQuery({\n queryKey: [stopID, 'shipments'],\n queryFn: () => getShipmentsForStop({ stop_id: stopID ?? '' }),\n enabled: !!stopID,\n });\n\n const { data: stopDetails } = useQuery({\n queryKey: [stopID, 'stop_details'],\n queryFn: () => getDetailsForStopWrapper({ stop_id: stopID ?? '' }),\n enabled: !!stopID,\n });\n\n const shipments: Shipment[] | undefined = db_shipments?.map((shipment) => {\n return {\n tracking_id: shipment.tracking_id,\n delivered: shipment.delivered || null, // Ensure delivered is a string\n missing: shipment.missing,\n notes: shipment.notes,\n pieces: shipment.pieces,\n weight: new Weight(shipment.weight), // Convert weight to Weight object\n overage: shipment.overage, // Convert overage to string\n scanner: shipment.scanner,\n unscanned: shipment.delivered === null, // Set unscanned based on delivered field\n };\n });\n\n return (\n \n \n \n \n\n \n
\n {stopDetails && (\n
\n \n
\n )}\n
\n \n \n \n
\n
\n
\n
\n );\n}\n","import { DialogContent } from '@radix-ui/react-dialog';\nimport React from 'react';\nimport { IndividualStopPage } from './IndividualStopPage';\nimport { Dialog } from '@/components/primitives/Dialog';\n\nimport { useDispatchURL } from '../../contexts/useDispatchURL';\n\nexport default function StopDetailsModal() {\n const { detailedStop, setDetailedStop } = useDispatchURL();\n\n return (\n \n \n \n \n \n );\n}\n","import React from 'react';\nimport CurrentDayContent from './CurrentDayContent';\nimport { PageHeader } from '@/layout/PageHeader';\nimport StopDetailsModal from './components/IndividualStop/StopDetailsModal';\nexport function DispatchPage() {\n return (\n
\n
\n \n
\n \n \n
\n );\n}\n","import { useEffect, useState } from 'react';\n\n/**\n * Delay value change by at least the given delay.\n *\n * @param delay - in milliseconds\n */\nexport function useDebounce(value: T, delay: number): T {\n const [debouncedValue, setDebouncedValue] = useState(value);\n\n useEffect(() => {\n const timeout = setTimeout(() => {\n setDebouncedValue(value);\n }, delay);\n\n return () => clearTimeout(timeout);\n }, [value, delay]);\n\n return debouncedValue;\n}\n","import { shipmentSearch } from '@/data/SupabaseRequests/dispatch-api/shipmentSearch';\nimport { createContext, useContext, useState, useEffect } from 'react';\nimport { useDebounce } from '@/common/hooks/useDebounce';\n\nexport type ShipmentSearch = {\n date: string | null;\n stop_id: string;\n tracking_id: string;\n};\n\ninterface IShipmentSearchContext {\n searchResults: ShipmentSearch[];\n setSearch: (search: string) => void;\n isLoading: boolean;\n error: string | null;\n}\n\nconst ShipmentSearchContext = createContext({\n searchResults: [],\n setSearch: () => {\n console.log('setSearch not implemented');\n },\n isLoading: false,\n error: null,\n});\n\nexport const useShipmentSearch = () => {\n const { searchResults, setSearch, isLoading, error } = useContext(\n ShipmentSearchContext,\n );\n return {\n searchResults,\n setSearch,\n isLoading,\n error,\n };\n};\n\nexport const ShipmentSearchProvider = ({\n children,\n}: {\n children: React.ReactNode;\n}) => {\n const [search, setSearch] = useState('');\n const [searchResults, setSearchResults] = useState([]);\n const [isLoading, setIsLoading] = useState(false);\n const [error, setError] = useState(null);\n\n // Debounce the search term\n const debouncedSearchTerm = useDebounce(search, 500);\n\n // Effect to trigger the search API call when the debounced term changes\n useEffect(() => {\n if (debouncedSearchTerm.trim() === '') {\n setSearchResults([]);\n return;\n }\n\n const fetchData = async () => {\n setIsLoading(true);\n try {\n const results = await shipmentSearch({ search: debouncedSearchTerm });\n setSearchResults(results);\n setError(null);\n } catch (err) {\n setError((err as Error).message);\n setSearchResults([]);\n } finally {\n setIsLoading(false);\n }\n };\n\n fetchData();\n }, [debouncedSearchTerm]);\n\n return (\n \n {children}\n \n );\n};\n","import React from 'react';\nimport { Route, Routes } from 'react-router';\nimport { DispatchPage } from './DispatchPage';\nimport { ShipmentSearchProvider } from './contexts/useShipmentSearch';\nimport { DispatchURLProvider } from './contexts/useDispatchURL';\n\nexport default function DispatchPageWrapper() {\n return (\n \n \n \n \n \n \n }\n />\n \n );\n}\n","import { supabase } from \"../../supabase\";\n\n// To regenerate this file, run the CLI command `deno run --allow-read --allow-write --allow-sys schema_to_ts.ts`. The script is located in the supabase-functions directory.\n\n/**\n * This interface was referenced by `Interface`'s JSON-Schema\n * via the `definition` \"sallyScansResponse\".\n */\nexport type SallyScansResponse = {\n tracking_id: string;\n delivered_at: string;\n unloaded_at: string;\n store_num: string;\n store_name: string;\n line_1: string;\n city: string;\n state: string;\n zip: string;\n bol: string;\n}[];\n\n\n/**\n * This interface was referenced by `Interface`'s JSON-Schema\n * via the `definition` \"sallyScansParams\".\n */\nexport interface SallyScansParams {\n function: \"sally-scans\";\n start: string;\n end: string;\n}\n\n\nexport async function sallyScans(\n params: Omit,\n){\n try {\n const result = await supabase.functions.invoke( \n 'reports-api',\n { body: { ...params, function: 'sally-scans' }},\n );\n\n if (!result.error && result.data) {\n return result.data;\n } else if (result.error) {\n throw new Error(\"Error Fetching Result in reports-api/sallyScans:\" + result.error);\n } else {\n throw new Error('Unknown error: result does not contain data or error.');\n }\n } catch (error) {\n console.error('Error:', error);\n throw error;\n }\n}\n","export const exportToCSV = (\n headers: string[],\n data: Array>,\n filename: string\n) => {\n const csvHeaders = headers.join(',');\n\n const csvRows = data.map((row) => {\n return headers\n .map((header) => {\n const value = row[header];\n return typeof value === 'string'\n ? `\"${value.replace(/\"/g, '\"\"')}\"`\n : value;\n })\n .join(',');\n });\n\n const csvContent = [csvHeaders, ...csvRows].join('\\n');\n downloadFile(csvContent, filename);\n};\n\nconst downloadFile = (data: string, filename: string) => {\n const blob = new Blob([data], { type: 'text/csv' });\n const url = window.URL.createObjectURL(blob);\n\n const a = document.createElement('a');\n a.href = url;\n a.download = filename;\n\n document.body.appendChild(a);\n a.click();\n document.body.removeChild(a);\n};\n","import { SallyScansResponse } from '@/data/SupabaseRequests/reports-api/sallyScans';\nimport { ScanLine } from '../SallyScanning/models';\nimport { LUDate } from '@/common/classes/LUDate';\nimport { exportToCSV } from '@/common/functions/downloadFile';\n\nexport function downloadScans(scans: SallyScansResponse): void {\n const scanLines = scans.flatMap((scan) => [\n {\n CustomerName: 'Sally Beauty',\n PoolPointID: '0',\n SCAC: 'TFOE',\n SupplierID: '0',\n CarrierName: 'TRANSFIRE LLC',\n 'Store#': scan.store_num,\n StopName: scan.store_name,\n Address1: scan.line_1,\n Address2: '',\n City: scan.city,\n State: scan.state,\n Zip: scan.zip,\n StopType: 'X4',\n ReasonCode: ' ',\n StopDate: new LUDate(scan.unloaded_at).asHTMLInputValue(),\n StopTime: new LUDate(scan.unloaded_at).toLocaleTimeString(),\n StopType2: '',\n ReasonCode2: '',\n StopDate2: '',\n StopTime2: '',\n StopType3: '',\n ReasonCode3: '',\n StopDate3: '',\n StopTime3: '',\n IBTrailerID: '',\n 'BOL#': scan.bol,\n Barcode: scan.tracking_id,\n PalletIDTag: '',\n CartonCondition: '',\n },\n {\n CustomerName: 'Sally Beauty',\n PoolPointID: '0',\n SCAC: 'TFOE',\n SupplierID: '0',\n CarrierName: 'TRANSFIRE LLC',\n 'Store#': scan.store_num,\n StopName: scan.store_name,\n Address1: scan.line_1,\n Address2: '',\n City: scan.city,\n State: scan.state,\n Zip: scan.zip,\n StopType: 'D1',\n ReasonCode: '',\n StopDate: new LUDate(scan.delivered_at).asHTMLInputValue(),\n StopTime: new LUDate(scan.delivered_at).toLocaleTimeString(),\n StopType2: '',\n ReasonCode2: '',\n StopDate2: '',\n StopTime2: '',\n StopType3: '',\n ReasonCode3: '',\n StopDate3: '',\n StopTime3: '',\n IBTrailerID: '',\n 'BOL#': scan.bol,\n Barcode: scan.tracking_id,\n PalletIDTag: '',\n CartonCondition: '',\n },\n ]);\n\n const name = new LUDate(scans[0].delivered_at).toString(false, true, true);\n\n exportToCSV(\n Object.keys(scanLines[0]) as Array,\n scanLines,\n `SallyScans_${name}.csv`,\n );\n}\n","import { LUDate } from '@/common/classes/LUDate';\nimport { SallyScansResponse } from '@/data/SupabaseRequests/reports-api/sallyScans';\nimport { Download } from 'lucide-react';\nimport React from 'react';\nimport { downloadScans } from '../functions/downloadScans';\n\ntype Props = {\n scans: SallyScansResponse;\n};\n\nexport default function ScanningTable({ scans }: Props) {\n return (\n <>\n
\n {scans.length > 0 && (\n downloadScans(scans)}\n />\n )}\n
Tracking ID
\n
Store Num
\n
Scan Type
\n
Scan Time
\n
\n\n {scans.length === 0 && (\n
No scans found
\n )}\n\n {/* Scrollable rows container */}\n
\n {' '}\n {/* Set the height and scrolling */}\n {scans.map((scan) => (\n \n
{scan.tracking_id}
\n
{scan.store_num}
\n
X4
\n
\n {scan.unloaded_at\n ? new LUDate(scan.unloaded_at).toLocaleString()\n : 'Not Available'}\n
\n\n
{scan.tracking_id}
\n
{scan.store_num}
\n
D1
\n
\n {scan.delivered_at\n ? new LUDate(scan.delivered_at).toLocaleString()\n : 'Not Available'}\n
\n
\n ))}\n \n \n );\n}\n","import { LUDate } from '@/common/classes/LUDate';\nimport { Button } from '@/components/primitives/Button';\nimport { Input } from '@/components/primitives/Input';\nimport {\n sallyScans,\n SallyScansResponse,\n} from '@/data/SupabaseRequests/reports-api/sallyScans';\nimport { Loading } from '@/layout/Loading';\nimport React, { useState } from 'react';\nimport ScanningTable from './ScanningTable';\n\nexport default function SallyScanning() {\n const [date, setDate] = useState(new LUDate());\n const [scans, setScans] = useState([]);\n const [isLoading, setIsLoading] = useState(false);\n\n const onSubmit = async () => {\n setIsLoading(true);\n setScans([]);\n\n const response = await sallyScans({\n start: date.startOfDay().toISOString(),\n end: date.endOfDay().toISOString(),\n });\n\n setScans(response);\n setIsLoading(false);\n };\n\n return (\n
\n
\n
\n setDate(new LUDate(e.target.value).addDays(1))}\n />\n\n \n
\n
\n {scans.length > 0 && (\n \n {scans.length} {' Shipments Found'}\n \n )}\n
\n
\n {isLoading ? : }\n
\n );\n}\n","import { useState } from 'react';\nimport {\n Table,\n TableBody,\n TableCell,\n TableHead,\n TableHeader,\n TableRow,\n} from '@/components/primitives/Table';\nimport {\n ColumnDef,\n flexRender,\n getCoreRowModel,\n getSortedRowModel,\n SortingState,\n useReactTable,\n} from '@tanstack/react-table';\n\ninterface DataTableProps {\n columns: ColumnDef[];\n data: TData[];\n}\n\nexport function DataTable({\n columns,\n data,\n}: DataTableProps) {\n const [sorting, setSorting] = useState([]);\n const [copiedCell, setCopiedCell] = useState(null); // Track which cell was copied\n const [copiedCellId, setCopiedCellId] = useState(null); // Track which cell ID was copied (to identify specific cell)\n\n const table = useReactTable({\n data,\n columns,\n getCoreRowModel: getCoreRowModel(),\n state: {\n sorting,\n },\n onSortingChange: setSorting,\n getSortedRowModel: getSortedRowModel(),\n });\n\n // Function to handle cell click and copy to clipboard\n const handleCellClick = (cellValue: string, cellId: string) => {\n navigator.clipboard.writeText(cellValue).then(() => {\n setCopiedCell('Copied!'); // Show \"Copied!\" in place of the cell content\n setCopiedCellId(cellId); // Keep track of which cell was copied\n\n // Reset after 2 seconds\n setTimeout(() => {\n setCopiedCell(null); // Clear the \"Copied!\" message\n setCopiedCellId(null); // Clear the copied cell ID\n }, 700);\n });\n };\n\n const scrollbarClassname =\n 'h-[95%] overflow-y-auto scrollbar scrollbar-track-slate-100 scrollbar-thumb-slate-200 hover:scrollbar-thumb-slate-300 scrollbar-thin ';\n\n return (\n
\n \n \n {table.getHeaderGroups().map((headerGroup) => (\n \n {headerGroup.headers.map((header) => {\n return (\n \n {header.isPlaceholder ? null : (\n \n {flexRender(\n header.column.columnDef.header,\n header.getContext(),\n )}\n {{\n asc: ,\n desc: ,\n }[header.column.getIsSorted() as string] ?? null}\n \n )}\n \n );\n })}\n \n ))}\n \n\n \n {table.getRowModel().rows?.length ? (\n table.getRowModel().rows.map((row) => (\n \n {row.getVisibleCells().map((cell) => (\n \n handleCellClick(cell.getValue() as string, cell.id)\n } // Pass cell id\n >\n {/* Display \"Copied!\" if this cell is the one that was clicked */}\n {copiedCellId === cell.id\n ? copiedCell\n : flexRender(\n cell.column.columnDef.cell,\n cell.getContext(),\n )}\n \n ))}\n \n ))\n ) : (\n \n \n No results.\n \n \n )}\n \n
\n
\n );\n}\n","import {\n MotionValue,\n motion,\n useMotionValue,\n useTransform,\n} from 'framer-motion';\n\nexport function Success() {\n const progress: MotionValue = useMotionValue(90);\n return (\n
\n \n \n
\n );\n}\n\ntype props = {\n progress: MotionValue;\n};\n\nfunction CircularProgress({ progress }: props) {\n const circleLength = useTransform(progress, [0, 100], [0, 1]);\n const checkmarkPathLength = useTransform(progress, [0, 95, 100], [0, 0, 1]);\n const circleColor = useTransform(\n progress,\n [0, 95, 100],\n ['#FFCC66', '#FFCC66', '#66BB66']\n );\n\n return (\n \n {/* Check mark */}\n \n {/* Circle */}\n \n \n );\n}\n","/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { ColumnDef } from '@tanstack/react-table';\nimport { StopBillingInfo } from '@/data/SupabaseRequests/reports-api/createSallyEdi';\nimport { TooltipWrapper } from '@/components/TooltipWrapper';\nimport { Button } from '@/components/primitives/Button';\nimport { Dialog } from '@/components/primitives/Dialog';\nimport { DialogTrigger } from '@radix-ui/react-dialog';\nimport { Weight } from '@/helpers/Weight';\n\nexport const BillingColumns: ColumnDef[] = [\n {\n header: 'Store #',\n id: 'store',\n enableSorting: true,\n accessorKey: 'store',\n accessorFn: (row) => row.stop.store_ref,\n sortingFn: 'alphanumeric',\n cell: ({ cell }) => {\n return
{cell.row.original.stop.store_ref}
;\n },\n },\n {\n header: 'BOLs',\n id: 'bols',\n enableSorting: true,\n cell: ({ cell }) => {\n return (\n \n
\n {/* \n \n */}\n
{cell.row.original.bol}
\n
\n
\n );\n },\n },\n // {\n // header: 'Route Name',\n // id: 'name',\n // enableSorting: true,\n // accessorKey: 'name',\n // accessorFn: (row) => row.stop.route_name,\n // sortingFn: 'alphanumeric',\n // cell: ({ cell }) => {\n // return
{cell.row.original.stop.route_name}
;\n // },\n // },\n {\n header: 'Pieces',\n id: 'pieces',\n enableSorting: true,\n accessorKey: 'pieces',\n accessorFn: (row) => row.stop.pieces,\n sortingFn: 'alphanumeric',\n cell: ({ cell }) => {\n return
{cell.row.original.stop.pieces}
;\n },\n },\n\n {\n header: 'Weight(lbs)',\n id: 'weight',\n enableSorting: true,\n accessorKey: 'weight',\n accessorFn: (row) => row.stop.weight,\n sortingFn: 'alphanumeric',\n cell: ({ cell }) => {\n return
{new Weight(cell.row.original.stop.weight).inPounds}
;\n },\n },\n {\n header: 'Min',\n id: 'min',\n enableSorting: true,\n accessorKey: 'min',\n accessorFn: (row) => row.min,\n sortingFn: 'alphanumeric',\n cell: ({ cell }) => {\n return
{'$' + cell.row.original.min}
;\n },\n },\n {\n header: 'Min Used',\n id: 'min_used',\n enableSorting: true,\n accessorKey: 'is_min',\n accessorFn: (row) => (row.is_min ? 'A' : 'B'),\n sortingFn: 'alphanumeric',\n cell: ({ cell }) => {\n return
{cell.row.original.is_min ? 'T' : 'F'}
;\n },\n },\n {\n header: 'Base',\n id: 'base',\n enableSorting: true,\n accessorKey: 'base',\n accessorFn: (row) => row.base,\n sortingFn: 'alphanumeric',\n cell: ({ cell }) => {\n return
{'$' + cell.row.original.base.toFixed(2)}
;\n },\n },\n {\n header: 'Sort',\n id: 'sort',\n enableSorting: true,\n accessorKey: 'sort',\n accessorFn: (row) => row.sort,\n sortingFn: 'alphanumeric',\n cell: ({ cell }) => {\n return
{'$' + cell.row.original.sort}
;\n },\n },\n {\n header: 'FSC',\n id: 'fsc',\n enableSorting: true,\n accessorKey: 'fsc',\n accessorFn: (row) => row.fsc,\n sortingFn: 'alphanumeric',\n cell: ({ cell }) => {\n return
{'$' + cell.row.original.fsc.toFixed(2)}
;\n },\n },\n {\n header: 'Total',\n id: 'total',\n enableSorting: true,\n accessorKey: 'total',\n accessorFn: (row) => row.total,\n sortingFn: 'alphanumeric',\n cell: ({ cell }) => {\n const data = cell.row.original;\n return (\n
\n \n {'$' + cell.row.original.total}\n \n
\n );\n },\n },\n];\n","export const HEADERS = ['store_ref', 'pieces', 'bol', 'pro_num'];\n","import { HEADERS } from './_models';\n\n/**\n * Donwload template CSV file for importing store delivery counts\n * @param data\n */\nexport const downloadTemplate = () => {\n const csvContent = generateCSVContent();\n\n const blob = new Blob([csvContent], { type: 'text/csv' });\n\n const a = document.createElement('a');\n\n const fileName = `Invoice_Template.csv`;\n a.download = fileName;\n a.href = window.URL.createObjectURL(blob);\n const clickEvt = new MouseEvent('click', {\n view: window,\n bubbles: true,\n cancelable: true,\n });\n a.dispatchEvent(clickEvt);\n a.remove();\n};\n\nconst generateCSVContent = () => {\n const headerRow = HEADERS.join(',') + '\\n';\n return headerRow;\n};\n","import Papa from 'papaparse';\nimport { StoreAndPieces } from '@/data/SupabaseRequests/reports-api/createSallyEdi';\n\n/**\n * Parse CSV file and give result to callback\n * @param file\n * @param callback\n */\nexport function parseFile(\n file: File,\n callback: (data: StoreAndPieces[]) => void,\n) {\n Papa.parse(file, {\n header: true,\n skipEmptyLines: 'greedy',\n transform: (val: string, col: string) => {\n if (val.includes('\\n')) {\n val = val.replace('\\n', '');\n }\n\n if (val.length === 4) {\n val = '0' + val;\n }\n\n if (col === 'store_ref') {\n return val.trim();\n } else if (col === 'bol') {\n if (val.includes('+')) {\n val = val.replace(/\\+/g, '-').trim();\n }\n return val;\n } else if (col === 'pro_num') {\n return val.trim();\n } else {\n return Number(val.trim());\n }\n },\n transformHeader: function (h: string, index: number) {\n const header = h.toLowerCase().trim();\n if (header === 'store_code') {\n return 'store_ref';\n }\n return header;\n },\n\n complete: function (results: Papa.ParseResult, file: File) {\n const data = results.data as StoreAndPieces[];\n callback(data);\n },\n });\n}\n","import { LUDate } from '@/common/classes/LUDate';\nimport { Input } from '@/components/primitives/Input';\nimport { useState } from 'react';\n\ntype Props = {\n setShowData: (value: boolean) => void;\n setFromDate: (value: LUDate | null) => void;\n setToDate: (value: LUDate | null) => void;\n setDisabled: (value: boolean) => void;\n};\n\nexport function DateControl({\n setShowData,\n setFromDate,\n setToDate,\n setDisabled,\n}: Props) {\n const [disableToDate, setDisableToDate] = useState(false);\n const [currentFromDate, setCurrentFromDate] = useState();\n\n return (\n
\n {\n setShowData(false);\n if (e.target.value) {\n setFromDate(new LUDate(e.target.value).startOfDay());\n setCurrentFromDate(new LUDate(e.target.value).startOfDay());\n setDisableToDate(false);\n } else {\n setFromDate(null);\n setCurrentFromDate(null);\n setToDate(null);\n setDisabled(true);\n setDisableToDate(true);\n }\n }}\n />\n {\n setShowData(false);\n if (e.target.value) {\n setToDate(new LUDate(e.target.value).endOfDay());\n } else {\n setToDate(null);\n setDisabled(true);\n }\n }}\n />\n
\n );\n}\n","import { supabase } from \"../../supabase\";\n\n// To regenerate this file, run the CLI command `deno run --allow-read --allow-write --allow-sys schema_to_ts.ts`. The script is located in the supabase-functions directory.\n\n\n/**\n * This interface was referenced by `Interface`'s JSON-Schema\n * via the `definition` \"storeAndPieces\".\n */\nexport interface StoreAndPieces {\n store_ref: string;\n pieces: number;\n bol: string;\n pro_num: string;\n}\n/**\n * This interface was referenced by `Interface`'s JSON-Schema\n * via the `definition` \"createSallyEdiParams\".\n */\nexport interface CreateSallyEdiParams {\n function: \"create-sally-edi\";\n fromDate: string;\n toDate: string;\n storeData: StoreAndPieces[];\n}\n/**\n * This interface was referenced by `Interface`'s JSON-Schema\n * via the `definition` \"stop\".\n */\nexport interface Stop {\n store_ref: string;\n weight: number;\n pieces: number;\n bol: string;\n pro_num: string;\n delivery_date: string;\n created_at: string;\n address_name: string;\n address_line_1: string;\n city: string;\n state: string;\n zip: string;\n}\n/**\n * This interface was referenced by `Interface`'s JSON-Schema\n * via the `definition` \"stopBillingInfo\".\n */\nexport interface StopBillingInfo {\n stop: Stop;\n base: number;\n base_total: number;\n sort_charge: number;\n min: number;\n sort: number;\n fsc: number;\n bol: string;\n pro_num: string;\n fuel_charge: number;\n total: number;\n is_min: boolean;\n fsc_percent_string: string;\n}\n/**\n * This interface was referenced by `Interface`'s JSON-Schema\n * via the `definition` \"createSallyEdiResponse\".\n */\nexport interface CreateSallyEdiResponse {\n preview: StopBillingInfo[];\n pieceCount: number;\n ediString: string;\n}\n\n\nexport async function createSallyEdi(\n params: Omit,\n){\n try {\n const result = await supabase.functions.invoke( \n 'reports-api',\n { body: { ...params, function: 'create-sally-edi' }},\n );\n\n if (!result.error && result.data) {\n return result.data;\n } else if (result.error) {\n throw new Error(\"Error Fetching Result in reports-api/createSallyEdi:\" + result.error);\n } else {\n throw new Error('Unknown error: result does not contain data or error.');\n }\n } catch (error) {\n console.error('Error:', error);\n throw error;\n }\n}\n","import { exportToCSV } from '@/common/functions/downloadFile';\nimport { StopBillingInfo } from '@/data/SupabaseRequests/reports-api/createSallyEdi';\n\nexport function downloadInvoiceDataAsCSV(\n data: Omit[],\n start: string,\n end: string,\n) {\n const name = `Sally_Invoice_${start}_${end}.csv`;\n\n function useFriendlyHeaders(header: string) {\n switch (header) {\n case 'base':\n return 'Base';\n case 'base_total':\n return 'Base Total';\n case 'sort_charge':\n return 'Sort Charge';\n case 'min':\n return 'Min';\n case 'sort':\n return 'Sort';\n case 'fsc':\n return 'FSC';\n case 'bol':\n return 'BOL';\n case 'pro_num':\n return 'Pro Num';\n case 'fuel_charge':\n return 'Fuel Charge($)';\n case 'total':\n return 'Total';\n case 'is_min':\n return 'Min Used';\n case 'fsc_percent_string':\n return 'FSC Percent';\n default:\n return header;\n }\n }\n\n const headers = Object.keys(data[0]) as Array<\n keyof Omit\n >;\n\n exportToCSV(\n headers\n .map((header) => useFriendlyHeaders(header))\n .filter((header) => header !== 'stop'),\n data.map((row) => {\n return {\n Base: row.base.toString(),\n 'Base Total': row.base_total.toString(),\n 'Sort Charge': row.sort_charge.toString(),\n Min: row.min.toString(),\n Sort: row.sort.toString(),\n FSC: row.fsc.toString(),\n BOL: row.bol,\n 'Pro Num': row.pro_num,\n 'Fuel Charge($)': row.fuel_charge.toString(),\n Total: row.total.toString(),\n 'Min Used': row.is_min ? 'Yes' : 'No',\n 'FSC Percent': row.fsc_percent_string,\n };\n }),\n name,\n );\n}\n","/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { LUDate } from '@/common/classes/LUDate';\nimport { Button } from '@/components/primitives/Button';\nimport { Input } from '@/components/primitives/Input';\nimport { useEffect, useState } from 'react';\nimport { DataTable } from './DataTable';\nimport { Success } from './Success';\nimport { BillingColumns } from './BillingColumns';\nimport { Loading } from '@/layout/Loading';\nimport { downloadTemplate } from './downloadTemplate';\nimport { parseFile } from './parseFile';\nimport { DateControl } from './DateControl';\nimport {\n StopBillingInfo,\n StoreAndPieces,\n createSallyEdi,\n} from '@/data/SupabaseRequests/reports-api/createSallyEdi';\nimport {\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuLabel,\n} from '@/components/primitives/DropdownMenu';\nimport { DropdownMenuTrigger } from '@radix-ui/react-dropdown-menu';\nimport { Download } from 'lucide-react';\nimport { downloadInvoiceDataAsCSV } from './downloadAsCSV';\n\nexport function SallyInvoicing() {\n const [showData, setShowData] = useState(false);\n const [success, setSuccess] = useState(false);\n const [disabled, setDisabled] = useState(false);\n\n const [fromDate, setFromDate] = useState(\n new LUDate().addDays(-7),\n );\n const [toDate, setToDate] = useState(new LUDate());\n const [invoiceData, setInvoiceData] = useState([]);\n const [isLoading, setIsLoading] = useState(false);\n const [errorText, setErrorText] = useState(null);\n const [storeData, setStoreData] = useState([]);\n const [ediText, setEdiText] = useState(null);\n const [lucidityCount, setLucidityCount] = useState(0);\n\n useEffect(() => {\n if (fromDate && toDate) {\n setDisabled(false);\n }\n }, [fromDate, toDate]);\n\n useEffect(() => {\n if (storeData.length > 0) {\n handlePreviewClick();\n }\n }, [storeData]);\n\n /**\n * Generate EDI file contents preview\n */\n function handlePreviewClick() {\n setIsLoading(true);\n setErrorText(null);\n if (toDate && fromDate) {\n createSallyEdi({\n toDate: toDate.toISOString(),\n fromDate: fromDate.toISOString(),\n storeData,\n })\n .then((result) => {\n setInvoiceData(result.preview);\n setEdiText(result.ediString);\n setLucidityCount(result.pieceCount);\n setIsLoading(false);\n setShowData(true);\n })\n .catch((e) => {\n setErrorText(e.message);\n setIsLoading(false);\n });\n }\n }\n\n /**\n * Download edi file\n */\n function handleDownloadClick() {\n setIsLoading(true);\n setTimeout(() => {\n if (ediText) {\n downloadFile(ediText);\n setSuccess(true);\n setIsLoading(false);\n }\n }, 1000);\n }\n\n const downloadFile = (data: BlobPart) => {\n const blob = new Blob([data], { type: 'edi' });\n\n const a = document.createElement('a');\n const date = new LUDate();\n const dateString = date\n .toISOString()\n .replace(/[-:]/g, '')\n .replace(/\\.\\d+/, '');\n const fileName = `invoices/TFOE210_${dateString}.edi`;\n a.download = fileName;\n a.href = window.URL.createObjectURL(blob);\n const clickEvt = new MouseEvent('click', {\n view: window,\n bubbles: true,\n cancelable: true,\n });\n a.dispatchEvent(clickEvt);\n a.remove();\n };\n\n return (\n
\n {!success ? (\n
\n

\n Select Date Range\n

\n \n {isLoading ? (\n \n ) : errorText != null ? (\n
{errorText}
\n ) : (\n
\n
\n {!showData && (\n \n )}\n
\n {\n if (e.target.files) {\n parseFile(e.target.files[0], setStoreData);\n }\n }}\n />\n
\n {showData && (\n \n \n \n \n \n \n EDI\n \n \n downloadInvoiceDataAsCSV(\n invoiceData,\n fromDate?.asHTMLInputValue() ?? '',\n toDate?.asHTMLInputValue() ?? '',\n )\n }\n >\n CSV\n \n \n \n )}\n
\n
\n )}\n {showData && (\n
\n
\n

{'Lucidity Piece Count: ' + lucidityCount}

\n

{'Total Pieces: ' + sumStopPieces(invoiceData)}

\n

\n {'Total Billed: $' +\n invoiceData.reduce((acc, i) => acc + i.total, 0).toFixed(2)}\n

\n
\n
\n \n
\n
\n )}\n
\n ) : (\n
\n \n
\n )}\n
\n );\n}\n\nfunction sumStopPieces(stops: StopBillingInfo[]) {\n let sum = 0;\n stops.forEach((stop) => {\n sum += stop.stop.pieces;\n });\n return sum;\n}\n","import React from 'react';\nimport SallyScanning from './TabContent/SallyScanning/SallyScanning';\nimport { SallyInvoicing } from './TabContent/SallyInvoice/SallyInvoicing';\nimport { useAuth } from '@/data/auth';\nimport { PageHeader } from '@/layout/PageHeader';\nimport { Route, Routes } from 'react-router';\n\nexport function ReportsPageWrapper() {\n const { user } = useAuth();\n return (\n <>\n \n \n {user?.org_type === 'carrier' ? (\n } key={'invoicing'} />\n ) : (\n } key={'scannning'} />\n )}\n \n \n );\n}\n","import { Button } from '@/components/primitives/Button';\nimport { Textarea } from '@/components/primitives/Textarea';\nimport { useState } from 'react';\n\ntype Props = {\n setTrackingIDs: (trackingIDs: string[]) => void;\n};\n\n/**\n * Container for the search input and search button.\n * @param param0\n * @returns\n */\nexport function SearchContainer({ setTrackingIDs }: Props) {\n const [searchValue, setSearchValue] = useState('');\n\n const handleChange = (inputString: string) => {\n // replace input by replacing sequences of spaces, commas, or newlines with a single comma\n return inputString.replace(/[\\s,]+/g, ',');\n };\n\n const handleSearchClick = () => {\n // Split the normalized input by comma, filter out any empty or only-space entries\n const trackingIDs = searchValue.split(',')\n .map(id => id.trim()) // Trim each ID to remove leading/trailing spaces\n .filter(id => id !== ''); // Remove any entries that are empty after trimming\n\n setTrackingIDs(trackingIDs);\n setSearchValue('');\n };\n\n return (\n \n
\n
\n setSearchValue(handleChange(e.target.value))}\n />\n
\n
\n {\n if (searchValue.length > 0) {\n handleSearchClick();\n }\n }}\n >\n Search\n \n
\n
\n
\n );\n}\n","import { LUDate } from '@/common/classes/LUDate';\nimport { ShipmentInfo, ShipmentTrackingData } from './models';\n\ntype Props = {\n shipmentDetails: ShipmentInfo;\n inputted_tracking_ids: string[];\n};\n\n/**\n * Shipment sscan history header data\n * @param param0\n * @returns\n */\nexport function ShipmentDetails({\n shipmentDetails,\n inputted_tracking_ids,\n}: Props) {\n\n const getLongestMatch = () => {\n let longestMatch = '';\n\n inputted_tracking_ids.forEach(id => {\n if (shipmentDetails.trackingId.includes(id) && id.length > longestMatch.length) {\n longestMatch = id;\n }\n });\n\n return longestMatch;\n};\n\n return (\n
\n
\n
\n Tracking ID:

{renderTrackingIdWithBoldMatch(shipmentDetails.trackingId, getLongestMatch())}

\n
\n
\n Weight:

{shipmentDetails.weight}(lbs)

\n
\n
\n
\n
\n Ship Date:\n

\n {new LUDate(shipmentDetails.shipDate).toDisplayString()}\n

\n
\n\n
\n Estimated Arrival:{' '}\n

\n {new LUDate(shipmentDetails.estimatedArrival).toDisplayString()}\n

\n
\n
\n
\n
\n
\n Store Address:\n

\n {shipmentDetails.address_string}\n

\n
\n
\n Store Number:\n

{shipmentDetails.storeNumber}

\n
\n
\n
\n
\n );\n}\n\nconst renderTrackingIdWithBoldMatch = (trackingId: string, longestMatch: string) => {\n if (!longestMatch) {\n return {trackingId};\n }\n\n const splitIndex = trackingId.indexOf(longestMatch);\n const beforeMatch = trackingId.substring(0, splitIndex);\n const afterMatch = trackingId.substring(splitIndex + longestMatch.length);\n\n return (\n <>\n {beforeMatch}\n {longestMatch}\n {afterMatch}\n \n );\n};\n\n","import { MoveRight, PackageCheck, PackageX } from 'lucide-react';\nimport { ShipmentTrackingData } from './models';\nimport { LUDate } from '@/common/classes/LUDate';\n\ntype Props = {\n shipmentTrackingData: ShipmentTrackingData;\n};\n\nconst scanEvents = [\n 'Loaded',\n 'Unloaded',\n 'Integrity',\n 'Out For Delivery',\n 'Delivered',\n];\n\n/**\n * Shipment scan history display\n * Missed scans os ones that just haven't occured yet are displayed as 'No Scan'\n * @param param0\n * @returns\n */\nexport function ShipmentTrackingHistory({ shipmentTrackingData }: Props) {\n const scanEventMap: Record = {\n Loaded: shipmentTrackingData.loadedAt,\n Unloaded: shipmentTrackingData.unloadedAt,\n Integrity: shipmentTrackingData.integrityCheckedAt,\n 'Out For Delivery': shipmentTrackingData.outForDeliveryAt,\n Delivered: shipmentTrackingData.deliveredAt,\n };\n\n function getScanEventDate(event: string): string {\n const dateData = scanEventMap[event];\n const date = dateData\n ? new LUDate(dateData).toDisplayString()\n : ('No Scan' as string);\n return date;\n }\n\n function getScanEventDateTime(event: string): string {\n const dateData = scanEventMap[event];\n const date = dateData\n ? new Date(dateData).toLocaleString()\n : ('No Scan' as string);\n return date.split(',')[1];\n }\n\n return (\n
\n
\n {scanEvents.map((event, index) => (\n
\n
\n {getScanEventDate(event) !== 'No Scan' ? (\n \n ) : (\n \n )}\n\n {index !== scanEvents.length - 1 && (\n \n )}\n
\n
\n
{event}
\n\n
\n {event === 'Delivered' &&\n shipmentTrackingData.currentStoreReferenceId && (\n \n {shipmentTrackingData.currentStoreReferenceId}\n

\n )}\n

{getScanEventDate(event)}

\n\n

{getScanEventDateTime(event)}

\n
\n
\n
\n ))}\n
\n
\n );\n}\n","import { Card } from '@/components/primitives/Card';\nimport { ShipmentDetails } from './ShipmentDetails';\nimport { ShipmentInfo, ShipmentTrackingData } from './models';\nimport { Weight } from '@/helpers/Weight';\nimport { ShipmentTrackingHistory } from './ShipmentTrackingHistory';\n\ntype Props = {\n shipmentTrackingData: ShipmentTrackingData;\n tracking_ids: string[];\n};\n\n/**\n * Card displaying on shipments scan history\n * @param param0\n * @returns React Component\n */\nexport function ShipmentTrackingCard({\n shipmentTrackingData,\n tracking_ids,\n}: Props) {\n function getShipmentInfo(): ShipmentInfo {\n return {\n trackingId: shipmentTrackingData.trackingId,\n weight: new Weight(shipmentTrackingData.weight).inPounds,\n shipDate: shipmentTrackingData.loadedAt,\n estimatedArrival: shipmentTrackingData.estimatedArrival,\n storeNumber: shipmentTrackingData.storeNumber,\n address_string:\n shipmentTrackingData.addressLine +\n ' ' +\n shipmentTrackingData.city +\n ', ' +\n shipmentTrackingData.state +\n ' ' +\n shipmentTrackingData.zip,\n };\n }\n return (\n \n
\n \n
\n
\n \n
\n
\n );\n}\n","import { InvalidTrackingIds } from './InvalidTrackingIds';\nimport { SearchContainer } from './SearchContainer';\nimport { ShipmentTrackingCard } from './ShipmentTrackingCard';\nimport { ShipmentTrackingData } from './models';\n\ntype Props = {\n shipmentTrackingDataArray: ShipmentTrackingData[];\n tracking_ids: string[];\n};\n\n/**\n * Search result view\n * Displays all shipments scan histories and any trackking ids that were not found in the database.\n * @param param0\n * @returns\n */\nexport function SearchResultView({\n shipmentTrackingDataArray,\n tracking_ids,\n}: Props) {\n return (\n
\n
\n\n {shipmentTrackingDataArray.map((shipmentTracking) => (\n \n \n
\n ))}\n \n );\n}\n","import { supabase } from \"../../supabase\";\n\n// To regenerate this file, run the CLI command `deno run --allow-read --allow-write --allow-sys schema_to_ts.ts`. The script is located in the supabase-functions directory.\n\n/**\n * This interface was referenced by `Interface`'s JSON-Schema\n * via the `definition` \"fetchShipmentTrackingDataResponse\".\n */\nexport type FetchShipmentTrackingDataResponse = {\n shipmentId: string;\n trackingId: string;\n loadedAt: string;\n estimatedArrival: string;\n unloadedAt?: string | null;\n integrityCheckedAt?: string | null;\n outForDeliveryAt?: string | null;\n deliveredAt?: string | null;\n storeNumber: string;\n storeName: string;\n city: string;\n state: string;\n zip: string;\n addressLine: string;\n weight: number;\n currentStoreReferenceId?: string | null;\n}[];\n\nexport interface Interface {}\n/**\n * This interface was referenced by `Interface`'s JSON-Schema\n * via the `definition` \"fetchShipmentTrackingDataParams\".\n */\nexport interface FetchShipmentTrackingDataParams {\n function: \"fetch-shipment-tracking-data\";\n tracking_ids: string[];\n}\n\n\nexport async function fetchShipmentTrackingData(\n params: Omit,\n){\n try {\n const result = await supabase.functions.invoke( \n 'shipment-search-api',\n { body: { ...params, function: 'fetch-shipment-tracking-data' }},\n );\n\n if (!result.error && result.data) {\n return result.data;\n } else if (result.error) {\n throw new Error(\"Error Fetching Result in shipment-search-api/fetchShipmentTrackingData:\" + result.error);\n } else {\n throw new Error('Unknown error: result does not contain data or error.');\n }\n } catch (error) {\n console.error('Error:', error);\n throw error;\n }\n}\n","import { useEffect, useState } from 'react';\nimport { SearchContainer } from './SearchContainer';\nimport { SearchResultView } from './SearchResultView';\nimport { useQuery } from 'react-query';\nimport { Loading } from '@/layout/Loading';\nimport {\n fetchShipmentTrackingData,\n FetchShipmentTrackingDataResponse,\n} from '@/data/SupabaseRequests/shipment-search-api/fetchShipmentTrackingData';\nimport { ShipmentTrackingData } from './models';\n\n/**\n * Control for shipment search. Initial view centers the search container.\n * After search, the search results are displayed and the search container is moved to the top left.\n * @returns\n */\nexport function SearchView() {\n const [trackingIDs, setTrackingIDs] = useState([]);\n\n const { data, isLoading } = useQuery({\n queryKey: ['fetch-shipment-tracking-data', trackingIDs],\n queryFn: () => fetchShipmentTrackingData({ tracking_ids: trackingIDs }),\n enabled: trackingIDs.length > 0,\n });\n\n console.log(data);\n return (\n
\n
\n \n {isLoading && }\n
\n {trackingIDs.length > 0 && (\n
\n \n
\n )}\n
\n );\n}\n\nexport function cleanseResponse(\n data: FetchShipmentTrackingDataResponse,\n): ShipmentTrackingData[] {\n return data.map((shipment) => ({\n shipmentId: shipment.shipmentId,\n trackingId: shipment.trackingId,\n loadedAt: new Date(shipment.loadedAt),\n estimatedArrival: new Date(shipment.estimatedArrival),\n unloadedAt: shipment.unloadedAt ? new Date(shipment.unloadedAt) : null,\n integrityCheckedAt: shipment.integrityCheckedAt\n ? new Date(shipment.integrityCheckedAt)\n : null,\n outForDeliveryAt: shipment.outForDeliveryAt\n ? new Date(shipment.outForDeliveryAt)\n : null,\n deliveredAt: shipment.deliveredAt ? new Date(shipment.deliveredAt) : null,\n storeNumber: shipment.storeNumber,\n storeName: shipment.storeName,\n city: shipment.city,\n state: shipment.state,\n zip: shipment.zip,\n addressLine: shipment.addressLine,\n weight: shipment.weight,\n currentStoreReferenceId: shipment.currentStoreReferenceId ?? null,\n }));\n}\n","import { PageHeader } from '@/layout/PageHeader';\nimport { SearchView } from './SearchView';\n\n/**\n * Landing page for shipment search\n * @returns\n */\nexport function ShipmentSearchPage() {\n return (\n
\n
\n \n
\n
\n \n
\n
\n );\n}\n","//Please feel free to change the name\n\nimport React, { useState } from 'react';\n\ntype Props = {\n items: any[];\n onChange?: (item: any) => void;\n defaultItem?: string;\n};\n\nexport function VerticalStateSelector({ items, onChange, defaultItem }: Props) {\n const [selected, setSelected] = useState(defaultItem ?? items[0]);\n\n return (\n
\n {items.map((item) => (\n {\n setSelected(item);\n if (onChange) {\n onChange(item);\n }\n }}\n >\n
{item}
\n
\n ))}\n \n );\n}\n","import React from 'react';\nimport { Card, CardContent } from '@/components/primitives/Card';\nimport { VerticalStateSelector } from '@/components/VerticalStateSelector';\nimport { PageHeader } from '@/layout/PageHeader';\n\nexport function CarriersPage() {\n return (\n
\n
\n \n
\n
\n \n \n
\n \n
\n
\n
\n
\n
\n );\n}\n","import React from 'react';\nimport { Outlet } from 'react-router-dom';\n\nexport function LandingLayout() {\n return (\n
\n \n \n
\n \n );\n}\n","import React from 'react';\nimport { Button } from '@/components/primitives/Button';\nimport { Card } from '@/components/primitives/Card';\nimport { AuthService } from '@/data/AuthService';\nimport { supabase } from '@/data/supabase';\nimport { useAuth } from '@/data/auth';\nimport { ChevronLeft } from 'lucide-react';\nimport { useNavigate } from 'react-router';\n\ninterface DownloadFromBucketProps {\n bucket: string;\n filename: string;\n appName: string;\n}\n\nexport default function DownloadFromBucket({\n bucket,\n filename,\n appName,\n}: DownloadFromBucketProps) {\n const [loading, setLoading] = React.useState(false);\n const { permissions } = useAuth();\n const navigate = useNavigate();\n\n // Determine if the back button should be shown\n const showBackButton =\n permissions?.hasPermission(['driver-app']) &&\n permissions?.hasPermission(['warehouse-app']);\n\n async function downloadApp() {\n setLoading(true);\n const { data, error } = await supabase.storage\n .from(bucket)\n .download(filename);\n if (error) {\n console.error('Error fetching file:', error);\n setLoading(false);\n } else {\n const url = window.URL.createObjectURL(data);\n const a = document.createElement('a');\n a.href = url;\n a.download = filename;\n document.body.appendChild(a);\n a.click();\n document.body.removeChild(a);\n window.URL.revokeObjectURL(url);\n setLoading(false);\n }\n }\n\n return (\n
\n \n {showBackButton ? (\n
\n navigate('../')}\n >\n \n

All Downloads

\n
\n \n Sign Out\n \n
\n ) : (\n
\n \n Sign Out\n \n
\n )}\n\n

{appName} Download

\n

\n Download the latest version of the {appName}.\n

\n\n
\n \n
\n \n \n );\n}\n","import { AuthService } from '@/data/AuthService';\nimport { useAuth } from '@/data/auth';\nimport { Link } from 'react-router-dom';\n\nexport default function DownloadOptions() {\n const { permissions } = useAuth();\n\n const hasDriverAppPermission = permissions?.hasPermission(['driver-app']);\n const hasWarehouseAppPermission = permissions?.hasPermission([\n 'warehouse-app',\n ]);\n\n return (\n
\n
\n
\n \n Sign Out\n \n
\n

Download Options

\n

\n Select the application you wish to download.\n

\n
\n {hasDriverAppPermission && (\n \n Download Driver App\n \n )}\n {hasWarehouseAppPermission && (\n \n Download Warehouse App\n \n )}\n {!hasDriverAppPermission && !hasWarehouseAppPermission && (\n
\n You do not have permission to download any apps.\n
\n )}\n
\n
\n
\n );\n}\n","import { useAuth } from '@/data/auth';\nimport { LandingLayout } from '@/layout/LandingLayout';\nimport React from 'react';\nimport { Navigate, Route, Routes } from 'react-router';\nimport DownloadFromBucket from './DownloadFromBucket';\nimport DownloadOptions from './DownloadOptions';\n\nexport function DownloadsPage() {\n const { permissions } = useAuth();\n\n const hasDriverAppPermission = permissions?.hasPermission(['driver-app']);\n const hasWarehouseAppPermission = permissions?.hasPermission([\n 'warehouse-app',\n ]);\n\n const downloadBoth = hasDriverAppPermission && hasWarehouseAppPermission;\n\n // Determine the redirection path based on permissions\n const getRedirectPath = () => {\n if (downloadBoth) {\n return '/downloads';\n } else if (hasDriverAppPermission) {\n return '/downloads/driver-app';\n } else if (hasWarehouseAppPermission) {\n return '/downloads/warehouse-app';\n } else {\n return '/downloads';\n }\n };\n\n return (\n \n }>\n {/* Redirect to the appropriate path based on permissions */}\n } />\n {downloadBoth && } />}\n \n }\n />\n \n }\n />\n \n \n );\n}\n","import { useAuth } from '@/data/auth';\nimport {\n ArrowBigRight,\n Boxes,\n LucideIcon,\n PackageOpen,\n ThumbsUp,\n Warehouse,\n} from 'lucide-react';\nimport { StateColors } from './models';\n\ntype SimplifiedState = {\n text: string;\n color: string;\n};\n\ntype Props = {\n state:\n | 'Building'\n | 'Ready To Load'\n | 'Loading'\n | 'Loaded'\n | 'In Transit'\n | 'Arrived'\n | 'Unloading'\n | 'Completed';\n isActive: boolean;\n showIcon?: boolean;\n stateColors?: StateColors;\n stationName?: string;\n};\n\nexport function StateBadge({\n state,\n isActive = false,\n showIcon,\n stateColors = {\n textActive: 'text-card-foreground',\n textGroupHover: 'group-hover:text-card-foreground',\n text: 'text-slate-400',\n },\n stationName,\n}: Props) {\n const { user } = useAuth();\n isActive = !!isActive;\n let icon = undefined;\n let title = '';\n const { textActive, textGroupHover, text } = stateColors as StateColors;\n\n const iconClass = 'h-6 align-top inline-flex';\n\n const getSimplifiedState = (): SimplifiedState => {\n switch (state) {\n case 'Building':\n case 'Ready To Load':\n case 'Loading':\n case 'Loaded':\n case 'In Transit':\n icon = showIcon ? : undefined;\n title = user?.org_type === 'shipper' ? 'Outbound' : 'Incoming';\n\n return {\n text: title,\n color: getColor(isActive),\n };\n case 'Arrived':\n icon = showIcon ? : undefined;\n return {\n text: 'Arrived by ' + stationName,\n color: getColor(isActive),\n };\n case 'Unloading':\n icon = showIcon ? : undefined;\n return { text: 'Sorting by ' + stationName, color: getColor(isActive) };\n case 'Completed':\n icon = showIcon ? : undefined;\n return {\n text: 'Completed by ' + stationName,\n color: getColor(isActive),\n };\n default:\n return { text: 'Unknown', color: 'gray' }; // Default case, though your Props type should prevent this\n }\n };\n\n const simplifiedState = getSimplifiedState();\n\n return (\n \n {simplifiedState.text}\n {icon}\n \n );\n\n function getColor(isActive: boolean): string {\n return isActive ? textActive || '' : text || '';\n }\n}\n","import { LUDate } from '@/common/classes/LUDate';\nimport { cn } from '@/lib/utils';\nimport { TruckIcon } from 'lucide-react';\nimport React from 'react';\nimport { StateColors } from './models';\n\ntype Props = {\n estimatedArrival: LUDate;\n bgcolor?: string;\n truckColor?: string; // Customization for truck icon color\n isActive?: boolean;\n activeColorClass?: string;\n activeTextColorClass?: string;\n groupHoverTextColorClass?: string;\n colors?: StateColors;\n};\n\n/**\n * Progress bar for arrival of load at the sorting station\n * @param param0\n * @returns React component\n */\nexport const ArrivalProgressBar = ({\n estimatedArrival,\n // bgcolor = 'lupurple-lighter', //'blue-500',\n isActive = false,\n colors = {\n foreground: 'bg-lupurple-lighter',\n foregroundActive: 'bg-lupurple-medium',\n foregroundHover: 'group-hover:bg-lupurple-medium',\n textActive: 'text-white',\n textGroupHover: 'group-hover:text-white',\n text: 'text-card-foreground'\n }\n // activeColorClass = 'lupurple-medium',\n // activeTextColorClass = 'text-white',\n // groupHoverTextColorClass = 'group-hover:text-white'\n}: Props) => {\n const hourDifference = getHourDifference(\n new LUDate(),\n new LUDate(estimatedArrival),\n );\n const progress = ((24 - hourDifference) / 24) * 100;\n const hoursAwayText = `${Math.round(hourDifference)} hrs away`;\n const awaitingSortText = 'Awaiting Sort';\n const largeScreenAwaitingSortText = 'Waiting To Begin Sort';\n\n return (\n \n \n {progress < 98 && (\n \n {hoursAwayText}\n \n \n )}\n {progress >= 99 && (\n <>\n \n {awaitingSortText}\n \n \n \n )}\n \n \n {/* {progress <= 50 && (\n
\n \n {hoursAwayText}\n \n
\n )} */}\n \n );\n};\n\nfunction getHourDifference(startDate: LUDate, endDate: LUDate): number {\n const msPerHour: number = 1000 * 60 * 60;\n const differenceInMs: number = endDate.getTime() - startDate.getTime();\n return differenceInMs / msPerHour;\n}\n","import { cn } from '@/lib/utils';\nimport { StateColors } from './models';\n\ntype Props = {\n progress: string | number;\n bgcolor?: string;\n progresscolor?: string;\n hoverbgcolor?: string;\n hoverprogresscolor?: string;\n miniView?: boolean;\n onClick?: () => void;\n className?: string;\n text?: string;\n isActive?: boolean;\n activeProgressColor?: string;\n colors?: StateColors;\n};\n\n/**\n * Progress percent bar display\n * @param progress is the number to display. No calculation is done here.\n * @param param0\n * @returns React component\n */\nexport const ProgressBar = ({\n progress,\n bgcolor = 'slate-200', // Default background color\n hoverbgcolor = bgcolor, // Default hover background color'\n progresscolor = 'lupurple-lighter', // Default progress color\n hoverprogresscolor = 'hover:bg-lupurple-medium', // Default hover progress color\n miniView = false,\n onClick,\n className = '',\n text = '',\n activeProgressColor = 'bg-lupurple-light',\n isActive = false,\n colors,\n}: Props) => {\n const backgroundColor = `bg-${bgcolor}`;\n const progressColor = isActive\n ? activeProgressColor\n : colors?.foreground || `bg-${progresscolor}`;\n const hoverProgressColor = colors?.foregroundHover || hoverprogresscolor;\n const hoverBackgroundColor = `hover:bg-${hoverbgcolor}`;\n\n return (\n \n {miniView ? (\n \n \n {text?.length && {text}}\n \n \n ) : (\n \n \n

{`${progress}%`}

\n \n \n )}\n \n );\n};\n","import { supabase } from \"../../supabase\";\n\n// To regenerate this file, run the CLI command `deno run --allow-read --allow-write --allow-sys schema_to_ts.ts`. The script is located in the supabase-functions directory.\n\n/**\n * This interface was referenced by `Interface`'s JSON-Schema\n * via the `definition` \"verifyASNResponse\".\n */\nexport type VerifyASNResponse = {\n severity: \"error\" | \"warning\";\n info?: string;\n type:\n | \"invalid_date\"\n | \"missing_cell\"\n | \"bad_template\"\n | \"no_template\"\n | \"duplicate_tracking_id\"\n | \"database_tracking_id\"\n | \"invalid_store\";\n row?: number;\n}[];\n\n\n/**\n * This interface was referenced by `Interface`'s JSON-Schema\n * via the `definition` \"verifyASNParams\".\n */\nexport interface VerifyASNParams {\n function: \"verify-asn\";\n asn_data: {\n [k: string]: string;\n }[];\n headers: string[];\n outbound_station_id: string;\n}\n\n\nexport async function verifyASN(\n params: Omit,\n){\n try {\n const result = await supabase.functions.invoke( \n 'warehouse-webapp-api',\n { body: { ...params, function: 'verify-asn' }},\n );\n\n if (!result.error && result.data) {\n return result.data;\n } else if (result.error) {\n throw new Error(\"Error Fetching Result in warehouse-webapp-api/verifyASN:\" + result.error);\n } else {\n throw new Error('Unknown error: result does not contain data or error.');\n }\n } catch (error) {\n console.error('Error:', error);\n throw error;\n }\n}\n","import { supabase } from \"../../supabase\";\n\n// To regenerate this file, run the CLI command `deno run --allow-read --allow-write --allow-sys schema_to_ts.ts`. The script is located in the supabase-functions directory.\n\n/**\n * This interface was referenced by `Interface`'s JSON-Schema\n * via the `definition` \"fetchOSDByTypeResponse\".\n */\nexport type FetchOSDByTypeResponse = {\n type: string;\n exception_id?: string;\n details: string;\n shipment_id: string;\n tracking_id: string;\n created_at: string;\n scanned_by_first_name?: string;\n scanned_by_last_name?: string;\n resolved_at: string | null;\n resolution: string | null;\n load_id?: string;\n is_unrecognized: boolean;\n}[];\n\n\n/**\n * This interface was referenced by `Interface`'s JSON-Schema\n * via the `definition` \"fetchOSDByTypeParams\".\n */\nexport interface FetchOSDByTypeParams {\n function: \"fetch-osd-shipments-by-type\";\n load_id: string;\n type: \"Overage\" | \"Damaged\" | \"Missing\";\n}\n\n\nexport async function fetchOSDByType(\n params: Omit,\n){\n try {\n const result = await supabase.functions.invoke( \n 'warehouse-webapp-api',\n { body: { ...params, function: 'fetch-osd-shipments-by-type' }},\n );\n\n if (!result.error && result.data) {\n return result.data;\n } else if (result.error) {\n throw new Error(\"Error Fetching Result in warehouse-webapp-api/fetchOSDByType:\" + result.error);\n } else {\n throw new Error('Unknown error: result does not contain data or error.');\n }\n } catch (error) {\n console.error('Error:', error);\n throw error;\n }\n}\n","import { supabase } from \"../../supabase\";\n\n// To regenerate this file, run the CLI command `deno run --allow-read --allow-write --allow-sys schema_to_ts.ts`. The script is located in the supabase-functions directory.\n\n/**\n * This interface was referenced by `Interface`'s JSON-Schema\n * via the `definition` \"loadScanReportResponse\".\n */\nexport type LoadScanReportResponse = {\n bol?: string;\n store?: string;\n scan_type: string;\n barcode?: string;\n}[];\n\n\n/**\n * This interface was referenced by `Interface`'s JSON-Schema\n * via the `definition` \"loadScanReportParams\".\n */\nexport interface LoadScanReportParams {\n function: \"load-scan-report\";\n load_id: string;\n}\n\n\nexport async function loadScanReport(\n params: Omit,\n){\n try {\n const result = await supabase.functions.invoke( \n 'warehouse-webapp-api',\n { body: { ...params, function: 'load-scan-report' }},\n );\n\n if (!result.error && result.data) {\n return result.data;\n } else if (result.error) {\n throw new Error(\"Error Fetching Result in warehouse-webapp-api/loadScanReport:\" + result.error);\n } else {\n throw new Error('Unknown error: result does not contain data or error.');\n }\n } catch (error) {\n console.error('Error:', error);\n throw error;\n }\n}\n","import { supabase } from \"../../supabase\";\n\n// To regenerate this file, run the CLI command `deno run --allow-read --allow-write --allow-sys schema_to_ts.ts`. The script is located in the supabase-functions directory.\n\n\n/**\n * This interface was referenced by `Interface`'s JSON-Schema\n * via the `definition` \"resolveMissingParams\".\n */\nexport interface ResolveMissingParams {\n function: \"resolve-missing\";\n shipment_id: string;\n exception_id?: string;\n resolution: string;\n}\n\n\nexport async function resolveMissing(\n params: Omit,\n): Promise{\n try {\n const result = await supabase.functions.invoke( \n 'warehouse-webapp-api',\n { body: { ...params, function: 'resolve-missing' }},\n );\n\n if (!result.error && result.data) {\n return;\n } else if (result.error) {\n throw new Error(\"Error Fetching Result in warehouse-webapp-api/resolveMissing:\" + result.error);\n } else {\n throw new Error('Unknown error: result does not contain data or error.');\n }\n } catch (error) {\n console.error('Error:', error);\n throw error;\n }\n}\n","import { supabase } from \"../../supabase\";\n\n// To regenerate this file, run the CLI command `deno run --allow-read --allow-write --allow-sys schema_to_ts.ts`. The script is located in the supabase-functions directory.\n\n\n/**\n * This interface was referenced by `Interface`'s JSON-Schema\n * via the `definition` \"fetchNewScanCountParams\".\n */\nexport interface FetchNewScanCountParams {\n function: \"fetch-new-scan-count\";\n load_id: string;\n last_updated_at: string;\n}\n/**\n * This interface was referenced by `Interface`'s JSON-Schema\n * via the `definition` \"FetchNewScanCountResponse\".\n */\nexport interface FetchNewScanCountResponse {\n count: string;\n}\n\n\nexport async function fetchNewScanCount(\n params: Omit,\n){\n try {\n const result = await supabase.functions.invoke( \n 'warehouse-webapp-api',\n { body: { ...params, function: 'fetch-new-scan-count' }},\n );\n\n if (!result.error && result.data) {\n return result.data;\n } else if (result.error) {\n throw new Error(\"Error Fetching Result in warehouse-webapp-api/fetchNewScanCount:\" + result.error);\n } else {\n throw new Error('Unknown error: result does not contain data or error.');\n }\n } catch (error) {\n console.error('Error:', error);\n throw error;\n }\n}\n","import { supabase } from \"../../supabase\";\n\n// To regenerate this file, run the CLI command `deno run --allow-read --allow-write --allow-sys schema_to_ts.ts`. The script is located in the supabase-functions directory.\n\n\n/**\n * This interface was referenced by `Interface`'s JSON-Schema\n * via the `definition` \"fetchASNTemplatesParams\".\n */\nexport interface FetchASNTemplatesParams {\n function: \"fetch-asn-templates\";\n stationId: string;\n}\n/**\n * This interface was referenced by `Interface`'s JSON-Schema\n * via the `definition` \"fetchASNTemplatesResponse\".\n */\nexport interface FetchASNTemplatesResponse {\n tracking_id: string;\n weight?: string | null;\n weight_unit?: string | null;\n store: string;\n trailer_name?: string | null;\n loaded_at?: string | null;\n bol?: string | null;\n expected_arrival?: string | null;\n}\n\n\nexport async function fetchASNTemplates(\n params: Omit,\n){\n try {\n const result = await supabase.functions.invoke( \n 'warehouse-webapp-api',\n { body: { ...params, function: 'fetch-asn-templates' }},\n );\n\n if (!result.error && result.data) {\n return result.data;\n } else if (result.error) {\n throw new Error(\"Error Fetching Result in warehouse-webapp-api/fetchASNTemplates:\" + result.error);\n } else {\n throw new Error('Unknown error: result does not contain data or error.');\n }\n } catch (error) {\n console.error('Error:', error);\n throw error;\n }\n}\n","import { supabase } from \"../../supabase\";\n\n// To regenerate this file, run the CLI command `deno run --allow-read --allow-write --allow-sys schema_to_ts.ts`. The script is located in the supabase-functions directory.\n\n\n/**\n * This interface was referenced by `Interface`'s JSON-Schema\n * via the `definition` \"updateOverageStoreParams\".\n */\nexport interface UpdateOverageStoreParams {\n function: \"update-overage-store\";\n store_ref: string;\n shipment_id: string;\n exception_id: string;\n}\n\n\nexport async function updateOverageStore(\n params: Omit,\n): Promise{\n try {\n const result = await supabase.functions.invoke( \n 'warehouse-webapp-api',\n { body: { ...params, function: 'update-overage-store' }},\n );\n\n if (!result.error && result.data) {\n return;\n } else if (result.error) {\n throw new Error(\"Error Fetching Result in warehouse-webapp-api/updateOverageStore:\" + result.error);\n } else {\n throw new Error('Unknown error: result does not contain data or error.');\n }\n } catch (error) {\n console.error('Error:', error);\n throw error;\n }\n}\n","import { supabase } from \"../../supabase\";\n\n// To regenerate this file, run the CLI command `deno run --allow-read --allow-write --allow-sys schema_to_ts.ts`. The script is located in the supabase-functions directory.\n\n/**\n * This interface was referenced by `Interface`'s JSON-Schema\n * via the `definition` \"fetchUnscannedShipmentsResponse\".\n */\nexport type FetchUnscannedShipmentsResponse = {\n shipment_id: string;\n tracking_id: string;\n exception_id?: string;\n}[];\n\n\n/**\n * This interface was referenced by `Interface`'s JSON-Schema\n * via the `definition` \"fetchUnscannedShipmentsParams\".\n */\nexport interface FetchUnscannedShipmentsParams {\n function: \"fetch-unscanned-shipments-by-load\";\n load_id: string;\n}\n\n\nexport async function fetchUnscannedShipments(\n params: Omit,\n){\n try {\n const result = await supabase.functions.invoke( \n 'warehouse-webapp-api',\n { body: { ...params, function: 'fetch-unscanned-shipments-by-load' }},\n );\n\n if (!result.error && result.data) {\n return result.data;\n } else if (result.error) {\n throw new Error(\"Error Fetching Result in warehouse-webapp-api/fetchUnscannedShipments:\" + result.error);\n } else {\n throw new Error('Unknown error: result does not contain data or error.');\n }\n } catch (error) {\n console.error('Error:', error);\n throw error;\n }\n}\n","import { supabase } from \"../../supabase\";\n\n// To regenerate this file, run the CLI command `deno run --allow-read --allow-write --allow-sys schema_to_ts.ts`. The script is located in the supabase-functions directory.\n\n\n/**\n * This interface was referenced by `Interface`'s JSON-Schema\n * via the `definition` \"resolveOverageParams\".\n */\nexport interface ResolveOverageParams {\n function: \"resolve-overage\";\n exception_id: string;\n resolution: string;\n}\n\n\nexport async function resolveOverage(\n params: Omit,\n): Promise{\n try {\n const result = await supabase.functions.invoke( \n 'warehouse-webapp-api',\n { body: { ...params, function: 'resolve-overage' }},\n );\n\n if (!result.error && result.data) {\n return;\n } else if (result.error) {\n throw new Error(\"Error Fetching Result in warehouse-webapp-api/resolveOverage:\" + result.error);\n } else {\n throw new Error('Unknown error: result does not contain data or error.');\n }\n } catch (error) {\n console.error('Error:', error);\n throw error;\n }\n}\n","import { supabase } from \"../../supabase\";\n\n// To regenerate this file, run the CLI command `deno run --allow-read --allow-write --allow-sys schema_to_ts.ts`. The script is located in the supabase-functions directory.\n\n/**\n * This interface was referenced by `Interface`'s JSON-Schema\n * via the `definition` \"fetchUnresolvedOSNDShipmentsResponse\".\n */\nexport type FetchUnresolvedOSNDShipmentsResponse = {\n type: string;\n exception_id?: string;\n details: string;\n shipment_id: string;\n tracking_id: string;\n created_at: string;\n scanned_by_first_name?: string;\n scanned_by_last_name?: string;\n resolved_at: string | null;\n resolution: string | null;\n load_id: string;\n is_unrecognized: boolean;\n}[];\n\n\n/**\n * This interface was referenced by `Interface`'s JSON-Schema\n * via the `definition` \"fetchUnresolvedOSNDShipmentsParams\".\n */\nexport interface FetchUnresolvedOSNDShipmentsParams {\n function: \"fetch-all-unresolved-osnd-shipments\";\n load_id: string;\n}\n\n\nexport async function fetchUnresolvedOSNDShipments(\n params: Omit,\n){\n try {\n const result = await supabase.functions.invoke( \n 'warehouse-webapp-api',\n { body: { ...params, function: 'fetch-all-unresolved-osnd-shipments' }},\n );\n\n if (!result.error && result.data) {\n return result.data;\n } else if (result.error) {\n throw new Error(\"Error Fetching Result in warehouse-webapp-api/fetchUnresolvedOSNDShipments:\" + result.error);\n } else {\n throw new Error('Unknown error: result does not contain data or error.');\n }\n } catch (error) {\n console.error('Error:', error);\n throw error;\n }\n}\n","import { supabase } from \"../../supabase\";\n\n// To regenerate this file, run the CLI command `deno run --allow-read --allow-write --allow-sys schema_to_ts.ts`. The script is located in the supabase-functions directory.\n\n\n/**\n * This interface was referenced by `Interface`'s JSON-Schema\n * via the `definition` \"handleBadScanParams\".\n */\nexport interface HandleBadScanParams {\n function: \"handle-bad-scan\";\n barcode: string;\n}\n\n\nexport async function handleBadScan(\n params: Omit,\n): Promise{\n try {\n const result = await supabase.functions.invoke( \n 'warehouse-webapp-api',\n { body: { ...params, function: 'handle-bad-scan' }},\n );\n\n if (!result.error && result.data) {\n return;\n } else if (result.error) {\n throw new Error(\"Error Fetching Result in warehouse-webapp-api/handleBadScan:\" + result.error);\n } else {\n throw new Error('Unknown error: result does not contain data or error.');\n }\n } catch (error) {\n console.error('Error:', error);\n throw error;\n }\n}\n","import { supabase } from \"../../supabase\";\n\n// To regenerate this file, run the CLI command `deno run --allow-read --allow-write --allow-sys schema_to_ts.ts`. The script is located in the supabase-functions directory.\n\n\n/**\n * This interface was referenced by `Interface`'s JSON-Schema\n * via the `definition` \"completeSortParams\".\n */\nexport interface CompleteSortParams {\n function: \"complete-sort\";\n load_id: string;\n}\n/**\n * This interface was referenced by `Interface`'s JSON-Schema\n * via the `definition` \"completeSortResponse\".\n */\nexport interface CompleteSortResponse {\n error: string | null;\n}\n\n\nexport async function completeSort(\n params: Omit,\n){\n try {\n const result = await supabase.functions.invoke( \n 'warehouse-webapp-api',\n { body: { ...params, function: 'complete-sort' }},\n );\n\n if (!result.error && result.data) {\n return result.data;\n } else if (result.error) {\n throw new Error(\"Error Fetching Result in warehouse-webapp-api/completeSort:\" + result.error);\n } else {\n throw new Error('Unknown error: result does not contain data or error.');\n }\n } catch (error) {\n console.error('Error:', error);\n throw error;\n }\n}\n","import { supabase } from \"../../supabase\";\n\n// To regenerate this file, run the CLI command `deno run --allow-read --allow-write --allow-sys schema_to_ts.ts`. The script is located in the supabase-functions directory.\n\n\n/**\n * This interface was referenced by `Interface`'s JSON-Schema\n * via the `definition` \"assignUnrecognizedToStoreParams\".\n */\nexport interface AssignUnrecognizedToStoreParams {\n function: \"assign-unrecognized-to-store\";\n store_ref: string;\n barcode: string;\n}\n/**\n * This interface was referenced by `Interface`'s JSON-Schema\n * via the `definition` \"assignUnrecognizedToStoreResponse\".\n */\nexport interface AssignUnrecognizedToStoreResponse {\n shipment_id: string;\n exception_id: string;\n}\n\n\nexport async function assignUnrecognizedToStore(\n params: Omit,\n){\n try {\n const result = await supabase.functions.invoke( \n 'warehouse-webapp-api',\n { body: { ...params, function: 'assign-unrecognized-to-store' }},\n );\n\n if (!result.error && result.data) {\n return result.data;\n } else if (result.error) {\n throw new Error(\"Error Fetching Result in warehouse-webapp-api/assignUnrecognizedToStore:\" + result.error);\n } else {\n throw new Error('Unknown error: result does not contain data or error.');\n }\n } catch (error) {\n console.error('Error:', error);\n throw error;\n }\n}\n","import { supabase } from \"../../supabase\";\n\n// To regenerate this file, run the CLI command `deno run --allow-read --allow-write --allow-sys schema_to_ts.ts`. The script is located in the supabase-functions directory.\n\n\n/**\n * This interface was referenced by `Interface`'s JSON-Schema\n * via the `definition` \"insertTemplateParams\".\n */\nexport interface InsertTemplateParams {\n function: \"insert-template\";\n tracking_id: string;\n store: string;\n bol: string;\n weight?: number | null;\n trailer_name?: string | null;\n loaded_at?: string | null;\n expected_arrival?: string | null;\n weight_unit?: string | null;\n station_id: string;\n}\n\n\nexport async function insertTemplate(\n params: Omit,\n): Promise{\n try {\n const result = await supabase.functions.invoke( \n 'warehouse-webapp-api',\n { body: { ...params, function: 'insert-template' }},\n );\n\n if (!result.error && result.data) {\n return;\n } else if (result.error) {\n throw new Error(\"Error Fetching Result in warehouse-webapp-api/insertTemplate:\" + result.error);\n } else {\n throw new Error('Unknown error: result does not contain data or error.');\n }\n } catch (error) {\n console.error('Error:', error);\n throw error;\n }\n}\n","import { supabase } from \"../../supabase\";\n\n// To regenerate this file, run the CLI command `deno run --allow-read --allow-write --allow-sys schema_to_ts.ts`. The script is located in the supabase-functions directory.\n\n/**\n * This interface was referenced by `Interface`'s JSON-Schema\n * via the `definition` \"fetchStoresResponse\".\n */\nexport type FetchStoresResponse = {\n id: string;\n store_ref: string;\n store_name: string;\n city: string;\n state: string;\n display_string: string;\n location_id: number;\n}[];\n\n\n/**\n * This interface was referenced by `Interface`'s JSON-Schema\n * via the `definition` \"fetchStoresParams\".\n */\nexport interface FetchStoresParams {\n function: \"fetch-stores\";\n load_id: string;\n}\n\n\nexport async function fetchStores(\n params: Omit,\n){\n try {\n const result = await supabase.functions.invoke( \n 'warehouse-webapp-api',\n { body: { ...params, function: 'fetch-stores' }},\n );\n\n if (!result.error && result.data) {\n return result.data;\n } else if (result.error) {\n throw new Error(\"Error Fetching Result in warehouse-webapp-api/fetchStores:\" + result.error);\n } else {\n throw new Error('Unknown error: result does not contain data or error.');\n }\n } catch (error) {\n console.error('Error:', error);\n throw error;\n }\n}\n","import { supabase } from \"../../supabase\";\n\n// To regenerate this file, run the CLI command `deno run --allow-read --allow-write --allow-sys schema_to_ts.ts`. The script is located in the supabase-functions directory.\n\n\n/**\n * This interface was referenced by `Interface`'s JSON-Schema\n * via the `definition` \"arriveLoadParams\".\n */\nexport interface ArriveLoadParams {\n function: \"arrive-load\";\n load_id: string;\n trailer_id: string;\n date_of_arrival: string | null;\n state: string;\n seal_num?: string;\n door_number?: string;\n notes?: string;\n}\n\n\nexport async function arriveLoad(\n params: Omit,\n): Promise{\n try {\n const result = await supabase.functions.invoke( \n 'warehouse-webapp-api',\n { body: { ...params, function: 'arrive-load' }},\n );\n\n if (!result.error && result.data) {\n return;\n } else if (result.error) {\n throw new Error(\"Error Fetching Result in warehouse-webapp-api/arriveLoad:\" + result.error);\n } else {\n throw new Error('Unknown error: result does not contain data or error.');\n }\n } catch (error) {\n console.error('Error:', error);\n throw error;\n }\n}\n","import { supabase } from \"../../supabase\";\n\n// To regenerate this file, run the CLI command `deno run --allow-read --allow-write --allow-sys schema_to_ts.ts`. The script is located in the supabase-functions directory.\n\n\n/**\n * This interface was referenced by `Interface`'s JSON-Schema\n * via the `definition` \"beginSortParams\".\n */\nexport interface BeginSortParams {\n function: \"begin-sort\";\n load_id: string;\n}\n\n\nexport async function beginSort(\n params: Omit,\n): Promise{\n try {\n const result = await supabase.functions.invoke( \n 'warehouse-webapp-api',\n { body: { ...params, function: 'begin-sort' }},\n );\n\n if (!result.error && result.data) {\n return;\n } else if (result.error) {\n throw new Error(\"Error Fetching Result in warehouse-webapp-api/beginSort:\" + result.error);\n } else {\n throw new Error('Unknown error: result does not contain data or error.');\n }\n } catch (error) {\n console.error('Error:', error);\n throw error;\n }\n}\n","import { supabase } from \"../../supabase\";\n\n// To regenerate this file, run the CLI command `deno run --allow-read --allow-write --allow-sys schema_to_ts.ts`. The script is located in the supabase-functions directory.\n\n\n/**\n * This interface was referenced by `Interface`'s JSON-Schema\n * via the `definition` \"fetchOSDCountParams\".\n */\nexport interface FetchOSDCountParams {\n function: \"fetch-osd-count\";\n load_id: string;\n}\n/**\n * This interface was referenced by `Interface`'s JSON-Schema\n * via the `definition` \"fetchOSDCountResponse\".\n */\nexport interface FetchOSDCountResponse {\n overages: number;\n shortages: number;\n damages: number;\n}\n\n\nexport async function fetchOSDCount(\n params: Omit,\n){\n try {\n const result = await supabase.functions.invoke( \n 'warehouse-webapp-api',\n { body: { ...params, function: 'fetch-osd-count' }},\n );\n\n if (!result.error && result.data) {\n return result.data;\n } else if (result.error) {\n throw new Error(\"Error Fetching Result in warehouse-webapp-api/fetchOSDCount:\" + result.error);\n } else {\n throw new Error('Unknown error: result does not contain data or error.');\n }\n } catch (error) {\n console.error('Error:', error);\n throw error;\n }\n}\n","import { supabase } from \"../../supabase\";\n\n// To regenerate this file, run the CLI command `deno run --allow-read --allow-write --allow-sys schema_to_ts.ts`. The script is located in the supabase-functions directory.\n\n/**\n * This interface was referenced by `Interface`'s JSON-Schema\n * via the `definition` \"fetchShipperLoadsResponse\".\n */\nexport type FetchShipperLoadsResponse = {\n id: string;\n trailer_id: string;\n org_name?: string;\n org_id?: string;\n state: \"Building\" | \"Ready To Load\" | \"Loading\" | \"Loaded\" | \"In Transit\" | \"Arrived\" | \"Unloading\" | \"Completed\";\n estimated_arrival: string;\n actual_arrival: string | null;\n loaded_shipments: number;\n unloaded_shipments: number;\n shortages: number;\n overages: number;\n station_name: string;\n station_id: string;\n}[];\n\n\n/**\n * This interface was referenced by `Interface`'s JSON-Schema\n * via the `definition` \"fetchShipperLoadsParams\".\n */\nexport interface FetchShipperLoadsParams {\n function: \"fetch-shipper-loads\";\n stations: string[];\n showCompleted: boolean;\n}\n\n\nexport async function fetchShipperLoads(\n params: Omit,\n){\n try {\n const result = await supabase.functions.invoke( \n 'warehouse-webapp-api',\n { body: { ...params, function: 'fetch-shipper-loads' }},\n );\n\n if (!result.error && result.data) {\n return result.data;\n } else if (result.error) {\n throw new Error(\"Error Fetching Result in warehouse-webapp-api/fetchShipperLoads:\" + result.error);\n } else {\n throw new Error('Unknown error: result does not contain data or error.');\n }\n } catch (error) {\n console.error('Error:', error);\n throw error;\n }\n}\n","import { supabase } from \"../../supabase\";\n\n// To regenerate this file, run the CLI command `deno run --allow-read --allow-write --allow-sys schema_to_ts.ts`. The script is located in the supabase-functions directory.\n\n\n/**\n * This interface was referenced by `Interface`'s JSON-Schema\n * via the `definition` \"resolveDamagedParams\".\n */\nexport interface ResolveDamagedParams {\n function: \"resolve-damaged\";\n shipment_id: string;\n exception_id: string;\n resolution: string;\n}\n\n\nexport async function resolveDamaged(\n params: Omit,\n): Promise{\n try {\n const result = await supabase.functions.invoke( \n 'warehouse-webapp-api',\n { body: { ...params, function: 'resolve-damaged' }},\n );\n\n if (!result.error && result.data) {\n return;\n } else if (result.error) {\n throw new Error(\"Error Fetching Result in warehouse-webapp-api/resolveDamaged:\" + result.error);\n } else {\n throw new Error('Unknown error: result does not contain data or error.');\n }\n } catch (error) {\n console.error('Error:', error);\n throw error;\n }\n}\n","import { supabase } from \"../../supabase\";\n\n// To regenerate this file, run the CLI command `deno run --allow-read --allow-write --allow-sys schema_to_ts.ts`. The script is located in the supabase-functions directory.\n\n/**\n * This interface was referenced by `Interface`'s JSON-Schema\n * via the `definition` \"FetchScannedShipmentsResponse\".\n */\nexport type FetchScannedShipmentsResponse = {\n id: string;\n tracking_id: string;\n scanned_at: string | null;\n}[];\n\n\n/**\n * This interface was referenced by `Interface`'s JSON-Schema\n * via the `definition` \"fetchScannedShipmentsParams\".\n */\nexport interface FetchScannedShipmentsParams {\n function: \"fetch-scanned-shipments\";\n load_id: string;\n}\n\n\nexport async function fetchScannedShipments(\n params: Omit,\n){\n try {\n const result = await supabase.functions.invoke( \n 'warehouse-webapp-api',\n { body: { ...params, function: 'fetch-scanned-shipments' }},\n );\n\n if (!result.error && result.data) {\n return result.data;\n } else if (result.error) {\n throw new Error(\"Error Fetching Result in warehouse-webapp-api/fetchScannedShipments:\" + result.error);\n } else {\n throw new Error('Unknown error: result does not contain data or error.');\n }\n } catch (error) {\n console.error('Error:', error);\n throw error;\n }\n}\n","import { supabase } from \"../../supabase\";\n\n// To regenerate this file, run the CLI command `deno run --allow-read --allow-write --allow-sys schema_to_ts.ts`. The script is located in the supabase-functions directory.\n\n/**\n * This interface was referenced by `Interface`'s JSON-Schema\n * via the `definition` \"fetchCarrierLoadsResponse\".\n */\nexport type FetchCarrierLoadsResponse = {\n id: string;\n trailer_id: string;\n org_name?: string;\n station_name: string;\n org_id?: string;\n station_id: string;\n state: \"Building\" | \"Ready To Load\" | \"Loading\" | \"Loaded\" | \"In Transit\" | \"Arrived\" | \"Unloading\" | \"Completed\";\n estimated_arrival: string;\n actual_arrival: string | null;\n loaded_shipments: number;\n unloaded_shipments: number;\n rate: string;\n}[];\n\n\n/**\n * This interface was referenced by `Interface`'s JSON-Schema\n * via the `definition` \"fetchCarrierLoadsParams\".\n */\nexport interface FetchCarrierLoadsParams {\n function: \"fetch-carrier-loads\";\n stations: string[];\n showCompleted: boolean;\n}\n\n\nexport async function fetchCarrierLoads(\n params: Omit,\n){\n try {\n const result = await supabase.functions.invoke( \n 'warehouse-webapp-api',\n { body: { ...params, function: 'fetch-carrier-loads' }},\n );\n\n if (!result.error && result.data) {\n return result.data;\n } else if (result.error) {\n throw new Error(\"Error Fetching Result in warehouse-webapp-api/fetchCarrierLoads:\" + result.error);\n } else {\n throw new Error('Unknown error: result does not contain data or error.');\n }\n } catch (error) {\n console.error('Error:', error);\n throw error;\n }\n}\n","import { supabase } from \"../../supabase\";\n\n// To regenerate this file, run the CLI command `deno run --allow-read --allow-write --allow-sys schema_to_ts.ts`. The script is located in the supabase-functions directory.\n\n/**\n * This interface was referenced by `Interface`'s JSON-Schema\n * via the `definition` \"uploadASNResponse\".\n */\nexport type UploadASNResponse = string;\n\n\n/**\n * This interface was referenced by `Interface`'s JSON-Schema\n * via the `definition` \"uploadASNParams\".\n */\nexport interface UploadASNParams {\n function: \"upload-asn\";\n asn_data: {\n [k: string]: string;\n }[];\n headers: string[];\n expected_at?: string;\n loaded_at?: string;\n outbound_station_id: string;\n indexes_to_ignore?: number[];\n}\n\n\nexport async function uploadASN(\n params: Omit,\n){\n try {\n const result = await supabase.functions.invoke( \n 'warehouse-webapp-api',\n { body: { ...params, function: 'upload-asn' }},\n );\n\n if (!result.error && result.data) {\n return result.data;\n } else if (result.error) {\n throw new Error(\"Error Fetching Result in warehouse-webapp-api/uploadASN:\" + result.error);\n } else {\n throw new Error('Unknown error: result does not contain data or error.');\n }\n } catch (error) {\n console.error('Error:', error);\n throw error;\n }\n}\n","import { supabase } from \"../../supabase\";\n\n// To regenerate this file, run the CLI command `deno run --allow-read --allow-write --allow-sys schema_to_ts.ts`. The script is located in the supabase-functions directory.\n\n\n/**\n * This interface was referenced by `Interface`'s JSON-Schema\n * via the `definition` \"createStopsParams\".\n */\nexport interface CreateStopsParams {\n function: \"create-stops\";\n loadId: string;\n}\n\n\nexport async function createStops(\n params: Omit,\n): Promise{\n try {\n const result = await supabase.functions.invoke( \n 'warehouse-webapp-api',\n { body: { ...params, function: 'create-stops' }},\n );\n\n if (!result.error && result.data) {\n return;\n } else if (result.error) {\n throw new Error(\"Error Fetching Result in warehouse-webapp-api/createStops:\" + result.error);\n } else {\n throw new Error('Unknown error: result does not contain data or error.');\n }\n } catch (error) {\n console.error('Error:', error);\n throw error;\n }\n}\n","import { FetchOSDCountResponse } from '@/data/SupabaseRequests/warehouse-webapp-api/fetchOSDCount';\nimport { useState } from 'react';\nimport { ActiveComponent } from '../../WarehouseURLContext';\nimport { PackageMinus, PackagePlus, PackageX } from 'lucide-react';\n\ntype Props = {\n osdData: FetchOSDCountResponse | undefined;\n className?: string;\n hasIcons?: boolean;\n};\n\nexport function OsdPillMini({\n osdData,\n className = '',\n hasIcons = false,\n}: Props) {\n const [selectedTab, setSelectedTab] = useState(null);\n\n return (\n
\n
\n \n {/* {hasIcons && } */}\n
{osdData?.overages ?? 0}
\n {hasIcons && }\n
\n \n {/* {hasIcons && } */}\n\n
{osdData?.shortages ?? 0}
\n {hasIcons && }\n
\n \n {/* {hasIcons && } */}\n
{osdData?.damages ?? 0}
\n {hasIcons && }\n \n \n \n );\n}\n","import React from 'react';\n\ntype Props = {\n count: number;\n title: string;\n color: 'yellow' | 'red' | 'orange';\n active: boolean;\n};\n\n// Define a mapping type\ntype ColorClasses = {\n [key in Props['color']]: {\n default: string;\n hover: string;\n };\n};\n\n// Define the class mappings\nconst colorClasses: ColorClasses = {\n yellow: { default: 'text-yellow-400', hover: 'text-yellow-500' },\n red: { default: 'text-red-400', hover: 'text-red-500' },\n orange: { default: 'text-orange-400', hover: 'text-orange-500' },\n};\n\n/**\n * OSnD type and count Widget\n * @param param0\n * @returns\n */\nexport function OSDWidget({ count, title, color, active }: Props) {\n // Directly use the color prop to get the corresponding class names\n const colorClass = active\n ? colorClasses[color].hover\n : colorClasses[color].default;\n\n return (\n
\n

{count === 0 ? '\\u00D8' : count}

\n

\n {title}\n

\n
\n );\n}\n","import {\n Tooltip,\n TooltipContent,\n TooltipProvider,\n TooltipTrigger,\n} from '@/components/primitives/Tooltip';\nimport { OSDWidget } from './OSDWidget';\nimport { ActiveComponent } from '../../WarehouseURLContext';\nimport { FetchOSDCountResponse } from '@/data/SupabaseRequests/warehouse-webapp-api/fetchOSDCount';\n\ntype Props = {\n handleTabClick: (category: ActiveComponent) => void;\n osdData: FetchOSDCountResponse | undefined;\n className?: string;\n selectedTab?: ActiveComponent;\n};\n\nexport function OsdPill({\n handleTabClick,\n osdData,\n className,\n selectedTab,\n}: Props) {\n return (\n \n \n \n \n Overages\n \n \n handleTabClick('Overages')}\n >\n \n \n \n \n \n\n \n \n \n Shortages\n \n \n handleTabClick('Shortages')}\n >\n \n \n \n \n \n \n \n \n Damages\n \n \n handleTabClick('Damages')}\n >\n \n \n \n \n \n \n );\n}\n","import { cn } from '@/lib/utils';\nimport { ActiveComponent } from '../../WarehouseURLContext';\nimport { FetchOSDCountResponse } from '@/data/SupabaseRequests/warehouse-webapp-api/fetchOSDCount';\nimport { PackageMinus, PackagePlus, PackageX } from 'lucide-react';\n\ntype Props = {\n handleTabClick: (category: ActiveComponent) => void;\n osdData: FetchOSDCountResponse | undefined;\n className?: string;\n selectedTab?: ActiveComponent;\n rounded?: boolean;\n};\n\nexport function OsdListView({\n handleTabClick,\n osdData,\n className,\n selectedTab,\n rounded = true,\n}: Props) {\n const layoutClass = '';\n return (\n //
    \n <>\n handleTabClick('Overages')}\n >\n {/* Overages */}\n {osdData?.overages}\n \n  Overages \n \n \n handleTabClick('Shortages')}\n >\n {/* Shortages */}\n {osdData?.shortages}\n \n {' '}\n Shortages  \n \n \n \n handleTabClick('Damages')}\n >\n {/* Damages */}\n {/* Damages */}\n {/* Damages */}\n {/* Damages */}\n {osdData?.damages}\n \n {' '}\n  Damages \n {' '}\n \n \n //
\n );\n}\n","import { useState } from 'react';\nimport { useQuery } from 'react-query';\nimport { ActiveComponent } from '../../WarehouseURLContext';\nimport { fetchOSDCount } from '@/data/SupabaseRequests/warehouse-webapp-api/_index';\nimport { OsdPillMini } from './OsdPillMini';\nimport { OsdPill } from './OsdPill';\nimport { OsdListView } from './OsdListView';\n\ntype Props = {\n loadId: string;\n type: 'shipper' | 'carrier';\n className?: string;\n miniClassName?: string;\n setCategory?: (category: ActiveComponent) => void;\n hasIcons?: boolean;\n mode?: 'default' | 'mini' | 'list' | 'pill';\n rounded?: boolean;\n};\n\n/**\n * OS&D container for overages, shortages, and damages\n * Mini view for warehouse card\n * @param param0\n * @returns React Component\n */\nexport function OSDContainer({\n loadId,\n type,\n className,\n setCategory,\n hasIcons = false,\n miniClassName = '',\n mode = 'default',\n rounded = true,\n}: Props) {\n const [selectedTab, setSelectedTab] = useState(null);\n\n const { data: osdData } = useQuery({\n queryKey: ['osd-count', type, loadId],\n queryFn: () => fetchOSDCount({ load_id: loadId }),\n });\n\n const handleTabClick = (category: ActiveComponent) => {\n category = category !== selectedTab ? category : 'Load';\n setSelectedTab(category);\n if (setCategory) {\n setCategory(category);\n }\n };\n\n return (\n <>\n {mode === 'mini' && (\n \n )}\n {mode === 'default' && (\n \n )}\n {mode === 'list' && (\n \n )}\n \n );\n}\n","import React, {\n createContext,\n useContext,\n useState,\n useEffect,\n ReactNode,\n} from 'react';\nimport { useLocation, useSearchParams } from 'react-router-dom';\n\nexport type ActiveComponent =\n | 'Load'\n | 'Overages'\n | 'Shortages'\n | 'Damages'\n | 'Complete'\n | 'Arrive'\n | 'Upload ASN'\n | null;\n\ninterface WarehouseContextProps {\n activeLoad: string;\n setActiveLoad: (load: string) => void;\n showCompleted: boolean;\n setShowCompleted: (show: boolean) => void;\n activeComponent: ActiveComponent;\n setActiveComponent: (component: ActiveComponent) => void;\n}\n\nconst WarehouseContext = createContext(\n undefined,\n);\n\nexport const useWarehouseContext = () => {\n const context = useContext(WarehouseContext);\n if (!context) {\n throw new Error(\n 'useWarehouseContext must be used within a WarehouseProvider',\n );\n }\n return context;\n};\n\n//TODO: DELETE THIS COMMENT - USED FOR REDEPLOY\n\nexport const WarehouseProvider = ({ children }: { children: ReactNode }) => {\n const location = useLocation();\n const [searchParams, setSearchParams] = useSearchParams();\n\n const [activeLoad, setActiveLoad] = useState(\n searchParams.get('load_id') || '',\n );\n const [showCompleted, setShowCompleted] = useState(\n searchParams.get('showCompleted') === 'true',\n );\n const [activeComponent, setActiveComponent] = useState(\n (searchParams.get('info') as ActiveComponent) || null,\n );\n\n // Ensure showCompleted is in the URL params and default to 'false' if not present\n useEffect(() => {\n if (!searchParams.has('showCompleted')) {\n searchParams.set('showCompleted', 'false');\n setSearchParams(searchParams);\n }\n }, []); // Empty dependency array ensures this runs only once on mount\n\n // Synchronize state with URL params\n useEffect(() => {\n const loadParam = searchParams.get('load_id') || '';\n const showCompletedParam = searchParams.get('showCompleted') === 'true';\n const infoParam = (searchParams.get('info') as ActiveComponent) || null;\n\n // Update state only if it has actually changed to prevent unnecessary renders\n if (activeLoad !== loadParam) {\n setActiveLoad(loadParam);\n setActiveComponent('Load');\n }\n\n if (showCompleted !== showCompletedParam) {\n setShowCompleted(showCompletedParam);\n }\n\n if (activeComponent !== infoParam) {\n setActiveComponent(infoParam);\n }\n }, [location.search]);\n\n // Update URL params when state changes\n useEffect(() => {\n const params = new URLSearchParams(location.search);\n\n if (activeLoad) {\n params.set('load_id', activeLoad);\n } else {\n params.delete('load_id');\n }\n\n if (showCompleted) {\n params.set('showCompleted', 'true');\n } else {\n params.set('showCompleted', 'false'); // Ensure the parameter is always present\n }\n\n if (activeComponent) {\n params.set('info', activeComponent);\n } else {\n params.delete('info');\n }\n\n setSearchParams(params);\n }, [activeLoad, showCompleted, activeComponent, setSearchParams]);\n\n // Custom function to set active load and reset active component\n const handleSetActiveLoad = (load: string) => {\n setActiveLoad(load);\n setActiveComponent(null);\n };\n\n const handleSetShowCompleted = (completed: boolean) => {\n setShowCompleted(completed);\n setActiveLoad('');\n setActiveComponent(null);\n };\n\n return (\n \n {children}\n \n );\n};\n","import React from 'react';\nimport { LoadCard } from '../_models';\nimport { LUDate } from '@/common/classes/LUDate';\nimport { StateBadge } from '../Shared/StateBadge';\nimport { ArrivalProgressBar } from '../Shared/ArrivalProgressBar';\nimport { ProgressBar } from '../Shared/ProgressBar';\nimport { OSDContainer } from '../Shared/os&d_view/OS&DContainer';\nimport { useWarehouseContext } from '../WarehouseURLContext';\nimport { cn } from '@/lib/utils';\nimport { StateColors } from '../Shared/models';\n\ntype Props = {\n load: LoadCard;\n isActive: boolean;\n};\n\nconst cell_style = 'text-center sm:text-sm xs:text-sm col-span-1';\n\nexport function LoadCardView({ load, isActive }: Props) {\n const { setActiveComponent, setActiveLoad } = useWarehouseContext();\n const colors: StateColors = {\n foregroundGroupHover: `group-hover:text-card-foreground`,\n textActive: 'text-card-foreground',\n textActiveHover: 'hover:text-white',\n textHover: 'hover:text-white',\n backgroundActive: 'bg-lupurple-lighter',\n backgroundHover: 'hover:bg-lupurple-lighter',\n textGroupHover: 'group-hover:text-card-foreground',\n text: 'text-card-foreground',\n };\n\n const progressColors: StateColors = {\n foreground: 'bg-lupurple-lighter',\n foregroundActive: 'bg-lupurple-light',\n foregroundHover: 'group-hover:bg-lupurple-medium',\n // textActive: 'text-',\n textGroupHover: 'group-hover:text-white',\n text: 'text-card-foreground',\n backgroundActive: 'bg-lubackground-light',\n };\n\n const hasUnloadTracking =\n load.state === 'Unloading' || load.state === 'Completed';\n\n const handleLoadClick = () => {\n setActiveLoad(load.id);\n if (load.state === 'In Transit') {\n setActiveComponent('Arrive');\n } else {\n setActiveComponent('Load');\n }\n };\n\n return (\n \n
\n
\n \n {load.trailer_id}\n \n
\n\n \n {hasUnloadTracking && (\n
\n \n
\n )}{' '}\n
\n
\n {/* {hasUnloadTracking && (\n
\n \n
)} */}\n {new LUDate(load.estimated_arrival).toString(true)}\n
\n \n {load.name}\n \n\n \n {/* {(load.state === 'Unloading' || load.state === 'Completed') && (\n
\n \n
)} */}{' '}\n {/* Hidden below md, visible above md */}\n \n
\n \n {load.state === 'In Transit' && (\n
\n \n
\n )}\n {load.state === 'Arrived' && (\n
\n \n
\n )}\n\n {(load.state === 'Unloading' || load.state === 'Completed') && (\n
\n
\n \n
\n
\n )}\n \n );\n}\n","import { LoadSort } from '../_models';\nimport {\n DropdownMenu,\n DropdownMenuTrigger,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuLabel,\n DropdownMenuSeparator,\n} from '@/components/primitives/DropdownMenu';\nimport { Button } from '@/components/primitives/Button';\nimport { useWarehouseContext } from '../WarehouseURLContext';\nimport { useQuery } from 'react-query';\nimport { getStations } from '@/data/SupabaseRequests/webapp-api/getStations';\nimport { useAuth } from '@/data/auth';\n\ntype Props = {\n sorting: LoadSort;\n setSorting: (sorting: LoadSort) => void;\n station: string | null;\n onStationChange: (stationId: string) => void; // Callback for station selection\n};\n\n/**\n * Left side load header for the load list with sorting and station filtering.\n * @param param0\n * @returns React component\n */\nexport function LoadHeader({\n sorting,\n setSorting,\n station,\n onStationChange,\n}: Props) {\n const {\n showCompleted,\n setShowCompleted,\n setActiveLoad,\n activeComponent,\n setActiveComponent,\n } = useWarehouseContext();\n const { user } = useAuth();\n\n const { data: stations } = useQuery({\n queryKey: 'stations',\n queryFn: () => getStations({}),\n });\n\n // Function to change the sorting based on the column clicked\n function changeSort(sort: 'trailer' | 'arrival') {\n setSorting({\n sort_by: sort,\n asc: sorting.sort_by === sort ? !sorting.asc : true,\n });\n }\n\n // Function to determine the sort icon (arrow direction) to display\n function sortIndicator(sort: 'trailer' | 'arrival') {\n return sorting.sort_by === sort\n ? sorting.asc\n ? '↑'\n : '↓'\n : '\\u00A0\\u00A0\\u00A0'; // three space characters to prevent jumping when the icon is toggled\n }\n\n return (\n
\n
\n {/* Station Filter Dropdown */}\n \n \n \n \n \n Filter by Station\n \n {stations?.map((s) => (\n onStationChange(s.id)}\n >\n {s.name}\n {station === s.id && }\n \n ))}\n \n \n\n {/* Sorting Dropdown */}\n \n \n \n \n \n Sort Options\n \n changeSort('trailer')}>\n Trailer {sortIndicator('trailer')}\n \n changeSort('arrival')}>\n Arrival {sortIndicator('arrival')}\n \n \n \n\n {/* Show Completed Toggle */}\n
\n \n setShowCompleted(!showCompleted)}\n id=\"show-completed-toggle\"\n />\n
\n
\n {user?.org_type === 'shipper' && (\n {\n setActiveLoad('');\n if (activeComponent === 'Upload ASN') setActiveComponent(null);\n else {\n setActiveComponent('Upload ASN');\n }\n }}\n className={`flex justify-center border-slate-300 hover:bg-lupurple-light hover:cursor-pointer border-b-2 border-l-2 items-center ${activeComponent === 'Upload ASN' ? 'bg-lupurple-light' : 'bg-slate-200'}`}\n >\n Upload ASN\n
\n )}\n \n );\n}\n","import React from 'react';\nimport { LoadCard, LoadSort } from '../_models';\nimport { LUDate } from '@/common/classes/LUDate';\nimport { Loading } from '@/layout/Loading';\nimport { Card } from '@/components/primitives/Card';\nimport { LoadCardView } from './LoadCardView';\nimport { useWarehouseContext } from '../WarehouseURLContext';\nimport { cn } from '@/lib/utils';\nimport { LoadHeader } from '../Shared/LoadHeader';\n\ntype Props = {\n loads: LoadCard[];\n isLoading: boolean;\n};\n\nexport function VertainerLeftCarrier({ loads, isLoading }: Props) {\n const [sorting, setSorting] = React.useState({\n sort_by: 'arrival',\n asc: false,\n } as LoadSort);\n const [station, setStation] = React.useState(null);\n //**Sorting and helper functions are below the html */\n\n const { activeLoad } = useWarehouseContext();\n\n const toggleStation = (station_id: string) => {\n if (station === station_id) {\n setStation(null);\n } else {\n setStation(station_id);\n }\n };\n\n const isActive = (load_id: string) => {\n return load_id.localeCompare(activeLoad) === 0;\n };\n\n return (\n \n
\n\n
\n \n
\n\n
\n {isLoading ? (\n
\n \n
\n ) : loads.length === 0 ? (\n
\n

\n {'No active loads'}\n

\n

\n {\n 'To view completed loads, click the menu icon and select \"Show Completed\"'\n }\n

\n
\n ) : (\n loadSorted(loads, sorting, station).map((load) => {\n return (\n \n );\n })\n )}\n
\n \n );\n}\n\ntype LoadState =\n | 'Building'\n | 'Ready To Load'\n | 'Loading'\n | 'Loaded'\n | 'In Transit'\n | 'Arrived'\n | 'Unloading'\n | 'Completed';\n\n// Helper function to map state to a sortable numeric value based on simplified state\nfunction mapStateToSortableValue(state: LoadState): number {\n switch (state) {\n case 'Building':\n case 'Ready To Load':\n case 'Loading':\n case 'Loaded':\n case 'In Transit':\n return 1; // 'Incoming'\n case 'Arrived':\n return 2; // 'Arrived'\n case 'Unloading':\n return 3; // 'Sorting'\n case 'Completed':\n return 4; // 'Completed'\n default:\n return 5; // 'Unknown' (should not happen with proper types)\n }\n}\n\nfunction loadSorted(\n loads: LoadCard[],\n sorting: LoadSort,\n stationId: string | null,\n): LoadCard[] {\n if (stationId) {\n loads = loads.filter((load) => load.station_id === stationId);\n }\n if (sorting.sort_by === 'arrival') {\n return loads.sort((a, b) => {\n return sorting.asc\n ? new LUDate(a.estimated_arrival).isBefore(\n new LUDate(b.estimated_arrival),\n )\n ? -1\n : 1\n : new LUDate(a.estimated_arrival).isBefore(\n new LUDate(b.estimated_arrival),\n )\n ? 1\n : -1;\n });\n } else if (sorting.sort_by === 'trailer') {\n return loads.sort((a, b) => {\n return sorting.asc\n ? a.trailer_id.localeCompare(b.trailer_id)\n : b.trailer_id.localeCompare(a.trailer_id);\n });\n } else if (sorting.sort_by === 'customer') {\n return loads.sort((a, b) => {\n return sorting.asc\n ? a.name.localeCompare(b.name)\n : b.name.localeCompare(a.name);\n });\n } else if (sorting.sort_by === 'status') {\n return loads.sort((a, b) => {\n const stateValueA = mapStateToSortableValue(a.state);\n const stateValueB = mapStateToSortableValue(b.state);\n return sorting.asc\n ? stateValueA - stateValueB\n : stateValueB - stateValueA;\n });\n }\n return [];\n}\n","import { useQuery } from 'react-query';\n\nimport { exportToCSV } from '@/common/functions/downloadFile';\nimport { DownloadIcon } from 'lucide-react';\nimport {\n LoadScanReportResponse,\n loadScanReport,\n} from '@/data/SupabaseRequests/warehouse-webapp-api/_index';\n\ntype Props = {\n load_id: string;\n load_name: string;\n load_date: string; //as html input\n};\n\nexport default function LoadScanReport({\n load_id,\n load_name,\n load_date,\n}: Props) {\n const { data, isLoading, error } = useQuery({\n queryKey: ['load_scan_report', load_id],\n queryFn: () => loadScanReport({ load_id }),\n enabled: load_id !== '',\n });\n\n if (isLoading) return
Loading...
;\n if (error) return
Error loading data
;\n\n const handleDownload = () => {\n if (data) {\n if (data) {\n const headers = [\n 'MBOL',\n 'Market',\n 'InductDate',\n 'BOL',\n 'StoreId',\n 'Condition',\n 'Barcode',\n ];\n const formattedData = data.map((line) => ({\n MBOL: '',\n Market: '',\n InductDate: load_date ?? '',\n BOL: line.bol ?? '',\n StoreId: line.store ?? '',\n Condition: line.scan_type ?? '',\n Barcode: line.barcode ?? '',\n }));\n exportToCSV(headers, formattedData, `ScanReport_${load_name}.csv`);\n }\n }\n };\n\n return (\n
\n
\n

Load Scan Report

\n \n Download As CSV\n \n
\n\n
\n
\n {data?.length === 0 && (\n
No Shipments Found
\n )}\n {data?.map((shipment, ix) => (\n \n
\n

Tracking ID:

\n

{shipment?.barcode}

\n
\n
\n

Type:

\n

{shipment.scan_type}

\n
\n
\n ))}\n
\n
\n \n );\n}\n\n// function getUserFriendlyTime(timestamp: string) {\n// const date = new Date(timestamp);\n// if (isNaN(date.getTime())) return 'No Date Given';\n// return date.toLocaleString();\n// }\n","export const formatTimeDifference = (date: Date, showSeconds?:boolean) => {\n const now = new Date();\n\n const differenceMs = Math.abs(now.getTime() - date.getTime());\n\n if (showSeconds && differenceMs >= 3000 && differenceMs < 60000) {\n const differenceSeconds = Math.floor(differenceMs / 1000);\n return `${differenceSeconds} second${differenceSeconds === 1 ? '' : 's'} ago`;\n }\n\n const differenceMinutes = Math.floor(differenceMs / 60000);\n if (differenceMinutes < 1) {\n return 'Just Now';\n } else if (differenceMinutes < 60) {\n return `${differenceMinutes} minute${differenceMinutes === 1 ? '' : 's'} ago`;\n }\n\n const differenceHours = Math.floor(differenceMs / 3600000);\n if (differenceHours < 24) {\n return `${differenceHours} hour${differenceHours === 1 ? '' : 's'} ago`;\n }\n\n const differenceDays = Math.floor(differenceMs / 86400000);\n if (differenceDays < 31) {\n return `${differenceDays} day${differenceDays === 1 ? '' : 's'} ago`;\n }\n\n const differenceMonths = Math.floor(differenceMs / 2629800000);\n if (differenceMonths < 12) {\n return `${differenceMonths} month${differenceMonths === 1 ? '' : 's'} ago`;\n }\n\n return 'Over a year ago';\n};\n\n","import { formatTimeDifference } from '@/common/functions/dateString';\nimport React, { useState, useMemo } from 'react';\nimport { ScannedShipment } from '../_models';\nimport { Badge } from '@/components/primitives/Badge';\nimport { LUDate } from '@/common/classes/LUDate';\nimport { cn } from '@/lib/utils';\n\ntype Props = {\n scannedShipments: ScannedShipment[];\n className?: string;\n alignLeft?: boolean;\n};\n\nexport const ScannedShipmentsTable = ({\n scannedShipments,\n ...props\n}: Props) => {\n const [sortConfig, setSortConfig] = useState<{\n key: 'date' | 'tracking_id';\n direction: 'asc' | 'desc';\n }>({\n key: 'date',\n direction: 'asc',\n });\n\n const sortedShipments = useMemo(() => {\n return [...scannedShipments].sort((a, b) => {\n if (sortConfig.key === 'date') {\n if (a.scanned_at === null && b.scanned_at === null) return 0; // Both null, considered equal\n if (a.scanned_at === null)\n return sortConfig.direction === 'asc' ? 1 : -1; // Treat null accordingly\n if (b.scanned_at === null)\n return sortConfig.direction === 'asc' ? -1 : 1; // Treat null accordingly\n const dateComparison =\n new Date(a.scanned_at).getTime() - new Date(b.scanned_at).getTime();\n return sortConfig.direction === 'asc'\n ? dateComparison\n : -dateComparison;\n } else {\n const idComparison = a.tracking_id.localeCompare(b.tracking_id);\n return sortConfig.direction === 'asc' ? idComparison : -idComparison;\n }\n });\n }, [scannedShipments, sortConfig]);\n\n const handleSort = (key: 'date' | 'tracking_id') => {\n setSortConfig((prevConfig) => {\n if (prevConfig.key === key) {\n return {\n key,\n direction: prevConfig.direction === 'asc' ? 'desc' : 'asc',\n };\n } else {\n return {\n key,\n direction: 'asc',\n };\n }\n });\n };\n\n return (\n
\n {/*
*/}\n \n handleSort('tracking_id')}\n >\n Tracking ID{' '}\n {sortConfig.key === 'tracking_id'\n ? sortConfig.direction === 'asc'\n ? '↑'\n : '↓'\n : ''}\n
\n handleSort('date')}\n >\n Scanned At{' '}\n {sortConfig.key === 'date'\n ? sortConfig.direction === 'asc'\n ? '↑'\n : '↓'\n : ''}\n
\n {sortedShipments.map((shipment) => (\n \n
\n {/* Ensure wrapping on long tracking IDs */}\n {shipment.tracking_id}\n
\n \n {shipment.scanned_at ? (\n formatTimeDifference(new LUDate(shipment.scanned_at), true)\n ) : (\n \n Unscanned\n \n )}\n \n
\n ))}\n \n \n );\n};\n","import React from 'react';\nimport { useQuery } from 'react-query';\nimport { useWarehouseContext } from '../WarehouseURLContext';\nimport { LUDate } from '@/common/classes/LUDate';\nimport { ArrowBigRight, Clock, RefreshCcwIcon, Warehouse } from 'lucide-react';\nimport { formatTimeDifference } from '@/common/functions/dateString';\nimport { ScannedShipmentsTable } from './ScannedShipmentsTable';\nimport { Badge } from '@/components/primitives/Badge';\nimport {\n fetchNewScanCount,\n fetchScannedShipments,\n FetchScannedShipmentsResponse,\n} from '@/data/SupabaseRequests/warehouse-webapp-api/_index';\nimport { Input } from '@/components/primitives/Input';\nimport { StateColors } from '../Shared/models';\nimport { LoadInfoState } from '../_models';\n\ntype Props = {\n rate: string;\n state?: LoadInfoState;\n colors?: StateColors;\n};\nexport default function ScannedShipmentsContent({\n rate,\n colors = {\n background: 'bg-lupurple-lighter',\n },\n state,\n}: Props) {\n const [lastUpdated, setLastUpdated] = React.useState(new LUDate());\n const [timeDifference, setTimeDifference] = React.useState('');\n const [hideUnscanned, setHideUnscanned] = React.useState(true);\n const { activeLoad } = useWarehouseContext();\n const { background } = colors as StateColors;\n\n async function getMoreScans() {\n setTimeDifference(formatTimeDifference(lastUpdated!, true));\n return fetchNewScanCount({\n load_id: activeLoad,\n last_updated_at: lastUpdated!.toISOString(),\n });\n }\n\n const { data: shipments } = useQuery({\n queryKey: [activeLoad, 'scanned-shipments', lastUpdated],\n queryFn: () => fetchScannedShipments({ load_id: activeLoad }),\n enabled: activeLoad !== '' || lastUpdated !== null,\n refetchInterval: 9000000,\n });\n\n const { data: newScans } = useQuery({\n queryKey: [activeLoad, 'new-scans', lastUpdated],\n queryFn: () => getMoreScans(),\n enabled: !!lastUpdated && activeLoad !== '',\n refetchInterval: 10000, // Refetch every 10 seconds\n });\n\n const numberOfNewScans = Number(newScans?.count) || 0;\n\n const scannedShipments = shipments?.filter(\n (shipment) => shipment.scanned_at !== null,\n );\n\n const lastHourScannedShipments = scannedShipments?.filter((shipment) => {\n const lastHour = new LUDate().addHours(-1);\n return new LUDate(shipment.scanned_at!).isAfter(lastHour) || false;\n });\n\n const placeholder = {\n text: 'Awaiting Scans',\n icon: ,\n };\n\n const hasPlaceHolder =\n !shipments ||\n !shipments?.length ||\n shipments.filter((shipment) => shipment.scanned_at !== null).length === 0;\n // TODO: handle show unscanned\n\n if (state === 'In Transit') {\n placeholder.text = 'Incoming'; //'In Transit';\n placeholder.icon = ;\n } else if (state === 'Arrived') {\n placeholder.icon = ;\n }\n\n //time remaining in hours and minutes\n\n return (\n
\n
\n
\n
\n
\n {timeDifference}\n \n setLastUpdated(new LUDate())}\n className=\"hover:text-lupurple hover:cursor-pointer\"\n />\n {newScans && numberOfNewScans > 0 && (\n
\n {newScans.count}\n
\n )}\n
\n
\n
\n {shipments && getTimeRemaining(shipments, rate)}\n
\n\n {/* Move the checkbox here, below Est. Time Remaining */}\n
\n \n setHideUnscanned(!hideUnscanned)}\n id=\"hide-unscanned-toggle\"\n />\n
\n
\n
\n \n \n {lastHourScannedShipments?.length}\n {' '}\n Scans in last hour\n \n \n \n {scannedShipments?.length}\n {' '}\n Total scans\n \n \n \n {Number(rate).toFixed(2)}\n \n Cartons/Hr\n \n
\n {/*
*/}\n
\n
\n\n {!hasPlaceHolder ? (\n shipment.scanned_at !== null) ||\n []\n : shipments || []\n }\n />\n ) : (\n
\n
\n {placeholder.text}\n
\n
\n {placeholder.icon}\n
\n
\n )}\n \n );\n}\n\nfunction getTimeRemaining(\n scanned_shipments: FetchScannedShipmentsResponse,\n rate: string,\n) {\n const total_scanned = scanned_shipments.filter(\n (shipment) => shipment.scanned_at !== null,\n ).length;\n\n const total_shipments = scanned_shipments.length;\n\n //we need to get the estimated time of completion: rate= shipments/hour\n const time_remaining: number =\n total_shipments && total_scanned\n ? (total_shipments - total_scanned) / Number(Number(rate).toFixed(2))\n : 0;\n\n //time remaining in hours and minutes\n\n const hours = Math.floor(time_remaining);\n const minutes = Math.floor((time_remaining - hours) * 60);\n const result =\n hours || minutes ? `${hours}h ${minutes}m remaining` : `\\u00A0`; //   to give cell content height\n return result;\n}\n","import React from 'react';\nimport LoadScanReport from '../../ShipperWarehouse/RightVertainer/LoadScanReport';\nimport ScannedShipmentsContent from '../ScannedShipmentsContent';\nimport { LoadInfoState } from '../../_models';\n\ntype Props = {\n load_id: string;\n completed: boolean;\n trailer: string;\n load_date: string;\n rate: string;\n state?: LoadInfoState;\n};\n\nexport default function LoadShipments({\n load_id,\n completed,\n trailer,\n load_date,\n rate,\n state,\n}: Props) {\n return (\n
\n {completed ? (\n \n ) : (\n \n )}\n
\n );\n}\n","'use client';\n\nimport * as React from 'react';\nimport * as MenubarPrimitive from '@radix-ui/react-menubar';\nimport { Check, ChevronRight, Circle } from 'lucide-react';\n\nimport { cn } from '@/lib/utils';\n\nconst MenubarMenu = MenubarPrimitive.Menu;\n\nconst MenubarGroup = MenubarPrimitive.Group;\n\nconst MenubarPortal = MenubarPrimitive.Portal;\n\nconst MenubarSub = MenubarPrimitive.Sub;\n\nconst MenubarRadioGroup = MenubarPrimitive.RadioGroup;\n\nconst Menubar = React.forwardRef<\n React.ElementRef,\n React.ComponentPropsWithoutRef\n>(({ className, ...props }, ref) => (\n \n));\nMenubar.displayName = MenubarPrimitive.Root.displayName;\n\nconst MenubarTrigger = React.forwardRef<\n React.ElementRef,\n React.ComponentPropsWithoutRef\n>(({ className, ...props }, ref) => (\n \n));\nMenubarTrigger.displayName = MenubarPrimitive.Trigger.displayName;\n\nconst MenubarSubTrigger = React.forwardRef<\n React.ElementRef,\n React.ComponentPropsWithoutRef & {\n inset?: boolean;\n }\n>(({ className, inset, children, ...props }, ref) => (\n \n {children}\n \n \n));\nMenubarSubTrigger.displayName = MenubarPrimitive.SubTrigger.displayName;\n\nconst MenubarSubContent = React.forwardRef<\n React.ElementRef,\n React.ComponentPropsWithoutRef\n>(({ className, ...props }, ref) => (\n \n));\nMenubarSubContent.displayName = MenubarPrimitive.SubContent.displayName;\n\nconst MenubarContent = React.forwardRef<\n React.ElementRef,\n React.ComponentPropsWithoutRef\n>(\n (\n { className, align = 'start', alignOffset = -4, sideOffset = 8, ...props },\n ref,\n ) => (\n \n \n \n ),\n);\nMenubarContent.displayName = MenubarPrimitive.Content.displayName;\n\nconst MenubarItem = React.forwardRef<\n React.ElementRef,\n React.ComponentPropsWithoutRef & {\n inset?: boolean;\n }\n>(({ className, inset, ...props }, ref) => (\n \n));\nMenubarItem.displayName = MenubarPrimitive.Item.displayName;\n\nconst MenubarCheckboxItem = React.forwardRef<\n React.ElementRef,\n React.ComponentPropsWithoutRef\n>(({ className, children, checked, ...props }, ref) => (\n \n \n \n \n \n \n {children}\n \n));\nMenubarCheckboxItem.displayName = MenubarPrimitive.CheckboxItem.displayName;\n\nconst MenubarRadioItem = React.forwardRef<\n React.ElementRef,\n React.ComponentPropsWithoutRef\n>(({ className, children, ...props }, ref) => (\n \n \n \n \n \n \n {children}\n \n));\nMenubarRadioItem.displayName = MenubarPrimitive.RadioItem.displayName;\n\nconst MenubarLabel = React.forwardRef<\n React.ElementRef,\n React.ComponentPropsWithoutRef & {\n inset?: boolean;\n }\n>(({ className, inset, ...props }, ref) => (\n \n));\nMenubarLabel.displayName = MenubarPrimitive.Label.displayName;\n\nconst MenubarSeparator = React.forwardRef<\n React.ElementRef,\n React.ComponentPropsWithoutRef\n>(({ className, ...props }, ref) => (\n \n));\nMenubarSeparator.displayName = MenubarPrimitive.Separator.displayName;\n\nconst MenubarShortcut = ({\n className,\n ...props\n}: React.HTMLAttributes) => {\n return (\n \n );\n};\nMenubarShortcut.displayname = 'MenubarShortcut';\n\nexport {\n Menubar,\n MenubarMenu,\n MenubarTrigger,\n MenubarContent,\n MenubarItem,\n MenubarSeparator,\n MenubarLabel,\n MenubarCheckboxItem,\n MenubarRadioGroup,\n MenubarRadioItem,\n MenubarPortal,\n MenubarSubContent,\n MenubarSubTrigger,\n MenubarGroup,\n MenubarSub,\n MenubarShortcut,\n};\n","'use client';\n\nimport * as React from 'react';\nimport { DialogProps } from '@radix-ui/react-dialog';\nimport { Command as CommandPrimitive } from 'cmdk';\n\nimport { cn } from '@/lib/utils';\nimport { Dialog, DialogContent } from '@/components/primitives/Dialog';\n\nconst Command = React.forwardRef<\n React.ElementRef,\n React.ComponentPropsWithoutRef\n>(({ className, ...props }, ref) => (\n \n));\nCommand.displayName = CommandPrimitive.displayName;\n\ntype CommandDialogProps = DialogProps;\n\nconst CommandDialog = ({ children, ...props }: CommandDialogProps) => {\n return (\n \n \n \n {children}\n \n \n \n );\n};\n\nconst CommandInput = React.forwardRef<\n React.ElementRef,\n React.ComponentPropsWithoutRef\n>(({ className, ...props }, ref) => (\n
\n \n
\n));\n\nCommandInput.displayName = CommandPrimitive.Input.displayName;\n\nconst CommandList = React.forwardRef<\n React.ElementRef,\n React.ComponentPropsWithoutRef\n>(({ className, ...props }, ref) => (\n \n));\n\nCommandList.displayName = CommandPrimitive.List.displayName;\n\nconst CommandEmpty = React.forwardRef<\n React.ElementRef,\n React.ComponentPropsWithoutRef\n>((props, ref) => (\n \n));\n\nCommandEmpty.displayName = CommandPrimitive.Empty.displayName;\n\nconst CommandGroup = React.forwardRef<\n React.ElementRef,\n React.ComponentPropsWithoutRef\n>(({ className, ...props }, ref) => (\n \n));\n\nCommandGroup.displayName = CommandPrimitive.Group.displayName;\n\nconst CommandSeparator = React.forwardRef<\n React.ElementRef,\n React.ComponentPropsWithoutRef\n>(({ className, ...props }, ref) => (\n \n));\nCommandSeparator.displayName = CommandPrimitive.Separator.displayName;\n\nconst CommandItem = React.forwardRef<\n React.ElementRef,\n React.ComponentPropsWithoutRef\n>(({ className, ...props }, ref) => (\n \n));\n\nCommandItem.displayName = CommandPrimitive.Item.displayName;\n\nconst CommandShortcut = ({\n className,\n ...props\n}: React.HTMLAttributes) => {\n return (\n \n );\n};\nCommandShortcut.displayName = 'CommandShortcut';\n\nexport {\n Command,\n CommandDialog,\n CommandInput,\n CommandList,\n CommandEmpty,\n CommandGroup,\n CommandItem,\n CommandShortcut,\n CommandSeparator,\n};\n","import { UseMutationResult, useMutation, useQueryClient } from 'react-query';\nimport { OSDShipment } from '../../../_models';\nimport { useToast } from '@/components/primitives/useToast';\nimport { useAuth } from '@/data/auth';\nimport { useWarehouseContext } from '@/pages/warehouse/WarehouseURLContext';\nimport { resolveOverage } from '@/data/SupabaseRequests/warehouse-webapp-api/resolveOverage';\nimport { assignUnrecognizedToStore } from '@/data/SupabaseRequests/warehouse-webapp-api/assignUnrecognizedToStore';\nimport {\n handleBadScan,\n updateOverageStore,\n} from '@/data/SupabaseRequests/warehouse-webapp-api/_index';\n\ntype UpdateOverageException = {\n exception_id: string;\n tracking_id: string;\n shipment_id: string;\n resolution: string;\n};\n\nexport function useUpdateOverageExceptions(): UseMutationResult<\n void,\n Error,\n UpdateOverageException\n> {\n const toast = useToast();\n const queryClient = useQueryClient();\n const { user } = useAuth();\n const { activeLoad: load_id } = useWarehouseContext();\n\n return useMutation(\n async ({ exception_id, tracking_id, shipment_id, resolution }) => {\n const originalShipments = queryClient.getQueryData([\n 'loads',\n load_id,\n 'OSND',\n 'Overage',\n ]);\n\n if (resolution === 'Bad Scan') {\n // Handle bad scan resolution\n const updatedShipments = originalShipments?.filter(\n (shipment) => shipment.tracking_id !== tracking_id,\n );\n\n try {\n await handleBadScan({ barcode: tracking_id });\n toast.toast({\n title: 'Success',\n description: `Successfully deleted shipment ${tracking_id}`,\n variant: 'success',\n time: 6000,\n });\n queryClient.setQueryData(\n ['loads', load_id, 'OSND', 'Overage'],\n updatedShipments,\n );\n } catch (error) {\n queryClient.setQueryData(\n ['loads', load_id, 'OSND', 'Overage'],\n originalShipments,\n );\n throw error;\n }\n } else {\n // Handle other resolutions\n const updatedShipments = originalShipments?.map((shipment) => {\n if (shipment.shipment_id === shipment_id) {\n shipment.resolution = resolution;\n shipment.resolved_at = new Date();\n shipment.is_unrecognized = false;\n shipment.details = 'In-Area';\n shipment.scanned_by_first_name = user?.name.split(' ')[0];\n shipment.scanned_by_last_name = user?.name.split(' ')[1];\n }\n return shipment;\n });\n\n queryClient.setQueryData(\n ['loads', load_id, 'OSND', 'Overage'],\n updatedShipments,\n );\n\n try {\n await resolveOverage({ exception_id, resolution });\n\n toast.toast({\n title: 'Success',\n description: `Successfully updated shipment ${tracking_id}`,\n variant: 'success',\n time: 6000,\n });\n } catch (error) {\n queryClient.setQueryData(\n ['loads', load_id, 'OSND', 'Overage'],\n originalShipments,\n );\n toast.toast({\n title: 'Error',\n description: `Could not update shipment ${tracking_id}. If issue persists, please contact support.`,\n variant: 'error',\n time: 6000,\n });\n throw error;\n }\n }\n },\n );\n}\n\ntype AssignToStoreParams = {\n exception_id: string | null;\n tracking_id: string;\n store_id: string;\n store_ref: string;\n shipment_id: string;\n};\n\nexport function useAssignToStore(): UseMutationResult<\n void,\n Error,\n AssignToStoreParams\n> {\n const toast = useToast();\n const queryClient = useQueryClient();\n const { user } = useAuth();\n const { activeLoad } = useWarehouseContext();\n\n return useMutation(\n async ({ exception_id, tracking_id, store_id, store_ref, shipment_id }) => {\n const originalShipments = queryClient.getQueryData([\n 'loads',\n activeLoad,\n 'OSND',\n 'Overage',\n ]);\n\n const original_overage_count = queryClient.getQueryData<{\n overages: number;\n shortages: number;\n damages: number;\n }>(['osd-count', 'carrier', activeLoad]);\n\n const newExceptionId = exception_id;\n\n const updatedShipments = originalShipments?.map((shipment) => {\n if (shipment.tracking_id === tracking_id) {\n shipment.resolution = store_ref;\n shipment.resolved_at = new Date();\n shipment.is_unrecognized = false;\n shipment.details = 'In-Area';\n shipment.scanned_by_first_name = user?.name.split(' ')[0];\n shipment.scanned_by_last_name = user?.name.split(' ')[1];\n\n if (newExceptionId) {\n shipment.exception_id = newExceptionId;\n }\n }\n return shipment;\n });\n\n try {\n if (exception_id === null) {\n const newException = await assignUnrecognizedToStore({\n store_ref,\n barcode: tracking_id,\n });\n // Update the exception_id in the shipment data after assigning\n updatedShipments?.forEach((shipment) => {\n if (shipment.tracking_id === tracking_id) {\n shipment.exception_id = newException.exception_id;\n shipment.shipment_id = newException.shipment_id;\n }\n });\n } else {\n await updateOverageStore({ shipment_id, store_ref, exception_id });\n }\n\n toast.toast({\n title: 'Success',\n description: `Successfully updated shipment ${tracking_id}`,\n variant: 'success',\n time: 6000,\n });\n\n queryClient.setQueryData(\n ['loads', activeLoad, 'OSND', 'Overage'],\n updatedShipments,\n );\n\n queryClient.setQueryData(['osd-count', 'carrier', activeLoad], {\n ...original_overage_count,\n overages: original_overage_count!.overages - 1,\n });\n } catch (error) {\n queryClient.setQueryData(\n ['loads', activeLoad, 'OSND', 'Overage'],\n originalShipments,\n );\n\n toast.toast({\n title: 'Error',\n description: `Could not update shipment ${tracking_id}. If issue persists, please contact support.`,\n variant: 'error',\n time: 6000,\n });\n\n throw error;\n }\n },\n );\n}\n","/***\n * \n * \n * export type Store = {\n id: string;\n store_ref: string;\n store_name: string;\n city: string;\n state: string;\n display_string: string;\n};\n */\n\nimport {\n FetchStoresParams,\n fetchStores,\n} from '@/data/SupabaseRequests/warehouse-webapp-api/_index';\nimport { Store } from '../_models';\n\nexport async function fetchStoresWrapper(\n params: Omit,\n): Promise {\n const stores = await fetchStores(params);\n\n const storeCards: Store[] = stores.map((store) => {\n return {\n id: store.id,\n store_ref: store.store_ref,\n store_name: store.store_name,\n city: store.city,\n state: store.state,\n display_string: store.display_string,\n };\n });\n\n return storeCards;\n}\n","/* eslint-disable array-callback-return */\n/* eslint-disable react-hooks/exhaustive-deps */\nimport React, { useState } from 'react';\nimport { ChevronsUpDown } from 'lucide-react';\nimport {\n Popover,\n PopoverContent,\n PopoverTrigger,\n} from '@/components/primitives/Popover';\nimport { Button } from '@/components/primitives/Button';\nimport {\n Command,\n CommandEmpty,\n CommandGroup,\n CommandInput,\n CommandItem,\n CommandSeparator,\n} from '@/components/primitives/Command';\nimport { useQuery } from 'react-query';\nimport { OSDShipment, Store } from '../../../_models';\nimport { useAuth } from '@/data/auth';\nimport { useAssignToStore } from '../mutations/updateOverageExceptions';\nimport { fetchStoresWrapper } from '@/pages/warehouse/FactoryFunctions/fetchStores';\n\ntype Props = {\n osdShipment: OSDShipment;\n placeholder?: string;\n};\n\n/**\n * Search and Select user for Route Schedule\n * @param param0\n * @returns React component\n */\nexport function OverageStoreSelector({ osdShipment, placeholder }: Props) {\n const { mutate: updateOverageExceptions } = useAssignToStore();\n const { user } = useAuth();\n const [open, setOpen] = useState(false);\n const [search, setSearch] = useState('');\n const [value, setValue] = useState('');\n\n const { data: stores } = useQuery({\n queryKey: ['stores', osdShipment.load_id],\n queryFn: () => fetchStoresWrapper({ load_id: osdShipment.load_id }),\n enabled: open,\n });\n const handleSelect = async (\n currentValue: string,\n store_id: string,\n store_ref: string,\n ) => {\n const selectedValue = currentValue === value ? '' : store_id;\n setValue(selectedValue);\n if (currentValue !== value) {\n updateOverageExceptions({\n exception_id: osdShipment.exception_id || null,\n tracking_id: osdShipment.tracking_id,\n store_id: store_id,\n store_ref: store_ref,\n shipment_id: osdShipment.shipment_id,\n });\n }\n setSearch('');\n setOpen(false);\n };\n\n const filtered_stores = stores?.filter((entry) =>\n entry.store_ref.toLowerCase().includes(search.toLowerCase()),\n );\n\n return (\n \n \n \n

\n {value\n ? stores?.find((entry) => entry.id === value)?.display_string\n : placeholder || 'Select option...'}\n

\n \n \n
\n \n \n setOpen(true)}\n onValueChange={(e) => setSearch(e)}\n />\n {open && No results found.}\n {open && (\n \n {filtered_stores?.map((entry) => (\n
\n \n handleSelect(currentValue, entry.id, entry.store_ref)\n }\n >\n {entry.display_string}\n \n \n
\n ))}\n
\n )}\n
\n
\n
\n );\n}\n","/* eslint-disable react/jsx-no-useless-fragment */\nimport {\n MenubarContent,\n MenubarItem,\n MenubarSeparator,\n MenubarSub,\n MenubarSubContent,\n MenubarSubTrigger,\n} from '@/components/primitives/Menubar';\nimport { OSDShipment } from '../../../_models';\nimport { OverageStoreSelector } from './OverageStoreSelector';\nimport { useUpdateOverageExceptions } from '../mutations/updateOverageExceptions';\n\ntype Props = {\n osdShipment: OSDShipment;\n};\n\n/**\n * Resolve overage exceptions menu for a shipment\n * @param param0\n * @returns React component\n */\nexport function OverageResolutions({ osdShipment }: Props) {\n const { mutate: updateOverageExceptions } = useUpdateOverageExceptions();\n\n const handleClick = async (resolution: string) => {\n updateOverageExceptions({\n exception_id: osdShipment.exception_id + '',\n tracking_id: osdShipment.tracking_id,\n shipment_id: osdShipment.shipment_id,\n resolution: resolution,\n });\n };\n\n return (\n <>\n \n \n Assign to Store\n\n \n \n \n \n \n {!osdShipment.is_unrecognized && (\n <>\n handleClick('Hold')}>\n Holding\n \n \n handleClick('Returning to Shipper')}>\n Returning To Shipper\n \n \n \n )}\n handleClick('Bad Scan')}>\n Bad Scan\n \n \n \n );\n}\n","import { useMutation, useQueryClient } from 'react-query';\nimport { OSDShipment } from '../../../_models';\nimport { useToast } from '@/components/primitives/useToast';\nimport { resolveMissing } from '@/data/SupabaseRequests/warehouse-webapp-api/_index';\n\n/**\n * Mutation for updating missing exception\n * Calls warehouse-webapi endpoint to update the exception\n * @returns useMutation\n */\nexport function useUpdateMissingShipment() {\n const toast = useToast();\n const queryClient = useQueryClient();\n\n return useMutation(\n async ({\n shipment_id,\n exception_id,\n tracking_id,\n resolution,\n load_id,\n }: {\n shipment_id: string;\n exception_id: string;\n tracking_id: string;\n resolution: string;\n load_id: string;\n }): Promise => {\n const originalShipments = queryClient.getQueryData([\n 'loads',\n load_id,\n 'OSND',\n 'Shortages',\n ]) as OSDShipment[] | undefined;\n\n const original_shortage_count = queryClient.getQueryData([\n 'osd-count',\n 'carrier',\n load_id,\n ]) as { overages: number; shortages: number; damages: number };\n\n const shortageCount = original_shortage_count?.shortages;\n\n const updatedShipments = originalShipments\n ?.map((shipment: OSDShipment) => {\n if (shipment.exception_id === exception_id) {\n shipment.resolution = resolution;\n shipment.resolved_at = new Date();\n }\n return shipment;\n })\n .sort((a, b) => {\n if (a.resolution === null || a.resolution === '') {\n return -1;\n }\n if (b.resolution === null || b.resolution === '') {\n return 1;\n }\n return 0;\n });\n\n queryClient.setQueryData(\n ['osd-shipments', load_id, 'Shortages'],\n updatedShipments,\n );\n\n try {\n await resolveMissing({ shipment_id, exception_id, resolution });\n\n toast.toast({\n title: 'Success',\n description: `Successfully updated shipment ${tracking_id}`,\n variant: 'success',\n time: 6000,\n });\n\n queryClient.setQueryData(\n ['osd-shipments', load_id, 'Shortages'],\n updatedShipments,\n );\n queryClient.setQueryData(['osd-count', 'carrier', load_id], {\n overages: original_shortage_count?.overages,\n shortages: shortageCount - 1,\n damages: original_shortage_count?.damages,\n });\n } catch (error) {\n queryClient.setQueryData(\n ['osd-shipments', load_id, 'Shortages'],\n originalShipments,\n );\n\n toast.toast({\n title: 'Error',\n description: `Could not update shipment ${tracking_id}. If issue persists, please contact support.`,\n variant: 'error',\n time: 6000,\n });\n throw error;\n }\n },\n );\n}\n","import {\n MenubarContent,\n MenubarItem,\n MenubarSeparator,\n} from '@/components/primitives/Menubar';\nimport { OSDShipment } from '../../../_models';\nimport { useUpdateMissingShipment } from '../mutations/updateMissingExceptions';\nimport { useQueryClient } from 'react-query';\n\ntype Props = {\n osdShipment: OSDShipment;\n};\n\n/**\n * Missing shipment resolution menu\n * @param param0\n * @returns React MenubarContent Component\n */\nexport function MissingResolutions({ osdShipment }: Props) {\n const queryClient = useQueryClient();\n\n const { mutate: updateMissingShipment } = useUpdateMissingShipment();\n const handleClick = (resolution: string) => {\n updateMissingShipment({\n shipment_id: osdShipment.shipment_id,\n exception_id: osdShipment.exception_id + '',\n tracking_id: osdShipment.tracking_id,\n resolution,\n load_id: osdShipment.load_id,\n });\n queryClient.invalidateQueries(['osd-count']);\n };\n\n return (\n \n handleClick('Shipment Found')}>\n Shipment Found\n \n \n handleClick('Shipment Missing')}>\n Missing\n \n \n );\n}\n","import { useMutation, useQueryClient } from 'react-query';\nimport { OSDShipment } from '../../../_models';\nimport { useToast } from '@/components/primitives/useToast';\nimport { resolveDamaged } from '@/data/SupabaseRequests/warehouse-webapp-api/resolveDamaged';\n\n/**\n * Mutation for updating damaged exception\n * Calls warehouse-webapi endpoint to update the exception\n * @returns useMutation\n */\nexport function useUpdateDamagedExceptions() {\n const toast = useToast();\n const queryClient = useQueryClient();\n\n return useMutation(\n async ({\n shipment_id,\n tracking_id,\n exception_id,\n resolution,\n load_id,\n }: {\n shipment_id: string;\n tracking_id: string;\n exception_id: string;\n resolution: string;\n load_id: string;\n }) => {\n const originalShipments = queryClient.getQueryData([\n 'osd-shipments',\n load_id,\n 'Damages',\n ]) as OSDShipment[] | undefined;\n\n const updatedShipments = originalShipments\n ?.map((shipment: OSDShipment) => {\n if (shipment.exception_id === exception_id) {\n shipment.resolution = resolution;\n shipment.resolved_at = new Date();\n }\n return shipment;\n })\n .sort((a, b) => {\n if (a.resolution === null || a.resolution === '') {\n return -1;\n }\n if (b.resolution === null || b.resolution === '') {\n return 1;\n }\n return 0;\n });\n queryClient.invalidateQueries(['unresolved-osd-shipments']);\n\n queryClient.setQueryData(\n ['osd-shipments', load_id, 'Damages'],\n updatedShipments,\n );\n\n try {\n await resolveDamaged({ shipment_id, exception_id, resolution });\n\n toast.toast({\n title: 'Success',\n description: `Successfully updated shipment ${tracking_id}`,\n variant: 'success',\n time: 6000,\n });\n\n queryClient.invalidateQueries(['unresolved-osd-shipments']);\n\n queryClient.setQueryData(\n ['osd-shipments', load_id, 'Damages'],\n updatedShipments,\n );\n } catch (error) {\n queryClient.setQueryData(\n ['osd-shipments', load_id, 'Damages'],\n originalShipments,\n );\n\n toast.toast({\n title: 'Error',\n description: `Could not update shipment ${tracking_id}. If issue persists, please contact support.`,\n variant: 'error',\n time: 6000,\n });\n throw error;\n }\n },\n );\n}\n","import {\n MenubarContent,\n MenubarItem,\n MenubarSeparator,\n} from '@/components/primitives/Menubar';\nimport { OSDShipment } from '../../../_models';\nimport { useUpdateDamagedExceptions } from '../mutations/updateDamagedExceptions';\nimport { useQueryClient } from 'react-query';\n\ntype Props = {\n osdShipment: OSDShipment;\n};\n\n/**\n * Handle damaged exception resolutions menu\n * @param param0\n * @returns\n */\nexport function DamagedResolutions({ osdShipment }: Props) {\n const queryClient = useQueryClient();\n const { mutate: updateDamagedExceptions } = useUpdateDamagedExceptions();\n\n const handleClick = (resolution: string) => {\n updateDamagedExceptions({\n shipment_id: osdShipment.shipment_id,\n exception_id: osdShipment.exception_id + '',\n tracking_id: osdShipment.tracking_id,\n resolution,\n load_id: osdShipment.load_id,\n });\n queryClient.invalidateQueries(['osd-count']);\n };\n\n return (\n \n handleClick('Not Damaged')}>\n Not Damaged\n \n \n handleClick('Delivering Damaged')}>\n Delivering Damaged\n \n \n handleClick('Disposed')}>\n Disposed\n \n \n );\n}\n","//hover:text-slate-300 hover:scale-125 cursor-pointer\n\nimport { OSDShipment } from '@/pages/warehouse/_models';\nimport { LUDate } from '@/common/classes/LUDate';\nimport {\n Menubar,\n MenubarMenu,\n MenubarTrigger,\n} from '@/components/primitives/Menubar';\nimport { OverageResolutions } from './OverageResolutions';\nimport { MissingResolutions } from './MissingResolutions';\nimport { DamagedResolutions } from './DamagedResolutions';\n\ntype Props = {\n shipment: OSDShipment;\n type: 'Overage' | 'Damaged' | 'Missing';\n};\n\n/**\n * Overage shipment Row\n * Contains data on the unrecognized scan\n * Has two options: Delete unrecognized scan\n * OR add barcode as a shipment and assign it to a store\n * @param param0\n * @returns\n */\nexport function CarrierShipmentRow({ shipment, type }: Props) {\n return (\n \n
\n \n \n \n {shipment.resolution ? 'Resolved' : 'Unresolved'}\n \n {type === 'Overage' && (\n \n )}\n {type === 'Missing' && (\n \n )}\n {type === 'Damaged' && (\n \n )}\n \n \n
\n
{shipment.tracking_id}
\n\n
{shipment.details}
\n
\n {shipment.resolution ? shipment.resolution : 'None'}\n
\n\n
\n {new LUDate(shipment.created_at).asHTMLInputValue()}\n
\n
\n {shipment.scanned_by_first_name\n ? shipment.scanned_by_first_name.charAt(0) +\n '. ' +\n shipment.scanned_by_last_name\n : 'N/A'}\n
\n \n );\n}\n","//hover:text-slate-300 hover:scale-125 cursor-pointer\n\nimport { OSDShipment } from '@/pages/warehouse/_models';\nimport { LUDate } from '@/common/classes/LUDate';\n\ntype Props = {\n shipment: OSDShipment;\n type: 'Overage' | 'Damaged' | 'Missing';\n};\n\n/**\n * Overage shipment Row\n * Contains data on the unrecognized scan\n * Has two options: Delete unrecognized scan\n * OR add barcode as a shipment and assign it to a store\n * @param param0\n * @returns\n */\nexport function ShipperShipmentRow({ shipment, type }: Props) {\n return (\n \n
{shipment.tracking_id}
\n\n
{shipment.details}
\n
\n {shipment.resolution ? shipment.resolution : 'None'}\n
\n\n
\n {new LUDate(shipment.created_at).asHTMLInputValue()}\n
\n \n );\n}\n","/**\n * \n * @param Omit export type OSDShipment = {\n type: string;\n exception_id?: string;\n details: string;\n shipment_id: string;\n tracking_id: string;\n created_at: Date;\n scanned_by_first_name?: string;\n scanned_by_last_name?: string;\n resolved_at: Date | null;\n resolution: string | null;\n load_id: string;\n is_unrecognized: boolean;\n};\n * @param \n * @param FetchOSDByTypeParams \n * @param */\nimport {\n FetchOSDByTypeParams,\n fetchOSDByType,\n} from '@/data/SupabaseRequests/warehouse-webapp-api/_index';\nimport { OSDShipment } from '../_models';\n\nexport async function fetchOSDByTypeWrapper(\n params: Omit,\n): Promise {\n const osdShipments = await fetchOSDByType(params);\n\n const osdShipmentCards: OSDShipment[] = osdShipments.map((osdShipment) => {\n return {\n type: osdShipment.type,\n exception_id: osdShipment.exception_id,\n details: osdShipment.details,\n shipment_id: osdShipment.shipment_id,\n tracking_id: osdShipment.tracking_id,\n created_at: new Date(osdShipment.created_at),\n scanned_by_first_name: osdShipment.scanned_by_first_name,\n scanned_by_last_name: osdShipment.scanned_by_last_name,\n resolved_at: osdShipment.resolved_at\n ? new Date(osdShipment.resolved_at)\n : null,\n resolution: osdShipment.resolution,\n load_id: osdShipment.load_id || '', // Ensure load_id is always a string\n is_unrecognized: osdShipment.is_unrecognized,\n };\n });\n\n return osdShipmentCards;\n}\n","import { CarrierShipmentRow } from './CarrierShipmentRow';\nimport { OSDShipment } from '@/pages/warehouse/_models';\nimport { ShipperShipmentRow } from './ShipperShipmentRow';\nimport { Loading } from '@/layout/Loading';\nimport { Card } from '@/components/primitives/Card';\nimport { useQuery } from 'react-query';\nimport { useAuth } from '@/data/auth';\nimport { fetchOSDByTypeWrapper } from '@/pages/warehouse/FactoryFunctions/fetchOSDByType';\n\ntype Props = {\n type: 'Overage' | 'Damaged' | 'Missing';\n load_id: string;\n};\n\n/**\n * Renders the header for the unrecognized shipments table\n * @returns React Component\n */\nexport function OSDTable({ type, load_id }: Props) {\n const { user } = useAuth();\n const org_type = user?.org_type;\n\n const { data: shipments, isLoading } = useQuery({\n queryKey: ['loads', load_id, 'OSND', type],\n queryFn: () => fetchOSDByTypeWrapper({ load_id, type }),\n enabled: load_id !== '',\n });\n\n return (\n \n
\n {' '}\n {/* Ensure a fixed minimum width */}\n
\n
\n {org_type === 'carrier' && (\n
{type}
\n )}\n \n Tracking ID\n
\n \n Details\n
\n \n Resolution\n
\n \n Created At\n \n {org_type === 'carrier' && (\n
Reported By
\n )}\n \n \n {isLoading ? (\n \n ) : (\n
\n {shipments && shipments.length > 0 ? (\n shipments.map((shipment) => (\n
\n {org_type === 'shipper' ? (\n \n ) : (\n \n )}\n
\n ))\n ) : (\n
\n {`No ${type}`}\n
\n )}\n
\n )}\n \n
\n );\n}\n","/**\n * Mutation for updating the load state to 'Arrived'\n * @returns useMutation\n */\nimport { useMutation, useQueryClient } from 'react-query';\nimport { useWarehouseContext } from '../../WarehouseURLContext.js';\nimport { LoadQueryResponseData } from '../../_models.js';\nimport { ArriveLoadData } from '../../WarehouseApi/types/index.js';\nimport {\n arriveLoad,\n beginSort,\n completeSort,\n createStops,\n} from '@/data/SupabaseRequests/warehouse-webapp-api/_index.js';\nimport { useAuth } from '@/data/auth.js';\n\nexport function useUpdateLoadStateArrived() {\n const queryClient = useQueryClient();\n const { stations } = useAuth();\n const { showCompleted } = useWarehouseContext();\n\n return useMutation(\n async ({ updatedFields }: { updatedFields: ArriveLoadData }) => {\n const load_id = updatedFields.load_id;\n const state = updatedFields.state;\n\n const originalLoads: LoadQueryResponseData[] | undefined =\n queryClient.getQueryData(['loads', stations, showCompleted]);\n\n const updatedLoads = originalLoads?.map((load: LoadQueryResponseData) => {\n if (load.id === load_id) {\n load.state = state as\n | 'Building'\n | 'Ready To Load'\n | 'Loading'\n | 'Loaded'\n | 'In Transit'\n | 'Arrived'\n | 'Unloading'\n | 'Completed';\n }\n return load;\n });\n\n try {\n await arriveLoad({\n load_id: load_id,\n state: state,\n trailer_id: updatedFields.trailer_id,\n seal_num: updatedFields.seal_num,\n date_of_arrival: updatedFields.date_of_arrival.toISOString(),\n // Use the date provided\n door_number: updatedFields.door_number,\n notes: updatedFields.notes,\n });\n await createStops({\n loadId: load_id,\n });\n\n queryClient.setQueryData(\n ['loads', stations, showCompleted],\n updatedLoads,\n );\n } catch (error) {\n queryClient.setQueryData(\n ['loads', stations, showCompleted],\n originalLoads,\n );\n throw error;\n }\n },\n );\n}\n\nexport function useUpdateStateOfLoad() {\n const queryClient = useQueryClient();\n const { stations } = useAuth();\n const { showCompleted } = useWarehouseContext();\n\n return useMutation(\n async ({ load_id, state }: { load_id: string; state: string }) => {\n const originalLoads: LoadQueryResponseData[] | undefined =\n queryClient.getQueryData(['loads', stations, showCompleted]);\n\n const updatedLoads = originalLoads?.map((load: LoadQueryResponseData) => {\n if (load.id === load_id) {\n load.state = state as\n | 'Building'\n | 'Ready To Load'\n | 'Loading'\n | 'Loaded'\n | 'In Transit'\n | 'Arrived'\n | 'Unloading'\n | 'Completed';\n }\n return load;\n });\n\n try {\n if (state === 'Completed') {\n await completeSort({\n load_id: load_id,\n });\n } else if (state === 'Unloading') {\n await beginSort({\n load_id: load_id,\n });\n }\n\n queryClient.setQueryData(\n ['loads', stations, showCompleted],\n updatedLoads,\n );\n } catch (error) {\n queryClient.setQueryData(\n ['loads', stations, showCompleted],\n originalLoads,\n );\n throw error;\n }\n },\n );\n}\n","import { LUDate } from '@/common/classes/LUDate';\nimport { Weight } from '@/helpers/Weight';\nimport * as z from 'zod';\n\nexport type Station = {\n id: string;\n name: string;\n code?: string;\n location_id: number;\n};\n\nexport const scrollbarClassname =\n 'h-[80%] overflow-y-auto scrollbar scrollbar-track-slate-100 scrollbar-thumb-slate-200 hover:scrollbar-thumb-slate-300 scrollbar-thin ';\n\nexport type Load = {\n id: string;\n weight?: number | 0;\n source?: string;\n source_location_id?: number;\n state: string | null;\n name?: string;\n customer_name: string;\n estimated_arrival: LUDate;\n pieces: number;\n location_id: number;\n is_accepted?: boolean;\n trailer_id?: string;\n customer_abbreviation?: string;\n shortages?: number;\n scanned?: number;\n sort_id: number;\n};\n\nexport type ScanCount = {\n scanned: number;\n pieces: number;\n};\n\nexport type ShipmentExceptionType = {\n shipment_id: string;\n type: string;\n location_id: number;\n};\n\nexport type ASNShipment = {\n id: string;\n trackingID: string;\n weight: Weight;\n store_ref: string;\n store_id: string;\n destination_location_id: number;\n};\n\nexport type OSDShipment = {\n type: string;\n exception_id?: string;\n details: string;\n shipment_id: string;\n tracking_id: string;\n created_at: Date;\n scanned_by_first_name?: string;\n scanned_by_last_name?: string;\n resolved_at: Date | null;\n resolution: string | null;\n load_id: string;\n is_unrecognized: boolean;\n};\n\nexport type ShipmentID = {\n shipment_id: string;\n tracking_id: string;\n exception_id?: string;\n};\n\nexport type OSDCount = {\n overages: number;\n shortages: number;\n damages: number;\n};\n\nexport type Store = {\n id: string;\n store_ref: string;\n store_name: string;\n city: string;\n state: string;\n display_string: string;\n};\n\nexport type ResponseData = {\n data: number;\n error: string | null;\n};\n\nexport type ScanData = {\n overages: number;\n scanned: number;\n sort_id: number;\n shortages: number;\n total: number;\n};\n\nexport type DateRange = {\n start: LUDate;\n end: LUDate;\n};\n\nexport type LoadCard = {\n id: string;\n trailer_id: string;\n name: string;\n state:\n | 'Building'\n | 'Ready To Load'\n | 'Loading'\n | 'Loaded'\n | 'In Transit'\n | 'Arrived'\n | 'Unloading'\n | 'Completed';\n estimated_arrival: LUDate;\n actual_arrival: LUDate | null;\n loaded_shipments: number;\n unloaded_shipments: number;\n shortages: number;\n overages: number;\n rate: string;\n station_name: string;\n station_id: string;\n};\n\nexport type Shipment = {\n tracking_id: string;\n weight: string;\n store_ref_num: string;\n is_scanned: boolean;\n time_scanned: Date | null;\n load_arrived_at: Date;\n};\n\nexport type LoadData = {\n id: string;\n state: string;\n weight: number;\n trailer_id: string;\n estimated_arrival: LUDate;\n location_id: number;\n shipper_id: string;\n pieces: number;\n unloaded_shipments: number;\n store_count: number;\n};\n\nexport type LoadResponseData = {\n load: LoadData;\n shipments: Shipment[];\n};\n\nexport type OSND = {\n pieces: number;\n successful_scan_count: number;\n overage_shipments: number;\n shortages: number;\n};\n\nexport type LoadQueryResponseData = {\n id: string;\n pieces: number;\n total_weight: number;\n successful_scan_count: number;\n overage_shipments: number;\n shortages: number;\n trailer_id: string;\n name: string;\n abbreviation: string;\n state:\n | 'Building'\n | 'Ready To Load'\n | 'Loading'\n | 'Loaded'\n | 'In Transit'\n | 'Arrived'\n | 'Unloading'\n | 'Completed';\n estimated_arrival: LUDate;\n actual_arrival: LUDate | null;\n};\n\nexport type LoadSort = {\n sort_by: 'customer' | 'status' | 'arrival' | 'trailer';\n asc: boolean;\n};\n\nexport const sallyBeautyTemplate = {\n tracking_id: 'CartonID',\n reference_id_1: 'BOLNum',\n description: null,\n notes: null,\n weight: null,\n pieces: null,\n volume: null,\n dimension_large: null,\n dimension_medium: null,\n dimension_small: null,\n load_id: 'TrailerID',\n store_code: 'StoreNum',\n};\n\nexport type ImportShipment = {\n id: string;\n tracking_id: string;\n weight: number;\n store_location_id: number;\n carrier_name: string;\n store_ref_id: string;\n};\n\nexport type UploadedShipment = {\n trailer_id: string;\n tracking_id: string;\n store_id: string;\n sortcode: string;\n timestamp: string;\n acttrail: string;\n bol: string;\n errorType?: 'duplicate' | 'missing';\n};\n\nexport type LoadInfo = {\n id: string;\n date: LUDate;\n pieces: number;\n weight: number;\n unloaded_shipments: number;\n state: LoadInfoState;\n trailer: string;\n shortages?: number;\n overages?: number;\n rate: string;\n};\n\nexport type LoadInfoState =\n | 'Building'\n | 'Ready To Load'\n | 'Loading'\n | 'Loaded'\n | 'In Transit'\n | 'Arrived'\n | 'Unloading'\n | 'Completed';\n\nexport type ScanLine = {\n tracking_id: string;\n scan_type: string;\n timestamp: string;\n};\n\nexport type ScannedShipment = {\n id: string;\n tracking_id: string;\n scanned_at: string | null;\n};\n\nexport type ASN_COLUMN = {\n header_name: string;\n description: string;\n database_column: string;\n};\n\nexport const ASN_COLUMNS: ASN_COLUMN[] = [\n {\n header_name: 'Tracking ID',\n description: 'Unique identifier for tracking the carton.',\n database_column: 'tracking_id',\n },\n {\n header_name: 'Weight',\n description: 'Total weight of the carton.',\n database_column: 'weight',\n },\n {\n header_name: 'Store',\n description: 'The destination store for the carton.',\n database_column: 'store',\n },\n {\n header_name: 'Trailer Name',\n description: 'Name of the trailer carrying the frieght.',\n database_column: 'trailer_name',\n },\n {\n header_name: 'Time Loaded',\n description: 'The time when the cartons was loaded onto the trailer.',\n database_column: 'loaded_at',\n },\n {\n header_name: 'BOL',\n description:\n 'Bill of Lading - document issued by a carrier to acknowledge receipt of cargo.',\n database_column: 'bol',\n },\n {\n header_name: 'Expected Arrival',\n description: 'The estimated time of arrival for the load.',\n database_column: 'expected_arrival',\n },\n];\n\nexport const addTemplateFormSchema = z.object({\n template_name: z.string(),\n tracking_id: z.string(),\n station_id: z.string(),\n weight: z.string().optional(),\n store: z.string(),\n trailer_name: z.string().optional(),\n loaded_at: z.string().optional(),\n bol: z.string().optional(),\n expected_arrival: z.string().optional(),\n weight_unit: z.string().optional(),\n});\n","import { ShipmentID } from '../../_models';\n\ntype Props = {\n shipment_id: ShipmentID;\n};\n\n/**\n * Unscanned shipment row\n * @param param0\n * @returns\n */\nexport function MissingRow({ shipment_id }: Props) {\n return (\n \n
{shipment_id.tracking_id}
\n \n );\n}\n","import { Loading } from '@/layout/Loading';\nimport { ShipmentID, scrollbarClassname } from '../../_models';\nimport { MissingRow } from './MissingRow';\n\ntype Props = {\n shipment_ids: ShipmentID[];\n isLoading: boolean;\n};\n\n/**\n * Displays shipments that were not scanned during sort\n * @param param0\n * @returns React component\n */\nexport function MissingShipments({ shipment_ids, isLoading }: Props) {\n return (\n
\n

\n Unscanned Shipments to be marked as missing\n

\n {isLoading ? (\n \n ) : (\n \n {shipment_ids && shipment_ids.length > 0 ? (\n shipment_ids.map((shipment) => (\n \n ))\n ) : (\n
\n {'No Missing Shipments'}\n
\n )}\n
\n )}\n \n );\n}\n","import { OSDShipment } from '@/pages/warehouse/_models';\nimport {\n Menubar,\n MenubarMenu,\n MenubarTrigger,\n} from '@/components/primitives/Menubar';\nimport { OverageResolutions } from '../os&d_view/osnd_table/OverageResolutions';\nimport { DamagedResolutions } from '../os&d_view/osnd_table/DamagedResolutions';\nimport { MissingResolutions } from '../os&d_view/osnd_table/MissingResolutions';\n\ntype Props = {\n shipment: OSDShipment;\n};\n\n/**\n * Unresolved shipment Row\n * Contains data on unresolved shipment exception\n * @param param0\n * @returns React component\n */\nexport function UnresolvedExceptionRow({ shipment }: Props) {\n return (\n \n
\n \n \n \n {'Unresolved'}\n \n {shipment.type === 'Overage' && (\n \n )}\n {shipment.type === 'Missing' && (\n \n )}\n {shipment.type === 'Damaged' && (\n \n )}\n \n \n
\n
{shipment.tracking_id}
\n
{shipment.details}
\n\n
\n {shipment.scanned_by_first_name\n ? shipment.scanned_by_first_name.charAt(0) +\n '. ' +\n shipment.scanned_by_last_name\n : 'N/A'}\n
\n \n );\n}\n","import { Loading } from '@/layout/Loading';\nimport { OSDShipment, scrollbarClassname } from '../../_models';\nimport { UnresolvedExceptionRow } from './UnresolvedExceptionRow';\n\ntype Props = {\n osdShipments: OSDShipment[];\n isLoading: boolean;\n};\n\n/**\n * Unresolved excpetions header for OS&D shipments\n * Displayed when a sort is being closed out\n * @param param0\n * @returns React component\n */\nexport function UnresolvedExceptionHeader({ osdShipments, isLoading }: Props) {\n return (\n
\n

\n Unresolved OS&D Shipments\n

\n
\n
Action
\n
Tracking ID
\n
Details
\n
Reported By
\n
\n {isLoading ? (\n \n ) : (\n \n {osdShipments && osdShipments.length > 0 ? (\n osdShipments.map((shipment, index) => (\n \n ))\n ) : (\n
\n {'No Unresolved Shipments'}\n
\n )}\n
\n )}\n \n );\n}\n","import {\n FetchUnresolvedOSNDShipmentsParams,\n fetchUnresolvedOSNDShipments,\n} from '@/data/SupabaseRequests/warehouse-webapp-api/fetchUnresolvedOSNDShipments';\nimport { Fetch } from '@supabase/supabase-js/dist/module/lib/types';\nimport { OSDShipment } from '../_models';\n\n/**\n * \n * export type OSDShipment = {\n type: string;\n exception_id?: string;\n details: string;\n shipment_id: string;\n tracking_id: string;\n created_at: Date;\n scanned_by_first_name?: string;\n scanned_by_last_name?: string;\n resolved_at: Date | null;\n resolution: string | null;\n load_id: string;\n is_unrecognized: boolean;\n};\n */\n\nexport async function fetchUnresolvedOSNDShipmentsWrapper(\n params: Omit,\n): Promise {\n const data = await fetchUnresolvedOSNDShipments(params);\n\n const shipments: OSDShipment[] = data.map((shipment) => {\n return {\n type: shipment.type,\n exception_id: shipment.exception_id,\n details: shipment.details,\n shipment_id: shipment.shipment_id,\n tracking_id: shipment.tracking_id,\n created_at: new Date(shipment.created_at),\n scanned_by_first_name: shipment.scanned_by_first_name,\n scanned_by_last_name: shipment.scanned_by_last_name,\n resolved_at: shipment.resolved_at ? new Date(shipment.resolved_at) : null,\n resolution: shipment.resolution,\n load_id: shipment.load_id,\n is_unrecognized: shipment.is_unrecognized,\n };\n });\n return shipments;\n}\n","import React, { useState } from 'react';\nimport { useQuery } from 'react-query';\nimport { ActiveComponent } from '../../WarehouseURLContext';\nimport { Button } from '@/components/primitives/Button';\nimport { useUpdateStateOfLoad } from '../../CarrierWarehouse/functions/updateLoadState';\nimport { MissingShipments } from './MissingShipments';\nimport { UnresolvedExceptionHeader } from './UnresolvedExceptionHeader';\nimport { fetchUnresolvedOSNDShipments } from '@/data/SupabaseRequests/warehouse-webapp-api/fetchUnresolvedOSNDShipments';\nimport { fetchUnscannedShipments } from '@/data/SupabaseRequests/warehouse-webapp-api/_index';\nimport { fetchUnresolvedOSNDShipmentsWrapper } from '../../FactoryFunctions/fetchUnresolvedOSNDShipments';\n\ntype Props = {\n load: { id: string; trailer_id: string };\n setActiveComponent: (component: ActiveComponent) => void;\n};\n\nexport function CompleteSort({ load, setActiveComponent }: Props) {\n const { mutate } = useUpdateStateOfLoad();\n const [step, setStep] = useState(1);\n\n const { data: unresolved, isLoading: unresolvedLoading } = useQuery({\n queryKey: ['unresolved-osd-shipments', load.id + ''],\n queryFn: () => fetchUnresolvedOSNDShipmentsWrapper({ load_id: load.id }),\n });\n\n const { data: unscanned, isLoading: unscannedLoading } = useQuery({\n queryKey: ['unscanned-shipments', load.id + ''],\n queryFn: () => fetchUnscannedShipments({ load_id: load.id }),\n });\n\n const handleCompleteLoadClick = async () => {\n mutate({ load_id: load.id, state: 'Completed' });\n setActiveComponent(null);\n };\n\n return (\n
\n
\n {step === 1 && (\n
\n
\n \n
\n
\n )}\n {step === 2 && (\n
\n
\n \n
\n
\n )}\n
\n
\n {step === 1 && (\n
\n \n
\n )}\n {step === 2 && (\n
\n setStep(1)}\n disabled={unscannedLoading || unresolvedLoading}\n variant={'cancel'}\n >\n Back\n \n handleCompleteLoadClick()}\n disabled={unscannedLoading || unresolvedLoading}\n >\n End Sort\n \n
\n )}\n
\n
\n );\n}\n","import { z } from 'zod';\nimport { zodResolver } from '@hookform/resolvers/zod';\nimport { useForm } from 'react-hook-form';\nimport {\n Form,\n FormControl,\n FormField,\n FormItem,\n FormLabel,\n FormMessage,\n} from '@/components/primitives/Form';\nimport { Input } from '@/components/primitives/Input';\nimport { Button } from '@/components/primitives/Button';\nimport { useUpdateLoadStateArrived } from '../CarrierWarehouse/functions/updateLoadState';\nimport { ArriveLoadData } from '../WarehouseApi/types';\nimport { ActiveComponent } from '../WarehouseURLContext';\nimport { LUDate } from '@/common/classes/LUDate';\n\ntype Props = {\n load: { id: string; trailer_id: string };\n setComponent: (component: ActiveComponent) => void;\n};\n\n/**\n * Fomr for updating the load state to arrived\n * @param param0\n * @returns React form component\n */\nexport function LoadArrivedForm({ load, setComponent }: Props) {\n const { mutate } = useUpdateLoadStateArrived();\n\n const formSchema = z.object({\n trailer_id: z.string(),\n date_of_arrival: z.string(),\n seal_num: z.string(),\n notes: z.string().optional(),\n door_number: z.string(),\n });\n\n const form = useForm>({\n resolver: zodResolver(formSchema),\n defaultValues: {\n trailer_id: load ? load.trailer_id : '',\n date_of_arrival: new LUDate().toDateTimeLocalInputString(),\n seal_num: '',\n notes: '',\n door_number: '',\n },\n });\n\n async function onSubmit(data: z.infer) {\n const arriveLoadData: ArriveLoadData = {\n load_id: load.id + '',\n state: 'Arrived',\n trailer_id: data.trailer_id,\n seal_num: data.seal_num,\n date_of_arrival: new LUDate(data.date_of_arrival) ?? new LUDate(),\n notes: data.notes,\n door_number: data.door_number,\n };\n\n mutate({ updatedFields: arriveLoadData });\n\n //mutate({ updatedFields: arriveLoad });\n setComponent(null);\n }\n\n return (\n
\n
\n \n
\n
\n (\n \n \n {'Trailer ID'}\n \n \n \n \n \n \n )}\n />\n
\n
\n (\n \n \n {'Date of Arrival'}\n \n \n \n \n \n \n )}\n />\n
\n
\n (\n \n \n {'Seal #'}\n \n \n \n \n \n \n )}\n />\n
\n
\n (\n \n \n {'Door Number'}\n \n \n \n \n \n \n )}\n />\n
\n
\n (\n \n \n {'Arrival Notes'}\n \n \n \n \n \n \n )}\n />\n
\n
\n
\n \n
\n
\n \n
\n );\n}\n","import { LoadInfo } from '../_models';\nimport { ProgressBar } from '../Shared/ProgressBar';\nimport { OSDContainer } from '../Shared/os&d_view/OS&DContainer';\nimport { useAuth } from '@/data/auth';\nimport LoadShipments from './DetailedLoadViews/LoadShipments';\nimport { OSDTable } from '../Shared/os&d_view/osnd_table/OSDTable';\nimport { CompleteSort } from '../Shared/CompleteLoad/CompleteSort';\nimport { Button } from '@/components/primitives/Button';\nimport { LoadArrivedForm } from '../Shared/LoadArrivedForm';\nimport { useWarehouseContext } from '../WarehouseURLContext';\nimport { useUpdateStateOfLoad } from './functions/updateLoadState';\nimport { Card } from '@/components/primitives/Card';\n\ntype Props = {\n load_info: LoadInfo;\n};\n\nexport type ActiveComponent =\n | 'Load'\n | 'Overages'\n | 'Shortages'\n | 'Damages'\n | 'Complete'\n | 'Arrive'\n | 'Upload ASN'\n | null;\n\nexport default function CarrierLoadDataContainer({ load_info }: Props) {\n const { user } = useAuth();\n const { activeComponent, setActiveComponent } = useWarehouseContext();\n const { mutate } = useUpdateStateOfLoad();\n\n const progress =\n load_info.pieces === 0\n ? 0\n : ((load_info.unloaded_shipments / load_info.pieces) * 100).toFixed(2);\n\n const showProgressBar =\n (!!progress && load_info.state === 'Unloading') ||\n load_info.state === 'Completed';\n\n const showCompleteButton =\n load_info.state === 'Unloading' &&\n user?.org_type === 'carrier' &&\n activeComponent !== 'Complete';\n const showArrivedButton =\n load_info.state === 'In Transit' && user?.org_type === 'carrier';\n\n const showOSD =\n load_info.state === 'Completed' ||\n (load_info.state === 'Unloading' && user?.org_type === 'carrier');\n\n const changeComponent = (component: ActiveComponent) => {\n setActiveComponent(component);\n };\n\n return (\n
\n {/* Fixed header section */}\n
\n \n
\n {/* Header Section */}\n\n {/* Load Info Section */}\n
\n
\n {load_info.trailer}\n
\n
\n {load_info.pieces}  pcs\n
\n
\n {load_info.weight}{' '}\n  lbs\n
\n
\n {showProgressBar && (\n changeComponent('Load')}\n />\n )}\n
\n {/*
*/}\n {showOSD && (\n \n )}\n {/*
*/}\n\n {/* Button Section */}\n
\n {showCompleteButton && (\n changeComponent('Complete')}\n >\n Complete Sort\n \n )}\n {showArrivedButton && (\n
Arrive Load
\n )}\n {load_info.state === 'Arrived' && (\n \n mutate({ load_id: load_info.id, state: 'Unloading' })\n }\n >\n Start Load\n \n )}\n
\n
\n
\n
\n\n {/* Progress Bar */}\n
\n\n {/* Scrollable content */}\n
\n {activeComponent === 'Load' && (\n \n )}\n {activeComponent === 'Damages' && (\n \n )}\n {activeComponent === 'Shortages' && (\n \n )}\n {activeComponent === 'Overages' && (\n \n )}\n {activeComponent === 'Complete' && (\n \n )}\n {activeComponent === 'Arrive' && (\n \n )}\n
\n
\n );\n}\n","import {\n FetchCarrierLoadsParams,\n fetchCarrierLoads,\n} from '@/data/SupabaseRequests/warehouse-webapp-api/fetchCarrierLoads';\nimport { LoadCard } from '../_models';\nimport { LUDate } from '@/common/classes/LUDate';\n\n/**\n * \n * \n * type LoadCard = {\n id: string;\n trailer_id: string;\n name: string;\n abbreviation: string;\n state: 'Building' | 'Ready To Load' | 'Loading' | 'Loaded' | 'In Transit' | 'Arrived' | 'Unloading' | 'Completed';\n estimated_arrival: LUDate;\n actual_arrival: LUDate;\n loaded_shipments: number;\n unloaded_shipments: number;\n}\n * @returns \n */\nexport async function fetchCarrierLoadsWrapper(\n params: Omit,\n): Promise {\n const loads = await fetchCarrierLoads(params);\n\n console.log('loads', loads);\n\n const loadCards: LoadCard[] = loads.map((load) => {\n return {\n id: load.id,\n trailer_id: load.trailer_id,\n name: load.org_name ?? 'Error',\n state: load.state,\n estimated_arrival: new LUDate(load.estimated_arrival),\n actual_arrival: load.actual_arrival\n ? new LUDate(load.actual_arrival)\n : null,\n loaded_shipments: load.loaded_shipments,\n unloaded_shipments: load.unloaded_shipments,\n shortages: 0,\n overages: 0,\n rate: load.rate,\n station_id: load.station_id,\n station_name: load.station_name,\n };\n });\n\n return loadCards;\n}\n","/* eslint-disable react-hooks/exhaustive-deps */\nimport React from 'react';\nimport { LoadCard, LoadInfo } from '../_models';\nimport { useQuery } from 'react-query';\nimport { VertainerLeftCarrier } from './VertainerLeftCarrier';\nimport { LUDate } from '@/common/classes/LUDate';\nimport LoadDataContainer from './CarrierLoadDataContainer';\nimport { useWarehouseContext } from '../WarehouseURLContext';\nimport { fetchCarrierLoadsWrapper } from '../FactoryFunctions/fetchCarrierLoads';\nimport { v4 } from 'uuid';\nimport { useAuth } from '@/data/auth';\n\nexport function CarrierWarehouse() {\n const { activeLoad, showCompleted, setActiveLoad, setActiveComponent } =\n useWarehouseContext();\n\n const { stations } = useAuth();\n\n const {\n data: loads,\n isLoading: loadsLoading,\n error: loadsError,\n } = useQuery({\n queryKey: ['loads', stations, showCompleted],\n queryFn: () =>\n fetchCarrierLoadsWrapper({\n stations: stations,\n showCompleted,\n }),\n enabled: true, // Ensure this is always true to fetch data correctly\n });\n\n if (loads && activeLoad === '' && loads.length > 0) {\n setActiveLoad(loads[0].id);\n //get the load\n if (loads[0].state === 'In Transit') {\n setActiveComponent('Arrive');\n }\n setActiveComponent('Load');\n }\n\n function getLoadInfo(load_id: string): LoadInfo {\n const target_load = loads?.find((load) => load.id === load_id);\n if (target_load) {\n return {\n id: target_load.id,\n date: new LUDate(target_load.estimated_arrival),\n pieces: target_load.loaded_shipments,\n weight: target_load.loaded_shipments * 11,\n unloaded_shipments: target_load.unloaded_shipments,\n state: target_load.state,\n trailer: target_load.trailer_id,\n rate: target_load.rate,\n };\n } else {\n return {\n id: '',\n date: new LUDate(),\n pieces: 0,\n weight: 0,\n unloaded_shipments: 0,\n state: 'Building',\n trailer: '',\n rate: '0.00',\n };\n }\n }\n\n if (loadsError) {\n console.error('Error loading loads:', loadsError);\n return
Error loading loads: {String(loadsError)}
;\n }\n\n return (\n
\n
\n \n
\n {loads && loads.length > 0 && (\n \n \n
\n )}\n \n );\n}\n","import { LUDate } from '@/common/classes/LUDate';\nimport { useWarehouseContext } from '../../WarehouseURLContext';\nimport { LoadCard } from '../../_models';\nimport { StateBadge } from '../../Shared/StateBadge';\nimport { ProgressBar } from '../../Shared/ProgressBar';\nimport { OSDContainer } from '../../Shared/os&d_view/OS&DContainer';\n\ntype Props = {\n load: LoadCard;\n};\n\nexport function LeftLoadCard({ load }: Props) {\n const { activeLoad, setActiveLoad, setActiveComponent } =\n useWarehouseContext();\n\n const accuracy =\n load.loaded_shipments /\n (load.loaded_shipments + load.overages + load.shortages);\n return (\n {\n setActiveLoad(load.id);\n setActiveComponent('Load');\n }}\n className={`py-2 border-b-2 ${\n activeLoad === load.id\n ? ' '\n : ' hover:cursor-pointer hover:bg-lubackground-medium flex flex-col pl-4'\n }`}\n >\n
\n \n {load.trailer_id}\n \n \n {' '}\n {/* Hidden below md, visible above md */}\n {new LUDate(load.estimated_arrival).toString(true)}\n \n {load.name}\n\n \n {' '}\n {/* Hidden below md, visible above md */}\n \n \n
\n {load.state === 'Completed' && (\n
\n
\n \n
\n
\n
ASN Accuracy: {(accuracy * 100).toFixed(2)}%
\n
\n
\n )}\n \n );\n}\n","import { useState } from 'react';\nimport { LoadCard, LoadSort } from '../../_models';\nimport { LUDate } from '@/common/classes/LUDate';\n\nimport { Loading } from '@/layout/Loading';\nimport { Card } from '@/components/primitives/Card';\n\nimport { LeftLoadCard } from './LeftLoadCard';\nimport { LoadHeader } from '../../Shared/LoadHeader';\n\ntype Props = {\n loads: LoadCard[];\n isLoading: boolean;\n};\n\n/**\n * Container for load selcection, load display, and menu for controling load display and upload of ASN\n * @param param0\n * @returns React container component\n */\nexport default function VertainerLeft({ loads, isLoading }: Props) {\n const [station, setStation] = useState(null);\n const [sorting, setSorting] = useState({\n sort_by: 'arrival',\n asc: false,\n } as LoadSort);\n\n return (\n \n
\n\n
\n \n
\n
\n {isLoading ? (\n
\n \n
\n ) : (\n loadSorted(loads, sorting, station).map((load) => {\n return ;\n })\n )}\n
\n
\n );\n}\n\ntype LoadState =\n | 'Building'\n | 'Ready To Load'\n | 'Loading'\n | 'Loaded'\n | 'In Transit'\n | 'Arrived'\n | 'Unloading'\n | 'Completed';\n\n// Helper function to map state to a sortable numeric value based on simplified state\nfunction mapStateToSortableValue(state: LoadState): number {\n switch (state) {\n case 'Building':\n case 'Ready To Load':\n case 'Loading':\n case 'Loaded':\n case 'In Transit':\n return 1; // 'Incoming'\n case 'Arrived':\n return 2; // 'Arrived'\n case 'Unloading':\n return 3; // 'Sorting'\n case 'Completed':\n return 4; // 'Completed'\n default:\n return 5; // 'Unknown' (should not happen with proper types)\n }\n}\n\nfunction loadSorted(\n loads: LoadCard[],\n sorting: LoadSort,\n stationId: string | null,\n): LoadCard[] {\n if (stationId) {\n loads = loads.filter((load) => load.station_id === stationId);\n }\n if (sorting.sort_by === 'arrival') {\n return loads.sort((a, b) => {\n return sorting.asc\n ? new LUDate(a.estimated_arrival).isBefore(\n new LUDate(b.estimated_arrival),\n )\n ? -1\n : 1\n : new LUDate(a.estimated_arrival).isBefore(\n new LUDate(b.estimated_arrival),\n )\n ? 1\n : -1;\n });\n } else if (sorting.sort_by === 'trailer') {\n return loads.sort((a, b) => {\n return sorting.asc\n ? a.trailer_id.localeCompare(b.trailer_id)\n : b.trailer_id.localeCompare(a.trailer_id);\n });\n } else if (sorting.sort_by === 'customer') {\n return loads.sort((a, b) => {\n return sorting.asc\n ? a.name.localeCompare(b.name)\n : b.name.localeCompare(a.name);\n });\n } else if (sorting.sort_by === 'status') {\n return loads.sort((a, b) => {\n const stateValueA = mapStateToSortableValue(a.state);\n const stateValueB = mapStateToSortableValue(b.state);\n return sorting.asc\n ? stateValueA - stateValueB\n : stateValueB - stateValueA;\n });\n }\n return [];\n}\n","import { useAuth } from '@/data/auth';\nimport { LoadInfo } from '../../_models';\nimport { useWarehouseContext } from '../../WarehouseURLContext';\nimport { ProgressBar } from '../../Shared/ProgressBar';\nimport { OSDContainer } from '../../Shared/os&d_view/OS&DContainer';\nimport LoadShipments from '../../CarrierWarehouse/DetailedLoadViews/LoadShipments';\nimport { OSDTable } from '../../Shared/os&d_view/osnd_table/OSDTable';\nimport { CompleteSort } from '../../Shared/CompleteLoad/CompleteSort';\nimport { LoadArrivedForm } from '../../Shared/LoadArrivedForm';\nimport { Card } from '@/components/primitives/Card';\n\ntype Props = {\n load_info: LoadInfo;\n};\n\nexport type ActiveComponent =\n | 'Load'\n | 'Overages'\n | 'Shortages'\n | 'Damages'\n | 'Complete'\n | 'Arrive'\n | 'Upload ASN'\n | null;\n\nexport default function ShipperLoadDataContainer({ load_info }: Props) {\n const { user } = useAuth();\n const { activeComponent, setActiveComponent } = useWarehouseContext();\n\n const progress =\n load_info.pieces === 0\n ? 0\n : ((load_info.unloaded_shipments / load_info.pieces) * 100).toFixed(2);\n\n const asn_accuracy =\n load_info.pieces /\n (load_info.pieces +\n (load_info?.shortages ?? 0) +\n (load_info.overages ?? 0));\n\n const showOSD =\n load_info.state === 'Completed' ||\n (load_info.state === 'Unloading' && user?.org_type === 'carrier');\n\n const changeComponent = (component: ActiveComponent) => {\n setActiveComponent(component);\n };\n\n return (\n
\n \n
\n {/* Header Section */}\n
\n
Load Information
\n
\n\n {/* Load Info Section */}\n
\n
\n
Trailer:
\n
{load_info.trailer}
\n
\n
\n
Pieces:
\n
{load_info.pieces}
\n
\n
\n
Weight:
\n
{load_info.weight}
\n
\n {/* Button Section */}\n
\n
\n
\n
\n {/* Adjusted flex container */}\n\n changeComponent('Load')}\n />\n\n {showOSD && (\n \n )}\n
\n
\n {activeComponent === 'Load' && (\n \n )}\n {activeComponent === 'Damages' && (\n \n )}\n {activeComponent === 'Shortages' && (\n \n )}\n {activeComponent === 'Overages' && (\n \n )}\n {activeComponent === 'Complete' && (\n \n )}\n {activeComponent === 'Arrive' && (\n \n )}\n
\n
\n );\n}\n","import {\n FetchShipperLoadsParams,\n fetchShipperLoads,\n} from '@/data/SupabaseRequests/warehouse-webapp-api/fetchShipperLoads';\nimport { LoadCard } from '../_models';\nimport { LUDate } from '@/common/classes/LUDate';\n\nexport async function fetchShipperLoadsWrapper(\n params: Omit,\n): Promise {\n const loads = await fetchShipperLoads(params);\n\n const loadCards: LoadCard[] = loads.map((load) => {\n return {\n id: load.id,\n trailer_id: load.trailer_id,\n name: load.org_name ?? 'Error',\n state: load.state,\n estimated_arrival: new LUDate(load.estimated_arrival),\n actual_arrival: load.actual_arrival\n ? new LUDate(load.actual_arrival)\n : null,\n loaded_shipments: load.loaded_shipments,\n unloaded_shipments: load.unloaded_shipments,\n shortages: load.shortages,\n overages: load.overages,\n rate: 'N/A',\n station_id: load.station_id,\n station_name: load.station_name,\n };\n });\n\n return loadCards;\n}\n","import { VerifyASNResponse } from '@/data/SupabaseRequests/warehouse-webapp-api/verifyASN';\nimport React, { createContext, useState, ReactNode, useContext } from 'react';\n\n// Define the shape of the context state\ninterface UploadAsnContextType {\n csvData: Record[];\n setCSVData: React.Dispatch[]>>;\n headers: string[];\n setHeaders: React.Dispatch>;\n verified: boolean;\n setVerified: React.Dispatch>;\n outboundStation: string;\n setOutboundStation: React.Dispatch>;\n loading: boolean;\n setLoading: React.Dispatch>;\n verifiedData: VerifyASNResponse | null;\n setVerifiedData: React.Dispatch<\n React.SetStateAction\n >;\n station: string;\n setStation: React.Dispatch>;\n}\n\nconst UploadAsnContext = createContext({\n csvData: [],\n setCSVData: () => {},\n headers: [],\n setHeaders: () => {},\n verified: false,\n setVerified: () => {},\n outboundStation: '',\n setOutboundStation: () => {},\n loading: false,\n setLoading: () => {},\n verifiedData: null,\n setVerifiedData: () => {},\n station: '',\n setStation: () => {},\n});\n\nexport const useUploadAsn = () => {\n const {\n csvData,\n setCSVData,\n headers,\n setHeaders,\n verified,\n setVerified,\n outboundStation,\n setOutboundStation,\n loading,\n setLoading,\n verifiedData,\n setVerifiedData,\n station,\n setStation,\n } = useContext(UploadAsnContext);\n return {\n csvData,\n setCSVData,\n headers,\n setHeaders,\n verified,\n setVerified,\n outboundStation,\n setOutboundStation,\n loading,\n setLoading,\n verifiedData,\n setVerifiedData,\n station,\n setStation,\n };\n};\n\nexport const UploadAsnProvider = ({ children }: { children: ReactNode }) => {\n const [csvData, setCSVData] = useState[]>([]);\n const [station, setStation] = useState('');\n const [headers, setHeaders] = useState([]);\n const [verified, setVerified] = useState(false);\n const [loading, setLoading] = useState(false);\n const [outboundStation, setOutboundStation] = useState('');\n const [verifiedData, setVerifiedData] = useState(\n null,\n );\n\n return (\n \n {children}\n \n );\n};\n","import * as React from 'react';\nimport * as SelectPrimitive from '@radix-ui/react-select';\nimport { Check, ChevronDown, ChevronUp } from 'lucide-react';\n\nimport { cn } from '@/lib/utils';\n\nconst Select = SelectPrimitive.Root;\n\nconst SelectGroup = SelectPrimitive.Group;\n\nconst SelectValue = SelectPrimitive.Value;\n\nconst SelectTrigger = React.forwardRef<\n React.ElementRef,\n React.ComponentPropsWithoutRef\n>(({ className, children, ...props }, ref) => (\n span]:line-clamp-1',\n className,\n )}\n {...props}\n >\n {children}\n \n \n \n \n));\nSelectTrigger.displayName = SelectPrimitive.Trigger.displayName;\n\nconst SelectScrollUpButton = React.forwardRef<\n React.ElementRef,\n React.ComponentPropsWithoutRef\n>(({ className, ...props }, ref) => (\n \n \n \n));\nSelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName;\n\nconst SelectScrollDownButton = React.forwardRef<\n React.ElementRef,\n React.ComponentPropsWithoutRef\n>(({ className, ...props }, ref) => (\n \n \n \n));\nSelectScrollDownButton.displayName =\n SelectPrimitive.ScrollDownButton.displayName;\n\nconst SelectContent = React.forwardRef<\n React.ElementRef,\n React.ComponentPropsWithoutRef\n>(({ className, children, position = 'popper', ...props }, ref) => (\n \n \n \n \n {children}\n \n \n \n \n));\nSelectContent.displayName = SelectPrimitive.Content.displayName;\n\nconst SelectLabel = React.forwardRef<\n React.ElementRef,\n React.ComponentPropsWithoutRef\n>(({ className, ...props }, ref) => (\n \n));\nSelectLabel.displayName = SelectPrimitive.Label.displayName;\n\nconst SelectItem = React.forwardRef<\n React.ElementRef,\n React.ComponentPropsWithoutRef\n>(({ className, children, ...props }, ref) => (\n \n \n \n \n \n \n\n {children}\n \n));\nSelectItem.displayName = SelectPrimitive.Item.displayName;\n\nconst SelectSeparator = React.forwardRef<\n React.ElementRef,\n React.ComponentPropsWithoutRef\n>(({ className, ...props }, ref) => (\n \n));\nSelectSeparator.displayName = SelectPrimitive.Separator.displayName;\n\nexport {\n Select,\n SelectGroup,\n SelectValue,\n SelectTrigger,\n SelectContent,\n SelectLabel,\n SelectItem,\n SelectSeparator,\n SelectScrollUpButton,\n SelectScrollDownButton,\n};\n","import { verifyASN } from '@/data/SupabaseRequests/warehouse-webapp-api/verifyASN';\nimport React, { useEffect } from 'react';\nimport { useUploadAsn } from './UploadAsnContext';\nimport Papa from 'papaparse';\nimport { Input } from '@/components/primitives/Input';\nimport {\n Select,\n SelectContent,\n SelectItem,\n SelectTrigger,\n} from '@/components/primitives/Select';\nimport { useQuery } from 'react-query';\nimport { getStations } from '@/data/SupabaseRequests/webapp-api/getStations';\nimport { useAuth } from '@/data/auth';\n\nexport default function UploadFile() {\n const {\n setCSVData,\n setHeaders,\n loading,\n setLoading,\n setVerifiedData,\n station,\n setStation,\n } = useUploadAsn();\n\n const { user } = useAuth();\n\n const {\n data: stations,\n isLoading,\n isError,\n } = useQuery({\n queryKey: ['stations', user?.id],\n queryFn: () => getStations({}),\n });\n\n useEffect(() => {\n if (stations && stations.length > 0) {\n setStation(stations[0].id);\n }\n }, [stations]);\n\n const handleFileUpload = (event: React.ChangeEvent) => {\n const file = event.target.files?.[0];\n if (file) {\n Papa.parse(file, {\n header: true,\n transformHeader: (header) => header.trim(),\n skipEmptyLines: true,\n complete: async (results) => {\n const { data, meta } = results;\n if (!meta.fields) return;\n setCSVData(data as Record[]);\n setHeaders(meta.fields);\n setLoading(true); // Start loading\n setVerifiedData(null); // Reset verified data\n try {\n const result = await verifyASN({\n asn_data: data as Record[],\n headers: meta.fields,\n outbound_station_id: station,\n });\n setLoading(false); // End loading\n setVerifiedData(result);\n } catch (error) {\n console.error('Error:', error);\n setLoading(false); // End loading\n }\n },\n });\n }\n event.target.value = ''; // Reset the input\n };\n\n if (!stations) return null;\n return (\n
\n \n\n {stations?.length > 1 && (\n
\n {\n setStation(station);\n }}\n >\n \n {stations[0].name}\n \n \n {stations?.map((station: { id: string; name: string }) => (\n \n {station.name}\n \n ))}\n \n \n
\n )}\n
\n );\n}\n","import { Button } from '@/components/primitives/Button';\nimport { UploadASNResponse } from '@/data/SupabaseRequests/warehouse-webapp-api/_index';\nimport { insertTemplate } from '@/data/SupabaseRequests/warehouse-webapp-api/insertTemplate';\nimport { Loading } from '@/layout/Loading';\nimport { InfoIcon } from 'lucide-react';\nimport { useState } from 'react';\nimport { useUploadAsn } from './UploadAsnContext';\n\nexport type InsertTemplateParams = {\n tracking_id: string;\n weight?: number;\n store: string;\n trailer_name?: string;\n loaded_at?: string;\n bol: string;\n expected_arrival?: string;\n weight_unit?: string;\n station_id: string;\n};\n\nconst ROWS = 5;\n\n// Static list of required and optional headers\nconst fieldLabels = {\n tracking_id: 'Tracking ID',\n store: 'Store',\n weight: 'Weight',\n trailer_name: 'Trailer Name',\n loaded_at: 'Loaded At',\n bol: 'BOL',\n expected_arrival: 'Expected Arrival',\n};\n\nconst requiredFields = ['tracking_id', 'store', 'bol'];\n\ntype FieldLabelKeys = keyof typeof fieldLabels;\n\nexport default function AddTemplate() {\n const [headerMapping, setHeaderMapping] = useState>(\n {},\n );\n const [errorMessage, setErrorMessage] = useState(null);\n\n const { csvData, setVerifiedData, loading, setLoading, station } =\n useUploadAsn();\n\n if (csvData.length === 0) {\n return
No data available
;\n }\n\n const headers = Object.keys(csvData[0]);\n const rows = csvData.slice(0, ROWS);\n\n const handleHeaderChange = (\n e: React.ChangeEvent,\n header: string,\n ) => {\n setHeaderMapping({\n ...headerMapping,\n [header]: e.target.value,\n });\n setErrorMessage(null); // Clear error message on change\n };\n\n // Identify duplicate selections\n const selectedValues = Object.values(headerMapping);\n const duplicates = selectedValues.filter(\n (item, index) => selectedValues.indexOf(item) !== index && item !== '',\n );\n\n // Check for missing required fields\n const missingRequiredFields = requiredFields.filter(\n (field) =>\n !Object.values(headerMapping).includes(\n fieldLabels[field as FieldLabelKeys],\n ),\n );\n\n const handleSubmit = async () => {\n // Check if all required fields are mapped\n setLoading(true);\n\n const mappedHeaders = Object.keys(fieldLabels).reduce(\n (acc, key) => {\n const mappedHeader = Object.keys(headerMapping).find(\n (header) =>\n headerMapping[header] === fieldLabels[key as FieldLabelKeys],\n );\n if (mappedHeader) {\n acc[fieldLabels[key as FieldLabelKeys]] = mappedHeader;\n }\n return acc;\n },\n {} as Record,\n );\n\n const insertTemplateParams: InsertTemplateParams = {\n tracking_id: mappedHeaders['Tracking ID'] || '',\n weight: mappedHeaders['Weight']\n ? parseFloat(csvData[0][mappedHeaders['Weight']])\n : undefined,\n store: mappedHeaders['Store'] || '',\n trailer_name: mappedHeaders['Trailer Name'] || undefined,\n loaded_at: mappedHeaders['Loaded At'] || undefined,\n bol: mappedHeaders['BOL'],\n expected_arrival: mappedHeaders['Expected Arrival'] || undefined,\n weight_unit: mappedHeaders['Weight Unit'] || undefined,\n station_id: station,\n };\n\n await insertTemplate(insertTemplateParams);\n setVerifiedData(null);\n setLoading(false);\n };\n\n return (\n
\n
\n

\n Your Organization doesn't have a template yet. Create it below.\n

\n \n
\n
\n \n \n \n {headers.map((header, index) => (\n \n
\n handleHeaderChange(e, header)}\n className={`mb-2 border p-1 rounded-md font-normal ${\n duplicates.includes(headerMapping[header])\n ? 'border-red-500 text-red-500'\n : 'border-gray-300 text-black'\n }`}\n >\n \n {Object.values(fieldLabels).map((option, i) => (\n \n ))}\n \n

{header}

\n
\n \n ))}\n
\n \n \n {rows.map((row, rowIndex) => (\n \n {headers.map((header, colIndex) => (\n \n {row[header]}\n \n ))}\n \n ))}\n \n
\n
\n\n {missingRequiredFields.length > 0 && (\n
\n Required fields need to be selected:{' '}\n {missingRequiredFields\n .map((field) => fieldLabels[field as FieldLabelKeys])\n .join(', ')}\n
\n )}\n\n {errorMessage &&
{errorMessage}
}\n\n {!loading && (\n 0 && errorMessage === null}\n >\n Submit\n \n )}\n {loading && }\n
\n );\n}\n","import { Button } from '@/components/primitives/Button';\nimport { Loading } from '@/layout/Loading';\nimport { InfoIcon } from 'lucide-react';\nimport { useState, useEffect, useMemo } from 'react';\nimport { useUploadAsn } from './UploadAsnContext';\nimport { verifyASN } from '@/data/SupabaseRequests/warehouse-webapp-api/verifyASN';\nimport { FetchASNTemplatesResponse } from '@/data/SupabaseRequests/warehouse-webapp-api/fetchASNTemplates';\nimport { set } from 'date-fns';\n\nexport type InsertTemplateParams = {\n tracking_id: string;\n weight?: number;\n store: string;\n trailer_name?: string;\n loaded_at?: string;\n bol: string;\n expected_arrival?: string;\n weight_unit?: string;\n};\n\nconst ROWS = 5;\n\ntype Props = {\n template: FetchASNTemplatesResponse;\n};\n\nexport function UploadInvalidTemplate({ template }: Props) {\n const {\n csvData,\n setCSVData,\n headers: uploadedHeaders,\n setHeaders,\n loading,\n setLoading,\n station,\n setVerifiedData,\n } = useUploadAsn();\n const headers_needed = Object.values(template);\n const [selectedOptions, setSelectedOptions] = useState>(\n new Map(),\n );\n\n const uploaded_rows = csvData.slice(0, ROWS);\n\n const headers_map = useMemo(() => {\n const map = new Map();\n uploadedHeaders.forEach((header) => {\n map.set(header, '');\n });\n return map;\n }, [uploadedHeaders]);\n\n const allOptions = useMemo(\n () => new Set(headers_needed.filter((header) => header !== null)),\n [headers_needed],\n );\n\n function handleHeaderChange(\n e: React.ChangeEvent,\n header: string,\n ) {\n const newValue = e.target.value;\n const oldValue = headers_map.get(header);\n\n // Update the headers_map with the new value\n headers_map.set(header, newValue);\n\n // Update the selected options state\n setSelectedOptions((prevSelectedOptions) => {\n const newSelectedOptions = new Map(prevSelectedOptions);\n\n if (oldValue) {\n newSelectedOptions.delete(header); // Remove the old value associated with the header\n }\n\n newSelectedOptions.set(header, newValue); // Set the new value for the header\n\n return newSelectedOptions;\n });\n }\n\n const handleSubmit = async () => {\n setLoading(true);\n const newHeaders = uploadedHeaders.map((header) => {\n const selectedValue = selectedOptions.get(header);\n return selectedValue || ''; // Return the selected value or null if not selected\n });\n\n setHeaders(newHeaders);\n\n const newCSVData = csvData.map((row) => {\n const newRow = { ...row };\n Object.keys(row).forEach((key) => {\n const selectedHeader = selectedOptions.get(key);\n if (selectedHeader) {\n newRow[selectedHeader] = newRow[key];\n delete newRow[key];\n }\n });\n return newRow;\n });\n\n const result = await verifyASN({\n asn_data: newCSVData as Record[],\n headers: newHeaders,\n outbound_station_id: station,\n });\n setLoading(false);\n setVerifiedData(result);\n setCSVData(newCSVData);\n };\n\n return (\n
\n
\n
\n

\n This doesn't match your template. Please assign the correct columns\n to this CSV.\n

\n \n
\n
\n \n \n \n {uploadedHeaders.map((header) => {\n const selectedValue = selectedOptions.get(header) || '';\n\n // Calculate available options by excluding already selected ones\n const availableOptions = Array.from(allOptions).filter(\n (option) => {\n return (\n option === selectedValue ||\n !Array.from(selectedOptions.values()).includes(option)\n );\n },\n );\n\n return (\n \n
\n handleHeaderChange(e, header)}\n >\n \n {availableOptions.map((option, i) => (\n \n ))}\n \n

{header}

\n
\n \n );\n })}\n
\n \n\n \n {uploaded_rows.map((row, rowIndex) => (\n \n {uploadedHeaders.map((header, colIndex) => (\n \n {row[header]}\n \n ))}\n \n ))}\n \n
\n
\n {!loading && (\n \n )}\n {loading && }\n
\n );\n}\n","import React from 'react';\nimport { FetchASNTemplatesReturnType } from '@/pages/warehouse/WarehouseApi/types';\nimport {\n FetchASNTemplatesResponse,\n fetchASNTemplates,\n} from '@/data/SupabaseRequests/warehouse-webapp-api/fetchASNTemplates';\nimport { useQuery } from 'react-query';\nimport { useUploadAsn } from './UploadAsnContext';\nimport { UploadInvalidTemplate } from './UploadInvalidTemplate';\n\n// Human-readable labels for template fields\nconst fieldLabels: Partial> =\n {\n tracking_id: 'Tracking ID',\n store: 'Store',\n weight: 'Weight',\n trailer_name: 'Trailer Name',\n loaded_at: 'Loaded At',\n bol: 'BOL',\n expected_arrival: 'Expected Arrival',\n };\n\nexport default function TemplateView() {\n const { headers, station } = useUploadAsn();\n\n const { data: template, error } = useQuery({\n queryKey: ['ASN_templates'],\n queryFn: () => fetchASNTemplates({ stationId: station }),\n refetchInterval: 9999999,\n });\n\n const matchedHeaders = matchHeaders(template, headers);\n\n return (\n
\n

\n The template does not match. Please review the template below and fix\n the CSV file.\n

\n
\n
Template Field
\n
Expected Header
\n
\n
\n {matchedHeaders.map((match, index) => (\n \n
{match.templateLabel}
\n
{match.expected}
\n
\n ))}\n {template && }\n \n );\n}\n\nfunction matchHeaders(\n template: FetchASNTemplatesResponse | undefined,\n uploadedHeaders: string[],\n) {\n if (!template) return [];\n return Object.entries(template)\n .filter(([, value]) => value !== null) // Filter out null values\n .map(([key, value]) => {\n const expected = value as string;\n const uploaded = findHeaderMatch(expected, uploadedHeaders);\n return {\n templateLabel:\n fieldLabels[key as keyof FetchASNTemplatesReturnType] || key,\n expected,\n uploaded,\n };\n });\n}\n\nfunction findHeaderMatch(\n templateField: string,\n uploadedHeaders: string[],\n): string {\n const match = uploadedHeaders.find(\n (uploaded) => uploaded.toLowerCase() === templateField.toLowerCase(),\n );\n return match || 'No Match';\n}\n","import { VerifyASNResponse } from '@/data/SupabaseRequests/warehouse-webapp-api/verifyASN';\nimport React, { useState } from 'react';\nimport { useUploadAsn } from './UploadAsnContext';\nimport { useQuery, useQueryClient } from 'react-query';\nimport {\n FetchASNTemplatesResponse,\n fetchASNTemplates,\n uploadASN,\n} from '@/data/SupabaseRequests/warehouse-webapp-api/_index';\nimport {\n Card,\n CardContent,\n CardFooter,\n CardHeader,\n} from '@/components/primitives/Card';\nimport { Button } from '@/components/primitives/Button';\nimport { SuccessAnimation } from './SuccessAnimation';\nimport { useWarehouseContext } from '@/pages/warehouse/WarehouseURLContext';\nimport { useAuth } from '@/data/auth';\n\ntype Props = {\n errors: VerifyASNResponse;\n};\n\n/***\n * \n * type VerifyASNResponse = {\n severity: \"error\" | \"warning\";\n info?: string | undefined;\n type: \"invalid_date\" | \"missing_cell\" | \"duplicate_tracking_id\" | \"database_tracking_id\" | \"invalid_store\";\n row?: number | undefined;\n}[]\n */\n\nexport default function DisplayErrorsAndUpload({ errors }: Props) {\n const [errorMessage, setErrorMessage] = useState(null);\n const [isSuccess, setIsSuccess] = useState(false);\n\n const { csvData, headers, outboundStation, setLoading } = useUploadAsn();\n const { showCompleted, setActiveLoad } = useWarehouseContext();\n const { stations } = useAuth();\n\n const { data: template } = useQuery({\n queryKey: ['ASN_templates'],\n queryFn: () => fetchASNTemplates({ stationId: outboundStation }),\n refetchInterval: 9999999,\n enabled: errors.length > 0,\n });\n\n const queryClient = useQueryClient();\n\n const warnings = errors.filter(\n (error) => error.severity === 'warning' && error.type !== 'invalid_date',\n );\n const errorsList = errors.filter((error) => error.severity === 'error');\n\n const store_warnings = warnings.filter(\n (warning) => warning.type === 'invalid_store',\n );\n\n const store_errors = errorsList.filter(\n (error) => error.type === 'invalid_store',\n );\n\n const shipment_errors = errorsList.filter(\n (error) => error.type === 'duplicate_tracking_id',\n );\n\n const shipment_warnings = warnings.filter(\n (warning) => warning.type === 'database_tracking_id',\n );\n\n const missing_cell_errors = errorsList.filter(\n (error) => error.type === 'missing_cell',\n );\n\n const onButtonClick = async () => {\n setErrorMessage(null); // Clear any previous errors\n setLoading(true); // Start loading\n try {\n const load_id = await uploadASN({\n asn_data: csvData,\n headers: headers,\n outbound_station_id:\n outboundStation !== '' ? outboundStation : stations[0],\n indexes_to_ignore: shipment_warnings.map((warning) =>\n Number(warning.row),\n ),\n });\n\n setLoading(false); // End loading\n setIsSuccess(true); // Show success animation\n await queryClient.invalidateQueries(['loads', stations, showCompleted]);\n setActiveLoad(load_id);\n } catch (error) {\n setErrorMessage(\n 'An error occurred while uploading the CSV. Please try again.',\n );\n setLoading(false); // End loading\n setIsSuccess(false); // Reset success state\n }\n };\n\n return (\n
\n {/* Render success animation if upload was successful */}\n\n {/* Render warnings and errors */}\n {warnings.length > 0 && (\n \n \n

Warnings

\n \n The CSV can be uploaded... The following fixes will be applied\n \n
\n \n {store_warnings.length > 0 && (\n
\n
Invalid Stores
\n
\n {store_warnings.map((warning, index) => {\n const resolution = getWarningResolutionObject(warning);\n return (\n
\n
\n {resolution.problem}\n
\n
\n {resolution.resolution}\n
\n
\n );\n })}\n
\n
\n )}\n {shipment_warnings.length > 0 && (\n
\n
Tracking ID Warnings
\n
\n {shipment_warnings.map((warning, index) => {\n const resolution = getWarningResolutionObject(warning);\n return (\n
\n
\n {resolution.problem}\n
\n
\n {resolution.resolution}\n
\n
\n );\n })}\n
\n
\n )}\n
\n
\n )}\n\n
\n {errorsList.length > 0 && (\n \n \n

Errors

\n \n The CSV cannot be uploaded until the following issues are fixed\n \n
\n \n {store_errors.length > 0 && (\n
\n
Invalid Stores
\n\n {store_errors.map((error, index) => {\n const resolution = getErrorResolutionObject(error);\n return (\n
\n
\n {resolution.bad_data}\n
\n
\n {resolution.resolution}\n
\n
\n );\n })}\n
\n )}\n\n {shipment_errors.length > 0 && (\n
\n
Tracking ID Errors
\n\n {shipment_errors.map((error, index) => {\n const resolution = getErrorResolutionObject(error);\n return (\n
\n
\n {resolution.bad_data}\n
\n
\n {resolution.resolution}\n
\n
\n );\n })}\n
\n )}\n {missing_cell_errors.length > 0 && (\n
\n
Missing Cells
\n
\n
Row
\n
Column Name
\n
\n\n {missing_cell_errors.map((error, index) => {\n const resolution = getErrorResolutionObject(error);\n return (\n
\n
\n \n {resolution.row\n ? resolution.row + 2\n : resolution.row}\n \n
\n
\n \n {findHeaderMatch(\n resolution.bad_data as keyof FetchASNTemplatesResponse,\n template,\n )}\n \n
\n
\n {resolution.resolution}\n
\n
\n );\n })}\n
\n )}\n
\n
\n )}\n\n {errorsList.length === 0 && warnings.length === 0 && !isSuccess && (\n \n \n

All Clear

\n

\n The CSV has no errors or warnings. Click the button to process\n the CSV.\n

\n
\n
\n )}\n {!isSuccess && (\n
\n \n {/* Display error message if upload fails */}\n {errorMessage && (\n {errorMessage}\n )}\n
\n )}\n
\n
\n );\n}\n\ntype WarningResolution = {\n readableString: string;\n resolution: string;\n problem: string;\n};\n\nfunction getWarningResolutionObject(\n warning: VerifyASNResponse[number],\n): WarningResolution {\n switch (warning.type) {\n case 'database_tracking_id':\n return {\n readableString: 'Tracking ID is already used on Lucidity',\n resolution: 'Tracking ID will be ignored',\n problem: warning.info ?? '',\n };\n case 'invalid_store':\n return {\n readableString: 'Invalid Store',\n resolution: `Store Number Used: ${warning.info?.padStart(5, '0')}`,\n problem: warning.info ?? 'Unknow Issue With Store',\n };\n\n default:\n return {\n problem: 'Unknown Issue',\n readableString: 'Unknown Issue',\n resolution: 'Unknown Issue',\n };\n }\n}\n\ntype ErrorResolution = {\n problem: string;\n resolution: string;\n bad_data?: string;\n row?: number;\n};\n\nfunction getErrorResolutionObject(\n error: VerifyASNResponse[number],\n): ErrorResolution {\n switch (error.type) {\n case 'invalid_date':\n return {\n problem: 'Invalid Date',\n resolution: 'Please check the date format',\n bad_data: error.info ?? '',\n };\n case 'missing_cell':\n return {\n problem: 'Missing Cell',\n resolution: 'Fill out this cell',\n bad_data: error.info ?? '',\n row: error.row,\n };\n case 'bad_template':\n return {\n problem: 'Bad Template',\n resolution: 'Please check the CSV file for missing cells',\n bad_data: error.info ?? '',\n };\n case 'no_template':\n return {\n problem: 'No Template',\n resolution: 'Please check the CSV file for missing cells',\n bad_data: error.info ?? '',\n };\n case 'duplicate_tracking_id':\n return {\n problem: 'Duplicate Tracking ID',\n resolution: 'Exists Multiple Times in the CSV',\n bad_data: error.info ?? '',\n };\n\n case 'invalid_store':\n return {\n problem: 'Invalid Store',\n resolution: `Please Check the store number and change it to a valid store`,\n bad_data: error.info ?? 'Unknown Issue With Store',\n };\n default:\n return {\n problem: 'Unknown Issue',\n resolution: 'Unknown Issue',\n };\n }\n}\n\nfunction findHeaderMatch(\n templateField: keyof FetchASNTemplatesResponse,\n template: FetchASNTemplatesResponse | undefined,\n): string {\n if (!template) return 'No Template Found';\n const match = template[templateField];\n return match || 'No Match';\n}\n","import AddTemplate from './AddTemplate';\nimport TemplateView from './TemplateView';\nimport { VerifyASNResponse } from '@/data/SupabaseRequests/warehouse-webapp-api/verifyASN';\nimport DisplayErrorsAndUpload from './DisplayErrorsAndUpload';\n\ntype Props = {\n verifiedData: VerifyASNResponse;\n};\n\nexport default function DisplayASNVerificationErrors({ verifiedData }: Props) {\n const hasNoTemplate = verifiedData?.some(\n (error) => error.type === 'no_template',\n );\n\n const hasInvalidTemplate = verifiedData?.some(\n (error) => error.type === 'bad_template',\n );\n\n const noTemplateErrors = !hasNoTemplate && !hasInvalidTemplate;\n\n console.log(verifiedData);\n\n return (\n
\n {hasNoTemplate && }\n {hasInvalidTemplate && }\n {noTemplateErrors && }\n
\n );\n}\n","import { Loading } from '@/layout/Loading';\nimport { useUploadAsn } from './UploadAsnContext';\nimport UploadFile from './UploadFile';\nimport DisplayASNVerificationErrors from './DisplayASNVerificationErrors';\n\nexport default function UploadASN() {\n const { loading, verifiedData } = useUploadAsn();\n\n return (\n
\n \n {loading && }\n {verifiedData && (\n
\n \n
\n )}\n
\n );\n}\n","/* eslint-disable react-hooks/exhaustive-deps */\nimport React from 'react';\nimport { LoadCard, LoadInfo } from '../_models';\nimport VertainerLeft from './LeftVertainer/ShipperVertainerLeft';\nimport { useQuery } from 'react-query';\nimport { LUDate } from '@/common/classes/LUDate';\nimport ShipperLoadDataContainer from './RightVertainer/ShipperLoadDataContainer';\nimport { useWarehouseContext } from '../WarehouseURLContext';\nimport { fetchShipperLoadsWrapper } from '../FactoryFunctions/fetchShipperLoads';\nimport { UploadAsnProvider } from './RightVertainer/UploadASN/UploadAsnContext';\nimport UploadASN from './RightVertainer/UploadASN/UploadASN';\nimport { useAuth } from '@/data/auth';\n\nexport function ShipperWarehouse() {\n const { stations } = useAuth();\n const { activeLoad, showCompleted, activeComponent } = useWarehouseContext();\n\n const { data: loads, isLoading: loadsLoading } = useQuery({\n queryKey: ['loads', stations, showCompleted],\n queryFn: () =>\n fetchShipperLoadsWrapper({\n stations: stations,\n showCompleted,\n }),\n enabled: true,\n });\n\n function getLoadInfo(load_id: string): LoadInfo {\n const target_load = loads?.find((load) => load.id === load_id);\n if (target_load) {\n return {\n id: target_load.id,\n date: new LUDate(target_load.estimated_arrival),\n pieces: target_load.loaded_shipments,\n weight: target_load.loaded_shipments * 11,\n unloaded_shipments: target_load.unloaded_shipments,\n state: target_load.state,\n trailer: target_load.trailer_id,\n shortages: target_load.shortages,\n overages: target_load.overages,\n rate: target_load.rate,\n };\n } else {\n return {\n id: '',\n date: new LUDate(),\n pieces: 0,\n weight: 0,\n unloaded_shipments: 0,\n state: 'Building',\n trailer: '',\n rate: 'N/A',\n };\n }\n }\n\n return (\n
\n
\n \n
\n\n {activeLoad && activeComponent !== 'Upload ASN' && (\n l.id) ?? ''}\n >\n \n
\n )}\n\n {activeComponent === 'Upload ASN' && (\n
\n \n \n \n
\n )}\n \n );\n}\n","import { PageHeader } from '@/layout/PageHeader';\nimport { useAuth } from '@/data/auth';\nimport { CarrierWarehouse } from './CarrierWarehouse/CarrierWarehouse';\nimport { ShipperWarehouse } from './ShipperWarehouse/ShipperWarehouse';\nimport { WarehouseProvider } from './WarehouseURLContext';\n\n/**\n * Warehouse Landing Page. Parent container for warehouse\n * @returns React Component\n */\n//This page looks perfect, i added the org because its better then ?? ''\nexport function WarehousePage() {\n const { user } = useAuth();\n\n return (\n
\n
\n \n
\n
\n \n {user?.org_type === 'carrier' ? (\n \n ) : (\n \n )}\n \n
\n
\n );\n}\n","import { set } from 'date-fns';\nimport { createContext, useContext, useEffect, useState } from 'react';\nimport { useLocation, useSearchParams } from 'react-router-dom';\n\nexport type Tab = 'users' | 'stores' | 'regions';\n\ninterface StationContextProps {\n selectedStation: string | null;\n setSelectedStation: (station: string | null) => void;\n selectedTab: Tab;\n setSelectedTab: (tab: Tab) => void;\n setSelectedRegion: (region: string | null) => void;\n selectedRegion: string | null;\n setSelectedStore: (store: string | null) => void;\n selectedStore: string | null;\n}\n\nconst StationContext = createContext(\n undefined,\n);\n\nexport const useStationContext = () => {\n const context = useContext(StationContext);\n if (!context) {\n throw new Error('useStationContext must be used within a StationProvider');\n }\n return context;\n};\n\nexport const StationProvider = ({\n children,\n}: {\n children: React.ReactNode;\n}) => {\n const location = useLocation();\n const [searchParams, setSearchParams] = useSearchParams();\n const [selectedStation, setSelectedStation] = useState(\n searchParams.get('station_id') || null,\n );\n const [selectedTab, setSelectedTab] = useState(\n (searchParams.get('tab') as Tab) || 'users',\n );\n const [selectedRegion, setSelectedRegion] = useState(null);\n const [selectedStore, setSelectedStore] = useState(null);\n\n const setSelectedRegionCascade = (region: string | null) => {\n setSelectedRegion(region);\n setSelectedStore(null);\n };\n\n useEffect(() => {\n const params = new URLSearchParams(location.search);\n if (selectedStation) {\n params.set('station_id', selectedStation);\n } else {\n params.delete('station_id');\n }\n\n if (selectedTab) {\n params.set('tab', selectedTab);\n } else {\n params.delete('tab');\n }\n\n if (selectedRegion) {\n params.set('region', selectedRegion);\n } else {\n params.delete('region');\n }\n\n if (selectedStore) {\n params.set('store', selectedStore);\n } else {\n params.delete('store');\n }\n\n setSearchParams(params);\n }, [location.search]);\n\n useEffect(() => {\n const params = new URLSearchParams();\n\n // Add `station_id` first if it exists\n if (selectedStation) {\n params.append('station_id', selectedStation);\n }\n\n // Add `tab` next\n if (selectedTab) {\n params.append('tab', selectedTab);\n }\n\n // Add `region` next\n if (selectedRegion) {\n params.append('region', selectedRegion);\n }\n\n // Add `store` next\n if (selectedStore) {\n params.append('store', selectedStore);\n }\n\n // Update the search params\n setSearchParams(params);\n }, [selectedStation, selectedTab, selectedRegion, selectedStore]);\n\n return (\n \n {children}\n \n );\n};\n","\"use client\"\n\nimport * as React from \"react\"\nimport * as TabsPrimitive from \"@radix-ui/react-tabs\"\n\nimport { cn } from \"@/lib/utils\"\n\nconst Tabs = TabsPrimitive.Root\n\nconst TabsList = React.forwardRef<\n React.ElementRef,\n React.ComponentPropsWithoutRef\n>(({ className, ...props }, ref) => (\n \n))\nTabsList.displayName = TabsPrimitive.List.displayName\n\nconst TabsTrigger = React.forwardRef<\n React.ElementRef,\n React.ComponentPropsWithoutRef\n>(({ className, ...props }, ref) => (\n \n))\nTabsTrigger.displayName = TabsPrimitive.Trigger.displayName\n\nconst TabsContent = React.forwardRef<\n React.ElementRef,\n React.ComponentPropsWithoutRef\n>(({ className, ...props }, ref) => (\n \n))\nTabsContent.displayName = TabsPrimitive.Content.displayName\n\nexport { Tabs, TabsList, TabsTrigger, TabsContent }\n","import { supabase } from \"../../supabase\";\n\n// To regenerate this file, run the CLI command `deno run --allow-read --allow-write --allow-sys schema_to_ts.ts`. The script is located in the supabase-functions directory.\n\n/**\n * This interface was referenced by `Interface`'s JSON-Schema\n * via the `definition` \"getStationUsersResponse\".\n */\nexport type GetStationUsersResponse = {\n name: string;\n email: string;\n id: string;\n invited: boolean;\n permissions: string[];\n}[];\n\n\n/**\n * This interface was referenced by `Interface`'s JSON-Schema\n * via the `definition` \"getStationUsersParams\".\n */\nexport interface GetStationUsersParams {\n function: \"get-station-users\";\n stationId: string;\n}\n\n\nexport async function getStationUsers(\n params: Omit,\n){\n try {\n const result = await supabase.functions.invoke( \n 'stations-api',\n { body: { ...params, function: 'get-station-users' }},\n );\n\n if (!result.error && result.data) {\n return result.data;\n } else if (result.error) {\n throw new Error(\"Error Fetching Result in stations-api/getStationUsers:\" + result.error);\n } else {\n throw new Error('Unknown error: result does not contain data or error.');\n }\n } catch (error) {\n console.error('Error:', error);\n throw error;\n }\n}\n","export type Permission =\n | 'admin'\n | 'super-admin'\n | 'organization'\n | 'warehouse'\n | 'webapp'\n | 'warehouse-app'\n | 'driver-app'\n | 'dispatch'\n | 'route-book'\n | 'create-shipments'\n | 'reports'\n | 'shipment-search'\n | 'analytics'\n | 'claims'\n | 'stations';\n\nexport const permissionList: Permission[] = [\n 'admin',\n 'super-admin',\n 'organization',\n 'warehouse',\n 'webapp',\n 'warehouse-app',\n 'driver-app',\n 'dispatch',\n 'route-book',\n 'create-shipments',\n 'reports',\n 'shipment-search',\n 'analytics',\n 'claims',\n 'stations',\n];\n\nexport const userFriendlyPermissions: Record = {\n admin: 'Admin',\n 'super-admin': 'Super Admin',\n organization: 'Organization',\n warehouse: 'Warehouse',\n webapp: 'Web App',\n 'warehouse-app': 'Warehouse App',\n 'driver-app': 'Driver App',\n dispatch: 'Dispatch',\n 'route-book': 'Route Book',\n 'create-shipments': 'Create Shipments',\n reports: 'Reports',\n 'shipment-search': 'Shipment Search',\n stations: 'Stations',\n analytics: 'Analytics',\n claims: 'Claims',\n};\n\nexport function getFriendlyName(permission: Permission): string {\n return userFriendlyPermissions[permission];\n}\n\nexport function hasWebappAccess(permissions: Permission[]): boolean {\n // Return true if there is at least one permission that is not 'warehouse-app' or 'driver-app'\n return permissions.some((p) => p !== 'warehouse-app' && p !== 'driver-app');\n}\n\nexport function getPermissionByFriendlyName(\n friendlyName: string,\n): Permission | undefined {\n const entry = Object.entries(userFriendlyPermissions).find(\n ([_, value]) => value === friendlyName,\n );\n return entry ? (entry[0] as Permission) : undefined;\n}\n","import * as React from 'react';\nimport { Eye, EyeOff } from 'lucide-react';\nimport { Input } from './primitives/Input';\nimport { Button } from './primitives/Button';\n\ntype Props = {\n onSubmit?: (password: string) => void; // Function to handle form submission\n onChange?: (password: string) => void; // Function to handle password change\n};\n\nexport function Password({ onSubmit, onChange }: Props) {\n const [password, setPassword] = React.useState('');\n const [showPassword, setShowPassword] = React.useState(false);\n\n const handleFormSubmit = (e: React.FormEvent) => {\n e.preventDefault();\n if (onSubmit) onSubmit(password);\n };\n\n const handlePasswordChange = (e: React.ChangeEvent) => {\n setPassword(e.target.value);\n if (onChange) {\n onChange(e.target.value);\n }\n };\n return (\n
\n
\n handlePasswordChange(e)}\n className=\"pr-10\" // Add padding to accommodate the eye icon\n />\n\n setShowPassword((prev) => !prev)}\n className=\"absolute inset-y-0 right-0 flex items-center px-2 text-muted\"\n aria-label={showPassword ? 'Hide password' : 'Show password'}\n >\n {showPassword ? (\n \n ) : (\n \n )}\n \n
\n {onSubmit && }\n
\n );\n}\n","import { supabase } from \"../../supabase\";\n\n// To regenerate this file, run the CLI command `deno run --allow-read --allow-write --allow-sys schema_to_ts.ts`. The script is located in the supabase-functions directory.\n\n\n/**\n * This interface was referenced by `Interface`'s JSON-Schema\n * via the `definition` \"inviteUsernameParams\".\n */\nexport interface InviteUsernameParams {\n function: \"invite-username\";\n username: string;\n firstName: string;\n lastName: string;\n password: string;\n station: string;\n permissions: (\"driver-app\" | \"warehouse-app\")[];\n}\n\n\nexport async function inviteUsername(\n params: Omit,\n): Promise{\n try {\n const result = await supabase.functions.invoke( \n 'stations-api',\n { body: { ...params, function: 'invite-username' }},\n );\n\n if (!result.error && result.data) {\n return;\n } else if (result.error) {\n throw new Error(\"Error Fetching Result in stations-api/inviteUsername:\" + result.error);\n } else {\n throw new Error('Unknown error: result does not contain data or error.');\n }\n } catch (error) {\n console.error('Error:', error);\n throw error;\n }\n}\n","import { supabase } from \"../../supabase\";\n\n// To regenerate this file, run the CLI command `deno run --allow-read --allow-write --allow-sys schema_to_ts.ts`. The script is located in the supabase-functions directory.\n\n\n/**\n * This interface was referenced by `Interface`'s JSON-Schema\n * via the `definition` \"removeUserFromStationParams\".\n */\nexport interface RemoveUserFromStationParams {\n function: \"remove-user-from-station\";\n stationId: string;\n email: string;\n}\n\n\nexport async function removeUserFromStation(\n params: Omit,\n): Promise{\n try {\n const result = await supabase.functions.invoke( \n 'stations-api',\n { body: { ...params, function: 'remove-user-from-station' }},\n );\n\n if (!result.error && result.data) {\n return;\n } else if (result.error) {\n throw new Error(\"Error Fetching Result in stations-api/removeUserFromStation:\" + result.error);\n } else {\n throw new Error('Unknown error: result does not contain data or error.');\n }\n } catch (error) {\n console.error('Error:', error);\n throw error;\n }\n}\n","import { supabase } from \"../../supabase\";\n\n// To regenerate this file, run the CLI command `deno run --allow-read --allow-write --allow-sys schema_to_ts.ts`. The script is located in the supabase-functions directory.\n\n\n/**\n * This interface was referenced by `Interface`'s JSON-Schema\n * via the `definition` \"user\".\n */\nexport interface User {\n first_name: string;\n last_name: string;\n email: string;\n id?: string;\n}\n/**\n * This interface was referenced by `Interface`'s JSON-Schema\n * via the `definition` \"inviteUserParams\".\n */\nexport interface InviteUserParams {\n function: \"invite-user\";\n users: {\n first_name: string;\n last_name: string;\n email: string;\n }[];\n station_id: string | null;\n permissions: (\n | \"super-admin\"\n | \"admin\"\n | \"warehouse-app\"\n | \"organization\"\n | \"driver-app\"\n | \"route-book\"\n | \"create-shipments\"\n | \"shipment-search\"\n | \"analytics\"\n | \"claims\"\n | \"dispatch\"\n | \"warehouse\"\n | \"reports\"\n | \"webapp\"\n | \"stations\"\n )[];\n}\n\n\nexport async function inviteUser(\n params: Omit,\n): Promise{\n try {\n const result = await supabase.functions.invoke( \n 'webapp-api',\n { body: { ...params, function: 'invite-user' }},\n );\n\n if (!result.error && result.data) {\n return;\n } else if (result.error) {\n throw new Error(\"Error Fetching Result in webapp-api/inviteUser:\" + result.error);\n } else {\n throw new Error('Unknown error: result does not contain data or error.');\n }\n } catch (error) {\n console.error('Error:', error);\n throw error;\n }\n}\n","import { Permission } from '@/data/permissions';\nimport { GetStationUsersResponse } from '@/data/SupabaseRequests/stations-api/getStationUsers';\nimport { inviteUsername } from '@/data/SupabaseRequests/stations-api/inviteUsername';\nimport { removeUserFromStation } from '@/data/SupabaseRequests/stations-api/removeUserFromStation';\nimport { inviteUser } from '@/data/SupabaseRequests/webapp-api/inviteUser';\nimport { useStationContext } from '@/pages/station/StationURLContext';\nimport { useMutation, useQueryClient } from 'react-query';\n\nexport function useAddUserEmail() {\n const queryClient = useQueryClient();\n const { selectedStation } = useStationContext();\n\n return useMutation(\n async ({\n email,\n firstName,\n lastName,\n permissions,\n }: {\n email: string;\n firstName: string;\n lastName: string;\n permissions: Permission[];\n }) => {\n const users: GetStationUsersResponse | undefined =\n queryClient.getQueryData(['users', selectedStation]);\n\n if (users) {\n try {\n await inviteUser({\n users: [\n {\n email: email,\n first_name: firstName,\n last_name: lastName,\n },\n ],\n station_id: selectedStation,\n permissions: permissions,\n });\n\n queryClient.setQueryData(\n ['users', selectedStation],\n [\n ...users,\n {\n email,\n name: `${firstName} ${lastName}`,\n id: email,\n invited: true,\n permissions,\n },\n ],\n );\n } catch (error) {\n console.error('Error:', error);\n throw error;\n }\n }\n },\n );\n}\n\nexport function useAddUsername() {\n const queryClient = useQueryClient();\n const { selectedStation } = useStationContext();\n\n return useMutation(\n async ({\n username,\n password,\n firstName,\n lastName,\n permissions,\n }: {\n username: string;\n password: string;\n firstName: string;\n lastName: string;\n permissions: ('warehouse-app' | 'driver-app')[];\n }) => {\n const users: GetStationUsersResponse | undefined =\n queryClient.getQueryData(['users', selectedStation]);\n\n if (users && selectedStation) {\n try {\n await inviteUsername({\n username,\n password,\n firstName,\n lastName,\n station: selectedStation,\n permissions,\n });\n\n queryClient.setQueryData(\n ['users', selectedStation],\n [\n ...users,\n {\n email: username + '@lucidityusername.com',\n name: `${firstName} ${lastName}`,\n id: username,\n invited: true,\n permissions,\n },\n ],\n );\n } catch (error) {\n console.error('Error:', error);\n throw error;\n }\n }\n },\n );\n}\n\nexport function useRemoveUser() {\n const queryClient = useQueryClient();\n const { selectedStation } = useStationContext();\n\n return useMutation(async ({ email }: { email: string }) => {\n const users: GetStationUsersResponse | undefined = queryClient.getQueryData(\n ['users', selectedStation],\n );\n\n if (users && selectedStation) {\n try {\n queryClient.setQueryData(\n ['users', selectedStation],\n users.filter((user) => user.email !== email),\n );\n\n await removeUserFromStation({ stationId: selectedStation, email });\n } catch (error) {\n console.error('Error:', error);\n throw error;\n }\n }\n });\n}\n","import { useState } from 'react';\nimport { Button } from '@/components/primitives/Button';\nimport { Input } from '@/components/primitives/Input';\nimport {\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuSeparator,\n DropdownMenuTrigger,\n} from '@/components/primitives/DropdownMenu';\nimport { Check, ChevronRight } from 'lucide-react';\nimport {\n getPermissionByFriendlyName,\n Permission,\n userFriendlyPermissions,\n} from '@/data/permissions';\nimport React from 'react';\nimport { useOutsideClick } from '@/common/hooks/useOutsideClick';\nimport { Password } from '@/components/Password';\nimport {\n useAddUserEmail,\n useAddUsername,\n} from './mutations/addOrRemoveUserMutation';\n\nexport function AddUserRow() {\n const [menuOpen, setMenuOpen] = useState(false);\n const [password, setPassword] = useState('');\n const [newUser, setNewUser] = useState({\n email: '',\n first_name: '',\n last_name: '',\n });\n const [selectedPermissions, setSelectedPermissions] = useState(\n [],\n );\n const [errors, setErrors] = useState({\n firstName: '',\n lastName: '',\n password: '',\n username: '',\n });\n\n const divRef = React.useRef(null);\n const emailMutation = useAddUserEmail();\n const usernameMutation = useAddUsername();\n\n useOutsideClick(divRef, () => {\n setMenuOpen(false);\n });\n\n // Validation functions\n function isValidPassword(password: string) {\n const hasUpperCase = /[A-Z]/.test(password);\n const hasLowerCase = /[a-z]/.test(password);\n const hasNumber = /\\d/.test(password);\n return hasUpperCase && hasLowerCase && hasNumber && password.length >= 8;\n }\n\n function isValidUsername(username: string) {\n return username.length > 5;\n }\n\n function isValidName(name: string) {\n return name.length >= 2;\n }\n\n const validateFields = () => {\n const newErrors = {\n firstName: '',\n lastName: '',\n password: '',\n username: '',\n };\n\n if (!isValidName(newUser.first_name)) {\n newErrors.firstName = 'First name must be at least 2 characters.';\n }\n\n if (!isValidName(newUser.last_name)) {\n newErrors.lastName = 'Last name must be at least 2 characters.';\n }\n\n if (isUsername && !isValidPassword(password)) {\n newErrors.password =\n 'Password must contain at least 1 uppercase, 1 lowercase, 1 number, and be at least 8 characters long.';\n }\n\n if (isUsername && !isValidUsername(newUser.email)) {\n newErrors.username = 'Username must be at least 6 characters long.';\n }\n\n setErrors(newErrors);\n return Object.values(newErrors).every((err) => err === '');\n };\n\n const handleAddNewUser = async () => {\n if (!validateFields()) return;\n\n emailMutation.mutate({\n email: newUser.email,\n firstName: newUser.first_name,\n lastName: newUser.last_name,\n permissions: selectedPermissions,\n });\n\n resetForm();\n };\n\n const handleAddNewUsername = async () => {\n if (!validateFields()) return;\n\n usernameMutation.mutate({\n username: newUser.email,\n password: password,\n firstName: newUser.first_name,\n lastName: newUser.last_name,\n permissions: selectedPermissions.filter(\n (perm) => perm === 'driver-app' || perm === 'warehouse-app',\n ) as ('driver-app' | 'warehouse-app')[],\n });\n\n resetForm();\n };\n\n function resetForm() {\n setNewUser({ email: '', first_name: '', last_name: '' });\n setPassword('');\n setSelectedPermissions([]);\n setErrors({ firstName: '', lastName: '', password: '', username: '' });\n }\n\n function togglePermission(permission: string) {\n const perm = getPermissionByFriendlyName(permission);\n if (perm && selectedPermissions.includes(perm)) {\n setSelectedPermissions(selectedPermissions.filter((p) => p !== perm));\n } else {\n if (perm) {\n setSelectedPermissions([...selectedPermissions, perm]);\n }\n }\n }\n\n function updateUserField(field: string, value: string) {\n setNewUser((prev) => ({ ...prev, [field]: value }));\n }\n\n function hasPermission(permission: string) {\n const perm = getPermissionByFriendlyName(permission);\n return perm ? selectedPermissions.includes(perm) : false;\n }\n\n const permissionStrings = Object.values(userFriendlyPermissions).filter(\n (perm) => !perm.includes('Admin') && !perm.includes('Web App'),\n );\n\n const topPermissions = permissionStrings.filter(\n (perm) => perm.includes('Warehouse App') || perm.includes('Driver App'),\n );\n const bottomPermissions = permissionStrings.filter(\n (perm) => !topPermissions.includes(perm),\n );\n\n const isUsername =\n !newUser.email.includes('@') &&\n !newUser.email.includes('.') &&\n newUser.email.length > 0;\n\n return (\n
\n
\n updateUserField('first_name', e.target.value)}\n />\n updateUserField('last_name', e.target.value)}\n />\n updateUserField('email', e.target.value)}\n />\n {isUsername && (\n setPassword(password)} />\n )}\n \n setMenuOpen(true)}>\n \n \n \n {/* Render top permissions */}\n {topPermissions.map((permission) => (\n togglePermission(permission)}\n >\n {permission}\n {hasPermission(permission) && (\n \n )}\n \n ))}\n\n {/* Render other permissions */}\n {!isUsername && (\n <>\n \n {bottomPermissions.map((permission) => (\n togglePermission(permission)}\n >\n {permission}\n {hasPermission(permission) && (\n \n )}\n \n ))}\n \n )}\n \n \n \n
\n\n {/* Display Validation Errors */}\n {errors.firstName && (\n

{errors.firstName}

\n )}\n {errors.lastName && (\n

{errors.lastName}

\n )}\n {errors.username && (\n

{errors.username}

\n )}\n {isUsername && errors.password && (\n

{errors.password}

\n )}\n
\n );\n}\n","import { supabase } from \"../../supabase\";\n\n// To regenerate this file, run the CLI command `deno run --allow-read --allow-write --allow-sys schema_to_ts.ts`. The script is located in the supabase-functions directory.\n\n\n/**\n * This interface was referenced by `Interface`'s JSON-Schema\n * via the `definition` \"updateUserPermissionParams\".\n */\nexport interface UpdateUserPermissionParams {\n function: \"update-user-permission\";\n userID: string | number;\n permission: string;\n checked: boolean;\n}\n\n\nexport async function updateUserPermission(\n params: Omit,\n): Promise{\n try {\n const result = await supabase.functions.invoke( \n 'stations-api',\n { body: { ...params, function: 'update-user-permission' }},\n );\n\n if (!result.error && result.data) {\n return;\n } else if (result.error) {\n throw new Error(\"Error Fetching Result in stations-api/updateUserPermission:\" + result.error);\n } else {\n throw new Error('Unknown error: result does not contain data or error.');\n }\n } catch (error) {\n console.error('Error:', error);\n throw error;\n }\n}\n","import { Permission } from '@/data/permissions';\nimport { GetStationUsersResponse } from '@/data/SupabaseRequests/stations-api/getStationUsers';\nimport { updateUserPermission } from '@/data/SupabaseRequests/stations-api/updateUserPermission';\nimport { useStationContext } from '@/pages/station/StationURLContext';\nimport { useMutation, useQueryClient } from 'react-query';\n\nexport function useAddOrRemoveUserPermission() {\n const queryClient = useQueryClient();\n const { selectedStation } = useStationContext();\n\n return useMutation(\n async ({\n userId,\n permission,\n checked,\n }: {\n userId: string;\n permission: Permission;\n checked: boolean;\n }) => {\n const users: GetStationUsersResponse | undefined =\n queryClient.getQueryData(['users', selectedStation]);\n\n if (users) {\n try {\n await updateUserPermission({\n userID: userId,\n permission: permission,\n checked,\n });\n\n const updatedUsers = users.map((user) => {\n if (user.id === userId) {\n return {\n ...user,\n permissions: checked\n ? [...user.permissions, permission]\n : user.permissions.filter((p) => p !== permission),\n };\n }\n\n return user;\n });\n\n queryClient.setQueryData(['users', selectedStation], updatedUsers);\n } catch (error) {\n console.error('Error:', error);\n throw error;\n }\n }\n },\n );\n}\n","import {\n DropdownMenuItem,\n DropdownMenuSeparator,\n DropdownMenuSub,\n DropdownMenuSubTrigger,\n} from '@/components/primitives/DropdownMenu';\nimport {\n getPermissionByFriendlyName,\n Permission,\n userFriendlyPermissions,\n} from '@/data/permissions';\nimport { DropdownMenuSubContent } from '@radix-ui/react-dropdown-menu';\nimport { Check, UserCog } from 'lucide-react';\nimport { useAddOrRemoveUserPermission } from '../mutations/addOrRemoveUserPermissionMutation';\nimport { is } from 'date-fns/locale';\n\ntype Props = {\n userID: string;\n username: boolean;\n userPermissions: Permission[];\n isAdmin: boolean;\n};\n\nexport function ChangePermissions({\n userID,\n username,\n userPermissions,\n isAdmin,\n}: Props) {\n const mutation = useAddOrRemoveUserPermission();\n\n async function changePermission(permission: string) {\n const permissionAsPermission = getPermissionByFriendlyName(permission);\n if (!permissionAsPermission) return;\n\n if (hasPermission(permission)) {\n await mutation.mutateAsync({\n userId: userID,\n permission: permissionAsPermission,\n checked: false,\n });\n } else {\n await mutation.mutateAsync({\n userId: userID,\n permission: permissionAsPermission,\n checked: true,\n });\n }\n }\n\n const permissionStrings = Object.values(userFriendlyPermissions).filter(\n (perm) => !perm.includes('Admin') && !perm.includes('Web App'),\n );\n\n const topPermissions = permissionStrings.filter(\n (perm) => perm.includes('Warehouse App') || perm.includes('Driver App'),\n );\n const bottomPermissions = permissionStrings.filter(\n (perm) => !topPermissions.includes(perm),\n );\n\n function hasPermission(permission: string) {\n const perm = getPermissionByFriendlyName(permission);\n return perm ? userPermissions.includes(perm) : false;\n }\n\n return (\n \n \n \n Change Permissions\n \n \n {topPermissions.map((permission) => (\n {\n changePermission(permission);\n }}\n >\n {permission}\n {hasPermission(permission) && (\n \n )}\n \n ))}\n {!username && (\n <>\n {/* Separator */}\n \n {bottomPermissions.map((permission) => (\n {\n changePermission(permission);\n }}\n >\n {permission}\n {hasPermission(permission) && (\n \n )}\n \n ))}\n \n )}\n \n \n );\n}\n","import { supabase } from \"../../supabase\";\n\n// To regenerate this file, run the CLI command `deno run --allow-read --allow-write --allow-sys schema_to_ts.ts`. The script is located in the supabase-functions directory.\n\n\n/**\n * This interface was referenced by `Interface`'s JSON-Schema\n * via the `definition` \"changePasswordParams\".\n */\nexport interface ChangePasswordParams {\n function: \"change-password\";\n newPassword: string;\n userID: string;\n}\n\n\nexport async function changePassword(\n params: Omit,\n): Promise{\n try {\n const result = await supabase.functions.invoke( \n 'stations-api',\n { body: { ...params, function: 'change-password' }},\n );\n\n if (!result.error && result.data) {\n return;\n } else if (result.error) {\n throw new Error(\"Error Fetching Result in stations-api/changePassword:\" + result.error);\n } else {\n throw new Error('Unknown error: result does not contain data or error.');\n }\n } catch (error) {\n console.error('Error:', error);\n throw error;\n }\n}\n","import React, { useState } from 'react';\nimport { Password } from '@/components/Password';\nimport {\n DropdownMenuSub,\n DropdownMenuSubContent,\n DropdownMenuSubTrigger,\n} from '@/components/primitives/DropdownMenu';\nimport { changePassword } from '@/data/SupabaseRequests/stations-api/changePassword';\nimport { Key } from 'lucide-react';\n\ntype Props = {\n userID: string;\n};\n\nexport function ResetPassword({ userID }: Props) {\n const [isSubMenuOpen, setIsSubMenuOpen] = useState(false);\n\n function handleResetPassword(newPassword: string) {\n changePassword({\n userID: userID,\n newPassword: newPassword,\n });\n\n // Close the submenu on successful submit\n setIsSubMenuOpen(false);\n }\n\n return (\n \n \n \n Reset Password\n \n \n
\n {\n handleResetPassword(newPassword);\n }}\n />\n
\n
\n
\n );\n}\n","import { supabase } from \"../../supabase\";\n\n// To regenerate this file, run the CLI command `deno run --allow-read --allow-write --allow-sys schema_to_ts.ts`. The script is located in the supabase-functions directory.\n\n\n/**\n * This interface was referenced by `Interface`'s JSON-Schema\n * via the `definition` \"resendOtpEmailParams\".\n */\nexport interface ResendOtpEmailParams {\n function: \"resendOtpEmail\";\n email: string;\n userType: \"admin\" | \"station-user\";\n}\n\n\nexport async function resendOtpEmail(\n params: Omit,\n): Promise{\n try {\n const result = await supabase.functions.invoke( \n 'stations-api',\n { body: { ...params, function: 'resendOtpEmail' }},\n );\n\n if (!result.error && result.data) {\n return;\n } else if (result.error) {\n throw new Error(\"Error Fetching Result in stations-api/resendOtpEmail:\" + result.error);\n } else {\n throw new Error('Unknown error: result does not contain data or error.');\n }\n } catch (error) {\n console.error('Error:', error);\n throw error;\n }\n}\n","import {\n Truck,\n Warehouse,\n Globe,\n Check,\n Clock,\n Mail,\n MoreVertical,\n UserMinus,\n} from 'lucide-react';\nimport { Button } from '@/components/primitives/Button';\nimport { TableCell, TableRow } from '@/components/primitives/Table';\nimport { Badge } from '@/components/primitives/Badge';\nimport {\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuSeparator,\n DropdownMenuTrigger,\n} from '@/components/primitives/DropdownMenu';\nimport { GetStationUsersResponse } from '@/data/SupabaseRequests/stations-api/getStationUsers';\nimport { hasWebappAccess, Permission } from '@/data/permissions';\nimport { ChangePermissions } from './Dropdown/ChangePermissions';\nimport { ResetPassword } from './Dropdown/ResetPassword';\nimport { useRemoveUser } from './mutations/addOrRemoveUserMutation';\nimport { resendOtpEmail } from '@/data/SupabaseRequests/stations-api/resendOtpEmail';\n\ntype Props = {\n user: GetStationUsersResponse[number];\n};\n\n// Extracted UserRow component for reuse\nexport function UserRow({ user }: Props) {\n const isUsername = user.email?.includes('@lucidityusername.com');\n const isAdmin =\n user.permissions.includes('admin') ||\n user.permissions.includes('super-admin');\n const webappAccess = hasWebappAccess(user.permissions as Permission[]);\n\n const mutation = useRemoveUser();\n\n const handleResendEmail = async (email: string) => {\n const userType = isAdmin ? 'admin' : 'station-user';\n await resendOtpEmail({\n userType: userType,\n email: email,\n });\n };\n\n return (\n \n {user.name}\n \n {isUsername\n ? user.email.replace('@lucidityusername.com', '')\n : user.email}\n \n \n
\n {user.permissions.includes('driver-app') && (\n \n )}\n {user.permissions.includes('warehouse-app') && (\n \n )}\n {webappAccess && }\n
\n
\n \n \n {!user.invited ? (\n \n ) : (\n \n )}\n {user.invited ? 'Invited' : 'Joined'}\n \n \n\n \n \n \n \n \n \n \n \n \n \n mutation.mutate({ email: user.email })}\n >\n \n Remove User\n \n {user.invited && (\n handleResendEmail(user.email)}>\n \n Resend Email\n \n )}\n \n \n \n
\n );\n}\n","import {\n Card,\n CardContent,\n CardDescription,\n CardHeader,\n CardTitle,\n} from '@/components/primitives/Card';\n\nimport { Table, TableBody } from '@/components/primitives/Table';\n\nimport { useStationContext } from '../../../StationURLContext';\n\nimport { useQuery } from 'react-query';\nimport { getStationUsers } from '@/data/SupabaseRequests/stations-api/getStationUsers';\nimport { AddUserRow } from './AddUserRow';\nimport { UserRow } from './UserRow';\nimport { useAuth } from '@/data/auth';\n\ntype Props = {\n stationName: string;\n};\nexport function StationUsers({ stationName }: Props) {\n const { selectedStation: stationId } = useStationContext();\n\n const { data: users } = useQuery({\n queryKey: ['users', stationId],\n queryFn: () => getStationUsers({ stationId: stationId! }),\n enabled: typeof stationId !== null,\n });\n\n const { permissions } = useAuth();\n\n // Separate admin users\n const adminUsers = users?.filter(\n (user) =>\n user.permissions.includes('admin') ||\n user.permissions.includes('super-admin'),\n );\n\n // Separate non-admin users\n const regularUsers = users?.filter(\n (user) =>\n !user.permissions.includes('admin') &&\n !user.permissions.includes('super-admin'),\n );\n\n return (\n \n \n Invite & Manage Users\n \n Manage users associated with station {stationName}\n \n \n \n \n\n {/* Regular Users Table */}\n \n \n {regularUsers?.map((user) => )}\n {permissions.hasPermission(['admin', 'super-admin']) &&\n adminUsers &&\n adminUsers?.length > 0 && (\n <>\n

\n Admin Users\n

\n\n {adminUsers.map((user) => (\n \n ))}\n \n )}\n
\n
\n
\n
\n );\n}\n","import { supabase } from \"../../supabase\";\n\n// To regenerate this file, run the CLI command `deno run --allow-read --allow-write --allow-sys schema_to_ts.ts`. The script is located in the supabase-functions directory.\n\n/**\n * This interface was referenced by `Interface`'s JSON-Schema\n * via the `definition` \"getStoresResponse\".\n */\nexport type GetStoresResponse = {\n address: Address;\n manager: Manager;\n storeNum: string;\n shipperName?: string;\n}[];\n\n\n/**\n * This interface was referenced by `Interface`'s JSON-Schema\n * via the `definition` \"address\".\n */\nexport interface Address {\n name?: string;\n street: string;\n city: string;\n state: string;\n zip: string;\n}\n/**\n * This interface was referenced by `Interface`'s JSON-Schema\n * via the `definition` \"manager\".\n */\nexport interface Manager {\n name: string;\n email: string;\n phone: string;\n}\n/**\n * This interface was referenced by `Interface`'s JSON-Schema\n * via the `definition` \"getStoresParams\".\n */\nexport interface GetStoresParams {\n function: \"get-stores\";\n stationId: string;\n}\n\n\nexport async function getStores(\n params: Omit,\n){\n try {\n const result = await supabase.functions.invoke( \n 'stations-api',\n { body: { ...params, function: 'get-stores' }},\n );\n\n if (!result.error && result.data) {\n return result.data;\n } else if (result.error) {\n throw new Error(\"Error Fetching Result in stations-api/getStores:\" + result.error);\n } else {\n throw new Error('Unknown error: result does not contain data or error.');\n }\n } catch (error) {\n console.error('Error:', error);\n throw error;\n }\n}\n","import { Button } from '@/components/primitives/Button';\nimport {\n Table,\n TableBody,\n TableCell,\n TableHead,\n TableHeader,\n TableRow,\n} from '@/components/primitives/Table';\nimport {\n Tooltip,\n TooltipContent,\n TooltipProvider,\n TooltipTrigger,\n} from '@/components/primitives/Tooltip';\nimport { getStores } from '@/data/SupabaseRequests/stations-api/getStores';\nimport { useStationContext } from '@/pages/station/StationURLContext';\nimport { useQuery } from 'react-query';\n\nexport function StationStores() {\n const { selectedStation: stationId } = useStationContext();\n\n const { data: stores } = useQuery({\n queryKey: ['stations', stationId, 'stores'],\n queryFn: async () => {\n return await getStores({ stationId: stationId! });\n },\n });\n\n return (\n \n \n \n Store\n Address\n Shipper\n Manager\n \n \n \n {stores?.map((store) => (\n \n \n ({store.storeNum}) {store.address.name}\n \n \n
\n
{store.address.street}
\n
\n {store.address.city}, {store.address.state}{' '}\n {store.address.zip}\n
\n
\n
\n \n
{store.shipperName}
\n
\n\n \n \n \n \n {store.manager.name}\n \n \n

Email: {store.manager.email}

\n

Phone: {store.manager.phone}

\n
\n
\n
\n
\n
\n ))}\n
\n
\n );\n}\n","import { supabase } from \"../../supabase\";\n\n// To regenerate this file, run the CLI command `deno run --allow-read --allow-write --allow-sys schema_to_ts.ts`. The script is located in the supabase-functions directory.\n\n/**\n * This interface was referenced by `Interface`'s JSON-Schema\n * via the `definition` \"regionCarrierStation\".\n */\nexport type RegionCarrierStation = {\n id: string;\n name: string;\n abbreviation: string;\n} | null;\n/**\n * This interface was referenced by `Interface`'s JSON-Schema\n * via the `definition` \"regionCarrier\".\n */\nexport type RegionCarrier = {\n id: string;\n name: string;\n abbreviation?: string;\n station: RegionCarrierStation1;\n} | null;\n/**\n * This interface was referenced by `Interface`'s JSON-Schema\n * via the `definition` \"getRegionsResponse\".\n */\nexport type GetRegionsResponse = {\n id: string;\n name: string;\n carrier: RegionCarrier1;\n stores: string;\n}[];\n\n\nexport interface RegionCarrierStation1 {\n id: string;\n name: string;\n abbreviation: string;\n}\n/**\n * This interface was referenced by `Interface`'s JSON-Schema\n * via the `definition` \"getRegionsParams\".\n */\nexport interface GetRegionsParams {\n function: \"get-regions\";\n stationId: string;\n}\nexport interface RegionCarrier1 {\n id: string;\n name: string;\n abbreviation?: string;\n station: RegionCarrierStation1;\n}\n\n\nexport async function getRegions(\n params: Omit,\n){\n try {\n const result = await supabase.functions.invoke( \n 'stations-api',\n { body: { ...params, function: 'get-regions' }},\n );\n\n if (!result.error && result.data) {\n return result.data;\n } else if (result.error) {\n throw new Error(\"Error Fetching Result in stations-api/getRegions:\" + result.error);\n } else {\n throw new Error('Unknown error: result does not contain data or error.');\n }\n } catch (error) {\n console.error('Error:', error);\n throw error;\n }\n}\n","import {\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuGroup,\n DropdownMenuItem,\n DropdownMenuPortal,\n DropdownMenuSub,\n DropdownMenuSubContent,\n DropdownMenuSubTrigger,\n DropdownMenuTrigger,\n} from '@/components/primitives/DropdownMenu';\nimport { EllipsisVertical } from 'lucide-react';\n\ntype StoreOptionsMenuProps = {\n regionId: string;\n onEdit: () => void;\n onDelete: () => void;\n};\n\nexport function RegionsOptionsMenu({\n regionId,\n onEdit,\n onDelete,\n}: StoreOptionsMenuProps) {\n return (\n \n \n \n \n \n Edit Region\n \n Delete Region\n \n \n Move To Station \n \n \n \n Station 1\n Station 2\n Station 3\n \n \n \n \n \n \n );\n}\n","import { supabase } from \"../../supabase\";\n\n// To regenerate this file, run the CLI command `deno run --allow-read --allow-write --allow-sys schema_to_ts.ts`. The script is located in the supabase-functions directory.\n\n\n/**\n * This interface was referenced by `Interface`'s JSON-Schema\n * via the `definition` \"getDestinationStationsParams\".\n */\nexport interface GetDestinationStationsParams {\n function: \"get-destination-stations\";\n}\n/**\n * This interface was referenced by `Interface`'s JSON-Schema\n * via the `definition` \"getDestinationStationsResponse\".\n */\nexport interface GetDestinationStationsResponse {\n destinationStations?: {\n id: string;\n name: string;\n code: string;\n org_name: string;\n org_id: string;\n }[];\n}\n\n\nexport async function getDestinationStations(\n params: Omit,\n){\n try {\n const result = await supabase.functions.invoke( \n 'stations-api',\n { body: { ...params, function: 'get-destination-stations' }},\n );\n\n if (!result.error && result.data) {\n return result.data;\n } else if (result.error) {\n throw new Error(\"Error Fetching Result in stations-api/getDestinationStations:\" + result.error);\n } else {\n throw new Error('Unknown error: result does not contain data or error.');\n }\n } catch (error) {\n console.error('Error:', error);\n throw error;\n }\n}\n","import { supabase } from \"../../supabase\";\n\n// To regenerate this file, run the CLI command `deno run --allow-read --allow-write --allow-sys schema_to_ts.ts`. The script is located in the supabase-functions directory.\n\n\n/**\n * This interface was referenced by `Interface`'s JSON-Schema\n * via the `definition` \"updateRegionParams\".\n */\nexport interface UpdateRegionParams {\n function: \"update-region\";\n id: string;\n name: string;\n destinationStationID: string | null;\n carrierId: string | null;\n}\n\n\nexport async function updateRegion(\n params: Omit,\n): Promise{\n try {\n const result = await supabase.functions.invoke( \n 'stations-api',\n { body: { ...params, function: 'update-region' }},\n );\n\n if (!result.error && result.data) {\n return;\n } else if (result.error) {\n throw new Error(\"Error Fetching Result in stations-api/updateRegion:\" + result.error);\n } else {\n throw new Error('Unknown error: result does not contain data or error.');\n }\n } catch (error) {\n console.error('Error:', error);\n throw error;\n }\n}\n","import { supabase } from \"../../supabase\";\n\n// To regenerate this file, run the CLI command `deno run --allow-read --allow-write --allow-sys schema_to_ts.ts`. The script is located in the supabase-functions directory.\n\n/**\n * This interface was referenced by `Interface`'s JSON-Schema\n * via the `definition` \"addRegionResponse\".\n */\nexport type AddRegionResponse = string;\n\n\n/**\n * This interface was referenced by `Interface`'s JSON-Schema\n * via the `definition` \"addRegionParams\".\n */\nexport interface AddRegionParams {\n function: \"add-region\";\n name: string;\n originStationID: string;\n destinationStationID: string | null;\n carrierId: string | null;\n}\n\n\nexport async function addRegion(\n params: Omit,\n){\n try {\n const result = await supabase.functions.invoke( \n 'stations-api',\n { body: { ...params, function: 'add-region' }},\n );\n\n if (!result.error && result.data) {\n return result.data;\n } else if (result.error) {\n throw new Error(\"Error Fetching Result in stations-api/addRegion:\" + result.error);\n } else {\n throw new Error('Unknown error: result does not contain data or error.');\n }\n } catch (error) {\n console.error('Error:', error);\n throw error;\n }\n}\n","'use client';\n\nimport { useEffect, useState } from 'react';\nimport { ArrowLeft, Car, Edit } from 'lucide-react';\nimport { Card, CardContent } from '@/components/primitives/Card';\nimport { Button } from '@/components/primitives/Button';\nimport { Region } from './_models';\nimport { RegionsOptionsMenu } from './RegionOptionsMenu';\nimport { Input } from '@/components/primitives/Input';\nimport {\n Select,\n SelectContent,\n SelectItem,\n SelectTrigger,\n SelectValue,\n} from '@/components/primitives/Select';\nimport { useQuery, useQueryClient } from 'react-query';\nimport { getDestinationStations } from '@/data/SupabaseRequests/stations-api/getDestinationStations';\nimport { updateRegion } from '@/data/SupabaseRequests/stations-api/updateRegion';\nimport { useStationContext } from '@/pages/station/StationURLContext';\nimport { addRegion } from '@/data/SupabaseRequests/stations-api/addRegion';\nimport { cn } from '@/lib/utils';\n\ntype RegionCardProps = {\n region: Region;\n isAddRegionCard: boolean;\n onCancel?: () => void;\n};\n\nexport function RegionCard({\n region,\n isAddRegionCard,\n onCancel,\n}: RegionCardProps) {\n const [isEditing, setIsEditing] = useState(isAddRegionCard);\n const [name, setName] = useState(region.name);\n const [selectedCarrier, setSelectedCarrier] = useState(\n region.carrier ? region.carrier.id : null,\n );\n const [selectedStation, setSelectedStation] = useState(\n region.carrier\n ? region.carrier.station\n ? region.carrier.station.id\n : null\n : null,\n );\n\n const {\n selectedStation: stationId,\n setSelectedRegion,\n selectedRegion,\n } = useStationContext();\n const queryClient = useQueryClient();\n\n const { data: stations } = useQuery({\n queryKey: ['customers'],\n queryFn: () => getDestinationStations({}),\n enabled: !!isEditing,\n });\n\n const carrierList = [\n ...new Map(\n stations?.destinationStations?.map((station) => [\n station.org_id,\n { id: station.org_id, name: station.org_name },\n ]),\n ).values(),\n ];\n\n async function handleSubmit() {\n if (isAddRegionCard) {\n if (!stationId) return;\n await addRegion({\n name,\n carrierId: selectedCarrier,\n destinationStationID: selectedStation,\n originStationID: stationId,\n });\n setIsEditing(false);\n onCancel && onCancel();\n queryClient.invalidateQueries(['stations', stationId, 'regions']);\n }\n await updateRegion({\n id: region.id,\n name,\n carrierId: selectedCarrier,\n destinationStationID: selectedStation,\n });\n setIsEditing(false);\n queryClient.invalidateQueries(['stations', stationId, 'regions']);\n }\n\n const onArrowClick = () => {\n if (isAddRegionCard && onCancel) {\n onCancel();\n } else if (isEditing) {\n setIsEditing(false);\n }\n };\n\n return (\n setSelectedRegion(region.id)}\n >\n \n {isEditing ? (\n <>\n {/* Name Field */}\n setName(e.target.value)}\n placeholder=\"Region Name\"\n className=\"mb-2 bg-white\"\n />\n\n {/* Carrier Dropdown */}\n \n \n \n \n \n {carrierList.map((carrier) => (\n \n {carrier.name}\n \n ))}\n \n \n\n {/* Station Dropdown (Disabled if Carrier is null) */}\n \n \n \n \n \n {stations?.destinationStations?.map((station) => (\n \n {station.name}\n \n ))}\n \n \n\n {/* Action Buttons */}\n
\n {/* Back Arrow for Cancel */}\n \n \n Submit\n \n
\n \n ) : (\n <>\n {/* Display Mode */}\n

{region.name}

\n\n

\n {region.carrier ? region.carrier.name : 'No Carrier Assigned'}\n

\n\n

\n {region.carrier?.station\n ? `${region.carrier.station.name} (${region.carrier.station.abbreviation})`\n : 'No Station Assigned'}\n

\n\n

{region.stores} stores

\n\n {/* Options Menu */}\n setIsEditing(true)}\n onDelete={() => console.error('Function not implemented.')}\n />\n \n )}\n
\n \n );\n}\n","import { add } from 'date-fns';\nimport { Region } from './_models';\nimport { RegionCard } from './RegionCard';\nimport { useState } from 'react';\n\n// Sample regions data\n\ntype RegionListProps = {\n regions: Region[];\n isLoading?: boolean;\n error?: string;\n};\n\nexport default function RegionList({\n regions,\n isLoading = false,\n error,\n}: RegionListProps) {\n if (isLoading) {\n return
Loading regions...
;\n }\n\n if (error) {\n return
Error: {error}
;\n }\n\n if (regions.length === 0) {\n return
No regions found
;\n }\n return (\n
\n {regions.map((region) => (\n \n ))}\n
\n );\n}\n","import { supabase } from \"../../supabase\";\n\n// To regenerate this file, run the CLI command `deno run --allow-read --allow-write --allow-sys schema_to_ts.ts`. The script is located in the supabase-functions directory.\n\n/**\n * This interface was referenced by `Interface`'s JSON-Schema\n * via the `definition` \"getStoresByRegionResponse\".\n */\nexport type GetStoresByRegionResponse = {\n id: string;\n name: string;\n referenceId: string;\n city: string;\n state: string;\n zip: string;\n}[];\n\n\n/**\n * This interface was referenced by `Interface`'s JSON-Schema\n * via the `definition` \"getStoresByRegionParams\".\n */\nexport interface GetStoresByRegionParams {\n function: \"get-stores-by-region\";\n regionId: string;\n}\n\n\nexport async function getStoresByRegion(\n params: Omit,\n){\n try {\n const result = await supabase.functions.invoke( \n 'stations-api',\n { body: { ...params, function: 'get-stores-by-region' }},\n );\n\n if (!result.error && result.data) {\n return result.data;\n } else if (result.error) {\n throw new Error(\"Error Fetching Result in stations-api/getStoresByRegion:\" + result.error);\n } else {\n throw new Error('Unknown error: result does not contain data or error.');\n }\n } catch (error) {\n console.error('Error:', error);\n throw error;\n }\n}\n","import {\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuGroup,\n DropdownMenuItem,\n DropdownMenuPortal,\n DropdownMenuSub,\n DropdownMenuSubContent,\n DropdownMenuSubTrigger,\n DropdownMenuTrigger,\n} from '@/components/primitives/DropdownMenu';\nimport { EllipsisVertical } from 'lucide-react';\n\ntype StoreOptionsMenuProps = {\n storeId: string;\n onEdit: () => void;\n onDelete: () => void;\n};\n\nexport function StoreOptionsMenu({\n storeId,\n onEdit,\n onDelete,\n}: StoreOptionsMenuProps) {\n return (\n \n \n \n \n \n Edit Store\n \n Delete Store\n \n \n Move To: \n \n \n \n Region 1\n Region 2\n Region 3\n \n \n \n \n \n \n );\n}\n","import { Edit, EllipsisVertical } from 'lucide-react';\nimport { Card, CardContent } from '@/components/primitives/Card';\nimport { cn } from '@/lib/utils';\nimport { StoreOptionsMenu } from './StoreOptionsMenu';\nimport { useState } from 'react';\nimport { Store } from './_models';\n\ninterface StoreCardProps {\n store: Store;\n}\n\nexport function StoreCard({ store }: StoreCardProps) {\n const [isEditing, setIsEditing] = useState(false);\n return (\n \n \n
Store #{store.referenceId}
\n
\n {store.city}, {store.state} {store.zip}\n
\n\n
\n
Schedule:
\n {/* {Object.entries(schedule).map(([day, hours]) => (\n
\n {day}: {hours}\n
\n ))} */}\n
\n\n
\n
Contact:
\n
{'Contact Name'}
\n
{'Contact Email'}
\n
{'Contact Phone'}
\n
\n\n setIsEditing(true)}\n onDelete={() => alert(`Delete Store #${store.referenceId}`)}\n />\n
\n \n );\n}\n","import { getStoresByRegion } from '@/data/SupabaseRequests/stations-api/getStoresByRegion';\nimport { useStationContext } from '@/pages/station/StationURLContext';\nimport { useQuery } from 'react-query';\nimport { StoreCard } from './StoreCard';\n\nexport function RegionStores() {\n const { selectedRegion, selectedStation } = useStationContext();\n\n const { data: stores } = useQuery({\n queryKey: [\n 'stations',\n selectedStation,\n 'regions',\n selectedRegion,\n 'stores',\n ],\n queryFn: () => getStoresByRegion({ regionId: selectedRegion! }),\n enabled: !!selectedRegion,\n });\n\n return (\n
\n {stores?.length === 0 && (\n
\n No stores found\n
\n )}\n {stores?.map((store) => )}\n
\n );\n}\n","import { supabase } from \"../../supabase\";\n\n// To regenerate this file, run the CLI command `deno run --allow-read --allow-write --allow-sys schema_to_ts.ts`. The script is located in the supabase-functions directory.\n\n\n/**\n * This interface was referenced by `Interface`'s JSON-Schema\n * via the `definition` \"uploadStoreAddressData\".\n */\nexport interface UploadStoreAddressData {\n name?: string;\n line1?: string;\n line2?: string;\n city: string;\n state: string;\n zip: string;\n lat?: number;\n long?: number;\n}\n/**\n * This interface was referenced by `Interface`'s JSON-Schema\n * via the `definition` \"uploadStoreStoreData\".\n */\nexport interface UploadStoreStoreData {\n region: string;\n contactName?: string;\n contactEmail?: string;\n contactPhone?: string;\n referenceId: string;\n timezone: string;\n schedule?: {\n M?: boolean | null;\n T?: boolean | null;\n W?: boolean | null;\n Th?: boolean | null;\n F?: boolean | null;\n Sa?: boolean | null;\n Su?: boolean | null;\n } | null;\n scheduleTime?: {\n start?: string | null;\n end?: string | null;\n } | null;\n}\n/**\n * This interface was referenced by `Interface`'s JSON-Schema\n * via the `definition` \"uploadStore\".\n */\nexport interface UploadStore {\n storeData: UploadStoreStoreData;\n addressData: UploadStoreAddressData;\n}\n/**\n * This interface was referenced by `Interface`'s JSON-Schema\n * via the `definition` \"uploadStoresParams\".\n */\nexport interface UploadStoresParams {\n function: \"upload-stores\";\n csvData: string;\n regionId: string;\n preview: boolean;\n}\n/**\n * This interface was referenced by `Interface`'s JSON-Schema\n * via the `definition` \"uploadStoresResponse\".\n */\nexport interface UploadStoresResponse {\n stores: UploadStore[];\n errors: string[];\n}\n\n\nexport async function uploadStores(\n params: Omit,\n){\n try {\n const result = await supabase.functions.invoke( \n 'stations-api',\n { body: { ...params, function: 'upload-stores' }},\n );\n\n if (!result.error && result.data) {\n return result.data;\n } else if (result.error) {\n throw new Error(\"Error Fetching Result in stations-api/uploadStores:\" + result.error);\n } else {\n throw new Error('Unknown error: result does not contain data or error.');\n }\n } catch (error) {\n console.error('Error:', error);\n throw error;\n }\n}\n","import { Button } from '@/components/primitives/Button';\nimport {\n Card,\n CardContent,\n CardFooter,\n CardHeader,\n} from '@/components/primitives/Card';\nimport { UploadStore } from '@/data/SupabaseRequests/stations-api/uploadStores';\n\ntype Props = {\n stores: UploadStore[];\n onSubmit: () => void;\n onCancel: () => void;\n};\n\nexport function PreviewStores({ stores, onSubmit, onCancel }: Props) {\n return (\n
\n

\n The following stores will be created(Edit CSV for any changes)\n

\n
\n
\n {stores.map((store) => (\n \n {store.storeData.referenceId}\n \n
\n {store.addressData.city}, {store.addressData.state}{' '}\n {store.addressData.zip}\n
\n\n
\n
Schedule:
\n {/* {Object.entries(schedule).map(([day, hours]) => (\n
\n {day}: {hours}\n
\n ))} */}\n
\n\n
\n
Contact:
\n
{store.storeData.contactName ?? 'None Assigned'}
\n
{store.storeData.contactEmail ?? 'None Assigned'}
\n
{store.storeData.contactPhone ?? 'None Assigned'}
\n
\n
\n \n
\n ))}\n
\n
\n
\n \n \n
\n
\n );\n}\n","import { useDropzone } from 'react-dropzone';\n\ntype Props = {\n onDrop: (acceptedFiles: File[]) => void;\n errors: string[];\n};\n\nexport function UploadDropzone({ onDrop, errors }: Props) {\n const { getRootProps, getInputProps } = useDropzone({\n onDrop,\n accept: { 'text/csv': ['.csv'] },\n });\n\n return (\n \n \n {errors.length === 0 && (\n

Drag and drop a CSV file here, or click to select a file

\n )}\n {errors.length > 0 && (\n

\n {' '}\n Reupload by dragging and dropping a CSV file here, or click to select\n a new file\n

\n )}\n \n );\n}\n","import { Card, CardContent } from '@/components/primitives/Card';\n\ntype Props = {\n errors: string[];\n};\nexport function ErrorList({ errors }: Props) {\n return (\n \n \n
    \n {errors.map((error, index) => (\n
  • \n {error}\n
  • \n ))}\n
\n
\n
\n );\n}\n","// Store Data Fields\nexport const storeDataFields = [\n {\n name: 'Store Code',\n label: 'Store Code',\n required: true,\n description: 'A unique identifier for the store',\n },\n {\n name: 'Store Contact Name',\n label: 'Store Contact Name',\n required: false,\n description: '',\n },\n {\n name: 'Store Contact Email',\n label: 'Store Contact Email',\n required: false,\n description: '',\n },\n {\n name: 'Store Contact Phone',\n label: 'Store Contact Phone',\n required: false,\n description: '',\n },\n];\n\n// Address Data Fields\nexport const addressDataFields = [\n {\n name: 'Store Name',\n label: 'Store Name',\n required: false,\n description: 'Name/Nickname of Store',\n },\n {\n name: 'Line 1',\n label: 'Line 1',\n required: true,\n description: 'The primary address of the store',\n },\n\n {\n name: 'City',\n label: 'City',\n required: true,\n description: '',\n },\n {\n name: 'State',\n label: 'State',\n required: true,\n description: '',\n },\n {\n name: 'Zip Code',\n label: 'Zip Code',\n required: true,\n description: '',\n },\n\n {\n name: 'Line 2',\n label: 'Address Line 2',\n required: false,\n description: 'Additional Information',\n },\n\n {\n name: 'Lat',\n label: 'Latitude',\n required: false,\n description: '',\n },\n {\n name: 'Long',\n label: 'Longitude',\n required: false,\n description: '',\n },\n];\n\n// Schedule Fields\nexport const scheduleFields = [\n {\n name: 'Schedule(M)',\n label: 'Schedule (Monday)',\n required: false,\n description: 'Whether the store operates on Monday',\n },\n {\n name: 'Schedule(T)',\n label: 'Schedule (Tuesday)',\n required: false,\n description: 'Whether the store operates on Tuesday',\n },\n {\n name: 'Schedule(W)',\n label: 'Schedule (Wednesday)',\n required: false,\n description: 'Whether the store operates on Wednesday',\n },\n {\n name: 'Schedule(Th)',\n label: 'Schedule (Thursday)',\n required: false,\n description: 'Whether the store operates on Thursday',\n },\n {\n name: 'Schedule(F)',\n label: 'Schedule (Friday)',\n required: false,\n description: 'Whether the store operates on Friday',\n },\n {\n name: 'Schedule(Sa)',\n label: 'Schedule (Saturday)',\n required: false,\n description: 'Whether the store operates on Saturday',\n },\n {\n name: 'Schedule(Su)',\n label: 'Schedule (Sunday)',\n required: false,\n description: 'Whether the store operates on Sunday',\n },\n {\n name: 'Schedule Start Time',\n label: 'Schedule Start Time',\n required: false,\n description: 'The time when the store’s scheduled operations begin',\n },\n {\n name: 'Schedule End Time',\n label: 'Schedule End Time',\n required: false,\n description: 'The time when the store’s scheduled operations end',\n },\n];\n","import { useState } from 'react';\nimport {\n Control,\n Controller,\n FieldValues,\n SubmitHandler,\n UseFormHandleSubmit,\n} from 'react-hook-form';\nimport { Button } from '@/components/primitives/Button';\nimport { addressDataFields, scheduleFields, storeDataFields } from './_models';\nimport { Label } from '@/components/primitives/Label';\nimport { InfoIcon } from 'lucide-react';\nimport {\n Select,\n SelectContent,\n SelectItem,\n SelectTrigger,\n SelectValue,\n} from '@/components/primitives/Select';\n\ntype Props = {\n csvHeaders: string[];\n onSubmit: SubmitHandler;\n control: Control;\n handleSubmit: UseFormHandleSubmit;\n};\n\n/** Header Mapping Form Wizard Component */\nexport function MappingForm({\n csvHeaders,\n onSubmit,\n control,\n handleSubmit,\n}: Props) {\n const [currentStep, setCurrentStep] = useState(0);\n\n // Steps of the wizard\n const steps = [\n { title: 'Store Data', fields: storeDataFields },\n { title: 'Address Data', fields: addressDataFields },\n { title: 'Schedule Details', fields: scheduleFields },\n ];\n\n const isLastStep = currentStep === steps.length - 1;\n const isFirstStep = currentStep === 0;\n\n //TODO: Implement using shadcn so we can handle required fields not being filled out\n\n return (\n {\n event.preventDefault();\n if (isLastStep) {\n handleSubmit(onSubmit)();\n } else {\n setCurrentStep((prev) => prev + 1);\n }\n }}\n className=\"mt-8\"\n >\n

{steps[currentStep].title}

\n
\n {steps[currentStep].fields.map((field) => (\n
\n \n (\n \n )}\n />\n
\n ))}\n
\n\n {/* Navigation Buttons */}\n
\n
\n {!isFirstStep ? (\n setCurrentStep((prev) => prev - 1)}\n >\n Back\n \n ) : (\n Placeholder\n )}\n
\n\n
\n \n {isLastStep ? 'Submit' : 'Next'}\n \n
\n
\n \n );\n}\n","import { useState } from 'react';\nimport Papa from 'papaparse';\nimport { useForm } from 'react-hook-form';\nimport {\n UploadStore,\n uploadStores,\n} from '@/data/SupabaseRequests/stations-api/uploadStores';\nimport { PreviewStores } from './PreviewStores';\nimport { UploadDropzone } from './UploadDropzone';\nimport { ErrorList } from './ErrorList';\nimport { MappingForm } from './MappingForm';\nimport { Button } from '@/components/primitives/Button';\nimport { useStationContext } from '@/pages/station/StationURLContext';\n\ntype Props = {\n onConfirm: () => void;\n};\n\nexport default function UploadStoresModalMain({ onConfirm }: Props) {\n const [newHeaders, setNewHeaders] = useState([]);\n const [csvData, setCsvData] = useState(null);\n const [uploadErrors, setErrors] = useState([]);\n const [previewedStores, setPreviewedStores] = useState([]);\n const { control, handleSubmit } = useForm();\n const { selectedRegion } = useStationContext();\n\n /** Handle CSV Drop */\n const onDrop = async (acceptedFiles: File[]) => {\n const file = acceptedFiles[0];\n\n setCsvData(null);\n setErrors([]);\n setPreviewedStores([]);\n setNewHeaders([]);\n\n const csvString = await new Promise((resolve, reject) => {\n Papa.parse(file, {\n complete: (result) =>\n result.data\n ? resolve(Papa.unparse(result.data))\n : reject(new Error('CSV parsing failed.')),\n error: (error) => reject(error),\n skipEmptyLines: true,\n });\n });\n\n setCsvData(Papa.parse(csvString).data as unknown as string[][]);\n };\n\n const onFileSubmit = async (data: Record) => {\n if (!csvData) {\n console.error('No CSV data available.');\n return;\n }\n\n if (!selectedRegion) {\n console.error('No region selected.');\n return;\n }\n\n // Create a mapping from uploaded headers to selected fields\n const headerMapping: Record = {};\n Object.entries(data).forEach(([selectedField, originalHeader]) => {\n if (originalHeader) {\n headerMapping[originalHeader] = selectedField; // Map old header to new field name\n }\n });\n\n // Replace headers in CSV using mapped values\n const originalHeaders = csvData[0]; // First row of CSV is headers\n const newHeaders = originalHeaders.map(\n (header) => headerMapping[header] || header, // Replace with mapped value or keep original\n );\n\n const updatedCsvData = [newHeaders, ...csvData.slice(1)];\n const csvString = Papa.unparse(updatedCsvData);\n\n setNewHeaders(newHeaders);\n\n try {\n const { errors, stores } = await uploadStores({\n csvData: csvString,\n regionId: selectedRegion,\n preview: true,\n });\n\n setErrors(errors.length > 0 ? errors : []);\n setPreviewedStores(stores.length > 0 ? stores : []);\n } catch (error) {\n setErrors(['Failed to upload stores. Please try again.']);\n }\n };\n\n const csvHeaders = csvData?.[0] || [];\n\n const onPreviewSubmit = async () => {\n if (!csvData) {\n console.error('No CSV data available.');\n return;\n }\n\n if (!selectedRegion) {\n console.error('No region selected.');\n return;\n }\n\n const updatedCsvData = [newHeaders, ...csvData.slice(1)];\n const csvString = Papa.unparse(updatedCsvData);\n\n try {\n uploadStores({\n csvData: csvString,\n regionId: selectedRegion,\n preview: false,\n });\n\n onConfirm();\n } catch (error) {\n setErrors(['Failed to upload stores. Please try again.']);\n }\n };\n\n const onCancel = () => {\n setCsvData(null);\n setErrors([]);\n setPreviewedStores([]);\n };\n\n const showMapping =\n csvData && uploadErrors.length + previewedStores.length === 0;\n const showDropZone = !csvData || uploadErrors.length > 0;\n\n return (\n
\n {showDropZone && }\n {uploadErrors.length > 0 && }\n {previewedStores.length > 0 && (\n \n )}\n {showMapping && (\n \n )}\n
\n );\n}\n","import React, { useState } from 'react';\nimport {\n Dialog,\n DialogContent,\n DialogHeader,\n DialogTitle,\n} from '@/components/primitives/Dialog';\nimport UploadStoresModalMain from './UploadStoresModalMain';\nimport { useStationContext } from '@/pages/station/StationURLContext';\nimport { useQueryClient } from 'react-query';\n\nexport function UploadStoresModal() {\n const [isOpen, setIsOpen] = useState(false);\n const { selectedStation, selectedRegion } = useStationContext();\n const queryClient = useQueryClient();\n\n function onConfirm() {\n setIsOpen(false);\n queryClient.invalidateQueries(['stations', selectedStation, 'regions']);\n }\n\n return (\n <>\n setIsOpen(true)}\n className=\"ml-4 text-blue-500 hover:underline\"\n >\n Upload Stores\n \n\n \n \n \n Upload Stores\n \n \n \n \n \n );\n}\n","import { getRegions } from '@/data/SupabaseRequests/stations-api/getRegions';\nimport { useStationContext } from '@/pages/station/StationURLContext';\nimport { useQuery } from 'react-query';\nimport { useEffect, useState } from 'react';\nimport RegionList from './RegionList';\nimport { defaultStores } from './_staticData';\nimport { StoreCard } from './StoreCard';\nimport { RegionStores } from './RegionStores';\nimport { UploadStoresModal } from './UploadStores/UploadStoresModal';\nimport { add } from 'date-fns';\nimport { RegionCard } from './RegionCard';\n\nexport function StationRegions() {\n const [editing, setEditing] = useState(false);\n const [addRegion, setAddRegion] = useState(false);\n const {\n selectedStation: stationId,\n selectedRegion,\n setSelectedRegion,\n } = useStationContext();\n\n const { data: regions } = useQuery({\n queryKey: ['stations', stationId, 'regions'],\n queryFn: () => getRegions({ stationId: stationId! }),\n enabled: !!stationId,\n });\n\n useEffect(() => {\n if (regions && regions.length > 0 && !selectedRegion) {\n setSelectedRegion(regions[0].id);\n }\n }, [regions, selectedRegion, setSelectedRegion]);\n\n useEffect(() => {\n setEditing(false);\n }, [selectedRegion]);\n\n const addRegionObject = {\n id: '',\n name: '',\n carrier: null,\n stores: '',\n };\n\n return (\n \n {/* Regions Section */}\n
\n
\n Regions\n {\n setAddRegion(!addRegion);\n }}\n >\n Add Region\n \n
\n {addRegion && (\n
\n setAddRegion(false)}\n />\n
\n )}\n {regions && (\n \n )}\n
\n\n {/* Stores Section */}\n
\n
\n Stores\n \n
\n \n
\n \n );\n}\n","import { supabase } from \"../../supabase\";\n\n// To regenerate this file, run the CLI command `deno run --allow-read --allow-write --allow-sys schema_to_ts.ts`. The script is located in the supabase-functions directory.\n\n\n/**\n * This interface was referenced by `Interface`'s JSON-Schema\n * via the `definition` \"getStationInfoParams\".\n */\nexport interface GetStationInfoParams {\n function: \"get-station-info\";\n stationId: string;\n orgType: \"carrier\" | \"shipper\";\n}\n/**\n * This interface was referenced by `Interface`'s JSON-Schema\n * via the `definition` \"getStationInfoResponse\".\n */\nexport interface GetStationInfoResponse {\n address: {\n line_1: string;\n line_2?: string;\n city: string;\n state: string;\n zip: string;\n };\n counts: {\n region?: number;\n users?: number;\n stores?: number;\n };\n}\n\n\nexport async function getStationInfo(\n params: Omit,\n){\n try {\n const result = await supabase.functions.invoke( \n 'stations-api',\n { body: { ...params, function: 'get-station-info' }},\n );\n\n if (!result.error && result.data) {\n return result.data;\n } else if (result.error) {\n throw new Error(\"Error Fetching Result in stations-api/getStationInfo:\" + result.error);\n } else {\n throw new Error('Unknown error: result does not contain data or error.');\n }\n } catch (error) {\n console.error('Error:', error);\n throw error;\n }\n}\n","import { Tab, useStationContext } from '../StationURLContext';\nimport { useQuery } from 'react-query';\nimport { Loading } from '@/layout/Loading';\nimport {\n Card,\n CardDescription,\n CardHeader,\n CardTitle,\n} from '@/components/primitives/Card';\nimport {\n Tabs,\n TabsContent,\n TabsList,\n TabsTrigger,\n} from '@/components/primitives/Tabs';\nimport { useAuth } from '@/data/auth';\nimport { Address, addressAsString } from '@/common/functions/cleanAddress';\nimport { StationUsers } from './tab/Users/StationUsers';\nimport { StationStores } from './tab/Stores/StationStores';\nimport { StationRegions } from './tab/Regions/StationRegions';\nimport { getStationInfo } from '@/data/SupabaseRequests/stations-api/getStationInfo';\n\ntype Props = {\n stationName: string;\n};\n\nexport default function SelectedStationPage({ stationName }: Props) {\n const { selectedStation, selectedTab, setSelectedTab } = useStationContext();\n const { user } = useAuth();\n\n const { data: stationInfo, isLoading } = useQuery({\n queryKey: ['station', selectedStation, 'address-info'],\n queryFn: () =>\n getStationInfo({\n stationId: selectedStation ?? '',\n orgType: user!.org_type,\n }),\n enabled: !!selectedStation,\n });\n\n if (isLoading) {\n return ;\n }\n\n return (\n
\n setSelectedTab(value as Tab)}\n className=\"min-w-[90%] \"\n >\n \n \n Manage Users ({stationInfo?.counts.users})\n \n {user?.org_type === 'carrier' ? (\n \n {stationName} Stores ({stationInfo?.counts.stores})\n \n ) : (\n \n Regions ({stationInfo?.counts.region})\n \n )}\n \n \n \n \n {user?.org_type === 'carrier' ? (\n \n \n \n ) : (\n \n \n \n )}\n \n
\n );\n}\n","import { supabase } from \"../../supabase\";\n\n// To regenerate this file, run the CLI command `deno run --allow-read --allow-write --allow-sys schema_to_ts.ts`. The script is located in the supabase-functions directory.\n\n/**\n * This interface was referenced by `Interface`'s JSON-Schema\n * via the `definition` \"getStationsLatLongResponse\".\n */\nexport type GetStationsLatLongResponse = {\n stationId: string;\n stationName: string;\n stationLat: number;\n stationLong: number;\n}[];\n\n\n/**\n * This interface was referenced by `Interface`'s JSON-Schema\n * via the `definition` \"getStationsLatLongParams\".\n */\nexport interface GetStationsLatLongParams {\n function: \"get-stations-lat-long\";\n}\n\n\nexport async function getStationsLatLong(\n params: Omit,\n){\n try {\n const result = await supabase.functions.invoke( \n 'stations-api',\n { body: { ...params, function: 'get-stations-lat-long' }},\n );\n\n if (!result.error && result.data) {\n return result.data;\n } else if (result.error) {\n throw new Error(\"Error Fetching Result in stations-api/getStationsLatLong:\" + result.error);\n } else {\n throw new Error('Unknown error: result does not contain data or error.');\n }\n } catch (error) {\n console.error('Error:', error);\n throw error;\n }\n}\n","import { supabase } from \"../../supabase\";\n\n// To regenerate this file, run the CLI command `deno run --allow-read --allow-write --allow-sys schema_to_ts.ts`. The script is located in the supabase-functions directory.\n\n\n/**\n * This interface was referenced by `Interface`'s JSON-Schema\n * via the `definition` \"storePin\".\n */\nexport interface StorePin {\n id: string;\n regionId: string;\n regionName: string;\n geocode: string;\n carrierName: string;\n}\n/**\n * This interface was referenced by `Interface`'s JSON-Schema\n * via the `definition` \"stationInfo\".\n */\nexport interface StationInfo {\n stationName: string;\n phone: string | null;\n city: string;\n state: string;\n zip: string;\n abbr: string | null;\n}\n/**\n * This interface was referenced by `Interface`'s JSON-Schema\n * via the `definition` \"getShipperStationPinsAndInfoParams\".\n */\nexport interface GetShipperStationPinsAndInfoParams {\n function: \"get-shipper-station-pins-and-info\";\n stationId: string;\n}\n/**\n * This interface was referenced by `Interface`'s JSON-Schema\n * via the `definition` \"getShipperStationPinsAndInfoResponse\".\n */\nexport interface GetShipperStationPinsAndInfoResponse {\n pins: StorePin[];\n stationInfo: StationInfo;\n}\n\n\nexport async function getShipperStationPinsAndInfo(\n params: Omit,\n){\n try {\n const result = await supabase.functions.invoke( \n 'stations-api',\n { body: { ...params, function: 'get-shipper-station-pins-and-info' }},\n );\n\n if (!result.error && result.data) {\n return result.data;\n } else if (result.error) {\n throw new Error(\"Error Fetching Result in stations-api/getShipperStationPinsAndInfo:\" + result.error);\n } else {\n throw new Error('Unknown error: result does not contain data or error.');\n }\n } catch (error) {\n console.error('Error:', error);\n throw error;\n }\n}\n","type Point = [number, number];\n\nexport function getCenter(polygon: Point[]): Point {\n if (polygon.length < 3) {\n throw new Error('A polygon must have at least three vertices.');\n }\n\n // Ensure the polygon is closed by repeating the first point at the end\n const vertices = [...polygon, polygon[0]];\n\n let area = 0; // Initialize area\n let centroidX = 0; // Initialize x-coordinate of centroid\n let centroidY = 0; // Initialize y-coordinate of centroid\n\n for (let i = 0; i < vertices.length - 1; i++) {\n const [x1, y1] = vertices[i];\n const [x2, y2] = vertices[i + 1];\n\n const crossProduct = x1 * y2 - x2 * y1;\n\n area += crossProduct;\n centroidX += (x1 + x2) * crossProduct;\n centroidY += (y1 + y2) * crossProduct;\n }\n\n area = area / 2;\n if (area === 0) {\n throw new Error(\"The polygon's area is zero; it may be degenerate.\");\n }\n\n centroidX = centroidX / (6 * area);\n centroidY = centroidY / (6 * area);\n\n return [centroidX, centroidY];\n}\n","export function jarvisMarch(points: [number, number][]): [number, number][] {\n if (points.length < 3) return points;\n\n const hull: [number, number][] = [];\n let pointOnHull = points.reduce((lowest, point) =>\n point[0] < lowest[0] ? point : lowest,\n );\n\n let endpoint;\n do {\n hull.push(pointOnHull);\n endpoint = points[0];\n for (const point of points) {\n if (endpoint === pointOnHull || ccw(pointOnHull, endpoint, point) > 0) {\n endpoint = point;\n }\n }\n pointOnHull = endpoint;\n } while (endpoint !== hull[0]);\n\n return hull;\n\n // Helper function: Calculate cross product\n function ccw(a: [number, number], b: [number, number], c: [number, number]) {\n return (b[0] - a[0]) * (c[1] - a[1]) - (b[1] - a[1]) * (c[0] - a[0]);\n }\n}\n","import { darkenHSLColor } from '@/components/map-features/helpers/darkenHSLColor';\nimport { getCenter } from '@/components/map-features/helpers/getCenter';\nimport { jarvisMarch } from '@/components/map-features/helpers/jarvisMarch';\nimport {\n getPolygonEdgesRounded,\n getPolygonNameCentered,\n} from '@/components/map-features/polygon';\nimport { GetShipperStationPinsAndInfoResponse } from '@/data/SupabaseRequests/stations-api/getShipperStationPinsAndInfo';\nimport { parseGeocode } from '@/helpers/parseGeocode';\nimport { generateColorFromId } from '@/pages/dashboard/mapFeatures/regionColors';\n\nexport interface StorePin {\n id: string;\n regionId: string;\n regionName: string;\n geocode: string;\n carrierName: string;\n}\n\nexport const getPolygon = (data: StorePin[]) => {\n // Break up pins by regionId\n const regions = data.reduce(\n (acc, store) => {\n if (!acc[store.regionId]) {\n acc[store.regionId] = [];\n }\n acc[store.regionId].push(store);\n return acc;\n },\n {} as Record,\n );\n\n const edges = Object.entries(regions).map(([regionId, stores]) => {\n const color = generateColorFromId(regionId);\n\n const allPoints: [number, number][] = stores.map((store) => {\n const { latitude, longitude } = parseGeocode(store.geocode);\n return [Number(longitude), Number(latitude)] as [number, number];\n });\n\n const bounds = jarvisMarch(allPoints);\n\n return getPolygonEdgesRounded({ id: regionId, bounds }, 0.335, color);\n });\n\n const names = Object.entries(regions).map(([regionId, stores]) => {\n const allPoints: [number, number][] = stores.map((store) => {\n const { latitude, longitude } = parseGeocode(store.geocode);\n return [Number(longitude), Number(latitude)] as [number, number];\n });\n\n const bounds = jarvisMarch(allPoints);\n const center = getCenter(bounds);\n\n return getPolygonNameCentered(\n {\n id: regionId,\n name: stores[0].regionName,\n center: center,\n },\n darkenHSLColor(generateColorFromId(regionId), 5),\n );\n });\n\n return {\n edges,\n names,\n };\n};\n","// Utility function to check if a point is inside a polygon\nexport function isPointInPolygon(\n point: [number, number],\n polygon: [number, number][],\n): boolean {\n const [x, y] = point;\n let inside = false;\n\n for (let i = 0, j = polygon.length - 1; i < polygon.length; j = i++) {\n const [xi, yi] = polygon[i];\n const [xj, yj] = polygon[j];\n\n const intersect =\n yi > y !== yj > y && // Check if point is between y-coordinates of edge\n x < ((xj - xi) * (y - yi)) / (yj - yi) + xi; // Calculate x intersection\n\n if (intersect) {\n inside = !inside; // Flip the boolean each time an edge is crossed\n }\n }\n\n return inside;\n}\n","import { MapLayerMouseEvent } from 'mapbox-gl';\n\nexport interface ParsedAddress {\n line1: string;\n city: string;\n state: string;\n zip: string;\n lat: number;\n lng: number;\n}\n\nexport function parseMapboxEvent(event: MapLayerMouseEvent): ParsedAddress {\n const features = event.features;\n\n if (!features || features.length === 0) {\n throw new Error('No features found in the event');\n }\n\n const properties = features[0].properties;\n\n if (!properties) {\n throw new Error('No properties found in the event');\n }\n\n console.log(properties);\n\n const address: ParsedAddress = {\n line1: properties.address,\n city: properties.context.place.name,\n state: properties.context.region.region_code,\n zip: properties.context.postcode.name,\n lat: properties.coordinates.latitude,\n lng: properties.coordinates.longitude,\n };\n\n return address;\n}\n","import { ParsedAddress } from '@/common/types/parseMapboxEvent';\nimport { Input } from '@/components/primitives/Input';\nimport { Button } from '@/components/primitives/Button';\nimport { useState } from 'react';\n\ntype Props = {\n stationAddress: ParsedAddress;\n onSubmit: (name: string, code: string) => Promise;\n onCancel?: () => void;\n};\n\nexport function NewStationForm({ stationAddress, onSubmit, onCancel }: Props) {\n const [formData, setFormData] = useState({\n name: '',\n code: '',\n });\n\n const handleChange = (e: React.ChangeEvent) => {\n const { name, value } = e.target;\n setFormData((prev) => ({ ...prev, [name]: value }));\n };\n\n const handleSubmit = (e: React.FormEvent) => {\n e.preventDefault();\n onSubmit(formData.name, formData.code);\n };\n\n return (\n
\n
\n \n \n
\n\n
\n
\n \n \n
\n
\n \n \n
\n
\n\n
\n \n \n
\n\n
\n \n \n
\n\n
\n \n \n
\n\n
\n {onCancel && (\n \n )}\n \n
\n
\n );\n}\n","import { supabase } from \"../../supabase\";\n\n// To regenerate this file, run the CLI command `deno run --allow-read --allow-write --allow-sys schema_to_ts.ts`. The script is located in the supabase-functions directory.\n\n/**\n * This interface was referenced by `Interface`'s JSON-Schema\n * via the `definition` \"uploadStationResponse\".\n */\nexport type UploadStationResponse = string;\n\n\n/**\n * This interface was referenced by `Interface`'s JSON-Schema\n * via the `definition` \"uploadStationParams\".\n */\nexport interface UploadStationParams {\n function: \"upload-station\";\n stationName: string;\n stationCode: string;\n line1: string;\n line2?: string;\n city: string;\n state: string;\n zip: string;\n}\n\n\nexport async function uploadStation(\n params: Omit,\n){\n try {\n const result = await supabase.functions.invoke( \n 'stations-api',\n { body: { ...params, function: 'upload-station' }},\n );\n\n if (!result.error && result.data) {\n return result.data;\n } else if (result.error) {\n throw new Error(\"Error Fetching Result in stations-api/uploadStation:\" + result.error);\n } else {\n throw new Error('Unknown error: result does not contain data or error.');\n }\n } catch (error) {\n console.error('Error:', error);\n throw error;\n }\n}\n","import { GetStationsLatLongResponse } from '@/data/SupabaseRequests/stations-api/getStationsLatLong';\nimport { uploadStation } from '@/data/SupabaseRequests/stations-api/uploadStation';\nimport { useMutation, useQueryClient } from 'react-query';\n\nexport function useAddStation() {\n const queryClient = useQueryClient();\n\n return useMutation(\n async ({\n line1,\n city,\n state,\n zip,\n name,\n code,\n lat,\n lng,\n }: {\n line1: string;\n city: string;\n state: string;\n zip: string;\n name: string;\n code: string;\n lat: number;\n lng: number;\n }) => {\n const stations: GetStationsLatLongResponse | undefined =\n queryClient.getQueryData(['stations', 'latLongs']);\n\n if (stations) {\n try {\n const id = await uploadStation({\n stationName: name,\n stationCode: code,\n line1: line1,\n city: city,\n state: state,\n zip: zip,\n });\n\n queryClient.setQueryData(\n ['stations', 'latLongs'],\n [\n ...stations,\n {\n stationName: name,\n stationId: id,\n stationLat: lat,\n stationLong: lng,\n },\n ],\n );\n\n return id;\n } catch (error) {\n console.error('Error:', error);\n throw error;\n }\n }\n },\n );\n}\n","\"use client\"\n\nimport * as React from \"react\"\nimport * as RadioGroupPrimitive from \"@radix-ui/react-radio-group\"\nimport { Circle } from \"lucide-react\"\n\nimport { cn } from \"@/lib/utils\"\n\nconst RadioGroup = React.forwardRef<\n React.ElementRef,\n React.ComponentPropsWithoutRef\n>(({ className, ...props }, ref) => {\n return (\n \n )\n})\nRadioGroup.displayName = RadioGroupPrimitive.Root.displayName\n\nconst RadioGroupItem = React.forwardRef<\n React.ElementRef,\n React.ComponentPropsWithoutRef\n>(({ className, children, ...props }, ref) => {\n return (\n \n \n \n \n \n )\n})\nRadioGroupItem.displayName = RadioGroupPrimitive.Item.displayName\n\nexport { RadioGroup, RadioGroupItem }\n","import { ParsedAddress } from '@/common/types/parseMapboxEvent';\nimport { Button } from '@/components/primitives/Button';\nimport {\n Card,\n CardHeader,\n CardDescription,\n CardContent,\n CardTitle,\n CardFooter,\n} from '@/components/primitives/Card';\nimport { Input } from '@/components/primitives/Input';\nimport { Label } from '@/components/primitives/Label';\nimport { RadioGroup, RadioGroupItem } from '@/components/primitives/RadioGroup';\nimport {\n Select,\n SelectTrigger,\n SelectValue,\n SelectContent,\n SelectItem,\n} from '@/components/primitives/Select';\nimport { useState } from 'react';\n\ntype Props = {\n address: ParsedAddress;\n};\n\nexport default function StoreContactForm({ address }: Props) {\n const [scheduleDay, setScheduleDay] = useState('monday');\n\n const handleSubmit = (event: React.FormEvent) => {\n event.preventDefault();\n console.log('Form submitted');\n };\n\n return (\n
\n \n {/* Contact Details Section */}\n
\n
\n \n \n
\n
\n \n \n
\n
\n \n \n
\n
\n \n \n
\n
\n \n \n
\n
\n \n \n
\n
\n\n {/* Schedule Day */}\n
\n \n \n {['M', 'T', 'W', 'TH', 'F'].map((day, index) => (\n
\n \n \n
\n ))}\n \n
\n
\n\n \n \n \n
\n );\n}\n","export function calculateDistance(\n lat1: number,\n lon1: number,\n lat2: number,\n lon2: number,\n) {\n const R = 6371; // Radius of the Earth in km\n const dLat = (lat2 - lat1) * (Math.PI / 180);\n const dLon = (lon2 - lon1) * (Math.PI / 180);\n const a =\n Math.sin(dLat / 2) * Math.sin(dLat / 2) +\n Math.cos(lat1 * (Math.PI / 180)) *\n Math.cos(lat2 * (Math.PI / 180)) *\n Math.sin(dLon / 2) *\n Math.sin(dLon / 2);\n const c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));\n return R * c * 1000; // Distance in meters\n}\n","import { useStationContext } from './StationURLContext';\nimport {\n FullscreenControl,\n NavigationControl,\n Map,\n Projection,\n Source,\n Layer,\n MapRef,\n Popup,\n} from 'react-map-gl';\nimport { GetStationsLatLongResponse } from '@/data/SupabaseRequests/stations-api/getStationsLatLong';\nimport { Pin } from '../dashboard/mapFeatures/Pin';\nimport { useQuery } from 'react-query';\nimport { getShipperStationPinsAndInfo } from '@/data/SupabaseRequests/stations-api/getShipperStationPinsAndInfo';\nimport { useMemo, useRef, useState } from 'react';\nimport {\n getPolygonEdgeLayerStyle,\n getPolygonLabelLayerStyle,\n getPolygonLayerStyle,\n} from '@/components/map-features/polygon';\nimport { getPolygon } from './functions/getPolygon';\nimport { isPointInPolygon } from '@/components/map-features/helpers/isPointInPolygon';\nimport { getCenter } from '@/components/map-features/helpers/getCenter';\nimport { Polygon, MultiPolygon } from 'geojson';\nimport { parseGeocode } from '@/helpers/parseGeocode';\nimport {\n ParsedAddress,\n parseMapboxEvent,\n} from '@/common/types/parseMapboxEvent';\nimport { SearchBox } from '@mapbox/search-js-react';\nimport { Button } from '@/components/primitives/Button';\nimport { FlyToOptions } from 'mapbox-gl';\nimport { NewStationForm } from './NewStationForm';\nimport { useAddStation } from './mutations';\nimport NewStoreForm from './NewStoreForm';\nimport { calculateDistance } from '@/components/map-features/helpers/calculateDistance';\n\ntype Props = {\n stations: GetStationsLatLongResponse;\n};\n\nexport default function ShipperMap({ stations }: Props) {\n const {\n selectedStation,\n selectedRegion,\n setSelectedStore,\n selectedStore,\n setSelectedStation,\n setSelectedRegion,\n setSelectedTab,\n } = useStationContext();\n\n const [searchExpanded, setSearchExpanded] = useState(false);\n const [address, setAddress] = useState(null);\n const [selected, setSelected] = useState<'store' | 'station' | null>(null);\n\n const handleStationSelect = (stationId: string) => {\n setSelectedStation(stationId);\n };\n\n const mapRef = useRef(null);\n\n const addStationMutation = useAddStation();\n\n const { data: storesAndInfo } = useQuery({\n queryKey: ['station', selectedStation, 'map'],\n queryFn: () =>\n getShipperStationPinsAndInfo({\n stationId: selectedStation!,\n }),\n enabled: !!selectedStation,\n });\n\n const polygons = useMemo(() => {\n if (!storesAndInfo) return null;\n\n const { names, edges } = getPolygon(storesAndInfo.pins);\n\n return {\n edges,\n names,\n };\n }, [storesAndInfo]);\n\n const handleMapClick = (event: mapboxgl.MapLayerMouseEvent) => {\n const { lng, lat } = event.lngLat;\n const clickedPoint: [number, number] = [lng, lat];\n\n for (const region of polygons?.edges ?? []) {\n if (\n region.geometry.type === 'Polygon' ||\n region.geometry.type === 'MultiPolygon'\n ) {\n const coords = (region.geometry as Polygon | MultiPolygon)\n .coordinates[0];\n\n // Ensure coords is a flat array of [number, number]\n const formattedCoords: [number, number][] = coords as [\n number,\n number,\n ][];\n\n if (\n region.properties &&\n isPointInPolygon(clickedPoint, formattedCoords)\n ) {\n const center = getCenter(formattedCoords as [number, number][]); // Ensure correct format\n setSelectedTab('regions');\n setSelectedRegion(region.properties.id);\n\n if (mapRef.current) {\n mapRef.current.flyTo({\n center: [center[0], center[1]],\n essential: true,\n duration: 1000,\n zoom: 5,\n });\n }\n\n return;\n }\n }\n }\n\n setSelectedRegion(null);\n };\n\n const storePinsForSelectedRegion = storesAndInfo?.pins.filter(\n (store) => store.regionId === selectedRegion,\n );\n\n const handleCreateStationClick = () => {\n if (searchExpanded) {\n setSearchExpanded(false);\n } else {\n setSearchExpanded(true);\n setSelected('station');\n }\n };\n\n const handleCreateStoreClick = () => {\n if (searchExpanded) {\n setSearchExpanded(false);\n } else {\n setSearchExpanded(true);\n setSelected('store');\n }\n };\n\n const handleSearchResult = (event: any) => {\n setAddress(null);\n const parsedAddress = parseMapboxEvent(event);\n const { lat, lng } = parsedAddress;\n\n if (mapRef.current) {\n const map = mapRef.current;\n\n map.once('moveend', () => {\n setAddress(parsedAddress); // Show the form after flying\n });\n\n const currentCenter = map.getCenter();\n\n const distance = calculateDistance(\n currentCenter.lat,\n currentCenter.lng,\n lat,\n lng,\n );\n\n const speed = Math.min(1.5, Math.max(0.5, distance / 500)); // Customize as needed\n\n const point = map.project([lng, lat]);\n const offsetX = 0;\n const newCenter = map.unproject([point.x - offsetX, point.y]);\n\n map.flyTo({\n center: [newCenter.lng, newCenter.lat],\n zoom: 10,\n speed: speed,\n });\n }\n };\n\n const handleCancelClick = () => {\n setSearchExpanded(false);\n setAddress(null);\n\n mapRef.current?.flyTo({\n center: [-98.7129, 37.0902],\n zoom: 3.5,\n speed: 1.8,\n } as FlyToOptions);\n };\n\n const onCreateStation = async (name: string, code: string) => {\n if (!address) return;\n addStationMutation.mutate({\n line1: address.line1 ?? 'UNKNOWN STREET',\n city: address.city,\n state: address.state,\n zip: address.zip,\n name,\n code,\n lat: address.lat,\n lng: address.lng,\n });\n\n setAddress(null);\n };\n\n return (\n
\n \n
\n \n {searchExpanded && (\n \n )}\n
\n {searchExpanded && (\n \n )}\n {!searchExpanded && (\n \n )}\n {!searchExpanded && (\n \n )}\n
\n \n \n {polygons?.edges && (\n \n \n \n )}\n {polygons?.edges && (\n \n \n \n )}\n {polygons?.names && (\n \n \n \n )}\n {stations.map((station) => {\n const { stationLat, stationLong } = station;\n return (\n
handleStationSelect(station.stationId)}>\n \n
\n );\n })}\n {storePinsForSelectedRegion?.map((store) => {\n if (selectedRegion && store.regionId !== selectedRegion) return null;\n const { latitude, longitude } = parseGeocode(store.geocode);\n return (\n {\n setSelectedStore(store.id);\n e.stopPropagation();\n }}\n >\n \n \n );\n })}\n {address && selected === 'store' && (\n <>\n \n \n \n \n \n )}\n {address && selected === 'station' && (\n <>\n \n \n \n \n \n )}\n \n \n );\n}\n","import { supabase } from \"../../supabase\";\n\n// To regenerate this file, run the CLI command `deno run --allow-read --allow-write --allow-sys schema_to_ts.ts`. The script is located in the supabase-functions directory.\n\n\n/**\n * This interface was referenced by `Interface`'s JSON-Schema\n * via the `definition` \"storePin\".\n */\nexport interface StorePin {\n id: string;\n geocode: string;\n shipperName: string;\n}\n/**\n * This interface was referenced by `Interface`'s JSON-Schema\n * via the `definition` \"stationInfo\".\n */\nexport interface StationInfo {\n stationName: string;\n phone: string | null;\n city: string;\n state: string;\n zip: string;\n abbr: string | null;\n}\n/**\n * This interface was referenced by `Interface`'s JSON-Schema\n * via the `definition` \"getCarrierStationPinsAndInfoParams\".\n */\nexport interface GetCarrierStationPinsAndInfoParams {\n function: \"get-carrier-station-pins-and-info\";\n stationId: string;\n}\n/**\n * This interface was referenced by `Interface`'s JSON-Schema\n * via the `definition` \"getCarrierStationPinsAndInfoResponse\".\n */\nexport interface GetCarrierStationPinsAndInfoResponse {\n stores: StorePin[];\n stationInfo: StationInfo;\n}\n\n\nexport async function getCarrierStationPinsAndInfo(\n params: Omit,\n){\n try {\n const result = await supabase.functions.invoke( \n 'stations-api',\n { body: { ...params, function: 'get-carrier-station-pins-and-info' }},\n );\n\n if (!result.error && result.data) {\n return result.data;\n } else if (result.error) {\n throw new Error(\"Error Fetching Result in stations-api/getCarrierStationPinsAndInfo:\" + result.error);\n } else {\n throw new Error('Unknown error: result does not contain data or error.');\n }\n } catch (error) {\n console.error('Error:', error);\n throw error;\n }\n}\n","/* eslint-disable @typescript-eslint/no-non-null-assertion */\nimport { useStationContext } from './StationURLContext';\nimport {\n FullscreenControl,\n NavigationControl,\n Map,\n Projection,\n MapRef,\n Popup,\n} from 'react-map-gl';\nimport { GetStationsLatLongResponse } from '@/data/SupabaseRequests/stations-api/getStationsLatLong';\nimport { Pin } from '../dashboard/mapFeatures/Pin';\nimport { useQuery } from 'react-query';\nimport { getCarrierStationPinsAndInfo } from '@/data/SupabaseRequests/stations-api/getCarrierStationPinsAndInfo';\nimport { parseGeocode } from '@/helpers/parseGeocode';\nimport { Button } from '@/components/primitives/Button';\nimport { useState } from 'react';\nimport React from 'react';\nimport { FlyToOptions } from 'mapbox-gl';\nimport { SearchBox } from '@mapbox/search-js-react';\nimport {\n ParsedAddress,\n parseMapboxEvent,\n} from '@/common/types/parseMapboxEvent';\nimport { NewStationForm } from './NewStationForm';\nimport { useAddStation } from './mutations';\n\ntype Props = {\n stations: GetStationsLatLongResponse;\n};\n\nexport default function CarrierMap({ stations }: Props) {\n const { selectedStation, setSelectedStation } = useStationContext();\n const [searchExpanded, setSearchExpanded] = useState(false);\n const [stationAddress, setStationAddress] = useState(\n null,\n );\n\n const mapRef = React.useRef(null);\n\n const addStationMutation = useAddStation();\n\n const handleStationSelect = (stationId: string) => {\n setSelectedStation(stationId);\n };\n\n const handleSearchResult = (event: any) => {\n const parsedAddress = parseMapboxEvent(event);\n\n const { lat, lng } = parsedAddress;\n\n setStationAddress(parsedAddress);\n\n mapRef.current?.flyTo({\n center: [lng, lat],\n zoom: 12,\n speed: 1.5,\n });\n };\n\n const { data: storesAndInfo } = useQuery({\n queryKey: ['station', selectedStation],\n queryFn: () =>\n getCarrierStationPinsAndInfo({ stationId: selectedStation! }),\n enabled: !!selectedStation,\n });\n\n const handleCreateStationClick = () => {\n if (searchExpanded) {\n onCancelNewStation();\n setStationAddress(null);\n } else {\n setSearchExpanded(true);\n }\n };\n\n const onCancelNewStation = () => {\n setStationAddress(null);\n setSearchExpanded(false);\n mapRef.current?.flyTo({\n center: [-98.7129, 37.0902],\n zoom: 3.5,\n speed: 1.5,\n } as FlyToOptions);\n };\n\n const showStationPopup = stationAddress;\n\n const onCreateStation = async (name: string, code: string) => {\n if (!stationAddress) return;\n\n addStationMutation.mutate({\n line1: stationAddress.line1,\n city: stationAddress.city,\n state: stationAddress.state,\n zip: stationAddress.zip,\n name,\n code,\n lat: stationAddress.lat,\n lng: stationAddress.lng,\n });\n\n setStationAddress(null);\n };\n\n return (\n
\n \n
\n \n {searchExpanded && (\n \n )}\n
\n\n \n
\n \n \n {stations.map((station) => {\n const { stationLat, stationLong } = station;\n return (\n
handleStationSelect(station.stationId)}>\n \n
\n );\n })}\n {storesAndInfo?.stores.map((store) => {\n const { latitude, longitude } = parseGeocode(store.geocode);\n return (\n \n );\n })}\n {showStationPopup && (\n <>\n \n \n \n \n \n )}\n \n \n );\n}\n","import SelectedStationPage from './SelectedStation/SelectedStationPage';\nimport { useStationContext } from './StationURLContext';\nimport { useQuery } from 'react-query';\nimport { Loading } from '@/layout/Loading';\nimport { getStationsLatLong } from '@/data/SupabaseRequests/stations-api/getStationsLatLong';\nimport StationMap from './CarrierMap';\nimport { useAuth } from '@/data/auth';\nimport ShipperMap from './ShipperMap';\nimport CarrierMap from './CarrierMap';\n\nexport function StationPage() {\n const { user } = useAuth();\n const { selectedStation, setSelectedStation } = useStationContext();\n\n const {\n data: stations,\n isLoading,\n isError,\n } = useQuery({\n queryKey: ['stations', 'latLongs'],\n queryFn: () => getStationsLatLong({}),\n });\n\n if (isLoading) {\n return ;\n }\n\n if (isError || !stations) {\n return
Theres an error
;\n }\n\n if (stations.length === 1) {\n setSelectedStation(stations[0].stationId);\n }\n\n return (\n
\n {user?.org_type === 'carrier' ? (\n \n ) : (\n \n )}\n {selectedStation && (\n s.stationId === selectedStation)\n ?.stationName ?? ''\n }\n />\n )}\n
\n );\n}\n","import { StationPage } from './StationPage';\nimport { StationProvider } from './StationURLContext';\n\nexport function StationPageWrapper() {\n return (\n \n \n \n );\n}\n","import { supabase } from \"../../supabase\";\n\n// To regenerate this file, run the CLI command `deno run --allow-read --allow-write --allow-sys schema_to_ts.ts`. The script is located in the supabase-functions directory.\n\n/**\n * This interface was referenced by `Interface`'s JSON-Schema\n * via the `definition` \"getClaimableShipmentsResponse\".\n */\nexport type GetClaimableShipmentsResponse = ClaimableShipment[];\n\n\n/**\n * This interface was referenced by `Interface`'s JSON-Schema\n * via the `definition` \"claimableShipment\".\n */\nexport interface ClaimableShipment {\n shipmentId: string;\n trackingId: string;\n type: \"overage\" | \"damage\";\n carrierId: string;\n carrierName: string;\n originStationId: string;\n destinationStationId: string;\n originStationName: string;\n destinationStationName: string;\n date: string;\n locationType: string;\n}\n/**\n * This interface was referenced by `Interface`'s JSON-Schema\n * via the `definition` \"getClaimableShipmentsParams\".\n */\nexport interface GetClaimableShipmentsParams {\n function: \"get-claimable-shipments\";\n}\n\n\nexport async function getClaimableShipments(\n params: Omit,\n){\n try {\n const result = await supabase.functions.invoke( \n 'claims-api',\n { body: { ...params, function: 'get-claimable-shipments' }},\n );\n\n if (!result.error && result.data) {\n return result.data;\n } else if (result.error) {\n throw new Error(\"Error Fetching Result in claims-api/getClaimableShipments:\" + result.error);\n } else {\n throw new Error('Unknown error: result does not contain data or error.');\n }\n } catch (error) {\n console.error('Error:', error);\n throw error;\n }\n}\n","import {\n Card,\n CardContent,\n CardHeader,\n CardTitle,\n} from '@/components/primitives/Card';\nimport {\n Select,\n SelectContent,\n SelectItem,\n SelectTrigger,\n SelectValue,\n} from '@/components/primitives/Select';\nimport {\n Table,\n TableBody,\n TableCell,\n TableHead,\n TableHeader,\n TableRow,\n} from '@/components/primitives/Table';\nimport { getClaimableShipments } from '@/data/SupabaseRequests/claims-api/getClaimableShipments';\nimport { useState } from 'react';\nimport { useQuery } from 'react-query';\n\nfunction determineCompanyAtFault(claim: string) {\n switch (claim) {\n case '':\n return 'Carrier Company';\n case 'load':\n return 'Line Haul';\n case 'station':\n return 'Carrier';\n default:\n return 'Unknown';\n }\n}\n\nexport default function ClaimsPage() {\n const [dateFilter, setDateFilter] = useState('all');\n const [typeFilter, setTypeFilter] = useState('all');\n\n const { data: claims } = useQuery({\n queryFn: () => getClaimableShipments({}),\n queryKey: ['claims'],\n });\n\n const filteredClaims = claims?.filter((claim) => {\n const claimDate = new Date(claim.date);\n const now = new Date();\n const oneWeekAgo = new Date(now.getTime() - 7 * 24 * 60 * 60 * 1000);\n const twoWeeksAgo = new Date(now.getTime() - 14 * 24 * 60 * 60 * 1000);\n const oneMonthAgo = new Date(now.getTime() - 30 * 24 * 60 * 60 * 1000);\n const oneYearAgo = new Date(now.getTime() - 365 * 24 * 60 * 60 * 1000);\n\n const dateFilterPass =\n dateFilter === 'all'\n ? true\n : dateFilter === 'week'\n ? claimDate >= oneWeekAgo\n : dateFilter === '2weeks'\n ? claimDate >= twoWeeksAgo\n : dateFilter === 'month'\n ? claimDate >= oneMonthAgo\n : dateFilter === 'year'\n ? claimDate >= oneYearAgo\n : true;\n\n const typeFilterPass = typeFilter === 'all' || claim.type === typeFilter;\n\n return dateFilterPass && typeFilterPass;\n });\n\n return (\n
\n \n \n Claims Overview\n \n \n
\n \n \n
\n \n \n \n Tracking ID\n Outbound Station\n Inbound Station\n Type\n Date\n Company at Fault\n \n \n \n {filteredClaims?.map((claim) => (\n \n {claim.trackingId}\n {claim.originStationName}\n \n {claim.destinationStationName +\n ' (' +\n claim.carrierName +\n ')'}\n \n \n {claim.type}\n \n \n {new Date(claim.date).toLocaleDateString()}\n \n \n {determineCompanyAtFault(claim.locationType)}\n \n \n ))}\n \n
\n
\n
\n
\n );\n}\n","import {\n createContext,\n ReactNode,\n useContext,\n useEffect,\n useState,\n} from 'react';\nimport { useLocation, useSearchParams } from 'react-router-dom';\n\ntype TimePeriod = '1_month' | '3_month' | '6_month' | '1_year' | 'all';\n\ninterface AnalyticsURLContextProps {\n selectedStation: string | null;\n setSelectedStation: (station: string | null) => void;\n selectedRegion: string | null;\n setSelectedRegion: (region: string | null) => void;\n selectedStore: string | null;\n setSelectedStore: (store: string | null) => void;\n timePeriod: TimePeriod;\n setTimePeriod: (timePeriod: TimePeriod) => void;\n}\n\nconst AnalyticsURLContext = createContext(\n undefined,\n);\n\nexport const useAnalyticsURL = () => {\n const context = useContext(AnalyticsURLContext);\n if (!context) {\n throw new Error('useAnalyticsURL must be used within an AnalyticsProvider');\n }\n return context;\n};\n\nexport const AnalyticsURLProvider = ({ children }: { children: ReactNode }) => {\n const location = useLocation();\n const [searchParams, setSearchParams] = useSearchParams();\n\n // Helper function to get param or return null if missing\n const getParamOrNull = (key: string): string | null => {\n const value = searchParams.get(key);\n return value && value.trim() !== '' ? value : null;\n };\n\n // Read from URL but prevent unnecessary re-parsing\n const [selectedStation, setSelectedStation] = useState(\n getParamOrNull('station_id'),\n );\n const [selectedRegion, setSelectedRegion] = useState(\n getParamOrNull('region_id'),\n );\n const [selectedStore, setSelectedStore] = useState(\n getParamOrNull('store_id'),\n );\n const [timePeriod, setTimePeriod] = useState(\n (getParamOrNull('time_period') as TimePeriod) || '1_month',\n );\n\n // Sync URL params into state (runs only when the URL actually changes)\n useEffect(() => {\n const stationParam = getParamOrNull('station_id');\n const regionParam = getParamOrNull('region_id');\n const storeParam = getParamOrNull('store_id');\n const timePeriodParam =\n (getParamOrNull('time_period') as TimePeriod) || '1_month';\n\n if (\n stationParam !== selectedStation ||\n regionParam !== selectedRegion ||\n storeParam !== selectedStore ||\n timePeriodParam !== timePeriod\n ) {\n setSelectedStation(stationParam);\n setSelectedRegion(regionParam);\n setSelectedStore(storeParam);\n setTimePeriod(timePeriodParam);\n }\n }, [location.search]); // Runs only when URL changes\n\n // Update URL when state changes (only if the values actually change)\n useEffect(() => {\n const currentParams = new URLSearchParams(location.search);\n const newParams = new URLSearchParams();\n\n if (selectedStation) newParams.set('station_id', selectedStation);\n if (selectedRegion) newParams.set('region_id', selectedRegion);\n if (selectedStore) newParams.set('store_id', selectedStore);\n if (timePeriod && timePeriod !== '1_month')\n newParams.set('time_period', timePeriod);\n\n // If current and new params are the same, do nothing to prevent loops\n if (currentParams.toString() === newParams.toString()) return;\n\n setSearchParams(newParams);\n }, [selectedStation, selectedRegion, selectedStore, timePeriod]);\n\n // Handlers to reset dependent state values\n const handleStationChange = (station: string | null) => {\n setSelectedStation(station);\n setSelectedRegion(null);\n setSelectedStore(null);\n };\n\n const handleRegionChange = (region: string | null) => {\n setSelectedRegion(region);\n if (region) setSelectedStore(null);\n };\n\n return (\n \n {children}\n \n );\n};\n","import 'mapbox-gl/dist/mapbox-gl.css';\nimport { Marker } from 'react-map-gl';\nimport { Dot } from 'lucide-react';\nimport { StoreCoord } from '@/data/SupabaseRequests/analytics-api/getStoreCoords';\nimport { useAnalyticsURL } from './useAnalyticsURL';\n\ntype Props = {\n store: StoreCoord;\n color: string;\n};\n\n/**\n * Store Marker for the dashboard map\n * @param param0\n * @returns React Component\n */\nexport function StoreMarker({ store, color }: Props) {\n const { setSelectedStore } = useAnalyticsURL();\n return (\n setSelectedStore(store.id)}\n >\n \n
\n \n
\n
\n \n );\n}\n","import { StationCoord } from '@/data/SupabaseRequests/analytics-api/getCoords';\nimport { Warehouse } from 'lucide-react';\nimport { Marker } from 'react-map-gl';\nimport { useAnalyticsURL } from './useAnalyticsURL';\n\ntype Props = {\n station: StationCoord;\n color: string;\n};\n\nexport function StationPin({ station, color }: Props) {\n const { setSelectedStation } = useAnalyticsURL();\n return (\n setSelectedStation(station.station_id)}\n >\n
\n \n \n {station.station_name}\n \n
\n \n );\n}\n","import { LayerProps } from 'react-map-gl';\nimport { jarvisMarch } from '../../../components/map-features/helpers/jarvisMarch';\nimport { getCenter } from '../../../components/map-features/helpers/getCenter';\nimport { darkenHSLColor } from '../../../components/map-features/helpers/darkenHSLColor';\nimport { bezierSpline, lineString } from '@turf/turf';\n\nexport type RegionMap = Record<\n string,\n { name: string; coordinates: [number, number][] }\n>;\n\nexport type Region = {\n id: string;\n name: string;\n points: [number, number][];\n centroid: [number, number];\n color: string;\n};\n\n/**\n * Groups stores by region and prepares region data with convex hulls and centroids.\n * @param stores Array of stores with region data\n * @returns Array of regions with id, name, convex hull points, centroid, and color\n */\nexport const getRegions = (\n regions: {\n region_id: string;\n region_name: string;\n bounds: [number, number][];\n }[],\n): Region[] => {\n return regions.map((region) => {\n const points = region.bounds;\n const hull = jarvisMarch(points);\n const centroid = getCenter(hull);\n const color = `hsl(${Math.random() * 360}, 100%, 50%)`;\n\n return {\n id: region.region_id,\n name: region.region_name,\n points: region.bounds,\n centroid,\n color,\n };\n });\n};\n\n/**\n * Creates GeoJSON for region polygons.\n * @param regions Array of regions with polygon points\n * @returns GeoJSON FeatureCollection for polygons\n */\nexport const getRegionPolygon = (\n regions: Region[],\n): GeoJSON.FeatureCollection => ({\n type: 'FeatureCollection',\n features: regions.map((region) => ({\n type: 'Feature',\n geometry: {\n type: 'Polygon',\n coordinates: [region.points],\n },\n properties: {\n id: region.id,\n },\n })),\n});\n\n/**\n * Creates GeoJSON for region centroids with names.\n * @param regions Array of regions with centroid points\n * @returns GeoJSON FeatureCollection for centroids\n */\nexport const getRegionNames = (\n regions: Region[],\n): GeoJSON.FeatureCollection => ({\n type: 'FeatureCollection',\n features: regions.map((region) => ({\n type: 'Feature',\n geometry: {\n type: 'Point',\n coordinates: region.centroid,\n },\n properties: {\n id: region.id,\n name: region.name, // Label for the region\n },\n })),\n});\n\n/**\n * Returns the style configuration for the region polygons layer.\n * @param regions Array of regions to generate color matches\n * @returns LayerProps for the Mapbox region polygons\n */\nexport const getRegionLayerStyle = (regions: Region[]): LayerProps => ({\n id: 'regions',\n type: 'fill',\n layout: {\n visibility: 'visible',\n },\n\n paint: {\n 'fill-color': [\n 'match',\n ['get', 'id'],\n ...regions.flatMap((region) => [region.id, region.color]),\n '#33C7FF', // Default color\n ],\n 'fill-opacity': 0.6,\n },\n});\n\n/**\n * Returns the style configuration for the region label layer.\n * @returns LayerProps for the Mapbox region labels\n */\nexport const getRegionLabelLayerStyle = (): LayerProps => ({\n id: 'region-labels',\n type: 'symbol',\n layout: {\n 'text-field': ['get', 'name'],\n 'text-font': ['Open Sans Bold', 'Arial Unicode MS Bold'],\n 'text-size': 14,\n 'text-anchor': 'center',\n },\n paint: {\n 'text-color': '#000000',\n 'text-halo-color': '#ffffff',\n 'text-halo-width': 1.5,\n },\n});\n\nexport const getRegionEdges = (\n regions: Region[],\n): GeoJSON.FeatureCollection => ({\n type: 'FeatureCollection',\n features: regions.map((region) => ({\n type: 'Feature',\n geometry: {\n type: 'LineString',\n coordinates: [...region.points, region.points[0]], // Close the loop for the edge\n },\n properties: {\n id: region.id,\n darkerColor: darkenHSLColor(region.color, 5), // Compute the darker color\n },\n })),\n});\n\nexport const getRegionEdgeLayerStyle = (): LayerProps => ({\n id: 'region-edges',\n type: 'line',\n layout: {\n 'line-cap': 'round',\n 'line-join': 'round',\n 'line-round-limit': 2,\n },\n paint: {\n 'line-color': ['get', 'darkerColor'], // Black color for edges\n 'line-width': 3, // Thickness of the edges\n },\n});\n\nexport const getRegionEdgesRounded = (\n regions: Region[],\n): GeoJSON.FeatureCollection => ({\n type: 'FeatureCollection',\n features: regions.map((region) => {\n // Create a LineString from the region points\n const line = lineString([...region.points, region.points[0]]); // Close the loop\n\n // Smooth the LineString using bezierSpline\n const smoothedLine = bezierSpline(line);\n\n return {\n type: 'Feature',\n geometry: smoothedLine.geometry, // Use the smoothed geometry\n properties: {\n id: region.id,\n color: darkenHSLColor(region.color, 30), // Use darker color for edges\n },\n };\n }),\n});\n","import { supabase } from \"../../supabase\";\n\n// To regenerate this file, run the CLI command `deno run --allow-read --allow-write --allow-sys schema_to_ts.ts`. The script is located in the supabase-functions directory.\n\n\n/**\n * This interface was referenced by `Interface`'s JSON-Schema\n * via the `definition` \"storeCoord\".\n */\nexport interface StoreCoord {\n region_id: string;\n region_name: string;\n latitude: number;\n longitude: number;\n id: string;\n}\n/**\n * This interface was referenced by `Interface`'s JSON-Schema\n * via the `definition` \"regionCoord\".\n */\nexport interface RegionCoord {\n region_id: string;\n region_name: string;\n bounds: number[][];\n}\n/**\n * This interface was referenced by `Interface`'s JSON-Schema\n * via the `definition` \"stationCoord\".\n */\nexport interface StationCoord {\n station_id: string;\n station_name: string;\n latitude: number;\n longitude: number;\n}\n/**\n * This interface was referenced by `Interface`'s JSON-Schema\n * via the `definition` \"getCoordsParams\".\n */\nexport interface GetCoordsParams {\n function: \"get-coords\";\n}\n/**\n * This interface was referenced by `Interface`'s JSON-Schema\n * via the `definition` \"getCoordsResponse\".\n */\nexport interface GetCoordsResponse {\n regions: RegionCoord[];\n stations: StationCoord[];\n}\n\n\nexport async function getCoords(\n params: Omit,\n){\n try {\n const result = await supabase.functions.invoke( \n 'analytics-api',\n { body: { ...params, function: 'get-coords' }},\n );\n\n if (!result.error && result.data) {\n return result.data;\n } else if (result.error) {\n throw new Error(\"Error Fetching Result in analytics-api/getCoords:\" + result.error);\n } else {\n throw new Error('Unknown error: result does not contain data or error.');\n }\n } catch (error) {\n console.error('Error:', error);\n throw error;\n }\n}\n","import { getCoords } from '@/data/SupabaseRequests/analytics-api/getCoords';\n\nexport async function getCoordsWrapper() {\n const coords = await getCoords({});\n\n const stations = coords.stations.map((st) => {\n return {\n ...st,\n latitude: Number(st.latitude),\n longitude: Number(st.longitude),\n };\n });\n\n const regions = coords.regions?.map((region) => {\n return {\n ...region,\n bounds: region.bounds?.map((bound) => {\n return {\n latitude: Number(bound[0]),\n longitude: Number(bound[1]),\n };\n }),\n };\n });\n\n return {\n stations,\n regions,\n };\n}\n","import { supabase } from \"../../supabase\";\n\n// To regenerate this file, run the CLI command `deno run --allow-read --allow-write --allow-sys schema_to_ts.ts`. The script is located in the supabase-functions directory.\n\n/**\n * This interface was referenced by `Interface`'s JSON-Schema\n * via the `definition` \"getStoreCoordsResponse\".\n */\nexport type GetStoreCoordsResponse = StoreCoord[];\n\n\n/**\n * This interface was referenced by `Interface`'s JSON-Schema\n * via the `definition` \"storeCoord\".\n */\nexport interface StoreCoord {\n latitude: number;\n longitude: number;\n id: string;\n}\n/**\n * This interface was referenced by `Interface`'s JSON-Schema\n * via the `definition` \"getStoreCoordsParams\".\n */\nexport interface GetStoreCoordsParams {\n function: \"get-store-coords\";\n regionId: string;\n}\n\n\nexport async function getStoreCoords(\n params: Omit,\n){\n try {\n const result = await supabase.functions.invoke( \n 'analytics-api',\n { body: { ...params, function: 'get-store-coords' }},\n );\n\n if (!result.error && result.data) {\n return result.data;\n } else if (result.error) {\n throw new Error(\"Error Fetching Result in analytics-api/getStoreCoords:\" + result.error);\n } else {\n throw new Error('Unknown error: result does not contain data or error.');\n }\n } catch (error) {\n console.error('Error:', error);\n throw error;\n }\n}\n","import React, { useMemo, useRef } from 'react';\nimport Map, { Source, Layer, MapRef, Projection } from 'react-map-gl';\nimport { StoreMarker } from './StoreMarker';\nimport { StationPin } from './StationPin';\nimport { isPointInPolygon } from '../../components/map-features/helpers/isPointInPolygon';\nimport { darkenHSLColor } from '../../components/map-features/helpers/darkenHSLColor';\nimport { useAnalyticsURL } from './useAnalyticsURL';\nimport {\n getRegionEdgeLayerStyle,\n getRegionEdges,\n getRegionLabelLayerStyle,\n getRegionLayerStyle,\n getRegionNames,\n getRegionPolygon,\n getRegions,\n} from './mapFunctions/geoJsonUtils';\nimport mapboxgl from 'mapbox-gl';\nimport { getCoordsWrapper } from './getCoordsWrapper';\nimport { useQuery } from 'react-query';\nimport { useAuth } from '@/data/auth';\nimport { getStoreCoords } from '@/data/SupabaseRequests/analytics-api/getStoreCoords';\n\nexport function AnalyticsMap() {\n const { user, stations } = useAuth();\n const {\n selectedRegion,\n setSelectedRegion,\n setSelectedStation,\n setSelectedStore,\n } = useAnalyticsURL();\n\n const { data, isLoading, isError } = useQuery({\n queryKey: [user?.id, 'analytics', 'coordinates'],\n queryFn: () => getCoordsWrapper(),\n });\n\n const { data: stores } = useQuery({\n queryKey: [user?.id, 'analytics', 'coordinates', selectedRegion],\n queryFn: () => getStoreCoords({ regionId: selectedRegion! }),\n enabled: !!selectedRegion,\n });\n const mapRef = useRef(null);\n\n const regions = useMemo(() => {\n if (!data?.regions) return [];\n return getRegions(\n data.regions.map((region) => ({\n ...region,\n bounds: region.bounds.map(({ latitude, longitude }) => [\n latitude,\n longitude,\n ]),\n })),\n );\n }, [data]);\n const geojson = useMemo(() => getRegionPolygon(regions), [regions]);\n const centroidsGeoJSON = useMemo(() => getRegionNames(regions), [regions]);\n const edgesGeoJSON = useMemo(() => getRegionEdges(regions), [regions]);\n\n const regionLayerStyle = useMemo(\n () => getRegionLayerStyle(regions),\n [regions],\n );\n const labelLayerStyle = useMemo(() => getRegionLabelLayerStyle(), []);\n const edgeLayerStyle = useMemo(() => getRegionEdgeLayerStyle(), []);\n\n const handleStoreClick = (store_id: string) => {\n if (!stores) return;\n setSelectedStore(store_id);\n\n for (const store of stores) {\n if (store.id === store_id) {\n if (mapRef.current) {\n mapRef.current.flyTo({\n center: [store.longitude, store.latitude],\n essential: true,\n duration: 1000,\n });\n }\n return;\n }\n }\n };\n\n const handleStationClick = (station_id: string) => {\n for (const station of data!.stations) {\n if (station.station_id === station_id) {\n setSelectedStation(station.station_id);\n\n if (mapRef.current) {\n mapRef.current.flyTo({\n center: [station.longitude, station.latitude],\n essential: true,\n duration: 1000,\n });\n }\n return;\n }\n }\n };\n const handleMapClick = (event: mapboxgl.MapLayerMouseEvent) => {\n const { lng, lat } = event.lngLat;\n const clickedPoint: [number, number] = [lng, lat];\n\n for (const region of regions) {\n if (isPointInPolygon(clickedPoint, region.points)) {\n setSelectedRegion(region.id);\n\n if (mapRef.current) {\n mapRef.current.flyTo({\n center: [region.centroid[0], region.centroid[1]],\n essential: true,\n duration: 1000,\n });\n }\n\n return;\n }\n }\n\n setSelectedRegion(null);\n };\n\n const loadMap =\n geojson.features.length > 0 &&\n centroidsGeoJSON.features.length > 0 &&\n edgesGeoJSON.features.length > 0;\n\n return (\n
\n {loadMap && (\n \n {geojson.features.length > 0 && (\n \n \n \n )}\n {regions.length > 0 && (\n \n \n \n )}\n {regions.length > 0 && (\n \n \n \n )}\n {data?.stations.map((station) => (\n {\n handleStationClick(station.station_id);\n e.stopPropagation();\n }}\n key={station.station_id}\n >\n \n
\n ))}\n {stores &&\n stores?.map((store) => {\n const region = regions.find(\n (region) => region.id === selectedRegion,\n );\n const darkerColor = region?.color\n ? darkenHSLColor(region.color, 10)\n : 'black';\n\n return (\n {\n handleStoreClick(store.id);\n e.stopPropagation();\n }}\n >\n \n \n );\n })}\n \n )}\n \n );\n}\n","export function formatDateString(dateString: string): string {\n return new Date(dateString.replace('Z', '')).toLocaleDateString('en-US', {\n month: 'short',\n day: 'numeric',\n });\n}\n","import {\n CartesianGrid,\n Legend,\n Line,\n LineChart,\n ResponsiveContainer,\n Tooltip,\n XAxis,\n YAxis,\n} from 'recharts';\nimport React from 'react';\nimport { GetGraphDataResponse } from '@/data/SupabaseRequests/analytics-api/getGraphData';\nimport { formatDateString } from './_helpers';\n\ntype Props = {\n data: GetGraphDataResponse;\n};\n\nexport const DeliveriesGraph: React.FC = (props) => {\n const { data } = props;\n\n const max = data.reduce((acc, curr) => {\n return Math.max(curr.deliveredShipments, acc);\n }, 0);\n\n return (\n
\n \n \n \n \n \n \n \n \n \n
\n );\n};\n","import {\n LineChart,\n Line,\n XAxis,\n YAxis,\n CartesianGrid,\n Tooltip,\n ResponsiveContainer,\n} from 'recharts';\nimport { formatDateString } from './_helpers';\n\ntype Props = {\n data: { date: string; missing: number; lost: number; shortage: number }[];\n};\n\nexport function MissingPercentageGraph({ data }: Props) {\n return (\n
\n \n \n \n \n \n \n {/* Line for total missing */}\n \n {/* Line for missing shortages */}\n \n {/* Line for missing lost */}\n \n \n \n
\n );\n}\n","import {\n LineChart,\n Line,\n XAxis,\n YAxis,\n CartesianGrid,\n Tooltip,\n Legend,\n ResponsiveContainer,\n} from 'recharts';\nimport { formatDateString } from './_helpers';\n\ntype Props = {\n data: {\n date: string;\n overages: number; // Total overages\n inArea: number; // In-area overages\n outOfArea: number; // Out-of-area overages\n }[];\n};\n\nexport function OveragesGraph({ data }: Props) {\n return (\n
\n \n \n \n \n \n \n \n {/* Total overages */}\n \n {/* In-area overages */}\n \n {/* Out-of-area overages */}\n \n \n \n
\n );\n}\n","import React from 'react';\nimport { useAnalyticsURL } from '../useAnalyticsURL';\nimport { useQuery } from 'react-query';\nimport { getGraphData } from '@/data/SupabaseRequests/analytics-api/getGraphData';\nimport { DeliveriesGraph } from './DeliveriesGraph';\nimport { MissingPercentageGraph } from './MissingPercentageGraph';\nimport { OveragesGraph } from './OveragePercentageGraph';\n\nexport const GraphsContainer: React.FC = () => {\n const { selectedStation, selectedRegion, selectedStore, timePeriod } =\n useAnalyticsURL();\n const queryStore = selectedStore ?? undefined;\n const queryRegion = !queryStore ? selectedRegion ?? undefined : undefined;\n const queryStation = !queryRegion ? selectedStation ?? undefined : undefined;\n\n const { data } = useQuery({\n queryFn: () =>\n getGraphData({\n period: timePeriod,\n storeId: queryStore,\n regionId: queryRegion,\n stationId: queryStation,\n }),\n queryKey: [\n 'analytics',\n 'graph-data',\n [timePeriod, queryStore, queryRegion, queryStation],\n ],\n });\n\n const missingData = data?.map((d) => {\n const lost =\n Math.round((d.missingLost / d.deliveredShipments) * 10000) / 100;\n const shortage =\n Math.round((d.missingShortage / d.deliveredShipments) * 10000) / 100;\n\n return {\n date: d.date,\n missing: lost + shortage, // Sum of percentages\n lost,\n shortage,\n };\n });\n\n const overageData = data?.map((d) => {\n const outOfArea =\n Math.round((d.overageOutOfArea / d.deliveredShipments) * 10000) / 100;\n const inArea =\n Math.round((d.overageInArea / d.deliveredShipments) * 10000) / 100;\n\n return {\n date: d.date,\n overages: outOfArea + inArea, // Sum of percentages\n outOfArea,\n inArea,\n };\n });\n\n return (\n
\n \n \n \n
\n );\n};\n","import {\n Select,\n SelectContent,\n SelectItem,\n SelectTrigger,\n SelectValue,\n} from '@/components/primitives/Select';\nimport { TimePeriod } from '../_models';\nimport { format, sub } from 'date-fns';\nimport { useAnalyticsURL } from '../useAnalyticsURL';\n\nconst dateRangeOptions: { value: TimePeriod; label: string }[] = [\n { value: '1_month', label: 'Last Month' },\n { value: '3_month', label: 'Last 3 Months' },\n { value: '6_month', label: 'Last 6 Months' },\n { value: '1_year', label: 'Last Year' },\n { value: 'all', label: 'All Time' },\n];\n\nexport function GraphToolbar() {\n const { timePeriod, setTimePeriod } = useAnalyticsURL();\n\n const formatDateRange = () => {\n const today = new Date();\n let startDate: Date;\n\n switch (timePeriod) {\n case '1_month':\n startDate = sub(today, { months: 1 });\n break;\n case '3_month':\n startDate = sub(today, { months: 3 });\n break;\n case '6_month':\n startDate = sub(today, { months: 6 });\n break;\n case '1_year':\n startDate = sub(today, { years: 1 });\n break;\n case 'all':\n return 'All Time';\n default:\n return '';\n }\n\n return `${format(startDate, 'MMM d, yyyy')} - ${format(today, 'MMM d, yyyy')}`;\n };\n\n return (\n
\n setTimePeriod(value)}\n >\n \n \n \n \n {dateRangeOptions.map((option) => (\n setTimePeriod(option.value)}\n >\n {option.label}\n \n ))}\n \n \n
\n {formatDateRange()}\n
\n
\n );\n}\n","import { PageHeader } from '@/layout/PageHeader';\nimport { AnalyticsMap } from './AnalyticsMap';\nimport { GraphsContainer } from './graphs/GraphsContainer';\nimport { GraphToolbar } from './graphs/GraphToolbar';\n\nexport function AnalyticsPage() {\n return (\n
\n \n
\n
\n \n
\n \n \n
\n
\n );\n}\n","import { Route, Routes } from 'react-router';\nimport { AnalyticsURLProvider } from './useAnalyticsURL';\nimport { AnalyticsPage } from './AnalyticsPage';\n\nexport default function AnalyticsPageWrapper() {\n return (\n \n \n \n \n }\n />\n \n );\n}\n","import { useState } from 'react';\nimport { supabase } from '@/data/supabase';\nimport { Card, CardContent } from '@/components/primitives/Card';\nimport { Input } from '@/components/primitives/Input';\nimport { Button } from '@/components/primitives/Button';\n\nexport function ResetPasswordForm() {\n const [password, setPassword] = useState('');\n const [confirmPassword, setConfirmPassword] = useState('');\n const [message, setMessage] = useState('');\n const [loading, setLoading] = useState(false);\n\n async function handlePasswordReset() {\n if (password.length < 8) {\n setMessage('Password must be at least 8 characters long.');\n return;\n }\n if (!/\\d/.test(password)) {\n setMessage('Password must contain at least one number.');\n return;\n }\n if (password !== confirmPassword) {\n setMessage('Passwords do not match.');\n return;\n }\n\n setLoading(true);\n setMessage('');\n\n const { error } = await supabase.auth.updateUser({ password });\n\n if (error) {\n setMessage(error.message);\n } else {\n setMessage('Password successfully reset! ');\n }\n setLoading(false);\n }\n\n return (\n
\n \n \n

Reset Your Password

\n

\n Enter your new password below.\n

\n\n setPassword(e.target.value)}\n className=\"mb-3\"\n />\n setConfirmPassword(e.target.value)}\n className=\"mb-3\"\n />\n\n {message &&

{message}

}\n\n \n {loading ? 'Resetting...' : 'Reset Password'}\n \n
\n
\n
\n );\n}\n","import {\n PDFViewer,\n Document,\n Page,\n View,\n Text,\n StyleSheet,\n Image,\n} from '@react-pdf/renderer';\nimport JsBarcode from 'jsbarcode';\nimport { useEffect, useState } from 'react';\n\ntype Props = {\n storeNumbers: string[];\n};\n\nconst styles = StyleSheet.create({\n page: {\n paddingTop: 80,\n alignItems: 'center',\n justifyContent: 'flex-start',\n },\n storeNumber: {\n fontSize: 185,\n fontWeight: 'bold',\n },\n barcodeImage: {\n marginTop: 20,\n width: 700,\n height: 200,\n },\n});\n\nexport function PalletsPDF({ storeNumbers }: Props) {\n const [barcodeImages, setBarcodeImages] = useState([]);\n\n useEffect(() => {\n const loadImages = async () => {\n const images = await Promise.all(\n storeNumbers.map((num) => generateBarcodeBase64(`S-${num}`)),\n );\n setBarcodeImages(images);\n };\n\n loadImages();\n }, [storeNumbers]);\n return (\n
\n
\n
\n \n \n {storeNumbers.map((number, index) => (\n \n \n {number}\n \n \n \n ))}\n \n \n
\n
\n );\n}\n\nfunction generateBarcodeBase64(value: string): Promise {\n return new Promise((resolve) => {\n const canvas = document.createElement('canvas');\n JsBarcode(canvas, value, {\n format: 'CODE128',\n lineColor: '#000',\n width: 2,\n height: 400,\n displayValue: false, //set this to true if you want to see the value below the barcode\n });\n resolve(canvas.toDataURL('image/png'));\n });\n}\n","import { Button } from '@/components/primitives/Button';\nimport {\n Card,\n CardContent,\n CardHeader,\n CardTitle,\n} from '@/components/primitives/Card';\nimport { Textarea } from '@/components/primitives/Textarea';\nimport { useState } from 'react';\nimport { PalletsPDF } from './PalletsPDF';\nimport { Dialog } from '@/components/primitives/Dialog';\n\nexport function PalletPrinting() {\n const [input, setInput] = useState('');\n const [storeNumbers, setStoreNumbers] = useState([]);\n const [showPDF, setShowPDF] = useState(false);\n\n const handleSubmit = (e: React.FormEvent) => {\n e.preventDefault();\n const numbers = input\n .split(/[,\\n]/) // Split by comma or newline\n .map((num) => num.trim())\n .filter((num) => num !== '');\n\n setStoreNumbers(numbers);\n setInput('');\n setShowPDF(true);\n };\n\n return (\n
\n \n \n Store Numbers Input\n \n \n
\n
\n setInput(e.target.value)}\n placeholder=\"Enter store numbers (separated by commas or new lines)\"\n rows={5}\n />\n
\n \n
\n\n {showPDF && (\n
\n \n
\n )}\n
\n
\n
\n );\n}\n","import { Navigate, Route, Routes } from 'react-router';\n\nimport { StandardLayout } from './layout/StandardLayout';\nimport { DashboardPage } from './pages/dashboard/DashboardPage';\nimport { Error404 } from './pages/error/Error404';\nimport { OrganizationPage } from './pages/organization/OrganizationPage';\nimport { useAuth } from './data/auth';\nimport DispatchPageWrapper from './pages/dispatch/DispatchPageWrapper';\nimport { ReportsPageWrapper } from './pages/reports/ReportsPageWrapper';\nimport { ShipmentSearchPage } from './pages/shipment_search/ShipmentSearchPage';\nimport { CarriersPage } from './pages/carriers/CarriersPage';\nimport { DownloadsPage } from './pages/downloads/DownloadsPage';\nimport { LandingLayout } from './layout/LandingLayout';\nimport { WarehousePage } from './pages/warehouse/WarehousePage';\nimport { StationPageWrapper } from './pages/station/StationPageWrapper';\nimport ClaimsPage from './pages/claims/ClaimsPage';\nimport AnalyticsPageWrapper from './pages/analytics/AnalyticsPageWrapper';\nimport { ResetPasswordForm } from './pages/auth/CreateForgottenPassword';\nimport { PalletPrinting } from './pages/pallets/PalletPrinting';\n\nexport function PrivateRoutes() {\n const { permissions, user } = useAuth();\n\n //is not a webapp user if only permissions are driver-app or warehouse-app\n //has permission takes an array and checks if the user has any of the permissions in the array so it wont work\n const isWebappUser = permissions.permissions.some(\n (permission) =>\n permission !== 'driver-app' && permission !== 'warehouse-app',\n );\n\n return (\n \n {isWebappUser && (\n }>\n } />\n } />\n\n } />\n\n {permissions?.hasPermission(['admin']) && (\n } />\n )}\n {permissions?.hasPermission(['reports']) && (\n } />\n )}\n {permissions?.hasPermission(['reports']) && (\n } />\n )}\n {permissions?.hasPermission(['shipment-search']) && (\n } />\n )}\n\n {user?.org_type === 'carrier' && (\n <>\n {permissions?.hasPermission(['dispatch']) && (\n } />\n )}\n } />\n {permissions?.hasPermission(['stations']) && (\n } />\n )}\n\n {permissions?.hasPermission(['warehouse']) && (\n }\n />\n )}\n \n )}\n\n {user?.org_type === 'shipper' && (\n } />\n )}\n {permissions?.hasPermission(['warehouse']) && (\n }\n />\n )}\n {permissions?.hasPermission(['stations']) && (\n }\n />\n )}\n {permissions?.hasPermission(['claims']) && (\n } />\n )}\n } />\n \n )}\n {!isWebappUser && (\n }>\n } />\n } />\n } />\n \n )}\n \n );\n}\n","import { supabase } from \"../../supabase\";\n\n// To regenerate this file, run the CLI command `deno run --allow-read --allow-write --allow-sys schema_to_ts.ts`. The script is located in the supabase-functions directory.\n\n/**\n * This interface was referenced by `Interface`'s JSON-Schema\n * via the `definition` \"signupUserResponse\".\n */\nexport type SignupUserResponse = string;\n\n\n/**\n * This interface was referenced by `Interface`'s JSON-Schema\n * via the `definition` \"signupUserParams\".\n */\nexport interface SignupUserParams {\n function: \"signup-user\";\n id: string;\n email: string;\n firstName: string;\n lastName: string;\n orgId: string;\n}\n\n\nexport async function signupUser(\n params: Omit,\n){\n try {\n const result = await supabase.functions.invoke( \n 'webapp-api',\n { body: { ...params, function: 'signup-user' }},\n );\n\n if (!result.error && result.data) {\n return result.data;\n } else if (result.error) {\n throw new Error(\"Error Fetching Result in webapp-api/signupUser:\" + result.error);\n } else {\n throw new Error('Unknown error: result does not contain data or error.');\n }\n } catch (error) {\n console.error('Error:', error);\n throw error;\n }\n}\n","import { Button } from '@/components/primitives/Button';\nimport {\n Card,\n CardContent,\n CardHeader,\n CardTitle,\n} from '@/components/primitives/Card';\nimport {\n Form,\n FormControl,\n FormField,\n FormItem,\n FormLabel,\n FormMessage,\n} from '@/components/primitives/Form';\nimport { Input } from '@/components/primitives/Input';\nimport { supabase } from '@/data/supabase';\nimport { zodResolver } from '@hookform/resolvers/zod';\nimport { EyeIcon, EyeOffIcon } from 'lucide-react';\nimport React, { useEffect } from 'react';\nimport { useForm } from 'react-hook-form';\nimport { z } from 'zod';\nimport { AuthService } from '@/data/AuthService';\nimport { useLocation, useNavigate } from 'react-router-dom';\nimport { signupUser } from '@/data/SupabaseRequests/webapp-api/signupUser';\n\nexport default function UserSignup() {\n const [showPassword, setShowPassword] = React.useState(false);\n const [showPasswordConfirm, setShowPasswordConfirm] = React.useState(false);\n const [error, setError] = React.useState();\n const [loading, setLoading] = React.useState(false);\n\n const navigate = useNavigate();\n const location = useLocation();\n\n // Handle URL errors\n useEffect(() => {\n const params = new URLSearchParams(location.hash.replace('#', '?')); // Convert hash to query params\n const error = params.get('error');\n const errorDescription = params.get('error_description');\n\n if (error) {\n setError(\n errorDescription ||\n 'An error occurred with your signup link. Have someone send a new one to you.',\n );\n }\n }, [location]);\n\n const formSchema = z\n .object({\n password: z\n .string()\n .min(8, { message: 'Password must be at least 8 characters long.' })\n .max(100, {\n message: 'Password must be less than 100 characters long.',\n })\n .refine((password) => /[A-Z]/.test(password), {\n message: 'Password must contain at least one uppercase letter.',\n })\n .refine((password) => /[0-9]/.test(password), {\n message: 'Password must contain at least one number.',\n })\n .refine((password) => /[!@#$%^&*(),.?\":{}|<>]/.test(password), {\n message: 'Password must contain at least one symbol.',\n }),\n confirmPassword: z.string(),\n first_name: z.string().min(1).max(100),\n last_name: z.string().min(1).max(100),\n })\n .refine((data) => data.password === data.confirmPassword, {\n message: 'Passwords must match.',\n path: ['confirmPassword'],\n });\n\n const form = useForm>({\n resolver: zodResolver(formSchema),\n mode: 'onChange',\n defaultValues: {\n password: '',\n confirmPassword: '',\n first_name: '',\n last_name: '',\n },\n });\n\n async function handleSubmit(data: z.infer) {\n setLoading(true);\n const user = await supabase.auth.getUser();\n\n const id = user.data.user?.id;\n const email = user.data.user?.email;\n const orgId = user.data.user?.user_metadata.organizationId;\n\n if (!id || !email || !orgId) {\n setError('There was a problem fetching metadata');\n setLoading(false);\n return;\n }\n\n const { error: signup_error } = await supabase.auth.updateUser({\n email: email,\n password: data.password,\n });\n if (signup_error) {\n setError(\n 'There was a problem updating your password: ' + signup_error.message,\n );\n setLoading(false);\n return;\n }\n\n signupUser({\n id: id,\n email: email,\n firstName: data.first_name,\n lastName: data.last_name,\n orgId: orgId,\n });\n\n setLoading(false);\n\n //const login_error = await AuthService.login(email, data.password);\n // if (login_error) {\n // setError(login_error.message);\n // } else {\n navigate('../auth');\n }\n\n return (\n
\n \n \n Sign Up\n \n \n {error && (\n
\n {error}\n
\n )}\n
\n \n (\n \n Password\n \n
\n \n {form.getValues('password').length > 0 && (\n
\n {showPassword ? (\n setShowPassword(false)}\n size={30}\n />\n ) : (\n setShowPassword(true)}\n size={30}\n />\n )}\n
\n )}\n
\n
\n \n
\n )}\n />\n\n (\n \n Confirm Password\n \n
\n \n {form.getValues('confirmPassword').length > 0 && (\n
\n {showPasswordConfirm ? (\n setShowPasswordConfirm(false)}\n size={30}\n />\n ) : (\n setShowPasswordConfirm(true)}\n size={30}\n />\n )}\n
\n )}\n
\n
\n \n
\n )}\n />\n\n
\n (\n \n First Name\n \n \n \n \n )}\n />\n (\n \n Last Name\n \n \n \n \n )}\n />\n
\n\n
\n \n
\n \n \n
\n
\n
\n );\n}\n","import { supabase } from '../supabase';\n\nexport type CarrierSignupReturnType = {\n organization_id: string;\n user_profile_id: string;\n};\n\nexport interface CarrierSignupParams {\n shipper_invite_code: string;\n organization_name: string;\n organization_abn: string;\n user_email: string;\n user_id: string;\n user_first_name: string;\n user_last_name: string;\n}\n\nexport interface UserToCarrierParams {\n org_id: string;\n user_email: string;\n user_first_name: string;\n user_last_name: string;\n}\n\n/**\n * Calls carrier-signup function in webapp-api\n * Edge function for signing up a carrier\n * @param data\n */\nexport async function carrierSignup(data: CarrierSignupParams) {\n const result = await supabase.functions.invoke(\n 'webapp-api',\n {\n body: JSON.stringify({\n ...data,\n function: 'carrier-signup',\n }),\n }\n );\n}\n\nexport async function connectUserToCarrier(\n data: UserToCarrierParams\n): Promise {\n await supabase.functions.invoke('webapp-api', {\n body: JSON.stringify({\n ...data,\n function: 'admin-user-carrier',\n }),\n });\n}\n","import React from 'react';\nimport { useNavigate, useParams } from 'react-router';\nimport {\n Card,\n CardContent,\n CardFooter,\n CardHeader,\n CardTitle,\n} from '@/components/primitives/Card';\nimport {\n Form,\n FormControl,\n FormField,\n FormItem,\n FormLabel,\n FormMessage,\n} from '@/components/primitives/Form';\nimport { Input } from '@/components/primitives/Input';\n\nimport { EyeIcon, EyeOffIcon } from 'lucide-react';\nimport { useForm } from 'react-hook-form';\nimport { z } from 'zod';\nimport { zodResolver } from '@hookform/resolvers/zod';\nimport { Button } from '@/components/primitives/Button';\nimport {\n CarrierSignupParams,\n carrierSignup,\n} from '@/data/OldSupabaseRequests/carrierSignup';\nimport { supabase } from '@/data/supabase';\n\nexport default function CarrierSignupPage() {\n const [showPassword, setShowPassword] = React.useState(false);\n const [showPasswordConfirm, setShowPasswordConfirm] = React.useState(false);\n const { organization_id } = useParams();\n\n const nav = useNavigate();\n\n const formSchema = z\n .object({\n password: z\n .string()\n .min(8, { message: 'Password must be at least 8 characters long.' })\n .max(100, {\n message: 'Password must be less than 100 characters long.',\n })\n .refine((password) => /[A-Z]/.test(password), {\n message: 'Password must contain at least one uppercase letter.',\n })\n .refine((password) => /[0-9]/.test(password), {\n message: 'Password must contain at least one number.',\n })\n .refine((password) => /[!@#$%^&*(),.?\":{}|<>]/.test(password), {\n message: 'Password must contain at least one symbol.',\n }),\n confirmPassword: z.string(),\n org_name: z.string(),\n org_abn: z.string().min(2).max(5),\n email: z.string().email(),\n first_name: z.string().min(1).max(100),\n last_name: z.string().min(1).max(100),\n })\n .refine((data) => data.password === data.confirmPassword, {\n message: 'Passwords must match.',\n path: ['confirmPassword'],\n });\n\n const form = useForm>({\n resolver: zodResolver(formSchema),\n mode: 'onChange',\n defaultValues: {\n org_name: '',\n org_abn: '',\n email: '',\n password: '',\n confirmPassword: '',\n first_name: '',\n last_name: '',\n },\n });\n\n const onSubmit = async (data: z.infer) => {\n const newUser = await supabase.auth.signUp({\n email: data.email,\n password: data.password,\n });\n\n await carrierSignup({\n shipper_invite_code: organization_id ?? '',\n organization_name: 'test',\n organization_abn: 'test',\n user_email: data.email,\n user_id: newUser.data.user?.id ?? '',\n user_first_name: 'test',\n user_last_name: 'test',\n } as CarrierSignupParams);\n\n await supabase.auth.signInWithPassword({\n email: data.email,\n password: data.password,\n });\n\n nav('../../');\n };\n\n return (\n
\n \n \n Create Organization Account\n \n \n
\n
\n (\n \n Organization Name\n \n \n )}\n />\n (\n \n ABN\n \n \n )}\n />\n
\n\n (\n \n Email\n \n \n \n \n \n )}\n />\n (\n \n Password\n \n
\n \n {form.getValues('password').length > 0 && (\n
\n {showPassword ? (\n setShowPassword(false)}\n size={30}\n />\n ) : (\n setShowPassword(true)}\n size={30}\n />\n )}\n
\n )}\n
\n
\n \n
\n )}\n />\n\n (\n \n Confirm Password\n \n
\n \n {form.getValues('confirmPassword').length > 0 && (\n
\n {showPasswordConfirm ? (\n setShowPasswordConfirm(false)}\n size={30}\n />\n ) : (\n setShowPasswordConfirm(true)}\n size={30}\n />\n )}\n
\n )}\n
\n
\n \n
\n )}\n />\n\n
\n (\n \n First Name\n \n \n \n \n )}\n />\n (\n \n Last Name\n \n \n \n \n )}\n />\n
\n \n
\n \n
\n \n
\n
\n
\n
\n );\n}\n","import React from 'react';\n\nexport default function PrivacyPolicyBody() {\n return (\n
\n

\n This policy applies to the Lucidity Website (henceforth, “the app”), and\n governs data collection and usage. The app is provided by Lucidity for\n use by its employees and authorized contractors.\n

\n
\n

\n By using the app, you consent to the data practices described herein. In\n order to provide its services, the app collects your first and last name\n and email address when you create an account. The app collects location\n information only if you grant permission to do so.\n

\n
\n

The app does not collect any other personal information.

\n
\n

\n Lucidity uses the personal information you provide in order to deliver\n the services of the app. Lucidity does not sell, rent or lease your\n information to any other parties.\n

\n
\n

\n Lucidity may share your information with third parties to help perform\n statistical analysis, send you email, or provide customer support. All\n third parties are prohibited from using your personal information except\n to provide these services to Lucidity, and they are required to maintain\n the confidentiality of your information.\n

\n
\n

\n Lucidity may keep track of your usage of the app in order to determine\n how services are used and to inform product development.\n

\n
\n

\n Information about your mobile device may be automatically collected by\n Lucidity. This may include your device type, IP address, and location\n (if you granted permission).\n

\n
\n

\n Lucidity secures your personal information from unauthorized access,\n use, or disclosure. When personal information is transmitted over the\n Internet, it is protected through the use of TLS encryption.\n

\n
\n

\n Lucidity strives to take appropriate security measures to protect\n against unauthorized access to, or alteration of, your personal\n information. However, no data transmission over the Internet or any\n wireless network can be guaranteed to be secure. By using the app, you\n accept that the security, integrity, and privacy of any and all\n information and data exchanged between you and Lucidity through the app\n cannot be guaranteed.\n

\n
\n

\n On receipt of a verifiable request from you, we will delete your\n personal information from our records and direct any service providers\n to delete your information from their records.\n

\n
\n

\n Lucidity stores your personal information on servers provided by third\n party hosting vendors.\n

\n
\n

\n Lucidity reserves the right to change this privacy policy from time to\n time. Lucidity will notify you about significant changes in the way your\n personal information is handled by sending a notice to the email address\n associated with your account.\n

\n
\n

\n Lucidity welcomes your questions or comments regarding this privacy\n policy. Please contact us at:{' '}\n hello@lu.app\n

\n
\n );\n}\n","import {\n Card,\n CardContent,\n CardHeader,\n CardTitle,\n} from '@/components/primitives/Card';\nimport PrivacyPolicyBody from './PrivacyPolicyBody';\n\nexport const PrivacyPolicy = () => (\n
\n \n \n Privacy Policy\n \n \n \n \n \n
\n);\n","import { Navigate, Route, Routes } from 'react-router';\nimport { QueryClient, QueryClientProvider } from 'react-query';\nimport { ReactQueryDevtools } from 'react-query/devtools';\n\nimport { AuthProvider, useAuth } from './data/auth';\n\nimport { AuthPage } from './pages/auth/AuthPage';\nimport { EulaPage } from './pages/public/EulaPage';\nimport { PrivateRoutes } from './PrivateRoutes';\nimport { LandingLayout } from './layout/LandingLayout';\nimport { Toaster } from './components/primitives/Toaster';\nimport { Loading } from './layout/Loading';\nimport UserSignup from './pages/public/UserSignup';\nimport CarrierSignupPage from './pages/public/CarrierSignupPage';\nimport { PrivacyPolicy } from './pages/public/PrivacyPolicy';\n\nconst queryClient = new QueryClient({\n defaultOptions: {\n queries: {\n refetchOnWindowFocus: false,\n refetchOnMount: true,\n },\n },\n});\n\nexport default function App() {\n return (\n \n \n \n }>\n } />\n } />\n } />\n }\n />\n Shipper Signup}\n />\n } />\n \n \n \n \n }\n />\n \n \n \n \n \n );\n}\n\nfunction RequireAuth({ children }: { children: JSX.Element }) {\n const { loading, user } = useAuth();\n if (loading) return ;\n if (user === null) {\n return ;\n }\n\n return children;\n}\n","import { StrictMode } from 'react';\nimport * as ReactDOM from 'react-dom/client';\nimport { BrowserRouter } from 'react-router-dom';\n\n//import './scss/styles.scss';\nimport './index.css';\n\nimport App from './App';\n\nimport * as Sentry from \"@sentry/react\";\n\nconst environment = import.meta.env.MODE;\n\nconst isLocalhost = Boolean(\n window.location.hostname === 'localhost' ||\n // [::1] is the IPv6 localhost address.\n window.location.hostname === '[::1]' ||\n window.location.hostname.match(/^127(?:\\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/)\n);\n\nSentry.init({\n dsn: \"https://afcdb58e3418216493218262a9610427@o4504889817235456.ingest.us.sentry.io/4508660892499968\",\n integrations: [\n Sentry.browserTracingIntegration(),\n Sentry.replayIntegration(),\n ],\n // Tracing\n tracesSampleRate: 1.0, // Capture 100% of the transactions\n // Set 'tracePropagationTargets' to control for which URLs distributed tracing should be enabled\n tracePropagationTargets: [\"localhost\", \"lu.app\"],\n // Session Replay\n replaysSessionSampleRate: 0.1, // This sets the sample rate at 10%. You may want to change it to 100% while in development and then sample at a lower rate in production.\n replaysOnErrorSampleRate: 1.0, // If you're not already sampling the entire session, change the sample rate to 100% when sampling sessions where errors occur.\n environment: environment, \n enabled: !isLocalhost,\n});\n\nconst root = ReactDOM.createRoot(\n document.getElementById('root') as HTMLElement\n);\nroot.render(\n \n \n \n \n \n);\n"],"names":["authErrorMessage","error","supabaseURL","supabaseKey","supabase","createClient","getUserData","params","result","AuthContext","createContext","useAuth","useContext","AuthProvider","children","loading","setLoading","useState","user","setUser","useEffect","data","_a","updateUserState","subscription","_event","session","resetUserState","dbUserData","requiredPermissions","hasPermissionHelper","jsx","sendPasswordResetEmail","email","userPermissions","permission","cn","inputs","twMerge","clsx","Card","React.forwardRef","className","props","ref","CardHeader","CardTitleClassname","CardTitle","CardDescription","CardContent","CardFooter","handleExpiredSession","SupabaseAuthService","password","e","handler","AuthService","buttonVariants","cva","Loading","Loader2","Button","variant","size","asChild","disabled","Comp","Slot","jsxs","Fragment","labelVariants","Label","LabelPrimitive.Root","Form","FormProvider","FormFieldContext","React.createContext","FormField","Controller","useFormField","fieldContext","React.useContext","itemContext","FormItemContext","getFieldState","formState","useFormContext","fieldState","id","FormItem","React.useId","FormLabel","formItemId","FormControl","formDescriptionId","formMessageId","FormDescription","FormMessage","body","FormRootError","root","InputClassName","Input","formSchema","z.object","z.string","SignInForm","showPassword","setShowPassword","React","setError","togglePassword","prev","search","useLocation","form","useForm","zodResolver","onSubmit","username","field","EyeIcon","Link","CreateAccountForm","emailParam","orgIdParam","Navigate","CreateOrganizationForm","SendResetEmailForm","emailSent","setEmailSent","EmailVerification","AuthPage","AuthCardWrapper","Outlet","Routes","Route","EulaBody","EulaPage","LucidityLogo","Header","ICON_SIZE","ICON_STROKE","links","HomeIcon","WarehouseIcon","LineChart","GitPullRequest","PackageSearchIcon","Building2Icon","BarChart","Clipboard","ScanText","NavLinks","permissions","location","navigate","useNavigate","org_type","link","hasPermission","isType","getPageName","activeLink","ret","expected_type","orgType","Footer","handleLogout","LogOut","SideBarContainer","ToastProvider","ToastPrimitives.Provider","ToastViewport","ToastPrimitives.Viewport","toastVariants","Toast","ToastPrimitives.Root","Info","Check","ToastAction","ToastPrimitives.Action","ToastClose","ToastPrimitives.Close","X","ToastTitle","ToastPrimitives.Title","ToastDescription","ToastPrimitives.Description","TOAST_LIMIT","TOAST_REMOVE_DELAY","count","genId","toastTimeouts","addToRemoveQueue","toastId","time","timeout","dispatch","reducer","state","action","t","toast","listeners","memoryState","listener","update","dismiss","open","useToast","setState","React.useState","React.useEffect","index","Toaster","toasts","title","description","StandardLayout","assignColors","stores","type","colors","uniqueRegions","store","regionColorMap","region","regionKey","color","getStores","getGraphData","formatDateString","dateString","DeliveriesGraph","max","acc","curr","ResponsiveContainer","CartesianGrid","XAxis","YAxis","Tooltip","Line","MissingPercentageGraph","OveragesGraph","GraphsContainer","useQuery","missingData","d","lost","shortage","overageData","outOfArea","inArea","getDashboardPins","ICONS","Warehouse","Truck","Store","Package","MapPin","Pin","icon","latitude","longitude","isSelected","IconComponent","Marker","parseGeocode","geocode","buffer","Buffer","getRoundedLine","points","percentages","start","end","midLat","midLong","dx","dy","baseLength","height","perpDx","perpDy","apex","rawLine","lineString","smoothedLine","bezierSpline","p","distance","length","point","along","getLineFeatures","stationLinks","loads","load","item","sourceLat","sourceLong","destLat","destLong","useOutsideClick","fn","handleClickOutside","event","getStoreDeliveryInfo","StorePin","showPopup","setShowPopup","divRef","useRef","storeData","isLoading","isError","Popup","Loader","_b","_c","_d","_e","_f","_g","_h","Legend","visibility","toggleVisibility","getRoundedPolygonFilled","poly","roundedTolerance","coords","bound","simplifiedLine","simplify","getPolygonEdgesRounded","polygon","getPolygonNameCentered","getPolygonLayerStyle","getPolygonLabelLayerStyle","getPolygonEdgeLayerStyle","generateColorFromId","hash","i","darkenHSLColor","hslColor","amount","regex","match","_","hue","saturation","lightness","darkerLightness","DashboardMap","setVisibility","key","mapRef","useMemo","lineFeatures","lineGeoJSON","fc","polygons","Map","FullscreenControl","NavigationControl","Source","Layer","feature","pin","pinIndex","DashboardAnalytics","setStores","DashboardPage","Error404","PageTitle","TooltipProvider","TooltipPrimitive.Provider","TooltipPrimitive.Root","TooltipTrigger","TooltipPrimitive.Trigger","TooltipContent","sideOffset","TooltipPrimitive.Content","TooltipWrapper","message","position","positionOffset","delayDuration","NavBar","items","orientation","NavLink","isActive","PageHeader","pages","Table","TableHeader","TableBody","TableFooter","TableRow","TableHead","TableCell","TableCaption","getAllUsers","spacing","UserFilters","searchQuery","setSearchQuery","filter","setFilter","badgeVariants","Badge","z.custom","v","LUDate","_LUDate","date","offset","nextDay","separator","dateSeparated","month","day","year","dateKey","includeYear","useDash","addZeroes","fullYear","sep","date1","date2","dates","LUDates","ranges","lastDate","reverse","a","b","value","days","newDate","hours","msInDay","minutes","later_date","date_to_compare","differenceInMilliseconds","differenceInMinutes","differenceInHours","differenceInDays","resultDate","sundayDate","dayOff","off","LastLoginCell","lastLogin","timeDiffString","daysAgo","textColor","Popover","PopoverPrimitive.Root","PopoverTrigger","PopoverPrimitive.Trigger","PopoverContent","align","PopoverPrimitive.Portal","PopoverPrimitive.Content","StationsCell","stations","isAdmin","station","PermissionsCell","setOpen","deleteUser","UserRow","getUserType","isPopoverOpen","setIsPopoverOpen","onDeleteConfirm","Trash2Icon","UsersTable","users","filteredAndSortedUsers","typeA","typeB","getShippers","connectWithShipper","Carrier","enteredCode","setEnteredCode","other_orgs","onCheckClick","code_is_valid","org","fetchInviteCode","InviteCodeGenerator","copied","setCopied","useQueryClient","inviteCode","copyToClipboard","ClipboardIcon","getCarriers","Shipper","ShipperCarrier","OrganizationPage","SelectedContext","useSelectedStops","selectedStops","addOrRemoveSelectedStop","selectedStoreToMerge","removeAllSelectedStops","SelectedProvider","setSelectedStops","setSelectedStoreToMerge","val","arr","stops","stopIndex","Checkbox","CheckboxPrimitive.Root","CheckboxPrimitive.Indicator","_weightInGrams","_Weight","theWeight","theUnit","__privateAdd","__privateSet","__privateGet","Weight","StopSummary","stop","weight","weightText","DispatchURLContext","useDispatchURL","context","DispatchURLProvider","searchParams","setSearchParams","useSearchParams","detailedStop","setDetailedStop","setSearch","currentDay","setCurrentDay","reorderedParams","stopParam","searchParam","dayParam","handleSetDetailedStop","combineStops","useMergeStops","queryClient","useMutation","stop_id","originalData","stopsToMerge","route","totalWeight","totalPieces","updatedUnnassignedStops","updatedRoutes","oldData","moveStopsToRoute","useMoveToUnnassigned","StopCard","headerHovered","setHeaderHovered","bodyHovered","setBodyHovered","mergeStops","unnassignStop","getHeaderColor","showMerge","highlightMatch","XIcon","MergeIcon","storeNum","parts","part","useAddStopsToRoute","route_id","oldRoutes","updatedStops","newRoutes","oldRoute","AddStopsToRoute","mutation","handleAddStops","Plus","UnnassignedStops","updateStopPriority","DraggableStopCard","moveStop","isDragging","drag","useDrag","monitor","drop","useDrop","node","RouteStops","isFiltered","setUpdatedStops","dragIndex","hoverIndex","draggedStop","updatedList","reorderedStops","DropdownMenu","DropdownMenuPrimitive.Root","DropdownMenuTrigger","DropdownMenuPrimitive.Trigger","DropdownMenuGroup","DropdownMenuPrimitive.Group","DropdownMenuPortal","DropdownMenuPrimitive.Portal","DropdownMenuSub","DropdownMenuPrimitive.Sub","DropdownMenuSubTrigger","inset","DropdownMenuPrimitive.SubTrigger","ChevronRight","DropdownMenuSubContent","DropdownMenuPrimitive.SubContent","DropdownMenuContent","DropdownMenuPrimitive.Content","DropdownMenuItem","DropdownMenuPrimitive.Item","DropdownMenuCheckboxItem","checked","DropdownMenuPrimitive.CheckboxItem","DropdownMenuPrimitive.ItemIndicator","DropdownMenuRadioItem","DropdownMenuPrimitive.RadioItem","Circle","DropdownMenuLabel","DropdownMenuPrimitive.Label","DropdownMenuSeparator","DropdownMenuPrimitive.Separator","RouteManifestButton","setShowManifest","Printer","Calendar","classNames","showOutsideDays","DayPicker","ChevronLeft","updateRoute","useEditRoute","route_details","originalRoutes","isDateChange","updatedData","deleteRoute","useDeleteRoute","routeToDelete","RouteActions","editRoute","changeDate","onDeleteRoute","MoreVertical","CalendarIcon","Trash2","EditableRouteName","name","isEditing","setIsEditing","inputValue","setInputValue","inputRef","handleSubmit","handleKeyDown","routeName","getDrivers","EditableDriver","driver","selectedDriver","setSelectedDriver","searchTerm","setSearchTerm","dropdownRef","driversList","handleDriverChange","newDriver","filteredDrivers","createRoute","useAddLocalRoute","stationID","newRoute","useAddRoute","driver_id","updatedRoute","getRouteManifestData","styles","StyleSheet","ShipmentsSection","shipments","View","shipment","Text","HeaderSection","carrier_info","shipper_info","stop_info","bols","trailers","storeNumberStr","isBSG","ProblemShipmentsSection","filteredShipments","overageShipments","missingShipments","damagedShipments","ProofOfStopSection","pos","Image","TotalsSection","totalCartons","FIRST_PAGE_SHIPMENTS","REMAINING_SHIPMENTS","StopManifestDocument","pdfProps","stop_shipments","problem_shipments","bolSet","trailerSet","firstPageShipments","remainingShipments","paginatedShipments","Page","shipmentGroup","RouteManifestCoverHeader","coverProps","driver_name","route_name","pieces","manifestConverter","RouteManifestCoverStops","columnStyle","RouteManifestCover","manifestProps","stopsWithShipments","manifest","shipmentsForStop","shipmentsCount","total","RouteMainfestMain","handleClose","ReactDOM","PDFViewer","Document","RouteComponent","stopsFilter","setStopsFilter","showManifest","addRoute","filteredStops","changeName","changeDriver","border","getTimeAgo","started_at","completed_at","RoutesSection","routes","DndProvider","HTML5Backend","getDispatchDataForDay","getCurrentDayData","unnassigned_stops","Dialog","DialogPrimitive.Root","DialogTrigger","DialogPrimitive.Trigger","DialogPortal","DialogPrimitive.Portal","DialogOverlay","DialogPrimitive.Overlay","DialogContent","DialogPrimitive.Content","DialogPrimitive.Close","DialogHeader","DialogTitle","DialogPrimitive.Title","DialogDescription","DialogPrimitive.Description","upsertDeliveryTimes","upsertPOS","getDetailsForStop","importRoutes","newStop","getDeliveryPDFInfo","getStopManifestShipments","shipmentSearch","getShipmentsForStop","getWeeklyOverview","Warnings","warnings","warning","Dot","getWarningDetails","RoutePreview","handleCreate","GitPullRequestCreate","StopPreview","ImportRoutesModal","setIsLoading","response","setResponse","creatingAllRoutes","setCreatingAllRoutes","creatingRoutes","setCreatingRoutes","routesCreated","setRoutesCreated","handleFileUpload","fileText","errorMessage","handleCreateRoute","routeIndex","newRouteId","handleCreateAllRoutes","promises","r","errorRouteNames","Import","Upload","ListPlus","v4","getStations","DispatchToolbar","onSort","onCreateRoute","onFilter","onStopRouteFilter","onStationChange","activeFilters","setActiveFilters","selectedStationId","setSelectedStationId","toggleRouteFilter","f","toggleStopFilter","handleStationChange","stationId","capitalizeFirstLetter","string","routeFilters","sortOptions","stopFilters","SortAsc","sort","Filter","PlusCircle","DaySelector","dayOfWeek","stop_count","isPastPresentOrCurrent","active","isComplete","returnString","weekAbbreviation","today","weekday","ARROW_SIZE","WeekSelector","weekStart","setWeekStart","handleWeekChange","next","monthString","startMonth","endMonth","weekDays","overview","ix","StopsKey","CurrentDayContent","routeSort","setRouteSort","setRouteFilters","routeStopFilters","setRouteStopFilters","showStops","setShowStops","setStation","stopsAndRoutes","isPastDay","getIsPastDay","station_id","toggleRouteStopFilter","stateOrder","filteredRoutes","matchesSearch","routeSearchFunction","aMatchesSearch","bMatchesSearch","stateA","stateB","aIncludesSearch","bIncludesSearch","lowerCaseSearch","dateOne","dateTwo","yearOne","monthOne","dayOne","yearTwo","monthTwo","dayTwo","getDetailsForStopWrapper","stop_details","StopShipmentsContext","shipmentIds","editingMode","useStopShipments","selectedShipments","selectShipments","filters","setEditingMode","StopShipmentsProvider","setSelectedShipments","setFilters","shipmentId","searchOrKey","ShipmentCard","getBorderColor","useRemoveShipmentsFromRoute","shipment_ids","ManifestPDFMain","isOpen","stopID","ManifestPDF","showPDF","setShowPDF","useUpdateShipments","tracking_ids","ids","tracking_id","ShipmentsToolbar","selectShipmentsByStatus","first_scan","last_scan","counts","selectedDate","setSelectedDate","shipmentsMutation","handleDateChange","selectedCount","Search","Pencil","Split","ManifestPDFButton","ShipmentSection","lastSelectedIndex","setLastSelectedIndex","matchesBooleanFilters","isAnyBooleanFilterActive","first_scanned_shipment_time","last_scanned_shipment_time","handleSelectShipment","trackingId","isShiftPressed","newSelected","rangeShipments","majoritySelected","s","status","show_shipments","Textarea","useAddPOD","PODSection","pod","podData","setPodData","editedData","setEditedData","addPODMutation","handleEdit","getTimeAsInputDisplay","handleSave","posParams","handleCancel","handleChange","file","reader","IndividualStopPage","handleBackClick","db_shipments","stopDetails","StopDetailsModal","DispatchPage","useDebounce","delay","debouncedValue","setDebouncedValue","ShipmentSearchContext","ShipmentSearchProvider","searchResults","setSearchResults","debouncedSearchTerm","results","err","DispatchPageWrapper","sallyScans","exportToCSV","headers","filename","csvHeaders","csvRows","row","header","csvContent","downloadFile","blob","url","downloadScans","scans","scanLines","scan","ScanningTable","Download","SallyScanning","setDate","setScans","DataTable","columns","sorting","setSorting","copiedCell","setCopiedCell","copiedCellId","setCopiedCellId","table","useReactTable","getCoreRowModel","getSortedRowModel","handleCellClick","cellValue","cellId","scrollbarClassname","headerGroup","flexRender","cell","Success","progress","useMotionValue","motion","CircularProgress","circleLength","useTransform","checkmarkPathLength","circleColor","BillingColumns","HEADERS","downloadTemplate","generateCSVContent","fileName","clickEvt","parseFile","callback","Papa","col","h","DateControl","setShowData","setFromDate","setToDate","setDisabled","disableToDate","setDisableToDate","currentFromDate","setCurrentFromDate","createSallyEdi","downloadInvoiceDataAsCSV","useFriendlyHeaders","SallyInvoicing","showData","success","setSuccess","fromDate","toDate","invoiceData","setInvoiceData","errorText","setErrorText","setStoreData","ediText","setEdiText","lucidityCount","setLucidityCount","handlePreviewClick","handleDownloadClick","sumStopPieces","sum","ReportsPageWrapper","SearchContainer","setTrackingIDs","searchValue","setSearchValue","inputString","handleSearchClick","trackingIDs","ShipmentDetails","shipmentDetails","inputted_tracking_ids","getLongestMatch","longestMatch","renderTrackingIdWithBoldMatch","splitIndex","beforeMatch","afterMatch","scanEvents","ShipmentTrackingHistory","shipmentTrackingData","scanEventMap","getScanEventDate","dateData","getScanEventDateTime","PackageCheck","PackageX","MoveRight","ShipmentTrackingCard","getShipmentInfo","SearchResultView","shipmentTrackingDataArray","shipmentTracking","fetchShipmentTrackingData","SearchView","cleanseResponse","ShipmentSearchPage","VerticalStateSelector","onChange","defaultItem","selected","setSelected","CarriersPage","LandingLayout","DownloadFromBucket","bucket","appName","showBackButton","downloadApp","DownloadOptions","hasDriverAppPermission","hasWarehouseAppPermission","DownloadsPage","downloadBoth","getRedirectPath","StateBadge","showIcon","stateColors","stationName","textActive","textGroupHover","text","iconClass","simplifiedState","ArrowBigRight","getColor","Boxes","ThumbsUp","ArrivalProgressBar","estimatedArrival","hourDifference","getHourDifference","hoursAwayText","awaitingSortText","largeScreenAwaitingSortText","TruckIcon","startDate","endDate","ProgressBar","bgcolor","hoverbgcolor","progresscolor","hoverprogresscolor","miniView","onClick","activeProgressColor","backgroundColor","progressColor","hoverProgressColor","hoverBackgroundColor","verifyASN","fetchOSDByType","loadScanReport","resolveMissing","fetchNewScanCount","fetchASNTemplates","updateOverageStore","fetchUnscannedShipments","resolveOverage","fetchUnresolvedOSNDShipments","handleBadScan","completeSort","assignUnrecognizedToStore","insertTemplate","fetchStores","arriveLoad","beginSort","fetchOSDCount","fetchShipperLoads","resolveDamaged","fetchScannedShipments","fetchCarrierLoads","uploadASN","createStops","OsdPillMini","osdData","hasIcons","selectedTab","setSelectedTab","PackagePlus","PackageMinus","colorClasses","OSDWidget","colorClass","OsdPill","handleTabClick","OsdListView","rounded","layoutClass","OSDContainer","loadId","setCategory","miniClassName","mode","category","WarehouseContext","useWarehouseContext","WarehouseProvider","activeLoad","setActiveLoad","showCompleted","setShowCompleted","activeComponent","setActiveComponent","loadParam","showCompletedParam","infoParam","handleSetActiveLoad","handleSetShowCompleted","completed","cell_style","LoadCardView","progressColors","hasUnloadTracking","handleLoadClick","LoadHeader","changeSort","sortIndicator","VertainerLeftCarrier","toggleStation","load_id","loadSorted","mapStateToSortableValue","stateValueA","stateValueB","LoadScanReport","load_name","load_date","handleDownload","formattedData","line","DownloadIcon","formatTimeDifference","showSeconds","differenceMs","differenceSeconds","differenceMinutes","differenceHours","differenceDays","differenceMonths","ScannedShipmentsTable","scannedShipments","sortConfig","setSortConfig","sortedShipments","dateComparison","idComparison","handleSort","prevConfig","ScannedShipmentsContent","rate","lastUpdated","setLastUpdated","timeDifference","setTimeDifference","hideUnscanned","setHideUnscanned","background","getMoreScans","newScans","numberOfNewScans","lastHourScannedShipments","lastHour","placeholder","Clock","hasPlaceHolder","RefreshCcwIcon","getTimeRemaining","scanned_shipments","total_scanned","total_shipments","time_remaining","LoadShipments","trailer","MenubarMenu","MenubarPrimitive.Menu","MenubarSub","MenubarPrimitive.Sub","Menubar","MenubarPrimitive.Root","MenubarTrigger","MenubarPrimitive.Trigger","MenubarSubTrigger","MenubarPrimitive.SubTrigger","MenubarSubContent","MenubarPrimitive.SubContent","MenubarContent","alignOffset","MenubarPrimitive.Portal","MenubarPrimitive.Content","MenubarItem","MenubarPrimitive.Item","MenubarCheckboxItem","MenubarPrimitive.CheckboxItem","MenubarPrimitive.ItemIndicator","MenubarRadioItem","MenubarPrimitive.RadioItem","MenubarLabel","MenubarPrimitive.Label","MenubarSeparator","MenubarPrimitive.Separator","Command","CommandPrimitive","CommandInput","CommandList","CommandEmpty","CommandGroup","CommandSeparator","CommandItem","useUpdateOverageExceptions","exception_id","shipment_id","resolution","originalShipments","updatedShipments","useAssignToStore","store_id","store_ref","original_overage_count","newExceptionId","newException","fetchStoresWrapper","OverageStoreSelector","osdShipment","updateOverageExceptions","setValue","handleSelect","currentValue","filtered_stores","entry","ChevronsUpDown","OverageResolutions","handleClick","useUpdateMissingShipment","original_shortage_count","shortageCount","MissingResolutions","updateMissingShipment","useUpdateDamagedExceptions","DamagedResolutions","updateDamagedExceptions","CarrierShipmentRow","ShipperShipmentRow","fetchOSDByTypeWrapper","OSDTable","useUpdateLoadStateArrived","updatedFields","originalLoads","updatedLoads","useUpdateStateOfLoad","MissingRow","MissingShipments","UnresolvedExceptionRow","UnresolvedExceptionHeader","osdShipments","fetchUnresolvedOSNDShipmentsWrapper","CompleteSort","mutate","step","setStep","unresolved","unresolvedLoading","unscanned","unscannedLoading","handleCompleteLoadClick","LoadArrivedForm","setComponent","z","arriveLoadData","CarrierLoadDataContainer","load_info","showProgressBar","showCompleteButton","showArrivedButton","showOSD","changeComponent","component","fetchCarrierLoadsWrapper","CarrierWarehouse","loadsLoading","loadsError","getLoadInfo","target_load","LoadDataContainer","LeftLoadCard","accuracy","VertainerLeft","ShipperLoadDataContainer","asn_accuracy","fetchShipperLoadsWrapper","UploadAsnContext","useUploadAsn","csvData","setCSVData","setHeaders","verified","setVerified","outboundStation","setOutboundStation","verifiedData","setVerifiedData","UploadAsnProvider","Select","SelectPrimitive.Root","SelectValue","SelectPrimitive.Value","SelectTrigger","SelectPrimitive.Trigger","SelectPrimitive.Icon","ChevronDown","SelectScrollUpButton","SelectPrimitive.ScrollUpButton","ChevronUp","SelectScrollDownButton","SelectPrimitive.ScrollDownButton","SelectContent","SelectPrimitive.Portal","SelectPrimitive.Content","SelectPrimitive.Viewport","SelectLabel","SelectPrimitive.Label","SelectItem","SelectPrimitive.Item","SelectPrimitive.ItemIndicator","SelectPrimitive.ItemText","SelectSeparator","SelectPrimitive.Separator","UploadFile","meta","ROWS","fieldLabels","requiredFields","AddTemplate","headerMapping","setHeaderMapping","setErrorMessage","rows","handleHeaderChange","selectedValues","duplicates","missingRequiredFields","mappedHeaders","mappedHeader","insertTemplateParams","InfoIcon","option","rowIndex","colIndex","UploadInvalidTemplate","template","uploadedHeaders","headers_needed","selectedOptions","setSelectedOptions","uploaded_rows","headers_map","map","allOptions","newValue","oldValue","prevSelectedOptions","newSelectedOptions","newHeaders","newCSVData","newRow","selectedHeader","selectedValue","availableOptions","TemplateView","matchedHeaders","matchHeaders","expected","uploaded","findHeaderMatch","templateField","DisplayErrorsAndUpload","errors","isSuccess","setIsSuccess","errorsList","store_warnings","store_errors","shipment_errors","shipment_warnings","missing_cell_errors","onButtonClick","getWarningResolutionObject","getErrorResolutionObject","DisplayASNVerificationErrors","hasNoTemplate","hasInvalidTemplate","noTemplateErrors","UploadASN","ShipperWarehouse","WarehousePage","StationContext","useStationContext","StationProvider","selectedStation","setSelectedStation","selectedRegion","setSelectedRegion","selectedStore","setSelectedStore","setSelectedRegionCascade","Tabs","TabsPrimitive.Root","TabsList","TabsPrimitive.List","TabsTrigger","TabsPrimitive.Trigger","TabsContent","TabsPrimitive.Content","getStationUsers","userFriendlyPermissions","hasWebappAccess","getPermissionByFriendlyName","friendlyName","Password","setPassword","handleFormSubmit","handlePasswordChange","EyeOff","Eye","inviteUsername","removeUserFromStation","inviteUser","useAddUserEmail","firstName","lastName","useAddUsername","useRemoveUser","AddUserRow","menuOpen","setMenuOpen","newUser","setNewUser","selectedPermissions","setSelectedPermissions","setErrors","emailMutation","usernameMutation","isValidPassword","hasUpperCase","hasLowerCase","hasNumber","isValidUsername","isValidName","validateFields","newErrors","isUsername","handleAddNewUser","resetForm","handleAddNewUsername","perm","togglePermission","updateUserField","permissionStrings","topPermissions","bottomPermissions","updateUserPermission","useAddOrRemoveUserPermission","userId","updatedUsers","ChangePermissions","userID","changePermission","permissionAsPermission","UserCog","changePassword","ResetPassword","isSubMenuOpen","setIsSubMenuOpen","handleResetPassword","newPassword","Key","resendOtpEmail","webappAccess","handleResendEmail","Globe","UserMinus","Mail","StationUsers","adminUsers","regularUsers","StationStores","getRegions","RegionsOptionsMenu","regionId","onEdit","onDelete","EllipsisVertical","getDestinationStations","updateRegion","addRegion","RegionCard","isAddRegionCard","onCancel","setName","selectedCarrier","setSelectedCarrier","carrierList","onArrowClick","carrier","ArrowLeft","RegionList","regions","getStoresByRegion","StoreOptionsMenu","storeId","StoreCard","RegionStores","uploadStores","PreviewStores","UploadDropzone","onDrop","getRootProps","getInputProps","useDropzone","ErrorList","storeDataFields","addressDataFields","scheduleFields","MappingForm","control","currentStep","setCurrentStep","steps","isLastStep","isFirstStep","UploadStoresModalMain","onConfirm","setNewHeaders","setCsvData","uploadErrors","previewedStores","setPreviewedStores","acceptedFiles","csvString","resolve","reject","onFileSubmit","selectedField","originalHeader","updatedCsvData","onPreviewSubmit","showMapping","showDropZone","UploadStoresModal","setIsOpen","StationRegions","editing","setEditing","setAddRegion","addRegionObject","getStationInfo","SelectedStationPage","stationInfo","getStationsLatLong","getShipperStationPinsAndInfo","getCenter","vertices","area","centroidX","centroidY","x1","y1","x2","y2","crossProduct","jarvisMarch","hull","pointOnHull","lowest","endpoint","ccw","c","getPolygon","edges","allPoints","bounds","names","center","isPointInPolygon","x","y","inside","j","xi","yi","xj","yj","parseMapboxEvent","features","properties","NewStationForm","stationAddress","formData","setFormData","uploadStation","useAddStation","line1","city","zip","code","lat","lng","RadioGroup","RadioGroupPrimitive.Root","RadioGroupItem","RadioGroupPrimitive.Item","RadioGroupPrimitive.Indicator","StoreContactForm","address","scheduleDay","setScheduleDay","calculateDistance","lat1","lon1","lat2","lon2","dLat","dLon","ShipperMap","searchExpanded","setSearchExpanded","setAddress","handleStationSelect","addStationMutation","storesAndInfo","handleMapClick","clickedPoint","formattedCoords","storePinsForSelectedRegion","handleCreateStationClick","handleCreateStoreClick","handleSearchResult","parsedAddress","currentCenter","speed","offsetX","newCenter","handleCancelClick","onCreateStation","SearchBox","stationLat","stationLong","NewStoreForm","getCarrierStationPinsAndInfo","CarrierMap","setStationAddress","onCancelNewStation","showStationPopup","StationPage","StationPageWrapper","getClaimableShipments","determineCompanyAtFault","claim","ClaimsPage","dateFilter","setDateFilter","typeFilter","setTypeFilter","claims","filteredClaims","claimDate","now","oneWeekAgo","twoWeeksAgo","oneMonthAgo","oneYearAgo","dateFilterPass","typeFilterPass","AnalyticsURLContext","useAnalyticsURL","AnalyticsURLProvider","getParamOrNull","timePeriod","setTimePeriod","stationParam","regionParam","storeParam","timePeriodParam","currentParams","newParams","handleRegionChange","StoreMarker","StationPin","centroid","getRegionPolygon","getRegionNames","getRegionLayerStyle","getRegionLabelLayerStyle","getRegionEdges","getRegionEdgeLayerStyle","getCoords","getCoordsWrapper","st","getStoreCoords","AnalyticsMap","geojson","centroidsGeoJSON","edgesGeoJSON","regionLayerStyle","labelLayerStyle","edgeLayerStyle","handleStoreClick","handleStationClick","loadMap","darkerColor","queryStore","queryRegion","queryStation","dateRangeOptions","GraphToolbar","formatDateRange","sub","format","AnalyticsPage","AnalyticsPageWrapper","ResetPasswordForm","confirmPassword","setConfirmPassword","setMessage","handlePasswordReset","PalletsPDF","storeNumbers","barcodeImages","setBarcodeImages","images","num","generateBarcodeBase64","number","canvas","JsBarcode","PalletPrinting","input","setInput","setStoreNumbers","numbers","PrivateRoutes","isWebappUser","signupUser","UserSignup","showPasswordConfirm","setShowPasswordConfirm","errorDescription","orgId","signup_error","EyeOffIcon","carrierSignup","CarrierSignupPage","organization_id","useParams","nav","PrivacyPolicyBody","PrivacyPolicy","QueryClient","App","QueryClientProvider","RequireAuth","ReactQueryDevtools","environment","isLocalhost","Sentry.init","Sentry.browserTracingIntegration","Sentry.replayIntegration","ReactDOM.createRoot","StrictMode","BrowserRouter"],"mappings":"8+FAEO,SAASA,GAAiBC,EAAwC,CACvE,GAAIA,EACF,QAAQ,MAAMA,CAAK,MAEZ,QAAA,KAGT,OAAQA,GAAA,YAAAA,EAAO,QAAS,CACtB,IAAK,4BACI,MAAA,0BAET,IAAK,sBACI,MAAA,8BAET,QACE,OAAOA,GAAA,YAAAA,EAAO,UAAW,2BAC7B,CACF,CCjBa,MAAAC,GAAc,2CACdC,GAAc,mNAEdC,EAAWC,GAAaH,GAAaC,EAAW,ECiC7D,eAAsBG,GACpBC,EACD,CACK,GAAA,CACI,M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P,SAAU,GACV,YAAa,EACf,EACA,CACE,KAAM,sBACN,MAAO,sBACP,SAAU,GACV,YAAa,EACf,EACA,CACE,KAAM,sBACN,MAAO,sBACP,SAAU,GACV,YAAa,EACf,CACF,EAGaC,GAAoB,CAC/B,CACE,KAAM,aACN,MAAO,aACP,SAAU,GACV,YAAa,wBACf,EACA,CACE,KAAM,SACN,MAAO,SACP,SAAU,GACV,YAAa,kCACf,EAEA,CACE,KAAM,OACN,MAAO,OACP,SAAU,GACV,YAAa,EACf,EACA,CACE,KAAM,QACN,MAAO,QACP,SAAU,GACV,YAAa,EACf,EACA,CACE,KAAM,WACN,MAAO,WACP,SAAU,GACV,YAAa,EACf,EAEA,CACE,KAAM,SACN,MAAO,iBACP,SAAU,GACV,YAAa,wBACf,EAEA,CACE,KAAM,MACN,MAAO,WACP,SAAU,GACV,YAAa,EACf,EACA,CACE,KAAM,OACN,MAAO,YACP,SAAU,GACV,YAAa,EACf,CACF,EAGaC,GAAiB,CAC5B,CACE,KAAM,cACN,MAAO,oBACP,SAAU,GACV,YAAa,sCACf,EACA,CACE,KAAM,cACN,MAAO,qBACP,SAAU,GACV,YAAa,uCACf,EACA,CACE,KAAM,cACN,MAAO,uBACP,SAAU,GACV,YAAa,yCACf,EACA,CACE,KAAM,eACN,MAAO,sBACP,SAAU,GACV,YAAa,wCACf,EACA,CACE,KAAM,cACN,MAAO,oBACP,SAAU,GACV,YAAa,sCACf,EACA,CACE,KAAM,eACN,MAAO,sBACP,SAAU,GACV,YAAa,wCACf,EACA,CACE,KAAM,eACN,MAAO,oBACP,SAAU,GACV,YAAa,sCACf,EACA,CACE,KAAM,sBACN,MAAO,sBACP,SAAU,GACV,YAAa,sDACf,EACA,CACE,KAAM,oBACN,MAAO,oBACP,SAAU,GACV,YAAa,oDACf,CACF,EC/GO,SAASC,GAAY,CAC1B,WAAAzoB,EACA,SAAAh4B,EACA,QAAA0gD,EACA,aAAA59B,CACF,EAAU,CACR,KAAM,CAAC69B,EAAaC,C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