@burdenoff/microfe-theglobalfuel 2026.705.2 → 2026.705.3

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.
@@ -3,25 +3,25 @@ import { MetricsCard as t } from "../../components/MetricsCard.js";
3
3
  import { formatDate as n, formatEnumLabel as r, formatPercent as i, formatRelativeTime as ee, formatTonnesCo2e as a, toBackendDate as o } from "../../utils/formatters.js";
4
4
  import { StatusBadge as te } from "../../components/StatusBadge.js";
5
5
  import { MiniBar as s } from "../../components/MiniBar.js";
6
- import { DataTable as c } from "../../components/DataTable.js";
7
- import { ErrorView as l, LoadingView as u } from "../../components/StateViews.js";
8
- import { EmptyState as d } from "../../components/EmptyState.js";
9
- import { useTheAssets as ne, useTheEmissionRecords as re, useTheRecordEmission as ie, useTheVerifyEmission as ae } from "../../hooks/useTheGlobalFuelApi.js";
10
- import { useCursorPager as oe } from "../../hooks/useCursorPager.js";
11
- import { useNotify as se } from "../../hooks/useNotify.js";
6
+ import { DataTable as ne } from "../../components/DataTable.js";
7
+ import { ErrorView as re, LoadingView as c } from "../../components/StateViews.js";
8
+ import { EmptyState as l } from "../../components/EmptyState.js";
9
+ import { useTheAssets as ie, useTheEmissionRecords as ae, useTheRecordEmission as oe, useTheVerifyEmission as se } from "../../hooks/useTheGlobalFuelApi.js";
10
+ import { useCursorPager as ce } from "../../hooks/useCursorPager.js";
11
+ import { useNotify as le } from "../../hooks/useNotify.js";
12
12
  import "../../hooks/index.js";
13
- import { FilterTabs as ce } from "../../components/FilterTabs.js";
14
- import { Pagination as le } from "../../components/Pagination.js";
15
- import { useMemo as f, useState as p } from "react";
16
- import { CheckCircle2 as ue, Circle as m, Cloud as h, Factory as g, Flame as _, Plus as v, Truck as de, Zap as fe } from "lucide-react";
17
- import { Fragment as pe, jsx as y, jsxs as b } from "react/jsx-runtime";
18
- import { Button as x, Input as S, Label as C, ResponsiveDialog as me, ResponsiveDialogContent as he, ResponsiveDialogDescription as ge, ResponsiveDialogFooter as _e, ResponsiveDialogHeader as ve, ResponsiveDialogTitle as ye, Select as w, SelectContent as T, SelectItem as E, SelectTrigger as D, SelectValue as O, Textarea as k } from "@burdenoff/fe-libs/ui";
13
+ import { FilterTabs as ue } from "../../components/FilterTabs.js";
14
+ import { Pagination as de } from "../../components/Pagination.js";
15
+ import { useMemo as u, useState as d } from "react";
16
+ import { CheckCircle2 as fe, Circle as pe, Cloud as f, Factory as p, Flame as me, Plus as m, Truck as h, Zap as g } from "lucide-react";
17
+ import { Fragment as _, jsx as v, jsxs as y } from "react/jsx-runtime";
18
+ import { Button as b, Input as x, Label as S, ResponsiveDialog as he, ResponsiveDialogContent as ge, ResponsiveDialogDescription as _e, ResponsiveDialogFooter as ve, ResponsiveDialogHeader as ye, ResponsiveDialogTitle as be, Select as C, SelectContent as w, SelectItem as T, SelectTrigger as E, SelectValue as D, Textarea as O } from "@burdenoff/fe-libs/ui";
19
19
  //#region src/theglobalfuel/pages/emissions/EmissionsPage.tsx
