@burdenoff/microfe-movethewheels 2026.920.2 → 2026.921.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 (82) hide show
  1. package/dist/components/CarbonFootprintPanel.js +1 -1
  2. package/dist/components/CustomerPicker.js +271 -0
  3. package/dist/components/DataTable.js +140 -139
  4. package/dist/components/DocumentsCard.js +14 -8
  5. package/dist/generated/wspace-types.d.ts +1043 -5
  6. package/dist/hooks/useAnalytics.js +21 -1
  7. package/dist/hooks/useCustomers.js +94 -78
  8. package/dist/hooks/useDebouncedValue.js +11 -0
  9. package/dist/hooks/useEntityDocuments.js +28 -18
  10. package/dist/hooks/useEpod.js +24 -17
  11. package/dist/hooks/useFleet.js +146 -125
  12. package/dist/hooks/useInventory.js +255 -186
  13. package/dist/hooks/useMultiModalShipments.js +35 -27
  14. package/dist/hooks/useOrders.js +73 -73
  15. package/dist/hooks/useRoutes.js +97 -75
  16. package/dist/hooks/useTracking.js +100 -88
  17. package/dist/movethewheels/components/CustomerPicker.d.ts +19 -0
  18. package/dist/movethewheels/components/DataTable.d.ts +5 -1
  19. package/dist/movethewheels/hooks/useCustomers.d.ts +0 -1
  20. package/dist/movethewheels/hooks/useDebouncedValue.d.ts +1 -0
  21. package/dist/movethewheels/hooks/useEntityDocuments.d.ts +2 -0
  22. package/dist/movethewheels/hooks/useEpod.d.ts +6 -1
  23. package/dist/movethewheels/hooks/useFleet.d.ts +49 -5
  24. package/dist/movethewheels/hooks/useInventory.d.ts +24 -17
  25. package/dist/movethewheels/hooks/useMultiModalShipments.d.ts +6 -1
  26. package/dist/movethewheels/hooks/useOrders.d.ts +33 -5
  27. package/dist/movethewheels/hooks/useRoutes.d.ts +2 -1
  28. package/dist/movethewheels/hooks/useTracking.d.ts +12 -11
  29. package/dist/movethewheels/types/index.d.ts +7 -5
  30. package/dist/movethewheels/utils/navigation.d.ts +14 -0
  31. package/dist/pages/CreateOrderPage.js +228 -217
  32. package/dist/pages/CustomerDetailsPage.js +220 -220
  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 +224 -208
  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 +343 -321
  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/dist/utils/navigation.js +22 -1
  47. package/package.json +1 -1
  48. package/src/generated/wspace-types.ts +1188 -5
  49. package/src/movethewheels/components/CarbonFootprintPanel.tsx +0 -1
  50. package/src/movethewheels/components/CustomerPicker.tsx +321 -0
  51. package/src/movethewheels/components/DataTable.tsx +34 -18
  52. package/src/movethewheels/components/DocumentsCard.tsx +6 -1
  53. package/src/movethewheels/components/maps/leaflet-setup.ts +1 -8
  54. package/src/movethewheels/hooks/useAnalytics.ts +27 -0
  55. package/src/movethewheels/hooks/useCustomers.ts +64 -24
  56. package/src/movethewheels/hooks/useDebouncedValue.ts +12 -0
  57. package/src/movethewheels/hooks/useEntityDocuments.ts +43 -25
  58. package/src/movethewheels/hooks/useEpod.ts +14 -7
  59. package/src/movethewheels/hooks/useFleet.ts +58 -37
  60. package/src/movethewheels/hooks/useFleetIntelligence.ts +1 -4
  61. package/src/movethewheels/hooks/useInventory.ts +211 -90
  62. package/src/movethewheels/hooks/useMultiModalShipments.ts +15 -11
  63. package/src/movethewheels/hooks/useOrders.ts +13 -14
  64. package/src/movethewheels/hooks/useRoutes.ts +80 -23
  65. package/src/movethewheels/hooks/useTracking.ts +130 -98
  66. package/src/movethewheels/pages/CreateOrderPage.tsx +92 -31
  67. package/src/movethewheels/pages/CustomerDetailsPage.tsx +15 -6
  68. package/src/movethewheels/pages/CustomersPage.tsx +11 -1
  69. package/src/movethewheels/pages/DeliveryCapturePage.tsx +31 -1
  70. package/src/movethewheels/pages/DriversPage.tsx +24 -12
  71. package/src/movethewheels/pages/InventoryPage.tsx +57 -32
  72. package/src/movethewheels/pages/MultiModalShipmentPage.tsx +52 -3
  73. package/src/movethewheels/pages/OrderDetailsPage.tsx +17 -1
  74. package/src/movethewheels/pages/OrdersListPage.tsx +20 -3
  75. package/src/movethewheels/pages/ProductDetailsPage.tsx +52 -3
  76. package/src/movethewheels/pages/ProductsPage.tsx +11 -1
  77. package/src/movethewheels/pages/RouteDetailsPage.tsx +35 -5
  78. package/src/movethewheels/pages/RoutesPage.tsx +11 -1
  79. package/src/movethewheels/pages/VehiclesPage.tsx +19 -2
  80. package/src/movethewheels/pages/WarehousesPage.tsx +11 -1
  81. package/src/movethewheels/types/index.ts +7 -5
  82. package/src/movethewheels/utils/navigation.ts +32 -0
@@ -18,20 +18,21 @@ import { joinPath as s } from "../utils/navigation.js";
18
18
  import { useMoveTheWheels as le } from "../providers/MoveTheWheelsProvider.js";
19
19
  import { useOrder as ue, useOrders as de } from "../hooks/useOrders.js";
20
20
  import { useFleet as fe } from "../hooks/useFleet.js";
