@burdenoff/microfe-movethewheels 2026.929.4 → 2026.930.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.
Files changed (49) hide show
  1. package/dist/components/CustomerPicker.js +52 -48
  2. package/dist/components/EntityCombobox.js +25 -23
  3. package/dist/components/OrderItemRow.js +123 -78
  4. package/dist/hooks/useCustomers.js +52 -17
  5. package/dist/hooks/useFleet.js +126 -44
  6. package/dist/hooks/useInventory.js +43 -7
  7. package/dist/hooks/useMultiModalShipments.js +30 -26
  8. package/dist/hooks/useRefetchOnLeaveEdit.js +10 -0
  9. package/dist/hooks/useRoutes.js +55 -15
  10. package/dist/movethewheels/components/CustomerPicker.d.ts +5 -1
  11. package/dist/movethewheels/components/EntityCombobox.d.ts +6 -3
  12. package/dist/movethewheels/components/OrderItemRow.d.ts +7 -1
  13. package/dist/movethewheels/hooks/useCustomers.d.ts +3 -0
  14. package/dist/movethewheels/hooks/useFleet.d.ts +6 -0
  15. package/dist/movethewheels/hooks/useInventory.d.ts +2 -0
  16. package/dist/movethewheels/hooks/useMultiModalShipments.d.ts +1 -0
  17. package/dist/movethewheels/hooks/useRefetchOnLeaveEdit.d.ts +7 -0
  18. package/dist/movethewheels/hooks/useRoutes.d.ts +3 -0
  19. package/dist/movethewheels/utils/orderValidation.d.ts +11 -0
  20. package/dist/pages/CreateOrderPage.js +349 -297
  21. package/dist/pages/DriverDetailsPage.js +258 -251
  22. package/dist/pages/DriversPage.js +3 -1
  23. package/dist/pages/MultiModalShipmentPage.js +139 -125
  24. package/dist/pages/OrderDetailsPage.js +132 -140
  25. package/dist/pages/ProductDetailsPage.js +22 -19
  26. package/dist/pages/RouteDetailsPage.js +284 -281
  27. package/dist/pages/TrackingPage.js +2 -1
  28. package/dist/pages/VehicleDetailsPage.js +28 -25
  29. package/dist/utils/orderValidation.js +18 -0
  30. package/package.json +1 -1
  31. package/src/movethewheels/components/CustomerPicker.tsx +12 -0
  32. package/src/movethewheels/components/EntityCombobox.tsx +30 -11
  33. package/src/movethewheels/components/OrderItemRow.tsx +44 -0
  34. package/src/movethewheels/hooks/useCustomers.ts +38 -0
  35. package/src/movethewheels/hooks/useFleet.ts +125 -5
  36. package/src/movethewheels/hooks/useInventory.ts +42 -0
  37. package/src/movethewheels/hooks/useMultiModalShipments.ts +9 -7
  38. package/src/movethewheels/hooks/useRefetchOnLeaveEdit.ts +18 -0
  39. package/src/movethewheels/hooks/useRoutes.ts +51 -0
  40. package/src/movethewheels/pages/CreateOrderPage.tsx +66 -2
  41. package/src/movethewheels/pages/DriverDetailsPage.tsx +14 -1
  42. package/src/movethewheels/pages/DriversPage.tsx +7 -1
  43. package/src/movethewheels/pages/MultiModalShipmentPage.tsx +15 -1
  44. package/src/movethewheels/pages/OrderDetailsPage.tsx +25 -25
  45. package/src/movethewheels/pages/ProductDetailsPage.tsx +2 -0
  46. package/src/movethewheels/pages/RouteDetailsPage.tsx +10 -4
  47. package/src/movethewheels/pages/TrackingPage.tsx +7 -2
  48. package/src/movethewheels/pages/VehicleDetailsPage.tsx +2 -0
  49. package/src/movethewheels/utils/orderValidation.ts +53 -0
@@ -12,29 +12,30 @@ import { SquarePen as l } from "../node_modules/lucide-react/dist/esm/icons/squa
12
12
  import { Trash2 as u } from "../node_modules/lucide-react/dist/esm/icons/trash-2.js";
13
13
  import { Zap as d } from "../node_modules/lucide-react/dist/esm/icons/zap.js";
14
14
  import { joinPath as f } from "../utils/navigation.js";
15
- import { useMoveTheWheels as te } from "../providers/MoveTheWheelsProvider.js";
16
- import { useRoute as ne, useRoutes as re } from "../hooks/useRoutes.js";
17
- import { useDriver as p, useDrivers as ie, useVehicle as ae, useVehicles as m } from "../hooks/useFleet.js";
18
- import { Badge as h, Button as g, Card as _, CardContent as v, CardHeader as y, CardTitle as b, Input as x, Label as S, Select as C, SelectContent as w, SelectItem as T, SelectTrigger as E, SelectValue as D } from "../components/ui.js";
19
- import { ErrorState as oe, LoadingState as se, PageLayout as O } from "../components/PageLayout.js";
20
- import { RouteMap as k } from "../components/maps/RouteMap.js";
15
+ import { useMoveTheWheels as p } from "../providers/MoveTheWheelsProvider.js";
16
+ import { useRoute as te, useRoutes as ne } from "../hooks/useRoutes.js";
17
+ import { useDriver as m, useDrivers as re, useVehicle as ie, useVehicles as h } from "../hooks/useFleet.js";
18
+ import { Badge as g, Button as _, Card as v, CardContent as y, CardHeader as b, CardTitle as x, Input as S, Label as C, Select as w, SelectContent as T, SelectItem as E, SelectTrigger as D, SelectValue as O } from "../components/ui.js";
19
+ import { ErrorState as ae, LoadingState as oe, PageLayout as se } from "../components/PageLayout.js";
20
+ import { RouteMap as ce } from "../components/maps/RouteMap.js";
21
21
  import "../components/maps/index.js";
