@burdenoff/microfe-movethewheels 2026.1101.1 → 2026.1101.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -7,4 +7,5 @@ import "./useCustomers.js";
7
7
  import "./useAnalytics.js";
8
8
  import "./useTracking.js";
9
9
  import "./useEntityDocuments.js";
10
+ import "./useDriverDay.js";
10
11
  import "./useEpod.js";
@@ -0,0 +1,153 @@
1
+ import { useMoveTheWheels as e } from "../providers/MoveTheWheelsProvider.js";
2
+ import { executeGraphQL as t } from "../utils/graphqlClient.js";
3
+ import { deviceTimeZone as n, timezoneOffsetFor as r } from "../utils/driverNavigation.js";
4
+ import { useCallback as i, useEffect as a, useMemo as o, useRef as s, useState as c } from "react";
5
+ //#region src/movethewheels/hooks/useDriverDay.ts
6
+ var l = "\n query MyDeliveryDay($date: String!, $timezoneOffsetMinutes: Int, $timeZone: String) {\n myDeliveryDay(date: $date, timezoneOffsetMinutes: $timezoneOffsetMinutes, timeZone: $timeZone) {\n date\n driverId\n driverName\n totalStops\n completedStops\n remainingStops\n stops {\n \n sequence\n state\n awaitingCapture\n overdue\n deliveredAt\n routeId\n routeName\n deliveryJob {\n id\n deliveryJobNumber\n status\n priority\n deliveryAddress\n scheduledDelivery\n specialInstructions\n customer {\n name\n phone\n }\n }\n\n }\n }\n }\n";
7
+ function u(e) {
8
+ let t = e.deliveryJob;
9
+ return {
10
+ sequence: e.sequence,
11
+ state: e.state,
12
+ awaitingCapture: e.awaitingCapture,
13
+ overdue: e.overdue,
14
+ deliveredAt: e.deliveredAt ? new Date(e.deliveredAt) : void 0,
15
+ routeId: e.routeId ?? void 0,
16
+ routeName: e.routeName ?? void 0,
17
+ jobId: t.id,
18
+ deliveryJobNumber: t.deliveryJobNumber,
19
+ status: t.status,
20
+ priority: t.priority,
21
+ deliveryAddress: t.deliveryAddress,
22
+ scheduledDelivery: t.scheduledDelivery ? new Date(t.scheduledDelivery) : void 0,
23
+ specialInstructions: t.specialInstructions ?? void 0,
24
+ customerName: t.customer?.name ?? void 0,
25
+ customerPhone: t.customer?.phone ?? void 0
26
+ };
27
+ }
28
+ function d(e, t) {
29
+ return e.map((e) => t.has(e.jobId) && e.state !== "COMPLETED" ? {
30
+ ...e,
31
+ state: "COMPLETED",
32
+ awaitingCapture: !1,
33
+ status: "DELIVERED"
34
+ } : e);
35
+ }
36
+ function f(e) {
37
+ let t = e.filter((e) => e.state === "COMPLETED" || e.state === "FAILED").length;
38
+ return {
39
+ totalStops: e.length,
40
+ completedStops: t,
41
+ remainingStops: e.length - t,
42
+ nextStop: e.find((e) => e.awaitingCapture) ?? e.find((e) => e.state === "UPCOMING") ?? null
43
+ };
44
+ }
45
+ function p(p) {
46
+ let { apiGatewayUrl: m, authToken: h, workspaceToken: g, workspaceId: _, tenantId: v, currentUser: y } = e(), b = o(() => ({
47
+ apiGatewayUrl: m,
48
+ authToken: h,
49
+ workspaceToken: g,
50
+ workspaceId: _,
51
+ tenantId: v,
52
+ actorId: y?.id
53
+ }), [
54
+ m,
55
+ h,
56
+ g,
57
+ _,
58
+ v,
59
+ y?.id
60
+ ]), x = JSON.stringify([
61
+ m,
62
+ _,
63
+ v,
64
+ y?.id
65
+ ]), S = JSON.stringify([x, p]), [C, w] = c({
66
+ scopeKey: x,
67
+ ids: /* @__PURE__ */ new Set()
68
+ }), T = s(0), [E, D] = c({
69
+ readKey: S,
70
+ day: null,
71
+ isLoading: !0,
72
+ error: null
73
+ }), O = i(async () => {
74
+ let e = ++T.current;
75
+ D((e) => ({
76
+ readKey: S,
77
+ day: e.readKey === S ? e.day : null,
78
+ isLoading: !0,
79
+ error: null
80
+ }));
81
+ try {
82
+ let i = await t(b, l, {
83
+ date: p,
84
+ timezoneOffsetMinutes: r(p),
85
+ timeZone: n()
86
+ });
87
+ if (e !== T.current) return;
88
+ D({
89
+ readKey: S,
90
+ day: i.myDeliveryDay,
91
+ isLoading: !1,
92
+ error: null
93
+ });
94
+ } catch (t) {
95
+ if (e !== T.current) return;
96
+ D((e) => ({
97
+ readKey: S,
98
+ day: e.readKey === S ? e.day : null,
99
+ isLoading: !1,
100
+ error: t instanceof Error ? t : /* @__PURE__ */ Error("Failed to load your deliveries")
101
+ }));
102
+ }
103
+ }, [
104
+ b,
105
+ p,
106
+ S
107
+ ]), k = i(() => {
108
+ T.current++;
109
+ }, []);
110
+ a(() => (O(), k), [O, k]);
111
+ let A = i((e) => {
112
+ w((t) => {
113
+ let n = new Set(t.scopeKey === x ? t.ids : []);
114
+ return n.add(e), {
115
+ scopeKey: x,
116
+ ids: n
117
+ };
118
+ });
119
+ }, [x]), j = E.readKey === S ? E : null, M = j?.day ?? null;
120
+ return {
121
+ day: o(() => {
122
+ if (!M) return null;
123
+ let e = C.scopeKey === x ? C.ids : /* @__PURE__ */ new Set(), t = d(M.stops.map(u), e);
124
+ return {
125
+ date: M.date,
126
+ driverId: M.driverId,
127
+ driverName: M.driverName,
128
+ stops: t,
129
+ ...f(t)
130
+ };
131
+ }, [
132
+ M,
133
+ x,
134
+ C
135
+ ]),
136
+ isLoading: !j || j.isLoading,
137
+ error: j?.error ?? null,
138
+ refetch: O,
139
+ markCaptured: A
140
+ };
141
+ }
142
+ function m() {
143
+ let [e, t] = c(() => typeof navigator > "u" ? !0 : navigator.onLine !== !1);
144
+ return a(() => {
145
+ if (typeof window > "u") return;
146
+ let e = () => t(navigator.onLine !== !1);
147
+ return window.addEventListener("online", e), window.addEventListener("offline", e), () => {
148
+ window.removeEventListener("online", e), window.removeEventListener("offline", e);
149
+ };
150
+ }, []), e;
151
+ }
152
+ //#endregion
153
+ export { p as useMyDeliveryDay, m as useOnlineStatus };
@@ -375,4 +375,4 @@ function w() {
375
375
  };
