@burdenoff/microfe-movethewheels 2026.1016.2 → 2026.1016.4

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 (113) hide show
  1. package/README.md +10 -0
  2. package/dist/MoveTheWheelsRoot.js +5 -0
  3. package/dist/MoveTheWheelsRoutes.js +25 -21
  4. package/dist/components/ContainerEvidencePicker.js +55 -55
  5. package/dist/components/FleetAlertsPanel.js +2 -2
  6. package/dist/components/freight-cost/FreightCommercialEditor.js +217 -0
  7. package/dist/components/freight-cost/FreightCommercialFactEditor.js +217 -0
  8. package/dist/components/freight-cost/FreightCommercialHistory.js +115 -0
  9. package/dist/components/freight-cost/FreightDraftForm.js +106 -91
  10. package/dist/components/freight-cost/FreightHistory.js +42 -40
  11. package/dist/components/freight-invoice/InvoiceForm.js +366 -0
  12. package/dist/components/freight-invoice/InvoiceResults.js +240 -0
  13. package/dist/generated/consolidation-operations.d.ts +195 -265
  14. package/dist/generated/container-condition-operations.d.ts +124 -187
  15. package/dist/generated/container-operations.d.ts +59 -85
  16. package/dist/generated/empty-reuse-operations.d.ts +165 -271
  17. package/dist/generated/free-time-operations.d.ts +120 -184
  18. package/dist/generated/freight-cost-operations.d.ts +955 -165
  19. package/dist/generated/freight-invoice-operations.d.ts +1447 -0
  20. package/dist/generated/logistics-procedure-operations.d.ts +100 -156
  21. package/dist/generated/pending-pick-operations.d.ts +769 -1025
  22. package/dist/generated/shipment-status-authority-operations.d.ts +82 -103
  23. package/dist/generated/stock-binding-operations.d.ts +188 -260
  24. package/dist/generated/stock-observation-operations.d.ts +103 -138
  25. package/dist/generated/tracking-quality-operations.d.ts +27 -41
  26. package/dist/generated/trip-utilization-operations.d.ts +137 -185
  27. package/dist/generated/wspace-operations.d.ts +628 -2272
  28. package/dist/generated/wspace-types.d.ts +4 -23
  29. package/dist/hooks/useFreightRecoveryAction.js +20 -20
  30. package/dist/hooks/useInvoiceComparisonRecovery.js +118 -0
  31. package/dist/movethewheels/components/ContainerEvidencePicker.d.ts +2 -1
  32. package/dist/movethewheels/components/freight-cost/FreightCommercialEditor.d.ts +8 -0
  33. package/dist/movethewheels/components/freight-cost/FreightCommercialFactEditor.d.ts +8 -0
  34. package/dist/movethewheels/components/freight-cost/FreightCommercialHistory.d.ts +4 -0
  35. package/dist/movethewheels/components/freight-cost/FreightDraftForm.d.ts +4 -2
  36. package/dist/movethewheels/components/freight-cost/FreightHistory.d.ts +2 -2
  37. package/dist/movethewheels/components/freight-invoice/InvoiceForm.d.ts +19 -0
  38. package/dist/movethewheels/components/freight-invoice/InvoiceResults.d.ts +9 -0
  39. package/dist/movethewheels/hooks/useFleet.d.ts +1 -1
  40. package/dist/movethewheels/hooks/useFleetIntelligence.d.ts +1 -1
  41. package/dist/movethewheels/hooks/useInvoiceComparisonRecovery.d.ts +22 -0
  42. package/dist/movethewheels/hooks/useProcedureSelection.d.ts +1 -3
  43. package/dist/movethewheels/pages/FreightInvoicePage.d.ts +10 -0
  44. package/dist/movethewheels/utils/driverLicenseExpiry.d.ts +6 -0
  45. package/dist/movethewheels/utils/freightCommercial.d.ts +44 -0
  46. package/dist/movethewheels/utils/invoiceComparison.d.ts +32 -0
  47. package/dist/pages/DriverDetailsPage.js +306 -282
  48. package/dist/pages/FreightEstimatePage.js +97 -92
  49. package/dist/pages/FreightInvoicePage.js +346 -0
  50. package/dist/src/generated/consolidation-operations.js +3961 -503
  51. package/dist/src/generated/container-condition-operations.js +2968 -206
  52. package/dist/src/generated/container-operations.js +997 -99
  53. package/dist/src/generated/empty-reuse-operations.js +4811 -747
  54. package/dist/src/generated/free-time-operations.js +2824 -233
  55. package/dist/src/generated/freight-cost-operations.js +4852 -323
  56. package/dist/src/generated/freight-invoice-operations.js +4894 -0
  57. package/dist/src/generated/logistics-procedure-operations.js +2707 -360
  58. package/dist/src/generated/pending-pick-operations.js +8244 -1196
  59. package/dist/src/generated/shipment-status-authority-operations.js +1157 -84
  60. package/dist/src/generated/stock-binding-operations.js +2779 -173
  61. package/dist/src/generated/stock-observation-operations.js +1274 -91
  62. package/dist/src/generated/tracking-quality-operations.js +407 -42
  63. package/dist/src/generated/trip-utilization-operations.js +1765 -138
  64. package/dist/src/generated/wspace-operations.js +428 -706
  65. package/dist/utils/driverLicenseExpiry.js +14 -0
  66. package/dist/utils/freightAcknowledgement.js +6 -5
  67. package/dist/utils/freightCommercial.js +194 -0
  68. package/dist/utils/freightRecovery.js +22 -22
  69. package/dist/utils/invoiceComparison.js +272 -0
  70. package/package.json +30 -29
  71. package/src/generated/consolidation-operations.ts +60 -559
  72. package/src/generated/container-condition-operations.ts +63 -265
  73. package/src/generated/container-operations.ts +37 -132
  74. package/src/generated/empty-reuse-operations.ts +83 -824
  75. package/src/generated/free-time-operations.ts +55 -284
  76. package/src/generated/freight-cost-operations.ts +373 -349
  77. package/src/generated/freight-invoice-operations.ts +830 -0
  78. package/src/generated/logistics-procedure-operations.ts +60 -414
  79. package/src/generated/pending-pick-operations.ts +48 -1239
  80. package/src/generated/shipment-status-authority-operations.ts +33 -113
  81. package/src/generated/stock-binding-operations.ts +29 -198
  82. package/src/generated/stock-observation-operations.ts +24 -111
  83. package/src/generated/tracking-quality-operations.ts +19 -57
  84. package/src/generated/trip-utilization-operations.ts +32 -166
  85. package/src/generated/wspace-operations.ts +284 -2906
  86. package/src/generated/wspace-types.ts +2 -8
  87. package/src/movethewheels/MoveTheWheelsRoot.tsx +6 -0
  88. package/src/movethewheels/MoveTheWheelsRoutes.tsx +2 -0
  89. package/src/movethewheels/components/ContainerEvidencePicker.tsx +12 -4
  90. package/src/movethewheels/components/FleetAlertsPanel.tsx +4 -2
  91. package/src/movethewheels/components/freight-cost/FreightCommercialEditor.tsx +236 -0
  92. package/src/movethewheels/components/freight-cost/FreightCommercialFactEditor.tsx +258 -0
  93. package/src/movethewheels/components/freight-cost/FreightCommercialHistory.tsx +90 -0
  94. package/src/movethewheels/components/freight-cost/FreightDraftForm.tsx +33 -4
  95. package/src/movethewheels/components/freight-cost/FreightHistory.tsx +4 -2
  96. package/src/movethewheels/components/freight-invoice/InvoiceForm.tsx +412 -0
  97. package/src/movethewheels/components/freight-invoice/InvoiceResults.tsx +162 -0
  98. package/src/movethewheels/hooks/useFleet.ts +1 -1
  99. package/src/movethewheels/hooks/useFleetIntelligence.ts +5 -1
  100. package/src/movethewheels/hooks/useFreightRecoveryAction.ts +2 -1
  101. package/src/movethewheels/hooks/useInvoiceComparisonRecovery.ts +227 -0
  102. package/src/movethewheels/pages/DriverDetailsPage.tsx +35 -9
  103. package/src/movethewheels/pages/FreightEstimatePage.tsx +15 -7
  104. package/src/movethewheels/pages/FreightInvoicePage.tsx +477 -0
  105. package/src/movethewheels/utils/driverLicenseExpiry.ts +25 -0
  106. package/src/movethewheels/utils/freightAcknowledgement.ts +3 -1
  107. package/src/movethewheels/utils/freightCommercial.ts +388 -0
  108. package/src/movethewheels/utils/freightRecovery.ts +6 -2
  109. package/src/movethewheels/utils/invoiceComparison.ts +520 -0
  110. package/src/operations/freight-cost/commercial.graphql +483 -0
  111. package/src/operations/freight-invoice/comparison.graphql +40 -0
  112. package/src/operations/wspace/freight-invoice-evidence.graphql +6 -0
  113. package/patches/braces@3.0.3.patch +0 -87
