@burdenoff/microfe-kadaikodi 2026.719.4 → 2026.723.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.
@@ -2,19 +2,20 @@ import { useKadaikodi as e } from "../../context/KadaikodiContext.js";
2
2
  import { cn as t } from "../../utils/cn.js";
3
3
  import { PageLayout as n } from "../../components/PageLayout.js";
4
4
  import { EmptyState as ee } from "../../components/EmptyState.js";
5
- import { useInvest as r, useInvestmentOpportunities as i, useInvestments as a, useProvider as te } from "../../hooks/useKadaikodiApi.js";
6
- import { formatCurrency as o, formatDate as ne } from "../../utils/formatters.js";
7
- import { AreaChart as s } from "../../components/viz/AreaChart.js";
8
- import { ProgressRing as c } from "../../components/viz/ProgressRing.js";
9
- import { StatCard as l } from "../../components/viz/StatCard.js";
5
+ import { useInvest as r, useInvestmentOpportunities as i, useInvestments as a, useProvider as o } from "../../hooks/useKadaikodiApi.js";
6
+ import { formatCurrency as s, formatDate as te } from "../../utils/formatters.js";
7
+ import { AreaChart as c } from "../../components/viz/AreaChart.js";
8
+ import { ProgressRing as l } from "../../components/viz/ProgressRing.js";
9
+ import { StatCard as u } from "../../components/viz/StatCard.js";
10
10
  import "../../components/viz/index.js";
11
- import { useCallback as u, useMemo as d, useState as f } from "react";
12
- import { ArrowLeft as re, CheckCircle2 as p, IndianRupee as m, Lock as ie, MessageSquare as h, Receipt as g, Shield as _, Star as v, Tag as y, Target as b, TrendingUp as x, Users as S } from "lucide-react";
13
- import { useParams as C } from "react-router-dom";
14
- import { jsx as w, jsxs as T } from "react/jsx-runtime";
15
- import { EmphasisPanel as ae, GlassCard as E, PagePurpose as oe } from "@burdenoff/fe-libs/ui";
11
+ import { InvestmentMarketplaceComingSoon as d, useInvestmentMarketplaceEnabled as f } from "../../components/InvestmentMarketplaceGate.js";
12
+ import { useCallback as p, useMemo as m, useState as h } from "react";
13
+ import { ArrowLeft as ne, CheckCircle2 as re, IndianRupee as g, Lock as ie, MessageSquare as _, Receipt as v, Shield as y, Star as ae, Tag as oe, Target as se, TrendingUp as b, Users as x } from "lucide-react";
14
+ import { useParams as S } from "react-router-dom";
15
+ import { jsx as C, jsxs as w } from "react/jsx-runtime";
16
+ import { EmphasisPanel as T, GlassCard as E, PagePurpose as ce } from "@burdenoff/fe-libs/ui";
16
17
  //#region src/kadaikodi/pages/investor/InvestmentDetailsPage.tsx