21
- import { Badge as c, Button as l, Card as u, CardContent as d, CardHeader as f, CardTitle as p, Label as m, Select as h, SelectContent as g, SelectItem as _, SelectTrigger as v, SelectValue as y, Separator as b, Table as pe, TableBody as me, TableCell as x, TableHead as S, TableHeader as he, TableRow as C } from "../components/ui.js";
22
- import { ErrorState as ge, LoadingState as _e, PageLayout as ve } from "../components/PageLayout.js";
23
- import { PaymentStatusBadge as ye, PriorityBadge as be, StatusBadge as w } from "../components/StatusBadge.js";
24
- import { FormError as xe } from "../components/FormError.js";
25
- import { Notice as Se, useNotice as T } from "../components/Notice.js";
26
- import { formatAddress as E, formatCurrency as D, formatDate as O } from "../utils/formatters.js";
27
- import { DocumentsCard as Ce } from "../components/DocumentsCard.js";
28
- import { ProofOfDeliveryCard as we } from "../components/ProofOfDeliveryCard.js";
29
- import { useState as k } from "react";
30
- import { useParams as Te } from "react-router";
31
- import { jsx as A, jsxs as j } from "react/jsx-runtime";
32
- import { EmphasisPanel as Ee, NextSteps as De, PagePurpose as Oe } from "@burdenoff/fe-libs/ui";
21
+ import { Badge as c, Button as l, Card as u, CardContent as d, CardHeader as f, CardTitle as p, Input as pe, Label as m, Select as h, SelectContent as g, SelectItem as _, SelectTrigger as v, SelectValue as y, Separator as b, Table as me, TableBody as he, TableCell as x, TableHead as S, TableHeader as ge, TableRow as C } from "../components/ui.js";
22
+ import { ErrorState as _e, LoadingState as ve, PageLayout as ye } from "../components/PageLayout.js";
23
+ import { PaymentStatusBadge as be, PriorityBadge as xe, StatusBadge as w } from "../components/StatusBadge.js";
24
+ import { FormError as Se } from "../components/FormError.js";
25
+ import { Notice as Ce, useNotice as we } from "../components/Notice.js";
26
+ import { formatAddress as T, formatCurrency as E, formatDate as D } from "../utils/formatters.js";
27
+ import { DocumentsCard as Te } from "../components/DocumentsCard.js";
28
+ import { useDebouncedValue as Ee } from "../hooks/useDebouncedValue.js";
29
+ import { ProofOfDeliveryCard as De } from "../components/ProofOfDeliveryCard.js";
30
+ import { useState as O } from "react";
31
+ import { useParams as Oe } from "react-router";
32
+ import { jsx as k, jsxs as A } from "react/jsx-runtime";
33
+ import { EmphasisPanel as ke, NextSteps as Ae, PagePurpose as je } from "@burdenoff/fe-libs/ui";
33
34
  //#region src/movethewheels/pages/OrderDetailsPage.tsx
