@burdenoff/microfe-movethewheels 2026.1107.6 → 2026.1108.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 (30) hide show
  1. package/dist/components/CarrierRecommendationDialog.js +21 -0
  2. package/dist/components/DispatchDecisionCard.js +111 -97
  3. package/dist/components/InventoryCoverPanel.js +401 -0
  4. package/dist/components/ShipmentDecisionPanel.js +362 -0
  5. package/dist/components/ShipmentRiskDialog.js +134 -89
  6. package/dist/generated/tracking-quality-operations.d.ts +288 -0
  7. package/dist/generated/wspace-types.d.ts +1645 -0
  8. package/dist/hooks/useInventoryCoverPlan.js +70 -0
  9. package/dist/hooks/useShipmentDecision.js +111 -0
  10. package/dist/movethewheels/components/CarrierRecommendationDialog.d.ts +20 -0
  11. package/dist/movethewheels/components/DispatchDecisionCard.d.ts +5 -1
  12. package/dist/movethewheels/components/InventoryCoverPanel.d.ts +24 -0
  13. package/dist/movethewheels/components/ShipmentDecisionPanel.d.ts +14 -0
  14. package/dist/movethewheels/hooks/useDispatchPlan.d.ts +1 -1
  15. package/dist/movethewheels/hooks/useInventoryCoverPlan.d.ts +80 -0
  16. package/dist/movethewheels/hooks/useShipmentDecision.d.ts +67 -0
  17. package/dist/pages/DispatchPlanPage.js +198 -171
  18. package/dist/pages/InventoryPage.js +219 -214
  19. package/package.json +1 -1
  20. package/src/generated/tracking-quality-operations.ts +321 -0
  21. package/src/generated/wspace-types.ts +1861 -0
  22. package/src/movethewheels/components/CarrierRecommendationDialog.tsx +54 -0
  23. package/src/movethewheels/components/DispatchDecisionCard.tsx +17 -2
  24. package/src/movethewheels/components/InventoryCoverPanel.tsx +449 -0
  25. package/src/movethewheels/components/ShipmentDecisionPanel.tsx +459 -0
  26. package/src/movethewheels/components/ShipmentRiskDialog.tsx +67 -1
  27. package/src/movethewheels/hooks/useInventoryCoverPlan.ts +250 -0
  28. package/src/movethewheels/hooks/useShipmentDecision.ts +318 -0
  29. package/src/movethewheels/pages/DispatchPlanPage.tsx +30 -1
  30. package/src/movethewheels/pages/InventoryPage.tsx +8 -0
@@ -1,70 +1,72 @@
1
- import { LoaderCircle as e } from "../node_modules/lucide-react/dist/esm/icons/loader-circle.js";
2
- import { Navigation as t } from "../node_modules/lucide-react/dist/esm/icons/navigation.js";
3
- import { Plus as n } from "../node_modules/lucide-react/dist/esm/icons/plus.js";
4
- import { RefreshCw as r } from "../node_modules/lucide-react/dist/esm/icons/refresh-cw.js";
1
+ import { Building2 as e } from "../node_modules/lucide-react/dist/esm/icons/building-2.js";
2
+ import { LoaderCircle as t } from "../node_modules/lucide-react/dist/esm/icons/loader-circle.js";
3
+ import { Navigation as n } from "../node_modules/lucide-react/dist/esm/icons/navigation.js";
4
+ import { Plus as r } from "../node_modules/lucide-react/dist/esm/icons/plus.js";
5
+ import { RefreshCw as ee } from "../node_modules/lucide-react/dist/esm/icons/refresh-cw.js";
5
6
  import { Sparkles as i } from "../node_modules/lucide-react/dist/esm/icons/sparkles.js";
6
7
  import { WandSparkles as a } from "../node_modules/lucide-react/dist/esm/icons/wand-sparkles.js";
