@burdenoff/microfe-movethewheels 2026.920.3 → 2026.923.1

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.
Files changed (79) hide show
  1. package/dist/components/CarbonFootprintPanel.js +1 -1
  2. package/dist/components/CustomerPicker.js +76 -65
  3. package/dist/components/DataTable.js +140 -139
  4. package/dist/components/DocumentsCard.js +14 -8
  5. package/dist/generated/wspace-types.d.ts +2719 -8
  6. package/dist/hooks/index.js +1 -1
  7. package/dist/hooks/useAnalytics.js +21 -1
  8. package/dist/hooks/useCustomers.js +94 -78
  9. package/dist/hooks/useDebouncedValue.js +11 -0
  10. package/dist/hooks/useEntityDocuments.js +28 -18
  11. package/dist/hooks/useEpod.js +24 -17
  12. package/dist/hooks/useFleet.js +148 -125
  13. package/dist/hooks/useInventory.js +255 -186
  14. package/dist/hooks/useMultiModalShipments.js +35 -27
  15. package/dist/hooks/useOrders.js +139 -134
  16. package/dist/hooks/useRoutes.js +97 -75
  17. package/dist/hooks/useTracking.js +100 -88
  18. package/dist/index.js +6 -6
  19. package/dist/movethewheels/components/CustomerPicker.d.ts +3 -1
  20. package/dist/movethewheels/components/DataTable.d.ts +5 -1
  21. package/dist/movethewheels/hooks/useCustomers.d.ts +0 -1
  22. package/dist/movethewheels/hooks/useDebouncedValue.d.ts +1 -0
  23. package/dist/movethewheels/hooks/useEntityDocuments.d.ts +2 -0
  24. package/dist/movethewheels/hooks/useEpod.d.ts +6 -1
  25. package/dist/movethewheels/hooks/useFleet.d.ts +49 -5
  26. package/dist/movethewheels/hooks/useInventory.d.ts +24 -17
  27. package/dist/movethewheels/hooks/useMultiModalShipments.d.ts +6 -1
  28. package/dist/movethewheels/hooks/useOrders.d.ts +48 -5
  29. package/dist/movethewheels/hooks/useRoutes.d.ts +18 -1
  30. package/dist/movethewheels/hooks/useTracking.d.ts +12 -11
  31. package/dist/movethewheels/types/index.d.ts +12 -5
  32. package/dist/pages/CreateOrderPage.js +191 -129
  33. package/dist/pages/CustomersPage.js +61 -54
  34. package/dist/pages/DeliveryCapturePage.js +131 -109
  35. package/dist/pages/DriversPage.js +100 -92
  36. package/dist/pages/InventoryPage.js +239 -236
  37. package/dist/pages/MultiModalShipmentPage.js +163 -130
  38. package/dist/pages/OrderDetailsPage.js +190 -106
  39. package/dist/pages/OrdersListPage.js +66 -60
  40. package/dist/pages/ProductDetailsPage.js +241 -200
  41. package/dist/pages/ProductsPage.js +59 -52
  42. package/dist/pages/RouteDetailsPage.js +324 -293
  43. package/dist/pages/RoutesPage.js +55 -48
  44. package/dist/pages/VehiclesPage.js +63 -56
  45. package/dist/pages/WarehousesPage.js +60 -53
  46. package/package.json +1 -1
  47. package/src/generated/wspace-types.ts +3136 -8
  48. package/src/movethewheels/components/CarbonFootprintPanel.tsx +0 -1
  49. package/src/movethewheels/components/CustomerPicker.tsx +14 -0
  50. package/src/movethewheels/components/DataTable.tsx +34 -18
  51. package/src/movethewheels/components/DocumentsCard.tsx +6 -1
  52. package/src/movethewheels/components/maps/leaflet-setup.ts +1 -8
  53. package/src/movethewheels/hooks/useAnalytics.ts +27 -0
  54. package/src/movethewheels/hooks/useCustomers.ts +64 -24
  55. package/src/movethewheels/hooks/useDebouncedValue.ts +12 -0
  56. package/src/movethewheels/hooks/useEntityDocuments.ts +43 -25
  57. package/src/movethewheels/hooks/useEpod.ts +14 -7
  58. package/src/movethewheels/hooks/useFleet.ts +66 -38
  59. package/src/movethewheels/hooks/useFleetIntelligence.ts +1 -4
  60. package/src/movethewheels/hooks/useInventory.ts +211 -90
  61. package/src/movethewheels/hooks/useMultiModalShipments.ts +15 -11
  62. package/src/movethewheels/hooks/useOrders.ts +48 -14
  63. package/src/movethewheels/hooks/useRoutes.ts +81 -24
  64. package/src/movethewheels/hooks/useTracking.ts +130 -98
  65. package/src/movethewheels/pages/CreateOrderPage.tsx +93 -2
  66. package/src/movethewheels/pages/CustomersPage.tsx +11 -1
  67. package/src/movethewheels/pages/DeliveryCapturePage.tsx +31 -1
  68. package/src/movethewheels/pages/DriversPage.tsx +24 -12
  69. package/src/movethewheels/pages/InventoryPage.tsx +57 -32
  70. package/src/movethewheels/pages/MultiModalShipmentPage.tsx +52 -3
  71. package/src/movethewheels/pages/OrderDetailsPage.tsx +91 -6
  72. package/src/movethewheels/pages/OrdersListPage.tsx +20 -3
  73. package/src/movethewheels/pages/ProductDetailsPage.tsx +52 -3
  74. package/src/movethewheels/pages/ProductsPage.tsx +11 -1
  75. package/src/movethewheels/pages/RouteDetailsPage.tsx +45 -5
  76. package/src/movethewheels/pages/RoutesPage.tsx +11 -1
  77. package/src/movethewheels/pages/VehiclesPage.tsx +19 -2
  78. package/src/movethewheels/pages/WarehousesPage.tsx +11 -1
  79. package/src/movethewheels/types/index.ts +12 -5
