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