@@ -8,14 +8,14 @@ import { SquarePen as o } from "../node_modules/lucide-react/dist/esm/icons/squa
8
8
  import { Star as s } from "../node_modules/lucide-react/dist/esm/icons/star.js";
9
9
  import { StickyNote as ee } from "../node_modules/lucide-react/dist/esm/icons/sticky-note.js";
10
10
  import { Trash2 as c } from "../node_modules/lucide-react/dist/esm/icons/trash-2.js";
11
- import { Truck as l } from "../node_modules/lucide-react/dist/esm/icons/truck.js";
12
- import { UserX as u } from "../node_modules/lucide-react/dist/esm/icons/user-x.js";
13
- import { Users as d } from "../node_modules/lucide-react/dist/esm/icons/users.js";
14
- import { joinPath as f } from "../utils/navigation.js";
15
- import { useMoveTheWheels as te } from "../providers/MoveTheWheelsProvider.js";
16
- import { toApiDriverStatus as p, useDriver as ne, useFleet as m, useVehicle as re, useVehicles as ie } from "../hooks/useFleet.js";
17
- import { Button as h, Card as g, CardContent as _, CardHeader as v, CardTitle as y, Input as b, Label as x, Select as S, SelectContent as C, SelectItem as w, SelectTrigger as T, SelectValue as E, Textarea as D } from "../components/ui.js";
18
- import { ErrorState as ae, LoadingState as O, PageLayout as oe } from "../components/PageLayout.js";
11
+ import { Truck as te } from "../node_modules/lucide-react/dist/esm/icons/truck.js";
12
+ import { UserX as l } from "../node_modules/lucide-react/dist/esm/icons/user-x.js";
13
+ import { Users as u } from "../node_modules/lucide-react/dist/esm/icons/users.js";
14
+ import { joinPath as d } from "../utils/navigation.js";
15
+ import { useMoveTheWheels as ne } from "../providers/MoveTheWheelsProvider.js";
16
+ import { toApiDriverStatus as f, useDriver as p, useFleet as m, useVehicle as re, useVehicles as ie } from "../hooks/useFleet.js";
17
+ import { Button as h, Card as g, CardContent as _, CardHeader as v, CardTitle as y, Input as b, Label as x, Select as S, SelectContent as ae, SelectItem as C, SelectTrigger as w, SelectValue as T, Textarea as E } from "../components/ui.js";
18
+ import { ErrorState as oe, LoadingState as D, PageLayout as O } from "../components/PageLayout.js";
19
19
  import { DRIVER_STATUS_LABELS as k } from "../constants/index.js";
20
20
  import { StatusBadge as A } from "../components/StatusBadge.js";
21
21
  import { FormError as j } from "../components/FormError.js";
@@ -24,15 +24,16 @@ import { DocumentsCard as P } from "../components/DocumentsCard.js";
24
24
  import { useDebouncedValue as se } from "../hooks/useDebouncedValue.js";
25
25
  import { EntityCombobox as ce } from "../components/EntityCombobox.js";
26
26
  import { useRefetchOnLeaveEdit as F } from "../hooks/useRefetchOnLeaveEdit.js";
27
- import { useEffect as le, useState as I } from "react";
28
- import { useLocation as L, useParams as R } from "react-router";
29
- import { Fragment as ue, jsx as z, jsxs as B } from "react/jsx-runtime";
30
- import { EmphasisPanel as de, NextSteps as V, PagePurpose as H, ResponsiveDialog as U, ResponsiveDialogContent as fe, ResponsiveDialogDescription as pe, ResponsiveDialogFooter as me, ResponsiveDialogHeader as he, ResponsiveDialogTitle as ge } from "@burdenoff/fe-libs/ui";
27
+ import { driverLicenseExpiryInput as le, driverLicenseExpiryUpdate as ue, parseDriverLicenseExpiry as de } from "../utils/driverLicenseExpiry.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";
31
32
  //#region src/movethewheels/pages/DriverDetailsPage.tsx
