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