@burdenoff/microfe-movethewheels 2026.1031.3 → 2026.1031.5
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/MoveTheWheelsRoot.js +136 -127
- package/dist/MoveTheWheelsRoutes.js +143 -135
- package/dist/components/DocumentsCard.js +11 -11
- package/dist/components/ProofOfDeliveryCard.js +13 -13
- package/dist/components/ShipmentRiskDialog.js +24 -24
- package/dist/components/ShippingQuoteResults.js +46 -46
- package/dist/components/TrackingAlertList.js +17 -17
- package/dist/generated/tracking-quality-operations.d.ts +56 -0
- package/dist/hooks/useOrderDispatch.js +17 -17
- package/dist/movethewheels/pages/SettingsPage.d.ts +1 -0
- package/dist/movethewheels/providers/ModuleSettingsProvider.d.ts +17 -0
- package/dist/movethewheels/utils/formatters.d.ts +23 -3
- package/dist/movethewheels/utils/moduleSettings.d.ts +52 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/bell.js +11 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/key-round.js +14 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/plug.js +22 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/rotate-ccw.js +11 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/settings.js +13 -0
- package/dist/pages/AnalyticsPage.js +27 -27
- package/dist/pages/CreateOrderPage.js +340 -317
- package/dist/pages/CustomerDetailsPage.js +246 -246
- package/dist/pages/CustomersPage.js +19 -19
- package/dist/pages/DashboardPage.js +24 -24
- package/dist/pages/DeliveryCapturePage.js +74 -74
- package/dist/pages/DriverDetailsPage.js +337 -337
- package/dist/pages/DriversPage.js +26 -26
- package/dist/pages/FinancePage.js +26 -26
- package/dist/pages/InventoryPage.js +28 -28
- package/dist/pages/LiveTrackingPage.js +108 -108
- package/dist/pages/MarketplacePage.js +44 -44
- package/dist/pages/OrderDetailsPage.js +306 -306
- package/dist/pages/OrdersListPage.js +27 -27
- package/dist/pages/ProductDetailsPage.js +89 -89
- package/dist/pages/ProductsPage.js +73 -73
- package/dist/pages/RouteDetailsPage.js +282 -285
- package/dist/pages/RoutesPage.js +78 -78
- package/dist/pages/SettingsPage.js +459 -0
- package/dist/pages/TrackingPage.js +41 -41
- package/dist/pages/VehicleDetailsPage.js +207 -207
- package/dist/pages/VehiclesPage.js +17 -16
- package/dist/pages/WarehouseDetailsPage.js +132 -132
- package/dist/providers/ModuleSettingsProvider.js +74 -0
- package/dist/utils/formatters.js +53 -26
- package/dist/utils/moduleSettings.js +132 -0
- package/package.json +3 -2
- package/src/generated/tracking-quality-operations.ts +62 -0
- package/src/movethewheels/MoveTheWheelsRoot.tsx +18 -5
- package/src/movethewheels/MoveTheWheelsRoutes.tsx +19 -4
- package/src/movethewheels/pages/CreateOrderPage.tsx +38 -6
- package/src/movethewheels/pages/ProductsPage.tsx +2 -2
- package/src/movethewheels/pages/RouteDetailsPage.tsx +3 -6
- package/src/movethewheels/pages/RoutesPage.tsx +2 -2
- package/src/movethewheels/pages/SettingsPage.tsx +516 -0
- package/src/movethewheels/pages/VehicleDetailsPage.tsx +4 -2
- package/src/movethewheels/pages/VehiclesPage.tsx +2 -1
- package/src/movethewheels/providers/ModuleSettingsProvider.tsx +133 -0
- package/src/movethewheels/utils/formatters.ts +69 -10
- package/src/movethewheels/utils/moduleSettings.ts +224 -0
- package/dist/movethewheels/pages/AIAssistantPage.d.ts +0 -22
- package/dist/node_modules/lucide-react/dist/esm/icons/message-circle.js +0 -8
- package/dist/node_modules/lucide-react/dist/esm/icons/wallet.js +0 -11
- package/dist/pages/AIAssistantPage.js +0 -81
- package/src/movethewheels/pages/AIAssistantPage.tsx +0 -123
|
@@ -8,169 +8,178 @@ import { Save as ee } from "../node_modules/lucide-react/dist/esm/icons/save.js"
|
|
|
8
8
|
import { Users as te } from "../node_modules/lucide-react/dist/esm/icons/users.js";
|
|
9
9
|
import { buildCustomerCreatePath as ne, joinPath as o } from "../utils/navigation.js";
|
|
10
10
|
import { useMoveTheWheels as re } from "../providers/MoveTheWheelsProvider.js";
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
11
|
+
import { deliveryWindowValue as ie, orderFormPriority as ae } from "../utils/moduleSettings.js";
|
|
12
|
+
import { useModuleSettings as oe } from "../providers/ModuleSettingsProvider.js";
|
|
13
|
+
import { useRoute as se, useRoutes as ce } from "../hooks/useRoutes.js";
|
|
14
|
+
import { useOrder as le, useOrders as ue } from "../hooks/useOrders.js";
|
|
15
|
+
import { useProducts as de } from "../hooks/useInventory.js";
|
|
16
|
+
import { useCustomer as fe, useCustomers as pe } from "../hooks/useCustomers.js";
|
|
17
|
+
import { Badge as s, Button as c, Card as l, CardContent as u, CardDescription as d, CardHeader as f, CardTitle as p, Input as m, Label as h, Select as me, SelectContent as he, SelectItem as g, SelectTrigger as ge, SelectValue as _e, Separator as ve, Textarea as ye } from "../components/ui.js";
|
|
18
|
+
import { EmptyState as be, PageLayout as xe } from "../components/PageLayout.js";
|
|
19
|
+
import { FormError as Se } from "../components/FormError.js";
|
|
20
|
+
import { EntityCombobox as Ce } from "../components/EntityCombobox.js";
|
|
21
|
+
import { CustomerPicker as we } from "../components/CustomerPicker.js";
|
|
22
|
+
import { OrderItemRow as Te } from "../components/OrderItemRow.js";
|
|
23
|
+
import { validateOrderItems as Ee } from "../utils/orderValidation.js";
|
|
24
|
+
import { calculateOrderPricing as De } from "../utils/orderPricing.js";
|
|
25
|
+
import { useEffect as _, useRef as Oe, useState as v } from "react";
|
|
26
|
+
import { useParams as ke, useSearchParams as Ae } from "react-router";
|
|
27
|
+
import { Fragment as je, jsx as y, jsxs as b } from "react/jsx-runtime";
|
|
28
|
+
import { EmphasisPanel as Me, PagePurpose as Ne, Stepper as Pe } from "@burdenoff/fe-libs/ui";
|
|
29
|
+
import { FormSection as x } from "@burdenoff/fe-libs/form";
|
|
28
30
|
//#region src/movethewheels/pages/CreateOrderPage.tsx
|
|
29
|
-
function
|
|
31
|
+
function S(e) {
|
|
30
32
|
if (!e || Number.isNaN(e.getTime())) return "";
|
|
31
33
|
let t = (e) => String(e).padStart(2, "0");
|
|
32
34
|
return `${e.getFullYear()}-${t(e.getMonth() + 1)}-${t(e.getDate())}T${t(e.getHours())}:${t(e.getMinutes())}`;
|
|
33
35
|
}
|
|
34
|
-
function
|
|
35
|
-
let { orderId:
|
|
36
|
+
function C() {
|
|
37
|
+
let { orderId: C } = ke(), [Fe] = Ae(), w = Fe.get("customerId")?.trim() || void 0, { basePath: T, navigate: E } = re(), { order: D } = le(C), { createOrder: Ie, updateOrder: Le } = ue(), [Re, ze] = v(""), { customers: O, createCustomer: Be, isLoading: k, isLoadingMore: Ve, error: A, refetch: He, loadMore: Ue, hasMore: We, totalCustomers: Ge } = pe({
|
|
36
38
|
limit: 20,
|
|
37
|
-
filters: { search:
|
|
38
|
-
}), { customer:
|
|
39
|
+
filters: { search: Re || void 0 }
|
|
40
|
+
}), { customer: j } = fe(w ?? D?.customerId), [Ke, qe] = v(""), { routes: M, isLoading: N, error: P, hasMore: Je, totalRoutes: Ye, loadMore: Xe, isLoadingMore: Ze } = ce({
|
|
39
41
|
status: "planned",
|
|
40
|
-
search:
|
|
42
|
+
search: Ke || void 0,
|
|
41
43
|
limit: 20
|
|
42
|
-
}), [
|
|
43
|
-
search:
|
|
44
|
+
}), [F, Qe] = v(""), { products: $e, isLoading: et, isLoadingMore: tt, hasMore: nt, totalProducts: rt, loadMore: it } = de({
|
|
45
|
+
search: F || void 0,
|
|
44
46
|
limit: 20
|
|
45
|
-
}),
|
|
46
|
-
customerId:
|
|
47
|
-
priority:
|
|
48
|
-
routeId:
|
|
47
|
+
}), I = !!C && !!D, { settings: L } = oe(), R = ae(L.defaultOrderPriority), z = L.defaultDeliveryWindowHours, B = Oe(!1), [V, H] = v(null), [U, W] = v({
|
|
48
|
+
customerId: w || D?.customerId || "",
|
|
49
|
+
priority: D?.priority || R,
|
|
50
|
+
routeId: D?.routeId || "",
|
|
49
51
|
pickupAddress: {
|
|
50
|
-
street:
|
|
51
|
-
city:
|
|
52
|
-
state:
|
|
53
|
-
postalCode:
|
|
54
|
-
country:
|
|
52
|
+
street: D?.pickupAddress.street || "",
|
|
53
|
+
city: D?.pickupAddress.city || "",
|
|
54
|
+
state: D?.pickupAddress.state || "",
|
|
55
|
+
postalCode: D?.pickupAddress.postalCode || "",
|
|
56
|
+
country: D?.pickupAddress.country || "USA"
|
|
55
57
|
},
|
|
56
58
|
deliveryAddress: {
|
|
57
|
-
street:
|
|
58
|
-
city:
|
|
59
|
-
state:
|
|
60
|
-
postalCode:
|
|
61
|
-
country:
|
|
59
|
+
street: D?.deliveryAddress.street || "",
|
|
60
|
+
city: D?.deliveryAddress.city || "",
|
|
61
|
+
state: D?.deliveryAddress.state || "",
|
|
62
|
+
postalCode: D?.deliveryAddress.postalCode || "",
|
|
63
|
+
country: D?.deliveryAddress.country || "USA"
|
|
62
64
|
},
|
|
63
|
-
items:
|
|
64
|
-
trackingNumber:
|
|
65
|
-
scheduledDelivery:
|
|
66
|
-
specialInstructions:
|
|
67
|
-
}), { route:
|
|
68
|
-
|
|
69
|
-
|
|
65
|
+
items: D?.items || [],
|
|
66
|
+
trackingNumber: D?.trackingNumber || "",
|
|
67
|
+
scheduledDelivery: S(D?.scheduledDelivery),
|
|
68
|
+
specialInstructions: D?.specialInstructions || ""
|
|
69
|
+
}), { route: at, isLoading: ot } = se(U.routeId || void 0), [G, K] = v(!1), [st, q] = v(null), [J, Y] = v({});
|
|
70
|
+
_(() => {
|
|
71
|
+
j && (H((e) => e?.id === j.id ? e : j), W((e) => e.customerId ? e : {
|
|
70
72
|
...e,
|
|
71
|
-
customerId:
|
|
73
|
+
customerId: j.id
|
|
72
74
|
}));
|
|
73
|
-
}, [
|
|
74
|
-
|
|
75
|
-
customerId:
|
|
76
|
-
priority:
|
|
77
|
-
routeId:
|
|
75
|
+
}, [j]), _(() => {
|
|
76
|
+
D && W({
|
|
77
|
+
customerId: D.customerId || "",
|
|
78
|
+
priority: D.priority || "normal",
|
|
79
|
+
routeId: D.routeId || "",
|
|
78
80
|
pickupAddress: {
|
|
79
|
-
street:
|
|
80
|
-
city:
|
|
81
|
-
state:
|
|
82
|
-
postalCode:
|
|
83
|
-
country:
|
|
81
|
+
street: D.pickupAddress.street || "",
|
|
82
|
+
city: D.pickupAddress.city || "",
|
|
83
|
+
state: D.pickupAddress.state || "",
|
|
84
|
+
postalCode: D.pickupAddress.postalCode || "",
|
|
85
|
+
country: D.pickupAddress.country || "USA"
|
|
84
86
|
},
|
|
85
87
|
deliveryAddress: {
|
|
86
|
-
street:
|
|
87
|
-
city:
|
|
88
|
-
state:
|
|
89
|
-
postalCode:
|
|
90
|
-
country:
|
|
88
|
+
street: D.deliveryAddress.street || "",
|
|
89
|
+
city: D.deliveryAddress.city || "",
|
|
90
|
+
state: D.deliveryAddress.state || "",
|
|
91
|
+
postalCode: D.deliveryAddress.postalCode || "",
|
|
92
|
+
country: D.deliveryAddress.country || "USA"
|
|
91
93
|
},
|
|
92
|
-
items:
|
|
93
|
-
trackingNumber:
|
|
94
|
-
scheduledDelivery:
|
|
95
|
-
specialInstructions:
|
|
94
|
+
items: D.items || [],
|
|
95
|
+
trackingNumber: D.trackingNumber || "",
|
|
96
|
+
scheduledDelivery: S(D.scheduledDelivery),
|
|
97
|
+
specialInstructions: D.specialInstructions || ""
|
|
96
98
|
});
|
|
97
|
-
}, [
|
|
98
|
-
let
|
|
99
|
-
if (
|
|
100
|
-
if (!
|
|
101
|
-
|
|
99
|
+
}, [D]);
|
|
100
|
+
let X = () => {
|
|
101
|
+
if (E) {
|
|
102
|
+
if (!I && w) {
|
|
103
|
+
E(o(T, `customers/${w}`));
|
|
102
104
|
return;
|
|
103
105
|
}
|
|
104
|
-
|
|
106
|
+
E(o(T, "orders"));
|
|
105
107
|
}
|
|
106
|
-
},
|
|
107
|
-
if (!
|
|
108
|
-
if (!
|
|
109
|
-
if (!
|
|
110
|
-
if (
|
|
111
|
-
let e =
|
|
112
|
-
return
|
|
113
|
-
},
|
|
114
|
-
e.preventDefault(),
|
|
115
|
-
let t =
|
|
108
|
+
}, ct = () => V ?? O.find((e) => e.id === U.customerId), lt = () => {
|
|
109
|
+
if (!U.customerId || !ct()) return A ? "Customers could not be loaded. Retry or create a customer before continuing." : "Select a customer for this order.";
|
|
110
|
+
if (!U.pickupAddress.street.trim()) return "Enter a pickup street address.";
|
|
111
|
+
if (!U.deliveryAddress.street.trim()) return "Enter a delivery street address.";
|
|
112
|
+
if (U.items.length === 0) return "Add at least one item to the order.";
|
|
113
|
+
let e = Ee(U.items);
|
|
114
|
+
return Y(e), Object.keys(e).length > 0 ? "Fix the highlighted shipment item fields before continuing." : U.scheduledDelivery && Number.isNaN(Date.parse(U.scheduledDelivery)) ? "Enter a valid scheduled delivery date and time." : null;
|
|
115
|
+
}, ut = async (e) => {
|
|
116
|
+
e.preventDefault(), q(null);
|
|
117
|
+
let t = lt();
|
|
116
118
|
if (t) {
|
|
117
|
-
|
|
119
|
+
q(t);
|
|
118
120
|
return;
|
|
119
121
|
}
|
|
120
|
-
let n =
|
|
122
|
+
let n = ct();
|
|
121
123
|
if (!n) {
|
|
122
|
-
|
|
124
|
+
q(A ? "Customers could not be loaded. Retry or create a customer before continuing." : "Select a customer for this order.");
|
|
123
125
|
return;
|
|
124
126
|
}
|
|
125
|
-
|
|
127
|
+
K(!0);
|
|
126
128
|
try {
|
|
127
129
|
let e = {
|
|
128
|
-
customerId:
|
|
130
|
+
customerId: U.customerId,
|
|
129
131
|
customerInfo: {
|
|
130
132
|
name: n.name,
|
|
131
133
|
email: n.email,
|
|
132
134
|
phone: n.phone,
|
|
133
135
|
company: n.company
|
|
134
136
|
},
|
|
135
|
-
priority:
|
|
136
|
-
pickupAddress:
|
|
137
|
-
deliveryAddress:
|
|
138
|
-
items:
|
|
139
|
-
pricing:
|
|
140
|
-
trackingNumber:
|
|
141
|
-
scheduledDelivery:
|
|
142
|
-
routeId:
|
|
143
|
-
specialInstructions:
|
|
137
|
+
priority: U.priority,
|
|
138
|
+
pickupAddress: U.pickupAddress,
|
|
139
|
+
deliveryAddress: U.deliveryAddress,
|
|
140
|
+
items: U.items,
|
|
141
|
+
pricing: De(U.items, I ? D?.pricing : void 0),
|
|
142
|
+
trackingNumber: U.trackingNumber.trim() || void 0,
|
|
143
|
+
scheduledDelivery: U.scheduledDelivery ? new Date(U.scheduledDelivery) : null,
|
|
144
|
+
routeId: U.routeId || void 0,
|
|
145
|
+
specialInstructions: U.specialInstructions
|
|
144
146
|
};
|
|
145
|
-
if (
|
|
147
|
+
if (I && C) await Le(C, e), E && E(o(T, `orders/${C}`));
|
|
146
148
|
else {
|
|
147
|
-
let t = await
|
|
148
|
-
|
|
149
|
+
let t = await Ie(e);
|
|
150
|
+
E ? E(o(T, `orders/${t.id}`)) : X();
|
|
149
151
|
}
|
|
150
152
|
} catch (e) {
|
|
151
|
-
|
|
153
|
+
q(e instanceof Error ? e.message : I ? "Could not update the order. Please try again." : "Could not create the order. Please try again.");
|
|
152
154
|
} finally {
|
|
153
|
-
|
|
155
|
+
K(!1);
|
|
154
156
|
}
|
|
155
157
|
}, Z = (e, t) => {
|
|
156
|
-
|
|
158
|
+
e === "priority" && (B.current = !0), W((n) => ({
|
|
157
159
|
...n,
|
|
158
160
|
[e]: t
|
|
159
161
|
}));
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
+
};
|
|
163
|
+
_(() => {
|
|
164
|
+
C || B.current || W((e) => e.priority === R ? e : {
|
|
165
|
+
...e,
|
|
166
|
+
priority: R
|
|
167
|
+
});
|
|
168
|
+
}, [C, R]);
|
|
169
|
+
let Q = (e, t, n) => {
|
|
170
|
+
W((r) => ({
|
|
162
171
|
...r,
|
|
163
172
|
[e]: {
|
|
164
173
|
...r[e],
|
|
165
174
|
[t]: n
|
|
166
175
|
}
|
|
167
176
|
}));
|
|
168
|
-
},
|
|
177
|
+
}, dt = (e) => {
|
|
169
178
|
if (!e) {
|
|
170
179
|
Z("routeId", "");
|
|
171
180
|
return;
|
|
172
181
|
}
|
|
173
|
-
let t =
|
|
182
|
+
let t = M.find((t) => t.id === e);
|
|
174
183
|
if (!t) return;
|
|
175
184
|
let n = t.stops.find((e) => e.type === "pickup")?.address, r = [...t.stops].reverse().find((e) => e.type === "delivery")?.address, i = (e, t) => t ? {
|
|
176
185
|
street: e.street.trim() ? e.street : t.street,
|
|
@@ -179,14 +188,14 @@ function T() {
|
|
|
179
188
|
postalCode: e.postalCode.trim() ? e.postalCode : t.postalCode,
|
|
180
189
|
country: e.country.trim() ? e.country : t.country
|
|
181
190
|
} : e;
|
|
182
|
-
|
|
191
|
+
W((e) => ({
|
|
183
192
|
...e,
|
|
184
193
|
routeId: t.id,
|
|
185
194
|
pickupAddress: i(e.pickupAddress, n),
|
|
186
195
|
deliveryAddress: i(e.deliveryAddress, r)
|
|
187
196
|
}));
|
|
188
197
|
}, $ = () => {
|
|
189
|
-
|
|
198
|
+
W((e) => ({
|
|
190
199
|
...e,
|
|
191
200
|
items: [...e.items, {
|
|
192
201
|
id: `item-${Date.now()}`,
|
|
@@ -204,56 +213,56 @@ function T() {
|
|
|
204
213
|
sku: ""
|
|
205
214
|
}]
|
|
206
215
|
}));
|
|
207
|
-
},
|
|
208
|
-
let t =
|
|
209
|
-
t &&
|
|
216
|
+
}, ft = (e) => {
|
|
217
|
+
let t = U.items[e]?.id;
|
|
218
|
+
t && Y((e) => {
|
|
210
219
|
let n = { ...e };
|
|
211
220
|
return delete n[t], n;
|
|
212
|
-
}),
|
|
221
|
+
}), W((t) => ({
|
|
213
222
|
...t,
|
|
214
223
|
items: t.items.filter((t, n) => n !== e)
|
|
215
224
|
}));
|
|
216
|
-
},
|
|
217
|
-
let r =
|
|
218
|
-
r &&
|
|
225
|
+
}, pt = (e, t, n) => {
|
|
226
|
+
let r = U.items[e]?.id;
|
|
227
|
+
r && J[r] && Y((e) => {
|
|
219
228
|
let t = { ...e };
|
|
220
229
|
return delete t[r], t;
|
|
221
|
-
}),
|
|
230
|
+
}), W((r) => ({
|
|
222
231
|
...r,
|
|
223
232
|
items: r.items.map((r, i) => i === e ? {
|
|
224
233
|
...r,
|
|
225
234
|
[t]: n
|
|
226
235
|
} : r)
|
|
227
236
|
}));
|
|
228
|
-
},
|
|
229
|
-
|
|
230
|
-
},
|
|
231
|
-
return /* @__PURE__ */
|
|
232
|
-
title:
|
|
233
|
-
subtitle:
|
|
234
|
-
icon: /* @__PURE__ */
|
|
237
|
+
}, mt = () => {
|
|
238
|
+
E && E(o(T, ne(I && C ? `orders/${C}/edit` : "orders/new")));
|
|
239
|
+
}, ht = U.customerId ? !U.pickupAddress.street || !U.deliveryAddress.street ? 1 : U.items.length === 0 ? 2 : 3 : 0;
|
|
240
|
+
return /* @__PURE__ */ b(xe, {
|
|
241
|
+
title: I ? "Edit Order" : "Create Order",
|
|
242
|
+
subtitle: I ? `Editing ${D?.orderNumber}` : "Create a new delivery order",
|
|
243
|
+
icon: /* @__PURE__ */ y(i, { size: 24 }),
|
|
235
244
|
maxWidth: "2xl",
|
|
236
|
-
headerActions: /* @__PURE__ */
|
|
245
|
+
headerActions: /* @__PURE__ */ b("div", {
|
|
237
246
|
className: "flex w-full flex-col-reverse gap-2 sm:w-auto sm:flex-row",
|
|
238
|
-
children: [/* @__PURE__ */
|
|
247
|
+
children: [/* @__PURE__ */ b(c, {
|
|
239
248
|
type: "button",
|
|
240
249
|
variant: "outline",
|
|
241
|
-
onClick:
|
|
242
|
-
disabled:
|
|
243
|
-
children: [/* @__PURE__ */
|
|
244
|
-
}), /* @__PURE__ */
|
|
250
|
+
onClick: X,
|
|
251
|
+
disabled: G,
|
|
252
|
+
children: [/* @__PURE__ */ y(e, { size: 16 }), "Cancel"]
|
|
253
|
+
}), /* @__PURE__ */ b(c, {
|
|
245
254
|
type: "submit",
|
|
246
255
|
form: "order-form",
|
|
247
|
-
disabled:
|
|
248
|
-
children: [/* @__PURE__ */
|
|
256
|
+
disabled: G || k,
|
|
257
|
+
children: [/* @__PURE__ */ y(ee, { size: 16 }), G ? "Saving..." : I ? "Save Changes" : "Create Order"]
|
|
249
258
|
})]
|
|
250
259
|
}),
|
|
251
260
|
children: [
|
|
252
|
-
/* @__PURE__ */
|
|
253
|
-
icon: /* @__PURE__ */
|
|
254
|
-
children:
|
|
261
|
+
/* @__PURE__ */ y(Ne, {
|
|
262
|
+
icon: /* @__PURE__ */ y(i, { size: 18 }),
|
|
263
|
+
children: I ? "Update the customer, delivery plan, shipment contents, or handling details before saving." : "Set the customer and delivery plan, add what is being shipped, then choose any timing or handling preferences."
|
|
255
264
|
}),
|
|
256
|
-
/* @__PURE__ */
|
|
265
|
+
/* @__PURE__ */ y(Pe, {
|
|
257
266
|
steps: [
|
|
258
267
|
{
|
|
259
268
|
key: "customer",
|
|
@@ -276,7 +285,7 @@ function T() {
|
|
|
276
285
|
description: "Add optional delivery instructions."
|
|
277
286
|
}
|
|
278
287
|
],
|
|
279
|
-
active:
|
|
288
|
+
active: ht,
|
|
280
289
|
onStepClick: (e) => {
|
|
281
290
|
let t = document.getElementById([
|
|
282
291
|
"customer",
|
|
@@ -295,255 +304,255 @@ function T() {
|
|
|
295
304
|
},
|
|
296
305
|
allowSkipAhead: !0
|
|
297
306
|
}),
|
|
298
|
-
/* @__PURE__ */
|
|
307
|
+
/* @__PURE__ */ b("form", {
|
|
299
308
|
id: "order-form",
|
|
300
|
-
onSubmit:
|
|
309
|
+
onSubmit: ut,
|
|
301
310
|
className: "space-y-6",
|
|
302
311
|
children: [
|
|
303
|
-
/* @__PURE__ */
|
|
304
|
-
/* @__PURE__ */
|
|
312
|
+
/* @__PURE__ */ y(Se, { message: st }),
|
|
313
|
+
/* @__PURE__ */ y("section", {
|
|
305
314
|
"aria-labelledby": "order-details-title",
|
|
306
|
-
children: /* @__PURE__ */
|
|
315
|
+
children: /* @__PURE__ */ b(Me, {
|
|
307
316
|
className: "space-y-5",
|
|
308
|
-
children: [/* @__PURE__ */
|
|
317
|
+
children: [/* @__PURE__ */ b("div", {
|
|
309
318
|
className: "flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between",
|
|
310
|
-
children: [/* @__PURE__ */
|
|
319
|
+
children: [/* @__PURE__ */ b("div", {
|
|
311
320
|
className: "flex items-start gap-3",
|
|
312
|
-
children: [/* @__PURE__ */
|
|
321
|
+
children: [/* @__PURE__ */ y("div", {
|
|
313
322
|
className: "rounded-xl bg-action-primary-bg/10 p-2 text-action-primary-bg",
|
|
314
|
-
children: /* @__PURE__ */
|
|
323
|
+
children: /* @__PURE__ */ y(te, {
|
|
315
324
|
size: 18,
|
|
316
325
|
"aria-hidden": "true"
|
|
317
326
|
})
|
|
318
|
-
}), /* @__PURE__ */
|
|
327
|
+
}), /* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("h2", {
|
|
319
328
|
id: "order-details-title",
|
|
320
329
|
className: "text-base font-semibold text-text-primary",
|
|
321
330
|
children: "Customer & priority"
|
|
322
|
-
}), /* @__PURE__ */
|
|
331
|
+
}), /* @__PURE__ */ y("p", {
|
|
323
332
|
className: "mt-1 text-sm text-text-secondary",
|
|
324
333
|
children: "Choose who this delivery is for and how urgently it should be handled."
|
|
325
334
|
})] })]
|
|
326
|
-
}), /* @__PURE__ */
|
|
335
|
+
}), /* @__PURE__ */ y(s, {
|
|
327
336
|
variant: "outline",
|
|
328
337
|
children: "Required"
|
|
329
338
|
})]
|
|
330
|
-
}), /* @__PURE__ */
|
|
339
|
+
}), /* @__PURE__ */ b("div", {
|
|
331
340
|
className: "grid grid-cols-1 gap-4 md:grid-cols-2",
|
|
332
|
-
children: [/* @__PURE__ */
|
|
333
|
-
customers:
|
|
334
|
-
value:
|
|
341
|
+
children: [/* @__PURE__ */ y(we, {
|
|
342
|
+
customers: O,
|
|
343
|
+
value: U.customerId,
|
|
335
344
|
onValueChange: (e) => {
|
|
336
|
-
e && (Z("customerId", e),
|
|
345
|
+
e && (Z("customerId", e), H(O.find((t) => t.id === e) ?? (V?.id === e ? V : null)), q(null));
|
|
337
346
|
},
|
|
338
347
|
onCreated: (e) => {
|
|
339
|
-
|
|
348
|
+
H(e), Z("customerId", e.id), q(null);
|
|
340
349
|
},
|
|
341
|
-
createCustomer:
|
|
342
|
-
isLoading:
|
|
343
|
-
error:
|
|
344
|
-
onRetry:
|
|
345
|
-
onOpenCustomers:
|
|
346
|
-
selectedCustomer:
|
|
347
|
-
onSearchQueryChange:
|
|
348
|
-
hasMore:
|
|
349
|
-
totalCount:
|
|
350
|
-
onLoadMore:
|
|
351
|
-
isLoadingMore:
|
|
352
|
-
}), /* @__PURE__ */
|
|
350
|
+
createCustomer: Be,
|
|
351
|
+
isLoading: k,
|
|
352
|
+
error: A,
|
|
353
|
+
onRetry: He,
|
|
354
|
+
onOpenCustomers: mt,
|
|
355
|
+
selectedCustomer: V,
|
|
356
|
+
onSearchQueryChange: ze,
|
|
357
|
+
hasMore: We,
|
|
358
|
+
totalCount: Ge,
|
|
359
|
+
onLoadMore: Ue,
|
|
360
|
+
isLoadingMore: Ve
|
|
361
|
+
}), /* @__PURE__ */ b("div", {
|
|
353
362
|
className: "min-w-0 space-y-2",
|
|
354
363
|
children: [
|
|
355
|
-
/* @__PURE__ */
|
|
364
|
+
/* @__PURE__ */ y(h, {
|
|
356
365
|
htmlFor: "priority",
|
|
357
366
|
children: "Priority"
|
|
358
367
|
}),
|
|
359
|
-
/* @__PURE__ */
|
|
360
|
-
value:
|
|
368
|
+
/* @__PURE__ */ b(me, {
|
|
369
|
+
value: U.priority,
|
|
361
370
|
onValueChange: (e) => Z("priority", e),
|
|
362
|
-
children: [/* @__PURE__ */
|
|
371
|
+
children: [/* @__PURE__ */ y(ge, {
|
|
363
372
|
id: "priority",
|
|
364
|
-
children: /* @__PURE__ */
|
|
365
|
-
}), /* @__PURE__ */
|
|
366
|
-
/* @__PURE__ */
|
|
373
|
+
children: /* @__PURE__ */ y(_e, {})
|
|
374
|
+
}), /* @__PURE__ */ b(he, { children: [
|
|
375
|
+
/* @__PURE__ */ y(g, {
|
|
367
376
|
value: "low",
|
|
368
377
|
children: "Low"
|
|
369
378
|
}),
|
|
370
|
-
/* @__PURE__ */
|
|
379
|
+
/* @__PURE__ */ y(g, {
|
|
371
380
|
value: "normal",
|
|
372
381
|
children: "Normal"
|
|
373
382
|
}),
|
|
374
|
-
/* @__PURE__ */
|
|
383
|
+
/* @__PURE__ */ y(g, {
|
|
375
384
|
value: "high",
|
|
376
385
|
children: "High"
|
|
377
386
|
}),
|
|
378
|
-
/* @__PURE__ */
|
|
387
|
+
/* @__PURE__ */ y(g, {
|
|
379
388
|
value: "urgent",
|
|
380
389
|
children: "Urgent"
|
|
381
390
|
})
|
|
382
391
|
] })]
|
|
383
392
|
}),
|
|
384
|
-
/* @__PURE__ */
|
|
393
|
+
/* @__PURE__ */ y("p", {
|
|
385
394
|
className: "text-xs text-text-secondary",
|
|
386
|
-
children: "
|
|
395
|
+
children: "New orders start with this workspace's default priority."
|
|
387
396
|
})
|
|
388
397
|
]
|
|
389
398
|
})]
|
|
390
399
|
})]
|
|
391
400
|
})
|
|
392
401
|
}),
|
|
393
|
-
/* @__PURE__ */
|
|
402
|
+
/* @__PURE__ */ y("div", {
|
|
394
403
|
id: "locations-section",
|
|
395
|
-
children: /* @__PURE__ */
|
|
396
|
-
title: /* @__PURE__ */
|
|
404
|
+
children: /* @__PURE__ */ b(x, {
|
|
405
|
+
title: /* @__PURE__ */ b("span", {
|
|
397
406
|
className: "flex items-center gap-2",
|
|
398
|
-
children: [/* @__PURE__ */
|
|
407
|
+
children: [/* @__PURE__ */ y(r, {
|
|
399
408
|
size: 18,
|
|
400
409
|
"aria-hidden": "true"
|
|
401
410
|
}), "Route & addresses"]
|
|
402
411
|
}),
|
|
403
412
|
description: "Choose an optional saved route, then review or enter the collection and destination details.",
|
|
404
413
|
children: [
|
|
405
|
-
/* @__PURE__ */
|
|
414
|
+
/* @__PURE__ */ b("div", {
|
|
406
415
|
className: "rounded-card border border-border-subtle bg-bg-sunken/40 p-4",
|
|
407
416
|
children: [
|
|
408
|
-
/* @__PURE__ */
|
|
417
|
+
/* @__PURE__ */ b("div", {
|
|
409
418
|
className: "mb-3 flex flex-col gap-2 sm:flex-row sm:items-start sm:justify-between",
|
|
410
|
-
children: [/* @__PURE__ */
|
|
419
|
+
children: [/* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("h3", {
|
|
411
420
|
className: "text-sm font-semibold text-text-primary",
|
|
412
421
|
children: "Use a saved route"
|
|
413
|
-
}), /* @__PURE__ */
|
|
422
|
+
}), /* @__PURE__ */ y("p", {
|
|
414
423
|
className: "mt-1 text-xs text-text-secondary",
|
|
415
424
|
children: "Optional — fills only blank address fields; you can always edit them below."
|
|
416
|
-
})] }), /* @__PURE__ */
|
|
425
|
+
})] }), /* @__PURE__ */ y(s, {
|
|
417
426
|
variant: "secondary",
|
|
418
427
|
children: "Optional"
|
|
419
428
|
})]
|
|
420
429
|
}),
|
|
421
|
-
/* @__PURE__ */
|
|
430
|
+
/* @__PURE__ */ y(Ce, {
|
|
422
431
|
id: "saved-route",
|
|
423
|
-
value:
|
|
424
|
-
onChange:
|
|
425
|
-
options:
|
|
426
|
-
loading:
|
|
432
|
+
value: U.routeId,
|
|
433
|
+
onChange: dt,
|
|
434
|
+
options: M,
|
|
435
|
+
loading: N,
|
|
427
436
|
getId: (e) => e.id,
|
|
428
437
|
getLabel: (e) => `${e.name} · ${e.stops.length} stops`,
|
|
429
|
-
renderOption: (e) => /* @__PURE__ */
|
|
438
|
+
renderOption: (e) => /* @__PURE__ */ b(je, { children: [
|
|
430
439
|
e.name,
|
|
431
440
|
" · ",
|
|
432
441
|
e.stops.length,
|
|
433
442
|
" stops"
|
|
434
443
|
] }),
|
|
435
|
-
selectedOption:
|
|
436
|
-
selectedLoading:
|
|
444
|
+
selectedOption: at,
|
|
445
|
+
selectedLoading: ot,
|
|
437
446
|
placeholder: "Choose a saved route",
|
|
438
447
|
searchPlaceholder: "Search saved routes",
|
|
439
448
|
emptyText: "No saved routes found.",
|
|
440
449
|
noneLabel: "No saved route",
|
|
441
|
-
error:
|
|
442
|
-
onSearchChange:
|
|
443
|
-
hasMore:
|
|
444
|
-
totalCount:
|
|
445
|
-
onLoadMore:
|
|
446
|
-
loadingMore:
|
|
450
|
+
error: P ? "Saved routes are unavailable" : void 0,
|
|
451
|
+
onSearchChange: qe,
|
|
452
|
+
hasMore: Je,
|
|
453
|
+
totalCount: Ye,
|
|
454
|
+
onLoadMore: Xe,
|
|
455
|
+
loadingMore: Ze
|
|
447
456
|
}),
|
|
448
|
-
/* @__PURE__ */
|
|
457
|
+
/* @__PURE__ */ y("p", {
|
|
449
458
|
className: "mt-2 text-xs text-text-secondary",
|
|
450
459
|
role: "status",
|
|
451
|
-
children:
|
|
460
|
+
children: N ? "Loading planned routes…" : P ? "Saved routes are unavailable; enter pickup and delivery addresses manually." : "Manual values always remain authoritative when a route is selected."
|
|
452
461
|
})
|
|
453
462
|
]
|
|
454
463
|
}),
|
|
455
|
-
/* @__PURE__ */
|
|
456
|
-
/* @__PURE__ */
|
|
464
|
+
/* @__PURE__ */ y(ve, {}),
|
|
465
|
+
/* @__PURE__ */ b("div", {
|
|
457
466
|
className: "grid grid-cols-1 gap-4 lg:grid-cols-[minmax(0,1fr)_auto_minmax(0,1fr)] lg:items-stretch",
|
|
458
467
|
children: [
|
|
459
|
-
/* @__PURE__ */
|
|
468
|
+
/* @__PURE__ */ b(l, {
|
|
460
469
|
className: "border-border-seam shadow-none",
|
|
461
|
-
children: [/* @__PURE__ */
|
|
470
|
+
children: [/* @__PURE__ */ b(f, { children: [/* @__PURE__ */ b(p, {
|
|
462
471
|
className: "flex items-center gap-2 text-base",
|
|
463
472
|
children: [
|
|
464
|
-
/* @__PURE__ */
|
|
473
|
+
/* @__PURE__ */ y(r, {
|
|
465
474
|
size: 17,
|
|
466
475
|
className: "text-text-secondary",
|
|
467
476
|
"aria-hidden": "true"
|
|
468
477
|
}),
|
|
469
478
|
"Pickup address ",
|
|
470
|
-
/* @__PURE__ */
|
|
479
|
+
/* @__PURE__ */ y("span", {
|
|
471
480
|
className: "text-status-error-text",
|
|
472
481
|
children: "*"
|
|
473
482
|
})
|
|
474
483
|
]
|
|
475
|
-
}), /* @__PURE__ */
|
|
484
|
+
}), /* @__PURE__ */ y(d, { children: "Where the shipment is collected." })] }), /* @__PURE__ */ y(u, {
|
|
476
485
|
className: "space-y-4",
|
|
477
|
-
children: /* @__PURE__ */
|
|
486
|
+
children: /* @__PURE__ */ b("fieldset", {
|
|
478
487
|
className: "space-y-4",
|
|
479
488
|
children: [
|
|
480
|
-
/* @__PURE__ */
|
|
489
|
+
/* @__PURE__ */ y("legend", {
|
|
481
490
|
className: "sr-only",
|
|
482
491
|
children: "Pickup address details"
|
|
483
492
|
}),
|
|
484
|
-
/* @__PURE__ */
|
|
493
|
+
/* @__PURE__ */ b("div", {
|
|
485
494
|
className: "space-y-2",
|
|
486
|
-
children: [/* @__PURE__ */
|
|
495
|
+
children: [/* @__PURE__ */ b(h, {
|
|
487
496
|
htmlFor: "pickupStreet",
|
|
488
|
-
children: ["Street address ", /* @__PURE__ */
|
|
497
|
+
children: ["Street address ", /* @__PURE__ */ y("span", {
|
|
489
498
|
className: "text-status-error-text",
|
|
490
499
|
children: "*"
|
|
491
500
|
})]
|
|
492
|
-
}), /* @__PURE__ */
|
|
501
|
+
}), /* @__PURE__ */ y(m, {
|
|
493
502
|
id: "pickupStreet",
|
|
494
|
-
value:
|
|
503
|
+
value: U.pickupAddress.street,
|
|
495
504
|
onChange: (e) => Q("pickupAddress", "street", e.target.value),
|
|
496
505
|
placeholder: "123 Main St",
|
|
497
506
|
"aria-required": "true"
|
|
498
507
|
})]
|
|
499
508
|
}),
|
|
500
|
-
/* @__PURE__ */
|
|
509
|
+
/* @__PURE__ */ b("div", {
|
|
501
510
|
className: "grid grid-cols-1 sm:grid-cols-2 gap-4",
|
|
502
|
-
children: [/* @__PURE__ */
|
|
511
|
+
children: [/* @__PURE__ */ b("div", {
|
|
503
512
|
className: "space-y-2",
|
|
504
|
-
children: [/* @__PURE__ */
|
|
513
|
+
children: [/* @__PURE__ */ y(h, {
|
|
505
514
|
htmlFor: "pickupCity",
|
|
506
515
|
children: "City"
|
|
507
|
-
}), /* @__PURE__ */
|
|
516
|
+
}), /* @__PURE__ */ y(m, {
|
|
508
517
|
id: "pickupCity",
|
|
509
|
-
value:
|
|
518
|
+
value: U.pickupAddress.city,
|
|
510
519
|
onChange: (e) => Q("pickupAddress", "city", e.target.value),
|
|
511
520
|
placeholder: "San Francisco"
|
|
512
521
|
})]
|
|
513
|
-
}), /* @__PURE__ */
|
|
522
|
+
}), /* @__PURE__ */ b("div", {
|
|
514
523
|
className: "space-y-2",
|
|
515
|
-
children: [/* @__PURE__ */
|
|
524
|
+
children: [/* @__PURE__ */ y(h, {
|
|
516
525
|
htmlFor: "pickupState",
|
|
517
526
|
children: "State"
|
|
518
|
-
}), /* @__PURE__ */
|
|
527
|
+
}), /* @__PURE__ */ y(m, {
|
|
519
528
|
id: "pickupState",
|
|
520
|
-
value:
|
|
529
|
+
value: U.pickupAddress.state,
|
|
521
530
|
onChange: (e) => Q("pickupAddress", "state", e.target.value),
|
|
522
531
|
placeholder: "CA"
|
|
523
532
|
})]
|
|
524
533
|
})]
|
|
525
534
|
}),
|
|
526
|
-
/* @__PURE__ */
|
|
535
|
+
/* @__PURE__ */ b("div", {
|
|
527
536
|
className: "grid grid-cols-1 sm:grid-cols-2 gap-4",
|
|
528
|
-
children: [/* @__PURE__ */
|
|
537
|
+
children: [/* @__PURE__ */ b("div", {
|
|
529
538
|
className: "space-y-2",
|
|
530
|
-
children: [/* @__PURE__ */
|
|
539
|
+
children: [/* @__PURE__ */ y(h, {
|
|
531
540
|
htmlFor: "pickupPostal",
|
|
532
541
|
children: "Postal Code"
|
|
533
|
-
}), /* @__PURE__ */
|
|
542
|
+
}), /* @__PURE__ */ y(m, {
|
|
534
543
|
id: "pickupPostal",
|
|
535
|
-
value:
|
|
544
|
+
value: U.pickupAddress.postalCode,
|
|
536
545
|
onChange: (e) => Q("pickupAddress", "postalCode", e.target.value),
|
|
537
546
|
placeholder: "94103"
|
|
538
547
|
})]
|
|
539
|
-
}), /* @__PURE__ */
|
|
548
|
+
}), /* @__PURE__ */ b("div", {
|
|
540
549
|
className: "space-y-2",
|
|
541
|
-
children: [/* @__PURE__ */
|
|
550
|
+
children: [/* @__PURE__ */ y(h, {
|
|
542
551
|
htmlFor: "pickupCountry",
|
|
543
552
|
children: "Country"
|
|
544
|
-
}), /* @__PURE__ */
|
|
553
|
+
}), /* @__PURE__ */ y(m, {
|
|
545
554
|
id: "pickupCountry",
|
|
546
|
-
value:
|
|
555
|
+
value: U.pickupAddress.country,
|
|
547
556
|
onChange: (e) => Q("pickupAddress", "country", e.target.value),
|
|
548
557
|
placeholder: "USA"
|
|
549
558
|
})]
|
|
@@ -553,102 +562,102 @@ function T() {
|
|
|
553
562
|
})
|
|
554
563
|
})]
|
|
555
564
|
}),
|
|
556
|
-
/* @__PURE__ */
|
|
565
|
+
/* @__PURE__ */ y("div", {
|
|
557
566
|
className: "hidden items-center justify-center lg:flex",
|
|
558
567
|
"aria-hidden": "true",
|
|
559
|
-
children: /* @__PURE__ */
|
|
568
|
+
children: /* @__PURE__ */ y(t, {
|
|
560
569
|
size: 18,
|
|
561
570
|
className: "text-text-muted"
|
|
562
571
|
})
|
|
563
572
|
}),
|
|
564
|
-
/* @__PURE__ */
|
|
573
|
+
/* @__PURE__ */ b(l, {
|
|
565
574
|
className: "border-border-seam shadow-none",
|
|
566
|
-
children: [/* @__PURE__ */
|
|
575
|
+
children: [/* @__PURE__ */ b(f, { children: [/* @__PURE__ */ b(p, {
|
|
567
576
|
className: "flex items-center gap-2 text-base",
|
|
568
577
|
children: [
|
|
569
|
-
/* @__PURE__ */
|
|
578
|
+
/* @__PURE__ */ y(r, {
|
|
570
579
|
size: 17,
|
|
571
580
|
className: "text-text-secondary",
|
|
572
581
|
"aria-hidden": "true"
|
|
573
582
|
}),
|
|
574
583
|
"Delivery address ",
|
|
575
|
-
/* @__PURE__ */
|
|
584
|
+
/* @__PURE__ */ y("span", {
|
|
576
585
|
className: "text-status-error-text",
|
|
577
586
|
children: "*"
|
|
578
587
|
})
|
|
579
588
|
]
|
|
580
|
-
}), /* @__PURE__ */
|
|
589
|
+
}), /* @__PURE__ */ y(d, { children: "Where the shipment is delivered." })] }), /* @__PURE__ */ y(u, {
|
|
581
590
|
className: "space-y-4",
|
|
582
|
-
children: /* @__PURE__ */
|
|
591
|
+
children: /* @__PURE__ */ b("fieldset", {
|
|
583
592
|
className: "space-y-4",
|
|
584
593
|
children: [
|
|
585
|
-
/* @__PURE__ */
|
|
594
|
+
/* @__PURE__ */ y("legend", {
|
|
586
595
|
className: "sr-only",
|
|
587
596
|
children: "Delivery address details"
|
|
588
597
|
}),
|
|
589
|
-
/* @__PURE__ */
|
|
598
|
+
/* @__PURE__ */ b("div", {
|
|
590
599
|
className: "space-y-2",
|
|
591
|
-
children: [/* @__PURE__ */
|
|
600
|
+
children: [/* @__PURE__ */ b(h, {
|
|
592
601
|
htmlFor: "deliveryStreet",
|
|
593
|
-
children: ["Street address ", /* @__PURE__ */
|
|
602
|
+
children: ["Street address ", /* @__PURE__ */ y("span", {
|
|
594
603
|
className: "text-status-error-text",
|
|
595
604
|
children: "*"
|
|
596
605
|
})]
|
|
597
|
-
}), /* @__PURE__ */
|
|
606
|
+
}), /* @__PURE__ */ y(m, {
|
|
598
607
|
id: "deliveryStreet",
|
|
599
|
-
value:
|
|
608
|
+
value: U.deliveryAddress.street,
|
|
600
609
|
onChange: (e) => Q("deliveryAddress", "street", e.target.value),
|
|
601
610
|
placeholder: "456 Oak Ave",
|
|
602
611
|
"aria-required": "true"
|
|
603
612
|
})]
|
|
604
613
|
}),
|
|
605
|
-
/* @__PURE__ */
|
|
614
|
+
/* @__PURE__ */ b("div", {
|
|
606
615
|
className: "grid grid-cols-1 gap-4 sm:grid-cols-2",
|
|
607
|
-
children: [/* @__PURE__ */
|
|
616
|
+
children: [/* @__PURE__ */ b("div", {
|
|
608
617
|
className: "space-y-2",
|
|
609
|
-
children: [/* @__PURE__ */
|
|
618
|
+
children: [/* @__PURE__ */ y(h, {
|
|
610
619
|
htmlFor: "deliveryCity",
|
|
611
620
|
children: "City"
|
|
612
|
-
}), /* @__PURE__ */
|
|
621
|
+
}), /* @__PURE__ */ y(m, {
|
|
613
622
|
id: "deliveryCity",
|
|
614
|
-
value:
|
|
623
|
+
value: U.deliveryAddress.city,
|
|
615
624
|
onChange: (e) => Q("deliveryAddress", "city", e.target.value),
|
|
616
625
|
placeholder: "Los Angeles"
|
|
617
626
|
})]
|
|
618
|
-
}), /* @__PURE__ */
|
|
627
|
+
}), /* @__PURE__ */ b("div", {
|
|
619
628
|
className: "space-y-2",
|
|
620
|
-
children: [/* @__PURE__ */
|
|
629
|
+
children: [/* @__PURE__ */ y(h, {
|
|
621
630
|
htmlFor: "deliveryState",
|
|
622
631
|
children: "State"
|
|
623
|
-
}), /* @__PURE__ */
|
|
632
|
+
}), /* @__PURE__ */ y(m, {
|
|
624
633
|
id: "deliveryState",
|
|
625
|
-
value:
|
|
634
|
+
value: U.deliveryAddress.state,
|
|
626
635
|
onChange: (e) => Q("deliveryAddress", "state", e.target.value),
|
|
627
636
|
placeholder: "CA"
|
|
628
637
|
})]
|
|
629
638
|
})]
|
|
630
639
|
}),
|
|
631
|
-
/* @__PURE__ */
|
|
640
|
+
/* @__PURE__ */ b("div", {
|
|
632
641
|
className: "grid grid-cols-1 gap-4 sm:grid-cols-2",
|
|
633
|
-
children: [/* @__PURE__ */
|
|
642
|
+
children: [/* @__PURE__ */ b("div", {
|
|
634
643
|
className: "space-y-2",
|
|
635
|
-
children: [/* @__PURE__ */
|
|
644
|
+
children: [/* @__PURE__ */ y(h, {
|
|
636
645
|
htmlFor: "deliveryPostal",
|
|
637
646
|
children: "Postal code"
|
|
638
|
-
}), /* @__PURE__ */
|
|
647
|
+
}), /* @__PURE__ */ y(m, {
|
|
639
648
|
id: "deliveryPostal",
|
|
640
|
-
value:
|
|
649
|
+
value: U.deliveryAddress.postalCode,
|
|
641
650
|
onChange: (e) => Q("deliveryAddress", "postalCode", e.target.value),
|
|
642
651
|
placeholder: "90210"
|
|
643
652
|
})]
|
|
644
|
-
}), /* @__PURE__ */
|
|
653
|
+
}), /* @__PURE__ */ b("div", {
|
|
645
654
|
className: "space-y-2",
|
|
646
|
-
children: [/* @__PURE__ */
|
|
655
|
+
children: [/* @__PURE__ */ y(h, {
|
|
647
656
|
htmlFor: "deliveryCountry",
|
|
648
657
|
children: "Country"
|
|
649
|
-
}), /* @__PURE__ */
|
|
658
|
+
}), /* @__PURE__ */ y(m, {
|
|
650
659
|
id: "deliveryCountry",
|
|
651
|
-
value:
|
|
660
|
+
value: U.deliveryAddress.country,
|
|
652
661
|
onChange: (e) => Q("deliveryAddress", "country", e.target.value),
|
|
653
662
|
placeholder: "USA"
|
|
654
663
|
})]
|
|
@@ -663,143 +672,157 @@ function T() {
|
|
|
663
672
|
]
|
|
664
673
|
})
|
|
665
674
|
}),
|
|
666
|
-
/* @__PURE__ */
|
|
675
|
+
/* @__PURE__ */ y("div", {
|
|
667
676
|
id: "items-section",
|
|
668
|
-
children: /* @__PURE__ */ x
|
|
669
|
-
title: /* @__PURE__ */
|
|
677
|
+
children: /* @__PURE__ */ y(x, {
|
|
678
|
+
title: /* @__PURE__ */ b("span", {
|
|
670
679
|
className: "flex items-center gap-2",
|
|
671
680
|
children: [
|
|
672
|
-
/* @__PURE__ */
|
|
681
|
+
/* @__PURE__ */ y(i, {
|
|
673
682
|
size: 18,
|
|
674
683
|
"aria-hidden": "true"
|
|
675
684
|
}),
|
|
676
685
|
"Shipment contents ",
|
|
677
|
-
/* @__PURE__ */
|
|
686
|
+
/* @__PURE__ */ y(s, {
|
|
678
687
|
variant: "secondary",
|
|
679
|
-
children:
|
|
688
|
+
children: U.items.length
|
|
680
689
|
})
|
|
681
690
|
]
|
|
682
691
|
}),
|
|
683
692
|
description: "Add each item being shipped. Use the catalog to prefill details or enter a one-off item manually.",
|
|
684
|
-
actions: /* @__PURE__ */
|
|
693
|
+
actions: /* @__PURE__ */ b(c, {
|
|
685
694
|
type: "button",
|
|
686
695
|
variant: "outline",
|
|
687
696
|
size: "sm",
|
|
688
697
|
onClick: $,
|
|
689
|
-
children: [/* @__PURE__ */
|
|
698
|
+
children: [/* @__PURE__ */ y(a, { size: 16 }), "Add item"]
|
|
690
699
|
}),
|
|
691
|
-
children:
|
|
700
|
+
children: U.items.length === 0 ? /* @__PURE__ */ y(be, {
|
|
692
701
|
illustration: "empty-files",
|
|
693
702
|
title: "No items added yet",
|
|
694
703
|
description: "Add the products this order will ship — each with a name, SKU, quantity and value.",
|
|
695
|
-
action: /* @__PURE__ */
|
|
704
|
+
action: /* @__PURE__ */ b(c, {
|
|
696
705
|
type: "button",
|
|
697
706
|
variant: "outline",
|
|
698
707
|
onClick: $,
|
|
699
|
-
children: [/* @__PURE__ */
|
|
708
|
+
children: [/* @__PURE__ */ y(a, {
|
|
700
709
|
size: 16,
|
|
701
710
|
className: "mr-1.5"
|
|
702
711
|
}), "Add your first item"]
|
|
703
712
|
})
|
|
704
|
-
}) : /* @__PURE__ */
|
|
713
|
+
}) : /* @__PURE__ */ b("div", {
|
|
705
714
|
className: "space-y-4",
|
|
706
|
-
children: [/* @__PURE__ */
|
|
715
|
+
children: [/* @__PURE__ */ b("div", {
|
|
707
716
|
className: "rounded-card border border-border-subtle bg-bg-sunken/40 p-4",
|
|
708
717
|
children: [
|
|
709
|
-
/* @__PURE__ */
|
|
718
|
+
/* @__PURE__ */ y(h, {
|
|
710
719
|
htmlFor: "item-product-search",
|
|
711
720
|
children: "Search product catalog"
|
|
712
721
|
}),
|
|
713
|
-
/* @__PURE__ */
|
|
722
|
+
/* @__PURE__ */ y(m, {
|
|
714
723
|
id: "item-product-search",
|
|
715
|
-
value:
|
|
716
|
-
onChange: (e) =>
|
|
724
|
+
value: F,
|
|
725
|
+
onChange: (e) => Qe(e.target.value),
|
|
717
726
|
placeholder: "Search by name or SKU",
|
|
718
727
|
className: "mt-2"
|
|
719
728
|
}),
|
|
720
|
-
/* @__PURE__ */
|
|
729
|
+
/* @__PURE__ */ y("p", {
|
|
721
730
|
className: "mt-2 text-xs text-text-secondary",
|
|
722
731
|
children: "This filters the catalog picker for every item below. You can still edit any autofilled value or enter item details manually."
|
|
723
732
|
})
|
|
724
733
|
]
|
|
725
|
-
}), /* @__PURE__ */
|
|
734
|
+
}), /* @__PURE__ */ y("ol", {
|
|
726
735
|
className: "space-y-4",
|
|
727
736
|
"aria-label": "Shipment items",
|
|
728
|
-
children:
|
|
737
|
+
children: U.items.map((e, t) => /* @__PURE__ */ y("li", { children: /* @__PURE__ */ y(Te, {
|
|
729
738
|
item: e,
|
|
730
739
|
index: t,
|
|
731
|
-
products:
|
|
732
|
-
productsLoading:
|
|
733
|
-
productsLoadingMore:
|
|
734
|
-
productsHasMore:
|
|
735
|
-
productsTotalCount:
|
|
736
|
-
onLoadMoreProducts:
|
|
737
|
-
errors:
|
|
738
|
-
onUpdate:
|
|
739
|
-
onRemove:
|
|
740
|
+
products: $e,
|
|
741
|
+
productsLoading: et,
|
|
742
|
+
productsLoadingMore: tt,
|
|
743
|
+
productsHasMore: nt,
|
|
744
|
+
productsTotalCount: rt,
|
|
745
|
+
onLoadMoreProducts: it,
|
|
746
|
+
errors: J[e.id],
|
|
747
|
+
onUpdate: pt,
|
|
748
|
+
onRemove: ft
|
|
740
749
|
}) }, e.id))
|
|
741
750
|
})]
|
|
742
751
|
})
|
|
743
752
|
})
|
|
744
753
|
}),
|
|
745
|
-
/* @__PURE__ */ x
|
|
746
|
-
title: /* @__PURE__ */
|
|
754
|
+
/* @__PURE__ */ y(x, {
|
|
755
|
+
title: /* @__PURE__ */ b("span", {
|
|
747
756
|
className: "flex items-center gap-2",
|
|
748
|
-
children: [/* @__PURE__ */
|
|
757
|
+
children: [/* @__PURE__ */ y(n, {
|
|
749
758
|
size: 18,
|
|
750
759
|
"aria-hidden": "true"
|
|
751
760
|
}), "Timing & handling"]
|
|
752
761
|
}),
|
|
753
762
|
description: "Optional delivery timing and instructions for the carrier.",
|
|
754
|
-
children: /* @__PURE__ */
|
|
763
|
+
children: /* @__PURE__ */ b("div", {
|
|
755
764
|
className: "grid grid-cols-1 gap-6 lg:grid-cols-3",
|
|
756
765
|
children: [
|
|
757
|
-
/* @__PURE__ */
|
|
766
|
+
/* @__PURE__ */ b("div", {
|
|
758
767
|
className: "space-y-2",
|
|
759
768
|
children: [
|
|
760
|
-
/* @__PURE__ */
|
|
769
|
+
/* @__PURE__ */ y(h, {
|
|
761
770
|
htmlFor: "trackingNumber",
|
|
762
771
|
children: "Tracking / reference number"
|
|
763
772
|
}),
|
|
764
|
-
/* @__PURE__ */
|
|
773
|
+
/* @__PURE__ */ y(m, {
|
|
765
774
|
id: "trackingNumber",
|
|
766
|
-
value:
|
|
775
|
+
value: U.trackingNumber,
|
|
767
776
|
onChange: (e) => Z("trackingNumber", e.target.value),
|
|
768
777
|
placeholder: "Optional carrier reference"
|
|
769
778
|
}),
|
|
770
|
-
/* @__PURE__ */
|
|
779
|
+
/* @__PURE__ */ y("p", {
|
|
771
780
|
className: "text-xs text-text-secondary",
|
|
772
781
|
children: "Use this when a carrier or customer already supplied a tracking reference."
|
|
773
782
|
})
|
|
774
783
|
]
|
|
775
784
|
}),
|
|
776
|
-
/* @__PURE__ */
|
|
785
|
+
/* @__PURE__ */ b("div", {
|
|
777
786
|
className: "space-y-2",
|
|
778
787
|
children: [
|
|
779
|
-
/* @__PURE__ */
|
|
788
|
+
/* @__PURE__ */ y(h, {
|
|
780
789
|
htmlFor: "scheduledDelivery",
|
|
781
790
|
children: "Scheduled delivery"
|
|
782
791
|
}),
|
|
783
|
-
/* @__PURE__ */
|
|
792
|
+
/* @__PURE__ */ y(m, {
|
|
784
793
|
id: "scheduledDelivery",
|
|
785
794
|
type: "datetime-local",
|
|
786
|
-
value:
|
|
795
|
+
value: U.scheduledDelivery,
|
|
787
796
|
onChange: (e) => Z("scheduledDelivery", e.target.value)
|
|
788
797
|
}),
|
|
789
|
-
/* @__PURE__ */
|
|
790
|
-
className: "
|
|
791
|
-
children:
|
|
798
|
+
/* @__PURE__ */ b("div", {
|
|
799
|
+
className: "flex flex-wrap items-center gap-2",
|
|
800
|
+
children: [/* @__PURE__ */ y("p", {
|
|
801
|
+
className: "text-xs text-text-secondary",
|
|
802
|
+
children: "Leave blank to dispatch as soon as a driver is available."
|
|
803
|
+
}), /* @__PURE__ */ b(c, {
|
|
804
|
+
type: "button",
|
|
805
|
+
variant: "link",
|
|
806
|
+
size: "sm",
|
|
807
|
+
className: "h-auto p-0 text-xs",
|
|
808
|
+
onClick: () => Z("scheduledDelivery", ie(z)),
|
|
809
|
+
children: [
|
|
810
|
+
"Use the default window (",
|
|
811
|
+
z,
|
|
812
|
+
" h from now)"
|
|
813
|
+
]
|
|
814
|
+
})]
|
|
792
815
|
})
|
|
793
816
|
]
|
|
794
817
|
}),
|
|
795
|
-
/* @__PURE__ */
|
|
818
|
+
/* @__PURE__ */ b("div", {
|
|
796
819
|
className: "space-y-2 lg:col-span-1",
|
|
797
|
-
children: [/* @__PURE__ */
|
|
820
|
+
children: [/* @__PURE__ */ y(h, {
|
|
798
821
|
htmlFor: "specialInstructions",
|
|
799
822
|
children: "Special instructions"
|
|
800
|
-
}), /* @__PURE__ */
|
|
823
|
+
}), /* @__PURE__ */ y(ye, {
|
|
801
824
|
id: "specialInstructions",
|
|
802
|
-
value:
|
|
825
|
+
value: U.specialInstructions,
|
|
803
826
|
onChange: (e) => Z("specialInstructions", e.target.value),
|
|
804
827
|
placeholder: "Any special handling or delivery instructions...",
|
|
805
828
|
rows: 4
|
|
@@ -814,4 +837,4 @@ function T() {
|
|
|
814
837
|
});
|
|
815
838
|
}
|
|
816
839
|
//#endregion
|
|
817
|
-
export {
|
|
840
|
+
export { C as default };
|