@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.
Files changed (79) hide show
  1. package/dist/components/CarbonFootprintPanel.js +1 -1
  2. package/dist/components/CustomerPicker.js +76 -65
  3. package/dist/components/DataTable.js +140 -139
  4. package/dist/components/DocumentsCard.js +14 -8
  5. package/dist/generated/wspace-types.d.ts +2719 -8
  6. package/dist/hooks/index.js +1 -1
  7. package/dist/hooks/useAnalytics.js +21 -1
  8. package/dist/hooks/useCustomers.js +94 -78
  9. package/dist/hooks/useDebouncedValue.js +11 -0
  10. package/dist/hooks/useEntityDocuments.js +28 -18
  11. package/dist/hooks/useEpod.js +24 -17
  12. package/dist/hooks/useFleet.js +148 -125
  13. package/dist/hooks/useInventory.js +255 -186
  14. package/dist/hooks/useMultiModalShipments.js +35 -27
  15. package/dist/hooks/useOrders.js +139 -134
  16. package/dist/hooks/useRoutes.js +97 -75
  17. package/dist/hooks/useTracking.js +100 -88
  18. package/dist/index.js +6 -6
  19. package/dist/movethewheels/components/CustomerPicker.d.ts +3 -1
  20. package/dist/movethewheels/components/DataTable.d.ts +5 -1
  21. package/dist/movethewheels/hooks/useCustomers.d.ts +0 -1
  22. package/dist/movethewheels/hooks/useDebouncedValue.d.ts +1 -0
  23. package/dist/movethewheels/hooks/useEntityDocuments.d.ts +2 -0
  24. package/dist/movethewheels/hooks/useEpod.d.ts +6 -1
  25. package/dist/movethewheels/hooks/useFleet.d.ts +49 -5
  26. package/dist/movethewheels/hooks/useInventory.d.ts +24 -17
  27. package/dist/movethewheels/hooks/useMultiModalShipments.d.ts +6 -1
  28. package/dist/movethewheels/hooks/useOrders.d.ts +48 -5
  29. package/dist/movethewheels/hooks/useRoutes.d.ts +18 -1
  30. package/dist/movethewheels/hooks/useTracking.d.ts +12 -11
  31. package/dist/movethewheels/types/index.d.ts +12 -5
  32. package/dist/pages/CreateOrderPage.js +191 -129
  33. package/dist/pages/CustomersPage.js +61 -54
  34. package/dist/pages/DeliveryCapturePage.js +131 -109
  35. package/dist/pages/DriversPage.js +100 -92
  36. package/dist/pages/InventoryPage.js +239 -236
  37. package/dist/pages/MultiModalShipmentPage.js +163 -130
  38. package/dist/pages/OrderDetailsPage.js +190 -106
  39. package/dist/pages/OrdersListPage.js +66 -60
  40. package/dist/pages/ProductDetailsPage.js +241 -200
  41. package/dist/pages/ProductsPage.js +59 -52
  42. package/dist/pages/RouteDetailsPage.js +324 -293
  43. package/dist/pages/RoutesPage.js +55 -48
  44. package/dist/pages/VehiclesPage.js +63 -56
  45. package/dist/pages/WarehousesPage.js +60 -53
  46. package/package.json +1 -1
  47. package/src/generated/wspace-types.ts +3136 -8
  48. package/src/movethewheels/components/CarbonFootprintPanel.tsx +0 -1
  49. package/src/movethewheels/components/CustomerPicker.tsx +14 -0
  50. package/src/movethewheels/components/DataTable.tsx +34 -18
  51. package/src/movethewheels/components/DocumentsCard.tsx +6 -1
  52. package/src/movethewheels/components/maps/leaflet-setup.ts +1 -8
  53. package/src/movethewheels/hooks/useAnalytics.ts +27 -0
  54. package/src/movethewheels/hooks/useCustomers.ts +64 -24
  55. package/src/movethewheels/hooks/useDebouncedValue.ts +12 -0
  56. package/src/movethewheels/hooks/useEntityDocuments.ts +43 -25
  57. package/src/movethewheels/hooks/useEpod.ts +14 -7
  58. package/src/movethewheels/hooks/useFleet.ts +66 -38
  59. package/src/movethewheels/hooks/useFleetIntelligence.ts +1 -4
  60. package/src/movethewheels/hooks/useInventory.ts +211 -90
  61. package/src/movethewheels/hooks/useMultiModalShipments.ts +15 -11
  62. package/src/movethewheels/hooks/useOrders.ts +48 -14
  63. package/src/movethewheels/hooks/useRoutes.ts +81 -24
  64. package/src/movethewheels/hooks/useTracking.ts +130 -98
  65. package/src/movethewheels/pages/CreateOrderPage.tsx +93 -2
  66. package/src/movethewheels/pages/CustomersPage.tsx +11 -1
  67. package/src/movethewheels/pages/DeliveryCapturePage.tsx +31 -1
  68. package/src/movethewheels/pages/DriversPage.tsx +24 -12
  69. package/src/movethewheels/pages/InventoryPage.tsx +57 -32
  70. package/src/movethewheels/pages/MultiModalShipmentPage.tsx +52 -3
  71. package/src/movethewheels/pages/OrderDetailsPage.tsx +91 -6
  72. package/src/movethewheels/pages/OrdersListPage.tsx +20 -3
  73. package/src/movethewheels/pages/ProductDetailsPage.tsx +52 -3
  74. package/src/movethewheels/pages/ProductsPage.tsx +11 -1
  75. package/src/movethewheels/pages/RouteDetailsPage.tsx +45 -5
  76. package/src/movethewheels/pages/RoutesPage.tsx +11 -1
  77. package/src/movethewheels/pages/VehiclesPage.tsx +19 -2
  78. package/src/movethewheels/pages/WarehousesPage.tsx +11 -1
  79. package/src/movethewheels/types/index.ts +12 -5