17
- function se(e) {
18
+ function le(e) {
18
19
  switch (e) {
19
20
  case "low": return {
20
21
  label: "Low risk",
@@ -38,70 +39,70 @@ function se(e) {
38
39
  };
39
40
  }
40
41
  }
41
- function ce(e) {
42
- return o(e, {
42
+ function ue(e) {
43
+ return s(e, {
43
44
  minimumFractionDigits: 0,
44
45
  notation: "compact"
45
46
  });
46
47
  }
47
48
  function D() {
48
- let { navigateTo: D, currentUser: O } = e(), { id: k } = C(), { data: A = [], isLoading: j } = i(), { data: M = [], isLoading: N } = a(O?.id || ""), P = j || N, F = d(() => M.find((e) => e.id === k), [M, k]), I = d(() => A.find((e) => e.id === k || e.id === F?.opportunityId) ?? null, [
49
+ let { navigateTo: D, currentUser: O } = e(), { id: k } = S(), { data: A = [], isLoading: j } = i(), { data: M = [], isLoading: N } = a(O?.id || ""), P = j || N, F = m(() => M.find((e) => e.id === k), [M, k]), I = m(() => A.find((e) => e.id === k || e.id === F?.opportunityId) ?? null, [
49
50
  A,
50
51
  k,
51
52
  F
52
- ]), { data: L } = te(I?.cartId), R = r(), [z, B] = f(""), [V, H] = f("idle"), U = I?.minimumInvestment ?? 0, W = I ? Math.max(0, I.targetAmount - I.raisedAmount) : 0, G = Math.max(U, W), K = Number.parseInt(z, 10), q = !Number.isNaN(K) && K >= U && K <= G, le = u(() => {
53
- if (!I || !q) {
54
- H("error");
53
+ ]), { data: L } = o(I?.cartId), R = r(), z = f(), [B, V] = h(""), [H, U] = h("idle"), W = I?.minimumInvestment ?? 0, G = I ? Math.max(0, I.targetAmount - I.raisedAmount) : 0, K = Math.max(W, G), q = Number.parseInt(B, 10), J = !Number.isNaN(q) && q >= W && q <= K, de = p(() => {
54
+ if (!I || !J) {
55
+ U("error");
55
56
  return;
56
57
  }
57
58
  R.mutate({
58
- amount: K,
59
+ amount: q,
59
60
  investorId: O?.id ?? "",
60
61
  opportunityId: I.id
61
62
  }, {
62
63
  onSuccess: () => {
63
- H("success"), window.setTimeout(() => D("/investor/portfolio"), 1400);
64
+ U("success"), window.setTimeout(() => D("/investor/portfolio"), 1400);
64
65
  },
65
- onError: () => H("error")
66
+ onError: () => U("error")
66
67
  });
67
68
  }, [
68
69
  I,
69
- q,
70
+ J,
70
71
  R,
71
- K,
72
+ q,
72
73
  O?.id,
73
74
  D
74
- ]), J = d(() => {
75
+ ]), fe = m(() => {
75
76
  if (!I) return [];
76
- let e = q ? K : U || I.targetAmount / 10, t = e * (1 + I.expectedReturns / 100), n = Math.min(Math.max(I.investmentPeriod, 3), 12);
77
+ let e = J ? q : W || I.targetAmount / 10, t = e * (1 + I.expectedReturns / 100), n = Math.min(Math.max(I.investmentPeriod, 3), 12);
77
78
  return Array.from({ length: 7 }, (ee, r) => ({
78
79
  label: r === 0 ? "Now" : r === 6 ? `${n}mo` : `M${Math.round(n * r / 6)}`,
79
80
  value: e + (t - e) * (r / 6)
80
81
  }));
81
82
  }, [
82
83
  I,
84
+ J,
83
85
  q,
84
- K,
85
- U
86
+ W
86
87
  ]);
87
- if (P) return /* @__PURE__ */ w(n, {
88
+ if (P) return /* @__PURE__ */ C(n, {
88
89
  title: "Investment Details",
89
90
  description: "Loading...",
90
- children: /* @__PURE__ */ T("div", {
91
+ children: /* @__PURE__ */ w("div", {
91
92
  className: "space-y-4",
92
- children: [/* @__PURE__ */ w("div", { className: "h-28 animate-pulse rounded-[var(--radius-card)] bg-bg-sunken" }), /* @__PURE__ */ T("div", {
93
+ children: [/* @__PURE__ */ C("div", { className: "h-28 animate-pulse rounded-[var(--radius-card)] bg-bg-sunken" }), /* @__PURE__ */ w("div", {
93
94
  className: "grid gap-6 lg:grid-cols-3",
94
- children: [/* @__PURE__ */ w("div", { className: "h-96 animate-pulse rounded-[var(--radius-card)] bg-bg-sunken lg:col-span-2" }), /* @__PURE__ */ w("div", { className: "h-96 animate-pulse rounded-[var(--radius-card)] bg-bg-sunken" })]
95
+ children: [/* @__PURE__ */ C("div", { className: "h-96 animate-pulse rounded-[var(--radius-card)] bg-bg-sunken lg:col-span-2" }), /* @__PURE__ */ C("div", { className: "h-96 animate-pulse rounded-[var(--radius-card)] bg-bg-sunken" })]
95
96
  })]
96
97
  })
97
98
  });
98
- if (!I && !F) return /* @__PURE__ */ w(n, {
99
+ if (!I && !F) return /* @__PURE__ */ C(n, {
99
100
  title: "Investment Not Found",
100
- children: /* @__PURE__ */ w(ee, {
101
+ children: /* @__PURE__ */ C(ee, {
101
102
  illustration: "empty-generic",
102
103
  title: "Investment not found",
103
104
  description: "We couldn't find this investment. It may have been closed or the link is out of date.",
104
- action: /* @__PURE__ */ w("button", {
105
+ action: /* @__PURE__ */ C("button", {
105
106
  type: "button",
106
107
  onClick: () => D("/investor/portfolio"),
107
108
  className: "rounded-lg border border-border-subtle px-4 py-2 text-sm font-medium text-text-primary hover:bg-accent transition-colors",
@@ -109,171 +110,171 @@ function D() {
109
110
  })
110
111
  })
111
112
  });
112
- let ue = I?.cartName ?? F?.cartName ?? "Investment", Y = I ? se(I.riskLevel) : null, X = I && I.targetAmount > 0 ? Math.min(I.raisedAmount / I.targetAmount * 100, 100) : 0, Z = I?.expiresAt ? Math.max(0, Math.ceil((new Date(I.expiresAt).getTime() - Date.now()) / 864e5)) : null, de = F ? F.currentValue - F.investedAmount : 0, Q = F && F.investedAmount > 0 ? de / F.investedAmount * 100 : 0, $ = !!I && I?.status === "active";
113
- return /* @__PURE__ */ T(n, {
114
- title: ue,
113
+ let pe = I?.cartName ?? F?.cartName ?? "Investment", Y = I ? le(I.riskLevel) : null, X = I && I.targetAmount > 0 ? Math.min(I.raisedAmount / I.targetAmount * 100, 100) : 0, Z = I?.expiresAt ? Math.max(0, Math.ceil((new Date(I.expiresAt).getTime() - Date.now()) / 864e5)) : null, me = F ? F.currentValue - F.investedAmount : 0, Q = F && F.investedAmount > 0 ? me / F.investedAmount * 100 : 0, $ = !!I && I?.status === "active";
114
+ return /* @__PURE__ */ w(n, {
115
+ title: pe,
115
116
  description: "Investment details & performance",
116
- actions: /* @__PURE__ */ T("button", {
117
+ actions: /* @__PURE__ */ w("button", {
117
118
  type: "button",
118
119
  onClick: () => D("/investor/portfolio"),
119
120
  className: "flex items-center gap-1.5 rounded-lg border border-border-subtle px-3 py-2 text-sm font-medium text-text-primary hover:bg-accent transition-colors",
120
121
  children: [
121
- /* @__PURE__ */ w(re, { className: "h-4 w-4" }),
122
- /* @__PURE__ */ w("span", {
122
+ /* @__PURE__ */ C(ne, { className: "h-4 w-4" }),
123
+ /* @__PURE__ */ C("span", {
123
124
  className: "hidden sm:inline",
124
125
  children: "Back to Portfolio"
125
126
  }),
126
- /* @__PURE__ */ w("span", {
127
+ /* @__PURE__ */ C("span", {
127
128
  className: "sm:hidden",
128
129
  children: "Back"
129
130
  })
130
131
  ]
131
132
  }),
132
133
  children: [
133
- /* @__PURE__ */ w(oe, {
134
+ /* @__PURE__ */ C(ce, {
134
135
  className: "mb-6",
135
136
  children: "A deep dive into this investment. Review the business behind it, funding progress, expected returns and terms on offer, and — if you already hold a stake — exactly what you've put in and what it's worth today."
136
137
  }),
137
- F && /* @__PURE__ */ T(ae, { children: [/* @__PURE__ */ w("h2", {
138
+ F && /* @__PURE__ */ w(T, { children: [/* @__PURE__ */ C("h2", {
138
139
  className: "mb-4 text-base font-semibold text-text-primary",
139
140
  children: "Your Position"
140
- }), /* @__PURE__ */ T("div", {
141
+ }), /* @__PURE__ */ w("div", {
141
142
  className: "grid grid-cols-2 gap-4 lg:grid-cols-4",
142
143
  children: [
143
- /* @__PURE__ */ w(l, {
144
+ /* @__PURE__ */ C(u, {
144
145
  label: "Your Investment",
145
- value: o(F.investedAmount, { minimumFractionDigits: 0 }),
146
- icon: /* @__PURE__ */ w(m, { className: "h-4 w-4" })
146
+ value: s(F.investedAmount, { minimumFractionDigits: 0 }),
147
+ icon: /* @__PURE__ */ C(g, { className: "h-4 w-4" })
147
148
  }),
148
- /* @__PURE__ */ w(l, {
149
+ /* @__PURE__ */ C(u, {
149
150
  label: "Current Value",
150
- value: o(F.currentValue, { minimumFractionDigits: 0 }),
151
- icon: /* @__PURE__ */ w(x, { className: "h-4 w-4" })
151
+ value: s(F.currentValue, { minimumFractionDigits: 0 }),
152
+ icon: /* @__PURE__ */ C(b, { className: "h-4 w-4" })
152
153
  }),
153
- /* @__PURE__ */ w(l, {
154
+ /* @__PURE__ */ C(u, {
154
155
  label: "Returns",
155
156
  value: `${Q >= 0 ? "+" : ""}${Q.toFixed(1)}%`,
156
157
  delta: Number(Q.toFixed(1)),
157
158
  deltaLabel: "on invested",
158
- icon: /* @__PURE__ */ w(x, { className: "h-4 w-4" })
159
+ icon: /* @__PURE__ */ C(b, { className: "h-4 w-4" })
159
160
  }),
160
- /* @__PURE__ */ w(l, {
161
+ /* @__PURE__ */ C(u, {
161
162
  label: "Realised Returns",
162
- value: o(F.returns, { minimumFractionDigits: 0 }),
163
- icon: /* @__PURE__ */ w(g, { className: "h-4 w-4" })
163
+ value: s(F.returns, { minimumFractionDigits: 0 }),
164
+ icon: /* @__PURE__ */ C(v, { className: "h-4 w-4" })
164
165
  })
165
166
  ]
166
167
  })] }),
167
- /* @__PURE__ */ T("div", {
168
+ /* @__PURE__ */ w("div", {
168
169
  className: "mt-6 grid gap-6 lg:grid-cols-3",
169
- children: [/* @__PURE__ */ T("div", {
170
+ children: [/* @__PURE__ */ w("div", {
170
171
  className: "space-y-6 lg:col-span-2",
171
172
  children: [
172
- I && /* @__PURE__ */ T(E, {
173
+ I && /* @__PURE__ */ w(E, {
173
174
  treatment: "glass",
174
175
  className: "p-5 sm:p-6",
175
- children: [/* @__PURE__ */ T("div", {
176
+ children: [/* @__PURE__ */ w("div", {
176
177
  className: "flex flex-wrap items-start justify-between gap-3",
177
- children: [/* @__PURE__ */ T("div", {
178
+ children: [/* @__PURE__ */ w("div", {
178
179
  className: "min-w-0",
179
- children: [/* @__PURE__ */ w("p", {
180
+ children: [/* @__PURE__ */ C("p", {
180
181
  className: "text-sm text-text-secondary",
181
182
  children: I.businessOwner
182
- }), /* @__PURE__ */ w("h2", {
183
+ }), /* @__PURE__ */ C("h2", {
183
184
  className: "mt-0.5 text-xl font-bold tracking-tight text-text-primary sm:text-2xl",
184
185
  children: I.cartName
185
186
  })]
186
- }), Y && /* @__PURE__ */ T("span", {
187
+ }), Y && /* @__PURE__ */ w("span", {
187
188
  className: t("inline-flex items-center gap-1.5 rounded-full border px-3 py-1 text-sm font-semibold", Y.badge),
188
- children: [/* @__PURE__ */ w(_, { className: "h-4 w-4" }), Y.label]
189
+ children: [/* @__PURE__ */ C(y, { className: "h-4 w-4" }), Y.label]
189
190
  })]
190
- }), I.description && /* @__PURE__ */ w("p", {
191
+ }), I.description && /* @__PURE__ */ C("p", {
191
192
  className: "mt-4 text-sm leading-relaxed text-text-secondary",
192
193
  children: I.description
193
194
  })]
194
195
  }),
195
- L && /* @__PURE__ */ T("section", { children: [/* @__PURE__ */ w("h3", {
196
+ L && /* @__PURE__ */ w("section", { children: [/* @__PURE__ */ C("h3", {
196
197
  className: "mb-3 text-lg font-semibold text-text-primary",
197
198
  children: "Business Metrics"
198
- }), /* @__PURE__ */ T("div", {
199
+ }), /* @__PURE__ */ w("div", {
199
200
  className: "grid grid-cols-2 gap-3 sm:grid-cols-4 sm:gap-4",
200
201
  children: [
201
- /* @__PURE__ */ w(l, {
202
+ /* @__PURE__ */ C(u, {
202
203
  label: "Rating",
203
204
  value: L.rating > 0 ? L.rating.toFixed(1) : "—",
204
- icon: /* @__PURE__ */ w(v, { className: "h-4 w-4" })
205
+ icon: /* @__PURE__ */ C(ae, { className: "h-4 w-4" })
205
206
  }),
206
- /* @__PURE__ */ w(l, {
207
+ /* @__PURE__ */ C(u, {
207
208
  label: "Reviews",
208
209
  value: L.totalRatings.toLocaleString("en-IN"),
209
- icon: /* @__PURE__ */ w(h, { className: "h-4 w-4" })
210
+ icon: /* @__PURE__ */ C(_, { className: "h-4 w-4" })
210
211
  }),
211
- /* @__PURE__ */ w(l, {
212
+ /* @__PURE__ */ C(u, {
212
213
  label: "Avg Order",
213
- value: L.averageOrderValue ? o(L.averageOrderValue, { minimumFractionDigits: 0 }) : "—",
214
- icon: /* @__PURE__ */ w(g, { className: "h-4 w-4" })
214
+ value: L.averageOrderValue ? s(L.averageOrderValue, { minimumFractionDigits: 0 }) : "—",
215
+ icon: /* @__PURE__ */ C(v, { className: "h-4 w-4" })
215
216
  }),
216
- /* @__PURE__ */ w(l, {
217
+ /* @__PURE__ */ C(u, {
217
218
  label: "Category",
218
- value: /* @__PURE__ */ w("span", {
219
+ value: /* @__PURE__ */ C("span", {
219
220
  className: "text-lg font-semibold capitalize",
220
221
  children: L.category || "—"
221
222
  }),
222
- icon: /* @__PURE__ */ w(y, { className: "h-4 w-4" })
223
+ icon: /* @__PURE__ */ C(oe, { className: "h-4 w-4" })
223
224
  })
224
225
  ]
225
226
  })] }),
226
- I && /* @__PURE__ */ T(E, {
227
+ I && /* @__PURE__ */ w(E, {
227
228
  treatment: "plain",
228
229
  className: "p-5 sm:p-6",
229
- children: [/* @__PURE__ */ w("h3", {
230
+ children: [/* @__PURE__ */ C("h3", {
230
231
  className: "mb-4 text-lg font-semibold text-text-primary",
231
232
  children: "Funding Progress"
232
- }), /* @__PURE__ */ T("div", {
233
+ }), /* @__PURE__ */ w("div", {
233
234
  className: "flex flex-col items-center gap-6 sm:flex-row sm:gap-8",
234
- children: [/* @__PURE__ */ w(c, {
235
+ children: [/* @__PURE__ */ C(l, {
235
236
  value: X,
236
237
  size: 140,
237
238
  label: `${X.toFixed(0)}%`,
238
239
  caption: "funded"
239
- }), /* @__PURE__ */ T("div", {
240
+ }), /* @__PURE__ */ w("div", {
240
241
  className: "w-full flex-1 space-y-4",
241
- children: [/* @__PURE__ */ T("div", { children: [/* @__PURE__ */ T("div", {
242
+ children: [/* @__PURE__ */ w("div", { children: [/* @__PURE__ */ w("div", {
242
243
  className: "flex items-baseline justify-between",
243
- children: [/* @__PURE__ */ w("span", {
244
+ children: [/* @__PURE__ */ C("span", {
244
245
  className: "text-2xl font-bold text-text-primary",
245
- children: o(I.raisedAmount, { minimumFractionDigits: 0 })
246
- }), /* @__PURE__ */ T("span", {
246
+ children: s(I.raisedAmount, { minimumFractionDigits: 0 })
247
+ }), /* @__PURE__ */ w("span", {
247
248
  className: "text-sm text-text-secondary",
248
- children: ["of ", o(I.targetAmount, { minimumFractionDigits: 0 })]
249
+ children: ["of ", s(I.targetAmount, { minimumFractionDigits: 0 })]
249
250
  })]
250
- }), /* @__PURE__ */ w("p", {
251
+ }), /* @__PURE__ */ C("p", {
251
252
  className: "mt-1 text-sm text-text-secondary",
252
253
  children: "raised so far"
253
- })] }), /* @__PURE__ */ T("div", {
254
+ })] }), /* @__PURE__ */ w("div", {
254
255
  className: "grid grid-cols-3 gap-3 border-t border-border-subtle pt-4 text-center",
255
256
  children: [
256
- /* @__PURE__ */ T("div", { children: [/* @__PURE__ */ w("p", {
257
+ /* @__PURE__ */ w("div", { children: [/* @__PURE__ */ C("p", {
257
258
  className: "text-base font-bold text-text-primary sm:text-lg",
258
259
  children: I.investors.length
259
- }), /* @__PURE__ */ w("p", {
260
+ }), /* @__PURE__ */ C("p", {
260
261
  className: "text-xs text-text-secondary",
261
262
  children: "Investors"
262
263
  })] }),
263
- /* @__PURE__ */ T("div", { children: [/* @__PURE__ */ w("p", {
264
+ /* @__PURE__ */ w("div", { children: [/* @__PURE__ */ C("p", {
264
265
  className: "text-base font-bold text-text-primary sm:text-lg",
265
- children: o(W, {
266
+ children: s(G, {
266
267
  minimumFractionDigits: 0,
267
268
  notation: "compact"
268
269
  })
269
- }), /* @__PURE__ */ w("p", {
270
+ }), /* @__PURE__ */ C("p", {
270
271
  className: "text-xs text-text-secondary",
271
272
  children: "To Go"
272
273
  })] }),
273
- /* @__PURE__ */ T("div", { children: [/* @__PURE__ */ w("p", {
274
+ /* @__PURE__ */ w("div", { children: [/* @__PURE__ */ C("p", {
274
275
  className: "text-base font-bold text-text-primary sm:text-lg",
275
276
  children: Z === null ? "—" : `${Z}`
276
- }), /* @__PURE__ */ w("p", {
277
+ }), /* @__PURE__ */ C("p", {
277
278
  className: "text-xs text-text-secondary",
278
279
  children: "Days Left"
279
280
  })] })
@@ -282,42 +283,42 @@ function D() {
282
283
  })]
283
284
  })]
284
285
  }),
285
- F && /* @__PURE__ */ T(E, {
286
+ F && /* @__PURE__ */ w(E, {
286
287
  treatment: "plain",
287
288
  className: "p-5 sm:p-6",
288
- children: [/* @__PURE__ */ w("h3", {
289
+ children: [/* @__PURE__ */ C("h3", {
289
290
  className: "mb-4 text-lg font-semibold text-text-primary",
290
291
  children: "Your Holding"
291
- }), /* @__PURE__ */ T("div", {
292
+ }), /* @__PURE__ */ w("div", {
292
293
  className: "grid gap-4 sm:grid-cols-2",
293
294
  children: [
294
- /* @__PURE__ */ T("div", { children: [/* @__PURE__ */ w("p", {
295
+ /* @__PURE__ */ w("div", { children: [/* @__PURE__ */ C("p", {
295
296
  className: "text-sm text-text-secondary",
296
297
  children: "Invested Amount"
297
- }), /* @__PURE__ */ w("p", {
298
+ }), /* @__PURE__ */ C("p", {
298
299
  className: "font-medium text-text-primary",
299
- children: o(F.investedAmount, { minimumFractionDigits: 0 })
300
+ children: s(F.investedAmount, { minimumFractionDigits: 0 })
300
301
  })] }),
301
- /* @__PURE__ */ T("div", { children: [/* @__PURE__ */ w("p", {
302
+ /* @__PURE__ */ w("div", { children: [/* @__PURE__ */ C("p", {
302
303
  className: "text-sm text-text-secondary",
303
304
  children: "Current Value"
304
- }), /* @__PURE__ */ w("p", {
305
+ }), /* @__PURE__ */ C("p", {
305
306
  className: "font-medium text-text-primary",
306
- children: o(F.currentValue, { minimumFractionDigits: 0 })
307
+ children: s(F.currentValue, { minimumFractionDigits: 0 })
307
308
  })] }),
308
- /* @__PURE__ */ T("div", { children: [/* @__PURE__ */ w("p", {
309
+ /* @__PURE__ */ w("div", { children: [/* @__PURE__ */ C("p", {
309
310
  className: "text-sm text-text-secondary",
310
311
  children: "Returns Realised"
311
- }), /* @__PURE__ */ w("p", {
312
+ }), /* @__PURE__ */ C("p", {
312
313
  className: "font-medium text-text-primary",
313
- children: o(F.returns, { minimumFractionDigits: 0 })
314
+ children: s(F.returns, { minimumFractionDigits: 0 })
314
315
  })] }),
315
- /* @__PURE__ */ T("div", { children: [/* @__PURE__ */ w("p", {
316
+ /* @__PURE__ */ w("div", { children: [/* @__PURE__ */ C("p", {
316
317
  className: "text-sm text-text-secondary",
317
318
  children: "Invested On"
318
- }), /* @__PURE__ */ w("p", {
319
+ }), /* @__PURE__ */ C("p", {
319
320
  className: "font-medium text-text-primary",
320
- children: ne(F.investmentDate, {
321
+ children: te(F.investmentDate, {
321
322
  hour: void 0,
322
323
  minute: void 0
323
324
  })
@@ -326,115 +327,119 @@ function D() {
326
327
  })]
327
328
  })
328
329
  ]
329
- }), /* @__PURE__ */ w("div", {
330
+ }), /* @__PURE__ */ C("div", {
330
331
  className: "space-y-6",
331
- children: /* @__PURE__ */ w("div", {
332
+ children: /* @__PURE__ */ C("div", {
332
333
  className: "lg:sticky lg:top-6",
333
- children: /* @__PURE__ */ T(E, {
334
+ children: /* @__PURE__ */ w(E, {
334
335
  treatment: "glass",
335
336
  glow: !0,
336
337
  className: "p-5 sm:p-6",
337
338
  children: [
338
- /* @__PURE__ */ w("h3", {
339
+ /* @__PURE__ */ C("h3", {
339
340
  className: "mb-4 text-lg font-semibold text-text-primary",
340
341
  children: $ ? "Invest" : "Investment Terms"
341
342
  }),
342
- /* @__PURE__ */ T("div", {
343
+ /* @__PURE__ */ w("div", {
343
344
  className: "space-y-3",
344
345
  children: [
345
- /* @__PURE__ */ T("div", {
346
+ /* @__PURE__ */ w("div", {
346
347
  className: "flex items-center justify-between",
347
- children: [/* @__PURE__ */ T("span", {
348
+ children: [/* @__PURE__ */ w("span", {
348
349
  className: "flex items-center gap-2 text-sm text-text-secondary",
349
- children: [/* @__PURE__ */ w(x, { className: "h-4 w-4" }), "Expected returns"]
350
- }), /* @__PURE__ */ T("span", {
350
+ children: [/* @__PURE__ */ C(b, { className: "h-4 w-4" }), "Expected returns"]
351
+ }), /* @__PURE__ */ w("span", {
351
352
  className: "font-semibold text-status-success-text",
352
353
  children: [I?.expectedReturns ?? F?.returnsPercentage, "% p.a."]
353
354
  })]
354
355
  }),
355
- /* @__PURE__ */ T("div", {
356
+ /* @__PURE__ */ w("div", {
356
357
  className: "flex items-center justify-between",
357
- children: [/* @__PURE__ */ T("span", {
358
+ children: [/* @__PURE__ */ w("span", {
358
359
  className: "flex items-center gap-2 text-sm text-text-secondary",
359
- children: [/* @__PURE__ */ w(ie, { className: "h-4 w-4" }), "Lock-in"]
360
- }), /* @__PURE__ */ T("span", {
360
+ children: [/* @__PURE__ */ C(ie, { className: "h-4 w-4" }), "Lock-in"]
361
+ }), /* @__PURE__ */ w("span", {
361
362
  className: "font-semibold text-text-primary",
362
363
  children: [I?.investmentPeriod ?? "—", " months"]
363
364
  })]
364
365
  }),
365
- I && /* @__PURE__ */ T("div", {
366
+ I && /* @__PURE__ */ w("div", {
366
367
  className: "flex items-center justify-between",
367
- children: [/* @__PURE__ */ T("span", {
368
+ children: [/* @__PURE__ */ w("span", {
368
369
  className: "flex items-center gap-2 text-sm text-text-secondary",
369
- children: [/* @__PURE__ */ w(m, { className: "h-4 w-4" }), "Minimum"]
370
- }), /* @__PURE__ */ w("span", {
370
+ children: [/* @__PURE__ */ C(g, { className: "h-4 w-4" }), "Minimum"]
371
+ }), /* @__PURE__ */ C("span", {
371
372
  className: "font-semibold text-text-primary",
372
- children: o(I.minimumInvestment, { minimumFractionDigits: 0 })
373
+ children: s(I.minimumInvestment, { minimumFractionDigits: 0 })
373
374
  })]
374
375
  }),
375
- I && I.investors.length > 0 && /* @__PURE__ */ T("div", {
376
+ I && I.investors.length > 0 && /* @__PURE__ */ w("div", {
376
377
  className: "flex items-center justify-between",
377
- children: [/* @__PURE__ */ T("span", {
378
+ children: [/* @__PURE__ */ w("span", {
378
379
  className: "flex items-center gap-2 text-sm text-text-secondary",
379
- children: [/* @__PURE__ */ w(S, { className: "h-4 w-4" }), "Investors"]
380
- }), /* @__PURE__ */ w("span", {
380
+ children: [/* @__PURE__ */ C(x, { className: "h-4 w-4" }), "Investors"]
381
+ }), /* @__PURE__ */ C("span", {
381
382
  className: "font-semibold text-text-primary",
382
383
  children: I.investors.length
383
384
  })]
384
385
  })
385
386
  ]
386
387
  }),
387
- $ && V !== "success" && /* @__PURE__ */ T("div", {
388
+ $ && H !== "success" && !z && /* @__PURE__ */ C("div", {
389
+ className: "mt-5 border-t border-border-subtle pt-5",
390
+ children: /* @__PURE__ */ C(d, {})
391
+ }),
392
+ $ && H !== "success" && z && /* @__PURE__ */ w("div", {
388
393
  className: "mt-5 space-y-4 border-t border-border-subtle pt-5",
389
394
  children: [
390
- /* @__PURE__ */ T("div", { children: [
391
- /* @__PURE__ */ w("label", {
395
+ /* @__PURE__ */ w("div", { children: [
396
+ /* @__PURE__ */ C("label", {
392
397
  htmlFor: "invest-amount",
393
398
  className: "mb-1.5 block text-sm font-medium text-text-primary",
394
399
  children: "Amount"
395
400
  }),
396
- /* @__PURE__ */ T("div", {
401
+ /* @__PURE__ */ w("div", {
397
402
  className: "relative",
398
- children: [/* @__PURE__ */ w(m, { className: "absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-text-secondary" }), /* @__PURE__ */ w("input", {
403
+ children: [/* @__PURE__ */ C(g, { className: "absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-text-secondary" }), /* @__PURE__ */ C("input", {
399
404
  id: "invest-amount",
400
405
  type: "number",
401
406
  inputMode: "numeric",
402
- value: z,
407
+ value: B,
403
408
  onChange: (e) => {
404
- B(e.target.value), H("idle");
409
+ V(e.target.value), U("idle");
405
410
  },
406
- placeholder: String(U),
411
+ placeholder: String(W),
407
412
  className: "w-full rounded-lg border border-border-subtle bg-bg-surface py-2.5 pl-9 pr-3 text-base font-semibold text-text-primary placeholder:font-normal placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]"
408
413
  })]
409
414
  }),
410
- /* @__PURE__ */ T("p", {
415
+ /* @__PURE__ */ w("p", {
411
416
  className: "mt-1.5 text-xs text-text-secondary",
412
417
  children: [
413
- o(U, { minimumFractionDigits: 0 }),
418
+ s(W, { minimumFractionDigits: 0 }),
414
419
  " –",
415
420
  " ",
416
- o(G, { minimumFractionDigits: 0 })
421
+ s(K, { minimumFractionDigits: 0 })
417
422
  ]
418
423
  }),
419
- V === "error" && /* @__PURE__ */ T("p", {
424
+ H === "error" && /* @__PURE__ */ w("p", {
420
425
  className: "mt-1 text-xs text-status-error-text",
421
426
  children: [
422
427
  "Enter an amount between",
423
428
  " ",
424
- o(U, { minimumFractionDigits: 0 }),
429
+ s(W, { minimumFractionDigits: 0 }),
425
430
  " and",
426
431
  " ",
427
- o(G, { minimumFractionDigits: 0 }),
432
+ s(K, { minimumFractionDigits: 0 }),
428
433
  "."
429
434
  ]
430
435
  })
431
436
  ] }),
432
- /* @__PURE__ */ T("div", { children: [
433
- /* @__PURE__ */ w("p", {
437
+ /* @__PURE__ */ w("div", { children: [
438
+ /* @__PURE__ */ C("p", {
434
439
  className: "mb-1 text-sm font-medium text-text-primary",
435
440
  children: "Projected returns"
436
441
  }),
437
- /* @__PURE__ */ T("p", {
442
+ /* @__PURE__ */ w("p", {
438
443
  className: "mb-2 text-xs text-text-muted",
439
444
  children: [
440
445
  "Forecast at ",
@@ -445,50 +450,50 @@ function D() {
445
450
  " months"
446
451
  ]
447
452
  }),
448
- /* @__PURE__ */ w(s, {
449
- series: J,
453
+ /* @__PURE__ */ C(c, {
454
+ series: fe,
450
455
  height: 140,
451
- valueFormatter: ce,
456
+ valueFormatter: ue,
452
457
  title: "Projected value over the lock-in period"
453
458
  }),
454
- q && /* @__PURE__ */ T("div", {
459
+ J && /* @__PURE__ */ w("div", {
455
460
  className: "mt-2 flex items-center justify-between rounded-lg bg-bg-sunken/60 px-3 py-2 text-sm",
456
- children: [/* @__PURE__ */ w("span", {
461
+ children: [/* @__PURE__ */ C("span", {
457
462
  className: "text-text-secondary",
458
463
  children: "Projected value"
459
- }), /* @__PURE__ */ w("span", {
464
+ }), /* @__PURE__ */ C("span", {
460
465
  className: "font-semibold text-status-success-text",
461
- children: o(K * (1 + (I?.expectedReturns ?? 0) / 100), { minimumFractionDigits: 0 })
466
+ children: s(q * (1 + (I?.expectedReturns ?? 0) / 100), { minimumFractionDigits: 0 })
462
467
  })]
463
468
  })
464
469
  ] }),
465
- /* @__PURE__ */ w("button", {
470
+ /* @__PURE__ */ C("button", {
466
471
  type: "button",
467
- onClick: le,
468
- disabled: !q || R.isPending,
469
- className: t("flex w-full items-center justify-center gap-2 rounded-lg px-4 py-3 text-sm font-semibold transition-colors", q && !R.isPending ? "bg-action-primary-bg text-action-primary-text hover:bg-action-primary-bg-hover" : "cursor-not-allowed bg-bg-sunken text-text-secondary"),
472
+ onClick: de,
473
+ disabled: !J || R.isPending,
474
+ className: t("flex w-full items-center justify-center gap-2 rounded-lg px-4 py-3 text-sm font-semibold transition-colors", J && !R.isPending ? "bg-action-primary-bg text-action-primary-text hover:bg-action-primary-bg-hover" : "cursor-not-allowed bg-bg-sunken text-text-secondary"),
470
475
  children: R.isPending ? "Processing…" : "Invest Now"
471
476
  })
472
477
  ]
473
478
  }),
474
- V === "success" && /* @__PURE__ */ T("div", {
479
+ H === "success" && /* @__PURE__ */ w("div", {
475
480
  className: "mt-5 border-t border-border-subtle pt-5 text-center",
476
481
  children: [
477
- /* @__PURE__ */ w(p, { className: "mx-auto mb-2 h-10 w-10 text-status-success-text" }),
478
- /* @__PURE__ */ w("p", {
482
+ /* @__PURE__ */ C(re, { className: "mx-auto mb-2 h-10 w-10 text-status-success-text" }),
483
+ /* @__PURE__ */ C("p", {
479
484
  className: "text-sm font-medium text-text-primary",
480
485
  children: "Investment successful!"
481
486
  }),
482
- /* @__PURE__ */ w("p", {
487
+ /* @__PURE__ */ C("p", {
483
488
  className: "mt-1 text-xs text-text-secondary",
484
489
  children: "Redirecting to your portfolio…"
485
490
  })
486
491
  ]
487
492
  }),
488
- !$ && !F && I && /* @__PURE__ */ T("div", {
493
+ !$ && !F && I && /* @__PURE__ */ w("div", {
489
494
  className: "mt-5 flex items-center gap-2 rounded-lg border border-border-subtle bg-bg-sunken/50 p-3 text-sm text-text-secondary",
490
495
  children: [
491
- /* @__PURE__ */ w(b, { className: "h-4 w-4 shrink-0" }),
496
+ /* @__PURE__ */ C(se, { className: "h-4 w-4 shrink-0" }),
492
497
  "This opportunity is ",
493
498
  I.status,
494
499
  ". It's no longer accepting investments."