34
- var M = [
35
+ var j = [
35
36
  "pending",
36
37
  "confirmed",
37
38
  "assigned",
@@ -39,7 +40,7 @@ var M = [
39
40
  "in_transit",
40
41
  "out_for_delivery",
41
42
  "delivered"
42
- ], N = {
43
+ ], M = {
43
44
  pending: "Pending",
44
45
  confirmed: "Confirmed",
45
46
  assigned: "Assigned",
@@ -50,32 +51,35 @@ var M = [
50
51
  cancelled: "Cancelled",
51
52
  failed: "Failed"
52
53
  };
53
- function ke(e) {
54
- let t = M.indexOf(e);
55
- return t === -1 || t >= M.length - 1 ? null : M[t + 1];
54
+ function Me(e) {
55
+ let t = j.indexOf(e);
56
+ return t === -1 || t >= j.length - 1 ? null : j[t + 1];
56
57
  }
57
- function P() {
58
- let { orderId: M } = Te(), { basePath: P, navigate: F } = le(), { order: I, isLoading: Ae, error: je, refetch: L } = ue(M), { updateOrder: Me, updateOrderStatus: Ne } = de(), { vehicles: Pe, drivers: Fe } = fe(), { message: R, notify: z } = T(), [B, V] = k(""), [H, U] = k(""), [W, G] = k(!1), [K, q] = k(!1), [J, Y] = k(null), X = Pe.filter((e) => e.status === "available" || e.id === I?.vehicleId), Z = Fe.filter((e) => e.status === "available" || e.id === I?.driverId), Ie = async () => {
59
- if (!M || !B && !H) {
58
+ function N() {
59
+ let { orderId: j } = Oe(), { basePath: N, navigate: P } = le(), { order: F, isLoading: Ne, error: Pe, refetch: I } = ue(j), { updateOrder: Fe, updateOrderStatus: Ie } = de(), [L, Le] = O(""), { vehicles: Re, drivers: ze } = fe({
60
+ limit: 20,
61
+ filters: { search: Ee(L) || void 0 }
62
+ }), { message: R, notify: z } = we(), [B, V] = O(""), [H, U] = O(""), [W, G] = O(!1), [K, q] = O(!1), [J, Y] = O(null), X = Re.filter((e) => e.status === "available" || e.id === F?.vehicleId), Z = ze.filter((e) => e.status === "available" || e.id === F?.driverId), Be = async () => {
63
+ if (!j || !B && !H) {
60
64
  Y("Pick a vehicle and/or a driver to assign.");
61
65
  return;
62
66
  }
63
67
  G(!0), Y(null);
64
68
  try {
65
- await Me(M, {
69
+ await Fe(j, {
66
70
  vehicleId: B || void 0,
67
71
  driverId: H || void 0
68
- }), z("Assignment updated."), V(""), U(""), L();
72
+ }), z("Assignment updated."), V(""), U(""), I();
69
73
  } catch (e) {
70
74
  Y(e instanceof Error ? e.message : "Failed to update assignment.");
71
75
  } finally {
72
76
  G(!1);
73
77
  }
74
78
  }, Q = async (e, t) => {
75
- if (M) {
79
+ if (j) {
76
80
  q(!0), Y(null);
77
81
  try {
78
- await Ne(M, e), z(t), L();
82
+ await Ie(j, e), z(t), I();
79
83
  } catch (e) {
80
84
  Y(e instanceof Error ? e.message : "Failed to update status.");
81
85
  } finally {
@@ -83,271 +87,271 @@ function P() {
83
87
  }
84
88
  }
85
89
  }, $ = (e) => {
86
- F && F(s(P, e));
90
+ P && P(s(N, e));
87
91
  };
88
- return Ae ? /* @__PURE__ */ A(_e, { message: "Loading order details..." }) : je || !I ? /* @__PURE__ */ A(ge, {
92
+ return Ne ? /* @__PURE__ */ k(ve, { message: "Loading order details..." }) : Pe || !F ? /* @__PURE__ */ k(_e, {
89
93
  title: "Order not found",
90
94
  message: "The order you're looking for doesn't exist or has been removed.",
91
- onRetry: L
92
- }) : /* @__PURE__ */ j(ve, {
93
- title: I.orderNumber,
94
- subtitle: `Created ${O(I.createdAt, "full")}`,
95
- icon: /* @__PURE__ */ A(i, { size: 24 }),
96
- headerActions: /* @__PURE__ */ j("div", {
95
+ onRetry: I
96
+ }) : /* @__PURE__ */ A(ye, {
97
+ title: F.orderNumber,
98
+ subtitle: `Created ${D(F.createdAt, "full")}`,
99
+ icon: /* @__PURE__ */ k(i, { size: 24 }),
100
+ headerActions: /* @__PURE__ */ A("div", {
97
101
  className: "flex gap-2",
98
102
  children: [
99
- /* @__PURE__ */ j(l, {
103
+ /* @__PURE__ */ A(l, {
100
104
  variant: "outline",
101
105
  onClick: () => {
102
- F && F(s(P, "orders"));
106
+ P && P(s(N, "orders"));
103
107
  },
104
- children: [/* @__PURE__ */ A(e, { size: 16 }), "Back"]
108
+ children: [/* @__PURE__ */ k(e, { size: 16 }), "Back"]
105
109
  }),
106
- /* @__PURE__ */ j(l, {
110
+ /* @__PURE__ */ A(l, {
107
111
  variant: "outline",
108
- children: [/* @__PURE__ */ A(a, { size: 16 }), "Print"]
112
+ children: [/* @__PURE__ */ k(a, { size: 16 }), "Print"]
109
113
  }),
110
- /* @__PURE__ */ j(l, {
111
- onClick: () => $(`orders/${M}/edit`),
112
- children: [/* @__PURE__ */ A(o, { size: 16 }), "Edit"]
114
+ /* @__PURE__ */ A(l, {
115
+ onClick: () => $(`orders/${j}/edit`),
116
+ children: [/* @__PURE__ */ k(o, { size: 16 }), "Edit"]
113
117
  })
114
118
  ]
115
119
  }),
116
- headerContent: /* @__PURE__ */ j("div", {
120
+ headerContent: /* @__PURE__ */ A("div", {
117
121
  className: "flex flex-wrap gap-2",
118
122
  children: [
119
- /* @__PURE__ */ A(w, {
120
- status: I.status,
123
+ /* @__PURE__ */ k(w, {
124
+ status: F.status,
121
125
  type: "order"
122
126
  }),
123
- /* @__PURE__ */ A(be, { priority: I.priority }),
124
- /* @__PURE__ */ A(ye, { status: I.pricing.paymentStatus })
127
+ /* @__PURE__ */ k(xe, { priority: F.priority }),
128
+ /* @__PURE__ */ k(be, { status: F.pricing.paymentStatus })
125
129
  ]
126
130
  }),
127
131
  children: [
128
- /* @__PURE__ */ A(Oe, {
129
- icon: /* @__PURE__ */ A(i, { size: 18 }),
132
+ /* @__PURE__ */ k(je, {
133
+ icon: /* @__PURE__ */ k(i, { size: 18 }),
130
134
  children: "Everything about this one delivery in a single place — who it's for, where it's going, what's inside, the running cost and the full status history. Use this page to review the order, hand it to a driver, print the docket, or jump into live tracking."
131
135
  }),
132
- /* @__PURE__ */ A(De, {
136
+ /* @__PURE__ */ k(Ae, {
133
137
  storageKey: "movethewheels-order-details",
134
138
  steps: [
135
139
  {
136
140
  id: "track",
137
141
  label: "Track this order live",
138
142
  description: "See where the shipment is right now on the map.",
139
- icon: /* @__PURE__ */ A(r, { size: 16 }),
140
- onClick: () => $(`tracking?order=${I.id}`)
143
+ icon: /* @__PURE__ */ k(r, { size: 16 }),
144
+ onClick: () => $(`tracking?order=${F.id}`)
141
145
  },
142
146
  {
143
147
  id: "edit",
144
148
  label: "Edit order details",
145
149
  description: "Update items, addresses or instructions before dispatch.",
146
- icon: /* @__PURE__ */ A(o, { size: 16 }),
147
- onClick: () => $(`orders/${M}/edit`)
150
+ icon: /* @__PURE__ */ k(o, { size: 16 }),
151
+ onClick: () => $(`orders/${j}/edit`)
148
152
  },
149
153
  {
150
154
  id: "print",
151
155
  label: "Print the delivery docket",
152
156
  description: "Generate a printable copy for the driver or warehouse.",
153
- icon: /* @__PURE__ */ A(a, { size: 16 }),
157
+ icon: /* @__PURE__ */ k(a, { size: 16 }),
154
158
  onClick: () => window.print()
155
159
  }
156
160
  ]
157
161
  }),
158
- /* @__PURE__ */ j("div", {
162
+ /* @__PURE__ */ A("div", {
159
163
  className: "grid grid-cols-1 lg:grid-cols-3 gap-6",
160
- children: [/* @__PURE__ */ j("div", {
164
+ children: [/* @__PURE__ */ A("div", {
161
165
  className: "lg:col-span-2 space-y-6",
162
166
  children: [
163
- /* @__PURE__ */ j(u, { children: [/* @__PURE__ */ A(f, { children: /* @__PURE__ */ j(p, {
167
+ /* @__PURE__ */ A(u, { children: [/* @__PURE__ */ k(f, { children: /* @__PURE__ */ A(p, {
164
168
  className: "flex items-center gap-2",
165
- children: [/* @__PURE__ */ A(ce, { size: 18 }), "Customer Information"]
166
- }) }), /* @__PURE__ */ A(d, { children: /* @__PURE__ */ j("div", {
169
+ children: [/* @__PURE__ */ k(ce, { size: 18 }), "Customer Information"]
170
+ }) }), /* @__PURE__ */ k(d, { children: /* @__PURE__ */ A("div", {
167
171
  className: "grid grid-cols-1 md:grid-cols-2 gap-6",
168
- children: [/* @__PURE__ */ j("div", { children: [
169
- /* @__PURE__ */ A("h4", {
172
+ children: [/* @__PURE__ */ A("div", { children: [
173
+ /* @__PURE__ */ k("h4", {
170
174
  className: "font-medium mb-2",
171
- children: I.customerInfo.name
175
+ children: F.customerInfo.name
172
176
  }),
173
- I.customerInfo.company && /* @__PURE__ */ A("p", {
177
+ F.customerInfo.company && /* @__PURE__ */ k("p", {
174
178
  className: "text-sm text-text-secondary mb-2",
175
- children: I.customerInfo.company
179
+ children: F.customerInfo.company
176
180
  }),
177
- /* @__PURE__ */ j("div", {
181
+ /* @__PURE__ */ A("div", {
178
182
  className: "space-y-1 text-sm",
179
- children: [/* @__PURE__ */ j("p", {
183
+ children: [/* @__PURE__ */ A("p", {
180
184
  className: "flex items-center gap-2",
181
- children: [/* @__PURE__ */ A(ie, {
185
+ children: [/* @__PURE__ */ k(ie, {
182
186
  size: 14,
183
187
  className: "text-text-secondary"
184
- }), I.customerInfo.email]
185
- }), /* @__PURE__ */ j("p", {
188
+ }), F.customerInfo.email]
189
+ }), /* @__PURE__ */ A("p", {
186
190
  className: "flex items-center gap-2",
187
- children: [/* @__PURE__ */ A(ae, {
191
+ children: [/* @__PURE__ */ k(ae, {
188
192
  size: 14,
189
193
  className: "text-text-secondary"
190
- }), I.customerInfo.phone]
194
+ }), F.customerInfo.phone]
191
195
  })]
192
196
  })
193
- ] }), /* @__PURE__ */ j("div", { children: [I.customerInfo.preferredDeliveryTime && /* @__PURE__ */ j("div", {
197
+ ] }), /* @__PURE__ */ A("div", { children: [F.customerInfo.preferredDeliveryTime && /* @__PURE__ */ A("div", {
194
198
  className: "mb-2",
195
- children: [/* @__PURE__ */ A("p", {
199
+ children: [/* @__PURE__ */ k("p", {
196
200
  className: "text-sm text-text-secondary",
197
201
  children: "Preferred Delivery Time"
198
- }), /* @__PURE__ */ A("p", {
202
+ }), /* @__PURE__ */ k("p", {
199
203
  className: "text-sm",
200
- children: I.customerInfo.preferredDeliveryTime
204
+ children: F.customerInfo.preferredDeliveryTime
201
205
  })]
202
- }), I.customerInfo.deliveryInstructions && /* @__PURE__ */ j("div", { children: [/* @__PURE__ */ A("p", {
206
+ }), F.customerInfo.deliveryInstructions && /* @__PURE__ */ A("div", { children: [/* @__PURE__ */ k("p", {
203
207
  className: "text-sm text-text-secondary",
204
208
  children: "Delivery Instructions"
205
- }), /* @__PURE__ */ A("p", {
209
+ }), /* @__PURE__ */ k("p", {
206
210
  className: "text-sm",
207
- children: I.customerInfo.deliveryInstructions
211
+ children: F.customerInfo.deliveryInstructions
208
212
  })] })] })]
209
213
  }) })] }),
210
- /* @__PURE__ */ j(u, { children: [/* @__PURE__ */ A(f, { children: /* @__PURE__ */ j(p, {
214
+ /* @__PURE__ */ A(u, { children: [/* @__PURE__ */ k(f, { children: /* @__PURE__ */ A(p, {
211
215
  className: "flex items-center gap-2",
212
- children: [/* @__PURE__ */ A(r, { size: 18 }), "Addresses"]
213
- }) }), /* @__PURE__ */ A(d, { children: /* @__PURE__ */ j("div", {
216
+ children: [/* @__PURE__ */ k(r, { size: 18 }), "Addresses"]
217
+ }) }), /* @__PURE__ */ k(d, { children: /* @__PURE__ */ A("div", {
214
218
  className: "grid grid-cols-1 md:grid-cols-2 gap-6",
215
- children: [/* @__PURE__ */ j("div", { children: [
216
- /* @__PURE__ */ A("h4", {
219
+ children: [/* @__PURE__ */ A("div", { children: [
220
+ /* @__PURE__ */ k("h4", {
217
221
  className: "font-medium mb-2 flex items-center gap-2",
218
- children: /* @__PURE__ */ A(c, {
222
+ children: /* @__PURE__ */ k(c, {
219
223
  variant: "outline",
220
224
  children: "Pickup"
221
225
  })
222
226
  }),
223
- /* @__PURE__ */ A("p", {
227
+ /* @__PURE__ */ k("p", {
224
228
  className: "text-sm",
225
- children: E(I.pickupAddress)
229
+ children: T(F.pickupAddress)
226
230
  }),
227
- I.scheduledPickup && /* @__PURE__ */ j("p", {
231
+ F.scheduledPickup && /* @__PURE__ */ A("p", {
228
232
  className: "text-sm text-text-secondary mt-2",
229
- children: ["Scheduled: ", O(I.scheduledPickup, "full")]
233
+ children: ["Scheduled: ", D(F.scheduledPickup, "full")]
230
234
  }),
231
- I.actualPickup && /* @__PURE__ */ j("p", {
235
+ F.actualPickup && /* @__PURE__ */ A("p", {
232
236
  className: "text-sm text-status-success-text mt-1",
233
237
  children: [
234
- /* @__PURE__ */ A(n, {
238
+ /* @__PURE__ */ k(n, {
235
239
  size: 14,
236
240
  className: "inline mr-1"
237
241
  }),
238
242
  "Picked up: ",
239
- O(I.actualPickup, "full")
243
+ D(F.actualPickup, "full")
240
244
  ]
241
245
  })
242
- ] }), /* @__PURE__ */ j("div", { children: [
243
- /* @__PURE__ */ A("h4", {
246
+ ] }), /* @__PURE__ */ A("div", { children: [
247
+ /* @__PURE__ */ k("h4", {
244
248
  className: "font-medium mb-2 flex items-center gap-2",
245
- children: /* @__PURE__ */ A(c, {
249
+ children: /* @__PURE__ */ k(c, {
246
250
  variant: "outline",
247
251
  children: "Delivery"
248
252
  })
249
253
  }),
250
- /* @__PURE__ */ A("p", {
254
+ /* @__PURE__ */ k("p", {
251
255
  className: "text-sm",
252
- children: E(I.deliveryAddress)
256
+ children: T(F.deliveryAddress)
253
257
  }),
254
- I.scheduledDelivery && /* @__PURE__ */ j("p", {
258
+ F.scheduledDelivery && /* @__PURE__ */ A("p", {
255
259
  className: "text-sm text-text-secondary mt-2",
256
- children: ["Scheduled: ", O(I.scheduledDelivery, "full")]
260
+ children: ["Scheduled: ", D(F.scheduledDelivery, "full")]
257
261
  }),
258
- I.actualDelivery && /* @__PURE__ */ j("p", {
262
+ F.actualDelivery && /* @__PURE__ */ A("p", {
259
263
  className: "text-sm text-status-success-text mt-1",
260
264
  children: [
261
- /* @__PURE__ */ A(n, {
265
+ /* @__PURE__ */ k(n, {
262
266
  size: 14,
263
267
  className: "inline mr-1"
264
268
  }),
265
269
  "Delivered: ",
266
- O(I.actualDelivery, "full")
270
+ D(F.actualDelivery, "full")
267
271
  ]
268
272
  })
269
273
  ] })]
270
274
  }) })] }),
271
- /* @__PURE__ */ j(u, { children: [/* @__PURE__ */ A(f, { children: /* @__PURE__ */ j(p, {
275
+ /* @__PURE__ */ A(u, { children: [/* @__PURE__ */ k(f, { children: /* @__PURE__ */ A(p, {
272
276
  className: "flex items-center gap-2",
273
277
  children: [
274
- /* @__PURE__ */ A(i, { size: 18 }),
278
+ /* @__PURE__ */ k(i, { size: 18 }),
275
279
  "Order Items (",
276
- I.items.length,
280
+ F.items.length,
277
281
  ")"
278
282
  ]
279
- }) }), /* @__PURE__ */ A(d, {
283
+ }) }), /* @__PURE__ */ k(d, {
280
284
  className: "p-0",
281
- children: /* @__PURE__ */ j(pe, { children: [/* @__PURE__ */ A(he, { children: /* @__PURE__ */ j(C, { children: [
282
- /* @__PURE__ */ A(S, { children: "Item" }),
283
- /* @__PURE__ */ A(S, { children: "SKU" }),
284
- /* @__PURE__ */ A(S, {
285
+ children: /* @__PURE__ */ A(me, { children: [/* @__PURE__ */ k(ge, { children: /* @__PURE__ */ A(C, { children: [
286
+ /* @__PURE__ */ k(S, { children: "Item" }),
287
+ /* @__PURE__ */ k(S, { children: "SKU" }),
288
+ /* @__PURE__ */ k(S, {
285
289
  className: "text-center",
286
290
  children: "Qty"
287
291
  }),
288
- /* @__PURE__ */ A(S, {
292
+ /* @__PURE__ */ k(S, {
289
293
  className: "text-right",
290
294
  children: "Unit Price"
291
295
  }),
292
- /* @__PURE__ */ A(S, {
296
+ /* @__PURE__ */ k(S, {
293
297
  className: "text-right",
294
298
  children: "Total"
295
299
  })
296
- ] }) }), /* @__PURE__ */ A(me, { children: I.items.map((e) => /* @__PURE__ */ j(C, { children: [
297
- /* @__PURE__ */ A(x, { children: /* @__PURE__ */ j("div", { children: [/* @__PURE__ */ A("p", {
300
+ ] }) }), /* @__PURE__ */ k(he, { children: F.items.map((e) => /* @__PURE__ */ A(C, { children: [
301
+ /* @__PURE__ */ k(x, { children: /* @__PURE__ */ A("div", { children: [/* @__PURE__ */ k("p", {
298
302
  className: "font-medium",
299
303
  children: e.name
300
- }), e.description && /* @__PURE__ */ A("p", {
304
+ }), e.description && /* @__PURE__ */ k("p", {
301
305
  className: "text-sm text-text-secondary",
302
306
  children: e.description
303
307
  })] }) }),
304
- /* @__PURE__ */ A(x, {
308
+ /* @__PURE__ */ k(x, {
305
309
  className: "font-mono text-sm",
306
310
  children: e.sku
307
311
  }),
308
- /* @__PURE__ */ A(x, {
312
+ /* @__PURE__ */ k(x, {
309
313
  className: "text-center",
310
314
  children: e.quantity
311
315
  }),
312
- /* @__PURE__ */ A(x, {
316
+ /* @__PURE__ */ k(x, {
313
317
  className: "text-right",
314
- children: D(e.value)
318
+ children: E(e.value)
315
319
  }),
316
- /* @__PURE__ */ A(x, {
320
+ /* @__PURE__ */ k(x, {
317
321
  className: "text-right font-medium",
318
- children: D(e.value * e.quantity)
322
+ children: E(e.value * e.quantity)
319
323
  })
320
324
  ] }, e.id)) })] })
321
325
  })] }),
322
- /* @__PURE__ */ j(u, { children: [/* @__PURE__ */ A(f, { children: /* @__PURE__ */ j(p, {
326
+ /* @__PURE__ */ A(u, { children: [/* @__PURE__ */ k(f, { children: /* @__PURE__ */ A(p, {
323
327
  className: "flex items-center gap-2",
324
- children: [/* @__PURE__ */ A(te, { size: 18 }), "Order Timeline"]
325
- }) }), /* @__PURE__ */ A(d, { children: /* @__PURE__ */ A("div", {
328
+ children: [/* @__PURE__ */ k(te, { size: 18 }), "Order Timeline"]
329
+ }) }), /* @__PURE__ */ k(d, { children: /* @__PURE__ */ k("div", {
326
330
  className: "relative",
327
- children: I.timeline.map((e, t) => /* @__PURE__ */ j("div", {
331
+ children: F.timeline.map((e, t) => /* @__PURE__ */ A("div", {
328
332
  className: "flex gap-4 pb-6 last:pb-0",
329
- children: [/* @__PURE__ */ j("div", {
333
+ children: [/* @__PURE__ */ A("div", {
330
334
  className: "relative",
331
- children: [/* @__PURE__ */ A("div", { className: "w-3 h-3 rounded-full bg-action-primary-bg mt-1.5" }), t < I.timeline.length - 1 && /* @__PURE__ */ A("div", { className: "absolute top-4 left-1.5 w-px h-full -ml-px bg-border" })]
332
- }), /* @__PURE__ */ j("div", {
335
+ children: [/* @__PURE__ */ k("div", { className: "w-3 h-3 rounded-full bg-action-primary-bg mt-1.5" }), t < F.timeline.length - 1 && /* @__PURE__ */ k("div", { className: "absolute top-4 left-1.5 w-px h-full -ml-px bg-border" })]
336
+ }), /* @__PURE__ */ A("div", {
333
337
  className: "flex-1",
334
338
  children: [
335
- /* @__PURE__ */ j("div", {
339
+ /* @__PURE__ */ A("div", {
336
340
  className: "flex items-center gap-2 mb-1",
337
- children: [/* @__PURE__ */ A(w, {
341
+ children: [/* @__PURE__ */ k(w, {
338
342
  status: e.status,
339
343
  type: "order",
340
344
  size: "sm"
341
- }), /* @__PURE__ */ A("span", {
345
+ }), /* @__PURE__ */ k("span", {
342
346
  className: "text-sm text-text-secondary",
343
- children: O(e.timestamp, "full")
347
+ children: D(e.timestamp, "full")
344
348
  })]
345
349
  }),
346
- e.notes && /* @__PURE__ */ A("p", {
350
+ e.notes && /* @__PURE__ */ k("p", {
347
351
  className: "text-sm",
348
352
  children: e.notes
349
353
  }),
350
- /* @__PURE__ */ j("p", {
354
+ /* @__PURE__ */ A("p", {
351
355
  className: "text-xs text-text-secondary",
352
356
  children: ["by ", e.performedBy]
353
357
  })
@@ -356,105 +360,117 @@ function P() {
356
360
  }, t))
357
361
  }) })] })
358
362
  ]
359
- }), /* @__PURE__ */ j("div", {
363
+ }), /* @__PURE__ */ A("div", {
360
364
  className: "space-y-6",
361
365
  children: [
362
- /* @__PURE__ */ j(Ee, { children: [/* @__PURE__ */ j("h2", {
366
+ /* @__PURE__ */ A(ke, { children: [/* @__PURE__ */ A("h2", {
363
367
  className: "flex items-center gap-2 text-base font-semibold text-text-primary mb-4",
364
- children: [/* @__PURE__ */ A(ne, { size: 18 }), "Order Summary"]
365
- }), /* @__PURE__ */ j("div", {
368
+ children: [/* @__PURE__ */ k(ne, { size: 18 }), "Order Summary"]
369
+ }), /* @__PURE__ */ A("div", {
366
370
  className: "space-y-3",
367
371
  children: [
368
- /* @__PURE__ */ j("div", {
372
+ /* @__PURE__ */ A("div", {
369
373
  className: "flex justify-between text-sm",
370
- children: [/* @__PURE__ */ A("span", {
374
+ children: [/* @__PURE__ */ k("span", {
371
375
  className: "text-text-secondary",
372
376
  children: "Subtotal"
373
- }), /* @__PURE__ */ A("span", { children: D(I.pricing.subtotal) })]
377
+ }), /* @__PURE__ */ k("span", { children: E(F.pricing.subtotal) })]
374
378
  }),
375
- /* @__PURE__ */ j("div", {
379
+ /* @__PURE__ */ A("div", {
376
380
  className: "flex justify-between text-sm",
377
- children: [/* @__PURE__ */ A("span", {
381
+ children: [/* @__PURE__ */ k("span", {
378
382
  className: "text-text-secondary",
379
383
  children: "Delivery"
380
- }), /* @__PURE__ */ A("span", { children: D(I.pricing.fees.delivery) })]
384
+ }), /* @__PURE__ */ k("span", { children: E(F.pricing.fees.delivery) })]
381
385
  }),
382
- /* @__PURE__ */ j("div", {
386
+ /* @__PURE__ */ A("div", {
383
387
  className: "flex justify-between text-sm",
384
- children: [/* @__PURE__ */ A("span", {
388
+ children: [/* @__PURE__ */ k("span", {
385
389
  className: "text-text-secondary",
386
390
  children: "Handling"
387
- }), /* @__PURE__ */ A("span", { children: D(I.pricing.fees.handling) })]
391
+ }), /* @__PURE__ */ k("span", { children: E(F.pricing.fees.handling) })]
388
392
  }),
389
- I.pricing.fees.insurance && /* @__PURE__ */ j("div", {
393
+ F.pricing.fees.insurance && /* @__PURE__ */ A("div", {
390
394
  className: "flex justify-between text-sm",
391
- children: [/* @__PURE__ */ A("span", {
395
+ children: [/* @__PURE__ */ k("span", {
392
396
  className: "text-text-secondary",
393
397
  children: "Insurance"
394
- }), /* @__PURE__ */ A("span", { children: D(I.pricing.fees.insurance) })]
398
+ }), /* @__PURE__ */ k("span", { children: E(F.pricing.fees.insurance) })]
395
399
  }),
396
- /* @__PURE__ */ j("div", {
400
+ /* @__PURE__ */ A("div", {
397
401
  className: "flex justify-between text-sm",
398
- children: [/* @__PURE__ */ A("span", {
402
+ children: [/* @__PURE__ */ k("span", {
399
403
  className: "text-text-secondary",
400
404
  children: "Taxes"
401
- }), /* @__PURE__ */ A("span", { children: D(I.pricing.taxes) })]
405
+ }), /* @__PURE__ */ k("span", { children: E(F.pricing.taxes) })]
402
406
  }),
403
- /* @__PURE__ */ A(b, {}),
404
- /* @__PURE__ */ j("div", {
407
+ /* @__PURE__ */ k(b, {}),
408
+ /* @__PURE__ */ A("div", {
405
409
  className: "flex justify-between font-medium",
406
- children: [/* @__PURE__ */ A("span", { children: "Total" }), /* @__PURE__ */ A("span", {
410
+ children: [/* @__PURE__ */ k("span", { children: "Total" }), /* @__PURE__ */ k("span", {
407
411
  className: "text-lg",
408
- children: D(I.pricing.total)
412
+ children: E(F.pricing.total)
409
413
  })]
410
414
  }),
411
- /* @__PURE__ */ j("div", {
415
+ /* @__PURE__ */ A("div", {
412
416
  className: "pt-2",
413
- children: [/* @__PURE__ */ A("p", {
417
+ children: [/* @__PURE__ */ k("p", {
414
418
  className: "text-sm text-text-secondary",
415
419
  children: "Payment Method"
416
- }), /* @__PURE__ */ A("p", {
420
+ }), /* @__PURE__ */ k("p", {
417
421
  className: "text-sm capitalize",
418
- children: I.pricing.paymentMethod.replace("_", " ")
422
+ children: F.pricing.paymentMethod.replace("_", " ")
419
423
  })]
420
424
  })
421
425
  ]
422
426
  })] }),
423
- /* @__PURE__ */ j(u, { children: [/* @__PURE__ */ A(f, { children: /* @__PURE__ */ j(p, {
427
+ /* @__PURE__ */ A(u, { children: [/* @__PURE__ */ k(f, { children: /* @__PURE__ */ A(p, {
424
428
  className: "flex items-center gap-2",
425
- children: [/* @__PURE__ */ A(oe, { size: 18 }), "Assignment"]
426
- }) }), /* @__PURE__ */ A(d, { children: /* @__PURE__ */ j("div", {
429
+ children: [/* @__PURE__ */ k(oe, { size: 18 }), "Assignment"]
430
+ }) }), /* @__PURE__ */ k(d, { children: /* @__PURE__ */ A("div", {
427
431
  className: "space-y-4",
428
432
  children: [
429
- J && /* @__PURE__ */ A(xe, { message: J }),
430
- R && /* @__PURE__ */ A(Se, { message: R }),
431
- /* @__PURE__ */ j("div", { children: [/* @__PURE__ */ A("p", {
433
+ J && /* @__PURE__ */ k(Se, { message: J }),
434
+ R && /* @__PURE__ */ k(Ce, { message: R }),
435
+ /* @__PURE__ */ A("div", { children: [/* @__PURE__ */ k("p", {
432
436
  className: "text-sm text-text-secondary",
433
437
  children: "Tracking Number"
434
- }), /* @__PURE__ */ A("p", {
438
+ }), /* @__PURE__ */ k("p", {
435
439
  className: "text-sm font-mono",
436
- children: I.trackingNumber || "—"
440
+ children: F.trackingNumber || "—"
437
441
  })] }),
438
- /* @__PURE__ */ A(b, {}),
439
- /* @__PURE__ */ j("div", {
442
+ /* @__PURE__ */ k(b, {}),
443
+ /* @__PURE__ */ A("div", {
440
444
  className: "space-y-3",
441
445
  children: [
442
- /* @__PURE__ */ j("div", {
446
+ /* @__PURE__ */ A("div", {
447
+ className: "space-y-1.5",
448
+ children: [/* @__PURE__ */ k(m, {
449
+ htmlFor: "assign-fleet-search",
450
+ children: "Search fleet"
451
+ }), /* @__PURE__ */ k(pe, {
452
+ id: "assign-fleet-search",
453
+ value: L,
454
+ onChange: (e) => Le(e.target.value),
455
+ placeholder: "Vehicle number, driver name or ID"
456
+ })]
457
+ }),
458
+ /* @__PURE__ */ A("div", {
443
459
  className: "space-y-1.5",
444
- children: [/* @__PURE__ */ A(m, {
460
+ children: [/* @__PURE__ */ k(m, {
445
461
  htmlFor: "assign-vehicle",
446
462
  children: "Vehicle"
447
- }), /* @__PURE__ */ j(h, {
463
+ }), /* @__PURE__ */ A(h, {
448
464
  value: B,
449
465
  onValueChange: V,
450
- children: [/* @__PURE__ */ A(v, {
466
+ children: [/* @__PURE__ */ k(v, {
451
467
  id: "assign-vehicle",
452
- children: /* @__PURE__ */ A(y, { placeholder: I.vehicleId ? `Current: ${I.vehicleId}` : "Select a vehicle" })
453
- }), /* @__PURE__ */ A(g, { children: X.length === 0 ? /* @__PURE__ */ A(_, {
468
+ children: /* @__PURE__ */ k(y, { placeholder: F.vehicleId ? `Current: ${F.vehicleId}` : "Select a vehicle" })
469
+ }), /* @__PURE__ */ k(g, { children: X.length === 0 ? /* @__PURE__ */ k(_, {
454
470
  value: "none",
455
471
  disabled: !0,
456
472
  children: "No available vehicles"
457
- }) : X.map((e) => /* @__PURE__ */ j(_, {
473
+ }) : X.map((e) => /* @__PURE__ */ A(_, {
458
474
  value: e.id,
459
475
  children: [
460
476
  e.vehicleNumber,
@@ -465,22 +481,22 @@ function P() {
465
481
  }, e.id)) })]
466
482
  })]
467
483
  }),
468
- /* @__PURE__ */ j("div", {
484
+ /* @__PURE__ */ A("div", {
469
485
  className: "space-y-1.5",
470
- children: [/* @__PURE__ */ A(m, {
486
+ children: [/* @__PURE__ */ k(m, {
471
487
  htmlFor: "assign-driver",
472
488
  children: "Driver"
473
- }), /* @__PURE__ */ j(h, {
489
+ }), /* @__PURE__ */ A(h, {
474
490
  value: H,
475
491
  onValueChange: U,
476
- children: [/* @__PURE__ */ A(v, {
492
+ children: [/* @__PURE__ */ k(v, {
477
493
  id: "assign-driver",
478
- children: /* @__PURE__ */ A(y, { placeholder: I.driverId ? `Current: ${I.driverId}` : "Select a driver" })
479
- }), /* @__PURE__ */ A(g, { children: Z.length === 0 ? /* @__PURE__ */ A(_, {
494
+ children: /* @__PURE__ */ k(y, { placeholder: F.driverId ? `Current: ${F.driverId}` : "Select a driver" })
495
+ }), /* @__PURE__ */ k(g, { children: Z.length === 0 ? /* @__PURE__ */ k(_, {
480
496
  value: "none",
481
497
  disabled: !0,
482
498
  children: "No available drivers"
483
- }) : Z.map((e) => /* @__PURE__ */ j(_, {
499
+ }) : Z.map((e) => /* @__PURE__ */ A(_, {
484
500
  value: e.id,
485
501
  children: [
486
502
  e.fullName,
@@ -491,67 +507,67 @@ function P() {
491
507
  }, e.id)) })]
492
508
  })]
493
509
  }),
494
- /* @__PURE__ */ j(l, {
510
+ /* @__PURE__ */ A(l, {
495
511
  className: "w-full",
496
- onClick: Ie,
512
+ onClick: Be,
497
513
  disabled: W || !B && !H,
498
- children: [/* @__PURE__ */ A(se, { size: 16 }), W ? "Assigning…" : "Assign driver & vehicle"]
514
+ children: [/* @__PURE__ */ k(se, { size: 16 }), W ? "Assigning…" : "Assign driver & vehicle"]
499
515
  })
500
516
  ]
501
517
  }),
502
- /* @__PURE__ */ A(b, {}),
503
- /* @__PURE__ */ j("div", {
518
+ /* @__PURE__ */ k(b, {}),
519
+ /* @__PURE__ */ A("div", {
504
520
  className: "space-y-2",
505
521
  children: [
506
- /* @__PURE__ */ j("p", {
522
+ /* @__PURE__ */ A("p", {
507
523
  className: "text-sm text-text-secondary",
508
524
  children: [
509
525
  "Current status:",
510
526
  " ",
511
- /* @__PURE__ */ A("span", {
527
+ /* @__PURE__ */ k("span", {
512
528
  className: "font-medium",
513
- children: N[I.status]
529
+ children: M[F.status]
514
530
  })
515
531
  ]
516
532
  }),
517
533
  (() => {
518
- let e = ke(I.status);
519
- return e ? /* @__PURE__ */ j(l, {
534
+ let e = Me(F.status);
535
+ return e ? /* @__PURE__ */ A(l, {
520
536
  variant: "outline",
521
537
  className: "w-full",
522
- onClick: () => Q(e, `Order advanced to ${N[e]}.`),
538
+ onClick: () => Q(e, `Order advanced to ${M[e]}.`),
523
539
  disabled: K,
524
- children: [/* @__PURE__ */ A(t, { size: 16 }), K ? "Updating…" : `Advance to ${N[e]}`]
540
+ children: [/* @__PURE__ */ k(t, { size: 16 }), K ? "Updating…" : `Advance to ${M[e]}`]
525
541
  }) : null;
526
542
  })(),
527
- I.status !== "cancelled" && I.status !== "delivered" && /* @__PURE__ */ j(l, {
543
+ F.status !== "cancelled" && F.status !== "delivered" && /* @__PURE__ */ A(l, {
528
544
  variant: "outline",
529
545
  className: "w-full text-status-error-text",
530
546
  onClick: () => Q("cancelled", "Order cancelled."),
531
547
  disabled: K,
532
- children: [/* @__PURE__ */ A(ee, { size: 16 }), "Cancel order"]
548
+ children: [/* @__PURE__ */ k(ee, { size: 16 }), "Cancel order"]
533
549
  })
534
550
  ]
535
551
  }),
536
- /* @__PURE__ */ j(l, {
552
+ /* @__PURE__ */ A(l, {
537
553
  variant: "outline",
538
554
  className: "w-full",
539
- onClick: () => $(`tracking?order=${I.id}`),
540
- children: [/* @__PURE__ */ A(r, { size: 16 }), "Track Order"]
555
+ onClick: () => $(`tracking?order=${F.id}`),
556
+ children: [/* @__PURE__ */ k(r, { size: 16 }), "Track Order"]
541
557
  })
542
558
  ]
543
559
  }) })] }),
544
- /* @__PURE__ */ A(Ce, {
560
+ /* @__PURE__ */ k(Te, {
545
561
  entityType: "order",
546
- entityId: I.id
562
+ entityId: F.id
547
563
  }),
548
- /* @__PURE__ */ A(we, { deliveryJobId: I.id }),
549
- I.specialInstructions && /* @__PURE__ */ j(u, { children: [/* @__PURE__ */ A(f, { children: /* @__PURE__ */ j(p, {
564
+ /* @__PURE__ */ k(De, { deliveryJobId: F.id }),
565
+ F.specialInstructions && /* @__PURE__ */ A(u, { children: [/* @__PURE__ */ k(f, { children: /* @__PURE__ */ A(p, {
550
566
  className: "flex items-center gap-2",
551
- children: [/* @__PURE__ */ A(re, { size: 18 }), "Special Instructions"]
552
- }) }), /* @__PURE__ */ A(d, { children: /* @__PURE__ */ A("p", {
567
+ children: [/* @__PURE__ */ k(re, { size: 18 }), "Special Instructions"]
568
+ }) }), /* @__PURE__ */ k(d, { children: /* @__PURE__ */ k("p", {
553
569
  className: "text-sm",
554
- children: I.specialInstructions
570
+ children: F.specialInstructions
555
571
  }) })] })
556
572
  ]
557
573
  })]
@@ -560,4 +576,4 @@ function P() {
560
576
  });
561
577
  }
562
578
  //#endregion
563
- export { P as default };
579
+ export { N as default };