@burdenoff/microfe-movethewheels 2026.1107.7 → 2026.1108.2

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 (28) hide show
  1. package/dist/components/ForecastModelsPanel.js +132 -0
  2. package/dist/components/InventoryCoverPanel.js +401 -0
  3. package/dist/components/UpcomingDemandPanel.js +70 -65
  4. package/dist/generated/wspace-operations.d.ts +25 -0
  5. package/dist/generated/wspace-types.d.ts +3467 -134
  6. package/dist/hooks/useDemandForecast.js +1 -1
  7. package/dist/hooks/useForecastModelChoices.js +57 -0
  8. package/dist/hooks/useInventoryCoverPlan.js +70 -0
  9. package/dist/movethewheels/components/ForecastModelsPanel.d.ts +4 -0
  10. package/dist/movethewheels/components/InventoryCoverPanel.d.ts +24 -0
  11. package/dist/movethewheels/hooks/useDemandForecast.d.ts +9 -0
  12. package/dist/movethewheels/hooks/useForecastModelChoices.d.ts +34 -0
  13. package/dist/movethewheels/hooks/useInventoryCoverPlan.d.ts +80 -0
  14. package/dist/node_modules/lucide-react/dist/esm/icons/sigma.js +8 -0
  15. package/dist/pages/AnalyticsPage.js +83 -81
  16. package/dist/pages/InventoryPage.js +219 -214
  17. package/package.json +1 -1
  18. package/src/generated/wspace-operations.ts +13 -4
  19. package/src/generated/wspace-types.ts +3812 -134
  20. package/src/movethewheels/components/ForecastModelsPanel.tsx +188 -0
  21. package/src/movethewheels/components/InventoryCoverPanel.tsx +449 -0
  22. package/src/movethewheels/components/UpcomingDemandPanel.tsx +9 -2
  23. package/src/movethewheels/hooks/useDemandForecast.ts +13 -0
  24. package/src/movethewheels/hooks/useForecastModelChoices.ts +138 -0
  25. package/src/movethewheels/hooks/useInventoryCoverPlan.ts +250 -0
  26. package/src/movethewheels/pages/AnalyticsPage.tsx +7 -2
  27. package/src/movethewheels/pages/InventoryPage.tsx +8 -0
  28. package/src/operations/wspace/movethewheels/queries/forecast.graphql +22 -1
@@ -2,7 +2,7 @@ import { useMoveTheWheels as e } from "../providers/MoveTheWheelsProvider.js";
2
2
  import { executeGraphQL as t } from "../utils/graphqlClient.js";
3
3
  import { useCallback as n, useEffect as r, useMemo as i, useState as a } from "react";
4
4
  //#region src/movethewheels/hooks/useDemandForecast.ts