7
- import { joinPath as o } from "../utils/navigation.js";
8
- import { useMoveTheWheels as s } from "../providers/MoveTheWheelsProvider.js";
9
- import { formatDateTime as c } from "../utils/formatters.js";
10
- import { Badge as l, Button as u, Card as d, CardContent as f, CardHeader as p, CardTitle as m, Select as h, SelectContent as g, SelectItem as _, SelectTrigger as v, SelectValue as y, Skeleton as b } from "../components/ui.js";
11
- import { PageLayout as ee } from "../components/PageLayout.js";
12
- import { FormError as te } from "../components/FormError.js";
13
- import { Notice as x, useNotice as S } from "../components/Notice.js";
14
- import { DispatchDecisionCard as C } from "../components/DispatchDecisionCard.js";
15
- import { useDispatchPlan as ne } from "../hooks/useDispatchPlan.js";
16
- import { useEffect as re, useMemo as w, useState as T } from "react";
17
- import { Fragment as E, jsx as D, jsxs as O } from "react/jsx-runtime";
18
- import { useI18n as ie } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
19
- import { CTAOverflowMenu as ae, EmphasisPanel as k, PagePurpose as A } from "@burdenoff/fe-libs/ui";
8
+ import { joinPath as te } from "../utils/navigation.js";
9
+ import { useMoveTheWheels as o } from "../providers/MoveTheWheelsProvider.js";
10
+ import { formatDateTime as s } from "../utils/formatters.js";
11
+ import { Badge as c, Button as l, Card as u, CardContent as d, CardHeader as f, CardTitle as p, Select as ne, SelectContent as re, SelectItem as m, SelectTrigger as h, SelectValue as g, Skeleton as _ } from "../components/ui.js";
12
+ import { PageLayout as v } from "../components/PageLayout.js";
13
+ import { FormError as y } from "../components/FormError.js";
14
+ import { Notice as b, useNotice as x } from "../components/Notice.js";
15
+ import { DispatchDecisionCard as S } from "../components/DispatchDecisionCard.js";
16
+ import { CarrierRecommendationDialog as C } from "../components/CarrierRecommendationDialog.js";
17
+ import { useDispatchPlan as ie } from "../hooks/useDispatchPlan.js";
18
+ import { useEffect as ae, useMemo as oe, useState as w } from "react";
19
+ import { Fragment as se, jsx as T, jsxs as E } from "react/jsx-runtime";
20
+ import { useI18n as ce } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
21
+ import { CTAOverflowMenu as D, EmphasisPanel as O, PagePurpose as k } from "@burdenoff/fe-libs/ui";
20
22
  //#region src/movethewheels/pages/DispatchPlanPage.tsx
