@burdenoff/microfe-healthybowl 2026.612.2 → 2026.612.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,25 +1,26 @@
1
1
  import { cn as e, formatCurrency as t, formatNumber as n } from "../../utils/helpers.js";
2
- import { PageLayout as r } from "../../components/PageLayout.js";
3
- import { StatCard as i } from "../../components/StatCard.js";
4
- import { StatusBadge as a } from "../../components/StatusBadge.js";
5
- import { EmptyState as o } from "../../components/EmptyState.js";
2
+ import { useBasePath as r } from "../../hooks/useBasePath.js";
3
+ import { PageLayout as i } from "../../components/PageLayout.js";
4
+ import { StatCard as a } from "../../components/StatCard.js";
5
+ import { StatusBadge as o } from "../../components/StatusBadge.js";
6
+ import { EmptyState as ee } from "../../components/EmptyState.js";
6
7
  import { ErrorState as s } from "../../components/ErrorState.js";
7
- import { ToastContainer as c } from "../../components/Toast.js";
8
- import { Breadcrumbs as ee } from "../../components/Breadcrumbs.js";
9
- import { Modal as l } from "../../components/Modal.js";
10
- import { HBEntityTags as u } from "../../components/HBEntityTags.js";
8
+ import { ToastContainer as te } from "../../components/Toast.js";
9
+ import { Breadcrumbs as ne } from "../../components/Breadcrumbs.js";
10
+ import { Modal as c } from "../../components/Modal.js";
11
+ import { HBEntityTags as re } from "../../components/HBEntityTags.js";
11
12
  import "../../components/index.js";
12
- import { useHealthyBowlData as te } from "../../hooks/useHealthyBowlData.js";
13
- import { useHealthyBowlStore as ne } from "../../store/healthybowlStore.js";
14
- import { useToast as re } from "../../hooks/useToast.js";
15
- import { isNative as ie, nativeConfirm as ae, nativeNotify as oe, nativeToast as d } from "../../../utils/nativeBridge.js";
16
- import { useCallback as se, useEffect as ce, useRef as le, useState as f } from "react";
17
- import { useI18n as ue } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
18
- import { ArrowUpDown as de, Award as fe, Check as pe, ChevronDown as me, Eye as he, Heart as p, Info as ge, Leaf as _e, Minus as ve, Package as ye, Pencil as be, Plus as xe, Search as Se, ShoppingCart as m, Star as h, Store as Ce, Tags as we, Trash2 as Te, X as g } from "lucide-react";
19
- import { useNavigate as Ee } from "react-router-dom";
20
- import { Fragment as _, jsx as v, jsxs as y } from "react/jsx-runtime";
13
+ import { useHealthyBowlData as ie } from "../../hooks/useHealthyBowlData.js";
14
+ import { useHealthyBowlStore as ae } from "../../store/healthybowlStore.js";
15
+ import { useToast as oe } from "../../hooks/useToast.js";
16
+ import { isNative as l, nativeConfirm as se, nativeNotify as u, nativeToast as d } from "../../../utils/nativeBridge.js";
17
+ import { useCallback as ce, useEffect as le, useRef as ue, useState as f } from "react";
18
+ import { useI18n as de } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
19
+ import { ArrowUpDown as fe, Award as pe, Check as me, ChevronDown as he, Eye as ge, Heart as _e, Info as ve, Leaf as p, Minus as ye, Package as be, Pencil as xe, Plus as Se, Search as Ce, ShoppingCart as m, Star as h, Store as g, Tags as _, Trash2 as we, X as v } from "lucide-react";
20
+ import { useNavigate as Te } from "react-router-dom";
21
+ import { Fragment as y, jsx as b, jsxs as x } from "react/jsx-runtime";
21
22
  //#region src/healthybowl/pages/marketplace/MarketplacePage.tsx
