@argusoft/medplat-product-management 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/BrandsPage-DCMCVvDY.js +334 -0
- package/dist/BrandsPage-DCMCVvDY.js.map +1 -0
- package/dist/CategoriesPage-BpRhwfrc.js +284 -0
- package/dist/CategoriesPage-BpRhwfrc.js.map +1 -0
- package/dist/DashboardPage-BNKUQj46.js +436 -0
- package/dist/DashboardPage-BNKUQj46.js.map +1 -0
- package/dist/FacilityPicker-Coi8I3yE.js +79 -0
- package/dist/FacilityPicker-Coi8I3yE.js.map +1 -0
- package/dist/InventoryPage-BR6jOzg2.js +517 -0
- package/dist/InventoryPage-BR6jOzg2.js.map +1 -0
- package/dist/MemberProfileCard-DbHZCS5n.js +272 -0
- package/dist/MemberProfileCard-DbHZCS5n.js.map +1 -0
- package/dist/PaymentCreatePage-Ci3ERnby.js +487 -0
- package/dist/PaymentCreatePage-Ci3ERnby.js.map +1 -0
- package/dist/PaymentsPage-sdg902zX.js +157 -0
- package/dist/PaymentsPage-sdg902zX.js.map +1 -0
- package/dist/PickupCreatePage-CieMsgWV.js +310 -0
- package/dist/PickupCreatePage-CieMsgWV.js.map +1 -0
- package/dist/PickupsPage-Ci2Ll0Kn.js +566 -0
- package/dist/PickupsPage-Ci2Ll0Kn.js.map +1 -0
- package/dist/PmGuard-CjJBisaN.js +1195 -0
- package/dist/PmGuard-CjJBisaN.js.map +1 -0
- package/dist/PmTable-BuXZQZCU.js +302 -0
- package/dist/PmTable-BuXZQZCU.js.map +1 -0
- package/dist/ProductEditPage-DL8gy85Y.js +666 -0
- package/dist/ProductEditPage-DL8gy85Y.js.map +1 -0
- package/dist/ProductsPage-BANTKxLb.js +221 -0
- package/dist/ProductsPage-BANTKxLb.js.map +1 -0
- package/dist/PurchaseCreatePage-C3KMfBxJ.js +626 -0
- package/dist/PurchaseCreatePage-C3KMfBxJ.js.map +1 -0
- package/dist/PurchaseRequestDetailPage-C0GYFJDl.js +586 -0
- package/dist/PurchaseRequestDetailPage-C0GYFJDl.js.map +1 -0
- package/dist/PurchaseRequestsPage-DvFH_tWe.js +265 -0
- package/dist/PurchaseRequestsPage-DvFH_tWe.js.map +1 -0
- package/dist/PurchasesPage-BCvLvSp4.js +295 -0
- package/dist/PurchasesPage-BCvLvSp4.js.map +1 -0
- package/dist/SaleCreatePage-DpkQMoTq.js +548 -0
- package/dist/SaleCreatePage-DpkQMoTq.js.map +1 -0
- package/dist/SalesPage-DUwgkEO-.js +315 -0
- package/dist/SalesPage-DUwgkEO-.js.map +1 -0
- package/dist/SettingsPage-CusC0jqJ.js +710 -0
- package/dist/SettingsPage-CusC0jqJ.js.map +1 -0
- package/dist/StorageUnitsPage-BlC2AgrJ.js +469 -0
- package/dist/StorageUnitsPage-BlC2AgrJ.js.map +1 -0
- package/dist/TransactionsPage-DDaK4VyY.js +714 -0
- package/dist/TransactionsPage-DDaK4VyY.js.map +1 -0
- package/dist/TransferCreatePage-BxudLfhS.js +363 -0
- package/dist/TransferCreatePage-BxudLfhS.js.map +1 -0
- package/dist/TransfersPage-zgmt7teZ.js +480 -0
- package/dist/TransfersPage-zgmt7teZ.js.map +1 -0
- package/dist/VialsPage-CjqPfgpV.js +855 -0
- package/dist/VialsPage-CjqPfgpV.js.map +1 -0
- package/dist/constants-BrA_hfAI.js +254 -0
- package/dist/constants-BrA_hfAI.js.map +1 -0
- package/dist/currency-BDDCDgeE.js +169 -0
- package/dist/currency-BDDCDgeE.js.map +1 -0
- package/dist/format-UOyOu75i.js +52 -0
- package/dist/format-UOyOu75i.js.map +1 -0
- package/dist/index.js +45 -0
- package/dist/index.js.map +1 -0
- package/dist/useFieldErrors-hDG8ox_x.js +29 -0
- package/dist/useFieldErrors-hDG8ox_x.js.map +1 -0
- package/dist/validation-Ba7puFIO.js +109 -0
- package/dist/validation-Ba7puFIO.js.map +1 -0
- package/package.json +36 -0
|
@@ -0,0 +1,272 @@
|
|
|
1
|
+
import { D as e, i as t } from "./PmGuard-CjJBisaN.js";
|
|
2
|
+
import { r as n } from "./format-UOyOu75i.js";
|
|
3
|
+
import { useEffect as r, useState as i } from "react";
|
|
4
|
+
import { Fragment as a, jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
5
|
+
import { Avatar as c, Box as l, Chip as u, LinearProgress as d, Stack as f, Typography as p } from "@mui/material";
|
|
6
|
+
import { alpha as m } from "@mui/material/styles";
|
|
7
|
+
import h from "@mui/icons-material/PaymentsRounded";
|
|
8
|
+
import g from "@mui/icons-material/LockOutlined";
|
|
9
|
+
import _ from "@mui/icons-material/BadgeRounded";
|
|
10
|
+
import v from "@mui/icons-material/GroupsRounded";
|
|
11
|
+
import y from "@mui/icons-material/CakeRounded";
|
|
12
|
+
//#region src/components/MemberProfileCard.jsx
|
|
13
|
+
function b(e) {
|
|
14
|
+
return e ? e.split(/\s+/).filter(Boolean).slice(0, 2).map((e) => e[0]).join("").toUpperCase() : "?";
|
|
15
|
+
}
|
|
16
|
+
function x(e) {
|
|
17
|
+
if (!e) return null;
|
|
18
|
+
let t = e instanceof Date ? e : new Date(e);
|
|
19
|
+
if (Number.isNaN(t.getTime())) return null;
|
|
20
|
+
let n = /* @__PURE__ */ new Date(), r = n.getFullYear() - t.getFullYear(), i = n.getMonth() - t.getMonth();
|
|
21
|
+
return (i < 0 || i === 0 && n.getDate() < t.getDate()) && --r, r >= 0 ? r : null;
|
|
22
|
+
}
|
|
23
|
+
function S({ memberId: S, previousDue: w = 0, currencySymbol: T = "", onLoad: E }) {
|
|
24
|
+
let D = t().has("view.manage.productManagement.member"), [O, k] = i(null), [A, j] = i(!1), [M, N] = i(!1);
|
|
25
|
+
if (r(() => {
|
|
26
|
+
if (!S) {
|
|
27
|
+
k(null), N(!1), j(!1);
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
if (!D) {
|
|
31
|
+
k(null), N(!1), j(!1);
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
let t = !1;
|
|
35
|
+
return j(!0), N(!1), (async () => {
|
|
36
|
+
try {
|
|
37
|
+
let n = await e(S);
|
|
38
|
+
if (t) return;
|
|
39
|
+
n ? (k(n), N(!1), E?.(n)) : (k(null), N(!0));
|
|
40
|
+
} catch {
|
|
41
|
+
t || (k(null), N(!0));
|
|
42
|
+
} finally {
|
|
43
|
+
t || j(!1);
|
|
44
|
+
}
|
|
45
|
+
})(), () => {
|
|
46
|
+
t = !0;
|
|
47
|
+
};
|
|
48
|
+
}, [S, D]), !D && S) return /* @__PURE__ */ o(l, {
|
|
49
|
+
sx: (e) => ({
|
|
50
|
+
p: 2,
|
|
51
|
+
borderRadius: 3,
|
|
52
|
+
border: `1px solid ${m(e.palette.warning.main, .4)}`,
|
|
53
|
+
bgcolor: m(e.palette.warning.main, .05)
|
|
54
|
+
}),
|
|
55
|
+
children: /* @__PURE__ */ s(f, {
|
|
56
|
+
direction: "row",
|
|
57
|
+
alignItems: "center",
|
|
58
|
+
spacing: 1.25,
|
|
59
|
+
children: [/* @__PURE__ */ o(g, {
|
|
60
|
+
fontSize: "small",
|
|
61
|
+
sx: { color: "warning.dark" }
|
|
62
|
+
}), /* @__PURE__ */ s(l, { children: [/* @__PURE__ */ o(p, {
|
|
63
|
+
variant: "body2",
|
|
64
|
+
sx: {
|
|
65
|
+
fontWeight: 700,
|
|
66
|
+
color: "warning.dark"
|
|
67
|
+
},
|
|
68
|
+
children: "Member details hidden"
|
|
69
|
+
}), /* @__PURE__ */ o(p, {
|
|
70
|
+
variant: "caption",
|
|
71
|
+
color: "text.secondary",
|
|
72
|
+
children: "You don’t have permission to view member profiles. Ask an admin to grant access if you need to see this customer’s details."
|
|
73
|
+
})] })]
|
|
74
|
+
})
|
|
75
|
+
});
|
|
76
|
+
if (A) return /* @__PURE__ */ s(l, {
|
|
77
|
+
sx: {
|
|
78
|
+
p: 2,
|
|
79
|
+
borderRadius: 3,
|
|
80
|
+
border: "1px solid",
|
|
81
|
+
borderColor: "divider"
|
|
82
|
+
},
|
|
83
|
+
children: [/* @__PURE__ */ o(d, {}), /* @__PURE__ */ o(p, {
|
|
84
|
+
variant: "caption",
|
|
85
|
+
color: "text.secondary",
|
|
86
|
+
sx: {
|
|
87
|
+
mt: 1,
|
|
88
|
+
display: "block"
|
|
89
|
+
},
|
|
90
|
+
children: "Loading member…"
|
|
91
|
+
})]
|
|
92
|
+
});
|
|
93
|
+
if (M) return /* @__PURE__ */ s(l, {
|
|
94
|
+
sx: (e) => ({
|
|
95
|
+
p: 2,
|
|
96
|
+
borderRadius: 3,
|
|
97
|
+
border: `1px solid ${m(e.palette.error.main, .4)}`,
|
|
98
|
+
bgcolor: m(e.palette.error.main, .05)
|
|
99
|
+
}),
|
|
100
|
+
children: [/* @__PURE__ */ o(p, {
|
|
101
|
+
variant: "body2",
|
|
102
|
+
sx: {
|
|
103
|
+
fontWeight: 700,
|
|
104
|
+
color: "error.dark"
|
|
105
|
+
},
|
|
106
|
+
children: "Member not found"
|
|
107
|
+
}), /* @__PURE__ */ o(p, {
|
|
108
|
+
variant: "caption",
|
|
109
|
+
color: "text.secondary",
|
|
110
|
+
children: "The id passed via the URL didn’t resolve in the configured member table, or the column mapping in Settings is incomplete."
|
|
111
|
+
})]
|
|
112
|
+
});
|
|
113
|
+
if (!O) return null;
|
|
114
|
+
let P = x(O.dob);
|
|
115
|
+
return /* @__PURE__ */ o(l, {
|
|
116
|
+
sx: (e) => ({
|
|
117
|
+
p: 2.5,
|
|
118
|
+
borderRadius: 3,
|
|
119
|
+
border: "1px solid",
|
|
120
|
+
borderColor: "divider",
|
|
121
|
+
background: `linear-gradient(135deg, ${m(e.palette.primary.main, .04)} 0%, ${e.palette.background.paper} 100%)`
|
|
122
|
+
}),
|
|
123
|
+
children: /* @__PURE__ */ s(f, {
|
|
124
|
+
direction: {
|
|
125
|
+
xs: "column",
|
|
126
|
+
md: "row"
|
|
127
|
+
},
|
|
128
|
+
alignItems: { md: "center" },
|
|
129
|
+
spacing: 2,
|
|
130
|
+
children: [
|
|
131
|
+
/* @__PURE__ */ o(c, {
|
|
132
|
+
sx: {
|
|
133
|
+
width: 56,
|
|
134
|
+
height: 56,
|
|
135
|
+
bgcolor: "primary.main",
|
|
136
|
+
fontWeight: 800,
|
|
137
|
+
fontSize: 18
|
|
138
|
+
},
|
|
139
|
+
children: b(O.name)
|
|
140
|
+
}),
|
|
141
|
+
/* @__PURE__ */ s(l, {
|
|
142
|
+
sx: {
|
|
143
|
+
flexGrow: 1,
|
|
144
|
+
minWidth: 0
|
|
145
|
+
},
|
|
146
|
+
children: [/* @__PURE__ */ o(p, {
|
|
147
|
+
variant: "h6",
|
|
148
|
+
sx: {
|
|
149
|
+
fontWeight: 800,
|
|
150
|
+
lineHeight: 1.2
|
|
151
|
+
},
|
|
152
|
+
children: O.name || /* @__PURE__ */ o(p, {
|
|
153
|
+
component: "span",
|
|
154
|
+
variant: "caption",
|
|
155
|
+
color: "text.disabled",
|
|
156
|
+
children: "No name configured"
|
|
157
|
+
})
|
|
158
|
+
}), /* @__PURE__ */ s(f, {
|
|
159
|
+
direction: "row",
|
|
160
|
+
flexWrap: "wrap",
|
|
161
|
+
useFlexGap: !0,
|
|
162
|
+
spacing: 1.25,
|
|
163
|
+
sx: { mt: 1 },
|
|
164
|
+
children: [
|
|
165
|
+
O.identifier ? /* @__PURE__ */ o(C, {
|
|
166
|
+
icon: /* @__PURE__ */ o(_, { fontSize: "small" }),
|
|
167
|
+
label: "Identifier",
|
|
168
|
+
value: O.identifier
|
|
169
|
+
}) : null,
|
|
170
|
+
O.familyId ? /* @__PURE__ */ o(C, {
|
|
171
|
+
icon: /* @__PURE__ */ o(v, { fontSize: "small" }),
|
|
172
|
+
label: "Family ID",
|
|
173
|
+
value: O.familyId
|
|
174
|
+
}) : null,
|
|
175
|
+
P == null ? null : /* @__PURE__ */ o(C, {
|
|
176
|
+
icon: /* @__PURE__ */ o(y, { fontSize: "small" }),
|
|
177
|
+
label: "Age",
|
|
178
|
+
value: `${P} ${P === 1 ? "year" : "years"}`
|
|
179
|
+
})
|
|
180
|
+
]
|
|
181
|
+
})]
|
|
182
|
+
}),
|
|
183
|
+
/* @__PURE__ */ o(l, {
|
|
184
|
+
sx: {
|
|
185
|
+
minWidth: 160,
|
|
186
|
+
textAlign: {
|
|
187
|
+
xs: "left",
|
|
188
|
+
md: "right"
|
|
189
|
+
}
|
|
190
|
+
},
|
|
191
|
+
children: w > 0 ? /* @__PURE__ */ s(a, { children: [/* @__PURE__ */ s(f, {
|
|
192
|
+
direction: "row",
|
|
193
|
+
alignItems: "center",
|
|
194
|
+
spacing: .75,
|
|
195
|
+
justifyContent: {
|
|
196
|
+
xs: "flex-start",
|
|
197
|
+
md: "flex-end"
|
|
198
|
+
},
|
|
199
|
+
sx: { color: "text.secondary" },
|
|
200
|
+
children: [/* @__PURE__ */ o(h, { fontSize: "small" }), /* @__PURE__ */ o(p, {
|
|
201
|
+
variant: "caption",
|
|
202
|
+
sx: {
|
|
203
|
+
fontWeight: 700,
|
|
204
|
+
letterSpacing: .6,
|
|
205
|
+
textTransform: "uppercase"
|
|
206
|
+
},
|
|
207
|
+
children: "Outstanding"
|
|
208
|
+
})]
|
|
209
|
+
}), /* @__PURE__ */ s(p, {
|
|
210
|
+
variant: "h5",
|
|
211
|
+
sx: {
|
|
212
|
+
fontWeight: 800,
|
|
213
|
+
color: "warning.dark",
|
|
214
|
+
fontVariantNumeric: "tabular-nums"
|
|
215
|
+
},
|
|
216
|
+
children: [T, n(w)]
|
|
217
|
+
})] }) : /* @__PURE__ */ o(u, {
|
|
218
|
+
size: "small",
|
|
219
|
+
color: "success",
|
|
220
|
+
label: "No outstanding dues",
|
|
221
|
+
sx: { fontWeight: 700 }
|
|
222
|
+
})
|
|
223
|
+
})
|
|
224
|
+
]
|
|
225
|
+
})
|
|
226
|
+
});
|
|
227
|
+
}
|
|
228
|
+
function C({ icon: e, label: t, value: n }) {
|
|
229
|
+
return /* @__PURE__ */ s(l, {
|
|
230
|
+
sx: (e) => ({
|
|
231
|
+
display: "inline-flex",
|
|
232
|
+
alignItems: "center",
|
|
233
|
+
gap: .75,
|
|
234
|
+
px: 1,
|
|
235
|
+
py: .4,
|
|
236
|
+
borderRadius: 1.5,
|
|
237
|
+
bgcolor: m(e.palette.primary.main, .06),
|
|
238
|
+
border: `1px solid ${m(e.palette.primary.main, .16)}`,
|
|
239
|
+
color: "text.primary"
|
|
240
|
+
}),
|
|
241
|
+
children: [
|
|
242
|
+
/* @__PURE__ */ o(l, {
|
|
243
|
+
sx: {
|
|
244
|
+
display: "flex",
|
|
245
|
+
color: "text.secondary"
|
|
246
|
+
},
|
|
247
|
+
children: e
|
|
248
|
+
}),
|
|
249
|
+
/* @__PURE__ */ o(p, {
|
|
250
|
+
component: "span",
|
|
251
|
+
variant: "caption",
|
|
252
|
+
color: "text.secondary",
|
|
253
|
+
sx: {
|
|
254
|
+
fontWeight: 700,
|
|
255
|
+
letterSpacing: .4,
|
|
256
|
+
textTransform: "uppercase"
|
|
257
|
+
},
|
|
258
|
+
children: t
|
|
259
|
+
}),
|
|
260
|
+
/* @__PURE__ */ o(p, {
|
|
261
|
+
component: "span",
|
|
262
|
+
variant: "body2",
|
|
263
|
+
sx: { fontWeight: 700 },
|
|
264
|
+
children: n
|
|
265
|
+
})
|
|
266
|
+
]
|
|
267
|
+
});
|
|
268
|
+
}
|
|
269
|
+
//#endregion
|
|
270
|
+
export { S as t };
|
|
271
|
+
|
|
272
|
+
//# sourceMappingURL=MemberProfileCard-DbHZCS5n.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MemberProfileCard-DbHZCS5n.js","names":[],"sources":["../src/components/MemberProfileCard.jsx"],"sourcesContent":["import { useEffect, useState } from 'react';\nimport { Avatar, Box, Chip, LinearProgress, Stack, Typography } from '@mui/material';\nimport { alpha } from '@mui/material/styles';\nimport BadgeRoundedIcon from '@mui/icons-material/BadgeRounded';\nimport GroupsRoundedIcon from '@mui/icons-material/GroupsRounded';\nimport CakeRoundedIcon from '@mui/icons-material/CakeRounded';\nimport PaymentsRoundedIcon from '@mui/icons-material/PaymentsRounded';\nimport LockOutlinedIcon from '@mui/icons-material/LockOutlined';\nimport { getMemberProfile } from '@pm/services/pmApi';\nimport { formatNumber } from '@pm/utils/format';\nimport { usePmPermissions } from '@pm/utils/permissions';\n\nfunction initials(name) {\n if (!name) return '?';\n return name.split(/\\s+/).filter(Boolean).slice(0, 2).map((s) => s[0]).join('').toUpperCase();\n}\n\n// Whole-year age from DOB (string or Date). Returns null when DOB is unset.\nfunction computeAge(dob) {\n if (!dob) return null;\n const birth = dob instanceof Date ? dob : new Date(dob);\n if (Number.isNaN(birth.getTime())) return null;\n const today = new Date();\n let age = today.getFullYear() - birth.getFullYear();\n const m = today.getMonth() - birth.getMonth();\n if (m < 0 || (m === 0 && today.getDate() < birth.getDate())) age -= 1;\n return age >= 0 ? age : null;\n}\n\n// Profile card for Sales / Payments. Receives the memberId and fetches the\n// profile + computes age inline. Outstanding dues are passed in by the\n// caller because the dues query is separate and the caller often has it\n// loaded already.\nexport default function MemberProfileCard({\n memberId,\n previousDue = 0,\n currencySymbol = '',\n onLoad,\n}) {\n const perms = usePmPermissions();\n const canSeeMember = perms.has('view.manage.productManagement.member');\n const [profile, setProfile] = useState(null);\n const [loading, setLoading] = useState(false);\n const [missing, setMissing] = useState(false);\n\n useEffect(() => {\n if (!memberId) {\n setProfile(null);\n setMissing(false);\n setLoading(false);\n return undefined;\n }\n if (!canSeeMember) {\n // No access — don't fire the /members/{id} call, the filter would 403.\n // The card renders a friendly \"no access\" panel below.\n setProfile(null);\n setMissing(false);\n setLoading(false);\n return undefined;\n }\n let cancelled = false;\n setLoading(true);\n setMissing(false);\n (async () => {\n try {\n const data = await getMemberProfile(memberId);\n if (cancelled) return;\n if (!data) {\n setProfile(null);\n setMissing(true);\n } else {\n setProfile(data);\n setMissing(false);\n onLoad?.(data);\n }\n } catch {\n if (!cancelled) {\n setProfile(null);\n setMissing(true);\n }\n } finally {\n if (!cancelled) setLoading(false);\n }\n })();\n return () => { cancelled = true; };\n // onLoad is intentionally excluded; passing a fresh function each render\n // shouldn't re-fire the fetch. The caller should memoize if needed.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [memberId, canSeeMember]);\n\n if (!canSeeMember && memberId) {\n return (\n <Box sx={(theme) => ({\n p: 2,\n borderRadius: 3,\n border: `1px solid ${alpha(theme.palette.warning.main, 0.4)}`,\n bgcolor: alpha(theme.palette.warning.main, 0.05),\n })}>\n <Stack direction=\"row\" alignItems=\"center\" spacing={1.25}>\n <LockOutlinedIcon fontSize=\"small\" sx={{ color: 'warning.dark' }} />\n <Box>\n <Typography variant=\"body2\" sx={{ fontWeight: 700, color: 'warning.dark' }}>\n Member details hidden\n </Typography>\n <Typography variant=\"caption\" color=\"text.secondary\">\n You don’t have permission to view member profiles. Ask an admin\n to grant access if you need to see this customer’s details.\n </Typography>\n </Box>\n </Stack>\n </Box>\n );\n }\n\n if (loading) {\n return (\n <Box sx={{ p: 2, borderRadius: 3, border: '1px solid', borderColor: 'divider' }}>\n <LinearProgress />\n <Typography variant=\"caption\" color=\"text.secondary\" sx={{ mt: 1, display: 'block' }}>\n Loading member…\n </Typography>\n </Box>\n );\n }\n\n if (missing) {\n return (\n <Box sx={(theme) => ({\n p: 2,\n borderRadius: 3,\n border: `1px solid ${alpha(theme.palette.error.main, 0.4)}`,\n bgcolor: alpha(theme.palette.error.main, 0.05),\n })}>\n <Typography variant=\"body2\" sx={{ fontWeight: 700, color: 'error.dark' }}>\n Member not found\n </Typography>\n <Typography variant=\"caption\" color=\"text.secondary\">\n The id passed via the URL didn’t resolve in the configured member table, or the column mapping in Settings is incomplete.\n </Typography>\n </Box>\n );\n }\n\n if (!profile) return null;\n\n const age = computeAge(profile.dob);\n\n return (\n <Box\n sx={(theme) => ({\n p: 2.5,\n borderRadius: 3,\n border: '1px solid',\n borderColor: 'divider',\n background: `linear-gradient(135deg, ${alpha(theme.palette.primary.main, 0.04)} 0%, ${theme.palette.background.paper} 100%)`,\n })}\n >\n <Stack direction={{ xs: 'column', md: 'row' }} alignItems={{ md: 'center' }} spacing={2}>\n <Avatar sx={{ width: 56, height: 56, bgcolor: 'primary.main', fontWeight: 800, fontSize: 18 }}>\n {initials(profile.name)}\n </Avatar>\n <Box sx={{ flexGrow: 1, minWidth: 0 }}>\n <Typography variant=\"h6\" sx={{ fontWeight: 800, lineHeight: 1.2 }}>\n {profile.name || <Typography component=\"span\" variant=\"caption\" color=\"text.disabled\">No name configured</Typography>}\n </Typography>\n <Stack direction=\"row\" flexWrap=\"wrap\" useFlexGap spacing={1.25} sx={{ mt: 1 }}>\n {profile.identifier ? (\n <DetailChip icon={<BadgeRoundedIcon fontSize=\"small\" />} label=\"Identifier\" value={profile.identifier} />\n ) : null}\n {profile.familyId ? (\n <DetailChip icon={<GroupsRoundedIcon fontSize=\"small\" />} label=\"Family ID\" value={profile.familyId} />\n ) : null}\n {age != null ? (\n <DetailChip icon={<CakeRoundedIcon fontSize=\"small\" />} label=\"Age\" value={`${age} ${age === 1 ? 'year' : 'years'}`} />\n ) : null}\n </Stack>\n </Box>\n <Box sx={{ minWidth: 160, textAlign: { xs: 'left', md: 'right' } }}>\n {previousDue > 0 ? (\n <>\n <Stack direction=\"row\" alignItems=\"center\" spacing={0.75} justifyContent={{ xs: 'flex-start', md: 'flex-end' }} sx={{ color: 'text.secondary' }}>\n <PaymentsRoundedIcon fontSize=\"small\" />\n <Typography variant=\"caption\" sx={{ fontWeight: 700, letterSpacing: 0.6, textTransform: 'uppercase' }}>\n Outstanding\n </Typography>\n </Stack>\n <Typography variant=\"h5\" sx={{ fontWeight: 800, color: 'warning.dark', fontVariantNumeric: 'tabular-nums' }}>\n {currencySymbol}{formatNumber(previousDue)}\n </Typography>\n </>\n ) : (\n <Chip size=\"small\" color=\"success\" label=\"No outstanding dues\" sx={{ fontWeight: 700 }} />\n )}\n </Box>\n </Stack>\n </Box>\n );\n}\n\nfunction DetailChip({ icon, label, value }) {\n return (\n <Box\n sx={(theme) => ({\n display: 'inline-flex',\n alignItems: 'center',\n gap: 0.75,\n px: 1,\n py: 0.4,\n borderRadius: 1.5,\n bgcolor: alpha(theme.palette.primary.main, 0.06),\n border: `1px solid ${alpha(theme.palette.primary.main, 0.16)}`,\n color: 'text.primary',\n })}\n >\n <Box sx={{ display: 'flex', color: 'text.secondary' }}>{icon}</Box>\n <Typography component=\"span\" variant=\"caption\" color=\"text.secondary\" sx={{ fontWeight: 700, letterSpacing: 0.4, textTransform: 'uppercase' }}>\n {label}\n </Typography>\n <Typography component=\"span\" variant=\"body2\" sx={{ fontWeight: 700 }}>\n {value}\n </Typography>\n </Box>\n );\n}\n"],"mappings":";;;;;;;;;;;;AAYA,SAAS,EAAS,GAAM;CAEtB,OADK,IACE,EAAK,MAAM,KAAK,EAAE,OAAO,OAAO,EAAE,MAAM,GAAG,CAAC,EAAE,KAAK,MAAM,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,YAAY,IADzE;AAEpB;AAGA,SAAS,EAAW,GAAK;CACvB,IAAI,CAAC,GAAK,OAAO;CACjB,IAAM,IAAQ,aAAe,OAAO,IAAM,IAAI,KAAK,CAAG;CACtD,IAAI,OAAO,MAAM,EAAM,QAAQ,CAAC,GAAG,OAAO;CAC1C,IAAM,oBAAQ,IAAI,KAAK,GACnB,IAAM,EAAM,YAAY,IAAI,EAAM,YAAY,GAC5C,IAAI,EAAM,SAAS,IAAI,EAAM,SAAS;CAE5C,QADI,IAAI,KAAM,MAAM,KAAK,EAAM,QAAQ,IAAI,EAAM,QAAQ,MAAI,KACtD,KAAO,IAAI,IAAM;AAC1B;AAMA,SAAwB,EAAkB,EACxC,aACA,iBAAc,GACd,oBAAiB,IACjB,aACC;CAED,IAAM,IADQ,EACO,EAAM,IAAI,sCAAsC,GAC/D,CAAC,GAAS,KAAc,EAAS,IAAI,GACrC,CAAC,GAAS,KAAc,EAAS,EAAK,GACtC,CAAC,GAAS,KAAc,EAAS,EAAK;CA+C5C,IA7C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