@burdenoff/microfe-healthybowl 2026.813.8 → 2026.813.10

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.
@@ -1,43 +1,43 @@
1
1
  import { useHealthyBowl as e } from "../context/HealthyBowlContext.js";
2
2
  import { useCallback as t, useMemo as n } from "react";
3
3
  import { gql as r } from "@apollo/client";
4
- import { useMutation as i, useQuery as a } from "@apollo/client/react";
4
+ import { useApolloClient as i, useMutation as a, useQuery as o } from "@apollo/client/react";
5
5
  //#region src/healthybowl/hooks/useHealthyBowlSustainability.ts
6
- var ee = "00000000-0000-0000-0000-000000000001", o = "\n id farmId farmName year periodStart periodEnd status methodology\n totalScope1 totalScope2 totalScope3 totalCo2e sequesteredCo2e netCo2e\n intensityPerTonne lockedAt verifiedAt notes activityCount createdAt updatedAt\n", s = "\n id inventoryId scope category sourceType sourceRef label quantity unit\n factorKey factorValue factorSet co2e activityDate\n", c = "\n id farmId fieldId practiceType startDate endDate areaHa evidence notes createdAt\n", l = "\n id farmId fieldId practiceId periodStart periodEnd methodology tCo2eSequestered\n baselineSoc currentSoc areaHa confidence notes createdAt\n", u = "\n id farmId creditCode method vintageYear quantityTCo2e registry status\n registrySerial verifierRef pricePerCredit currency baselinePractice\n inventoryId soilCarbonEstimateId regenerativePracticeId linkedFieldIds issuedDate notes createdAt updatedAt\n", d = "\n id farmId fieldId traceBatchId statementCode commodity plotGeojson plotAreaHa\n geoLatitude geoLongitude productionDateFrom productionDateTo cutoffDate\n deforestationRisk cutoffCompliant riskAssessment dataSource lastVerifiedAt\n status statementFileId dueDiligenceRef createdAt updatedAt\n", f = "\n id farmId year reportCode format reportFileId summary generatedAt\n", te = r`
6
+ var ee = "00000000-0000-0000-0000-000000000001", s = "\n id farmId farmName year periodStart periodEnd status methodology\n totalScope1 totalScope2 totalScope3 totalCo2e sequesteredCo2e netCo2e\n intensityPerTonne lockedAt verifiedAt notes activityCount createdAt updatedAt\n", c = "\n id inventoryId scope category sourceType sourceRef label quantity unit\n factorKey factorValue factorSet co2e activityDate\n", l = "\n id farmId fieldId practiceType startDate endDate areaHa evidence notes createdAt\n", u = "\n id farmId fieldId practiceId periodStart periodEnd methodology tCo2eSequestered\n baselineSoc currentSoc areaHa confidence notes createdAt\n", d = "\n id farmId creditCode method vintageYear quantityTCo2e registry status\n registrySerial verifierRef pricePerCredit currency baselinePractice\n inventoryId soilCarbonEstimateId regenerativePracticeId linkedFieldIds issuedDate notes createdAt updatedAt\n", f = "\n id farmId fieldId traceBatchId statementCode commodity plotGeojson plotAreaHa\n geoLatitude geoLongitude productionDateFrom productionDateTo cutoffDate\n deforestationRisk cutoffCompliant riskAssessment dataSource lastVerifiedAt\n status statementFileId dueDiligenceRef createdAt updatedAt\n", p = "\n id farmId year reportCode format reportFileId summary generatedAt\n", te = r`
7
7
  query GetHealthyBowlCarbonOverview($context: ContextInput!, $farmId: ID, $year: Int) {
8
8
  getHealthyBowlCarbonOverview(context: $context, farmId: $farmId, year: $year) {
9
9
  farmId farmName farmLocation year hasData
10
- inventory { ${o} }
10
+ inventory { ${s} }
11
11
  totalEmissions emissionsChangePct sequestered netBalance netStatus intensityPerTonne
12
12
  scopeBreakdown { scope label co2e percentage }
13
13
  soilCarbonTrend { label periodEnd cumulativeTco2e }
14
14
  credits { total verified pending draft issued totalTco2e }
15
- eudr { totalPlots compliantPlots latestStatement { ${d} } }
15
+ eudr { totalPlots compliantPlots latestStatement { ${f} } }
16
16
  }
17
17
  }
