@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,23 +1,23 @@
1
1
  import { useEcoImpactHub as e } from "../../context/EcoImpactHubContext.js";
2
2
  import { PageLayout as t } from "../../components/PageLayout.js";
3
- import { formatEnumLabel as n, formatNumber as r, formatRelativeTime as i } from "../../utils/formatters.js";
4
- import { StatusBadge as a } from "../../components/StatusBadge.js";
5
- import { ErrorView as o, LoadingView as s } from "../../components/StateViews.js";
6
- import { EmptyState as c } from "../../components/EmptyState.js";
3
+ import { formatEnumLabel as n, formatNumber as r, formatRelativeTime as ee } from "../../utils/formatters.js";
4
+ import { StatusBadge as te } from "../../components/StatusBadge.js";
5
+ import { ErrorView as ne, LoadingView as i } from "../../components/StateViews.js";
6
+ import { EmptyState as a } from "../../components/EmptyState.js";
7
7
  import "../../context/index.js";
8
- import { useEcoCreateSite as l, useEcoSites as u } from "../../hooks/useEcoImpactHubApi.js";
9
- import { useCursorPager as d } from "../../hooks/useCursorPager.js";
8
+ import { useEcoCreateSite as o, useEcoSites as s } from "../../hooks/useEcoImpactHubApi.js";
9
+ import { useCursorPager as c } from "../../hooks/useCursorPager.js";
10
10
  import "../../hooks/index.js";
11
- import { DataTable as f } from "../../components/DataTable.js";
12
- import { Pagination as p } from "../../components/Pagination.js";
13
- import { FilterTabs as m } from "../../components/FilterTabs.js";
14
- import { SiteTypeBadge as h, SiteTypeIcon as g } from "./siteTypeVisuals.js";
15
- import { useMemo as _, useState as v } from "react";
16
- import { MapPin as y, Plus as b } from "lucide-react";
17
- import { Fragment as x, jsx as S, jsxs as C } from "react/jsx-runtime";
18
- import { Button as w, Input as T, Label as E, ResponsiveDialog as D, ResponsiveDialogContent as ee, ResponsiveDialogDescription as te, ResponsiveDialogFooter as ne, ResponsiveDialogHeader as re, ResponsiveDialogTitle as ie, Select as O, SelectContent as k, SelectItem as A, SelectTrigger as j, SelectValue as M, Textarea as N } from "@burdenoff/fe-libs/ui";
11
+ import { DataTable as l } from "../../components/DataTable.js";
12
+ import { Pagination as u } from "../../components/Pagination.js";
13
+ import { FilterTabs as re } from "../../components/FilterTabs.js";
14
+ import { SiteTypeBadge as ie, SiteTypeIcon as ae } from "./siteTypeVisuals.js";
15
+ import { useMemo as d, useState as f } from "react";
16
+ import { MapPin as p, Plus as m, Search as h } from "lucide-react";
17
+ import { Fragment as g, jsx as _, jsxs as v } from "react/jsx-runtime";
18
+ import { Button as y, Input as b, Label as x, ResponsiveDialog as S, ResponsiveDialogContent as C, ResponsiveDialogDescription as oe, ResponsiveDialogFooter as se, ResponsiveDialogHeader as ce, ResponsiveDialogTitle as le, Select as w, SelectContent as T, SelectItem as E, SelectTrigger as D, SelectValue as O, Textarea as k } from "@burdenoff/fe-libs/ui";
19
19
  //#region src/ecoimpacthub/pages/sites/SitesPage.tsx
