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