22
- import { ROUTE_STATUS_COLORS as A } from "../constants/index.js";
23
- import { StatusBadge as j } from "../components/StatusBadge.js";
24
- import { FormError as M } from "../components/FormError.js";
25
- import { Notice as N, useNotice as ce } from "../components/Notice.js";
26
- import { formatAddress as P, formatCurrency as le, formatDate as F } from "../utils/formatters.js";
27
- import { EntityCombobox as I } from "../components/EntityCombobox.js";
28
- import { firstRealLatLng as L } from "../utils/mapMarkers.js";
29
- import { useAssignmentSuggestions as ue } from "../hooks/useFleetIntelligence.js";
30
- import { AssignmentSuggestions as de } from "../components/AssignmentSuggestions.js";
31
- import { useEffect as R, useState as z } from "react";
32
- import { useLocation as B, useParams as V } from "react-router";
33
- import { Fragment as H, jsx as U, jsxs as W } from "react/jsx-runtime";
34
- import { useI18n as fe } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
35
- import { EmphasisPanel as pe, NextSteps as me, PagePurpose as he, ResponsiveDialog as ge, ResponsiveDialogContent as _e, ResponsiveDialogDescription as G, ResponsiveDialogFooter as K, ResponsiveDialogHeader as ve, ResponsiveDialogTitle as q } from "@burdenoff/fe-libs/ui";
22
+ import { ROUTE_STATUS_COLORS as k } from "../constants/index.js";
23
+ import { StatusBadge as A } from "../components/StatusBadge.js";
24
+ import { FormError as j } from "../components/FormError.js";
25
+ import { Notice as M, useNotice as le } from "../components/Notice.js";
26
+ import { formatAddress as N, formatCurrency as ue, formatDate as P } from "../utils/formatters.js";
27
+ import { EntityCombobox as F } from "../components/EntityCombobox.js";
28
+ import { firstRealLatLng as de } from "../utils/mapMarkers.js";
29
+ import { useRefetchOnLeaveEdit as fe } from "../hooks/useRefetchOnLeaveEdit.js";
30
+ import { useAssignmentSuggestions as pe } from "../hooks/useFleetIntelligence.js";
31
+ import { AssignmentSuggestions as me } from "../components/AssignmentSuggestions.js";
32
+ import { useEffect as I, useState as L } from "react";
33
+ import { useLocation as R, useParams as he } from "react-router";
34
+ import { Fragment as z, jsx as B, jsxs as V } from "react/jsx-runtime";
35
+ import { useI18n as ge } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
36
+ import { EmphasisPanel as _e, NextSteps as ve, PagePurpose as ye, ResponsiveDialog as H, ResponsiveDialogContent as be, ResponsiveDialogDescription as xe, ResponsiveDialogFooter as Se, ResponsiveDialogHeader as Ce, ResponsiveDialogTitle as U } from "@burdenoff/fe-libs/ui";
36
37
  //#region src/movethewheels/pages/RouteDetailsPage.tsx