@@ -3,95 +3,106 @@ import { CalendarClock as t } from "../node_modules/lucide-react/dist/esm/icons/
3
3
  import { MapPin as n } from "../node_modules/lucide-react/dist/esm/icons/map-pin.js";
4
4
  import { Package as r } from "../node_modules/lucide-react/dist/esm/icons/package.js";
5
5
  import { Plus as i } from "../node_modules/lucide-react/dist/esm/icons/plus.js";
6
- import { Save as a } from "../node_modules/lucide-react/dist/esm/icons/save.js";
7
- import { Trash2 as o } from "../node_modules/lucide-react/dist/esm/icons/trash-2.js";
8
- import { Users as ee } from "../node_modules/lucide-react/dist/esm/icons/users.js";
9
- import { buildCustomerCreatePath as te, joinPath as s } from "../utils/navigation.js";
10
- import { useMoveTheWheels as c } from "../providers/MoveTheWheelsProvider.js";
11
- import { useOrder as l, useOrders as u } from "../hooks/useOrders.js";
12
- import { useCustomer as ne, useCustomers as re } from "../hooks/useCustomers.js";
13
- import { Button as d, Card as f, CardContent as p, CardHeader as m, CardTitle as h, Input as g, Label as _, Select as v, SelectContent as ie, SelectItem as y, SelectTrigger as ae, SelectValue as oe, Separator as se, Textarea as ce } from "../components/ui.js";
14
- import { EmptyState as le, PageLayout as ue } from "../components/PageLayout.js";
15
- import { FormError as de } from "../components/FormError.js";
16
- import { CustomerPicker as fe } from "../components/CustomerPicker.js";
6
+ import { Route as a } from "../node_modules/lucide-react/dist/esm/icons/route.js";
7
+ import { Save as ee } from "../node_modules/lucide-react/dist/esm/icons/save.js";
8
+ import { Trash2 as te } from "../node_modules/lucide-react/dist/esm/icons/trash-2.js";
9
+ import { Users as ne } from "../node_modules/lucide-react/dist/esm/icons/users.js";
10
+ import { buildCustomerCreatePath as re, joinPath as o } from "../utils/navigation.js";
11
+ import { useMoveTheWheels as ie } from "../providers/MoveTheWheelsProvider.js";
12
+ import { useRoutes as ae } from "../hooks/useRoutes.js";
13
+ import { useOrder as oe, useOrders as se } from "../hooks/useOrders.js";
14
+ import { useCustomer as ce, useCustomers as le } from "../hooks/useCustomers.js";
15
+ import { Button as s, Card as c, CardContent as l, CardHeader as u, CardTitle as d, Input as f, Label as p, Select as m, SelectContent as h, SelectItem as g, SelectTrigger as _, SelectValue as v, Separator as ue, Textarea as de } from "../components/ui.js";
16
+ import { EmptyState as fe, PageLayout as y } from "../components/PageLayout.js";
17
+ import { FormError as pe } from "../components/FormError.js";
18
+ import { useDebouncedValue as me } from "../hooks/useDebouncedValue.js";
19
+ import { CustomerPicker as he } from "../components/CustomerPicker.js";
17
20
  import { useEffect as b, useState as x } from "react";
18
- import { useParams as pe, useSearchParams as S } from "react-router";
21
+ import { useParams as ge, useSearchParams as S } from "react-router";
19
22
  import { jsx as C, jsxs as w } from "react/jsx-runtime";
20
- import { EmphasisPanel as T, NextSteps as me, PagePurpose as he } from "@burdenoff/fe-libs/ui";
23
+ import { EmphasisPanel as _e, NextSteps as ve, PagePurpose as ye } from "@burdenoff/fe-libs/ui";
21
24
  //#region src/movethewheels/pages/CreateOrderPage.tsx