@@ -14,79 +14,81 @@ import { MetricCard as g, MetricGrid as _ } from "../components/MetricCard.js";
14
14
  import { TypeBadge as v } from "../components/StatusBadge.js";
15
15
  import { DataTable as y } from "../components/DataTable.js";
16
16
  import { formatDate as b } from "../utils/formatters.js";
17
- import { useState as x } from "react";
18
- import { jsx as S, jsxs as C } from "react/jsx-runtime";
19
- import { CTAOverflowMenu as w, PagePurpose as T } from "@burdenoff/fe-libs/ui";
17
+ import { useDebouncedValue as x } from "../hooks/useDebouncedValue.js";
18
+ import { useState as S } from "react";
19
+ import { jsx as C, jsxs as w } from "react/jsx-runtime";
20
+ import { CTAOverflowMenu as T, PagePurpose as E } from "@burdenoff/fe-libs/ui";
20
21
  //#region src/movethewheels/pages/CustomersPage.tsx
21
- function E() {
22
- let { basePath: E, navigate: D } = c(), [O, k] = x(0), [A, j] = x(25), { customers: M, hasMore: N, isLoading: P, error: F, refetch: I } = u({
23
- limit: A,
24
- offset: O * A
25
- }), { stats: L } = l(), R = (e) => D?.(s(E, e));
26
- return /* @__PURE__ */ C(h, {
22
+ function D() {
23
+ let { basePath: D, navigate: O } = c(), [k, A] = S(0), [j, M] = S(25), [N, P] = S(""), F = x(N), { customers: I, totalCustomers: L, hasMore: R, isLoading: z, error: B, refetch: V } = u({
24
+ limit: j,
25
+ offset: k * j,
26
+ filters: { search: F }
27
+ }), { stats: H } = l(), U = (e) => O?.(s(D, e));
28
+ return /* @__PURE__ */ w(h, {
27
29
  title: "Customers",
28
- subtitle: `${L.total} customers`,
29
- icon: /* @__PURE__ */ S(o, { size: 24 }),
30
- headerActions: /* @__PURE__ */ S(w, {
30
+ subtitle: `${H.total} customers`,
31
+ icon: /* @__PURE__ */ C(o, { size: 24 }),
32
+ headerActions: /* @__PURE__ */ C(T, {
31
33
  primary: {
32
34
  label: "Add Customer",
33
- icon: /* @__PURE__ */ S(n, { size: 16 }),
34
- onSelect: () => R("customers/new")
35
+ icon: /* @__PURE__ */ C(n, { size: 16 }),
36
+ onSelect: () => U("customers/new")
35
37
  },
36
38
  actions: [{
37
39
  label: "Refresh",
38
- icon: /* @__PURE__ */ S(r, { size: 16 }),
39
- onSelect: () => I()
40
+ icon: /* @__PURE__ */ C(r, { size: 16 }),
41
+ onSelect: () => V()
40
42
  }, {
41
43
  label: "Export",
42
- icon: /* @__PURE__ */ S(t, { size: 16 }),
43
- onSelect: () => R("import-export")
44
+ icon: /* @__PURE__ */ C(t, { size: 16 }),
45
+ onSelect: () => U("import-export")
44
46
  }]
45
47
  }),
46
48
  children: [
47
- /* @__PURE__ */ S(T, {
48
- icon: /* @__PURE__ */ S(o, { size: 18 }),
49
+ /* @__PURE__ */ C(E, {
50
+ icon: /* @__PURE__ */ C(o, { size: 18 }),
49
51
  children: "The businesses and individuals you deliver for. Keep contact details, locations and satisfaction ratings here, and open a customer to see their order history before booking the next shipment."
50
52
  }),
51
- /* @__PURE__ */ C("div", { children: [/* @__PURE__ */ S("p", {
53
+ /* @__PURE__ */ w("div", { children: [/* @__PURE__ */ C("p", {
52
54
  className: "mb-3 text-sm font-medium text-text-secondary",
53
55
  children: "Customer base at a glance"
54
- }), /* @__PURE__ */ C(_, {
56
+ }), /* @__PURE__ */ w(_, {
55
57
  columns: 3,
56
58
  children: [
57
- /* @__PURE__ */ S(g, {
59
+ /* @__PURE__ */ C(g, {
58
60
  label: "Total customers",
59
- value: L.total,
60
- icon: /* @__PURE__ */ S(o, { size: 20 }),
61
+ value: H.total,
62
+ icon: /* @__PURE__ */ C(o, { size: 20 }),
61
63
  accent: "brand"
62
64
  }),
63
- /* @__PURE__ */ S(g, {
65
+ /* @__PURE__ */ C(g, {
64
66
  label: "Active",
65
- value: L.active,
66
- icon: /* @__PURE__ */ S(a, { size: 20 }),
67
+ value: H.active,
68
+ icon: /* @__PURE__ */ C(a, { size: 20 }),
67
69
  accent: "success",
68
70
  subtitle: "Currently transacting"
69
71
  }),
70
- /* @__PURE__ */ S(g, {
72
+ /* @__PURE__ */ C(g, {
71
73
  label: "Business accounts",
72
- value: L.b2b,
73
- icon: /* @__PURE__ */ S(e, { size: 20 }),
74
+ value: H.b2b,
75
+ icon: /* @__PURE__ */ C(e, { size: 20 }),
74
76
  accent: "blue",
75
77
  subtitle: "B2B relationships"
76
78
  })
77
79
  ]
78
80
  })] }),
79
- /* @__PURE__ */ S(y, {
81
+ /* @__PURE__ */ C(y, {
80
82
  columns: [
81
83
  {
82
84
  id: "customer",
83
85
  header: "Customer",
84
- cell: (e) => /* @__PURE__ */ C("div", {
86
+ cell: (e) => /* @__PURE__ */ w("div", {
85
87
  className: "flex items-center gap-3",
86
- children: [/* @__PURE__ */ S(d, { children: /* @__PURE__ */ S(f, { children: e.name.split(" ").map((e) => e[0]).join("") }) }), /* @__PURE__ */ C("div", { children: [/* @__PURE__ */ S("p", {
88
+ children: [/* @__PURE__ */ C(d, { children: /* @__PURE__ */ C(f, { children: e.name.split(" ").map((e) => e[0]).join("") }) }), /* @__PURE__ */ w("div", { children: [/* @__PURE__ */ C("p", {
87
89
  className: "font-medium",
88
90
  children: e.name
89
- }), /* @__PURE__ */ S("p", {
91
+ }), /* @__PURE__ */ C("p", {
90
92
  className: "text-sm text-text-secondary",
91
93
  children: e.email
92
94
  })] })]
@@ -96,7 +98,7 @@ function E() {
96
98
  id: "type",
97
99
  header: "Type",
98
100
  accessorKey: "type",
99
- cell: (e) => /* @__PURE__ */ S(v, { type: e.type })
101
+ cell: (e) => /* @__PURE__ */ C(v, { type: e.type })
100
102
  },
101
103
  {
102
104
  id: "company",
@@ -117,18 +119,18 @@ function E() {
117
119
  {
118
120
  id: "rating",
119
121
  header: "Rating",
120
- cell: (e) => /* @__PURE__ */ C("div", {
122
+ cell: (e) => /* @__PURE__ */ w("div", {
121
123
  className: "flex items-center gap-1",
122
- children: [/* @__PURE__ */ S(i, {
124
+ children: [/* @__PURE__ */ C(i, {
123
125
  size: 14,
124
126
  className: "text-status-warning-text fill-current"
125
- }), /* @__PURE__ */ S("span", { children: e.rating.toFixed(1) })]
127
+ }), /* @__PURE__ */ C("span", { children: e.rating.toFixed(1) })]
126
128
  })
127
129
  },
128
130
  {
129
131
  id: "status",
130
132
  header: "Status",
131
- cell: (e) => /* @__PURE__ */ S(p, {
133
+ cell: (e) => /* @__PURE__ */ C(p, {
132
134
  variant: e.isActive ? "default" : "secondary",
133
135
  children: e.isActive ? "Active" : "Inactive"
134
136
  })
@@ -141,10 +143,10 @@ function E() {
141
143
  cell: (e) => b(e.createdAt, "short")
142
144
  }
143
145
  ],
144
- data: M,
145
- isLoading: P,
146
- error: F,
147
- onRetry: I,
146
+ data: I,
147
+ isLoading: z,
148
+ error: B,
149
+ onRetry: V,
148
150
  searchable: !0,
149
151
  searchPlaceholder: "Search customers...",
150
152
  searchFields: [
@@ -152,21 +154,26 @@ function E() {
152
154
  "email",
153
155
  "company"
154
156
  ],
155
- onRowClick: (e) => R(`customers/${e.id}`),
157
+ searchQuery: N,
158
+ onSearchQueryChange: (e) => {
159
+ P(e), A(0);
160
+ },
161
+ onRowClick: (e) => U(`customers/${e.id}`),
156
162
  getRowId: (e) => e.id,
157
- pageIndex: O,
158
- pageSize: A,
159
- onPageChange: k,
163
+ pageIndex: k,
164
+ pageSize: j,
165
+ onPageChange: A,
160
166
  onPageSizeChange: (e) => {
161
- j(e), k(0);
167
+ M(e), A(0);
162
168
  },
163
- hasNextPage: N,
169
+ totalItems: L,
170
+ hasNextPage: R,
164
171
  emptyIllustration: "empty-people",
165
172
  emptyTitle: "No customers yet",
166
173
  emptyDescription: "Add your first customer to start booking deliveries for them.",
167
- emptyAction: /* @__PURE__ */ C(m, {
168
- onClick: () => R("customers/new"),
169
- children: [/* @__PURE__ */ S(n, {
174
+ emptyAction: /* @__PURE__ */ w(m, {
175
+ onClick: () => U("customers/new"),
176
+ children: [/* @__PURE__ */ C(n, {
170
177
  size: 16,
171
178
  className: "mr-1.5"
172
179
  }), "Add Customer"]
@@ -176,4 +183,4 @@ function E() {
176
183
  });
177
184
  }
178
185
  //#endregion
179
- export { E as default };
186
+ export { D as default };
@@ -1,24 +1,26 @@
1
- import { CircleCheck as e } from "../node_modules/lucide-react/dist/esm/icons/circle-check.js";
2
- import { LoaderCircle as t } from "../node_modules/lucide-react/dist/esm/icons/loader-circle.js";
3
- import { MapPin as n } from "../node_modules/lucide-react/dist/esm/icons/map-pin.js";
4
- import { Package as r } from "../node_modules/lucide-react/dist/esm/icons/package.js";
5
- import { PenLine as i } from "../node_modules/lucide-react/dist/esm/icons/pen-line.js";
6
- import { Truck as a } from "../node_modules/lucide-react/dist/esm/icons/truck.js";
7
- import { Type as o } from "../node_modules/lucide-react/dist/esm/icons/type.js";
8
- import { Upload as s } from "../node_modules/lucide-react/dist/esm/icons/upload.js";
9
- import { mapOrderPriority as c, mapOrderStatus as l } from "../hooks/useOrders.js";
10
- import { useCaptureEpod as u, useEpodPhotoUpload as d, useMyPendingEpodDeliveryJobs as f } from "../hooks/useEpod.js";
11
- import { Button as p, Card as m, CardContent as h, CardHeader as g, CardTitle as _, Input as v, Label as y, Textarea as b } from "../components/ui.js";
12
- import { PageLayout as x } from "../components/PageLayout.js";
13
- import { PriorityBadge as S, StatusBadge as C } from "../components/StatusBadge.js";
14
- import { FormError as w } from "../components/FormError.js";
15
- import { Notice as T, useNotice as E } from "../components/Notice.js";
16
- import { formatAddress as D, formatDate as O } from "../utils/formatters.js";
17
- import { SignaturePad as k } from "../components/SignaturePad.js";
18
- import { useRef as A, useState as j } from "react";
19
- import { Fragment as M, jsx as N, jsxs as P } from "react/jsx-runtime";
1
+ import { ChevronLeft as e } from "../node_modules/lucide-react/dist/esm/icons/chevron-left.js";
2
+ import { ChevronRight as t } from "../node_modules/lucide-react/dist/esm/icons/chevron-right.js";
3
+ import { CircleCheck as n } from "../node_modules/lucide-react/dist/esm/icons/circle-check.js";
4
+ import { LoaderCircle as r } from "../node_modules/lucide-react/dist/esm/icons/loader-circle.js";
5
+ import { MapPin as i } from "../node_modules/lucide-react/dist/esm/icons/map-pin.js";
6
+ import { Package as a } from "../node_modules/lucide-react/dist/esm/icons/package.js";
7
+ import { PenLine as o } from "../node_modules/lucide-react/dist/esm/icons/pen-line.js";
8
+ import { Truck as s } from "../node_modules/lucide-react/dist/esm/icons/truck.js";
9
+ import { Type as c } from "../node_modules/lucide-react/dist/esm/icons/type.js";
10
+ import { Upload as l } from "../node_modules/lucide-react/dist/esm/icons/upload.js";
11
+ import { mapOrderPriority as u, mapOrderStatus as d } from "../hooks/useOrders.js";
12
+ import { useCaptureEpod as f, useEpodPhotoUpload as p, useMyPendingEpodDeliveryJobs as m } from "../hooks/useEpod.js";
13
+ import { Button as h, Card as g, CardContent as _, CardHeader as v, CardTitle as y, Input as b, Label as x, Textarea as S } from "../components/ui.js";
14
+ import { PageLayout as C } from "../components/PageLayout.js";
15
+ import { PriorityBadge as w, StatusBadge as T } from "../components/StatusBadge.js";
16
+ import { FormError as E } from "../components/FormError.js";
17
+ import { Notice as D, useNotice as O } from "../components/Notice.js";
18
+ import { formatAddress as k, formatDate as A } from "../utils/formatters.js";
19
+ import { SignaturePad as j } from "../components/SignaturePad.js";
20
+ import { useRef as M, useState as N } from "react";
21
+ import { Fragment as P, jsx as F, jsxs as I } from "react/jsx-runtime";
20
22
  //#region src/movethewheels/pages/DeliveryCapturePage.tsx
21
- function F() {
23
+ function L() {
22
24
  return new Promise((e) => {
23
25
  if (!navigator.geolocation) {
24
26
  e(null);
@@ -31,122 +33,122 @@ function F() {
31
33
  });
32
34
  });
33
35
  }
34
- function I({ job: r, onCaptured: c, onCancel: l }) {
35
- let { captureEpod: f, isSubmitting: x, error: S } = u(), { upload: C, isUploading: T, error: E } = d(), O = A(null), [I, L] = j(""), [R, z] = j("drawn"), [B, V] = j(""), [H, U] = j(null), [W, G] = j(""), [K, q] = j(null), J = async () => {
36
+ function R({ job: e, onCaptured: t, onCancel: a }) {
37
+ let { captureEpod: u, isSubmitting: d, error: m } = f(), { upload: C, isUploading: w, error: T } = p(), D = M(null), [O, A] = N(""), [R, z] = N("drawn"), [B, V] = N(""), [H, U] = N(null), [W, G] = N(""), [K, q] = N(null), J = async () => {
36
38
  q(null);
37
- let e = I.trim();
38
- if (!e) {
39
+ let n = O.trim();
40
+ if (!n) {
39
41
  q("Recipient name is required.");
40
42
  return;
41
43
  }
42
- let t = R === "typed" ? B.trim() : O.current?.toDataUrl() ?? null;
43
- if (!t) {
44
+ let r = R === "typed" ? B.trim() : D.current?.toDataUrl() ?? null;
45
+ if (!r) {
44
46
  q(R === "typed" ? "Type the recipient full name as their signature." : "A signature is required.");
45
47
  return;
46
48
  }
47
49
  try {
48
- let n;
49
- H && (n = [(await C(H)).fileId]);
50
- let i = await F();
51
- await f({
52
- deliveryJobId: r.id,
53
- recipientName: e,
50
+ let i;
51
+ H && (i = [(await C(H)).fileId]);
52
+ let a = await L();
53
+ await u({
54
+ deliveryJobId: e.id,
55
+ recipientName: n,
54
56
  signatureType: R,
55
- signatureData: t,
56
- photoFileIds: n,
57
- latitude: i?.coords.latitude,
58
- longitude: i?.coords.longitude,
59
- locationAccuracy: i?.coords.accuracy,
57
+ signatureData: r,
58
+ photoFileIds: i,
59
+ latitude: a?.coords.latitude,
60
+ longitude: a?.coords.longitude,
61
+ locationAccuracy: a?.coords.accuracy,
60
62
  notes: W.trim() || void 0
61
- }), c();
63
+ }), t();
62
64
  } catch {}
63
- }, Y = x || T;
64
- return /* @__PURE__ */ P(m, { children: [/* @__PURE__ */ N(g, { children: /* @__PURE__ */ P(_, {
65
+ }, Y = d || w;
66
+ return /* @__PURE__ */ I(g, { children: [/* @__PURE__ */ F(v, { children: /* @__PURE__ */ I(y, {
65
67
  className: "flex items-center gap-2",
66
68
  children: [
67
- /* @__PURE__ */ N(a, { size: 18 }),
69
+ /* @__PURE__ */ F(s, { size: 18 }),
68
70
  " Capture delivery for ",
69
- r.deliveryJobNumber
71
+ e.deliveryJobNumber
70
72
  ]
71
- }) }), /* @__PURE__ */ P(h, {
73
+ }) }), /* @__PURE__ */ I(_, {
72
74
  className: "space-y-4",
73
75
  children: [
74
- /* @__PURE__ */ P("div", {
76
+ /* @__PURE__ */ I("div", {
75
77
  className: "text-sm text-text-secondary space-y-1",
76
- children: [r.customerName && /* @__PURE__ */ P("p", { children: ["Recipient on file: ", r.customerName] }), r.deliveryAddress && /* @__PURE__ */ N("p", { children: D(r.deliveryAddress) })]
78
+ children: [e.customerName && /* @__PURE__ */ I("p", { children: ["Recipient on file: ", e.customerName] }), e.deliveryAddress && /* @__PURE__ */ F("p", { children: k(e.deliveryAddress) })]
77
79
  }),
78
- /* @__PURE__ */ P("div", {
80
+ /* @__PURE__ */ I("div", {
79
81
  className: "space-y-1.5",
80
- children: [/* @__PURE__ */ N(y, {
82
+ children: [/* @__PURE__ */ F(x, {
81
83
  htmlFor: "epod-recipient-name",
82
84
  children: "Recipient name"
83
- }), /* @__PURE__ */ N(v, {
85
+ }), /* @__PURE__ */ F(b, {
84
86
  id: "epod-recipient-name",
85
- value: I,
86
- onChange: (e) => L(e.target.value),
87
+ value: O,
88
+ onChange: (e) => A(e.target.value),
87
89
  placeholder: "Who received the delivery?"
88
90
  })]
89
91
  }),
90
- /* @__PURE__ */ P("div", {
92
+ /* @__PURE__ */ I("div", {
91
93
  className: "space-y-1.5",
92
94
  children: [
93
- /* @__PURE__ */ N(y, { children: "Signature" }),
94
- /* @__PURE__ */ P("div", {
95
+ /* @__PURE__ */ F(x, { children: "Signature" }),
96
+ /* @__PURE__ */ I("div", {
95
97
  className: "flex gap-2",
96
- children: [/* @__PURE__ */ P(p, {
98
+ children: [/* @__PURE__ */ I(h, {
97
99
  type: "button",
98
100
  variant: R === "drawn" ? "default" : "outline",
99
101
  size: "sm",
100
102
  onClick: () => z("drawn"),
101
- children: [/* @__PURE__ */ N(i, { size: 14 }), " Draw"]
102
- }), /* @__PURE__ */ P(p, {
103
+ children: [/* @__PURE__ */ F(o, { size: 14 }), " Draw"]
104
+ }), /* @__PURE__ */ I(h, {
103
105
  type: "button",
104
106
  variant: R === "typed" ? "default" : "outline",
105
107
  size: "sm",
106
108
  onClick: () => z("typed"),
107
- children: [/* @__PURE__ */ N(o, { size: 14 }), " Type name instead"]
109
+ children: [/* @__PURE__ */ F(c, { size: 14 }), " Type name instead"]
108
110
  })]
109
111
  }),
110
- R === "drawn" ? /* @__PURE__ */ N(k, { ref: O }) : /* @__PURE__ */ N(v, {
112
+ R === "drawn" ? /* @__PURE__ */ F(j, { ref: D }) : /* @__PURE__ */ F(b, {
111
113
  value: B,
112
114
  onChange: (e) => V(e.target.value),
113
115
  placeholder: "Type full name as signature"
114
116
  })
115
117
  ]
116
118
  }),
117
- /* @__PURE__ */ P("div", {
119
+ /* @__PURE__ */ I("div", {
118
120
  className: "space-y-1.5",
119
121
  children: [
120
- /* @__PURE__ */ N(y, {
122
+ /* @__PURE__ */ F(x, {
121
123
  htmlFor: "epod-photo",
122
124
  children: "Delivery photo (optional)"
123
125
  }),
124
- /* @__PURE__ */ P("div", {
126
+ /* @__PURE__ */ I("div", {
125
127
  className: "flex items-center gap-2",
126
- children: [/* @__PURE__ */ N("input", {
128
+ children: [/* @__PURE__ */ F("input", {
127
129
  id: "epod-photo",
128
130
  type: "file",
129
131
  accept: "image/*",
130
132
  capture: "environment",
131
133
  onChange: (e) => U(e.target.files?.[0] ?? null),
132
134
  className: "text-sm"
133
- }), H && /* @__PURE__ */ N(s, {
135
+ }), H && /* @__PURE__ */ F(l, {
134
136
  size: 14,
135
137
  className: "text-text-secondary"
136
138
  })]
137
139
  }),
138
- H && /* @__PURE__ */ N("p", {
140
+ H && /* @__PURE__ */ F("p", {
139
141
  className: "text-xs text-text-secondary",
140
142
  children: H.name
141
143
  })
142
144
  ]
143
145
  }),
144
- /* @__PURE__ */ P("div", {
146
+ /* @__PURE__ */ I("div", {
145
147
  className: "space-y-1.5",
146
- children: [/* @__PURE__ */ N(y, {
148
+ children: [/* @__PURE__ */ F(x, {
147
149
  htmlFor: "epod-notes",
148
150
  children: "Notes (optional)"
149
- }), /* @__PURE__ */ N(b, {
151
+ }), /* @__PURE__ */ F(S, {
150
152
  id: "epod-notes",
151
153
  value: W,
152
154
  onChange: (e) => G(e.target.value),
@@ -154,99 +156,119 @@ function I({ job: r, onCaptured: c, onCancel: l }) {
154
156
  rows: 2
155
157
  })]
156
158
  }),
157
- /* @__PURE__ */ P("p", {
159
+ /* @__PURE__ */ I("p", {
158
160
  className: "flex items-center gap-1.5 text-xs text-text-secondary",
159
- children: [/* @__PURE__ */ N(n, { size: 12 }), " Device GPS is captured automatically when permitted by the browser."]
161
+ children: [/* @__PURE__ */ F(i, { size: 12 }), " Device GPS is captured automatically when permitted by the browser."]
160
162
  }),
161
- K && /* @__PURE__ */ N(w, { message: K }),
162
- S && /* @__PURE__ */ N(w, { message: S.message }),
163
- E && /* @__PURE__ */ N(w, { message: E.message }),
164
- /* @__PURE__ */ P("div", {
163
+ K && /* @__PURE__ */ F(E, { message: K }),
164
+ m && /* @__PURE__ */ F(E, { message: m.message }),
165
+ T && /* @__PURE__ */ F(E, { message: T.message }),
166
+ /* @__PURE__ */ I("div", {
165
167
  className: "flex gap-2 justify-end",
166
- children: [/* @__PURE__ */ N(p, {
168
+ children: [/* @__PURE__ */ F(h, {
167
169
  type: "button",
168
170
  variant: "outline",
169
- onClick: l,
171
+ onClick: a,
170
172
  disabled: Y,
171
173
  children: "Cancel"
172
- }), /* @__PURE__ */ N(p, {
174
+ }), /* @__PURE__ */ F(h, {
173
175
  type: "button",
174
176
  onClick: () => void J(),
175
177
  disabled: Y,
176
- children: Y ? /* @__PURE__ */ P(M, { children: [/* @__PURE__ */ N(t, {
178
+ children: Y ? /* @__PURE__ */ I(P, { children: [/* @__PURE__ */ F(r, {
177
179
  size: 14,
178
180
  className: "animate-spin"
179
- }), " Submitting…"] }) : /* @__PURE__ */ P(M, { children: [/* @__PURE__ */ N(e, { size: 14 }), " Confirm delivery"] })
181
+ }), " Submitting…"] }) : /* @__PURE__ */ I(P, { children: [/* @__PURE__ */ F(n, { size: 14 }), " Confirm delivery"] })
180
182
  })]
181
183
  })
182
184
  ]
183
185
  })] });
184
186
  }
185
- function L() {
186
- let { jobs: t, isLoading: n, error: i, refetch: o } = f(), [s, u] = j(null), { message: d, notify: g } = E();
187
- return /* @__PURE__ */ N(x, {
187
+ function z() {
188
+ let [r, i] = N(0), { jobs: o, hasMore: c, isLoading: l, error: f, refetch: p } = m({
189
+ limit: 20,
190
+ offset: r * 20
191
+ }), [v, y] = N(null), { message: b, notify: x } = O();
192
+ return /* @__PURE__ */ F(C, {
188
193
  title: "My Deliveries",
189
194
  subtitle: "Capture proof of delivery for your assigned stops",
190
- icon: /* @__PURE__ */ N(a, { size: 24 }),
191
- children: /* @__PURE__ */ P("div", {
195
+ icon: /* @__PURE__ */ F(s, { size: 24 }),
196
+ children: /* @__PURE__ */ I("div", {
192
197
  className: "space-y-4",
193
- children: [/* @__PURE__ */ N(T, { message: d }), s ? /* @__PURE__ */ N(I, {
194
- job: s,
198
+ children: [/* @__PURE__ */ F(D, { message: b }), v ? /* @__PURE__ */ F(R, {
199
+ job: v,
195
200
  onCaptured: () => {
196
- g("Proof of delivery captured — delivery marked complete."), u(null), o();
201
+ x("Proof of delivery captured — delivery marked complete."), y(null), i(0), p();
197
202
  },
198
- onCancel: () => u(null)
199
- }) : n ? /* @__PURE__ */ N("p", {
203
+ onCancel: () => y(null)
204
+ }) : l ? /* @__PURE__ */ F("p", {
200
205
  className: "text-text-secondary text-center py-8",
201
206
  children: "Loading your deliveries…"
202
- }) : i ? /* @__PURE__ */ N(w, { message: i.message }) : t.length > 0 ? /* @__PURE__ */ N("div", {
207
+ }) : f ? /* @__PURE__ */ F(E, { message: f.message }) : o.length > 0 ? /* @__PURE__ */ I("div", {
203
208
  className: "space-y-3",
204
- children: t.map((e) => /* @__PURE__ */ N(m, { children: /* @__PURE__ */ P(h, {
209
+ children: [o.map((e) => /* @__PURE__ */ F(g, { children: /* @__PURE__ */ I(_, {
205
210
  className: "flex items-center justify-between gap-3 py-4",
206
- children: [/* @__PURE__ */ P("div", {
211
+ children: [/* @__PURE__ */ I("div", {
207
212
  className: "min-w-0",
208
213
  children: [
209
- /* @__PURE__ */ P("p", {
214
+ /* @__PURE__ */ I("p", {
210
215
  className: "font-medium flex items-center gap-2",
211
216
  children: [
212
- /* @__PURE__ */ N(r, { size: 16 }),
217
+ /* @__PURE__ */ F(a, { size: 16 }),
213
218
  " ",
214
219
  e.deliveryJobNumber
215
220
  ]
216
221
  }),
217
- /* @__PURE__ */ P("div", {
222
+ /* @__PURE__ */ I("div", {
218
223
  className: "flex flex-wrap items-center gap-1.5 py-1",
219
- children: [/* @__PURE__ */ N(C, {
220
- status: l(e.status),
224
+ children: [/* @__PURE__ */ F(T, {
225
+ status: d(e.status),
221
226
  type: "order",
222
227
  size: "sm"
223
- }), /* @__PURE__ */ N(S, {
224
- priority: c(e.priority),
228
+ }), /* @__PURE__ */ F(w, {
229
+ priority: u(e.priority),
225
230
  size: "sm"
226
231
  })]
227
232
  }),
228
- e.deliveryAddress && /* @__PURE__ */ N("p", {
233
+ e.deliveryAddress && /* @__PURE__ */ F("p", {
229
234
  className: "text-sm text-text-secondary truncate",
230
- children: D(e.deliveryAddress)
235
+ children: k(e.deliveryAddress)
231
236
  }),
232
- e.scheduledDelivery && /* @__PURE__ */ P("p", {
237
+ e.scheduledDelivery && /* @__PURE__ */ I("p", {
233
238
  className: "text-xs text-text-secondary",
234
- children: ["Scheduled ", O(e.scheduledDelivery, "short")]
239
+ children: ["Scheduled ", A(e.scheduledDelivery, "short")]
235
240
  })
236
241
  ]
237
- }), /* @__PURE__ */ N(p, {
242
+ }), /* @__PURE__ */ F(h, {
238
243
  type: "button",
239
244
  size: "sm",
240
- onClick: () => u(e),
245
+ onClick: () => y(e),
241
246
  children: "Capture"
242
247
  })]
243
- }) }, e.id))
244
- }) : /* @__PURE__ */ P("div", {
248
+ }) }, e.id)), (r > 0 || c) && /* @__PURE__ */ I("div", {
249
+ className: "flex justify-end gap-2 pt-2",
250
+ children: [/* @__PURE__ */ I(h, {
251
+ type: "button",
252
+ variant: "outline",
253
+ size: "sm",
254
+ disabled: r === 0 || l,
255
+ onClick: () => i((e) => Math.max(0, e - 1)),
256
+ children: [/* @__PURE__ */ F(e, { size: 16 }), " Previous"]
257
+ }), /* @__PURE__ */ I(h, {
258
+ type: "button",
259
+ variant: "outline",
260
+ size: "sm",
261
+ disabled: !c || l,
262
+ onClick: () => i((e) => e + 1),
263
+ children: ["Next ", /* @__PURE__ */ F(t, { size: 16 })]
264
+ })]
265
+ })]
266
+ }) : /* @__PURE__ */ I("div", {
245
267
  className: "text-center py-12",
246
- children: [/* @__PURE__ */ N(e, {
268
+ children: [/* @__PURE__ */ F(n, {
247
269
  size: 40,
248
270
  className: "mx-auto mb-3 text-text-secondary opacity-50"
249
- }), /* @__PURE__ */ N("p", {
271
+ }), /* @__PURE__ */ F("p", {
250
272
  className: "text-text-secondary",
251
273
  children: "No deliveries awaiting proof of delivery."
252
274
  })]
@@ -255,4 +277,4 @@ function L() {
255
277
  });
256
278
  }
257
279
  //#endregion
258
- export { L as default };
280
+ export { z as default };