376
376
  }
377
377
  //#endregion
378
- export { x as mapOrder, _ as mapOrderPriority, g as mapOrderStatus, C as useOrder, w as useOrderStats, S as useOrders };
378
+ export { x as mapOrder, _ as mapOrderPriority, C as useOrder, w as useOrderStats, S as useOrders };
package/dist/index.js CHANGED
@@ -8,31 +8,32 @@ import { useCustomer as E, useCustomerStats as D, useCustomers as O } from "./ho
8
8
  import { useAnalytics as k, useDashboardMetrics as A, useEmissionsSummary as j, useFinanceMetrics as M, useFleetAnalytics as N, useOrderAnalytics as P, usePerformanceAnalytics as F, useRevenueAnalytics as I } from "./hooks/useAnalytics.js";
9
9
  import { useDriverTracking as L, useGeofence as R, useLiveTracking as z, useOrderTracking as B, useTracking as V, useTrackingAlerts as H, useVehicleTracking as U } from "./hooks/useTracking.js";
10
10
  import { useEntityDocuments as W } from "./hooks/useEntityDocuments.js";
11
- import { useCaptureEpod as G, useEpod as K, useEpodPhotoUpload as q, useEpodPhotoUrl as J, useMyPendingEpodDeliveryJobs as Y } from "./hooks/useEpod.js";
11
+ import { useMyDeliveryDay as G, useOnlineStatus as K } from "./hooks/useDriverDay.js";
12
+ import { useCaptureEpod as q, useEpod as J, useEpodPhotoUpload as Y, useEpodPhotoUrl as X, useMyPendingEpodDeliveryJobs as Z } from "./hooks/useEpod.js";
12
13
  import "./hooks/index.js";
