@burdenoff/microfe-movethewheels 2026.1117.1 → 2026.1123.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 (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 +1 -1
  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
@@ -3,32 +3,35 @@ import t from "../node_modules/lucide-react/dist/esm/icons/arrow-left.js";
3
3
  import n from "../node_modules/lucide-react/dist/esm/icons/map-pin.js";
4
4
  import r from "../node_modules/lucide-react/dist/esm/icons/fuel.js";
5
5
  import i from "../node_modules/lucide-react/dist/esm/icons/user-round.js";
6
- import a from "../node_modules/lucide-react/dist/esm/icons/square-pen.js";
7
- import o from "../node_modules/lucide-react/dist/esm/icons/save.js";
8
- import s from "../node_modules/lucide-react/dist/esm/icons/mail.js";
9
- import c from "../node_modules/lucide-react/dist/esm/icons/phone.js";
10
- import l from "../node_modules/lucide-react/dist/esm/icons/trash-2.js";
11
- import { ErrorState as u, LoadingState as d, PageLayout as f } from "../components/PageLayout.js";
6
+ import ee from "../node_modules/lucide-react/dist/esm/icons/square-pen.js";
7
+ import a from "../node_modules/lucide-react/dist/esm/icons/save.js";
8
+ import o from "../node_modules/lucide-react/dist/esm/icons/mail.js";
9
+ import te from "../node_modules/lucide-react/dist/esm/icons/phone.js";
10
+ import s from "../node_modules/lucide-react/dist/esm/icons/trash-2.js";
11
+ import c from "../node_modules/lucide-react/dist/esm/icons/wrench.js";
12
+ import l from "../node_modules/lucide-react/dist/esm/icons/activity.js";
13
+ import u from "../node_modules/lucide-react/dist/esm/icons/plus.js";
14
+ import { ErrorState as d, LoadingState as f, PageLayout as ne } from "../components/PageLayout.js";
12
15
  import { StatusBadge as p, VehicleTypeBadge as m } from "../components/StatusBadge.js";
13
- import { Avatar as h, AvatarFallback as g, Button as _, Card as v, CardContent as y, CardHeader as b, CardTitle as x, Input as S, Label as C, Progress as w, Select as T, SelectContent as E, SelectItem as D, SelectTrigger as O, SelectValue as k } from "../components/ui.js";
14
- import { toApiVehicleStatus as A, useFleet as j, useVehicle as M, useVehicleDrivers as N } from "../hooks/useFleet.js";
15
- import { VEHICLE_STATUS_LABELS as P } from "../constants/index.js";
16
- import { useRecordVehicleService as F } from "../hooks/useFleetIntelligence.js";
17
- import { useRefetchOnLeaveEdit as I } from "../hooks/useRefetchOnLeaveEdit.js";
18
- import { VehicleServiceCard as L } from "../components/VehicleServiceCard.js";
19
- import { useMoveTheWheels as R } from "../providers/MoveTheWheelsProvider.js";
20
- import { formatDate as z, formatWeight as B, getInitials as V } from "../utils/formatters.js";
21
- import { joinPath as H } from "../utils/navigation.js";
22
- import { FormError as U } from "../components/FormError.js";
23
- import { Notice as W, useNotice as ee } from "../components/Notice.js";
24
- import { DocumentsCard as te } from "../components/DocumentsCard.js";
25
- import { useEffect as G, useState as K } from "react";
26
- import { useLocation as ne, useParams as re } from "react-router";
27
- import { jsx as q, jsxs as J } from "react/jsx-runtime";
28
- import { useI18n as ie } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
29
- import { EmphasisPanel as Y, NextSteps as ae, PagePurpose as X, ResponsiveDialog as Z, ResponsiveDialogContent as Q, ResponsiveDialogDescription as $, ResponsiveDialogFooter as oe, ResponsiveDialogHeader as se, ResponsiveDialogTitle as ce } from "@burdenoff/fe-libs/ui";
16
+ import { Avatar as h, AvatarFallback as re, Button as g, Card as _, CardContent as v, CardHeader as y, CardTitle as b, Input as x, Label as S, Progress as C, Select as w, SelectContent as T, SelectItem as E, SelectTrigger as D, SelectValue as O } from "../components/ui.js";
17
+ import { toApiVehicleStatus as k, useFleet as A, useVehicle as j, useVehicleDrivers as M } from "../hooks/useFleet.js";
18
+ import { VEHICLE_STATUS_LABELS as N } from "../constants/index.js";
19
+ import { useRecordVehicleService as ie } from "../hooks/useFleetIntelligence.js";
20
+ import { useRefetchOnLeaveEdit as P } from "../hooks/useRefetchOnLeaveEdit.js";
21
+ import { VehicleServiceCard as ae } from "../components/VehicleServiceCard.js";
22
+ import { useMoveTheWheels as oe } from "../providers/MoveTheWheelsProvider.js";
23
+ import { formatDate as F, formatWeight as se, getInitials as ce } from "../utils/formatters.js";
24
+ import { joinPath as I } from "../utils/navigation.js";
25
+ import { FormError as L } from "../components/FormError.js";
26
+ import { Notice as le, useNotice as ue } from "../components/Notice.js";
27
+ import { DocumentsCard as de } from "../components/DocumentsCard.js";
28
+ import { useEffect as R, useState as z } from "react";
29
+ import { useLocation as fe, useParams as pe } from "react-router";
30
+ import { jsx as B, jsxs as V } from "react/jsx-runtime";
31
+ import { useI18n as me } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
32
+ import { EmphasisPanel as he, NextSteps as ge, PagePurpose as _e, ResponsiveDialog as H, ResponsiveDialogContent as ve, ResponsiveDialogDescription as ye, ResponsiveDialogFooter as be, ResponsiveDialogHeader as U, ResponsiveDialogTitle as W } from "@burdenoff/fe-libs/ui";
30
33
  // src/movethewheels/pages/VehicleDetailsPage.tsx
31
- var le = [
34
+ var G = [
32
35
  {
33
36
  value: "TRUCK",
34
37
  label: "Truck"
@@ -61,10 +64,10 @@ var le = [
61
64
  value: "DRONE",
62
65
  label: "Drone"
63
66
  }
64
- ], ue = Object.entries(P).map(([e, t]) => ({
67
+ ], K = Object.entries(N).map(([e, t]) => ({
65
68
  value: e,
66
69
  label: t
67
- })), de = [
70
+ })), q = [
68
71
  {
69
72
  value: "DIESEL",
70
73
  label: "Diesel"
@@ -85,7 +88,7 @@ var le = [
85
88
  value: "HYBRID",
86
89
  label: "Hybrid"
87
90
  }
88
- ], fe = [
91
+ ], J = [
89
92
  {
90
93
  value: "owned",
91
94
  label: "Owned"
@@ -99,8 +102,8 @@ var le = [
99
102
  label: "Rented"
100
103
  }
101
104
  ];
102
- function pe({ editId: n }) {
103
- let { basePath: r, navigate: i } = R(), { createVehicle: a, updateVehicle: s, deleteVehicle: c } = j(), { vehicle: u } = M(n), d = !!n, [p, m] = K({
105
+ function Y({ editId: n }) {
106
+ let { basePath: r, navigate: i } = oe(), { createVehicle: ee, updateVehicle: o, deleteVehicle: te } = A(), { vehicle: c } = j(n), l = !!n, [u, d] = z({
104
107
  vehicleNumber: "",
105
108
  type: "VAN",
106
109
  make: "",
@@ -114,181 +117,181 @@ function pe({ editId: n }) {
114
117
  capacityWeight: "",
115
118
  capacityVolume: "",
116
119
  capacityPallets: ""
117
- }), [h, g] = K(!1), [w, N] = K(null), [P, F] = K(!1), [I, L] = K(!1), [z, B] = K(null);
118
- G(() => {
119
- n && u && m({
120
- vehicleNumber: u.vehicleNumber ?? "",
121
- type: u.type ? u.type.toUpperCase() : "VAN",
122
- make: u.make ?? "",
123
- model: u.model ?? "",
124
- licensePlate: u.licensePlate ?? "",
125
- ownershipType: u.ownershipType ?? "",
126
- year: u.year ? String(u.year) : "",
127
- status: u.status,
128
- fuelType: u.fuelType ?? "",
129
- fuelEfficiencyLPer100Km: u.fuelEfficiencyLPer100Km === void 0 ? "" : String(u.fuelEfficiencyLPer100Km),
130
- capacityWeight: u.capacity.weight ? String(u.capacity.weight) : "",
131
- capacityVolume: u.capacity.volume ? String(u.capacity.volume) : "",
132
- capacityPallets: u.capacity.pallets ? String(u.capacity.pallets) : ""
120
+ }), [f, p] = z(!1), [m, h] = z(null), [re, C] = z(!1), [M, N] = z(!1), [ie, P] = z(null);
121
+ R(() => {
122
+ n && c && d({
123
+ vehicleNumber: c.vehicleNumber ?? "",
124
+ type: c.type ? c.type.toUpperCase() : "VAN",
125
+ make: c.make ?? "",
126
+ model: c.model ?? "",
127
+ licensePlate: c.licensePlate ?? "",
128
+ ownershipType: c.ownershipType ?? "",
129
+ year: c.year ? String(c.year) : "",
130
+ status: c.status,
131
+ fuelType: c.fuelType ?? "",
132
+ fuelEfficiencyLPer100Km: c.fuelEfficiencyLPer100Km === void 0 ? "" : String(c.fuelEfficiencyLPer100Km),
133
+ capacityWeight: c.capacity.weight ? String(c.capacity.weight) : "",
134
+ capacityVolume: c.capacity.volume ? String(c.capacity.volume) : "",
135
+ capacityPallets: c.capacity.pallets ? String(c.capacity.pallets) : ""
133
136
  });
134
- }, [n, u]);
135
- let V = () => i?.(H(r, "fleet/vehicles")), W = async (e) => {
136
- if (e.preventDefault(), !p.vehicleNumber.trim()) N("Vehicle number is required.");
137
+ }, [n, c]);
138
+ let ae = () => i?.(I(r, "fleet/vehicles")), F = async (e) => {
139
+ if (e.preventDefault(), !u.vehicleNumber.trim()) h("Vehicle number is required.");
137
140
  else {
138
- g(!0), N(null);
141
+ p(!0), h(null);
139
142
  try {
140
143
  let e = {
141
- vehicleNumber: p.vehicleNumber.trim(),
142
- type: p.type,
143
- make: p.make.trim() || void 0,
144
- model: p.model.trim() || void 0,
145
- licensePlate: p.licensePlate.trim() || void 0,
146
- ownershipType: p.ownershipType || void 0,
147
- year: p.year ? Number(p.year) : void 0,
148
- status: A(p.status),
149
- fuelType: p.fuelType || void 0,
150
- fuelEfficiencyLPer100Km: p.fuelEfficiencyLPer100Km ? Number(p.fuelEfficiencyLPer100Km) : void 0,
151
- capacity: p.capacityWeight || p.capacityVolume || p.capacityPallets ? {
152
- weight: p.capacityWeight ? Number(p.capacityWeight) : void 0,
153
- volume: p.capacityVolume ? Number(p.capacityVolume) : void 0,
154
- pallets: p.capacityPallets ? Number(p.capacityPallets) : void 0
144
+ vehicleNumber: u.vehicleNumber.trim(),
145
+ type: u.type,
146
+ make: u.make.trim() || void 0,
147
+ model: u.model.trim() || void 0,
148
+ licensePlate: u.licensePlate.trim() || void 0,
149
+ ownershipType: u.ownershipType || void 0,
150
+ year: u.year ? Number(u.year) : void 0,
151
+ status: k(u.status),
152
+ fuelType: u.fuelType || void 0,
153
+ fuelEfficiencyLPer100Km: u.fuelEfficiencyLPer100Km ? Number(u.fuelEfficiencyLPer100Km) : void 0,
154
+ capacity: u.capacityWeight || u.capacityVolume || u.capacityPallets ? {
155
+ weight: u.capacityWeight ? Number(u.capacityWeight) : void 0,
156
+ volume: u.capacityVolume ? Number(u.capacityVolume) : void 0,
157
+ pallets: u.capacityPallets ? Number(u.capacityPallets) : void 0
155
158
  } : void 0
156
159
  };
157
160
  if (n) {
158
- let t = await s(n, e);
159
- i?.(H(r, `fleet/vehicles/${t.id}`));
161
+ let t = await o(n, e);
162
+ i?.(I(r, `fleet/vehicles/${t.id}`));
160
163
  } else {
161
- let t = await a(e);
162
- i?.(H(r, `fleet/vehicles/${t.id}`));
164
+ let t = await ee(e);
165
+ i?.(I(r, `fleet/vehicles/${t.id}`));
163
166
  }
164
167
  } catch (e) {
165
- console.error("Failed to create vehicle:", e), N(e instanceof Error ? e.message : "Failed to create vehicle. Please try again."), g(!1);
168
+ console.error("Failed to create vehicle:", e), h(e instanceof Error ? e.message : "Failed to create vehicle. Please try again."), p(!1);
166
169
  }
167
170
  }
168
171
  };
169
- return /* @__PURE__ */ J(f, {
170
- title: d ? "Edit Vehicle" : "Add Vehicle",
172
+ return /* @__PURE__ */ V(ne, {
173
+ title: l ? "Edit Vehicle" : "Add Vehicle",
171
174
  subtitle: "Register a new vehicle in your fleet",
172
- icon: /* @__PURE__ */ q(e, { size: 24 }),
173
- headerActions: /* @__PURE__ */ J("div", {
175
+ icon: /* @__PURE__ */ B(e, { size: 24 }),
176
+ headerActions: /* @__PURE__ */ V("div", {
174
177
  className: "flex gap-2",
175
- children: [/* @__PURE__ */ J(_, {
178
+ children: [/* @__PURE__ */ V(g, {
176
179
  variant: "outline",
177
- onClick: V,
178
- disabled: h,
179
- children: [/* @__PURE__ */ q(t, { size: 16 }), " Cancel"]
180
- }), /* @__PURE__ */ J(_, {
181
- onClick: W,
182
- disabled: h,
180
+ onClick: ae,
181
+ disabled: f,
182
+ children: [/* @__PURE__ */ B(t, { size: 16 }), " Cancel"]
183
+ }), /* @__PURE__ */ V(g, {
184
+ onClick: F,
185
+ disabled: f,
183
186
  children: [
184
- /* @__PURE__ */ q(o, { size: 16 }),
187
+ /* @__PURE__ */ B(a, { size: 16 }),
185
188
  " ",
186
- d ? h ? "Saving..." : "Save Changes" : h ? "Saving..." : "Add Vehicle"
189
+ l ? f ? "Saving..." : "Save Changes" : f ? "Saving..." : "Add Vehicle"
187
190
  ]
188
191
  })]
189
192
  }),
190
193
  children: [
191
- /* @__PURE__ */ q(X, {
192
- icon: /* @__PURE__ */ q(e, { size: 18 }),
194
+ /* @__PURE__ */ B(_e, {
195
+ icon: /* @__PURE__ */ B(e, { size: 18 }),
193
196
  children: "Add a vehicle so it can be assigned to deliveries and routes. Give it a fleet number and type to start — make, model and plate help identify it on the road."
194
197
  }),
195
- /* @__PURE__ */ J("form", {
196
- onSubmit: W,
198
+ /* @__PURE__ */ V("form", {
199
+ onSubmit: F,
197
200
  className: "max-w-2xl space-y-6",
198
201
  children: [
199
- /* @__PURE__ */ q(U, { message: w }),
200
- /* @__PURE__ */ J(Y, { children: [/* @__PURE__ */ q("h2", {
202
+ /* @__PURE__ */ B(L, { message: m }),
203
+ /* @__PURE__ */ V(he, { children: [/* @__PURE__ */ B("h2", {
201
204
  className: "text-base font-semibold text-text-primary mb-4",
202
205
  children: "Vehicle Details"
203
- }), /* @__PURE__ */ J("div", {
206
+ }), /* @__PURE__ */ V("div", {
204
207
  className: "space-y-4",
205
208
  children: [
206
- /* @__PURE__ */ J("div", {
209
+ /* @__PURE__ */ V("div", {
207
210
  className: "grid grid-cols-1 md:grid-cols-2 gap-4",
208
- children: [/* @__PURE__ */ J("div", {
211
+ children: [/* @__PURE__ */ V("div", {
209
212
  className: "space-y-2",
210
- children: [/* @__PURE__ */ J(C, {
213
+ children: [/* @__PURE__ */ V(S, {
211
214
  htmlFor: "vehicleNumber",
212
- children: ["Vehicle Number ", /* @__PURE__ */ q("span", {
215
+ children: ["Vehicle Number ", /* @__PURE__ */ B("span", {
213
216
  className: "text-status-error-text",
214
217
  children: "*"
215
218
  })]
216
- }), /* @__PURE__ */ q(S, {
219
+ }), /* @__PURE__ */ B(x, {
217
220
  id: "vehicleNumber",
218
- value: p.vehicleNumber,
219
- onChange: (e) => m((t) => ({
221
+ value: u.vehicleNumber,
222
+ onChange: (e) => d((t) => ({
220
223
  ...t,
221
224
  vehicleNumber: e.target.value
222
225
  })),
223
226
  placeholder: "MTW-001",
224
227
  required: !0
225
228
  })]
226
- }), /* @__PURE__ */ J("div", {
229
+ }), /* @__PURE__ */ V("div", {
227
230
  className: "space-y-2",
228
- children: [/* @__PURE__ */ J(C, {
231
+ children: [/* @__PURE__ */ V(S, {
229
232
  htmlFor: "type",
230
- children: ["Type ", /* @__PURE__ */ q("span", {
233
+ children: ["Type ", /* @__PURE__ */ B("span", {
231
234
  className: "text-status-error-text",
232
235
  children: "*"
233
236
  })]
234
- }), /* @__PURE__ */ J(T, {
235
- value: p.type,
236
- onValueChange: (e) => m((t) => ({
237
+ }), /* @__PURE__ */ V(w, {
238
+ value: u.type,
239
+ onValueChange: (e) => d((t) => ({
237
240
  ...t,
238
241
  type: e
239
242
  })),
240
- children: [/* @__PURE__ */ q(O, {
243
+ children: [/* @__PURE__ */ B(D, {
241
244
  id: "type",
242
- children: /* @__PURE__ */ q(k, {})
243
- }), /* @__PURE__ */ q(E, { children: le.map((e) => /* @__PURE__ */ q(D, {
245
+ children: /* @__PURE__ */ B(O, {})
246
+ }), /* @__PURE__ */ B(T, { children: G.map((e) => /* @__PURE__ */ B(E, {
244
247
  value: e.value,
245
248
  children: e.label
246
249
  }, e.value)) })]
247
250
  })]
248
251
  })]
249
252
  }),
250
- /* @__PURE__ */ J("div", {
253
+ /* @__PURE__ */ V("div", {
251
254
  className: "grid grid-cols-1 md:grid-cols-3 gap-4",
252
255
  children: [
253
- /* @__PURE__ */ J("div", {
256
+ /* @__PURE__ */ V("div", {
254
257
  className: "space-y-2",
255
- children: [/* @__PURE__ */ q(C, {
258
+ children: [/* @__PURE__ */ B(S, {
256
259
  htmlFor: "make",
257
260
  children: "Make"
258
- }), /* @__PURE__ */ q(S, {
261
+ }), /* @__PURE__ */ B(x, {
259
262
  id: "make",
260
- value: p.make,
261
- onChange: (e) => m((t) => ({
263
+ value: u.make,
264
+ onChange: (e) => d((t) => ({
262
265
  ...t,
263
266
  make: e.target.value
264
267
  })),
265
268
  placeholder: "Ford"
266
269
  })]
267
270
  }),
268
- /* @__PURE__ */ J("div", {
271
+ /* @__PURE__ */ V("div", {
269
272
  className: "space-y-2",
270
- children: [/* @__PURE__ */ q(C, {
273
+ children: [/* @__PURE__ */ B(S, {
271
274
  htmlFor: "model",
272
275
  children: "Model"
273
- }), /* @__PURE__ */ q(S, {
276
+ }), /* @__PURE__ */ B(x, {
274
277
  id: "model",
275
- value: p.model,
276
- onChange: (e) => m((t) => ({
278
+ value: u.model,
279
+ onChange: (e) => d((t) => ({
277
280
  ...t,
278
281
  model: e.target.value
279
282
  })),
280
283
  placeholder: "Transit"
281
284
  })]
282
285
  }),
283
- /* @__PURE__ */ J("div", {
286
+ /* @__PURE__ */ V("div", {
284
287
  className: "space-y-2",
285
- children: [/* @__PURE__ */ q(C, {
288
+ children: [/* @__PURE__ */ B(S, {
286
289
  htmlFor: "licensePlate",
287
290
  children: "License Plate"
288
- }), /* @__PURE__ */ q(S, {
291
+ }), /* @__PURE__ */ B(x, {
289
292
  id: "licensePlate",
290
- value: p.licensePlate,
291
- onChange: (e) => m((t) => ({
293
+ value: u.licensePlate,
294
+ onChange: (e) => d((t) => ({
292
295
  ...t,
293
296
  licensePlate: e.target.value
294
297
  })),
@@ -297,62 +300,62 @@ function pe({ editId: n }) {
297
300
  })
298
301
  ]
299
302
  }),
300
- /* @__PURE__ */ J("div", {
303
+ /* @__PURE__ */ V("div", {
301
304
  className: "grid grid-cols-1 md:grid-cols-3 gap-4",
302
305
  children: [
303
- /* @__PURE__ */ J("div", {
306
+ /* @__PURE__ */ V("div", {
304
307
  className: "space-y-2",
305
- children: [/* @__PURE__ */ q(C, {
308
+ children: [/* @__PURE__ */ B(S, {
306
309
  htmlFor: "ownershipType",
307
310
  children: "Ownership"
308
- }), /* @__PURE__ */ J(T, {
309
- value: p.ownershipType || void 0,
310
- onValueChange: (e) => m((t) => ({
311
+ }), /* @__PURE__ */ V(w, {
312
+ value: u.ownershipType || void 0,
313
+ onValueChange: (e) => d((t) => ({
311
314
  ...t,
312
315
  ownershipType: e
313
316
  })),
314
- children: [/* @__PURE__ */ q(O, {
317
+ children: [/* @__PURE__ */ B(D, {
315
318
  id: "ownershipType",
316
- children: /* @__PURE__ */ q(k, { placeholder: "Select ownership" })
317
- }), /* @__PURE__ */ q(E, { children: fe.map((e) => /* @__PURE__ */ q(D, {
319
+ children: /* @__PURE__ */ B(O, { placeholder: "Select ownership" })
320
+ }), /* @__PURE__ */ B(T, { children: J.map((e) => /* @__PURE__ */ B(E, {
318
321
  value: e.value,
319
322
  children: e.label
320
323
  }, e.value)) })]
321
324
  })]
322
325
  }),
323
- /* @__PURE__ */ J("div", {
326
+ /* @__PURE__ */ V("div", {
324
327
  className: "space-y-2",
325
- children: [/* @__PURE__ */ q(C, {
328
+ children: [/* @__PURE__ */ B(S, {
326
329
  htmlFor: "year",
327
330
  children: "Year"
328
- }), /* @__PURE__ */ q(S, {
331
+ }), /* @__PURE__ */ B(x, {
329
332
  id: "year",
330
333
  type: "number",
331
334
  min: 1980,
332
335
  max: (/* @__PURE__ */ new Date()).getFullYear() + 1,
333
- value: p.year,
334
- onChange: (e) => m((t) => ({
336
+ value: u.year,
337
+ onChange: (e) => d((t) => ({
335
338
  ...t,
336
339
  year: e.target.value
337
340
  })),
338
341
  placeholder: String((/* @__PURE__ */ new Date()).getFullYear())
339
342
  })]
340
343
  }),
341
- /* @__PURE__ */ J("div", {
344
+ /* @__PURE__ */ V("div", {
342
345
  className: "space-y-2",
343
- children: [/* @__PURE__ */ q(C, {
346
+ children: [/* @__PURE__ */ B(S, {
344
347
  htmlFor: "vehicleStatus",
345
348
  children: "Status"
346
- }), /* @__PURE__ */ J(T, {
347
- value: p.status,
348
- onValueChange: (e) => m((t) => ({
349
+ }), /* @__PURE__ */ V(w, {
350
+ value: u.status,
351
+ onValueChange: (e) => d((t) => ({
349
352
  ...t,
350
353
  status: e
351
354
  })),
352
- children: [/* @__PURE__ */ q(O, {
355
+ children: [/* @__PURE__ */ B(D, {
353
356
  id: "vehicleStatus",
354
- children: /* @__PURE__ */ q(k, {})
355
- }), /* @__PURE__ */ q(E, { children: ue.map((e) => /* @__PURE__ */ q(D, {
357
+ children: /* @__PURE__ */ B(O, {})
358
+ }), /* @__PURE__ */ B(T, { children: K.map((e) => /* @__PURE__ */ B(E, {
356
359
  value: e.value,
357
360
  children: e.label
358
361
  }, e.value)) })]
@@ -360,42 +363,42 @@ function pe({ editId: n }) {
360
363
  })
361
364
  ]
362
365
  }),
363
- /* @__PURE__ */ J("div", {
366
+ /* @__PURE__ */ V("div", {
364
367
  className: "grid grid-cols-1 md:grid-cols-2 gap-4",
365
- children: [/* @__PURE__ */ J("div", {
368
+ children: [/* @__PURE__ */ V("div", {
366
369
  className: "space-y-2",
367
- children: [/* @__PURE__ */ q(C, {
370
+ children: [/* @__PURE__ */ B(S, {
368
371
  htmlFor: "fuelType",
369
372
  children: "Fuel Type"
370
- }), /* @__PURE__ */ J(T, {
371
- value: p.fuelType || void 0,
373
+ }), /* @__PURE__ */ V(w, {
374
+ value: u.fuelType || void 0,
372
375
  onValueChange: (e) => {
373
- let t = de.find((t) => t.value === e)?.value;
374
- m((e) => ({
376
+ let t = q.find((t) => t.value === e)?.value;
377
+ d((e) => ({
375
378
  ...e,
376
379
  fuelType: t ?? ""
377
380
  }));
378
381
  },
379
- children: [/* @__PURE__ */ q(O, {
382
+ children: [/* @__PURE__ */ B(D, {
380
383
  id: "fuelType",
381
- children: /* @__PURE__ */ q(k, { placeholder: "Select fuel type" })
382
- }), /* @__PURE__ */ q(E, { children: de.map((e) => /* @__PURE__ */ q(D, {
384
+ children: /* @__PURE__ */ B(O, { placeholder: "Select fuel type" })
385
+ }), /* @__PURE__ */ B(T, { children: q.map((e) => /* @__PURE__ */ B(E, {
383
386
  value: e.value,
384
387
  children: e.label
385
388
  }, e.value)) })]
386
389
  })]
387
- }), /* @__PURE__ */ J("div", {
390
+ }), /* @__PURE__ */ V("div", {
388
391
  className: "space-y-2",
389
- children: [/* @__PURE__ */ q(C, {
392
+ children: [/* @__PURE__ */ B(S, {
390
393
  htmlFor: "fuelEfficiency",
391
394
  children: "Fuel Efficiency (L/100km)"
392
- }), /* @__PURE__ */ q(S, {
395
+ }), /* @__PURE__ */ B(x, {
393
396
  id: "fuelEfficiency",
394
397
  type: "number",
395
398
  min: 0,
396
399
  step: .1,
397
- value: p.fuelEfficiencyLPer100Km,
398
- onChange: (e) => m((t) => ({
400
+ value: u.fuelEfficiencyLPer100Km,
401
+ onChange: (e) => d((t) => ({
399
402
  ...t,
400
403
  fuelEfficiencyLPer100Km: e.target.value
401
404
  })),
@@ -403,55 +406,55 @@ function pe({ editId: n }) {
403
406
  })]
404
407
  })]
405
408
  }),
406
- /* @__PURE__ */ J("div", {
409
+ /* @__PURE__ */ V("div", {
407
410
  className: "grid grid-cols-1 md:grid-cols-3 gap-4",
408
411
  children: [
409
- /* @__PURE__ */ J("div", {
412
+ /* @__PURE__ */ V("div", {
410
413
  className: "space-y-2",
411
- children: [/* @__PURE__ */ q(C, {
414
+ children: [/* @__PURE__ */ B(S, {
412
415
  htmlFor: "capacityWeight",
413
416
  children: "Capacity — Weight (kg)"
414
- }), /* @__PURE__ */ q(S, {
417
+ }), /* @__PURE__ */ B(x, {
415
418
  id: "capacityWeight",
416
419
  type: "number",
417
420
  min: 0,
418
- value: p.capacityWeight,
419
- onChange: (e) => m((t) => ({
421
+ value: u.capacityWeight,
422
+ onChange: (e) => d((t) => ({
420
423
  ...t,
421
424
  capacityWeight: e.target.value
422
425
  })),
423
426
  placeholder: "5000"
424
427
  })]
425
428
  }),
426
- /* @__PURE__ */ J("div", {
429
+ /* @__PURE__ */ V("div", {
427
430
  className: "space-y-2",
428
- children: [/* @__PURE__ */ q(C, {
431
+ children: [/* @__PURE__ */ B(S, {
429
432
  htmlFor: "capacityVolume",
430
433
  children: "Capacity — Volume (m³)"
431
- }), /* @__PURE__ */ q(S, {
434
+ }), /* @__PURE__ */ B(x, {
432
435
  id: "capacityVolume",
433
436
  type: "number",
434
437
  min: 0,
435
438
  step: .1,
436
- value: p.capacityVolume,
437
- onChange: (e) => m((t) => ({
439
+ value: u.capacityVolume,
440
+ onChange: (e) => d((t) => ({
438
441
  ...t,
439
442
  capacityVolume: e.target.value
440
443
  })),
441
444
  placeholder: "18"
442
445
  })]
443
446
  }),
444
- /* @__PURE__ */ J("div", {
447
+ /* @__PURE__ */ V("div", {
445
448
  className: "space-y-2",
446
- children: [/* @__PURE__ */ q(C, {
449
+ children: [/* @__PURE__ */ B(S, {
447
450
  htmlFor: "capacityPallets",
448
451
  children: "Capacity — Pallets"
449
- }), /* @__PURE__ */ q(S, {
452
+ }), /* @__PURE__ */ B(x, {
450
453
  id: "capacityPallets",
451
454
  type: "number",
452
455
  min: 0,
453
- value: p.capacityPallets,
454
- onChange: (e) => m((t) => ({
456
+ value: u.capacityPallets,
457
+ onChange: (e) => d((t) => ({
455
458
  ...t,
456
459
  capacityPallets: e.target.value
457
460
  })),
@@ -462,276 +465,575 @@ function pe({ editId: n }) {
462
465
  })
463
466
  ]
464
467
  })] }),
465
- d && /* @__PURE__ */ J(v, {
468
+ l && /* @__PURE__ */ V(_, {
466
469
  className: "border-status-error-border",
467
- children: [/* @__PURE__ */ q(b, { children: /* @__PURE__ */ J(x, {
470
+ children: [/* @__PURE__ */ B(y, { children: /* @__PURE__ */ V(b, {
468
471
  className: "flex items-center gap-2 text-status-error-text",
469
- children: [/* @__PURE__ */ q(l, { size: 18 }), " Delete Vehicle"]
470
- }) }), /* @__PURE__ */ J(y, { children: [/* @__PURE__ */ q("p", {
472
+ children: [/* @__PURE__ */ B(s, { size: 18 }), " Delete Vehicle"]
473
+ }) }), /* @__PURE__ */ V(v, { children: [/* @__PURE__ */ B("p", {
471
474
  className: "mb-3 text-sm text-text-secondary",
472
475
  children: "Removes this vehicle from the active fleet. It can no longer be assigned to drivers, orders, or routes. This cannot be undone from here."
473
- }), /* @__PURE__ */ J(_, {
476
+ }), /* @__PURE__ */ V(g, {
474
477
  type: "button",
475
478
  variant: "outline",
476
479
  className: "border-status-error-border text-status-error-text hover:bg-status-error-bg-subtle",
477
- onClick: () => F(!0),
478
- children: [/* @__PURE__ */ q(l, { size: 16 }), " Delete this vehicle"]
480
+ onClick: () => C(!0),
481
+ children: [/* @__PURE__ */ B(s, { size: 16 }), " Delete this vehicle"]
479
482
  })] })]
480
483
  })
481
484
  ]
482
485
  }),
483
- /* @__PURE__ */ q(Z, {
484
- open: P,
485
- onOpenChange: F,
486
- children: /* @__PURE__ */ J(Q, { children: [
487
- /* @__PURE__ */ J(se, { children: [/* @__PURE__ */ q(ce, { children: "Delete this vehicle?" }), /* @__PURE__ */ J($, { children: [
486
+ /* @__PURE__ */ B(H, {
487
+ open: re,
488
+ onOpenChange: C,
489
+ children: /* @__PURE__ */ V(ve, { children: [
490
+ /* @__PURE__ */ V(U, { children: [/* @__PURE__ */ B(W, { children: "Delete this vehicle?" }), /* @__PURE__ */ V(ye, { children: [
488
491
  "This removes ",
489
- p.vehicleNumber || "this vehicle",
492
+ u.vehicleNumber || "this vehicle",
490
493
  " from the active fleet. It cannot be undone from here."
491
494
  ] })] }),
492
- /* @__PURE__ */ q("div", {
495
+ /* @__PURE__ */ B("div", {
493
496
  className: "px-1",
494
- children: /* @__PURE__ */ q(U, { message: z })
497
+ children: /* @__PURE__ */ B(L, { message: ie })
495
498
  }),
496
- /* @__PURE__ */ J(oe, { children: [/* @__PURE__ */ q(_, {
499
+ /* @__PURE__ */ V(be, { children: [/* @__PURE__ */ B(g, {
497
500
  variant: "outline",
498
- onClick: () => F(!1),
499
- disabled: I,
501
+ onClick: () => C(!1),
502
+ disabled: M,
500
503
  children: "Cancel"
501
- }), /* @__PURE__ */ q(_, {
504
+ }), /* @__PURE__ */ B(g, {
502
505
  className: "bg-status-error-text text-text-inverse hover:opacity-90",
503
506
  onClick: async () => {
504
507
  if (n) {
505
- L(!0), B(null);
508
+ N(!0), P(null);
506
509
  try {
507
- await c(n), F(!1), i?.(H(r, "fleet/vehicles"));
510
+ await te(n), C(!1), i?.(I(r, "fleet/vehicles"));
508
511
  } catch (e) {
509
- B(e instanceof Error ? e.message : "Failed to delete vehicle.");
512
+ P(e instanceof Error ? e.message : "Failed to delete vehicle.");
510
513
  } finally {
511
- L(!1);
514
+ N(!1);
512
515
  }
513
516
  }
514
517
  },
515
- disabled: I,
516
- children: I ? "Deleting..." : "Delete vehicle"
518
+ disabled: M,
519
+ children: M ? "Deleting..." : "Delete vehicle"
517
520
  })] })
518
521
  ] })
519
522
  })
520
523
  ]
521
524
  });
522
525
  }
523
- function me() {
524
- let { vehicleId: o } = re(), { basePath: l, navigate: S } = R(), { vehicle: C, isLoading: T, error: E, refetch: D } = M(o), O = F(), { message: k, notify: A } = ee(), { t: j } = ie(), P = (e, t) => {
525
- let n = j(e);
526
+ function X() {
527
+ let { vehicleId: a } = pe(), { basePath: k, navigate: A } = oe(), { vehicle: N, isLoading: L, error: R, refetch: H, addMaintenanceLog: ve, removeMaintenanceLog: ye } = j(a), be = ie(), { message: U, notify: W } = ue(), [G, K] = z(!1), [q, J] = z({
528
+ serviceDate: (/* @__PURE__ */ new Date()).toISOString().slice(0, 10),
529
+ serviceType: "PREVENTIVE",
530
+ description: "",
531
+ mileage: "",
532
+ cost: "",
533
+ vendor: ""
534
+ }), [X, xe] = z(!1), { t: Se } = me(), Ce = (e, t) => {
535
+ let n = Se(e);
526
536
  return n === e ? t : n;
527
- }, U = ne().pathname.endsWith("/edit");
528
- I(U, D);
529
- let { drivers: G, isLoading: K, error: Z } = N(U ? void 0 : o), Q = () => S?.(H(l, "fleet/vehicles")), $ = (e) => S?.(H(l, e));
530
- return o ? U ? /* @__PURE__ */ q(pe, { editId: o }) : T ? /* @__PURE__ */ q(d, { message: "Loading vehicle details..." }) : E || !C ? /* @__PURE__ */ q(u, {
537
+ }, Z = fe().pathname.endsWith("/edit");
538
+ P(Z, H);
539
+ let { drivers: Q, isLoading: we, error: Te } = M(Z ? void 0 : a), Ee = () => A?.(I(k, "fleet/vehicles")), $ = (e) => A?.(I(k, e));
540
+ return a ? Z ? /* @__PURE__ */ B(Y, { editId: a }) : L ? /* @__PURE__ */ B(f, { message: "Loading vehicle details..." }) : R || !N ? /* @__PURE__ */ B(d, {
531
541
  title: "Vehicle not found",
532
- onRetry: D
533
- }) : /* @__PURE__ */ J(f, {
534
- title: C.vehicleNumber,
535
- subtitle: `${C.make} ${C.model}${C.year ? ` (${C.year})` : ""}`,
536
- icon: /* @__PURE__ */ q(e, { size: 24 }),
537
- headerActions: /* @__PURE__ */ J("div", {
542
+ onRetry: H
543
+ }) : /* @__PURE__ */ V(ne, {
544
+ title: N.vehicleNumber,
545
+ subtitle: `${N.make} ${N.model}${N.year ? ` (${N.year})` : ""}`,
546
+ icon: /* @__PURE__ */ B(e, { size: 24 }),
547
+ headerActions: /* @__PURE__ */ V("div", {
538
548
  className: "flex gap-2",
539
- children: [/* @__PURE__ */ J(_, {
549
+ children: [/* @__PURE__ */ V(g, {
540
550
  variant: "outline",
541
- onClick: Q,
542
- children: [/* @__PURE__ */ q(t, { size: 16 }), " Back"]
543
- }), /* @__PURE__ */ J(_, {
544
- onClick: () => S?.(H(l, "fleet/vehicles/" + o + "/edit")),
545
- children: [/* @__PURE__ */ q(a, { size: 16 }), " Edit"]
551
+ onClick: Ee,
552
+ children: [/* @__PURE__ */ B(t, { size: 16 }), " Back"]
553
+ }), /* @__PURE__ */ V(g, {
554
+ onClick: () => A?.(I(k, "fleet/vehicles/" + a + "/edit")),
555
+ children: [/* @__PURE__ */ B(ee, { size: 16 }), " Edit"]
546
556
  })]
547
557
  }),
548
- headerContent: /* @__PURE__ */ J("div", {
558
+ headerContent: /* @__PURE__ */ V("div", {
549
559
  className: "flex gap-2",
550
- children: [/* @__PURE__ */ q(p, {
551
- status: C.status,
560
+ children: [/* @__PURE__ */ B(p, {
561
+ status: N.status,
552
562
  type: "vehicle"
553
- }), /* @__PURE__ */ q(m, { type: C.type })]
563
+ }), /* @__PURE__ */ B(m, { type: N.type })]
554
564
  }),
555
565
  children: [
556
- /* @__PURE__ */ q(X, {
557
- icon: /* @__PURE__ */ q(e, { size: 18 }),
566
+ /* @__PURE__ */ B(_e, {
567
+ icon: /* @__PURE__ */ B(e, { size: 18 }),
558
568
  children: "The full record for this vehicle — specs, capacity, fuel and mileage, who is driving it and where it is right now. Use it to confirm a vehicle is fuelled, crewed and the right size before dispatching it on a delivery."
559
569
  }),
560
- /* @__PURE__ */ q(ae, {
570
+ /* @__PURE__ */ B(ge, {
561
571
  storageKey: "movethewheels-vehicle-details",
562
572
  steps: [{
563
573
  id: "assign",
564
574
  label: "Assign to a delivery",
565
575
  description: "Put this vehicle on an order that fits its capacity.",
566
- icon: /* @__PURE__ */ q(n, { size: 16 }),
576
+ icon: /* @__PURE__ */ B(n, { size: 16 }),
567
577
  onClick: () => $("orders")
568
578
  }, {
569
579
  id: "driver",
570
- label: G.length > 0 ? "Review the assigned driver" : "Assign a driver",
580
+ label: Q.length > 0 ? "Review the assigned driver" : "Assign a driver",
571
581
  description: "A vehicle needs a driver before it can be dispatched.",
572
- icon: /* @__PURE__ */ q(i, { size: 16 }),
573
- done: G.length > 0,
574
- onClick: () => G[0] ? $(`fleet/drivers/${G[0].id}`) : $("fleet/drivers")
582
+ icon: /* @__PURE__ */ B(i, { size: 16 }),
583
+ done: Q.length > 0,
584
+ onClick: () => Q[0] ? $(`fleet/drivers/${Q[0].id}`) : $("fleet/drivers")
575
585
  }]
576
586
  }),
577
- k && /* @__PURE__ */ q("div", {
587
+ U && /* @__PURE__ */ B("div", {
578
588
  className: "mb-2",
579
- children: /* @__PURE__ */ q(W, { message: k })
589
+ children: /* @__PURE__ */ B(le, { message: U })
580
590
  }),
581
- /* @__PURE__ */ J("div", {
591
+ /* @__PURE__ */ V("div", {
582
592
  className: "grid grid-cols-1 lg:grid-cols-3 gap-6",
583
- children: [/* @__PURE__ */ J("div", {
593
+ children: [/* @__PURE__ */ V("div", {
584
594
  className: "lg:col-span-2 space-y-6",
585
595
  children: [
586
- /* @__PURE__ */ J(Y, { children: [/* @__PURE__ */ q("h2", {
596
+ /* @__PURE__ */ V(he, { children: [/* @__PURE__ */ B("h2", {
587
597
  className: "text-base font-semibold text-text-primary mb-4",
588
598
  children: "Vehicle Information"
589
- }), /* @__PURE__ */ J("div", {
599
+ }), /* @__PURE__ */ V("div", {
590
600
  className: "grid grid-cols-2 md:grid-cols-3 gap-6",
591
601
  children: [
592
- /* @__PURE__ */ J("div", { children: [/* @__PURE__ */ q("p", {
602
+ /* @__PURE__ */ V("div", { children: [/* @__PURE__ */ B("p", {
593
603
  className: "text-sm text-text-secondary",
594
604
  children: "Type"
595
- }), /* @__PURE__ */ q("p", {
605
+ }), /* @__PURE__ */ B("p", {
596
606
  className: "font-medium capitalize",
597
- children: C.type
607
+ children: N.type
598
608
  })] }),
599
- /* @__PURE__ */ J("div", { children: [/* @__PURE__ */ q("p", {
609
+ /* @__PURE__ */ V("div", { children: [/* @__PURE__ */ B("p", {
600
610
  className: "text-sm text-text-secondary",
601
611
  children: "Make"
602
- }), /* @__PURE__ */ q("p", {
612
+ }), /* @__PURE__ */ B("p", {
603
613
  className: "font-medium",
604
- children: C.make || "—"
614
+ children: N.make || "—"
605
615
  })] }),
606
- /* @__PURE__ */ J("div", { children: [/* @__PURE__ */ q("p", {
616
+ /* @__PURE__ */ V("div", { children: [/* @__PURE__ */ B("p", {
607
617
  className: "text-sm text-text-secondary",
608
618
  children: "Model"
609
- }), /* @__PURE__ */ q("p", {
619
+ }), /* @__PURE__ */ B("p", {
610
620
  className: "font-medium",
611
- children: C.model || "—"
621
+ children: N.model || "—"
612
622
  })] }),
613
- /* @__PURE__ */ J("div", { children: [/* @__PURE__ */ q("p", {
623
+ /* @__PURE__ */ V("div", { children: [/* @__PURE__ */ B("p", {
614
624
  className: "text-sm text-text-secondary",
615
625
  children: "Year"
616
- }), /* @__PURE__ */ q("p", {
626
+ }), /* @__PURE__ */ B("p", {
617
627
  className: "font-medium",
618
- children: C.year ?? "—"
628
+ children: N.year ?? "—"
619
629
  })] }),
620
- /* @__PURE__ */ J("div", { children: [/* @__PURE__ */ q("p", {
630
+ /* @__PURE__ */ V("div", { children: [/* @__PURE__ */ B("p", {
621
631
  className: "text-sm text-text-secondary",
622
632
  children: "License Plate"
623
- }), /* @__PURE__ */ q("p", {
633
+ }), /* @__PURE__ */ B("p", {
624
634
  className: "font-medium",
625
- children: C.licensePlate || "—"
635
+ children: N.licensePlate || "—"
626
636
  })] }),
627
- /* @__PURE__ */ J("div", { children: [/* @__PURE__ */ q("p", {
637
+ /* @__PURE__ */ V("div", { children: [/* @__PURE__ */ B("p", {
628
638
  className: "text-sm text-text-secondary",
629
639
  children: "Ownership"
630
- }), /* @__PURE__ */ q("p", {
640
+ }), /* @__PURE__ */ B("p", {
631
641
  className: "font-medium capitalize",
632
- children: C.ownershipType || "—"
642
+ children: N.ownershipType || "—"
633
643
  })] })
634
644
  ]
635
645
  })] }),
636
- /* @__PURE__ */ J(v, { children: [/* @__PURE__ */ q(b, { children: /* @__PURE__ */ q(x, { children: "Capacity" }) }), /* @__PURE__ */ q(y, { children: /* @__PURE__ */ J("div", {
646
+ /* @__PURE__ */ V(_, { children: [/* @__PURE__ */ B(y, { children: /* @__PURE__ */ B(b, { children: "Capacity" }) }), /* @__PURE__ */ B(v, { children: /* @__PURE__ */ V("div", {
637
647
  className: "grid grid-cols-1 sm:grid-cols-3 gap-6",
638
648
  children: [
639
- /* @__PURE__ */ J("div", { children: [/* @__PURE__ */ q("p", {
649
+ /* @__PURE__ */ V("div", { children: [/* @__PURE__ */ B("p", {
640
650
  className: "text-sm text-text-secondary",
641
651
  children: "Weight"
642
- }), /* @__PURE__ */ q("p", {
652
+ }), /* @__PURE__ */ B("p", {
643
653
  className: "text-2xl font-bold",
644
- children: C.capacity.weight === void 0 ? "—" : B(C.capacity.weight)
654
+ children: N.capacity.weight === void 0 ? "—" : se(N.capacity.weight)
645
655
  })] }),
646
- /* @__PURE__ */ J("div", { children: [/* @__PURE__ */ q("p", {
656
+ /* @__PURE__ */ V("div", { children: [/* @__PURE__ */ B("p", {
647
657
  className: "text-sm text-text-secondary",
648
658
  children: "Volume"
649
- }), /* @__PURE__ */ q("p", {
659
+ }), /* @__PURE__ */ B("p", {
650
660
  className: "text-2xl font-bold",
651
- children: C.capacity.volume === void 0 ? "—" : `${C.capacity.volume} m³`
661
+ children: N.capacity.volume === void 0 ? "—" : `${N.capacity.volume} m³`
652
662
  })] }),
653
- C.capacity.pallets && /* @__PURE__ */ J("div", { children: [/* @__PURE__ */ q("p", {
663
+ N.capacity.pallets && /* @__PURE__ */ V("div", { children: [/* @__PURE__ */ B("p", {
654
664
  className: "text-sm text-text-secondary",
655
665
  children: "Pallets"
656
- }), /* @__PURE__ */ q("p", {
666
+ }), /* @__PURE__ */ B("p", {
657
667
  className: "text-2xl font-bold",
658
- children: C.capacity.pallets
668
+ children: N.capacity.pallets
659
669
  })] })
660
670
  ]
661
671
  }) })] }),
662
- /* @__PURE__ */ q(te, {
672
+ /* @__PURE__ */ B(de, {
663
673
  entityType: "vehicle",
664
- entityId: C.id
665
- })
674
+ entityId: N.id
675
+ }),
676
+ /* @__PURE__ */ V(_, { children: [/* @__PURE__ */ B(y, { children: /* @__PURE__ */ V(b, {
677
+ className: "flex items-center gap-2",
678
+ children: [/* @__PURE__ */ B(l, {
679
+ size: 18,
680
+ "aria-hidden": "true"
681
+ }), " Utilization & Diagnostics"]
682
+ }) }), /* @__PURE__ */ V(v, {
683
+ className: "space-y-4",
684
+ children: [N.utilizationSummary ? /* @__PURE__ */ V("div", {
685
+ className: "grid grid-cols-2 sm:grid-cols-4 gap-4",
686
+ children: [
687
+ /* @__PURE__ */ V("div", { children: [/* @__PURE__ */ B("p", {
688
+ className: "text-xs text-text-secondary",
689
+ children: "Routes"
690
+ }), /* @__PURE__ */ V("p", {
691
+ className: "text-lg font-semibold",
692
+ children: [
693
+ N.utilizationSummary.completedRoutes,
694
+ "/",
695
+ N.utilizationSummary.totalRoutes
696
+ ]
697
+ })] }),
698
+ /* @__PURE__ */ V("div", { children: [/* @__PURE__ */ B("p", {
699
+ className: "text-xs text-text-secondary",
700
+ children: "Deliveries"
701
+ }), /* @__PURE__ */ V("p", {
702
+ className: "text-lg font-semibold",
703
+ children: [
704
+ N.utilizationSummary.completedDeliveryJobs,
705
+ "/",
706
+ N.utilizationSummary.totalDeliveryJobs
707
+ ]
708
+ })] }),
709
+ /* @__PURE__ */ V("div", { children: [/* @__PURE__ */ B("p", {
710
+ className: "text-xs text-text-secondary",
711
+ children: "Total Distance"
712
+ }), /* @__PURE__ */ V("p", {
713
+ className: "text-lg font-semibold",
714
+ children: [N.utilizationSummary.totalDistanceKm.toLocaleString(), " km"]
715
+ })] }),
716
+ /* @__PURE__ */ V("div", { children: [/* @__PURE__ */ B("p", {
717
+ className: "text-xs text-text-secondary",
718
+ children: "Utilization"
719
+ }), /* @__PURE__ */ B("p", {
720
+ className: "text-lg font-semibold",
721
+ children: N.utilizationSummary.utilizationRate === void 0 ? "—" : `${N.utilizationSummary.utilizationRate}%`
722
+ })] })
723
+ ]
724
+ }) : /* @__PURE__ */ B("p", {
725
+ className: "text-sm text-text-secondary",
726
+ children: "No route utilization recorded yet."
727
+ }), N.diagnostics ? /* @__PURE__ */ V("div", {
728
+ className: "border-t border-border-seam pt-3 grid grid-cols-2 sm:grid-cols-3 gap-3 text-sm",
729
+ children: [
730
+ /* @__PURE__ */ V("div", { children: [/* @__PURE__ */ B("p", {
731
+ className: "text-xs text-text-secondary",
732
+ children: "Engine Status"
733
+ }), /* @__PURE__ */ B("p", {
734
+ className: "font-medium",
735
+ children: N.diagnostics.engineStatus ?? "Not reported"
736
+ })] }),
737
+ /* @__PURE__ */ V("div", { children: [/* @__PURE__ */ B("p", {
738
+ className: "text-xs text-text-secondary",
739
+ children: "Battery Voltage"
740
+ }), /* @__PURE__ */ B("p", {
741
+ className: "font-medium",
742
+ children: N.diagnostics.batteryVoltage === void 0 ? "—" : `${N.diagnostics.batteryVoltage} V`
743
+ })] }),
744
+ /* @__PURE__ */ V("div", { children: [/* @__PURE__ */ B("p", {
745
+ className: "text-xs text-text-secondary",
746
+ children: "Fault Codes"
747
+ }), /* @__PURE__ */ B("p", {
748
+ className: "font-medium",
749
+ children: N.diagnostics.faultCodes && N.diagnostics.faultCodes.length > 0 ? N.diagnostics.faultCodes.join(", ") : "None"
750
+ })] })
751
+ ]
752
+ }) : /* @__PURE__ */ B("p", {
753
+ className: "border-t border-border-seam pt-3 text-xs text-text-secondary",
754
+ children: "No engine diagnostics snapshot recorded for this vehicle yet."
755
+ })]
756
+ })] }),
757
+ /* @__PURE__ */ V(_, { children: [/* @__PURE__ */ V(y, {
758
+ className: "flex flex-row items-center justify-between gap-2",
759
+ children: [/* @__PURE__ */ V(b, {
760
+ className: "flex items-center gap-2",
761
+ children: [/* @__PURE__ */ B(c, {
762
+ size: 18,
763
+ "aria-hidden": "true"
764
+ }), " Maintenance History"]
765
+ }), /* @__PURE__ */ V(g, {
766
+ variant: "outline",
767
+ size: "sm",
768
+ onClick: () => K((e) => !e),
769
+ children: [
770
+ /* @__PURE__ */ B(u, {
771
+ size: 14,
772
+ "aria-hidden": "true"
773
+ }),
774
+ " ",
775
+ G ? "Close" : "Add record"
776
+ ]
777
+ })]
778
+ }), /* @__PURE__ */ V(v, {
779
+ className: "space-y-4",
780
+ children: [G && /* @__PURE__ */ V("form", {
781
+ className: "space-y-3 rounded-lg border border-border-seam p-3",
782
+ onSubmit: async (e) => {
783
+ if (e.preventDefault(), q.description.trim()) {
784
+ xe(!0);
785
+ try {
786
+ await ve({
787
+ serviceDate: `${q.serviceDate}T12:00:00.000Z`,
788
+ serviceType: q.serviceType,
789
+ description: q.description.trim(),
790
+ mileage: q.mileage ? Number(q.mileage) : void 0,
791
+ cost: q.cost ? Number(q.cost) : void 0,
792
+ vendor: q.vendor.trim() || void 0
793
+ }), J({
794
+ serviceDate: (/* @__PURE__ */ new Date()).toISOString().slice(0, 10),
795
+ serviceType: "PREVENTIVE",
796
+ description: "",
797
+ mileage: "",
798
+ cost: "",
799
+ vendor: ""
800
+ }), K(!1), W("Maintenance log saved.");
801
+ } finally {
802
+ xe(!1);
803
+ }
804
+ }
805
+ },
806
+ children: [
807
+ /* @__PURE__ */ V("div", {
808
+ className: "grid grid-cols-1 sm:grid-cols-2 gap-3",
809
+ children: [/* @__PURE__ */ V("div", {
810
+ className: "space-y-1",
811
+ children: [/* @__PURE__ */ B(S, {
812
+ htmlFor: "maint-date",
813
+ children: "Date"
814
+ }), /* @__PURE__ */ B(x, {
815
+ id: "maint-date",
816
+ type: "date",
817
+ required: !0,
818
+ value: q.serviceDate,
819
+ onChange: (e) => J((t) => ({
820
+ ...t,
821
+ serviceDate: e.target.value
822
+ }))
823
+ })]
824
+ }), /* @__PURE__ */ V("div", {
825
+ className: "space-y-1",
826
+ children: [/* @__PURE__ */ B(S, {
827
+ htmlFor: "maint-type",
828
+ children: "Type"
829
+ }), /* @__PURE__ */ V(w, {
830
+ value: q.serviceType,
831
+ onValueChange: (e) => J((t) => ({
832
+ ...t,
833
+ serviceType: e
834
+ })),
835
+ children: [/* @__PURE__ */ B(D, {
836
+ id: "maint-type",
837
+ children: /* @__PURE__ */ B(O, {})
838
+ }), /* @__PURE__ */ B(T, { children: [
839
+ "PREVENTIVE",
840
+ "REPAIR",
841
+ "INSPECTION",
842
+ "TIRE",
843
+ "BRAKE",
844
+ "OIL_CHANGE",
845
+ "OTHER"
846
+ ].map((e) => /* @__PURE__ */ B(E, {
847
+ value: e,
848
+ children: e.replace("_", " ")
849
+ }, e)) })]
850
+ })]
851
+ })]
852
+ }),
853
+ /* @__PURE__ */ V("div", {
854
+ className: "space-y-1",
855
+ children: [/* @__PURE__ */ B(S, {
856
+ htmlFor: "maint-desc",
857
+ children: "Description"
858
+ }), /* @__PURE__ */ B(x, {
859
+ id: "maint-desc",
860
+ required: !0,
861
+ placeholder: "Oil change and brake inspection",
862
+ value: q.description,
863
+ onChange: (e) => J((t) => ({
864
+ ...t,
865
+ description: e.target.value
866
+ }))
867
+ })]
868
+ }),
869
+ /* @__PURE__ */ V("div", {
870
+ className: "grid grid-cols-1 sm:grid-cols-3 gap-3",
871
+ children: [
872
+ /* @__PURE__ */ V("div", {
873
+ className: "space-y-1",
874
+ children: [/* @__PURE__ */ B(S, {
875
+ htmlFor: "maint-mileage",
876
+ children: "Odometer"
877
+ }), /* @__PURE__ */ B(x, {
878
+ id: "maint-mileage",
879
+ type: "number",
880
+ min: 0,
881
+ value: q.mileage,
882
+ onChange: (e) => J((t) => ({
883
+ ...t,
884
+ mileage: e.target.value
885
+ }))
886
+ })]
887
+ }),
888
+ /* @__PURE__ */ V("div", {
889
+ className: "space-y-1",
890
+ children: [/* @__PURE__ */ B(S, {
891
+ htmlFor: "maint-cost",
892
+ children: "Cost"
893
+ }), /* @__PURE__ */ B(x, {
894
+ id: "maint-cost",
895
+ type: "number",
896
+ min: 0,
897
+ step: "0.01",
898
+ value: q.cost,
899
+ onChange: (e) => J((t) => ({
900
+ ...t,
901
+ cost: e.target.value
902
+ }))
903
+ })]
904
+ }),
905
+ /* @__PURE__ */ V("div", {
906
+ className: "space-y-1",
907
+ children: [/* @__PURE__ */ B(S, {
908
+ htmlFor: "maint-vendor",
909
+ children: "Vendor"
910
+ }), /* @__PURE__ */ B(x, {
911
+ id: "maint-vendor",
912
+ placeholder: "Workshop name",
913
+ value: q.vendor,
914
+ onChange: (e) => J((t) => ({
915
+ ...t,
916
+ vendor: e.target.value
917
+ }))
918
+ })]
919
+ })
920
+ ]
921
+ }),
922
+ /* @__PURE__ */ B(g, {
923
+ type: "submit",
924
+ size: "sm",
925
+ disabled: X,
926
+ children: X ? "Saving…" : "Save maintenance record"
927
+ })
928
+ ]
929
+ }), N.maintenanceLogs && N.maintenanceLogs.length > 0 ? /* @__PURE__ */ B("ul", {
930
+ className: "divide-y divide-border-seam",
931
+ children: N.maintenanceLogs.map((e) => /* @__PURE__ */ V("li", {
932
+ className: "flex items-start justify-between gap-3 py-2.5 text-sm",
933
+ children: [/* @__PURE__ */ V("div", {
934
+ className: "space-y-0.5",
935
+ children: [/* @__PURE__ */ V("p", {
936
+ className: "font-medium",
937
+ children: [
938
+ e.serviceType.replace("_", " "),
939
+ " — ",
940
+ e.description
941
+ ]
942
+ }), /* @__PURE__ */ V("p", {
943
+ className: "text-xs text-text-secondary",
944
+ children: [
945
+ F(e.serviceDate, "short"),
946
+ e.mileage === void 0 ? "" : ` · ${e.mileage.toLocaleString()} km`,
947
+ e.cost === void 0 ? "" : ` · ${e.cost} ${e.currency ?? "USD"}`,
948
+ e.vendor ? ` · ${e.vendor}` : ""
949
+ ]
950
+ })]
951
+ }), /* @__PURE__ */ B(g, {
952
+ variant: "ghost",
953
+ size: "sm",
954
+ className: "text-status-error-text",
955
+ "aria-label": `Delete maintenance record ${e.description}`,
956
+ onClick: () => void ye(e.id),
957
+ children: /* @__PURE__ */ B(s, {
958
+ size: 14,
959
+ "aria-hidden": "true"
960
+ })
961
+ })]
962
+ }, e.id))
963
+ }) : /* @__PURE__ */ B("p", {
964
+ className: "text-sm text-text-secondary",
965
+ children: "No maintenance records logged yet."
966
+ })]
967
+ })] })
666
968
  ]
667
- }), /* @__PURE__ */ J("div", {
969
+ }), /* @__PURE__ */ V("div", {
668
970
  className: "space-y-6",
669
971
  children: [
670
- /* @__PURE__ */ J(v, { children: [/* @__PURE__ */ q(b, { children: /* @__PURE__ */ J(x, {
972
+ /* @__PURE__ */ V(_, { children: [/* @__PURE__ */ B(y, { children: /* @__PURE__ */ V(b, {
671
973
  className: "flex items-center gap-2",
672
- children: [/* @__PURE__ */ q(r, { size: 18 }), " Fuel & Mileage"]
673
- }) }), /* @__PURE__ */ J(y, {
974
+ children: [/* @__PURE__ */ B(r, { size: 18 }), " Fuel & Mileage"]
975
+ }) }), /* @__PURE__ */ V(v, {
674
976
  className: "space-y-4",
675
977
  children: [
676
- C.fuelLevel !== void 0 && /* @__PURE__ */ J("div", { children: [/* @__PURE__ */ J("div", {
978
+ N.fuelLevel !== void 0 && /* @__PURE__ */ V("div", { children: [/* @__PURE__ */ V("div", {
677
979
  className: "flex justify-between text-sm mb-2",
678
- children: [/* @__PURE__ */ q("span", { children: "Fuel Level" }), /* @__PURE__ */ J("span", { children: [C.fuelLevel, "%"] })]
679
- }), /* @__PURE__ */ q(w, { value: C.fuelLevel })] }),
680
- C.mileage !== void 0 && /* @__PURE__ */ J("div", { children: [/* @__PURE__ */ q("p", {
980
+ children: [/* @__PURE__ */ B("span", { children: "Fuel Level" }), /* @__PURE__ */ V("span", { children: [N.fuelLevel, "%"] })]
981
+ }), /* @__PURE__ */ B(C, { value: N.fuelLevel })] }),
982
+ N.mileage !== void 0 && /* @__PURE__ */ V("div", { children: [/* @__PURE__ */ B("p", {
681
983
  className: "text-sm text-text-secondary",
682
984
  children: "Total Mileage"
683
- }), /* @__PURE__ */ J("p", {
985
+ }), /* @__PURE__ */ V("p", {
684
986
  className: "text-2xl font-bold",
685
987
  children: [
686
- C.mileage.toLocaleString(),
988
+ N.mileage.toLocaleString(),
687
989
  " ",
688
- /* @__PURE__ */ q("span", {
990
+ /* @__PURE__ */ B("span", {
689
991
  className: "text-sm font-normal",
690
992
  children: "miles"
691
993
  })
692
994
  ]
693
995
  })] }),
694
- (C.fuelType || C.fuelEfficiencyLPer100Km !== void 0) && /* @__PURE__ */ J("div", {
996
+ (N.fuelType || N.fuelEfficiencyLPer100Km !== void 0) && /* @__PURE__ */ V("div", {
695
997
  className: "grid grid-cols-2 gap-4",
696
- children: [C.fuelType && /* @__PURE__ */ J("div", { children: [/* @__PURE__ */ q("p", {
998
+ children: [N.fuelType && /* @__PURE__ */ V("div", { children: [/* @__PURE__ */ B("p", {
697
999
  className: "text-sm text-text-secondary",
698
1000
  children: "Fuel Type"
699
- }), /* @__PURE__ */ q("p", {
1001
+ }), /* @__PURE__ */ B("p", {
700
1002
  className: "font-medium",
701
- children: C.fuelType
702
- })] }), C.fuelEfficiencyLPer100Km !== void 0 && /* @__PURE__ */ J("div", { children: [/* @__PURE__ */ q("p", {
1003
+ children: N.fuelType
1004
+ })] }), N.fuelEfficiencyLPer100Km !== void 0 && /* @__PURE__ */ V("div", { children: [/* @__PURE__ */ B("p", {
703
1005
  className: "text-sm text-text-secondary",
704
1006
  children: "Efficiency"
705
- }), /* @__PURE__ */ J("p", {
1007
+ }), /* @__PURE__ */ V("p", {
706
1008
  className: "font-medium",
707
- children: [C.fuelEfficiencyLPer100Km, " L/100km"]
1009
+ children: [N.fuelEfficiencyLPer100Km, " L/100km"]
708
1010
  })] })]
709
1011
  })
710
1012
  ]
711
1013
  })] }),
712
- /* @__PURE__ */ J(v, { children: [/* @__PURE__ */ q(b, { children: /* @__PURE__ */ J(x, {
1014
+ /* @__PURE__ */ V(_, { children: [/* @__PURE__ */ B(y, { children: /* @__PURE__ */ V(b, {
713
1015
  className: "flex items-center gap-2",
714
- children: [/* @__PURE__ */ q(i, { size: 18 }), " Assigned Driver"]
715
- }) }), /* @__PURE__ */ q(y, {
1016
+ children: [/* @__PURE__ */ B(i, { size: 18 }), " Assigned Driver"]
1017
+ }) }), /* @__PURE__ */ B(v, {
716
1018
  className: "space-y-4",
717
- children: K ? /* @__PURE__ */ q("p", {
1019
+ children: we ? /* @__PURE__ */ B("p", {
718
1020
  className: "text-sm text-text-secondary",
719
1021
  children: "Loading assignment…"
720
- }) : Z ? /* @__PURE__ */ q("p", {
1022
+ }) : Te ? /* @__PURE__ */ B("p", {
721
1023
  className: "text-sm text-status-error-text",
722
- children: Z.message
723
- }) : G.length === 0 ? /* @__PURE__ */ J("div", {
1024
+ children: Te.message
1025
+ }) : Q.length === 0 ? /* @__PURE__ */ V("div", {
724
1026
  className: "space-y-3",
725
- children: [/* @__PURE__ */ q("p", {
1027
+ children: [/* @__PURE__ */ B("p", {
726
1028
  className: "text-sm text-text-secondary",
727
1029
  children: "No driver is assigned to this vehicle yet."
728
- }), /* @__PURE__ */ q(_, {
1030
+ }), /* @__PURE__ */ B(g, {
729
1031
  variant: "outline",
730
1032
  size: "sm",
731
1033
  onClick: () => $("fleet/drivers"),
732
1034
  children: "Assign from the roster"
733
1035
  })]
734
- }) : G.map((e) => /* @__PURE__ */ J("div", {
1036
+ }) : Q.map((e) => /* @__PURE__ */ V("div", {
735
1037
  role: "button",
736
1038
  tabIndex: 0,
737
1039
  className: "flex w-full items-start gap-3 rounded-lg p-2 text-left hover:bg-bg-sunken/50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-action-primary-bg",
@@ -739,34 +1041,34 @@ function me() {
739
1041
  onKeyDown: (t) => {
740
1042
  (t.key === "Enter" || t.key === " ") && (t.preventDefault(), $(`fleet/drivers/${e.id}`));
741
1043
  },
742
- children: [/* @__PURE__ */ q(h, { children: /* @__PURE__ */ q(g, { children: V(e.fullName) }) }), /* @__PURE__ */ J("div", {
1044
+ children: [/* @__PURE__ */ B(h, { children: /* @__PURE__ */ B(re, { children: ce(e.fullName) }) }), /* @__PURE__ */ V("div", {
743
1045
  className: "min-w-0 space-y-1",
744
1046
  children: [
745
- /* @__PURE__ */ q("p", {
1047
+ /* @__PURE__ */ B("p", {
746
1048
  className: "font-medium",
747
1049
  children: e.fullName
748
1050
  }),
749
- /* @__PURE__ */ q("p", {
1051
+ /* @__PURE__ */ B("p", {
750
1052
  className: "text-xs text-text-secondary",
751
1053
  children: e.employeeId
752
1054
  }),
753
- /* @__PURE__ */ q(p, {
1055
+ /* @__PURE__ */ B(p, {
754
1056
  status: e.status,
755
1057
  type: "driver",
756
1058
  size: "sm"
757
1059
  }),
758
- e.email && /* @__PURE__ */ J("p", {
1060
+ e.email && /* @__PURE__ */ V("p", {
759
1061
  className: "flex items-center gap-1.5 truncate text-sm text-text-secondary",
760
1062
  children: [
761
- /* @__PURE__ */ q(s, { size: 13 }),
1063
+ /* @__PURE__ */ B(o, { size: 13 }),
762
1064
  " ",
763
1065
  e.email
764
1066
  ]
765
1067
  }),
766
- e.phone && /* @__PURE__ */ J("p", {
1068
+ e.phone && /* @__PURE__ */ V("p", {
767
1069
  className: "flex items-center gap-1.5 text-sm text-text-secondary",
768
1070
  children: [
769
- /* @__PURE__ */ q(c, { size: 13 }),
1071
+ /* @__PURE__ */ B(te, { size: 13 }),
770
1072
  " ",
771
1073
  e.phone
772
1074
  ]
@@ -775,27 +1077,27 @@ function me() {
775
1077
  })]
776
1078
  }, e.id))
777
1079
  })] }),
778
- /* @__PURE__ */ q(L, {
779
- vehicle: C,
780
- t: P,
1080
+ /* @__PURE__ */ B(ae, {
1081
+ vehicle: N,
1082
+ t: Ce,
781
1083
  onRecord: async (e) => {
782
- await O(C.id, e), A(P("movethewheels.vehicles.service.saved", "Service recorded.")), D();
1084
+ await be(N.id, e), W(Ce("movethewheels.vehicles.service.saved", "Service recorded.")), H();
783
1085
  }
784
1086
  }),
785
- C.currentLocation && /* @__PURE__ */ J(v, { children: [/* @__PURE__ */ q(b, { children: /* @__PURE__ */ J(x, {
1087
+ N.currentLocation && /* @__PURE__ */ V(_, { children: [/* @__PURE__ */ B(y, { children: /* @__PURE__ */ V(b, {
786
1088
  className: "flex items-center gap-2",
787
- children: [/* @__PURE__ */ q(n, { size: 18 }), " Current Location"]
788
- }) }), /* @__PURE__ */ J(y, { children: [/* @__PURE__ */ q("p", {
1089
+ children: [/* @__PURE__ */ B(n, { size: 18 }), " Current Location"]
1090
+ }) }), /* @__PURE__ */ V(v, { children: [/* @__PURE__ */ B("p", {
789
1091
  className: "text-sm",
790
- children: C.currentLocation.address || "Location updating..."
791
- }), /* @__PURE__ */ q("p", {
1092
+ children: N.currentLocation.address || "Location updating..."
1093
+ }), /* @__PURE__ */ B("p", {
792
1094
  className: "text-xs text-text-secondary mt-1",
793
- children: C.currentLocation.timestamp ? `Updated ${z(C.currentLocation.timestamp, "relative")}` : "Update time not recorded"
1095
+ children: N.currentLocation.timestamp ? `Updated ${F(N.currentLocation.timestamp, "relative")}` : "Update time not recorded"
794
1096
  })] })] })
795
1097
  ]
796
1098
  })]
797
1099
  })
798
1100
  ]
799
- }) : /* @__PURE__ */ q(pe, {});
1101
+ }) : /* @__PURE__ */ B(Y, {});
800
1102
  }
801
- export { me as default };
1103
+ export { X as default };