@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
@@ -1,39 +1,42 @@
1
1
  import e from "../node_modules/lucide-react/dist/esm/icons/users.js";
2
2
  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/star.js";
4
- import r from "../node_modules/lucide-react/dist/esm/icons/dollar-sign.js";
5
- import i from "../node_modules/lucide-react/dist/esm/icons/clock.js";
6
- import a from "../node_modules/lucide-react/dist/esm/icons/file-text.js";
7
- import o from "../node_modules/lucide-react/dist/esm/icons/square-pen.js";
8
- import s from "../node_modules/lucide-react/dist/esm/icons/map-pin.js";
9
- import c from "../node_modules/lucide-react/dist/esm/icons/save.js";
10
- import l from "../node_modules/lucide-react/dist/esm/icons/user-x.js";
11
- import u from "../node_modules/lucide-react/dist/esm/icons/trash-2.js";
12
- import ee from "../node_modules/lucide-react/dist/esm/icons/truck.js";
13
- import d from "../node_modules/lucide-react/dist/esm/icons/sticky-note.js";
14
- import { ErrorState as f, LoadingState as p, PageLayout as te } from "../components/PageLayout.js";
4
+ import ee from "../node_modules/lucide-react/dist/esm/icons/dollar-sign.js";
5
+ import r from "../node_modules/lucide-react/dist/esm/icons/clock.js";
6
+ import i from "../node_modules/lucide-react/dist/esm/icons/file-text.js";
7
+ import a from "../node_modules/lucide-react/dist/esm/icons/square-pen.js";
8
+ import o from "../node_modules/lucide-react/dist/esm/icons/map-pin.js";
9
+ import s from "../node_modules/lucide-react/dist/esm/icons/save.js";
10
+ import c from "../node_modules/lucide-react/dist/esm/icons/user-x.js";
11
+ import l from "../node_modules/lucide-react/dist/esm/icons/trash-2.js";
12
+ import te from "../node_modules/lucide-react/dist/esm/icons/truck.js";
13
+ import ne from "../node_modules/lucide-react/dist/esm/icons/sticky-note.js";
14
+ import re from "../node_modules/lucide-react/dist/esm/icons/shield-check.js";
15
+ import u from "../node_modules/lucide-react/dist/esm/icons/calendar.js";
16
+ import d from "../node_modules/lucide-react/dist/esm/icons/plus.js";
17
+ import { ErrorState as f, LoadingState as p, PageLayout as ie } from "../components/PageLayout.js";
15
18
  import { StatusBadge as m } from "../components/StatusBadge.js";
16
- import { Button as h, Card as g, CardContent as _, CardHeader as v, CardTitle as y, Input as b, Label as x, Select as ne, SelectContent as S, SelectItem as C, SelectTrigger as w, SelectValue as re, Textarea as T } from "../components/ui.js";
17
- import { EntityCombobox as E } from "../components/EntityCombobox.js";
18
- import { toApiDriverStatus as D, useDriver as ie, useFleet as ae, useVehicle as oe, useVehicles as se } from "../hooks/useFleet.js";
19
- import { useDebouncedValue as ce } from "../hooks/useDebouncedValue.js";
20
- import { useRefetchOnLeaveEdit as O } from "../hooks/useRefetchOnLeaveEdit.js";
21
- import { useMoveTheWheels as k } from "../providers/MoveTheWheelsProvider.js";
22
- import { formatCurrency as A, formatDate as j } from "../utils/formatters.js";
23
- import { driverLicenseExpiryInput as le, driverLicenseExpiryUpdate as ue, parseDriverLicenseExpiry as de } from "../utils/driverLicenseExpiry.js";
24
- import { joinPath as M } from "../utils/navigation.js";
25
- import { FormError as N } from "../components/FormError.js";
26
- import { DocumentsCard as P } from "../components/DocumentsCard.js";
27
- import { DRIVER_STATUS_LABELS as F } from "../constants/index.js";
28
- import { useEffect as fe, useState as I } from "react";
29
- import { useLocation as L, useParams as pe } from "react-router";
30
- import { Fragment as me, jsx as R, jsxs as z } from "react/jsx-runtime";
31
- import { EmphasisPanel as he, NextSteps as B, PagePurpose as V, ResponsiveDialog as H, ResponsiveDialogContent as U, ResponsiveDialogDescription as W, ResponsiveDialogFooter as G, ResponsiveDialogHeader as ge, ResponsiveDialogTitle as _e } from "@burdenoff/fe-libs/ui";
19
+ import { Button as h, Card as g, CardContent as _, CardHeader as v, CardTitle as y, Input as b, Label as x, Select as ae, SelectContent as oe, SelectItem as se, SelectTrigger as ce, SelectValue as le, Textarea as S } from "../components/ui.js";
20
+ import { EntityCombobox as C } from "../components/EntityCombobox.js";
21
+ import { toApiDriverStatus as w, useDriver as ue, useFleet as de, useVehicle as fe, useVehicles as pe } from "../hooks/useFleet.js";
22
+ import { useDebouncedValue as T } from "../hooks/useDebouncedValue.js";
23
+ import { useRefetchOnLeaveEdit as E } from "../hooks/useRefetchOnLeaveEdit.js";
24
+ import { useMoveTheWheels as me } from "../providers/MoveTheWheelsProvider.js";
25
+ import { formatCurrency as D, formatDate as O } from "../utils/formatters.js";
26
+ import { driverLicenseExpiryInput as he, driverLicenseExpiryUpdate as ge, parseDriverLicenseExpiry as _e } from "../utils/driverLicenseExpiry.js";
27
+ import { joinPath as k } from "../utils/navigation.js";
28
+ import { FormError as A } from "../components/FormError.js";
29
+ import { DocumentsCard as ve } from "../components/DocumentsCard.js";
30
+ import { DRIVER_STATUS_LABELS as j } from "../constants/index.js";
31
+ import { useEffect as M, useState as N } from "react";
32
+ import { useLocation as ye, useParams as P } from "react-router";
33
+ import { Fragment as be, jsx as F, jsxs as I } from "react/jsx-runtime";
34
+ import { EmphasisPanel as L, NextSteps as R, PagePurpose as xe, ResponsiveDialog as z, ResponsiveDialogContent as B, ResponsiveDialogDescription as V, ResponsiveDialogFooter as H, ResponsiveDialogHeader as U, ResponsiveDialogTitle as W } from "@burdenoff/fe-libs/ui";
32
35
  // src/movethewheels/pages/DriverDetailsPage.tsx