13
- import { MoveTheWheelsRoot as X } from "./MoveTheWheelsRoot.js";
14
- import { useMoveTheWheelsStore as Z } from "./store/movethewheelsStore.js";
15
- import { useSandboxAssistantTransport as Q } from "./services/createSandboxAssistantTransport.js";
16
- import { Avatar as $, AvatarFallback as ee, AvatarImage as te, Badge as ne, Button as re, Card as ie, CardContent as ae, CardDescription as oe, CardFooter as se, CardHeader as ce, CardTitle as le, Checkbox as ue, Command as de, CommandEmpty as fe, CommandGroup as pe, CommandInput as me, CommandItem as he, CommandList as ge, Dialog as _e, DialogContent as ve, DialogDescription as ye, DialogFooter as be, DialogHeader as xe, DialogTitle as Se, DialogTrigger as Ce, DropdownMenu as we, DropdownMenuContent as Te, DropdownMenuItem as Ee, DropdownMenuSeparator as De, DropdownMenuTrigger as Oe, Input as ke, Label as Ae, Popover as je, PopoverContent as Me, PopoverTrigger as Ne, Progress as Pe, ScrollArea as Fe, Select as Ie, SelectContent as Le, SelectItem as Re, SelectTrigger as ze, SelectValue as Be, Separator as Ve, Skeleton as He, Switch as Ue, Table as We, TableBody as Ge, TableCell as Ke, TableHead as qe, TableHeader as Je, TableRow as Ye, Tabs as Xe, TabsContent as Ze, TabsList as Qe, TabsTrigger as $e, Textarea as et, Tooltip as tt, TooltipContent as nt, TooltipProvider as rt, TooltipTrigger as it } from "./components/ui.js";
17
- import { EmptyState as at, ErrorState as ot, LoadingState as st, PageLayout as ct, PageSection as lt } from "./components/PageLayout.js";
18
- import { chartTokens as ut, seriesColor as dt } from "./components/charts/chartTokens.js";
19
- import { Sparkline as ft } from "./components/charts/Sparkline.js";
20
- import { MetricCard as pt, MetricCardSkeleton as mt, MetricGrid as ht } from "./components/MetricCard.js";
21
- import { GlassPanel as gt } from "./components/GlassPanel.js";
22
- import { ChartEmpty as _t, ChartTooltip as vt } from "./components/charts/ChartShell.js";
23
- import { TrendChart as yt } from "./components/charts/TrendChart.js";
24
- import { VolumeBar as bt } from "./components/charts/VolumeBar.js";
25
- import { StatusDonut as xt } from "./components/charts/StatusDonut.js";
26
- import { createCurrentIcon as St, createPinIcon as Ct, createStopIcon as wt, isRealCoord as Tt } from "./components/maps/leaflet-setup.js";
27
- import { MapCanvas as Et } from "./components/maps/MapCanvas.js";
28
- import { LogisticsMap as Dt } from "./components/maps/LogisticsMap.js";
29
- import { RouteMap as Ot } from "./components/maps/RouteMap.js";
30
- import { TrackingMap as kt } from "./components/maps/TrackingMap.js";
31
- import { PaymentStatusBadge as At, PriorityBadge as jt, StatusBadge as Mt, TypeBadge as Nt, VehicleTypeBadge as Pt } from "./components/StatusBadge.js";
32
- import { DataTable as Ft } from "./components/DataTable.js";
33
- import { FormError as It } from "./components/FormError.js";
34
- import { Notice as Lt, useNotice as Rt } from "./components/Notice.js";
35
- import { DocumentsCard as zt } from "./components/DocumentsCard.js";
36
- import { CarbonFootprintPanel as Bt } from "./components/CarbonFootprintPanel.js";
14
+ import { MoveTheWheelsRoot as Q } from "./MoveTheWheelsRoot.js";
15
+ import { useMoveTheWheelsStore as $ } from "./store/movethewheelsStore.js";
16
+ import { useSandboxAssistantTransport as ee } from "./services/createSandboxAssistantTransport.js";
17
+ import { Avatar as te, AvatarFallback as ne, AvatarImage as re, Badge as ie, Button as ae, Card as oe, CardContent as se, CardDescription as ce, CardFooter as le, CardHeader as ue, CardTitle as de, Checkbox as fe, Command as pe, CommandEmpty as me, CommandGroup as he, CommandInput as ge, CommandItem as _e, CommandList as ve, Dialog as ye, DialogContent as be, DialogDescription as xe, DialogFooter as Se, DialogHeader as Ce, DialogTitle as we, DialogTrigger as Te, DropdownMenu as Ee, DropdownMenuContent as De, DropdownMenuItem as Oe, DropdownMenuSeparator as ke, DropdownMenuTrigger as Ae, Input as je, Label as Me, Popover as Ne, PopoverContent as Pe, PopoverTrigger as Fe, Progress as Ie, ScrollArea as Le, Select as Re, SelectContent as ze, SelectItem as Be, SelectTrigger as Ve, SelectValue as He, Separator as Ue, Skeleton as We, Switch as Ge, Table as Ke, TableBody as qe, TableCell as Je, TableHead as Ye, TableHeader as Xe, TableRow as Ze, Tabs as Qe, TabsContent as $e, TabsList as et, TabsTrigger as tt, Textarea as nt, Tooltip as rt, TooltipContent as it, TooltipProvider as at, TooltipTrigger as ot } from "./components/ui.js";
18
+ import { EmptyState as st, ErrorState as ct, LoadingState as lt, PageLayout as ut, PageSection as dt } from "./components/PageLayout.js";
19
+ import { chartTokens as ft, seriesColor as pt } from "./components/charts/chartTokens.js";
20
+ import { Sparkline as mt } from "./components/charts/Sparkline.js";
21
+ import { MetricCard as ht, MetricCardSkeleton as gt, MetricGrid as _t } from "./components/MetricCard.js";
22
+ import { GlassPanel as vt } from "./components/GlassPanel.js";
23
+ import { ChartEmpty as yt, ChartTooltip as bt } from "./components/charts/ChartShell.js";
24
+ import { TrendChart as xt } from "./components/charts/TrendChart.js";
25
+ import { VolumeBar as St } from "./components/charts/VolumeBar.js";
26
+ import { StatusDonut as Ct } from "./components/charts/StatusDonut.js";
27
+ import { createCurrentIcon as wt, createPinIcon as Tt, createStopIcon as Et, isRealCoord as Dt } from "./components/maps/leaflet-setup.js";
28
+ import { MapCanvas as Ot } from "./components/maps/MapCanvas.js";
29
+ import { LogisticsMap as kt } from "./components/maps/LogisticsMap.js";
30
+ import { RouteMap as At } from "./components/maps/RouteMap.js";
31
+ import { TrackingMap as jt } from "./components/maps/TrackingMap.js";
32
+ import { PaymentStatusBadge as Mt, PriorityBadge as Nt, StatusBadge as Pt, TypeBadge as Ft, VehicleTypeBadge as It } from "./components/StatusBadge.js";
33
+ import { DataTable as Lt } from "./components/DataTable.js";
34
+ import { FormError as Rt } from "./components/FormError.js";
35
+ import { Notice as zt, useNotice as Bt } from "./components/Notice.js";
36
+ import { DocumentsCard as Vt } from "./components/DocumentsCard.js";
37
+ import { CarbonFootprintPanel as Ht } from "./components/CarbonFootprintPanel.js";
37
38
  import "./components/index.js";