21
- var j = {
23
+ var A = {
22
24
  "24h": 24,
23
25
  "72h": 72,
24
26
  "7d": 168
25
- }, M = {
27
+ }, j = {
26
28
  PROPOSED: ["movethewheels.dispatch.status.proposed", "Waiting for your decision"],
27
29
  APPLYING: ["movethewheels.dispatch.status.applying", "Applying decisions"],
28
30
  APPLIED: ["movethewheels.dispatch.status.applied", "All accepted"],
29
31
  PARTIALLY_APPLIED: ["movethewheels.dispatch.status.partiallyApplied", "Partly accepted"],
30
32
  REJECTED: ["movethewheels.dispatch.status.rejected", "Rejected — nothing written"],
31
33
  EXPIRED: ["movethewheels.dispatch.status.expired", "Expired"]
32
- }, N = {
34
+ }, M = {
33
35
  NOT_NEEDED: ["movethewheels.dispatch.ai.notNeeded", "Nothing could be assigned, so there was nothing for AI to explain."],
34
36
  AI_DISABLED: ["movethewheels.dispatch.ai.disabled", "AI explanations are switched off. The rule-based rationale below is complete."],
35
37
  CREDITS_EXHAUSTED: ["movethewheels.dispatch.ai.creditsExhausted", "This workspace has used its MoveTheWheels AI credits, so no AI explanation was written. The proposal and its rule-based rationale are unaffected."],
36
38
  DAILY_CAP_REACHED: ["movethewheels.dispatch.ai.dailyCap", "Today's AI explanation limit is reached. The proposal and its rule-based rationale are unaffected."],
37
39
  UNAVAILABLE: ["movethewheels.dispatch.ai.unavailable", "The AI explanation could not be produced this time. The proposal and its rule-based rationale are unaffected."]
38
- }, P = {
40
+ }, N = {
39
41
  NO_ELIGIBLE_PAIR: ["movethewheels.dispatch.unassigned.noPair", "No linked vehicle and driver are free (vehicle active and not on a live route, driver with a valid licence)."],
40
42
  FLEET_FULLY_ASSIGNED: ["movethewheels.dispatch.unassigned.fleetFull", "Every free vehicle and driver pair is already used in this plan."],
41
43
  OVER_CAPACITY: ["movethewheels.dispatch.unassigned.overCapacity", "The load is heavier than every free vehicle’s recorded capacity."],
42
44
  PLAN_LIMIT_REACHED: ["movethewheels.dispatch.unassigned.limit", "The plan reached its assignment limit."],
43
45
  NOT_PLANNABLE: ["movethewheels.dispatch.unassigned.notPlannable", "Not a planned shipment without a route."]
44
46
  };
45
- function F(e) {
46
- return e === "all" ? {} : { to: new Date(Date.now() + j[e] * 36e5).toISOString() };
47
+ function P(e) {
48
+ return e === "all" ? {} : { to: new Date(Date.now() + A[e] * 36e5).toISOString() };
47
49
  }
48
- function I({ plan: e, t }) {
49
- let [n, r] = M[e.status];
50
- return /* @__PURE__ */ O(k, { children: [/* @__PURE__ */ O("div", {
50
+ function F({ plan: e, t }) {
51
+ let [n, r] = j[e.status];
52
+ return /* @__PURE__ */ E(O, { children: [/* @__PURE__ */ E("div", {
51
53
  className: "flex flex-wrap items-center justify-between gap-3",
52
- children: [/* @__PURE__ */ O("div", {
54
+ children: [/* @__PURE__ */ E("div", {
53
55
  className: "space-y-1",
54
- children: [/* @__PURE__ */ O("p", {
56
+ children: [/* @__PURE__ */ E("p", {
55
57
  className: "text-sm font-medium text-text-secondary",
56
58
  children: [
57
59
  t("movethewheels.dispatch.planLabel", "Latest proposal"),
58
60
  " ·",
59
61
  " ",
60
- c(e.createdAt)
62
+ s(e.createdAt)
61
63
  ]
62
- }), /* @__PURE__ */ O("div", {
64
+ }), /* @__PURE__ */ E("div", {
63
65
  className: "flex flex-wrap items-center gap-2",
64
- children: [/* @__PURE__ */ D(l, {
66
+ children: [/* @__PURE__ */ T(c, {
65
67
  variant: e.status === "PROPOSED" ? "default" : "secondary",
66
68
  children: t(n, r)
67
- }), /* @__PURE__ */ O("span", {
69
+ }), /* @__PURE__ */ E("span", {
68
70
  className: "text-xs text-text-secondary",
69
71
  children: [
70
72
  t("movethewheels.dispatch.method", "Rule-based planner"),
@@ -74,301 +76,326 @@ function I({ plan: e, t }) {
74
76
  ]
75
77
  })]
76
78
  })]
77
- }), /* @__PURE__ */ O("div", {
79
+ }), /* @__PURE__ */ E("div", {
78
80
  className: "grid grid-cols-3 gap-4 text-center",
79
81
  children: [
80
- /* @__PURE__ */ O("div", { children: [/* @__PURE__ */ D("p", {
82
+ /* @__PURE__ */ E("div", { children: [/* @__PURE__ */ T("p", {
81
83
  className: "text-2xl font-bold tabular-nums text-text-primary",
82
84
  children: e.assignments.length
83
- }), /* @__PURE__ */ D("p", {
85
+ }), /* @__PURE__ */ T("p", {
84
86
  className: "text-xs text-text-secondary",
85
87
  children: t("movethewheels.dispatch.proposed", "Proposed")
86
88
  })] }),
87
- /* @__PURE__ */ O("div", { children: [/* @__PURE__ */ D("p", {
89
+ /* @__PURE__ */ E("div", { children: [/* @__PURE__ */ T("p", {
88
90
  className: "text-2xl font-bold tabular-nums text-text-primary",
89
91
  children: e.acceptedCount
90
- }), /* @__PURE__ */ D("p", {
92
+ }), /* @__PURE__ */ T("p", {
91
93
  className: "text-xs text-text-secondary",
92
94
  children: t("movethewheels.dispatch.acceptedCount", "Accepted")
93
95
  })] }),
94
- /* @__PURE__ */ O("div", { children: [/* @__PURE__ */ D("p", {
96
+ /* @__PURE__ */ E("div", { children: [/* @__PURE__ */ T("p", {
95
97
  className: "text-2xl font-bold tabular-nums text-text-primary",
96
98
  children: e.unassigned.length
97
- }), /* @__PURE__ */ D("p", {
99
+ }), /* @__PURE__ */ T("p", {
98
100
  className: "text-xs text-text-secondary",
99
101
  children: t("movethewheels.dispatch.unassignedCount", "Unassigned")
100
102
  })] })
101
103
  ]
102
104
  })]
103
- }), e.status === "PROPOSED" && /* @__PURE__ */ O("p", {
105
+ }), e.status === "PROPOSED" && /* @__PURE__ */ E("p", {
104
106
  className: "mt-3 text-xs text-text-secondary",
105
107
  children: [
106
108
  t("movethewheels.dispatch.expires", "Valid until"),
107
109
  " ",
108
- c(e.expiresAt)
110
+ s(e.expiresAt)
109
111
  ]
110
112
  })] });
111
113
  }
112
- function L({ plan: e, t }) {
113
- if (e.aiStatus === "AVAILABLE" && e.aiSummary) return /* @__PURE__ */ O(d, { children: [/* @__PURE__ */ D(p, { children: /* @__PURE__ */ O(m, {
114
+ function I({ plan: e, t }) {
115
+ if (e.aiStatus === "AVAILABLE" && e.aiSummary) return /* @__PURE__ */ E(u, { children: [/* @__PURE__ */ T(f, { children: /* @__PURE__ */ E(p, {
114
116
  className: "flex items-center gap-2 text-base",
115
- children: [/* @__PURE__ */ D(i, {
117
+ children: [/* @__PURE__ */ T(i, {
116
118
  size: 16,
117
119
  "aria-hidden": "true"
118
120
  }), t("movethewheels.dispatch.ai.title", "AI summary")]
119
- }) }), /* @__PURE__ */ O(f, {
121
+ }) }), /* @__PURE__ */ E(d, {
120
122
  className: "space-y-2",
121
- children: [/* @__PURE__ */ D("p", {
123
+ children: [/* @__PURE__ */ T("p", {
122
124
  className: "text-sm text-text-primary",
123
125
  children: e.aiSummary
124
- }), /* @__PURE__ */ O("p", {
126
+ }), /* @__PURE__ */ E("p", {
125
127
  className: "text-xs text-text-secondary",
126
128
  children: [t("movethewheels.dispatch.ai.disclaimer", "Written by AI from the planner’s facts. It never changes an assignment; check before accepting."), e.aiModel ? ` (${e.aiModel})` : ""]
127
129
  })]
128
130
  })] });
129
- let [n, r] = N[e.aiStatus === "AVAILABLE" ? "UNAVAILABLE" : e.aiStatus];
130
- return /* @__PURE__ */ D("div", {
131
+ let [n, r] = M[e.aiStatus === "AVAILABLE" ? "UNAVAILABLE" : e.aiStatus];
132
+ return /* @__PURE__ */ T("div", {
131
133
  role: "status",
132
134
  className: "rounded-lg border border-status-info-border bg-status-info-bg-subtle px-4 py-3 text-sm text-status-info-text",
133
135
  children: t(n, r)
134
136
  });
135
137
  }
136
- function R() {
137
- let { t: i } = ie(), c = (e, t) => {
138
+ function L() {
139
+ let { t: i } = ce(), s = (e, t) => {
138
140
  let n = i(e);
139
141
  return n === e ? t : n;
140
- }, { basePath: l, navigate: k } = s(), j = (e) => k?.(o(l, e)), { plan: M, isLoading: N, error: R, pendingAction: z, refetch: B, propose: V, apply: H, reject: U } = ne(), [W, G] = T("72h"), [K, q] = T({}), [oe, J] = T(null), { message: se, notify: ce } = S(6e3);
141
- re(() => {
142
- q({});
143
- }, [M?.id, M?.status]);
144
- let Y = M?.status === "PROPOSED", X = z !== null, Z = w(() => M ? M.assignments.filter((e) => K[e.id] === "accept").map((e) => e.id) : [], [M, K]), le = M ? M.assignments.filter((e) => e.decision === "PENDING" && !K[e.id]).length : 0, Q = async (e, t) => {
145
- J(null);
142
+ }, { basePath: c, navigate: O } = o(), A = (e) => O?.(te(c, e)), { plan: j, isLoading: M, error: L, pendingAction: R, refetch: z, propose: B, apply: V, reject: H } = ie(), [U, le] = w("72h"), [W, G] = w({}), [ue, K] = w(null), [de, q] = w(null), { message: fe, notify: J } = x(6e3);
143
+ ae(() => {
144
+ G({});
145
+ }, [j?.id, j?.status]);
146
+ let Y = j?.status === "PROPOSED", X = R !== null, Z = oe(() => j ? j.assignments.filter((e) => W[e.id] === "accept").map((e) => e.id) : [], [j, W]), pe = j ? j.assignments.filter((e) => e.decision === "PENDING" && !W[e.id]).length : 0, Q = async (e, t) => {
147
+ K(null);
146
148
  try {
147
- ce(t(await e()));
149
+ J(t(await e()));
148
150
  } catch (e) {
149
- J(e instanceof Error ? e.message : "The request failed.");
151
+ K(e instanceof Error ? e.message : "The request failed.");
150
152
  }
151
- }, ue = () => Q(() => V(F(W)), (e) => e.assignments.length > 0 ? c("movethewheels.dispatch.notice.proposed", "New proposal ready. Nothing is written until you accept.") : c("movethewheels.dispatch.notice.proposedEmpty", "No shipment could be assigned right now.")), de = () => M && Q(() => H(M.id, Z), (e) => `${c("movethewheels.dispatch.notice.applied", "Decisions applied. Routes created")}: ${e.acceptedCount}`), fe = () => M && Q(() => U(M.id), () => c("movethewheels.dispatch.notice.rejected", "Proposal rejected. Nothing was written.")), $ = (e) => M && q(Object.fromEntries(M.assignments.map((t) => [t.id, e])));
152
- return /* @__PURE__ */ O(ee, {
153
- title: c("movethewheels.dispatch.title", "Dispatch planner"),
154
- subtitle: c("movethewheels.dispatch.subtitle", "Proposed vehicle and driver assignments for planned shipments — you decide what becomes a route."),
155
- icon: /* @__PURE__ */ D(a, {
153
+ }, me = () => Q(() => B(P(U)), (e) => e.assignments.length > 0 ? s("movethewheels.dispatch.notice.proposed", "New proposal ready. Nothing is written until you accept.") : s("movethewheels.dispatch.notice.proposedEmpty", "No shipment could be assigned right now.")), he = () => j && Q(() => V(j.id, Z), (e) => `${s("movethewheels.dispatch.notice.applied", "Decisions applied. Routes created")}: ${e.acceptedCount}`), ge = () => j && Q(() => H(j.id), () => s("movethewheels.dispatch.notice.rejected", "Proposal rejected. Nothing was written.")), $ = (e) => j && G(Object.fromEntries(j.assignments.map((t) => [t.id, e])));
154
+ return /* @__PURE__ */ E(v, {
155
+ title: s("movethewheels.dispatch.title", "Dispatch planner"),
156
+ subtitle: s("movethewheels.dispatch.subtitle", "Proposed vehicle and driver assignments for planned shipments — you decide what becomes a route."),
157
+ icon: /* @__PURE__ */ T(a, {
156
158
  size: 24,
157
159
  "aria-hidden": "true"
158
160
  }),
159
- headerActions: /* @__PURE__ */ D(ae, {
161
+ headerActions: /* @__PURE__ */ T(D, {
160
162
  primary: {
161
- label: c("movethewheels.dispatch.manual", "Create route manually"),
162
- icon: /* @__PURE__ */ D(n, { size: 16 }),
163
- onSelect: () => j("routes/new")
163
+ label: s("movethewheels.dispatch.manual", "Create route manually"),
164
+ icon: /* @__PURE__ */ T(r, { size: 16 }),
165
+ onSelect: () => A("routes/new")
164
166
  },
165
167
  actions: [{
166
- label: c("movethewheels.dispatch.allRoutes", "All routes"),
167
- icon: /* @__PURE__ */ D(t, { size: 16 }),
168
- onSelect: () => j("routes")
168
+ label: s("movethewheels.dispatch.allRoutes", "All routes"),
169
+ icon: /* @__PURE__ */ T(n, { size: 16 }),
170
+ onSelect: () => A("routes")
169
171
  }, {
170
- label: c("movethewheels.dispatch.refresh", "Refresh"),
171
- icon: /* @__PURE__ */ D(r, { size: 16 }),
172
- onSelect: () => B()
172
+ label: s("movethewheels.dispatch.refresh", "Refresh"),
173
+ icon: /* @__PURE__ */ T(ee, { size: 16 }),
174
+ onSelect: () => z()
173
175
  }]
174
176
  }),
175
177
  children: [
176
- /* @__PURE__ */ D(A, {
177
- icon: /* @__PURE__ */ D(a, { size: 18 }),
178
- children: c("movethewheels.dispatch.purpose", "The planner pairs each planned shipment that has no route with a free, linked vehicle and driver, earliest due first, and explains why. Proposing writes nothing. Accept the cards you agree with and apply: each accepted card becomes a planned route, checked again at that moment; everything else is rejected.")
178
+ /* @__PURE__ */ T(k, {
179
+ icon: /* @__PURE__ */ T(a, { size: 18 }),
180
+ children: s("movethewheels.dispatch.purpose", "The planner pairs each planned shipment that has no route with a free, linked vehicle and driver, earliest due first, and explains why. Proposing writes nothing. Accept the cards you agree with and apply: each accepted card becomes a planned route, checked again at that moment; everything else is rejected.")
179
181
  }),
180
- /* @__PURE__ */ D(d, { children: /* @__PURE__ */ O(f, {
182
+ /* @__PURE__ */ T(u, { children: /* @__PURE__ */ E(d, {
181
183
  className: "flex flex-wrap items-center gap-3 p-4",
182
184
  children: [
183
- /* @__PURE__ */ D("span", {
185
+ /* @__PURE__ */ T("span", {
184
186
  className: "text-sm font-medium",
185
- children: c("movethewheels.dispatch.horizon", "Shipments due within")
187
+ children: s("movethewheels.dispatch.horizon", "Shipments due within")
186
188
  }),
187
- /* @__PURE__ */ O(h, {
188
- value: W,
189
- onValueChange: (e) => G(e),
190
- children: [/* @__PURE__ */ D(v, {
189
+ /* @__PURE__ */ E(ne, {
190
+ value: U,
191
+ onValueChange: (e) => le(e),
192
+ children: [/* @__PURE__ */ T(h, {
191
193
  className: "w-[180px]",
192
- "aria-label": c("movethewheels.dispatch.horizon", "Shipments due within"),
193
- children: /* @__PURE__ */ D(y, {})
194
- }), /* @__PURE__ */ O(g, { children: [
195
- /* @__PURE__ */ D(_, {
194
+ "aria-label": s("movethewheels.dispatch.horizon", "Shipments due within"),
195
+ children: /* @__PURE__ */ T(g, {})
196
+ }), /* @__PURE__ */ E(re, { children: [
197
+ /* @__PURE__ */ T(m, {
196
198
  value: "24h",
197
- children: c("movethewheels.dispatch.horizon.24h", "Next 24 hours")
199
+ children: s("movethewheels.dispatch.horizon.24h", "Next 24 hours")
198
200
  }),
199
- /* @__PURE__ */ D(_, {
201
+ /* @__PURE__ */ T(m, {
200
202
  value: "72h",
201
- children: c("movethewheels.dispatch.horizon.72h", "Next 3 days")
203
+ children: s("movethewheels.dispatch.horizon.72h", "Next 3 days")
202
204
  }),
203
- /* @__PURE__ */ D(_, {
205
+ /* @__PURE__ */ T(m, {
204
206
  value: "7d",
205
- children: c("movethewheels.dispatch.horizon.7d", "Next 7 days")
207
+ children: s("movethewheels.dispatch.horizon.7d", "Next 7 days")
206
208
  }),
207
- /* @__PURE__ */ D(_, {
209
+ /* @__PURE__ */ T(m, {
208
210
  value: "all",
209
- children: c("movethewheels.dispatch.horizon.all", "Any due date")
211
+ children: s("movethewheels.dispatch.horizon.all", "Any due date")
210
212
  })
211
213
  ] })]
212
214
  }),
213
- /* @__PURE__ */ O(u, {
214
- onClick: ue,
215
+ /* @__PURE__ */ E(l, {
216
+ onClick: me,
215
217
  disabled: X,
216
- children: [z === "propose" ? /* @__PURE__ */ D(e, {
218
+ children: [R === "propose" ? /* @__PURE__ */ T(t, {
217
219
  size: 16,
218
220
  className: "animate-spin",
219
221
  "aria-hidden": "true"
220
- }) : /* @__PURE__ */ D(a, {
222
+ }) : /* @__PURE__ */ T(a, {
221
223
  size: 16,
222
224
  "aria-hidden": "true"
223
- }), z === "propose" ? c("movethewheels.dispatch.proposing", "Proposing…") : c("movethewheels.dispatch.propose", "Propose assignments")]
225
+ }), R === "propose" ? s("movethewheels.dispatch.proposing", "Proposing…") : s("movethewheels.dispatch.propose", "Propose assignments")]
224
226
  }),
225
- /* @__PURE__ */ D("span", {
227
+ /* @__PURE__ */ T("span", {
226
228
  className: "text-xs text-text-secondary",
227
- children: c("movethewheels.dispatch.noUndatedNote", "Shipments without a due date are always included.")
229
+ children: s("movethewheels.dispatch.noUndatedNote", "Shipments without a due date are always included.")
228
230
  })
229
231
  ]
230
232
  }) }),
231
- /* @__PURE__ */ D(x, { message: se }),
232
- /* @__PURE__ */ D(te, { message: oe }),
233
- N && !M ? /* @__PURE__ */ O("div", {
233
+ /* @__PURE__ */ T(b, { message: fe }),
234
+ /* @__PURE__ */ T(y, { message: ue }),
235
+ M && !j ? /* @__PURE__ */ E("div", {
234
236
  className: "space-y-3",
235
- children: [/* @__PURE__ */ D(b, { className: "h-24 w-full" }), /* @__PURE__ */ D(b, { className: "h-40 w-full" })]
236
- }) : R ? /* @__PURE__ */ D(d, {
237
+ children: [/* @__PURE__ */ T(_, { className: "h-24 w-full" }), /* @__PURE__ */ T(_, { className: "h-40 w-full" })]
238
+ }) : L ? /* @__PURE__ */ T(u, {
237
239
  className: "border-status-error-border",
238
- children: /* @__PURE__ */ O(f, {
240
+ children: /* @__PURE__ */ E(d, {
239
241
  className: "space-y-3 p-6 text-center",
240
242
  children: [
241
- /* @__PURE__ */ D("p", {
243
+ /* @__PURE__ */ T("p", {
242
244
  className: "font-medium text-status-error-text",
243
- children: c("movethewheels.dispatch.loadError", "Couldn't load the dispatch plan")
245
+ children: s("movethewheels.dispatch.loadError", "Couldn't load the dispatch plan")
244
246
  }),
245
- /* @__PURE__ */ D("p", {
247
+ /* @__PURE__ */ T("p", {
246
248
  className: "text-sm text-text-secondary",
247
- children: R.message
249
+ children: L.message
248
250
  }),
249
- /* @__PURE__ */ D(u, {
251
+ /* @__PURE__ */ T(l, {
250
252
  variant: "outline",
251
- onClick: B,
252
- children: c("movethewheels.fleet.error.retry", "Retry")
253
+ onClick: z,
254
+ children: s("movethewheels.fleet.error.retry", "Retry")
253
255
  })
254
256
  ]
255
257
  })
256
- }) : M ? /* @__PURE__ */ O(E, { children: [
257
- /* @__PURE__ */ D(I, {
258
- plan: M,
259
- t: c
258
+ }) : j ? /* @__PURE__ */ E(se, { children: [
259
+ /* @__PURE__ */ T(F, {
260
+ plan: j,
261
+ t: s
260
262
  }),
261
- /* @__PURE__ */ D(L, {
262
- plan: M,
263
- t: c
263
+ /* @__PURE__ */ T(I, {
264
+ plan: j,
265
+ t: s
264
266
  }),
265
- Y && M.assignments.length > 0 && /* @__PURE__ */ D(d, { children: /* @__PURE__ */ O(f, {
267
+ Y && j.assignments.length > 0 && /* @__PURE__ */ T(u, { children: /* @__PURE__ */ E(d, {
266
268
  className: "flex flex-wrap items-center justify-between gap-3 p-4",
267
- children: [/* @__PURE__ */ O("div", {
269
+ children: [/* @__PURE__ */ E("div", {
268
270
  className: "space-y-1",
269
- children: [/* @__PURE__ */ O("p", {
271
+ children: [/* @__PURE__ */ E("p", {
270
272
  className: "text-sm font-medium text-text-primary",
271
273
  "aria-live": "polite",
272
274
  children: [
273
275
  Z.length,
274
276
  " ",
275
- c("movethewheels.dispatch.toAccept", "to accept"),
277
+ s("movethewheels.dispatch.toAccept", "to accept"),
276
278
  " ·",
277
279
  " ",
278
- M.assignments.length - Z.length,
280
+ j.assignments.length - Z.length,
279
281
  " ",
280
- c("movethewheels.dispatch.toReject", "to reject")
282
+ s("movethewheels.dispatch.toReject", "to reject")
281
283
  ]
282
- }), le > 0 && /* @__PURE__ */ D("p", {
284
+ }), pe > 0 && /* @__PURE__ */ T("p", {
283
285
  className: "text-xs text-text-secondary",
284
- children: c("movethewheels.dispatch.undecidedNote", "Cards you have not accepted are rejected when you apply.")
286
+ children: s("movethewheels.dispatch.undecidedNote", "Cards you have not accepted are rejected when you apply.")
285
287
  })]
286
- }), /* @__PURE__ */ O("div", {
288
+ }), /* @__PURE__ */ E("div", {
287
289
  className: "flex flex-wrap gap-2",
288
290
  children: [
289
- /* @__PURE__ */ D(u, {
291
+ /* @__PURE__ */ T(l, {
290
292
  variant: "ghost",
291
293
  size: "sm",
292
294
  disabled: X,
293
295
  onClick: () => $("accept"),
294
- children: c("movethewheels.dispatch.acceptAll", "Accept all")
296
+ children: s("movethewheels.dispatch.acceptAll", "Accept all")
295
297
  }),
296
- /* @__PURE__ */ D(u, {
298
+ /* @__PURE__ */ T(l, {
297
299
  variant: "ghost",
298
300
  size: "sm",
299
301
  disabled: X,
300
302
  onClick: () => $(null),
301
- children: c("movethewheels.dispatch.clear", "Clear")
303
+ children: s("movethewheels.dispatch.clear", "Clear")
302
304
  }),
303
- /* @__PURE__ */ O(u, {
305
+ /* @__PURE__ */ E(l, {
304
306
  variant: "outline",
305
307
  disabled: X,
306
- onClick: fe,
307
- children: [z === "reject" && /* @__PURE__ */ D(e, {
308
+ onClick: ge,
309
+ children: [R === "reject" && /* @__PURE__ */ T(t, {
308
310
  size: 16,
309
311
  className: "animate-spin",
310
312
  "aria-hidden": "true"
311
- }), c("movethewheels.dispatch.rejectPlan", "Reject proposal")]
313
+ }), s("movethewheels.dispatch.rejectPlan", "Reject proposal")]
312
314
  }),
313
- /* @__PURE__ */ O(u, {
315
+ /* @__PURE__ */ E(l, {
314
316
  disabled: X || Z.length === 0,
315
- onClick: de,
316
- children: [z === "apply" && /* @__PURE__ */ D(e, {
317
+ onClick: he,
318
+ children: [R === "apply" && /* @__PURE__ */ T(t, {
317
319
  size: 16,
318
320
  className: "animate-spin",
319
321
  "aria-hidden": "true"
320
- }), z === "apply" ? c("movethewheels.dispatch.applying", "Creating routes…") : c("movethewheels.dispatch.apply", "Apply decisions")]
322
+ }), R === "apply" ? s("movethewheels.dispatch.applying", "Creating routes…") : s("movethewheels.dispatch.apply", "Apply decisions")]
321
323
  })
322
324
  ]
323
325
  })]
324
326
  }) }),
325
- M.assignments.length > 0 && /* @__PURE__ */ D("section", {
326
- "aria-label": c("movethewheels.dispatch.cards", "Decision cards"),
327
+ j.assignments.length > 0 && /* @__PURE__ */ T("section", {
328
+ "aria-label": s("movethewheels.dispatch.cards", "Decision cards"),
327
329
  className: "grid gap-4 lg:grid-cols-2",
328
- children: M.assignments.map((e) => /* @__PURE__ */ D(C, {
330
+ children: j.assignments.map((e) => /* @__PURE__ */ T(S, {
329
331
  assignment: e,
330
332
  open: Y,
331
- choice: K[e.id] ?? null,
333
+ choice: W[e.id] ?? null,
332
334
  disabled: X,
333
- onChoose: (t) => q((n) => ({
335
+ onChoose: (t) => G((n) => ({
334
336
  ...n,
335
337
  [e.id]: t
336
338
  })),
337
- onOpenRoute: (e) => j(`routes/${e}`),
338
- t: c
339
+ onOpenRoute: (e) => A(`routes/${e}`),
340
+ onRecommendCarrier: (e, t) => q({
341
+ id: e,
342
+ number: t
343
+ }),
344
+ t: s
339
345
  }, e.id))
340
346
  }),
341
- M.unassigned.length > 0 && /* @__PURE__ */ O(d, { children: [/* @__PURE__ */ D(p, { children: /* @__PURE__ */ D(m, {
347
+ j.unassigned.length > 0 && /* @__PURE__ */ E(u, { children: [/* @__PURE__ */ T(f, { children: /* @__PURE__ */ T(p, {
342
348
  className: "text-base",
343
- children: c("movethewheels.dispatch.unassignedTitle", "Not assigned")
344
- }) }), /* @__PURE__ */ D(f, { children: /* @__PURE__ */ D("ul", {
349
+ children: s("movethewheels.dispatch.unassignedTitle", "Not assigned")
350
+ }) }), /* @__PURE__ */ T(d, { children: /* @__PURE__ */ T("ul", {
345
351
  className: "divide-y",
346
- children: M.unassigned.map((e) => {
347
- let t = P[e.reason];
348
- return /* @__PURE__ */ O("li", {
352
+ children: j.unassigned.map((t) => {
353
+ let n = N[t.reason];
354
+ return /* @__PURE__ */ E("li", {
349
355
  className: "flex flex-wrap justify-between gap-2 py-2 text-sm",
350
- children: [/* @__PURE__ */ D("span", {
351
- className: "font-medium break-words",
352
- children: e.shipmentNumber ?? e.shipmentId
353
- }), /* @__PURE__ */ D("span", {
354
- className: "text-text-secondary",
355
- children: t ? c(t[0], t[1]) : e.reason
356
- })]
357
- }, e.shipmentId);
356
+ children: [
357
+ /* @__PURE__ */ T("span", {
358
+ className: "font-medium break-words",
359
+ children: t.shipmentNumber ?? t.shipmentId
360
+ }),
361
+ /* @__PURE__ */ T("span", {
362
+ className: "text-text-secondary",
363
+ children: n ? s(n[0], n[1]) : t.reason
364
+ }),
365
+ t.reason !== "NOT_PLANNABLE" && /* @__PURE__ */ E(l, {
366
+ size: "sm",
367
+ variant: "outline",
368
+ onClick: () => q({
369
+ id: t.shipmentId,
370
+ number: t.shipmentNumber
371
+ }),
372
+ children: [/* @__PURE__ */ T(e, {
373
+ size: 14,
374
+ "aria-hidden": "true"
375
+ }), s("movethewheels.carrierDecision.propose", "Recommend a carrier")]
376
+ })
377
+ ]
378
+ }, t.shipmentId);
358
379
  })
359
380
  }) })] })
360
- ] }) : /* @__PURE__ */ D(d, { children: /* @__PURE__ */ O(f, {
381
+ ] }) : /* @__PURE__ */ T(u, { children: /* @__PURE__ */ E(d, {
361
382
  className: "space-y-2 p-6 text-center",
362
- children: [/* @__PURE__ */ D("p", {
383
+ children: [/* @__PURE__ */ T("p", {
363
384
  className: "font-medium text-text-primary",
364
- children: c("movethewheels.dispatch.empty", "No proposal yet")
365
- }), /* @__PURE__ */ D("p", {
385
+ children: s("movethewheels.dispatch.empty", "No proposal yet")
386
+ }), /* @__PURE__ */ T("p", {
366
387
  className: "text-sm text-text-secondary",
367
- children: c("movethewheels.dispatch.emptyHint", "Propose assignments to see decision cards for your planned shipments.")
388
+ children: s("movethewheels.dispatch.emptyHint", "Propose assignments to see decision cards for your planned shipments.")
368
389
  })]
369
- }) })
390
+ }) }),
391
+ /* @__PURE__ */ T(C, {
392
+ shipment: de,
393
+ onOpenChange: (e) => !e && q(null),
394
+ onApplied: () => J(s("movethewheels.carrierDecision.applied", "Carrier assigned to the shipment. It stays planned for you to hand over.")),
395
+ t: s
396
+ })
370
397
  ]
371
398
  });
372
399
  }
373
400
  //#endregion
374
- export { R as default };
401
+ export { L as default };