33
- var ve = Object.entries(F).map(([e, t]) => ({
36
+ var Se = Object.entries(j).map(([e, t]) => ({
34
37
  value: e,
35
38
  label: t
36
- })), ye = (e) => e ? e.toISOString().slice(0, 10) : "", be = (e) => e ? `${e}T12:00:00.000Z` : void 0, xe = {
39
+ })), G = (e) => e ? e.toISOString().slice(0, 10) : "", K = (e) => e ? `${e}T12:00:00.000Z` : void 0, q = {
37
40
  employeeId: "",
38
41
  firstName: "",
39
42
  lastName: "",
@@ -53,83 +56,83 @@ var ve = Object.entries(F).map(([e, t]) => ({
53
56
  payCurrency: "",
54
57
  onLeaveUntil: ""
55
58
  };
56
- function K({ editId: n }) {
57
- let { basePath: i, navigate: a } = k(), { createDriver: o, updateDriver: s, deleteDriver: f } = ae(), { driver: p, refetch: m } = ie(n), O = !!n, [A, P] = I(xe), [F, L] = I(!1), [pe, B] = I(null), [K, q] = I(!1), [J, Se] = I(""), [Y, Ce] = I(!1), [we, X] = I(null), [Te, Z] = I(!1), [Q, Ee] = I(!1), [De, Oe] = I(null), [ke, Ae] = I(""), je = ce(ke), { vehicles: Me, isLoading: Ne, isLoadingMore: Pe, hasMore: Fe, totalVehicles: Ie, loadMore: Le } = se({
59
+ function J({ editId: n }) {
60
+ let { basePath: r, navigate: i } = me(), { createDriver: a, updateDriver: o, deleteDriver: re } = de(), { driver: u, refetch: d } = ue(n), f = !!n, [p, m] = N(q), [E, D] = N(!1), [ve, j] = N(null), [ye, P] = N(!1), [R, J] = N(""), [Y, Ce] = N(!1), [we, X] = N(null), [Te, Z] = N(!1), [Q, Ee] = N(!1), [De, Oe] = N(null), [ke, Ae] = N(""), je = T(ke), { vehicles: Me, isLoading: Ne, isLoadingMore: Pe, hasMore: Fe, totalVehicles: Ie, loadMore: Le } = pe({
58
61
  limit: 20,
59
62
  search: je || void 0
60
- }), { vehicle: Re, isLoading: ze } = oe(A.vehicleId || void 0);
61
- fe(() => {
62
- if (!n || !p) return;
63
- let [e, ...t] = p.fullName.trim().split(/\s+/);
64
- P({
65
- employeeId: p.employeeId || "",
63
+ }), { vehicle: Re, isLoading: ze } = fe(p.vehicleId || void 0);
64
+ M(() => {
65
+ if (!n || !u) return;
66
+ let [e, ...t] = u.fullName.trim().split(/\s+/);
67
+ m({
68
+ employeeId: u.employeeId || "",
66
69
  firstName: e || "",
67
70
  lastName: t.join(" "),
68
- email: p.email || "",
69
- phone: p.phone || "",
70
- licenseNumber: p.licenseNumber || "",
71
- licenseClass: p.licenseType || "",
72
- licenseExpiry: le(p.licenseExpiry),
73
- status: p.status,
74
- vehicleId: p.assignedVehicle || "",
75
- vehicleIds: p.vehicleIds,
76
- rating: p.rating ? String(p.rating) : "",
77
- notes: p.notes || "",
78
- hireDate: ye(p.hireDate),
79
- baseSalary: p.baseSalary === void 0 ? "" : String(p.baseSalary),
80
- bonusYtd: p.bonusYtd === void 0 ? "" : String(p.bonusYtd),
81
- payCurrency: p.payCurrency || "",
82
- onLeaveUntil: ye(p.onLeaveUntil)
71
+ email: u.email || "",
72
+ phone: u.phone || "",
73
+ licenseNumber: u.licenseNumber || "",
74
+ licenseClass: u.licenseType || "",
75
+ licenseExpiry: he(u.licenseExpiry),
76
+ status: u.status,
77
+ vehicleId: u.assignedVehicle || "",
78
+ vehicleIds: u.vehicleIds,
79
+ rating: u.rating ? String(u.rating) : "",
80
+ notes: u.notes || "",
81
+ hireDate: G(u.hireDate),
82
+ baseSalary: u.baseSalary === void 0 ? "" : String(u.baseSalary),
83
+ bonusYtd: u.bonusYtd === void 0 ? "" : String(u.bonusYtd),
84
+ payCurrency: u.payCurrency || "",
85
+ onLeaveUntil: G(u.onLeaveUntil)
83
86
  });
84
- }, [n, p]);
85
- let Be = () => a?.(M(i, "fleet/drivers")), $ = (e = !0) => ({
86
- firstName: A.firstName.trim(),
87
- lastName: A.lastName.trim(),
88
- email: A.email.trim() || void 0,
89
- phone: A.phone.trim() || void 0,
90
- licenseNumber: A.licenseNumber.trim() || void 0,
91
- licenseClass: A.licenseClass.trim() || void 0,
92
- licenseExpiry: O ? ue(A.licenseExpiry, p?.licenseExpiry) : de(A.licenseExpiry),
93
- status: D(A.status),
94
- vehicleId: A.vehicleId || null,
95
- vehicleIds: A.vehicleIds,
96
- rating: A.rating.trim() ? Number(A.rating) : void 0,
97
- notes: A.notes.trim() || void 0,
98
- hireDate: be(A.hireDate),
99
- baseSalary: A.baseSalary.trim() ? Number(A.baseSalary) : void 0,
100
- bonusYtd: A.bonusYtd.trim() ? Number(A.bonusYtd) : void 0,
101
- payCurrency: A.payCurrency.trim() || void 0,
102
- ...e ? { onLeaveUntil: be(A.onLeaveUntil) ?? null } : {}
87
+ }, [n, u]);
88
+ let Be = () => i?.(k(r, "fleet/drivers")), $ = (e = !0) => ({
89
+ firstName: p.firstName.trim(),
90
+ lastName: p.lastName.trim(),
91
+ email: p.email.trim() || void 0,
92
+ phone: p.phone.trim() || void 0,
93
+ licenseNumber: p.licenseNumber.trim() || void 0,
94
+ licenseClass: p.licenseClass.trim() || void 0,
95
+ licenseExpiry: f ? ge(p.licenseExpiry, u?.licenseExpiry) : _e(p.licenseExpiry),
96
+ status: w(p.status),
97
+ vehicleId: p.vehicleId || null,
98
+ vehicleIds: p.vehicleIds,
99
+ rating: p.rating.trim() ? Number(p.rating) : void 0,
100
+ notes: p.notes.trim() || void 0,
101
+ hireDate: K(p.hireDate),
102
+ baseSalary: p.baseSalary.trim() ? Number(p.baseSalary) : void 0,
103
+ bonusYtd: p.bonusYtd.trim() ? Number(p.bonusYtd) : void 0,
104
+ payCurrency: p.payCurrency.trim() || void 0,
105
+ ...e ? { onLeaveUntil: K(p.onLeaveUntil) ?? null } : {}
103
106
  }), Ve = () => ({
104
- employeeId: A.employeeId.trim(),
107
+ employeeId: p.employeeId.trim(),
105
108
  ...$(!1)
106
109
  }), He = async (e) => {
107
- if (e.preventDefault(), !A.employeeId.trim() || !A.firstName.trim() || !A.lastName.trim()) B("Employee ID, first name and last name are required.");
108
- else if (!A.phone.trim()) B("Phone is required so this driver can be reached.");
110
+ if (e.preventDefault(), !p.employeeId.trim() || !p.firstName.trim() || !p.lastName.trim()) j("Employee ID, first name and last name are required.");
111
+ else if (!p.phone.trim()) j("Phone is required so this driver can be reached.");
109
112
  else {
110
- L(!0), B(null);
113
+ D(!0), j(null);
111
114
  try {
112
115
  if (n) {
113
- let e = await s(n, $());
114
- a?.(M(i, `fleet/drivers/${e.id}`));
116
+ let e = await o(n, $());
117
+ i?.(k(r, `fleet/drivers/${e.id}`));
115
118
  } else {
116
- let e = await o(Ve());
117
- a?.(M(i, `fleet/drivers/${e.id}`));
119
+ let e = await a(Ve());
120
+ i?.(k(r, `fleet/drivers/${e.id}`));
118
121
  }
119
122
  } catch (e) {
120
- console.error("Failed to save driver:", e), B(e instanceof Error ? e.message : "Failed to save driver. Please try again."), L(!1);
123
+ console.error("Failed to save driver:", e), j(e instanceof Error ? e.message : "Failed to save driver. Please try again."), D(!1);
121
124
  }
122
125
  }
123
126
  }, Ue = async () => {
124
- if (!n || !J.trim()) X("A reason is required to dismiss a driver.");
127
+ if (!n || !R.trim()) X("A reason is required to dismiss a driver.");
125
128
  else {
126
129
  Ce(!0), X(null);
127
130
  try {
128
- await s(n, {
131
+ await o(n, {
129
132
  ...$(),
130
133
  terminatedAt: (/* @__PURE__ */ new Date()).toISOString(),
131
- terminationReason: J.trim()
132
- }), q(!1), await m(), a?.(M(i, `fleet/drivers/${n}`));
134
+ terminationReason: R.trim()
135
+ }), P(!1), await d(), i?.(k(r, `fleet/drivers/${n}`));
133
136
  } catch (e) {
134
137
  X(e instanceof Error ? e.message : "Failed to dismiss driver.");
135
138
  } finally {
@@ -140,105 +143,105 @@ function K({ editId: n }) {
140
143
  if (n) {
141
144
  Ee(!0), Oe(null);
142
145
  try {
143
- await f(n), Z(!1), a?.(M(i, "fleet/drivers"));
146
+ await re(n), Z(!1), i?.(k(r, "fleet/drivers"));
144
147
  } catch (e) {
145
148
  Oe(e instanceof Error ? e.message : "Failed to delete driver.");
146
149
  } finally {
147
150
  Ee(!1);
148
151
  }
149
152
  }
150
- }, Ge = O && !!p?.terminatedAt;
151
- return /* @__PURE__ */ z(te, {
152
- title: O ? "Edit Driver" : "Add Driver",
153
+ }, Ge = f && !!u?.terminatedAt;
154
+ return /* @__PURE__ */ I(ie, {
155
+ title: f ? "Edit Driver" : "Add Driver",
153
156
  subtitle: "Add a driver to your workforce",
154
- icon: /* @__PURE__ */ R(e, { size: 24 }),
155
- headerActions: /* @__PURE__ */ z("div", {
157
+ icon: /* @__PURE__ */ F(e, { size: 24 }),
158
+ headerActions: /* @__PURE__ */ I("div", {
156
159
  className: "flex gap-2",
157
- children: [/* @__PURE__ */ z(h, {
160
+ children: [/* @__PURE__ */ I(h, {
158
161
  variant: "outline",
159
162
  onClick: Be,
160
- disabled: F,
161
- children: [/* @__PURE__ */ R(t, { size: 16 }), " Cancel"]
162
- }), /* @__PURE__ */ z(h, {
163
+ disabled: E,
164
+ children: [/* @__PURE__ */ F(t, { size: 16 }), " Cancel"]
165
+ }), /* @__PURE__ */ I(h, {
163
166
  onClick: He,
164
- disabled: F,
167
+ disabled: E,
165
168
  children: [
166
- /* @__PURE__ */ R(c, { size: 16 }),
169
+ /* @__PURE__ */ F(s, { size: 16 }),
167
170
  " ",
168
- O ? F ? "Saving..." : "Save Changes" : F ? "Saving..." : "Add Driver"
171
+ f ? E ? "Saving..." : "Save Changes" : E ? "Saving..." : "Add Driver"
169
172
  ]
170
173
  })]
171
174
  }),
172
175
  children: [
173
- /* @__PURE__ */ R(V, {
174
- icon: /* @__PURE__ */ R(e, { size: 18 }),
176
+ /* @__PURE__ */ F(xe, {
177
+ icon: /* @__PURE__ */ F(e, { size: 18 }),
175
178
  children: "Add a driver so they can be assigned to orders and routes. An employee ID, name and phone get them on the roster — add licensing, a vehicle and HR details to keep the record complete."
176
179
  }),
177
- Ge && p?.terminatedAt && /* @__PURE__ */ z("div", {
180
+ Ge && u?.terminatedAt && /* @__PURE__ */ I("div", {
178
181
  className: "rounded-card border border-status-error-border bg-status-error-bg-subtle p-4 text-sm text-status-error-text",
179
- children: [/* @__PURE__ */ z("p", {
182
+ children: [/* @__PURE__ */ I("p", {
180
183
  className: "font-medium",
181
184
  children: [
182
185
  "This driver was dismissed on ",
183
- j(p.terminatedAt, "full"),
186
+ O(u.terminatedAt, "full"),
184
187
  "."
185
188
  ]
186
- }), p.terminationReason && /* @__PURE__ */ z("p", {
189
+ }), u.terminationReason && /* @__PURE__ */ I("p", {
187
190
  className: "mt-1",
188
- children: ["Reason: ", p.terminationReason]
191
+ children: ["Reason: ", u.terminationReason]
189
192
  })]
190
193
  }),
191
- /* @__PURE__ */ z("form", {
194
+ /* @__PURE__ */ I("form", {
192
195
  onSubmit: He,
193
196
  className: "max-w-3xl space-y-6",
194
197
  children: [
195
- /* @__PURE__ */ R(N, { message: pe }),
196
- /* @__PURE__ */ z(he, { children: [/* @__PURE__ */ R("h2", {
198
+ /* @__PURE__ */ F(A, { message: ve }),
199
+ /* @__PURE__ */ I(L, { children: [/* @__PURE__ */ F("h2", {
197
200
  className: "text-base font-semibold text-text-primary mb-4",
198
201
  children: "Driver Details"
199
- }), /* @__PURE__ */ z("div", {
202
+ }), /* @__PURE__ */ I("div", {
200
203
  className: "space-y-4",
201
204
  children: [
202
- /* @__PURE__ */ z("div", {
205
+ /* @__PURE__ */ I("div", {
203
206
  className: "grid grid-cols-1 md:grid-cols-3 gap-4",
204
207
  children: [
205
- /* @__PURE__ */ z("div", {
208
+ /* @__PURE__ */ I("div", {
206
209
  className: "space-y-2",
207
- children: [/* @__PURE__ */ z(x, {
210
+ children: [/* @__PURE__ */ I(x, {
208
211
  htmlFor: "employeeId",
209
212
  children: [
210
213
  "Employee ID ",
211
- O ? "(immutable)" : "",
214
+ f ? "(immutable)" : "",
212
215
  " ",
213
- /* @__PURE__ */ R("span", {
216
+ /* @__PURE__ */ F("span", {
214
217
  className: "text-status-error-text",
215
- children: !O && "*"
218
+ children: !f && "*"
216
219
  })
217
220
  ]
218
- }), /* @__PURE__ */ R(b, {
221
+ }), /* @__PURE__ */ F(b, {
219
222
  id: "employeeId",
220
- value: A.employeeId,
221
- onChange: (e) => P((t) => ({
223
+ value: p.employeeId,
224
+ onChange: (e) => m((t) => ({
222
225
  ...t,
223
226
  employeeId: e.target.value
224
227
  })),
225
228
  placeholder: "EMP-001",
226
229
  required: !0,
227
- disabled: O
230
+ disabled: f
228
231
  })]
229
232
  }),
230
- /* @__PURE__ */ z("div", {
233
+ /* @__PURE__ */ I("div", {
231
234
  className: "space-y-2",
232
- children: [/* @__PURE__ */ z(x, {
235
+ children: [/* @__PURE__ */ I(x, {
233
236
  htmlFor: "firstName",
234
- children: ["First Name ", /* @__PURE__ */ R("span", {
237
+ children: ["First Name ", /* @__PURE__ */ F("span", {
235
238
  className: "text-status-error-text",
236
239
  children: "*"
237
240
  })]
238
- }), /* @__PURE__ */ R(b, {
241
+ }), /* @__PURE__ */ F(b, {
239
242
  id: "firstName",
240
- value: A.firstName,
241
- onChange: (e) => P((t) => ({
243
+ value: p.firstName,
244
+ onChange: (e) => m((t) => ({
242
245
  ...t,
243
246
  firstName: e.target.value
244
247
  })),
@@ -246,18 +249,18 @@ function K({ editId: n }) {
246
249
  required: !0
247
250
  })]
248
251
  }),
249
- /* @__PURE__ */ z("div", {
252
+ /* @__PURE__ */ I("div", {
250
253
  className: "space-y-2",
251
- children: [/* @__PURE__ */ z(x, {
254
+ children: [/* @__PURE__ */ I(x, {
252
255
  htmlFor: "lastName",
253
- children: ["Last Name ", /* @__PURE__ */ R("span", {
256
+ children: ["Last Name ", /* @__PURE__ */ F("span", {
254
257
  className: "text-status-error-text",
255
258
  children: "*"
256
259
  })]
257
- }), /* @__PURE__ */ R(b, {
260
+ }), /* @__PURE__ */ F(b, {
258
261
  id: "lastName",
259
- value: A.lastName,
260
- onChange: (e) => P((t) => ({
262
+ value: p.lastName,
263
+ onChange: (e) => m((t) => ({
261
264
  ...t,
262
265
  lastName: e.target.value
263
266
  })),
@@ -267,37 +270,37 @@ function K({ editId: n }) {
267
270
  })
268
271
  ]
269
272
  }),
270
- /* @__PURE__ */ z("div", {
273
+ /* @__PURE__ */ I("div", {
271
274
  className: "grid grid-cols-1 md:grid-cols-3 gap-4",
272
275
  children: [
273
- /* @__PURE__ */ z("div", {
276
+ /* @__PURE__ */ I("div", {
274
277
  className: "space-y-2",
275
- children: [/* @__PURE__ */ R(x, {
278
+ children: [/* @__PURE__ */ F(x, {
276
279
  htmlFor: "email",
277
280
  children: "Email"
278
- }), /* @__PURE__ */ R(b, {
281
+ }), /* @__PURE__ */ F(b, {
279
282
  id: "email",
280
283
  type: "email",
281
- value: A.email,
282
- onChange: (e) => P((t) => ({
284
+ value: p.email,
285
+ onChange: (e) => m((t) => ({
283
286
  ...t,
284
287
  email: e.target.value
285
288
  })),
286
289
  placeholder: "jane.doe@example.com"
287
290
  })]
288
291
  }),
289
- /* @__PURE__ */ z("div", {
292
+ /* @__PURE__ */ I("div", {
290
293
  className: "space-y-2",
291
- children: [/* @__PURE__ */ z(x, {
294
+ children: [/* @__PURE__ */ I(x, {
292
295
  htmlFor: "phone",
293
- children: ["Phone ", /* @__PURE__ */ R("span", {
296
+ children: ["Phone ", /* @__PURE__ */ F("span", {
294
297
  className: "text-status-error-text",
295
298
  children: "*"
296
299
  })]
297
- }), /* @__PURE__ */ R(b, {
300
+ }), /* @__PURE__ */ F(b, {
298
301
  id: "phone",
299
- value: A.phone,
300
- onChange: (e) => P((t) => ({
302
+ value: p.phone,
303
+ onChange: (e) => m((t) => ({
301
304
  ...t,
302
305
  phone: e.target.value
303
306
  })),
@@ -305,21 +308,21 @@ function K({ editId: n }) {
305
308
  required: !0
306
309
  })]
307
310
  }),
308
- /* @__PURE__ */ z("div", {
311
+ /* @__PURE__ */ I("div", {
309
312
  className: "space-y-2",
310
- children: [/* @__PURE__ */ R(x, {
313
+ children: [/* @__PURE__ */ F(x, {
311
314
  htmlFor: "status",
312
315
  children: "Status"
313
- }), /* @__PURE__ */ z(ne, {
314
- value: A.status,
315
- onValueChange: (e) => P((t) => ({
316
+ }), /* @__PURE__ */ I(ae, {
317
+ value: p.status,
318
+ onValueChange: (e) => m((t) => ({
316
319
  ...t,
317
320
  status: e
318
321
  })),
319
- children: [/* @__PURE__ */ R(w, {
322
+ children: [/* @__PURE__ */ F(ce, {
320
323
  id: "status",
321
- children: /* @__PURE__ */ R(re, {})
322
- }), /* @__PURE__ */ R(S, { children: ve.map((e) => /* @__PURE__ */ R(C, {
324
+ children: /* @__PURE__ */ F(le, {})
325
+ }), /* @__PURE__ */ F(oe, { children: Se.map((e) => /* @__PURE__ */ F(se, {
323
326
  value: e.value,
324
327
  children: e.label
325
328
  }, e.value)) })]
@@ -327,71 +330,71 @@ function K({ editId: n }) {
327
330
  })
328
331
  ]
329
332
  }),
330
- /* @__PURE__ */ z("div", {
333
+ /* @__PURE__ */ I("div", {
331
334
  className: "grid grid-cols-1 md:grid-cols-3 gap-4",
332
335
  children: [
333
- /* @__PURE__ */ z("div", {
336
+ /* @__PURE__ */ I("div", {
334
337
  className: "space-y-2",
335
- children: [/* @__PURE__ */ R(x, {
338
+ children: [/* @__PURE__ */ F(x, {
336
339
  htmlFor: "licenseNumber",
337
340
  children: "License Number"
338
- }), /* @__PURE__ */ R(b, {
341
+ }), /* @__PURE__ */ F(b, {
339
342
  id: "licenseNumber",
340
- value: A.licenseNumber,
341
- onChange: (e) => P((t) => ({
343
+ value: p.licenseNumber,
344
+ onChange: (e) => m((t) => ({
342
345
  ...t,
343
346
  licenseNumber: e.target.value
344
347
  })),
345
348
  placeholder: "D1234567"
346
349
  })]
347
350
  }),
348
- /* @__PURE__ */ z("div", {
351
+ /* @__PURE__ */ I("div", {
349
352
  className: "space-y-2",
350
- children: [/* @__PURE__ */ R(x, {
353
+ children: [/* @__PURE__ */ F(x, {
351
354
  htmlFor: "licenseClass",
352
355
  children: "License Class"
353
- }), /* @__PURE__ */ R(b, {
356
+ }), /* @__PURE__ */ F(b, {
354
357
  id: "licenseClass",
355
- value: A.licenseClass,
356
- onChange: (e) => P((t) => ({
358
+ value: p.licenseClass,
359
+ onChange: (e) => m((t) => ({
357
360
  ...t,
358
361
  licenseClass: e.target.value
359
362
  })),
360
363
  placeholder: "Class A"
361
364
  })]
362
365
  }),
363
- /* @__PURE__ */ z("div", {
366
+ /* @__PURE__ */ I("div", {
364
367
  className: "space-y-2 md:col-span-3",
365
368
  children: [
366
- /* @__PURE__ */ z("div", {
369
+ /* @__PURE__ */ I("div", {
367
370
  className: "flex items-center justify-between gap-2",
368
- children: [/* @__PURE__ */ R(x, {
371
+ children: [/* @__PURE__ */ F(x, {
369
372
  htmlFor: "licenseExpiry",
370
373
  children: "Licence expiry (UTC)"
371
- }), A.licenseExpiry && /* @__PURE__ */ R(h, {
374
+ }), p.licenseExpiry && /* @__PURE__ */ F(h, {
372
375
  type: "button",
373
376
  variant: "ghost",
374
377
  size: "sm",
375
378
  "aria-label": "Clear recorded licence expiry",
376
- onClick: () => P((e) => ({
379
+ onClick: () => m((e) => ({
377
380
  ...e,
378
381
  licenseExpiry: ""
379
382
  })),
380
383
  children: "Clear"
381
384
  })]
382
385
  }),
383
- /* @__PURE__ */ R(b, {
386
+ /* @__PURE__ */ F(b, {
384
387
  id: "licenseExpiry",
385
388
  type: "datetime-local",
386
389
  step: "0.001",
387
390
  "aria-describedby": "licenseExpiryHelp",
388
- value: A.licenseExpiry,
389
- onChange: (e) => P((t) => ({
391
+ value: p.licenseExpiry,
392
+ onChange: (e) => m((t) => ({
390
393
  ...t,
391
394
  licenseExpiry: e.target.value
392
395
  }))
393
396
  }),
394
- /* @__PURE__ */ R("p", {
397
+ /* @__PURE__ */ F("p", {
395
398
  id: "licenseExpiryHelp",
396
399
  className: "text-xs text-text-secondary",
397
400
  children: "Enter the recorded UTC time. Blank means expiry not recorded; clearing removes it. A recorded expiry does not certify legal driving eligibility."
@@ -400,28 +403,28 @@ function K({ editId: n }) {
400
403
  })
401
404
  ]
402
405
  }),
403
- /* @__PURE__ */ z("div", {
406
+ /* @__PURE__ */ I("div", {
404
407
  className: "grid grid-cols-1 md:grid-cols-2 gap-4",
405
- children: [/* @__PURE__ */ z("div", {
408
+ children: [/* @__PURE__ */ I("div", {
406
409
  className: "space-y-2",
407
- children: [/* @__PURE__ */ R(x, {
410
+ children: [/* @__PURE__ */ F(x, {
408
411
  htmlFor: "vehicleSearch",
409
412
  children: "Search vehicles"
410
- }), /* @__PURE__ */ R(b, {
413
+ }), /* @__PURE__ */ F(b, {
411
414
  id: "vehicleSearch",
412
415
  value: ke,
413
416
  onChange: (e) => Ae(e.target.value),
414
417
  placeholder: "Vehicle number or type"
415
418
  })]
416
- }), /* @__PURE__ */ z("div", {
419
+ }), /* @__PURE__ */ I("div", {
417
420
  className: "space-y-2",
418
- children: [/* @__PURE__ */ R(x, {
421
+ children: [/* @__PURE__ */ F(x, {
419
422
  htmlFor: "vehicle",
420
423
  children: "Assigned Vehicle"
421
- }), /* @__PURE__ */ R(E, {
424
+ }), /* @__PURE__ */ F(C, {
422
425
  id: "vehicle",
423
- value: A.vehicleId,
424
- onChange: (e) => P((t) => ({
426
+ value: p.vehicleId,
427
+ onChange: (e) => m((t) => ({
425
428
  ...t,
426
429
  vehicleId: e,
427
430
  vehicleIds: e ? [e] : []
@@ -430,8 +433,8 @@ function K({ editId: n }) {
430
433
  loading: Ne,
431
434
  getId: (e) => e.id,
432
435
  getLabel: (e) => `${e.vehicleNumber} (${e.type})`,
433
- renderOption: (e) => /* @__PURE__ */ z(me, { children: [
434
- /* @__PURE__ */ R(ee, {
436
+ renderOption: (e) => /* @__PURE__ */ I(be, { children: [
437
+ /* @__PURE__ */ F(te, {
435
438
  size: 14,
436
439
  className: "mr-2 inline text-text-secondary"
437
440
  }),
@@ -451,65 +454,65 @@ function K({ editId: n }) {
451
454
  })]
452
455
  })]
453
456
  }),
454
- /* @__PURE__ */ z("div", {
457
+ /* @__PURE__ */ I("div", {
455
458
  className: "grid grid-cols-1 md:grid-cols-3 gap-4",
456
459
  children: [
457
- /* @__PURE__ */ z("div", {
460
+ /* @__PURE__ */ I("div", {
458
461
  className: "space-y-2",
459
- children: [/* @__PURE__ */ R(x, {
462
+ children: [/* @__PURE__ */ F(x, {
460
463
  htmlFor: "rating",
461
464
  children: "Rating (0–5)"
462
- }), /* @__PURE__ */ R(b, {
465
+ }), /* @__PURE__ */ F(b, {
463
466
  id: "rating",
464
467
  type: "number",
465
468
  min: 0,
466
469
  max: 5,
467
470
  step: .1,
468
- value: A.rating,
469
- onChange: (e) => P((t) => ({
471
+ value: p.rating,
472
+ onChange: (e) => m((t) => ({
470
473
  ...t,
471
474
  rating: e.target.value
472
475
  })),
473
476
  placeholder: "4.8"
474
477
  })]
475
478
  }),
476
- /* @__PURE__ */ z("div", {
479
+ /* @__PURE__ */ I("div", {
477
480
  className: "space-y-2",
478
- children: [/* @__PURE__ */ R(x, {
481
+ children: [/* @__PURE__ */ F(x, {
479
482
  htmlFor: "hireDate",
480
483
  children: "Hire Date"
481
- }), /* @__PURE__ */ R(b, {
484
+ }), /* @__PURE__ */ F(b, {
482
485
  id: "hireDate",
483
486
  type: "date",
484
- value: A.hireDate,
485
- onChange: (e) => P((t) => ({
487
+ value: p.hireDate,
488
+ onChange: (e) => m((t) => ({
486
489
  ...t,
487
490
  hireDate: e.target.value
488
491
  }))
489
492
  })]
490
493
  }),
491
- /* @__PURE__ */ z("div", {
494
+ /* @__PURE__ */ I("div", {
492
495
  className: "space-y-2",
493
- children: [/* @__PURE__ */ z("div", {
496
+ children: [/* @__PURE__ */ I("div", {
494
497
  className: "flex items-center justify-between gap-2",
495
- children: [/* @__PURE__ */ R(x, {
498
+ children: [/* @__PURE__ */ F(x, {
496
499
  htmlFor: "onLeaveUntil",
497
500
  children: "On Leave Until"
498
- }), A.onLeaveUntil && /* @__PURE__ */ R(h, {
501
+ }), p.onLeaveUntil && /* @__PURE__ */ F(h, {
499
502
  type: "button",
500
503
  variant: "ghost",
501
504
  size: "sm",
502
- onClick: () => P((e) => ({
505
+ onClick: () => m((e) => ({
503
506
  ...e,
504
507
  onLeaveUntil: ""
505
508
  })),
506
509
  children: "Clear"
507
510
  })]
508
- }), /* @__PURE__ */ R(b, {
511
+ }), /* @__PURE__ */ F(b, {
509
512
  id: "onLeaveUntil",
510
513
  type: "date",
511
- value: A.onLeaveUntil,
512
- onChange: (e) => P((t) => ({
514
+ value: p.onLeaveUntil,
515
+ onChange: (e) => m((t) => ({
513
516
  ...t,
514
517
  onLeaveUntil: e.target.value
515
518
  }))
@@ -519,57 +522,57 @@ function K({ editId: n }) {
519
522
  })
520
523
  ]
521
524
  })] }),
522
- /* @__PURE__ */ z(g, { children: [/* @__PURE__ */ R(v, { children: /* @__PURE__ */ z(y, {
525
+ /* @__PURE__ */ I(g, { children: [/* @__PURE__ */ F(v, { children: /* @__PURE__ */ I(y, {
523
526
  className: "flex items-center gap-2",
524
- children: [/* @__PURE__ */ R(r, { size: 18 }), " Compensation"]
525
- }) }), /* @__PURE__ */ R(_, { children: /* @__PURE__ */ z("div", {
527
+ children: [/* @__PURE__ */ F(ee, { size: 18 }), " Compensation"]
528
+ }) }), /* @__PURE__ */ F(_, { children: /* @__PURE__ */ I("div", {
526
529
  className: "grid grid-cols-1 md:grid-cols-3 gap-4",
527
530
  children: [
528
- /* @__PURE__ */ z("div", {
531
+ /* @__PURE__ */ I("div", {
529
532
  className: "space-y-2",
530
- children: [/* @__PURE__ */ R(x, {
533
+ children: [/* @__PURE__ */ F(x, {
531
534
  htmlFor: "baseSalary",
532
535
  children: "Base Salary (annual)"
533
- }), /* @__PURE__ */ R(b, {
536
+ }), /* @__PURE__ */ F(b, {
534
537
  id: "baseSalary",
535
538
  type: "number",
536
539
  min: 0,
537
540
  step: .01,
538
- value: A.baseSalary,
539
- onChange: (e) => P((t) => ({
541
+ value: p.baseSalary,
542
+ onChange: (e) => m((t) => ({
540
543
  ...t,
541
544
  baseSalary: e.target.value
542
545
  })),
543
546
  placeholder: "55000"
544
547
  })]
545
548
  }),
546
- /* @__PURE__ */ z("div", {
549
+ /* @__PURE__ */ I("div", {
547
550
  className: "space-y-2",
548
- children: [/* @__PURE__ */ R(x, {
551
+ children: [/* @__PURE__ */ F(x, {
549
552
  htmlFor: "bonusYtd",
550
553
  children: "Bonus (YTD)"
551
- }), /* @__PURE__ */ R(b, {
554
+ }), /* @__PURE__ */ F(b, {
552
555
  id: "bonusYtd",
553
556
  type: "number",
554
557
  min: 0,
555
558
  step: .01,
556
- value: A.bonusYtd,
557
- onChange: (e) => P((t) => ({
559
+ value: p.bonusYtd,
560
+ onChange: (e) => m((t) => ({
558
561
  ...t,
559
562
  bonusYtd: e.target.value
560
563
  })),
561
564
  placeholder: "1200"
562
565
  })]
563
566
  }),
564
- /* @__PURE__ */ z("div", {
567
+ /* @__PURE__ */ I("div", {
565
568
  className: "space-y-2",
566
- children: [/* @__PURE__ */ R(x, {
569
+ children: [/* @__PURE__ */ F(x, {
567
570
  htmlFor: "payCurrency",
568
571
  children: "Currency"
569
- }), /* @__PURE__ */ R(b, {
572
+ }), /* @__PURE__ */ F(b, {
570
573
  id: "payCurrency",
571
- value: A.payCurrency,
572
- onChange: (e) => P((t) => ({
574
+ value: p.payCurrency,
575
+ onChange: (e) => m((t) => ({
573
576
  ...t,
574
577
  payCurrency: e.target.value
575
578
  })),
@@ -579,71 +582,71 @@ function K({ editId: n }) {
579
582
  })
580
583
  ]
581
584
  }) })] }),
582
- /* @__PURE__ */ z(g, { children: [/* @__PURE__ */ R(v, { children: /* @__PURE__ */ z(y, {
585
+ /* @__PURE__ */ I(g, { children: [/* @__PURE__ */ F(v, { children: /* @__PURE__ */ I(y, {
583
586
  className: "flex items-center gap-2",
584
- children: [/* @__PURE__ */ R(d, { size: 18 }), " HR Notes"]
585
- }) }), /* @__PURE__ */ R(_, { children: /* @__PURE__ */ R(T, {
586
- value: A.notes,
587
- onChange: (e) => P((t) => ({
587
+ children: [/* @__PURE__ */ F(ne, { size: 18 }), " HR Notes"]
588
+ }) }), /* @__PURE__ */ F(_, { children: /* @__PURE__ */ F(S, {
589
+ value: p.notes,
590
+ onChange: (e) => m((t) => ({
588
591
  ...t,
589
592
  notes: e.target.value
590
593
  })),
591
594
  placeholder: "Performance notes, disciplinary history, anything worth tracking for this driver...",
592
595
  rows: 4
593
596
  }) })] }),
594
- O && !Ge && /* @__PURE__ */ z(g, {
597
+ f && !Ge && /* @__PURE__ */ I(g, {
595
598
  className: "border-status-error-border",
596
- children: [/* @__PURE__ */ R(v, { children: /* @__PURE__ */ z(y, {
599
+ children: [/* @__PURE__ */ F(v, { children: /* @__PURE__ */ I(y, {
597
600
  className: "flex items-center gap-2 text-status-error-text",
598
- children: [/* @__PURE__ */ R(l, { size: 18 }), " Dismiss Driver"]
599
- }) }), /* @__PURE__ */ z(_, { children: [/* @__PURE__ */ R("p", {
601
+ children: [/* @__PURE__ */ F(c, { size: 18 }), " Dismiss Driver"]
602
+ }) }), /* @__PURE__ */ I(_, { children: [/* @__PURE__ */ F("p", {
600
603
  className: "mb-3 text-sm text-text-secondary",
601
604
  children: "Dismissing a driver marks them as no longer employed. Their delivery and route history stays visible; they can no longer be assigned new work. This cannot be undone from here."
602
- }), /* @__PURE__ */ z(h, {
605
+ }), /* @__PURE__ */ I(h, {
603
606
  type: "button",
604
607
  variant: "outline",
605
608
  className: "border-status-error-border text-status-error-text hover:bg-status-error-bg-subtle",
606
- onClick: () => q(!0),
607
- children: [/* @__PURE__ */ R(l, { size: 16 }), " Dismiss this driver"]
609
+ onClick: () => P(!0),
610
+ children: [/* @__PURE__ */ F(c, { size: 16 }), " Dismiss this driver"]
608
611
  })] })]
609
612
  }),
610
- O && /* @__PURE__ */ z(g, {
613
+ f && /* @__PURE__ */ I(g, {
611
614
  className: "border-status-error-border",
612
- children: [/* @__PURE__ */ R(v, { children: /* @__PURE__ */ z(y, {
615
+ children: [/* @__PURE__ */ F(v, { children: /* @__PURE__ */ I(y, {
613
616
  className: "flex items-center gap-2 text-status-error-text",
614
- children: [/* @__PURE__ */ R(u, { size: 18 }), " Delete Driver"]
615
- }) }), /* @__PURE__ */ z(_, { children: [/* @__PURE__ */ R("p", {
617
+ children: [/* @__PURE__ */ F(l, { size: 18 }), " Delete Driver"]
618
+ }) }), /* @__PURE__ */ I(_, { children: [/* @__PURE__ */ F("p", {
616
619
  className: "mb-3 text-sm text-text-secondary",
617
620
  children: "Removes this driver record, for example one entered by mistake, and unlinks them from any vehicle. To keep delivery history for someone who has left, dismiss them instead. This cannot be undone from here."
618
- }), /* @__PURE__ */ z(h, {
621
+ }), /* @__PURE__ */ I(h, {
619
622
  type: "button",
620
623
  variant: "outline",
621
624
  className: "border-status-error-border text-status-error-text hover:bg-status-error-bg-subtle",
622
625
  onClick: () => Z(!0),
623
- children: [/* @__PURE__ */ R(u, { size: 16 }), " Delete this driver"]
626
+ children: [/* @__PURE__ */ F(l, { size: 16 }), " Delete this driver"]
624
627
  })] })]
625
628
  })
626
629
  ]
627
630
  }),
628
- /* @__PURE__ */ R(H, {
631
+ /* @__PURE__ */ F(z, {
629
632
  open: Te,
630
633
  onOpenChange: Z,
631
- children: /* @__PURE__ */ z(U, { children: [
632
- /* @__PURE__ */ z(ge, { children: [/* @__PURE__ */ R(_e, { children: "Delete this driver?" }), /* @__PURE__ */ z(W, { children: [
634
+ children: /* @__PURE__ */ I(B, { children: [
635
+ /* @__PURE__ */ I(U, { children: [/* @__PURE__ */ F(W, { children: "Delete this driver?" }), /* @__PURE__ */ I(V, { children: [
633
636
  "This removes ",
634
- `${A.firstName} ${A.lastName}`.trim() || "this driver",
637
+ `${p.firstName} ${p.lastName}`.trim() || "this driver",
635
638
  " and unlinks them from any vehicle. It cannot be undone from here."
636
639
  ] })] }),
637
- /* @__PURE__ */ R("div", {
640
+ /* @__PURE__ */ F("div", {
638
641
  className: "px-1",
639
- children: /* @__PURE__ */ R(N, { message: De })
642
+ children: /* @__PURE__ */ F(A, { message: De })
640
643
  }),
641
- /* @__PURE__ */ z(G, { children: [/* @__PURE__ */ R(h, {
644
+ /* @__PURE__ */ I(H, { children: [/* @__PURE__ */ F(h, {
642
645
  variant: "outline",
643
646
  onClick: () => Z(!1),
644
647
  disabled: Q,
645
648
  children: "Cancel"
646
- }), /* @__PURE__ */ R(h, {
649
+ }), /* @__PURE__ */ F(h, {
647
650
  className: "bg-status-error-text text-text-inverse hover:opacity-90",
648
651
  onClick: We,
649
652
  disabled: Q,
@@ -651,37 +654,37 @@ function K({ editId: n }) {
651
654
  })] })
652
655
  ] })
653
656
  }),
654
- /* @__PURE__ */ R(H, {
655
- open: K,
656
- onOpenChange: q,
657
- children: /* @__PURE__ */ z(U, { children: [
658
- /* @__PURE__ */ z(ge, { children: [/* @__PURE__ */ R(_e, { children: "Dismiss this driver?" }), /* @__PURE__ */ R(W, { children: "This records the driver as dismissed and requires a reason. It cannot be undone from here." })] }),
659
- /* @__PURE__ */ z("div", {
657
+ /* @__PURE__ */ F(z, {
658
+ open: ye,
659
+ onOpenChange: P,
660
+ children: /* @__PURE__ */ I(B, { children: [
661
+ /* @__PURE__ */ I(U, { children: [/* @__PURE__ */ F(W, { children: "Dismiss this driver?" }), /* @__PURE__ */ F(V, { children: "This records the driver as dismissed and requires a reason. It cannot be undone from here." })] }),
662
+ /* @__PURE__ */ I("div", {
660
663
  className: "space-y-2 px-1",
661
664
  children: [
662
- /* @__PURE__ */ z(x, {
665
+ /* @__PURE__ */ I(x, {
663
666
  htmlFor: "dismissReason",
664
- children: ["Reason ", /* @__PURE__ */ R("span", {
667
+ children: ["Reason ", /* @__PURE__ */ F("span", {
665
668
  className: "text-status-error-text",
666
669
  children: "*"
667
670
  })]
668
671
  }),
669
- /* @__PURE__ */ R(T, {
672
+ /* @__PURE__ */ F(S, {
670
673
  id: "dismissReason",
671
- value: J,
672
- onChange: (e) => Se(e.target.value),
674
+ value: R,
675
+ onChange: (e) => J(e.target.value),
673
676
  placeholder: "e.g. Repeated policy violations, voluntary resignation, performance...",
674
677
  rows: 3
675
678
  }),
676
- /* @__PURE__ */ R(N, { message: we })
679
+ /* @__PURE__ */ F(A, { message: we })
677
680
  ]
678
681
  }),
679
- /* @__PURE__ */ z(G, { children: [/* @__PURE__ */ R(h, {
682
+ /* @__PURE__ */ I(H, { children: [/* @__PURE__ */ F(h, {
680
683
  variant: "outline",
681
- onClick: () => q(!1),
684
+ onClick: () => P(!1),
682
685
  disabled: Y,
683
686
  children: "Cancel"
684
- }), /* @__PURE__ */ R(h, {
687
+ }), /* @__PURE__ */ F(h, {
685
688
  className: "bg-status-error-text text-text-inverse hover:opacity-90",
686
689
  onClick: Ue,
687
690
  disabled: Y,
@@ -692,41 +695,51 @@ function K({ editId: n }) {
692
695
  ]
693
696
  });
694
697
  }
695
- function q() {
696
- let { driverId: c } = pe(), l = L().pathname.endsWith("/edit"), { basePath: u, navigate: b } = k(), { driver: x, isLoading: ne, error: S, refetch: C } = ie(c);
697
- O(l, C);
698
- let { vehicle: w } = oe(x?.assignedVehicle), re = () => b?.(M(u, "fleet/drivers")), T = (e) => b?.(M(u, e));
699
- if (!c) return /* @__PURE__ */ R(K, {});
700
- if (l) return /* @__PURE__ */ R(K, { editId: c });
701
- if (ne) return /* @__PURE__ */ R(p, { message: "Loading driver details..." });
702
- if (S || !x) return /* @__PURE__ */ R(f, {
698
+ function Y() {
699
+ let { driverId: s } = P(), c = ye().pathname.endsWith("/edit"), { basePath: S, navigate: C } = me(), { driver: w, isLoading: de, error: pe, refetch: T, addShift: he, removeShift: ge, addComplianceRecord: _e, removeComplianceRecord: A } = ue(s), [j, M] = N(!1), [L, z] = N({
700
+ shiftDate: (/* @__PURE__ */ new Date()).toISOString().slice(0, 10),
701
+ startTime: "08:00",
702
+ endTime: "16:00",
703
+ status: "SCHEDULED"
704
+ }), [B, V] = N(!1), [H, U] = N({
705
+ recordType: "MEDICAL_CERT",
706
+ status: "VALID",
707
+ expiresAt: "",
708
+ referenceNumber: ""
709
+ });
710
+ E(c, T);
711
+ let { vehicle: W } = fe(w?.assignedVehicle), Se = () => C?.(k(S, "fleet/drivers")), G = (e) => C?.(k(S, e));
712
+ if (!s) return /* @__PURE__ */ F(J, {});
713
+ if (c) return /* @__PURE__ */ F(J, { editId: s });
714
+ if (de) return /* @__PURE__ */ F(p, { message: "Loading driver details..." });
715
+ if (pe || !w) return /* @__PURE__ */ F(f, {
703
716
  title: "Driver not found",
704
- onRetry: C
717
+ onRetry: T
705
718
  });
706
- let E = !!x.terminatedAt, D = x.onLeaveUntil && x.onLeaveUntil.getTime() > (/* @__PURE__ */ new Date()).getTime() ? x.onLeaveUntil : void 0, ae = x.baseSalary !== void 0 || x.bonusYtd !== void 0;
707
- return /* @__PURE__ */ z(te, {
708
- title: x.fullName,
709
- subtitle: `Employee ID: ${x.employeeId}`,
710
- icon: /* @__PURE__ */ R(e, { size: 24 }),
711
- headerActions: /* @__PURE__ */ z("div", {
719
+ let K = !!w.terminatedAt, q = w.onLeaveUntil && w.onLeaveUntil.getTime() > (/* @__PURE__ */ new Date()).getTime() ? w.onLeaveUntil : void 0, Y = w.baseSalary !== void 0 || w.bonusYtd !== void 0;
720
+ return /* @__PURE__ */ I(ie, {
721
+ title: w.fullName,
722
+ subtitle: `Employee ID: ${w.employeeId}`,
723
+ icon: /* @__PURE__ */ F(e, { size: 24 }),
724
+ headerActions: /* @__PURE__ */ I("div", {
712
725
  className: "flex gap-2",
713
- children: [/* @__PURE__ */ z(h, {
726
+ children: [/* @__PURE__ */ I(h, {
714
727
  variant: "outline",
715
- onClick: re,
716
- children: [/* @__PURE__ */ R(t, { size: 16 }), " Back"]
717
- }), /* @__PURE__ */ z(h, {
718
- onClick: () => b?.(M(u, "fleet/drivers/" + c + "/edit")),
719
- children: [/* @__PURE__ */ R(o, { size: 16 }), " Edit"]
728
+ onClick: Se,
729
+ children: [/* @__PURE__ */ F(t, { size: 16 }), " Back"]
730
+ }), /* @__PURE__ */ I(h, {
731
+ onClick: () => C?.(k(S, "fleet/drivers/" + s + "/edit")),
732
+ children: [/* @__PURE__ */ F(a, { size: 16 }), " Edit"]
720
733
  })]
721
734
  }),
722
- headerContent: /* @__PURE__ */ z("div", {
735
+ headerContent: /* @__PURE__ */ I("div", {
723
736
  className: "flex flex-wrap items-center gap-4",
724
737
  children: [
725
- /* @__PURE__ */ R(m, {
726
- status: x.status,
738
+ /* @__PURE__ */ F(m, {
739
+ status: w.status,
727
740
  type: "driver"
728
741
  }),
729
- E && /* @__PURE__ */ R(m, {
742
+ K && /* @__PURE__ */ F(m, {
730
743
  status: "dismissed",
731
744
  label: "Dismissed",
732
745
  customColors: {
@@ -734,168 +747,429 @@ function q() {
734
747
  text: "text-status-error-text"
735
748
  }
736
749
  }),
737
- D && !E && /* @__PURE__ */ R(m, {
750
+ q && !K && /* @__PURE__ */ F(m, {
738
751
  status: "on_leave",
739
- label: `On leave until ${j(D, "short")}`,
752
+ label: `On leave until ${O(q, "short")}`,
740
753
  customColors: {
741
754
  bg: "bg-status-warning-bg-subtle",
742
755
  text: "text-status-warning-text"
743
756
  }
744
757
  }),
745
- x.rating !== void 0 && /* @__PURE__ */ z("div", {
758
+ w.rating !== void 0 && /* @__PURE__ */ I("div", {
746
759
  className: "flex items-center gap-1",
747
- children: [/* @__PURE__ */ R(n, {
760
+ children: [/* @__PURE__ */ F(n, {
748
761
  size: 16,
749
762
  className: "text-status-warning-text fill-current"
750
- }), /* @__PURE__ */ R("span", {
763
+ }), /* @__PURE__ */ F("span", {
751
764
  className: "font-medium",
752
- children: x.rating.toFixed(1)
765
+ children: w.rating.toFixed(1)
753
766
  })]
754
767
  })
755
768
  ]
756
769
  }),
757
770
  children: [
758
- /* @__PURE__ */ R(V, {
759
- icon: /* @__PURE__ */ R(e, { size: 18 }),
771
+ /* @__PURE__ */ F(xe, {
772
+ icon: /* @__PURE__ */ F(e, { size: 18 }),
760
773
  children: "Review the recorded licensing, assigned vehicle, documents and HR facts before assignment. These records do not certify legal driving eligibility or duty-hours availability."
761
774
  }),
762
- /* @__PURE__ */ R(B, {
775
+ /* @__PURE__ */ F(R, {
763
776
  storageKey: "movethewheels-driver-details",
764
777
  steps: [
765
778
  {
766
779
  id: "assign",
767
780
  label: "Assign to an order",
768
781
  description: "Hand a pending delivery to this driver.",
769
- icon: /* @__PURE__ */ R(s, { size: 16 }),
770
- onClick: () => T("orders")
782
+ icon: /* @__PURE__ */ F(o, { size: 16 }),
783
+ onClick: () => G("orders")
771
784
  },
772
785
  {
773
786
  id: "routes",
774
787
  label: "Plan their route",
775
788
  description: "Batch nearby drop-offs into an optimized itinerary.",
776
- icon: /* @__PURE__ */ R(i, { size: 16 }),
777
- onClick: () => T("routes")
789
+ icon: /* @__PURE__ */ F(r, { size: 16 }),
790
+ onClick: () => G("routes")
778
791
  },
779
792
  {
780
793
  id: "edit",
781
794
  label: "Update driver record",
782
795
  description: "Refresh documents, license or HR details.",
783
- icon: /* @__PURE__ */ R(o, { size: 16 }),
796
+ icon: /* @__PURE__ */ F(a, { size: 16 }),
784
797
  onClick: () => {}
785
798
  }
786
799
  ]
787
800
  }),
788
- E && /* @__PURE__ */ z("div", {
801
+ K && /* @__PURE__ */ I("div", {
789
802
  className: "rounded-card border border-status-error-border bg-status-error-bg-subtle p-4 text-sm text-status-error-text",
790
- children: [/* @__PURE__ */ z("p", {
803
+ children: [/* @__PURE__ */ I("p", {
791
804
  className: "font-medium",
792
- children: ["Dismissed ", x.terminatedAt && j(x.terminatedAt, "full")]
793
- }), x.terminationReason && /* @__PURE__ */ z("p", {
805
+ children: ["Dismissed ", w.terminatedAt && O(w.terminatedAt, "full")]
806
+ }), w.terminationReason && /* @__PURE__ */ I("p", {
794
807
  className: "mt-1",
795
- children: ["Reason: ", x.terminationReason]
808
+ children: ["Reason: ", w.terminationReason]
796
809
  })]
797
810
  }),
798
- /* @__PURE__ */ z("div", {
811
+ /* @__PURE__ */ I("div", {
799
812
  className: "grid grid-cols-1 lg:grid-cols-3 gap-6",
800
- children: [/* @__PURE__ */ z("div", {
813
+ children: [/* @__PURE__ */ I("div", {
801
814
  className: "lg:col-span-2 space-y-6",
802
815
  children: [
803
- /* @__PURE__ */ z(g, { children: [/* @__PURE__ */ R(v, { children: /* @__PURE__ */ z(y, {
816
+ /* @__PURE__ */ I(g, { children: [/* @__PURE__ */ F(v, { children: /* @__PURE__ */ I(y, {
804
817
  className: "flex items-center gap-2",
805
- children: [/* @__PURE__ */ R(a, { size: 18 }), " License"]
806
- }) }), /* @__PURE__ */ R(_, { children: /* @__PURE__ */ R("div", {
818
+ children: [/* @__PURE__ */ F(i, { size: 18 }), " License"]
819
+ }) }), /* @__PURE__ */ F(_, { children: /* @__PURE__ */ F("div", {
807
820
  className: "flex items-center justify-between p-3 border rounded-lg",
808
- children: /* @__PURE__ */ z("div", { children: [
809
- /* @__PURE__ */ R("p", {
821
+ children: /* @__PURE__ */ I("div", { children: [
822
+ /* @__PURE__ */ F("p", {
810
823
  className: "font-medium",
811
824
  children: "Driver's License"
812
825
  }),
813
- /* @__PURE__ */ z("p", {
826
+ /* @__PURE__ */ I("p", {
814
827
  className: "text-sm text-text-secondary",
815
- children: [x.licenseNumber || "—", x.licenseType ? ` - ${x.licenseType}` : ""]
828
+ children: [w.licenseNumber || "—", w.licenseType ? ` - ${w.licenseType}` : ""]
816
829
  }),
817
- /* @__PURE__ */ R("p", {
830
+ /* @__PURE__ */ F("p", {
818
831
  className: "text-sm text-text-secondary break-all",
819
- children: x.licenseExpiry ? `Recorded expiry (UTC): ${x.licenseExpiry.toISOString()}` : "Expiry not recorded"
832
+ children: w.licenseExpiry ? `Recorded expiry (UTC): ${w.licenseExpiry.toISOString()}` : "Expiry not recorded"
820
833
  })
821
834
  ] })
822
835
  }) })] }),
823
- x.notes && /* @__PURE__ */ z(g, { children: [/* @__PURE__ */ R(v, { children: /* @__PURE__ */ z(y, {
836
+ w.notes && /* @__PURE__ */ I(g, { children: [/* @__PURE__ */ F(v, { children: /* @__PURE__ */ I(y, {
824
837
  className: "flex items-center gap-2",
825
- children: [/* @__PURE__ */ R(d, { size: 18 }), " HR Notes"]
826
- }) }), /* @__PURE__ */ R(_, { children: /* @__PURE__ */ R("p", {
838
+ children: [/* @__PURE__ */ F(ne, { size: 18 }), " HR Notes"]
839
+ }) }), /* @__PURE__ */ F(_, { children: /* @__PURE__ */ F("p", {
827
840
  className: "text-sm whitespace-pre-wrap",
828
- children: x.notes
841
+ children: w.notes
829
842
  }) })] }),
830
- /* @__PURE__ */ R(P, {
843
+ /* @__PURE__ */ F(ve, {
831
844
  entityType: "driver",
832
- entityId: x.id
833
- })
845
+ entityId: w.id
846
+ }),
847
+ /* @__PURE__ */ I(g, { children: [/* @__PURE__ */ I(v, {
848
+ className: "flex flex-row items-center justify-between gap-2",
849
+ children: [/* @__PURE__ */ I(y, {
850
+ className: "flex items-center gap-2",
851
+ children: [/* @__PURE__ */ F(u, {
852
+ size: 18,
853
+ "aria-hidden": "true"
854
+ }), " Shift Roster"]
855
+ }), /* @__PURE__ */ I(h, {
856
+ variant: "outline",
857
+ size: "sm",
858
+ onClick: () => M((e) => !e),
859
+ children: [
860
+ /* @__PURE__ */ F(d, {
861
+ size: 14,
862
+ "aria-hidden": "true"
863
+ }),
864
+ " ",
865
+ j ? "Close" : "Add shift"
866
+ ]
867
+ })]
868
+ }), /* @__PURE__ */ I(_, {
869
+ className: "space-y-4",
870
+ children: [j && /* @__PURE__ */ I("form", {
871
+ className: "space-y-3 rounded-lg border border-border-seam p-3",
872
+ onSubmit: async (e) => {
873
+ e.preventDefault(), await he({
874
+ shiftDate: `${L.shiftDate}T12:00:00.000Z`,
875
+ startTime: L.startTime,
876
+ endTime: L.endTime,
877
+ status: L.status
878
+ }), M(!1);
879
+ },
880
+ children: [/* @__PURE__ */ I("div", {
881
+ className: "grid grid-cols-1 sm:grid-cols-3 gap-3",
882
+ children: [
883
+ /* @__PURE__ */ I("div", {
884
+ className: "space-y-1",
885
+ children: [/* @__PURE__ */ F(x, {
886
+ htmlFor: "shift-date",
887
+ children: "Date"
888
+ }), /* @__PURE__ */ F(b, {
889
+ id: "shift-date",
890
+ type: "date",
891
+ required: !0,
892
+ value: L.shiftDate,
893
+ onChange: (e) => z((t) => ({
894
+ ...t,
895
+ shiftDate: e.target.value
896
+ }))
897
+ })]
898
+ }),
899
+ /* @__PURE__ */ I("div", {
900
+ className: "space-y-1",
901
+ children: [/* @__PURE__ */ F(x, {
902
+ htmlFor: "shift-start",
903
+ children: "Start"
904
+ }), /* @__PURE__ */ F(b, {
905
+ id: "shift-start",
906
+ type: "time",
907
+ required: !0,
908
+ value: L.startTime,
909
+ onChange: (e) => z((t) => ({
910
+ ...t,
911
+ startTime: e.target.value
912
+ }))
913
+ })]
914
+ }),
915
+ /* @__PURE__ */ I("div", {
916
+ className: "space-y-1",
917
+ children: [/* @__PURE__ */ F(x, {
918
+ htmlFor: "shift-end",
919
+ children: "End"
920
+ }), /* @__PURE__ */ F(b, {
921
+ id: "shift-end",
922
+ type: "time",
923
+ required: !0,
924
+ value: L.endTime,
925
+ onChange: (e) => z((t) => ({
926
+ ...t,
927
+ endTime: e.target.value
928
+ }))
929
+ })]
930
+ })
931
+ ]
932
+ }), /* @__PURE__ */ F(h, {
933
+ type: "submit",
934
+ size: "sm",
935
+ children: "Save shift"
936
+ })]
937
+ }), w.shifts && w.shifts.length > 0 ? /* @__PURE__ */ F("ul", {
938
+ className: "divide-y divide-border-seam",
939
+ children: w.shifts.map((e) => /* @__PURE__ */ I("li", {
940
+ className: "flex items-center justify-between gap-3 py-2 text-sm",
941
+ children: [/* @__PURE__ */ I("div", { children: [/* @__PURE__ */ I("p", {
942
+ className: "font-medium",
943
+ children: [
944
+ O(e.shiftDate, "short"),
945
+ " · ",
946
+ e.startTime,
947
+ " –",
948
+ " ",
949
+ e.endTime
950
+ ]
951
+ }), /* @__PURE__ */ I("p", {
952
+ className: "text-xs text-text-secondary",
953
+ children: [e.status, e.notes ? ` · ${e.notes}` : ""]
954
+ })] }), /* @__PURE__ */ F(h, {
955
+ variant: "ghost",
956
+ size: "sm",
957
+ className: "text-status-error-text",
958
+ "aria-label": `Delete shift ${e.startTime}`,
959
+ onClick: () => void ge(e.id),
960
+ children: /* @__PURE__ */ F(l, {
961
+ size: 14,
962
+ "aria-hidden": "true"
963
+ })
964
+ })]
965
+ }, e.id))
966
+ }) : /* @__PURE__ */ F("p", {
967
+ className: "text-sm text-text-secondary",
968
+ children: "No shifts scheduled yet."
969
+ })]
970
+ })] }),
971
+ /* @__PURE__ */ I(g, { children: [/* @__PURE__ */ I(v, {
972
+ className: "flex flex-row items-center justify-between gap-2",
973
+ children: [/* @__PURE__ */ I(y, {
974
+ className: "flex items-center gap-2",
975
+ children: [/* @__PURE__ */ F(re, {
976
+ size: 18,
977
+ "aria-hidden": "true"
978
+ }), " Compliance Records"]
979
+ }), /* @__PURE__ */ I(h, {
980
+ variant: "outline",
981
+ size: "sm",
982
+ onClick: () => V((e) => !e),
983
+ children: [
984
+ /* @__PURE__ */ F(d, {
985
+ size: 14,
986
+ "aria-hidden": "true"
987
+ }),
988
+ " ",
989
+ B ? "Close" : "Add record"
990
+ ]
991
+ })]
992
+ }), /* @__PURE__ */ I(_, {
993
+ className: "space-y-4",
994
+ children: [B && /* @__PURE__ */ I("form", {
995
+ className: "space-y-3 rounded-lg border border-border-seam p-3",
996
+ onSubmit: async (e) => {
997
+ e.preventDefault(), await _e({
998
+ recordType: H.recordType,
999
+ status: H.status,
1000
+ expiresAt: H.expiresAt ? `${H.expiresAt}T12:00:00.000Z` : void 0,
1001
+ referenceNumber: H.referenceNumber.trim() || void 0
1002
+ }), V(!1), U({
1003
+ recordType: "MEDICAL_CERT",
1004
+ status: "VALID",
1005
+ expiresAt: "",
1006
+ referenceNumber: ""
1007
+ });
1008
+ },
1009
+ children: [/* @__PURE__ */ I("div", {
1010
+ className: "grid grid-cols-1 sm:grid-cols-3 gap-3",
1011
+ children: [
1012
+ /* @__PURE__ */ I("div", {
1013
+ className: "space-y-1",
1014
+ children: [/* @__PURE__ */ F(x, {
1015
+ htmlFor: "comp-type",
1016
+ children: "Record Type"
1017
+ }), /* @__PURE__ */ I(ae, {
1018
+ value: H.recordType,
1019
+ onValueChange: (e) => U((t) => ({
1020
+ ...t,
1021
+ recordType: e
1022
+ })),
1023
+ children: [/* @__PURE__ */ F(ce, {
1024
+ id: "comp-type",
1025
+ children: /* @__PURE__ */ F(le, {})
1026
+ }), /* @__PURE__ */ F(oe, { children: [
1027
+ "LICENSE",
1028
+ "MEDICAL_CERT",
1029
+ "BACKGROUND_CHECK",
1030
+ "HAZMAT",
1031
+ "TRAINING",
1032
+ "INSURANCE",
1033
+ "OTHER"
1034
+ ].map((e) => /* @__PURE__ */ F(se, {
1035
+ value: e,
1036
+ children: e.replace("_", " ")
1037
+ }, e)) })]
1038
+ })]
1039
+ }),
1040
+ /* @__PURE__ */ I("div", {
1041
+ className: "space-y-1",
1042
+ children: [/* @__PURE__ */ F(x, {
1043
+ htmlFor: "comp-ref",
1044
+ children: "Reference #"
1045
+ }), /* @__PURE__ */ F(b, {
1046
+ id: "comp-ref",
1047
+ placeholder: "CERT-2026-01",
1048
+ value: H.referenceNumber,
1049
+ onChange: (e) => U((t) => ({
1050
+ ...t,
1051
+ referenceNumber: e.target.value
1052
+ }))
1053
+ })]
1054
+ }),
1055
+ /* @__PURE__ */ I("div", {
1056
+ className: "space-y-1",
1057
+ children: [/* @__PURE__ */ F(x, {
1058
+ htmlFor: "comp-exp",
1059
+ children: "Expires"
1060
+ }), /* @__PURE__ */ F(b, {
1061
+ id: "comp-exp",
1062
+ type: "date",
1063
+ value: H.expiresAt,
1064
+ onChange: (e) => U((t) => ({
1065
+ ...t,
1066
+ expiresAt: e.target.value
1067
+ }))
1068
+ })]
1069
+ })
1070
+ ]
1071
+ }), /* @__PURE__ */ F(h, {
1072
+ type: "submit",
1073
+ size: "sm",
1074
+ children: "Save compliance record"
1075
+ })]
1076
+ }), w.complianceRecords && w.complianceRecords.length > 0 ? /* @__PURE__ */ F("ul", {
1077
+ className: "divide-y divide-border-seam",
1078
+ children: w.complianceRecords.map((e) => /* @__PURE__ */ I("li", {
1079
+ className: "flex items-center justify-between gap-3 py-2 text-sm",
1080
+ children: [/* @__PURE__ */ I("div", { children: [/* @__PURE__ */ I("p", {
1081
+ className: "font-medium",
1082
+ children: [
1083
+ e.recordType.replace("_", " "),
1084
+ " (",
1085
+ e.status.replace("_", " "),
1086
+ ")"
1087
+ ]
1088
+ }), /* @__PURE__ */ I("p", {
1089
+ className: "text-xs text-text-secondary",
1090
+ children: [e.referenceNumber ? `Ref: ${e.referenceNumber}` : "No reference #", e.expiresAt ? ` · Expires ${O(e.expiresAt, "short")}` : ""]
1091
+ })] }), /* @__PURE__ */ F(h, {
1092
+ variant: "ghost",
1093
+ size: "sm",
1094
+ className: "text-status-error-text",
1095
+ "aria-label": `Delete compliance record ${e.recordType}`,
1096
+ onClick: () => void A(e.id),
1097
+ children: /* @__PURE__ */ F(l, {
1098
+ size: 14,
1099
+ "aria-hidden": "true"
1100
+ })
1101
+ })]
1102
+ }, e.id))
1103
+ }) : /* @__PURE__ */ F("p", {
1104
+ className: "text-sm text-text-secondary",
1105
+ children: "No compliance records stored yet."
1106
+ })]
1107
+ })] })
834
1108
  ]
835
- }), /* @__PURE__ */ z("div", {
1109
+ }), /* @__PURE__ */ I("div", {
836
1110
  className: "space-y-6",
837
1111
  children: [
838
- /* @__PURE__ */ z(g, { children: [/* @__PURE__ */ R(v, { children: /* @__PURE__ */ z(y, {
1112
+ /* @__PURE__ */ I(g, { children: [/* @__PURE__ */ F(v, { children: /* @__PURE__ */ I(y, {
839
1113
  className: "flex items-center gap-2",
840
- children: [/* @__PURE__ */ R(ee, { size: 18 }), " Assigned Vehicle"]
841
- }) }), /* @__PURE__ */ R(_, { children: x.assignedVehicle ? w ? /* @__PURE__ */ z("button", {
1114
+ children: [/* @__PURE__ */ F(te, { size: 18 }), " Assigned Vehicle"]
1115
+ }) }), /* @__PURE__ */ F(_, { children: w.assignedVehicle ? W ? /* @__PURE__ */ I("button", {
842
1116
  type: "button",
843
1117
  className: "text-sm font-medium text-primary hover:underline",
844
- onClick: () => T(`fleet/vehicles/${w.id}`),
1118
+ onClick: () => G(`fleet/vehicles/${W.id}`),
845
1119
  children: [
846
- w.vehicleNumber,
1120
+ W.vehicleNumber,
847
1121
  " (",
848
- w.type,
1122
+ W.type,
849
1123
  ")"
850
1124
  ]
851
- }) : /* @__PURE__ */ R("p", {
1125
+ }) : /* @__PURE__ */ F("p", {
852
1126
  className: "text-sm text-text-secondary",
853
1127
  children: "Loading…"
854
- }) : /* @__PURE__ */ R("p", {
1128
+ }) : /* @__PURE__ */ F("p", {
855
1129
  className: "text-sm text-text-secondary",
856
1130
  children: "No vehicle assigned"
857
1131
  }) })] }),
858
- /* @__PURE__ */ z(g, { children: [/* @__PURE__ */ R(v, { children: /* @__PURE__ */ R(y, { children: "Record" }) }), /* @__PURE__ */ R(_, {
1132
+ /* @__PURE__ */ I(g, { children: [/* @__PURE__ */ F(v, { children: /* @__PURE__ */ F(y, { children: "Record" }) }), /* @__PURE__ */ F(_, {
859
1133
  className: "space-y-4",
860
- children: /* @__PURE__ */ z("div", { children: [/* @__PURE__ */ R("p", {
1134
+ children: /* @__PURE__ */ I("div", { children: [/* @__PURE__ */ F("p", {
861
1135
  className: "text-sm text-text-secondary",
862
1136
  children: "Hire Date"
863
- }), /* @__PURE__ */ R("p", {
1137
+ }), /* @__PURE__ */ F("p", {
864
1138
  className: "font-medium",
865
- children: x.hireDate ? j(x.hireDate) : "Not recorded"
1139
+ children: w.hireDate ? O(w.hireDate) : "Not recorded"
866
1140
  })] })
867
1141
  })] }),
868
- /* @__PURE__ */ z(g, { children: [/* @__PURE__ */ R(v, { children: /* @__PURE__ */ z(y, {
1142
+ /* @__PURE__ */ I(g, { children: [/* @__PURE__ */ F(v, { children: /* @__PURE__ */ I(y, {
869
1143
  className: "flex items-center gap-2",
870
- children: [/* @__PURE__ */ R(r, { size: 18 }), " Compensation"]
871
- }) }), /* @__PURE__ */ R(_, {
1144
+ children: [/* @__PURE__ */ F(ee, { size: 18 }), " Compensation"]
1145
+ }) }), /* @__PURE__ */ F(_, {
872
1146
  className: "space-y-3",
873
- children: ae ? /* @__PURE__ */ z(me, { children: [x.baseSalary !== void 0 && /* @__PURE__ */ z("div", { children: [/* @__PURE__ */ R("p", {
1147
+ children: Y ? /* @__PURE__ */ I(be, { children: [w.baseSalary !== void 0 && /* @__PURE__ */ I("div", { children: [/* @__PURE__ */ F("p", {
874
1148
  className: "text-sm text-text-secondary",
875
1149
  children: "Base Salary"
876
- }), /* @__PURE__ */ z("p", {
1150
+ }), /* @__PURE__ */ I("p", {
877
1151
  className: "font-medium",
878
- children: [A(x.baseSalary, x.payCurrency || void 0), "/year"]
879
- })] }), x.bonusYtd !== void 0 && /* @__PURE__ */ z("div", { children: [/* @__PURE__ */ R("p", {
1152
+ children: [D(w.baseSalary, w.payCurrency || void 0), "/year"]
1153
+ })] }), w.bonusYtd !== void 0 && /* @__PURE__ */ I("div", { children: [/* @__PURE__ */ F("p", {
880
1154
  className: "text-sm text-text-secondary",
881
1155
  children: "Bonus (YTD)"
882
- }), /* @__PURE__ */ R("p", {
1156
+ }), /* @__PURE__ */ F("p", {
883
1157
  className: "font-medium",
884
- children: A(x.bonusYtd, x.payCurrency || void 0)
885
- })] })] }) : /* @__PURE__ */ R("p", {
1158
+ children: D(w.bonusYtd, w.payCurrency || void 0)
1159
+ })] })] }) : /* @__PURE__ */ F("p", {
886
1160
  className: "text-sm text-text-secondary",
887
1161
  children: "Not recorded"
888
1162
  })
889
1163
  })] }),
890
- x.currentLocation && /* @__PURE__ */ z(g, { children: [/* @__PURE__ */ R(v, { children: /* @__PURE__ */ z(y, {
1164
+ w.currentLocation && /* @__PURE__ */ I(g, { children: [/* @__PURE__ */ F(v, { children: /* @__PURE__ */ I(y, {
891
1165
  className: "flex items-center gap-2",
892
- children: [/* @__PURE__ */ R(s, { size: 18 }), " Current Location"]
893
- }) }), /* @__PURE__ */ z(_, { children: [/* @__PURE__ */ R("p", {
1166
+ children: [/* @__PURE__ */ F(o, { size: 18 }), " Current Location"]
1167
+ }) }), /* @__PURE__ */ I(_, { children: [/* @__PURE__ */ F("p", {
894
1168
  className: "text-sm",
895
- children: x.currentLocation.address || "Location updating..."
896
- }), /* @__PURE__ */ R("p", {
1169
+ children: w.currentLocation.address || "Location updating..."
1170
+ }), /* @__PURE__ */ F("p", {
897
1171
  className: "text-xs text-text-secondary mt-1",
898
- children: x.currentLocation.timestamp ? `Updated ${j(x.currentLocation.timestamp, "relative")}` : "Update time not recorded"
1172
+ children: w.currentLocation.timestamp ? `Updated ${O(w.currentLocation.timestamp, "relative")}` : "Update time not recorded"
899
1173
  })] })] })
900
1174
  ]
901
1175
  })]
@@ -903,4 +1177,4 @@ function q() {
903
1177
  ]
904
1178
  });
905
1179
  }
906
- export { q as default };
1180
+ export { Y as default };