37
- var J = [
38
+ var W = [
38
39
  {
39
40
  value: "planned",
40
41
  label: "Planned"
@@ -52,8 +53,8 @@ var J = [
52
53
  label: "Cancelled"
53
54
  }
54
55
  ];
55
- function Y({ editId: r }) {
56
- let { basePath: i, navigate: a } = te(), { createRoute: ee, updateRoute: l } = re(), { route: d } = ne(r), [h, oe] = z(""), [se, k] = z(""), A = !!r, [j, N] = z({
56
+ function G({ editId: r }) {
57
+ let { basePath: i, navigate: a } = p(), { createRoute: ee, updateRoute: l } = ne(), { route: d } = te(r), [g, ae] = L(""), [oe, ce] = L(""), k = !!r, [A, M] = L({
57
58
  name: "",
58
59
  status: "planned",
59
60
  vehicleId: "",
@@ -62,23 +63,21 @@ function Y({ editId: r }) {
62
63
  address: "",
63
64
  type: "delivery"
64
65
  }]
65
- }), { vehicles: ce, isLoading: le, hasMore: F, totalVehicles: L } = m({
66
+ }), { vehicles: le, isLoading: ue, hasMore: P, totalVehicles: de, loadMore: fe, isLoadingMore: pe } = h({
66
67
  limit: 20,
67
- search: h || void 0,
68
- driverId: j.driverId || void 0
69
- }), { drivers: ue, isLoading: de, hasMore: B, totalDrivers: V } = ie({
68
+ search: g || void 0
69
+ }), { drivers: me, isLoading: R, hasMore: he, totalDrivers: ge, loadMore: ve, isLoadingMore: H } = re({
70
70
  limit: 20,
71
- search: se || void 0,
72
- vehicleId: j.vehicleId || void 0
73
- }), { vehicle: fe, isLoading: me } = ae(j.vehicleId || void 0), { driver: ge, isLoading: _e } = p(j.driverId || void 0), [G, K] = z(!1), [ve, q] = z(null);
74
- R(() => {
75
- !r || !d || N({
71
+ search: oe || void 0
72
+ }), { vehicle: be, isLoading: xe } = ie(A.vehicleId || void 0), { driver: Se, isLoading: Ce } = m(A.driverId || void 0), [U, G] = L(!1), [K, q] = L(null);
73
+ I(() => {
74
+ !r || !d || M({
76
75
  name: d.name || "",
77
76
  status: d.status,
78
77
  vehicleId: d.vehicleId || "",
79
78
  driverId: d.driverId || "",
80
79
  stops: d.stops.length > 0 ? d.stops.map((e) => ({
81
- address: P(e.address) || e.address.street || "",
80
+ address: N(e.address) || e.address.street || "",
82
81
  type: e.type
83
82
  })) : [{
84
83
  address: "",
@@ -86,22 +85,22 @@ function Y({ editId: r }) {
86
85
  }]
87
86
  });
88
87
  }, [r, d]);
89
- let Y = () => a?.(f(i, "routes")), X = () => N((e) => ({
88
+ let J = () => a?.(f(i, "routes")), Y = () => M((e) => ({
90
89
  ...e,
91
90
  stops: [...e.stops, {
92
91
  address: "",
93
92
  type: "delivery"
94
93
  }]
95
- })), ye = (e) => N((t) => ({
94
+ })), X = (e) => M((t) => ({
96
95
  ...t,
97
96
  stops: t.stops.filter((t, n) => n !== e)
98
- })), Z = (e, t, n) => N((r) => ({
97
+ })), Z = (e, t, n) => M((r) => ({
99
98
  ...r,
100
99
  stops: r.stops.map((r, i) => i === e ? {
101
100
  ...r,
102
101
  [t]: n
103
102
  } : r)
104
- })), Q = (e, t) => N((n) => {
103
+ })), Q = (e, t) => M((n) => {
105
104
  let r = e + t;
106
105
  if (r < 0 || r >= n.stops.length) return n;
107
106
  let i = [...n.stops];
@@ -110,16 +109,16 @@ function Y({ editId: r }) {
110
109
  stops: i
111
110
  };
112
111
  }), $ = async (e) => {
113
- if (e.preventDefault(), !j.name.trim()) {
112
+ if (e.preventDefault(), !A.name.trim()) {
114
113
  q("Route name is required.");
115
114
  return;
116
115
  }
117
- let t = j.stops.filter((e) => e.address.trim());
116
+ let t = A.stops.filter((e) => e.address.trim());
118
117
  if (t.length === 0) {
119
118
  q("Add at least one stop with an address.");
120
119
  return;
121
120
  }
122
- K(!0), q(null);
121
+ G(!0), q(null);
123
122
  try {
124
123
  let e = t.map((e, t) => ({
125
124
  id: `stop-${t + 1}`,
@@ -135,255 +134,257 @@ function Y({ editId: r }) {
135
134
  type: e.type,
136
135
  status: "pending"
137
136
  }));
138
- if (A) {
137
+ if (k) {
139
138
  let t = await l(r, {
140
- name: j.name.trim(),
141
- status: j.status,
142
- vehicleId: j.vehicleId || null,
143
- driverId: j.driverId || null,
139
+ name: A.name.trim(),
140
+ status: A.status,
141
+ vehicleId: A.vehicleId || null,
142
+ driverId: A.driverId || null,
144
143
  stops: e
145
144
  });
146
145
  a?.(f(i, `routes/${t.id}`));
147
146
  return;
148
147
  }
149
148
  let n = await ee({
150
- name: j.name.trim(),
151
- status: j.status,
152
- vehicleId: j.vehicleId || void 0,
153
- driverId: j.driverId || void 0,
149
+ name: A.name.trim(),
150
+ status: A.status,
151
+ vehicleId: A.vehicleId || void 0,
152
+ driverId: A.driverId || void 0,
154
153
  stops: e
155
154
  });
156
155
  a?.(f(i, `routes/${n.id}`));
157
156
  } catch (e) {
158
- console.error("Failed to create route:", e), q(e instanceof Error ? e.message : "Failed to create route. Please try again."), K(!1);
157
+ console.error("Failed to create route:", e), q(e instanceof Error ? e.message : "Failed to create route. Please try again."), G(!1);
159
158
  }
160
159
  };
161
- return /* @__PURE__ */ W(O, {
162
- title: A ? "Edit Route" : "Create Route",
160
+ return /* @__PURE__ */ V(se, {
161
+ title: k ? "Edit Route" : "Create Route",
163
162
  subtitle: "Plan a new delivery route",
164
- icon: /* @__PURE__ */ U(o, { size: 24 }),
165
- headerActions: /* @__PURE__ */ W("div", {
163
+ icon: /* @__PURE__ */ B(o, { size: 24 }),
164
+ headerActions: /* @__PURE__ */ V("div", {
166
165
  className: "flex gap-2",
167
- children: [/* @__PURE__ */ W(g, {
166
+ children: [/* @__PURE__ */ V(_, {
168
167
  variant: "outline",
169
- onClick: Y,
170
- disabled: G,
171
- children: [/* @__PURE__ */ U(t, { size: 16 }), " Cancel"]
172
- }), /* @__PURE__ */ W(g, {
168
+ onClick: J,
169
+ disabled: U,
170
+ children: [/* @__PURE__ */ B(t, { size: 16 }), " Cancel"]
171
+ }), /* @__PURE__ */ V(_, {
173
172
  onClick: $,
174
- disabled: G,
173
+ disabled: U,
175
174
  children: [
176
- /* @__PURE__ */ U(c, { size: 16 }),
175
+ /* @__PURE__ */ B(c, { size: 16 }),
177
176
  " ",
178
- A ? G ? "Saving..." : "Save Changes" : G ? "Saving..." : "Create Route"
177
+ k ? U ? "Saving..." : "Save Changes" : U ? "Saving..." : "Create Route"
179
178
  ]
180
179
  })]
181
180
  }),
182
- children: [/* @__PURE__ */ U(he, {
183
- icon: /* @__PURE__ */ U(o, { size: 18 }),
181
+ children: [/* @__PURE__ */ B(ye, {
182
+ icon: /* @__PURE__ */ B(o, { size: 18 }),
184
183
  children: "Plan a new delivery route — name it, list the stops to visit, and optionally assign a vehicle and driver. Once created you can optimize it to sequence the stops into the shortest run."
185
- }), /* @__PURE__ */ W("form", {
184
+ }), /* @__PURE__ */ V("form", {
186
185
  onSubmit: $,
187
186
  className: "max-w-3xl space-y-6",
188
187
  children: [
189
- /* @__PURE__ */ U(M, { message: ve }),
190
- /* @__PURE__ */ W(pe, { children: [/* @__PURE__ */ U("h2", {
188
+ /* @__PURE__ */ B(j, { message: K }),
189
+ /* @__PURE__ */ V(_e, { children: [/* @__PURE__ */ B("h2", {
191
190
  className: "text-base font-semibold text-text-primary mb-4",
192
191
  children: "Route Details"
193
- }), /* @__PURE__ */ W("div", {
192
+ }), /* @__PURE__ */ V("div", {
194
193
  className: "space-y-4",
195
- children: [/* @__PURE__ */ W("div", {
194
+ children: [/* @__PURE__ */ V("div", {
196
195
  className: "grid grid-cols-1 md:grid-cols-2 gap-4",
197
- children: [/* @__PURE__ */ W("div", {
196
+ children: [/* @__PURE__ */ V("div", {
198
197
  className: "space-y-2",
199
- children: [/* @__PURE__ */ W(S, {
198
+ children: [/* @__PURE__ */ V(C, {
200
199
  htmlFor: "name",
201
- children: ["Route Name ", /* @__PURE__ */ U("span", {
200
+ children: ["Route Name ", /* @__PURE__ */ B("span", {
202
201
  className: "text-status-error-text",
203
202
  children: "*"
204
203
  })]
205
- }), /* @__PURE__ */ U(x, {
204
+ }), /* @__PURE__ */ B(S, {
206
205
  id: "name",
207
- value: j.name,
208
- onChange: (e) => N((t) => ({
206
+ value: A.name,
207
+ onChange: (e) => M((t) => ({
209
208
  ...t,
210
209
  name: e.target.value
211
210
  })),
212
211
  placeholder: "Downtown morning run",
213
212
  required: !0
214
213
  })]
215
- }), /* @__PURE__ */ W("div", {
214
+ }), /* @__PURE__ */ V("div", {
216
215
  className: "space-y-2",
217
- children: [/* @__PURE__ */ U(S, {
216
+ children: [/* @__PURE__ */ B(C, {
218
217
  htmlFor: "status",
219
218
  children: "Status"
220
- }), /* @__PURE__ */ W(C, {
221
- value: j.status,
222
- onValueChange: (e) => N((t) => ({
219
+ }), /* @__PURE__ */ V(w, {
220
+ value: A.status,
221
+ onValueChange: (e) => M((t) => ({
223
222
  ...t,
224
223
  status: e
225
224
  })),
226
- children: [/* @__PURE__ */ U(E, {
225
+ children: [/* @__PURE__ */ B(D, {
227
226
  id: "status",
228
- children: /* @__PURE__ */ U(D, {})
229
- }), /* @__PURE__ */ U(w, { children: J.map((e) => /* @__PURE__ */ U(T, {
227
+ children: /* @__PURE__ */ B(O, {})
228
+ }), /* @__PURE__ */ B(T, { children: W.map((e) => /* @__PURE__ */ B(E, {
230
229
  value: e.value,
231
230
  children: e.label
232
231
  }, e.value)) })]
233
232
  })]
234
233
  })]
235
- }), /* @__PURE__ */ W("div", {
234
+ }), /* @__PURE__ */ V("div", {
236
235
  className: "grid grid-cols-1 md:grid-cols-2 gap-4",
237
- children: [/* @__PURE__ */ W("div", {
236
+ children: [/* @__PURE__ */ V("div", {
238
237
  className: "space-y-2",
239
- children: [/* @__PURE__ */ U(S, {
238
+ children: [/* @__PURE__ */ B(C, {
240
239
  htmlFor: "vehicle",
241
240
  children: "Vehicle (optional)"
242
- }), /* @__PURE__ */ U(I, {
241
+ }), /* @__PURE__ */ B(F, {
243
242
  id: "vehicle",
244
- value: j.vehicleId,
245
- onChange: (e) => N((t) => ({
243
+ value: A.vehicleId,
244
+ onChange: (e) => M((t) => ({
246
245
  ...t,
247
246
  vehicleId: e
248
247
  })),
249
- options: ce,
250
- loading: le,
248
+ options: le,
249
+ loading: ue,
251
250
  getId: (e) => e.id,
252
251
  getLabel: (e) => `${e.vehicleNumber} (${e.type})`,
253
- renderOption: (e) => /* @__PURE__ */ W(H, { children: [
252
+ renderOption: (e) => /* @__PURE__ */ V(z, { children: [
254
253
  e.vehicleNumber,
255
254
  " (",
256
255
  e.type,
257
256
  ")"
258
257
  ] }),
259
- selectedOption: fe,
260
- selectedLoading: me,
261
- onSearchChange: oe,
258
+ selectedOption: be,
259
+ selectedLoading: xe,
260
+ onSearchChange: ae,
262
261
  searchPlaceholder: "Search vehicle number or type…",
263
- hasMore: F,
264
- totalCount: L,
265
- required: !0,
262
+ hasMore: P,
263
+ totalCount: de,
264
+ onLoadMore: fe,
265
+ loadingMore: pe,
266
266
  placeholder: "Assign later",
267
267
  emptyText: "No available vehicles."
268
268
  })]
269
- }), /* @__PURE__ */ W("div", {
269
+ }), /* @__PURE__ */ V("div", {
270
270
  className: "space-y-2",
271
- children: [/* @__PURE__ */ U(S, {
271
+ children: [/* @__PURE__ */ B(C, {
272
272
  htmlFor: "driver",
273
273
  children: "Driver (optional)"
274
- }), /* @__PURE__ */ U(I, {
274
+ }), /* @__PURE__ */ B(F, {
275
275
  id: "driver",
276
- value: j.driverId,
277
- onChange: (e) => N((t) => ({
276
+ value: A.driverId,
277
+ onChange: (e) => M((t) => ({
278
278
  ...t,
279
279
  driverId: e
280
280
  })),
281
- options: ue,
282
- loading: de,
281
+ options: me,
282
+ loading: R,
283
283
  getId: (e) => e.id,
284
284
  getLabel: (e) => `${e.fullName} (${e.employeeId})`,
285
- renderOption: (e) => /* @__PURE__ */ W(H, { children: [
285
+ renderOption: (e) => /* @__PURE__ */ V(z, { children: [
286
286
  e.fullName,
287
287
  " (",
288
288
  e.employeeId,
289
289
  ")"
290
290
  ] }),
291
- selectedOption: ge,
292
- selectedLoading: _e,
293
- onSearchChange: k,
291
+ selectedOption: Se,
292
+ selectedLoading: Ce,
293
+ onSearchChange: ce,
294
294
  searchPlaceholder: "Search driver name or employee ID…",
295
- hasMore: B,
296
- totalCount: V,
297
- required: !0,
295
+ hasMore: he,
296
+ totalCount: ge,
297
+ onLoadMore: ve,
298
+ loadingMore: H,
298
299
  placeholder: "Assign later",
299
300
  emptyText: "No available drivers."
300
301
  })]
301
302
  })]
302
303
  })]
303
304
  })] }),
304
- /* @__PURE__ */ W(_, { children: [/* @__PURE__ */ W(y, {
305
+ /* @__PURE__ */ V(v, { children: [/* @__PURE__ */ V(b, {
305
306
  className: "flex flex-row items-center justify-between",
306
- children: [/* @__PURE__ */ W(b, { children: ["Stops ", /* @__PURE__ */ U("span", {
307
+ children: [/* @__PURE__ */ V(x, { children: ["Stops ", /* @__PURE__ */ B("span", {
307
308
  className: "text-status-error-text",
308
309
  children: "*"
309
- })] }), /* @__PURE__ */ W(g, {
310
+ })] }), /* @__PURE__ */ V(_, {
310
311
  type: "button",
311
312
  variant: "outline",
312
313
  size: "sm",
313
- onClick: X,
314
- children: [/* @__PURE__ */ U(s, { size: 16 }), " Add Stop"]
314
+ onClick: Y,
315
+ children: [/* @__PURE__ */ B(s, { size: 16 }), " Add Stop"]
315
316
  })]
316
- }), /* @__PURE__ */ U(v, {
317
+ }), /* @__PURE__ */ B(y, {
317
318
  className: "space-y-4",
318
- children: j.stops.map((t, r) => /* @__PURE__ */ W("div", {
319
+ children: A.stops.map((t, r) => /* @__PURE__ */ V("div", {
319
320
  className: "grid grid-cols-1 md:grid-cols-12 gap-3 items-end",
320
321
  children: [
321
- /* @__PURE__ */ W("div", {
322
+ /* @__PURE__ */ V("div", {
322
323
  className: "md:col-span-7 space-y-2",
323
- children: [/* @__PURE__ */ W(S, {
324
+ children: [/* @__PURE__ */ V(C, {
324
325
  htmlFor: `stop-address-${r}`,
325
326
  children: [
326
327
  "Stop ",
327
328
  r + 1,
328
329
  " address"
329
330
  ]
330
- }), /* @__PURE__ */ U(x, {
331
+ }), /* @__PURE__ */ B(S, {
331
332
  id: `stop-address-${r}`,
332
333
  value: t.address,
333
334
  onChange: (e) => Z(r, "address", e.target.value),
334
335
  placeholder: "123 Main St, San Francisco, CA"
335
336
  })]
336
337
  }),
337
- /* @__PURE__ */ W("div", {
338
+ /* @__PURE__ */ V("div", {
338
339
  className: "md:col-span-4 space-y-2",
339
- children: [/* @__PURE__ */ U(S, {
340
+ children: [/* @__PURE__ */ B(C, {
340
341
  htmlFor: `stop-type-${r}`,
341
342
  children: "Type"
342
- }), /* @__PURE__ */ W(C, {
343
+ }), /* @__PURE__ */ V(w, {
343
344
  value: t.type,
344
345
  onValueChange: (e) => Z(r, "type", e),
345
- children: [/* @__PURE__ */ U(E, {
346
+ children: [/* @__PURE__ */ B(D, {
346
347
  id: `stop-type-${r}`,
347
- children: /* @__PURE__ */ U(D, {})
348
- }), /* @__PURE__ */ W(w, { children: [/* @__PURE__ */ U(T, {
348
+ children: /* @__PURE__ */ B(O, {})
349
+ }), /* @__PURE__ */ V(T, { children: [/* @__PURE__ */ B(E, {
349
350
  value: "pickup",
350
351
  children: "Pickup"
351
- }), /* @__PURE__ */ U(T, {
352
+ }), /* @__PURE__ */ B(E, {
352
353
  value: "delivery",
353
354
  children: "Delivery"
354
355
  })] })]
355
356
  })]
356
357
  }),
357
- /* @__PURE__ */ W("div", {
358
+ /* @__PURE__ */ V("div", {
358
359
  className: "md:col-span-1 flex justify-end gap-1",
359
360
  children: [
360
- /* @__PURE__ */ U(g, {
361
+ /* @__PURE__ */ B(_, {
361
362
  type: "button",
362
363
  variant: "ghost",
363
364
  size: "icon",
364
365
  onClick: () => Q(r, -1),
365
366
  disabled: r === 0,
366
367
  "aria-label": `Move stop ${r + 1} up`,
367
- children: /* @__PURE__ */ U(n, { size: 16 })
368
+ children: /* @__PURE__ */ B(n, { size: 16 })
368
369
  }),
369
- /* @__PURE__ */ U(g, {
370
+ /* @__PURE__ */ B(_, {
370
371
  type: "button",
371
372
  variant: "ghost",
372
373
  size: "icon",
373
374
  onClick: () => Q(r, 1),
374
- disabled: r === j.stops.length - 1,
375
+ disabled: r === A.stops.length - 1,
375
376
  "aria-label": `Move stop ${r + 1} down`,
376
- children: /* @__PURE__ */ U(e, { size: 16 })
377
+ children: /* @__PURE__ */ B(e, { size: 16 })
377
378
  }),
378
- /* @__PURE__ */ U(g, {
379
+ /* @__PURE__ */ B(_, {
379
380
  type: "button",
380
381
  variant: "ghost",
381
382
  size: "icon",
382
383
  className: "text-status-error-text",
383
- onClick: () => ye(r),
384
- disabled: j.stops.length === 1,
384
+ onClick: () => X(r),
385
+ disabled: A.stops.length === 1,
385
386
  "aria-label": `Remove stop ${r + 1}`,
386
- children: /* @__PURE__ */ U(u, { size: 16 })
387
+ children: /* @__PURE__ */ B(u, { size: 16 })
387
388
  })
388
389
  ]
389
390
  })
@@ -394,195 +395,197 @@ function Y({ editId: r }) {
394
395
  })]
395
396
  });
396
397
  }
397
- function X() {
398
- let { routeId: e } = V(), n = B().pathname.endsWith("/edit"), { basePath: s, navigate: c } = te(), { route: p, isLoading: ie, error: ae, refetch: m } = ne(e), { optimizeRoute: x, updateRoute: S, deleteRoute: C } = re(), w = ue(e), { t: T } = fe(), E = (e, t) => {
399
- let n = T(e);
398
+ function K() {
399
+ let { routeId: e } = he(), n = R().pathname.endsWith("/edit"), { basePath: s, navigate: c } = p(), { route: m, isLoading: re, error: ie, refetch: h } = te(e);
400
+ fe(n, h);
401
+ let { optimizeRoute: S, updateRoute: C, deleteRoute: w } = ne(), T = pe(e), { t: E } = ge(), D = (e, t) => {
402
+ let n = E(e);
400
403
  return n === e ? t : n;
401
- }, { message: D, notify: I } = ce(), [R, H] = z(null), [J, X] = z(!1), [ye, Z] = z(!1), [Q, $] = z(!1), [be, xe] = z(null), Se = () => c?.(f(s, "routes")), Ce = (e) => c?.(f(s, e)), we = async () => {
404
+ }, { message: O, notify: F } = le(), [I, z] = L(null), [W, K] = L(!1), [q, J] = L(!1), [Y, X] = L(!1), [Z, Q] = L(null), $ = () => c?.(f(s, "routes")), we = (e) => c?.(f(s, e)), Te = async () => {
402
405
  if (e) {
403
- $(!0), xe(null);
406
+ X(!0), Q(null);
404
407
  try {
405
- await C(e), Z(!1), Se();
408
+ await w(e), J(!1), $();
406
409
  } catch (e) {
407
- xe(e instanceof Error ? e.message : "Failed to delete route."), $(!1);
410
+ Q(e instanceof Error ? e.message : "Failed to delete route."), X(!1);
408
411
  }
409
412
  }
410
- }, Te = async () => {
413
+ }, Ee = async () => {
411
414
  if (e) {
412
- X(!0), H(null);
415
+ K(!0), z(null);
413
416
  try {
414
- await x(e), I("Route optimized — stops resequenced for the shortest run."), m();
417
+ await S(e), F("Route optimized — stops resequenced for the shortest run."), h();
415
418
  } catch (e) {
416
- H(e instanceof Error ? e.message : "Failed to optimize route.");
419
+ z(e instanceof Error ? e.message : "Failed to optimize route.");
417
420
  } finally {
418
- X(!1);
421
+ K(!1);
419
422
  }
420
423
  }
421
- }, Ee = async (t) => {
422
- e && (await S(e, t), I(E("movethewheels.routes.suggest.done", "Assignment saved.")), m(), w.refetch());
424
+ }, De = async (t) => {
425
+ e && (await C(e, t), F(D("movethewheels.routes.suggest.done", "Assignment saved.")), h(), T.refetch());
423
426
  };
424
- if (!e) return /* @__PURE__ */ U(Y, {});
425
- if (n) return /* @__PURE__ */ U(Y, { editId: e });
426
- if (ie) return /* @__PURE__ */ U(se, { message: "Loading route details..." });
427
- if (ae || !p) return /* @__PURE__ */ U(oe, {
427
+ if (!e) return /* @__PURE__ */ B(G, {});
428
+ if (n) return /* @__PURE__ */ B(G, { editId: e });
429
+ if (re) return /* @__PURE__ */ B(oe, { message: "Loading route details..." });
430
+ if (ie || !m) return /* @__PURE__ */ B(ae, {
428
431
  title: "Route not found",
429
- onRetry: m
432
+ onRetry: h
430
433
  });
431
- let De = p.stops.map((e) => {
432
- let t = L(e.address);
434
+ let Oe = m.stops.map((e) => {
435
+ let t = de(e.address);
433
436
  return t ? {
434
437
  lat: t.lat,
435
438
  lng: t.lng,
436
439
  sequence: e.sequence,
437
- label: P(e.address) || `Order #${e.orderId || e.sequence}`
440
+ label: N(e.address) || `Order #${e.orderId || e.sequence}`
438
441
  } : null;
439
442
  }).filter((e) => e !== null);
440
- return /* @__PURE__ */ W(O, {
441
- title: p.name,
442
- subtitle: `${p.stops.length} stops - ${p.distance.toFixed(1)} km`,
443
- icon: /* @__PURE__ */ U(o, { size: 24 }),
444
- headerActions: /* @__PURE__ */ W("div", {
443
+ return /* @__PURE__ */ V(se, {
444
+ title: m.name,
445
+ subtitle: `${m.stops.length} stops - ${m.distance.toFixed(1)} km`,
446
+ icon: /* @__PURE__ */ B(o, { size: 24 }),
447
+ headerActions: /* @__PURE__ */ V("div", {
445
448
  className: "flex gap-2",
446
449
  children: [
447
- /* @__PURE__ */ W(g, {
450
+ /* @__PURE__ */ V(_, {
448
451
  variant: "outline",
449
- onClick: Se,
450
- children: [/* @__PURE__ */ U(t, { size: 16 }), " Back"]
452
+ onClick: $,
453
+ children: [/* @__PURE__ */ B(t, { size: 16 }), " Back"]
451
454
  }),
452
- !p.optimized && /* @__PURE__ */ W(g, {
455
+ !m.optimized && /* @__PURE__ */ V(_, {
453
456
  variant: "outline",
454
- onClick: Te,
455
- disabled: J,
457
+ onClick: Ee,
458
+ disabled: W,
456
459
  children: [
457
- /* @__PURE__ */ U(d, { size: 16 }),
460
+ /* @__PURE__ */ B(d, { size: 16 }),
458
461
  " ",
459
- J ? "Optimizing…" : "Optimize"
462
+ W ? "Optimizing…" : "Optimize"
460
463
  ]
461
464
  }),
462
- /* @__PURE__ */ W(g, {
465
+ /* @__PURE__ */ V(_, {
463
466
  onClick: () => c?.(f(s, `routes/${e}/edit`)),
464
- children: [/* @__PURE__ */ U(l, { size: 16 }), " Edit"]
467
+ children: [/* @__PURE__ */ B(l, { size: 16 }), " Edit"]
465
468
  })
466
469
  ]
467
470
  }),
468
- headerContent: /* @__PURE__ */ W("div", {
471
+ headerContent: /* @__PURE__ */ V("div", {
469
472
  className: "flex gap-2",
470
- children: [/* @__PURE__ */ U(j, {
471
- status: p.status,
472
- customColors: A[p.status]
473
- }), /* @__PURE__ */ U(h, {
474
- variant: p.optimized === !0 ? "default" : "secondary",
475
- children: p.optimized === void 0 ? "Optimization unknown" : p.optimized ? "Optimized" : "Not Optimized"
473
+ children: [/* @__PURE__ */ B(A, {
474
+ status: m.status,
475
+ customColors: k[m.status]
476
+ }), /* @__PURE__ */ B(g, {
477
+ variant: m.optimized === !0 ? "default" : "secondary",
478
+ children: m.optimized === void 0 ? "Optimization unknown" : m.optimized ? "Optimized" : "Not Optimized"
476
479
  })]
477
480
  }),
478
481
  children: [
479
- /* @__PURE__ */ U(he, {
480
- icon: /* @__PURE__ */ U(o, { size: 18 }),
482
+ /* @__PURE__ */ B(ye, {
483
+ icon: /* @__PURE__ */ B(o, { size: 18 }),
481
484
  children: "A single optimized driving plan that chains together this route's stops. Review the sequence, distance and timing here, re-optimize if traffic or stops change, then hand the itinerary to a driver."
482
485
  }),
483
- /* @__PURE__ */ U(me, {
486
+ /* @__PURE__ */ B(ve, {
484
487
  storageKey: "movethewheels-route-details",
485
488
  steps: [
486
- ...p.optimized ? [] : [{
489
+ ...m.optimized ? [] : [{
487
490
  id: "optimize",
488
491
  label: "Optimize this route",
489
492
  description: "Reorder stops to cut distance and driving time.",
490
- icon: /* @__PURE__ */ U(d, { size: 16 }),
491
- onClick: Te
493
+ icon: /* @__PURE__ */ B(d, { size: 16 }),
494
+ onClick: Ee
492
495
  }],
493
496
  {
494
497
  id: "edit",
495
498
  label: "Adjust stops",
496
499
  description: "Add, remove or reorder the delivery stops.",
497
- icon: /* @__PURE__ */ U(l, { size: 16 }),
500
+ icon: /* @__PURE__ */ B(l, { size: 16 }),
498
501
  onClick: () => {}
499
502
  },
500
503
  {
501
504
  id: "orders",
502
505
  label: "Review the orders on this route",
503
506
  description: "Check the deliveries bundled into this run.",
504
- icon: /* @__PURE__ */ U(ee, { size: 16 }),
505
- onClick: () => Ce("orders")
507
+ icon: /* @__PURE__ */ B(ee, { size: 16 }),
508
+ onClick: () => we("orders")
506
509
  }
507
510
  ]
508
511
  }),
509
- R && /* @__PURE__ */ U("div", {
512
+ I && /* @__PURE__ */ B("div", {
510
513
  className: "mb-2",
511
- children: /* @__PURE__ */ U(M, { message: R })
514
+ children: /* @__PURE__ */ B(j, { message: I })
512
515
  }),
513
- D && /* @__PURE__ */ U("div", {
516
+ O && /* @__PURE__ */ B("div", {
514
517
  className: "mb-2",
515
- children: /* @__PURE__ */ U(N, { message: D })
518
+ children: /* @__PURE__ */ B(M, { message: O })
516
519
  }),
517
- /* @__PURE__ */ W("div", {
520
+ /* @__PURE__ */ V("div", {
518
521
  className: "grid grid-cols-1 lg:grid-cols-3 gap-6",
519
- children: [/* @__PURE__ */ W("div", {
522
+ children: [/* @__PURE__ */ V("div", {
520
523
  className: "lg:col-span-2 space-y-6",
521
- children: [/* @__PURE__ */ W(_, { children: [/* @__PURE__ */ U(y, { children: /* @__PURE__ */ U(b, { children: "Route Map" }) }), /* @__PURE__ */ U(v, { children: De.length > 0 ? /* @__PURE__ */ U(k, {
524
+ children: [/* @__PURE__ */ V(v, { children: [/* @__PURE__ */ B(b, { children: /* @__PURE__ */ B(x, { children: "Route Map" }) }), /* @__PURE__ */ B(y, { children: Oe.length > 0 ? /* @__PURE__ */ B(ce, {
522
525
  className: "overflow-hidden rounded-lg border border-border-seam",
523
526
  height: 360,
524
- stops: De
525
- }) : /* @__PURE__ */ W("div", {
527
+ stops: Oe
528
+ }) : /* @__PURE__ */ V("div", {
526
529
  className: "rounded-lg border border-border-seam bg-bg-sunken/40 p-4",
527
- children: [/* @__PURE__ */ U("p", {
530
+ children: [/* @__PURE__ */ B("p", {
528
531
  className: "mb-3 text-sm text-text-secondary",
529
532
  children: "These stops don't have map coordinates yet — showing the planned sequence instead."
530
- }), /* @__PURE__ */ U("ol", {
533
+ }), /* @__PURE__ */ B("ol", {
531
534
  className: "space-y-2",
532
- children: p.stops.map((e) => /* @__PURE__ */ W("li", {
535
+ children: m.stops.map((e) => /* @__PURE__ */ V("li", {
533
536
  className: "flex items-start gap-3",
534
- children: [/* @__PURE__ */ U("span", {
537
+ children: [/* @__PURE__ */ B("span", {
535
538
  className: "flex h-6 w-6 shrink-0 items-center justify-center rounded-full bg-action-primary-bg/10 text-xs font-semibold text-primary",
536
539
  children: e.sequence
537
- }), /* @__PURE__ */ U("span", {
540
+ }), /* @__PURE__ */ B("span", {
538
541
  className: "text-sm",
539
- children: P(e.address) || `Order #${e.orderId || e.sequence}`
542
+ children: N(e.address) || `Order #${e.orderId || e.sequence}`
540
543
  })]
541
544
  }, e.id))
542
545
  })]
543
- }) })] }), /* @__PURE__ */ W(_, { children: [/* @__PURE__ */ U(y, { children: /* @__PURE__ */ W(b, { children: [
546
+ }) })] }), /* @__PURE__ */ V(v, { children: [/* @__PURE__ */ B(b, { children: /* @__PURE__ */ V(x, { children: [
544
547
  "Stops (",
545
- p.stops.length,
548
+ m.stops.length,
546
549
  ")"
547
- ] }) }), /* @__PURE__ */ U(v, { children: /* @__PURE__ */ U("div", {
550
+ ] }) }), /* @__PURE__ */ B(y, { children: /* @__PURE__ */ B("div", {
548
551
  className: "space-y-4",
549
- children: p.stops.map((e, t) => /* @__PURE__ */ W("div", {
552
+ children: m.stops.map((e, t) => /* @__PURE__ */ V("div", {
550
553
  className: "flex gap-4",
551
- children: [/* @__PURE__ */ W("div", {
554
+ children: [/* @__PURE__ */ V("div", {
552
555
  className: "relative",
553
- children: [/* @__PURE__ */ U("div", {
556
+ children: [/* @__PURE__ */ B("div", {
554
557
  className: `w-8 h-8 rounded-full flex items-center justify-center ${e.status === "completed" ? "bg-status-success-text text-text-inverse" : "bg-bg-sunken"}`,
555
- children: e.status === "completed" ? /* @__PURE__ */ U(r, { size: 16 }) : e.sequence
556
- }), t < p.stops.length - 1 && /* @__PURE__ */ U("div", { className: "absolute top-8 left-4 w-px h-12 bg-border" })]
557
- }), /* @__PURE__ */ U("div", {
558
+ children: e.status === "completed" ? /* @__PURE__ */ B(r, { size: 16 }) : e.sequence
559
+ }), t < m.stops.length - 1 && /* @__PURE__ */ B("div", { className: "absolute top-8 left-4 w-px h-12 bg-border" })]
560
+ }), /* @__PURE__ */ B("div", {
558
561
  className: "flex-1 pb-4",
559
- children: /* @__PURE__ */ W("div", {
562
+ children: /* @__PURE__ */ V("div", {
560
563
  className: "flex items-center justify-between",
561
- children: [/* @__PURE__ */ W("div", { children: [/* @__PURE__ */ W("div", {
564
+ children: [/* @__PURE__ */ V("div", { children: [/* @__PURE__ */ V("div", {
562
565
  className: "flex items-center gap-2",
563
- children: [/* @__PURE__ */ U(h, {
566
+ children: [/* @__PURE__ */ B(g, {
564
567
  variant: e.type === "pickup" ? "secondary" : "default",
565
568
  className: "capitalize",
566
569
  children: e.type
567
- }), /* @__PURE__ */ W("span", {
570
+ }), /* @__PURE__ */ V("span", {
568
571
  className: "font-medium",
569
572
  children: ["Order #", e.orderId]
570
573
  })]
571
- }), /* @__PURE__ */ U("p", {
574
+ }), /* @__PURE__ */ B("p", {
572
575
  className: "text-sm text-text-secondary mt-1",
573
- children: P(e.address)
574
- })] }), /* @__PURE__ */ W("div", {
576
+ children: N(e.address)
577
+ })] }), /* @__PURE__ */ V("div", {
575
578
  className: "text-right",
576
579
  children: [
577
- /* @__PURE__ */ U("p", {
580
+ /* @__PURE__ */ B("p", {
578
581
  className: "text-sm",
579
- children: e.scheduledTime ? `Scheduled: ${F(e.scheduledTime, "time")}` : "Scheduled: Not provided"
582
+ children: e.scheduledTime ? `Scheduled: ${P(e.scheduledTime, "time")}` : "Scheduled: Not provided"
580
583
  }),
581
- e.actualTime && /* @__PURE__ */ W("p", {
584
+ e.actualTime && /* @__PURE__ */ V("p", {
582
585
  className: "text-sm text-status-success-text",
583
- children: ["Actual: ", F(e.actualTime, "time")]
586
+ children: ["Actual: ", P(e.actualTime, "time")]
584
587
  }),
585
- /* @__PURE__ */ U("p", {
588
+ /* @__PURE__ */ B("p", {
586
589
  className: "text-xs text-text-secondary",
587
590
  children: e.duration === void 0 ? "Duration not provided" : `${e.duration} min stop`
588
591
  })
@@ -592,116 +595,116 @@ function X() {
592
595
  })]
593
596
  }, e.id))
594
597
  }) })] })]
595
- }), /* @__PURE__ */ W("div", {
598
+ }), /* @__PURE__ */ V("div", {
596
599
  className: "space-y-6",
597
600
  children: [
598
- (p.status === "planned" || p.status === "in_progress") && /* @__PURE__ */ U(de, {
599
- suggestions: w.data,
600
- isLoading: w.isLoading,
601
- error: w.error,
602
- onRetry: w.refetch,
603
- assignedVehicleId: p.vehicleId || void 0,
604
- assignedDriverId: p.driverId || void 0,
605
- onAssign: Ee,
606
- t: E
601
+ (m.status === "planned" || m.status === "in_progress") && /* @__PURE__ */ B(me, {
602
+ suggestions: T.data,
603
+ isLoading: T.isLoading,
604
+ error: T.error,
605
+ onRetry: T.refetch,
606
+ assignedVehicleId: m.vehicleId || void 0,
607
+ assignedDriverId: m.driverId || void 0,
608
+ onAssign: De,
609
+ t: D
607
610
  }),
608
- /* @__PURE__ */ W(pe, {
611
+ /* @__PURE__ */ V(_e, {
609
612
  className: "space-y-4",
610
613
  children: [
611
- /* @__PURE__ */ U("h2", {
614
+ /* @__PURE__ */ B("h2", {
612
615
  className: "text-base font-semibold text-text-primary",
613
616
  children: "Route Info"
614
617
  }),
615
- /* @__PURE__ */ W("div", { children: [/* @__PURE__ */ U("p", {
618
+ /* @__PURE__ */ V("div", { children: [/* @__PURE__ */ B("p", {
616
619
  className: "text-sm text-text-secondary",
617
620
  children: "Total Distance"
618
- }), /* @__PURE__ */ W("p", {
621
+ }), /* @__PURE__ */ V("p", {
619
622
  className: "text-2xl font-bold",
620
- children: [p.distance.toFixed(1), /* @__PURE__ */ U("span", {
623
+ children: [m.distance.toFixed(1), /* @__PURE__ */ B("span", {
621
624
  className: "text-sm font-normal",
622
625
  children: " km"
623
626
  })]
624
627
  })] }),
625
- /* @__PURE__ */ W("div", { children: [/* @__PURE__ */ U("p", {
628
+ /* @__PURE__ */ V("div", { children: [/* @__PURE__ */ B("p", {
626
629
  className: "text-sm text-text-secondary",
627
630
  children: "Est. Duration"
628
- }), /* @__PURE__ */ W("p", {
631
+ }), /* @__PURE__ */ V("p", {
629
632
  className: "text-2xl font-bold",
630
- children: [p.estimatedDuration, /* @__PURE__ */ U("span", {
633
+ children: [m.estimatedDuration, /* @__PURE__ */ B("span", {
631
634
  className: "text-sm font-normal",
632
635
  children: " min"
633
636
  })]
634
637
  })] }),
635
- p.fuelCost !== void 0 && /* @__PURE__ */ W("div", { children: [/* @__PURE__ */ W("p", {
638
+ m.fuelCost !== void 0 && /* @__PURE__ */ V("div", { children: [/* @__PURE__ */ V("p", {
636
639
  className: "text-sm text-text-secondary flex items-center gap-1",
637
- children: [/* @__PURE__ */ U(a, { size: 14 }), " Est. Fuel Cost"]
638
- }), /* @__PURE__ */ U("p", {
640
+ children: [/* @__PURE__ */ B(a, { size: 14 }), " Est. Fuel Cost"]
641
+ }), /* @__PURE__ */ B("p", {
639
642
  className: "text-2xl font-bold",
640
- children: le(p.fuelCost)
643
+ children: ue(m.fuelCost)
641
644
  })] }),
642
- p.actualDuration && /* @__PURE__ */ W("div", { children: [/* @__PURE__ */ U("p", {
645
+ m.actualDuration && /* @__PURE__ */ V("div", { children: [/* @__PURE__ */ B("p", {
643
646
  className: "text-sm text-text-secondary",
644
647
  children: "Actual Duration"
645
- }), /* @__PURE__ */ W("p", {
648
+ }), /* @__PURE__ */ V("p", {
646
649
  className: "text-2xl font-bold",
647
- children: [p.actualDuration, /* @__PURE__ */ U("span", {
650
+ children: [m.actualDuration, /* @__PURE__ */ B("span", {
648
651
  className: "text-sm font-normal",
649
652
  children: " min"
650
653
  })]
651
654
  })] })
652
655
  ]
653
656
  }),
654
- /* @__PURE__ */ W(_, { children: [/* @__PURE__ */ U(y, { children: /* @__PURE__ */ W(b, {
657
+ /* @__PURE__ */ V(v, { children: [/* @__PURE__ */ B(b, { children: /* @__PURE__ */ V(x, {
655
658
  className: "flex items-center gap-2",
656
- children: [/* @__PURE__ */ U(i, { size: 18 }), " Timeline"]
657
- }) }), /* @__PURE__ */ U(v, {
659
+ children: [/* @__PURE__ */ B(i, { size: 18 }), " Timeline"]
660
+ }) }), /* @__PURE__ */ B(y, {
658
661
  className: "space-y-3",
659
- children: /* @__PURE__ */ W("div", { children: [/* @__PURE__ */ U("p", {
662
+ children: /* @__PURE__ */ V("div", { children: [/* @__PURE__ */ B("p", {
660
663
  className: "text-sm text-text-secondary",
661
664
  children: "Created"
662
- }), /* @__PURE__ */ U("p", { children: F(p.createdAt, "full") })] })
665
+ }), /* @__PURE__ */ B("p", { children: P(m.createdAt, "full") })] })
663
666
  })] }),
664
- /* @__PURE__ */ W(_, {
667
+ /* @__PURE__ */ V(v, {
665
668
  className: "border-status-error-border",
666
- children: [/* @__PURE__ */ U(y, { children: /* @__PURE__ */ W(b, {
669
+ children: [/* @__PURE__ */ B(b, { children: /* @__PURE__ */ V(x, {
667
670
  className: "flex items-center gap-2 text-status-error-text",
668
- children: [/* @__PURE__ */ U(u, { size: 18 }), " Delete Route"]
669
- }) }), /* @__PURE__ */ W(v, { children: [/* @__PURE__ */ U("p", {
671
+ children: [/* @__PURE__ */ B(u, { size: 18 }), " Delete Route"]
672
+ }) }), /* @__PURE__ */ V(y, { children: [/* @__PURE__ */ B("p", {
670
673
  className: "mb-3 text-sm text-text-secondary",
671
674
  children: "Removes this route. It can no longer be dispatched. This cannot be undone from here."
672
- }), /* @__PURE__ */ W(g, {
675
+ }), /* @__PURE__ */ V(_, {
673
676
  variant: "outline",
674
677
  className: "border-status-error-border text-status-error-text hover:bg-status-error-bg-subtle",
675
- onClick: () => Z(!0),
676
- children: [/* @__PURE__ */ U(u, { size: 16 }), " Delete this route"]
678
+ onClick: () => J(!0),
679
+ children: [/* @__PURE__ */ B(u, { size: 16 }), " Delete this route"]
677
680
  })] })]
678
681
  })
679
682
  ]
680
683
  })]
681
684
  }),
682
- /* @__PURE__ */ U(ge, {
683
- open: ye,
684
- onOpenChange: Z,
685
- children: /* @__PURE__ */ W(_e, { children: [
686
- /* @__PURE__ */ W(ve, { children: [/* @__PURE__ */ U(q, { children: "Delete this route?" }), /* @__PURE__ */ W(G, { children: [
685
+ /* @__PURE__ */ B(H, {
686
+ open: q,
687
+ onOpenChange: J,
688
+ children: /* @__PURE__ */ V(be, { children: [
689
+ /* @__PURE__ */ V(Ce, { children: [/* @__PURE__ */ B(U, { children: "Delete this route?" }), /* @__PURE__ */ V(xe, { children: [
687
690
  "This removes ",
688
- p.name,
691
+ m.name,
689
692
  " and cannot be undone from here."
690
693
  ] })] }),
691
- /* @__PURE__ */ U("div", {
694
+ /* @__PURE__ */ B("div", {
692
695
  className: "px-1",
693
- children: /* @__PURE__ */ U(M, { message: be })
696
+ children: /* @__PURE__ */ B(j, { message: Z })
694
697
  }),
695
- /* @__PURE__ */ W(K, { children: [/* @__PURE__ */ U(g, {
698
+ /* @__PURE__ */ V(Se, { children: [/* @__PURE__ */ B(_, {
696
699
  variant: "outline",
697
- onClick: () => Z(!1),
698
- disabled: Q,
700
+ onClick: () => J(!1),
701
+ disabled: Y,
699
702
  children: "Cancel"
700
- }), /* @__PURE__ */ U(g, {
703
+ }), /* @__PURE__ */ B(_, {
701
704
  className: "bg-status-error-text text-text-inverse hover:opacity-90",
702
- onClick: we,
703
- disabled: Q,
704
- children: Q ? "Deleting..." : "Delete route"
705
+ onClick: Te,
706
+ disabled: Y,
707
+ children: Y ? "Deleting..." : "Delete route"
705
708
  })] })
706
709
  ] })
707
710
  })
@@ -709,4 +712,4 @@ function X() {
709
712
  });
710
713
  }
711
714
  //#endregion
712
- export { X as default };
715
+ export { K as default };