38
- export { $ as Avatar, ee as AvatarFallback, te as AvatarImage, ne as Badge, re as Button, Bt as CarbonFootprintPanel, ie as Card, ae as CardContent, oe as CardDescription, se as CardFooter, ce as CardHeader, le as CardTitle, _t as ChartEmpty, vt as ChartTooltip, ue as Checkbox, de as Command, fe as CommandEmpty, pe as CommandGroup, me as CommandInput, he as CommandItem, ge as CommandList, Ft as DataTable, _e as Dialog, ve as DialogContent, ye as DialogDescription, be as DialogFooter, xe as DialogHeader, Se as DialogTitle, Ce as DialogTrigger, zt as DocumentsCard, we as DropdownMenu, Te as DropdownMenuContent, Ee as DropdownMenuItem, De as DropdownMenuSeparator, Oe as DropdownMenuTrigger, at as EmptyState, ot as ErrorState, It as FormError, gt as GlassPanel, ke as Input, Ae as Label, st as LoadingState, Dt as LogisticsMap, Et as MapCanvas, pt as MetricCard, mt as MetricCardSkeleton, ht as MetricGrid, X as MoveTheWheelsRoot, Lt as Notice, ct as PageLayout, lt as PageSection, At as PaymentStatusBadge, je as Popover, Me as PopoverContent, Ne as PopoverTrigger, jt as PriorityBadge, Pe as Progress, Ot as RouteMap, Fe as ScrollArea, Ie as Select, Le as SelectContent, Re as SelectItem, ze as SelectTrigger, Be as SelectValue, Ve as Separator, He as Skeleton, ft as Sparkline, Mt as StatusBadge, xt as StatusDonut, Ue as Switch, We as Table, Ge as TableBody, Ke as TableCell, qe as TableHead, Je as TableHeader, Ye as TableRow, Xe as Tabs, Ze as TabsContent, Qe as TabsList, $e as TabsTrigger, et as Textarea, tt as Tooltip, nt as TooltipContent, rt as TooltipProvider, it as TooltipTrigger, kt as TrackingMap, yt as TrendChart, Nt as TypeBadge, Pt as VehicleTypeBadge, bt as VolumeBar, ut as chartTokens, St as createCurrentIcon, Ct as createPinIcon, wt as createStopIcon, Tt as isRealCoord, dt as seriesColor, k as useAnalytics, G as useCaptureEpod, E as useCustomer, D as useCustomerStats, O as useCustomers, A as useDashboardMetrics, l as useDriver, u as useDriverStatusCounts, L as useDriverTracking, d as useDrivers, j as useEmissionsSummary, W as useEntityDocuments, K as useEpod, q as useEpodPhotoUpload, J as useEpodPhotoUrl, M as useFinanceMetrics, f as useFleet, N as useFleetAnalytics, p as useFleetStats, R as useGeofence, _ as useInventory, v as useInventoryStats, y as useInventoryTransactions, z as useLiveTracking, e as useMoveTheWheels, t as useMoveTheWheelsNavigate, Z as useMoveTheWheelsStore, Y as useMyPendingEpodDeliveryJobs, Rt as useNotice, o as useOrder, P as useOrderAnalytics, s as useOrderStats, B as useOrderTracking, c as useOrders, F as usePerformanceAnalytics, b as useProduct, x as useProductStockLevels, S as useProducts, I as useRevenueAnalytics, r as useRoute, i as useRouteStats, a as useRoutes, Q as useSandboxAssistantTransport, C as useStockActions, n as useTr, V as useTracking, H as useTrackingAlerts, m as useVehicle, h as useVehicleDrivers, U as useVehicleTracking, g as useVehicles, w as useWarehouse, T as useWarehouses };
39
+ export { te as Avatar, ne as AvatarFallback, re as AvatarImage, ie as Badge, ae as Button, Ht as CarbonFootprintPanel, oe as Card, se as CardContent, ce as CardDescription, le as CardFooter, ue as CardHeader, de as CardTitle, yt as ChartEmpty, bt as ChartTooltip, fe as Checkbox, pe as Command, me as CommandEmpty, he as CommandGroup, ge as CommandInput, _e as CommandItem, ve as CommandList, Lt as DataTable, ye as Dialog, be as DialogContent, xe as DialogDescription, Se as DialogFooter, Ce as DialogHeader, we as DialogTitle, Te as DialogTrigger, Vt as DocumentsCard, Ee as DropdownMenu, De as DropdownMenuContent, Oe as DropdownMenuItem, ke as DropdownMenuSeparator, Ae as DropdownMenuTrigger, st as EmptyState, ct as ErrorState, Rt as FormError, vt as GlassPanel, je as Input, Me as Label, lt as LoadingState, kt as LogisticsMap, Ot as MapCanvas, ht as MetricCard, gt as MetricCardSkeleton, _t as MetricGrid, Q as MoveTheWheelsRoot, zt as Notice, ut as PageLayout, dt as PageSection, Mt as PaymentStatusBadge, Ne as Popover, Pe as PopoverContent, Fe as PopoverTrigger, Nt as PriorityBadge, Ie as Progress, At as RouteMap, Le as ScrollArea, Re as Select, ze as SelectContent, Be as SelectItem, Ve as SelectTrigger, He as SelectValue, Ue as Separator, We as Skeleton, mt as Sparkline, Pt as StatusBadge, Ct as StatusDonut, Ge as Switch, Ke as Table, qe as TableBody, Je as TableCell, Ye as TableHead, Xe as TableHeader, Ze as TableRow, Qe as Tabs, $e as TabsContent, et as TabsList, tt as TabsTrigger, nt as Textarea, rt as Tooltip, it as TooltipContent, at as TooltipProvider, ot as TooltipTrigger, jt as TrackingMap, xt as TrendChart, Ft as TypeBadge, It as VehicleTypeBadge, St as VolumeBar, ft as chartTokens, wt as createCurrentIcon, Tt as createPinIcon, Et as createStopIcon, Dt as isRealCoord, pt as seriesColor, k as useAnalytics, q as useCaptureEpod, E as useCustomer, D as useCustomerStats, O as useCustomers, A as useDashboardMetrics, l as useDriver, u as useDriverStatusCounts, L as useDriverTracking, d as useDrivers, j as useEmissionsSummary, W as useEntityDocuments, J as useEpod, Y as useEpodPhotoUpload, X as useEpodPhotoUrl, M as useFinanceMetrics, f as useFleet, N as useFleetAnalytics, p as useFleetStats, R as useGeofence, _ as useInventory, v as useInventoryStats, y as useInventoryTransactions, z as useLiveTracking, e as useMoveTheWheels, t as useMoveTheWheelsNavigate, $ as useMoveTheWheelsStore, G as useMyDeliveryDay, Z as useMyPendingEpodDeliveryJobs, Bt as useNotice, K as useOnlineStatus, o as useOrder, P as useOrderAnalytics, s as useOrderStats, B as useOrderTracking, c as useOrders, F as usePerformanceAnalytics, b as useProduct, x as useProductStockLevels, S as useProducts, I as useRevenueAnalytics, r as useRoute, i as useRouteStats, a as useRoutes, ee as useSandboxAssistantTransport, C as useStockActions, n as useTr, V as useTracking, H as useTrackingAlerts, m as useVehicle, h as useVehicleDrivers, U as useVehicleTracking, g as useVehicles, w as useWarehouse, T as useWarehouses };
@@ -0,0 +1,12 @@
1
+ import { PendingEpodDeliveryJob } from '../hooks/useEpod';
2
+ export declare function EpodCaptureForm({ job, onCaptured, onCancel, offline, }: {
3
+ job: PendingEpodDeliveryJob;
4
+ onCaptured: (deliveryJobId: string) => void;
5
+ onCancel: () => void;
6
+ /**
7
+ * True while the device has no network. Capture needs the live linked
8
+ * shipment status and an acknowledged server write, so it is blocked
9
+ * rather than queued while offline.
10
+ */
11
+ offline?: boolean;
12
+ }): import('react').JSX.Element;
@@ -12,4 +12,5 @@ export { useRoutes, useRoute, useRouteStats } from './useRoutes';
12
12
  export { useAnalytics, useDashboardMetrics, useRevenueAnalytics, useOrderAnalytics, useFleetAnalytics, usePerformanceAnalytics, useFinanceMetrics, type FinanceMetrics, useEmissionsSummary, type EmissionsSummary, } from './useAnalytics';