18
18
  `, ne = r`
19
19
  query GetHealthyBowlGhgInventory($context: ContextInput!, $farmId: ID!, $year: Int) {
20
- getHealthyBowlGhgInventory(context: $context, farmId: $farmId, year: $year) { ${o} }
20
+ getHealthyBowlGhgInventory(context: $context, farmId: $farmId, year: $year) { ${s} }
21
21
  }
22
22
  `, re = r`
23
23
  query ListHealthyBowlGhgActivities($context: ContextInput!, $inventoryId: ID!, $limit: Int, $offset: Int) {
24
24
  listHealthyBowlGhgActivities(context: $context, inventoryId: $inventoryId, limit: $limit, offset: $offset) {
25
- ${s}
25
+ ${c}
26
26
  }
27
27
  }
28
28
  `, ie = r`
29
29
  query ListHealthyBowlRegenerativePractices($context: ContextInput!, $farmId: ID, $limit: Int, $offset: Int) {
30
30
  listHealthyBowlRegenerativePractices(context: $context, farmId: $farmId, limit: $limit, offset: $offset) {
31
- ${c}
31
+ ${l}
32
32
  }
33
33
  }
34
34
  `, ae = r`
35
35
  query ListHealthyBowlSoilCarbonEstimates($context: ContextInput!, $farmId: ID, $limit: Int, $offset: Int) {
36
36
  listHealthyBowlSoilCarbonEstimates(context: $context, farmId: $farmId, limit: $limit, offset: $offset) {
37
- ${l}
37
+ ${u}
38
38
  }
39
39
  }
40
- `, p = r`
40
+ `, m = r`
41
41
  query ListHealthyBowlCarbonCredits(
42
42
  $context: ContextInput!
43
43
  $farmId: ID
@@ -56,31 +56,39 @@ var ee = "00000000-0000-0000-0000-000000000001", o = "\n id farmId farmName yea
56
56
  limit: $limit
57
57
  offset: $offset
58
58
  ) {
59
- items { ${u} }
59
+ items { ${d} }
60
60
  total verifiedCount pendingCount draftCount issuedCount totalTco2e
61
61
  }
62
62
  }
63
63
  `, oe = r`
64
64
  query GetHealthyBowlCarbonCredit($context: ContextInput!, $id: ID!) {
65
- getHealthyBowlCarbonCredit(context: $context, id: $id) { ${u} }
65
+ getHealthyBowlCarbonCredit(context: $context, id: $id) { ${d} }
66
66
  }
67
67
  `, se = r`
68
68
  query ListHealthyBowlEudrStatements($context: ContextInput!, $farmId: ID, $limit: Int, $offset: Int) {
69
69
  listHealthyBowlEudrStatements(context: $context, farmId: $farmId, limit: $limit, offset: $offset) {
70
- ${d}
70
+ ${f}
71
71
  }
72
72
  }
73
73
  `, ce = r`
74
74
  query GetHealthyBowlEudrStatement($context: ContextInput!, $id: ID!) {
75
- getHealthyBowlEudrStatement(context: $context, id: $id) { ${d} }
75
+ getHealthyBowlEudrStatement(context: $context, id: $id) { ${f} }
76
76
  }
77
77
  `, le = r`
78
78
  query ListHealthyBowlMrvReports($context: ContextInput!, $farmId: ID, $limit: Int, $offset: Int) {
79
79
  listHealthyBowlMrvReports(context: $context, farmId: $farmId, limit: $limit, offset: $offset) {
80
- ${f}
80
+ ${p}
81
81
  }
82
82
  }
83
83
  `, ue = r`
84
+ query GetHealthyBowlMrvReportFile($context: ContextInput!, $id: ID!) {
85
+ getHealthyBowlMrvReportFile(context: $context, id: $id) {
86
+ ${p}
87
+ pdfBase64
88
+ csv
89
+ }
90
+ }
91
+ `, de = r`
84
92
  query GetHealthyBowlSustainabilityFields($context: ContextInput!) {
85
93
  getHealthyBowlCropsData(context: $context) {
86
94
  fields {
@@ -91,11 +99,11 @@ var ee = "00000000-0000-0000-0000-000000000001", o = "\n id farmId farmName yea
91
99
  }
92
100
  }
93
101
  }
