@burdenoff/microfe-theglobalfuel 2026.705.4 → 2026.709.1

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