20
- var A = [
20
+ var k = [
21
21
  "SCOPE_1",
22
22
  "SCOPE_2",
23
23
  "SCOPE_3"
24
- ], j = [
24
+ ], A = [
25
25
  {
26
26
  value: "ALL",
27
27
  label: "All scopes"
@@ -38,47 +38,47 @@ var A = [
38
38
  value: "SCOPE_3",
39
39
  label: "Scope 3"
40
40
  }
41
- ], M = {
41
+ ], j = {
42
42
  SCOPE_1: "bg-status-error-text",
43
43
  SCOPE_2: "bg-status-warning-text",
44
44
  SCOPE_3: "bg-accent"
45
- }, N = 25, P = () => (/* @__PURE__ */ new Date()).toISOString().slice(0, 10), F = () => ({
45
+ }, M = 25, N = () => (/* @__PURE__ */ new Date()).toISOString().slice(0, 10), P = () => ({
46
46
  assetId: "",
47
47
  scope: "SCOPE_1",
48
48
  co2eTonnes: "",
49
- periodStart: P(),
50
- periodEnd: P(),
49
+ periodStart: N(),
50
+ periodEnd: N(),
51
51
  source: "",
52
52
  methodology: "",
53
53
  notes: ""
54
- }), I = (e, t, n) => {
54
+ }), F = (e, t, n) => {
55
55
  if (t <= 0) return;
56
56
  let r = e / t * 100;
57
- return /* @__PURE__ */ b("div", {
57
+ return /* @__PURE__ */ y("div", {
58
58
  className: "space-y-2",
59
- children: [/* @__PURE__ */ y(s, {
59
+ children: [/* @__PURE__ */ v(s, {
60
60
  value: r,
61
- barClassName: M[n],
61
+ barClassName: j[n],
62
62
  height: 4
63
- }), /* @__PURE__ */ b("p", {
63
+ }), /* @__PURE__ */ y("p", {
64
64
  className: "text-xs tabular-nums text-text-tertiary",
65
65
  children: [i(r), " of total"]
66
66
  })]
67
67
  });
68
68
  };
69
- function L() {
70
- let i = se(), [s, M] = p("ALL"), [P, L] = p("ALL"), R = oe(), [be, z] = p(!1), [B, V] = p(F), [H, U] = p(null), [W, G] = p(null), K = ne({ pagination: { limit: 100 } }), xe = f(() => {
69
+ function I() {
70
+ let i = le(), [s, j] = d("ALL"), [N, I] = d("ALL"), L = ce(), [xe, R] = d(!1), [z, B] = d(P), [V, H] = d(null), [U, W] = d(null), G = ie({ pagination: { limit: 100 } }), Se = u(() => {
71
71
  let e = {};
72
- for (let t of K.data?.items ?? []) e[t.id] = t.name;
72
+ for (let t of G.data?.items ?? []) e[t.id] = t.name;
73
73
  return e;
74
- }, [K.data]), q = K.data?.items ?? [], { data: J, isLoading: Se, isError: Ce, refetch: we } = re({
74
+ }, [G.data]), K = G.data?.items ?? [], { data: q, isLoading: Ce, isError: we, refetch: J } = ae({
75
75
  scope: s === "ALL" ? void 0 : s,
76
- assetId: P === "ALL" ? void 0 : P,
76
+ assetId: N === "ALL" ? void 0 : N,
77
77
  pagination: {
78
- limit: N,
79
- cursor: R.cursor
78
+ limit: M,
79
+ offset: L.page * M
80
80
  }
81
- }), Y = ie(), Te = ae(), X = f(() => J?.items ?? [], [J]), { total: Z, byScope: Q } = f(() => {
81
+ }), Y = oe(), Te = se(), X = u(() => q?.items ?? [], [q]), { total: Z, byScope: Q } = u(() => {
82
82
  let e = {
83
83
  SCOPE_1: 0,
84
84
  SCOPE_2: 0,
@@ -93,14 +93,14 @@ function L() {
93
93
  {
94
94
  key: "scope",
95
95
  header: "Scope",
96
- render: (e) => /* @__PURE__ */ y(te, { status: e.scope })
96
+ render: (e) => /* @__PURE__ */ v(te, { status: e.scope })
97
97
  },
98
98
  {
99
99
  key: "asset",
100
100
  header: "Asset",
101
- render: (e) => /* @__PURE__ */ y("span", {
101
+ render: (e) => /* @__PURE__ */ v("span", {
102
102
  className: "text-text-secondary",
103
- children: e.assetId ? xe[e.assetId] ?? `${e.assetId.slice(0, 8)}…` : "—"
103
+ children: e.assetId ? Se[e.assetId] ?? `${e.assetId.slice(0, 8)}…` : "—"
104
104
  })
105
105
  },
106
106
  {
@@ -108,7 +108,7 @@ function L() {
108
108
  header: "CO₂e",
109
109
  align: "right",
110
110
  sortValue: (e) => e.co2eTonnes,
111
- render: (e) => /* @__PURE__ */ y("span", {
111
+ render: (e) => /* @__PURE__ */ v("span", {
112
112
  className: "tabular-nums font-medium text-text-primary",
113
113
  children: a(e.co2eTonnes)
114
114
  })
@@ -118,7 +118,7 @@ function L() {
118
118
  header: "Period",
119
119
  hideOnMobile: !0,
120
120
  sortValue: (e) => new Date(e.periodStart).getTime(),
121
- render: (e) => /* @__PURE__ */ b("span", {
121
+ render: (e) => /* @__PURE__ */ y("span", {
122
122
  className: "text-text-secondary",
123
123
  children: [
124
124
  n(e.periodStart),
@@ -131,7 +131,7 @@ function L() {
131
131
  key: "source",
132
132
  header: "Source",
133
133
  hideOnMobile: !0,
134
- render: (e) => /* @__PURE__ */ y("span", {
134
+ render: (e) => /* @__PURE__ */ v("span", {
135
135
  className: "text-text-secondary",
136
136
  children: e.source ?? "—"
137
137
  })
@@ -139,22 +139,22 @@ function L() {
139
139
  {
140
140
  key: "verified",
141
141
  header: "Verified",
142
- render: (e) => e.verified ? /* @__PURE__ */ b("span", {
142
+ render: (e) => e.verified ? /* @__PURE__ */ y("span", {
143
143
  className: "inline-flex items-center gap-1.5 text-status-success-text",
144
144
  children: [
145
- /* @__PURE__ */ y(ue, { className: "h-4 w-4" }),
146
- /* @__PURE__ */ y("span", {
145
+ /* @__PURE__ */ v(fe, { className: "h-4 w-4" }),
146
+ /* @__PURE__ */ v("span", {
147
147
  className: "text-xs font-medium",
148
148
  children: "Verified"
149
149
  }),
150
- e.verifiedAt && /* @__PURE__ */ y("span", {
150
+ e.verifiedAt && /* @__PURE__ */ v("span", {
151
151
  className: "text-xs font-normal tabular-nums text-text-tertiary",
152
152
  children: n(e.verifiedAt)
153
153
  })
154
154
  ]
155
- }) : /* @__PURE__ */ b("span", {
155
+ }) : /* @__PURE__ */ y("span", {
156
156
  className: "inline-flex items-center gap-1.5 text-text-tertiary",
157
- children: [/* @__PURE__ */ y(m, { className: "h-3.5 w-3.5" }), /* @__PURE__ */ y("span", {
157
+ children: [/* @__PURE__ */ v(pe, { className: "h-3.5 w-3.5" }), /* @__PURE__ */ v("span", {
158
158
  className: "text-xs",
159
159
  children: "Unverified"
160
160
  })]
@@ -165,7 +165,7 @@ function L() {
165
165
  header: "Logged",
166
166
  align: "right",
167
167
  hideOnMobile: !0,
168
- render: (e) => /* @__PURE__ */ y("span", {
168
+ render: (e) => /* @__PURE__ */ v("span", {
169
169
  className: "text-text-tertiary",
170
170
  children: ee(e.createdAt)
171
171
  })
@@ -174,75 +174,75 @@ function L() {
174
174
  key: "verify",
175
175
  header: "",
176
176
  align: "right",
177
- render: (e) => e.verified ? null : /* @__PURE__ */ y(x, {
177
+ render: (e) => e.verified ? null : /* @__PURE__ */ v(b, {
178
178
  size: "sm",
179
179
  variant: "outline",
180
180
  onClick: () => {
181
- G(e.id), Te.mutate(e.id, {
181
+ W(e.id), Te.mutate(e.id, {
182
182
  onSuccess: () => i.success("Emission verified"),
183
183
  onError: (e) => i.fromError(e),
184
- onSettled: () => G(null)
184
+ onSettled: () => W(null)
185
185
  });
186
186
  },
187
- disabled: W === e.id,
188
- children: W === e.id ? "Verifying…" : "Verify"
187
+ disabled: U === e.id,
188
+ children: U === e.id ? "Verifying…" : "Verify"
189
189
  })
190
190
  }
191
191
  ], $ = () => {
192
- V(F()), U(null), z(!0);
192
+ B(P()), H(null), R(!0);
193
193
  }, De = async () => {
194
- let e = Number(B.co2eTonnes);
195
- if (!B.co2eTonnes || Number.isNaN(e) || e <= 0) {
194
+ let e = Number(z.co2eTonnes);
195
+ if (!z.co2eTonnes || Number.isNaN(e) || e <= 0) {
196
196
  let e = "CO₂e (tonnes) must be greater than zero.";
197
- U(e), i.error(e);
197
+ H(e), i.error(e);
198
198
  return;
199
199
  }
200
- if (!B.periodStart || !B.periodEnd) {
201
- U("Period start and end are required.");
200
+ if (!z.periodStart || !z.periodEnd) {
201
+ H("Period start and end are required.");
202
202
  return;
203
203
  }
204
- let t = o(B.periodStart), n = o(B.periodEnd);
204
+ let t = o(z.periodStart), n = o(z.periodEnd);
205
205
  if (!t || !n) {
206
- U("Period start and end are required.");
206
+ H("Period start and end are required.");
207
207
  return;
208
208
  }
209
209
  if (new Date(n).getTime() < new Date(t).getTime()) {
210
- U("Period end must be on or after the period start.");
210
+ H("Period end must be on or after the period start.");
211
211
  return;
212
212
  }
213
- U(null);
213
+ H(null);
214
214
  try {
215
215
  await Y.mutateAsync({
216
- assetId: B.assetId || null,
217
- scope: B.scope,
216
+ assetId: z.assetId || null,
217
+ scope: z.scope,
218
218
  co2eTonnes: e,
219
219
  periodStart: t,
220
220
  periodEnd: n,
221
- source: B.source.trim() || null,
222
- methodology: B.methodology.trim() || null,
223
- notes: B.notes.trim() || null
224
- }), i.success("Emission recorded"), z(!1), V(F());
221
+ source: z.source.trim() || null,
222
+ methodology: z.methodology.trim() || null,
223
+ notes: z.notes.trim() || null
224
+ }), i.success("Emission recorded"), R(!1), B(P());
225
225
  } catch (e) {
226
- i.fromError(e), U(e instanceof Error ? e.message : "Failed to record emission.");
226
+ i.fromError(e), H(e instanceof Error ? e.message : "Failed to record emission.");
227
227
  }
228
228
  };
229
- return /* @__PURE__ */ b(e, {
229
+ return /* @__PURE__ */ y(e, {
230
230
  title: "Emissions",
231
231
  description: "ESG greenhouse-gas ledger across every asset — GHG Protocol Scope 1 / 2 / 3, with third-party verification.",
232
- actions: /* @__PURE__ */ b(x, {
232
+ actions: /* @__PURE__ */ y(b, {
233
233
  onClick: $,
234
- children: [/* @__PURE__ */ y(v, { className: "mr-1.5 h-4 w-4" }), " Record emission"]
234
+ children: [/* @__PURE__ */ v(m, { className: "mr-1.5 h-4 w-4" }), " Record emission"]
235
235
  }),
236
236
  children: [
237
- /* @__PURE__ */ b("div", {
237
+ /* @__PURE__ */ y("div", {
238
238
  className: "grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-4",
239
239
  children: [
240
- /* @__PURE__ */ y(t, {
241
- icon: /* @__PURE__ */ y(g, { className: "h-5 w-5" }),
240
+ /* @__PURE__ */ v(t, {
241
+ icon: /* @__PURE__ */ v(p, { className: "h-5 w-5" }),
242
242
  value: X.length > 0 ? a(Z) : "—",
243
243
  label: "CO₂e on this page",
244
244
  featured: !0,
245
- footer: /* @__PURE__ */ b("p", {
245
+ footer: /* @__PURE__ */ y("p", {
246
246
  className: "text-xs tabular-nums text-text-tertiary",
247
247
  children: [
248
248
  X.length,
@@ -252,65 +252,65 @@ function L() {
252
252
  ]
253
253
  })
254
254
  }),
255
- /* @__PURE__ */ y(t, {
256
- icon: /* @__PURE__ */ y(_, { className: "h-5 w-5" }),
255
+ /* @__PURE__ */ v(t, {
256
+ icon: /* @__PURE__ */ v(me, { className: "h-5 w-5" }),
257
257
  value: X.length > 0 ? a(Q.SCOPE_1) : "—",
258
258
  label: "Scope 1 · Direct",
259
- footer: I(Q.SCOPE_1, Z, "SCOPE_1")
259
+ footer: F(Q.SCOPE_1, Z, "SCOPE_1")
260
260
  }),
261
- /* @__PURE__ */ y(t, {
262
- icon: /* @__PURE__ */ y(fe, { className: "h-5 w-5" }),
261
+ /* @__PURE__ */ v(t, {
262
+ icon: /* @__PURE__ */ v(g, { className: "h-5 w-5" }),
263
263
  value: X.length > 0 ? a(Q.SCOPE_2) : "—",
264
264
  label: "Scope 2 · Purchased energy",
265
- footer: I(Q.SCOPE_2, Z, "SCOPE_2")
265
+ footer: F(Q.SCOPE_2, Z, "SCOPE_2")
266
266
  }),
267
- /* @__PURE__ */ y(t, {
268
- icon: /* @__PURE__ */ y(de, { className: "h-5 w-5" }),
267
+ /* @__PURE__ */ v(t, {
268
+ icon: /* @__PURE__ */ v(h, { className: "h-5 w-5" }),
269
269
  value: X.length > 0 ? a(Q.SCOPE_3) : "—",
270
270
  label: "Scope 3 · Value chain",
271
- footer: I(Q.SCOPE_3, Z, "SCOPE_3")
271
+ footer: F(Q.SCOPE_3, Z, "SCOPE_3")
272
272
  })
273
273
  ]
274
274
  }),
275
- /* @__PURE__ */ b("div", {
275
+ /* @__PURE__ */ y("div", {
276
276
  className: "mt-6 mb-5 flex flex-wrap items-center gap-3",
277
- children: [/* @__PURE__ */ y(ce, {
278
- options: j,
277
+ children: [/* @__PURE__ */ v(ue, {
278
+ options: A,
279
279
  value: s,
280
280
  onChange: (e) => {
281
- M(e), R.reset();
281
+ j(e), L.reset();
282
282
  }
283
- }), /* @__PURE__ */ b(w, {
284
- value: P,
283
+ }), /* @__PURE__ */ y(C, {
284
+ value: N,
285
285
  onValueChange: (e) => {
286
- L(e), R.reset();
286
+ I(e), L.reset();
287
287
  },
288
- children: [/* @__PURE__ */ y(D, {
288
+ children: [/* @__PURE__ */ v(E, {
289
289
  className: "w-56",
290
290
  "aria-label": "Filter by asset",
291
- children: /* @__PURE__ */ y(O, { placeholder: "All assets" })
292
- }), /* @__PURE__ */ b(T, { children: [/* @__PURE__ */ y(E, {
291
+ children: /* @__PURE__ */ v(D, { placeholder: "All assets" })
292
+ }), /* @__PURE__ */ y(w, { children: [/* @__PURE__ */ v(T, {
293
293
  value: "ALL",
294
294
  children: "All assets"
295
- }), q.map((e) => /* @__PURE__ */ y(E, {
295
+ }), K.map((e) => /* @__PURE__ */ v(T, {
296
296
  value: e.id,
297
297
  children: e.name
298
298
  }, e.id))] })]
299
299
  })]
300
300
  }),
301
- Se ? /* @__PURE__ */ y(u, { label: "Loading emission records…" }) : Ce ? /* @__PURE__ */ y(l, {
301
+ Ce ? /* @__PURE__ */ v(c, { label: "Loading emission records…" }) : we ? /* @__PURE__ */ v(re, {
302
302
  message: "Couldn't load emission records.",
303
- onRetry: () => we()
304
- }) : X.length === 0 ? /* @__PURE__ */ y(d, {
303
+ onRetry: () => J()
304
+ }) : X.length === 0 ? /* @__PURE__ */ v(l, {
305
305
  illustration: "empty-data",
306
- icon: /* @__PURE__ */ y(h, { className: "h-10 w-10" }),
306
+ icon: /* @__PURE__ */ v(f, { className: "h-10 w-10" }),
307
307
  title: "No emissions recorded",
308
- description: s === "ALL" && P === "ALL" ? "Record a CO₂e figure to start building your Scope 1–3 emissions ledger." : "No emission records match these filters.",
309
- action: /* @__PURE__ */ b(x, {
308
+ description: s === "ALL" && N === "ALL" ? "Record a CO₂e figure to start building your Scope 1–3 emissions ledger." : "No emission records match these filters.",
309
+ action: /* @__PURE__ */ y(b, {
310
310
  onClick: $,
311
- children: [/* @__PURE__ */ y(v, { className: "mr-1.5 h-4 w-4" }), " Record emission"]
311
+ children: [/* @__PURE__ */ v(m, { className: "mr-1.5 h-4 w-4" }), " Record emission"]
312
312
  })
313
- }) : /* @__PURE__ */ b(pe, { children: [/* @__PURE__ */ y(c, {
313
+ }) : /* @__PURE__ */ y(_, { children: [/* @__PURE__ */ v(ne, {
314
314
  columns: Ee,
315
315
  rows: X,
316
316
  rowKey: (e) => e.id,
@@ -318,176 +318,176 @@ function L() {
318
318
  key: "period",
319
319
  dir: "desc"
320
320
  }
321
- }), /* @__PURE__ */ y(le, {
322
- page: R.page,
323
- pageSize: N,
321
+ }), /* @__PURE__ */ v(de, {
322
+ page: L.page,
323
+ pageSize: M,
324
324
  itemCount: X.length,
325
- hasMore: J?.pageInfo?.hasMore ?? !1,
326
- onPageChange: (e) => R.onPageChange(e, J?.pageInfo?.cursor)
325
+ hasMore: q?.pageInfo?.hasMore ?? !1,
326
+ onPageChange: L.onPageChange
327
327
  })] }),
328
- /* @__PURE__ */ y(me, {
329
- open: be,
328
+ /* @__PURE__ */ v(he, {
329
+ open: xe,
330
330
  onOpenChange: (e) => {
331
- z(e), e || (V(F()), U(null));
331
+ R(e), e || (B(P()), H(null));
332
332
  },
333
- children: /* @__PURE__ */ b(he, { children: [/* @__PURE__ */ b(ve, { children: [/* @__PURE__ */ y(ye, { children: "Record emission" }), /* @__PURE__ */ y(ge, { children: "Log a CO₂e figure for a reporting period — optionally attributed to an asset." })] }), /* @__PURE__ */ b("form", {
333
+ children: /* @__PURE__ */ y(ge, { children: [/* @__PURE__ */ y(ye, { children: [/* @__PURE__ */ v(be, { children: "Record emission" }), /* @__PURE__ */ v(_e, { children: "Log a CO₂e figure for a reporting period — optionally attributed to an asset." })] }), /* @__PURE__ */ y("form", {
334
334
  onSubmit: (e) => {
335
335
  e.preventDefault(), De();
336
336
  },
337
- children: [/* @__PURE__ */ b("div", {
337
+ children: [/* @__PURE__ */ y("div", {
338
338
  className: "grid gap-4 py-2",
339
339
  children: [
340
- /* @__PURE__ */ b("div", {
340
+ /* @__PURE__ */ y("div", {
341
341
  className: "grid gap-2 sm:grid-cols-2",
342
- children: [/* @__PURE__ */ b("div", {
342
+ children: [/* @__PURE__ */ y("div", {
343
343
  className: "grid gap-1.5",
344
- children: [/* @__PURE__ */ y(C, {
344
+ children: [/* @__PURE__ */ v(S, {
345
345
  htmlFor: "emScope",
346
346
  children: "Scope"
347
- }), /* @__PURE__ */ b(w, {
348
- value: B.scope,
349
- onValueChange: (e) => V({
350
- ...B,
347
+ }), /* @__PURE__ */ y(C, {
348
+ value: z.scope,
349
+ onValueChange: (e) => B({
350
+ ...z,
351
351
  scope: e
352
352
  }),
353
- children: [/* @__PURE__ */ y(D, {
353
+ children: [/* @__PURE__ */ v(E, {
354
354
  id: "emScope",
355
- children: /* @__PURE__ */ y(O, {})
356
- }), /* @__PURE__ */ y(T, { children: A.map((e) => /* @__PURE__ */ y(E, {
355
+ children: /* @__PURE__ */ v(D, {})
356
+ }), /* @__PURE__ */ v(w, { children: k.map((e) => /* @__PURE__ */ v(T, {
357
357
  value: e,
358
358
  children: r(e)
359
359
  }, e)) })]
360
360
  })]
361
- }), /* @__PURE__ */ b("div", {
361
+ }), /* @__PURE__ */ y("div", {
362
362
  className: "grid gap-1.5",
363
- children: [/* @__PURE__ */ y(C, {
363
+ children: [/* @__PURE__ */ v(S, {
364
364
  htmlFor: "emCo2e",
365
365
  children: "CO₂e (tonnes) *"
366
- }), /* @__PURE__ */ y(S, {
366
+ }), /* @__PURE__ */ v(x, {
367
367
  id: "emCo2e",
368
368
  type: "number",
369
369
  min: "0",
370
370
  step: "any",
371
- value: B.co2eTonnes,
372
- onChange: (e) => V({
373
- ...B,
371
+ value: z.co2eTonnes,
372
+ onChange: (e) => B({
373
+ ...z,
374
374
  co2eTonnes: e.target.value
375
375
  }),
376
376
  placeholder: "1250"
377
377
  })]
378
378
  })]
379
379
  }),
380
- /* @__PURE__ */ b("div", {
380
+ /* @__PURE__ */ y("div", {
381
381
  className: "grid gap-1.5",
382
- children: [/* @__PURE__ */ y(C, {
382
+ children: [/* @__PURE__ */ v(S, {
383
383
  htmlFor: "emAsset",
384
384
  children: "Asset"
385
- }), /* @__PURE__ */ b(w, {
386
- value: B.assetId,
387
- onValueChange: (e) => V({
388
- ...B,
385
+ }), /* @__PURE__ */ y(C, {
386
+ value: z.assetId,
387
+ onValueChange: (e) => B({
388
+ ...z,
389
389
  assetId: e
390
390
  }),
391
- children: [/* @__PURE__ */ y(D, {
391
+ children: [/* @__PURE__ */ v(E, {
392
392
  id: "emAsset",
393
- children: /* @__PURE__ */ y(O, { placeholder: "Optional — org-wide if unset" })
394
- }), /* @__PURE__ */ y(T, { children: q.map((e) => /* @__PURE__ */ y(E, {
393
+ children: /* @__PURE__ */ v(D, { placeholder: "Optional — org-wide if unset" })
394
+ }), /* @__PURE__ */ v(w, { children: K.map((e) => /* @__PURE__ */ v(T, {
395
395
  value: e.id,
396
396
  children: e.name
397
397
  }, e.id)) })]
398
398
  })]
399
399
  }),
400
- /* @__PURE__ */ b("div", {
400
+ /* @__PURE__ */ y("div", {
401
401
  className: "grid gap-2 sm:grid-cols-2",
402
- children: [/* @__PURE__ */ b("div", {
402
+ children: [/* @__PURE__ */ y("div", {
403
403
  className: "grid gap-1.5",
404
- children: [/* @__PURE__ */ y(C, {
404
+ children: [/* @__PURE__ */ v(S, {
405
405
  htmlFor: "emStart",
406
406
  children: "Period start *"
407
- }), /* @__PURE__ */ y(S, {
407
+ }), /* @__PURE__ */ v(x, {
408
408
  id: "emStart",
409
409
  type: "date",
410
- value: B.periodStart,
411
- onChange: (e) => V({
412
- ...B,
410
+ value: z.periodStart,
411
+ onChange: (e) => B({
412
+ ...z,
413
413
  periodStart: e.target.value
414
414
  })
415
415
  })]
416
- }), /* @__PURE__ */ b("div", {
416
+ }), /* @__PURE__ */ y("div", {
417
417
  className: "grid gap-1.5",
418
- children: [/* @__PURE__ */ y(C, {
418
+ children: [/* @__PURE__ */ v(S, {
419
419
  htmlFor: "emEnd",
420
420
  children: "Period end *"
421
- }), /* @__PURE__ */ y(S, {
421
+ }), /* @__PURE__ */ v(x, {
422
422
  id: "emEnd",
423
423
  type: "date",
424
- value: B.periodEnd,
425
- onChange: (e) => V({
426
- ...B,
424
+ value: z.periodEnd,
425
+ onChange: (e) => B({
426
+ ...z,
427
427
  periodEnd: e.target.value
428
428
  })
429
429
  })]
430
430
  })]
431
431
  }),
432
- /* @__PURE__ */ b("div", {
432
+ /* @__PURE__ */ y("div", {
433
433
  className: "grid gap-2 sm:grid-cols-2",
434
- children: [/* @__PURE__ */ b("div", {
434
+ children: [/* @__PURE__ */ y("div", {
435
435
  className: "grid gap-1.5",
436
- children: [/* @__PURE__ */ y(C, {
436
+ children: [/* @__PURE__ */ v(S, {
437
437
  htmlFor: "emSource",
438
438
  children: "Source"
439
- }), /* @__PURE__ */ y(S, {
439
+ }), /* @__PURE__ */ v(x, {
440
440
  id: "emSource",
441
- value: B.source,
442
- onChange: (e) => V({
443
- ...B,
441
+ value: z.source,
442
+ onChange: (e) => B({
443
+ ...z,
444
444
  source: e.target.value
445
445
  }),
446
446
  placeholder: "Flaring, grid electricity…"
447
447
  })]
448
- }), /* @__PURE__ */ b("div", {
448
+ }), /* @__PURE__ */ y("div", {
449
449
  className: "grid gap-1.5",
450
- children: [/* @__PURE__ */ y(C, {
450
+ children: [/* @__PURE__ */ v(S, {
451
451
  htmlFor: "emMethod",
452
452
  children: "Methodology"
453
- }), /* @__PURE__ */ y(S, {
453
+ }), /* @__PURE__ */ v(x, {
454
454
  id: "emMethod",
455
- value: B.methodology,
456
- onChange: (e) => V({
457
- ...B,
455
+ value: z.methodology,
456
+ onChange: (e) => B({
457
+ ...z,
458
458
  methodology: e.target.value
459
459
  }),
460
460
  placeholder: "GHG Protocol / IPCC / API"
461
461
  })]
462
462
  })]
463
463
  }),
464
- /* @__PURE__ */ b("div", {
464
+ /* @__PURE__ */ y("div", {
465
465
  className: "grid gap-1.5",
466
- children: [/* @__PURE__ */ y(C, {
466
+ children: [/* @__PURE__ */ v(S, {
467
467
  htmlFor: "emNotes",
468
468
  children: "Notes"
469
- }), /* @__PURE__ */ y(k, {
469
+ }), /* @__PURE__ */ v(O, {
470
470
  id: "emNotes",
471
471
  rows: 2,
472
- value: B.notes,
473
- onChange: (e) => V({
474
- ...B,
472
+ value: z.notes,
473
+ onChange: (e) => B({
474
+ ...z,
475
475
  notes: e.target.value
476
476
  }),
477
477
  placeholder: "Optional context about this figure."
478
478
  })]
479
479
  }),
480
- H && /* @__PURE__ */ y("p", {
480
+ V && /* @__PURE__ */ v("p", {
481
481
  className: "text-sm text-status-error-text",
482
- children: H
482
+ children: V
483
483
  })
484
484
  ]
485
- }), /* @__PURE__ */ b(_e, { children: [/* @__PURE__ */ y(x, {
485
+ }), /* @__PURE__ */ y(ve, { children: [/* @__PURE__ */ v(b, {
486
486
  type: "button",
487
487
  variant: "outline",
488
- onClick: () => z(!1),
488
+ onClick: () => R(!1),
489
489
  children: "Cancel"
490
- }), /* @__PURE__ */ y(x, {
490
+ }), /* @__PURE__ */ v(b, {
491
491
  type: "submit",
492
492
  disabled: Y.isPending,
493
493
  children: Y.isPending ? "Recording…" : "Record emission"
@@ -498,6 +498,6 @@ function L() {
498
498
  });
499
499
  }
500
500
  //#endregion
501
- export { L as EmissionsPage };
501
+ export { I as EmissionsPage };
502
502
 
503
503
  //# sourceMappingURL=EmissionsPage.js.map