32
- var _e = Object.entries(k).map(([e, t]) => ({
33
+ var ve = Object.entries(k).map(([e, t]) => ({
33
34
  value: e,
34
35
  label: t
35
- })), W = (e) => e ? e.toISOString().slice(0, 10) : "", G = (e) => e ? `${e}T12:00:00.000Z` : void 0, ve = {
36
+ })), ye = (e) => e ? e.toISOString().slice(0, 10) : "", be = (e) => e ? `${e}T12:00:00.000Z` : void 0, xe = {
36
37
  employeeId: "",
37
38
  firstName: "",
38
39
  lastName: "",
@@ -53,173 +54,173 @@ var _e = Object.entries(k).map(([e, t]) => ({
53
54
  onLeaveUntil: ""
54
55
  };
55
56
  function K({ editId: t }) {
56
- let { basePath: r, navigate: i } = te(), { createDriver: o, updateDriver: s, deleteDriver: ae } = m(), { driver: O, refetch: k } = ne(t), A = !!t, [M, P] = I(ve), [F, L] = I(!1), [R, V] = I(null), [K, q] = I(!1), [J, ye] = I(""), [Y, be] = I(!1), [xe, X] = I(null), [Se, Z] = I(!1), [Q, Ce] = I(!1), [we, Te] = I(null), [Ee, De] = I(""), { vehicles: Oe, isLoading: ke, isLoadingMore: Ae, hasMore: je, totalVehicles: Me, loadMore: Ne } = ie({
57
+ let { basePath: r, navigate: i } = ne(), { createDriver: o, updateDriver: s, deleteDriver: oe } = m(), { driver: D, refetch: k } = p(t), A = !!t, [M, 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(""), { vehicles: je, isLoading: Me, isLoadingMore: Ne, hasMore: Pe, totalVehicles: Fe, loadMore: Ie } = ie({
57
58
  limit: 20,
58
- search: se(Ee) || void 0
59
- }), { vehicle: Pe, isLoading: Fe } = re(M.vehicleId || void 0);
60
- le(() => {
61
- if (!t || !O) return;
62
- let [e, ...n] = O.fullName.trim().split(/\s+/);
59
+ search: se(ke) || void 0
60
+ }), { vehicle: Le, isLoading: Re } = re(M.vehicleId || void 0);
61
+ fe(() => {
62
+ if (!t || !D) return;
63
+ let [e, ...n] = D.fullName.trim().split(/\s+/);
63
64
  P({
64
- employeeId: O.employeeId || "",
65
+ employeeId: D.employeeId || "",
65
66
  firstName: e || "",
66
67
  lastName: n.join(" "),
67
- email: O.email || "",
68
- phone: O.phone || "",
69
- licenseNumber: O.licenseNumber || "",
70
- licenseClass: O.licenseType || "",
71
- licenseExpiry: W(O.licenseExpiry),
72
- status: O.status,
73
- vehicleId: O.assignedVehicle || "",
74
- vehicleIds: O.vehicleIds,
75
- rating: O.rating ? String(O.rating) : "",
76
- notes: O.notes || "",
77
- hireDate: W(O.hireDate),
78
- baseSalary: O.baseSalary === void 0 ? "" : String(O.baseSalary),
79
- bonusYtd: O.bonusYtd === void 0 ? "" : String(O.bonusYtd),
80
- payCurrency: O.payCurrency || "",
81
- onLeaveUntil: W(O.onLeaveUntil)
68
+ email: D.email || "",
69
+ phone: D.phone || "",
70
+ licenseNumber: D.licenseNumber || "",
71
+ licenseClass: D.licenseType || "",
72
+ licenseExpiry: le(D.licenseExpiry),
73
+ status: D.status,
74
+ vehicleId: D.assignedVehicle || "",
75
+ vehicleIds: D.vehicleIds,
76
+ rating: D.rating ? String(D.rating) : "",
77
+ notes: D.notes || "",
78
+ hireDate: ye(D.hireDate),
79
+ baseSalary: D.baseSalary === void 0 ? "" : String(D.baseSalary),
80
+ bonusYtd: D.bonusYtd === void 0 ? "" : String(D.bonusYtd),
81
+ payCurrency: D.payCurrency || "",
82
+ onLeaveUntil: ye(D.onLeaveUntil)
82
83
  });
83
- }, [t, O]);
84
- let Ie = () => i?.(f(r, "fleet/drivers")), $ = (e = !0) => ({
84
+ }, [t, D]);
85
+ let ze = () => i?.(d(r, "fleet/drivers")), $ = (e = !0) => ({
85
86
  firstName: M.firstName.trim(),
86
87
  lastName: M.lastName.trim(),
87
88
  email: M.email.trim() || void 0,
88
89
  phone: M.phone.trim() || void 0,
89
90
  licenseNumber: M.licenseNumber.trim() || void 0,
90
91
  licenseClass: M.licenseClass.trim() || void 0,
91
- licenseExpiry: G(M.licenseExpiry),
92
- status: p(M.status),
92
+ licenseExpiry: A ? ue(M.licenseExpiry, D?.licenseExpiry) : de(M.licenseExpiry),
93
+ status: f(M.status),
93
94
  vehicleId: M.vehicleId || null,
94
95
  vehicleIds: M.vehicleIds,
95
96
  rating: M.rating.trim() ? Number(M.rating) : void 0,
96
97
  notes: M.notes.trim() || void 0,
97
- hireDate: G(M.hireDate),
98
+ hireDate: be(M.hireDate),
98
99
  baseSalary: M.baseSalary.trim() ? Number(M.baseSalary) : void 0,
99
100
  bonusYtd: M.bonusYtd.trim() ? Number(M.bonusYtd) : void 0,
100
101
  payCurrency: M.payCurrency.trim() || void 0,
101
- ...e ? { onLeaveUntil: G(M.onLeaveUntil) ?? null } : {}
102
- }), Le = () => ({
102
+ ...e ? { onLeaveUntil: be(M.onLeaveUntil) ?? null } : {}
103
+ }), Be = () => ({
103
104
  employeeId: M.employeeId.trim(),
104
105
  ...$(!1)
105
- }), Re = async (e) => {
106
+ }), Ve = async (e) => {
106
107
  if (e.preventDefault(), !M.employeeId.trim() || !M.firstName.trim() || !M.lastName.trim()) {
107
- V("Employee ID, first name and last name are required.");
108
+ B("Employee ID, first name and last name are required.");
108
109
  return;
109
110
  }
110
111
  if (!M.phone.trim()) {
111
- V("Phone is required so this driver can be reached.");
112
+ B("Phone is required so this driver can be reached.");
112
113
  return;
113
114
  }
114
- L(!0), V(null);
115
+ L(!0), B(null);
115
116
  try {
116
117
  if (t) {
117
118
  let e = await s(t, $());
118
- i?.(f(r, `fleet/drivers/${e.id}`));
119
+ i?.(d(r, `fleet/drivers/${e.id}`));
119
120
  } else {
120
- let e = await o(Le());
121
- i?.(f(r, `fleet/drivers/${e.id}`));
121
+ let e = await o(Be());
122
+ i?.(d(r, `fleet/drivers/${e.id}`));
122
123
  }
123
124
  } catch (e) {
124
- console.error("Failed to save driver:", e), V(e instanceof Error ? e.message : "Failed to save driver. Please try again."), L(!1);
125
+ console.error("Failed to save driver:", e), B(e instanceof Error ? e.message : "Failed to save driver. Please try again."), L(!1);
125
126
  }
126
- }, ze = async () => {
127
+ }, He = async () => {
127
128
  if (!t || !J.trim()) {
128
129
  X("A reason is required to dismiss a driver.");
129
130
  return;
130
131
  }
131
- be(!0), X(null);
132
+ Ce(!0), X(null);
132
133
  try {
133
134
  await s(t, {
134
135
  ...$(),
135
136
  terminatedAt: (/* @__PURE__ */ new Date()).toISOString(),
136
137
  terminationReason: J.trim()
137
- }), q(!1), await k(), i?.(f(r, `fleet/drivers/${t}`));
138
+ }), q(!1), await k(), i?.(d(r, `fleet/drivers/${t}`));
138
139
  } catch (e) {
139
140
  X(e instanceof Error ? e.message : "Failed to dismiss driver.");
140
141
  } finally {
141
- be(!1);
142
+ Ce(!1);
142
143
  }
143
- }, Be = async () => {
144
+ }, Ue = async () => {
144
145
  if (t) {
145
- Ce(!0), Te(null);
146
+ Ee(!0), Oe(null);
146
147
  try {
147
- await ae(t), Z(!1), i?.(f(r, "fleet/drivers"));
148
+ await oe(t), Z(!1), i?.(d(r, "fleet/drivers"));
148
149
  } catch (e) {
149
- Te(e instanceof Error ? e.message : "Failed to delete driver.");
150
+ Oe(e instanceof Error ? e.message : "Failed to delete driver.");
150
151
  } finally {
151
- Ce(!1);
152
+ Ee(!1);
152
153
  }
153
154
  }
154
- }, Ve = A && !!O?.terminatedAt;
155
- return /* @__PURE__ */ B(oe, {
155
+ }, We = A && !!D?.terminatedAt;
156
+ return /* @__PURE__ */ z(O, {
156
157
  title: A ? "Edit Driver" : "Add Driver",
157
158
  subtitle: "Add a driver to your workforce",
158
- icon: /* @__PURE__ */ z(d, { size: 24 }),
159
- headerActions: /* @__PURE__ */ B("div", {
159
+ icon: /* @__PURE__ */ R(u, { size: 24 }),
160
+ headerActions: /* @__PURE__ */ z("div", {
160
161
  className: "flex gap-2",
161
- children: [/* @__PURE__ */ B(h, {
162
+ children: [/* @__PURE__ */ z(h, {
162
163
  variant: "outline",
163
- onClick: Ie,
164
+ onClick: ze,
164
165
  disabled: F,
165
- children: [/* @__PURE__ */ z(e, { size: 16 }), " Cancel"]
166
- }), /* @__PURE__ */ B(h, {
167
- onClick: Re,
166
+ children: [/* @__PURE__ */ R(e, { size: 16 }), " Cancel"]
167
+ }), /* @__PURE__ */ z(h, {
168
+ onClick: Ve,
168
169
  disabled: F,
169
170
  children: [
170
- /* @__PURE__ */ z(a, { size: 16 }),
171
+ /* @__PURE__ */ R(a, { size: 16 }),
171
172
  " ",
172
173
  A ? F ? "Saving..." : "Save Changes" : F ? "Saving..." : "Add Driver"
173
174
  ]
174
175
  })]
175
176
  }),
176
177
  children: [
177
- /* @__PURE__ */ z(H, {
178
- icon: /* @__PURE__ */ z(d, { size: 18 }),
178
+ /* @__PURE__ */ R(V, {
179
+ icon: /* @__PURE__ */ R(u, { size: 18 }),
179
180
  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."
180
181
  }),
181
- Ve && O?.terminatedAt && /* @__PURE__ */ B("div", {
182
+ We && D?.terminatedAt && /* @__PURE__ */ z("div", {
182
183
  className: "rounded-card border border-status-error-border bg-status-error-bg-subtle p-4 text-sm text-status-error-text",
183
- children: [/* @__PURE__ */ B("p", {
184
+ children: [/* @__PURE__ */ z("p", {
184
185
  className: "font-medium",
185
186
  children: [
186
187
  "This driver was dismissed on ",
187
- N(O.terminatedAt, "full"),
188
+ N(D.terminatedAt, "full"),
188
189
  "."
189
190
  ]
190
- }), O.terminationReason && /* @__PURE__ */ B("p", {
191
+ }), D.terminationReason && /* @__PURE__ */ z("p", {
191
192
  className: "mt-1",
192
- children: ["Reason: ", O.terminationReason]
193
+ children: ["Reason: ", D.terminationReason]
193
194
  })]
194
195
  }),
195
- /* @__PURE__ */ B("form", {
196
- onSubmit: Re,
196
+ /* @__PURE__ */ z("form", {
197
+ onSubmit: Ve,
197
198
  className: "max-w-3xl space-y-6",
198
199
  children: [
199
- /* @__PURE__ */ z(j, { message: R }),
200
- /* @__PURE__ */ B(de, { children: [/* @__PURE__ */ z("h2", {
200
+ /* @__PURE__ */ R(j, { message: pe }),
201
+ /* @__PURE__ */ z(he, { children: [/* @__PURE__ */ R("h2", {
201
202
  className: "text-base font-semibold text-text-primary mb-4",
202
203
  children: "Driver Details"
203
- }), /* @__PURE__ */ B("div", {
204
+ }), /* @__PURE__ */ z("div", {
204
205
  className: "space-y-4",
205
206
  children: [
206
- /* @__PURE__ */ B("div", {
207
+ /* @__PURE__ */ z("div", {
207
208
  className: "grid grid-cols-1 md:grid-cols-3 gap-4",
208
209
  children: [
209
- /* @__PURE__ */ B("div", {
210
+ /* @__PURE__ */ z("div", {
210
211
  className: "space-y-2",
211
- children: [/* @__PURE__ */ B(x, {
212
+ children: [/* @__PURE__ */ z(x, {
212
213
  htmlFor: "employeeId",
213
214
  children: [
214
215
  "Employee ID ",
215
216
  A ? "(immutable)" : "",
216
217
  " ",
217
- /* @__PURE__ */ z("span", {
218
+ /* @__PURE__ */ R("span", {
218
219
  className: "text-status-error-text",
219
220
  children: !A && "*"
220
221
  })
221
222
  ]
222
- }), /* @__PURE__ */ z(b, {
223
+ }), /* @__PURE__ */ R(b, {
223
224
  id: "employeeId",
224
225
  value: M.employeeId,
225
226
  onChange: (e) => P((t) => ({
@@ -231,15 +232,15 @@ function K({ editId: t }) {
231
232
  disabled: A
232
233
  })]
233
234
  }),
234
- /* @__PURE__ */ B("div", {
235
+ /* @__PURE__ */ z("div", {
235
236
  className: "space-y-2",
236
- children: [/* @__PURE__ */ B(x, {
237
+ children: [/* @__PURE__ */ z(x, {
237
238
  htmlFor: "firstName",
238
- children: ["First Name ", /* @__PURE__ */ z("span", {
239
+ children: ["First Name ", /* @__PURE__ */ R("span", {
239
240
  className: "text-status-error-text",
240
241
  children: "*"
241
242
  })]
242
- }), /* @__PURE__ */ z(b, {
243
+ }), /* @__PURE__ */ R(b, {
243
244
  id: "firstName",
244
245
  value: M.firstName,
245
246
  onChange: (e) => P((t) => ({
@@ -250,15 +251,15 @@ function K({ editId: t }) {
250
251
  required: !0
251
252
  })]
252
253
  }),
253
- /* @__PURE__ */ B("div", {
254
+ /* @__PURE__ */ z("div", {
254
255
  className: "space-y-2",
255
- children: [/* @__PURE__ */ B(x, {
256
+ children: [/* @__PURE__ */ z(x, {
256
257
  htmlFor: "lastName",
257
- children: ["Last Name ", /* @__PURE__ */ z("span", {
258
+ children: ["Last Name ", /* @__PURE__ */ R("span", {
258
259
  className: "text-status-error-text",
259
260
  children: "*"
260
261
  })]
261
- }), /* @__PURE__ */ z(b, {
262
+ }), /* @__PURE__ */ R(b, {
262
263
  id: "lastName",
263
264
  value: M.lastName,
264
265
  onChange: (e) => P((t) => ({
@@ -271,15 +272,15 @@ function K({ editId: t }) {
271
272
  })
272
273
  ]
273
274
  }),
274
- /* @__PURE__ */ B("div", {
275
+ /* @__PURE__ */ z("div", {
275
276
  className: "grid grid-cols-1 md:grid-cols-3 gap-4",
276
277
  children: [
277
- /* @__PURE__ */ B("div", {
278
+ /* @__PURE__ */ z("div", {
278
279
  className: "space-y-2",
279
- children: [/* @__PURE__ */ z(x, {
280
+ children: [/* @__PURE__ */ R(x, {
280
281
  htmlFor: "email",
281
282
  children: "Email"
282
- }), /* @__PURE__ */ z(b, {
283
+ }), /* @__PURE__ */ R(b, {
283
284
  id: "email",
284
285
  type: "email",
285
286
  value: M.email,
@@ -290,15 +291,15 @@ function K({ editId: t }) {
290
291
  placeholder: "jane.doe@example.com"
291
292
  })]
292
293
  }),
293
- /* @__PURE__ */ B("div", {
294
+ /* @__PURE__ */ z("div", {
294
295
  className: "space-y-2",
295
- children: [/* @__PURE__ */ B(x, {
296
+ children: [/* @__PURE__ */ z(x, {
296
297
  htmlFor: "phone",
297
- children: ["Phone ", /* @__PURE__ */ z("span", {
298
+ children: ["Phone ", /* @__PURE__ */ R("span", {
298
299
  className: "text-status-error-text",
299
300
  children: "*"
300
301
  })]
301
- }), /* @__PURE__ */ z(b, {
302
+ }), /* @__PURE__ */ R(b, {
302
303
  id: "phone",
303
304
  value: M.phone,
304
305
  onChange: (e) => P((t) => ({
@@ -309,21 +310,21 @@ function K({ editId: t }) {
309
310
  required: !0
310
311
  })]
311
312
  }),
312
- /* @__PURE__ */ B("div", {
313
+ /* @__PURE__ */ z("div", {
313
314
  className: "space-y-2",
314
- children: [/* @__PURE__ */ z(x, {
315
+ children: [/* @__PURE__ */ R(x, {
315
316
  htmlFor: "status",
316
317
  children: "Status"
317
- }), /* @__PURE__ */ B(S, {
318
+ }), /* @__PURE__ */ z(S, {
318
319
  value: M.status,
319
320
  onValueChange: (e) => P((t) => ({
320
321
  ...t,
321
322
  status: e
322
323
  })),
323
- children: [/* @__PURE__ */ z(T, {
324
+ children: [/* @__PURE__ */ R(w, {
324
325
  id: "status",
325
- children: /* @__PURE__ */ z(E, {})
326
- }), /* @__PURE__ */ z(C, { children: _e.map((e) => /* @__PURE__ */ z(w, {
326
+ children: /* @__PURE__ */ R(T, {})
327
+ }), /* @__PURE__ */ R(ae, { children: ve.map((e) => /* @__PURE__ */ R(C, {
327
328
  value: e.value,
328
329
  children: e.label
329
330
  }, e.value)) })]
@@ -331,15 +332,15 @@ function K({ editId: t }) {
331
332
  })
332
333
  ]
333
334
  }),
334
- /* @__PURE__ */ B("div", {
335
+ /* @__PURE__ */ z("div", {
335
336
  className: "grid grid-cols-1 md:grid-cols-3 gap-4",
336
337
  children: [
337
- /* @__PURE__ */ B("div", {
338
+ /* @__PURE__ */ z("div", {
338
339
  className: "space-y-2",
339
- children: [/* @__PURE__ */ z(x, {
340
+ children: [/* @__PURE__ */ R(x, {
340
341
  htmlFor: "licenseNumber",
341
342
  children: "License Number"
342
- }), /* @__PURE__ */ z(b, {
343
+ }), /* @__PURE__ */ R(b, {
343
344
  id: "licenseNumber",
344
345
  value: M.licenseNumber,
345
346
  onChange: (e) => P((t) => ({
@@ -349,12 +350,12 @@ function K({ editId: t }) {
349
350
  placeholder: "D1234567"
350
351
  })]
351
352
  }),
352
- /* @__PURE__ */ B("div", {
353
+ /* @__PURE__ */ z("div", {
353
354
  className: "space-y-2",
354
- children: [/* @__PURE__ */ z(x, {
355
+ children: [/* @__PURE__ */ R(x, {
355
356
  htmlFor: "licenseClass",
356
357
  children: "License Class"
357
- }), /* @__PURE__ */ z(b, {
358
+ }), /* @__PURE__ */ R(b, {
358
359
  id: "licenseClass",
359
360
  value: M.licenseClass,
360
361
  onChange: (e) => P((t) => ({
@@ -364,42 +365,65 @@ function K({ editId: t }) {
364
365
  placeholder: "Class A"
365
366
  })]
366
367
  }),
367
- /* @__PURE__ */ B("div", {
368
- className: "space-y-2",
369
- children: [/* @__PURE__ */ z(x, {
370
- htmlFor: "licenseExpiry",
371
- children: "License Expiry"
372
- }), /* @__PURE__ */ z(b, {
373
- id: "licenseExpiry",
374
- type: "date",
375
- value: M.licenseExpiry,
376
- onChange: (e) => P((t) => ({
377
- ...t,
378
- licenseExpiry: e.target.value
379
- }))
380
- })]
368
+ /* @__PURE__ */ z("div", {
369
+ className: "space-y-2 md:col-span-3",
370
+ children: [
371
+ /* @__PURE__ */ z("div", {
372
+ className: "flex items-center justify-between gap-2",
373
+ children: [/* @__PURE__ */ R(x, {
374
+ htmlFor: "licenseExpiry",
375
+ children: "Licence expiry (UTC)"
376
+ }), M.licenseExpiry && /* @__PURE__ */ R(h, {
377
+ type: "button",
378
+ variant: "ghost",
379
+ size: "sm",
380
+ "aria-label": "Clear recorded licence expiry",
381
+ onClick: () => P((e) => ({
382
+ ...e,
383
+ licenseExpiry: ""
384
+ })),
385
+ children: "Clear"
386
+ })]
387
+ }),
388
+ /* @__PURE__ */ R(b, {
389
+ id: "licenseExpiry",
390
+ type: "datetime-local",
391
+ step: "0.001",
392
+ "aria-describedby": "licenseExpiryHelp",
393
+ value: M.licenseExpiry,
394
+ onChange: (e) => P((t) => ({
395
+ ...t,
396
+ licenseExpiry: e.target.value
397
+ }))
398
+ }),
399
+ /* @__PURE__ */ R("p", {
400
+ id: "licenseExpiryHelp",
401
+ className: "text-xs text-text-secondary",
402
+ children: "Enter the recorded UTC time. Blank means expiry not recorded; clearing removes it. A recorded expiry does not certify legal driving eligibility."
403
+ })
404
+ ]
381
405
  })
382
406
  ]
383
407
  }),
384
- /* @__PURE__ */ B("div", {
408
+ /* @__PURE__ */ z("div", {
385
409
  className: "grid grid-cols-1 md:grid-cols-2 gap-4",
386
- children: [/* @__PURE__ */ B("div", {
410
+ children: [/* @__PURE__ */ z("div", {
387
411
  className: "space-y-2",
388
- children: [/* @__PURE__ */ z(x, {
412
+ children: [/* @__PURE__ */ R(x, {
389
413
  htmlFor: "vehicleSearch",
390
414
  children: "Search vehicles"
391
- }), /* @__PURE__ */ z(b, {
415
+ }), /* @__PURE__ */ R(b, {
392
416
  id: "vehicleSearch",
393
- value: Ee,
394
- onChange: (e) => De(e.target.value),
417
+ value: ke,
418
+ onChange: (e) => Ae(e.target.value),
395
419
  placeholder: "Vehicle number or type"
396
420
  })]
397
- }), /* @__PURE__ */ B("div", {
421
+ }), /* @__PURE__ */ z("div", {
398
422
  className: "space-y-2",
399
- children: [/* @__PURE__ */ z(x, {
423
+ children: [/* @__PURE__ */ R(x, {
400
424
  htmlFor: "vehicle",
401
425
  children: "Assigned Vehicle"
402
- }), /* @__PURE__ */ z(ce, {
426
+ }), /* @__PURE__ */ R(ce, {
403
427
  id: "vehicle",
404
428
  value: M.vehicleId,
405
429
  onChange: (e) => P((t) => ({
@@ -407,12 +431,12 @@ function K({ editId: t }) {
407
431
  vehicleId: e,
408
432
  vehicleIds: e ? [e] : []
409
433
  })),
410
- options: Oe,
411
- loading: ke,
434
+ options: je,
435
+ loading: Me,
412
436
  getId: (e) => e.id,
413
437
  getLabel: (e) => `${e.vehicleNumber} (${e.type})`,
414
- renderOption: (e) => /* @__PURE__ */ B(ue, { children: [
415
- /* @__PURE__ */ z(l, {
438
+ renderOption: (e) => /* @__PURE__ */ z(me, { children: [
439
+ /* @__PURE__ */ R(te, {
416
440
  size: 14,
417
441
  className: "mr-2 inline text-text-secondary"
418
442
  }),
@@ -421,26 +445,26 @@ function K({ editId: t }) {
421
445
  e.type,
422
446
  ")"
423
447
  ] }),
424
- selectedOption: Pe,
425
- selectedLoading: Fe,
426
- hasMore: je,
427
- totalCount: Me,
428
- onLoadMore: Ne,
429
- loadingMore: Ae,
448
+ selectedOption: Le,
449
+ selectedLoading: Re,
450
+ hasMore: Pe,
451
+ totalCount: Fe,
452
+ onLoadMore: Ie,
453
+ loadingMore: Ne,
430
454
  placeholder: "Unassigned",
431
455
  emptyText: "No vehicles match that search."
432
456
  })]
433
457
  })]
434
458
  }),
435
- /* @__PURE__ */ B("div", {
459
+ /* @__PURE__ */ z("div", {
436
460
  className: "grid grid-cols-1 md:grid-cols-3 gap-4",
437
461
  children: [
438
- /* @__PURE__ */ B("div", {
462
+ /* @__PURE__ */ z("div", {
439
463
  className: "space-y-2",
440
- children: [/* @__PURE__ */ z(x, {
464
+ children: [/* @__PURE__ */ R(x, {
441
465
  htmlFor: "rating",
442
466
  children: "Rating (0–5)"
443
- }), /* @__PURE__ */ z(b, {
467
+ }), /* @__PURE__ */ R(b, {
444
468
  id: "rating",
445
469
  type: "number",
446
470
  min: 0,
@@ -454,12 +478,12 @@ function K({ editId: t }) {
454
478
  placeholder: "4.8"
455
479
  })]
456
480
  }),
457
- /* @__PURE__ */ B("div", {
481
+ /* @__PURE__ */ z("div", {
458
482
  className: "space-y-2",
459
- children: [/* @__PURE__ */ z(x, {
483
+ children: [/* @__PURE__ */ R(x, {
460
484
  htmlFor: "hireDate",
461
485
  children: "Hire Date"
462
- }), /* @__PURE__ */ z(b, {
486
+ }), /* @__PURE__ */ R(b, {
463
487
  id: "hireDate",
464
488
  type: "date",
465
489
  value: M.hireDate,
@@ -469,14 +493,14 @@ function K({ editId: t }) {
469
493
  }))
470
494
  })]
471
495
  }),
472
- /* @__PURE__ */ B("div", {
496
+ /* @__PURE__ */ z("div", {
473
497
  className: "space-y-2",
474
- children: [/* @__PURE__ */ B("div", {
498
+ children: [/* @__PURE__ */ z("div", {
475
499
  className: "flex items-center justify-between gap-2",
476
- children: [/* @__PURE__ */ z(x, {
500
+ children: [/* @__PURE__ */ R(x, {
477
501
  htmlFor: "onLeaveUntil",
478
502
  children: "On Leave Until"
479
- }), M.onLeaveUntil && /* @__PURE__ */ z(h, {
503
+ }), M.onLeaveUntil && /* @__PURE__ */ R(h, {
480
504
  type: "button",
481
505
  variant: "ghost",
482
506
  size: "sm",
@@ -486,7 +510,7 @@ function K({ editId: t }) {
486
510
  })),
487
511
  children: "Clear"
488
512
  })]
489
- }), /* @__PURE__ */ z(b, {
513
+ }), /* @__PURE__ */ R(b, {
490
514
  id: "onLeaveUntil",
491
515
  type: "date",
492
516
  value: M.onLeaveUntil,
@@ -500,18 +524,18 @@ function K({ editId: t }) {
500
524
  })
501
525
  ]
502
526
  })] }),
503
- /* @__PURE__ */ B(g, { children: [/* @__PURE__ */ z(v, { children: /* @__PURE__ */ B(y, {
527
+ /* @__PURE__ */ z(g, { children: [/* @__PURE__ */ R(v, { children: /* @__PURE__ */ z(y, {
504
528
  className: "flex items-center gap-2",
505
- children: [/* @__PURE__ */ z(n, { size: 18 }), " Compensation"]
506
- }) }), /* @__PURE__ */ z(_, { children: /* @__PURE__ */ B("div", {
529
+ children: [/* @__PURE__ */ R(n, { size: 18 }), " Compensation"]
530
+ }) }), /* @__PURE__ */ R(_, { children: /* @__PURE__ */ z("div", {
507
531
  className: "grid grid-cols-1 md:grid-cols-3 gap-4",
508
532
  children: [
509
- /* @__PURE__ */ B("div", {
533
+ /* @__PURE__ */ z("div", {
510
534
  className: "space-y-2",
511
- children: [/* @__PURE__ */ z(x, {
535
+ children: [/* @__PURE__ */ R(x, {
512
536
  htmlFor: "baseSalary",
513
537
  children: "Base Salary (annual)"
514
- }), /* @__PURE__ */ z(b, {
538
+ }), /* @__PURE__ */ R(b, {
515
539
  id: "baseSalary",
516
540
  type: "number",
517
541
  min: 0,
@@ -524,12 +548,12 @@ function K({ editId: t }) {
524
548
  placeholder: "55000"
525
549
  })]
526
550
  }),
527
- /* @__PURE__ */ B("div", {
551
+ /* @__PURE__ */ z("div", {
528
552
  className: "space-y-2",
529
- children: [/* @__PURE__ */ z(x, {
553
+ children: [/* @__PURE__ */ R(x, {
530
554
  htmlFor: "bonusYtd",
531
555
  children: "Bonus (YTD)"
532
- }), /* @__PURE__ */ z(b, {
556
+ }), /* @__PURE__ */ R(b, {
533
557
  id: "bonusYtd",
534
558
  type: "number",
535
559
  min: 0,
@@ -542,12 +566,12 @@ function K({ editId: t }) {
542
566
  placeholder: "1200"
543
567
  })]
544
568
  }),
545
- /* @__PURE__ */ B("div", {
569
+ /* @__PURE__ */ z("div", {
546
570
  className: "space-y-2",
547
- children: [/* @__PURE__ */ z(x, {
571
+ children: [/* @__PURE__ */ R(x, {
548
572
  htmlFor: "payCurrency",
549
573
  children: "Currency"
550
- }), /* @__PURE__ */ z(b, {
574
+ }), /* @__PURE__ */ R(b, {
551
575
  id: "payCurrency",
552
576
  value: M.payCurrency,
553
577
  onChange: (e) => P((t) => ({
@@ -560,10 +584,10 @@ function K({ editId: t }) {
560
584
  })
561
585
  ]
562
586
  }) })] }),
563
- /* @__PURE__ */ B(g, { children: [/* @__PURE__ */ z(v, { children: /* @__PURE__ */ B(y, {
587
+ /* @__PURE__ */ z(g, { children: [/* @__PURE__ */ R(v, { children: /* @__PURE__ */ z(y, {
564
588
  className: "flex items-center gap-2",
565
- children: [/* @__PURE__ */ z(ee, { size: 18 }), " HR Notes"]
566
- }) }), /* @__PURE__ */ z(_, { children: /* @__PURE__ */ z(D, {
589
+ children: [/* @__PURE__ */ R(ee, { size: 18 }), " HR Notes"]
590
+ }) }), /* @__PURE__ */ R(_, { children: /* @__PURE__ */ R(E, {
567
591
  value: M.notes,
568
592
  onChange: (e) => P((t) => ({
569
593
  ...t,
@@ -572,99 +596,99 @@ function K({ editId: t }) {
572
596
  placeholder: "Performance notes, disciplinary history, anything worth tracking for this driver...",
573
597
  rows: 4
574
598
  }) })] }),
575
- A && !Ve && /* @__PURE__ */ B(g, {
599
+ A && !We && /* @__PURE__ */ z(g, {
576
600
  className: "border-status-error-border",
577
- children: [/* @__PURE__ */ z(v, { children: /* @__PURE__ */ B(y, {
601
+ children: [/* @__PURE__ */ R(v, { children: /* @__PURE__ */ z(y, {
578
602
  className: "flex items-center gap-2 text-status-error-text",
579
- children: [/* @__PURE__ */ z(u, { size: 18 }), " Dismiss Driver"]
580
- }) }), /* @__PURE__ */ B(_, { children: [/* @__PURE__ */ z("p", {
603
+ children: [/* @__PURE__ */ R(l, { size: 18 }), " Dismiss Driver"]
604
+ }) }), /* @__PURE__ */ z(_, { children: [/* @__PURE__ */ R("p", {
581
605
  className: "mb-3 text-sm text-text-secondary",
582
606
  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."
583
- }), /* @__PURE__ */ B(h, {
607
+ }), /* @__PURE__ */ z(h, {
584
608
  type: "button",
585
609
  variant: "outline",
586
610
  className: "border-status-error-border text-status-error-text hover:bg-status-error-bg-subtle",
587
611
  onClick: () => q(!0),
588
- children: [/* @__PURE__ */ z(u, { size: 16 }), " Dismiss this driver"]
612
+ children: [/* @__PURE__ */ R(l, { size: 16 }), " Dismiss this driver"]
589
613
  })] })]
590
614
  }),
591
- A && /* @__PURE__ */ B(g, {
615
+ A && /* @__PURE__ */ z(g, {
592
616
  className: "border-status-error-border",
593
- children: [/* @__PURE__ */ z(v, { children: /* @__PURE__ */ B(y, {
617
+ children: [/* @__PURE__ */ R(v, { children: /* @__PURE__ */ z(y, {
594
618
  className: "flex items-center gap-2 text-status-error-text",
595
- children: [/* @__PURE__ */ z(c, { size: 18 }), " Delete Driver"]
596
- }) }), /* @__PURE__ */ B(_, { children: [/* @__PURE__ */ z("p", {
619
+ children: [/* @__PURE__ */ R(c, { size: 18 }), " Delete Driver"]
620
+ }) }), /* @__PURE__ */ z(_, { children: [/* @__PURE__ */ R("p", {
597
621
  className: "mb-3 text-sm text-text-secondary",
598
622
  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."
599
- }), /* @__PURE__ */ B(h, {
623
+ }), /* @__PURE__ */ z(h, {
600
624
  type: "button",
601
625
  variant: "outline",
602
626
  className: "border-status-error-border text-status-error-text hover:bg-status-error-bg-subtle",
603
627
  onClick: () => Z(!0),
604
- children: [/* @__PURE__ */ z(c, { size: 16 }), " Delete this driver"]
628
+ children: [/* @__PURE__ */ R(c, { size: 16 }), " Delete this driver"]
605
629
  })] })]
606
630
  })
607
631
  ]
608
632
  }),
609
- /* @__PURE__ */ z(U, {
610
- open: Se,
633
+ /* @__PURE__ */ R(H, {
634
+ open: Te,
611
635
  onOpenChange: Z,
612
- children: /* @__PURE__ */ B(fe, { children: [
613
- /* @__PURE__ */ B(he, { children: [/* @__PURE__ */ z(ge, { children: "Delete this driver?" }), /* @__PURE__ */ B(pe, { children: [
636
+ children: /* @__PURE__ */ z(U, { children: [
637
+ /* @__PURE__ */ z(ge, { children: [/* @__PURE__ */ R(_e, { children: "Delete this driver?" }), /* @__PURE__ */ z(W, { children: [
614
638
  "This removes ",
615
639
  `${M.firstName} ${M.lastName}`.trim() || "this driver",
616
640
  " and unlinks them from any vehicle. It cannot be undone from here."
617
641
  ] })] }),
618
- /* @__PURE__ */ z("div", {
642
+ /* @__PURE__ */ R("div", {
619
643
  className: "px-1",
620
- children: /* @__PURE__ */ z(j, { message: we })
644
+ children: /* @__PURE__ */ R(j, { message: De })
621
645
  }),
622
- /* @__PURE__ */ B(me, { children: [/* @__PURE__ */ z(h, {
646
+ /* @__PURE__ */ z(G, { children: [/* @__PURE__ */ R(h, {
623
647
  variant: "outline",
624
648
  onClick: () => Z(!1),
625
649
  disabled: Q,
626
650
  children: "Cancel"
627
- }), /* @__PURE__ */ z(h, {
651
+ }), /* @__PURE__ */ R(h, {
628
652
  className: "bg-status-error-text text-text-inverse hover:opacity-90",
629
- onClick: Be,
653
+ onClick: Ue,
630
654
  disabled: Q,
631
655
  children: Q ? "Deleting..." : "Delete driver"
632
656
  })] })
633
657
  ] })
634
658
  }),
635
- /* @__PURE__ */ z(U, {
659
+ /* @__PURE__ */ R(H, {
636
660
  open: K,
637
661
  onOpenChange: q,
638
- children: /* @__PURE__ */ B(fe, { children: [
639
- /* @__PURE__ */ B(he, { children: [/* @__PURE__ */ z(ge, { children: "Dismiss this driver?" }), /* @__PURE__ */ z(pe, { children: "This records the driver as dismissed and requires a reason. It cannot be undone from here." })] }),
640
- /* @__PURE__ */ B("div", {
662
+ children: /* @__PURE__ */ z(U, { children: [
663
+ /* @__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." })] }),
664
+ /* @__PURE__ */ z("div", {
641
665
  className: "space-y-2 px-1",
642
666
  children: [
643
- /* @__PURE__ */ B(x, {
667
+ /* @__PURE__ */ z(x, {
644
668
  htmlFor: "dismissReason",
645
- children: ["Reason ", /* @__PURE__ */ z("span", {
669
+ children: ["Reason ", /* @__PURE__ */ R("span", {
646
670
  className: "text-status-error-text",
647
671
  children: "*"
648
672
  })]
649
673
  }),
650
- /* @__PURE__ */ z(D, {
674
+ /* @__PURE__ */ R(E, {
651
675
  id: "dismissReason",
652
676
  value: J,
653
- onChange: (e) => ye(e.target.value),
677
+ onChange: (e) => Se(e.target.value),
654
678
  placeholder: "e.g. Repeated policy violations, voluntary resignation, performance...",
655
679
  rows: 3
656
680
  }),
657
- /* @__PURE__ */ z(j, { message: xe })
681
+ /* @__PURE__ */ R(j, { message: we })
658
682
  ]
659
683
  }),
660
- /* @__PURE__ */ B(me, { children: [/* @__PURE__ */ z(h, {
684
+ /* @__PURE__ */ z(G, { children: [/* @__PURE__ */ R(h, {
661
685
  variant: "outline",
662
686
  onClick: () => q(!1),
663
687
  disabled: Y,
664
688
  children: "Cancel"
665
- }), /* @__PURE__ */ z(h, {
689
+ }), /* @__PURE__ */ R(h, {
666
690
  className: "bg-status-error-text text-text-inverse hover:opacity-90",
667
- onClick: ze,
691
+ onClick: He,
668
692
  disabled: Y,
669
693
  children: Y ? "Dismissing..." : "Confirm dismissal"
670
694
  })] })
@@ -674,40 +698,40 @@ function K({ editId: t }) {
674
698
  });
675
699
  }
676
700
  function q() {
677
- let { driverId: a } = R(), c = L().pathname.endsWith("/edit"), { basePath: u, navigate: p } = te(), { driver: m, isLoading: ie, error: b, refetch: x } = ne(a);
701
+ let { driverId: a } = pe(), c = L().pathname.endsWith("/edit"), { basePath: l, navigate: f } = ne(), { driver: m, isLoading: ie, error: b, refetch: x } = p(a);
678
702
  F(c, x);
679
- let { vehicle: S } = re(m?.assignedVehicle), C = () => p?.(f(u, "fleet/drivers")), w = (e) => p?.(f(u, e));
680
- if (!a) return /* @__PURE__ */ z(K, {});
681
- if (c) return /* @__PURE__ */ z(K, { editId: a });
682
- if (ie) return /* @__PURE__ */ z(O, { message: "Loading driver details..." });
683
- if (b || !m) return /* @__PURE__ */ z(ae, {
703
+ let { vehicle: S } = re(m?.assignedVehicle), ae = () => f?.(d(l, "fleet/drivers")), C = (e) => f?.(d(l, e));
704
+ if (!a) return /* @__PURE__ */ R(K, {});
705
+ if (c) return /* @__PURE__ */ R(K, { editId: a });
706
+ if (ie) return /* @__PURE__ */ R(D, { message: "Loading driver details..." });
707
+ if (b || !m) return /* @__PURE__ */ R(oe, {
684
708
  title: "Driver not found",
685
709
  onRetry: x
686
710
  });
687
- let T = !!m.terminatedAt, E = m.onLeaveUntil && m.onLeaveUntil.getTime() > (/* @__PURE__ */ new Date()).getTime() ? m.onLeaveUntil : void 0, D = m.baseSalary !== void 0 || m.bonusYtd !== void 0;
688
- return /* @__PURE__ */ B(oe, {
711
+ let w = !!m.terminatedAt, T = m.onLeaveUntil && m.onLeaveUntil.getTime() > (/* @__PURE__ */ new Date()).getTime() ? m.onLeaveUntil : void 0, E = m.baseSalary !== void 0 || m.bonusYtd !== void 0;
712
+ return /* @__PURE__ */ z(O, {
689
713
  title: m.fullName,
690
714
  subtitle: `Employee ID: ${m.employeeId}`,
691
- icon: /* @__PURE__ */ z(d, { size: 24 }),
692
- headerActions: /* @__PURE__ */ B("div", {
715
+ icon: /* @__PURE__ */ R(u, { size: 24 }),
716
+ headerActions: /* @__PURE__ */ z("div", {
693
717
  className: "flex gap-2",
694
- children: [/* @__PURE__ */ B(h, {
718
+ children: [/* @__PURE__ */ z(h, {
695
719
  variant: "outline",
696
- onClick: C,
697
- children: [/* @__PURE__ */ z(e, { size: 16 }), " Back"]
698
- }), /* @__PURE__ */ B(h, {
699
- onClick: () => p?.(f(u, "fleet/drivers/" + a + "/edit")),
700
- children: [/* @__PURE__ */ z(o, { size: 16 }), " Edit"]
720
+ onClick: ae,
721
+ children: [/* @__PURE__ */ R(e, { size: 16 }), " Back"]
722
+ }), /* @__PURE__ */ z(h, {
723
+ onClick: () => f?.(d(l, "fleet/drivers/" + a + "/edit")),
724
+ children: [/* @__PURE__ */ R(o, { size: 16 }), " Edit"]
701
725
  })]
702
726
  }),
703
- headerContent: /* @__PURE__ */ B("div", {
727
+ headerContent: /* @__PURE__ */ z("div", {
704
728
  className: "flex flex-wrap items-center gap-4",
705
729
  children: [
706
- /* @__PURE__ */ z(A, {
730
+ /* @__PURE__ */ R(A, {
707
731
  status: m.status,
708
732
  type: "driver"
709
733
  }),
710
- T && /* @__PURE__ */ z(A, {
734
+ w && /* @__PURE__ */ R(A, {
711
735
  status: "dismissed",
712
736
  label: "Dismissed",
713
737
  customColors: {
@@ -715,20 +739,20 @@ function q() {
715
739
  text: "text-status-error-text"
716
740
  }
717
741
  }),
718
- E && !T && /* @__PURE__ */ z(A, {
742
+ T && !w && /* @__PURE__ */ R(A, {
719
743
  status: "on_leave",
720
- label: `On leave until ${N(E, "short")}`,
744
+ label: `On leave until ${N(T, "short")}`,
721
745
  customColors: {
722
746
  bg: "bg-status-warning-bg-subtle",
723
747
  text: "text-status-warning-text"
724
748
  }
725
749
  }),
726
- m.rating !== void 0 && /* @__PURE__ */ B("div", {
750
+ m.rating !== void 0 && /* @__PURE__ */ z("div", {
727
751
  className: "flex items-center gap-1",
728
- children: [/* @__PURE__ */ z(s, {
752
+ children: [/* @__PURE__ */ R(s, {
729
753
  size: 16,
730
754
  className: "text-status-warning-text fill-current"
731
- }), /* @__PURE__ */ z("span", {
755
+ }), /* @__PURE__ */ R("span", {
732
756
  className: "font-medium",
733
757
  children: m.rating.toFixed(1)
734
758
  })]
@@ -736,145 +760,145 @@ function q() {
736
760
  ]
737
761
  }),
738
762
  children: [
739
- /* @__PURE__ */ z(H, {
740
- icon: /* @__PURE__ */ z(d, { size: 18 }),
741
- children: "A driver's full profile — licensing, assigned vehicle, documents and HR record. Use it to confirm someone is road-ready and compliant before assigning them an order or route."
763
+ /* @__PURE__ */ R(V, {
764
+ icon: /* @__PURE__ */ R(u, { size: 18 }),
765
+ 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."
742
766
  }),
743
- /* @__PURE__ */ z(V, {
767
+ /* @__PURE__ */ R(B, {
744
768
  storageKey: "movethewheels-driver-details",
745
769
  steps: [
746
770
  {
747
771
  id: "assign",
748
772
  label: "Assign to an order",
749
773
  description: "Hand a pending delivery to this driver.",
750
- icon: /* @__PURE__ */ z(i, { size: 16 }),
751
- onClick: () => w("orders")
774
+ icon: /* @__PURE__ */ R(i, { size: 16 }),
775
+ onClick: () => C("orders")
752
776
  },
753
777
  {
754
778
  id: "routes",
755
779
  label: "Plan their route",
756
780
  description: "Batch nearby drop-offs into an optimized itinerary.",
757
- icon: /* @__PURE__ */ z(t, { size: 16 }),
758
- onClick: () => w("routes")
781
+ icon: /* @__PURE__ */ R(t, { size: 16 }),
782
+ onClick: () => C("routes")
759
783
  },
760
784
  {
761
785
  id: "edit",
762
786
  label: "Update driver record",
763
787
  description: "Refresh documents, license or HR details.",
764
- icon: /* @__PURE__ */ z(o, { size: 16 }),
788
+ icon: /* @__PURE__ */ R(o, { size: 16 }),
765
789
  onClick: () => {}
766
790
  }
767
791
  ]
768
792
  }),
769
- T && /* @__PURE__ */ B("div", {
793
+ w && /* @__PURE__ */ z("div", {
770
794
  className: "rounded-card border border-status-error-border bg-status-error-bg-subtle p-4 text-sm text-status-error-text",
771
- children: [/* @__PURE__ */ B("p", {
795
+ children: [/* @__PURE__ */ z("p", {
772
796
  className: "font-medium",
773
797
  children: ["Dismissed ", m.terminatedAt && N(m.terminatedAt, "full")]
774
- }), m.terminationReason && /* @__PURE__ */ B("p", {
798
+ }), m.terminationReason && /* @__PURE__ */ z("p", {
775
799
  className: "mt-1",
776
800
  children: ["Reason: ", m.terminationReason]
777
801
  })]
778
802
  }),
779
- /* @__PURE__ */ B("div", {
803
+ /* @__PURE__ */ z("div", {
780
804
  className: "grid grid-cols-1 lg:grid-cols-3 gap-6",
781
- children: [/* @__PURE__ */ B("div", {
805
+ children: [/* @__PURE__ */ z("div", {
782
806
  className: "lg:col-span-2 space-y-6",
783
807
  children: [
784
- /* @__PURE__ */ B(g, { children: [/* @__PURE__ */ z(v, { children: /* @__PURE__ */ B(y, {
808
+ /* @__PURE__ */ z(g, { children: [/* @__PURE__ */ R(v, { children: /* @__PURE__ */ z(y, {
785
809
  className: "flex items-center gap-2",
786
- children: [/* @__PURE__ */ z(r, { size: 18 }), " License"]
787
- }) }), /* @__PURE__ */ z(_, { children: /* @__PURE__ */ z("div", {
810
+ children: [/* @__PURE__ */ R(r, { size: 18 }), " License"]
811
+ }) }), /* @__PURE__ */ R(_, { children: /* @__PURE__ */ R("div", {
788
812
  className: "flex items-center justify-between p-3 border rounded-lg",
789
- children: /* @__PURE__ */ B("div", { children: [
790
- /* @__PURE__ */ z("p", {
813
+ children: /* @__PURE__ */ z("div", { children: [
814
+ /* @__PURE__ */ R("p", {
791
815
  className: "font-medium",
792
816
  children: "Driver's License"
793
817
  }),
794
- /* @__PURE__ */ B("p", {
818
+ /* @__PURE__ */ z("p", {
795
819
  className: "text-sm text-text-secondary",
796
820
  children: [m.licenseNumber || "—", m.licenseType ? ` - ${m.licenseType}` : ""]
797
821
  }),
798
- /* @__PURE__ */ z("p", {
799
- className: "text-sm text-text-secondary",
800
- children: m.licenseExpiry ? `Expires: ${N(m.licenseExpiry)}` : "Expiry not recorded"
822
+ /* @__PURE__ */ R("p", {
823
+ className: "text-sm text-text-secondary break-all",
824
+ children: m.licenseExpiry ? `Recorded expiry (UTC): ${m.licenseExpiry.toISOString()}` : "Expiry not recorded"
801
825
  })
802
826
  ] })
803
827
  }) })] }),
804
- m.notes && /* @__PURE__ */ B(g, { children: [/* @__PURE__ */ z(v, { children: /* @__PURE__ */ B(y, {
828
+ m.notes && /* @__PURE__ */ z(g, { children: [/* @__PURE__ */ R(v, { children: /* @__PURE__ */ z(y, {
805
829
  className: "flex items-center gap-2",
806
- children: [/* @__PURE__ */ z(ee, { size: 18 }), " HR Notes"]
807
- }) }), /* @__PURE__ */ z(_, { children: /* @__PURE__ */ z("p", {
830
+ children: [/* @__PURE__ */ R(ee, { size: 18 }), " HR Notes"]
831
+ }) }), /* @__PURE__ */ R(_, { children: /* @__PURE__ */ R("p", {
808
832
  className: "text-sm whitespace-pre-wrap",
809
833
  children: m.notes
810
834
  }) })] }),
811
- /* @__PURE__ */ z(P, {
835
+ /* @__PURE__ */ R(P, {
812
836
  entityType: "driver",
813
837
  entityId: m.id
814
838
  })
815
839
  ]
816
- }), /* @__PURE__ */ B("div", {
840
+ }), /* @__PURE__ */ z("div", {
817
841
  className: "space-y-6",
818
842
  children: [
819
- /* @__PURE__ */ B(g, { children: [/* @__PURE__ */ z(v, { children: /* @__PURE__ */ B(y, {
843
+ /* @__PURE__ */ z(g, { children: [/* @__PURE__ */ R(v, { children: /* @__PURE__ */ z(y, {
820
844
  className: "flex items-center gap-2",
821
- children: [/* @__PURE__ */ z(l, { size: 18 }), " Assigned Vehicle"]
822
- }) }), /* @__PURE__ */ z(_, { children: m.assignedVehicle ? S ? /* @__PURE__ */ B("button", {
845
+ children: [/* @__PURE__ */ R(te, { size: 18 }), " Assigned Vehicle"]
846
+ }) }), /* @__PURE__ */ R(_, { children: m.assignedVehicle ? S ? /* @__PURE__ */ z("button", {
823
847
  type: "button",
824
848
  className: "text-sm font-medium text-primary hover:underline",
825
- onClick: () => w(`fleet/vehicles/${S.id}`),
849
+ onClick: () => C(`fleet/vehicles/${S.id}`),
826
850
  children: [
827
851
  S.vehicleNumber,
828
852
  " (",
829
853
  S.type,
830
854
  ")"
831
855
  ]
832
- }) : /* @__PURE__ */ z("p", {
856
+ }) : /* @__PURE__ */ R("p", {
833
857
  className: "text-sm text-text-secondary",
834
858
  children: "Loading…"
835
- }) : /* @__PURE__ */ z("p", {
859
+ }) : /* @__PURE__ */ R("p", {
836
860
  className: "text-sm text-text-secondary",
837
861
  children: "No vehicle assigned"
838
862
  }) })] }),
839
- /* @__PURE__ */ B(g, { children: [/* @__PURE__ */ z(v, { children: /* @__PURE__ */ z(y, { children: "Record" }) }), /* @__PURE__ */ z(_, {
863
+ /* @__PURE__ */ z(g, { children: [/* @__PURE__ */ R(v, { children: /* @__PURE__ */ R(y, { children: "Record" }) }), /* @__PURE__ */ R(_, {
840
864
  className: "space-y-4",
841
- children: /* @__PURE__ */ B("div", { children: [/* @__PURE__ */ z("p", {
865
+ children: /* @__PURE__ */ z("div", { children: [/* @__PURE__ */ R("p", {
842
866
  className: "text-sm text-text-secondary",
843
867
  children: "Hire Date"
844
- }), /* @__PURE__ */ z("p", {
868
+ }), /* @__PURE__ */ R("p", {
845
869
  className: "font-medium",
846
870
  children: m.hireDate ? N(m.hireDate) : "Not recorded"
847
871
  })] })
848
872
  })] }),
849
- /* @__PURE__ */ B(g, { children: [/* @__PURE__ */ z(v, { children: /* @__PURE__ */ B(y, {
873
+ /* @__PURE__ */ z(g, { children: [/* @__PURE__ */ R(v, { children: /* @__PURE__ */ z(y, {
850
874
  className: "flex items-center gap-2",
851
- children: [/* @__PURE__ */ z(n, { size: 18 }), " Compensation"]
852
- }) }), /* @__PURE__ */ z(_, {
875
+ children: [/* @__PURE__ */ R(n, { size: 18 }), " Compensation"]
876
+ }) }), /* @__PURE__ */ R(_, {
853
877
  className: "space-y-3",
854
- children: D ? /* @__PURE__ */ B(ue, { children: [m.baseSalary !== void 0 && /* @__PURE__ */ B("div", { children: [/* @__PURE__ */ z("p", {
878
+ children: E ? /* @__PURE__ */ z(me, { children: [m.baseSalary !== void 0 && /* @__PURE__ */ z("div", { children: [/* @__PURE__ */ R("p", {
855
879
  className: "text-sm text-text-secondary",
856
880
  children: "Base Salary"
857
- }), /* @__PURE__ */ B("p", {
881
+ }), /* @__PURE__ */ z("p", {
858
882
  className: "font-medium",
859
883
  children: [M(m.baseSalary, m.payCurrency || void 0), "/year"]
860
- })] }), m.bonusYtd !== void 0 && /* @__PURE__ */ B("div", { children: [/* @__PURE__ */ z("p", {
884
+ })] }), m.bonusYtd !== void 0 && /* @__PURE__ */ z("div", { children: [/* @__PURE__ */ R("p", {
861
885
  className: "text-sm text-text-secondary",
862
886
  children: "Bonus (YTD)"
863
- }), /* @__PURE__ */ z("p", {
887
+ }), /* @__PURE__ */ R("p", {
864
888
  className: "font-medium",
865
889
  children: M(m.bonusYtd, m.payCurrency || void 0)
866
- })] })] }) : /* @__PURE__ */ z("p", {
890
+ })] })] }) : /* @__PURE__ */ R("p", {
867
891
  className: "text-sm text-text-secondary",
868
892
  children: "Not recorded"
869
893
  })
870
894
  })] }),
871
- m.currentLocation && /* @__PURE__ */ B(g, { children: [/* @__PURE__ */ z(v, { children: /* @__PURE__ */ B(y, {
895
+ m.currentLocation && /* @__PURE__ */ z(g, { children: [/* @__PURE__ */ R(v, { children: /* @__PURE__ */ z(y, {
872
896
  className: "flex items-center gap-2",
873
- children: [/* @__PURE__ */ z(i, { size: 18 }), " Current Location"]
874
- }) }), /* @__PURE__ */ B(_, { children: [/* @__PURE__ */ z("p", {
897
+ children: [/* @__PURE__ */ R(i, { size: 18 }), " Current Location"]
898
+ }) }), /* @__PURE__ */ z(_, { children: [/* @__PURE__ */ R("p", {
875
899
  className: "text-sm",
876
900
  children: m.currentLocation.address || "Location updating..."
877
- }), /* @__PURE__ */ z("p", {
901
+ }), /* @__PURE__ */ R("p", {
878
902
  className: "text-xs text-text-secondary mt-1",
879
903
  children: m.currentLocation.timestamp ? `Updated ${N(m.currentLocation.timestamp, "relative")}` : "Update time not recorded"
880
904
  })] })] })