13
13
  export { useTracking, useOrderTracking, useVehicleTracking, useDriverTracking, useLiveTracking, useTrackingAlerts, useGeofence, } from './useTracking';
14
14
  export { useEntityDocuments, type EntityDocument, type EntityDocumentType, } from './useEntityDocuments';
15
+ export { useMyDeliveryDay, useOnlineStatus, type DriverDay, type DriverStop, type DriverStopState, } from './useDriverDay';
15
16
  export { useEpod, useMyPendingEpodDeliveryJobs, useCaptureEpod, useEpodPhotoUpload, useEpodPhotoUrl, type PendingEpodDeliveryJob, type CaptureEpodArgs, type UploadedEpodPhoto, } from './useEpod';
@@ -0,0 +1,53 @@
1
+ import { Order } from '../types';
2
+ export type DriverStopState = 'COMPLETED' | 'EN_ROUTE' | 'UPCOMING' | 'FAILED';
3
+ export interface DriverStop {
4
+ sequence: number;
5
+ state: DriverStopState;
6
+ awaitingCapture: boolean;
7
+ overdue: boolean;
8
+ deliveredAt?: Date;
9
+ routeId?: string;
10
+ routeName?: string;
11
+ jobId: string;
12
+ deliveryJobNumber: string;
13
+ status: string;
14
+ priority: string;
15
+ deliveryAddress: Order['deliveryAddress'] | null;
16
+ scheduledDelivery?: Date;
17
+ specialInstructions?: string;
18
+ customerName?: string;
19
+ customerPhone?: string;
20
+ }
21
+ export interface DriverDay {
22
+ date: string;
23
+ driverId: string | null;
24
+ driverName: string | null;
25
+ stops: DriverStop[];
26
+ totalStops: number;
27
+ completedStops: number;
28
+ remainingStops: number;
29
+ nextStop: DriverStop | null;
30
+ }
31
+ /**
32
+ * Applies acknowledged captures on top of a server snapshot: a stop whose
33
+ * capture the server already acknowledged is shown completed even if a
34
+ * delayed read still reports it en route. This is an in-memory UI fact for
35
+ * the current actor/scope, never a fabricated server update.
36
+ */
37
+ export declare function applyAcknowledgedCaptures(stops: DriverStop[], acknowledged: ReadonlySet<string>): DriverDay['stops'];
38
+ /** Derived counters and the next stop, recomputed after acknowledgement overrides. */
39
+ export declare function summariseStops(stops: DriverStop[]): {
40
+ totalStops: number;
41
+ completedStops: number;
42
+ remainingStops: number;
43
+ nextStop: DriverStop | null;
44
+ };
45
+ export declare function useMyDeliveryDay(date: string): {
46
+ day: DriverDay | null;
47
+ isLoading: boolean;
48
+ error: Error | null;
49
+ refetch: () => Promise<void>;
50
+ markCaptured: (deliveryJobId: string) => void;
51
+ };
52
+ /** Tracks `navigator.onLine` so the driver sees when capture is unavailable. */
53
+ export declare function useOnlineStatus(): boolean;
@@ -0,0 +1,31 @@
1
+ import { Address } from '../types';
2
+ /**
3
+ * Google's universal URL accepts at most 9 intermediate waypoints (plus the
4
+ * destination). Longer days are handed off in chunks: the driver restarts
5
+ * navigation from the next remaining stop once these are done.
6
+ */
7
+ export declare const MAX_NAVIGATION_WAYPOINTS = 9;
8
+ /** The best destination string for an address: coordinates when present, else the formatted address. */
9
+ export declare function navigationDestination(address: Partial<Address> | null | undefined): string | null;
10
+ /** Directions from the device's current position to one stop. */
11
+ export declare function stopNavigationUrl(address: Partial<Address> | null | undefined): string | null;
12
+ /**
13
+ * Directions through the remaining stops in sequence: the last stop in the
14
+ * chunk is the destination, the ones before it are waypoints. Stops without a
15
+ * usable address are skipped. Returns null when no stop is navigable.
16
+ */
17
+ export declare function routeNavigationUrl(addresses: Array<Partial<Address> | null | undefined>): string | null;
18
+ /** A `tel:` link for a phone number, keeping only dialable characters. */
19
+ export declare function phoneHref(phone: string | null | undefined): string | null;
20
+ /** The device-local calendar date as YYYY-MM-DD (what `myDeliveryDay` expects). */
21
+ export declare function localDateString(date: Date): string;
22
+ /** Shift a YYYY-MM-DD date by whole days, staying in local calendar terms. */
23
+ export declare function shiftLocalDate(date: string, days: number): string;
24
+ /** The `Date#getTimezoneOffset()` value for local midnight of a YYYY-MM-DD date (DST-correct). */
25
+ export declare function timezoneOffsetFor(date: string): number;
26
+ /**
27
+ * The device's IANA time zone (e.g. `Asia/Kolkata`), so the server can build
28
+ * the day window from real local midnights, including on DST transition
29
+ * days. Null when the runtime cannot report one; the fixed offset is then used.
30
+ */
31
+ export declare function deviceTimeZone(): string | null;
@@ -0,0 +1,50 @@
1
+ import { createLucideIcon as e } from "../createLucideIcon.js";
2
+ //#region node_modules/lucide-react/dist/esm/icons/calendar-days.js
3
+ var t = e("CalendarDays", [
4
+ ["path", {
5
+ d: "M8 2v4",
6
+ key: "1cmpym"
7
+ }],
8
+ ["path", {
9
+ d: "M16 2v4",
10
+ key: "4m81vk"
11
+ }],
12
+ ["rect", {
13
+ width: "18",
14
+ height: "18",
15
+ x: "3",
16
+ y: "4",
17
+ rx: "2",
18
+ key: "1hopcy"
19
+ }],
20
+ ["path", {
21
+ d: "M3 10h18",
22
+ key: "8toen8"
23
+ }],
24
+ ["path", {
25
+ d: "M8 14h.01",
26
+ key: "6423bh"
27
+ }],
28
+ ["path", {
29
+ d: "M12 14h.01",
30
+ key: "1etili"
31
+ }],
32
+ ["path", {
33
+ d: "M16 14h.01",
34
+ key: "1gbofw"
35
+ }],
36
+ ["path", {
37
+ d: "M8 18h.01",
38
+ key: "lrp35t"
39
+ }],
40
+ ["path", {
41
+ d: "M12 18h.01",
42
+ key: "mhygvu"
43
+ }],
44
+ ["path", {
45
+ d: "M16 18h.01",
46
+ key: "kzsmim"
47
+ }]
48
+ ]);
49
+ //#endregion
50
+ export { t as CalendarDays };
@@ -0,0 +1,34 @@
1
+ import { createLucideIcon as e } from "../createLucideIcon.js";
2
+ //#region node_modules/lucide-react/dist/esm/icons/wifi-off.js
3
+ var t = e("WifiOff", [
4
+ ["path", {
5
+ d: "M12 20h.01",
6
+ key: "zekei9"
7
+ }],
8
+ ["path", {
9
+ d: "M8.5 16.429a5 5 0 0 1 7 0",
10
+ key: "1bycff"
11
+ }],
12
+ ["path", {
13
+ d: "M5 12.859a10 10 0 0 1 5.17-2.69",
14
+ key: "1dl1wf"
15
+ }],
16
+ ["path", {
17
+ d: "M19 12.859a10 10 0 0 0-2.007-1.523",
18
+ key: "4k23kn"
19
+ }],
20
+ ["path", {
21
+ d: "M2 8.82a15 15 0 0 1 4.177-2.643",
22
+ key: "1grhjp"
23
+ }],
24
+ ["path", {
25
+ d: "M22 8.82a15 15 0 0 0-11.288-3.764",
26
+ key: "z3jwby"
27
+ }],
28
+ ["path", {
29
+ d: "m2 2 20 20",
30
+ key: "1ooewy"
31
+ }]
32
+ ]);
33
+ //#endregion
34
+ export { t as WifiOff };