@burdenoff/microfe-theglobalfuel 2026.509.101
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 +12 -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 +5 -0
- package/dist/node_modules/clsx/dist/clsx.js +18 -0
- package/dist/node_modules/clsx/dist/clsx.js.map +1 -0
- package/dist/node_modules/tailwind-merge/dist/bundle-mjs.js +1674 -0
- package/dist/node_modules/tailwind-merge/dist/bundle-mjs.js.map +1 -0
- package/dist/theglobalfuel/TheGlobalFuelRoot.d.ts +5 -0
- package/dist/theglobalfuel/TheGlobalFuelRoot.d.ts.map +1 -0
- package/dist/theglobalfuel/TheGlobalFuelRoot.js +175 -0
- package/dist/theglobalfuel/TheGlobalFuelRoot.js.map +1 -0
- package/dist/theglobalfuel/TheGlobalFuelRoutes.d.ts +2 -0
- package/dist/theglobalfuel/TheGlobalFuelRoutes.d.ts.map +1 -0
- package/dist/theglobalfuel/TheGlobalFuelRoutes.js +91 -0
- package/dist/theglobalfuel/TheGlobalFuelRoutes.js.map +1 -0
- package/dist/theglobalfuel/index.d.ts +5 -0
- package/dist/theglobalfuel/index.d.ts.map +1 -0
- package/dist/theglobalfuel/index.js +3 -0
- package/dist/theglobalfuel/pages/AiIntelligencePage.d.ts +2 -0
- package/dist/theglobalfuel/pages/AiIntelligencePage.d.ts.map +1 -0
- package/dist/theglobalfuel/pages/AiIntelligencePage.js +190 -0
- package/dist/theglobalfuel/pages/AiIntelligencePage.js.map +1 -0
- package/dist/theglobalfuel/pages/AnalyticsPage.d.ts +2 -0
- package/dist/theglobalfuel/pages/AnalyticsPage.d.ts.map +1 -0
- package/dist/theglobalfuel/pages/AnalyticsPage.js +241 -0
- package/dist/theglobalfuel/pages/AnalyticsPage.js.map +1 -0
- package/dist/theglobalfuel/pages/CompliancePage.d.ts +2 -0
- package/dist/theglobalfuel/pages/CompliancePage.d.ts.map +1 -0
- package/dist/theglobalfuel/pages/CompliancePage.js +173 -0
- package/dist/theglobalfuel/pages/CompliancePage.js.map +1 -0
- package/dist/theglobalfuel/pages/DashboardPage.d.ts +2 -0
- package/dist/theglobalfuel/pages/DashboardPage.d.ts.map +1 -0
- package/dist/theglobalfuel/pages/DashboardPage.js +145 -0
- package/dist/theglobalfuel/pages/DashboardPage.js.map +1 -0
- package/dist/theglobalfuel/pages/FinancialPage.d.ts +2 -0
- package/dist/theglobalfuel/pages/FinancialPage.d.ts.map +1 -0
- package/dist/theglobalfuel/pages/FinancialPage.js +204 -0
- package/dist/theglobalfuel/pages/FinancialPage.js.map +1 -0
- package/dist/theglobalfuel/pages/FleetManagementPage.d.ts +2 -0
- package/dist/theglobalfuel/pages/FleetManagementPage.d.ts.map +1 -0
- package/dist/theglobalfuel/pages/FleetManagementPage.js +244 -0
- package/dist/theglobalfuel/pages/FleetManagementPage.js.map +1 -0
- package/dist/theglobalfuel/pages/MarketplacePage.d.ts +2 -0
- package/dist/theglobalfuel/pages/MarketplacePage.d.ts.map +1 -0
- package/dist/theglobalfuel/pages/MarketplacePage.js +260 -0
- package/dist/theglobalfuel/pages/MarketplacePage.js.map +1 -0
- package/dist/theglobalfuel/pages/OperationsPage.d.ts +2 -0
- package/dist/theglobalfuel/pages/OperationsPage.d.ts.map +1 -0
- package/dist/theglobalfuel/pages/OperationsPage.js +190 -0
- package/dist/theglobalfuel/pages/OperationsPage.js.map +1 -0
- package/dist/theglobalfuel/pages/QualityControlPage.d.ts +2 -0
- package/dist/theglobalfuel/pages/QualityControlPage.d.ts.map +1 -0
- package/dist/theglobalfuel/pages/QualityControlPage.js +215 -0
- package/dist/theglobalfuel/pages/QualityControlPage.js.map +1 -0
- package/dist/theglobalfuel/pages/ReportsPage.d.ts +2 -0
- package/dist/theglobalfuel/pages/ReportsPage.d.ts.map +1 -0
- package/dist/theglobalfuel/pages/ReportsPage.js +247 -0
- package/dist/theglobalfuel/pages/ReportsPage.js.map +1 -0
- package/dist/theglobalfuel/pages/ResourcesPage.d.ts +2 -0
- package/dist/theglobalfuel/pages/ResourcesPage.d.ts.map +1 -0
- package/dist/theglobalfuel/pages/ResourcesPage.js +225 -0
- package/dist/theglobalfuel/pages/ResourcesPage.js.map +1 -0
- package/dist/theglobalfuel/pages/RiskManagementPage.d.ts +2 -0
- package/dist/theglobalfuel/pages/RiskManagementPage.d.ts.map +1 -0
- package/dist/theglobalfuel/pages/RiskManagementPage.js +230 -0
- package/dist/theglobalfuel/pages/RiskManagementPage.js.map +1 -0
- package/dist/theglobalfuel/pages/SupplyChainPage.d.ts +2 -0
- package/dist/theglobalfuel/pages/SupplyChainPage.d.ts.map +1 -0
- package/dist/theglobalfuel/pages/SupplyChainPage.js +214 -0
- package/dist/theglobalfuel/pages/SupplyChainPage.js.map +1 -0
- package/dist/theglobalfuel/pages/SustainabilityPage.d.ts +2 -0
- package/dist/theglobalfuel/pages/SustainabilityPage.d.ts.map +1 -0
- package/dist/theglobalfuel/pages/SustainabilityPage.js +261 -0
- package/dist/theglobalfuel/pages/SustainabilityPage.js.map +1 -0
- package/dist/theglobalfuel/pages/TrainingPage.d.ts +2 -0
- package/dist/theglobalfuel/pages/TrainingPage.d.ts.map +1 -0
- package/dist/theglobalfuel/pages/TrainingPage.js +253 -0
- package/dist/theglobalfuel/pages/TrainingPage.js.map +1 -0
- package/dist/theglobalfuel/providers/TheGlobalFuelProvider.d.ts +6 -0
- package/dist/theglobalfuel/providers/TheGlobalFuelProvider.d.ts.map +1 -0
- package/dist/theglobalfuel/providers/TheGlobalFuelProvider.js +27 -0
- package/dist/theglobalfuel/providers/TheGlobalFuelProvider.js.map +1 -0
- package/dist/theglobalfuel/store/theglobalfuelStore.d.ts +163 -0
- package/dist/theglobalfuel/store/theglobalfuelStore.d.ts.map +1 -0
- package/dist/theglobalfuel/store/theglobalfuelStore.js +712 -0
- package/dist/theglobalfuel/store/theglobalfuelStore.js.map +1 -0
- package/dist/theglobalfuel/types/index.d.ts +51 -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/cn.js +10 -0
- package/dist/theglobalfuel/utils/cn.js.map +1 -0
- package/dist/theglobalfuel/utils/i18n.d.ts +6 -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/navigation.d.ts +2 -0
- package/dist/theglobalfuel/utils/navigation.d.ts.map +1 -0
- package/dist/theglobalfuel/utils/navigation.js +8 -0
- package/dist/theglobalfuel/utils/navigation.js.map +1 -0
- package/package.json +107 -0
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
import { useTheGlobalFuelStore as e } from "../store/theglobalfuelStore.js";
|
|
2
|
+
import { AlertTriangle as t, CheckCircle as n, Clock as r, FileText as i, Shield as a } from "lucide-react";
|
|
3
|
+
import { jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
4
|
+
import { Badge as c, Button as l, Card as u, CardContent as d, CardHeader as f, CardTitle as p } from "@burdenoff/fe-libs/ui";
|
|
5
|
+
//#region src/theglobalfuel/pages/CompliancePage.tsx
|
|
6
|
+
function m() {
|
|
7
|
+
let { compliance: m } = e(), h = m.filter((e) => e.status === "compliant").length, g = (m.reduce((e, t) => e + t.score, 0) / m.length).toFixed(1);
|
|
8
|
+
return /* @__PURE__ */ s("div", {
|
|
9
|
+
className: "space-y-6 p-6",
|
|
10
|
+
children: [
|
|
11
|
+
/* @__PURE__ */ s("div", {
|
|
12
|
+
className: "flex items-center justify-between",
|
|
13
|
+
children: [/* @__PURE__ */ s("div", { children: [/* @__PURE__ */ s("h1", {
|
|
14
|
+
className: "flex items-center gap-2 text-2xl font-semibold",
|
|
15
|
+
children: [/* @__PURE__ */ o(a, { className: "h-7 w-7 text-green-600" }), "Regulatory Compliance"]
|
|
16
|
+
}), /* @__PURE__ */ o("p", {
|
|
17
|
+
className: "mt-1 text-sm text-muted-foreground",
|
|
18
|
+
children: "EPA, OSHA, DOT, and industry regulatory compliance for petroleum operations"
|
|
19
|
+
})] }), /* @__PURE__ */ s(l, { children: [/* @__PURE__ */ o(i, { className: "mr-2 h-4 w-4" }), "Generate Report"] })]
|
|
20
|
+
}),
|
|
21
|
+
/* @__PURE__ */ s("div", {
|
|
22
|
+
className: "grid gap-4 md:grid-cols-2 lg:grid-cols-4",
|
|
23
|
+
children: [
|
|
24
|
+
/* @__PURE__ */ s(u, { children: [/* @__PURE__ */ s(f, {
|
|
25
|
+
className: "flex flex-row items-center justify-between space-y-0 pb-2",
|
|
26
|
+
children: [/* @__PURE__ */ o(p, {
|
|
27
|
+
className: "text-sm font-medium",
|
|
28
|
+
children: "Overall Score"
|
|
29
|
+
}), /* @__PURE__ */ o(a, { className: "h-4 w-4 text-green-600" })]
|
|
30
|
+
}), /* @__PURE__ */ s(d, { children: [/* @__PURE__ */ s("div", {
|
|
31
|
+
className: "text-2xl font-bold",
|
|
32
|
+
children: [g, "%"]
|
|
33
|
+
}), /* @__PURE__ */ o("p", {
|
|
34
|
+
className: "text-xs text-muted-foreground",
|
|
35
|
+
children: "+2.1% from last quarter"
|
|
36
|
+
})] })] }),
|
|
37
|
+
/* @__PURE__ */ s(u, { children: [/* @__PURE__ */ s(f, {
|
|
38
|
+
className: "flex flex-row items-center justify-between space-y-0 pb-2",
|
|
39
|
+
children: [/* @__PURE__ */ o(p, {
|
|
40
|
+
className: "text-sm font-medium",
|
|
41
|
+
children: "Compliant"
|
|
42
|
+
}), /* @__PURE__ */ o(n, { className: "h-4 w-4 text-green-600" })]
|
|
43
|
+
}), /* @__PURE__ */ s(d, { children: [/* @__PURE__ */ s("div", {
|
|
44
|
+
className: "text-2xl font-bold",
|
|
45
|
+
children: [
|
|
46
|
+
h,
|
|
47
|
+
"/",
|
|
48
|
+
m.length
|
|
49
|
+
]
|
|
50
|
+
}), /* @__PURE__ */ s("p", {
|
|
51
|
+
className: "text-xs text-muted-foreground",
|
|
52
|
+
children: [m.length - h, " under review"]
|
|
53
|
+
})] })] }),
|
|
54
|
+
/* @__PURE__ */ s(u, { children: [/* @__PURE__ */ s(f, {
|
|
55
|
+
className: "flex flex-row items-center justify-between space-y-0 pb-2",
|
|
56
|
+
children: [/* @__PURE__ */ o(p, {
|
|
57
|
+
className: "text-sm font-medium",
|
|
58
|
+
children: "Active Audits"
|
|
59
|
+
}), /* @__PURE__ */ o(i, { className: "h-4 w-4 text-blue-600" })]
|
|
60
|
+
}), /* @__PURE__ */ s(d, { children: [/* @__PURE__ */ o("div", {
|
|
61
|
+
className: "text-2xl font-bold",
|
|
62
|
+
children: "3"
|
|
63
|
+
}), /* @__PURE__ */ o("p", {
|
|
64
|
+
className: "text-xs text-muted-foreground",
|
|
65
|
+
children: "EPA, OSHA, Pipeline Safety"
|
|
66
|
+
})] })] }),
|
|
67
|
+
/* @__PURE__ */ s(u, { children: [/* @__PURE__ */ s(f, {
|
|
68
|
+
className: "flex flex-row items-center justify-between space-y-0 pb-2",
|
|
69
|
+
children: [/* @__PURE__ */ o(p, {
|
|
70
|
+
className: "text-sm font-medium",
|
|
71
|
+
children: "Violations"
|
|
72
|
+
}), /* @__PURE__ */ o(t, { className: "h-4 w-4 text-red-600" })]
|
|
73
|
+
}), /* @__PURE__ */ s(d, { children: [/* @__PURE__ */ o("div", {
|
|
74
|
+
className: "text-2xl font-bold",
|
|
75
|
+
children: "0"
|
|
76
|
+
}), /* @__PURE__ */ o("p", {
|
|
77
|
+
className: "text-xs text-muted-foreground",
|
|
78
|
+
children: "Clean record this quarter"
|
|
79
|
+
})] })] })
|
|
80
|
+
]
|
|
81
|
+
}),
|
|
82
|
+
/* @__PURE__ */ s("div", {
|
|
83
|
+
className: "grid gap-4 lg:grid-cols-2",
|
|
84
|
+
children: [/* @__PURE__ */ s(u, { children: [/* @__PURE__ */ o(f, { children: /* @__PURE__ */ o(p, { children: "Regulatory Status" }) }), /* @__PURE__ */ o(d, {
|
|
85
|
+
className: "space-y-4",
|
|
86
|
+
children: m.map((e) => /* @__PURE__ */ s("div", {
|
|
87
|
+
className: "space-y-2",
|
|
88
|
+
children: [
|
|
89
|
+
/* @__PURE__ */ s("div", {
|
|
90
|
+
className: "flex items-center justify-between",
|
|
91
|
+
children: [/* @__PURE__ */ o("span", {
|
|
92
|
+
className: "text-sm font-medium",
|
|
93
|
+
children: e.framework
|
|
94
|
+
}), /* @__PURE__ */ o(c, {
|
|
95
|
+
variant: "outline",
|
|
96
|
+
className: e.status === "compliant" ? "text-green-600" : "text-amber-600",
|
|
97
|
+
children: e.status === "compliant" ? "Compliant" : "Under Review"
|
|
98
|
+
})]
|
|
99
|
+
}),
|
|
100
|
+
/* @__PURE__ */ o("div", {
|
|
101
|
+
className: "h-2 w-full rounded-full bg-muted",
|
|
102
|
+
children: /* @__PURE__ */ o("div", {
|
|
103
|
+
className: `h-2 rounded-full ${e.score >= 95 ? "bg-green-500" : e.score >= 85 ? "bg-amber-500" : "bg-red-500"}`,
|
|
104
|
+
style: { width: `${e.score}%` }
|
|
105
|
+
})
|
|
106
|
+
}),
|
|
107
|
+
/* @__PURE__ */ s("div", {
|
|
108
|
+
className: "flex justify-between text-xs text-muted-foreground",
|
|
109
|
+
children: [/* @__PURE__ */ s("span", { children: [
|
|
110
|
+
"Score: ",
|
|
111
|
+
e.score,
|
|
112
|
+
"%"
|
|
113
|
+
] }), /* @__PURE__ */ s("span", { children: ["Next: ", e.nextAudit] })]
|
|
114
|
+
})
|
|
115
|
+
]
|
|
116
|
+
}, e.id))
|
|
117
|
+
})] }), /* @__PURE__ */ s(u, { children: [/* @__PURE__ */ o(f, { children: /* @__PURE__ */ o(p, { children: "Recent Activities" }) }), /* @__PURE__ */ o(d, {
|
|
118
|
+
className: "space-y-4",
|
|
119
|
+
children: [
|
|
120
|
+
{
|
|
121
|
+
icon: n,
|
|
122
|
+
color: "text-green-600",
|
|
123
|
+
title: "EPA inspection passed",
|
|
124
|
+
desc: "Gulf Coast Refinery - 96%",
|
|
125
|
+
time: "2 days ago"
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
icon: i,
|
|
129
|
+
color: "text-blue-600",
|
|
130
|
+
title: "DOT pipeline audit completed",
|
|
131
|
+
desc: "Segment 1-8 integrity checks passed",
|
|
132
|
+
time: "5 days ago"
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
icon: r,
|
|
136
|
+
color: "text-amber-600",
|
|
137
|
+
title: "SPCC plan update required",
|
|
138
|
+
desc: "Annual review due in 30 days",
|
|
139
|
+
time: "1 week ago"
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
icon: t,
|
|
143
|
+
color: "text-orange-600",
|
|
144
|
+
title: "OSHA PSM drill scheduled",
|
|
145
|
+
desc: "Emergency response drill - Baytown",
|
|
146
|
+
time: "Due in 10 days"
|
|
147
|
+
}
|
|
148
|
+
].map((e, t) => /* @__PURE__ */ s("div", {
|
|
149
|
+
className: "flex items-start gap-3",
|
|
150
|
+
children: [/* @__PURE__ */ o(e.icon, { className: `mt-0.5 h-5 w-5 ${e.color}` }), /* @__PURE__ */ s("div", { children: [
|
|
151
|
+
/* @__PURE__ */ o("p", {
|
|
152
|
+
className: "text-sm font-medium",
|
|
153
|
+
children: e.title
|
|
154
|
+
}),
|
|
155
|
+
/* @__PURE__ */ o("p", {
|
|
156
|
+
className: "text-xs text-muted-foreground",
|
|
157
|
+
children: e.desc
|
|
158
|
+
}),
|
|
159
|
+
/* @__PURE__ */ o("p", {
|
|
160
|
+
className: "text-xs text-muted-foreground",
|
|
161
|
+
children: e.time
|
|
162
|
+
})
|
|
163
|
+
] })]
|
|
164
|
+
}, t))
|
|
165
|
+
})] })]
|
|
166
|
+
})
|
|
167
|
+
]
|
|
168
|
+
});
|
|
169
|
+
}
|
|
170
|
+
//#endregion
|
|
171
|
+
export { m as CompliancePage };
|
|
172
|
+
|
|
173
|
+
//# sourceMappingURL=CompliancePage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CompliancePage.js","names":[],"sources":["../../../src/theglobalfuel/pages/CompliancePage.tsx"],"sourcesContent":["import { Card, CardContent, CardHeader, CardTitle, Badge, Button } from '@burdenoff/fe-libs/ui';\nimport { Shield, CheckCircle, FileText, AlertTriangle, Clock } from 'lucide-react';\nimport { useTheGlobalFuelStore } from '../store/theglobalfuelStore';\n\nexport function CompliancePage() {\n const { compliance } = useTheGlobalFuelStore();\n const compliantCount = compliance.filter((c) => c.status === 'compliant').length;\n const avgScore = (compliance.reduce((a, c) => a + c.score, 0) / compliance.length).toFixed(1);\n\n return (\n <div className=\"space-y-6 p-6\">\n <div className=\"flex items-center justify-between\">\n <div>\n <h1 className=\"flex items-center gap-2 text-2xl font-semibold\">\n <Shield className=\"h-7 w-7 text-green-600\" />\n Regulatory Compliance\n </h1>\n <p className=\"mt-1 text-sm text-muted-foreground\">\n EPA, OSHA, DOT, and industry regulatory compliance for petroleum operations\n </p>\n </div>\n <Button>\n <FileText className=\"mr-2 h-4 w-4\" />\n Generate Report\n </Button>\n </div>\n <div className=\"grid gap-4 md:grid-cols-2 lg:grid-cols-4\">\n <Card>\n <CardHeader className=\"flex flex-row items-center justify-between space-y-0 pb-2\">\n <CardTitle className=\"text-sm font-medium\">Overall Score</CardTitle>\n <Shield className=\"h-4 w-4 text-green-600\" />\n </CardHeader>\n <CardContent>\n <div className=\"text-2xl font-bold\">{avgScore}%</div>\n <p className=\"text-xs text-muted-foreground\">+2.1% from last quarter</p>\n </CardContent>\n </Card>\n <Card>\n <CardHeader className=\"flex flex-row items-center justify-between space-y-0 pb-2\">\n <CardTitle className=\"text-sm font-medium\">Compliant</CardTitle>\n <CheckCircle className=\"h-4 w-4 text-green-600\" />\n </CardHeader>\n <CardContent>\n <div className=\"text-2xl font-bold\">\n {compliantCount}/{compliance.length}\n </div>\n <p className=\"text-xs text-muted-foreground\">\n {compliance.length - compliantCount} under review\n </p>\n </CardContent>\n </Card>\n <Card>\n <CardHeader className=\"flex flex-row items-center justify-between space-y-0 pb-2\">\n <CardTitle className=\"text-sm font-medium\">Active Audits</CardTitle>\n <FileText className=\"h-4 w-4 text-blue-600\" />\n </CardHeader>\n <CardContent>\n <div className=\"text-2xl font-bold\">3</div>\n <p className=\"text-xs text-muted-foreground\">EPA, OSHA, Pipeline Safety</p>\n </CardContent>\n </Card>\n <Card>\n <CardHeader className=\"flex flex-row items-center justify-between space-y-0 pb-2\">\n <CardTitle className=\"text-sm font-medium\">Violations</CardTitle>\n <AlertTriangle className=\"h-4 w-4 text-red-600\" />\n </CardHeader>\n <CardContent>\n <div className=\"text-2xl font-bold\">0</div>\n <p className=\"text-xs text-muted-foreground\">Clean record this quarter</p>\n </CardContent>\n </Card>\n </div>\n <div className=\"grid gap-4 lg:grid-cols-2\">\n <Card>\n <CardHeader>\n <CardTitle>Regulatory Status</CardTitle>\n </CardHeader>\n <CardContent className=\"space-y-4\">\n {compliance.map((c) => (\n <div key={c.id} className=\"space-y-2\">\n <div className=\"flex items-center justify-between\">\n <span className=\"text-sm font-medium\">{c.framework}</span>\n <Badge\n variant=\"outline\"\n className={c.status === 'compliant' ? 'text-green-600' : 'text-amber-600'}\n >\n {c.status === 'compliant' ? 'Compliant' : 'Under Review'}\n </Badge>\n </div>\n <div className=\"h-2 w-full rounded-full bg-muted\">\n <div\n className={`h-2 rounded-full ${c.score >= 95 ? 'bg-green-500' : c.score >= 85 ? 'bg-amber-500' : 'bg-red-500'}`}\n style={{ width: `${c.score}%` }}\n />\n </div>\n <div className=\"flex justify-between text-xs text-muted-foreground\">\n <span>Score: {c.score}%</span>\n <span>Next: {c.nextAudit}</span>\n </div>\n </div>\n ))}\n </CardContent>\n </Card>\n <Card>\n <CardHeader>\n <CardTitle>Recent Activities</CardTitle>\n </CardHeader>\n <CardContent className=\"space-y-4\">\n {[\n {\n icon: CheckCircle,\n color: 'text-green-600',\n title: 'EPA inspection passed',\n desc: 'Gulf Coast Refinery - 96%',\n time: '2 days ago',\n },\n {\n icon: FileText,\n color: 'text-blue-600',\n title: 'DOT pipeline audit completed',\n desc: 'Segment 1-8 integrity checks passed',\n time: '5 days ago',\n },\n {\n icon: Clock,\n color: 'text-amber-600',\n title: 'SPCC plan update required',\n desc: 'Annual review due in 30 days',\n time: '1 week ago',\n },\n {\n icon: AlertTriangle,\n color: 'text-orange-600',\n title: 'OSHA PSM drill scheduled',\n desc: 'Emergency response drill - Baytown',\n time: 'Due in 10 days',\n },\n ].map((a, i) => (\n <div key={i} className=\"flex items-start gap-3\">\n <a.icon className={`mt-0.5 h-5 w-5 ${a.color}`} />\n <div>\n <p className=\"text-sm font-medium\">{a.title}</p>\n <p className=\"text-xs text-muted-foreground\">{a.desc}</p>\n <p className=\"text-xs text-muted-foreground\">{a.time}</p>\n </div>\n </div>\n ))}\n </CardContent>\n </Card>\n </div>\n </div>\n );\n}\n"],"mappings":";;;;;AAIA,SAAgB,IAAiB;CAC/B,IAAM,EAAE,kBAAe,GAAuB,EACxC,IAAiB,EAAW,QAAQ,MAAM,EAAE,WAAW,YAAY,CAAC,QACpE,KAAY,EAAW,QAAQ,GAAG,MAAM,IAAI,EAAE,OAAO,EAAE,GAAG,EAAW,QAAQ,QAAQ,EAAE;AAE7F,QACE,kBAAC,OAAD;EAAK,WAAU;YAAf;GACE,kBAAC,OAAD;IAAK,WAAU;cAAf,CACE,kBAAC,OAAD,EAAA,UAAA,CACE,kBAAC,MAAD;KAAI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C,QAAD,EAAA,UAAA,CAAM,UAAO,EAAE,UAAiB,EAAA,CAAA,CAC5B;;OACF;QApBI,EAAE,GAoBN,CACN;KACU,CAAA,CACT,EAAA,CAAA,EACP,kBAAC,GAAD,EAAA,UAAA,CACE,kBAAC,GAAD,EAAA,UACE,kBAAC,GAAD,EAAA,UAAW,qBAA6B,CAAA,EAC7B,CAAA,EACb,kBAAC,GAAD;KAAa,WAAU;eACpB;MACC;OACE,MAAM;OACN,OAAO;OACP,OAAO;OACP,MAAM;OACN,MAAM;OACP;MACD;OACE,MAAM;OACN,OAAO;OACP,OAAO;OACP,MAAM;OACN,MAAM;OACP;MACD;OACE,MAAM;OACN,OAAO;OACP,OAAO;OACP,MAAM;OACN,MAAM;OACP;MACD;OACE,MAAM;OACN,OAAO;OACP,OAAO;OACP,MAAM;OACN,MAAM;OACP;MACF,CAAC,KAAK,GAAG,MACR,kBAAC,OAAD;MAAa,WAAU;gBAAvB,CACE,kBAAC,EAAE,MAAH,EAAQ,WAAW,kBAAkB,EAAE,SAAW,CAAA,EAClD,kBAAC,OAAD,EAAA,UAAA;OACE,kBAAC,KAAD;QAAG,WAAU;kBAAuB,EAAE;QAAU,CAAA;OAChD,kBAAC,KAAD;QAAG,WAAU;kBAAiC,EAAE;QAAS,CAAA;OACzD,kBAAC,KAAD;QAAG,WAAU;kBAAiC,EAAE;QAAS,CAAA;OACrD,EAAA,CAAA,CACF;QAPI,EAOJ,CACN;KACU,CAAA,CACT,EAAA,CAAA,CACH;;GACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DashboardPage.d.ts","sourceRoot":"","sources":["../../../src/theglobalfuel/pages/DashboardPage.tsx"],"names":[],"mappings":"AAeA,wBAAgB,aAAa,4CA4J5B"}
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
import { useTheGlobalFuelStore as e } from "../store/theglobalfuelStore.js";
|
|
2
|
+
import { tWithFallback as t } from "../utils/i18n.js";
|
|
3
|
+
import { useI18n as n } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
4
|
+
import { Activity as r, AlertTriangle as i, Droplets as a, Factory as o, Flame as s, Fuel as c, Gauge as l, TrendingUp as u } from "lucide-react";
|
|
5
|
+
import { jsx as d, jsxs as f } from "react/jsx-runtime";
|
|
6
|
+
import { Card as p, CardContent as m, CardHeader as h, CardTitle as g } from "@burdenoff/fe-libs/ui";
|
|
7
|
+
//#region src/theglobalfuel/pages/DashboardPage.tsx
|
|
8
|
+
function _() {
|
|
9
|
+
let { t: _ } = n(), v = (e, n, r) => t(_, e, n, r), { metrics: y, workItems: b, facilities: x } = e(), S = x.filter((e) => e.status === "operational").length, C = y.map((e) => ({
|
|
10
|
+
...e,
|
|
11
|
+
label: e.label === "Daily Production" ? v("theglobalfuel.dashboard.metrics.dailyProduction.label", "Daily Production") : e.label === "Pipeline Throughput" ? v("theglobalfuel.dashboard.metrics.pipelineThroughput.label", "Pipeline Throughput") : e.label === "Refinery Utilization" ? v("theglobalfuel.dashboard.metrics.refineryUtilization.label", "Refinery Utilization") : v("theglobalfuel.dashboard.metrics.esgScore.label", "ESG Score"),
|
|
12
|
+
trend: v("theglobalfuel.dashboard.metrics.trendSuffix", "{{trend}} from last period", { trend: e.trend })
|
|
13
|
+
})), w = (e) => {
|
|
14
|
+
switch (e) {
|
|
15
|
+
case "active": return v("theglobalfuel.dashboard.workItems.status.active", "active");
|
|
16
|
+
case "planned": return v("theglobalfuel.dashboard.workItems.status.planned", "planned");
|
|
17
|
+
case "at_risk": return v("theglobalfuel.dashboard.workItems.status.atRisk", "at risk");
|
|
18
|
+
case "completed": return v("theglobalfuel.dashboard.workItems.status.completed", "completed");
|
|
19
|
+
default: return e.replace("_", " ");
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
return /* @__PURE__ */ f("div", {
|
|
23
|
+
className: "space-y-6 p-6",
|
|
24
|
+
children: [
|
|
25
|
+
/* @__PURE__ */ d("div", {
|
|
26
|
+
className: "flex items-center justify-between",
|
|
27
|
+
children: /* @__PURE__ */ f("div", { children: [/* @__PURE__ */ f("h1", {
|
|
28
|
+
className: "flex items-center gap-2 text-2xl font-semibold",
|
|
29
|
+
children: [/* @__PURE__ */ d(c, { className: "h-7 w-7 text-amber-600" }), v("theglobalfuel.dashboard.title", "Energy Operations Dashboard")]
|
|
30
|
+
}), /* @__PURE__ */ d("p", {
|
|
31
|
+
className: "mt-1 text-sm text-muted-foreground",
|
|
32
|
+
children: v("theglobalfuel.dashboard.description", "Real-time overview of petroleum, natural gas, and refinery operations")
|
|
33
|
+
})] })
|
|
34
|
+
}),
|
|
35
|
+
/* @__PURE__ */ d("div", {
|
|
36
|
+
className: "grid gap-4 md:grid-cols-2 lg:grid-cols-4",
|
|
37
|
+
children: C.map((e, t) => {
|
|
38
|
+
let n = [
|
|
39
|
+
o,
|
|
40
|
+
a,
|
|
41
|
+
l,
|
|
42
|
+
u
|
|
43
|
+
], i = [
|
|
44
|
+
"text-blue-600",
|
|
45
|
+
"text-cyan-600",
|
|
46
|
+
"text-amber-600",
|
|
47
|
+
"text-green-600"
|
|
48
|
+
], s = n[t] ?? r;
|
|
49
|
+
return /* @__PURE__ */ f(p, { children: [/* @__PURE__ */ f(h, {
|
|
50
|
+
className: "flex flex-row items-center justify-between space-y-0 pb-2",
|
|
51
|
+
children: [/* @__PURE__ */ d(g, {
|
|
52
|
+
className: "text-sm font-medium",
|
|
53
|
+
children: e.label
|
|
54
|
+
}), /* @__PURE__ */ d(s, { className: `h-4 w-4 ${i[t] ?? "text-muted-foreground"}` })]
|
|
55
|
+
}), /* @__PURE__ */ f(m, { children: [/* @__PURE__ */ d("div", {
|
|
56
|
+
className: "text-2xl font-bold",
|
|
57
|
+
children: e.value
|
|
58
|
+
}), /* @__PURE__ */ d("p", {
|
|
59
|
+
className: "text-xs text-muted-foreground",
|
|
60
|
+
children: e.trend
|
|
61
|
+
})] })] }, e.label);
|
|
62
|
+
})
|
|
63
|
+
}),
|
|
64
|
+
/* @__PURE__ */ f("div", {
|
|
65
|
+
className: "grid gap-4 md:grid-cols-7",
|
|
66
|
+
children: [/* @__PURE__ */ f(p, {
|
|
67
|
+
className: "col-span-4",
|
|
68
|
+
children: [/* @__PURE__ */ d(h, { children: /* @__PURE__ */ f(g, {
|
|
69
|
+
className: "flex items-center gap-2",
|
|
70
|
+
children: [/* @__PURE__ */ d(o, { className: "h-5 w-5 text-blue-600" }), v("theglobalfuel.dashboard.facilityStatus.title", "Facility Status")]
|
|
71
|
+
}) }), /* @__PURE__ */ f(m, {
|
|
72
|
+
className: "space-y-3",
|
|
73
|
+
children: [x.map((e) => /* @__PURE__ */ f("div", {
|
|
74
|
+
className: "flex items-center justify-between rounded-lg border p-3",
|
|
75
|
+
children: [/* @__PURE__ */ f("div", { children: [/* @__PURE__ */ d("p", {
|
|
76
|
+
className: "text-sm font-medium",
|
|
77
|
+
children: e.name
|
|
78
|
+
}), /* @__PURE__ */ f("p", {
|
|
79
|
+
className: "text-xs text-muted-foreground",
|
|
80
|
+
children: [
|
|
81
|
+
e.location,
|
|
82
|
+
" · ",
|
|
83
|
+
e.type.replace(/_/g, " ")
|
|
84
|
+
]
|
|
85
|
+
})] }), /* @__PURE__ */ f("div", {
|
|
86
|
+
className: "flex items-center gap-3",
|
|
87
|
+
children: [/* @__PURE__ */ f("div", {
|
|
88
|
+
className: "text-right",
|
|
89
|
+
children: [/* @__PURE__ */ f("p", {
|
|
90
|
+
className: "text-sm font-medium",
|
|
91
|
+
children: [e.utilization, "%"]
|
|
92
|
+
}), /* @__PURE__ */ d("p", {
|
|
93
|
+
className: "text-xs text-muted-foreground",
|
|
94
|
+
children: e.capacity
|
|
95
|
+
})]
|
|
96
|
+
}), /* @__PURE__ */ d("span", { className: `inline-block h-2.5 w-2.5 rounded-full ${e.status === "operational" ? "bg-green-500" : e.status === "maintenance" ? "bg-orange-500" : "bg-red-500"}` })]
|
|
97
|
+
})]
|
|
98
|
+
}, e.id)), /* @__PURE__ */ d("p", {
|
|
99
|
+
className: "text-xs text-muted-foreground",
|
|
100
|
+
children: v("theglobalfuel.dashboard.facilityStatus.summary", "{{count}} of {{total}} facilities operational", {
|
|
101
|
+
count: S,
|
|
102
|
+
total: x.length
|
|
103
|
+
})
|
|
104
|
+
})]
|
|
105
|
+
})]
|
|
106
|
+
}), /* @__PURE__ */ f(p, {
|
|
107
|
+
className: "col-span-3",
|
|
108
|
+
children: [/* @__PURE__ */ d(h, { children: /* @__PURE__ */ f(g, {
|
|
109
|
+
className: "flex items-center gap-2",
|
|
110
|
+
children: [/* @__PURE__ */ d(s, { className: "h-5 w-5 text-orange-600" }), v("theglobalfuel.dashboard.workItems.title", "Active Work Items")]
|
|
111
|
+
}) }), /* @__PURE__ */ d(m, {
|
|
112
|
+
className: "space-y-4",
|
|
113
|
+
children: b.map((e) => /* @__PURE__ */ f("div", {
|
|
114
|
+
className: "flex items-center justify-between",
|
|
115
|
+
children: [/* @__PURE__ */ f("div", {
|
|
116
|
+
className: "flex-1",
|
|
117
|
+
children: [/* @__PURE__ */ f("div", {
|
|
118
|
+
className: "flex items-center gap-2",
|
|
119
|
+
children: [e.status === "at_risk" && /* @__PURE__ */ d(i, { className: "h-3.5 w-3.5 text-orange-500" }), /* @__PURE__ */ d("p", {
|
|
120
|
+
className: "text-sm font-medium",
|
|
121
|
+
children: e.title
|
|
122
|
+
})]
|
|
123
|
+
}), /* @__PURE__ */ f("p", {
|
|
124
|
+
className: "text-xs text-muted-foreground",
|
|
125
|
+
children: [
|
|
126
|
+
e.owner,
|
|
127
|
+
" · ",
|
|
128
|
+
e.updatedAt
|
|
129
|
+
]
|
|
130
|
+
})]
|
|
131
|
+
}), /* @__PURE__ */ d("span", {
|
|
132
|
+
className: `rounded-full px-2 py-0.5 text-xs font-medium ${e.status === "active" ? "bg-blue-100 text-blue-700" : e.status === "planned" ? "bg-gray-100 text-gray-700" : e.status === "at_risk" ? "bg-orange-100 text-orange-700" : "bg-green-100 text-green-700"}`,
|
|
133
|
+
children: w(e.status)
|
|
134
|
+
})]
|
|
135
|
+
}, e.id))
|
|
136
|
+
})]
|
|
137
|
+
})]
|
|
138
|
+
})
|
|
139
|
+
]
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
//#endregion
|
|
143
|
+
export { _ as DashboardPage };
|
|
144
|
+
|
|
145
|
+
//# sourceMappingURL=DashboardPage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DashboardPage.js","names":[],"sources":["../../../src/theglobalfuel/pages/DashboardPage.tsx"],"sourcesContent":["import { useI18n } from '@burdenoff/fe-libs/shared/providers/shell/I18nProvider';\nimport { Card, CardContent, CardHeader, CardTitle } from '@burdenoff/fe-libs/ui';\nimport {\n Fuel,\n Activity,\n Factory,\n Gauge,\n TrendingUp,\n AlertTriangle,\n Droplets,\n Flame,\n} from 'lucide-react';\nimport { useTheGlobalFuelStore } from '../store/theglobalfuelStore';\nimport { tWithFallback } from '../utils/i18n';\n\nexport function DashboardPage() {\n const { t } = useI18n();\n const tr = (key: string, fallback: string, params?: Record<string, string | number>): string =>\n tWithFallback(t, key, fallback, params);\n const { metrics, workItems, facilities } = useTheGlobalFuelStore();\n\n const operationalFacilities = facilities.filter((f) => f.status === 'operational').length;\n const localizedMetrics = metrics.map((metric) => ({\n ...metric,\n label:\n metric.label === 'Daily Production'\n ? tr('theglobalfuel.dashboard.metrics.dailyProduction.label', 'Daily Production')\n : metric.label === 'Pipeline Throughput'\n ? tr('theglobalfuel.dashboard.metrics.pipelineThroughput.label', 'Pipeline Throughput')\n : metric.label === 'Refinery Utilization'\n ? tr(\n 'theglobalfuel.dashboard.metrics.refineryUtilization.label',\n 'Refinery Utilization'\n )\n : tr('theglobalfuel.dashboard.metrics.esgScore.label', 'ESG Score'),\n trend: tr('theglobalfuel.dashboard.metrics.trendSuffix', '{{trend}} from last period', {\n trend: metric.trend,\n }),\n }));\n\n const workItemStatusLabel = (status: string): string => {\n switch (status) {\n case 'active':\n return tr('theglobalfuel.dashboard.workItems.status.active', 'active');\n case 'planned':\n return tr('theglobalfuel.dashboard.workItems.status.planned', 'planned');\n case 'at_risk':\n return tr('theglobalfuel.dashboard.workItems.status.atRisk', 'at risk');\n case 'completed':\n return tr('theglobalfuel.dashboard.workItems.status.completed', 'completed');\n default:\n return status.replace('_', ' ');\n }\n };\n\n return (\n <div className=\"space-y-6 p-6\">\n <div className=\"flex items-center justify-between\">\n <div>\n <h1 className=\"flex items-center gap-2 text-2xl font-semibold\">\n <Fuel className=\"h-7 w-7 text-amber-600\" />\n {tr('theglobalfuel.dashboard.title', 'Energy Operations Dashboard')}\n </h1>\n <p className=\"mt-1 text-sm text-muted-foreground\">\n {tr(\n 'theglobalfuel.dashboard.description',\n 'Real-time overview of petroleum, natural gas, and refinery operations'\n )}\n </p>\n </div>\n </div>\n\n <div className=\"grid gap-4 md:grid-cols-2 lg:grid-cols-4\">\n {localizedMetrics.map((metric, i) => {\n const icons = [Factory, Droplets, Gauge, TrendingUp];\n const colors = ['text-blue-600', 'text-cyan-600', 'text-amber-600', 'text-green-600'];\n const Icon = icons[i] ?? Activity;\n return (\n <Card key={metric.label}>\n <CardHeader className=\"flex flex-row items-center justify-between space-y-0 pb-2\">\n <CardTitle className=\"text-sm font-medium\">{metric.label}</CardTitle>\n <Icon className={`h-4 w-4 ${colors[i] ?? 'text-muted-foreground'}`} />\n </CardHeader>\n <CardContent>\n <div className=\"text-2xl font-bold\">{metric.value}</div>\n <p className=\"text-xs text-muted-foreground\">{metric.trend}</p>\n </CardContent>\n </Card>\n );\n })}\n </div>\n\n <div className=\"grid gap-4 md:grid-cols-7\">\n <Card className=\"col-span-4\">\n <CardHeader>\n <CardTitle className=\"flex items-center gap-2\">\n <Factory className=\"h-5 w-5 text-blue-600\" />\n {tr('theglobalfuel.dashboard.facilityStatus.title', 'Facility Status')}\n </CardTitle>\n </CardHeader>\n <CardContent className=\"space-y-3\">\n {facilities.map((fac) => (\n <div key={fac.id} className=\"flex items-center justify-between rounded-lg border p-3\">\n <div>\n <p className=\"text-sm font-medium\">{fac.name}</p>\n <p className=\"text-xs text-muted-foreground\">\n {fac.location} · {fac.type.replace(/_/g, ' ')}\n </p>\n </div>\n <div className=\"flex items-center gap-3\">\n <div className=\"text-right\">\n <p className=\"text-sm font-medium\">{fac.utilization}%</p>\n <p className=\"text-xs text-muted-foreground\">{fac.capacity}</p>\n </div>\n <span\n className={`inline-block h-2.5 w-2.5 rounded-full ${fac.status === 'operational' ? 'bg-green-500' : fac.status === 'maintenance' ? 'bg-orange-500' : 'bg-red-500'}`}\n />\n </div>\n </div>\n ))}\n <p className=\"text-xs text-muted-foreground\">\n {tr(\n 'theglobalfuel.dashboard.facilityStatus.summary',\n '{{count}} of {{total}} facilities operational',\n { count: operationalFacilities, total: facilities.length }\n )}\n </p>\n </CardContent>\n </Card>\n\n <Card className=\"col-span-3\">\n <CardHeader>\n <CardTitle className=\"flex items-center gap-2\">\n <Flame className=\"h-5 w-5 text-orange-600\" />\n {tr('theglobalfuel.dashboard.workItems.title', 'Active Work Items')}\n </CardTitle>\n </CardHeader>\n <CardContent className=\"space-y-4\">\n {workItems.map((item) => (\n <div key={item.id} className=\"flex items-center justify-between\">\n <div className=\"flex-1\">\n <div className=\"flex items-center gap-2\">\n {item.status === 'at_risk' && (\n <AlertTriangle className=\"h-3.5 w-3.5 text-orange-500\" />\n )}\n <p className=\"text-sm font-medium\">{item.title}</p>\n </div>\n <p className=\"text-xs text-muted-foreground\">\n {item.owner} · {item.updatedAt}\n </p>\n </div>\n <span\n className={`rounded-full px-2 py-0.5 text-xs font-medium ${\n item.status === 'active'\n ? 'bg-blue-100 text-blue-700'\n : item.status === 'planned'\n ? 'bg-gray-100 text-gray-700'\n : item.status === 'at_risk'\n ? 'bg-orange-100 text-orange-700'\n : 'bg-green-100 text-green-700'\n }`}\n >\n {workItemStatusLabel(item.status)}\n </span>\n </div>\n ))}\n </CardContent>\n </Card>\n </div>\n </div>\n );\n}\n"],"mappings":";;;;;;;AAeA,SAAgB,I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kB,gBACrJ,CAAA,CACE;UACF;SAhBI,EAAI,GAgBR,CACN,EACF,kBAAC,KAAD;OAAG,WAAU;iBACV,EACC,kDACA,iDACA;QAAE,OAAO;QAAuB,OAAO,EAAW;QAAQ,CAC3D;OACC,CAAA,CACQ;QACT;QAEP,kBAAC,GAAD;KAAM,WAAU;eAAhB,CACE,kBAAC,GAAD,EAAA,UACE,kBAAC,GAAD;MAAW,WAAU;gBAArB,CACE,kBAAC,GAAD,EAAO,WAAU,2BAA4B,CAAA,EAC5C,EAAG,2CAA2C,oBAAoB,CACzD;SACD,CAAA,EACb,kBAAC,GAAD;MAAa,WAAU;gBACpB,EAAU,KAAK,MACd,kBAAC,OAAD;OAAmB,WAAU;iBAA7B,CACE,kBAAC,OAAD;QAAK,WAAU;kBAAf,CACE,kBAAC,OAAD;SAAK,WAAU;mBAAf,CACG,EAAK,WAAW,aACf,kBAAC,GAAD,EAAe,WAAU,+BAAgC,CAAA,EAE3D,kBAAC,KAAD;UAAG,WAAU;oBAAuB,EAAK;UAAU,CAAA,CAC/C;YACN,kBAAC,KAAD;SAAG,WAAU;mBAAb;UACG,EAAK;UAAM;UAAW,EAAK;UAC1B;WACA;WACN,kBAAC,QAAD;QACE,WAAW,gDACT,EAAK,WAAW,WACZ,8BACA,EAAK,WAAW,YACd,8BACA,EAAK,WAAW,YACd,kCACA;kBAGT,EAAoB,EAAK,OAAO;QAC5B,CAAA,CACH;SAzBI,EAAK,GAyBT,CACN;MACU,CAAA,CACT;OACH;;GACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FinancialPage.d.ts","sourceRoot":"","sources":["../../../src/theglobalfuel/pages/FinancialPage.tsx"],"names":[],"mappings":"AAuBA,wBAAgB,aAAa,4CA2L5B"}
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
import { useTheGlobalFuelStore as e } from "../store/theglobalfuelStore.js";
|
|
2
|
+
import { tWithFallback as t } from "../utils/i18n.js";
|
|
3
|
+
import { useI18n as n } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
4
|
+
import { BarChart3 as r, DollarSign as i, Fuel as a, TrendingDown as o, TrendingUp as s } from "lucide-react";
|
|
5
|
+
import { jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
6
|
+
import { Button as u, Card as d, CardContent as f, CardHeader as p, CardTitle as m, Tabs as h, TabsContent as g, TabsList as _, TabsTrigger as v } from "@burdenoff/fe-libs/ui";
|
|
7
|
+
//#region src/theglobalfuel/pages/FinancialPage.tsx
|
|
8
|
+
var y = (e) => e >= 1e9 ? `$${(e / 1e9).toFixed(2)}B` : e >= 1e6 ? `$${(e / 1e6).toFixed(0)}M` : `$${(e / 1e3).toFixed(0)}K`;
|
|
9
|
+
function b() {
|
|
10
|
+
let { t: b } = n(), x = (e, n, r) => t(b, e, n, r), { financials: S } = e();
|
|
11
|
+
return /* @__PURE__ */ l("div", {
|
|
12
|
+
className: "space-y-6 p-6",
|
|
13
|
+
children: [
|
|
14
|
+
/* @__PURE__ */ l("div", {
|
|
15
|
+
className: "flex items-center justify-between",
|
|
16
|
+
children: [/* @__PURE__ */ l("div", { children: [/* @__PURE__ */ l("h1", {
|
|
17
|
+
className: "flex items-center gap-2 text-2xl font-semibold",
|
|
18
|
+
children: [/* @__PURE__ */ c(i, { className: "h-7 w-7 text-green-600" }), x("theglobalfuel.financial.title", "Financial Management")]
|
|
19
|
+
}), /* @__PURE__ */ c("p", {
|
|
20
|
+
className: "mt-1 text-sm text-muted-foreground",
|
|
21
|
+
children: x("theglobalfuel.financial.description", "Revenue, OPEX, refining margins, and crude oil price tracking")
|
|
22
|
+
})] }), /* @__PURE__ */ c(u, { children: x("theglobalfuel.financial.actions.report", "Financial Report") })]
|
|
23
|
+
}),
|
|
24
|
+
/* @__PURE__ */ l("div", {
|
|
25
|
+
className: "grid gap-4 md:grid-cols-2 lg:grid-cols-4",
|
|
26
|
+
children: [
|
|
27
|
+
/* @__PURE__ */ l(d, { children: [/* @__PURE__ */ l(p, {
|
|
28
|
+
className: "flex flex-row items-center justify-between space-y-0 pb-2",
|
|
29
|
+
children: [/* @__PURE__ */ c(m, {
|
|
30
|
+
className: "text-sm font-medium",
|
|
31
|
+
children: x("theglobalfuel.financial.stats.totalRevenue", "Total Revenue")
|
|
32
|
+
}), /* @__PURE__ */ c(i, { className: "h-4 w-4 text-green-600" })]
|
|
33
|
+
}), /* @__PURE__ */ l(f, { children: [/* @__PURE__ */ c("div", {
|
|
34
|
+
className: "text-2xl font-bold",
|
|
35
|
+
children: y(S.revenueUSD)
|
|
36
|
+
}), /* @__PURE__ */ l("p", {
|
|
37
|
+
className: "flex items-center text-xs text-green-600",
|
|
38
|
+
children: [/* @__PURE__ */ c(s, { className: "mr-1 h-3 w-3" }), "+12.3%"]
|
|
39
|
+
})] })] }),
|
|
40
|
+
/* @__PURE__ */ l(d, { children: [/* @__PURE__ */ l(p, {
|
|
41
|
+
className: "flex flex-row items-center justify-between space-y-0 pb-2",
|
|
42
|
+
children: [/* @__PURE__ */ c(m, {
|
|
43
|
+
className: "text-sm font-medium",
|
|
44
|
+
children: x("theglobalfuel.financial.stats.operatingExpenses", "Operating Expenses")
|
|
45
|
+
}), /* @__PURE__ */ c(r, { className: "h-4 w-4 text-blue-600" })]
|
|
46
|
+
}), /* @__PURE__ */ l(f, { children: [/* @__PURE__ */ c("div", {
|
|
47
|
+
className: "text-2xl font-bold",
|
|
48
|
+
children: y(S.opexUSD)
|
|
49
|
+
}), /* @__PURE__ */ l("p", {
|
|
50
|
+
className: "flex items-center text-xs text-red-600",
|
|
51
|
+
children: [/* @__PURE__ */ c(o, { className: "mr-1 h-3 w-3" }), "-3.2%"]
|
|
52
|
+
})] })] }),
|
|
53
|
+
/* @__PURE__ */ l(d, { children: [/* @__PURE__ */ l(p, {
|
|
54
|
+
className: "flex flex-row items-center justify-between space-y-0 pb-2",
|
|
55
|
+
children: [/* @__PURE__ */ c(m, {
|
|
56
|
+
className: "text-sm font-medium",
|
|
57
|
+
children: x("theglobalfuel.financial.stats.netProfit", "Net Profit")
|
|
58
|
+
}), /* @__PURE__ */ c(s, { className: "h-4 w-4 text-green-600" })]
|
|
59
|
+
}), /* @__PURE__ */ l(f, { children: [/* @__PURE__ */ c("div", {
|
|
60
|
+
className: "text-2xl font-bold",
|
|
61
|
+
children: y(S.netProfitUSD)
|
|
62
|
+
}), /* @__PURE__ */ l("p", {
|
|
63
|
+
className: "flex items-center text-xs text-green-600",
|
|
64
|
+
children: [/* @__PURE__ */ c(s, { className: "mr-1 h-3 w-3" }), "+18.7%"]
|
|
65
|
+
})] })] }),
|
|
66
|
+
/* @__PURE__ */ l(d, { children: [/* @__PURE__ */ l(p, {
|
|
67
|
+
className: "flex flex-row items-center justify-between space-y-0 pb-2",
|
|
68
|
+
children: [/* @__PURE__ */ c(m, {
|
|
69
|
+
className: "text-sm font-medium",
|
|
70
|
+
children: x("theglobalfuel.financial.stats.crudePrice", "Crude Price (WTI)")
|
|
71
|
+
}), /* @__PURE__ */ c(a, { className: "h-4 w-4 text-amber-600" })]
|
|
72
|
+
}), /* @__PURE__ */ l(f, { children: [/* @__PURE__ */ l("div", {
|
|
73
|
+
className: "text-2xl font-bold",
|
|
74
|
+
children: [
|
|
75
|
+
"$",
|
|
76
|
+
S.crudePricePerBarrel,
|
|
77
|
+
"/bbl"
|
|
78
|
+
]
|
|
79
|
+
}), /* @__PURE__ */ c("p", {
|
|
80
|
+
className: "text-xs text-muted-foreground",
|
|
81
|
+
children: x("theglobalfuel.financial.stats.gasPrice", "Gas: ${{value}}/MMBTU", { value: S.gasPricePerMMBTU })
|
|
82
|
+
})] })] })
|
|
83
|
+
]
|
|
84
|
+
}),
|
|
85
|
+
/* @__PURE__ */ l(h, {
|
|
86
|
+
defaultValue: "overview",
|
|
87
|
+
children: [
|
|
88
|
+
/* @__PURE__ */ l(_, { children: [
|
|
89
|
+
/* @__PURE__ */ c(v, {
|
|
90
|
+
value: "overview",
|
|
91
|
+
children: x("theglobalfuel.financial.tabs.overview", "Overview")
|
|
92
|
+
}),
|
|
93
|
+
/* @__PURE__ */ c(v, {
|
|
94
|
+
value: "revenue",
|
|
95
|
+
children: x("theglobalfuel.financial.tabs.revenue", "Revenue")
|
|
96
|
+
}),
|
|
97
|
+
/* @__PURE__ */ c(v, {
|
|
98
|
+
value: "expenses",
|
|
99
|
+
children: x("theglobalfuel.financial.tabs.expenses", "Expenses")
|
|
100
|
+
})
|
|
101
|
+
] }),
|
|
102
|
+
/* @__PURE__ */ c(g, {
|
|
103
|
+
value: "overview",
|
|
104
|
+
className: "mt-4",
|
|
105
|
+
children: /* @__PURE__ */ l("div", {
|
|
106
|
+
className: "grid gap-4 lg:grid-cols-3",
|
|
107
|
+
children: [
|
|
108
|
+
/* @__PURE__ */ c(d, { children: /* @__PURE__ */ c(f, {
|
|
109
|
+
className: "pt-6",
|
|
110
|
+
children: /* @__PURE__ */ l("div", {
|
|
111
|
+
className: "text-center",
|
|
112
|
+
children: [/* @__PURE__ */ c("p", {
|
|
113
|
+
className: "text-sm text-muted-foreground",
|
|
114
|
+
children: x("theglobalfuel.financial.overview.profitMargin", "Profit Margin")
|
|
115
|
+
}), /* @__PURE__ */ l("p", {
|
|
116
|
+
className: "text-3xl font-bold text-green-600",
|
|
117
|
+
children: [S.profitMarginPct, "%"]
|
|
118
|
+
})]
|
|
119
|
+
})
|
|
120
|
+
}) }),
|
|
121
|
+
/* @__PURE__ */ c(d, { children: /* @__PURE__ */ c(f, {
|
|
122
|
+
className: "pt-6",
|
|
123
|
+
children: /* @__PURE__ */ l("div", {
|
|
124
|
+
className: "text-center",
|
|
125
|
+
children: [/* @__PURE__ */ c("p", {
|
|
126
|
+
className: "text-sm text-muted-foreground",
|
|
127
|
+
children: x("theglobalfuel.financial.overview.refiningMargin", "Refining Margin")
|
|
128
|
+
}), /* @__PURE__ */ c("p", {
|
|
129
|
+
className: "text-3xl font-bold text-blue-600",
|
|
130
|
+
children: "$18.50/bbl"
|
|
131
|
+
})]
|
|
132
|
+
})
|
|
133
|
+
}) }),
|
|
134
|
+
/* @__PURE__ */ c(d, { children: /* @__PURE__ */ c(f, {
|
|
135
|
+
className: "pt-6",
|
|
136
|
+
children: /* @__PURE__ */ l("div", {
|
|
137
|
+
className: "text-center",
|
|
138
|
+
children: [/* @__PURE__ */ c("p", {
|
|
139
|
+
className: "text-sm text-muted-foreground",
|
|
140
|
+
children: x("theglobalfuel.financial.overview.crackSpread", "Crack Spread")
|
|
141
|
+
}), /* @__PURE__ */ c("p", {
|
|
142
|
+
className: "text-3xl font-bold text-purple-600",
|
|
143
|
+
children: "$24.30/bbl"
|
|
144
|
+
})]
|
|
145
|
+
})
|
|
146
|
+
}) })
|
|
147
|
+
]
|
|
148
|
+
})
|
|
149
|
+
}),
|
|
150
|
+
/* @__PURE__ */ c(g, {
|
|
151
|
+
value: "revenue",
|
|
152
|
+
className: "mt-4",
|
|
153
|
+
children: /* @__PURE__ */ l(d, { children: [/* @__PURE__ */ c(p, { children: /* @__PURE__ */ c(m, { children: x("theglobalfuel.financial.revenue.title", "Revenue Streams") }) }), /* @__PURE__ */ c(f, {
|
|
154
|
+
className: "space-y-3",
|
|
155
|
+
children: S.revenueStreams.map((e) => /* @__PURE__ */ l("div", {
|
|
156
|
+
className: "flex items-center justify-between rounded border p-3",
|
|
157
|
+
children: [/* @__PURE__ */ c("div", { children: /* @__PURE__ */ c("p", {
|
|
158
|
+
className: "font-medium",
|
|
159
|
+
children: e.name
|
|
160
|
+
}) }), /* @__PURE__ */ l("div", {
|
|
161
|
+
className: "text-right",
|
|
162
|
+
children: [/* @__PURE__ */ c("p", {
|
|
163
|
+
className: "font-bold text-green-600",
|
|
164
|
+
children: y(e.amountUSD)
|
|
165
|
+
}), /* @__PURE__ */ c("p", {
|
|
166
|
+
className: "text-xs text-muted-foreground",
|
|
167
|
+
children: x("theglobalfuel.financial.revenue.percentOfTotal", "{{value}}% of total", { value: e.pct })
|
|
168
|
+
})]
|
|
169
|
+
})]
|
|
170
|
+
}, e.name))
|
|
171
|
+
})] })
|
|
172
|
+
}),
|
|
173
|
+
/* @__PURE__ */ c(g, {
|
|
174
|
+
value: "expenses",
|
|
175
|
+
className: "mt-4",
|
|
176
|
+
children: /* @__PURE__ */ l(d, { children: [/* @__PURE__ */ c(p, { children: /* @__PURE__ */ c(m, { children: x("theglobalfuel.financial.expenses.title", "Cost Breakdown") }) }), /* @__PURE__ */ c(f, {
|
|
177
|
+
className: "space-y-3",
|
|
178
|
+
children: S.costBreakdown.map((e) => /* @__PURE__ */ l("div", {
|
|
179
|
+
className: "flex items-center justify-between rounded border p-3",
|
|
180
|
+
children: [/* @__PURE__ */ c("div", { children: /* @__PURE__ */ c("p", {
|
|
181
|
+
className: "font-medium",
|
|
182
|
+
children: e.name
|
|
183
|
+
}) }), /* @__PURE__ */ l("div", {
|
|
184
|
+
className: "text-right",
|
|
185
|
+
children: [/* @__PURE__ */ c("p", {
|
|
186
|
+
className: "font-bold",
|
|
187
|
+
children: y(e.amountUSD)
|
|
188
|
+
}), /* @__PURE__ */ c("p", {
|
|
189
|
+
className: "text-xs text-muted-foreground",
|
|
190
|
+
children: x("theglobalfuel.financial.expenses.percentOfOpex", "{{value}}% of OPEX", { value: e.pct })
|
|
191
|
+
})]
|
|
192
|
+
})]
|
|
193
|
+
}, e.name))
|
|
194
|
+
})] })
|
|
195
|
+
})
|
|
196
|
+
]
|
|
197
|
+
})
|
|
198
|
+
]
|
|
199
|
+
});
|
|
200
|
+
}
|
|
201
|
+
//#endregion
|
|
202
|
+
export { b as FinancialPage };
|
|
203
|
+
|
|
204
|
+
//# sourceMappingURL=FinancialPage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FinancialPage.js","names":[],"sources":["../../../src/theglobalfuel/pages/FinancialPage.tsx"],"sourcesContent":["import { useI18n } from '@burdenoff/fe-libs/shared/providers/shell/I18nProvider';\nimport {\n Card,\n CardContent,\n CardHeader,\n CardTitle,\n Button,\n Tabs,\n TabsList,\n TabsTrigger,\n TabsContent,\n} from '@burdenoff/fe-libs/ui';\nimport { DollarSign, TrendingUp, TrendingDown, BarChart3, Fuel } from 'lucide-react';\nimport { useTheGlobalFuelStore } from '../store/theglobalfuelStore';\nimport { tWithFallback } from '../utils/i18n';\n\nconst fmt = (n: number) =>\n n >= 1e9\n ? `$${(n / 1e9).toFixed(2)}B`\n : n >= 1e6\n ? `$${(n / 1e6).toFixed(0)}M`\n : `$${(n / 1e3).toFixed(0)}K`;\n\nexport function FinancialPage() {\n const { t } = useI18n();\n const tr = (key: string, fallback: string, params?: Record<string, string | number>): string =>\n tWithFallback(t, key, fallback, params);\n const { financials } = useTheGlobalFuelStore();\n\n return (\n <div className=\"space-y-6 p-6\">\n <div className=\"flex items-center justify-between\">\n <div>\n <h1 className=\"flex items-center gap-2 text-2xl font-semibold\">\n <DollarSign className=\"h-7 w-7 text-green-600\" />\n {tr('theglobalfuel.financial.title', 'Financial Management')}\n </h1>\n <p className=\"mt-1 text-sm text-muted-foreground\">\n {tr(\n 'theglobalfuel.financial.description',\n 'Revenue, OPEX, refining margins, and crude oil price tracking'\n )}\n </p>\n </div>\n <Button>{tr('theglobalfuel.financial.actions.report', 'Financial Report')}</Button>\n </div>\n <div className=\"grid gap-4 md:grid-cols-2 lg:grid-cols-4\">\n <Card>\n <CardHeader className=\"flex flex-row items-center justify-between space-y-0 pb-2\">\n <CardTitle className=\"text-sm font-medium\">\n {tr('theglobalfuel.financial.stats.totalRevenue', 'Total Revenue')}\n </CardTitle>\n <DollarSign className=\"h-4 w-4 text-green-600\" />\n </CardHeader>\n <CardContent>\n <div className=\"text-2xl font-bold\">{fmt(financials.revenueUSD)}</div>\n <p className=\"flex items-center text-xs text-green-600\">\n <TrendingUp className=\"mr-1 h-3 w-3\" />\n +12.3%\n </p>\n </CardContent>\n </Card>\n <Card>\n <CardHeader className=\"flex flex-row items-center justify-between space-y-0 pb-2\">\n <CardTitle className=\"text-sm font-medium\">\n {tr('theglobalfuel.financial.stats.operatingExpenses', 'Operating Expenses')}\n </CardTitle>\n <BarChart3 className=\"h-4 w-4 text-blue-600\" />\n </CardHeader>\n <CardContent>\n <div className=\"text-2xl font-bold\">{fmt(financials.opexUSD)}</div>\n <p className=\"flex items-center text-xs text-red-600\">\n <TrendingDown className=\"mr-1 h-3 w-3\" />\n -3.2%\n </p>\n </CardContent>\n </Card>\n <Card>\n <CardHeader className=\"flex flex-row items-center justify-between space-y-0 pb-2\">\n <CardTitle className=\"text-sm font-medium\">\n {tr('theglobalfuel.financial.stats.netProfit', 'Net Profit')}\n </CardTitle>\n <TrendingUp className=\"h-4 w-4 text-green-600\" />\n </CardHeader>\n <CardContent>\n <div className=\"text-2xl font-bold\">{fmt(financials.netProfitUSD)}</div>\n <p className=\"flex items-center text-xs text-green-600\">\n <TrendingUp className=\"mr-1 h-3 w-3\" />\n +18.7%\n </p>\n </CardContent>\n </Card>\n <Card>\n <CardHeader className=\"flex flex-row items-center justify-between space-y-0 pb-2\">\n <CardTitle className=\"text-sm font-medium\">\n {tr('theglobalfuel.financial.stats.crudePrice', 'Crude Price (WTI)')}\n </CardTitle>\n <Fuel className=\"h-4 w-4 text-amber-600\" />\n </CardHeader>\n <CardContent>\n <div className=\"text-2xl font-bold\">${financials.crudePricePerBarrel}/bbl</div>\n <p className=\"text-xs text-muted-foreground\">\n {tr('theglobalfuel.financial.stats.gasPrice', 'Gas: ${{value}}/MMBTU', {\n value: financials.gasPricePerMMBTU,\n })}\n </p>\n </CardContent>\n </Card>\n </div>\n <Tabs defaultValue=\"overview\">\n <TabsList>\n <TabsTrigger value=\"overview\">\n {tr('theglobalfuel.financial.tabs.overview', 'Overview')}\n </TabsTrigger>\n <TabsTrigger value=\"revenue\">\n {tr('theglobalfuel.financial.tabs.revenue', 'Revenue')}\n </TabsTrigger>\n <TabsTrigger value=\"expenses\">\n {tr('theglobalfuel.financial.tabs.expenses', 'Expenses')}\n </TabsTrigger>\n </TabsList>\n <TabsContent value=\"overview\" className=\"mt-4\">\n <div className=\"grid gap-4 lg:grid-cols-3\">\n <Card>\n <CardContent className=\"pt-6\">\n <div className=\"text-center\">\n <p className=\"text-sm text-muted-foreground\">\n {tr('theglobalfuel.financial.overview.profitMargin', 'Profit Margin')}\n </p>\n <p className=\"text-3xl font-bold text-green-600\">{financials.profitMarginPct}%</p>\n </div>\n </CardContent>\n </Card>\n <Card>\n <CardContent className=\"pt-6\">\n <div className=\"text-center\">\n <p className=\"text-sm text-muted-foreground\">\n {tr('theglobalfuel.financial.overview.refiningMargin', 'Refining Margin')}\n </p>\n <p className=\"text-3xl font-bold text-blue-600\">$18.50/bbl</p>\n </div>\n </CardContent>\n </Card>\n <Card>\n <CardContent className=\"pt-6\">\n <div className=\"text-center\">\n <p className=\"text-sm text-muted-foreground\">\n {tr('theglobalfuel.financial.overview.crackSpread', 'Crack Spread')}\n </p>\n <p className=\"text-3xl font-bold text-purple-600\">$24.30/bbl</p>\n </div>\n </CardContent>\n </Card>\n </div>\n </TabsContent>\n <TabsContent value=\"revenue\" className=\"mt-4\">\n <Card>\n <CardHeader>\n <CardTitle>\n {tr('theglobalfuel.financial.revenue.title', 'Revenue Streams')}\n </CardTitle>\n </CardHeader>\n <CardContent className=\"space-y-3\">\n {financials.revenueStreams.map((r) => (\n <div key={r.name} className=\"flex items-center justify-between rounded border p-3\">\n <div>\n <p className=\"font-medium\">{r.name}</p>\n </div>\n <div className=\"text-right\">\n <p className=\"font-bold text-green-600\">{fmt(r.amountUSD)}</p>\n <p className=\"text-xs text-muted-foreground\">\n {tr('theglobalfuel.financial.revenue.percentOfTotal', '{{value}}% of total', {\n value: r.pct,\n })}\n </p>\n </div>\n </div>\n ))}\n </CardContent>\n </Card>\n </TabsContent>\n <TabsContent value=\"expenses\" className=\"mt-4\">\n <Card>\n <CardHeader>\n <CardTitle>\n {tr('theglobalfuel.financial.expenses.title', 'Cost Breakdown')}\n </CardTitle>\n </CardHeader>\n <CardContent className=\"space-y-3\">\n {financials.costBreakdown.map((c) => (\n <div key={c.name} className=\"flex items-center justify-between rounded border p-3\">\n <div>\n <p className=\"font-medium\">{c.name}</p>\n </div>\n <div className=\"text-right\">\n <p className=\"font-bold\">{fmt(c.amountUSD)}</p>\n <p className=\"text-xs text-muted-foreground\">\n {tr('theglobalfuel.financial.expenses.percentOfOpex', '{{value}}% of OPEX', {\n value: c.pct,\n })}\n </p>\n </div>\n </div>\n ))}\n </CardContent>\n </Card>\n </TabsContent>\n </Tabs>\n </div>\n );\n}\n"],"mappings":";;;;;;;AAgBA,IAAM,KAAO,MACX,KAAK,MACD,KAAK,IAAI,KAAK,QAAQ,EAAE,CAAC,KACzB,KAAK,MACH,KAAK,IAAI,KAAK,QAAQ,EAAE,CAAC,KACzB,KAAK,IAAI,KAAK,QAAQ,EAAE,CAAC;AAEjC,SAAgB,IAAgB;CAC9B,IAAM,EAAE,SAAM,GAAS,EACjB,KAAM,GAAa,GAAkB,MACzC,EAAc,GAAG,GAAK,GAAU,EAAO,EACnC,EAAE,kBAAe,GAAuB;AAE9C,QACE,kBAAC,OAAD;EAAK,WAAU;YAAf;GACE,kBAAC,OAAD;IAAK,WAAU;cAAf,CACE,kBAAC,OAAD,EAAA,UAAA,CACE,kBAAC,MAAD;KAAI,WAAU;eAAd,CACE,kBAAC,GAAD,EAAY,WAAU,0BAA2B,CAAA,EAChD,EAAG,iCAAiC,uBAAuB,CACzD;QACL,kBAAC,KAAD;KAAG,WAAU;eACV,EACC,uCACA,gEACD;KACC,CAAA,CACA,EAAA,CAAA,EACN,kBAAC,GAAD,EAAA,UAAS,EAAG,0CAA0C,mBAAmB,EAAU,CAAA,CAC/E;;GACN,kBAAC,OAAD;IAAK,WAAU;cAAf;KACE,kBAAC,GAAD,EAAA,UAAA,CACE,kBAAC,GAAD;MAAY,WAAU;gBAAtB,CACE,kBAAC,GAAD;OAAW,WAAU;iBAClB,EAAG,8CAA8C,gBAAgB;OACxD,CAAA,EACZ,kBAAC,GAAD,EAAY,WAAU,0BAA2B,CAAA,CACtC;SACb,kBAAC,GA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AAD;UAAG,WAAU;oBAAa,EAAI,EAAE,UAAU;UAAK,CAAA,EAC/C,kBAAC,KAAD;UAAG,WAAU;oBACV,EAAG,kDAAkD,sBAAsB,EAC1E,OAAO,EAAE,KACV,CAAC;UACA,CAAA,CACA;WACF;UAZI,EAAE,KAYN,CACN;OACU,CAAA,CACT,EAAA,CAAA;MACK,CAAA;KACT;;GACH"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FleetManagementPage.d.ts","sourceRoot":"","sources":["../../../src/theglobalfuel/pages/FleetManagementPage.tsx"],"names":[],"mappings":"AAeA,wBAAgB,mBAAmB,4CAsLlC"}
|