@burdenoff/microfe-ecoimpacthub 2026.1124.1 → 2026.1124.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ecoimpacthub/EcoImpactHubRoutes.js +43 -39
- package/dist/ecoimpacthub/EcoImpactHubRoutes.js.map +1 -1
- package/dist/ecoimpacthub/hooks/index.d.ts +1 -0
- package/dist/ecoimpacthub/hooks/index.js +3 -2
- package/dist/ecoimpacthub/hooks/useEcoAiOperations.d.ts +15 -0
- package/dist/ecoimpacthub/hooks/useEcoAiOperations.js +90 -0
- package/dist/ecoimpacthub/hooks/useEcoAiOperations.js.map +1 -0
- package/dist/ecoimpacthub/hooks/useEcoImpactHubApi.js +1 -1
- package/dist/ecoimpacthub/hooks/useEcoImpactHubApi.js.map +1 -1
- package/dist/ecoimpacthub/pages/ai/AiOperationsPage.d.ts +21 -0
- package/dist/ecoimpacthub/pages/ai/AiOperationsPage.js +536 -0
- package/dist/ecoimpacthub/pages/ai/AiOperationsPage.js.map +1 -0
- package/dist/ecoimpacthub/pages/carbon/CarbonPage.js +346 -320
- package/dist/ecoimpacthub/pages/carbon/CarbonPage.js.map +1 -1
- package/dist/ecoimpacthub/pages/observations/ObservationsPage.js +165 -143
- package/dist/ecoimpacthub/pages/observations/ObservationsPage.js.map +1 -1
- package/dist/ecoimpacthub/pages/reports/ReportDetailPage.js +346 -185
- package/dist/ecoimpacthub/pages/reports/ReportDetailPage.js.map +1 -1
- package/dist/ecoimpacthub/types/index.d.ts +83 -0
- package/dist/ecoimpacthub/utils/pageContext.js +2 -1
- package/dist/ecoimpacthub/utils/pageContext.js.map +1 -1
- package/package.json +1 -1
|
@@ -3,23 +3,24 @@ import { PageLayout as t } from "../../components/PageLayout.js";
|
|
|
3
3
|
import { DataTable as n } from "../../components/DataTable.js";
|
|
4
4
|
import { ErrorView as ee, LoadingView as te } from "../../components/StateViews.js";
|
|
5
5
|
import { EmptyState as ne } from "../../components/EmptyState.js";
|
|
6
|
-
import { Pagination as
|
|
7
|
-
import { useEcoObservations as
|
|
8
|
-
import { useCursorPager as
|
|
9
|
-
import { EvidenceUpload as
|
|
10
|
-
import { MethodBadge as
|
|
11
|
-
import { MethodPicker as
|
|
12
|
-
import { UseMyLocationButton as
|
|
13
|
-
import { EvidenceThumb as
|
|
6
|
+
import { Pagination as re } from "../../components/Pagination.js";
|
|
7
|
+
import { useEcoObservations as ie, useEcoRecordObservation as r, useEcoSites as ae, useEcoSpecies as oe } from "../../hooks/useEcoImpactHubApi.js";
|
|
8
|
+
import { useCursorPager as se } from "../../hooks/useCursorPager.js";
|
|
9
|
+
import { EvidenceUpload as ce } from "../../components/EvidenceUpload.js";
|
|
10
|
+
import { MethodBadge as i } from "../_shared/MethodBadge.js";
|
|
11
|
+
import { MethodPicker as a } from "../_shared/MethodPicker.js";
|
|
12
|
+
import { UseMyLocationButton as o } from "../_shared/UseMyLocationButton.js";
|
|
13
|
+
import { EvidenceThumb as s } from "../_shared/EvidenceThumb.js";
|
|
14
14
|
import "../../hooks/index.js";
|
|
15
15
|
import "../../context/index.js";
|
|
16
|
-
import { formatCoords as
|
|
17
|
-
import { useMemo as
|
|
18
|
-
import { Binoculars as
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
16
|
+
import { formatCoords as c, formatDateTime as l, formatNumber as le } from "../../utils/formatters.js";
|
|
17
|
+
import { useMemo as u, useState as d } from "react";
|
|
18
|
+
import { Binoculars as ue, MapPin as de, Plus as f, Smartphone as fe } from "lucide-react";
|
|
19
|
+
import { useSearchParams as pe } from "react-router";
|
|
20
|
+
import { Fragment as p, jsx as m, jsxs as h } from "react/jsx-runtime";
|
|
21
|
+
import { Button as g, GlassCard as me, Input as _, Label as v, ResponsiveDialog as y, ResponsiveDialogContent as b, ResponsiveDialogDescription as he, ResponsiveDialogFooter as ge, ResponsiveDialogHeader as _e, ResponsiveDialogTitle as ve, Select as x, SelectContent as S, SelectItem as C, SelectTrigger as w, SelectValue as T, Textarea as E } from "@burdenoff/fe-libs/ui";
|
|
21
22
|
// src/ecoimpacthub/pages/observations/ObservationsPage.tsx
|
|
22
|
-
var
|
|
23
|
+
var D = [
|
|
23
24
|
"DIRECT_SIGHTING",
|
|
24
25
|
"CAMERA_TRAP",
|
|
25
26
|
"ACOUSTIC",
|
|
@@ -27,48 +28,48 @@ var O = [
|
|
|
27
28
|
"EDNA",
|
|
28
29
|
"TELEMETRY",
|
|
29
30
|
"COMMUNITY_REPORT"
|
|
30
|
-
],
|
|
31
|
+
], O = 25, k = {
|
|
31
32
|
limit: 100,
|
|
32
33
|
offset: 0
|
|
33
|
-
},
|
|
34
|
-
function
|
|
34
|
+
}, A = "NONE";
|
|
35
|
+
function j() {
|
|
35
36
|
let e = /* @__PURE__ */ new Date();
|
|
36
37
|
return (/* @__PURE__ */ new Date(e.getTime() - e.getTimezoneOffset() * 6e4)).toISOString().slice(0, 16);
|
|
37
38
|
}
|
|
38
|
-
function
|
|
39
|
+
function M() {
|
|
39
40
|
return {
|
|
40
41
|
speciesId: "",
|
|
41
|
-
observedAt:
|
|
42
|
+
observedAt: j(),
|
|
42
43
|
count: "1",
|
|
43
44
|
method: "DIRECT_SIGHTING",
|
|
44
|
-
siteId:
|
|
45
|
+
siteId: A,
|
|
45
46
|
latitude: "",
|
|
46
47
|
longitude: "",
|
|
47
48
|
notes: "",
|
|
48
49
|
evidence: null
|
|
49
50
|
};
|
|
50
51
|
}
|
|
51
|
-
function
|
|
52
|
-
let { navigateTo:
|
|
53
|
-
speciesId:
|
|
54
|
-
siteId:
|
|
52
|
+
function N() {
|
|
53
|
+
let { navigateTo: j } = e(), [N, P] = pe(), F = N.get("highlight"), [I, ye] = d("ALL"), [L, be] = d("ALL"), R = se(), [xe, z] = d(!1), [B, V] = d(M), [H, U] = d(null), W = ae({ pagination: k }), G = oe({ pagination: k }), { data: K, isLoading: Se, isError: Ce, refetch: we } = ie({
|
|
54
|
+
speciesId: I === "ALL" ? void 0 : I,
|
|
55
|
+
siteId: L === "ALL" ? void 0 : L,
|
|
55
56
|
pagination: {
|
|
56
|
-
limit:
|
|
57
|
+
limit: O,
|
|
57
58
|
cursor: R.cursor
|
|
58
59
|
}
|
|
59
|
-
}), q =
|
|
60
|
+
}), q = r(), J = u(() => W.data?.items ?? [], [W.data]), Y = u(() => G.data?.items ?? [], [G.data]), X = u(() => K?.items ?? [], [K]), Te = u(() => {
|
|
60
61
|
let e = /* @__PURE__ */ new Map();
|
|
61
62
|
for (let t of J) e.set(t.id, t.name);
|
|
62
63
|
return e;
|
|
63
|
-
}, [J]), Z =
|
|
64
|
+
}, [J]), Z = u(() => {
|
|
64
65
|
let e = /* @__PURE__ */ new Map();
|
|
65
66
|
for (let t of Y) e.set(t.id, t.commonName);
|
|
66
67
|
return e;
|
|
67
|
-
}, [Y]),
|
|
68
|
+
}, [Y]), Ee = [
|
|
68
69
|
{
|
|
69
70
|
key: "evidence",
|
|
70
71
|
header: "Evidence",
|
|
71
|
-
render: (e) => /* @__PURE__ */
|
|
72
|
+
render: (e) => /* @__PURE__ */ m(s, {
|
|
72
73
|
fileId: e.evidence?.id,
|
|
73
74
|
alt: e.species?.commonName ?? Z.get(e.speciesId)
|
|
74
75
|
})
|
|
@@ -76,12 +77,12 @@ function P() {
|
|
|
76
77
|
{
|
|
77
78
|
key: "species",
|
|
78
79
|
header: "Species",
|
|
79
|
-
render: (e) => /* @__PURE__ */
|
|
80
|
+
render: (e) => /* @__PURE__ */ h("div", {
|
|
80
81
|
className: "min-w-0",
|
|
81
|
-
children: [/* @__PURE__ */
|
|
82
|
+
children: [/* @__PURE__ */ m("p", {
|
|
82
83
|
className: "font-semibold text-text-primary",
|
|
83
84
|
children: e.species?.commonName ?? Z.get(e.speciesId) ?? "Unknown species"
|
|
84
|
-
}), e.species?.scientificName && /* @__PURE__ */
|
|
85
|
+
}), e.species?.scientificName && /* @__PURE__ */ m("p", {
|
|
85
86
|
className: "truncate text-xs italic text-text-tertiary",
|
|
86
87
|
children: e.species.scientificName
|
|
87
88
|
})]
|
|
@@ -90,25 +91,25 @@ function P() {
|
|
|
90
91
|
{
|
|
91
92
|
key: "method",
|
|
92
93
|
header: "Method",
|
|
93
|
-
render: (e) => /* @__PURE__ */
|
|
94
|
+
render: (e) => /* @__PURE__ */ m(i, { method: e.method })
|
|
94
95
|
},
|
|
95
96
|
{
|
|
96
97
|
key: "count",
|
|
97
98
|
header: "Count",
|
|
98
99
|
align: "right",
|
|
99
100
|
sortValue: (e) => e.count,
|
|
100
|
-
render: (e) => /* @__PURE__ */
|
|
101
|
+
render: (e) => /* @__PURE__ */ h("span", {
|
|
101
102
|
className: "tabular-nums font-medium text-text-primary",
|
|
102
|
-
children: ["×",
|
|
103
|
+
children: ["×", le(e.count)]
|
|
103
104
|
})
|
|
104
105
|
},
|
|
105
106
|
{
|
|
106
107
|
key: "observedAt",
|
|
107
108
|
header: "Observed",
|
|
108
109
|
hideOnMobile: !0,
|
|
109
|
-
render: (e) => /* @__PURE__ */
|
|
110
|
+
render: (e) => /* @__PURE__ */ m("span", {
|
|
110
111
|
className: "whitespace-nowrap text-text-secondary",
|
|
111
|
-
children:
|
|
112
|
+
children: l(e.observedAt)
|
|
112
113
|
})
|
|
113
114
|
},
|
|
114
115
|
{
|
|
@@ -116,11 +117,11 @@ function P() {
|
|
|
116
117
|
header: "Site",
|
|
117
118
|
hideOnMobile: !0,
|
|
118
119
|
render: (e) => {
|
|
119
|
-
let t = e.siteId ?
|
|
120
|
-
return t ? /* @__PURE__ */
|
|
120
|
+
let t = e.siteId ? Te.get(e.siteId) : void 0;
|
|
121
|
+
return t ? /* @__PURE__ */ m("span", {
|
|
121
122
|
className: "text-text-secondary",
|
|
122
123
|
children: t
|
|
123
|
-
}) : /* @__PURE__ */
|
|
124
|
+
}) : /* @__PURE__ */ m("span", {
|
|
124
125
|
className: "text-text-tertiary",
|
|
125
126
|
children: "—"
|
|
126
127
|
});
|
|
@@ -131,13 +132,13 @@ function P() {
|
|
|
131
132
|
header: "Coords",
|
|
132
133
|
hideOnMobile: !0,
|
|
133
134
|
render: (e) => {
|
|
134
|
-
let t =
|
|
135
|
-
return t === "—" ? /* @__PURE__ */
|
|
135
|
+
let t = c(e.latitude, e.longitude);
|
|
136
|
+
return t === "—" ? /* @__PURE__ */ m("span", {
|
|
136
137
|
className: "text-text-tertiary",
|
|
137
138
|
children: "—"
|
|
138
|
-
}) : /* @__PURE__ */
|
|
139
|
+
}) : /* @__PURE__ */ h("span", {
|
|
139
140
|
className: "inline-flex items-center gap-1 tabular-nums text-text-secondary",
|
|
140
|
-
children: [/* @__PURE__ */
|
|
141
|
+
children: [/* @__PURE__ */ m(de, {
|
|
141
142
|
className: "h-3.5 w-3.5 shrink-0 text-text-tertiary",
|
|
142
143
|
"aria-hidden": "true"
|
|
143
144
|
}), t]
|
|
@@ -148,20 +149,20 @@ function P() {
|
|
|
148
149
|
key: "notes",
|
|
149
150
|
header: "Notes",
|
|
150
151
|
hideOnMobile: !0,
|
|
151
|
-
render: (e) => e.notes ? /* @__PURE__ */
|
|
152
|
+
render: (e) => e.notes ? /* @__PURE__ */ m("span", {
|
|
152
153
|
className: "block max-w-xs truncate text-text-secondary",
|
|
153
154
|
title: e.notes,
|
|
154
155
|
children: e.notes
|
|
155
|
-
}) : /* @__PURE__ */
|
|
156
|
+
}) : /* @__PURE__ */ m("span", {
|
|
156
157
|
className: "text-text-tertiary",
|
|
157
158
|
children: "—"
|
|
158
159
|
})
|
|
159
160
|
}
|
|
160
161
|
], Q = () => {
|
|
161
|
-
V(
|
|
162
|
+
V(M()), U(null), z(!0);
|
|
162
163
|
}, $ = () => {
|
|
163
|
-
V(
|
|
164
|
-
},
|
|
164
|
+
V(M()), U(null);
|
|
165
|
+
}, De = async () => {
|
|
165
166
|
if (!B.speciesId) U("Species is required.");
|
|
166
167
|
else try {
|
|
167
168
|
await q.mutateAsync({
|
|
@@ -169,7 +170,7 @@ function P() {
|
|
|
169
170
|
observedAt: B.observedAt ? new Date(B.observedAt).toISOString() : (/* @__PURE__ */ new Date()).toISOString(),
|
|
170
171
|
count: B.count ? Number(B.count) : 1,
|
|
171
172
|
method: B.method,
|
|
172
|
-
siteId: B.siteId && B.siteId !==
|
|
173
|
+
siteId: B.siteId && B.siteId !== A ? B.siteId : null,
|
|
173
174
|
latitude: B.latitude ? Number(B.latitude) : null,
|
|
174
175
|
longitude: B.longitude ? Number(B.longitude) : null,
|
|
175
176
|
notes: B.notes.trim() || null,
|
|
@@ -178,62 +179,62 @@ function P() {
|
|
|
178
179
|
} catch (e) {
|
|
179
180
|
U(e instanceof Error ? e.message : "Failed to record observation.");
|
|
180
181
|
}
|
|
181
|
-
},
|
|
182
|
-
return /* @__PURE__ */
|
|
182
|
+
}, Oe = I !== "ALL" || L !== "ALL";
|
|
183
|
+
return /* @__PURE__ */ h(t, {
|
|
183
184
|
title: "Field Observations",
|
|
184
185
|
description: "Wildlife & biodiversity sightings across every species and site — your citizen-science field log.",
|
|
185
|
-
actions: /* @__PURE__ */
|
|
186
|
+
actions: /* @__PURE__ */ h(p, { children: [/* @__PURE__ */ h(g, {
|
|
186
187
|
variant: "outline",
|
|
187
|
-
onClick: () =>
|
|
188
|
-
children: [/* @__PURE__ */
|
|
189
|
-
}), /* @__PURE__ */
|
|
188
|
+
onClick: () => j("mobile/record-observation"),
|
|
189
|
+
children: [/* @__PURE__ */ m(fe, { className: "mr-1.5 h-4 w-4" }), " Field capture"]
|
|
190
|
+
}), /* @__PURE__ */ h(g, {
|
|
190
191
|
onClick: Q,
|
|
191
|
-
children: [/* @__PURE__ */
|
|
192
|
+
children: [/* @__PURE__ */ m(f, { className: "mr-1.5 h-4 w-4" }), " Record observation"]
|
|
192
193
|
})] }),
|
|
193
194
|
children: [
|
|
194
|
-
/* @__PURE__ */
|
|
195
|
+
/* @__PURE__ */ m(me, {
|
|
195
196
|
treatment: "plain",
|
|
196
197
|
className: "mb-5 p-4",
|
|
197
|
-
children: /* @__PURE__ */
|
|
198
|
+
children: /* @__PURE__ */ h("div", {
|
|
198
199
|
className: "flex flex-col gap-3 sm:flex-row sm:flex-wrap sm:items-end",
|
|
199
|
-
children: [/* @__PURE__ */
|
|
200
|
+
children: [/* @__PURE__ */ h("div", {
|
|
200
201
|
className: "grid gap-1.5",
|
|
201
|
-
children: [/* @__PURE__ */
|
|
202
|
+
children: [/* @__PURE__ */ m("span", {
|
|
202
203
|
className: "text-xs font-medium uppercase tracking-wide text-text-tertiary",
|
|
203
204
|
children: "Species"
|
|
204
|
-
}), /* @__PURE__ */
|
|
205
|
-
value:
|
|
205
|
+
}), /* @__PURE__ */ h(x, {
|
|
206
|
+
value: I,
|
|
206
207
|
onValueChange: (e) => {
|
|
207
|
-
|
|
208
|
+
ye(e), R.reset();
|
|
208
209
|
},
|
|
209
|
-
children: [/* @__PURE__ */
|
|
210
|
+
children: [/* @__PURE__ */ m(w, {
|
|
210
211
|
className: "w-full sm:w-52",
|
|
211
|
-
children: /* @__PURE__ */
|
|
212
|
-
}), /* @__PURE__ */
|
|
212
|
+
children: /* @__PURE__ */ m(T, { placeholder: "All species" })
|
|
213
|
+
}), /* @__PURE__ */ h(S, { children: [/* @__PURE__ */ m(C, {
|
|
213
214
|
value: "ALL",
|
|
214
215
|
children: "All species"
|
|
215
|
-
}), Y.map((e) => /* @__PURE__ */
|
|
216
|
+
}), Y.map((e) => /* @__PURE__ */ m(C, {
|
|
216
217
|
value: e.id,
|
|
217
218
|
children: e.commonName
|
|
218
219
|
}, e.id))] })]
|
|
219
220
|
})]
|
|
220
|
-
}), /* @__PURE__ */
|
|
221
|
+
}), /* @__PURE__ */ h("div", {
|
|
221
222
|
className: "grid gap-1.5",
|
|
222
|
-
children: [/* @__PURE__ */
|
|
223
|
+
children: [/* @__PURE__ */ m("span", {
|
|
223
224
|
className: "text-xs font-medium uppercase tracking-wide text-text-tertiary",
|
|
224
225
|
children: "Site"
|
|
225
|
-
}), /* @__PURE__ */
|
|
226
|
-
value:
|
|
226
|
+
}), /* @__PURE__ */ h(x, {
|
|
227
|
+
value: L,
|
|
227
228
|
onValueChange: (e) => {
|
|
228
|
-
|
|
229
|
+
be(e), R.reset();
|
|
229
230
|
},
|
|
230
|
-
children: [/* @__PURE__ */
|
|
231
|
+
children: [/* @__PURE__ */ m(w, {
|
|
231
232
|
className: "w-full sm:w-52",
|
|
232
|
-
children: /* @__PURE__ */
|
|
233
|
-
}), /* @__PURE__ */
|
|
233
|
+
children: /* @__PURE__ */ m(T, { placeholder: "All sites" })
|
|
234
|
+
}), /* @__PURE__ */ h(S, { children: [/* @__PURE__ */ m(C, {
|
|
234
235
|
value: "ALL",
|
|
235
236
|
children: "All sites"
|
|
236
|
-
}), J.map((e) => /* @__PURE__ */
|
|
237
|
+
}), J.map((e) => /* @__PURE__ */ m(C, {
|
|
237
238
|
value: e.id,
|
|
238
239
|
children: e.name
|
|
239
240
|
}, e.id))] })]
|
|
@@ -241,74 +242,95 @@ function P() {
|
|
|
241
242
|
})]
|
|
242
243
|
})
|
|
243
244
|
}),
|
|
244
|
-
|
|
245
|
+
Se ? /* @__PURE__ */ m(te, { label: "Loading observations…" }) : Ce ? /* @__PURE__ */ m(ee, {
|
|
245
246
|
message: "Couldn't load observations.",
|
|
246
|
-
onRetry: () =>
|
|
247
|
-
}) : X.length === 0 ? /* @__PURE__ */
|
|
247
|
+
onRetry: () => we()
|
|
248
|
+
}) : X.length === 0 ? /* @__PURE__ */ m(ne, {
|
|
248
249
|
illustration: "empty-data",
|
|
249
|
-
icon: /* @__PURE__ */
|
|
250
|
+
icon: /* @__PURE__ */ m(ue, { className: "h-10 w-10" }),
|
|
250
251
|
title: "No observations yet",
|
|
251
|
-
description:
|
|
252
|
-
action: /* @__PURE__ */
|
|
252
|
+
description: Oe ? "No observations match these filters." : "Record your first field observation to start building your biodiversity dataset.",
|
|
253
|
+
action: /* @__PURE__ */ h(g, {
|
|
253
254
|
onClick: Q,
|
|
254
|
-
children: [/* @__PURE__ */
|
|
255
|
+
children: [/* @__PURE__ */ m(f, { className: "mr-1.5 h-4 w-4" }), " Record observation"]
|
|
256
|
+
})
|
|
257
|
+
}) : /* @__PURE__ */ h(p, { children: [
|
|
258
|
+
F && /* @__PURE__ */ h("div", {
|
|
259
|
+
role: "status",
|
|
260
|
+
"data-testid": "eco-observation-highlight-banner",
|
|
261
|
+
className: "mb-3 flex items-center justify-between rounded-lg border border-border-seam bg-bg-sunken px-3 py-2 text-xs text-text-primary",
|
|
262
|
+
children: [/* @__PURE__ */ h("span", { children: ["Highlighting cited observation ", /* @__PURE__ */ m("code", {
|
|
263
|
+
className: "font-mono",
|
|
264
|
+
children: F
|
|
265
|
+
})] }), /* @__PURE__ */ m(g, {
|
|
266
|
+
size: "sm",
|
|
267
|
+
variant: "ghost",
|
|
268
|
+
onClick: () => {
|
|
269
|
+
let e = new URLSearchParams(N);
|
|
270
|
+
e.delete("highlight"), P(e, { replace: !0 });
|
|
271
|
+
},
|
|
272
|
+
children: "Clear highlight"
|
|
273
|
+
})]
|
|
274
|
+
}),
|
|
275
|
+
/* @__PURE__ */ m(n, {
|
|
276
|
+
columns: Ee,
|
|
277
|
+
rows: X,
|
|
278
|
+
rowKey: (e) => e.id,
|
|
279
|
+
rowClassName: (e) => F && e.id === F ? "bg-status-warning-bg-subtle/60 ring-1 ring-inset ring-border-strong" : void 0
|
|
280
|
+
}),
|
|
281
|
+
/* @__PURE__ */ m(re, {
|
|
282
|
+
page: R.page,
|
|
283
|
+
pageSize: O,
|
|
284
|
+
itemCount: X.length,
|
|
285
|
+
hasMore: K?.pageInfo?.hasMore ?? !1,
|
|
286
|
+
onPageChange: (e) => R.onPageChange(e, K?.pageInfo?.cursor)
|
|
255
287
|
})
|
|
256
|
-
})
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
rowKey: (e) => e.id
|
|
260
|
-
}), /* @__PURE__ */ g(r, {
|
|
261
|
-
page: R.page,
|
|
262
|
-
pageSize: k,
|
|
263
|
-
itemCount: X.length,
|
|
264
|
-
hasMore: K?.pageInfo?.hasMore ?? !1,
|
|
265
|
-
onPageChange: (e) => R.onPageChange(e, K?.pageInfo?.cursor)
|
|
266
|
-
})] }),
|
|
267
|
-
/* @__PURE__ */ g(x, {
|
|
268
|
-
open: _e,
|
|
288
|
+
] }),
|
|
289
|
+
/* @__PURE__ */ m(y, {
|
|
290
|
+
open: xe,
|
|
269
291
|
onOpenChange: (e) => {
|
|
270
292
|
z(e), e || $();
|
|
271
293
|
},
|
|
272
|
-
children: /* @__PURE__ */
|
|
273
|
-
/* @__PURE__ */
|
|
274
|
-
/* @__PURE__ */
|
|
294
|
+
children: /* @__PURE__ */ h(b, { children: [
|
|
295
|
+
/* @__PURE__ */ h(_e, { children: [/* @__PURE__ */ m(ve, { children: "Record observation" }), /* @__PURE__ */ m(he, { children: "Log a wildlife or biodiversity sighting in the field." })] }),
|
|
296
|
+
/* @__PURE__ */ h("div", {
|
|
275
297
|
className: "grid gap-4 py-2",
|
|
276
298
|
children: [
|
|
277
|
-
/* @__PURE__ */
|
|
299
|
+
/* @__PURE__ */ h("div", {
|
|
278
300
|
className: "grid gap-1.5",
|
|
279
301
|
children: [
|
|
280
|
-
/* @__PURE__ */
|
|
302
|
+
/* @__PURE__ */ m(v, {
|
|
281
303
|
htmlFor: "species",
|
|
282
304
|
children: "Species *"
|
|
283
305
|
}),
|
|
284
|
-
/* @__PURE__ */
|
|
306
|
+
/* @__PURE__ */ h(x, {
|
|
285
307
|
value: B.speciesId,
|
|
286
308
|
onValueChange: (e) => V({
|
|
287
309
|
...B,
|
|
288
310
|
speciesId: e
|
|
289
311
|
}),
|
|
290
|
-
children: [/* @__PURE__ */
|
|
312
|
+
children: [/* @__PURE__ */ m(w, {
|
|
291
313
|
id: "species",
|
|
292
|
-
children: /* @__PURE__ */
|
|
293
|
-
}), /* @__PURE__ */
|
|
314
|
+
children: /* @__PURE__ */ m(T, { placeholder: "Select a species" })
|
|
315
|
+
}), /* @__PURE__ */ m(S, { children: Y.map((e) => /* @__PURE__ */ m(C, {
|
|
294
316
|
value: e.id,
|
|
295
317
|
children: e.commonName
|
|
296
318
|
}, e.id)) })]
|
|
297
319
|
}),
|
|
298
|
-
Y.length === 0 && /* @__PURE__ */
|
|
320
|
+
Y.length === 0 && /* @__PURE__ */ m("p", {
|
|
299
321
|
className: "text-xs text-text-tertiary",
|
|
300
322
|
children: "No species defined yet — add one in the Species section first."
|
|
301
323
|
})
|
|
302
324
|
]
|
|
303
325
|
}),
|
|
304
|
-
/* @__PURE__ */
|
|
326
|
+
/* @__PURE__ */ h("div", {
|
|
305
327
|
className: "grid gap-2 sm:grid-cols-2",
|
|
306
|
-
children: [/* @__PURE__ */
|
|
328
|
+
children: [/* @__PURE__ */ h("div", {
|
|
307
329
|
className: "grid gap-1.5",
|
|
308
|
-
children: [/* @__PURE__ */
|
|
330
|
+
children: [/* @__PURE__ */ m(v, {
|
|
309
331
|
htmlFor: "observedAt",
|
|
310
332
|
children: "Observed at"
|
|
311
|
-
}), /* @__PURE__ */
|
|
333
|
+
}), /* @__PURE__ */ m(_, {
|
|
312
334
|
id: "observedAt",
|
|
313
335
|
type: "datetime-local",
|
|
314
336
|
value: B.observedAt,
|
|
@@ -317,12 +339,12 @@ function P() {
|
|
|
317
339
|
observedAt: e.target.value
|
|
318
340
|
})
|
|
319
341
|
})]
|
|
320
|
-
}), /* @__PURE__ */
|
|
342
|
+
}), /* @__PURE__ */ h("div", {
|
|
321
343
|
className: "grid gap-1.5",
|
|
322
|
-
children: [/* @__PURE__ */
|
|
344
|
+
children: [/* @__PURE__ */ m(v, {
|
|
323
345
|
htmlFor: "count",
|
|
324
346
|
children: "Count"
|
|
325
|
-
}), /* @__PURE__ */
|
|
347
|
+
}), /* @__PURE__ */ m(_, {
|
|
326
348
|
id: "count",
|
|
327
349
|
type: "number",
|
|
328
350
|
min: "1",
|
|
@@ -336,10 +358,10 @@ function P() {
|
|
|
336
358
|
})]
|
|
337
359
|
})]
|
|
338
360
|
}),
|
|
339
|
-
/* @__PURE__ */
|
|
361
|
+
/* @__PURE__ */ h("div", {
|
|
340
362
|
className: "grid gap-1.5",
|
|
341
|
-
children: [/* @__PURE__ */
|
|
342
|
-
options:
|
|
363
|
+
children: [/* @__PURE__ */ m(v, { children: "Method" }), /* @__PURE__ */ m(a, {
|
|
364
|
+
options: D,
|
|
343
365
|
value: B.method,
|
|
344
366
|
onChange: (e) => V({
|
|
345
367
|
...B,
|
|
@@ -348,39 +370,39 @@ function P() {
|
|
|
348
370
|
label: "Observation method"
|
|
349
371
|
})]
|
|
350
372
|
}),
|
|
351
|
-
/* @__PURE__ */
|
|
373
|
+
/* @__PURE__ */ h("div", {
|
|
352
374
|
className: "grid gap-1.5",
|
|
353
|
-
children: [/* @__PURE__ */
|
|
375
|
+
children: [/* @__PURE__ */ m(v, {
|
|
354
376
|
htmlFor: "site",
|
|
355
377
|
children: "Site"
|
|
356
|
-
}), /* @__PURE__ */
|
|
378
|
+
}), /* @__PURE__ */ h(x, {
|
|
357
379
|
value: B.siteId,
|
|
358
380
|
onValueChange: (e) => V({
|
|
359
381
|
...B,
|
|
360
382
|
siteId: e
|
|
361
383
|
}),
|
|
362
|
-
children: [/* @__PURE__ */
|
|
384
|
+
children: [/* @__PURE__ */ m(w, {
|
|
363
385
|
id: "site",
|
|
364
|
-
children: /* @__PURE__ */
|
|
365
|
-
}), /* @__PURE__ */
|
|
366
|
-
value:
|
|
386
|
+
children: /* @__PURE__ */ m(T, { placeholder: "No site" })
|
|
387
|
+
}), /* @__PURE__ */ h(S, { children: [/* @__PURE__ */ m(C, {
|
|
388
|
+
value: A,
|
|
367
389
|
children: "No site"
|
|
368
|
-
}), J.map((e) => /* @__PURE__ */
|
|
390
|
+
}), J.map((e) => /* @__PURE__ */ m(C, {
|
|
369
391
|
value: e.id,
|
|
370
392
|
children: e.name
|
|
371
393
|
}, e.id))] })]
|
|
372
394
|
})]
|
|
373
395
|
}),
|
|
374
|
-
/* @__PURE__ */
|
|
396
|
+
/* @__PURE__ */ h("div", {
|
|
375
397
|
className: "grid gap-2",
|
|
376
|
-
children: [/* @__PURE__ */
|
|
398
|
+
children: [/* @__PURE__ */ h("div", {
|
|
377
399
|
className: "grid gap-2 sm:grid-cols-2",
|
|
378
|
-
children: [/* @__PURE__ */
|
|
400
|
+
children: [/* @__PURE__ */ h("div", {
|
|
379
401
|
className: "grid gap-1.5",
|
|
380
|
-
children: [/* @__PURE__ */
|
|
402
|
+
children: [/* @__PURE__ */ m(v, {
|
|
381
403
|
htmlFor: "lat",
|
|
382
404
|
children: "Latitude"
|
|
383
|
-
}), /* @__PURE__ */
|
|
405
|
+
}), /* @__PURE__ */ m(_, {
|
|
384
406
|
id: "lat",
|
|
385
407
|
type: "number",
|
|
386
408
|
step: "any",
|
|
@@ -391,12 +413,12 @@ function P() {
|
|
|
391
413
|
}),
|
|
392
414
|
placeholder: "12.9716"
|
|
393
415
|
})]
|
|
394
|
-
}), /* @__PURE__ */
|
|
416
|
+
}), /* @__PURE__ */ h("div", {
|
|
395
417
|
className: "grid gap-1.5",
|
|
396
|
-
children: [/* @__PURE__ */
|
|
418
|
+
children: [/* @__PURE__ */ m(v, {
|
|
397
419
|
htmlFor: "lng",
|
|
398
420
|
children: "Longitude"
|
|
399
|
-
}), /* @__PURE__ */
|
|
421
|
+
}), /* @__PURE__ */ m(_, {
|
|
400
422
|
id: "lng",
|
|
401
423
|
type: "number",
|
|
402
424
|
step: "any",
|
|
@@ -408,7 +430,7 @@ function P() {
|
|
|
408
430
|
placeholder: "77.5946"
|
|
409
431
|
})]
|
|
410
432
|
})]
|
|
411
|
-
}), /* @__PURE__ */
|
|
433
|
+
}), /* @__PURE__ */ m(o, {
|
|
412
434
|
onCapture: ({ latitude: e, longitude: t }) => V((n) => ({
|
|
413
435
|
...n,
|
|
414
436
|
latitude: e.toFixed(6),
|
|
@@ -417,12 +439,12 @@ function P() {
|
|
|
417
439
|
className: "justify-self-start"
|
|
418
440
|
})]
|
|
419
441
|
}),
|
|
420
|
-
/* @__PURE__ */
|
|
442
|
+
/* @__PURE__ */ h("div", {
|
|
421
443
|
className: "grid gap-1.5",
|
|
422
|
-
children: [/* @__PURE__ */
|
|
444
|
+
children: [/* @__PURE__ */ m(v, {
|
|
423
445
|
htmlFor: "notes",
|
|
424
446
|
children: "Notes"
|
|
425
|
-
}), /* @__PURE__ */
|
|
447
|
+
}), /* @__PURE__ */ m(E, {
|
|
426
448
|
id: "notes",
|
|
427
449
|
value: B.notes,
|
|
428
450
|
onChange: (e) => V({
|
|
@@ -433,7 +455,7 @@ function P() {
|
|
|
433
455
|
rows: 2
|
|
434
456
|
})]
|
|
435
457
|
}),
|
|
436
|
-
/* @__PURE__ */
|
|
458
|
+
/* @__PURE__ */ m(ce, {
|
|
437
459
|
id: "obsEvidence",
|
|
438
460
|
label: "Evidence photo (optional)",
|
|
439
461
|
value: B.evidence,
|
|
@@ -443,18 +465,18 @@ function P() {
|
|
|
443
465
|
}),
|
|
444
466
|
hint: "Attach a photo, audio clip or PDF as supporting evidence."
|
|
445
467
|
}),
|
|
446
|
-
H && /* @__PURE__ */
|
|
468
|
+
H && /* @__PURE__ */ m("p", {
|
|
447
469
|
className: "text-sm text-status-error-text",
|
|
448
470
|
children: H
|
|
449
471
|
})
|
|
450
472
|
]
|
|
451
473
|
}),
|
|
452
|
-
/* @__PURE__ */
|
|
474
|
+
/* @__PURE__ */ h(ge, { children: [/* @__PURE__ */ m(g, {
|
|
453
475
|
variant: "outline",
|
|
454
476
|
onClick: () => z(!1),
|
|
455
477
|
children: "Cancel"
|
|
456
|
-
}), /* @__PURE__ */ g
|
|
457
|
-
onClick:
|
|
478
|
+
}), /* @__PURE__ */ m(g, {
|
|
479
|
+
onClick: De,
|
|
458
480
|
disabled: q.isPending,
|
|
459
481
|
children: q.isPending ? "Recording…" : "Record observation"
|
|
460
482
|
})] })
|
|
@@ -463,6 +485,6 @@ function P() {
|
|
|
463
485
|
]
|
|
464
486
|
});
|
|
465
487
|
}
|
|
466
|
-
export {
|
|
488
|
+
export { N as ObservationsPage };
|
|
467
489
|
|
|
468
490
|
//# sourceMappingURL=ObservationsPage.js.map
|