94
- `, de = r`
102
+ `, fe = r`
95
103
  mutation RecomputeHealthyBowlGhgInventory($input: RecomputeHealthyBowlGhgInventoryInput!) {
96
- recomputeHealthyBowlGhgInventory(input: $input) { ${o} }
104
+ recomputeHealthyBowlGhgInventory(input: $input) { ${s} }
97
105
  }
98
- `, fe = r`
106
+ `, pe = r`
99
107
  mutation LockHealthyBowlGhgInventory($context: ContextInput!, $id: ID!) {
100
108
  lockHealthyBowlGhgInventory(context: $context, id: $id) {
101
109
  id
@@ -103,7 +111,7 @@ var ee = "00000000-0000-0000-0000-000000000001", o = "\n id farmId farmName yea
103
111
  lockedAt
104
112
  }
105
113
  }
106
- `, pe = r`
114
+ `, me = r`
107
115
  mutation VerifyHealthyBowlGhgInventory($context: ContextInput!, $id: ID!) {
108
116
  verifyHealthyBowlGhgInventory(context: $context, id: $id) {
109
117
  id
@@ -111,7 +119,7 @@ var ee = "00000000-0000-0000-0000-000000000001", o = "\n id farmId farmName yea
111
119
  verifiedAt
112
120
  }
113
121
  }
114
- `, me = r`
122
+ `, he = r`
115
123
  mutation UpsertHealthyBowlGhgActivity($input: UpsertHealthyBowlGhgActivityInput!) {
116
124
  upsertHealthyBowlGhgActivity(input: $input) {
117
125
  id
@@ -120,25 +128,25 @@ var ee = "00000000-0000-0000-0000-000000000001", o = "\n id farmId farmName yea
120
128
  co2e
121
129
  }
122
130
  }
123
- `, he = r`
131
+ `, ge = r`
124
132
  mutation DeleteHealthyBowlGhgActivity($context: ContextInput!, $id: ID!) {
125
133
  deleteHealthyBowlGhgActivity(context: $context, id: $id)
126
134
  }
127
- `, ge = r`
135
+ `, _e = r`
128
136
  mutation CreateHealthyBowlRegenerativePractice($input: CreateHealthyBowlRegenerativePracticeInput!) {
129
137
  createHealthyBowlRegenerativePractice(input: $input) {
130
138
  id
131
139
  practiceType
132
140
  }
133
141
  }
134
- `, _e = r`
142
+ `, ve = r`
135
143
  mutation UpsertHealthyBowlSoilCarbonEstimate($input: UpsertHealthyBowlSoilCarbonEstimateInput!) {
136
144
  upsertHealthyBowlSoilCarbonEstimate(input: $input) {
137
145
  id
138
146
  tCo2eSequestered
139
147
  }
140
148
  }
141
- `, ve = r`
149
+ `, ye = r`
142
150
  mutation CreateHealthyBowlCarbonCredit($input: CreateHealthyBowlCarbonCreditInput!) {
143
151
  createHealthyBowlCarbonCredit(input: $input) {
144
152
  id
@@ -147,18 +155,18 @@ var ee = "00000000-0000-0000-0000-000000000001", o = "\n id farmId farmName yea
147
155
  quantityTCo2e
148
156
  }
149
157
  }
150
- `, ye = r`
158
+ `, be = r`
151
159
  mutation TransitionHealthyBowlCarbonCredit($input: TransitionHealthyBowlCarbonCreditInput!) {
152
160
  transitionHealthyBowlCarbonCredit(input: $input) {
153
161
  id
154
162
  status
155
163
  }
156
164
  }
157
- `, be = r`
165
+ `, xe = r`
158
166
  mutation DeleteHealthyBowlCarbonCredit($context: ContextInput!, $id: ID!) {
159
167
  deleteHealthyBowlCarbonCredit(context: $context, id: $id)
160
168
  }
161
- `, xe = r`
169
+ `, Se = r`
162
170
  mutation UpsertHealthyBowlEudrStatement($input: UpsertHealthyBowlEudrStatementInput!) {
163
171
  upsertHealthyBowlEudrStatement(input: $input) {
164
172
  id
@@ -167,7 +175,7 @@ var ee = "00000000-0000-0000-0000-000000000001", o = "\n id farmId farmName yea
167
175
  cutoffCompliant
168
176
  }
169
177
  }
