@burdenoff/microfe-theglobalfuel 2026.705.5 → 2026.709.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.
- package/README.md +3 -0
- package/dist/dev/main.d.ts +2 -0
- package/dist/dev/main.d.ts.map +1 -0
- package/dist/generated/global-operations.d.ts +2 -0
- package/dist/generated/global-operations.d.ts.map +1 -0
- package/dist/generated/global-types.d.ts +18199 -0
- package/dist/generated/global-types.d.ts.map +1 -0
- package/dist/generated/wspace-operations.d.ts +2 -0
- package/dist/generated/wspace-operations.d.ts.map +1 -0
- package/dist/generated/wspace-types.d.ts +43046 -0
- package/dist/generated/wspace-types.d.ts.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +3 -1
- package/dist/theglobalfuel/TheGlobalFuelRoot.d.ts +5 -0
- package/dist/theglobalfuel/TheGlobalFuelRoot.d.ts.map +1 -0
- package/dist/theglobalfuel/TheGlobalFuelRoot.js +106 -104
- package/dist/theglobalfuel/TheGlobalFuelRoot.js.map +1 -1
- package/dist/theglobalfuel/TheGlobalFuelRoutes.d.ts +4 -0
- package/dist/theglobalfuel/TheGlobalFuelRoutes.d.ts.map +1 -0
- package/dist/theglobalfuel/TheGlobalFuelRoutes.js +60 -38
- package/dist/theglobalfuel/TheGlobalFuelRoutes.js.map +1 -1
- package/dist/theglobalfuel/components/DataTable.d.ts +30 -0
- package/dist/theglobalfuel/components/DataTable.d.ts.map +1 -0
- package/dist/theglobalfuel/components/DataTable.js.map +1 -1
- package/dist/theglobalfuel/components/EmptyState.d.ts +18 -0
- package/dist/theglobalfuel/components/EmptyState.d.ts.map +1 -0
- package/dist/theglobalfuel/components/EvidenceUpload.d.ts +14 -0
- package/dist/theglobalfuel/components/EvidenceUpload.d.ts.map +1 -0
- package/dist/theglobalfuel/components/FileLink.d.ts +15 -0
- package/dist/theglobalfuel/components/FileLink.d.ts.map +1 -0
- package/dist/theglobalfuel/components/FilterTabs.d.ts +18 -0
- package/dist/theglobalfuel/components/FilterTabs.d.ts.map +1 -0
- package/dist/theglobalfuel/components/MetricsCard.d.ts +23 -0
- package/dist/theglobalfuel/components/MetricsCard.d.ts.map +1 -0
- package/dist/theglobalfuel/components/MiniBar.d.ts +16 -0
- package/dist/theglobalfuel/components/MiniBar.d.ts.map +1 -0
- package/dist/theglobalfuel/components/PageLayout.d.ts +18 -0
- package/dist/theglobalfuel/components/PageLayout.d.ts.map +1 -0
- package/dist/theglobalfuel/components/PageLayout.js +2 -1
- package/dist/theglobalfuel/components/PageLayout.js.map +1 -1
- package/dist/theglobalfuel/components/Pagination.d.ts +22 -0
- package/dist/theglobalfuel/components/Pagination.d.ts.map +1 -0
- package/dist/theglobalfuel/components/StateViews.d.ts +24 -0
- package/dist/theglobalfuel/components/StateViews.d.ts.map +1 -0
- package/dist/theglobalfuel/components/StatusBadge.d.ts +9 -0
- package/dist/theglobalfuel/components/StatusBadge.d.ts.map +1 -0
- package/dist/theglobalfuel/components/Tabs.d.ts +17 -0
- package/dist/theglobalfuel/components/Tabs.d.ts.map +1 -0
- package/dist/theglobalfuel/components/TheDiscussion.d.ts +18 -0
- package/dist/theglobalfuel/components/TheDiscussion.d.ts.map +1 -0
- package/dist/theglobalfuel/components/TheTags.d.ts +17 -0
- package/dist/theglobalfuel/components/TheTags.d.ts.map +1 -0
- package/dist/theglobalfuel/components/WorldMap.d.ts +18 -0
- package/dist/theglobalfuel/components/WorldMap.d.ts.map +1 -0
- package/dist/theglobalfuel/components/WorldMap.js.map +1 -1
- package/dist/theglobalfuel/components/index.d.ts +21 -0
- package/dist/theglobalfuel/components/index.d.ts.map +1 -0
- package/dist/theglobalfuel/components/viz/AllocationBar.d.ts +21 -0
- package/dist/theglobalfuel/components/viz/AllocationBar.d.ts.map +1 -0
- package/dist/theglobalfuel/components/viz/AreaChart.d.ts +18 -0
- package/dist/theglobalfuel/components/viz/AreaChart.d.ts.map +1 -0
- package/dist/theglobalfuel/components/viz/AvatarStack.d.ts +13 -0
- package/dist/theglobalfuel/components/viz/AvatarStack.d.ts.map +1 -0
- package/dist/theglobalfuel/components/viz/BarChart.d.ts +17 -0
- package/dist/theglobalfuel/components/viz/BarChart.d.ts.map +1 -0
- package/dist/theglobalfuel/components/viz/CertificateCard.d.ts +14 -0
- package/dist/theglobalfuel/components/viz/CertificateCard.d.ts.map +1 -0
- package/dist/theglobalfuel/components/viz/DonutChart.d.ts +20 -0
- package/dist/theglobalfuel/components/viz/DonutChart.d.ts.map +1 -0
- package/dist/theglobalfuel/components/viz/HBarFunnel.d.ts +17 -0
- package/dist/theglobalfuel/components/viz/HBarFunnel.d.ts.map +1 -0
- package/dist/theglobalfuel/components/viz/Heatmap.d.ts +26 -0
- package/dist/theglobalfuel/components/viz/Heatmap.d.ts.map +1 -0
- package/dist/theglobalfuel/components/viz/KanbanBoard.d.ts +17 -0
- package/dist/theglobalfuel/components/viz/KanbanBoard.d.ts.map +1 -0
- package/dist/theglobalfuel/components/viz/LineChart.d.ts +20 -0
- package/dist/theglobalfuel/components/viz/LineChart.d.ts.map +1 -0
- package/dist/theglobalfuel/components/viz/OrgTree.d.ts +14 -0
- package/dist/theglobalfuel/components/viz/OrgTree.d.ts.map +1 -0
- package/dist/theglobalfuel/components/viz/PathSteps.d.ts +17 -0
- package/dist/theglobalfuel/components/viz/PathSteps.d.ts.map +1 -0
- package/dist/theglobalfuel/components/viz/ProgressRing.d.ts +20 -0
- package/dist/theglobalfuel/components/viz/ProgressRing.d.ts.map +1 -0
- package/dist/theglobalfuel/components/viz/RatingStars.d.ts +14 -0
- package/dist/theglobalfuel/components/viz/RatingStars.d.ts.map +1 -0
- package/dist/theglobalfuel/components/viz/SegmentedTabs.d.ts +26 -0
- package/dist/theglobalfuel/components/viz/SegmentedTabs.d.ts.map +1 -0
- package/dist/theglobalfuel/components/viz/SkillBar.d.ts +17 -0
- package/dist/theglobalfuel/components/viz/SkillBar.d.ts.map +1 -0
- package/dist/theglobalfuel/components/viz/Sparkline.d.ts +16 -0
- package/dist/theglobalfuel/components/viz/Sparkline.d.ts.map +1 -0
- package/dist/theglobalfuel/components/viz/StatCard.d.ts +22 -0
- package/dist/theglobalfuel/components/viz/StatCard.d.ts.map +1 -0
- package/dist/theglobalfuel/components/viz/StepProgress.d.ts +17 -0
- package/dist/theglobalfuel/components/viz/StepProgress.d.ts.map +1 -0
- package/dist/theglobalfuel/components/viz/Timeline.d.ts +21 -0
- package/dist/theglobalfuel/components/viz/Timeline.d.ts.map +1 -0
- package/dist/theglobalfuel/components/viz/index.d.ts +35 -0
- package/dist/theglobalfuel/components/viz/index.d.ts.map +1 -0
- package/dist/theglobalfuel/components/viz/lib/Avatar.d.ts +15 -0
- package/dist/theglobalfuel/components/viz/lib/Avatar.d.ts.map +1 -0
- package/dist/theglobalfuel/components/viz/lib/CartesianFrame.d.ts +44 -0
- package/dist/theglobalfuel/components/viz/lib/CartesianFrame.d.ts.map +1 -0
- package/dist/theglobalfuel/components/viz/lib/ResponsiveSvg.d.ts +27 -0
- package/dist/theglobalfuel/components/viz/lib/ResponsiveSvg.d.ts.map +1 -0
- package/dist/theglobalfuel/components/viz/lib/format.d.ts +10 -0
- package/dist/theglobalfuel/components/viz/lib/format.d.ts.map +1 -0
- package/dist/theglobalfuel/components/viz/lib/geometry.d.ts +41 -0
- package/dist/theglobalfuel/components/viz/lib/geometry.d.ts.map +1 -0
- package/dist/theglobalfuel/components/viz/lib/hooks.d.ts +18 -0
- package/dist/theglobalfuel/components/viz/lib/hooks.d.ts.map +1 -0
- package/dist/theglobalfuel/components/viz/lib/palette.d.ts +31 -0
- package/dist/theglobalfuel/components/viz/lib/palette.d.ts.map +1 -0
- package/dist/theglobalfuel/components/viz/lib/types.d.ts +27 -0
- package/dist/theglobalfuel/components/viz/lib/types.d.ts.map +1 -0
- package/dist/theglobalfuel/context/TheGlobalFuelContext.d.ts +16 -0
- package/dist/theglobalfuel/context/TheGlobalFuelContext.d.ts.map +1 -0
- package/dist/theglobalfuel/context/index.d.ts +6 -0
- package/dist/theglobalfuel/context/index.d.ts.map +1 -0
- package/dist/theglobalfuel/hooks/index.d.ts +15 -0
- package/dist/theglobalfuel/hooks/index.d.ts.map +1 -0
- package/dist/theglobalfuel/hooks/index.js +4 -0
- package/dist/theglobalfuel/hooks/useCursorPager.d.ts +26 -0
- package/dist/theglobalfuel/hooks/useCursorPager.d.ts.map +1 -0
- package/dist/theglobalfuel/hooks/useNotify.d.ts +23 -0
- package/dist/theglobalfuel/hooks/useNotify.d.ts.map +1 -0
- package/dist/theglobalfuel/hooks/useTheAnalytics.d.ts +38 -0
- package/dist/theglobalfuel/hooks/useTheAnalytics.d.ts.map +1 -0
- package/dist/theglobalfuel/hooks/useTheAnalytics.js +46 -0
- package/dist/theglobalfuel/hooks/useTheAnalytics.js.map +1 -0
- package/dist/theglobalfuel/hooks/useTheComments.d.ts +36 -0
- package/dist/theglobalfuel/hooks/useTheComments.d.ts.map +1 -0
- package/dist/theglobalfuel/hooks/useTheFiles.d.ts +47 -0
- package/dist/theglobalfuel/hooks/useTheFiles.d.ts.map +1 -0
- package/dist/theglobalfuel/hooks/useTheGlobalFuelApi.d.ts +79 -0
- package/dist/theglobalfuel/hooks/useTheGlobalFuelApi.d.ts.map +1 -0
- package/dist/theglobalfuel/hooks/useTheGlobalFuelApi.js +2 -9
- package/dist/theglobalfuel/hooks/useTheGlobalFuelApi.js.map +1 -1
- package/dist/theglobalfuel/hooks/useTheNativeControls.d.ts +20 -0
- package/dist/theglobalfuel/hooks/useTheNativeControls.d.ts.map +1 -0
- package/dist/theglobalfuel/hooks/useTheNativeControls.js +22 -0
- package/dist/theglobalfuel/hooks/useTheNativeControls.js.map +1 -0
- package/dist/theglobalfuel/hooks/useThePageView.d.ts +10 -0
- package/dist/theglobalfuel/hooks/useThePageView.d.ts.map +1 -0
- package/dist/theglobalfuel/hooks/useThePageView.js +13 -0
- package/dist/theglobalfuel/hooks/useThePageView.js.map +1 -0
- package/dist/theglobalfuel/hooks/useTheTags.d.ts +44 -0
- package/dist/theglobalfuel/hooks/useTheTags.d.ts.map +1 -0
- package/dist/theglobalfuel/hooks/useTheTranslation.d.ts +4 -0
- package/dist/theglobalfuel/hooks/useTheTranslation.d.ts.map +1 -0
- package/dist/theglobalfuel/hooks/useTheTranslation.js +12 -0
- package/dist/theglobalfuel/hooks/useTheTranslation.js.map +1 -0
- package/dist/theglobalfuel/index.d.ts +11 -0
- package/dist/theglobalfuel/index.d.ts.map +1 -0
- package/dist/theglobalfuel/index.js +2 -0
- package/dist/theglobalfuel/pages/assets/AssetDetailPage.d.ts +13 -0
- package/dist/theglobalfuel/pages/assets/AssetDetailPage.d.ts.map +1 -0
- package/dist/theglobalfuel/pages/assets/AssetDetailPage.js +395 -353
- package/dist/theglobalfuel/pages/assets/AssetDetailPage.js.map +1 -1
- package/dist/theglobalfuel/pages/assets/AssetsPage.d.ts +10 -0
- package/dist/theglobalfuel/pages/assets/AssetsPage.d.ts.map +1 -0
- package/dist/theglobalfuel/pages/assets/AssetsPage.js +152 -146
- package/dist/theglobalfuel/pages/assets/AssetsPage.js.map +1 -1
- package/dist/theglobalfuel/pages/compliance/CompliancePage.d.ts +11 -0
- package/dist/theglobalfuel/pages/compliance/CompliancePage.d.ts.map +1 -0
- package/dist/theglobalfuel/pages/compliance/CompliancePage.js +233 -229
- package/dist/theglobalfuel/pages/compliance/CompliancePage.js.map +1 -1
- package/dist/theglobalfuel/pages/contracts/ContractDetailPage.d.ts +9 -0
- package/dist/theglobalfuel/pages/contracts/ContractDetailPage.d.ts.map +1 -0
- package/dist/theglobalfuel/pages/contracts/ContractDetailPage.js +410 -389
- package/dist/theglobalfuel/pages/contracts/ContractDetailPage.js.map +1 -1
- package/dist/theglobalfuel/pages/contracts/ContractsPage.d.ts +8 -0
- package/dist/theglobalfuel/pages/contracts/ContractsPage.d.ts.map +1 -0
- package/dist/theglobalfuel/pages/contracts/ContractsPage.js +237 -231
- package/dist/theglobalfuel/pages/contracts/ContractsPage.js.map +1 -1
- package/dist/theglobalfuel/pages/dashboard/DashboardPage.d.ts +17 -0
- package/dist/theglobalfuel/pages/dashboard/DashboardPage.d.ts.map +1 -0
- package/dist/theglobalfuel/pages/dashboard/DashboardPage.js +255 -250
- package/dist/theglobalfuel/pages/dashboard/DashboardPage.js.map +1 -1
- package/dist/theglobalfuel/pages/emissions/EmissionsPage.d.ts +13 -0
- package/dist/theglobalfuel/pages/emissions/EmissionsPage.d.ts.map +1 -0
- package/dist/theglobalfuel/pages/emissions/EmissionsPage.js +154 -150
- package/dist/theglobalfuel/pages/emissions/EmissionsPage.js.map +1 -1
- package/dist/theglobalfuel/pages/inventory/InventoryPage.d.ts +11 -0
- package/dist/theglobalfuel/pages/inventory/InventoryPage.d.ts.map +1 -0
- package/dist/theglobalfuel/pages/inventory/InventoryPage.js +151 -147
- package/dist/theglobalfuel/pages/inventory/InventoryPage.js.map +1 -1
- package/dist/theglobalfuel/pages/production/ProductionPage.d.ts +11 -0
- package/dist/theglobalfuel/pages/production/ProductionPage.d.ts.map +1 -0
- package/dist/theglobalfuel/pages/production/ProductionPage.js +175 -171
- package/dist/theglobalfuel/pages/production/ProductionPage.js.map +1 -1
- package/dist/theglobalfuel/pages/provenance/ProvenancePage.d.ts +23 -0
- package/dist/theglobalfuel/pages/provenance/ProvenancePage.d.ts.map +1 -0
- package/dist/theglobalfuel/pages/provenance/ProvenancePage.js +153 -146
- package/dist/theglobalfuel/pages/provenance/ProvenancePage.js.map +1 -1
- package/dist/theglobalfuel/pages/reserves/ReservesPage.d.ts +10 -0
- package/dist/theglobalfuel/pages/reserves/ReservesPage.d.ts.map +1 -0
- package/dist/theglobalfuel/pages/reserves/ReservesPage.js +168 -164
- package/dist/theglobalfuel/pages/reserves/ReservesPage.js.map +1 -1
- package/dist/theglobalfuel/pages/shipments/ShipmentsPage.d.ts +11 -0
- package/dist/theglobalfuel/pages/shipments/ShipmentsPage.d.ts.map +1 -0
- package/dist/theglobalfuel/pages/shipments/ShipmentsPage.js +179 -175
- package/dist/theglobalfuel/pages/shipments/ShipmentsPage.js.map +1 -1
- package/dist/theglobalfuel/services/assistantApi.d.ts +25 -0
- package/dist/theglobalfuel/services/assistantApi.d.ts.map +1 -0
- package/dist/theglobalfuel/services/assistantApi.js +225 -0
- package/dist/theglobalfuel/services/assistantApi.js.map +1 -0
- package/dist/theglobalfuel/services/createSandboxAssistantTransport.d.ts +38 -0
- package/dist/theglobalfuel/services/createSandboxAssistantTransport.d.ts.map +1 -0
- package/dist/theglobalfuel/services/createSandboxAssistantTransport.js +120 -0
- package/dist/theglobalfuel/services/createSandboxAssistantTransport.js.map +1 -0
- package/dist/theglobalfuel/services/index.d.ts +7 -0
- package/dist/theglobalfuel/services/index.d.ts.map +1 -0
- package/dist/theglobalfuel/types/assistant.d.ts +65 -0
- package/dist/theglobalfuel/types/assistant.d.ts.map +1 -0
- package/dist/theglobalfuel/types/index.d.ts +376 -0
- package/dist/theglobalfuel/types/index.d.ts.map +1 -0
- package/dist/theglobalfuel/utils/cn.d.ts +4 -0
- package/dist/theglobalfuel/utils/cn.d.ts.map +1 -0
- package/dist/theglobalfuel/utils/formatters.d.ts +44 -0
- package/dist/theglobalfuel/utils/formatters.d.ts.map +1 -0
- package/dist/theglobalfuel/utils/i18n.d.ts +5 -0
- package/dist/theglobalfuel/utils/i18n.d.ts.map +1 -0
- package/dist/theglobalfuel/utils/i18n.js +15 -0
- package/dist/theglobalfuel/utils/i18n.js.map +1 -0
- package/dist/theglobalfuel/utils/index.d.ts +10 -0
- package/dist/theglobalfuel/utils/index.d.ts.map +1 -0
- package/dist/theglobalfuel/utils/navigation.d.ts +14 -0
- package/dist/theglobalfuel/utils/navigation.d.ts.map +1 -0
- package/dist/theglobalfuel/utils/pageContext.d.ts +26 -0
- package/dist/theglobalfuel/utils/pageContext.d.ts.map +1 -0
- package/dist/theglobalfuel/utils/pageContext.js +65 -0
- package/dist/theglobalfuel/utils/pageContext.js.map +1 -0
- package/dist/theglobalfuel/utils/transitions.d.ts +17 -0
- package/dist/theglobalfuel/utils/transitions.d.ts.map +1 -0
- package/package.json +5 -1
- package/dist/node_modules/clsx/dist/clsx.js +0 -18
- package/dist/node_modules/clsx/dist/clsx.js.map +0 -1
- package/dist/node_modules/tailwind-merge/dist/bundle-mjs.js +0 -1716
- package/dist/node_modules/tailwind-merge/dist/bundle-mjs.js.map +0 -1
|
@@ -11,23 +11,25 @@ import { EmptyState as v } from "../../components/EmptyState.js";
|
|
|
11
11
|
import { chartPalette as ee } from "../../components/viz/lib/palette.js";
|
|
12
12
|
import { Sparkline as y } from "../../components/viz/Sparkline.js";
|
|
13
13
|
import { AreaChart as te } from "../../components/viz/AreaChart.js";
|
|
14
|
-
import { DonutChart as
|
|
14
|
+
import { DonutChart as b } from "../../components/viz/DonutChart.js";
|
|
15
15
|
import "../../components/viz/index.js";
|
|
16
16
|
import "../../context/index.js";
|
|
17
|
-
import { useTheAssets as
|
|
17
|
+
import { useTheAssets as ne, useTheComplianceCerts as re, useTheContracts as ie, useTheEmissionRecords as ae, useTheInventoryLots as oe, useTheProductionRecords as se, useTheShipments as ce } from "../../hooks/useTheGlobalFuelApi.js";
|
|
18
|
+
import { useThePageView as le } from "../../hooks/useThePageView.js";
|
|
19
|
+
import { useTheTranslation as ue } from "../../hooks/useTheTranslation.js";
|
|
18
20
|
import "../../hooks/index.js";
|
|
19
|
-
import { useMemo as
|
|
20
|
-
import { Activity as
|
|
21
|
-
import { jsx as
|
|
22
|
-
import { GlassCard as
|
|
21
|
+
import { useMemo as x } from "react";
|
|
22
|
+
import { Activity as de, ArrowRight as S, ArrowUpRight as C, Boxes as fe, ClipboardList as pe, Factory as me, Fuel as he, Gauge as ge, GitBranch as _e, Layers as ve, ScrollText as ye, ShieldCheck as be, Ship as xe } from "lucide-react";
|
|
23
|
+
import { jsx as w, jsxs as T } from "react/jsx-runtime";
|
|
24
|
+
import { GlassCard as E, Spinner as D } from "@burdenoff/fe-libs/ui";
|
|
23
25
|
//#region src/theglobalfuel/pages/dashboard/DashboardPage.tsx
|
|
24
|
-
var
|
|
26
|
+
var O = 1440 * 60 * 1e3, k = 30, A = (e) => {
|
|
25
27
|
if (!e) return !1;
|
|
26
28
|
let t = new Date(e).getTime();
|
|
27
29
|
if (Number.isNaN(t)) return !1;
|
|
28
30
|
let n = t - Date.now();
|
|
29
|
-
return n >= 0 && n <=
|
|
30
|
-
},
|
|
31
|
+
return n >= 0 && n <= k * O;
|
|
32
|
+
}, Se = {
|
|
31
33
|
EXPLORATION: "bg-[var(--color-accent-indigo)]",
|
|
32
34
|
APPRAISAL: "bg-[var(--color-accent-blue)]",
|
|
33
35
|
DEVELOPMENT: "bg-[var(--color-accent-teal)]",
|
|
@@ -35,32 +37,32 @@ var k = 1440 * 60 * 1e3, A = 30, j = (e) => {
|
|
|
35
37
|
SUSPENDED: "bg-status-warning-text",
|
|
36
38
|
DECOMMISSIONING: "bg-status-error-text",
|
|
37
39
|
RETIRED: "bg-[var(--color-text-tertiary)]"
|
|
38
|
-
},
|
|
40
|
+
}, Ce = {
|
|
39
41
|
SCOPE_1: "var(--color-status-error-text)",
|
|
40
42
|
SCOPE_2: "var(--color-status-warning-text)",
|
|
41
43
|
SCOPE_3: "var(--color-accent-blue)"
|
|
42
|
-
},
|
|
44
|
+
}, we = [
|
|
43
45
|
"SCOPE_1",
|
|
44
46
|
"SCOPE_2",
|
|
45
47
|
"SCOPE_3"
|
|
46
|
-
],
|
|
48
|
+
], j = (e) => `${e.getUTCFullYear()}-${String(e.getUTCMonth() + 1).padStart(2, "0")}`, M = new Intl.DateTimeFormat(void 0, {
|
|
47
49
|
month: "short",
|
|
48
50
|
year: "2-digit",
|
|
49
51
|
timeZone: "UTC"
|
|
50
|
-
}),
|
|
51
|
-
function
|
|
52
|
+
}), N = (e, t) => M.format(new Date(Date.UTC(e, t - 1, 1)));
|
|
53
|
+
function Te(e, t, n) {
|
|
52
54
|
let r = /* @__PURE__ */ new Map();
|
|
53
55
|
for (let i of e) {
|
|
54
56
|
let e = t(i);
|
|
55
57
|
if (!e) continue;
|
|
56
58
|
let a = new Date(e);
|
|
57
59
|
if (Number.isNaN(a.getTime())) continue;
|
|
58
|
-
let o =
|
|
60
|
+
let o = j(a);
|
|
59
61
|
r.set(o, (r.get(o) ?? 0) + n(i));
|
|
60
62
|
}
|
|
61
63
|
return r;
|
|
62
64
|
}
|
|
63
|
-
function
|
|
65
|
+
function P(e, t = 18) {
|
|
64
66
|
let n = [...e.keys()].sort();
|
|
65
67
|
if (n.length === 0) return [];
|
|
66
68
|
let r = (e) => {
|
|
@@ -68,12 +70,12 @@ function F(e, t = 18) {
|
|
|
68
70
|
return [Number(t), Number(n)];
|
|
69
71
|
}, [i, a] = r(n[n.length - 1]), [o, s] = r(n[0]), c = [], l = 0;
|
|
70
72
|
for (; (o < i || o === i && s <= a) && l < 240;) c.push({
|
|
71
|
-
label:
|
|
73
|
+
label: N(o, s),
|
|
72
74
|
value: e.get(`${o}-${String(s).padStart(2, "0")}`) ?? 0
|
|
73
75
|
}), s += 1, s > 12 && (s = 1, o += 1), l += 1;
|
|
74
76
|
return c.length > t ? c.slice(c.length - t) : c;
|
|
75
77
|
}
|
|
76
|
-
function
|
|
78
|
+
function F(e, t) {
|
|
77
79
|
let n = /* @__PURE__ */ new Map();
|
|
78
80
|
for (let r of e) {
|
|
79
81
|
let e = t(r);
|
|
@@ -86,186 +88,186 @@ function I(e, t) {
|
|
|
86
88
|
pct: r ? t / r * 100 : 0
|
|
87
89
|
}));
|
|
88
90
|
}
|
|
89
|
-
function
|
|
90
|
-
return /* @__PURE__ */ E
|
|
91
|
+
function Ee({ title: e, description: n, icon: r, linkLabel: i, onLink: a, isLoading: o, isError: c, onRetry: l, emptyLabel: u, bars: d, footer: f, className: m }) {
|
|
92
|
+
return /* @__PURE__ */ T(E, {
|
|
91
93
|
treatment: "glass",
|
|
92
94
|
className: t("flex flex-col p-5", m),
|
|
93
|
-
children: [/* @__PURE__ */
|
|
95
|
+
children: [/* @__PURE__ */ T("div", {
|
|
94
96
|
className: "mb-4 flex items-start justify-between gap-3",
|
|
95
|
-
children: [/* @__PURE__ */
|
|
97
|
+
children: [/* @__PURE__ */ T("div", {
|
|
96
98
|
className: "flex min-w-0 items-start gap-2.5",
|
|
97
|
-
children: [/* @__PURE__ */
|
|
99
|
+
children: [/* @__PURE__ */ w("span", {
|
|
98
100
|
className: "mt-0.5 flex size-8 shrink-0 items-center justify-center rounded-lg bg-[var(--color-accent-soft)] text-accent",
|
|
99
101
|
children: r
|
|
100
|
-
}), /* @__PURE__ */
|
|
102
|
+
}), /* @__PURE__ */ T("div", {
|
|
101
103
|
className: "min-w-0",
|
|
102
|
-
children: [/* @__PURE__ */
|
|
104
|
+
children: [/* @__PURE__ */ w("h2", {
|
|
103
105
|
className: "text-base font-semibold text-text-primary",
|
|
104
106
|
children: e
|
|
105
|
-
}), /* @__PURE__ */
|
|
107
|
+
}), /* @__PURE__ */ w("p", {
|
|
106
108
|
className: "mt-0.5 text-xs text-text-tertiary",
|
|
107
109
|
children: n
|
|
108
110
|
})]
|
|
109
111
|
})]
|
|
110
|
-
}), /* @__PURE__ */
|
|
112
|
+
}), /* @__PURE__ */ T("button", {
|
|
111
113
|
type: "button",
|
|
112
114
|
onClick: a,
|
|
113
115
|
className: "inline-flex shrink-0 items-center gap-1 text-sm font-medium text-accent hover:underline",
|
|
114
116
|
children: [
|
|
115
117
|
i,
|
|
116
118
|
" ",
|
|
117
|
-
/* @__PURE__ */
|
|
119
|
+
/* @__PURE__ */ w(S, { className: "h-4 w-4" })
|
|
118
120
|
]
|
|
119
121
|
})]
|
|
120
|
-
}), o ? /* @__PURE__ */
|
|
122
|
+
}), o ? /* @__PURE__ */ T("div", {
|
|
121
123
|
className: "flex items-center gap-2 py-8 text-sm text-text-secondary",
|
|
122
|
-
children: [/* @__PURE__ */
|
|
123
|
-
}) : c ? /* @__PURE__ */
|
|
124
|
+
children: [/* @__PURE__ */ w(D, { size: "sm" }), " Loading…"]
|
|
125
|
+
}) : c ? /* @__PURE__ */ T("div", {
|
|
124
126
|
className: "flex flex-col items-start gap-2 py-6",
|
|
125
|
-
children: [/* @__PURE__ */
|
|
127
|
+
children: [/* @__PURE__ */ T("p", {
|
|
126
128
|
className: "text-sm text-status-error-text",
|
|
127
129
|
children: [
|
|
128
130
|
"Couldn't load ",
|
|
129
131
|
e.toLowerCase(),
|
|
130
132
|
"."
|
|
131
133
|
]
|
|
132
|
-
}), /* @__PURE__ */
|
|
134
|
+
}), /* @__PURE__ */ w("button", {
|
|
133
135
|
type: "button",
|
|
134
136
|
onClick: l,
|
|
135
137
|
className: "rounded-lg border border-border-seam px-3 py-1.5 text-xs font-medium text-text-primary hover:bg-bg-sunken",
|
|
136
138
|
children: "Retry"
|
|
137
139
|
})]
|
|
138
|
-
}) : d.length === 0 ? /* @__PURE__ */
|
|
140
|
+
}) : d.length === 0 ? /* @__PURE__ */ w("div", {
|
|
139
141
|
className: "flex flex-1 flex-col items-center justify-center rounded-xl border border-dashed border-border-seam py-8 text-center",
|
|
140
|
-
children: /* @__PURE__ */
|
|
142
|
+
children: /* @__PURE__ */ w("p", {
|
|
141
143
|
className: "text-sm text-text-secondary",
|
|
142
144
|
children: u
|
|
143
145
|
})
|
|
144
|
-
}) : /* @__PURE__ */
|
|
146
|
+
}) : /* @__PURE__ */ T("div", {
|
|
145
147
|
className: "flex flex-1 flex-col justify-between gap-4",
|
|
146
|
-
children: [/* @__PURE__ */
|
|
148
|
+
children: [/* @__PURE__ */ w("div", {
|
|
147
149
|
className: "space-y-3",
|
|
148
|
-
children: d.map((e) => /* @__PURE__ */
|
|
150
|
+
children: d.map((e) => /* @__PURE__ */ T("div", {
|
|
149
151
|
className: "flex items-center gap-3",
|
|
150
152
|
children: [
|
|
151
|
-
/* @__PURE__ */
|
|
153
|
+
/* @__PURE__ */ w("div", {
|
|
152
154
|
className: "w-24 shrink-0 truncate text-sm text-text-secondary sm:w-28",
|
|
153
155
|
children: e.label
|
|
154
156
|
}),
|
|
155
|
-
/* @__PURE__ */
|
|
157
|
+
/* @__PURE__ */ w(p, {
|
|
156
158
|
value: e.pct,
|
|
157
159
|
barClassName: e.barClassName,
|
|
158
160
|
className: "flex-1",
|
|
159
161
|
height: 8
|
|
160
162
|
}),
|
|
161
|
-
/* @__PURE__ */
|
|
163
|
+
/* @__PURE__ */ w("span", {
|
|
162
164
|
className: "w-16 shrink-0 whitespace-nowrap text-right text-sm font-medium tabular-nums text-text-primary",
|
|
163
165
|
children: e.value
|
|
164
166
|
}),
|
|
165
|
-
/* @__PURE__ */
|
|
167
|
+
/* @__PURE__ */ w("span", {
|
|
166
168
|
className: "hidden w-11 shrink-0 text-right text-xs tabular-nums text-text-tertiary sm:inline",
|
|
167
169
|
children: s(e.pct)
|
|
168
170
|
})
|
|
169
171
|
]
|
|
170
172
|
}, e.key))
|
|
171
|
-
}), f && /* @__PURE__ */
|
|
173
|
+
}), f && /* @__PURE__ */ w("p", {
|
|
172
174
|
className: "border-t border-border-seam/70 pt-3 text-xs text-text-tertiary",
|
|
173
175
|
children: f
|
|
174
176
|
})]
|
|
175
177
|
})]
|
|
176
178
|
});
|
|
177
179
|
}
|
|
178
|
-
function
|
|
179
|
-
return /* @__PURE__ */ E
|
|
180
|
+
function I({ title: e, caption: n, icon: r, link: i, isLoading: a, isError: o, onRetry: s, isEmpty: c, emptyLabel: l, footer: u, className: d, children: f }) {
|
|
181
|
+
return /* @__PURE__ */ T(E, {
|
|
180
182
|
treatment: "glass",
|
|
181
183
|
className: t("flex flex-col p-5", d),
|
|
182
|
-
children: [/* @__PURE__ */
|
|
184
|
+
children: [/* @__PURE__ */ T("div", {
|
|
183
185
|
className: "mb-4 flex items-start justify-between gap-3",
|
|
184
|
-
children: [/* @__PURE__ */
|
|
186
|
+
children: [/* @__PURE__ */ T("div", {
|
|
185
187
|
className: "flex min-w-0 items-start gap-2.5",
|
|
186
|
-
children: [/* @__PURE__ */
|
|
188
|
+
children: [/* @__PURE__ */ w("span", {
|
|
187
189
|
className: "mt-0.5 flex size-8 shrink-0 items-center justify-center rounded-lg bg-[var(--color-accent-soft)] text-accent",
|
|
188
190
|
children: r
|
|
189
|
-
}), /* @__PURE__ */
|
|
191
|
+
}), /* @__PURE__ */ T("div", {
|
|
190
192
|
className: "min-w-0",
|
|
191
|
-
children: [/* @__PURE__ */
|
|
193
|
+
children: [/* @__PURE__ */ w("h2", {
|
|
192
194
|
className: "text-base font-semibold text-text-primary",
|
|
193
195
|
children: e
|
|
194
|
-
}), /* @__PURE__ */
|
|
196
|
+
}), /* @__PURE__ */ w("p", {
|
|
195
197
|
className: "mt-0.5 text-xs text-text-tertiary",
|
|
196
198
|
children: n
|
|
197
199
|
})]
|
|
198
200
|
})]
|
|
199
|
-
}), i ? /* @__PURE__ */
|
|
201
|
+
}), i ? /* @__PURE__ */ T("button", {
|
|
200
202
|
type: "button",
|
|
201
203
|
onClick: i.onClick,
|
|
202
204
|
className: "inline-flex shrink-0 items-center gap-1 text-sm font-medium text-accent hover:underline",
|
|
203
205
|
children: [
|
|
204
206
|
i.label,
|
|
205
207
|
" ",
|
|
206
|
-
/* @__PURE__ */
|
|
208
|
+
/* @__PURE__ */ w(S, { className: "h-4 w-4" })
|
|
207
209
|
]
|
|
208
210
|
}) : null]
|
|
209
|
-
}), a ? /* @__PURE__ */
|
|
211
|
+
}), a ? /* @__PURE__ */ T("div", {
|
|
210
212
|
className: "flex flex-1 items-center gap-2 py-8 text-sm text-text-secondary",
|
|
211
|
-
children: [/* @__PURE__ */
|
|
212
|
-
}) : o ? /* @__PURE__ */
|
|
213
|
+
children: [/* @__PURE__ */ w(D, { size: "sm" }), " Loading…"]
|
|
214
|
+
}) : o ? /* @__PURE__ */ T("div", {
|
|
213
215
|
className: "flex flex-1 flex-col items-start gap-2 py-6",
|
|
214
|
-
children: [/* @__PURE__ */
|
|
216
|
+
children: [/* @__PURE__ */ T("p", {
|
|
215
217
|
className: "text-sm text-status-error-text",
|
|
216
218
|
children: [
|
|
217
219
|
"Couldn't load ",
|
|
218
220
|
e.toLowerCase(),
|
|
219
221
|
"."
|
|
220
222
|
]
|
|
221
|
-
}), /* @__PURE__ */
|
|
223
|
+
}), /* @__PURE__ */ w("button", {
|
|
222
224
|
type: "button",
|
|
223
225
|
onClick: s,
|
|
224
226
|
className: "rounded-lg border border-border-seam px-3 py-1.5 text-xs font-medium text-text-primary hover:bg-bg-sunken",
|
|
225
227
|
children: "Retry"
|
|
226
228
|
})]
|
|
227
|
-
}) : c ? /* @__PURE__ */
|
|
229
|
+
}) : c ? /* @__PURE__ */ w("div", {
|
|
228
230
|
className: "flex flex-1 flex-col items-center justify-center rounded-xl border border-dashed border-border-seam py-10 text-center",
|
|
229
|
-
children: /* @__PURE__ */
|
|
231
|
+
children: /* @__PURE__ */ w("p", {
|
|
230
232
|
className: "text-sm text-text-secondary",
|
|
231
233
|
children: l
|
|
232
234
|
})
|
|
233
|
-
}) : /* @__PURE__ */
|
|
235
|
+
}) : /* @__PURE__ */ T("div", {
|
|
234
236
|
className: "flex flex-1 flex-col justify-between gap-4",
|
|
235
|
-
children: [/* @__PURE__ */
|
|
237
|
+
children: [/* @__PURE__ */ w("div", {
|
|
236
238
|
className: "flex-1",
|
|
237
239
|
children: f
|
|
238
|
-
}), u ? /* @__PURE__ */
|
|
240
|
+
}), u ? /* @__PURE__ */ w("p", {
|
|
239
241
|
className: "border-t border-border-seam/70 pt-3 text-xs text-text-tertiary",
|
|
240
242
|
children: u
|
|
241
243
|
}) : null]
|
|
242
244
|
})]
|
|
243
245
|
});
|
|
244
246
|
}
|
|
245
|
-
function
|
|
246
|
-
return /* @__PURE__ */
|
|
247
|
+
function De({ card: e, onOpen: t }) {
|
|
248
|
+
return /* @__PURE__ */ w(E, {
|
|
247
249
|
treatment: "metric",
|
|
248
250
|
className: "p-0",
|
|
249
|
-
children: /* @__PURE__ */
|
|
251
|
+
children: /* @__PURE__ */ T("button", {
|
|
250
252
|
type: "button",
|
|
251
253
|
onClick: t,
|
|
252
254
|
"aria-label": `Open ${e.name} assets`,
|
|
253
255
|
className: "flex w-full flex-col gap-4 rounded-[var(--radius-card)] p-5 text-left outline-none transition-transform duration-200 hover:-translate-y-0.5 focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]",
|
|
254
256
|
children: [
|
|
255
|
-
/* @__PURE__ */
|
|
257
|
+
/* @__PURE__ */ T("div", {
|
|
256
258
|
className: "flex items-start justify-between gap-2",
|
|
257
|
-
children: [/* @__PURE__ */
|
|
259
|
+
children: [/* @__PURE__ */ T("div", {
|
|
258
260
|
className: "flex min-w-0 items-center gap-2.5",
|
|
259
|
-
children: [/* @__PURE__ */
|
|
261
|
+
children: [/* @__PURE__ */ w("span", {
|
|
260
262
|
"aria-hidden": "true",
|
|
261
263
|
className: "size-2.5 shrink-0 rounded-full",
|
|
262
264
|
style: { backgroundColor: e.color }
|
|
263
|
-
}), /* @__PURE__ */
|
|
265
|
+
}), /* @__PURE__ */ T("div", {
|
|
264
266
|
className: "min-w-0",
|
|
265
|
-
children: [/* @__PURE__ */
|
|
267
|
+
children: [/* @__PURE__ */ w("p", {
|
|
266
268
|
className: "truncate text-sm font-semibold text-text-primary",
|
|
267
269
|
children: e.name
|
|
268
|
-
}), /* @__PURE__ */
|
|
270
|
+
}), /* @__PURE__ */ T("p", {
|
|
269
271
|
className: "text-xs text-text-tertiary",
|
|
270
272
|
children: [
|
|
271
273
|
e.assetCount,
|
|
@@ -274,30 +276,30 @@ function we({ card: e, onOpen: t }) {
|
|
|
274
276
|
]
|
|
275
277
|
})]
|
|
276
278
|
})]
|
|
277
|
-
}), /* @__PURE__ */
|
|
279
|
+
}), /* @__PURE__ */ w(C, { className: "h-4 w-4 shrink-0 text-text-tertiary" })]
|
|
278
280
|
}),
|
|
279
|
-
/* @__PURE__ */
|
|
281
|
+
/* @__PURE__ */ T("div", {
|
|
280
282
|
className: "grid grid-cols-2 gap-3",
|
|
281
|
-
children: [/* @__PURE__ */
|
|
283
|
+
children: [/* @__PURE__ */ T("div", {
|
|
282
284
|
className: "min-w-0",
|
|
283
|
-
children: [/* @__PURE__ */
|
|
285
|
+
children: [/* @__PURE__ */ w("p", {
|
|
284
286
|
className: "text-[11px] uppercase tracking-wide text-text-tertiary",
|
|
285
287
|
children: "Capacity/day"
|
|
286
|
-
}), /* @__PURE__ */
|
|
288
|
+
}), /* @__PURE__ */ w("p", {
|
|
287
289
|
className: "mt-0.5 truncate text-sm font-semibold tabular-nums text-text-primary",
|
|
288
290
|
children: e.capacity > 0 ? u(e.capacity, e.unit) : "—"
|
|
289
291
|
})]
|
|
290
|
-
}), /* @__PURE__ */
|
|
292
|
+
}), /* @__PURE__ */ T("div", {
|
|
291
293
|
className: "min-w-0",
|
|
292
|
-
children: [/* @__PURE__ */
|
|
294
|
+
children: [/* @__PURE__ */ w("p", {
|
|
293
295
|
className: "text-[11px] uppercase tracking-wide text-text-tertiary",
|
|
294
296
|
children: "Producing"
|
|
295
|
-
}), /* @__PURE__ */
|
|
297
|
+
}), /* @__PURE__ */ T("p", {
|
|
296
298
|
className: "mt-0.5 text-sm font-semibold tabular-nums text-text-primary",
|
|
297
299
|
children: [
|
|
298
300
|
e.producing,
|
|
299
301
|
" ",
|
|
300
|
-
/* @__PURE__ */
|
|
302
|
+
/* @__PURE__ */ T("span", {
|
|
301
303
|
className: "text-xs font-normal text-text-tertiary",
|
|
302
304
|
children: ["of ", e.assetCount]
|
|
303
305
|
})
|
|
@@ -305,15 +307,15 @@ function we({ card: e, onOpen: t }) {
|
|
|
305
307
|
})]
|
|
306
308
|
})]
|
|
307
309
|
}),
|
|
308
|
-
e.spark.length >= 2 ? /* @__PURE__ */
|
|
310
|
+
e.spark.length >= 2 ? /* @__PURE__ */ T("div", { children: [/* @__PURE__ */ w(y, {
|
|
309
311
|
data: e.spark,
|
|
310
312
|
variant: "area",
|
|
311
313
|
height: 40,
|
|
312
314
|
label: `${e.name} monthly production`
|
|
313
|
-
}), /* @__PURE__ */
|
|
315
|
+
}), /* @__PURE__ */ w("p", {
|
|
314
316
|
className: "mt-1 text-[11px] text-text-tertiary",
|
|
315
317
|
children: "Monthly output"
|
|
316
|
-
})] }) : /* @__PURE__ */
|
|
318
|
+
})] }) : /* @__PURE__ */ w("p", {
|
|
317
319
|
className: "text-xs text-text-tertiary",
|
|
318
320
|
children: "No production logged yet."
|
|
319
321
|
})
|
|
@@ -321,41 +323,42 @@ function we({ card: e, onOpen: t }) {
|
|
|
321
323
|
})
|
|
322
324
|
});
|
|
323
325
|
}
|
|
324
|
-
function
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
326
|
+
function L() {
|
|
327
|
+
le("dashboard");
|
|
328
|
+
let { navigateTo: t, currentUser: s } = e(), y = ne({ pagination: { limit: 200 } }), C = ie({ pagination: { limit: 50 } }), E = ce(void 0, "IN_TRANSIT"), D = ae({ pagination: { limit: 200 } }), O = oe({ pagination: { limit: 50 } }), k = re(), M = se({ pagination: { limit: 200 } }), N = x(() => y.data?.items ?? [], [y.data]), L = x(() => C.data?.items ?? [], [C.data]), R = x(() => E.data?.items ?? [], [E.data]), z = x(() => D.data?.items ?? [], [D.data]), B = x(() => O.data?.items ?? [], [O.data]), V = x(() => k.data?.items ?? [], [k.data]), H = x(() => M.data?.items ?? [], [M.data]), U = N.filter((e) => e.status === "PRODUCING").length, W = L.filter((e) => e.status === "ACTIVE").length, G = z.reduce((e, t) => e + (t.co2eTonnes ?? 0), 0), Oe = z.filter((e) => e.verified).length, ke = B.filter((e) => e.status === "AVAILABLE").length, Ae = H.reduce((e, t) => e + (t.volume ?? 0), 0), je = V.filter((e) => e.status === "PENDING").length, Me = V.filter((e) => e.expiresAt != null && (d(e.expiresAt) || A(e.expiresAt))).length, K = V.filter((e) => e.status === "PENDING" || e.expiresAt != null && (d(e.expiresAt) || A(e.expiresAt))).length, q = (e, t) => t ? `${e.length}+` : o(e.length), J = x(() => P(Te(H, (e) => e.periodEnd, (e) => e.volume ?? 0)), [H]), Y = x(() => F(N, (e) => e.commodity), [N]), X = x(() => {
|
|
329
|
+
let e = ee(Y.length), t = /* @__PURE__ */ new Map();
|
|
330
|
+
return Y.forEach((n, r) => t.set(n.key, e[r])), t;
|
|
331
|
+
}, [Y]), Z = x(() => Y.map((e) => ({
|
|
329
332
|
label: a(e.key),
|
|
330
333
|
value: e.count,
|
|
331
|
-
color:
|
|
332
|
-
})), [
|
|
333
|
-
if (
|
|
334
|
+
color: X.get(e.key)
|
|
335
|
+
})), [Y, X]), Ne = x(() => {
|
|
336
|
+
if (z.length === 0) return [];
|
|
334
337
|
let e = {
|
|
335
338
|
SCOPE_1: 0,
|
|
336
339
|
SCOPE_2: 0,
|
|
337
340
|
SCOPE_3: 0
|
|
338
341
|
};
|
|
339
|
-
for (let t of
|
|
340
|
-
return
|
|
342
|
+
for (let t of z) e[t.scope] += t.co2eTonnes ?? 0;
|
|
343
|
+
return we.filter((t) => e[t] > 0).map((t) => ({
|
|
341
344
|
label: a(t),
|
|
342
345
|
value: e[t],
|
|
343
|
-
color:
|
|
346
|
+
color: Ce[t]
|
|
344
347
|
}));
|
|
345
|
-
}, [
|
|
348
|
+
}, [z]), Pe = x(() => F(N, (e) => e.status).map((e) => ({
|
|
346
349
|
key: e.key,
|
|
347
|
-
label: /* @__PURE__ */
|
|
350
|
+
label: /* @__PURE__ */ w(f, { status: e.key }),
|
|
348
351
|
value: o(e.count),
|
|
349
352
|
pct: e.pct,
|
|
350
|
-
barClassName:
|
|
351
|
-
})), [
|
|
353
|
+
barClassName: Se[e.key] ?? "bg-action-primary-bg"
|
|
354
|
+
})), [N]), Fe = x(() => {
|
|
352
355
|
let e = /* @__PURE__ */ new Map();
|
|
353
|
-
for (let t of
|
|
356
|
+
for (let t of N) e.set(t.id, t.commodity);
|
|
354
357
|
return e;
|
|
355
|
-
}, [
|
|
356
|
-
if (
|
|
358
|
+
}, [N]), Ie = x(() => {
|
|
359
|
+
if (Y.length === 0) return [];
|
|
357
360
|
let e = /* @__PURE__ */ new Map();
|
|
358
|
-
for (let t of
|
|
361
|
+
for (let t of N) {
|
|
359
362
|
let n = e.get(t.commodity) ?? {
|
|
360
363
|
count: 0,
|
|
361
364
|
producing: 0,
|
|
@@ -365,12 +368,12 @@ function R() {
|
|
|
365
368
|
n.count += 1, t.status === "PRODUCING" && (n.producing += 1), n.capacity += t.capacityPerDay ?? 0, t.capacityUnit && n.units.set(t.capacityUnit, (n.units.get(t.capacityUnit) ?? 0) + 1), e.set(t.commodity, n);
|
|
366
369
|
}
|
|
367
370
|
let t = /* @__PURE__ */ new Map();
|
|
368
|
-
for (let e of
|
|
369
|
-
let n =
|
|
371
|
+
for (let e of H) {
|
|
372
|
+
let n = Fe.get(e.assetId);
|
|
370
373
|
if (!n) continue;
|
|
371
374
|
let r = new Date(e.periodEnd);
|
|
372
375
|
if (Number.isNaN(r.getTime())) continue;
|
|
373
|
-
let i =
|
|
376
|
+
let i = j(r), a = t.get(n);
|
|
374
377
|
a || (a = /* @__PURE__ */ new Map(), t.set(n, a)), a.set(i, (a.get(i) ?? 0) + (e.volume ?? 0));
|
|
375
378
|
}
|
|
376
379
|
let n = (e) => {
|
|
@@ -378,17 +381,17 @@ function R() {
|
|
|
378
381
|
for (let [r, i] of e) i > n && (t = r, n = i);
|
|
379
382
|
return t;
|
|
380
383
|
};
|
|
381
|
-
return
|
|
384
|
+
return Y.map((r) => {
|
|
382
385
|
let i = e.get(r.key) ?? {
|
|
383
386
|
count: 0,
|
|
384
387
|
producing: 0,
|
|
385
388
|
capacity: 0,
|
|
386
389
|
units: /* @__PURE__ */ new Map()
|
|
387
|
-
}, o = t.get(r.key), s = o ?
|
|
390
|
+
}, o = t.get(r.key), s = o ? P(o, 12).map((e) => e.value) : [];
|
|
388
391
|
return {
|
|
389
392
|
key: r.key,
|
|
390
393
|
name: a(r.key),
|
|
391
|
-
color:
|
|
394
|
+
color: X.get(r.key) ?? "var(--color-accent-primary)",
|
|
392
395
|
assetCount: i.count,
|
|
393
396
|
producing: i.producing,
|
|
394
397
|
capacity: i.capacity,
|
|
@@ -397,20 +400,20 @@ function R() {
|
|
|
397
400
|
};
|
|
398
401
|
});
|
|
399
402
|
}, [
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
]),
|
|
403
|
+
N,
|
|
404
|
+
H,
|
|
405
|
+
Fe,
|
|
406
|
+
Y,
|
|
407
|
+
X
|
|
408
|
+
]), Le = x(() => {
|
|
406
409
|
let e = /* @__PURE__ */ new Map();
|
|
407
|
-
for (let t of
|
|
410
|
+
for (let t of N) e.set(t.id, t.name);
|
|
408
411
|
return e;
|
|
409
|
-
}, [
|
|
412
|
+
}, [N]), Re = x(() => [...L].sort((e, t) => new Date(t.createdAt).getTime() - new Date(e.createdAt).getTime()).slice(0, 6), [L]), Q = x(() => [...H].sort((e, t) => new Date(t.periodEnd).getTime() - new Date(e.periodEnd).getTime()).slice(0, 6), [H]), ze = [
|
|
410
413
|
{
|
|
411
414
|
key: "reference",
|
|
412
415
|
header: "Reference",
|
|
413
|
-
render: (e) => /* @__PURE__ */
|
|
416
|
+
render: (e) => /* @__PURE__ */ w("span", {
|
|
414
417
|
className: "font-medium text-text-primary",
|
|
415
418
|
children: e.reference
|
|
416
419
|
})
|
|
@@ -419,7 +422,7 @@ function R() {
|
|
|
419
422
|
key: "counterparty",
|
|
420
423
|
header: "Counterparty",
|
|
421
424
|
hideOnMobile: !0,
|
|
422
|
-
render: (e) => /* @__PURE__ */
|
|
425
|
+
render: (e) => /* @__PURE__ */ w("span", {
|
|
423
426
|
className: "text-text-secondary",
|
|
424
427
|
children: e.counterparty
|
|
425
428
|
})
|
|
@@ -428,7 +431,7 @@ function R() {
|
|
|
428
431
|
key: "commodity",
|
|
429
432
|
header: "Commodity",
|
|
430
433
|
hideOnMobile: !0,
|
|
431
|
-
render: (e) => /* @__PURE__ */
|
|
434
|
+
render: (e) => /* @__PURE__ */ w("span", {
|
|
432
435
|
className: "text-text-secondary",
|
|
433
436
|
children: a(e.commodity)
|
|
434
437
|
})
|
|
@@ -436,14 +439,14 @@ function R() {
|
|
|
436
439
|
{
|
|
437
440
|
key: "side",
|
|
438
441
|
header: "Side",
|
|
439
|
-
render: (e) => /* @__PURE__ */
|
|
442
|
+
render: (e) => /* @__PURE__ */ w(f, { status: e.side })
|
|
440
443
|
},
|
|
441
444
|
{
|
|
442
445
|
key: "volume",
|
|
443
446
|
header: "Volume",
|
|
444
447
|
align: "right",
|
|
445
448
|
hideOnMobile: !0,
|
|
446
|
-
render: (e) => /* @__PURE__ */
|
|
449
|
+
render: (e) => /* @__PURE__ */ w("span", {
|
|
447
450
|
className: "tabular-nums text-text-secondary",
|
|
448
451
|
children: u(e.contractedVolume, e.unit)
|
|
449
452
|
})
|
|
@@ -451,32 +454,32 @@ function R() {
|
|
|
451
454
|
{
|
|
452
455
|
key: "status",
|
|
453
456
|
header: "Status",
|
|
454
|
-
render: (e) => /* @__PURE__ */
|
|
457
|
+
render: (e) => /* @__PURE__ */ w(f, { status: e.status })
|
|
455
458
|
},
|
|
456
459
|
{
|
|
457
460
|
key: "created",
|
|
458
461
|
header: "Created",
|
|
459
462
|
align: "right",
|
|
460
463
|
hideOnMobile: !0,
|
|
461
|
-
render: (e) => /* @__PURE__ */
|
|
464
|
+
render: (e) => /* @__PURE__ */ w("span", {
|
|
462
465
|
className: "text-text-tertiary",
|
|
463
466
|
children: c(e.createdAt)
|
|
464
467
|
})
|
|
465
468
|
}
|
|
466
|
-
],
|
|
469
|
+
], Be = [
|
|
467
470
|
{
|
|
468
471
|
key: "asset",
|
|
469
472
|
header: "Asset",
|
|
470
|
-
render: (e) => /* @__PURE__ */
|
|
473
|
+
render: (e) => /* @__PURE__ */ w("span", {
|
|
471
474
|
className: "font-medium text-text-primary",
|
|
472
|
-
children:
|
|
475
|
+
children: Le.get(e.assetId) ?? "Unknown asset"
|
|
473
476
|
})
|
|
474
477
|
},
|
|
475
478
|
{
|
|
476
479
|
key: "period",
|
|
477
480
|
header: "Period",
|
|
478
481
|
hideOnMobile: !0,
|
|
479
|
-
render: (e) => /* @__PURE__ */
|
|
482
|
+
render: (e) => /* @__PURE__ */ T("span", {
|
|
480
483
|
className: "text-text-secondary",
|
|
481
484
|
children: [
|
|
482
485
|
i(e.periodStart),
|
|
@@ -489,7 +492,7 @@ function R() {
|
|
|
489
492
|
key: "volume",
|
|
490
493
|
header: "Volume",
|
|
491
494
|
align: "right",
|
|
492
|
-
render: (e) => /* @__PURE__ */
|
|
495
|
+
render: (e) => /* @__PURE__ */ w("span", {
|
|
493
496
|
className: "tabular-nums font-medium text-text-primary",
|
|
494
497
|
children: u(e.volume, e.unit)
|
|
495
498
|
})
|
|
@@ -499,7 +502,7 @@ function R() {
|
|
|
499
502
|
header: "Downtime",
|
|
500
503
|
align: "right",
|
|
501
504
|
hideOnMobile: !0,
|
|
502
|
-
render: (e) => /* @__PURE__ */
|
|
505
|
+
render: (e) => /* @__PURE__ */ T("span", {
|
|
503
506
|
className: "tabular-nums text-text-secondary",
|
|
504
507
|
children: [o(e.downtimeHours), " h"]
|
|
505
508
|
})
|
|
@@ -509,91 +512,93 @@ function R() {
|
|
|
509
512
|
header: "Logged",
|
|
510
513
|
align: "right",
|
|
511
514
|
hideOnMobile: !0,
|
|
512
|
-
render: (e) => /* @__PURE__ */
|
|
515
|
+
render: (e) => /* @__PURE__ */ w("span", {
|
|
513
516
|
className: "text-text-tertiary",
|
|
514
517
|
children: c(e.createdAt)
|
|
515
518
|
})
|
|
516
519
|
}
|
|
517
|
-
],
|
|
518
|
-
return
|
|
519
|
-
title:
|
|
520
|
+
], Ve = s?.firstName || s?.name || "there", He = ue(), Ue = He("theglobalfuel.pages.dashboard.subtitle", "Welcome back, {name} — your energy, mineral & commodity resource control room.", { name: Ve }), We = y.isLoading && C.isLoading && D.isLoading && O.isLoading && k.isLoading, $ = He("theglobalfuel.pages.dashboard.title", "TheGlobalFuel");
|
|
521
|
+
return We ? /* @__PURE__ */ w(n, {
|
|
522
|
+
title: $,
|
|
520
523
|
titleGradient: !0,
|
|
521
524
|
aurora: !0,
|
|
522
|
-
description:
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
525
|
+
description: Ue,
|
|
526
|
+
dataTour: "theglobalfuel-dashboard-page",
|
|
527
|
+
children: /* @__PURE__ */ w(g, { label: "Loading your resource portfolio…" })
|
|
528
|
+
}) : /* @__PURE__ */ T(n, {
|
|
529
|
+
title: $,
|
|
526
530
|
titleGradient: !0,
|
|
527
531
|
aurora: !0,
|
|
528
|
-
description:
|
|
532
|
+
description: Ue,
|
|
533
|
+
dataTour: "theglobalfuel-dashboard-page",
|
|
529
534
|
children: [
|
|
530
|
-
/* @__PURE__ */
|
|
535
|
+
/* @__PURE__ */ T("div", {
|
|
531
536
|
className: "grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-6",
|
|
532
537
|
children: [
|
|
533
|
-
/* @__PURE__ */
|
|
534
|
-
icon: /* @__PURE__ */
|
|
535
|
-
value:
|
|
538
|
+
/* @__PURE__ */ w(r, {
|
|
539
|
+
icon: /* @__PURE__ */ w(ve, { className: "h-5 w-5" }),
|
|
540
|
+
value: q(N, y.data?.pageInfo?.hasMore),
|
|
536
541
|
label: "Resource assets",
|
|
537
542
|
featured: !0,
|
|
538
|
-
footer: /* @__PURE__ */
|
|
543
|
+
footer: /* @__PURE__ */ T("div", {
|
|
539
544
|
className: "space-y-2",
|
|
540
|
-
children: [/* @__PURE__ */
|
|
541
|
-
value:
|
|
545
|
+
children: [/* @__PURE__ */ w(p, {
|
|
546
|
+
value: N.length ? U / N.length * 100 : 0,
|
|
542
547
|
height: 4,
|
|
543
548
|
barClassName: "bg-status-success-text"
|
|
544
|
-
}), /* @__PURE__ */
|
|
549
|
+
}), /* @__PURE__ */ T("p", {
|
|
545
550
|
className: "text-xs text-text-tertiary",
|
|
546
|
-
children: [/* @__PURE__ */
|
|
551
|
+
children: [/* @__PURE__ */ w("span", {
|
|
547
552
|
className: "tabular-nums text-text-secondary",
|
|
548
|
-
children:
|
|
553
|
+
children: U
|
|
549
554
|
}), " producing"]
|
|
550
555
|
})]
|
|
551
556
|
})
|
|
552
557
|
}),
|
|
553
|
-
/* @__PURE__ */
|
|
554
|
-
icon: /* @__PURE__ */
|
|
555
|
-
value:
|
|
558
|
+
/* @__PURE__ */ w(r, {
|
|
559
|
+
icon: /* @__PURE__ */ w(ye, { className: "h-5 w-5" }),
|
|
560
|
+
value: q(L, C.data?.pageInfo?.hasMore),
|
|
556
561
|
label: "Offtake contracts",
|
|
557
|
-
footer: /* @__PURE__ */
|
|
562
|
+
footer: /* @__PURE__ */ T("div", {
|
|
558
563
|
className: "space-y-2",
|
|
559
|
-
children: [/* @__PURE__ */
|
|
560
|
-
value:
|
|
564
|
+
children: [/* @__PURE__ */ w(p, {
|
|
565
|
+
value: L.length ? W / L.length * 100 : 0,
|
|
561
566
|
height: 4,
|
|
562
567
|
barClassName: "bg-action-primary-bg"
|
|
563
|
-
}), /* @__PURE__ */
|
|
568
|
+
}), /* @__PURE__ */ T("p", {
|
|
564
569
|
className: "text-xs text-text-tertiary",
|
|
565
|
-
children: [/* @__PURE__ */
|
|
570
|
+
children: [/* @__PURE__ */ w("span", {
|
|
566
571
|
className: "tabular-nums text-text-secondary",
|
|
567
|
-
children:
|
|
572
|
+
children: W
|
|
568
573
|
}), " active"]
|
|
569
574
|
})]
|
|
570
575
|
})
|
|
571
576
|
}),
|
|
572
|
-
/* @__PURE__ */
|
|
573
|
-
icon: /* @__PURE__ */
|
|
574
|
-
value:
|
|
577
|
+
/* @__PURE__ */ w(r, {
|
|
578
|
+
icon: /* @__PURE__ */ w(xe, { className: "h-5 w-5" }),
|
|
579
|
+
value: E.isError ? "—" : o(R.length),
|
|
575
580
|
label: "Shipments in transit",
|
|
576
|
-
footer: /* @__PURE__ */
|
|
581
|
+
footer: /* @__PURE__ */ w("p", {
|
|
577
582
|
className: "text-xs text-text-tertiary",
|
|
578
|
-
children:
|
|
583
|
+
children: R.length > 0 ? "In motion across carriers" : "No active movements"
|
|
579
584
|
})
|
|
580
585
|
}),
|
|
581
|
-
/* @__PURE__ */
|
|
582
|
-
icon: /* @__PURE__ */
|
|
583
|
-
value:
|
|
586
|
+
/* @__PURE__ */ w(r, {
|
|
587
|
+
icon: /* @__PURE__ */ w(me, { className: "h-5 w-5" }),
|
|
588
|
+
value: D.isError ? "—" : l(G),
|
|
584
589
|
label: "Emissions logged",
|
|
585
|
-
footer: /* @__PURE__ */
|
|
590
|
+
footer: /* @__PURE__ */ T("div", {
|
|
586
591
|
className: "space-y-2",
|
|
587
|
-
children: [/* @__PURE__ */
|
|
588
|
-
value:
|
|
592
|
+
children: [/* @__PURE__ */ w(p, {
|
|
593
|
+
value: z.length ? Oe / z.length * 100 : 0,
|
|
589
594
|
height: 4,
|
|
590
595
|
barClassName: "bg-status-success-text"
|
|
591
|
-
}), /* @__PURE__ */
|
|
596
|
+
}), /* @__PURE__ */ T("p", {
|
|
592
597
|
className: "text-xs text-text-tertiary",
|
|
593
598
|
children: [
|
|
594
|
-
/* @__PURE__ */
|
|
599
|
+
/* @__PURE__ */ w("span", {
|
|
595
600
|
className: "tabular-nums text-text-secondary",
|
|
596
|
-
children:
|
|
601
|
+
children: Oe
|
|
597
602
|
}),
|
|
598
603
|
" ",
|
|
599
604
|
"verified"
|
|
@@ -601,22 +606,22 @@ function R() {
|
|
|
601
606
|
})]
|
|
602
607
|
})
|
|
603
608
|
}),
|
|
604
|
-
/* @__PURE__ */
|
|
605
|
-
icon: /* @__PURE__ */
|
|
606
|
-
value:
|
|
609
|
+
/* @__PURE__ */ w(r, {
|
|
610
|
+
icon: /* @__PURE__ */ w(fe, { className: "h-5 w-5" }),
|
|
611
|
+
value: O.isError ? "—" : o(ke),
|
|
607
612
|
label: "Inventory available",
|
|
608
|
-
footer: /* @__PURE__ */
|
|
613
|
+
footer: /* @__PURE__ */ T("div", {
|
|
609
614
|
className: "space-y-2",
|
|
610
|
-
children: [/* @__PURE__ */
|
|
611
|
-
value:
|
|
615
|
+
children: [/* @__PURE__ */ w(p, {
|
|
616
|
+
value: B.length ? ke / B.length * 100 : 0,
|
|
612
617
|
height: 4,
|
|
613
618
|
barClassName: "bg-action-primary-bg"
|
|
614
|
-
}), /* @__PURE__ */
|
|
619
|
+
}), /* @__PURE__ */ T("p", {
|
|
615
620
|
className: "text-xs text-text-tertiary",
|
|
616
621
|
children: [
|
|
617
|
-
/* @__PURE__ */
|
|
622
|
+
/* @__PURE__ */ w("span", {
|
|
618
623
|
className: "tabular-nums text-text-secondary",
|
|
619
|
-
children:
|
|
624
|
+
children: q(B, O.data?.pageInfo?.hasMore)
|
|
620
625
|
}),
|
|
621
626
|
" ",
|
|
622
627
|
"lots total"
|
|
@@ -624,44 +629,44 @@ function R() {
|
|
|
624
629
|
})]
|
|
625
630
|
})
|
|
626
631
|
}),
|
|
627
|
-
/* @__PURE__ */
|
|
628
|
-
icon: /* @__PURE__ */
|
|
629
|
-
value:
|
|
632
|
+
/* @__PURE__ */ w(r, {
|
|
633
|
+
icon: /* @__PURE__ */ w(be, { className: "h-5 w-5" }),
|
|
634
|
+
value: k.isError ? "—" : o(K),
|
|
630
635
|
label: "Certs need attention",
|
|
631
|
-
accent:
|
|
632
|
-
footer: /* @__PURE__ */
|
|
633
|
-
className:
|
|
634
|
-
children:
|
|
636
|
+
accent: K > 0 ? "warning" : V.length > 0 ? "success" : void 0,
|
|
637
|
+
footer: /* @__PURE__ */ w("p", {
|
|
638
|
+
className: K > 0 ? "text-xs font-medium text-status-warning-text" : "text-xs text-text-tertiary",
|
|
639
|
+
children: V.length === 0 ? "No certifications tracked yet" : K > 0 ? `${je} pending · ${Me} expiring` : "All certifications current"
|
|
635
640
|
})
|
|
636
641
|
})
|
|
637
642
|
]
|
|
638
643
|
}),
|
|
639
|
-
/* @__PURE__ */
|
|
644
|
+
/* @__PURE__ */ T("div", {
|
|
640
645
|
className: "mt-6 grid grid-cols-1 gap-6 lg:grid-cols-3",
|
|
641
|
-
children: [/* @__PURE__ */
|
|
646
|
+
children: [/* @__PURE__ */ w(I, {
|
|
642
647
|
className: "lg:col-span-2",
|
|
643
648
|
title: "Production trend",
|
|
644
649
|
caption: "Metered output aggregated by month across your producing assets.",
|
|
645
|
-
icon: /* @__PURE__ */
|
|
650
|
+
icon: /* @__PURE__ */ w(de, { className: "h-4 w-4" }),
|
|
646
651
|
link: {
|
|
647
652
|
label: "Production",
|
|
648
653
|
onClick: () => t("production")
|
|
649
654
|
},
|
|
650
|
-
isLoading:
|
|
651
|
-
isError:
|
|
652
|
-
onRetry: () =>
|
|
653
|
-
isEmpty:
|
|
655
|
+
isLoading: M.isLoading,
|
|
656
|
+
isError: M.isError,
|
|
657
|
+
onRetry: () => M.refetch(),
|
|
658
|
+
isEmpty: J.length === 0,
|
|
654
659
|
emptyLabel: "No production logged yet — record output to build the trend.",
|
|
655
|
-
footer:
|
|
656
|
-
children: /* @__PURE__ */
|
|
657
|
-
series:
|
|
660
|
+
footer: J.length > 0 ? `${o(Ae, { maximumFractionDigits: 0 })} total volume across ${q(H, M.data?.pageInfo?.hasMore)} records` : void 0,
|
|
661
|
+
children: /* @__PURE__ */ w(te, {
|
|
662
|
+
series: J,
|
|
658
663
|
height: 220,
|
|
659
664
|
title: "Monthly production volume"
|
|
660
665
|
})
|
|
661
|
-
}), /* @__PURE__ */
|
|
666
|
+
}), /* @__PURE__ */ w(I, {
|
|
662
667
|
title: "Commodity mix",
|
|
663
668
|
caption: "Share of assets across your commodity streams.",
|
|
664
|
-
icon: /* @__PURE__ */
|
|
669
|
+
icon: /* @__PURE__ */ w(he, { className: "h-4 w-4" }),
|
|
665
670
|
link: {
|
|
666
671
|
label: "Assets",
|
|
667
672
|
onClick: () => t("assets")
|
|
@@ -669,15 +674,15 @@ function R() {
|
|
|
669
674
|
isLoading: y.isLoading,
|
|
670
675
|
isError: y.isError,
|
|
671
676
|
onRetry: () => y.refetch(),
|
|
672
|
-
isEmpty:
|
|
677
|
+
isEmpty: Z.length === 0,
|
|
673
678
|
emptyLabel: "No assets registered yet.",
|
|
674
|
-
footer:
|
|
675
|
-
children: /* @__PURE__ */
|
|
679
|
+
footer: Z.length > 0 ? `${q(N, y.data?.pageInfo?.hasMore)} assets · ${Z.length} ${Z.length === 1 ? "commodity" : "commodities"}` : void 0,
|
|
680
|
+
children: /* @__PURE__ */ w("div", {
|
|
676
681
|
className: "flex items-center justify-center py-2",
|
|
677
|
-
children: /* @__PURE__ */
|
|
678
|
-
segments:
|
|
682
|
+
children: /* @__PURE__ */ w(b, {
|
|
683
|
+
segments: Z,
|
|
679
684
|
size: 168,
|
|
680
|
-
centerLabel: o(
|
|
685
|
+
centerLabel: o(N.length),
|
|
681
686
|
centerCaption: "assets",
|
|
682
687
|
valueFormatter: (e) => o(e),
|
|
683
688
|
title: "Assets by commodity"
|
|
@@ -685,59 +690,59 @@ function R() {
|
|
|
685
690
|
})
|
|
686
691
|
})]
|
|
687
692
|
}),
|
|
688
|
-
/* @__PURE__ */
|
|
693
|
+
/* @__PURE__ */ w(_, {
|
|
689
694
|
title: "Commodity portfolio",
|
|
690
695
|
description: "One model, every commodity — assets, capacity and output across your book.",
|
|
691
|
-
children: y.isLoading ? /* @__PURE__ */
|
|
696
|
+
children: y.isLoading ? /* @__PURE__ */ w(g, { label: "Loading commodities…" }) : y.isError ? /* @__PURE__ */ w(h, {
|
|
692
697
|
message: "Couldn't load your commodity portfolio.",
|
|
693
698
|
onRetry: () => y.refetch()
|
|
694
|
-
}) :
|
|
699
|
+
}) : Ie.length === 0 ? /* @__PURE__ */ w(v, {
|
|
695
700
|
illustration: "empty-data",
|
|
696
|
-
icon: /* @__PURE__ */
|
|
701
|
+
icon: /* @__PURE__ */ w(ve, { className: "h-10 w-10" }),
|
|
697
702
|
title: "No commodities yet",
|
|
698
703
|
description: "Register your first resource asset to build out your commodity portfolio."
|
|
699
|
-
}) : /* @__PURE__ */
|
|
704
|
+
}) : /* @__PURE__ */ w("div", {
|
|
700
705
|
className: "grid grid-cols-1 gap-4 sm:grid-cols-2 xl:grid-cols-4",
|
|
701
|
-
children:
|
|
706
|
+
children: Ie.map((e) => /* @__PURE__ */ w(De, {
|
|
702
707
|
card: e,
|
|
703
708
|
onOpen: () => t("assets")
|
|
704
709
|
}, e.key))
|
|
705
710
|
})
|
|
706
711
|
}),
|
|
707
|
-
/* @__PURE__ */
|
|
712
|
+
/* @__PURE__ */ T("div", {
|
|
708
713
|
className: "mt-6 grid grid-cols-1 gap-6 lg:grid-cols-2",
|
|
709
|
-
children: [/* @__PURE__ */
|
|
714
|
+
children: [/* @__PURE__ */ w(Ee, {
|
|
710
715
|
title: "Assets by lifecycle",
|
|
711
716
|
description: "Where the portfolio sits from exploration to retirement.",
|
|
712
|
-
icon: /* @__PURE__ */
|
|
717
|
+
icon: /* @__PURE__ */ w(_e, { className: "h-4 w-4" }),
|
|
713
718
|
linkLabel: "Assets",
|
|
714
719
|
onLink: () => t("assets"),
|
|
715
720
|
isLoading: y.isLoading,
|
|
716
721
|
isError: y.isError,
|
|
717
722
|
onRetry: () => y.refetch(),
|
|
718
723
|
emptyLabel: "No assets to profile yet.",
|
|
719
|
-
bars:
|
|
720
|
-
footer:
|
|
721
|
-
}), /* @__PURE__ */
|
|
724
|
+
bars: Pe,
|
|
725
|
+
footer: N.length > 0 ? `${U} of ${q(N, y.data?.pageInfo?.hasMore)} currently producing` : void 0
|
|
726
|
+
}), /* @__PURE__ */ w(I, {
|
|
722
727
|
title: "Emissions by scope",
|
|
723
728
|
caption: "GHG Protocol Scope 1 / 2 / 3 — tonnes CO₂e logged.",
|
|
724
|
-
icon: /* @__PURE__ */
|
|
729
|
+
icon: /* @__PURE__ */ w(ge, { className: "h-4 w-4" }),
|
|
725
730
|
link: {
|
|
726
731
|
label: "Emissions",
|
|
727
732
|
onClick: () => t("emissions")
|
|
728
733
|
},
|
|
729
|
-
isLoading:
|
|
730
|
-
isError:
|
|
731
|
-
onRetry: () =>
|
|
732
|
-
isEmpty:
|
|
734
|
+
isLoading: D.isLoading,
|
|
735
|
+
isError: D.isError,
|
|
736
|
+
onRetry: () => D.refetch(),
|
|
737
|
+
isEmpty: Ne.length === 0,
|
|
733
738
|
emptyLabel: "No emission records logged yet.",
|
|
734
|
-
footer:
|
|
735
|
-
children: /* @__PURE__ */
|
|
739
|
+
footer: z.length > 0 ? `${l(G)} across ${q(z, D.data?.pageInfo?.hasMore)} records` : void 0,
|
|
740
|
+
children: /* @__PURE__ */ w("div", {
|
|
736
741
|
className: "flex items-center justify-center py-2",
|
|
737
|
-
children: /* @__PURE__ */
|
|
738
|
-
segments:
|
|
742
|
+
children: /* @__PURE__ */ w(b, {
|
|
743
|
+
segments: Ne,
|
|
739
744
|
size: 168,
|
|
740
|
-
centerLabel: o(
|
|
745
|
+
centerLabel: o(G, {
|
|
741
746
|
notation: "compact",
|
|
742
747
|
maximumFractionDigits: 1
|
|
743
748
|
}),
|
|
@@ -748,60 +753,60 @@ function R() {
|
|
|
748
753
|
})
|
|
749
754
|
})]
|
|
750
755
|
}),
|
|
751
|
-
/* @__PURE__ */
|
|
756
|
+
/* @__PURE__ */ w(_, {
|
|
752
757
|
title: "Recent offtake contracts",
|
|
753
758
|
description: "Latest buy/sell agreements across your commodity book.",
|
|
754
|
-
action: /* @__PURE__ */
|
|
759
|
+
action: /* @__PURE__ */ T("button", {
|
|
755
760
|
type: "button",
|
|
756
761
|
onClick: () => t("contracts"),
|
|
757
762
|
className: "inline-flex items-center gap-1 text-sm font-medium text-accent hover:underline",
|
|
758
|
-
children: ["All contracts ", /* @__PURE__ */
|
|
763
|
+
children: ["All contracts ", /* @__PURE__ */ w(S, { className: "h-4 w-4" })]
|
|
759
764
|
}),
|
|
760
|
-
children:
|
|
765
|
+
children: C.isLoading ? /* @__PURE__ */ w(g, { label: "Loading contracts…" }) : C.isError ? /* @__PURE__ */ w(h, {
|
|
761
766
|
message: "Couldn't load contracts.",
|
|
762
|
-
onRetry: () =>
|
|
763
|
-
}) :
|
|
767
|
+
onRetry: () => C.refetch()
|
|
768
|
+
}) : Re.length === 0 ? /* @__PURE__ */ w(v, {
|
|
764
769
|
illustration: "empty-data",
|
|
765
|
-
icon: /* @__PURE__ */
|
|
770
|
+
icon: /* @__PURE__ */ w(ye, { className: "h-10 w-10" }),
|
|
766
771
|
title: "No contracts yet",
|
|
767
772
|
description: "Draft your first offtake contract to start tracking commodity trade."
|
|
768
|
-
}) : /* @__PURE__ */
|
|
769
|
-
columns:
|
|
770
|
-
rows:
|
|
773
|
+
}) : /* @__PURE__ */ w(m, {
|
|
774
|
+
columns: ze,
|
|
775
|
+
rows: Re,
|
|
771
776
|
rowKey: (e) => e.id,
|
|
772
777
|
onRowClick: (e) => t(`contracts/${e.id}`),
|
|
773
778
|
rowLabel: (e) => `Open contract ${e.reference}`
|
|
774
779
|
})
|
|
775
780
|
}),
|
|
776
|
-
/* @__PURE__ */
|
|
781
|
+
/* @__PURE__ */ w(_, {
|
|
777
782
|
title: "Recent production",
|
|
778
783
|
description: "Latest metered output captured against your producing assets.",
|
|
779
|
-
action: /* @__PURE__ */
|
|
784
|
+
action: /* @__PURE__ */ T("button", {
|
|
780
785
|
type: "button",
|
|
781
786
|
onClick: () => t("production"),
|
|
782
787
|
className: "inline-flex items-center gap-1 text-sm font-medium text-accent hover:underline",
|
|
783
|
-
children: ["All production ", /* @__PURE__ */
|
|
788
|
+
children: ["All production ", /* @__PURE__ */ w(S, { className: "h-4 w-4" })]
|
|
784
789
|
}),
|
|
785
|
-
children:
|
|
790
|
+
children: M.isLoading ? /* @__PURE__ */ w(g, { label: "Loading production…" }) : M.isError ? /* @__PURE__ */ w(h, {
|
|
786
791
|
message: "Couldn't load production records.",
|
|
787
|
-
onRetry: () =>
|
|
788
|
-
}) :
|
|
792
|
+
onRetry: () => M.refetch()
|
|
793
|
+
}) : Q.length === 0 ? /* @__PURE__ */ w(v, {
|
|
789
794
|
illustration: "empty-data",
|
|
790
|
-
icon: /* @__PURE__ */
|
|
795
|
+
icon: /* @__PURE__ */ w(pe, { className: "h-10 w-10" }),
|
|
791
796
|
title: "No production logged yet",
|
|
792
797
|
description: "Record production against an asset to build its output history."
|
|
793
|
-
}) : /* @__PURE__ */
|
|
794
|
-
columns:
|
|
795
|
-
rows:
|
|
798
|
+
}) : /* @__PURE__ */ w(m, {
|
|
799
|
+
columns: Be,
|
|
800
|
+
rows: Q,
|
|
796
801
|
rowKey: (e) => e.id,
|
|
797
802
|
onRowClick: (e) => t(`assets/${e.assetId}`),
|
|
798
|
-
rowLabel: (e) => `Open ${
|
|
803
|
+
rowLabel: (e) => `Open ${Le.get(e.assetId) ?? "asset"}`
|
|
799
804
|
})
|
|
800
805
|
})
|
|
801
806
|
]
|
|
802
807
|
});
|
|
803
808
|
}
|
|
804
809
|
//#endregion
|
|
805
|
-
export {
|
|
810
|
+
export { L as DashboardPage };
|
|
806
811
|
|
|
807
812
|
//# sourceMappingURL=DashboardPage.js.map
|