@argusoft/medplat-core 1.0.32 → 1.0.33
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/{AccessRights-DBjTQA1-.js → AccessRights-BC43Jhml.js} +264 -199
- package/dist/AccessRights-BC43Jhml.js.map +1 -0
- package/dist/{BrandsPage-CdcAvaml-ZtVTX6vX.js → BrandsPage-CdcAvaml-CYT80CMH.js} +3 -3
- package/dist/{BrandsPage-CdcAvaml-ZtVTX6vX.js.map → BrandsPage-CdcAvaml-CYT80CMH.js.map} +1 -1
- package/dist/{CategoriesPage-BprQEYJw-CclreTv1.js → CategoriesPage-BprQEYJw-BRAukJB1.js} +3 -3
- package/dist/{CategoriesPage-BprQEYJw-CclreTv1.js.map → CategoriesPage-BprQEYJw-BRAukJB1.js.map} +1 -1
- package/dist/ChangePasswordModalCore-rypTxA2O.js +238 -0
- package/dist/ChangePasswordModalCore-rypTxA2O.js.map +1 -0
- package/dist/{DashboardPage-CTiGSx71-CsYohJ5e.js → DashboardPage-CTiGSx71-DX-TzGOH.js} +3 -3
- package/dist/{DashboardPage-CTiGSx71-CsYohJ5e.js.map → DashboardPage-CTiGSx71-DX-TzGOH.js.map} +1 -1
- package/dist/{FacilityPicker-BXa2VF7i-Dab_Jwa5.js → FacilityPicker-BXa2VF7i-D0JUIqLv.js} +2 -2
- package/dist/{FacilityPicker-BXa2VF7i-Dab_Jwa5.js.map → FacilityPicker-BXa2VF7i-D0JUIqLv.js.map} +1 -1
- package/dist/FaqList-CeDEuhU_.js +237 -0
- package/dist/FaqList-CeDEuhU_.js.map +1 -0
- package/dist/FaqSkeletons-hLCEcRr-.js +19 -0
- package/dist/FaqSkeletons-hLCEcRr-.js.map +1 -0
- package/dist/FaqView-sDzBVyXV.js +617 -0
- package/dist/FaqView-sDzBVyXV.js.map +1 -0
- package/dist/{FeatureMenu-Kc73yPHH.js → FeatureMenu-CaI-ZhSZ.js} +2 -2
- package/dist/{FeatureMenu-Kc73yPHH.js.map → FeatureMenu-CaI-ZhSZ.js.map} +1 -1
- package/dist/{ImmunizationConfigurationBase-lKsJZMak.js → ImmunizationConfigurationBase-Clkk0-n6.js} +2352 -2332
- package/dist/{ImmunizationConfigurationBase-lKsJZMak.js.map → ImmunizationConfigurationBase-Clkk0-n6.js.map} +1 -1
- package/dist/{InventoryPage-JadYMCzU-CzJQfQ2A.js → InventoryPage-JadYMCzU-CWcCauMI.js} +4 -4
- package/dist/{InventoryPage-JadYMCzU-CzJQfQ2A.js.map → InventoryPage-JadYMCzU-CWcCauMI.js.map} +1 -1
- package/dist/ManageFaq-4cT6bntx.js +1583 -0
- package/dist/ManageFaq-4cT6bntx.js.map +1 -0
- package/dist/ManageFaq.css +1 -0
- package/dist/{ManageUser-Dm0l833u.js → ManageUser-DchUMAyC.js} +2 -2
- package/dist/{ManageUser-Dm0l833u.js.map → ManageUser-DchUMAyC.js.map} +1 -1
- package/dist/{MemberProfileCard-01d_jz3w-DYHtbgMX.js → MemberProfileCard-01d_jz3w-CQi_zu6x.js} +3 -3
- package/dist/{MemberProfileCard-01d_jz3w-DYHtbgMX.js.map → MemberProfileCard-01d_jz3w-CQi_zu6x.js.map} +1 -1
- package/dist/{PaymentCreatePage-D6NZBUC3-DxXf2kvH.js → PaymentCreatePage-D6NZBUC3-_98S21Sa.js} +4 -4
- package/dist/{PaymentCreatePage-D6NZBUC3-DxXf2kvH.js.map → PaymentCreatePage-D6NZBUC3-_98S21Sa.js.map} +1 -1
- package/dist/{PaymentsPage-CHieGNrn-BnYCtqHd.js → PaymentsPage-CHieGNrn-ChCXEyck.js} +3 -3
- package/dist/{PaymentsPage-CHieGNrn-BnYCtqHd.js.map → PaymentsPage-CHieGNrn-ChCXEyck.js.map} +1 -1
- package/dist/{PickupBatchLinesEditor-QPaqFtUO-CY7BShYh.js → PickupBatchLinesEditor-QPaqFtUO-BEtI5mIU.js} +2 -2
- package/dist/{PickupBatchLinesEditor-QPaqFtUO-CY7BShYh.js.map → PickupBatchLinesEditor-QPaqFtUO-BEtI5mIU.js.map} +1 -1
- package/dist/{PickupCreatePage-C7_67u_u-OId8-e2a.js → PickupCreatePage-C7_67u_u-DbDIZ1WC.js} +5 -5
- package/dist/{PickupCreatePage-C7_67u_u-OId8-e2a.js.map → PickupCreatePage-C7_67u_u-DbDIZ1WC.js.map} +1 -1
- package/dist/{PickupsPage-BWblMlic-CWkgeBw0.js → PickupsPage-BWblMlic-KehDMebm.js} +4 -4
- package/dist/{PickupsPage-BWblMlic-CWkgeBw0.js.map → PickupsPage-BWblMlic-KehDMebm.js.map} +1 -1
- package/dist/{PmGuard-BvUUbU80-BpYNaDzl.js → PmGuard-BvUUbU80-DJipZoSg.js} +2 -2
- package/dist/{PmGuard-BvUUbU80-BpYNaDzl.js.map → PmGuard-BvUUbU80-DJipZoSg.js.map} +1 -1
- package/dist/{ProductEditPage-Dbq4vUAA-BoBmTPPL.js → ProductEditPage-Dbq4vUAA-DusAdAvm.js} +4 -4
- package/dist/{ProductEditPage-Dbq4vUAA-BoBmTPPL.js.map → ProductEditPage-Dbq4vUAA-DusAdAvm.js.map} +1 -1
- package/dist/{ProductsPage-BI22nPb4-CQBjnc-n.js → ProductsPage-BI22nPb4-D3GnWz34.js} +4 -4
- package/dist/{ProductsPage-BI22nPb4-CQBjnc-n.js.map → ProductsPage-BI22nPb4-D3GnWz34.js.map} +1 -1
- package/dist/{PurchaseCreatePage-C0EK9z4w-BQMTsjE7.js → PurchaseCreatePage-C0EK9z4w-D4PlZsOH.js} +4 -4
- package/dist/{PurchaseCreatePage-C0EK9z4w-BQMTsjE7.js.map → PurchaseCreatePage-C0EK9z4w-D4PlZsOH.js.map} +1 -1
- package/dist/{PurchaseRequestDetailPage-DhBuOGHZ-CWZPqzt9.js → PurchaseRequestDetailPage-DhBuOGHZ-CAmlL4fP.js} +3 -3
- package/dist/{PurchaseRequestDetailPage-DhBuOGHZ-CWZPqzt9.js.map → PurchaseRequestDetailPage-DhBuOGHZ-CAmlL4fP.js.map} +1 -1
- package/dist/{PurchaseRequestsPage-Bj9HUMxb-B7-AxT8m.js → PurchaseRequestsPage-Bj9HUMxb-BCAhEEkL.js} +3 -3
- package/dist/{PurchaseRequestsPage-Bj9HUMxb-B7-AxT8m.js.map → PurchaseRequestsPage-Bj9HUMxb-BCAhEEkL.js.map} +1 -1
- package/dist/{PurchasesPage-Djl1AqD_-DXeYFMrX.js → PurchasesPage-Djl1AqD_-DxBRFRDy.js} +3 -3
- package/dist/{PurchasesPage-Djl1AqD_-DXeYFMrX.js.map → PurchasesPage-Djl1AqD_-DxBRFRDy.js.map} +1 -1
- package/dist/{SaleCreatePage-DHBLmlBr-BlgjVsq6.js → SaleCreatePage-DHBLmlBr-aEGmvJQq.js} +4 -4
- package/dist/{SaleCreatePage-DHBLmlBr-BlgjVsq6.js.map → SaleCreatePage-DHBLmlBr-aEGmvJQq.js.map} +1 -1
- package/dist/{SalesPage-eF9Yr42z-BQ9FlXC3.js → SalesPage-eF9Yr42z-CvOr82vo.js} +3 -3
- package/dist/{SalesPage-eF9Yr42z-BQ9FlXC3.js.map → SalesPage-eF9Yr42z-CvOr82vo.js.map} +1 -1
- package/dist/{SettingsPage-Cre-UE3r-9ntnLYsQ.js → SettingsPage-Cre-UE3r-CGTVp5Zw.js} +3 -3
- package/dist/{SettingsPage-Cre-UE3r-9ntnLYsQ.js.map → SettingsPage-Cre-UE3r-CGTVp5Zw.js.map} +1 -1
- package/dist/{StorageUnitsPage-CTEVuemZ-B4osG74N.js → StorageUnitsPage-CTEVuemZ-C7zkwKMz.js} +5 -5
- package/dist/{StorageUnitsPage-CTEVuemZ-B4osG74N.js.map → StorageUnitsPage-CTEVuemZ-C7zkwKMz.js.map} +1 -1
- package/dist/{SubMenu-OO2zhKiu.js → SubMenu-DZIhur09.js} +2 -2
- package/dist/{SubMenu-OO2zhKiu.js.map → SubMenu-DZIhur09.js.map} +1 -1
- package/dist/{TransactionsPage-Zuu7sjID-B-ACzvd1.js → TransactionsPage-Zuu7sjID-BDmUK7s1.js} +3 -3
- package/dist/{TransactionsPage-Zuu7sjID-B-ACzvd1.js.map → TransactionsPage-Zuu7sjID-BDmUK7s1.js.map} +1 -1
- package/dist/{TransferCreatePage-DlT0nCDj-B2SdPgYB.js → TransferCreatePage-DlT0nCDj-evHPJc99.js} +4 -4
- package/dist/{TransferCreatePage-DlT0nCDj-B2SdPgYB.js.map → TransferCreatePage-DlT0nCDj-evHPJc99.js.map} +1 -1
- package/dist/{TransfersPage-DqaSvHda-G2tFa5Jq.js → TransfersPage-DqaSvHda-DAUn5SSr.js} +3 -3
- package/dist/{TransfersPage-DqaSvHda-G2tFa5Jq.js.map → TransfersPage-DqaSvHda-DAUn5SSr.js.map} +1 -1
- package/dist/{VaccineEducation-T_UE57Ef.js → VaccineEducation-DWkNNasF.js} +2 -2
- package/dist/{VaccineEducation-T_UE57Ef.js.map → VaccineEducation-DWkNNasF.js.map} +1 -1
- package/dist/VaccineEducationConfigurator-BFCvu5Mw.js +1450 -0
- package/dist/VaccineEducationConfigurator-BFCvu5Mw.js.map +1 -0
- package/dist/VaccineEducationConfigurator.css +1 -4
- package/dist/{VaccineEducationList-Ok7_5EFb.js → VaccineEducationList-BxZHahCh.js} +2 -2
- package/dist/{VaccineEducationList-Ok7_5EFb.js.map → VaccineEducationList-BxZHahCh.js.map} +1 -1
- package/dist/{VialsPage-LoDaUqVv-DmMXbK8j.js → VialsPage-LoDaUqVv-Dw00Zc06.js} +4 -4
- package/dist/{VialsPage-LoDaUqVv-DmMXbK8j.js.map → VialsPage-LoDaUqVv-Dw00Zc06.js.map} +1 -1
- package/dist/{VaccineEducationConfigurator-CWc20_rv.js → ckeditor5-_x14lrzc.js} +4014 -5372
- package/dist/ckeditor5-_x14lrzc.js.map +1 -0
- package/dist/ckeditor5.css +4 -0
- package/dist/faqMedia-FDpje7v0.js +234 -0
- package/dist/faqMedia-FDpje7v0.js.map +1 -0
- package/dist/index.css +1 -1
- package/dist/index.js +1 -1
- package/dist/{index.lib-BySa9-Z-.js → index.lib-QDEODnRT.js} +343 -303
- package/dist/index.lib-QDEODnRT.js.map +1 -0
- package/dist/{listValueStore-5d4vNGQM-WclZ5nBG.js → listValueStore-5d4vNGQM-DB08drLf.js} +2 -2
- package/dist/{listValueStore-5d4vNGQM-WclZ5nBG.js.map → listValueStore-5d4vNGQM-DB08drLf.js.map} +1 -1
- package/dist/proxy-C4gcRXzG.js +5265 -0
- package/dist/proxy-C4gcRXzG.js.map +1 -0
- package/package.json +3 -2
- package/dist/AccessRights-DBjTQA1-.js.map +0 -1
- package/dist/ChangePasswordModalCore-DZGOkbRY.js +0 -5494
- package/dist/ChangePasswordModalCore-DZGOkbRY.js.map +0 -1
- package/dist/VaccineEducationConfigurator-CWc20_rv.js.map +0 -1
- package/dist/index.lib-BySa9-Z-.js.map +0 -1
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
import { jsx as t, jsxs as o } from "react/jsx-runtime";
|
|
2
|
+
import { yupResolver as Z } from "@hookform/resolvers/yup";
|
|
3
|
+
import m from "prop-types";
|
|
4
|
+
import { Modal as J, Typography as p, Button as z, CircularProgress as Q } from "@mui/material";
|
|
5
|
+
import X from "@mui/icons-material/LockResetRounded";
|
|
6
|
+
import M from "@mui/icons-material/CheckRounded";
|
|
7
|
+
import * as f from "yup";
|
|
8
|
+
import { useMemo as O, useRef as q, useState as y, useEffect as L } from "react";
|
|
9
|
+
import { useForm as Y } from "react-hook-form";
|
|
10
|
+
import ee from "@/hooks/useAESEncryption.js";
|
|
11
|
+
import { o as se } from "./Users-MC7txo1V.js";
|
|
12
|
+
import { showToast as te } from "@/common/toaster/toaster.jsx";
|
|
13
|
+
import ae from "@/common/services/util/GeneralUtil";
|
|
14
|
+
import re from "@/hooks/useTrackEvent";
|
|
15
|
+
import { useTranslateProvider as oe } from "@/common/languageTranslator/TranslationContext";
|
|
16
|
+
import { P as U } from "./ManageUser-DchUMAyC.js";
|
|
17
|
+
import { PasswordStrength as ie } from "@/views/feature-components/users/PasswordStrength";
|
|
18
|
+
import { m as d, A as ne } from "./proxy-C4gcRXzG.js";
|
|
19
|
+
const le = ({ open: u, onClose: i, userId: F, roleCode: P, ...$ }) => {
|
|
20
|
+
const r = ae.isOasis && (P === "RHP" || P === "PARAVET"), { translate: e } = oe(), w = O(
|
|
21
|
+
() => r ? [{ id: "pin", label: e("Exactly 6 digits"), test: (s) => /^\d{6}$/.test(s) }] : [
|
|
22
|
+
{ id: "length", label: e("At least 8 characters"), test: (s) => s.length >= 8 },
|
|
23
|
+
{ id: "lowercase", label: e("One lowercase letter"), test: (s) => /[a-z]/.test(s) },
|
|
24
|
+
{ id: "uppercase", label: e("One uppercase letter"), test: (s) => /[A-Z]/.test(s) },
|
|
25
|
+
{
|
|
26
|
+
id: "special",
|
|
27
|
+
label: e("One special character (@$!%*?&#)"),
|
|
28
|
+
test: (s) => /[@$!%*?&#]/.test(s)
|
|
29
|
+
}
|
|
30
|
+
],
|
|
31
|
+
[r, e]
|
|
32
|
+
), D = O(
|
|
33
|
+
() => f.object().shape({
|
|
34
|
+
password: w.reduce(
|
|
35
|
+
(s, a) => s.test(a.id, a.label, (c) => !!c && a.test(c)),
|
|
36
|
+
f.string().required("Password is required")
|
|
37
|
+
),
|
|
38
|
+
confirmPassword: f.string().required("Confirm Password is required").oneOf([f.ref("password"), null], "Passwords do not match")
|
|
39
|
+
}),
|
|
40
|
+
[w]
|
|
41
|
+
), {
|
|
42
|
+
control: b,
|
|
43
|
+
formState: { errors: h, isValid: W },
|
|
44
|
+
handleSubmit: _,
|
|
45
|
+
watch: N,
|
|
46
|
+
reset: v
|
|
47
|
+
} = Y({ resolver: Z(D), mode: "onChange" }), g = q(null), S = q(!1), B = re(), G = ee(), [I, T] = y("form"), [l, x] = y(!1), [C, R] = y({ password: !1, confirmPassword: !1 }), A = (s) => R((a) => ({ ...a, [s]: !a[s] })), E = N("password") || "", j = N("confirmPassword") || "", H = j.length > 0 && j === E, K = async ({ password: s }) => {
|
|
48
|
+
var a, c;
|
|
49
|
+
if (!l) {
|
|
50
|
+
x(!0);
|
|
51
|
+
try {
|
|
52
|
+
const n = await G.encrypt(s);
|
|
53
|
+
await se({
|
|
54
|
+
oldPassword: n,
|
|
55
|
+
userId: F
|
|
56
|
+
}), S.current = !0, T("success"), setTimeout(() => i == null ? void 0 : i(), 1600);
|
|
57
|
+
} catch (n) {
|
|
58
|
+
console.error(n), te({
|
|
59
|
+
message: ((c = (a = n == null ? void 0 : n.response) == null ? void 0 : a.data) == null ? void 0 : c.message) || "Something Went Wrong",
|
|
60
|
+
type: "error"
|
|
61
|
+
});
|
|
62
|
+
} finally {
|
|
63
|
+
x(!1);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
L(() => {
|
|
68
|
+
u && (v(), T("form"), x(!1), R({ password: !1, confirmPassword: !1 }));
|
|
69
|
+
}, [u, v]), L(() => {
|
|
70
|
+
let s = g.current;
|
|
71
|
+
return () => {
|
|
72
|
+
s && B("conversion_event", {
|
|
73
|
+
form: s,
|
|
74
|
+
form_name: "Change Password",
|
|
75
|
+
submit: S.current
|
|
76
|
+
});
|
|
77
|
+
};
|
|
78
|
+
}, [g]);
|
|
79
|
+
const V = e(r ? "New PIN" : "New Password"), k = e(r ? "Confirm PIN" : "Confirm Password");
|
|
80
|
+
return /* @__PURE__ */ t(
|
|
81
|
+
J,
|
|
82
|
+
{
|
|
83
|
+
open: u,
|
|
84
|
+
onClose: (s, a) => {
|
|
85
|
+
(l || I === "success") && (a === "backdropClick" || a === "escapeKeyDown") || i == null || i(s, a);
|
|
86
|
+
},
|
|
87
|
+
...$,
|
|
88
|
+
children: /* @__PURE__ */ t("div", { className: "fixed inset-0 z-[200] flex items-center justify-center p-4", children: /* @__PURE__ */ t(
|
|
89
|
+
d.div,
|
|
90
|
+
{
|
|
91
|
+
initial: { opacity: 0, y: 24, scale: 0.96 },
|
|
92
|
+
animate: { opacity: 1, y: 0, scale: 1 },
|
|
93
|
+
transition: { type: "spring", stiffness: 220, damping: 22 },
|
|
94
|
+
className: "w-full max-w-md",
|
|
95
|
+
children: /* @__PURE__ */ t("div", { className: "w-full rounded-2xl bg-white shadow-2xl overflow-hidden max-h-[90vh] flex flex-col", children: /* @__PURE__ */ t(ne, { mode: "wait", children: I === "form" ? /* @__PURE__ */ o(
|
|
96
|
+
d.form,
|
|
97
|
+
{
|
|
98
|
+
ref: g,
|
|
99
|
+
onSubmit: _(K),
|
|
100
|
+
noValidate: !0,
|
|
101
|
+
initial: { opacity: 0, scale: 0.98 },
|
|
102
|
+
animate: { opacity: 1, scale: 1 },
|
|
103
|
+
exit: { opacity: 0, scale: 0.98 },
|
|
104
|
+
transition: { duration: 0.2 },
|
|
105
|
+
className: "flex flex-col px-8 py-7 overflow-y-auto",
|
|
106
|
+
children: [
|
|
107
|
+
/* @__PURE__ */ o("div", { className: "flex flex-col items-center text-center", children: [
|
|
108
|
+
/* @__PURE__ */ t(
|
|
109
|
+
d.div,
|
|
110
|
+
{
|
|
111
|
+
initial: { scale: 0.6, opacity: 0 },
|
|
112
|
+
animate: { scale: 1, opacity: 1 },
|
|
113
|
+
transition: { type: "spring", stiffness: 260, damping: 16 },
|
|
114
|
+
className: "flex items-center justify-center w-14 h-14 rounded-full bg-blue-50 text-[#007ACC] mb-4",
|
|
115
|
+
children: /* @__PURE__ */ t(X, { sx: { fontSize: 30 } })
|
|
116
|
+
}
|
|
117
|
+
),
|
|
118
|
+
/* @__PURE__ */ t(p, { className: "text-lg font-bold text-gray-800", children: e(r ? "Set a new PIN" : "Set a new password") }),
|
|
119
|
+
/* @__PURE__ */ t(p, { className: "text-sm text-gray-500 mt-1 max-w-xs", children: e(r ? "Choose a 6-digit PIN for this user." : "Choose a strong password for this user.") })
|
|
120
|
+
] }),
|
|
121
|
+
/* @__PURE__ */ o("div", { className: "mt-6 space-y-4", children: [
|
|
122
|
+
/* @__PURE__ */ o("div", { children: [
|
|
123
|
+
/* @__PURE__ */ t(
|
|
124
|
+
U,
|
|
125
|
+
{
|
|
126
|
+
autoFocus: !0,
|
|
127
|
+
control: b,
|
|
128
|
+
name: "password",
|
|
129
|
+
placeholder: V,
|
|
130
|
+
inputProps: { "aria-label": V },
|
|
131
|
+
errors: h,
|
|
132
|
+
showPassword: C.password,
|
|
133
|
+
togglePasswordVisibility: () => A("password"),
|
|
134
|
+
autoComplete: "new-password",
|
|
135
|
+
dataTestId: "changepasswordmodal-newpassword"
|
|
136
|
+
}
|
|
137
|
+
),
|
|
138
|
+
/* @__PURE__ */ t(
|
|
139
|
+
ie,
|
|
140
|
+
{
|
|
141
|
+
password: E,
|
|
142
|
+
rules: w,
|
|
143
|
+
showMeter: !r
|
|
144
|
+
}
|
|
145
|
+
)
|
|
146
|
+
] }),
|
|
147
|
+
/* @__PURE__ */ o("div", { children: [
|
|
148
|
+
/* @__PURE__ */ t(
|
|
149
|
+
U,
|
|
150
|
+
{
|
|
151
|
+
control: b,
|
|
152
|
+
name: "confirmPassword",
|
|
153
|
+
placeholder: k,
|
|
154
|
+
inputProps: { "aria-label": k },
|
|
155
|
+
errors: h,
|
|
156
|
+
showPassword: C.confirmPassword,
|
|
157
|
+
togglePasswordVisibility: () => A("confirmPassword"),
|
|
158
|
+
autoComplete: "new-password",
|
|
159
|
+
dataTestId: "changepasswordmodal-confirmpassword"
|
|
160
|
+
}
|
|
161
|
+
),
|
|
162
|
+
H && !h.confirmPassword && /* @__PURE__ */ o("p", { className: "mt-1 flex items-center gap-1 text-xs text-green-600", children: [
|
|
163
|
+
/* @__PURE__ */ t(M, { sx: { fontSize: 14 } }),
|
|
164
|
+
e(r ? "PINs match" : "Passwords match")
|
|
165
|
+
] })
|
|
166
|
+
] })
|
|
167
|
+
] }),
|
|
168
|
+
/* @__PURE__ */ o("div", { className: "mt-7 flex flex-col-reverse sm:flex-row items-center justify-end gap-3", children: [
|
|
169
|
+
/* @__PURE__ */ t(
|
|
170
|
+
z,
|
|
171
|
+
{
|
|
172
|
+
variant: "outlined",
|
|
173
|
+
color: "inherit",
|
|
174
|
+
onClick: i,
|
|
175
|
+
disabled: l,
|
|
176
|
+
className: "rounded-full px-6 normal-case font-medium text-gray-600 w-full sm:w-auto",
|
|
177
|
+
"data-testid": "changepasswordmodal-button-cancel",
|
|
178
|
+
children: e("Cancel")
|
|
179
|
+
}
|
|
180
|
+
),
|
|
181
|
+
/* @__PURE__ */ t(
|
|
182
|
+
z,
|
|
183
|
+
{
|
|
184
|
+
type: "submit",
|
|
185
|
+
variant: "contained",
|
|
186
|
+
color: "primary",
|
|
187
|
+
disabled: !W || l,
|
|
188
|
+
className: "rounded-full px-6 normal-case font-medium w-full sm:w-auto",
|
|
189
|
+
"data-testid": "changepasswordmodal-button-submit",
|
|
190
|
+
children: l ? /* @__PURE__ */ o("span", { className: "flex items-center gap-2", children: [
|
|
191
|
+
/* @__PURE__ */ t(Q, { size: 16, color: "inherit" }),
|
|
192
|
+
e("Updating…")
|
|
193
|
+
] }) : e(r ? "Update PIN" : "Update password")
|
|
194
|
+
}
|
|
195
|
+
)
|
|
196
|
+
] })
|
|
197
|
+
]
|
|
198
|
+
},
|
|
199
|
+
"form"
|
|
200
|
+
) : /* @__PURE__ */ o(
|
|
201
|
+
d.div,
|
|
202
|
+
{
|
|
203
|
+
initial: { opacity: 0 },
|
|
204
|
+
animate: { opacity: 1 },
|
|
205
|
+
className: "flex flex-col items-center text-center px-8 py-12 overflow-y-auto",
|
|
206
|
+
"data-testid": "changepasswordmodal-success",
|
|
207
|
+
children: [
|
|
208
|
+
/* @__PURE__ */ t(
|
|
209
|
+
d.div,
|
|
210
|
+
{
|
|
211
|
+
initial: { scale: 0, rotate: -20 },
|
|
212
|
+
animate: { scale: 1, rotate: 0 },
|
|
213
|
+
transition: { type: "spring", stiffness: 260, damping: 14 },
|
|
214
|
+
className: "flex items-center justify-center w-20 h-20 rounded-full bg-green-50 text-green-600 mb-5",
|
|
215
|
+
children: /* @__PURE__ */ t(M, { sx: { fontSize: 46 } })
|
|
216
|
+
}
|
|
217
|
+
),
|
|
218
|
+
/* @__PURE__ */ t(p, { className: "text-xl font-bold text-gray-800", children: e(r ? "PIN updated" : "Password updated") }),
|
|
219
|
+
/* @__PURE__ */ t(p, { className: "text-sm text-gray-500 mt-2 max-w-xs", children: e(r ? "The user's PIN has been changed successfully." : "The user's password has been changed successfully.") })
|
|
220
|
+
]
|
|
221
|
+
},
|
|
222
|
+
"success"
|
|
223
|
+
) }) })
|
|
224
|
+
}
|
|
225
|
+
) })
|
|
226
|
+
}
|
|
227
|
+
);
|
|
228
|
+
};
|
|
229
|
+
le.propTypes = {
|
|
230
|
+
open: m.bool,
|
|
231
|
+
onClose: m.func,
|
|
232
|
+
userId: m.number,
|
|
233
|
+
roleCode: m.string
|
|
234
|
+
};
|
|
235
|
+
export {
|
|
236
|
+
le as default
|
|
237
|
+
};
|
|
238
|
+
//# sourceMappingURL=ChangePasswordModalCore-rypTxA2O.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ChangePasswordModalCore-rypTxA2O.js","sources":["../src/views/Users/ChangePasswordModalCore.jsx"],"sourcesContent":["import { yupResolver } from \"@hookform/resolvers/yup\";\nimport PropTypes from \"prop-types\";\nimport { Button, CircularProgress, Modal, Typography } from \"@mui/material\";\nimport LockResetRoundedIcon from \"@mui/icons-material/LockResetRounded\";\nimport CheckRoundedIcon from \"@mui/icons-material/CheckRounded\";\nimport { motion, AnimatePresence } from \"framer-motion\";\nimport * as yup from \"yup\";\nimport { useEffect, useMemo, useRef, useState } from \"react\";\nimport { useForm } from \"react-hook-form\";\nimport useAESEncryption from \"@/hooks/useAESEncryption.js\";\nimport { changePassword } from \"../../services/Users.js\";\nimport { showToast } from \"@/common/toaster/toaster.jsx\";\nimport GeneralUtil from \"@/common/services/util/GeneralUtil\";\nimport useTrackEvent from \"@/hooks/useTrackEvent\";\nimport { useTranslateProvider } from \"@/common/languageTranslator/TranslationContext\";\nimport { PasswordField } from \"./PasswordField\";\n// Reused from app-shell via the \"@/\" app-shell contract (externalized at build, provided by the host at runtime).\nimport { PasswordStrength } from \"@/views/feature-components/users/PasswordStrength\";\n\n/**\n * A modal for an administrator to set a new password for a user.\n * @module ChangePasswordModal\n * @param {Object} props\n * @param {boolean} props.open - Whether the modal is open.\n * @param {Function} props.onClose - Called to close the modal.\n * @param {string} props.userId - The ID of the user whose password is being changed.\n * @param {string} props.roleCode - Role of the target user; drives the 6-digit PIN policy.\n * @returns {JSX.Element}\n */\nconst ChangePasswordModal = ({ open, onClose, userId, roleCode, ...props }) => {\n const isSixDigitPin =\n GeneralUtil.isOasis && (roleCode === \"RHP\" || roleCode === \"PARAVET\");\n\n const { translate } = useTranslateProvider();\n\n // Single source of truth: the live checklist and the yup schema both derive from this.\n const passwordRules = useMemo(\n () =>\n isSixDigitPin\n ? [{ id: \"pin\", label: translate(\"Exactly 6 digits\"), test: (v) => /^\\d{6}$/.test(v) }]\n : [\n { id: \"length\", label: translate(\"At least 8 characters\"), test: (v) => v.length >= 8 },\n { id: \"lowercase\", label: translate(\"One lowercase letter\"), test: (v) => /[a-z]/.test(v) },\n { id: \"uppercase\", label: translate(\"One uppercase letter\"), test: (v) => /[A-Z]/.test(v) },\n {\n id: \"special\",\n label: translate(\"One special character (@$!%*?&#)\"),\n test: (v) => /[@$!%*?&#]/.test(v),\n },\n ],\n [isSixDigitPin, translate],\n );\n\n const validationSchema = useMemo(\n () =>\n yup.object().shape({\n password: passwordRules.reduce(\n (schema, rule) => schema.test(rule.id, rule.label, (v) => !!v && rule.test(v)),\n yup.string().required(\"Password is required\"),\n ),\n confirmPassword: yup\n .string()\n .required(\"Confirm Password is required\")\n .oneOf([yup.ref(\"password\"), null], \"Passwords do not match\"),\n }),\n [passwordRules],\n );\n\n const {\n control,\n formState: { errors, isValid },\n handleSubmit,\n watch,\n reset\n } = useForm({ resolver: yupResolver(validationSchema), mode: \"onChange\" });\n\n const formRef = useRef(null);\n const submitRef = useRef(false);\n const trackEvent = useTrackEvent();\n const AESEncryption = useAESEncryption();\n\n const [phase, setPhase] = useState(\"form\"); // 'form' | 'success'\n const [loading, setLoading] = useState(false);\n const [visible, setVisible] = useState({ password: false, confirmPassword: false });\n const toggle = (key) => setVisible((v) => ({ ...v, [key]: !v[key] }));\n\n const newPassword = watch(\"password\") || \"\";\n const confirmValue = watch(\"confirmPassword\") || \"\";\n const passwordsMatch = confirmValue.length > 0 && confirmValue === newPassword;\n\n /**\n * Handles the process of changing a user's password.\n * @param {Object} params\n * @param {string} params.password - The new password to be set.\n * @returns {Promise<void>}\n */\n const handleChangePassword = async ({ password }) => {\n if (loading) return;\n setLoading(true);\n try {\n const encryptedPassword = await AESEncryption.encrypt(password);\n await changePassword({\n oldPassword: encryptedPassword,\n userId,\n });\n submitRef.current = true;\n setPhase(\"success\");\n setTimeout(() => onClose?.(), 1600);\n } catch (error) {\n console.error(error);\n showToast({\n message: error?.response?.data?.message || \"Something Went Wrong\",\n type: \"error\",\n });\n } finally {\n setLoading(false);\n }\n };\n\n useEffect(() => {\n if (open) {\n reset();\n setPhase(\"form\");\n setLoading(false);\n setVisible({ password: false, confirmPassword: false });\n }\n }, [open, reset]);\n\n useEffect(() => {\n let form = formRef.current;\n return () => {\n if (form) {\n trackEvent(\"conversion_event\", {\n form: form,\n form_name: \"Change Password\",\n submit: submitRef.current,\n });\n }\n };\n }, [formRef]);\n\n const passwordLabel = isSixDigitPin ? translate(\"New PIN\") : translate(\"New Password\");\n const confirmLabel = isSixDigitPin ? translate(\"Confirm PIN\") : translate(\"Confirm Password\");\n\n return (\n <Modal\n open={open}\n onClose={(event, reason) => {\n if ((loading || phase === \"success\") && (reason === \"backdropClick\" || reason === \"escapeKeyDown\")) {\n return;\n }\n onClose?.(event, reason);\n }}\n {...props}\n >\n <div className=\"fixed inset-0 z-[200] flex items-center justify-center p-4\">\n <motion.div\n initial={{ opacity: 0, y: 24, scale: 0.96 }}\n animate={{ opacity: 1, y: 0, scale: 1 }}\n transition={{ type: \"spring\", stiffness: 220, damping: 22 }}\n className=\"w-full max-w-md\"\n >\n <div className=\"w-full rounded-2xl bg-white shadow-2xl overflow-hidden max-h-[90vh] flex flex-col\">\n <AnimatePresence mode=\"wait\">\n {phase === \"form\" ? (\n <motion.form\n key=\"form\"\n ref={formRef}\n onSubmit={handleSubmit(handleChangePassword)}\n noValidate\n initial={{ opacity: 0, scale: 0.98 }}\n animate={{ opacity: 1, scale: 1 }}\n exit={{ opacity: 0, scale: 0.98 }}\n transition={{ duration: 0.2 }}\n className=\"flex flex-col px-8 py-7 overflow-y-auto\"\n >\n {/* Header */}\n <div className=\"flex flex-col items-center text-center\">\n <motion.div\n initial={{ scale: 0.6, opacity: 0 }}\n animate={{ scale: 1, opacity: 1 }}\n transition={{ type: \"spring\", stiffness: 260, damping: 16 }}\n className=\"flex items-center justify-center w-14 h-14 rounded-full bg-blue-50 text-[#007ACC] mb-4\"\n >\n <LockResetRoundedIcon sx={{ fontSize: 30 }} />\n </motion.div>\n <Typography className=\"text-lg font-bold text-gray-800\">\n {isSixDigitPin ? translate(\"Set a new PIN\") : translate(\"Set a new password\")}\n </Typography>\n <Typography className=\"text-sm text-gray-500 mt-1 max-w-xs\">\n {isSixDigitPin\n ? translate(\"Choose a 6-digit PIN for this user.\")\n : translate(\"Choose a strong password for this user.\")}\n </Typography>\n </div>\n\n {/* Fields */}\n <div className=\"mt-6 space-y-4\">\n <div>\n <PasswordField\n autoFocus={true}\n control={control}\n name=\"password\"\n placeholder={passwordLabel}\n inputProps={{ \"aria-label\": passwordLabel }}\n errors={errors}\n showPassword={visible.password}\n togglePasswordVisibility={() => toggle(\"password\")}\n autoComplete=\"new-password\"\n dataTestId=\"changepasswordmodal-newpassword\"\n />\n <PasswordStrength\n password={newPassword}\n rules={passwordRules}\n showMeter={!isSixDigitPin}\n />\n </div>\n\n <div>\n <PasswordField\n control={control}\n name=\"confirmPassword\"\n placeholder={confirmLabel}\n inputProps={{ \"aria-label\": confirmLabel }}\n errors={errors}\n showPassword={visible.confirmPassword}\n togglePasswordVisibility={() => toggle(\"confirmPassword\")}\n autoComplete=\"new-password\"\n dataTestId=\"changepasswordmodal-confirmpassword\"\n />\n {passwordsMatch && !errors.confirmPassword && (\n <p className=\"mt-1 flex items-center gap-1 text-xs text-green-600\">\n <CheckRoundedIcon sx={{ fontSize: 14 }} />\n {isSixDigitPin ? translate(\"PINs match\") : translate(\"Passwords match\")}\n </p>\n )}\n </div>\n </div>\n\n {/* Actions */}\n <div className=\"mt-7 flex flex-col-reverse sm:flex-row items-center justify-end gap-3\">\n <Button\n variant=\"outlined\"\n color=\"inherit\"\n onClick={onClose}\n disabled={loading}\n className=\"rounded-full px-6 normal-case font-medium text-gray-600 w-full sm:w-auto\"\n data-testid=\"changepasswordmodal-button-cancel\"\n >\n {translate(\"Cancel\")}\n </Button>\n <Button\n type=\"submit\"\n variant=\"contained\"\n color=\"primary\"\n disabled={!isValid || loading}\n className=\"rounded-full px-6 normal-case font-medium w-full sm:w-auto\"\n data-testid=\"changepasswordmodal-button-submit\"\n >\n {loading ? (\n <span className=\"flex items-center gap-2\">\n <CircularProgress size={16} color=\"inherit\" />\n {translate(\"Updating…\")}\n </span>\n ) : isSixDigitPin ? (\n translate(\"Update PIN\")\n ) : (\n translate(\"Update password\")\n )}\n </Button>\n </div>\n </motion.form>\n ) : (\n <motion.div\n key=\"success\"\n initial={{ opacity: 0 }}\n animate={{ opacity: 1 }}\n className=\"flex flex-col items-center text-center px-8 py-12 overflow-y-auto\"\n data-testid=\"changepasswordmodal-success\"\n >\n <motion.div\n initial={{ scale: 0, rotate: -20 }}\n animate={{ scale: 1, rotate: 0 }}\n transition={{ type: \"spring\", stiffness: 260, damping: 14 }}\n className=\"flex items-center justify-center w-20 h-20 rounded-full bg-green-50 text-green-600 mb-5\"\n >\n <CheckRoundedIcon sx={{ fontSize: 46 }} />\n </motion.div>\n <Typography className=\"text-xl font-bold text-gray-800\">\n {isSixDigitPin ? translate(\"PIN updated\") : translate(\"Password updated\")}\n </Typography>\n <Typography className=\"text-sm text-gray-500 mt-2 max-w-xs\">\n {isSixDigitPin\n ? translate(\"The user's PIN has been changed successfully.\")\n : translate(\"The user's password has been changed successfully.\")}\n </Typography>\n </motion.div>\n )}\n </AnimatePresence>\n </div>\n </motion.div>\n </div>\n </Modal>\n );\n};\n\nexport default ChangePasswordModal;\n\nChangePasswordModal.propTypes = {\n open: PropTypes.bool,\n onClose: PropTypes.func,\n userId: PropTypes.number,\n roleCode: PropTypes.string,\n};\n"],"names":["ChangePasswordModal","open","onClose","userId","roleCode","props","isSixDigitPin","GeneralUtil","translate","useTranslateProvider","passwordRules","useMemo","v","validationSchema","yup","schema","rule","control","errors","isValid","handleSubmit","watch","reset","useForm","yupResolver","formRef","useRef","submitRef","trackEvent","useTrackEvent","AESEncryption","useAESEncryption","phase","setPhase","useState","loading","setLoading","visible","setVisible","toggle","key","newPassword","confirmValue","passwordsMatch","handleChangePassword","password","encryptedPassword","changePassword","error","showToast","_b","_a","useEffect","form","passwordLabel","confirmLabel","jsx","Modal","event","reason","motion","AnimatePresence","jsxs","LockResetRoundedIcon","Typography","PasswordField","PasswordStrength","CheckRoundedIcon","Button","CircularProgress","PropTypes"],"mappings":";;;;;;;;;;;;;;;;;;AA6BA,MAAMA,KAAsB,CAAC,EAAE,MAAAC,GAAM,SAAAC,GAAS,QAAAC,GAAQ,UAAAC,GAAU,GAAGC,QAAY;AAC7E,QAAMC,IACJC,GAAY,YAAYH,MAAa,SAASA,MAAa,YAEvD,EAAE,WAAAI,EAAA,IAAcC,GAAA,GAGhBC,IAAgBC;AAAA,IACpB,MACEL,IACI,CAAC,EAAE,IAAI,OAAO,OAAOE,EAAU,kBAAkB,GAAG,MAAM,CAACI,MAAM,UAAU,KAAKA,CAAC,EAAA,CAAG,IACpF;AAAA,MACA,EAAE,IAAI,UAAU,OAAOJ,EAAU,uBAAuB,GAAG,MAAM,CAACI,MAAMA,EAAE,UAAU,EAAA;AAAA,MACpF,EAAE,IAAI,aAAa,OAAOJ,EAAU,sBAAsB,GAAG,MAAM,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A,cACpB,SAAS,EAAE,SAAS,EAAA;AAAA,cACpB,WAAU;AAAA,cACV,eAAY;AAAA,cAEZ,UAAA;AAAA,gBAAA,gBAAAJ;AAAA,kBAACI,EAAO;AAAA,kBAAP;AAAA,oBACC,SAAS,EAAE,OAAO,GAAG,QAAQ,IAAA;AAAA,oBAC7B,SAAS,EAAE,OAAO,GAAG,QAAQ,EAAA;AAAA,oBAC7B,YAAY,EAAE,MAAM,UAAU,WAAW,KAAK,SAAS,GAAA;AAAA,oBACvD,WAAU;AAAA,oBAEV,4BAACO,GAAA,EAAiB,IAAI,EAAE,UAAU,KAAG,CAAG;AAAA,kBAAA;AAAA,gBAAA;AAAA,gBAE1C,gBAAAX,EAACQ,GAAA,EAAW,WAAU,mCACnB,UAAgBxD,EAAhBF,IAA0B,gBAA2B,kBAAd,EAAgC,CAC1E;AAAA,gBACA,gBAAAkD,EAACQ,GAAA,EAAW,WAAU,uCACnB,UACGxD,EADHF,IACa,kDACA,oDAD+C,EACK,CACpE;AAAA,cAAA;AAAA,YAAA;AAAA,YArBI;AAAA,UAAA,GAwBV,EAAA,CACF;AAAA,QAAA;AAAA,MAAA,EACF,CACF;AAAA,IAAA;AAAA,EAAA;AAGN;AAIAN,GAAoB,YAAY;AAAA,EAC9B,MAAMsE,EAAU;AAAA,EAChB,SAASA,EAAU;AAAA,EACnB,QAAQA,EAAU;AAAA,EAClB,UAAUA,EAAU;AACtB;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { A as H, D as O, c as Y, u as j, f as z, O as F, k as B, M as Q, N as _, P as K } from "./ImmunizationConfigurationBase-
|
|
1
|
+
import { A as H, D as O, c as Y, u as j, f as z, O as F, k as B, M as Q, N as _, P as K } from "./ImmunizationConfigurationBase-Clkk0-n6.js";
|
|
2
2
|
import { n as J, o as k } from "./format-UOyOu75i-D0GyylyQ.js";
|
|
3
|
-
import { Q as X, K as Z, Z as ee, $ as te, e as ae, Y as ne } from "./PmGuard-BvUUbU80-
|
|
3
|
+
import { Q as X, K as Z, Z as ee, $ as te, e as ae, Y as ne } from "./PmGuard-BvUUbU80-DJipZoSg.js";
|
|
4
4
|
import { useState as $ } from "react";
|
|
5
5
|
import { jsxs as n, jsx as e } from "react/jsx-runtime";
|
|
6
6
|
import p from "prop-types";
|
|
@@ -432,4 +432,4 @@ function ve() {
|
|
|
432
432
|
export {
|
|
433
433
|
ve as default
|
|
434
434
|
};
|
|
435
|
-
//# sourceMappingURL=DashboardPage-CTiGSx71-
|
|
435
|
+
//# sourceMappingURL=DashboardPage-CTiGSx71-DX-TzGOH.js.map
|
package/dist/{DashboardPage-CTiGSx71-CsYohJ5e.js.map → DashboardPage-CTiGSx71-DX-TzGOH.js.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DashboardPage-CTiGSx71-CsYohJ5e.js","sources":["../../productManagement/dist/DashboardPage-CTiGSx71.js"],"sourcesContent":["import { B as e, F as t, G as n, K as r, V as i, i as a, k as o, r as s, v as c, y as l } from \"./settingsStore-Df_wGo55.js\";\nimport { n as u, r as d } from \"./format-UOyOu75i.js\";\nimport { a as f, i as p, n as m, o as h, r as g, t as _ } from \"./PmGuard-BvUUbU80.js\";\nimport { useState as v } from \"react\";\nimport { jsx as y, jsxs as b } from \"react/jsx-runtime\";\nimport x from \"prop-types\";\nimport { Box as S, Card as C, CardContent as w, Chip as T, Grid as E, Grow as D, LinearProgress as O, Skeleton as k, Stack as A, Typography as j } from \"@mui/material\";\nimport { alpha as M, useTheme as N } from \"@mui/material/styles\";\nimport { useNavigate as P } from \"react-router-dom\";\nimport F from \"@mui/icons-material/ArrowForwardRounded\";\n//#region src/views/DashboardPage.jsx\nvar I = {\n\tRECEIPT: \"success\",\n\tSALE: \"primary\",\n\tPAYMENT: \"info\",\n\tVIAL_OPENED: \"info\",\n\tADMINISTRATION: \"info\",\n\tWASTAGE: \"warning\",\n\tEXPIRY: \"error\",\n\tQUARANTINE: \"error\",\n\tRECALL: \"error\",\n\tUNQUARANTINE: \"success\",\n\tTRANSFER_OUT: \"default\",\n\tTRANSFER_IN: \"default\"\n};\nfunction L({ label: e, value: t, loading: n }) {\n\treturn /* @__PURE__ */ b(S, { children: [/* @__PURE__ */ y(j, {\n\t\tvariant: \"caption\",\n\t\tcolor: \"text.secondary\",\n\t\tsx: {\n\t\t\tfontWeight: 700,\n\t\t\tletterSpacing: .5\n\t\t},\n\t\tchildren: e.toUpperCase()\n\t}), n ? /* @__PURE__ */ y(k, {\n\t\twidth: 48,\n\t\theight: 32\n\t}) : /* @__PURE__ */ y(j, {\n\t\tvariant: \"h5\",\n\t\tsx: {\n\t\t\tfontWeight: 800,\n\t\t\tfontVariantNumeric: \"tabular-nums\",\n\t\t\tlineHeight: 1.1,\n\t\t\tmt: .25\n\t\t},\n\t\tchildren: t\n\t})] });\n}\nL.propTypes = {\n\tlabel: x.string,\n\tvalue: x.node,\n\tloading: x.bool\n};\nfunction R({ workspace: e, metrics: t, loading: n, onItemClick: r }) {\n\tlet i = N(), a = e.icon;\n\treturn /* @__PURE__ */ y(C, {\n\t\tsx: {\n\t\t\tborderRadius: 1.5,\n\t\t\theight: \"100%\",\n\t\t\tposition: \"relative\",\n\t\t\toverflow: \"hidden\",\n\t\t\tborder: `1px solid ${M(e.accent, .18)}`,\n\t\t\tbackground: `linear-gradient(180deg, ${M(e.accent, .06)} 0%, ${M(i.palette.background.paper, 1)} 35%)`,\n\t\t\tboxShadow: `0 16px 36px ${M(e.accent, .08)}`,\n\t\t\ttransition: \"transform 240ms cubic-bezier(0.4, 0, 0.2, 1), box-shadow 240ms\",\n\t\t\t\"&:hover\": {\n\t\t\t\ttransform: \"translateY(-3px)\",\n\t\t\t\tboxShadow: `0 22px 50px ${M(e.accent, .18)}`\n\t\t\t},\n\t\t\t\"&::before\": {\n\t\t\t\tcontent: \"\\\"\\\"\",\n\t\t\t\tposition: \"absolute\",\n\t\t\t\tleft: 0,\n\t\t\t\tright: 0,\n\t\t\t\ttop: 0,\n\t\t\t\theight: 4,\n\t\t\t\tbackground: `linear-gradient(90deg, ${e.accent} 0%, ${e.accentDark} 100%)`\n\t\t\t}\n\t\t},\n\t\tchildren: /* @__PURE__ */ b(w, {\n\t\t\tsx: {\n\t\t\t\tpt: 3,\n\t\t\t\tdisplay: \"flex\",\n\t\t\t\tflexDirection: \"column\",\n\t\t\t\theight: \"100%\"\n\t\t\t},\n\t\t\tchildren: [\n\t\t\t\t/* @__PURE__ */ b(A, {\n\t\t\t\t\tdirection: \"row\",\n\t\t\t\t\talignItems: \"center\",\n\t\t\t\t\tspacing: 1.5,\n\t\t\t\t\tchildren: [/* @__PURE__ */ y(S, {\n\t\t\t\t\t\tsx: {\n\t\t\t\t\t\t\twidth: 44,\n\t\t\t\t\t\t\theight: 44,\n\t\t\t\t\t\t\tborderRadius: 1.5,\n\t\t\t\t\t\t\tdisplay: \"grid\",\n\t\t\t\t\t\t\tplaceItems: \"center\",\n\t\t\t\t\t\t\tcolor: \"#fff\",\n\t\t\t\t\t\t\tbackground: `linear-gradient(135deg, ${e.accent} 0%, ${e.accentDark} 100%)`,\n\t\t\t\t\t\t\tboxShadow: `0 8px 18px ${M(e.accent, .3)}`\n\t\t\t\t\t\t},\n\t\t\t\t\t\tchildren: /* @__PURE__ */ y(a, { sx: { fontSize: 24 } })\n\t\t\t\t\t}), /* @__PURE__ */ b(S, {\n\t\t\t\t\t\tsx: {\n\t\t\t\t\t\t\tflexGrow: 1,\n\t\t\t\t\t\t\tminWidth: 0\n\t\t\t\t\t\t},\n\t\t\t\t\t\tchildren: [/* @__PURE__ */ y(j, {\n\t\t\t\t\t\t\tvariant: \"overline\",\n\t\t\t\t\t\t\tsx: {\n\t\t\t\t\t\t\t\tcolor: e.accentDark,\n\t\t\t\t\t\t\t\tfontWeight: 800,\n\t\t\t\t\t\t\t\tletterSpacing: 1.1,\n\t\t\t\t\t\t\t\tlineHeight: 1\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tchildren: \"Workspace\"\n\t\t\t\t\t\t}), /* @__PURE__ */ y(j, {\n\t\t\t\t\t\t\tvariant: \"h6\",\n\t\t\t\t\t\t\tsx: {\n\t\t\t\t\t\t\t\tfontWeight: 800,\n\t\t\t\t\t\t\t\tlineHeight: 1.2\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tchildren: e.label\n\t\t\t\t\t\t})]\n\t\t\t\t\t})]\n\t\t\t\t}),\n\t\t\t\t/* @__PURE__ */ y(j, {\n\t\t\t\t\tvariant: \"body2\",\n\t\t\t\t\tcolor: \"text.secondary\",\n\t\t\t\t\tsx: {\n\t\t\t\t\t\tmt: 1.5,\n\t\t\t\t\t\tmb: 2\n\t\t\t\t\t},\n\t\t\t\t\tchildren: e.description\n\t\t\t\t}),\n\t\t\t\tt?.length ? /* @__PURE__ */ y(A, {\n\t\t\t\t\tdirection: \"row\",\n\t\t\t\t\tspacing: 3,\n\t\t\t\t\tsx: { mb: 2.5 },\n\t\t\t\t\tchildren: t.map((e) => /* @__PURE__ */ y(L, {\n\t\t\t\t\t\tlabel: e.label,\n\t\t\t\t\t\tvalue: e.value,\n\t\t\t\t\t\tloading: n\n\t\t\t\t\t}, e.label))\n\t\t\t\t}) : null,\n\t\t\t\t/* @__PURE__ */ y(S, {\n\t\t\t\t\tsx: { mt: \"auto\" },\n\t\t\t\t\tchildren: /* @__PURE__ */ y(A, {\n\t\t\t\t\t\tdirection: \"row\",\n\t\t\t\t\t\tspacing: 1,\n\t\t\t\t\t\tflexWrap: \"wrap\",\n\t\t\t\t\t\tuseFlexGap: !0,\n\t\t\t\t\t\tchildren: e.items.map((t) => {\n\t\t\t\t\t\t\tlet n = t.icon;\n\t\t\t\t\t\t\treturn /* @__PURE__ */ y(T, {\n\t\t\t\t\t\t\t\ticon: n ? /* @__PURE__ */ y(n, { sx: {\n\t\t\t\t\t\t\t\t\tfontSize: \"1rem !important\",\n\t\t\t\t\t\t\t\t\tcolor: `${e.accentDark} !important`\n\t\t\t\t\t\t\t\t} }) : void 0,\n\t\t\t\t\t\t\t\tlabel: t.label,\n\t\t\t\t\t\t\t\tonClick: () => r(t),\n\t\t\t\t\t\t\t\tsx: {\n\t\t\t\t\t\t\t\t\tborderRadius: 2,\n\t\t\t\t\t\t\t\t\tfontWeight: 700,\n\t\t\t\t\t\t\t\t\tbackgroundColor: M(e.accent, .08),\n\t\t\t\t\t\t\t\t\tcolor: e.accentDark,\n\t\t\t\t\t\t\t\t\tborder: `1px solid ${M(e.accent, .18)}`,\n\t\t\t\t\t\t\t\t\ttransition: \"all 180ms ease\",\n\t\t\t\t\t\t\t\t\t\"&:hover\": {\n\t\t\t\t\t\t\t\t\t\tbackgroundColor: M(e.accent, .18),\n\t\t\t\t\t\t\t\t\t\ttransform: \"translateY(-1px)\"\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}, t.id);\n\t\t\t\t\t\t})\n\t\t\t\t\t})\n\t\t\t\t})\n\t\t\t]\n\t\t})\n\t});\n}\nR.propTypes = {\n\tworkspace: x.object.isRequired,\n\tmetrics: x.array,\n\tloading: x.bool,\n\tonItemClick: x.func.isRequired\n};\nfunction z() {\n\tlet x = P(), L = N(), z = s(), B = p(), V = a(z?.currencyCode), H = h(B, z), U = B.has(\"view.manage.productManagement.ledger\"), [W, G] = v(!0), [K, q] = v({\n\t\tcategories: 0,\n\t\tbrands: 0,\n\t\tproducts: 0,\n\t\tbatches: 0,\n\t\topenVials: 0,\n\t\tsales: 0,\n\t\tpayments: 0,\n\t\ttxns: []\n\t});\n\tasync function J() {\n\t\tG(!0);\n\t\ttry {\n\t\t\tlet a = (e, t) => B.has(e) ? t().catch(() => []) : Promise.resolve([]), [s, u, d, f, p, m, h, g] = await Promise.all([\n\t\t\t\ta(\"view.manage.productManagement.category\", () => l()),\n\t\t\t\ta(\"view.manage.productManagement.brand\", () => c()),\n\t\t\t\ta(\"view.manage.productManagement.product\", () => o()),\n\t\t\t\ta(\"view.manage.productManagement.inventory\", () => t()),\n\t\t\t\ta(\"view.manage.productManagement.vial\", () => e()),\n\t\t\t\ta(\"view.manage.productManagement.sale\", () => n(0, 100)),\n\t\t\t\ta(\"view.manage.productManagement.payment\", () => i(0, 100)),\n\t\t\t\ta(\"view.manage.productManagement.ledger\", () => r(0, 8))\n\t\t\t]);\n\t\t\tq({\n\t\t\t\tcategories: s.length,\n\t\t\t\tbrands: u.length,\n\t\t\t\tproducts: d.length,\n\t\t\t\tbatches: f.length,\n\t\t\t\topenVials: p.length,\n\t\t\t\tsales: m.length,\n\t\t\t\tpayments: h.length,\n\t\t\t\ttxns: g\n\t\t\t});\n\t\t} finally {\n\t\t\tG(!1);\n\t\t}\n\t}\n\tg(\"view.manage.productManagement\", () => {\n\t\tJ();\n\t}, []);\n\tlet Y = {\n\t\tcatalog: [\n\t\t\t{\n\t\t\t\tlabel: \"Categories\",\n\t\t\t\tvalue: K.categories\n\t\t\t},\n\t\t\t{\n\t\t\t\tlabel: \"Brands\",\n\t\t\t\tvalue: K.brands\n\t\t\t},\n\t\t\t{\n\t\t\t\tlabel: \"Products\",\n\t\t\t\tvalue: K.products\n\t\t\t}\n\t\t],\n\t\toperations: [\n\t\t\t{\n\t\t\t\tlabel: \"Batches\",\n\t\t\t\tvalue: K.batches\n\t\t\t},\n\t\t\t{\n\t\t\t\tlabel: \"Open vials\",\n\t\t\t\tvalue: K.openVials\n\t\t\t},\n\t\t\t{\n\t\t\t\tlabel: \"Sales\",\n\t\t\t\tvalue: K.sales\n\t\t\t}\n\t\t],\n\t\tledger: [{\n\t\t\tlabel: \"Recent\",\n\t\t\tvalue: K.txns.length\n\t\t}]\n\t};\n\treturn /* @__PURE__ */ b(S, { children: [/* @__PURE__ */ y(m, {}), /* @__PURE__ */ y(_, {\n\t\tperm: \"view.manage.productManagement\",\n\t\tchildren: /* @__PURE__ */ b(f, {\n\t\t\ttitle: \"Product Management\",\n\t\t\tsubtitle: \"Choose where to start. Use Catalog to set up, Operations for daily work, and Ledger to review history.\",\n\t\t\tchips: [\n\t\t\t\t\"Generic\",\n\t\t\t\t\"Vaccine-aware\",\n\t\t\t\t\"Ledger-driven\"\n\t\t\t],\n\t\t\tchildren: [\n\t\t\t\tW ? /* @__PURE__ */ y(O, { sx: {\n\t\t\t\t\tmb: 2,\n\t\t\t\t\tborderRadius: 1\n\t\t\t\t} }) : null,\n\t\t\t\t/* @__PURE__ */ y(E, {\n\t\t\t\t\tcontainer: !0,\n\t\t\t\t\tspacing: 2.5,\n\t\t\t\t\tchildren: H.map((e, t) => /* @__PURE__ */ y(E, {\n\t\t\t\t\t\titem: !0,\n\t\t\t\t\t\txs: 12,\n\t\t\t\t\t\tmd: 4,\n\t\t\t\t\t\tchildren: /* @__PURE__ */ y(D, {\n\t\t\t\t\t\t\tin: !0,\n\t\t\t\t\t\t\ttimeout: 420,\n\t\t\t\t\t\t\tstyle: { transitionDelay: `${t * 80}ms` },\n\t\t\t\t\t\t\tchildren: /* @__PURE__ */ y(S, {\n\t\t\t\t\t\t\t\tsx: { height: \"100%\" },\n\t\t\t\t\t\t\t\tchildren: /* @__PURE__ */ y(R, {\n\t\t\t\t\t\t\t\t\tworkspace: e,\n\t\t\t\t\t\t\t\t\tmetrics: Y[e.id],\n\t\t\t\t\t\t\t\t\tloading: W,\n\t\t\t\t\t\t\t\t\tonItemClick: (e) => x(e.path)\n\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t})\n\t\t\t\t\t}, e.id))\n\t\t\t\t}),\n\t\t\t\tU ? /* @__PURE__ */ y(C, {\n\t\t\t\t\tsx: {\n\t\t\t\t\t\tborderRadius: 1.5,\n\t\t\t\t\t\tmt: 3,\n\t\t\t\t\t\tboxShadow: `0 12px 32px ${M(L.palette.common.black, .05)}`\n\t\t\t\t\t},\n\t\t\t\t\tchildren: /* @__PURE__ */ b(w, { children: [/* @__PURE__ */ b(A, {\n\t\t\t\t\t\tdirection: \"row\",\n\t\t\t\t\t\tjustifyContent: \"space-between\",\n\t\t\t\t\t\talignItems: \"center\",\n\t\t\t\t\t\tsx: { mb: 1.5 },\n\t\t\t\t\t\tchildren: [/* @__PURE__ */ b(S, { children: [/* @__PURE__ */ y(j, {\n\t\t\t\t\t\t\tvariant: \"overline\",\n\t\t\t\t\t\t\tsx: {\n\t\t\t\t\t\t\t\tcolor: \"text.secondary\",\n\t\t\t\t\t\t\t\tfontWeight: 800,\n\t\t\t\t\t\t\t\tletterSpacing: 1\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tchildren: \"Stock Ledger\"\n\t\t\t\t\t\t}), /* @__PURE__ */ y(j, {\n\t\t\t\t\t\t\tvariant: \"h6\",\n\t\t\t\t\t\t\tsx: {\n\t\t\t\t\t\t\t\tfontWeight: 800,\n\t\t\t\t\t\t\t\tlineHeight: 1.2\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tchildren: \"Recent activity\"\n\t\t\t\t\t\t})] }), /* @__PURE__ */ y(T, {\n\t\t\t\t\t\t\tclickable: !0,\n\t\t\t\t\t\t\ticon: /* @__PURE__ */ y(F, { sx: { fontSize: \"1rem !important\" } }),\n\t\t\t\t\t\t\tlabel: \"View ledger\",\n\t\t\t\t\t\t\tonClick: () => x(\"/ui/medplat/manage/pm/transactions\"),\n\t\t\t\t\t\t\tsx: {\n\t\t\t\t\t\t\t\tborderRadius: 2,\n\t\t\t\t\t\t\t\tfontWeight: 700,\n\t\t\t\t\t\t\t\tbgcolor: M(L.palette.primary.main, .08),\n\t\t\t\t\t\t\t\tcolor: \"primary.dark\",\n\t\t\t\t\t\t\t\t\"&:hover\": { bgcolor: M(L.palette.primary.main, .16) }\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t})]\n\t\t\t\t\t}), K.txns.length === 0 && !W ? /* @__PURE__ */ y(j, {\n\t\t\t\t\t\tvariant: \"body2\",\n\t\t\t\t\t\tcolor: \"text.secondary\",\n\t\t\t\t\t\tchildren: \"No activity yet — record a purchase or a sale to see entries here.\"\n\t\t\t\t\t}) : /* @__PURE__ */ y(A, {\n\t\t\t\t\t\tdivider: /* @__PURE__ */ y(S, { sx: { borderTop: `1px dashed ${L.palette.divider}` } }),\n\t\t\t\t\t\tspacing: 0,\n\t\t\t\t\t\tchildren: (W ? Array.from({ length: 4 }) : K.txns).map((e, t) => /* @__PURE__ */ b(S, {\n\t\t\t\t\t\t\tsx: {\n\t\t\t\t\t\t\t\tdisplay: \"flex\",\n\t\t\t\t\t\t\t\tjustifyContent: \"space-between\",\n\t\t\t\t\t\t\t\talignItems: \"center\",\n\t\t\t\t\t\t\t\tpy: 1.25,\n\t\t\t\t\t\t\t\tgap: 2\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tchildren: [/* @__PURE__ */ b(A, {\n\t\t\t\t\t\t\t\tdirection: \"row\",\n\t\t\t\t\t\t\t\talignItems: \"center\",\n\t\t\t\t\t\t\t\tspacing: 1.5,\n\t\t\t\t\t\t\t\tsx: { minWidth: 0 },\n\t\t\t\t\t\t\t\tchildren: [W ? /* @__PURE__ */ y(k, {\n\t\t\t\t\t\t\t\t\tvariant: \"rounded\",\n\t\t\t\t\t\t\t\t\twidth: 92,\n\t\t\t\t\t\t\t\t\theight: 22\n\t\t\t\t\t\t\t\t}) : /* @__PURE__ */ y(T, {\n\t\t\t\t\t\t\t\t\tsize: \"small\",\n\t\t\t\t\t\t\t\t\tlabel: e.transactionType,\n\t\t\t\t\t\t\t\t\tcolor: I[e.transactionType] || \"default\",\n\t\t\t\t\t\t\t\t\tsx: {\n\t\t\t\t\t\t\t\t\t\tfontWeight: 700,\n\t\t\t\t\t\t\t\t\t\tborderRadius: 1.5,\n\t\t\t\t\t\t\t\t\t\theight: 22\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}), /* @__PURE__ */ b(S, {\n\t\t\t\t\t\t\t\t\tsx: { minWidth: 0 },\n\t\t\t\t\t\t\t\t\tchildren: [W ? /* @__PURE__ */ y(k, {\n\t\t\t\t\t\t\t\t\t\twidth: 220,\n\t\t\t\t\t\t\t\t\t\theight: 20\n\t\t\t\t\t\t\t\t\t}) : /* @__PURE__ */ b(j, {\n\t\t\t\t\t\t\t\t\t\tvariant: \"body2\",\n\t\t\t\t\t\t\t\t\t\tsx: {\n\t\t\t\t\t\t\t\t\t\t\tfontWeight: 700,\n\t\t\t\t\t\t\t\t\t\t\tlineHeight: 1.2\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\tnoWrap: !0,\n\t\t\t\t\t\t\t\t\t\tchildren: [e.productName || \"—\", e.lotNumber ? /* @__PURE__ */ b(j, {\n\t\t\t\t\t\t\t\t\t\t\tcomponent: \"span\",\n\t\t\t\t\t\t\t\t\t\t\tvariant: \"body2\",\n\t\t\t\t\t\t\t\t\t\t\tcolor: \"text.secondary\",\n\t\t\t\t\t\t\t\t\t\t\tsx: {\n\t\t\t\t\t\t\t\t\t\t\t\tfontFamily: \"monospace\",\n\t\t\t\t\t\t\t\t\t\t\t\tml: 1\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\tchildren: [\"lot \", e.lotNumber]\n\t\t\t\t\t\t\t\t\t\t}) : null]\n\t\t\t\t\t\t\t\t\t}), W ? /* @__PURE__ */ y(k, {\n\t\t\t\t\t\t\t\t\t\twidth: 120,\n\t\t\t\t\t\t\t\t\t\theight: 16\n\t\t\t\t\t\t\t\t\t}) : /* @__PURE__ */ y(j, {\n\t\t\t\t\t\t\t\t\t\tvariant: \"caption\",\n\t\t\t\t\t\t\t\t\t\tcolor: \"text.secondary\",\n\t\t\t\t\t\t\t\t\t\tchildren: u(e.transactionTime)\n\t\t\t\t\t\t\t\t\t})]\n\t\t\t\t\t\t\t\t})]\n\t\t\t\t\t\t\t}), /* @__PURE__ */ y(S, {\n\t\t\t\t\t\t\t\tsx: {\n\t\t\t\t\t\t\t\t\ttextAlign: \"right\",\n\t\t\t\t\t\t\t\t\twhiteSpace: \"nowrap\"\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tchildren: W ? /* @__PURE__ */ y(k, {\n\t\t\t\t\t\t\t\t\twidth: 70,\n\t\t\t\t\t\t\t\t\theight: 20\n\t\t\t\t\t\t\t\t}) : /* @__PURE__ */ b(j, {\n\t\t\t\t\t\t\t\t\tvariant: \"body2\",\n\t\t\t\t\t\t\t\t\tsx: {\n\t\t\t\t\t\t\t\t\t\tfontWeight: 800,\n\t\t\t\t\t\t\t\t\t\tfontVariantNumeric: \"tabular-nums\"\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\tchildren: [\n\t\t\t\t\t\t\t\t\t\te.quantity == null ? \"\" : `qty ${e.quantity}`,\n\t\t\t\t\t\t\t\t\t\te.volumeMl == null ? \"\" : `${e.quantity == null ? \"\" : \" · \"}${d(e.volumeMl)} ml`,\n\t\t\t\t\t\t\t\t\t\te.monetaryAmount == null ? \"\" : `${e.quantity != null || e.volumeMl != null ? \" · \" : \"\"}${V}${d(e.monetaryAmount)}`\n\t\t\t\t\t\t\t\t\t]\n\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t})]\n\t\t\t\t\t\t}, e?.id ?? t))\n\t\t\t\t\t})] })\n\t\t\t\t}) : null\n\t\t\t]\n\t\t})\n\t})] });\n}\n//#endregion\nexport { z as default };\n\n//# sourceMappingURL=DashboardPage-CTiGSx71.js.map"],"names":["I","L","e","t","n","b","S","y","j","k","x","R","r","i","N","a","C","M","w","A","T","z","P","s","B","p","V","H","h","U","W","G","v","K","q","J","u","d","f","m","g","l","c","o","Y","_","O","E","D","F"],"mappings":";;;;;;;;;;AAWA,IAAIA,KAAI;AAAA,EACP,SAAS;AAAA,EACT,MAAM;AAAA,EACN,SAAS;AAAA,EACT,aAAa;AAAA,EACb,gBAAgB;AAAA,EAChB,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,YAAY;AAAA,EACZ,QAAQ;AAAA,EACR,cAAc;AAAA,EACd,cAAc;AAAA,EACd,aAAa;AACd;AACA,SAASC,EAAE,EAAE,OA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AA,oBAC5EA,EAAE,kBAAkB,OAAO,KAAK,GAAGA,EAAE,YAAY,QAAQA,EAAE,YAAY,OAAO,QAAQ,EAAE,GAAGwB,CAAC,GAAGW,EAAEnC,EAAE,cAAc,CAAC;AAAA,kBAC5H;AAAA,gBACA,CAAS;AAAA,cACT,CAAQ,CAAC;AAAA,YACT,IAASA,KAAA,gBAAAA,EAAG,OAAMC,CAAC,CAAC;AAAA,UACpB,CAAM,CAAC,EAAC,CAAE;AAAA,QACV,CAAK,IAAI;AAAA,MACT;AAAA,IACA,CAAG;AAAA,EACH,CAAE,CAAC,EAAC,CAAE;AACN;"}
|
|
1
|
+
{"version":3,"file":"DashboardPage-CTiGSx71-DX-TzGOH.js","sources":["../../productManagement/dist/DashboardPage-CTiGSx71.js"],"sourcesContent":["import { B as e, F as t, G as n, K as r, V as i, i as a, k as o, r as s, v as c, y as l } from \"./settingsStore-Df_wGo55.js\";\nimport { n as u, r as d } from \"./format-UOyOu75i.js\";\nimport { a as f, i as p, n as m, o as h, r as g, t as _ } from \"./PmGuard-BvUUbU80.js\";\nimport { useState as v } from \"react\";\nimport { jsx as y, jsxs as b } from \"react/jsx-runtime\";\nimport x from \"prop-types\";\nimport { Box as S, Card as C, CardContent as w, Chip as T, Grid as E, Grow as D, LinearProgress as O, Skeleton as k, Stack as A, Typography as j } from \"@mui/material\";\nimport { alpha as M, useTheme as N } from \"@mui/material/styles\";\nimport { useNavigate as P } from \"react-router-dom\";\nimport F from \"@mui/icons-material/ArrowForwardRounded\";\n//#region src/views/DashboardPage.jsx\nvar I = {\n\tRECEIPT: \"success\",\n\tSALE: \"primary\",\n\tPAYMENT: \"info\",\n\tVIAL_OPENED: \"info\",\n\tADMINISTRATION: \"info\",\n\tWASTAGE: \"warning\",\n\tEXPIRY: \"error\",\n\tQUARANTINE: \"error\",\n\tRECALL: \"error\",\n\tUNQUARANTINE: \"success\",\n\tTRANSFER_OUT: \"default\",\n\tTRANSFER_IN: \"default\"\n};\nfunction L({ label: e, value: t, loading: n }) {\n\treturn /* @__PURE__ */ b(S, { children: [/* @__PURE__ */ y(j, {\n\t\tvariant: \"caption\",\n\t\tcolor: \"text.secondary\",\n\t\tsx: {\n\t\t\tfontWeight: 700,\n\t\t\tletterSpacing: .5\n\t\t},\n\t\tchildren: e.toUpperCase()\n\t}), n ? /* @__PURE__ */ y(k, {\n\t\twidth: 48,\n\t\theight: 32\n\t}) : /* @__PURE__ */ y(j, {\n\t\tvariant: \"h5\",\n\t\tsx: {\n\t\t\tfontWeight: 800,\n\t\t\tfontVariantNumeric: \"tabular-nums\",\n\t\t\tlineHeight: 1.1,\n\t\t\tmt: .25\n\t\t},\n\t\tchildren: t\n\t})] });\n}\nL.propTypes = {\n\tlabel: x.string,\n\tvalue: x.node,\n\tloading: x.bool\n};\nfunction R({ workspace: e, metrics: t, loading: n, onItemClick: r }) {\n\tlet i = N(), a = e.icon;\n\treturn /* @__PURE__ */ y(C, {\n\t\tsx: {\n\t\t\tborderRadius: 1.5,\n\t\t\theight: \"100%\",\n\t\t\tposition: \"relative\",\n\t\t\toverflow: \"hidden\",\n\t\t\tborder: `1px solid ${M(e.accent, .18)}`,\n\t\t\tbackground: `linear-gradient(180deg, ${M(e.accent, .06)} 0%, ${M(i.palette.background.paper, 1)} 35%)`,\n\t\t\tboxShadow: `0 16px 36px ${M(e.accent, .08)}`,\n\t\t\ttransition: \"transform 240ms cubic-bezier(0.4, 0, 0.2, 1), box-shadow 240ms\",\n\t\t\t\"&:hover\": {\n\t\t\t\ttransform: \"translateY(-3px)\",\n\t\t\t\tboxShadow: `0 22px 50px ${M(e.accent, .18)}`\n\t\t\t},\n\t\t\t\"&::before\": {\n\t\t\t\tcontent: \"\\\"\\\"\",\n\t\t\t\tposition: \"absolute\",\n\t\t\t\tleft: 0,\n\t\t\t\tright: 0,\n\t\t\t\ttop: 0,\n\t\t\t\theight: 4,\n\t\t\t\tbackground: `linear-gradient(90deg, ${e.accent} 0%, ${e.accentDark} 100%)`\n\t\t\t}\n\t\t},\n\t\tchildren: /* @__PURE__ */ b(w, {\n\t\t\tsx: {\n\t\t\t\tpt: 3,\n\t\t\t\tdisplay: \"flex\",\n\t\t\t\tflexDirection: \"column\",\n\t\t\t\theight: \"100%\"\n\t\t\t},\n\t\t\tchildren: [\n\t\t\t\t/* @__PURE__ */ b(A, {\n\t\t\t\t\tdirection: \"row\",\n\t\t\t\t\talignItems: \"center\",\n\t\t\t\t\tspacing: 1.5,\n\t\t\t\t\tchildren: [/* @__PURE__ */ y(S, {\n\t\t\t\t\t\tsx: {\n\t\t\t\t\t\t\twidth: 44,\n\t\t\t\t\t\t\theight: 44,\n\t\t\t\t\t\t\tborderRadius: 1.5,\n\t\t\t\t\t\t\tdisplay: \"grid\",\n\t\t\t\t\t\t\tplaceItems: \"center\",\n\t\t\t\t\t\t\tcolor: \"#fff\",\n\t\t\t\t\t\t\tbackground: `linear-gradient(135deg, ${e.accent} 0%, ${e.accentDark} 100%)`,\n\t\t\t\t\t\t\tboxShadow: `0 8px 18px ${M(e.accent, .3)}`\n\t\t\t\t\t\t},\n\t\t\t\t\t\tchildren: /* @__PURE__ */ y(a, { sx: { fontSize: 24 } })\n\t\t\t\t\t}), /* @__PURE__ */ b(S, {\n\t\t\t\t\t\tsx: {\n\t\t\t\t\t\t\tflexGrow: 1,\n\t\t\t\t\t\t\tminWidth: 0\n\t\t\t\t\t\t},\n\t\t\t\t\t\tchildren: [/* @__PURE__ */ y(j, {\n\t\t\t\t\t\t\tvariant: \"overline\",\n\t\t\t\t\t\t\tsx: {\n\t\t\t\t\t\t\t\tcolor: e.accentDark,\n\t\t\t\t\t\t\t\tfontWeight: 800,\n\t\t\t\t\t\t\t\tletterSpacing: 1.1,\n\t\t\t\t\t\t\t\tlineHeight: 1\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tchildren: \"Workspace\"\n\t\t\t\t\t\t}), /* @__PURE__ */ y(j, {\n\t\t\t\t\t\t\tvariant: \"h6\",\n\t\t\t\t\t\t\tsx: {\n\t\t\t\t\t\t\t\tfontWeight: 800,\n\t\t\t\t\t\t\t\tlineHeight: 1.2\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tchildren: e.label\n\t\t\t\t\t\t})]\n\t\t\t\t\t})]\n\t\t\t\t}),\n\t\t\t\t/* @__PURE__ */ y(j, {\n\t\t\t\t\tvariant: \"body2\",\n\t\t\t\t\tcolor: \"text.secondary\",\n\t\t\t\t\tsx: {\n\t\t\t\t\t\tmt: 1.5,\n\t\t\t\t\t\tmb: 2\n\t\t\t\t\t},\n\t\t\t\t\tchildren: e.description\n\t\t\t\t}),\n\t\t\t\tt?.length ? /* @__PURE__ */ y(A, {\n\t\t\t\t\tdirection: \"row\",\n\t\t\t\t\tspacing: 3,\n\t\t\t\t\tsx: { mb: 2.5 },\n\t\t\t\t\tchildren: t.map((e) => /* @__PURE__ */ y(L, {\n\t\t\t\t\t\tlabel: e.label,\n\t\t\t\t\t\tvalue: e.value,\n\t\t\t\t\t\tloading: n\n\t\t\t\t\t}, e.label))\n\t\t\t\t}) : null,\n\t\t\t\t/* @__PURE__ */ y(S, {\n\t\t\t\t\tsx: { mt: \"auto\" },\n\t\t\t\t\tchildren: /* @__PURE__ */ y(A, {\n\t\t\t\t\t\tdirection: \"row\",\n\t\t\t\t\t\tspacing: 1,\n\t\t\t\t\t\tflexWrap: \"wrap\",\n\t\t\t\t\t\tuseFlexGap: !0,\n\t\t\t\t\t\tchildren: e.items.map((t) => {\n\t\t\t\t\t\t\tlet n = t.icon;\n\t\t\t\t\t\t\treturn /* @__PURE__ */ y(T, {\n\t\t\t\t\t\t\t\ticon: n ? /* @__PURE__ */ y(n, { sx: {\n\t\t\t\t\t\t\t\t\tfontSize: \"1rem !important\",\n\t\t\t\t\t\t\t\t\tcolor: `${e.accentDark} !important`\n\t\t\t\t\t\t\t\t} }) : void 0,\n\t\t\t\t\t\t\t\tlabel: t.label,\n\t\t\t\t\t\t\t\tonClick: () => r(t),\n\t\t\t\t\t\t\t\tsx: {\n\t\t\t\t\t\t\t\t\tborderRadius: 2,\n\t\t\t\t\t\t\t\t\tfontWeight: 700,\n\t\t\t\t\t\t\t\t\tbackgroundColor: M(e.accent, .08),\n\t\t\t\t\t\t\t\t\tcolor: e.accentDark,\n\t\t\t\t\t\t\t\t\tborder: `1px solid ${M(e.accent, .18)}`,\n\t\t\t\t\t\t\t\t\ttransition: \"all 180ms ease\",\n\t\t\t\t\t\t\t\t\t\"&:hover\": {\n\t\t\t\t\t\t\t\t\t\tbackgroundColor: M(e.accent, .18),\n\t\t\t\t\t\t\t\t\t\ttransform: \"translateY(-1px)\"\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}, t.id);\n\t\t\t\t\t\t})\n\t\t\t\t\t})\n\t\t\t\t})\n\t\t\t]\n\t\t})\n\t});\n}\nR.propTypes = {\n\tworkspace: x.object.isRequired,\n\tmetrics: x.array,\n\tloading: x.bool,\n\tonItemClick: x.func.isRequired\n};\nfunction z() {\n\tlet x = P(), L = N(), z = s(), B = p(), V = a(z?.currencyCode), H = h(B, z), U = B.has(\"view.manage.productManagement.ledger\"), [W, G] = v(!0), [K, q] = v({\n\t\tcategories: 0,\n\t\tbrands: 0,\n\t\tproducts: 0,\n\t\tbatches: 0,\n\t\topenVials: 0,\n\t\tsales: 0,\n\t\tpayments: 0,\n\t\ttxns: []\n\t});\n\tasync function J() {\n\t\tG(!0);\n\t\ttry {\n\t\t\tlet a = (e, t) => B.has(e) ? t().catch(() => []) : Promise.resolve([]), [s, u, d, f, p, m, h, g] = await Promise.all([\n\t\t\t\ta(\"view.manage.productManagement.category\", () => l()),\n\t\t\t\ta(\"view.manage.productManagement.brand\", () => c()),\n\t\t\t\ta(\"view.manage.productManagement.product\", () => o()),\n\t\t\t\ta(\"view.manage.productManagement.inventory\", () => t()),\n\t\t\t\ta(\"view.manage.productManagement.vial\", () => e()),\n\t\t\t\ta(\"view.manage.productManagement.sale\", () => n(0, 100)),\n\t\t\t\ta(\"view.manage.productManagement.payment\", () => i(0, 100)),\n\t\t\t\ta(\"view.manage.productManagement.ledger\", () => r(0, 8))\n\t\t\t]);\n\t\t\tq({\n\t\t\t\tcategories: s.length,\n\t\t\t\tbrands: u.length,\n\t\t\t\tproducts: d.length,\n\t\t\t\tbatches: f.length,\n\t\t\t\topenVials: p.length,\n\t\t\t\tsales: m.length,\n\t\t\t\tpayments: h.length,\n\t\t\t\ttxns: g\n\t\t\t});\n\t\t} finally {\n\t\t\tG(!1);\n\t\t}\n\t}\n\tg(\"view.manage.productManagement\", () => {\n\t\tJ();\n\t}, []);\n\tlet Y = {\n\t\tcatalog: [\n\t\t\t{\n\t\t\t\tlabel: \"Categories\",\n\t\t\t\tvalue: K.categories\n\t\t\t},\n\t\t\t{\n\t\t\t\tlabel: \"Brands\",\n\t\t\t\tvalue: K.brands\n\t\t\t},\n\t\t\t{\n\t\t\t\tlabel: \"Products\",\n\t\t\t\tvalue: K.products\n\t\t\t}\n\t\t],\n\t\toperations: [\n\t\t\t{\n\t\t\t\tlabel: \"Batches\",\n\t\t\t\tvalue: K.batches\n\t\t\t},\n\t\t\t{\n\t\t\t\tlabel: \"Open vials\",\n\t\t\t\tvalue: K.openVials\n\t\t\t},\n\t\t\t{\n\t\t\t\tlabel: \"Sales\",\n\t\t\t\tvalue: K.sales\n\t\t\t}\n\t\t],\n\t\tledger: [{\n\t\t\tlabel: \"Recent\",\n\t\t\tvalue: K.txns.length\n\t\t}]\n\t};\n\treturn /* @__PURE__ */ b(S, { children: [/* @__PURE__ */ y(m, {}), /* @__PURE__ */ y(_, {\n\t\tperm: \"view.manage.productManagement\",\n\t\tchildren: /* @__PURE__ */ b(f, {\n\t\t\ttitle: \"Product Management\",\n\t\t\tsubtitle: \"Choose where to start. Use Catalog to set up, Operations for daily work, and Ledger to review history.\",\n\t\t\tchips: [\n\t\t\t\t\"Generic\",\n\t\t\t\t\"Vaccine-aware\",\n\t\t\t\t\"Ledger-driven\"\n\t\t\t],\n\t\t\tchildren: [\n\t\t\t\tW ? /* @__PURE__ */ y(O, { sx: {\n\t\t\t\t\tmb: 2,\n\t\t\t\t\tborderRadius: 1\n\t\t\t\t} }) : null,\n\t\t\t\t/* @__PURE__ */ y(E, {\n\t\t\t\t\tcontainer: !0,\n\t\t\t\t\tspacing: 2.5,\n\t\t\t\t\tchildren: H.map((e, t) => /* @__PURE__ */ y(E, {\n\t\t\t\t\t\titem: !0,\n\t\t\t\t\t\txs: 12,\n\t\t\t\t\t\tmd: 4,\n\t\t\t\t\t\tchildren: /* @__PURE__ */ y(D, {\n\t\t\t\t\t\t\tin: !0,\n\t\t\t\t\t\t\ttimeout: 420,\n\t\t\t\t\t\t\tstyle: { transitionDelay: `${t * 80}ms` },\n\t\t\t\t\t\t\tchildren: /* @__PURE__ */ y(S, {\n\t\t\t\t\t\t\t\tsx: { height: \"100%\" },\n\t\t\t\t\t\t\t\tchildren: /* @__PURE__ */ y(R, {\n\t\t\t\t\t\t\t\t\tworkspace: e,\n\t\t\t\t\t\t\t\t\tmetrics: Y[e.id],\n\t\t\t\t\t\t\t\t\tloading: W,\n\t\t\t\t\t\t\t\t\tonItemClick: (e) => x(e.path)\n\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t})\n\t\t\t\t\t}, e.id))\n\t\t\t\t}),\n\t\t\t\tU ? /* @__PURE__ */ y(C, {\n\t\t\t\t\tsx: {\n\t\t\t\t\t\tborderRadius: 1.5,\n\t\t\t\t\t\tmt: 3,\n\t\t\t\t\t\tboxShadow: `0 12px 32px ${M(L.palette.common.black, .05)}`\n\t\t\t\t\t},\n\t\t\t\t\tchildren: /* @__PURE__ */ b(w, { children: [/* @__PURE__ */ b(A, {\n\t\t\t\t\t\tdirection: \"row\",\n\t\t\t\t\t\tjustifyContent: \"space-between\",\n\t\t\t\t\t\talignItems: \"center\",\n\t\t\t\t\t\tsx: { mb: 1.5 },\n\t\t\t\t\t\tchildren: [/* @__PURE__ */ b(S, { children: [/* @__PURE__ */ y(j, {\n\t\t\t\t\t\t\tvariant: \"overline\",\n\t\t\t\t\t\t\tsx: {\n\t\t\t\t\t\t\t\tcolor: \"text.secondary\",\n\t\t\t\t\t\t\t\tfontWeight: 800,\n\t\t\t\t\t\t\t\tletterSpacing: 1\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tchildren: \"Stock Ledger\"\n\t\t\t\t\t\t}), /* @__PURE__ */ y(j, {\n\t\t\t\t\t\t\tvariant: \"h6\",\n\t\t\t\t\t\t\tsx: {\n\t\t\t\t\t\t\t\tfontWeight: 800,\n\t\t\t\t\t\t\t\tlineHeight: 1.2\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tchildren: \"Recent activity\"\n\t\t\t\t\t\t})] }), /* @__PURE__ */ y(T, {\n\t\t\t\t\t\t\tclickable: !0,\n\t\t\t\t\t\t\ticon: /* @__PURE__ */ y(F, { sx: { fontSize: \"1rem !important\" } }),\n\t\t\t\t\t\t\tlabel: \"View ledger\",\n\t\t\t\t\t\t\tonClick: () => x(\"/ui/medplat/manage/pm/transactions\"),\n\t\t\t\t\t\t\tsx: {\n\t\t\t\t\t\t\t\tborderRadius: 2,\n\t\t\t\t\t\t\t\tfontWeight: 700,\n\t\t\t\t\t\t\t\tbgcolor: M(L.palette.primary.main, .08),\n\t\t\t\t\t\t\t\tcolor: \"primary.dark\",\n\t\t\t\t\t\t\t\t\"&:hover\": { bgcolor: M(L.palette.primary.main, .16) }\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t})]\n\t\t\t\t\t}), K.txns.length === 0 && !W ? /* @__PURE__ */ y(j, {\n\t\t\t\t\t\tvariant: \"body2\",\n\t\t\t\t\t\tcolor: \"text.secondary\",\n\t\t\t\t\t\tchildren: \"No activity yet — record a purchase or a sale to see entries here.\"\n\t\t\t\t\t}) : /* @__PURE__ */ y(A, {\n\t\t\t\t\t\tdivider: /* @__PURE__ */ y(S, { sx: { borderTop: `1px dashed ${L.palette.divider}` } }),\n\t\t\t\t\t\tspacing: 0,\n\t\t\t\t\t\tchildren: (W ? Array.from({ length: 4 }) : K.txns).map((e, t) => /* @__PURE__ */ b(S, {\n\t\t\t\t\t\t\tsx: {\n\t\t\t\t\t\t\t\tdisplay: \"flex\",\n\t\t\t\t\t\t\t\tjustifyContent: \"space-between\",\n\t\t\t\t\t\t\t\talignItems: \"center\",\n\t\t\t\t\t\t\t\tpy: 1.25,\n\t\t\t\t\t\t\t\tgap: 2\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tchildren: [/* @__PURE__ */ b(A, {\n\t\t\t\t\t\t\t\tdirection: \"row\",\n\t\t\t\t\t\t\t\talignItems: \"center\",\n\t\t\t\t\t\t\t\tspacing: 1.5,\n\t\t\t\t\t\t\t\tsx: { minWidth: 0 },\n\t\t\t\t\t\t\t\tchildren: [W ? /* @__PURE__ */ y(k, {\n\t\t\t\t\t\t\t\t\tvariant: \"rounded\",\n\t\t\t\t\t\t\t\t\twidth: 92,\n\t\t\t\t\t\t\t\t\theight: 22\n\t\t\t\t\t\t\t\t}) : /* @__PURE__ */ y(T, {\n\t\t\t\t\t\t\t\t\tsize: \"small\",\n\t\t\t\t\t\t\t\t\tlabel: e.transactionType,\n\t\t\t\t\t\t\t\t\tcolor: I[e.transactionType] || \"default\",\n\t\t\t\t\t\t\t\t\tsx: {\n\t\t\t\t\t\t\t\t\t\tfontWeight: 700,\n\t\t\t\t\t\t\t\t\t\tborderRadius: 1.5,\n\t\t\t\t\t\t\t\t\t\theight: 22\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}), /* @__PURE__ */ b(S, {\n\t\t\t\t\t\t\t\t\tsx: { minWidth: 0 },\n\t\t\t\t\t\t\t\t\tchildren: [W ? /* @__PURE__ */ y(k, {\n\t\t\t\t\t\t\t\t\t\twidth: 220,\n\t\t\t\t\t\t\t\t\t\theight: 20\n\t\t\t\t\t\t\t\t\t}) : /* @__PURE__ */ b(j, {\n\t\t\t\t\t\t\t\t\t\tvariant: \"body2\",\n\t\t\t\t\t\t\t\t\t\tsx: {\n\t\t\t\t\t\t\t\t\t\t\tfontWeight: 700,\n\t\t\t\t\t\t\t\t\t\t\tlineHeight: 1.2\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\tnoWrap: !0,\n\t\t\t\t\t\t\t\t\t\tchildren: [e.productName || \"—\", e.lotNumber ? /* @__PURE__ */ b(j, {\n\t\t\t\t\t\t\t\t\t\t\tcomponent: \"span\",\n\t\t\t\t\t\t\t\t\t\t\tvariant: \"body2\",\n\t\t\t\t\t\t\t\t\t\t\tcolor: \"text.secondary\",\n\t\t\t\t\t\t\t\t\t\t\tsx: {\n\t\t\t\t\t\t\t\t\t\t\t\tfontFamily: \"monospace\",\n\t\t\t\t\t\t\t\t\t\t\t\tml: 1\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\tchildren: [\"lot \", e.lotNumber]\n\t\t\t\t\t\t\t\t\t\t}) : null]\n\t\t\t\t\t\t\t\t\t}), W ? /* @__PURE__ */ y(k, {\n\t\t\t\t\t\t\t\t\t\twidth: 120,\n\t\t\t\t\t\t\t\t\t\theight: 16\n\t\t\t\t\t\t\t\t\t}) : /* @__PURE__ */ y(j, {\n\t\t\t\t\t\t\t\t\t\tvariant: \"caption\",\n\t\t\t\t\t\t\t\t\t\tcolor: \"text.secondary\",\n\t\t\t\t\t\t\t\t\t\tchildren: u(e.transactionTime)\n\t\t\t\t\t\t\t\t\t})]\n\t\t\t\t\t\t\t\t})]\n\t\t\t\t\t\t\t}), /* @__PURE__ */ y(S, {\n\t\t\t\t\t\t\t\tsx: {\n\t\t\t\t\t\t\t\t\ttextAlign: \"right\",\n\t\t\t\t\t\t\t\t\twhiteSpace: \"nowrap\"\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tchildren: W ? /* @__PURE__ */ y(k, {\n\t\t\t\t\t\t\t\t\twidth: 70,\n\t\t\t\t\t\t\t\t\theight: 20\n\t\t\t\t\t\t\t\t}) : /* @__PURE__ */ b(j, {\n\t\t\t\t\t\t\t\t\tvariant: \"body2\",\n\t\t\t\t\t\t\t\t\tsx: {\n\t\t\t\t\t\t\t\t\t\tfontWeight: 800,\n\t\t\t\t\t\t\t\t\t\tfontVariantNumeric: \"tabular-nums\"\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\tchildren: [\n\t\t\t\t\t\t\t\t\t\te.quantity == null ? \"\" : `qty ${e.quantity}`,\n\t\t\t\t\t\t\t\t\t\te.volumeMl == null ? \"\" : `${e.quantity == null ? \"\" : \" · \"}${d(e.volumeMl)} ml`,\n\t\t\t\t\t\t\t\t\t\te.monetaryAmount == null ? \"\" : `${e.quantity != null || e.volumeMl != null ? \" · \" : \"\"}${V}${d(e.monetaryAmount)}`\n\t\t\t\t\t\t\t\t\t]\n\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t})]\n\t\t\t\t\t\t}, e?.id ?? t))\n\t\t\t\t\t})] })\n\t\t\t\t}) : null\n\t\t\t]\n\t\t})\n\t})] });\n}\n//#endregion\nexport { z as default };\n\n//# sourceMappingURL=DashboardPage-CTiGSx71.js.map"],"names":["I","L","e","t","n","b","S","y","j","k","x","R","r","i","N","a","C","M","w","A","T","z","P","s","B","p","V","H","h","U","W","G","v","K","q","J","u","d","f","m","g","l","c","o","Y","_","O","E","D","F"],"mappings":";;;;;;;;;;AAWA,IAAIA,KAAI;AAAA,EACP,SAAS;AAAA,EACT,MAAM;AAAA,EACN,SAAS;AAAA,EACT,aAAa;AAAA,EACb,gBAAgB;AAAA,EAChB,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,YAAY;AAAA,EACZ,QAAQ;AAAA,EACR,cAAc;AAAA,EACd,cAAc;AAAA,EACd,aAAa;AACd;AACA,SAASC,EAAE,EAAE,OAAOC,GAAG,OAAOC,GAAG,SAASC,KAAK;AAC9C,SAAuBC,gBAAAA,EAAEC,GAAG,EAAE,U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AO,QAAQ,EAAE,GAAGwB,CAAC,GAAGW,EAAEnC,EAAE,cAAc,CAAC;AAAA,kBAC5H;AAAA,gBACA,CAAS;AAAA,cACT,CAAQ,CAAC;AAAA,YACT,IAASA,KAAA,gBAAAA,EAAG,OAAMC,CAAC,CAAC;AAAA,UACpB,CAAM,CAAC,EAAC,CAAE;AAAA,QACV,CAAK,IAAI;AAAA,MACT;AAAA,IACA,CAAG;AAAA,EACH,CAAE,CAAC,EAAC,CAAE;AACN;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as E, x as L, S as B } from "./ImmunizationConfigurationBase-
|
|
1
|
+
import { C as E, x as L, S as B } from "./ImmunizationConfigurationBase-Clkk0-n6.js";
|
|
2
2
|
import { useState as a, useEffect as h, useMemo as S } from "react";
|
|
3
3
|
import { jsx as y, jsxs as W, Fragment as k } from "react/jsx-runtime";
|
|
4
4
|
import { Autocomplete as D, TextField as R, CircularProgress as V } from "@mui/material";
|
|
@@ -109,4 +109,4 @@ function K({ value: o, onChange: d, label: C = "Facility", scope: O = "assigned"
|
|
|
109
109
|
export {
|
|
110
110
|
K as f
|
|
111
111
|
};
|
|
112
|
-
//# sourceMappingURL=FacilityPicker-BXa2VF7i-
|
|
112
|
+
//# sourceMappingURL=FacilityPicker-BXa2VF7i-D0JUIqLv.js.map
|
package/dist/{FacilityPicker-BXa2VF7i-Dab_Jwa5.js.map → FacilityPicker-BXa2VF7i-D0JUIqLv.js.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FacilityPicker-BXa2VF7i-
|
|
1
|
+
{"version":3,"file":"FacilityPicker-BXa2VF7i-D0JUIqLv.js","sources":["../../productManagement/dist/FacilityPicker-BXa2VF7i.js"],"sourcesContent":["import { L as e, at as t, b as n } from \"./settingsStore-Df_wGo55.js\";\nimport { useEffect as r, useMemo as i, useState as a } from \"react\";\nimport { Fragment as o, jsx as s, jsxs as c } from \"react/jsx-runtime\";\nimport { Autocomplete as l, CircularProgress as u, TextField as d } from \"@mui/material\";\n//#region src/components/FacilityPicker.jsx\nfunction f({ value: f, onChange: p, label: m = \"Facility\", scope: h = \"assigned\", required: g = !1, disabled: _ = !1, error: v = !1, helperText: y = \"\", onBlur: b, size: x = \"small\", fullWidth: S = !0 }) {\n\tlet C = h === \"all\", [w, T] = a(!1), [E, D] = a([]), [O, k] = a(!1), [A, j] = a(!1), [M, N] = a(null), [P, F] = a(\"\");\n\tr(() => {\n\t\tif (!f) {\n\t\t\tN(null);\n\t\t\treturn;\n\t\t}\n\t\tif (M?.id === f) return;\n\t\tlet e = E.find((e) => e.id === f);\n\t\tif (e) {\n\t\t\tN(e);\n\t\t\treturn;\n\t\t}\n\t\tlet t = !1;\n\t\treturn (async () => {\n\t\t\ttry {\n\t\t\t\tlet e = await n([f]);\n\t\t\t\t!t && e[0] && N(e[0]);\n\t\t\t} catch {}\n\t\t})(), () => {\n\t\t\tt = !0;\n\t\t};\n\t}, [f]), r(() => {\n\t\tif (C || !w || A) return;\n\t\tlet t = !1;\n\t\treturn k(!0), (async () => {\n\t\t\ttry {\n\t\t\t\tlet n = await e();\n\t\t\t\tt || D(n);\n\t\t\t} catch {\n\t\t\t\tt || D([]);\n\t\t\t} finally {\n\t\t\t\tt || (k(!1), j(!0));\n\t\t\t}\n\t\t})(), () => {\n\t\t\tt = !0;\n\t\t};\n\t}, [\n\t\tC,\n\t\tw,\n\t\tA\n\t]), r(() => {\n\t\tif (!C || !w) return;\n\t\tlet e = !1;\n\t\tk(!0);\n\t\tlet n = setTimeout(() => {\n\t\t\t(async () => {\n\t\t\t\ttry {\n\t\t\t\t\tlet n = await t(P);\n\t\t\t\t\te || D(n);\n\t\t\t\t} catch {\n\t\t\t\t\te || D([]);\n\t\t\t\t} finally {\n\t\t\t\t\te || (k(!1), j(!0));\n\t\t\t\t}\n\t\t\t})();\n\t\t}, 300);\n\t\treturn () => {\n\t\t\te = !0, clearTimeout(n);\n\t\t};\n\t}, [\n\t\tC,\n\t\tw,\n\t\tP\n\t]);\n\tlet I = i(() => !M || E.some((e) => e.id === M.id) ? E : [M, ...E], [E, M]), L = O ? \"Loading…\" : A && E.length === 0 ? C ? \"No active facilities match\" : \"No facilities assigned to your account\" : \"No matches\", R = C ? \"Any active facility can be chosen. Type to search.\" : \"Only facilities assigned to your account are shown. Type to filter.\";\n\treturn /* @__PURE__ */ s(l, {\n\t\tsize: x,\n\t\tfullWidth: S,\n\t\tdisabled: _,\n\t\topen: w,\n\t\tonOpen: () => T(!0),\n\t\tonClose: () => T(!1),\n\t\tvalue: M,\n\t\tisOptionEqualToValue: (e, t) => e?.id === t?.id,\n\t\tgetOptionLabel: (e) => e?.name ?? \"\",\n\t\toptions: I,\n\t\tloading: O,\n\t\tfilterOptions: C ? (e) => e : void 0,\n\t\tonInputChange: C ? (e, t, n) => {\n\t\t\tn === \"input\" && F(t);\n\t\t} : void 0,\n\t\tonChange: (e, t) => {\n\t\t\tN(t ?? null), p?.(t?.id ?? \"\");\n\t\t},\n\t\tnoOptionsText: L,\n\t\trenderInput: (e) => /* @__PURE__ */ s(d, {\n\t\t\t...e,\n\t\t\trequired: g,\n\t\t\tlabel: m,\n\t\t\terror: v,\n\t\t\thelperText: y || R,\n\t\t\tonBlur: b,\n\t\t\tInputProps: {\n\t\t\t\t...e.InputProps,\n\t\t\t\tendAdornment: /* @__PURE__ */ c(o, { children: [O ? /* @__PURE__ */ s(u, {\n\t\t\t\t\tcolor: \"inherit\",\n\t\t\t\t\tsize: 16\n\t\t\t\t}) : null, e.InputProps.endAdornment] })\n\t\t\t}\n\t\t})\n\t});\n}\n//#endregion\nexport { f as t };\n\n//# sourceMappingURL=FacilityPicker-BXa2VF7i.js.map"],"names":["f","p","m","h","g","_","v","y","b","x","S","C","w","T","a","E","D","O","k","A","j","M","N","P","F","r","e","n","t","I","i","L","R","s","l","d","c","o","u"],"mappings":";;;;AAKA,SAASA,EAAE,EAAE,OAAOA,GAAG,UAAUC,GAAG,OAAOC,IAAI,YAAY,O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