5
- var o = "\n query GetMovethewheelsDemandForecast($weeks: Int!, $varianceLimit: Int!) {\n demandForecastByLane(weeks: $weeks) {\n scopeType\n scopeKey\n scopeLabel\n periodStart\n periodEnd\n predictedVolume\n predictedRevenue\n actualVolume\n actualRevenue\n confidence\n }\n demandForecastByCustomer(weeks: $weeks) {\n scopeType\n scopeKey\n scopeLabel\n periodStart\n periodEnd\n predictedVolume\n predictedRevenue\n actualVolume\n actualRevenue\n confidence\n }\n laneVariance: demandForecastVariance(scopeType: LANE, limit: $varianceLimit) {\n scopeType\n scopeKey\n scopeLabel\n periodStart\n periodEnd\n predictedVolume\n actualVolume\n volumeVariance\n predictedRevenue\n actualRevenue\n revenueVariance\n }\n customerVariance: demandForecastVariance(scopeType: CUSTOMER, limit: $varianceLimit) {\n scopeType\n scopeKey\n scopeLabel\n periodStart\n periodEnd\n predictedVolume\n actualVolume\n volumeVariance\n predictedRevenue\n actualRevenue\n revenueVariance\n }\n }\n";
5
+ var o = "\n query GetMovethewheelsDemandForecast($weeks: Int!, $varianceLimit: Int!) {\n demandForecastByLane(weeks: $weeks) {\n scopeType\n scopeKey\n scopeLabel\n periodStart\n periodEnd\n predictedVolume\n predictedRevenue\n actualVolume\n actualRevenue\n confidence\n model\n }\n demandForecastByCustomer(weeks: $weeks) {\n scopeType\n scopeKey\n scopeLabel\n periodStart\n periodEnd\n predictedVolume\n predictedRevenue\n actualVolume\n actualRevenue\n confidence\n model\n }\n laneVariance: demandForecastVariance(scopeType: LANE, limit: $varianceLimit) {\n scopeType\n scopeKey\n scopeLabel\n periodStart\n periodEnd\n predictedVolume\n actualVolume\n volumeVariance\n predictedRevenue\n actualRevenue\n revenueVariance\n }\n customerVariance: demandForecastVariance(scopeType: CUSTOMER, limit: $varianceLimit) {\n scopeType\n scopeKey\n scopeLabel\n periodStart\n periodEnd\n predictedVolume\n actualVolume\n volumeVariance\n predictedRevenue\n actualRevenue\n revenueVariance\n }\n }\n";
6
6
  function s(s = 4, c = 8) {
7
7
  let { apiGatewayUrl: l, authToken: u, workspaceToken: d, workspaceId: f, tenantId: p, currentUser: m } = e(), [h, g] = a([]), [_, v] = a([]), [y, b] = a([]), [x, S] = a([]), [C, w] = a(!1), [T, E] = a(null), D = i(() => ({
8
8
  apiGatewayUrl: l,
@@ -0,0 +1,57 @@
1
+ import { useMoveTheWheels as e } from "../providers/MoveTheWheelsProvider.js";
2
+ import { executeGraphQL as t } from "../utils/graphqlClient.js";
3
+ import { useCallback as n, useEffect as r, useMemo as i, useRef as a, useState as o } from "react";
4
+ //#region src/movethewheels/hooks/useForecastModelChoices.ts
5
+ var s = "\n scopeType\n scopeKey\n scopeLabel\n historyWeeks\n selectedModel\n reason\n evaluatedAt\n candidates {\n model\n seasonLengthWeeks\n mape\n holdoutWeeks\n selected\n }\n", c = `
6
+ query GetMovethewheelsForecastModelChoices($limit: Int!) {
7
+ laneChoices: demandForecastModelChoices(scopeType: LANE, limit: $limit) {
8
+ ${s}
9
+ }
10
+ customerChoices: demandForecastModelChoices(scopeType: CUSTOMER, limit: $limit) {
11
+ ${s}
12
+ }
13
+ }
14
+ `;
15
+ function l(s = 5) {
16
+ let { apiGatewayUrl: l, authToken: u, workspaceToken: d, workspaceId: f, tenantId: p, currentUser: m } = e(), [h, g] = o([]), [_, v] = o([]), [y, b] = o(!0), [x, S] = o(null), C = a(0), w = i(() => ({
17
+ apiGatewayUrl: l,
18
+ authToken: u,
19
+ workspaceToken: d,
20
+ workspaceId: f,
21
+ tenantId: p,
22
+ actorId: m?.id
23
+ }), [
24
+ l,
25
+ u,
26
+ d,
27
+ f,
28
+ p,
29
+ m?.id
30
+ ]), T = n(async () => {
31
+ let e = ++C.current;
32
+ b(!0), S(null);
33
+ try {
34
+ let n = await t(w, c, { limit: s });
35
+ if (e !== C.current) return;
36
+ g(n.laneChoices ?? []), v(n.customerChoices ?? []);
37
+ } catch (t) {
38
+ if (e !== C.current) return;
39
+ S(t instanceof Error ? t : /* @__PURE__ */ Error("Failed to load forecast models"));
40
+ } finally {
41
+ e === C.current && b(!1);
42
+ }
43
+ }, [w, s]);
44
+ return r(() => (T(), () => {
45
+ C.current += 1;
46
+ }), [T]), {
47
+ laneChoices: h,
48
+ customerChoices: _,
49
+ isLoading: y,
50
+ error: x,
51
+ refetch: n(() => {
52
+ T();
53
+ }, [T])
54
+ };
55
+ }
56
+ //#endregion
57
+ export { l as useForecastModelChoices };
@@ -0,0 +1,70 @@
1
+ import { useMoveTheWheels as e } from "../providers/MoveTheWheelsProvider.js";
2
+ import { executeGraphQL as t } from "../utils/graphqlClient.js";
3
+ import { useCallback as n, useEffect as r, useMemo as i, useRef as a, useState as o } from "react";
4
+ //#region src/movethewheels/hooks/useInventoryCoverPlan.ts
5
+ var s = [
6
+ "OUT_OF_STOCK",
7
+ "AT_RISK",
8
+ "REORDER"
9
+ ], c = "\n query GetMovethewheelsInventoryCoverPlan($input: InventoryCoverPlanInput) {\n inventoryCoverPlan(input: $input) {\n generatedAt\n historyStart\n historyEnd\n historyWeeks\n warehouseId\n leadTimeWeeks\n targetCoverWeeks\n demandChangePct\n summary {\n totalItems\n outOfStock\n atRisk\n reorder\n healthy\n notEnoughHistory\n noDemand\n totalSuggestedReorderQuantity\n }\n unattributedUnits\n unattributedJobs\n truncated\n matchingItems\n rows {\n warehouseId\n warehouseName\n warehouseCode\n cargoItemId\n sku\n name\n onHand\n damaged\n usableStock\n reorderPoint\n safetyStock\n demandStatus\n weeksOfHistory\n weeklyUnits\n currentWeekUnits\n baselineWeeklyDemand\n forecastWeeklyDemand\n weeksOfCover\n projectedStockOutWeek\n stockOutBeforeLeadTime\n suggestedReorderQuantity\n status\n }\n }\n }\n", l = {
10
+ warehouseId: null,
11
+ leadTimeWeeks: 2,
12
+ targetCoverWeeks: 6,
13
+ demandChangePct: 0,
14
+ actionOnly: !1
15
+ };
16
+ function u(u = l) {
17
+ let { apiGatewayUrl: d, authToken: f, workspaceToken: p, workspaceId: m, tenantId: h, currentUser: g } = e(), [_, v] = o(null), [y, b] = o(!0), [x, S] = o(null), C = a(0), w = a(null), T = a(u), E = i(() => ({
18
+ apiGatewayUrl: d,
19
+ authToken: f,
20
+ workspaceToken: p,
21
+ workspaceId: m,
22
+ tenantId: h,
23
+ actorId: g?.id
24
+ }), [
25
+ d,
26
+ f,
27
+ p,
28
+ m,
29
+ h,
30
+ g?.id
31
+ ]), D = n(async (e) => {
32
+ T.current = e;
33
+ let n = C.current + 1;
34
+ C.current = n, w.current?.abort();
35
+ let r = new AbortController();
36
+ w.current = r, b(!0), S(null);
37
+ try {
38
+ let i = await t({
39
+ ...E,
40
+ signal: r.signal
41
+ }, c, { input: {
42
+ warehouseId: e.warehouseId,
43
+ leadTimeWeeks: e.leadTimeWeeks,
44
+ targetCoverWeeks: e.targetCoverWeeks,
45
+ demandChangePct: e.demandChangePct,
46
+ statuses: e.actionOnly ? s : null,
47
+ limit: 200
48
+ } });
49
+ C.current === n && v(i.inventoryCoverPlan);
50
+ } catch (e) {
51
+ C.current === n && !r.signal.aborted && S(e instanceof Error ? e : /* @__PURE__ */ Error("Failed to load the stock cover plan"));
52
+ } finally {
53
+ C.current === n && b(!1);
54
+ }
55
+ }, [E]);
56
+ return r(() => {
57
+ D(T.current);
58
+ }, [D]), r(() => () => {
59
+ C.current += 1, w.current?.abort();
60
+ }, []), {
61
+ plan: _,
62
+ isLoading: y,
63
+ error: x,
64
+ run: n((e) => {
65
+ D(e);
66
+ }, [D])
67
+ };
68
+ }
69
+ //#endregion
70
+ export { l as DEFAULT_COVER_REQUEST, u as useInventoryCoverPlan };
@@ -0,0 +1,4 @@
1
+ import { DemandForecastModel } from '../hooks/useDemandForecast';
2
+ /** Short display name of a forecast model. */
3
+ export declare const forecastModelLabel: (model: DemandForecastModel, seasonLengthWeeks?: number | null) => string;
4
+ export declare function ForecastModelsPanel(): import('react').JSX.Element;
@@ -0,0 +1,24 @@
1
+ import { CoverPlanRequest } from '../hooks/useInventoryCoverPlan';
2
+ interface DraftSettings {
3
+ warehouseId: string;
4
+ leadTime: string;
5
+ targetCover: string;
6
+ demandPct: string;
7
+ actionOnly: boolean;
8
+ }
9
+ /** The request a draft describes, or the first problem with it. */
10
+ export declare function parseCoverDraft(draft: DraftSettings): {
11
+ request: CoverPlanRequest;
12
+ problem: null;
13
+ } | {
14
+ request: null;
15
+ problem: string;
16
+ };
17
+ interface InventoryCoverPanelProps {
18
+ warehouses: {
19
+ id: string;
20
+ name: string;
21
+ }[];
22
+ }
23
+ export declare function InventoryCoverPanel({ warehouses }: InventoryCoverPanelProps): import('react').JSX.Element;
24
+ export {};
@@ -3,6 +3,13 @@
3
3
  * and customer plus the recent closed-period variance. Read-side only — the
4
4
  * admin console exposes `recalculateDemandForecasts` separately.
5
5
  */
6
+ /**
7
+ * The forecast model behind a row: the moving-average heuristic, or (once a
8
+ * lane or customer has 26 closed weeks and the model wins the back-test)
9
+ * Holt linear or Holt-Winters exponential smoothing. HEURISTIC_GROWTH_RATE is
10
+ * reserved and never produced.
11
+ */
12
+ export type DemandForecastModel = 'HEURISTIC_MOVING_AVG' | 'HEURISTIC_GROWTH_RATE' | 'HOLT_LINEAR' | 'HOLT_WINTERS';
6
13
  export interface ForecastPoint {
7
14
  scopeType: 'LANE' | 'CUSTOMER';
8
15
  scopeKey: string;
@@ -15,6 +22,8 @@ export interface ForecastPoint {
15
22
  actualVolume: number | null;
16
23
  actualRevenue: number | null;
17
24
  confidence: number;
25
+ /** The model that produced the row (BOFF-10925). */
26
+ model: DemandForecastModel;
18
27
  }
19
28
  export interface ForecastVariance {
20
29
  scopeType: 'LANE' | 'CUSTOMER';
@@ -0,0 +1,34 @@
1
+ import { DemandForecastModel } from './useDemandForecast';
2
+ /**
3
+ * Forecast model choices (BOFF-10925): which model forecasts each lane and
4
+ * customer, with every candidate's back-test error (MAPE), so the choice can
5
+ * be checked. Loaded separately from the forecast itself so a failure here
6
+ * never hides the upcoming demand.
7
+ */
8
+ export interface ForecastModelScore {
9
+ model: DemandForecastModel;
10
+ seasonLengthWeeks: number | null;
11
+ /** Mean absolute percentage error on weekly volume; 0.25 = 25%. */
12
+ mape: number | null;
13
+ holdoutWeeks: number;
14
+ selected: boolean;
15
+ }
16
+ export interface ForecastModelChoice {
17
+ scopeType: 'LANE' | 'CUSTOMER';
18
+ scopeKey: string;
19
+ scopeLabel: string;
20
+ historyWeeks: number;
21
+ selectedModel: DemandForecastModel;
22
+ reason: string;
23
+ evaluatedAt: string;
24
+ candidates: ForecastModelScore[];
25
+ }
26
+ interface UseForecastModelChoicesResult {
27
+ laneChoices: ForecastModelChoice[];
28
+ customerChoices: ForecastModelChoice[];
29
+ isLoading: boolean;
30
+ error: Error | null;
31
+ refetch: () => void;
32
+ }
33
+ export declare function useForecastModelChoices(limit?: number): UseForecastModelChoicesResult;
34
+ export {};
@@ -0,0 +1,80 @@
1
+ /**
2
+ * Inventory planning (BOFF-10926). Runs the read-only `inventoryCoverPlan`
3
+ * query: weeks of stock cover per warehouse and SKU against forecast
4
+ * outbound demand, with the projected stock-out week and a suggested
5
+ * reorder quantity.
6
+ */
7
+ export type CoverStatus = 'OUT_OF_STOCK' | 'AT_RISK' | 'REORDER' | 'HEALTHY' | 'NOT_ENOUGH_HISTORY' | 'NO_DEMAND';
8
+ export type DemandStatus = 'FORECAST' | 'NOT_ENOUGH_HISTORY' | 'NO_DEMAND';
9
+ /** Statuses that ask the planner to act, most urgent first. */
10
+ export declare const ACTION_STATUSES: CoverStatus[];
11
+ export interface CoverPlanRequest {
12
+ warehouseId: string | null;
13
+ leadTimeWeeks: number;
14
+ targetCoverWeeks: number;
15
+ demandChangePct: number;
16
+ /** Only rows that need action; the summary always counts every row. */
17
+ actionOnly: boolean;
18
+ }
19
+ export interface CoverPlanRow {
20
+ warehouseId: string;
21
+ warehouseName: string;
22
+ warehouseCode: string;
23
+ cargoItemId: string;
24
+ sku: string;
25
+ name: string;
26
+ onHand: number;
27
+ damaged: number;
28
+ usableStock: number;
29
+ reorderPoint: number | null;
30
+ safetyStock: number | null;
31
+ demandStatus: DemandStatus;
32
+ weeksOfHistory: number;
33
+ weeklyUnits: number[];
34
+ currentWeekUnits: number;
35
+ baselineWeeklyDemand: number | null;
36
+ forecastWeeklyDemand: number | null;
37
+ weeksOfCover: number | null;
38
+ projectedStockOutWeek: string | null;
39
+ stockOutBeforeLeadTime: boolean;
40
+ suggestedReorderQuantity: number | null;
41
+ status: CoverStatus;
42
+ }
43
+ export interface CoverPlanSummary {
44
+ totalItems: number;
45
+ outOfStock: number;
46
+ atRisk: number;
47
+ reorder: number;
48
+ healthy: number;
49
+ notEnoughHistory: number;
50
+ noDemand: number;
51
+ totalSuggestedReorderQuantity: number;
52
+ }
53
+ export interface CoverPlan {
54
+ generatedAt: string;
55
+ historyStart: string;
56
+ historyEnd: string;
57
+ historyWeeks: number;
58
+ warehouseId: string | null;
59
+ leadTimeWeeks: number;
60
+ targetCoverWeeks: number;
61
+ demandChangePct: number;
62
+ summary: CoverPlanSummary;
63
+ unattributedUnits: number;
64
+ unattributedJobs: number;
65
+ truncated: boolean;
66
+ matchingItems: number;
67
+ rows: CoverPlanRow[];
68
+ }
69
+ /** Rows the panel asks for; the summary still counts every position. */
70
+ export declare const COVER_PLAN_ROW_LIMIT = 200;
71
+ export declare const DEFAULT_COVER_REQUEST: CoverPlanRequest;
72
+ interface UseInventoryCoverPlanResult {
73
+ plan: CoverPlan | null;
74
+ isLoading: boolean;
75
+ error: Error | null;
76
+ /** Run a plan; the latest request wins if several overlap. */
77
+ run: (request: CoverPlanRequest) => void;
78
+ }
79
+ export declare function useInventoryCoverPlan(initial?: CoverPlanRequest): UseInventoryCoverPlanResult;
80
+ export {};
@@ -0,0 +1,8 @@
1
+ import { createLucideIcon as e } from "../createLucideIcon.js";
2
+ //#region node_modules/lucide-react/dist/esm/icons/sigma.js
3
+ var t = e("Sigma", [["path", {
4
+ d: "M18 7V5a1 1 0 0 0-1-1H6.5a.5.5 0 0 0-.4.8l4.5 6a2 2 0 0 1 0 2.4l-4.5 6a.5.5 0 0 0 .4.8H17a1 1 0 0 0 1-1v-2",
5
+ key: "wuwx1p"
6
+ }]]);
7
+ //#endregion
8
+ export { t as Sigma };
@@ -14,78 +14,79 @@ import { VolumeBar as x } from "../components/charts/VolumeBar.js";
14
14
  import { StatusDonut as S } from "../components/charts/StatusDonut.js";
15
15
  import "../components/charts/index.js";
16
16
  import { CarbonFootprintPanel as C } from "../components/CarbonFootprintPanel.js";
17
- import { UpcomingDemandPanel as w } from "../components/UpcomingDemandPanel.js";
18
- import { ScenarioPlanningPanel as T } from "../components/ScenarioPlanningPanel.js";
19
- import { useDemandForecast as E } from "../hooks/useDemandForecast.js";
20
- import { useMemo as D } from "react";
21
- import { jsx as O, jsxs as k } from "react/jsx-runtime";
22
- import { EmphasisPanel as A, PagePurpose as j } from "@burdenoff/fe-libs/ui";
17
+ import { ForecastModelsPanel as w } from "../components/ForecastModelsPanel.js";
18
+ import { UpcomingDemandPanel as T } from "../components/UpcomingDemandPanel.js";
19
+ import { ScenarioPlanningPanel as E } from "../components/ScenarioPlanningPanel.js";
20
+ import { useDemandForecast as D } from "../hooks/useDemandForecast.js";
21
+ import { useMemo as O } from "react";
22
+ import { jsx as k, jsxs as A } from "react/jsx-runtime";
23
+ import { EmphasisPanel as j, PagePurpose as M } from "@burdenoff/fe-libs/ui";
23
24
  //#region src/movethewheels/pages/AnalyticsPage.tsx
24
- var M = (e) => e.replace(/_/g, " ").replace(/\b\w/g, (e) => e.toUpperCase());
25
- function N() {
26
- let { analytics: N, isLoading: P, error: F, refetch: I } = s(), { orderData: L } = l(), { fleetData: R } = c(), { laneForecast: z, customerForecast: B, laneVariance: V, customerVariance: H, isLoading: U, error: W, refetch: G } = E(4, 8), K = D(() => N.trends.dailyOrders.map((e) => e.orders), [N.trends.dailyOrders]), q = D(() => N.trends.revenue.map((e) => ({
25
+ var N = (e) => e.replace(/_/g, " ").replace(/\b\w/g, (e) => e.toUpperCase());
26
+ function P() {
27
+ let { analytics: P, isLoading: F, error: I, refetch: L } = s(), { orderData: R } = l(), { fleetData: z } = c(), { laneForecast: B, customerForecast: V, laneVariance: H, customerVariance: U, isLoading: W, error: G, refetch: K } = D(4, 8), q = O(() => P.trends.dailyOrders.map((e) => e.orders), [P.trends.dailyOrders]), J = O(() => P.trends.revenue.map((e) => ({
27
28
  month: e.month,
28
29
  revenue: e.revenue
29
- })), [N.trends.revenue]), J = D(() => L.byStatus.filter((e) => e.count > 0).map((e) => ({
30
- name: M(e.status),
30
+ })), [P.trends.revenue]), Y = O(() => R.byStatus.filter((e) => e.count > 0).map((e) => ({
31
+ name: N(e.status),
31
32
  value: e.count
32
- })), [L.byStatus]), Y = J.reduce((e, t) => e + t.value, 0);
33
- return /* @__PURE__ */ k(g, {
33
+ })), [R.byStatus]), X = Y.reduce((e, t) => e + t.value, 0);
34
+ return /* @__PURE__ */ A(g, {
34
35
  title: "Analytics",
35
36
  subtitle: "Business performance and insights",
36
- icon: /* @__PURE__ */ O(e, { size: 24 }),
37
+ icon: /* @__PURE__ */ k(e, { size: 24 }),
37
38
  children: [
38
- /* @__PURE__ */ O(j, {
39
- icon: /* @__PURE__ */ O(e, { size: 18 }),
39
+ /* @__PURE__ */ k(M, {
40
+ icon: /* @__PURE__ */ k(e, { size: 18 }),
40
41
  children: "See how the operation is really performing. Track order volume, revenue, on-time rate and customer satisfaction over time so you can spot trends, find bottlenecks, and decide where to invest — whether that's more vehicles, better routes, or new customers."
41
42
  }),
42
- F && !P ? /* @__PURE__ */ O(d, {
43
+ I && !F ? /* @__PURE__ */ k(d, {
43
44
  className: "border-status-error-border",
44
- children: /* @__PURE__ */ k(f, {
45
+ children: /* @__PURE__ */ A(f, {
45
46
  className: "p-6 text-center space-y-3",
46
47
  children: [
47
- /* @__PURE__ */ O("p", {
48
+ /* @__PURE__ */ k("p", {
48
49
  className: "text-status-error-text font-medium",
49
50
  children: "Couldn't load analytics"
50
51
  }),
51
- /* @__PURE__ */ O("p", {
52
+ /* @__PURE__ */ k("p", {
52
53
  className: "text-sm text-text-secondary",
53
- children: F.message
54
+ children: I.message
54
55
  }),
55
- /* @__PURE__ */ O(u, {
56
+ /* @__PURE__ */ k(u, {
56
57
  variant: "outline",
57
- onClick: I,
58
+ onClick: L,
58
59
  children: "Retry"
59
60
  })
60
61
  ]
61
62
  })
62
- }) : P ? /* @__PURE__ */ O(y, {
63
+ }) : F ? /* @__PURE__ */ k(y, {
63
64
  columns: 4,
64
- children: Array.from({ length: 4 }).map((e, t) => /* @__PURE__ */ O(v, {}, t))
65
- }) : /* @__PURE__ */ k(y, {
65
+ children: Array.from({ length: 4 }).map((e, t) => /* @__PURE__ */ k(v, {}, t))
66
+ }) : /* @__PURE__ */ A(y, {
66
67
  columns: 4,
67
68
  children: [
68
- /* @__PURE__ */ O(_, {
69
+ /* @__PURE__ */ k(_, {
69
70
  label: "Order Volume",
70
- value: N.overview.totalOrders.toLocaleString(),
71
- icon: /* @__PURE__ */ O(n, { size: 20 }),
71
+ value: P.overview.totalOrders.toLocaleString(),
72
+ icon: /* @__PURE__ */ k(n, { size: 20 }),
72
73
  accent: "brand",
73
- sparklineData: K.length >= 2 ? K : void 0
74
+ sparklineData: q.length >= 2 ? q : void 0
74
75
  }),
75
- /* @__PURE__ */ O(_, {
76
+ /* @__PURE__ */ k(_, {
76
77
  treatment: "glass",
77
78
  glow: !0,
78
79
  label: "Revenue",
79
- value: o(N.overview.totalRevenue),
80
- icon: /* @__PURE__ */ O(t, { size: 20 }),
80
+ value: o(P.overview.totalRevenue),
81
+ icon: /* @__PURE__ */ k(t, { size: 20 }),
81
82
  accent: "success"
82
83
  }),
83
- /* @__PURE__ */ O(_, {
84
+ /* @__PURE__ */ k(_, {
84
85
  label: "On-Time Delivery",
85
- value: `${N.overview.onTimeDeliveryRate.toFixed(1)}%`,
86
- icon: /* @__PURE__ */ O(i, { size: 20 }),
86
+ value: `${P.overview.onTimeDeliveryRate.toFixed(1)}%`,
87
+ icon: /* @__PURE__ */ k(i, { size: 20 }),
87
88
  accent: "blue",
88
- delta: N.overview.onTimeDeliveryRate >= 90 ? {
89
+ delta: P.overview.onTimeDeliveryRate >= 90 ? {
89
90
  value: "On target",
90
91
  direction: "up"
91
92
  } : {
@@ -93,19 +94,19 @@ function N() {
93
94
  direction: "down"
94
95
  }
95
96
  }),
96
- /* @__PURE__ */ O(_, {
97
+ /* @__PURE__ */ k(_, {
97
98
  label: "Customer Satisfaction",
98
- value: N.overview.customerSatisfaction.toFixed(1),
99
- icon: /* @__PURE__ */ O(r, { size: 20 }),
99
+ value: P.overview.customerSatisfaction.toFixed(1),
100
+ icon: /* @__PURE__ */ k(r, { size: 20 }),
100
101
  accent: "warning",
101
102
  subtitle: "out of 5"
102
103
  })
103
104
  ]
104
105
  }),
105
- /* @__PURE__ */ k(d, { children: [/* @__PURE__ */ O(p, { children: /* @__PURE__ */ O(m, { children: "Order & delivery trend" }) }), /* @__PURE__ */ O(f, { children: /* @__PURE__ */ O(b, {
106
+ /* @__PURE__ */ A(d, { children: [/* @__PURE__ */ k(p, { children: /* @__PURE__ */ k(m, { children: "Order & delivery trend" }) }), /* @__PURE__ */ k(f, { children: /* @__PURE__ */ k(b, {
106
107
  xKey: "date",
107
108
  height: 300,
108
- data: N.trends.dailyOrders,
109
+ data: P.trends.dailyOrders,
109
110
  series: [{
110
111
  dataKey: "orders",
111
112
  name: "Orders"
@@ -115,100 +116,101 @@ function N() {
115
116
  }],
116
117
  emptyMessage: "No order trend recorded yet"
117
118
  }) })] }),
118
- /* @__PURE__ */ O(w, {
119
- laneForecast: z,
120
- customerForecast: B,
121
- laneVariance: V,
122
- customerVariance: H,
123
- isLoading: U,
124
- error: W,
125
- onRetry: G
119
+ /* @__PURE__ */ k(T, {
120
+ laneForecast: B,
121
+ customerForecast: V,
122
+ laneVariance: H,
123
+ customerVariance: U,
124
+ isLoading: W,
125
+ error: G,
126
+ onRetry: K
126
127
  }),
127
- /* @__PURE__ */ O(T, {}),
128
- /* @__PURE__ */ k("div", {
128
+ /* @__PURE__ */ k(w, {}),
129
+ /* @__PURE__ */ k(E, {}),
130
+ /* @__PURE__ */ A("div", {
129
131
  className: "grid grid-cols-1 lg:grid-cols-2 gap-6",
130
- children: [/* @__PURE__ */ k(d, { children: [/* @__PURE__ */ O(p, { children: /* @__PURE__ */ O(m, { children: "Revenue by month" }) }), /* @__PURE__ */ O(f, { children: /* @__PURE__ */ O(x, {
132
+ children: [/* @__PURE__ */ A(d, { children: [/* @__PURE__ */ k(p, { children: /* @__PURE__ */ k(m, { children: "Revenue by month" }) }), /* @__PURE__ */ k(f, { children: /* @__PURE__ */ k(x, {
131
133
  xKey: "month",
132
134
  height: 280,
133
135
  showLegend: !1,
134
- data: q,
136
+ data: J,
135
137
  series: [{
136
138
  dataKey: "revenue",
137
139
  name: "Revenue"
138
140
  }],
139
141
  valueFormatter: (e) => o(Number(e)),
140
142
  emptyMessage: "No revenue recorded yet"
141
- }) })] }), /* @__PURE__ */ k(d, { children: [/* @__PURE__ */ O(p, { children: /* @__PURE__ */ O(m, { children: "Orders by status" }) }), /* @__PURE__ */ O(f, { children: /* @__PURE__ */ O(S, {
142
- data: J,
143
+ }) })] }), /* @__PURE__ */ A(d, { children: [/* @__PURE__ */ k(p, { children: /* @__PURE__ */ k(m, { children: "Orders by status" }) }), /* @__PURE__ */ k(f, { children: /* @__PURE__ */ k(S, {
144
+ data: Y,
143
145
  height: 240,
144
- centerLabel: Y.toLocaleString(),
146
+ centerLabel: X.toLocaleString(),
145
147
  centerSubLabel: "orders",
146
148
  emptyMessage: "No orders to break down yet"
147
149
  }) })] })]
148
150
  }),
149
- /* @__PURE__ */ k("div", {
151
+ /* @__PURE__ */ A("div", {
150
152
  className: "grid grid-cols-1 lg:grid-cols-2 gap-6",
151
- children: [/* @__PURE__ */ k(d, { children: [/* @__PURE__ */ O(p, { children: /* @__PURE__ */ O(m, { children: "Fleet Performance" }) }), /* @__PURE__ */ k(f, {
153
+ children: [/* @__PURE__ */ A(d, { children: [/* @__PURE__ */ k(p, { children: /* @__PURE__ */ k(m, { children: "Fleet Performance" }) }), /* @__PURE__ */ A(f, {
152
154
  className: "space-y-4",
153
- children: [/* @__PURE__ */ k("div", { children: [/* @__PURE__ */ k("div", {
155
+ children: [/* @__PURE__ */ A("div", { children: [/* @__PURE__ */ A("div", {
154
156
  className: "flex justify-between text-sm mb-1",
155
- children: [/* @__PURE__ */ O("span", { children: "Vehicle Utilization" }), /* @__PURE__ */ k("span", { children: [R.vehicleUtilization.toFixed(0), "%"] })]
156
- }), /* @__PURE__ */ O(h, { value: R.vehicleUtilization })] }), R.vehiclesByType.length > 0 && /* @__PURE__ */ k("div", {
157
+ children: [/* @__PURE__ */ k("span", { children: "Vehicle Utilization" }), /* @__PURE__ */ A("span", { children: [z.vehicleUtilization.toFixed(0), "%"] })]
158
+ }), /* @__PURE__ */ k(h, { value: z.vehicleUtilization })] }), z.vehiclesByType.length > 0 && /* @__PURE__ */ A("div", {
157
159
  className: "pt-2",
158
- children: [/* @__PURE__ */ O("p", {
160
+ children: [/* @__PURE__ */ k("p", {
159
161
  className: "text-sm text-text-secondary mb-2",
160
162
  children: "Vehicles by Type"
161
- }), R.vehiclesByType.map(({ type: e, count: t }) => /* @__PURE__ */ k("div", {
163
+ }), z.vehiclesByType.map(({ type: e, count: t }) => /* @__PURE__ */ A("div", {
162
164
  className: "flex justify-between text-sm py-1",
163
- children: [/* @__PURE__ */ O("span", {
165
+ children: [/* @__PURE__ */ k("span", {
164
166
  className: "capitalize",
165
167
  children: e
166
- }), /* @__PURE__ */ O("span", {
168
+ }), /* @__PURE__ */ k("span", {
167
169
  className: "font-medium",
168
170
  children: t
169
171
  })]
170
172
  }, e))]
171
173
  })]
172
- })] }), /* @__PURE__ */ k(A, {
174
+ })] }), /* @__PURE__ */ A(j, {
173
175
  className: "space-y-4",
174
176
  children: [
175
- /* @__PURE__ */ O("h2", {
177
+ /* @__PURE__ */ k("h2", {
176
178
  className: "text-base font-semibold text-text-primary",
177
179
  children: "Performance Metrics"
178
180
  }),
179
- /* @__PURE__ */ k("div", { children: [/* @__PURE__ */ O("p", {
181
+ /* @__PURE__ */ A("div", { children: [/* @__PURE__ */ k("p", {
180
182
  className: "text-sm text-text-secondary",
181
183
  children: "On-Time Delivery"
182
- }), /* @__PURE__ */ k("p", {
184
+ }), /* @__PURE__ */ A("p", {
183
185
  className: "text-2xl font-bold",
184
- children: [N.performance.onTimeDelivery.toFixed(1), "%"]
186
+ children: [P.performance.onTimeDelivery.toFixed(1), "%"]
185
187
  })] }),
186
- /* @__PURE__ */ k("div", { children: [/* @__PURE__ */ O("p", {
188
+ /* @__PURE__ */ A("div", { children: [/* @__PURE__ */ k("p", {
187
189
  className: "text-sm text-text-secondary",
188
190
  children: "Customer Satisfaction"
189
- }), /* @__PURE__ */ k("p", {
191
+ }), /* @__PURE__ */ A("p", {
190
192
  className: "text-2xl font-bold",
191
- children: [N.overview.customerSatisfaction.toFixed(1), "/5"]
193
+ children: [P.overview.customerSatisfaction.toFixed(1), "/5"]
192
194
  })] }),
193
- /* @__PURE__ */ k("div", {
195
+ /* @__PURE__ */ A("div", {
194
196
  className: "flex items-center gap-2",
195
- children: [/* @__PURE__ */ O(a, {
197
+ children: [/* @__PURE__ */ k(a, {
196
198
  size: 16,
197
199
  className: "text-text-secondary"
198
- }), /* @__PURE__ */ k("div", { children: [/* @__PURE__ */ O("p", {
200
+ }), /* @__PURE__ */ A("div", { children: [/* @__PURE__ */ k("p", {
199
201
  className: "text-sm text-text-secondary",
200
202
  children: "Driver Ratings"
201
- }), /* @__PURE__ */ k("p", {
203
+ }), /* @__PURE__ */ A("p", {
202
204
  className: "text-2xl font-bold",
203
- children: [N.performance.driverRatings.toFixed(1), "/5"]
205
+ children: [P.performance.driverRatings.toFixed(1), "/5"]
204
206
  })] })]
205
207
  })
206
208
  ]
207
209
  })]
208
210
  }),
209
- /* @__PURE__ */ O(C, {})
211
+ /* @__PURE__ */ k(C, {})
210
212
  ]
211
213
  });
212
214
  }
213
215
  //#endregion
214
- export { N as default };
216
+ export { P as default };