22
- var De = [
23
+ var Ee = [
23
24
  "Vegetables",
24
25
  "Fruits",
25
26
  "Herbs",
@@ -27,7 +28,7 @@ var De = [
27
28
  "Seeds",
28
29
  "Supplies",
29
30
  "Pest Control"
30
- ], b = {
31
+ ], S = {
31
32
  name: "",
32
33
  category: "Vegetables",
33
34
  price: "",
@@ -37,7 +38,7 @@ var De = [
37
38
  location: "",
38
39
  description: "",
39
40
  organicCertified: !1
40
- }, Oe = [
41
+ }, De = [
41
42
  "All",
42
43
  "Vegetables",
43
44
  "Fruits",
@@ -46,28 +47,28 @@ var De = [
46
47
  "Seeds",
47
48
  "Supplies",
48
49
  "Pest Control"
49
- ], x = {
50
+ ], Oe = {
50
51
  "price-asc": "Price: Low → High",
51
52
  "price-desc": "Price: High → Low",
52
53
  rating: "Highest Rated",
53
54
  reviews: "Most Reviewed"
54
55
  };
55
- function S(t) {
56
- return Array.from({ length: 5 }, (n, r) => /* @__PURE__ */ v(h, { className: e("h-3 w-3", r < Math.round(t) ? "fill-warning text-warning" : "text-muted-foreground") }, r));
56
+ function ke(t) {
57
+ return Array.from({ length: 5 }, (n, r) => /* @__PURE__ */ b(h, { className: e("h-3 w-3", r < Math.round(t) ? "fill-warning text-warning" : "text-muted-foreground") }, r));
57
58
  }
58
59
  var C = () => {
59
- let { marketplaceProducts: C, loading: w, errors: ke, createMarketplaceProduct: Ae, updateMarketplaceProduct: je, deleteMarketplaceProduct: Me } = te(), { t: T } = ue(), E = se((e, t) => {
60
- let n = T(e);
60
+ let { marketplaceProducts: C, loading: Ae, errors: je, createMarketplaceProduct: Me, updateMarketplaceProduct: Ne, deleteMarketplaceProduct: Pe } = ie(), { t: Fe } = de(), w = ce((e, t) => {
61
+ let n = Fe(e);
61
62
  return n === e ? t : n;
62
- }, [T]), [D, O] = f(""), [k, A] = f("All"), [j, M] = f(null), [N, Ne] = f("rating"), [P, F] = f(!1), [Pe, I] = f(/* @__PURE__ */ new Set()), [Fe, Ie] = f({}), [L, R] = f(null), [Le, z] = f(!1), [B, V] = f(null), [H, U] = f(b), [W, G] = f(!1), K = (e, t) => {
63
- U((n) => ({
63
+ }, [Fe]), [T, E] = f(""), [D, O] = f("All"), [k, A] = f(null), [j, Ie] = f("rating"), [M, N] = f(!1), [Le, P] = f(/* @__PURE__ */ new Set()), [Re, ze] = f({}), [F, I] = f(null), [Be, L] = f(!1), [R, z] = f(null), [B, V] = f(S), [H, U] = f(!1), W = (e, t) => {
64
+ V((n) => ({
64
65
  ...n,
65
66
  [e]: t
66
67
  }));
67
- }, Re = () => {
68
- V(null), U(b), z(!0);
69
- }, ze = (e) => {
70
- V(e), U({
68
+ }, Ve = () => {
69
+ z(null), V(S), L(!0);
70
+ }, He = (e) => {
71
+ z(e), V({
71
72
  name: e.name ?? "",
72
73
  category: e.category ?? "Vegetables",
73
74
  price: String(e.price ?? ""),
@@ -77,13 +78,13 @@ var C = () => {
77
78
  location: e.location ?? "",
78
79
  description: e.description ?? "",
79
80
  organicCertified: !!e.organicCertified
80
- }), z(!0);
81
- }, q = () => {
82
- z(!1), V(null), U(b);
83
- }, Be = async () => {
84
- let e = Number(H.price), t = Number(H.stock);
85
- if (!H.name.trim() || !H.seller.trim() || !H.price || !H.stock) {
86
- Z({
81
+ }), L(!0);
82
+ }, G = () => {
83
+ L(!1), z(null), V(S);
84
+ }, Ue = async () => {
85
+ let e = Number(B.price), t = Number(B.stock);
86
+ if (!B.name.trim() || !B.seller.trim() || !B.price || !B.stock) {
87
+ X({
87
88
  title: "Missing required fields",
88
89
  description: "Product name, seller, price, and quantity available are required.",
89
90
  variant: "warning"
@@ -91,129 +92,129 @@ var C = () => {
91
92
  return;
92
93
  }
93
94
  if (Number.isNaN(e) || e < 0 || Number.isNaN(t) || t < 0) {
94
- Z({
95
+ X({
95
96
  title: "Invalid values",
96
97
  description: "Price and quantity must be positive numbers.",
97
98
  variant: "warning"
98
99
  });
99
100
  return;
100
101
  }
101
- G(!0);
102
+ U(!0);
102
103
  try {
103
- B ? (await je({
104
- id: B.id,
105
- name: H.name.trim(),
106
- category: H.category,
104
+ R ? (await Ne({
105
+ id: R.id,
106
+ name: B.name.trim(),
107
+ category: B.category,
107
108
  price: e,
108
- unit: H.unit.trim() || "unit",
109
+ unit: B.unit.trim() || "unit",
109
110
  stock: t,
110
- seller: H.seller.trim(),
111
- location: H.location.trim() || void 0,
112
- description: H.description.trim() || void 0,
113
- organicCertified: H.organicCertified
114
- }), Z({
111
+ seller: B.seller.trim(),
112
+ location: B.location.trim() || void 0,
113
+ description: B.description.trim() || void 0,
114
+ organicCertified: B.organicCertified
115
+ }), X({
115
116
  title: "Listing updated",
116
- description: `${H.name.trim()} has been updated.`,
117
+ description: `${B.name.trim()} has been updated.`,
117
118
  variant: "success"
118
- })) : (await Ae({
119
- name: H.name.trim(),
120
- category: H.category,
119
+ })) : (await Me({
120
+ name: B.name.trim(),
121
+ category: B.category,
121
122
  price: e,
122
- unit: H.unit.trim() || "unit",
123
+ unit: B.unit.trim() || "unit",
123
124
  stock: t,
124
- seller: H.seller.trim(),
125
- location: H.location.trim() || void 0,
126
- description: H.description.trim() || "",
127
- organicCertified: H.organicCertified,
125
+ seller: B.seller.trim(),
126
+ location: B.location.trim() || void 0,
127
+ description: B.description.trim() || "",
128
+ organicCertified: B.organicCertified,
128
129
  rating: 0,
129
130
  reviews: 0,
130
131
  sellerRating: 0
131
- }), Z({
132
+ }), X({
132
133
  title: "Listing published",
133
- description: `${H.name.trim()} is now live in the marketplace.`,
134
+ description: `${B.name.trim()} is now live in the marketplace.`,
134
135
  variant: "success"
135
- })), q();
136
+ })), G();
136
137
  } catch (e) {
137
- Z({
138
- title: B ? "Update failed" : "Publish failed",
138
+ X({
139
+ title: R ? "Update failed" : "Publish failed",
139
140
  description: String(e),
140
141
  variant: "error"
141
142
  });
142
143
  } finally {
143
- G(!1);
144
+ U(!1);
144
145
  }
145
- }, Ve = async (e) => {
146
- if (await ae({
146
+ }, We = async (e) => {
147
+ if (await se({
147
148
  title: "Delete listing?",
148
149
  message: `${e.name ?? "This listing"} will be permanently removed from the marketplace.`,
149
150
  okButtonTitle: "Delete",
150
151
  cancelButtonTitle: "Cancel"
151
152
  }) !== !1) {
152
- G(!0);
153
+ U(!0);
153
154
  try {
154
- await Me(e.id), Z({
155
+ await Pe(e.id), X({
155
156
  title: "Listing deleted",
156
157
  description: `${e.name ?? "Listing"} has been removed.`,
157
158
  variant: "success"
158
- }), ie() && (d("Listing deleted"), oe("success"));
159
+ }), l() && (d("Listing deleted"), u("success"));
159
160
  } catch (e) {
160
- Z({
161
+ X({
161
162
  title: "Delete failed",
162
163
  description: String(e),
163
164
  variant: "error"
164
- }), ie() && (d("Delete failed"), oe("error"));
165
+ }), l() && (d("Delete failed"), u("error"));
165
166
  } finally {
166
- G(!1);
167
+ U(!1);
167
168
  }
168
169
  }
169
- }, J = le(null), Y = Ee(), { addToCart: He, cart: Ue, wishlist: X, toggleWishlist: We } = ne(), { toasts: Ge, toast: Z, dismiss: Ke } = re(), qe = Ue.reduce((e, t) => e + t.quantity, 0);
170
- ce(() => {
170
+ }, K = ue(null), q = Te(), { buildPath: J } = r(), { addToCart: Ge, cart: Ke, wishlist: Y, toggleWishlist: qe } = ae(), { toasts: Je, toast: X, dismiss: Ye } = oe(), Xe = Ke.reduce((e, t) => e + t.quantity, 0);
171
+ le(() => {
171
172
  let e = (e) => {
172
- J.current && !J.current.contains(e.target) && F(!1);
173
+ K.current && !K.current.contains(e.target) && N(!1);
173
174
  };
174
175
  return document.addEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
175
176
  }, []);
176
- let Je = Array.from(C.flatMap((e) => e.entityTags ?? []).reduce((e, t) => e.has(t.key) ? e : e.set(t.key, t.label), /* @__PURE__ */ new Map()).entries()).map(([e, t]) => ({
177
+ let Ze = Array.from(C.flatMap((e) => e.entityTags ?? []).reduce((e, t) => e.has(t.key) ? e : e.set(t.key, t.label), /* @__PURE__ */ new Map()).entries()).map(([e, t]) => ({
177
178
  key: e,
178
179
  label: t
179
- })), Q = C.filter((e) => {
180
- let t = (e.name ?? "").toLowerCase().includes(D.toLowerCase()) || (e.seller ?? "").toLowerCase().includes(D.toLowerCase()) || (e.description ?? "").toLowerCase().includes(D.toLowerCase()), n = k === "All" || e.category === k, r = !j || (e.entityTags ?? []).some((e) => e.key === j);
180
+ })), Z = C.filter((e) => {
181
+ let t = (e.name ?? "").toLowerCase().includes(T.toLowerCase()) || (e.seller ?? "").toLowerCase().includes(T.toLowerCase()) || (e.description ?? "").toLowerCase().includes(T.toLowerCase()), n = D === "All" || e.category === D, r = !k || (e.entityTags ?? []).some((e) => e.key === k);
181
182
  return t && n && r;
182
183
  }).sort((e, t) => {
183
- switch (N) {
184
+ switch (j) {
184
185
  case "price-asc": return e.price - t.price;
185
186
  case "price-desc": return t.price - e.price;
186
187
  case "rating": return t.rating - e.rating;
187
188
  case "reviews": return t.reviews - e.reviews;
188
189
  default: return 0;
189
190
  }
190
- }), $ = C.length, Ye = new Set(C.map((e) => e.category)).size, Xe = $ > 0 ? C.reduce((e, t) => e + t.rating, 0) / $ : 0, Ze = C.filter((e) => e.organicCertified).length, Qe = (e) => Fe[e] ?? 1, $e = (e, t) => {
191
- Ie((n) => ({
191
+ }), Q = C.length, Qe = new Set(C.map((e) => e.category)).size, $e = Q > 0 ? C.reduce((e, t) => e + t.rating, 0) / Q : 0, et = C.filter((e) => e.organicCertified).length, tt = (e) => Re[e] ?? 1, nt = (e, t) => {
192
+ ze((n) => ({
192
193
  ...n,
193
194
  [e]: Math.max(1, t)
194
195
  }));
195
- }, et = (e) => {
196
- let t = Qe(e.id);
197
- for (let n = 0; n < t; n++) He({
196
+ }, $ = (e) => {
197
+ let t = tt(e.id);
198
+ for (let n = 0; n < t; n++) Ge({
198
199
  productId: e.id,
199
200
  name: e.name,
200
201
  price: e.price,
201
202
  unit: e.unit,
202
203
  seller: e.seller
203
204
  });
204
- I((t) => new Set(t).add(e.id)), Z({
205
+ P((t) => new Set(t).add(e.id)), X({
205
206
  title: "Added to cart (this session)",
206
207
  description: `${t}× ${e.name}. Cart isn't saved yet — it resets on refresh.`,
207
208
  variant: "info"
208
209
  }), setTimeout(() => {
209
- I((t) => {
210
+ P((t) => {
210
211
  let n = new Set(t);
211
212
  return n.delete(e.id), n;
212
213
  });
213
214
  }, 1500);
214
- }, tt = (e) => {
215
- let t = X.has(e.id);
216
- We(e.id), Z(t ? {
215
+ }, rt = (e) => {
216
+ let t = Y.has(e.id);
217
+ qe(e.id), X(t ? {
217
218
  title: "Removed from wishlist",
218
219
  description: e.name,
219
220
  variant: "info"
@@ -223,220 +224,220 @@ var C = () => {
223
224
  variant: "info"
224
225
  });
225
226
  };
226
- return /* @__PURE__ */ y(r, {
227
- title: E("healthybowl.marketplace.title", "Marketplace"),
228
- description: E("healthybowl.marketplace.description", "Browse organic products from verified sellers"),
229
- actions: /* @__PURE__ */ y("div", {
227
+ return /* @__PURE__ */ x(i, {
228
+ title: w("healthybowl.marketplace.title", "Marketplace"),
229
+ description: w("healthybowl.marketplace.description", "Browse organic products from verified sellers"),
230
+ actions: /* @__PURE__ */ x("div", {
230
231
  className: "flex items-center gap-2",
231
232
  children: [
232
- /* @__PURE__ */ y("button", {
233
- onClick: Re,
233
+ /* @__PURE__ */ x("button", {
234
+ onClick: Ve,
234
235
  className: "flex items-center gap-1.5 rounded-md border border-border px-3 py-1.5 text-sm font-medium text-foreground hover:bg-muted/50",
235
- children: [/* @__PURE__ */ v(Ce, { className: "h-4 w-4" }), E("healthybowl.marketplace.actions.listProduct", "List a Product")]
236
+ children: [/* @__PURE__ */ b(g, { className: "h-4 w-4" }), w("healthybowl.marketplace.actions.listProduct", "List a Product")]
236
237
  }),
237
- /* @__PURE__ */ y("button", {
238
- onClick: () => Y("wishlist"),
238
+ /* @__PURE__ */ x("button", {
239
+ onClick: () => q(J("marketplace/wishlist")),
239
240
  className: "flex items-center gap-1.5 rounded-md border border-border px-3 py-1.5 text-sm font-medium text-foreground hover:bg-muted/50",
240
241
  children: [
241
- /* @__PURE__ */ v(p, { className: "h-4 w-4" }),
242
- E("healthybowl.marketplace.actions.wishlist", "Wishlist"),
243
- X.size > 0 && /* @__PURE__ */ v("span", {
242
+ /* @__PURE__ */ b(_e, { className: "h-4 w-4" }),
243
+ w("healthybowl.marketplace.actions.wishlist", "Wishlist"),
244
+ Y.size > 0 && /* @__PURE__ */ b("span", {
244
245
  className: "ml-0.5 rounded-full bg-muted px-1.5 text-xs font-bold text-foreground",
245
- children: X.size
246
+ children: Y.size
246
247
  })
247
248
  ]
248
249
  }),
249
- /* @__PURE__ */ y("button", {
250
- onClick: () => Y("cart"),
250
+ /* @__PURE__ */ x("button", {
251
+ onClick: () => q(J("marketplace/cart")),
251
252
  className: "relative flex items-center gap-1.5 rounded-md bg-primary px-3 py-1.5 text-sm font-medium text-primary-foreground hover:bg-primary/90",
252
253
  children: [
253
- /* @__PURE__ */ v(m, { className: "h-4 w-4" }),
254
- E("healthybowl.marketplace.actions.cart", "Cart"),
255
- qe > 0 && /* @__PURE__ */ v("span", {
254
+ /* @__PURE__ */ b(m, { className: "h-4 w-4" }),
255
+ w("healthybowl.marketplace.actions.cart", "Cart"),
256
+ Xe > 0 && /* @__PURE__ */ b("span", {
256
257
  className: "absolute -right-1.5 -top-1.5 flex h-5 w-5 items-center justify-center rounded-full bg-foreground text-[10px] font-bold text-background",
257
- children: qe
258
+ children: Xe
258
259
  })
259
260
  ]
260
261
  })
261
262
  ]
262
263
  }),
263
264
  children: [
264
- /* @__PURE__ */ v(ee, { items: [{ label: E("healthybowl.marketplace.breadcrumb", "Marketplace") }] }),
265
- /* @__PURE__ */ y("div", {
265
+ /* @__PURE__ */ b(ne, { items: [{ label: w("healthybowl.marketplace.breadcrumb", "Marketplace") }] }),
266
+ /* @__PURE__ */ x("div", {
266
267
  className: "flex items-start gap-2 rounded-lg border border-border bg-muted/40 p-3 text-xs text-muted-foreground",
267
- children: [/* @__PURE__ */ v(ge, { className: "mt-0.5 h-4 w-4 shrink-0 text-muted-foreground" }), /* @__PURE__ */ v("p", { children: "Product listings are saved and shared across the marketplace, and checking out from the cart places a real order (payment is arranged separately). Cart and wishlist are kept only for this browser session (not saved yet) and reset on refresh." })]
268
+ children: [/* @__PURE__ */ b(ve, { className: "mt-0.5 h-4 w-4 shrink-0 text-muted-foreground" }), /* @__PURE__ */ b("p", { children: "Product listings are saved and shared across the marketplace, and checking out from the cart places a real order (payment is arranged separately). Cart and wishlist are kept only for this browser session (not saved yet) and reset on refresh." })]
268
269
  }),
269
- /* @__PURE__ */ y("div", {
270
+ /* @__PURE__ */ x("div", {
270
271
  className: "grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-4",
271
272
  children: [
272
- /* @__PURE__ */ v(i, {
273
- label: E("healthybowl.marketplace.stats.totalProducts", "Total Products"),
274
- value: $,
275
- icon: /* @__PURE__ */ v(ye, { className: "h-5 w-5" })
273
+ /* @__PURE__ */ b(a, {
274
+ label: w("healthybowl.marketplace.stats.totalProducts", "Total Products"),
275
+ value: Q,
276
+ icon: /* @__PURE__ */ b(be, { className: "h-5 w-5" })
276
277
  }),
277
- /* @__PURE__ */ v(i, {
278
- label: E("healthybowl.marketplace.stats.categories", "Categories"),
279
- value: Ye,
280
- icon: /* @__PURE__ */ v(we, { className: "h-5 w-5" })
278
+ /* @__PURE__ */ b(a, {
279
+ label: w("healthybowl.marketplace.stats.categories", "Categories"),
280
+ value: Qe,
281
+ icon: /* @__PURE__ */ b(_, { className: "h-5 w-5" })
281
282
  }),
282
- /* @__PURE__ */ v(i, {
283
- label: E("healthybowl.marketplace.stats.avgRating", "Avg Rating"),
284
- value: Xe.toFixed(1),
285
- icon: /* @__PURE__ */ v(h, { className: "h-5 w-5" })
283
+ /* @__PURE__ */ b(a, {
284
+ label: w("healthybowl.marketplace.stats.avgRating", "Avg Rating"),
285
+ value: $e.toFixed(1),
286
+ icon: /* @__PURE__ */ b(h, { className: "h-5 w-5" })
286
287
  }),
287
- /* @__PURE__ */ v(i, {
288
- label: E("healthybowl.marketplace.stats.organicCertified", "Organic Certified"),
289
- value: Ze,
290
- icon: /* @__PURE__ */ v(fe, { className: "h-5 w-5" })
288
+ /* @__PURE__ */ b(a, {
289
+ label: w("healthybowl.marketplace.stats.organicCertified", "Organic Certified"),
290
+ value: et,
291
+ icon: /* @__PURE__ */ b(pe, { className: "h-5 w-5" })
291
292
  })
292
293
  ]
293
294
  }),
294
- /* @__PURE__ */ y("div", {
295
+ /* @__PURE__ */ x("div", {
295
296
  className: "flex flex-col gap-4 rounded-lg border border-border bg-card p-4 sm:flex-row sm:items-center sm:justify-between",
296
- children: [/* @__PURE__ */ y("div", {
297
+ children: [/* @__PURE__ */ x("div", {
297
298
  className: "flex flex-1 flex-wrap items-center gap-3",
298
- children: [/* @__PURE__ */ y("div", {
299
+ children: [/* @__PURE__ */ x("div", {
299
300
  className: "relative",
300
301
  children: [
301
- /* @__PURE__ */ v(Se, { className: "absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground" }),
302
- /* @__PURE__ */ v("input", {
302
+ /* @__PURE__ */ b(Ce, { className: "absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground" }),
303
+ /* @__PURE__ */ b("input", {
303
304
  type: "text",
304
- placeholder: E("healthybowl.marketplace.search.placeholder", "Search products or sellers..."),
305
- value: D,
306
- onChange: (e) => O(e.target.value),
305
+ placeholder: w("healthybowl.marketplace.search.placeholder", "Search products or sellers..."),
306
+ value: T,
307
+ onChange: (e) => E(e.target.value),
307
308
  className: "w-64 rounded-md border border-border bg-background py-2 pl-10 pr-8 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring"
308
309
  }),
309
- D && /* @__PURE__ */ v("button", {
310
- onClick: () => O(""),
310
+ T && /* @__PURE__ */ b("button", {
311
+ onClick: () => E(""),
311
312
  className: "absolute right-2.5 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground",
312
- children: /* @__PURE__ */ v(g, { className: "h-3.5 w-3.5" })
313
+ children: /* @__PURE__ */ b(v, { className: "h-3.5 w-3.5" })
313
314
  })
314
315
  ]
315
- }), /* @__PURE__ */ y("div", {
316
+ }), /* @__PURE__ */ x("div", {
316
317
  className: "relative",
317
- ref: J,
318
- children: [/* @__PURE__ */ y("button", {
319
- onClick: () => F(!P),
318
+ ref: K,
319
+ children: [/* @__PURE__ */ x("button", {
320
+ onClick: () => N(!M),
320
321
  className: "flex items-center gap-1.5 rounded-md border border-border bg-background px-3 py-2 text-sm text-foreground hover:bg-muted/50",
321
322
  children: [
322
- /* @__PURE__ */ v(de, { className: "h-3.5 w-3.5 text-muted-foreground" }),
323
- x[N],
324
- /* @__PURE__ */ v(me, { className: "h-3.5 w-3.5 text-muted-foreground" })
323
+ /* @__PURE__ */ b(fe, { className: "h-3.5 w-3.5 text-muted-foreground" }),
324
+ Oe[j],
325
+ /* @__PURE__ */ b(he, { className: "h-3.5 w-3.5 text-muted-foreground" })
325
326
  ]
326
- }), P && /* @__PURE__ */ v("div", {
327
+ }), M && /* @__PURE__ */ b("div", {
327
328
  className: "absolute left-0 z-20 mt-1 w-48 rounded-md border border-border bg-card shadow-lg",
328
- children: Object.entries(x).map(([t, n]) => /* @__PURE__ */ v("button", {
329
+ children: Object.entries(Oe).map(([t, n]) => /* @__PURE__ */ b("button", {
329
330
  onClick: () => {
330
- Ne(t), F(!1);
331
+ Ie(t), N(!1);
331
332
  },
332
- className: e("flex w-full items-center px-3 py-2 text-sm hover:bg-muted/50", N === t ? "font-medium text-primary" : "text-foreground"),
333
+ className: e("flex w-full items-center px-3 py-2 text-sm hover:bg-muted/50", j === t ? "font-medium text-primary" : "text-foreground"),
333
334
  children: n
334
335
  }, t))
335
336
  })]
336
337
  })]
337
- }), /* @__PURE__ */ y("span", {
338
+ }), /* @__PURE__ */ x("span", {
338
339
  className: "text-xs text-muted-foreground",
339
340
  children: [
340
341
  "Showing ",
341
- Q.length,
342
+ Z.length,
342
343
  " of ",
343
- $,
344
+ Q,
344
345
  " products"
345
346
  ]
346
347
  })]
347
348
  }),
348
- /* @__PURE__ */ v("div", {
349
+ /* @__PURE__ */ b("div", {
349
350
  className: "flex flex-wrap gap-1.5",
350
- children: Oe.map((t) => /* @__PURE__ */ v("button", {
351
- onClick: () => A(t),
352
- className: e("rounded-full px-3 py-1 text-xs font-medium transition-colors", k === t ? "bg-primary text-primary-foreground" : "border border-border text-muted-foreground hover:text-foreground hover:bg-muted/50"),
351
+ children: De.map((t) => /* @__PURE__ */ b("button", {
352
+ onClick: () => O(t),
353
+ className: e("rounded-full px-3 py-1 text-xs font-medium transition-colors", D === t ? "bg-primary text-primary-foreground" : "border border-border text-muted-foreground hover:text-foreground hover:bg-muted/50"),
353
354
  children: t
354
355
  }, t))
355
356
  }),
356
- Je.length > 0 && /* @__PURE__ */ y("div", {
357
+ Ze.length > 0 && /* @__PURE__ */ x("div", {
357
358
  className: "flex flex-wrap items-center gap-1.5",
358
359
  children: [
359
- /* @__PURE__ */ y("span", {
360
+ /* @__PURE__ */ x("span", {
360
361
  className: "flex items-center gap-1 text-xs font-medium text-muted-foreground",
361
- children: [/* @__PURE__ */ v(we, { className: "h-3.5 w-3.5" }), " Tags:"]
362
+ children: [/* @__PURE__ */ b(_, { className: "h-3.5 w-3.5" }), " Tags:"]
362
363
  }),
363
- Je.map((t) => /* @__PURE__ */ v("button", {
364
- onClick: () => M((e) => e === t.key ? null : t.key),
365
- className: e("rounded-full px-3 py-1 text-xs font-medium transition-colors", j === t.key ? "bg-primary text-primary-foreground" : "border border-border text-muted-foreground hover:text-foreground hover:bg-muted/50"),
364
+ Ze.map((t) => /* @__PURE__ */ b("button", {
365
+ onClick: () => A((e) => e === t.key ? null : t.key),
366
+ className: e("rounded-full px-3 py-1 text-xs font-medium transition-colors", k === t.key ? "bg-primary text-primary-foreground" : "border border-border text-muted-foreground hover:text-foreground hover:bg-muted/50"),
366
367
  children: t.label
367
368
  }, t.key)),
368
- j && /* @__PURE__ */ y("button", {
369
- onClick: () => M(null),
369
+ k && /* @__PURE__ */ x("button", {
370
+ onClick: () => A(null),
370
371
  className: "flex items-center gap-0.5 text-xs text-muted-foreground hover:text-foreground",
371
- children: [/* @__PURE__ */ v(g, { className: "h-3 w-3" }), " Clear"]
372
+ children: [/* @__PURE__ */ b(v, { className: "h-3 w-3" }), " Clear"]
372
373
  })
373
374
  ]
374
375
  }),
375
- Q.length > 0 ? /* @__PURE__ */ v("div", {
376
+ Z.length > 0 ? /* @__PURE__ */ b("div", {
376
377
  className: "grid gap-4 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4",
377
- children: Q.map((r) => {
378
- let i = Pe.has(r.id), o = Ue.some((e) => e.productId === r.id), s = X.has(r.id), c = Qe(r.id);
379
- return /* @__PURE__ */ y("div", {
378
+ children: Z.map((r) => {
379
+ let i = Le.has(r.id), a = Ke.some((e) => e.productId === r.id), ee = Y.has(r.id), s = tt(r.id);
380
+ return /* @__PURE__ */ x("div", {
380
381
  className: "flex flex-col rounded-lg border border-border bg-card p-4 shadow-sm transition-shadow hover:shadow-md",
381
382
  children: [
382
- /* @__PURE__ */ y("div", {
383
+ /* @__PURE__ */ x("div", {
383
384
  className: "flex items-start justify-between",
384
- children: [/* @__PURE__ */ v("button", {
385
- onClick: () => R(r),
385
+ children: [/* @__PURE__ */ b("button", {
386
+ onClick: () => I(r),
386
387
  className: "text-left text-sm font-semibold text-foreground hover:underline",
387
388
  children: r.name
388
- }), /* @__PURE__ */ y("div", {
389
+ }), /* @__PURE__ */ x("div", {
389
390
  className: "flex items-center gap-1.5",
390
- children: [r.organicCertified && /* @__PURE__ */ y("span", {
391
+ children: [r.organicCertified && /* @__PURE__ */ x("span", {
391
392
  className: "flex items-center gap-0.5 rounded-full bg-success-subtle px-1.5 py-0.5 text-[10px] font-medium text-success",
392
- children: [/* @__PURE__ */ v(_e, { className: "h-2.5 w-2.5" }), " Organic"]
393
- }), /* @__PURE__ */ v("button", {
394
- onClick: () => tt(r),
393
+ children: [/* @__PURE__ */ b(p, { className: "h-2.5 w-2.5" }), " Organic"]
394
+ }), /* @__PURE__ */ b("button", {
395
+ onClick: () => rt(r),
395
396
  className: "rounded-md p-1 text-muted-foreground hover:text-foreground",
396
- children: /* @__PURE__ */ v(p, { className: e("h-4 w-4 transition-colors", s && "fill-destructive text-destructive") })
397
+ children: /* @__PURE__ */ b(_e, { className: e("h-4 w-4 transition-colors", ee && "fill-destructive text-destructive") })
397
398
  })]
398
399
  })]
399
400
  }),
400
- /* @__PURE__ */ v("div", {
401
+ /* @__PURE__ */ b("div", {
401
402
  className: "mt-1.5",
402
- children: /* @__PURE__ */ v(a, {
403
+ children: /* @__PURE__ */ b(o, {
403
404
  label: r.category,
404
405
  variant: "muted"
405
406
  })
406
407
  }),
407
- /* @__PURE__ */ v(u, {
408
+ /* @__PURE__ */ b(re, {
408
409
  readOnly: !0,
409
410
  entityType: "MARKETPLACE_PRODUCT",
410
411
  entityId: r.id,
411
412
  tags: r.entityTags ?? [],
412
413
  className: "mt-1.5"
413
414
  }),
414
- /* @__PURE__ */ y("div", {
415
+ /* @__PURE__ */ x("div", {
415
416
  className: "mt-2 flex items-center justify-between",
416
- children: [/* @__PURE__ */ v("p", {
417
+ children: [/* @__PURE__ */ b("p", {
417
418
  className: "text-xs text-muted-foreground",
418
419
  children: r.seller
419
- }), /* @__PURE__ */ v("div", {
420
+ }), /* @__PURE__ */ b("div", {
420
421
  className: "flex items-center gap-0.5",
421
- children: S(r.sellerRating)
422
+ children: ke(r.sellerRating)
422
423
  })]
423
424
  }),
424
- /* @__PURE__ */ y("p", {
425
+ /* @__PURE__ */ x("p", {
425
426
  className: "mt-2 text-lg font-bold text-foreground",
426
- children: [t(r.price), /* @__PURE__ */ y("span", {
427
+ children: [t(r.price), /* @__PURE__ */ x("span", {
427
428
  className: "text-xs font-normal text-muted-foreground",
428
429
  children: ["/", r.unit]
429
430
  })]
430
431
  }),
431
- /* @__PURE__ */ y("div", {
432
+ /* @__PURE__ */ x("div", {
432
433
  className: "mt-1.5 flex items-center gap-2",
433
- children: [/* @__PURE__ */ y("div", {
434
+ children: [/* @__PURE__ */ x("div", {
434
435
  className: "flex items-center gap-1",
435
- children: [/* @__PURE__ */ v(h, { className: "h-3 w-3 fill-warning text-warning" }), /* @__PURE__ */ v("span", {
436
+ children: [/* @__PURE__ */ b(h, { className: "h-3 w-3 fill-warning text-warning" }), /* @__PURE__ */ b("span", {
436
437
  className: "text-xs font-medium text-foreground",
437
438
  children: r.rating
438
439
  })]
439
- }), /* @__PURE__ */ y("span", {
440
+ }), /* @__PURE__ */ x("span", {
440
441
  className: "text-xs text-muted-foreground",
441
442
  children: [
442
443
  "(",
@@ -445,224 +446,224 @@ var C = () => {
445
446
  ]
446
447
  })]
447
448
  }),
448
- /* @__PURE__ */ v("div", {
449
+ /* @__PURE__ */ b("div", {
449
450
  className: "mt-2",
450
- children: /* @__PURE__ */ v(a, {
451
+ children: /* @__PURE__ */ b(o, {
451
452
  label: r.stock === 0 ? "Out of Stock" : r.stock < 50 ? `Low Stock (${r.stock})` : "In Stock",
452
453
  variant: r.stock === 0 ? "error" : r.stock < 50 ? "warning" : "success",
453
454
  dot: !0
454
455
  })
455
456
  }),
456
- /* @__PURE__ */ y("div", {
457
+ /* @__PURE__ */ x("div", {
457
458
  className: "mt-3 flex items-center gap-2",
458
- children: [/* @__PURE__ */ v("span", {
459
+ children: [/* @__PURE__ */ b("span", {
459
460
  className: "text-xs text-muted-foreground",
460
461
  children: "Qty:"
461
- }), /* @__PURE__ */ y("div", {
462
+ }), /* @__PURE__ */ x("div", {
462
463
  className: "flex items-center rounded-md border border-border",
463
464
  children: [
464
- /* @__PURE__ */ v("button", {
465
- onClick: () => $e(r.id, c - 1),
466
- disabled: c <= 1,
465
+ /* @__PURE__ */ b("button", {
466
+ onClick: () => nt(r.id, s - 1),
467
+ disabled: s <= 1,
467
468
  className: "rounded-l-md px-2 py-1 text-muted-foreground hover:bg-muted/50 disabled:opacity-40",
468
- children: /* @__PURE__ */ v(ve, { className: "h-3 w-3" })
469
+ children: /* @__PURE__ */ b(ye, { className: "h-3 w-3" })
469
470
  }),
470
- /* @__PURE__ */ v("span", {
471
+ /* @__PURE__ */ b("span", {
471
472
  className: "min-w-[2rem] text-center text-xs font-medium text-foreground",
472
- children: c
473
+ children: s
473
474
  }),
474
- /* @__PURE__ */ v("button", {
475
- onClick: () => $e(r.id, c + 1),
476
- disabled: c >= r.stock,
475
+ /* @__PURE__ */ b("button", {
476
+ onClick: () => nt(r.id, s + 1),
477
+ disabled: s >= r.stock,
477
478
  className: "rounded-r-md px-2 py-1 text-muted-foreground hover:bg-muted/50 disabled:opacity-40",
478
- children: /* @__PURE__ */ v(xe, { className: "h-3 w-3" })
479
+ children: /* @__PURE__ */ b(Se, { className: "h-3 w-3" })
479
480
  })
480
481
  ]
481
482
  })]
482
483
  }),
483
- /* @__PURE__ */ y("div", {
484
+ /* @__PURE__ */ x("div", {
484
485
  className: "mt-3 flex items-center gap-2",
485
- children: [/* @__PURE__ */ v("button", {
486
- onClick: () => et(r),
486
+ children: [/* @__PURE__ */ b("button", {
487
+ onClick: () => $(r),
487
488
  disabled: r.stock === 0,
488
- className: e("flex flex-1 items-center justify-center gap-1 rounded-md px-3 py-1.5 text-xs font-medium transition-all", i ? "bg-success text-white" : o ? "border border-border bg-muted text-foreground hover:bg-muted/80" : "bg-primary text-primary-foreground hover:bg-primary/90", r.stock === 0 && "cursor-not-allowed opacity-50"),
489
- children: i ? /* @__PURE__ */ y(_, { children: [/* @__PURE__ */ v(pe, { className: "h-3 w-3" }), " Added"] }) : o ? /* @__PURE__ */ y(_, { children: [/* @__PURE__ */ v(m, { className: "h-3 w-3" }), " Add More"] }) : /* @__PURE__ */ y(_, { children: [/* @__PURE__ */ v(m, { className: "h-3 w-3" }), " Add to Cart"] })
490
- }), /* @__PURE__ */ v("button", {
491
- onClick: () => R(r),
489
+ className: e("flex flex-1 items-center justify-center gap-1 rounded-md px-3 py-1.5 text-xs font-medium transition-all", i ? "bg-success text-white" : a ? "border border-border bg-muted text-foreground hover:bg-muted/80" : "bg-primary text-primary-foreground hover:bg-primary/90", r.stock === 0 && "cursor-not-allowed opacity-50"),
490
+ children: i ? /* @__PURE__ */ x(y, { children: [/* @__PURE__ */ b(me, { className: "h-3 w-3" }), " Added"] }) : a ? /* @__PURE__ */ x(y, { children: [/* @__PURE__ */ b(m, { className: "h-3 w-3" }), " Add More"] }) : /* @__PURE__ */ x(y, { children: [/* @__PURE__ */ b(m, { className: "h-3 w-3" }), " Add to Cart"] })
491
+ }), /* @__PURE__ */ b("button", {
492
+ onClick: () => I(r),
492
493
  className: "rounded-md border border-border px-2 py-1.5 text-xs text-muted-foreground hover:bg-muted/50 hover:text-foreground",
493
494
  "aria-label": "Quick view",
494
- children: /* @__PURE__ */ v(he, { className: "h-3.5 w-3.5" })
495
+ children: /* @__PURE__ */ b(ge, { className: "h-3.5 w-3.5" })
495
496
  })]
496
497
  }),
497
- /* @__PURE__ */ y("div", {
498
+ /* @__PURE__ */ x("div", {
498
499
  className: "mt-2 flex items-center gap-2 border-t border-border pt-2",
499
- children: [/* @__PURE__ */ y("button", {
500
- onClick: () => ze(r),
501
- disabled: W,
500
+ children: [/* @__PURE__ */ x("button", {
501
+ onClick: () => He(r),
502
+ disabled: H,
502
503
  className: "flex flex-1 items-center justify-center gap-1 rounded-md border border-border px-2 py-1 text-xs text-muted-foreground hover:bg-muted/50 hover:text-foreground disabled:opacity-50",
503
- children: [/* @__PURE__ */ v(be, { className: "h-3 w-3" }), " Edit Listing"]
504
- }), /* @__PURE__ */ v("button", {
505
- onClick: () => Ve(r),
506
- disabled: W,
504
+ children: [/* @__PURE__ */ b(xe, { className: "h-3 w-3" }), " Edit Listing"]
505
+ }), /* @__PURE__ */ b("button", {
506
+ onClick: () => We(r),
507
+ disabled: H,
507
508
  className: "flex items-center justify-center gap-1 rounded-md border border-border px-2 py-1 text-xs text-muted-foreground hover:border-destructive hover:text-destructive disabled:opacity-50",
508
509
  "aria-label": "Delete listing",
509
- children: /* @__PURE__ */ v(Te, { className: "h-3 w-3" })
510
+ children: /* @__PURE__ */ b(we, { className: "h-3 w-3" })
510
511
  })]
511
512
  })
512
513
  ]
513
514
  }, r.id);
514
515
  })
515
- }) : ke.marketplace ? /* @__PURE__ */ v(s, {}) : /* @__PURE__ */ v(o, {
516
- icon: /* @__PURE__ */ v(ye, { className: "h-12 w-12 text-muted-foreground" }),
517
- title: D || k !== "All" ? "No products found" : "No listings yet",
518
- description: D || k !== "All" ? "Try adjusting your search or category filters." : w ? "Loading marketplace products..." : "No products have been listed yet. Be the first to list your farm produce for buyers to discover.",
519
- action: D || k !== "All" ? /* @__PURE__ */ v("button", {
516
+ }) : je.marketplace ? /* @__PURE__ */ b(s, {}) : /* @__PURE__ */ b(ee, {
517
+ icon: /* @__PURE__ */ b(be, { className: "h-12 w-12 text-muted-foreground" }),
518
+ title: T || D !== "All" ? "No products found" : "No listings yet",
519
+ description: T || D !== "All" ? "Try adjusting your search or category filters." : Ae ? "Loading marketplace products..." : "No products have been listed yet. Be the first to list your farm produce for buyers to discover.",
520
+ action: T || D !== "All" ? /* @__PURE__ */ b("button", {
520
521
  onClick: () => {
521
- O(""), A("All");
522
+ E(""), O("All");
522
523
  },
523
524
  className: "rounded-md bg-primary px-4 py-2 text-sm font-medium text-primary-foreground hover:bg-primary/90",
524
525
  children: "Clear Filters"
525
- }) : w ? void 0 : /* @__PURE__ */ y("button", {
526
- onClick: Re,
526
+ }) : Ae ? void 0 : /* @__PURE__ */ x("button", {
527
+ onClick: Ve,
527
528
  className: "flex items-center gap-1.5 rounded-md bg-primary px-4 py-2 text-sm font-medium text-primary-foreground hover:bg-primary/90",
528
- children: [/* @__PURE__ */ v(Ce, { className: "h-4 w-4" }), " List a Product"]
529
+ children: [/* @__PURE__ */ b(g, { className: "h-4 w-4" }), " List a Product"]
529
530
  })
530
531
  }),
531
- /* @__PURE__ */ v(l, {
532
- open: !!L,
533
- onClose: () => R(null),
534
- title: L?.name ?? "",
535
- description: L?.category,
532
+ /* @__PURE__ */ b(c, {
533
+ open: !!F,
534
+ onClose: () => I(null),
535
+ title: F?.name ?? "",
536
+ description: F?.category,
536
537
  size: "lg",
537
- footer: L ? /* @__PURE__ */ y(_, { children: [
538
- /* @__PURE__ */ v("button", {
539
- onClick: () => R(null),
538
+ footer: F ? /* @__PURE__ */ x(y, { children: [
539
+ /* @__PURE__ */ b("button", {
540
+ onClick: () => I(null),
540
541
  className: "rounded-md border border-border px-4 py-2 text-sm text-muted-foreground hover:text-foreground",
541
542
  children: "Close"
542
543
  }),
543
- /* @__PURE__ */ v("button", {
544
+ /* @__PURE__ */ b("button", {
544
545
  onClick: () => {
545
- Y(L.id), R(null);
546
+ q(J(`marketplace/${F.id}`)), I(null);
546
547
  },
547
548
  className: "rounded-md border border-border px-4 py-2 text-sm text-foreground hover:bg-muted/50",
548
549
  children: "View Full Details"
549
550
  }),
550
- /* @__PURE__ */ y("button", {
551
+ /* @__PURE__ */ x("button", {
551
552
  onClick: () => {
552
- et(L), R(null);
553
+ $(F), I(null);
553
554
  },
554
- disabled: L.stock === 0,
555
+ disabled: F.stock === 0,
555
556
  className: "flex items-center gap-1.5 rounded-md bg-primary px-4 py-2 text-sm font-medium text-primary-foreground hover:bg-primary/90 disabled:cursor-not-allowed disabled:opacity-50",
556
- children: [/* @__PURE__ */ v(m, { className: "h-4 w-4" }), " Add to Cart"]
557
+ children: [/* @__PURE__ */ b(m, { className: "h-4 w-4" }), " Add to Cart"]
557
558
  })
558
559
  ] }) : void 0,
559
- children: L && /* @__PURE__ */ y("div", {
560
+ children: F && /* @__PURE__ */ x("div", {
560
561
  className: "space-y-4",
561
562
  children: [
562
- /* @__PURE__ */ y("div", {
563
+ /* @__PURE__ */ x("div", {
563
564
  className: "flex flex-wrap items-center gap-2",
564
565
  children: [
565
- L.organicCertified && /* @__PURE__ */ y("span", {
566
+ F.organicCertified && /* @__PURE__ */ x("span", {
566
567
  className: "flex items-center gap-1 rounded-full bg-success-subtle px-2.5 py-0.5 text-xs font-medium text-success",
567
- children: [/* @__PURE__ */ v(_e, { className: "h-3 w-3" }), " Organic Certified"]
568
+ children: [/* @__PURE__ */ b(p, { className: "h-3 w-3" }), " Organic Certified"]
568
569
  }),
569
- /* @__PURE__ */ v(a, {
570
- label: L.category,
570
+ /* @__PURE__ */ b(o, {
571
+ label: F.category,
571
572
  variant: "muted"
572
573
  }),
573
- /* @__PURE__ */ v(a, {
574
- label: L.stock > 0 ? `${L.stock} in stock` : "Out of Stock",
575
- variant: L.stock > 0 ? "success" : "error",
574
+ /* @__PURE__ */ b(o, {
575
+ label: F.stock > 0 ? `${F.stock} in stock` : "Out of Stock",
576
+ variant: F.stock > 0 ? "success" : "error",
576
577
  dot: !0
577
578
  })
578
579
  ]
579
580
  }),
580
- /* @__PURE__ */ y("div", {
581
+ /* @__PURE__ */ x("div", {
581
582
  className: "flex items-baseline gap-3",
582
- children: [/* @__PURE__ */ v("span", {
583
+ children: [/* @__PURE__ */ b("span", {
583
584
  className: "text-2xl font-bold text-foreground",
584
- children: t(L.price)
585
- }), /* @__PURE__ */ y("span", {
585
+ children: t(F.price)
586
+ }), /* @__PURE__ */ x("span", {
586
587
  className: "text-sm text-muted-foreground",
587
- children: ["/ ", L.unit]
588
+ children: ["/ ", F.unit]
588
589
  })]
589
590
  }),
590
- /* @__PURE__ */ y("div", {
591
+ /* @__PURE__ */ x("div", {
591
592
  className: "flex items-center gap-2",
592
593
  children: [
593
- /* @__PURE__ */ v("div", {
594
+ /* @__PURE__ */ b("div", {
594
595
  className: "flex",
595
- children: S(L.rating)
596
+ children: ke(F.rating)
596
597
  }),
597
- /* @__PURE__ */ v("span", {
598
+ /* @__PURE__ */ b("span", {
598
599
  className: "text-sm font-medium text-foreground",
599
- children: L.rating
600
+ children: F.rating
600
601
  }),
601
- /* @__PURE__ */ y("span", {
602
+ /* @__PURE__ */ x("span", {
602
603
  className: "text-sm text-muted-foreground",
603
604
  children: [
604
605
  "(",
605
- n(L.reviews),
606
+ n(F.reviews),
606
607
  " reviews)"
607
608
  ]
608
609
  })
609
610
  ]
610
611
  }),
611
- /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("h4", {
612
+ /* @__PURE__ */ x("div", { children: [/* @__PURE__ */ b("h4", {
612
613
  className: "text-sm font-medium text-foreground",
613
614
  children: "Description"
614
- }), /* @__PURE__ */ v("p", {
615
+ }), /* @__PURE__ */ b("p", {
615
616
  className: "mt-1 text-sm text-muted-foreground",
616
- children: L.description
617
+ children: F.description
617
618
  })] }),
618
- /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("h4", {
619
+ /* @__PURE__ */ x("div", { children: [/* @__PURE__ */ b("h4", {
619
620
  className: "text-sm font-medium text-foreground",
620
621
  children: "Tags"
621
- }), /* @__PURE__ */ v(u, {
622
+ }), /* @__PURE__ */ b(re, {
622
623
  entityType: "MARKETPLACE_PRODUCT",
623
- entityId: L.id,
624
- tags: L.entityTags ?? [],
624
+ entityId: F.id,
625
+ tags: F.entityTags ?? [],
625
626
  className: "mt-1.5"
626
627
  })] }),
627
- /* @__PURE__ */ y("div", {
628
+ /* @__PURE__ */ x("div", {
628
629
  className: "rounded-lg border border-border bg-muted/50 p-3",
629
- children: [/* @__PURE__ */ v("h4", {
630
+ children: [/* @__PURE__ */ b("h4", {
630
631
  className: "text-sm font-medium text-foreground",
631
632
  children: "Seller Information"
632
- }), /* @__PURE__ */ y("div", {
633
+ }), /* @__PURE__ */ x("div", {
633
634
  className: "mt-2 space-y-1 text-sm",
634
635
  children: [
635
- /* @__PURE__ */ y("div", {
636
+ /* @__PURE__ */ x("div", {
636
637
  className: "flex items-center justify-between",
637
- children: [/* @__PURE__ */ v("span", {
638
+ children: [/* @__PURE__ */ b("span", {
638
639
  className: "text-muted-foreground",
639
640
  children: "Seller"
640
- }), /* @__PURE__ */ v("span", {
641
+ }), /* @__PURE__ */ b("span", {
641
642
  className: "font-medium text-foreground",
642
- children: L.seller
643
+ children: F.seller
643
644
  })]
644
645
  }),
645
- /* @__PURE__ */ y("div", {
646
+ /* @__PURE__ */ x("div", {
646
647
  className: "flex items-center justify-between",
647
- children: [/* @__PURE__ */ v("span", {
648
+ children: [/* @__PURE__ */ b("span", {
648
649
  className: "text-muted-foreground",
649
650
  children: "Seller Rating"
650
- }), /* @__PURE__ */ y("div", {
651
+ }), /* @__PURE__ */ x("div", {
651
652
  className: "flex items-center gap-1",
652
- children: [/* @__PURE__ */ v(h, { className: "h-3 w-3 fill-warning text-warning" }), /* @__PURE__ */ v("span", {
653
+ children: [/* @__PURE__ */ b(h, { className: "h-3 w-3 fill-warning text-warning" }), /* @__PURE__ */ b("span", {
653
654
  className: "font-medium text-foreground",
654
- children: L.sellerRating
655
+ children: F.sellerRating
655
656
  })]
656
657
  })]
657
658
  }),
658
- /* @__PURE__ */ y("div", {
659
+ /* @__PURE__ */ x("div", {
659
660
  className: "flex items-center justify-between",
660
- children: [/* @__PURE__ */ v("span", {
661
+ children: [/* @__PURE__ */ b("span", {
661
662
  className: "text-muted-foreground",
662
663
  children: "Location"
663
- }), /* @__PURE__ */ v("span", {
664
+ }), /* @__PURE__ */ b("span", {
664
665
  className: "text-foreground",
665
- children: L.location
666
+ children: F.location
666
667
  })]
667
668
  })
668
669
  ]
@@ -671,120 +672,120 @@ var C = () => {
671
672
  ]
672
673
  })
673
674
  }),
674
- /* @__PURE__ */ v(l, {
675
- open: Le,
676
- onClose: q,
677
- title: B ? `Edit ${B.name}` : "List a Product",
678
- description: B ? "Update this marketplace listing. Changes are saved and persist after refresh." : "Publish your farm produce to the marketplace. Listings are saved and persist after refresh.",
675
+ /* @__PURE__ */ b(c, {
676
+ open: Be,
677
+ onClose: G,
678
+ title: R ? `Edit ${R.name}` : "List a Product",
679
+ description: R ? "Update this marketplace listing. Changes are saved and persist after refresh." : "Publish your farm produce to the marketplace. Listings are saved and persist after refresh.",
679
680
  size: "xl",
680
- footer: /* @__PURE__ */ y(_, { children: [/* @__PURE__ */ v("button", {
681
- onClick: q,
681
+ footer: /* @__PURE__ */ x(y, { children: [/* @__PURE__ */ b("button", {
682
+ onClick: G,
682
683
  className: "rounded-md border border-border px-4 py-2 text-sm text-muted-foreground hover:text-foreground",
683
684
  children: "Cancel"
684
- }), /* @__PURE__ */ v("button", {
685
- onClick: Be,
686
- disabled: W,
685
+ }), /* @__PURE__ */ b("button", {
686
+ onClick: Ue,
687
+ disabled: H,
687
688
  className: "rounded-md bg-primary px-4 py-2 text-sm font-medium text-primary-foreground hover:bg-primary/90 disabled:opacity-60",
688
- children: W ? "Saving..." : B ? "Save Changes" : "Publish Listing"
689
+ children: H ? "Saving..." : R ? "Save Changes" : "Publish Listing"
689
690
  })] }),
690
- children: /* @__PURE__ */ y("div", {
691
+ children: /* @__PURE__ */ x("div", {
691
692
  className: "grid gap-4 sm:grid-cols-2",
692
693
  children: [
693
- /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("label", {
694
+ /* @__PURE__ */ x("div", { children: [/* @__PURE__ */ b("label", {
694
695
  className: "text-sm font-medium text-foreground",
695
696
  children: "Product Name *"
696
- }), /* @__PURE__ */ v("input", {
697
+ }), /* @__PURE__ */ b("input", {
697
698
  type: "text",
698
- value: H.name,
699
- onChange: (e) => K("name", e.target.value),
699
+ value: B.name,
700
+ onChange: (e) => W("name", e.target.value),
700
701
  placeholder: "e.g., Organic Tomato",
701
702
  className: "mt-1 w-full rounded-md border border-border bg-background px-3 py-2 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring"
702
703
  })] }),
703
- /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("label", {
704
+ /* @__PURE__ */ x("div", { children: [/* @__PURE__ */ b("label", {
704
705
  className: "text-sm font-medium text-foreground",
705
706
  children: "Category"
706
- }), /* @__PURE__ */ v("select", {
707
- value: H.category,
708
- onChange: (e) => K("category", e.target.value),
707
+ }), /* @__PURE__ */ b("select", {
708
+ value: B.category,
709
+ onChange: (e) => W("category", e.target.value),
709
710
  className: "mt-1 w-full rounded-md border border-border bg-background px-3 py-2 text-sm text-foreground",
710
- children: De.map((e) => /* @__PURE__ */ v("option", {
711
+ children: Ee.map((e) => /* @__PURE__ */ b("option", {
711
712
  value: e,
712
713
  children: e
713
714
  }, e))
714
715
  })] }),
715
- /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("label", {
716
+ /* @__PURE__ */ x("div", { children: [/* @__PURE__ */ b("label", {
716
717
  className: "text-sm font-medium text-foreground",
717
718
  children: "Price *"
718
- }), /* @__PURE__ */ v("input", {
719
+ }), /* @__PURE__ */ b("input", {
719
720
  type: "number",
720
721
  min: 0,
721
722
  step: "0.01",
722
- value: H.price,
723
- onChange: (e) => K("price", e.target.value),
723
+ value: B.price,
724
+ onChange: (e) => W("price", e.target.value),
724
725
  placeholder: "e.g., 75",
725
726
  className: "mt-1 w-full rounded-md border border-border bg-background px-3 py-2 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring"
726
727
  })] }),
727
- /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("label", {
728
+ /* @__PURE__ */ x("div", { children: [/* @__PURE__ */ b("label", {
728
729
  className: "text-sm font-medium text-foreground",
729
730
  children: "Unit"
730
- }), /* @__PURE__ */ v("input", {
731
+ }), /* @__PURE__ */ b("input", {
731
732
  type: "text",
732
- value: H.unit,
733
- onChange: (e) => K("unit", e.target.value),
733
+ value: B.unit,
734
+ onChange: (e) => W("unit", e.target.value),
734
735
  placeholder: "e.g., kg",
735
736
  className: "mt-1 w-full rounded-md border border-border bg-background px-3 py-2 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring"
736
737
  })] }),
737
- /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("label", {
738
+ /* @__PURE__ */ x("div", { children: [/* @__PURE__ */ b("label", {
738
739
  className: "text-sm font-medium text-foreground",
739
740
  children: "Quantity Available *"
740
- }), /* @__PURE__ */ v("input", {
741
+ }), /* @__PURE__ */ b("input", {
741
742
  type: "number",
742
743
  min: 0,
743
- value: H.stock,
744
- onChange: (e) => K("stock", e.target.value),
744
+ value: B.stock,
745
+ onChange: (e) => W("stock", e.target.value),
745
746
  placeholder: "e.g., 1000",
746
747
  className: "mt-1 w-full rounded-md border border-border bg-background px-3 py-2 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring"
747
748
  })] }),
748
- /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("label", {
749
+ /* @__PURE__ */ x("div", { children: [/* @__PURE__ */ b("label", {
749
750
  className: "text-sm font-medium text-foreground",
750
751
  children: "Seller / Farm *"
751
- }), /* @__PURE__ */ v("input", {
752
+ }), /* @__PURE__ */ b("input", {
752
753
  type: "text",
753
- value: H.seller,
754
- onChange: (e) => K("seller", e.target.value),
754
+ value: B.seller,
755
+ onChange: (e) => W("seller", e.target.value),
755
756
  placeholder: "e.g., Green Valley Farm",
756
757
  className: "mt-1 w-full rounded-md border border-border bg-background px-3 py-2 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring"
757
758
  })] }),
758
- /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("label", {
759
+ /* @__PURE__ */ x("div", { children: [/* @__PURE__ */ b("label", {
759
760
  className: "text-sm font-medium text-foreground",
760
761
  children: "Location"
761
- }), /* @__PURE__ */ v("input", {
762
+ }), /* @__PURE__ */ b("input", {
762
763
  type: "text",
763
- value: H.location,
764
- onChange: (e) => K("location", e.target.value),
764
+ value: B.location,
765
+ onChange: (e) => W("location", e.target.value),
765
766
  placeholder: "e.g., Pune, Maharashtra",
766
767
  className: "mt-1 w-full rounded-md border border-border bg-background px-3 py-2 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring"
767
768
  })] }),
768
- /* @__PURE__ */ v("div", {
769
+ /* @__PURE__ */ b("div", {
769
770
  className: "flex items-end",
770
- children: /* @__PURE__ */ y("label", {
771
+ children: /* @__PURE__ */ x("label", {
771
772
  className: "flex items-center gap-2 text-sm font-medium text-foreground",
772
- children: [/* @__PURE__ */ v("input", {
773
+ children: [/* @__PURE__ */ b("input", {
773
774
  type: "checkbox",
774
- checked: H.organicCertified,
775
- onChange: (e) => K("organicCertified", e.target.checked),
775
+ checked: B.organicCertified,
776
+ onChange: (e) => W("organicCertified", e.target.checked),
776
777
  className: "h-4 w-4 rounded border-border text-primary focus:ring-ring"
777
778
  }), "Organic certified"]
778
779
  })
779
780
  }),
780
- /* @__PURE__ */ y("div", {
781
+ /* @__PURE__ */ x("div", {
781
782
  className: "sm:col-span-2",
782
- children: [/* @__PURE__ */ v("label", {
783
+ children: [/* @__PURE__ */ b("label", {
783
784
  className: "text-sm font-medium text-foreground",
784
785
  children: "Description"
785
- }), /* @__PURE__ */ v("textarea", {
786
- value: H.description,
787
- onChange: (e) => K("description", e.target.value),
786
+ }), /* @__PURE__ */ b("textarea", {
787
+ value: B.description,
788
+ onChange: (e) => W("description", e.target.value),
788
789
  placeholder: "Describe your produce, quality, and any certifications...",
789
790
  rows: 3,
790
791
  className: "mt-1 w-full rounded-md border border-border bg-background px-3 py-2 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring"
@@ -793,9 +794,9 @@ var C = () => {
793
794
  ]
794
795
  })
795
796
  }),
796
- /* @__PURE__ */ v(c, {
797
- toasts: Ge,
798
- onDismiss: Ke
797
+ /* @__PURE__ */ b(te, {
798
+ toasts: Je,
799
+ onDismiss: Ye
799
800
  })
800
801
  ]
801
802
  });