@burdenoff/microfe-theglobalfuel 2026.705.2 → 2026.705.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/theglobalfuel/TheGlobalFuelRoot.js +54 -46
- package/dist/theglobalfuel/TheGlobalFuelRoot.js.map +1 -1
- package/dist/theglobalfuel/TheGlobalFuelRoutes.js +10 -6
- package/dist/theglobalfuel/TheGlobalFuelRoutes.js.map +1 -1
- package/dist/theglobalfuel/components/DataTable.js +126 -58
- package/dist/theglobalfuel/components/DataTable.js.map +1 -1
- package/dist/theglobalfuel/components/EmptyState.js +4 -4
- package/dist/theglobalfuel/components/EmptyState.js.map +1 -1
- package/dist/theglobalfuel/components/MetricsCard.js +2 -2
- package/dist/theglobalfuel/components/MetricsCard.js.map +1 -1
- package/dist/theglobalfuel/components/WorldMap.js +115 -0
- package/dist/theglobalfuel/components/WorldMap.js.map +1 -0
- package/dist/theglobalfuel/components/index.js +9 -0
- package/dist/theglobalfuel/components/viz/AllocationBar.js +68 -0
- package/dist/theglobalfuel/components/viz/AllocationBar.js.map +1 -0
- package/dist/theglobalfuel/components/viz/AreaChart.js +102 -0
- package/dist/theglobalfuel/components/viz/AreaChart.js.map +1 -0
- package/dist/theglobalfuel/components/viz/AvatarStack.js +2 -0
- package/dist/theglobalfuel/components/viz/BarChart.js +4 -0
- package/dist/theglobalfuel/components/viz/CertificateCard.js +4 -0
- package/dist/theglobalfuel/components/viz/DonutChart.js +109 -0
- package/dist/theglobalfuel/components/viz/DonutChart.js.map +1 -0
- package/dist/theglobalfuel/components/viz/HBarFunnel.js +3 -0
- package/dist/theglobalfuel/components/viz/Heatmap.js +3 -0
- package/dist/theglobalfuel/components/viz/KanbanBoard.js +2 -0
- package/dist/theglobalfuel/components/viz/LineChart.js +4 -0
- package/dist/theglobalfuel/components/viz/OrgTree.js +2 -0
- package/dist/theglobalfuel/components/viz/PathSteps.js +68 -0
- package/dist/theglobalfuel/components/viz/PathSteps.js.map +1 -0
- package/dist/theglobalfuel/components/viz/ProgressRing.js +6 -0
- package/dist/theglobalfuel/components/viz/ProgressRing.js.map +1 -0
- package/dist/theglobalfuel/components/viz/RatingStars.js +3 -0
- package/dist/theglobalfuel/components/viz/SegmentedTabs.js +3 -0
- package/dist/theglobalfuel/components/viz/SkillBar.js +3 -0
- package/dist/theglobalfuel/components/viz/Sparkline.js +74 -0
- package/dist/theglobalfuel/components/viz/Sparkline.js.map +1 -0
- package/dist/theglobalfuel/components/viz/StatCard.js +3 -0
- package/dist/theglobalfuel/components/viz/StepProgress.js +64 -0
- package/dist/theglobalfuel/components/viz/StepProgress.js.map +1 -0
- package/dist/theglobalfuel/components/viz/Timeline.js +66 -0
- package/dist/theglobalfuel/components/viz/Timeline.js.map +1 -0
- package/dist/theglobalfuel/components/viz/index.js +23 -0
- package/dist/theglobalfuel/components/viz/lib/Avatar.js +1 -0
- package/dist/theglobalfuel/components/viz/lib/CartesianFrame.js +119 -0
- package/dist/theglobalfuel/components/viz/lib/CartesianFrame.js.map +1 -0
- package/dist/theglobalfuel/components/viz/lib/ResponsiveSvg.js +35 -0
- package/dist/theglobalfuel/components/viz/lib/ResponsiveSvg.js.map +1 -0
- package/dist/theglobalfuel/components/viz/lib/format.js +17 -0
- package/dist/theglobalfuel/components/viz/lib/format.js.map +1 -0
- package/dist/theglobalfuel/components/viz/lib/geometry.js +61 -0
- package/dist/theglobalfuel/components/viz/lib/geometry.js.map +1 -0
- package/dist/theglobalfuel/components/viz/lib/hooks.js +39 -0
- package/dist/theglobalfuel/components/viz/lib/hooks.js.map +1 -0
- package/dist/theglobalfuel/components/viz/lib/palette.js +27 -0
- package/dist/theglobalfuel/components/viz/lib/palette.js.map +1 -0
- package/dist/theglobalfuel/hooks/useCursorPager.js +6 -15
- package/dist/theglobalfuel/hooks/useCursorPager.js.map +1 -1
- package/dist/theglobalfuel/pages/assets/AssetDetailPage.js +431 -316
- package/dist/theglobalfuel/pages/assets/AssetDetailPage.js.map +1 -1
- package/dist/theglobalfuel/pages/assets/AssetsPage.js +99 -99
- package/dist/theglobalfuel/pages/assets/AssetsPage.js.map +1 -1
- package/dist/theglobalfuel/pages/compliance/CompliancePage.js +250 -250
- package/dist/theglobalfuel/pages/compliance/CompliancePage.js.map +1 -1
- package/dist/theglobalfuel/pages/contracts/ContractsPage.js +2 -2
- package/dist/theglobalfuel/pages/contracts/ContractsPage.js.map +1 -1
- package/dist/theglobalfuel/pages/dashboard/DashboardPage.js +525 -227
- package/dist/theglobalfuel/pages/dashboard/DashboardPage.js.map +1 -1
- package/dist/theglobalfuel/pages/emissions/EmissionsPage.js +255 -206
- package/dist/theglobalfuel/pages/emissions/EmissionsPage.js.map +1 -1
- package/dist/theglobalfuel/pages/inventory/InventoryPage.js +60 -60
- package/dist/theglobalfuel/pages/inventory/InventoryPage.js.map +1 -1
- package/dist/theglobalfuel/pages/production/ProductionPage.js +2 -2
- package/dist/theglobalfuel/pages/production/ProductionPage.js.map +1 -1
- package/dist/theglobalfuel/pages/provenance/ProvenancePage.js +465 -0
- package/dist/theglobalfuel/pages/provenance/ProvenancePage.js.map +1 -0
- package/dist/theglobalfuel/pages/reserves/ReservesPage.js +152 -152
- package/dist/theglobalfuel/pages/reserves/ReservesPage.js.map +1 -1
- package/dist/theglobalfuel/pages/shipments/ShipmentsPage.js +356 -227
- package/dist/theglobalfuel/pages/shipments/ShipmentsPage.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,25 +1,28 @@
|
|
|
1
1
|
import { PageLayout as e } from "../../components/PageLayout.js";
|
|
2
2
|
import { MetricsCard as t } from "../../components/MetricsCard.js";
|
|
3
|
-
import { formatDate as n, formatEnumLabel as r, formatVolume as i, toBackendDate as
|
|
4
|
-
import { StatusBadge as
|
|
5
|
-
import { DataTable as
|
|
6
|
-
import { ErrorView as
|
|
7
|
-
import { EmptyState as
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
3
|
+
import { formatDate as n, formatEnumLabel as r, formatVolume as i, toBackendDate as a } from "../../utils/formatters.js";
|
|
4
|
+
import { StatusBadge as o } from "../../components/StatusBadge.js";
|
|
5
|
+
import { DataTable as ee } from "../../components/DataTable.js";
|
|
6
|
+
import { ErrorView as te, LoadingView as ne } from "../../components/StateViews.js";
|
|
7
|
+
import { EmptyState as re } from "../../components/EmptyState.js";
|
|
8
|
+
import { AllocationBar as ie } from "../../components/viz/AllocationBar.js";
|
|
9
|
+
import { PathSteps as ae } from "../../components/viz/PathSteps.js";
|
|
10
|
+
import { useTheContracts as oe, useTheDeliverShipment as se, useTheScheduleShipment as ce, useTheShipments as s, useTheTransitionShipment as le } from "../../hooks/useTheGlobalFuelApi.js";
|
|
11
|
+
import { useCursorPager as ue } from "../../hooks/useCursorPager.js";
|
|
12
|
+
import { useNotify as de } from "../../hooks/useNotify.js";
|
|
11
13
|
import "../../hooks/index.js";
|
|
12
|
-
import { SHIPMENT_DELIVERABLE_FROM as
|
|
13
|
-
import { FilterTabs as
|
|
14
|
-
import { Pagination as
|
|
15
|
-
import { EvidenceUpload as
|
|
16
|
-
import { FileLink as
|
|
14
|
+
import { SHIPMENT_DELIVERABLE_FROM as fe, SHIPMENT_TRANSITIONS as pe, nextStatuses as me } from "../../utils/transitions.js";
|
|
15
|
+
import { FilterTabs as he } from "../../components/FilterTabs.js";
|
|
16
|
+
import { Pagination as ge } from "../../components/Pagination.js";
|
|
17
|
+
import { EvidenceUpload as _e } from "../../components/EvidenceUpload.js";
|
|
18
|
+
import { FileLink as ve } from "../../components/FileLink.js";
|
|
19
|
+
import "../../components/index.js";
|
|
17
20
|
import { useMemo as c, useState as l } from "react";
|
|
18
|
-
import { ArrowRight as
|
|
19
|
-
import { Fragment as
|
|
20
|
-
import { Button as
|
|
21
|
+
import { ArrowRight as ye, CalendarClock as be, MapPin as xe, PackageCheck as u, Plus as d, Ship as f, Truck as Se } from "lucide-react";
|
|
22
|
+
import { Fragment as Ce, jsx as p, jsxs as m } from "react/jsx-runtime";
|
|
23
|
+
import { Button as h, Input as g, Label as _, ResponsiveDialog as we, ResponsiveDialogContent as Te, ResponsiveDialogDescription as Ee, ResponsiveDialogFooter as De, ResponsiveDialogHeader as Oe, ResponsiveDialogTitle as ke, Select as v, SelectContent as y, SelectItem as b, SelectTrigger as x, SelectValue as S, Textarea as Ae } from "@burdenoff/fe-libs/ui";
|
|
21
24
|
//#region src/theglobalfuel/pages/shipments/ShipmentsPage.tsx
|
|
22
|
-
var
|
|
25
|
+
var je = [
|
|
23
26
|
{
|
|
24
27
|
value: "ALL",
|
|
25
28
|
label: "All"
|
|
@@ -44,14 +47,14 @@ var T = [
|
|
|
44
47
|
value: "CANCELLED",
|
|
45
48
|
label: "Cancelled"
|
|
46
49
|
}
|
|
47
|
-
],
|
|
50
|
+
], Me = [
|
|
48
51
|
"PIPELINE",
|
|
49
52
|
"TANKER",
|
|
50
53
|
"VESSEL_BULK",
|
|
51
54
|
"RAIL",
|
|
52
55
|
"TRUCK",
|
|
53
56
|
"GRID"
|
|
54
|
-
],
|
|
57
|
+
], Ne = [
|
|
55
58
|
"BARRELS",
|
|
56
59
|
"CUBIC_METERS",
|
|
57
60
|
"TONNES",
|
|
@@ -59,7 +62,44 @@ var T = [
|
|
|
59
62
|
"MWH",
|
|
60
63
|
"GJ",
|
|
61
64
|
"MCF"
|
|
62
|
-
],
|
|
65
|
+
], C = 25, Pe = [
|
|
66
|
+
"SCHEDULED",
|
|
67
|
+
"LOADING",
|
|
68
|
+
"IN_TRANSIT",
|
|
69
|
+
"DELIVERED",
|
|
70
|
+
"CANCELLED"
|
|
71
|
+
], Fe = {
|
|
72
|
+
SCHEDULED: "Scheduled",
|
|
73
|
+
LOADING: "Loading",
|
|
74
|
+
IN_TRANSIT: "In transit",
|
|
75
|
+
DELIVERED: "Delivered",
|
|
76
|
+
CANCELLED: "Cancelled"
|
|
77
|
+
}, Ie = {
|
|
78
|
+
SCHEDULED: "var(--color-text-muted)",
|
|
79
|
+
LOADING: "var(--color-accent-blue)",
|
|
80
|
+
IN_TRANSIT: "var(--color-status-warning-text)",
|
|
81
|
+
DELIVERED: "var(--color-status-success-text)",
|
|
82
|
+
CANCELLED: "var(--color-status-error-text)"
|
|
83
|
+
}, Le = (e) => {
|
|
84
|
+
let t = e.status === "CANCELLED", n = e.status === "DELIVERED", i = e.status === "IN_TRANSIT", a = n || i, o = t ? "Cancelled" : n ? "Delivered" : i ? "In transit" : r(e.status);
|
|
85
|
+
return [
|
|
86
|
+
{
|
|
87
|
+
label: (e.origin ?? "").trim(),
|
|
88
|
+
meta: "Origin",
|
|
89
|
+
state: t ? "todo" : a ? "done" : "active"
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
label: r(e.mode),
|
|
93
|
+
meta: o,
|
|
94
|
+
state: t ? "locked" : n ? "done" : i ? "active" : "todo"
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
label: (e.destination ?? "").trim(),
|
|
98
|
+
meta: "Destination",
|
|
99
|
+
state: t ? "locked" : n ? "done" : "todo"
|
|
100
|
+
}
|
|
101
|
+
];
|
|
102
|
+
}, w = {
|
|
63
103
|
contractId: "",
|
|
64
104
|
reference: "",
|
|
65
105
|
mode: "TANKER",
|
|
@@ -71,66 +111,74 @@ var T = [
|
|
|
71
111
|
scheduledAt: "",
|
|
72
112
|
notes: ""
|
|
73
113
|
};
|
|
74
|
-
function
|
|
75
|
-
let [
|
|
76
|
-
limit:
|
|
77
|
-
|
|
78
|
-
}),
|
|
114
|
+
function T() {
|
|
115
|
+
let [T, Re] = l("ALL"), [E, ze] = l("ALL"), D = ue(), [Be, O] = l(!1), [k, A] = l(w), [j, M] = l(null), [N, P] = l(null), [Ve, F] = l(null), [I, He] = l(null), L = de(), R = E === "ALL" ? void 0 : E, { data: z, isLoading: Ue, isError: We, refetch: Ge } = s(R, T === "ALL" ? void 0 : T, {
|
|
116
|
+
limit: C,
|
|
117
|
+
offset: D.page * C
|
|
118
|
+
}), B = s(R, void 0, { limit: 200 }), V = oe({ pagination: { limit: 100 } }), H = c(() => V.data?.items ?? [], [V.data]), U = c(() => {
|
|
79
119
|
let e = /* @__PURE__ */ new Map();
|
|
80
|
-
for (let t of
|
|
120
|
+
for (let t of H) e.set(t.id, t);
|
|
81
121
|
return e;
|
|
82
|
-
}, [
|
|
122
|
+
}, [H]), W = ce(), G = se(), Ke = le(), K = c(() => z?.items ?? [], [z]), q = c(() => B.data?.items ?? [], [B.data]), qe = q.filter((e) => e.status === "SCHEDULED").length, Je = q.filter((e) => e.status === "IN_TRANSIT").length, Ye = q.filter((e) => e.status === "DELIVERED").length, J = c(() => {
|
|
83
123
|
let e = {};
|
|
84
|
-
for (let t of
|
|
124
|
+
for (let t of q) e[t.status] = (e[t.status] ?? 0) + 1;
|
|
85
125
|
return e;
|
|
86
|
-
}, [
|
|
126
|
+
}, [q]), Xe = je.map((e) => ({
|
|
87
127
|
value: e.value,
|
|
88
128
|
label: e.label,
|
|
89
|
-
count: e.value === "ALL" ?
|
|
90
|
-
})),
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
129
|
+
count: e.value === "ALL" ? q.length : J[e.value] ?? 0
|
|
130
|
+
})), Y = c(() => Pe.filter((e) => (J[e] ?? 0) > 0).map((e) => ({
|
|
131
|
+
label: Fe[e],
|
|
132
|
+
value: J[e] ?? 0,
|
|
133
|
+
color: Ie[e]
|
|
134
|
+
})), [J]), X = c(() => q.filter((e) => (e.origin ?? "").trim() && (e.destination ?? "").trim()), [q]), Ze = c(() => {
|
|
135
|
+
let e = /* @__PURE__ */ new Set();
|
|
136
|
+
for (let t of X) e.add(`${(t.origin ?? "").trim()} → ${(t.destination ?? "").trim()}`);
|
|
137
|
+
return e.size;
|
|
138
|
+
}, [X]), Z = c(() => X.find((e) => e.id === I) ?? X[0] ?? null, [X, I]), Q = () => {
|
|
139
|
+
A(w), M(null), P(null);
|
|
140
|
+
}, Qe = async () => {
|
|
141
|
+
if (!k.contractId) {
|
|
142
|
+
P("Select the contract this shipment fulfils.");
|
|
95
143
|
return;
|
|
96
144
|
}
|
|
97
|
-
if (!
|
|
98
|
-
|
|
145
|
+
if (!k.reference.trim()) {
|
|
146
|
+
P("A shipment reference is required.");
|
|
99
147
|
return;
|
|
100
148
|
}
|
|
101
|
-
let e = Number(
|
|
102
|
-
if (!
|
|
103
|
-
|
|
149
|
+
let e = Number(k.volume);
|
|
150
|
+
if (!k.volume || Number.isNaN(e) || e <= 0) {
|
|
151
|
+
P("Enter a volume greater than zero."), L.error("Enter a volume greater than zero.");
|
|
104
152
|
return;
|
|
105
153
|
}
|
|
106
|
-
|
|
154
|
+
P(null);
|
|
107
155
|
try {
|
|
108
|
-
await
|
|
109
|
-
contractId:
|
|
110
|
-
reference:
|
|
111
|
-
mode:
|
|
112
|
-
carrier:
|
|
113
|
-
origin:
|
|
114
|
-
destination:
|
|
156
|
+
await W.mutateAsync({
|
|
157
|
+
contractId: k.contractId,
|
|
158
|
+
reference: k.reference.trim(),
|
|
159
|
+
mode: k.mode,
|
|
160
|
+
carrier: k.carrier.trim() || null,
|
|
161
|
+
origin: k.origin.trim() || null,
|
|
162
|
+
destination: k.destination.trim() || null,
|
|
115
163
|
volume: e,
|
|
116
|
-
unit:
|
|
117
|
-
scheduledAt:
|
|
118
|
-
documentFileId:
|
|
119
|
-
notes:
|
|
120
|
-
}),
|
|
164
|
+
unit: k.unit,
|
|
165
|
+
scheduledAt: a(k.scheduledAt) ?? null,
|
|
166
|
+
documentFileId: j?.fileId ?? null,
|
|
167
|
+
notes: k.notes.trim() || null
|
|
168
|
+
}), L.success("Shipment scheduled"), O(!1), Q();
|
|
121
169
|
} catch (e) {
|
|
122
|
-
|
|
170
|
+
P(e instanceof Error ? e.message : "Failed to schedule shipment."), L.fromError(e);
|
|
123
171
|
}
|
|
124
|
-
},
|
|
172
|
+
}, $e = [
|
|
125
173
|
{
|
|
126
174
|
key: "reference",
|
|
127
175
|
header: "Shipment",
|
|
128
|
-
render: (e) => /* @__PURE__ */
|
|
176
|
+
render: (e) => /* @__PURE__ */ m("div", {
|
|
129
177
|
className: "min-w-0",
|
|
130
|
-
children: [/* @__PURE__ */
|
|
178
|
+
children: [/* @__PURE__ */ p("p", {
|
|
131
179
|
className: "truncate font-semibold text-text-primary",
|
|
132
180
|
children: e.reference
|
|
133
|
-
}), /* @__PURE__ */
|
|
181
|
+
}), /* @__PURE__ */ p("p", {
|
|
134
182
|
className: "truncate text-xs text-text-tertiary md:hidden",
|
|
135
183
|
children: r(e.mode)
|
|
136
184
|
})]
|
|
@@ -141,17 +189,17 @@ function A() {
|
|
|
141
189
|
header: "Contract",
|
|
142
190
|
hideOnMobile: !0,
|
|
143
191
|
render: (e) => {
|
|
144
|
-
let t =
|
|
145
|
-
return t ? /* @__PURE__ */
|
|
192
|
+
let t = U.get(e.contractId);
|
|
193
|
+
return t ? /* @__PURE__ */ m("div", {
|
|
146
194
|
className: "min-w-0",
|
|
147
|
-
children: [/* @__PURE__ */
|
|
195
|
+
children: [/* @__PURE__ */ p("p", {
|
|
148
196
|
className: "truncate font-medium text-text-primary",
|
|
149
197
|
children: t.reference
|
|
150
|
-
}), /* @__PURE__ */
|
|
198
|
+
}), /* @__PURE__ */ p("p", {
|
|
151
199
|
className: "truncate text-xs text-text-tertiary",
|
|
152
200
|
children: t.counterparty
|
|
153
201
|
})]
|
|
154
|
-
}) : /* @__PURE__ */
|
|
202
|
+
}) : /* @__PURE__ */ p("span", {
|
|
155
203
|
className: "font-mono text-xs text-text-tertiary",
|
|
156
204
|
children: e.contractId.slice(0, 8)
|
|
157
205
|
});
|
|
@@ -161,7 +209,7 @@ function A() {
|
|
|
161
209
|
key: "mode",
|
|
162
210
|
header: "Mode",
|
|
163
211
|
hideOnMobile: !0,
|
|
164
|
-
render: (e) => /* @__PURE__ */
|
|
212
|
+
render: (e) => /* @__PURE__ */ p("span", {
|
|
165
213
|
className: "text-text-secondary",
|
|
166
214
|
children: r(e.mode)
|
|
167
215
|
})
|
|
@@ -169,7 +217,7 @@ function A() {
|
|
|
169
217
|
{
|
|
170
218
|
key: "status",
|
|
171
219
|
header: "Status",
|
|
172
|
-
render: (e) => /* @__PURE__ */
|
|
220
|
+
render: (e) => /* @__PURE__ */ p(o, { status: e.status })
|
|
173
221
|
},
|
|
174
222
|
{
|
|
175
223
|
key: "route",
|
|
@@ -177,18 +225,18 @@ function A() {
|
|
|
177
225
|
hideOnMobile: !0,
|
|
178
226
|
render: (e) => {
|
|
179
227
|
let t = e.origin?.trim(), n = e.destination?.trim();
|
|
180
|
-
return !t && !n ? /* @__PURE__ */
|
|
228
|
+
return !t && !n ? /* @__PURE__ */ p("span", {
|
|
181
229
|
className: "text-text-tertiary",
|
|
182
230
|
children: "—"
|
|
183
|
-
}) : /* @__PURE__ */
|
|
231
|
+
}) : /* @__PURE__ */ m("span", {
|
|
184
232
|
className: "inline-flex items-center gap-1.5 text-text-secondary",
|
|
185
233
|
children: [
|
|
186
|
-
/* @__PURE__ */
|
|
234
|
+
/* @__PURE__ */ p("span", {
|
|
187
235
|
className: "truncate",
|
|
188
236
|
children: t ?? "—"
|
|
189
237
|
}),
|
|
190
|
-
/* @__PURE__ */
|
|
191
|
-
/* @__PURE__ */
|
|
238
|
+
/* @__PURE__ */ p(ye, { className: "h-3.5 w-3.5 shrink-0 text-text-tertiary" }),
|
|
239
|
+
/* @__PURE__ */ p("span", {
|
|
192
240
|
className: "truncate",
|
|
193
241
|
children: n ?? "—"
|
|
194
242
|
})
|
|
@@ -201,7 +249,7 @@ function A() {
|
|
|
201
249
|
header: "Volume",
|
|
202
250
|
align: "right",
|
|
203
251
|
sortValue: (e) => e.volume,
|
|
204
|
-
render: (e) => /* @__PURE__ */
|
|
252
|
+
render: (e) => /* @__PURE__ */ p("span", {
|
|
205
253
|
className: "tabular-nums text-text-primary",
|
|
206
254
|
children: i(e.volume, e.unit)
|
|
207
255
|
})
|
|
@@ -212,7 +260,7 @@ function A() {
|
|
|
212
260
|
align: "right",
|
|
213
261
|
hideOnMobile: !0,
|
|
214
262
|
sortValue: (e) => e.scheduledAt ?? "",
|
|
215
|
-
render: (e) => /* @__PURE__ */
|
|
263
|
+
render: (e) => /* @__PURE__ */ p("span", {
|
|
216
264
|
className: "text-text-tertiary",
|
|
217
265
|
children: n(e.scheduledAt)
|
|
218
266
|
})
|
|
@@ -221,7 +269,7 @@ function A() {
|
|
|
221
269
|
key: "document",
|
|
222
270
|
header: "Document",
|
|
223
271
|
hideOnMobile: !0,
|
|
224
|
-
render: (e) => e.document?.id ? /* @__PURE__ */
|
|
272
|
+
render: (e) => e.document?.id ? /* @__PURE__ */ p(ve, { fileId: e.document.id }) : /* @__PURE__ */ p("span", {
|
|
225
273
|
className: "text-text-tertiary",
|
|
226
274
|
children: "—"
|
|
227
275
|
})
|
|
@@ -231,104 +279,185 @@ function A() {
|
|
|
231
279
|
header: "",
|
|
232
280
|
align: "right",
|
|
233
281
|
render: (e) => {
|
|
234
|
-
let t = pe
|
|
235
|
-
return t.length === 0 && !n ? /* @__PURE__ */
|
|
282
|
+
let t = me(pe, e.status), n = fe.includes(e.status), i = Ve === e.id;
|
|
283
|
+
return t.length === 0 && !n ? /* @__PURE__ */ p("span", {
|
|
236
284
|
className: "text-text-tertiary",
|
|
237
285
|
children: "—"
|
|
238
|
-
}) : /* @__PURE__ */
|
|
286
|
+
}) : /* @__PURE__ */ m("div", {
|
|
239
287
|
className: "flex items-center justify-end gap-2",
|
|
240
|
-
children: [t.length > 0 && /* @__PURE__ */
|
|
288
|
+
children: [t.length > 0 && /* @__PURE__ */ m(v, {
|
|
241
289
|
value: e.status,
|
|
242
290
|
disabled: i,
|
|
243
291
|
onValueChange: (t) => {
|
|
244
|
-
t !== e.status && (
|
|
292
|
+
t !== e.status && (F(e.id), Ke.mutate({
|
|
245
293
|
id: e.id,
|
|
246
294
|
status: t
|
|
247
295
|
}, {
|
|
248
|
-
onSuccess: () =>
|
|
249
|
-
onError: (e) =>
|
|
250
|
-
onSettled: () =>
|
|
296
|
+
onSuccess: () => L.success("Shipment updated"),
|
|
297
|
+
onError: (e) => L.fromError(e),
|
|
298
|
+
onSettled: () => F(null)
|
|
251
299
|
}));
|
|
252
300
|
},
|
|
253
|
-
children: [/* @__PURE__ */
|
|
301
|
+
children: [/* @__PURE__ */ p(x, {
|
|
254
302
|
className: "h-8 w-36",
|
|
255
303
|
"aria-label": `Change status for shipment ${e.reference}`,
|
|
256
|
-
children: /* @__PURE__ */
|
|
257
|
-
}), /* @__PURE__ */
|
|
304
|
+
children: /* @__PURE__ */ p(S, { placeholder: r(e.status) })
|
|
305
|
+
}), /* @__PURE__ */ p(y, { children: t.map((e) => /* @__PURE__ */ p(b, {
|
|
258
306
|
value: e,
|
|
259
307
|
children: r(e)
|
|
260
308
|
}, e)) })]
|
|
261
|
-
}), n && /* @__PURE__ */ h
|
|
309
|
+
}), n && /* @__PURE__ */ m(h, {
|
|
262
310
|
size: "sm",
|
|
263
311
|
variant: "outline",
|
|
264
|
-
disabled:
|
|
265
|
-
onClick: () =>
|
|
266
|
-
onSuccess: () =>
|
|
267
|
-
onError: (e) =>
|
|
312
|
+
disabled: G.isPending || i,
|
|
313
|
+
onClick: () => G.mutate(e.id, {
|
|
314
|
+
onSuccess: () => L.success("Shipment delivered"),
|
|
315
|
+
onError: (e) => L.fromError(e)
|
|
268
316
|
}),
|
|
269
|
-
children: [/* @__PURE__ */
|
|
317
|
+
children: [/* @__PURE__ */ p(u, { className: "mr-1.5 h-4 w-4" }), " Mark delivered"]
|
|
270
318
|
})]
|
|
271
319
|
});
|
|
272
320
|
}
|
|
273
321
|
}
|
|
274
|
-
], $ =
|
|
275
|
-
return /* @__PURE__ */
|
|
322
|
+
], $ = T !== "ALL" || E !== "ALL";
|
|
323
|
+
return /* @__PURE__ */ m(e, {
|
|
276
324
|
title: "Shipments",
|
|
277
325
|
description: "Cargo movements delivering offtake contracts — pipelines, tankers, vessels, rail & grid.",
|
|
278
|
-
actions: /* @__PURE__ */ h
|
|
279
|
-
onClick: () =>
|
|
280
|
-
children: [/* @__PURE__ */
|
|
326
|
+
actions: /* @__PURE__ */ m(h, {
|
|
327
|
+
onClick: () => O(!0),
|
|
328
|
+
children: [/* @__PURE__ */ p(d, { className: "mr-1.5 h-4 w-4" }), " Schedule shipment"]
|
|
281
329
|
}),
|
|
282
330
|
children: [
|
|
283
|
-
/* @__PURE__ */
|
|
284
|
-
className: "mb-
|
|
331
|
+
/* @__PURE__ */ m("div", {
|
|
332
|
+
className: "mb-4 grid grid-cols-2 gap-4 lg:grid-cols-4",
|
|
285
333
|
children: [
|
|
286
|
-
/* @__PURE__ */
|
|
334
|
+
/* @__PURE__ */ p(t, {
|
|
287
335
|
featured: !0,
|
|
288
|
-
icon: /* @__PURE__ */
|
|
289
|
-
value:
|
|
336
|
+
icon: /* @__PURE__ */ p(f, { className: "h-5 w-5" }),
|
|
337
|
+
value: q.length,
|
|
290
338
|
label: "Total shipments"
|
|
291
339
|
}),
|
|
292
|
-
/* @__PURE__ */
|
|
293
|
-
icon: /* @__PURE__ */
|
|
294
|
-
value:
|
|
340
|
+
/* @__PURE__ */ p(t, {
|
|
341
|
+
icon: /* @__PURE__ */ p(be, { className: "h-5 w-5" }),
|
|
342
|
+
value: qe,
|
|
295
343
|
label: "Scheduled"
|
|
296
344
|
}),
|
|
297
|
-
/* @__PURE__ */
|
|
345
|
+
/* @__PURE__ */ p(t, {
|
|
298
346
|
accent: "warning",
|
|
299
|
-
icon: /* @__PURE__ */
|
|
300
|
-
value:
|
|
347
|
+
icon: /* @__PURE__ */ p(Se, { className: "h-5 w-5" }),
|
|
348
|
+
value: Je,
|
|
301
349
|
label: "In transit"
|
|
302
350
|
}),
|
|
303
|
-
/* @__PURE__ */
|
|
351
|
+
/* @__PURE__ */ p(t, {
|
|
304
352
|
accent: "success",
|
|
305
|
-
icon: /* @__PURE__ */
|
|
306
|
-
value:
|
|
353
|
+
icon: /* @__PURE__ */ p(u, { className: "h-5 w-5" }),
|
|
354
|
+
value: Ye,
|
|
307
355
|
label: "Delivered"
|
|
308
356
|
})
|
|
309
357
|
]
|
|
310
358
|
}),
|
|
311
|
-
/* @__PURE__ */
|
|
359
|
+
/* @__PURE__ */ m("div", {
|
|
360
|
+
className: "mb-6 grid grid-cols-1 gap-4 lg:grid-cols-2",
|
|
361
|
+
children: [/* @__PURE__ */ m("div", {
|
|
362
|
+
className: "flex flex-col gap-4 rounded-[var(--radius-card)] border border-border-subtle bg-bg-surface p-5 shadow-elevation-1",
|
|
363
|
+
children: [/* @__PURE__ */ m("div", {
|
|
364
|
+
className: "flex items-center justify-between gap-2",
|
|
365
|
+
children: [/* @__PURE__ */ p("h3", {
|
|
366
|
+
className: "text-sm font-semibold text-text-secondary",
|
|
367
|
+
children: "Status distribution"
|
|
368
|
+
}), /* @__PURE__ */ p(f, {
|
|
369
|
+
className: "h-4 w-4 shrink-0 text-text-muted",
|
|
370
|
+
"aria-hidden": "true"
|
|
371
|
+
})]
|
|
372
|
+
}), Y.length > 0 ? /* @__PURE__ */ p(ie, {
|
|
373
|
+
segments: Y,
|
|
374
|
+
height: 14,
|
|
375
|
+
label: "By status",
|
|
376
|
+
rightLabel: `${q.length} shipment${q.length === 1 ? "" : "s"}`
|
|
377
|
+
}) : /* @__PURE__ */ p("p", {
|
|
378
|
+
className: "py-6 text-sm text-text-tertiary",
|
|
379
|
+
children: "No shipments yet — schedule one to see the status mix."
|
|
380
|
+
})]
|
|
381
|
+
}), /* @__PURE__ */ m("div", {
|
|
382
|
+
className: "flex flex-col gap-3 rounded-[var(--radius-card)] border border-border-subtle bg-bg-surface p-5 shadow-elevation-1",
|
|
383
|
+
children: [/* @__PURE__ */ m("div", {
|
|
384
|
+
className: "flex items-center justify-between gap-2",
|
|
385
|
+
children: [/* @__PURE__ */ p("h3", {
|
|
386
|
+
className: "text-sm font-semibold text-text-secondary",
|
|
387
|
+
children: "Route flow"
|
|
388
|
+
}), /* @__PURE__ */ m("span", {
|
|
389
|
+
className: "inline-flex items-center gap-1.5 text-xs text-text-tertiary",
|
|
390
|
+
children: [
|
|
391
|
+
/* @__PURE__ */ p(xe, {
|
|
392
|
+
className: "h-3.5 w-3.5",
|
|
393
|
+
"aria-hidden": "true"
|
|
394
|
+
}),
|
|
395
|
+
Ze,
|
|
396
|
+
" lane",
|
|
397
|
+
Ze === 1 ? "" : "s"
|
|
398
|
+
]
|
|
399
|
+
})]
|
|
400
|
+
}), Z ? /* @__PURE__ */ m(Ce, { children: [
|
|
401
|
+
/* @__PURE__ */ m(v, {
|
|
402
|
+
value: Z.id,
|
|
403
|
+
onValueChange: He,
|
|
404
|
+
children: [/* @__PURE__ */ p(x, {
|
|
405
|
+
"aria-label": "Trace a shipment route",
|
|
406
|
+
children: /* @__PURE__ */ p(S, {})
|
|
407
|
+
}), /* @__PURE__ */ p(y, { children: X.map((e) => /* @__PURE__ */ m(b, {
|
|
408
|
+
value: e.id,
|
|
409
|
+
children: [
|
|
410
|
+
e.reference,
|
|
411
|
+
" · ",
|
|
412
|
+
(e.origin ?? "").trim(),
|
|
413
|
+
" → ",
|
|
414
|
+
(e.destination ?? "").trim()
|
|
415
|
+
]
|
|
416
|
+
}, e.id)) })]
|
|
417
|
+
}),
|
|
418
|
+
/* @__PURE__ */ p(ae, { steps: Le(Z) }),
|
|
419
|
+
/* @__PURE__ */ m("div", {
|
|
420
|
+
className: "flex flex-wrap items-center gap-x-3 gap-y-1.5 text-xs text-text-tertiary",
|
|
421
|
+
children: [
|
|
422
|
+
/* @__PURE__ */ p(o, { status: Z.status }),
|
|
423
|
+
/* @__PURE__ */ p("span", { children: r(Z.mode) }),
|
|
424
|
+
/* @__PURE__ */ p("span", {
|
|
425
|
+
className: "tabular-nums text-text-secondary",
|
|
426
|
+
children: i(Z.volume, Z.unit)
|
|
427
|
+
}),
|
|
428
|
+
Z.scheduledAt ? /* @__PURE__ */ m("span", {
|
|
429
|
+
className: "tabular-nums",
|
|
430
|
+
children: ["Sched ", n(Z.scheduledAt)]
|
|
431
|
+
}) : null
|
|
432
|
+
]
|
|
433
|
+
})
|
|
434
|
+
] }) : /* @__PURE__ */ p("p", {
|
|
435
|
+
className: "py-6 text-sm text-text-tertiary",
|
|
436
|
+
children: "Add an origin and destination to a shipment to trace its route."
|
|
437
|
+
})]
|
|
438
|
+
})]
|
|
439
|
+
}),
|
|
440
|
+
/* @__PURE__ */ m("div", {
|
|
312
441
|
className: "mb-5 flex flex-wrap items-center gap-3",
|
|
313
|
-
children: [/* @__PURE__ */
|
|
314
|
-
options:
|
|
315
|
-
value:
|
|
442
|
+
children: [/* @__PURE__ */ p(he, {
|
|
443
|
+
options: Xe,
|
|
444
|
+
value: T,
|
|
316
445
|
onChange: (e) => {
|
|
317
|
-
|
|
446
|
+
Re(e), D.reset();
|
|
318
447
|
}
|
|
319
|
-
}), /* @__PURE__ */
|
|
320
|
-
value:
|
|
448
|
+
}), /* @__PURE__ */ m(v, {
|
|
449
|
+
value: E,
|
|
321
450
|
onValueChange: (e) => {
|
|
322
|
-
|
|
451
|
+
ze(e), D.reset();
|
|
323
452
|
},
|
|
324
|
-
children: [/* @__PURE__ */
|
|
453
|
+
children: [/* @__PURE__ */ p(x, {
|
|
325
454
|
className: "w-56",
|
|
326
455
|
"aria-label": "Filter by contract",
|
|
327
|
-
children: /* @__PURE__ */
|
|
328
|
-
}), /* @__PURE__ */
|
|
456
|
+
children: /* @__PURE__ */ p(S, { placeholder: "All contracts" })
|
|
457
|
+
}), /* @__PURE__ */ m(y, { children: [/* @__PURE__ */ p(b, {
|
|
329
458
|
value: "ALL",
|
|
330
459
|
children: "All contracts"
|
|
331
|
-
}),
|
|
460
|
+
}), H.map((e) => /* @__PURE__ */ m(b, {
|
|
332
461
|
value: e.id,
|
|
333
462
|
children: [
|
|
334
463
|
e.reference,
|
|
@@ -338,68 +467,68 @@ function A() {
|
|
|
338
467
|
}, e.id))] })]
|
|
339
468
|
})]
|
|
340
469
|
}),
|
|
341
|
-
|
|
470
|
+
Ue ? /* @__PURE__ */ p(ne, { label: "Loading shipments…" }) : We ? /* @__PURE__ */ p(te, {
|
|
342
471
|
message: "Couldn't load shipments.",
|
|
343
|
-
onRetry: () =>
|
|
344
|
-
}) :
|
|
472
|
+
onRetry: () => Ge()
|
|
473
|
+
}) : K.length === 0 ? /* @__PURE__ */ p(re, {
|
|
345
474
|
illustration: "empty-data",
|
|
346
|
-
icon: /* @__PURE__ */
|
|
475
|
+
icon: /* @__PURE__ */ p(f, { className: "h-10 w-10" }),
|
|
347
476
|
title: $ ? "No matching shipments" : "No shipments yet",
|
|
348
477
|
description: $ ? "No shipments match these filters. Try a different status or contract." : "Schedule your first shipment to start tracking cargo against your offtake contracts.",
|
|
349
|
-
action: /* @__PURE__ */ h
|
|
350
|
-
onClick: () =>
|
|
351
|
-
children: [/* @__PURE__ */
|
|
478
|
+
action: /* @__PURE__ */ m(h, {
|
|
479
|
+
onClick: () => O(!0),
|
|
480
|
+
children: [/* @__PURE__ */ p(d, { className: "mr-1.5 h-4 w-4" }), " Schedule shipment"]
|
|
352
481
|
})
|
|
353
|
-
}) : /* @__PURE__ */
|
|
354
|
-
columns:
|
|
355
|
-
rows:
|
|
482
|
+
}) : /* @__PURE__ */ m(Ce, { children: [/* @__PURE__ */ p(ee, {
|
|
483
|
+
columns: $e,
|
|
484
|
+
rows: K,
|
|
356
485
|
rowKey: (e) => e.id,
|
|
357
486
|
defaultSort: {
|
|
358
487
|
key: "scheduledAt",
|
|
359
488
|
dir: "desc"
|
|
360
489
|
}
|
|
361
|
-
}), /* @__PURE__ */
|
|
362
|
-
page:
|
|
363
|
-
pageSize:
|
|
364
|
-
itemCount:
|
|
365
|
-
hasMore:
|
|
366
|
-
onPageChange:
|
|
490
|
+
}), /* @__PURE__ */ p(ge, {
|
|
491
|
+
page: D.page,
|
|
492
|
+
pageSize: C,
|
|
493
|
+
itemCount: K.length,
|
|
494
|
+
hasMore: z?.pageInfo?.hasMore ?? !1,
|
|
495
|
+
onPageChange: D.onPageChange
|
|
367
496
|
})] }),
|
|
368
|
-
/* @__PURE__ */
|
|
369
|
-
open:
|
|
497
|
+
/* @__PURE__ */ p(we, {
|
|
498
|
+
open: Be,
|
|
370
499
|
onOpenChange: (e) => {
|
|
371
|
-
|
|
500
|
+
O(e), e || Q();
|
|
372
501
|
},
|
|
373
|
-
children: /* @__PURE__ */
|
|
502
|
+
children: /* @__PURE__ */ m(Te, { children: [/* @__PURE__ */ m(Oe, { children: [/* @__PURE__ */ p(ke, { children: "Schedule shipment" }), /* @__PURE__ */ p(Ee, { children: "Book a cargo movement against an offtake contract and track it to delivery." })] }), /* @__PURE__ */ m("form", {
|
|
374
503
|
onSubmit: (e) => {
|
|
375
|
-
e.preventDefault(),
|
|
504
|
+
e.preventDefault(), Qe();
|
|
376
505
|
},
|
|
377
|
-
children: [/* @__PURE__ */
|
|
506
|
+
children: [/* @__PURE__ */ m("div", {
|
|
378
507
|
className: "grid gap-4 py-2",
|
|
379
508
|
children: [
|
|
380
|
-
/* @__PURE__ */
|
|
509
|
+
/* @__PURE__ */ m("div", {
|
|
381
510
|
className: "grid gap-1.5",
|
|
382
|
-
children: [/* @__PURE__ */
|
|
511
|
+
children: [/* @__PURE__ */ p(_, {
|
|
383
512
|
htmlFor: "shipContract",
|
|
384
513
|
children: "Contract *"
|
|
385
|
-
}), /* @__PURE__ */
|
|
386
|
-
value:
|
|
514
|
+
}), /* @__PURE__ */ m(v, {
|
|
515
|
+
value: k.contractId,
|
|
387
516
|
onValueChange: (e) => {
|
|
388
|
-
let t =
|
|
389
|
-
|
|
517
|
+
let t = U.get(e);
|
|
518
|
+
A((n) => ({
|
|
390
519
|
...n,
|
|
391
520
|
contractId: e,
|
|
392
521
|
unit: t?.unit ?? n.unit
|
|
393
522
|
}));
|
|
394
523
|
},
|
|
395
|
-
children: [/* @__PURE__ */
|
|
524
|
+
children: [/* @__PURE__ */ p(x, {
|
|
396
525
|
id: "shipContract",
|
|
397
|
-
children: /* @__PURE__ */
|
|
398
|
-
}), /* @__PURE__ */
|
|
526
|
+
children: /* @__PURE__ */ p(S, { placeholder: "Select a contract" })
|
|
527
|
+
}), /* @__PURE__ */ p(y, { children: H.length === 0 ? /* @__PURE__ */ p(b, {
|
|
399
528
|
value: "none",
|
|
400
529
|
disabled: !0,
|
|
401
530
|
children: "No contracts available"
|
|
402
|
-
}) :
|
|
531
|
+
}) : H.map((e) => /* @__PURE__ */ m(b, {
|
|
403
532
|
value: e.id,
|
|
404
533
|
children: [
|
|
405
534
|
e.reference,
|
|
@@ -409,187 +538,187 @@ function A() {
|
|
|
409
538
|
}, e.id)) })]
|
|
410
539
|
})]
|
|
411
540
|
}),
|
|
412
|
-
/* @__PURE__ */
|
|
541
|
+
/* @__PURE__ */ m("div", {
|
|
413
542
|
className: "grid gap-2 sm:grid-cols-2",
|
|
414
|
-
children: [/* @__PURE__ */
|
|
543
|
+
children: [/* @__PURE__ */ m("div", {
|
|
415
544
|
className: "grid gap-1.5",
|
|
416
|
-
children: [/* @__PURE__ */
|
|
545
|
+
children: [/* @__PURE__ */ p(_, {
|
|
417
546
|
htmlFor: "shipRef",
|
|
418
547
|
children: "Reference *"
|
|
419
|
-
}), /* @__PURE__ */
|
|
548
|
+
}), /* @__PURE__ */ p(g, {
|
|
420
549
|
id: "shipRef",
|
|
421
|
-
value:
|
|
422
|
-
onChange: (e) =>
|
|
423
|
-
...
|
|
550
|
+
value: k.reference,
|
|
551
|
+
onChange: (e) => A({
|
|
552
|
+
...k,
|
|
424
553
|
reference: e.target.value
|
|
425
554
|
}),
|
|
426
555
|
placeholder: "SHP-2026-0142"
|
|
427
556
|
})]
|
|
428
|
-
}), /* @__PURE__ */
|
|
557
|
+
}), /* @__PURE__ */ m("div", {
|
|
429
558
|
className: "grid gap-1.5",
|
|
430
|
-
children: [/* @__PURE__ */
|
|
559
|
+
children: [/* @__PURE__ */ p(_, {
|
|
431
560
|
htmlFor: "shipMode",
|
|
432
561
|
children: "Mode"
|
|
433
|
-
}), /* @__PURE__ */
|
|
434
|
-
value:
|
|
435
|
-
onValueChange: (e) =>
|
|
436
|
-
...
|
|
562
|
+
}), /* @__PURE__ */ m(v, {
|
|
563
|
+
value: k.mode,
|
|
564
|
+
onValueChange: (e) => A({
|
|
565
|
+
...k,
|
|
437
566
|
mode: e
|
|
438
567
|
}),
|
|
439
|
-
children: [/* @__PURE__ */
|
|
568
|
+
children: [/* @__PURE__ */ p(x, {
|
|
440
569
|
id: "shipMode",
|
|
441
|
-
children: /* @__PURE__ */
|
|
442
|
-
}), /* @__PURE__ */
|
|
570
|
+
children: /* @__PURE__ */ p(S, {})
|
|
571
|
+
}), /* @__PURE__ */ p(y, { children: Me.map((e) => /* @__PURE__ */ p(b, {
|
|
443
572
|
value: e,
|
|
444
573
|
children: r(e)
|
|
445
574
|
}, e)) })]
|
|
446
575
|
})]
|
|
447
576
|
})]
|
|
448
577
|
}),
|
|
449
|
-
/* @__PURE__ */
|
|
578
|
+
/* @__PURE__ */ m("div", {
|
|
450
579
|
className: "grid gap-2 sm:grid-cols-2",
|
|
451
|
-
children: [/* @__PURE__ */
|
|
580
|
+
children: [/* @__PURE__ */ m("div", {
|
|
452
581
|
className: "grid gap-1.5",
|
|
453
|
-
children: [/* @__PURE__ */
|
|
582
|
+
children: [/* @__PURE__ */ p(_, {
|
|
454
583
|
htmlFor: "shipOrigin",
|
|
455
584
|
children: "Origin"
|
|
456
|
-
}), /* @__PURE__ */
|
|
585
|
+
}), /* @__PURE__ */ p(g, {
|
|
457
586
|
id: "shipOrigin",
|
|
458
|
-
value:
|
|
459
|
-
onChange: (e) =>
|
|
460
|
-
...
|
|
587
|
+
value: k.origin,
|
|
588
|
+
onChange: (e) => A({
|
|
589
|
+
...k,
|
|
461
590
|
origin: e.target.value
|
|
462
591
|
}),
|
|
463
592
|
placeholder: "Ras Tanura Terminal"
|
|
464
593
|
})]
|
|
465
|
-
}), /* @__PURE__ */
|
|
594
|
+
}), /* @__PURE__ */ m("div", {
|
|
466
595
|
className: "grid gap-1.5",
|
|
467
|
-
children: [/* @__PURE__ */
|
|
596
|
+
children: [/* @__PURE__ */ p(_, {
|
|
468
597
|
htmlFor: "shipDest",
|
|
469
598
|
children: "Destination"
|
|
470
|
-
}), /* @__PURE__ */
|
|
599
|
+
}), /* @__PURE__ */ p(g, {
|
|
471
600
|
id: "shipDest",
|
|
472
|
-
value:
|
|
473
|
-
onChange: (e) =>
|
|
474
|
-
...
|
|
601
|
+
value: k.destination,
|
|
602
|
+
onChange: (e) => A({
|
|
603
|
+
...k,
|
|
475
604
|
destination: e.target.value
|
|
476
605
|
}),
|
|
477
606
|
placeholder: "Rotterdam"
|
|
478
607
|
})]
|
|
479
608
|
})]
|
|
480
609
|
}),
|
|
481
|
-
/* @__PURE__ */
|
|
610
|
+
/* @__PURE__ */ m("div", {
|
|
482
611
|
className: "grid gap-2 sm:grid-cols-3",
|
|
483
612
|
children: [
|
|
484
|
-
/* @__PURE__ */
|
|
613
|
+
/* @__PURE__ */ m("div", {
|
|
485
614
|
className: "grid gap-1.5",
|
|
486
|
-
children: [/* @__PURE__ */
|
|
615
|
+
children: [/* @__PURE__ */ p(_, {
|
|
487
616
|
htmlFor: "shipVolume",
|
|
488
617
|
children: "Volume *"
|
|
489
|
-
}), /* @__PURE__ */
|
|
618
|
+
}), /* @__PURE__ */ p(g, {
|
|
490
619
|
id: "shipVolume",
|
|
491
620
|
type: "number",
|
|
492
621
|
min: "0",
|
|
493
622
|
step: "any",
|
|
494
|
-
value:
|
|
495
|
-
onChange: (e) =>
|
|
496
|
-
...
|
|
623
|
+
value: k.volume,
|
|
624
|
+
onChange: (e) => A({
|
|
625
|
+
...k,
|
|
497
626
|
volume: e.target.value
|
|
498
627
|
}),
|
|
499
628
|
placeholder: "500000"
|
|
500
629
|
})]
|
|
501
630
|
}),
|
|
502
|
-
/* @__PURE__ */
|
|
631
|
+
/* @__PURE__ */ m("div", {
|
|
503
632
|
className: "grid gap-1.5",
|
|
504
|
-
children: [/* @__PURE__ */
|
|
633
|
+
children: [/* @__PURE__ */ p(_, {
|
|
505
634
|
htmlFor: "shipUnit",
|
|
506
635
|
children: "Unit"
|
|
507
|
-
}), /* @__PURE__ */
|
|
508
|
-
value:
|
|
509
|
-
onValueChange: (e) =>
|
|
510
|
-
...
|
|
636
|
+
}), /* @__PURE__ */ m(v, {
|
|
637
|
+
value: k.unit,
|
|
638
|
+
onValueChange: (e) => A({
|
|
639
|
+
...k,
|
|
511
640
|
unit: e
|
|
512
641
|
}),
|
|
513
|
-
children: [/* @__PURE__ */
|
|
642
|
+
children: [/* @__PURE__ */ p(x, {
|
|
514
643
|
id: "shipUnit",
|
|
515
|
-
children: /* @__PURE__ */
|
|
516
|
-
}), /* @__PURE__ */
|
|
644
|
+
children: /* @__PURE__ */ p(S, {})
|
|
645
|
+
}), /* @__PURE__ */ p(y, { children: Ne.map((e) => /* @__PURE__ */ p(b, {
|
|
517
646
|
value: e,
|
|
518
647
|
children: r(e)
|
|
519
648
|
}, e)) })]
|
|
520
649
|
})]
|
|
521
650
|
}),
|
|
522
|
-
/* @__PURE__ */
|
|
651
|
+
/* @__PURE__ */ m("div", {
|
|
523
652
|
className: "grid gap-1.5",
|
|
524
|
-
children: [/* @__PURE__ */
|
|
653
|
+
children: [/* @__PURE__ */ p(_, {
|
|
525
654
|
htmlFor: "shipScheduled",
|
|
526
655
|
children: "Scheduled date"
|
|
527
|
-
}), /* @__PURE__ */
|
|
656
|
+
}), /* @__PURE__ */ p(g, {
|
|
528
657
|
id: "shipScheduled",
|
|
529
658
|
type: "date",
|
|
530
|
-
value:
|
|
531
|
-
onChange: (e) =>
|
|
532
|
-
...
|
|
659
|
+
value: k.scheduledAt,
|
|
660
|
+
onChange: (e) => A({
|
|
661
|
+
...k,
|
|
533
662
|
scheduledAt: e.target.value
|
|
534
663
|
})
|
|
535
664
|
})]
|
|
536
665
|
})
|
|
537
666
|
]
|
|
538
667
|
}),
|
|
539
|
-
/* @__PURE__ */
|
|
668
|
+
/* @__PURE__ */ m("div", {
|
|
540
669
|
className: "grid gap-1.5",
|
|
541
|
-
children: [/* @__PURE__ */
|
|
670
|
+
children: [/* @__PURE__ */ p(_, {
|
|
542
671
|
htmlFor: "shipCarrier",
|
|
543
672
|
children: "Carrier"
|
|
544
|
-
}), /* @__PURE__ */
|
|
673
|
+
}), /* @__PURE__ */ p(g, {
|
|
545
674
|
id: "shipCarrier",
|
|
546
|
-
value:
|
|
547
|
-
onChange: (e) =>
|
|
548
|
-
...
|
|
675
|
+
value: k.carrier,
|
|
676
|
+
onChange: (e) => A({
|
|
677
|
+
...k,
|
|
549
678
|
carrier: e.target.value
|
|
550
679
|
}),
|
|
551
680
|
placeholder: "Frontline Ltd."
|
|
552
681
|
})]
|
|
553
682
|
}),
|
|
554
|
-
/* @__PURE__ */
|
|
683
|
+
/* @__PURE__ */ p(_e, {
|
|
555
684
|
id: "shipDocument",
|
|
556
685
|
label: "Bill of lading (optional)",
|
|
557
|
-
value:
|
|
558
|
-
onChange:
|
|
686
|
+
value: j,
|
|
687
|
+
onChange: M,
|
|
559
688
|
hint: "Attach the bill of lading or shipping document (PDF or image)."
|
|
560
689
|
}),
|
|
561
|
-
/* @__PURE__ */
|
|
690
|
+
/* @__PURE__ */ m("div", {
|
|
562
691
|
className: "grid gap-1.5",
|
|
563
|
-
children: [/* @__PURE__ */
|
|
692
|
+
children: [/* @__PURE__ */ p(_, {
|
|
564
693
|
htmlFor: "shipNotes",
|
|
565
694
|
children: "Notes"
|
|
566
|
-
}), /* @__PURE__ */
|
|
695
|
+
}), /* @__PURE__ */ p(Ae, {
|
|
567
696
|
id: "shipNotes",
|
|
568
|
-
value:
|
|
569
|
-
onChange: (e) =>
|
|
570
|
-
...
|
|
697
|
+
value: k.notes,
|
|
698
|
+
onChange: (e) => A({
|
|
699
|
+
...k,
|
|
571
700
|
notes: e.target.value
|
|
572
701
|
}),
|
|
573
702
|
placeholder: "Optional context — laycan window, inspector, terms.",
|
|
574
703
|
rows: 2
|
|
575
704
|
})]
|
|
576
705
|
}),
|
|
577
|
-
|
|
706
|
+
N && /* @__PURE__ */ p("p", {
|
|
578
707
|
className: "text-sm text-status-error-text",
|
|
579
|
-
children:
|
|
708
|
+
children: N
|
|
580
709
|
})
|
|
581
710
|
]
|
|
582
|
-
}), /* @__PURE__ */
|
|
711
|
+
}), /* @__PURE__ */ m(De, { children: [/* @__PURE__ */ p(h, {
|
|
583
712
|
type: "button",
|
|
584
713
|
variant: "outline",
|
|
585
714
|
onClick: () => {
|
|
586
|
-
|
|
715
|
+
O(!1), Q();
|
|
587
716
|
},
|
|
588
717
|
children: "Cancel"
|
|
589
|
-
}), /* @__PURE__ */
|
|
718
|
+
}), /* @__PURE__ */ p(h, {
|
|
590
719
|
type: "submit",
|
|
591
|
-
disabled:
|
|
592
|
-
children:
|
|
720
|
+
disabled: W.isPending,
|
|
721
|
+
children: W.isPending ? "Scheduling…" : "Schedule shipment"
|
|
593
722
|
})] })]
|
|
594
723
|
})] })
|
|
595
724
|
})
|
|
@@ -597,6 +726,6 @@ function A() {
|
|
|
597
726
|
});
|
|
598
727
|
}
|
|
599
728
|
//#endregion
|
|
600
|
-
export {
|
|
729
|
+
export { T as ShipmentsPage };
|
|
601
730
|
|
|
602
731
|
//# sourceMappingURL=ShipmentsPage.js.map
|