22
- function E(e) {
25
+ function T(e) {
23
26
  if (!e || Number.isNaN(e.getTime())) return "";
24
27
  let t = (e) => String(e).padStart(2, "0");
25
28
  return `${e.getFullYear()}-${t(e.getMonth() + 1)}-${t(e.getDate())}T${t(e.getHours())}:${t(e.getMinutes())}`;
26
29
  }
27
- function D() {
28
- let { orderId: D } = pe(), [ge] = S(), O = ge.get("customerId")?.trim() || void 0, { basePath: k, navigate: A } = c(), { order: j } = l(D), { createOrder: M, updateOrder: N } = u(), { customers: P, createCustomer: F, isLoading: I, error: L, refetch: _e } = re({ limit: 100 }), { customer: R } = ne(O ?? j?.customerId), z = !!D && !!j, [B, V] = x(null), [H, U] = x({
29
- customerId: O || j?.customerId || "",
30
- priority: j?.priority || "normal",
30
+ function E() {
31
+ let { orderId: E } = ge(), [be] = S(), D = be.get("customerId")?.trim() || void 0, { basePath: O, navigate: k } = ie(), { order: A } = oe(E), { createOrder: j, updateOrder: M } = se(), [N, xe] = x(""), { customers: P, createCustomer: Se, isLoading: F, error: I, refetch: Ce } = le({
32
+ limit: 20,
33
+ filters: { search: me(N) || void 0 }
34
+ }), { customer: L } = ce(D ?? A?.customerId), { routes: R, isLoading: we, error: Te } = ae({
35
+ status: "planned",
36
+ limit: 20
37
+ }), z = !!E && !!A, [B, V] = x(null), [H, U] = x({
38
+ customerId: D || A?.customerId || "",
39
+ priority: A?.priority || "normal",
40
+ routeId: A?.routeId || "",
31
41
  pickupAddress: {
32
- street: j?.pickupAddress.street || "",
33
- city: j?.pickupAddress.city || "",
34
- state: j?.pickupAddress.state || "",
35
- postalCode: j?.pickupAddress.postalCode || "",
36
- country: j?.pickupAddress.country || "USA"
42
+ street: A?.pickupAddress.street || "",
43
+ city: A?.pickupAddress.city || "",
44
+ state: A?.pickupAddress.state || "",
45
+ postalCode: A?.pickupAddress.postalCode || "",
46
+ country: A?.pickupAddress.country || "USA"
37
47
  },
38
48
  deliveryAddress: {
39
- street: j?.deliveryAddress.street || "",
40
- city: j?.deliveryAddress.city || "",
41
- state: j?.deliveryAddress.state || "",
42
- postalCode: j?.deliveryAddress.postalCode || "",
43
- country: j?.deliveryAddress.country || "USA"
49
+ street: A?.deliveryAddress.street || "",
50
+ city: A?.deliveryAddress.city || "",
51
+ state: A?.deliveryAddress.state || "",
52
+ postalCode: A?.deliveryAddress.postalCode || "",
53
+ country: A?.deliveryAddress.country || "USA"
44
54
  },
45
- items: j?.items || [],
46
- scheduledDelivery: E(j?.scheduledDelivery),
47
- specialInstructions: j?.specialInstructions || ""
48
- }), [W, G] = x(!1), [ve, K] = x(null);
55
+ items: A?.items || [],
56
+ scheduledDelivery: T(A?.scheduledDelivery),
57
+ specialInstructions: A?.specialInstructions || ""
58
+ }), [W, G] = x(!1), [Ee, K] = x(null);
49
59
  b(() => {
50
- R && (V((e) => e?.id === R.id ? e : R), U((e) => e.customerId ? e : {
60
+ L && (V((e) => e?.id === L.id ? e : L), U((e) => e.customerId ? e : {
51
61
  ...e,
52
- customerId: R.id
62
+ customerId: L.id
53
63
  }));
54
- }, [R]), b(() => {
55
- j && U({
56
- customerId: j.customerId || "",
57
- priority: j.priority || "normal",
64
+ }, [L]), b(() => {
65
+ A && U({
66
+ customerId: A.customerId || "",
67
+ priority: A.priority || "normal",
68
+ routeId: A.routeId || "",
58
69
  pickupAddress: {
59
- street: j.pickupAddress.street || "",
60
- city: j.pickupAddress.city || "",
61
- state: j.pickupAddress.state || "",
62
- postalCode: j.pickupAddress.postalCode || "",
63
- country: j.pickupAddress.country || "USA"
70
+ street: A.pickupAddress.street || "",
71
+ city: A.pickupAddress.city || "",
72
+ state: A.pickupAddress.state || "",
73
+ postalCode: A.pickupAddress.postalCode || "",
74
+ country: A.pickupAddress.country || "USA"
64
75
  },
65
76
  deliveryAddress: {
66
- street: j.deliveryAddress.street || "",
67
- city: j.deliveryAddress.city || "",
68
- state: j.deliveryAddress.state || "",
69
- postalCode: j.deliveryAddress.postalCode || "",
70
- country: j.deliveryAddress.country || "USA"
77
+ street: A.deliveryAddress.street || "",
78
+ city: A.deliveryAddress.city || "",
79
+ state: A.deliveryAddress.state || "",
80
+ postalCode: A.deliveryAddress.postalCode || "",
81
+ country: A.deliveryAddress.country || "USA"
71
82
  },
72
- items: j.items || [],
73
- scheduledDelivery: E(j.scheduledDelivery),
74
- specialInstructions: j.specialInstructions || ""
83
+ items: A.items || [],
84
+ scheduledDelivery: T(A.scheduledDelivery),
85
+ specialInstructions: A.specialInstructions || ""
75
86
  });
76
- }, [j]);
87
+ }, [A]);
77
88
  let q = () => {
78
- if (A) {
79
- if (!z && O) {
80
- A(s(k, `customers/${O}`));
89
+ if (k) {
90
+ if (!z && D) {
91
+ k(o(O, `customers/${D}`));
81
92
  return;
82
93
  }
83
- A(s(k, "orders"));
94
+ k(o(O, "orders"));
84
95
  }
85
- }, J = () => B ?? P.find((e) => e.id === H.customerId), ye = () => !H.customerId || !J() ? L ? "Customers could not be loaded. Retry or create a customer before continuing." : "Select a customer for this order." : H.pickupAddress.street.trim() ? H.deliveryAddress.street.trim() ? H.items.length === 0 ? "Add at least one item to the order." : H.scheduledDelivery && Number.isNaN(Date.parse(H.scheduledDelivery)) ? "Enter a valid scheduled delivery date and time." : null : "Enter a delivery street address." : "Enter a pickup street address.", Y = async (e) => {
96
+ }, J = () => B ?? P.find((e) => e.id === H.customerId), De = () => !H.customerId || !J() ? I ? "Customers could not be loaded. Retry or create a customer before continuing." : "Select a customer for this order." : H.pickupAddress.street.trim() ? H.deliveryAddress.street.trim() ? H.items.length === 0 ? "Add at least one item to the order." : H.scheduledDelivery && Number.isNaN(Date.parse(H.scheduledDelivery)) ? "Enter a valid scheduled delivery date and time." : null : "Enter a delivery street address." : "Enter a pickup street address.", Y = async (e) => {
86
97
  e.preventDefault(), K(null);
87
- let t = ye();
98
+ let t = De();
88
99
  if (t) {
89
100
  K(t);
90
101
  return;
91
102
  }
92
103
  let n = J();
93
104
  if (!n) {
94
- K(L ? "Customers could not be loaded. Retry or create a customer before continuing." : "Select a customer for this order.");
105
+ K(I ? "Customers could not be loaded. Retry or create a customer before continuing." : "Select a customer for this order.");
95
106
  return;
96
107
  }
97
108
  G(!0);
@@ -109,9 +120,10 @@ function D() {
109
120
  deliveryAddress: H.deliveryAddress,
110
121
  items: H.items,
111
122
  scheduledDelivery: H.scheduledDelivery ? new Date(H.scheduledDelivery) : null,
123
+ routeId: H.routeId || void 0,
112
124
  specialInstructions: H.specialInstructions
113
125
  };
114
- z && D ? (await N(D, e), A && A(s(k, `orders/${D}`))) : (await M(e), q());
126
+ z && E ? (await M(E, e), k && k(o(O, `orders/${E}`))) : (await j(e), q());
115
127
  } catch (e) {
116
128
  K(e instanceof Error ? e.message : z ? "Could not update the order. Please try again." : "Could not create the order. Please try again.");
117
129
  } finally {
@@ -130,6 +142,26 @@ function D() {
130
142
  [t]: n
131
143
  }
132
144
  }));
145
+ }, Oe = (e) => {
146
+ if (e === "none") {
147
+ X("routeId", "");
148
+ return;
149
+ }
150
+ let t = R.find((t) => t.id === e);
151
+ if (!t) return;
152
+ let n = t.stops.find((e) => e.type === "pickup")?.address, r = [...t.stops].reverse().find((e) => e.type === "delivery")?.address, i = (e, t) => t ? {
153
+ street: e.street.trim() ? e.street : t.street,
154
+ city: e.city.trim() ? e.city : t.city,
155
+ state: e.state.trim() ? e.state : t.state,
156
+ postalCode: e.postalCode.trim() ? e.postalCode : t.postalCode,
157
+ country: e.country.trim() ? e.country : t.country
158
+ } : e;
159
+ U((e) => ({
160
+ ...e,
161
+ routeId: t.id,
162
+ pickupAddress: i(e.pickupAddress, n),
163
+ deliveryAddress: i(e.deliveryAddress, r)
164
+ }));
133
165
  }, Q = () => {
134
166
  U((e) => ({
135
167
  ...e,
@@ -149,7 +181,7 @@ function D() {
149
181
  sku: ""
150
182
  }]
151
183
  }));
152
- }, be = (e) => {
184
+ }, ke = (e) => {
153
185
  U((t) => ({
154
186
  ...t,
155
187
  items: t.items.filter((t, n) => n !== e)
@@ -163,35 +195,35 @@ function D() {
163
195
  } : r)
164
196
  }));
165
197
  };
166
- return /* @__PURE__ */ w(ue, {
198
+ return /* @__PURE__ */ w(y, {
167
199
  title: z ? "Edit Order" : "Create Order",
168
- subtitle: z ? `Editing ${j?.orderNumber}` : "Create a new delivery order",
200
+ subtitle: z ? `Editing ${A?.orderNumber}` : "Create a new delivery order",
169
201
  icon: /* @__PURE__ */ C(r, { size: 24 }),
170
202
  headerActions: /* @__PURE__ */ w("div", {
171
203
  className: "flex gap-2",
172
- children: [/* @__PURE__ */ w(d, {
204
+ children: [/* @__PURE__ */ w(s, {
173
205
  variant: "outline",
174
206
  onClick: q,
175
207
  children: [/* @__PURE__ */ C(e, { size: 16 }), "Cancel"]
176
- }), /* @__PURE__ */ w(d, {
208
+ }), /* @__PURE__ */ w(s, {
177
209
  onClick: Y,
178
- disabled: W || I,
179
- children: [/* @__PURE__ */ C(a, { size: 16 }), W ? "Saving..." : z ? "Save Changes" : "Create Order"]
210
+ disabled: W || F,
211
+ children: [/* @__PURE__ */ C(ee, { size: 16 }), W ? "Saving..." : z ? "Save Changes" : "Create Order"]
180
212
  })]
181
213
  }),
182
214
  children: [
183
- /* @__PURE__ */ C(he, {
215
+ /* @__PURE__ */ C(ye, {
184
216
  icon: /* @__PURE__ */ C(r, { size: 18 }),
185
217
  children: z ? "Update this delivery before it goes out — change the customer, addresses, items or handling notes, then save." : "Book a new delivery in a few steps: choose who it’s for, set pickup and drop-off addresses, list what’s being shipped, and add any handling notes. Once created it joins the orders pipeline ready to assign and track."
186
218
  }),
187
- /* @__PURE__ */ C(me, {
219
+ /* @__PURE__ */ C(ve, {
188
220
  storageKey: "movethewheels-create-order",
189
221
  steps: [
190
222
  {
191
223
  id: "customer",
192
224
  label: "Pick the customer first",
193
225
  description: "Their saved contact details auto-fill the order.",
194
- icon: /* @__PURE__ */ C(ee, { size: 16 }),
226
+ icon: /* @__PURE__ */ C(ne, { size: 16 }),
195
227
  done: !!H.customerId,
196
228
  onClick: () => document.getElementById("customer")?.focus()
197
229
  },
@@ -217,15 +249,15 @@ function D() {
217
249
  onSubmit: Y,
218
250
  className: "space-y-6",
219
251
  children: [
220
- /* @__PURE__ */ C(de, { message: ve }),
221
- /* @__PURE__ */ w(T, { children: [/* @__PURE__ */ C("h2", {
252
+ /* @__PURE__ */ C(pe, { message: Ee }),
253
+ /* @__PURE__ */ w(_e, { children: [/* @__PURE__ */ C("h2", {
222
254
  className: "text-base font-semibold text-text-primary mb-4",
223
255
  children: "Order Details"
224
256
  }), /* @__PURE__ */ C("div", {
225
257
  className: "space-y-4",
226
258
  children: /* @__PURE__ */ w("div", {
227
259
  className: "grid grid-cols-1 md:grid-cols-2 gap-4",
228
- children: [/* @__PURE__ */ C(fe, {
260
+ children: [/* @__PURE__ */ C(he, {
229
261
  customers: P,
230
262
  value: H.customerId,
231
263
  onValueChange: (e) => {
@@ -234,39 +266,41 @@ function D() {
234
266
  onCreated: (e) => {
235
267
  V(e), X("customerId", e.id), K(null);
236
268
  },
237
- createCustomer: F,
238
- isLoading: I,
239
- error: L,
240
- onRetry: _e,
269
+ createCustomer: Se,
270
+ isLoading: F,
271
+ error: I,
272
+ onRetry: Ce,
241
273
  onOpenCustomers: () => {
242
- A && A(s(k, te(z && D ? `orders/${D}/edit` : "orders/new")));
274
+ k && k(o(O, re(z && E ? `orders/${E}/edit` : "orders/new")));
243
275
  },
244
- selectedCustomer: B
276
+ selectedCustomer: B,
277
+ searchQuery: N,
278
+ onSearchQueryChange: xe
245
279
  }), /* @__PURE__ */ w("div", {
246
280
  className: "space-y-2",
247
- children: [/* @__PURE__ */ C(_, {
281
+ children: [/* @__PURE__ */ C(p, {
248
282
  htmlFor: "priority",
249
283
  children: "Priority"
250
- }), /* @__PURE__ */ w(v, {
284
+ }), /* @__PURE__ */ w(m, {
251
285
  value: H.priority,
252
286
  onValueChange: (e) => X("priority", e),
253
- children: [/* @__PURE__ */ C(ae, {
287
+ children: [/* @__PURE__ */ C(_, {
254
288
  id: "priority",
255
- children: /* @__PURE__ */ C(oe, {})
256
- }), /* @__PURE__ */ w(ie, { children: [
257
- /* @__PURE__ */ C(y, {
289
+ children: /* @__PURE__ */ C(v, {})
290
+ }), /* @__PURE__ */ w(h, { children: [
291
+ /* @__PURE__ */ C(g, {
258
292
  value: "low",
259
293
  children: "Low"
260
294
  }),
261
- /* @__PURE__ */ C(y, {
295
+ /* @__PURE__ */ C(g, {
262
296
  value: "normal",
263
297
  children: "Normal"
264
298
  }),
265
- /* @__PURE__ */ C(y, {
299
+ /* @__PURE__ */ C(g, {
266
300
  value: "high",
267
301
  children: "High"
268
302
  }),
269
- /* @__PURE__ */ C(y, {
303
+ /* @__PURE__ */ C(g, {
270
304
  value: "urgent",
271
305
  children: "Urgent"
272
306
  })
@@ -275,17 +309,45 @@ function D() {
275
309
  })]
276
310
  })
277
311
  })] }),
312
+ /* @__PURE__ */ w(c, { children: [/* @__PURE__ */ C(u, { children: /* @__PURE__ */ w(d, {
313
+ className: "flex items-center gap-2",
314
+ children: [/* @__PURE__ */ C(a, { size: 18 }), "Saved Route (Optional)"]
315
+ }) }), /* @__PURE__ */ w(l, {
316
+ className: "space-y-2",
317
+ children: [/* @__PURE__ */ w(m, {
318
+ value: H.routeId || "none",
319
+ onValueChange: Oe,
320
+ children: [/* @__PURE__ */ C(_, {
321
+ id: "saved-route",
322
+ children: /* @__PURE__ */ C(v, { placeholder: "Choose a saved route" })
323
+ }), /* @__PURE__ */ w(h, { children: [/* @__PURE__ */ C(g, {
324
+ value: "none",
325
+ children: "No saved route"
326
+ }), R.map((e) => /* @__PURE__ */ w(g, {
327
+ value: e.id,
328
+ children: [
329
+ e.name,
330
+ " · ",
331
+ e.stops.length,
332
+ " stops"
333
+ ]
334
+ }, e.id))] })]
335
+ }), /* @__PURE__ */ C("p", {
336
+ className: "text-xs text-text-secondary",
337
+ children: we ? "Loading planned routes…" : Te ? "Saved routes are unavailable; enter pickup and delivery addresses manually." : "A saved route fills any blank address fields. You can always edit both addresses below."
338
+ })]
339
+ })] }),
278
340
  /* @__PURE__ */ w("div", {
279
341
  className: "grid grid-cols-1 md:grid-cols-2 gap-6",
280
- children: [/* @__PURE__ */ w(f, { children: [/* @__PURE__ */ C(m, { children: /* @__PURE__ */ C(h, { children: "Pickup Address" }) }), /* @__PURE__ */ w(p, {
342
+ children: [/* @__PURE__ */ w(c, { children: [/* @__PURE__ */ C(u, { children: /* @__PURE__ */ C(d, { children: "Pickup Address" }) }), /* @__PURE__ */ w(l, {
281
343
  className: "space-y-4",
282
344
  children: [
283
345
  /* @__PURE__ */ w("div", {
284
346
  className: "space-y-2",
285
- children: [/* @__PURE__ */ C(_, {
347
+ children: [/* @__PURE__ */ C(p, {
286
348
  htmlFor: "pickupStreet",
287
349
  children: "Street Address"
288
- }), /* @__PURE__ */ C(g, {
350
+ }), /* @__PURE__ */ C(f, {
289
351
  id: "pickupStreet",
290
352
  value: H.pickupAddress.street,
291
353
  onChange: (e) => Z("pickupAddress", "street", e.target.value),
@@ -296,10 +358,10 @@ function D() {
296
358
  className: "grid grid-cols-1 sm:grid-cols-2 gap-4",
297
359
  children: [/* @__PURE__ */ w("div", {
298
360
  className: "space-y-2",
299
- children: [/* @__PURE__ */ C(_, {
361
+ children: [/* @__PURE__ */ C(p, {
300
362
  htmlFor: "pickupCity",
301
363
  children: "City"
302
- }), /* @__PURE__ */ C(g, {
364
+ }), /* @__PURE__ */ C(f, {
303
365
  id: "pickupCity",
304
366
  value: H.pickupAddress.city,
305
367
  onChange: (e) => Z("pickupAddress", "city", e.target.value),
@@ -307,10 +369,10 @@ function D() {
307
369
  })]
308
370
  }), /* @__PURE__ */ w("div", {
309
371
  className: "space-y-2",
310
- children: [/* @__PURE__ */ C(_, {
372
+ children: [/* @__PURE__ */ C(p, {
311
373
  htmlFor: "pickupState",
312
374
  children: "State"
313
- }), /* @__PURE__ */ C(g, {
375
+ }), /* @__PURE__ */ C(f, {
314
376
  id: "pickupState",
315
377
  value: H.pickupAddress.state,
316
378
  onChange: (e) => Z("pickupAddress", "state", e.target.value),
@@ -322,10 +384,10 @@ function D() {
322
384
  className: "grid grid-cols-1 sm:grid-cols-2 gap-4",
323
385
  children: [/* @__PURE__ */ w("div", {
324
386
  className: "space-y-2",
325
- children: [/* @__PURE__ */ C(_, {
387
+ children: [/* @__PURE__ */ C(p, {
326
388
  htmlFor: "pickupPostal",
327
389
  children: "Postal Code"
328
- }), /* @__PURE__ */ C(g, {
390
+ }), /* @__PURE__ */ C(f, {
329
391
  id: "pickupPostal",
330
392
  value: H.pickupAddress.postalCode,
331
393
  onChange: (e) => Z("pickupAddress", "postalCode", e.target.value),
@@ -333,10 +395,10 @@ function D() {
333
395
  })]
334
396
  }), /* @__PURE__ */ w("div", {
335
397
  className: "space-y-2",
336
- children: [/* @__PURE__ */ C(_, {
398
+ children: [/* @__PURE__ */ C(p, {
337
399
  htmlFor: "pickupCountry",
338
400
  children: "Country"
339
- }), /* @__PURE__ */ C(g, {
401
+ }), /* @__PURE__ */ C(f, {
340
402
  id: "pickupCountry",
341
403
  value: H.pickupAddress.country,
342
404
  onChange: (e) => Z("pickupAddress", "country", e.target.value),
@@ -345,15 +407,15 @@ function D() {
345
407
  })]
346
408
  })
347
409
  ]
348
- })] }), /* @__PURE__ */ w(f, { children: [/* @__PURE__ */ C(m, { children: /* @__PURE__ */ C(h, { children: "Delivery Address" }) }), /* @__PURE__ */ w(p, {
410
+ })] }), /* @__PURE__ */ w(c, { children: [/* @__PURE__ */ C(u, { children: /* @__PURE__ */ C(d, { children: "Delivery Address" }) }), /* @__PURE__ */ w(l, {
349
411
  className: "space-y-4",
350
412
  children: [
351
413
  /* @__PURE__ */ w("div", {
352
414
  className: "space-y-2",
353
- children: [/* @__PURE__ */ C(_, {
415
+ children: [/* @__PURE__ */ C(p, {
354
416
  htmlFor: "deliveryStreet",
355
417
  children: "Street Address"
356
- }), /* @__PURE__ */ C(g, {
418
+ }), /* @__PURE__ */ C(f, {
357
419
  id: "deliveryStreet",
358
420
  value: H.deliveryAddress.street,
359
421
  onChange: (e) => Z("deliveryAddress", "street", e.target.value),
@@ -364,10 +426,10 @@ function D() {
364
426
  className: "grid grid-cols-1 sm:grid-cols-2 gap-4",
365
427
  children: [/* @__PURE__ */ w("div", {
366
428
  className: "space-y-2",
367
- children: [/* @__PURE__ */ C(_, {
429
+ children: [/* @__PURE__ */ C(p, {
368
430
  htmlFor: "deliveryCity",
369
431
  children: "City"
370
- }), /* @__PURE__ */ C(g, {
432
+ }), /* @__PURE__ */ C(f, {
371
433
  id: "deliveryCity",
372
434
  value: H.deliveryAddress.city,
373
435
  onChange: (e) => Z("deliveryAddress", "city", e.target.value),
@@ -375,10 +437,10 @@ function D() {
375
437
  })]
376
438
  }), /* @__PURE__ */ w("div", {
377
439
  className: "space-y-2",
378
- children: [/* @__PURE__ */ C(_, {
440
+ children: [/* @__PURE__ */ C(p, {
379
441
  htmlFor: "deliveryState",
380
442
  children: "State"
381
- }), /* @__PURE__ */ C(g, {
443
+ }), /* @__PURE__ */ C(f, {
382
444
  id: "deliveryState",
383
445
  value: H.deliveryAddress.state,
384
446
  onChange: (e) => Z("deliveryAddress", "state", e.target.value),
@@ -390,10 +452,10 @@ function D() {
390
452
  className: "grid grid-cols-1 sm:grid-cols-2 gap-4",
391
453
  children: [/* @__PURE__ */ w("div", {
392
454
  className: "space-y-2",
393
- children: [/* @__PURE__ */ C(_, {
455
+ children: [/* @__PURE__ */ C(p, {
394
456
  htmlFor: "deliveryPostal",
395
457
  children: "Postal Code"
396
- }), /* @__PURE__ */ C(g, {
458
+ }), /* @__PURE__ */ C(f, {
397
459
  id: "deliveryPostal",
398
460
  value: H.deliveryAddress.postalCode,
399
461
  onChange: (e) => Z("deliveryAddress", "postalCode", e.target.value),
@@ -401,10 +463,10 @@ function D() {
401
463
  })]
402
464
  }), /* @__PURE__ */ w("div", {
403
465
  className: "space-y-2",
404
- children: [/* @__PURE__ */ C(_, {
466
+ children: [/* @__PURE__ */ C(p, {
405
467
  htmlFor: "deliveryCountry",
406
468
  children: "Country"
407
- }), /* @__PURE__ */ C(g, {
469
+ }), /* @__PURE__ */ C(f, {
408
470
  id: "deliveryCountry",
409
471
  value: H.deliveryAddress.country,
410
472
  onChange: (e) => Z("deliveryAddress", "country", e.target.value),
@@ -415,20 +477,20 @@ function D() {
415
477
  ]
416
478
  })] })]
417
479
  }),
418
- /* @__PURE__ */ w(f, { children: [/* @__PURE__ */ w(m, {
480
+ /* @__PURE__ */ w(c, { children: [/* @__PURE__ */ w(u, {
419
481
  className: "flex flex-row items-center justify-between",
420
- children: [/* @__PURE__ */ C(h, { children: "Order Items" }), /* @__PURE__ */ w(d, {
482
+ children: [/* @__PURE__ */ C(d, { children: "Order Items" }), /* @__PURE__ */ w(s, {
421
483
  type: "button",
422
484
  variant: "outline",
423
485
  size: "sm",
424
486
  onClick: Q,
425
487
  children: [/* @__PURE__ */ C(i, { size: 16 }), "Add Item"]
426
488
  })]
427
- }), /* @__PURE__ */ C(p, { children: H.items.length === 0 ? /* @__PURE__ */ C(le, {
489
+ }), /* @__PURE__ */ C(l, { children: H.items.length === 0 ? /* @__PURE__ */ C(fe, {
428
490
  illustration: "empty-files",
429
491
  title: "No items added yet",
430
492
  description: "Add the products this order will ship — each with a name, SKU, quantity and value.",
431
- action: /* @__PURE__ */ w(d, {
493
+ action: /* @__PURE__ */ w(s, {
432
494
  type: "button",
433
495
  variant: "outline",
434
496
  onClick: Q,
@@ -439,12 +501,12 @@ function D() {
439
501
  })
440
502
  }) : /* @__PURE__ */ C("div", {
441
503
  className: "space-y-4",
442
- children: H.items.map((e, t) => /* @__PURE__ */ w("div", { children: [t > 0 && /* @__PURE__ */ C(se, { className: "my-4" }), /* @__PURE__ */ w("div", {
504
+ children: H.items.map((e, t) => /* @__PURE__ */ w("div", { children: [t > 0 && /* @__PURE__ */ C(ue, { className: "my-4" }), /* @__PURE__ */ w("div", {
443
505
  className: "grid grid-cols-1 md:grid-cols-7 gap-4",
444
506
  children: [
445
507
  /* @__PURE__ */ w("div", {
446
508
  className: "md:col-span-2 space-y-2",
447
- children: [/* @__PURE__ */ C(_, { children: "Item Name" }), /* @__PURE__ */ C(g, {
509
+ children: [/* @__PURE__ */ C(p, { children: "Item Name" }), /* @__PURE__ */ C(f, {
448
510
  value: e.name,
449
511
  onChange: (e) => $(t, "name", e.target.value),
450
512
  placeholder: "Product name"
@@ -452,7 +514,7 @@ function D() {
452
514
  }),
453
515
  /* @__PURE__ */ w("div", {
454
516
  className: "space-y-2",
455
- children: [/* @__PURE__ */ C(_, { children: "SKU" }), /* @__PURE__ */ C(g, {
517
+ children: [/* @__PURE__ */ C(p, { children: "SKU" }), /* @__PURE__ */ C(f, {
456
518
  value: e.sku,
457
519
  onChange: (e) => $(t, "sku", e.target.value),
458
520
  placeholder: "SKU-001"
@@ -460,7 +522,7 @@ function D() {
460
522
  }),
461
523
  /* @__PURE__ */ w("div", {
462
524
  className: "space-y-2",
463
- children: [/* @__PURE__ */ C(_, { children: "Quantity" }), /* @__PURE__ */ C(g, {
525
+ children: [/* @__PURE__ */ C(p, { children: "Quantity" }), /* @__PURE__ */ C(f, {
464
526
  type: "number",
465
527
  min: "1",
466
528
  value: e.quantity,
@@ -469,7 +531,7 @@ function D() {
469
531
  }),
470
532
  /* @__PURE__ */ w("div", {
471
533
  className: "space-y-2",
472
- children: [/* @__PURE__ */ C(_, { children: "Weight (kg)" }), /* @__PURE__ */ C(g, {
534
+ children: [/* @__PURE__ */ C(p, { children: "Weight (kg)" }), /* @__PURE__ */ C(f, {
473
535
  type: "number",
474
536
  min: "0",
475
537
  step: "0.1",
@@ -479,7 +541,7 @@ function D() {
479
541
  }),
480
542
  /* @__PURE__ */ w("div", {
481
543
  className: "space-y-2",
482
- children: [/* @__PURE__ */ C(_, { children: "Value ($)" }), /* @__PURE__ */ C(g, {
544
+ children: [/* @__PURE__ */ C(p, { children: "Value ($)" }), /* @__PURE__ */ C(f, {
483
545
  type: "number",
484
546
  min: "0",
485
547
  step: "0.01",
@@ -489,24 +551,24 @@ function D() {
489
551
  }),
490
552
  /* @__PURE__ */ C("div", {
491
553
  className: "flex items-end",
492
- children: /* @__PURE__ */ C(d, {
554
+ children: /* @__PURE__ */ C(s, {
493
555
  type: "button",
494
556
  variant: "ghost",
495
557
  size: "icon",
496
558
  className: "text-status-error-text",
497
- onClick: () => be(t),
498
- children: /* @__PURE__ */ C(o, { size: 16 })
559
+ onClick: () => ke(t),
560
+ children: /* @__PURE__ */ C(te, { size: 16 })
499
561
  })
500
562
  })
501
563
  ]
502
564
  })] }, e.id))
503
565
  }) })] }),
504
- /* @__PURE__ */ w(f, { children: [/* @__PURE__ */ C(m, { children: /* @__PURE__ */ C(h, { children: "Scheduling & Handling" }) }), /* @__PURE__ */ C(p, { children: /* @__PURE__ */ w("div", {
566
+ /* @__PURE__ */ w(c, { children: [/* @__PURE__ */ C(u, { children: /* @__PURE__ */ C(d, { children: "Scheduling & Handling" }) }), /* @__PURE__ */ C(l, { children: /* @__PURE__ */ w("div", {
505
567
  className: "grid grid-cols-1 md:grid-cols-3 gap-6",
506
568
  children: [/* @__PURE__ */ w("div", {
507
569
  className: "space-y-2",
508
570
  children: [
509
- /* @__PURE__ */ w(_, {
571
+ /* @__PURE__ */ w(p, {
510
572
  htmlFor: "scheduledDelivery",
511
573
  className: "flex items-center gap-1.5",
512
574
  children: [/* @__PURE__ */ C(t, {
@@ -514,7 +576,7 @@ function D() {
514
576
  className: "text-text-secondary"
515
577
  }), "Scheduled Delivery"]
516
578
  }),
517
- /* @__PURE__ */ C(g, {
579
+ /* @__PURE__ */ C(f, {
518
580
  id: "scheduledDelivery",
519
581
  type: "datetime-local",
520
582
  value: H.scheduledDelivery,
@@ -527,10 +589,10 @@ function D() {
527
589
  ]
528
590
  }), /* @__PURE__ */ w("div", {
529
591
  className: "md:col-span-2 space-y-2",
530
- children: [/* @__PURE__ */ C(_, {
592
+ children: [/* @__PURE__ */ C(p, {
531
593
  htmlFor: "specialInstructions",
532
594
  children: "Special Instructions"
533
- }), /* @__PURE__ */ C(ce, {
595
+ }), /* @__PURE__ */ C(de, {
534
596
  id: "specialInstructions",
535
597
  value: H.specialInstructions,
536
598
  onChange: (e) => X("specialInstructions", e.target.value),
@@ -545,4 +607,4 @@ function D() {
545
607
  });
546
608
  }
547
609
  //#endregion
548
- export { D as default };
610
+ export { E as default };