170
- `, Se = r`
178
+ `, Ce = r`
171
179
  mutation ExportHealthyBowlEudrStatement($context: ContextInput!, $id: ID!) {
172
180
  exportHealthyBowlEudrStatement(context: $context, id: $id) {
173
181
  statementCode
@@ -176,11 +184,11 @@ var ee = "00000000-0000-0000-0000-000000000001", o = "\n id farmId farmName yea
176
184
  fileId
177
185
  }
178
186
  }
179
- `, Ce = r`
187
+ `, we = r`
180
188
  mutation DeleteHealthyBowlEudrStatement($context: ContextInput!, $id: ID!) {
181
189
  deleteHealthyBowlEudrStatement(context: $context, id: $id)
182
190
  }
183
- `, we = r`
191
+ `, Te = r`
184
192
  mutation GenerateHealthyBowlMrvReport($input: GenerateHealthyBowlMrvReportInput!) {
185
193
  generateHealthyBowlMrvReport(input: $input) {
186
194
  id
@@ -196,329 +204,340 @@ var ee = "00000000-0000-0000-0000-000000000001", o = "\n id farmId farmName yea
196
204
  }
197
205
  }
198
206
  `;
199
- function m(e, t) {
207
+ function h(e, t) {
200
208
  if (typeof document > "u") return;
201
209
  let n = URL.createObjectURL(e), r = document.createElement("a");
202
210
  r.href = n, r.download = t, document.body.appendChild(r), r.click(), r.remove(), URL.revokeObjectURL(n);
203
211
  }
204
- function h(e, t, n) {
212
+ function g(e, t, n) {
205
213
  let r = atob(e), i = new Uint8Array(r.length);
206
214
  for (let e = 0; e < r.length; e += 1) i[e] = r.charCodeAt(e);
207
- m(new Blob([i], { type: n }), t);
215
+ h(new Blob([i], { type: n }), t);
208
216
  }
209
- function Te(e, t, n) {
210
- m(new Blob([e], { type: n }), t);
217
+ function _(e, t, n) {
218
+ h(new Blob([e], { type: n }), t);
211
219
  }
212
- function g(r = {}) {
213
- let { workspaceId: o } = e(), s = o || ee, c = n(() => ({ workspaceId: s }), [s]), l = r.include ?? {}, { year: u, creditFilters: d } = r, f = a(te, {
220
+ function v(r = {}) {
221
+ let { workspaceId: s } = e(), c = s || ee, l = n(() => ({ workspaceId: c }), [c]), u = r.include ?? {}, { year: d, creditFilters: f } = r, p = o(te, {
214
222
  variables: {
215
- context: c,
223
+ context: l,
216
224
  farmId: r.farmId ?? null,
217
- year: u ?? null
225
+ year: d ?? null
218
226
  },
219
227
  fetchPolicy: "cache-and-network"
220
- }), m = f.data?.getHealthyBowlCarbonOverview ?? null, g = r.farmId ?? m?.farmId ?? null, _ = a(ne, {
228
+ }), h = p.data?.getHealthyBowlCarbonOverview ?? null, v = r.farmId ?? h?.farmId ?? null, y = o(ne, {
221
229
  variables: {
222
- context: c,
223
- farmId: g ?? "",
224
- year: u ?? null
230
+ context: l,
231
+ farmId: v ?? "",
232
+ year: d ?? null
225
233
  },
226
234
  fetchPolicy: "cache-and-network",
227
- skip: !l.ghg || !g
228
- }), v = _.data?.getHealthyBowlGhgInventory ?? m?.inventory ?? null, y = v?.id ?? null, b = a(re, {
235
+ skip: !u.ghg || !v
236
+ }), b = y.data?.getHealthyBowlGhgInventory ?? h?.inventory ?? null, x = b?.id ?? null, S = o(re, {
229
237
  variables: {
230
- context: c,
231
- inventoryId: y ?? "",
238
+ context: l,
239
+ inventoryId: x ?? "",
232
240
  limit: 200,
233
241
  offset: 0
234
242
  },
235
243
  fetchPolicy: "cache-and-network",
236
- skip: !l.ghg || !y
237
- }), x = a(ae, {
244
+ skip: !u.ghg || !x
245
+ }), C = o(ae, {
238
246
  variables: {
239
- context: c,
240
- farmId: g ?? null,
247
+ context: l,
248
+ farmId: v ?? null,
241
249
  limit: 100,
242
250
  offset: 0
243
251
  },
244
252
  fetchPolicy: "cache-and-network",
245
- skip: !l.soil || !g
246
- }), S = a(ie, {
253
+ skip: !u.soil || !v
254
+ }), w = o(ie, {
247
255
  variables: {
248
- context: c,
249
- farmId: g ?? null,
256
+ context: l,
257
+ farmId: v ?? null,
250
258
  limit: 100,
251
259
  offset: 0
252
260
  },
253
261
  fetchPolicy: "cache-and-network",
254
- skip: !l.soil || !g
255
- }), C = a(p, {
262
+ skip: !u.soil || !v
263
+ }), T = o(m, {
256
264
  variables: {
257
- context: c,
258
- farmId: g ?? null,
259
- status: d?.status ?? null,
260
- method: d?.method ?? null,
261
- vintageYear: d?.vintageYear ?? null,
265
+ context: l,
266
+ farmId: v ?? null,
267
+ status: f?.status ?? null,
268
+ method: f?.method ?? null,
269
+ vintageYear: f?.vintageYear ?? null,
262
270
  limit: 200,
263
271
  offset: 0
264
272
  },
265
273
  fetchPolicy: "cache-and-network",
266
- skip: !l.credits || !g
267
- }), w = a(p, {
274
+ skip: !u.credits || !v
275
+ }), E = o(m, {
268
276
  variables: {
269
- context: c,
270
- farmId: g ?? null,
277
+ context: l,
278
+ farmId: v ?? null,
271
279
  limit: 5,
272
280
  offset: 0
273
281
  },
274
282
  fetchPolicy: "cache-and-network",
275
- skip: !l.creditsPreview || !g
276
- }), T = a(se, {
283
+ skip: !u.creditsPreview || !v
284
+ }), D = o(se, {
277
285
  variables: {
278
- context: c,
279
- farmId: g ?? null,
286
+ context: l,
287
+ farmId: v ?? null,
280
288
  limit: 100,
281
289
  offset: 0
282
290
  },
283
291
  fetchPolicy: "cache-and-network",
284
- skip: !l.eudr || !g
285
- }), E = a(le, {
292
+ skip: !u.eudr || !v
293
+ }), O = o(le, {
286
294
  variables: {
287
- context: c,
288
- farmId: g ?? null,
295
+ context: l,
296
+ farmId: v ?? null,
289
297
  limit: 50,
290
298
  offset: 0
291
299
  },
292
300
  fetchPolicy: "cache-and-network",
293
- skip: !l.mrvReports || !g
294
- }), D = a(ue, {
295
- variables: { context: c },
301
+ skip: !u.mrvReports || !v
302
+ }), k = o(de, {
303
+ variables: { context: l },
296
304
  fetchPolicy: "cache-and-network",
297
- skip: !l.fields
298
- }), O = f.refetch, k = _.refetch, A = b.refetch, j = x.refetch, M = S.refetch, N = C.refetch, P = w.refetch, F = T.refetch, I = E.refetch, L = t(async (...e) => {
305
+ skip: !u.fields
306
+ }), A = p.refetch, j = y.refetch, M = S.refetch, N = C.refetch, P = w.refetch, F = T.refetch, I = E.refetch, L = D.refetch, R = O.refetch, z = t(async (...e) => {
299
307
  await Promise.all(e.map((e) => e().catch(() => {})));
300
- }, []), [R] = i(de), [z] = i(fe), [B] = i(pe), [V] = i(me), [H] = i(he), [U] = i(ge), [W] = i(_e), [G] = i(ve), [K] = i(ye), [q] = i(be), [J] = i(xe), [Y] = i(Se), [Ee] = i(Ce), [X] = i(we), Z = t(async (e, t, n) => {
308
+ }, []), [B] = a(fe), [V] = a(pe), [H] = a(me), [U] = a(he), [W] = a(ge), [G] = a(_e), [K] = a(ve), [q] = a(ye), [J] = a(be), [Y] = a(xe), [Ee] = a(Se), [De] = a(Ce), [Oe] = a(we), ke = i(), [X] = a(Te), Z = t(async (e, t, n) => {
301
309
  let r = await e({ variables: t });
302
310
  if (r.error) throw r.error instanceof Error ? r.error : Error(String(r.error));
303
- return await L(...n), r.data;
304
- }, [L]), Q = t((e) => ({
311
+ return await z(...n), r.data;
312
+ }, [z]), Q = t((e) => ({
305
313
  ...e,
306
- context: c
307
- }), [c]), $ = n(() => [
308
- O,
309
- k,
310
- A
314
+ context: l
315
+ }), [l]), $ = n(() => [
316
+ A,
317
+ j,
318
+ M
311
319
  ], [
312
- O,
313
- k,
314
- A
320
+ A,
321
+ j,
322
+ M
315
323
  ]);
316
324
  return {
317
- overview: m,
318
- inventory: v,
319
- activities: b.data?.listHealthyBowlGhgActivities ?? [],
320
- soilEstimates: x.data?.listHealthyBowlSoilCarbonEstimates ?? [],
321
- practices: S.data?.listHealthyBowlRegenerativePractices ?? [],
322
- credits: C.data?.listHealthyBowlCarbonCredits ?? null,
323
- creditsPreview: w.data?.listHealthyBowlCarbonCredits ?? null,
324
- eudrStatements: T.data?.listHealthyBowlEudrStatements ?? [],
325
- mrvReports: E.data?.listHealthyBowlMrvReports ?? [],
326
- fields: D.data?.getHealthyBowlCropsData?.fields ?? [],
327
- farmId: g,
325
+ overview: h,
326
+ inventory: b,
327
+ activities: S.data?.listHealthyBowlGhgActivities ?? [],
328
+ soilEstimates: C.data?.listHealthyBowlSoilCarbonEstimates ?? [],
329
+ practices: w.data?.listHealthyBowlRegenerativePractices ?? [],
330
+ credits: T.data?.listHealthyBowlCarbonCredits ?? null,
331
+ creditsPreview: E.data?.listHealthyBowlCarbonCredits ?? null,
332
+ eudrStatements: D.data?.listHealthyBowlEudrStatements ?? [],
333
+ mrvReports: O.data?.listHealthyBowlMrvReports ?? [],
334
+ fields: k.data?.getHealthyBowlCropsData?.fields ?? [],
335
+ farmId: v,
328
336
  loading: {
329
- overview: f.loading,
330
- inventory: _.loading,
331
- activities: b.loading,
332
- soilEstimates: x.loading,
333
- practices: S.loading,
334
- credits: C.loading,
335
- creditsPreview: w.loading,
336
- eudr: T.loading,
337
- mrvReports: E.loading,
338
- fields: D.loading
337
+ overview: p.loading,
338
+ inventory: y.loading,
339
+ activities: S.loading,
340
+ soilEstimates: C.loading,
341
+ practices: w.loading,
342
+ credits: T.loading,
343
+ creditsPreview: E.loading,
344
+ eudr: D.loading,
345
+ mrvReports: O.loading,
346
+ fields: k.loading
339
347
  },
340
348
  errors: {
341
- overview: f.error,
342
- inventory: _.error,
343
- activities: b.error,
344
- soilEstimates: x.error,
345
- practices: S.error,
346
- credits: C.error,
347
- creditsPreview: w.error,
348
- eudr: T.error,
349
- mrvReports: E.error,
350
- fields: D.error
349
+ overview: p.error,
350
+ inventory: y.error,
351
+ activities: S.error,
352
+ soilEstimates: C.error,
353
+ practices: w.error,
354
+ credits: T.error,
355
+ creditsPreview: E.error,
356
+ eudr: D.error,
357
+ mrvReports: O.error,
358
+ fields: k.error
351
359
  },
352
- refetchAll: t(() => L(O, k, A, j, M, N, P, F, I), [
353
- L,
354
- O,
355
- k,
360
+ refetchAll: t(() => z(A, j, M, N, P, F, I, L, R), [
361
+ z,
356
362
  A,
357
363
  j,
358
364
  M,
359
365
  N,
360
366
  P,
361
367
  F,
362
- I
368
+ I,
369
+ L,
370
+ R
363
371
  ]),
364
372
  recomputeInventory: t(async (e, t) => {
365
- let n = await R({ variables: { input: {
366
- context: c,
373
+ let n = await B({ variables: { input: {
374
+ context: l,
367
375
  farmId: e,
368
376
  ...t ? { year: t } : {}
369
377
  } } });
370
378
  if (n.error) throw n.error;
371
- return await L(...$, N, P), n.data?.recomputeHealthyBowlGhgInventory ?? null;
379
+ return await z(...$, F, I), n.data?.recomputeHealthyBowlGhgInventory ?? null;
372
380
  }, [
373
- R,
374
- c,
375
- L,
381
+ B,
382
+ l,
383
+ z,
376
384
  $,
377
- N,
378
- P
385
+ F,
386
+ I
379
387
  ]),
380
- lockInventory: t((e) => Z(z, {
381
- context: c,
388
+ lockInventory: t((e) => Z(V, {
389
+ context: l,
382
390
  id: e
383
391
  }, $), [
384
392
  Z,
385
- z,
386
- c,
393
+ V,
394
+ l,
387
395
  $
388
396
  ]),
389
- verifyInventory: t((e) => Z(B, {
390
- context: c,
397
+ verifyInventory: t((e) => Z(H, {
398
+ context: l,
391
399
  id: e
392
400
  }, $), [
393
401
  Z,
394
- B,
395
- c,
402
+ H,
403
+ l,
396
404
  $
397
405
  ]),
398
- upsertActivity: t((e) => Z(V, { input: Q(e) }, $), [
406
+ upsertActivity: t((e) => Z(U, { input: Q(e) }, $), [
399
407
  Z,
400
- V,
408
+ U,
401
409
  Q,
402
410
  $
403
411
  ]),
404
- deleteActivity: t((e) => Z(H, {
405
- context: c,
412
+ deleteActivity: t((e) => Z(W, {
413
+ context: l,
406
414
  id: e
407
415
  }, $), [
408
416
  Z,
409
- H,
410
- c,
417
+ W,
418
+ l,
411
419
  $
412
420
  ]),
413
- createPractice: t((e) => Z(U, { input: Q(e) }, [M, O]), [
421
+ createPractice: t((e) => Z(G, { input: Q(e) }, [P, A]), [
414
422
  Z,
415
- U,
423
+ G,
416
424
  Q,
417
- M,
418
- O
425
+ P,
426
+ A
419
427
  ]),
420
- upsertSoilEstimate: t((e) => Z(W, { input: Q(e) }, [j, O]), [
428
+ upsertSoilEstimate: t((e) => Z(K, { input: Q(e) }, [N, A]), [
421
429
  Z,
422
- W,
430
+ K,
423
431
  Q,
424
- j,
425
- O
432
+ N,
433
+ A
426
434
  ]),
427
435
  createCredit: t(async (e) => {
428
- let t = await G({ variables: { input: Q(e) } });
436
+ let t = await q({ variables: { input: Q(e) } });
429
437
  if (t.error) throw t.error;
430
- return await L(N, P, O), t.data?.createHealthyBowlCarbonCredit ?? null;
438
+ return await z(F, I, A), t.data?.createHealthyBowlCarbonCredit ?? null;
431
439
  }, [
432
- G,
440
+ q,
433
441
  Q,
434
- L,
435
- N,
436
- P,
437
- O
442
+ z,
443
+ F,
444
+ I,
445
+ A
438
446
  ]),
439
- transitionCredit: t((e) => Z(K, { input: Q(e) }, [
440
- N,
441
- P,
442
- O
447
+ transitionCredit: t((e) => Z(J, { input: Q(e) }, [
448
+ F,
449
+ I,
450
+ A
443
451
  ]), [
444
452
  Z,
445
- K,
453
+ J,
446
454
  Q,
447
- N,
448
- P,
449
- O
455
+ F,
456
+ I,
457
+ A
450
458
  ]),
451
- deleteCredit: t((e) => Z(q, {
452
- context: c,
459
+ deleteCredit: t((e) => Z(Y, {
460
+ context: l,
453
461
  id: e
454
462
  }, [
455
- N,
456
- P,
457
- O
463
+ F,
464
+ I,
465
+ A
458
466
  ]), [
459
467
  Z,
460
- q,
461
- c,
462
- N,
463
- P,
464
- O
468
+ Y,
469
+ l,
470
+ F,
471
+ I,
472
+ A
465
473
  ]),
466
- upsertEudrStatement: t((e) => Z(J, { input: Q(e) }, [F, O]), [
474
+ upsertEudrStatement: t((e) => Z(Ee, { input: Q(e) }, [L, A]), [
467
475
  Z,
468
- J,
476
+ Ee,
469
477
  Q,
470
- F,
471
- O
478
+ L,
479
+ A
472
480
  ]),
473
- deleteEudrStatement: t((e) => Z(Ee, {
474
- context: c,
481
+ deleteEudrStatement: t((e) => Z(Oe, {
482
+ context: l,
475
483
  id: e
476
- }, [F, O]), [
484
+ }, [L, A]), [
477
485
  Z,
478
- Ee,
479
- c,
480
- F,
481
- O
486
+ Oe,
487
+ l,
488
+ L,
489
+ A
482
490
  ]),
483
491
  exportEudrStatement: t(async (e) => {
484
- let t = await Y({ variables: {
485
- context: c,
492
+ let t = await De({ variables: {
493
+ context: l,
486
494
  id: e
487
495
  } });
488
496
  if (t.error) throw t.error;
489
497
  let n = t.data?.exportHealthyBowlEudrStatement ?? null;
490
- return n?.pdfBase64 && h(n.pdfBase64, n.fileName || `${n.statementCode}.pdf`, "application/pdf"), await L(F, O), n;
498
+ return n?.pdfBase64 && g(n.pdfBase64, n.fileName || `${n.statementCode}.pdf`, "application/pdf"), await z(L, A), n;
491
499
  }, [
492
- Y,
493
- c,
500
+ De,
501
+ l,
502
+ z,
494
503
  L,
495
- F,
496
- O
504
+ A
497
505
  ]),
498
506
  generateMrvReport: t(async (e, t = "PDF", n) => {
499
507
  let r = await X({ variables: { input: {
500
- context: c,
508
+ context: l,
501
509
  farmId: e,
502
510
  format: t,
503
511
  ...n ? { year: n } : {}
504
512
  } } });
505
513
  if (r.error) throw r.error;
506
514
  let i = r.data?.generateHealthyBowlMrvReport ?? null;
507
- return i && (i.format === "CSV" && i.csv ? Te(i.csv, `${i.reportCode}.csv`, "text/csv") : i.pdfBase64 && h(i.pdfBase64, `${i.reportCode}.pdf`, "application/pdf")), await L(I), i;
515
+ return i && (i.format === "CSV" && i.csv ? _(i.csv, `${i.reportCode}.csv`, "text/csv") : i.pdfBase64 && g(i.pdfBase64, `${i.reportCode}.pdf`, "application/pdf")), await z(R), i;
508
516
  }, [
509
517
  X,
510
- c,
511
- L,
512
- I
518
+ l,
519
+ z,
520
+ R
513
521
  ]),
522
+ downloadMrvReport: t(async (e) => {
523
+ let t = (await ke.query({
524
+ query: ue,
525
+ variables: {
526
+ context: l,
527
+ id: e
528
+ },
529
+ fetchPolicy: "network-only"
530
+ })).data?.getHealthyBowlMrvReportFile ?? null;
531
+ return t ? t.format === "CSV" && t.csv ? (_(t.csv, `${t.reportCode}.csv`, "text/csv"), t) : t.pdfBase64 ? (g(t.pdfBase64, `${t.reportCode}.pdf`, "application/pdf"), t) : null : null;
532
+ }, [ke, l]),
514
533
  documents: {
515
534
  GET_CARBON_CREDIT: oe,
516
535
  GET_EUDR_STATEMENT: ce
517
536
  },
518
- context: c
537
+ context: l
519
538
  };
520
539
  }
521
540
  //#endregion
522
- export { g as useHealthyBowlSustainability };
541
+ export { v as useHealthyBowlSustainability };
523
542
 
524
543
  //# sourceMappingURL=useHealthyBowlSustainability.js.map