20
- var P = [
20
+ var A = [
21
21
  {
22
22
  value: "ALL",
23
23
  label: "All"
@@ -34,7 +34,7 @@ var P = [
34
34
  value: "ARCHIVED",
35
35
  label: "Archived"
36
36
  }
37
- ], F = [
37
+ ], j = [
38
38
  "FACILITY",
39
39
  "WATERSHED",
40
40
  "FOREST",
@@ -44,7 +44,7 @@ var P = [
44
44
  "AIRSHED",
45
45
  "COASTAL",
46
46
  "OTHER"
47
- ], I = 25, L = {
47
+ ], M = 25, N = {
48
48
  name: "",
49
49
  code: "",
50
50
  type: "FACILITY",
@@ -55,26 +55,31 @@ var P = [
55
55
  longitude: "",
56
56
  description: ""
57
57
  };
58
- function R() {
59
- let { navigateTo: R } = e(), [z, B] = v("ALL"), [V, H] = v("ALL"), U = d(), [W, G] = v(!1), [K, q] = v(L), [J, Y] = v(null), { data: X, isLoading: ae, isError: oe, refetch: se } = u({
60
- status: z === "ALL" ? void 0 : z,
61
- type: V === "ALL" ? void 0 : V,
58
+ function P() {
59
+ let { navigateTo: P } = e(), [F, I] = f("ALL"), [L, R] = f("ALL"), [z, B] = f(""), V = c(), [H, U] = f(!1), [W, G] = f(N), [K, q] = f(null), { data: J, isLoading: ue, isError: de, refetch: fe } = s({
60
+ status: F === "ALL" ? void 0 : F,
61
+ type: L === "ALL" ? void 0 : L,
62
62
  pagination: {
63
- limit: I,
64
- cursor: U.cursor
63
+ limit: M,
64
+ cursor: V.cursor
65
65
  }
66
- }), Z = l(), Q = _(() => X?.items ?? [], [X]), ce = [
66
+ }), Y = o(), X = d(() => J?.items ?? [], [J]), Z = z.trim().toLowerCase(), Q = d(() => Z ? X.filter((e) => [
67
+ e.name,
68
+ e.code,
69
+ e.region,
70
+ e.country
71
+ ].some((e) => (e ?? "").toLowerCase().includes(Z))) : X, [X, Z]), pe = [
67
72
  {
68
73
  key: "name",
69
74
  header: "Site",
70
- render: (e) => /* @__PURE__ */ C("div", {
75
+ render: (e) => /* @__PURE__ */ v("div", {
71
76
  className: "flex items-center gap-3",
72
- children: [/* @__PURE__ */ S(g, { type: e.type }), /* @__PURE__ */ C("div", {
77
+ children: [/* @__PURE__ */ _(ae, { type: e.type }), /* @__PURE__ */ v("div", {
73
78
  className: "min-w-0",
74
- children: [/* @__PURE__ */ S("p", {
79
+ children: [/* @__PURE__ */ _("p", {
75
80
  className: "truncate font-semibold text-text-primary",
76
81
  children: e.name
77
- }), e.code && /* @__PURE__ */ S("p", {
82
+ }), e.code && /* @__PURE__ */ _("p", {
78
83
  className: "truncate text-xs text-text-tertiary",
79
84
  children: e.code
80
85
  })]
@@ -85,7 +90,7 @@ function R() {
85
90
  key: "type",
86
91
  header: "Type",
87
92
  hideOnMobile: !0,
88
- render: (e) => /* @__PURE__ */ S(h, { type: e.type })
93
+ render: (e) => /* @__PURE__ */ _(ie, { type: e.type })
89
94
  },
90
95
  {
91
96
  key: "location",
@@ -93,10 +98,10 @@ function R() {
93
98
  hideOnMobile: !0,
94
99
  render: (e) => {
95
100
  let t = [e.region, e.country].filter(Boolean).join(", ");
96
- return t ? /* @__PURE__ */ C("span", {
101
+ return t ? /* @__PURE__ */ v("span", {
97
102
  className: "inline-flex items-center gap-1.5 text-text-secondary",
98
- children: [/* @__PURE__ */ S(y, { className: "h-3.5 w-3.5 shrink-0 text-text-tertiary" }), t]
99
- }) : /* @__PURE__ */ S("span", {
103
+ children: [/* @__PURE__ */ _(p, { className: "h-3.5 w-3.5 shrink-0 text-text-tertiary" }), t]
104
+ }) : /* @__PURE__ */ _("span", {
100
105
  className: "text-text-tertiary",
101
106
  children: "—"
102
107
  });
@@ -108,10 +113,10 @@ function R() {
108
113
  align: "right",
109
114
  hideOnMobile: !0,
110
115
  sortValue: (e) => e.areaHectares ?? 0,
111
- render: (e) => e.areaHectares == null ? /* @__PURE__ */ S("span", {
116
+ render: (e) => e.areaHectares == null ? /* @__PURE__ */ _("span", {
112
117
  className: "text-text-tertiary",
113
118
  children: "—"
114
- }) : /* @__PURE__ */ C("span", {
119
+ }) : /* @__PURE__ */ v("span", {
115
120
  className: "tabular-nums text-text-secondary",
116
121
  children: [r(e.areaHectares), " ha"]
117
122
  })
@@ -119,279 +124,311 @@ function R() {
119
124
  {
120
125
  key: "status",
121
126
  header: "Status",
122
- render: (e) => /* @__PURE__ */ S(a, { status: e.status })
127
+ render: (e) => /* @__PURE__ */ _(te, { status: e.status })
123
128
  },
124
129
  {
125
130
  key: "updated",
126
131
  header: "Updated",
127
132
  align: "right",
128
133
  hideOnMobile: !0,
129
- render: (e) => /* @__PURE__ */ S("span", {
134
+ render: (e) => /* @__PURE__ */ _("span", {
130
135
  className: "text-text-tertiary",
131
- children: i(e.updatedAt)
136
+ children: ee(e.updatedAt)
132
137
  })
133
138
  }
134
139
  ], $ = () => {
135
- q(L), Y(null);
140
+ G(N), q(null);
136
141
  };
137
- return /* @__PURE__ */ C(t, {
142
+ return /* @__PURE__ */ v(t, {
138
143
  title: "Sites",
139
144
  description: "Monitored locations — facilities, watersheds, forests, wetlands, farms & protected areas.",
140
- actions: /* @__PURE__ */ C(w, {
141
- onClick: () => G(!0),
142
- children: [/* @__PURE__ */ S(b, { className: "mr-1.5 h-4 w-4" }), " New site"]
145
+ actions: /* @__PURE__ */ v(y, {
146
+ onClick: () => U(!0),
147
+ children: [/* @__PURE__ */ _(m, { className: "mr-1.5 h-4 w-4" }), " New site"]
143
148
  }),
144
149
  children: [
145
- /* @__PURE__ */ C("div", {
150
+ /* @__PURE__ */ v("div", {
146
151
  className: "mb-5 flex flex-wrap items-center gap-3",
147
- children: [/* @__PURE__ */ S(m, {
148
- options: P,
149
- value: z,
150
- onChange: (e) => {
151
- B(e), U.reset();
152
- }
153
- }), /* @__PURE__ */ C(O, {
154
- value: V,
155
- onValueChange: (e) => {
156
- H(e), U.reset();
157
- },
158
- children: [/* @__PURE__ */ S(j, {
159
- className: "w-44",
160
- children: /* @__PURE__ */ S(M, { placeholder: "All types" })
161
- }), /* @__PURE__ */ C(k, { children: [/* @__PURE__ */ S(A, {
162
- value: "ALL",
163
- children: "All types"
164
- }), F.map((e) => /* @__PURE__ */ S(A, {
165
- value: e,
166
- children: n(e)
167
- }, e))] })]
168
- })]
152
+ children: [
153
+ /* @__PURE__ */ _(re, {
154
+ options: A,
155
+ value: F,
156
+ onChange: (e) => {
157
+ I(e), V.reset();
158
+ }
159
+ }),
160
+ /* @__PURE__ */ v(w, {
161
+ value: L,
162
+ onValueChange: (e) => {
163
+ R(e), V.reset();
164
+ },
165
+ children: [/* @__PURE__ */ _(D, {
166
+ className: "w-44",
167
+ children: /* @__PURE__ */ _(O, { placeholder: "All types" })
168
+ }), /* @__PURE__ */ v(T, { children: [/* @__PURE__ */ _(E, {
169
+ value: "ALL",
170
+ children: "All types"
171
+ }), j.map((e) => /* @__PURE__ */ _(E, {
172
+ value: e,
173
+ children: n(e)
174
+ }, e))] })]
175
+ }),
176
+ /* @__PURE__ */ v("div", {
177
+ className: "relative",
178
+ children: [/* @__PURE__ */ _(h, { className: "pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-text-tertiary" }), /* @__PURE__ */ _(b, {
179
+ value: z,
180
+ onChange: (e) => B(e.target.value),
181
+ placeholder: "Search this page…",
182
+ className: "w-full pl-9 sm:w-64",
183
+ "aria-label": "Search loaded sites by name, code or location"
184
+ })]
185
+ })
186
+ ]
169
187
  }),
170
- ae ? /* @__PURE__ */ S(s, { label: "Loading sites…" }) : oe ? /* @__PURE__ */ S(o, {
188
+ ue ? /* @__PURE__ */ _(i, { label: "Loading sites…" }) : de ? /* @__PURE__ */ _(ne, {
171
189
  message: "Couldn't load sites.",
172
- onRetry: () => se()
173
- }) : Q.length === 0 ? /* @__PURE__ */ S(c, {
190
+ onRetry: () => fe()
191
+ }) : X.length === 0 ? /* @__PURE__ */ _(a, {
174
192
  illustration: "empty-data",
175
- icon: /* @__PURE__ */ S(y, { className: "h-10 w-10" }),
193
+ icon: /* @__PURE__ */ _(p, { className: "h-10 w-10" }),
176
194
  title: "No sites yet",
177
- description: z === "ALL" && V === "ALL" ? "Create your first monitored site to start collecting environmental data." : "No sites match these filters.",
178
- action: /* @__PURE__ */ C(w, {
179
- onClick: () => G(!0),
180
- children: [/* @__PURE__ */ S(b, { className: "mr-1.5 h-4 w-4" }), " New site"]
195
+ description: F === "ALL" && L === "ALL" ? "Create your first monitored site to start collecting environmental data." : "No sites match these filters.",
196
+ action: /* @__PURE__ */ v(y, {
197
+ onClick: () => U(!0),
198
+ children: [/* @__PURE__ */ _(m, { className: "mr-1.5 h-4 w-4" }), " New site"]
199
+ })
200
+ }) : Q.length === 0 ? /* @__PURE__ */ _(a, {
201
+ icon: /* @__PURE__ */ _(h, { className: "h-10 w-10" }),
202
+ title: "No matches on this page",
203
+ description: `No sites on this page match “${z.trim()}”. Clear the search or page through the list.`,
204
+ action: /* @__PURE__ */ _(y, {
205
+ variant: "outline",
206
+ onClick: () => B(""),
207
+ children: "Clear search"
181
208
  })
182
- }) : /* @__PURE__ */ C(x, { children: [/* @__PURE__ */ S(f, {
183
- columns: ce,
209
+ }) : /* @__PURE__ */ v(g, { children: [/* @__PURE__ */ _(l, {
210
+ columns: pe,
184
211
  rows: Q,
185
212
  rowKey: (e) => e.id,
186
- onRowClick: (e) => R(`sites/${e.id}`)
187
- }), /* @__PURE__ */ S(p, {
188
- page: U.page,
189
- pageSize: I,
190
- itemCount: Q.length,
191
- hasMore: X?.pageInfo?.hasMore ?? !1,
192
- onPageChange: (e) => U.onPageChange(e, X?.pageInfo?.cursor)
213
+ onRowClick: (e) => P(`sites/${e.id}`)
214
+ }), Z ? /* @__PURE__ */ v("p", {
215
+ className: "mt-4 text-sm tabular-nums text-text-secondary",
216
+ children: [
217
+ Q.length,
218
+ " of ",
219
+ X.length,
220
+ " on this page match “",
221
+ z.trim(),
222
+ "”"
223
+ ]
224
+ }) : /* @__PURE__ */ _(u, {
225
+ page: V.page,
226
+ pageSize: M,
227
+ itemCount: X.length,
228
+ hasMore: J?.pageInfo?.hasMore ?? !1,
229
+ onPageChange: (e) => V.onPageChange(e, J?.pageInfo?.cursor)
193
230
  })] }),
194
- /* @__PURE__ */ S(D, {
195
- open: W,
231
+ /* @__PURE__ */ _(S, {
232
+ open: H,
196
233
  onOpenChange: (e) => {
197
- G(e), e || $();
234
+ U(e), e || $();
198
235
  },
199
- children: /* @__PURE__ */ C(ee, { children: [
200
- /* @__PURE__ */ C(re, { children: [/* @__PURE__ */ S(ie, { children: "New site" }), /* @__PURE__ */ S(te, { children: "Register a location to monitor and attribute environmental data to." })] }),
201
- /* @__PURE__ */ C("div", {
236
+ children: /* @__PURE__ */ v(C, { children: [
237
+ /* @__PURE__ */ v(ce, { children: [/* @__PURE__ */ _(le, { children: "New site" }), /* @__PURE__ */ _(oe, { children: "Register a location to monitor and attribute environmental data to." })] }),
238
+ /* @__PURE__ */ v("div", {
202
239
  className: "grid gap-4 py-2",
203
240
  children: [
204
- /* @__PURE__ */ C("div", {
241
+ /* @__PURE__ */ v("div", {
205
242
  className: "grid gap-2 sm:grid-cols-2",
206
- children: [/* @__PURE__ */ C("div", {
243
+ children: [/* @__PURE__ */ v("div", {
207
244
  className: "grid gap-1.5",
208
- children: [/* @__PURE__ */ S(E, {
245
+ children: [/* @__PURE__ */ _(x, {
209
246
  htmlFor: "name",
210
247
  children: "Name *"
211
- }), /* @__PURE__ */ S(T, {
248
+ }), /* @__PURE__ */ _(b, {
212
249
  id: "name",
213
- value: K.name,
214
- onChange: (e) => q({
215
- ...K,
250
+ value: W.name,
251
+ onChange: (e) => G({
252
+ ...W,
216
253
  name: e.target.value
217
254
  }),
218
255
  placeholder: "Palar Wetland Reserve"
219
256
  })]
220
- }), /* @__PURE__ */ C("div", {
257
+ }), /* @__PURE__ */ v("div", {
221
258
  className: "grid gap-1.5",
222
- children: [/* @__PURE__ */ S(E, {
259
+ children: [/* @__PURE__ */ _(x, {
223
260
  htmlFor: "code",
224
261
  children: "Code"
225
- }), /* @__PURE__ */ S(T, {
262
+ }), /* @__PURE__ */ _(b, {
226
263
  id: "code",
227
- value: K.code,
228
- onChange: (e) => q({
229
- ...K,
264
+ value: W.code,
265
+ onChange: (e) => G({
266
+ ...W,
230
267
  code: e.target.value
231
268
  }),
232
269
  placeholder: "SITE-PWR"
233
270
  })]
234
271
  })]
235
272
  }),
236
- /* @__PURE__ */ C("div", {
273
+ /* @__PURE__ */ v("div", {
237
274
  className: "grid gap-2 sm:grid-cols-2",
238
- children: [/* @__PURE__ */ C("div", {
275
+ children: [/* @__PURE__ */ v("div", {
239
276
  className: "grid gap-1.5",
240
- children: [/* @__PURE__ */ S(E, {
277
+ children: [/* @__PURE__ */ _(x, {
241
278
  htmlFor: "type",
242
279
  children: "Type"
243
- }), /* @__PURE__ */ C(O, {
244
- value: K.type,
245
- onValueChange: (e) => q({
246
- ...K,
280
+ }), /* @__PURE__ */ v(w, {
281
+ value: W.type,
282
+ onValueChange: (e) => G({
283
+ ...W,
247
284
  type: e
248
285
  }),
249
- children: [/* @__PURE__ */ S(j, {
286
+ children: [/* @__PURE__ */ _(D, {
250
287
  id: "type",
251
- children: /* @__PURE__ */ S(M, {})
252
- }), /* @__PURE__ */ S(k, { children: F.map((e) => /* @__PURE__ */ S(A, {
288
+ children: /* @__PURE__ */ _(O, {})
289
+ }), /* @__PURE__ */ _(T, { children: j.map((e) => /* @__PURE__ */ _(E, {
253
290
  value: e,
254
291
  children: n(e)
255
292
  }, e)) })]
256
293
  })]
257
- }), /* @__PURE__ */ C("div", {
294
+ }), /* @__PURE__ */ v("div", {
258
295
  className: "grid gap-1.5",
259
- children: [/* @__PURE__ */ S(E, {
296
+ children: [/* @__PURE__ */ _(x, {
260
297
  htmlFor: "area",
261
298
  children: "Area (hectares)"
262
- }), /* @__PURE__ */ S(T, {
299
+ }), /* @__PURE__ */ _(b, {
263
300
  id: "area",
264
301
  type: "number",
265
302
  min: "0",
266
303
  step: "any",
267
- value: K.areaHectares,
268
- onChange: (e) => q({
269
- ...K,
304
+ value: W.areaHectares,
305
+ onChange: (e) => G({
306
+ ...W,
270
307
  areaHectares: e.target.value
271
308
  }),
272
309
  placeholder: "42.5"
273
310
  })]
274
311
  })]
275
312
  }),
276
- /* @__PURE__ */ C("div", {
313
+ /* @__PURE__ */ v("div", {
277
314
  className: "grid gap-2 sm:grid-cols-2",
278
- children: [/* @__PURE__ */ C("div", {
315
+ children: [/* @__PURE__ */ v("div", {
279
316
  className: "grid gap-1.5",
280
- children: [/* @__PURE__ */ S(E, {
317
+ children: [/* @__PURE__ */ _(x, {
281
318
  htmlFor: "region",
282
319
  children: "Region"
283
- }), /* @__PURE__ */ S(T, {
320
+ }), /* @__PURE__ */ _(b, {
284
321
  id: "region",
285
- value: K.region,
286
- onChange: (e) => q({
287
- ...K,
322
+ value: W.region,
323
+ onChange: (e) => G({
324
+ ...W,
288
325
  region: e.target.value
289
326
  }),
290
327
  placeholder: "Tamil Nadu"
291
328
  })]
292
- }), /* @__PURE__ */ C("div", {
329
+ }), /* @__PURE__ */ v("div", {
293
330
  className: "grid gap-1.5",
294
- children: [/* @__PURE__ */ S(E, {
331
+ children: [/* @__PURE__ */ _(x, {
295
332
  htmlFor: "country",
296
333
  children: "Country"
297
- }), /* @__PURE__ */ S(T, {
334
+ }), /* @__PURE__ */ _(b, {
298
335
  id: "country",
299
- value: K.country,
300
- onChange: (e) => q({
301
- ...K,
336
+ value: W.country,
337
+ onChange: (e) => G({
338
+ ...W,
302
339
  country: e.target.value
303
340
  }),
304
341
  placeholder: "India"
305
342
  })]
306
343
  })]
307
344
  }),
308
- /* @__PURE__ */ C("div", {
345
+ /* @__PURE__ */ v("div", {
309
346
  className: "grid gap-2 sm:grid-cols-2",
310
- children: [/* @__PURE__ */ C("div", {
347
+ children: [/* @__PURE__ */ v("div", {
311
348
  className: "grid gap-1.5",
312
- children: [/* @__PURE__ */ S(E, {
349
+ children: [/* @__PURE__ */ _(x, {
313
350
  htmlFor: "lat",
314
351
  children: "Latitude"
315
- }), /* @__PURE__ */ S(T, {
352
+ }), /* @__PURE__ */ _(b, {
316
353
  id: "lat",
317
354
  type: "number",
318
355
  step: "any",
319
- value: K.latitude,
320
- onChange: (e) => q({
321
- ...K,
356
+ value: W.latitude,
357
+ onChange: (e) => G({
358
+ ...W,
322
359
  latitude: e.target.value
323
360
  }),
324
361
  placeholder: "12.9716"
325
362
  })]
326
- }), /* @__PURE__ */ C("div", {
363
+ }), /* @__PURE__ */ v("div", {
327
364
  className: "grid gap-1.5",
328
- children: [/* @__PURE__ */ S(E, {
365
+ children: [/* @__PURE__ */ _(x, {
329
366
  htmlFor: "lng",
330
367
  children: "Longitude"
331
- }), /* @__PURE__ */ S(T, {
368
+ }), /* @__PURE__ */ _(b, {
332
369
  id: "lng",
333
370
  type: "number",
334
371
  step: "any",
335
- value: K.longitude,
336
- onChange: (e) => q({
337
- ...K,
372
+ value: W.longitude,
373
+ onChange: (e) => G({
374
+ ...W,
338
375
  longitude: e.target.value
339
376
  }),
340
377
  placeholder: "77.5946"
341
378
  })]
342
379
  })]
343
380
  }),
344
- /* @__PURE__ */ C("div", {
381
+ /* @__PURE__ */ v("div", {
345
382
  className: "grid gap-1.5",
346
- children: [/* @__PURE__ */ S(E, {
383
+ children: [/* @__PURE__ */ _(x, {
347
384
  htmlFor: "description",
348
385
  children: "Description"
349
- }), /* @__PURE__ */ S(N, {
386
+ }), /* @__PURE__ */ _(k, {
350
387
  id: "description",
351
- value: K.description,
352
- onChange: (e) => q({
353
- ...K,
388
+ value: W.description,
389
+ onChange: (e) => G({
390
+ ...W,
354
391
  description: e.target.value
355
392
  }),
356
393
  placeholder: "Optional context about this site.",
357
394
  rows: 2
358
395
  })]
359
396
  }),
360
- J && /* @__PURE__ */ S("p", {
397
+ K && /* @__PURE__ */ _("p", {
361
398
  className: "text-sm text-status-error-text",
362
- children: J
399
+ children: K
363
400
  })
364
401
  ]
365
402
  }),
366
- /* @__PURE__ */ C(ne, { children: [/* @__PURE__ */ S(w, {
403
+ /* @__PURE__ */ v(se, { children: [/* @__PURE__ */ _(y, {
367
404
  variant: "outline",
368
- onClick: () => G(!1),
405
+ onClick: () => U(!1),
369
406
  children: "Cancel"
370
- }), /* @__PURE__ */ S(w, {
407
+ }), /* @__PURE__ */ _(y, {
371
408
  onClick: async () => {
372
- if (!K.name.trim()) {
373
- Y("Site name is required.");
409
+ if (!W.name.trim()) {
410
+ q("Site name is required.");
374
411
  return;
375
412
  }
376
413
  try {
377
- let e = await Z.mutateAsync({
378
- name: K.name.trim(),
379
- code: K.code.trim() || null,
380
- type: K.type,
381
- region: K.region.trim() || null,
382
- country: K.country.trim() || null,
383
- areaHectares: K.areaHectares ? Number(K.areaHectares) : null,
384
- latitude: K.latitude ? Number(K.latitude) : null,
385
- longitude: K.longitude ? Number(K.longitude) : null,
386
- description: K.description.trim() || null
414
+ let e = await Y.mutateAsync({
415
+ name: W.name.trim(),
416
+ code: W.code.trim() || null,
417
+ type: W.type,
418
+ region: W.region.trim() || null,
419
+ country: W.country.trim() || null,
420
+ areaHectares: W.areaHectares ? Number(W.areaHectares) : null,
421
+ latitude: W.latitude ? Number(W.latitude) : null,
422
+ longitude: W.longitude ? Number(W.longitude) : null,
423
+ description: W.description.trim() || null
387
424
  });
388
- G(!1), $(), R(`sites/${e.id}`);
425
+ U(!1), $(), P(`sites/${e.id}`);
389
426
  } catch (e) {
390
- Y(e instanceof Error ? e.message : "Failed to create site.");
427
+ q(e instanceof Error ? e.message : "Failed to create site.");
391
428
  }
392
429
  },
393
- disabled: Z.isPending,
394
- children: Z.isPending ? "Creating…" : "Create site"
430
+ disabled: Y.isPending,
431
+ children: Y.isPending ? "Creating…" : "Create site"
395
432
  })] })
396
433
  ] })
397
434
  })
@@ -399,6 +436,6 @@ function R() {
399
436
  });
400
437
  }
401
438
  //#endregion
402
- export { R as SitesPage };
439
+ export { P as SitesPage };
403
440
 
404
441
  //# sourceMappingURL=SitesPage.js.map