@argusoft/medplat-core 1.0.30 → 1.0.32
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-xrday-L1.js → AccessRights-DBjTQA1-.js} +395 -390
- package/dist/AccessRights-DBjTQA1-.js.map +1 -0
- package/dist/{AddFeatures-D1sU8RjY.js → AddFeatures-COj4ZTIM.js} +2 -2
- package/dist/{AddFeatures-D1sU8RjY.js.map → AddFeatures-COj4ZTIM.js.map} +1 -1
- package/dist/AddMenuConfiguration-Creeib5X.js +11223 -0
- package/dist/AddMenuConfiguration-Creeib5X.js.map +1 -0
- package/dist/AddMenuConfiguration.css +1 -1
- package/dist/{BrandsPage-DmRW5bhm-Bk1szrjI.js → BrandsPage-CdcAvaml-ZtVTX6vX.js} +43 -43
- package/dist/{BrandsPage-DmRW5bhm-Bk1szrjI.js.map → BrandsPage-CdcAvaml-ZtVTX6vX.js.map} +1 -1
- package/dist/{CategoriesPage-BsS5IQh3-B03lWRY5.js → CategoriesPage-BprQEYJw-CclreTv1.js} +109 -102
- package/dist/CategoriesPage-BprQEYJw-CclreTv1.js.map +1 -0
- package/dist/{ChangePasswordModalCore-BPsJquTS.js → ChangePasswordModalCore-DZGOkbRY.js} +3 -3
- package/dist/{ChangePasswordModalCore-BPsJquTS.js.map → ChangePasswordModalCore-DZGOkbRY.js.map} +1 -1
- package/dist/ConditionConfig-Bpm6OoV5.js +408 -0
- package/dist/ConditionConfig-Bpm6OoV5.js.map +1 -0
- package/dist/{DashboardPage-C3bKc5na-sBd9Yqbi.js → DashboardPage-CTiGSx71-CsYohJ5e.js} +32 -32
- package/dist/{DashboardPage-C3bKc5na-sBd9Yqbi.js.map → DashboardPage-CTiGSx71-CsYohJ5e.js.map} +1 -1
- package/dist/EntityManagement-BGwJGl9k.js +62 -0
- package/dist/EntityManagement-BGwJGl9k.js.map +1 -0
- package/dist/EventConfig-BY2cgGyx.js +27 -0
- package/dist/{EventConfig-BmLemzX3.js.map → EventConfig-BY2cgGyx.js.map} +1 -1
- package/dist/EventConfigurations-B-z7xHh_.js +544 -0
- package/dist/EventConfigurations-B-z7xHh_.js.map +1 -0
- package/dist/EventConfigurations.css +1 -1
- package/dist/EventsExceptionModal-DafomIv6.js +188 -0
- package/dist/EventsExceptionModal-DafomIv6.js.map +1 -0
- package/dist/EventsUi-Dl_yckSA.js +263 -0
- package/dist/EventsUi-Dl_yckSA.js.map +1 -0
- package/dist/FacilityPicker-BXa2VF7i-Dab_Jwa5.js +112 -0
- package/dist/FacilityPicker-BXa2VF7i-Dab_Jwa5.js.map +1 -0
- package/dist/{FeatureMenu-DYJmDt7q.js → FeatureMenu-Kc73yPHH.js} +9 -5
- package/dist/FeatureMenu-Kc73yPHH.js.map +1 -0
- package/dist/{FhirServerList-DuTwnngN.js → FhirServerList-CrIHMAxz.js} +16 -16
- package/dist/{FhirServerList-DuTwnngN.js.map → FhirServerList-CrIHMAxz.js.map} +1 -1
- package/dist/{FhirServerProfile-CUOwC6Wb.js → FhirServerProfile-D3aYcpwY.js} +8 -8
- package/dist/{FhirServerProfile-CUOwC6Wb.js.map → FhirServerProfile-D3aYcpwY.js.map} +1 -1
- package/dist/{FhirServerWizard-DZI8Olku.js → FhirServerWizard-Db6Hm4bQ.js} +15 -15
- package/dist/{FhirServerWizard-DZI8Olku.js.map → FhirServerWizard-Db6Hm4bQ.js.map} +1 -1
- package/dist/{GrantPermissionModal-BDN66Atn.js → GrantPermissionModal-D7iNZd0M.js} +54 -51
- package/dist/GrantPermissionModal-D7iNZd0M.js.map +1 -0
- package/dist/ImmunizationConfigurationBase-lKsJZMak.js +8060 -0
- package/dist/ImmunizationConfigurationBase-lKsJZMak.js.map +1 -0
- package/dist/InventoryPage-JadYMCzU-CzJQfQ2A.js +1017 -0
- package/dist/InventoryPage-JadYMCzU-CzJQfQ2A.js.map +1 -0
- package/dist/LocationWiseExpectedTargetPage-CjKk1aTF.js +1344 -0
- package/dist/LocationWiseExpectedTargetPage-CjKk1aTF.js.map +1 -0
- package/dist/{ManageDynamicFeature-BU0I45dd.js → ManageDynamicFeature-CuyYfx_P.js} +104 -97
- package/dist/ManageDynamicFeature-CuyYfx_P.js.map +1 -0
- package/dist/ManageEventConfiguration-DqPbn3Oi.js +1216 -0
- package/dist/ManageEventConfiguration-DqPbn3Oi.js.map +1 -0
- package/dist/ManageEventConfiguration.css +1 -1
- package/dist/ManageRole-CyfpySt9.js +981 -0
- package/dist/ManageRole-CyfpySt9.js.map +1 -0
- package/dist/{ManageUser-DCFkUMV9.js → ManageUser-Dm0l833u.js} +286 -286
- package/dist/{ManageUser-DCFkUMV9.js.map → ManageUser-Dm0l833u.js.map} +1 -1
- package/dist/{MemberProfileCard-BdUNgHRB-VywqQdFF.js → MemberProfileCard-01d_jz3w-DYHtbgMX.js} +46 -46
- package/dist/{MemberProfileCard-BdUNgHRB-VywqQdFF.js.map → MemberProfileCard-01d_jz3w-DYHtbgMX.js.map} +1 -1
- package/dist/MobileAnalytics-C9oc2yAo.js +18399 -0
- package/dist/MobileAnalytics-C9oc2yAo.js.map +1 -0
- package/dist/MobileMenuManagement-BmzTPXy7.js +231 -0
- package/dist/MobileMenuManagement-BmzTPXy7.js.map +1 -0
- package/dist/MobileTypeEventConfigModal-DodU3beR.js +752 -0
- package/dist/MobileTypeEventConfigModal-DodU3beR.js.map +1 -0
- package/dist/{NewServerManagement-Cxe0dV0O.js → NewServerManagement-BdayO78D.js} +368 -352
- package/dist/NewServerManagement-BdayO78D.js.map +1 -0
- package/dist/OtherTypeEventConfigModal-D_9S50aI.js +1414 -0
- package/dist/OtherTypeEventConfigModal-D_9S50aI.js.map +1 -0
- package/dist/{PaymentCreatePage-CIVe0P0p-25BQVpOX.js → PaymentCreatePage-D6NZBUC3-DxXf2kvH.js} +58 -58
- package/dist/{PaymentCreatePage-CIVe0P0p-25BQVpOX.js.map → PaymentCreatePage-D6NZBUC3-DxXf2kvH.js.map} +1 -1
- package/dist/{PaymentsPage-BvPe5Q9F-D2gfziwW.js → PaymentsPage-CHieGNrn-BnYCtqHd.js} +37 -37
- package/dist/{PaymentsPage-BvPe5Q9F-D2gfziwW.js.map → PaymentsPage-CHieGNrn-BnYCtqHd.js.map} +1 -1
- package/dist/{PermissionsModal-CCYkcKlC.js → PermissionsModal-Dxbkkrqe.js} +18 -18
- package/dist/PermissionsModal-Dxbkkrqe.js.map +1 -0
- package/dist/{PickupBatchLinesEditor-DHmcAG23-DL2p6IKJ.js → PickupBatchLinesEditor-QPaqFtUO-CY7BShYh.js} +2 -2
- package/dist/{PickupBatchLinesEditor-DHmcAG23-DL2p6IKJ.js.map → PickupBatchLinesEditor-QPaqFtUO-CY7BShYh.js.map} +1 -1
- package/dist/PickupCreatePage-C7_67u_u-OId8-e2a.js +801 -0
- package/dist/PickupCreatePage-C7_67u_u-OId8-e2a.js.map +1 -0
- package/dist/{PickupsPage-Ctpghavs-CUp4uIZq.js → PickupsPage-BWblMlic-CWkgeBw0.js} +132 -132
- package/dist/PickupsPage-BWblMlic-CWkgeBw0.js.map +1 -0
- package/dist/PmGuard-BvUUbU80-BpYNaDzl.js +641 -0
- package/dist/PmGuard-BvUUbU80-BpYNaDzl.js.map +1 -0
- package/dist/ProductEditPage-Dbq4vUAA-BoBmTPPL.js +1523 -0
- package/dist/ProductEditPage-Dbq4vUAA-BoBmTPPL.js.map +1 -0
- package/dist/{ProductsPage-CupVmOD4-D45a_hf-.js → ProductsPage-BI22nPb4-CQBjnc-n.js} +44 -43
- package/dist/ProductsPage-BI22nPb4-CQBjnc-n.js.map +1 -0
- package/dist/PurchaseCreatePage-C0EK9z4w-BQMTsjE7.js +724 -0
- package/dist/PurchaseCreatePage-C0EK9z4w-BQMTsjE7.js.map +1 -0
- package/dist/{PurchaseRequestDetailPage-Dg_MRY_N-D1bgTEAn.js → PurchaseRequestDetailPage-DhBuOGHZ-CWZPqzt9.js} +428 -418
- package/dist/PurchaseRequestDetailPage-DhBuOGHZ-CWZPqzt9.js.map +1 -0
- package/dist/{PurchaseRequestsPage-DPAPzpmm-mDH2IrTl.js → PurchaseRequestsPage-Bj9HUMxb-B7-AxT8m.js} +65 -65
- package/dist/{PurchaseRequestsPage-DPAPzpmm-mDH2IrTl.js.map → PurchaseRequestsPage-Bj9HUMxb-B7-AxT8m.js.map} +1 -1
- package/dist/{PurchasesPage-It1GHiXl-eH4IsF_U.js → PurchasesPage-Djl1AqD_-DXeYFMrX.js} +55 -55
- package/dist/{PurchasesPage-It1GHiXl-eH4IsF_U.js.map → PurchasesPage-Djl1AqD_-DXeYFMrX.js.map} +1 -1
- package/dist/{RoleManagement-s8iNx2Mu.js → RoleManagement-DVYufwy-.js} +3 -3
- package/dist/{RoleManagement-s8iNx2Mu.js.map → RoleManagement-DVYufwy-.js.map} +1 -1
- package/dist/Roles-BoNGJhtR.js +19 -0
- package/dist/Roles-BoNGJhtR.js.map +1 -0
- package/dist/{SaleCreatePage-C9kFmTvm-B3Y0o4CX.js → SaleCreatePage-DHBLmlBr-BlgjVsq6.js} +39 -39
- package/dist/{SaleCreatePage-C9kFmTvm-B3Y0o4CX.js.map → SaleCreatePage-DHBLmlBr-BlgjVsq6.js.map} +1 -1
- package/dist/{SalesPage-D18DCseD-BxktGDRQ.js → SalesPage-eF9Yr42z-BQ9FlXC3.js} +61 -61
- package/dist/{SalesPage-D18DCseD-BxktGDRQ.js.map → SalesPage-eF9Yr42z-BQ9FlXC3.js.map} +1 -1
- package/dist/SettingsPage-Cre-UE3r-9ntnLYsQ.js +741 -0
- package/dist/SettingsPage-Cre-UE3r-9ntnLYsQ.js.map +1 -0
- package/dist/{ShowFlywayQuery-D1y_4A1u.js → ShowFlywayQuery-DIOUdYfG.js} +26 -19
- package/dist/{ShowFlywayQuery-D1y_4A1u.js.map → ShowFlywayQuery-DIOUdYfG.js.map} +1 -1
- package/dist/{StorageUnitsPage-7EqwuMOI-BwUso1Th.js → StorageUnitsPage-CTEVuemZ-B4osG74N.js} +253 -223
- package/dist/StorageUnitsPage-CTEVuemZ-B4osG74N.js.map +1 -0
- package/dist/{SubMenu-eEDhZUvh.js → SubMenu-OO2zhKiu.js} +5 -3
- package/dist/SubMenu-OO2zhKiu.js.map +1 -0
- package/dist/{TableDetails-BtafRxXb.js → TableDetails-Cc40dEUs.js} +272 -267
- package/dist/TableDetails-Cc40dEUs.js.map +1 -0
- package/dist/{TableList-Dpo6dO7S.js → TableList-B5tX4wII.js} +316 -312
- package/dist/TableList-B5tX4wII.js.map +1 -0
- package/dist/{TransactionsPage-DrH53pVS-BkhIGB6C.js → TransactionsPage-Zuu7sjID-B-ACzvd1.js} +195 -180
- package/dist/TransactionsPage-Zuu7sjID-B-ACzvd1.js.map +1 -0
- package/dist/TransferCreatePage-DlT0nCDj-B2SdPgYB.js +635 -0
- package/dist/TransferCreatePage-DlT0nCDj-B2SdPgYB.js.map +1 -0
- package/dist/TransfersPage-DqaSvHda-G2tFa5Jq.js +600 -0
- package/dist/TransfersPage-DqaSvHda-G2tFa5Jq.js.map +1 -0
- package/dist/TypeConfiguration-EaFiOzRE.js +114 -0
- package/dist/TypeConfiguration-EaFiOzRE.js.map +1 -0
- package/dist/UserList-Cf5B-o_1.js +1904 -0
- package/dist/UserList-Cf5B-o_1.js.map +1 -0
- package/dist/Users-MC7txo1V.js +43 -0
- package/dist/{Users-Bpc4Sazd.js.map → Users-MC7txo1V.js.map} +1 -1
- package/dist/VaccineEducation-T_UE57Ef.js +231 -0
- package/dist/VaccineEducation-T_UE57Ef.js.map +1 -0
- package/dist/VaccineEducation.css +1 -0
- package/dist/VaccineEducationConfigurator-CWc20_rv.js +50948 -0
- package/dist/VaccineEducationConfigurator-CWc20_rv.js.map +1 -0
- package/dist/VaccineEducationConfigurator.css +4 -0
- package/dist/VaccineEducationList-Ok7_5EFb.js +334 -0
- package/dist/VaccineEducationList-Ok7_5EFb.js.map +1 -0
- package/dist/VialsPage-LoDaUqVv-DmMXbK8j.js +457 -0
- package/dist/VialsPage-LoDaUqVv-DmMXbK8j.js.map +1 -0
- package/dist/{constants-ClZJY2x1-MkSWn6TZ.js → constants-BTpJFQe_-CYPZIqQF.js} +166 -56
- package/dist/constants-BTpJFQe_-CYPZIqQF.js.map +1 -0
- package/dist/dashboardLayoutUtils--xUnoKPa.js +615 -0
- package/dist/dashboardLayoutUtils--xUnoKPa.js.map +1 -0
- package/dist/index-mfoqII2U.js +524 -0
- package/dist/index-mfoqII2U.js.map +1 -0
- package/dist/{index-D9YNFPn9.js → index-o8Pyt1Bt.js} +445 -439
- package/dist/index-o8Pyt1Bt.js.map +1 -0
- package/dist/index.css +1 -1
- package/dist/index.js +1 -1
- package/dist/index.lib-BySa9-Z-.js +936 -0
- package/dist/index.lib-BySa9-Z-.js.map +1 -0
- package/dist/listValueStore-5d4vNGQM-WclZ5nBG.js +43 -0
- package/dist/listValueStore-5d4vNGQM-WclZ5nBG.js.map +1 -0
- package/package.json +5 -1
- package/dist/AccessRights-xrday-L1.js.map +0 -1
- package/dist/AddMenuConfiguration-e5BVXhmw.js +0 -8547
- package/dist/AddMenuConfiguration-e5BVXhmw.js.map +0 -1
- package/dist/CategoriesPage-BsS5IQh3-B03lWRY5.js.map +0 -1
- package/dist/ConditionConfig-Ddz9halE.js +0 -395
- package/dist/ConditionConfig-Ddz9halE.js.map +0 -1
- package/dist/ConditionConfig.css +0 -1
- package/dist/EntityManagement-CPQL6qBj.js +0 -50
- package/dist/EntityManagement-CPQL6qBj.js.map +0 -1
- package/dist/EventConfig-BmLemzX3.js +0 -26
- package/dist/EventConfigurations-Bzh1qWXU.js +0 -450
- package/dist/EventConfigurations-Bzh1qWXU.js.map +0 -1
- package/dist/EventsExceptionModal-B2SRrnB1.js +0 -200
- package/dist/EventsExceptionModal-B2SRrnB1.js.map +0 -1
- package/dist/EventsSkeleton-BIcPks4T.js +0 -61
- package/dist/EventsSkeleton-BIcPks4T.js.map +0 -1
- package/dist/FacilityPicker-BiZeupmP-CyPHmj6b.js +0 -79
- package/dist/FacilityPicker-BiZeupmP-CyPHmj6b.js.map +0 -1
- package/dist/FeatureMenu-DYJmDt7q.js.map +0 -1
- package/dist/GrantPermissionModal-BDN66Atn.js.map +0 -1
- package/dist/ImmunizationConfigurationBase-Di1KO3oW.js +0 -7639
- package/dist/ImmunizationConfigurationBase-Di1KO3oW.js.map +0 -1
- package/dist/InventoryPage-C_AxSy7A-QLvlL4rE.js +0 -665
- package/dist/InventoryPage-C_AxSy7A-QLvlL4rE.js.map +0 -1
- package/dist/ManageDynamicFeature-BU0I45dd.js.map +0 -1
- package/dist/ManageEventConfiguration-CoYcpjR9.js +0 -1085
- package/dist/ManageEventConfiguration-CoYcpjR9.js.map +0 -1
- package/dist/ManageRole-CNZBRKGU.js +0 -776
- package/dist/ManageRole-CNZBRKGU.js.map +0 -1
- package/dist/MobileAnalytics-pQoE8cG1.js +0 -16888
- package/dist/MobileAnalytics-pQoE8cG1.js.map +0 -1
- package/dist/MobileMenuManagement-Cf8IZlla.js +0 -108
- package/dist/MobileMenuManagement-Cf8IZlla.js.map +0 -1
- package/dist/MobileTypeEventConfigModal-BeveaX0C.js +0 -783
- package/dist/MobileTypeEventConfigModal-BeveaX0C.js.map +0 -1
- package/dist/NewServerManagement-Cxe0dV0O.js.map +0 -1
- package/dist/OtherTypeEventConfigModal-CM6VkdmY.js +0 -2046
- package/dist/OtherTypeEventConfigModal-CM6VkdmY.js.map +0 -1
- package/dist/PermissionsModal-CCYkcKlC.js.map +0 -1
- package/dist/PickupCreatePage-CB0Sl0Hb-Mmj7zESG.js +0 -783
- package/dist/PickupCreatePage-CB0Sl0Hb-Mmj7zESG.js.map +0 -1
- package/dist/PickupsPage-Ctpghavs-CUp4uIZq.js.map +0 -1
- package/dist/PmGuard-b10TGXEi-G3N0G_Wg.js +0 -599
- package/dist/PmGuard-b10TGXEi-G3N0G_Wg.js.map +0 -1
- package/dist/ProductEditPage-C1thoKHu-URQaZ6st.js +0 -1302
- package/dist/ProductEditPage-C1thoKHu-URQaZ6st.js.map +0 -1
- package/dist/ProductsPage-CupVmOD4-D45a_hf-.js.map +0 -1
- package/dist/PurchaseCreatePage-YD3NmhPQ-2j4etSjM.js +0 -648
- package/dist/PurchaseCreatePage-YD3NmhPQ-2j4etSjM.js.map +0 -1
- package/dist/PurchaseRequestDetailPage-Dg_MRY_N-D1bgTEAn.js.map +0 -1
- package/dist/Roles-BIyiic67.js +0 -14
- package/dist/Roles-BIyiic67.js.map +0 -1
- package/dist/SettingsPage-VsxI-ano-DcmtUUEj.js +0 -747
- package/dist/SettingsPage-VsxI-ano-DcmtUUEj.js.map +0 -1
- package/dist/StorageUnitsPage-7EqwuMOI-BwUso1Th.js.map +0 -1
- package/dist/SubMenu-eEDhZUvh.js.map +0 -1
- package/dist/TableDetails-BtafRxXb.js.map +0 -1
- package/dist/TableList-Dpo6dO7S.js.map +0 -1
- package/dist/TransactionsPage-DrH53pVS-BkhIGB6C.js.map +0 -1
- package/dist/TransferCreatePage-CuvoMrYH-DTTfHjz-.js +0 -315
- package/dist/TransferCreatePage-CuvoMrYH-DTTfHjz-.js.map +0 -1
- package/dist/TransfersPage-Cf701t8s-BBbN7cBf.js +0 -476
- package/dist/TransfersPage-Cf701t8s-BBbN7cBf.js.map +0 -1
- package/dist/TypeConfiguration-3O6ABrK-.js +0 -117
- package/dist/TypeConfiguration-3O6ABrK-.js.map +0 -1
- package/dist/UserList-DgPxsnj2.js +0 -1129
- package/dist/UserList-DgPxsnj2.js.map +0 -1
- package/dist/Users-Bpc4Sazd.js +0 -41
- package/dist/VialsPage-8oAc1yFv-Cl3FUXBJ.js +0 -321
- package/dist/VialsPage-8oAc1yFv-Cl3FUXBJ.js.map +0 -1
- package/dist/constants-ClZJY2x1-MkSWn6TZ.js.map +0 -1
- package/dist/dashboardLayoutUtils-D1xCAxp3.js +0 -405
- package/dist/dashboardLayoutUtils-D1xCAxp3.js.map +0 -1
- package/dist/index-D9YNFPn9.js.map +0 -1
- package/dist/index.lib-Dn8PMkeD.js +0 -862
- package/dist/index.lib-Dn8PMkeD.js.map +0 -1
|
@@ -1,1302 +0,0 @@
|
|
|
1
|
-
import { C as Ne, W as we, G as S, g as ze, m as Le, k as Y, h as Ye, c as je, u as Qe, s as Ge, p as _e } from "./ImmunizationConfigurationBase-Di1KO3oW.js";
|
|
2
|
-
import { f as Ke, e as Xe, c as Ze, t as Je, n as Oe, s as ei, r as Pe } from "./constants-ClZJY2x1-MkSWn6TZ.js";
|
|
3
|
-
import { r as F, v as ii, d as ti, u as ni, l as ri, f as oi, C as ai } from "./validation-BzlHnL-r-CCJm2utQ.js";
|
|
4
|
-
import { n as li } from "./useFieldErrors-hDG8ox_x-DbSAzrGo.js";
|
|
5
|
-
import { Y as si, Z as ci, Q as ui, q as di } from "./PmGuard-b10TGXEi-G3N0G_Wg.js";
|
|
6
|
-
import { useState as I, useMemo as Ee, useEffect as oe, useRef as Ie } from "react";
|
|
7
|
-
import { jsxs as u, jsx as e, Fragment as mi } from "react/jsx-runtime";
|
|
8
|
-
import te from "prop-types";
|
|
9
|
-
import { Box as E, Alert as Be, Card as ne, CardContent as re, Typography as v, Grid as a, TextField as T, FormControlLabel as W, Checkbox as q, Stack as H, Divider as pi, Button as _, CircularProgress as He, IconButton as ke } from "@mui/material";
|
|
10
|
-
import { v4 as le } from "uuid";
|
|
11
|
-
import gi from "@mui/icons-material/AddRounded";
|
|
12
|
-
import { useParams as hi, useNavigate as fi } from "react-router-dom";
|
|
13
|
-
import vi from "@mui/icons-material/SaveRounded";
|
|
14
|
-
import Ci from "@mui/icons-material/DeleteOutlineRounded";
|
|
15
|
-
import xi from "@mui/icons-material/AddPhotoAlternateRounded";
|
|
16
|
-
import bi from "@mui/icons-material/CloseRounded";
|
|
17
|
-
var K = 5, yi = 5 * 1024 * 1024, z = {
|
|
18
|
-
display: "block",
|
|
19
|
-
fontWeight: 800,
|
|
20
|
-
letterSpacing: 0.6,
|
|
21
|
-
color: "text.secondary"
|
|
22
|
-
};
|
|
23
|
-
function ae() {
|
|
24
|
-
return {
|
|
25
|
-
key: le(),
|
|
26
|
-
profileType: "AGE_BASED",
|
|
27
|
-
fromAge: "",
|
|
28
|
-
fromUnit: "YEARS",
|
|
29
|
-
toAge: "",
|
|
30
|
-
toUnit: "YEARS",
|
|
31
|
-
doseAmount: ""
|
|
32
|
-
};
|
|
33
|
-
}
|
|
34
|
-
var L = {
|
|
35
|
-
vaccineCode: "",
|
|
36
|
-
vialVolumeMl: "",
|
|
37
|
-
singleDose: !1,
|
|
38
|
-
profiles: [ae()],
|
|
39
|
-
openVialValidityHours: 6,
|
|
40
|
-
openVialValidityUnit: "HOURS",
|
|
41
|
-
maxConcurrentOpenVials: 2,
|
|
42
|
-
requiresReconstitution: !1,
|
|
43
|
-
reconstitutedValidityHours: "",
|
|
44
|
-
reconstitutedValidityUnit: "HOURS",
|
|
45
|
-
route: "",
|
|
46
|
-
storageTempMinCelsius: "",
|
|
47
|
-
storageTempMaxCelsius: "",
|
|
48
|
-
comments: ""
|
|
49
|
-
};
|
|
50
|
-
function Vi(g, k) {
|
|
51
|
-
var w;
|
|
52
|
-
let V = !k && !!g.singleDose, U = (C) => C === "" || C == null ? null : Number(C);
|
|
53
|
-
return {
|
|
54
|
-
vaccineCode: (w = g.vaccineCode) == null ? void 0 : w.trim().toUpperCase(),
|
|
55
|
-
vialVolumeMl: Number(g.vialVolumeMl),
|
|
56
|
-
singleDose: V,
|
|
57
|
-
profiles: V ? [] : (g.profiles ?? []).map((C) => {
|
|
58
|
-
let B = U(C.toAge);
|
|
59
|
-
return {
|
|
60
|
-
profileType: C.profileType || "AGE_BASED",
|
|
61
|
-
fromAge: U(C.fromAge),
|
|
62
|
-
fromUnit: C.fromUnit || "YEARS",
|
|
63
|
-
toAge: B,
|
|
64
|
-
toUnit: B == null ? null : C.toUnit || "YEARS",
|
|
65
|
-
doseAmount: U(C.doseAmount)
|
|
66
|
-
};
|
|
67
|
-
}),
|
|
68
|
-
openVialValidityHours: Number(g.openVialValidityHours ?? 6),
|
|
69
|
-
openVialValidityUnit: g.openVialValidityUnit || "HOURS",
|
|
70
|
-
maxConcurrentOpenVials: V ? null : Number(g.maxConcurrentOpenVials ?? 2),
|
|
71
|
-
requiresReconstitution: !!g.requiresReconstitution,
|
|
72
|
-
reconstitutedValidityHours: U(g.reconstitutedValidityHours),
|
|
73
|
-
reconstitutedValidityUnit: g.reconstitutedValidityUnit || "HOURS",
|
|
74
|
-
route: g.route || null,
|
|
75
|
-
storageTempMinCelsius: U(g.storageTempMinCelsius),
|
|
76
|
-
storageTempMaxCelsius: U(g.storageTempMaxCelsius),
|
|
77
|
-
comments: g.comments || null
|
|
78
|
-
};
|
|
79
|
-
}
|
|
80
|
-
function Wi() {
|
|
81
|
-
var ce, ue, de, me, pe, ge, he, fe, ve, Ce, xe, be, ye, Ve, Ae, Te, Me, Ue, Re, Se;
|
|
82
|
-
let { productId: g } = hi(), k = fi(), [V, U] = I(!0), [w, C] = I(""), [B, j] = I(!1), [$, Q] = I([]), [X, Z] = I([]), [J, d] = I([]), n = li(), f = ((ce = Ne()) == null ? void 0 : ce.manageSales) !== !1, [t, R] = I({
|
|
83
|
-
id: g,
|
|
84
|
-
name: "",
|
|
85
|
-
categoryId: "",
|
|
86
|
-
brandId: "",
|
|
87
|
-
description: "",
|
|
88
|
-
unit: "",
|
|
89
|
-
unitOther: "",
|
|
90
|
-
hasExpiry: !0,
|
|
91
|
-
needsStorageUnit: !1,
|
|
92
|
-
notForSale: !1,
|
|
93
|
-
canBeQuarantined: !0,
|
|
94
|
-
salePriceMode: "FREE",
|
|
95
|
-
salePrice: "",
|
|
96
|
-
isActive: !0,
|
|
97
|
-
imageUuids: [],
|
|
98
|
-
vaccineConfig: null
|
|
99
|
-
}), O = Ee(() => $.find((i) => i.id === t.categoryId), [$, t.categoryId]), b = ((ue = O == null ? void 0 : O.code) == null ? void 0 : ue.toUpperCase()) === Ke, x = b && t.unit === "DROPS";
|
|
100
|
-
si("update.manage.productManagement.product", () => {
|
|
101
|
-
async function i() {
|
|
102
|
-
var l, h;
|
|
103
|
-
U(!0);
|
|
104
|
-
try {
|
|
105
|
-
let [s, p, M] = await Promise.all([
|
|
106
|
-
je(),
|
|
107
|
-
Qe(),
|
|
108
|
-
Ge().catch(() => [])
|
|
109
|
-
]);
|
|
110
|
-
Q(s), Z(p), d(M);
|
|
111
|
-
try {
|
|
112
|
-
let o = await _e(g);
|
|
113
|
-
j(!1), R({
|
|
114
|
-
id: o.id,
|
|
115
|
-
name: o.name ?? "",
|
|
116
|
-
categoryId: o.categoryId ?? "",
|
|
117
|
-
brandId: o.brandId ?? "",
|
|
118
|
-
description: o.description ?? "",
|
|
119
|
-
unit: o.unit ?? "PIECE",
|
|
120
|
-
unitOther: o.unitOther ?? "",
|
|
121
|
-
hasExpiry: o.hasExpiry ?? !1,
|
|
122
|
-
needsStorageUnit: o.needsStorageUnit ?? !1,
|
|
123
|
-
notForSale: o.notForSale ?? !1,
|
|
124
|
-
canBeQuarantined: o.canBeQuarantined ?? !0,
|
|
125
|
-
salePriceMode: o.salePriceMode ?? "FREE",
|
|
126
|
-
salePrice: o.salePrice ?? "",
|
|
127
|
-
isActive: o.isActive ?? !0,
|
|
128
|
-
imageUuids: o.imageUuids ?? [],
|
|
129
|
-
vaccineConfig: o.vaccineConfig ? {
|
|
130
|
-
vaccineCode: o.vaccineConfig.vaccineCode ?? "",
|
|
131
|
-
vialVolumeMl: o.vaccineConfig.vialVolumeMl ?? "",
|
|
132
|
-
singleDose: o.vaccineConfig.singleDose ?? !1,
|
|
133
|
-
profiles: (o.vaccineConfig.profiles ?? []).length > 0 ? o.vaccineConfig.profiles.map((A) => ({
|
|
134
|
-
key: le(),
|
|
135
|
-
profileType: A.profileType ?? "AGE_BASED",
|
|
136
|
-
fromAge: A.fromAge ?? "",
|
|
137
|
-
fromUnit: A.fromUnit ?? "YEARS",
|
|
138
|
-
toAge: A.toAge ?? "",
|
|
139
|
-
toUnit: A.toUnit ?? "YEARS",
|
|
140
|
-
doseAmount: A.doseAmount ?? ""
|
|
141
|
-
})) : [ae()],
|
|
142
|
-
openVialValidityHours: o.vaccineConfig.openVialValidityHours ?? 6,
|
|
143
|
-
openVialValidityUnit: o.vaccineConfig.openVialValidityUnit ?? "HOURS",
|
|
144
|
-
maxConcurrentOpenVials: o.vaccineConfig.maxConcurrentOpenVials ?? 2,
|
|
145
|
-
requiresReconstitution: o.vaccineConfig.requiresReconstitution ?? !1,
|
|
146
|
-
reconstitutedValidityHours: o.vaccineConfig.reconstitutedValidityHours ?? "",
|
|
147
|
-
reconstitutedValidityUnit: o.vaccineConfig.reconstitutedValidityUnit ?? "HOURS",
|
|
148
|
-
route: o.vaccineConfig.route ?? "",
|
|
149
|
-
storageTempMinCelsius: o.vaccineConfig.storageTempMinCelsius ?? "",
|
|
150
|
-
storageTempMaxCelsius: o.vaccineConfig.storageTempMaxCelsius ?? "",
|
|
151
|
-
comments: o.vaccineConfig.comments ?? ""
|
|
152
|
-
} : null
|
|
153
|
-
});
|
|
154
|
-
} catch {
|
|
155
|
-
j(!0);
|
|
156
|
-
}
|
|
157
|
-
} catch (s) {
|
|
158
|
-
C(((h = (l = s == null ? void 0 : s.response) == null ? void 0 : l.data) == null ? void 0 : h.message) ?? (s == null ? void 0 : s.message) ?? "Failed to load product");
|
|
159
|
-
} finally {
|
|
160
|
-
U(!1);
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
i();
|
|
164
|
-
}, [g]), oe(() => {
|
|
165
|
-
R(b ? (i) => ({
|
|
166
|
-
...i,
|
|
167
|
-
unit: i.unit === "VIAL" || i.unit === "DROPS" ? i.unit : "VIAL",
|
|
168
|
-
needsStorageUnit: !0,
|
|
169
|
-
vaccineConfig: i.vaccineConfig ?? { ...L }
|
|
170
|
-
}) : (i) => i.vaccineConfig ? {
|
|
171
|
-
...i,
|
|
172
|
-
vaccineConfig: null
|
|
173
|
-
} : i);
|
|
174
|
-
}, [b]);
|
|
175
|
-
function c(i, l) {
|
|
176
|
-
R((h) => ({
|
|
177
|
-
...h,
|
|
178
|
-
[i]: l
|
|
179
|
-
}));
|
|
180
|
-
}
|
|
181
|
-
function y(i, l) {
|
|
182
|
-
R((h) => ({
|
|
183
|
-
...h,
|
|
184
|
-
vaccineConfig: {
|
|
185
|
-
...h.vaccineConfig ?? L,
|
|
186
|
-
[i]: l
|
|
187
|
-
}
|
|
188
|
-
}));
|
|
189
|
-
}
|
|
190
|
-
function D(i, l, h) {
|
|
191
|
-
R((s) => {
|
|
192
|
-
let p = s.vaccineConfig ?? L, M = (p.profiles ?? []).slice();
|
|
193
|
-
return M[i] = {
|
|
194
|
-
...M[i],
|
|
195
|
-
[l]: h
|
|
196
|
-
}, {
|
|
197
|
-
...s,
|
|
198
|
-
vaccineConfig: {
|
|
199
|
-
...p,
|
|
200
|
-
profiles: M
|
|
201
|
-
}
|
|
202
|
-
};
|
|
203
|
-
});
|
|
204
|
-
}
|
|
205
|
-
function Fe() {
|
|
206
|
-
R((i) => {
|
|
207
|
-
let l = i.vaccineConfig ?? L;
|
|
208
|
-
return {
|
|
209
|
-
...i,
|
|
210
|
-
vaccineConfig: {
|
|
211
|
-
...l,
|
|
212
|
-
profiles: [...l.profiles ?? [], ae()]
|
|
213
|
-
}
|
|
214
|
-
};
|
|
215
|
-
});
|
|
216
|
-
}
|
|
217
|
-
function We(i) {
|
|
218
|
-
R((l) => {
|
|
219
|
-
let h = l.vaccineConfig ?? L;
|
|
220
|
-
return {
|
|
221
|
-
...l,
|
|
222
|
-
vaccineConfig: {
|
|
223
|
-
...h,
|
|
224
|
-
profiles: (h.profiles ?? []).filter((s, p) => p !== i)
|
|
225
|
-
}
|
|
226
|
-
};
|
|
227
|
-
});
|
|
228
|
-
}
|
|
229
|
-
function qe() {
|
|
230
|
-
let i = (t.vaccineConfig ?? {}).profiles ?? [], l = x ? "drops" : "ml", h = x ? {
|
|
231
|
-
min: 0,
|
|
232
|
-
step: 1
|
|
233
|
-
} : {
|
|
234
|
-
step: "0.01",
|
|
235
|
-
min: 0
|
|
236
|
-
};
|
|
237
|
-
return /* @__PURE__ */ u(E, { children: [
|
|
238
|
-
/* @__PURE__ */ u(H, {
|
|
239
|
-
direction: "row",
|
|
240
|
-
justifyContent: "space-between",
|
|
241
|
-
alignItems: "center",
|
|
242
|
-
sx: { mb: 0.5 },
|
|
243
|
-
children: [/* @__PURE__ */ e(v, {
|
|
244
|
-
variant: "body2",
|
|
245
|
-
sx: { fontWeight: 700 },
|
|
246
|
-
children: "Dose profiles"
|
|
247
|
-
}), /* @__PURE__ */ e(_, {
|
|
248
|
-
size: "small",
|
|
249
|
-
variant: "outlined",
|
|
250
|
-
startIcon: /* @__PURE__ */ e(gi, {}),
|
|
251
|
-
onClick: Fe,
|
|
252
|
-
children: "Add profile"
|
|
253
|
-
})]
|
|
254
|
-
}),
|
|
255
|
-
/* @__PURE__ */ u(v, {
|
|
256
|
-
variant: "caption",
|
|
257
|
-
color: "text.secondary",
|
|
258
|
-
sx: {
|
|
259
|
-
display: "block",
|
|
260
|
-
mb: 1.5
|
|
261
|
-
},
|
|
262
|
-
children: [
|
|
263
|
-
"Each band sets one dose. It is measured from the patient's reference date, so the right dose is chosen automatically when giving the vaccine.",
|
|
264
|
-
/* @__PURE__ */ e("br", {}),
|
|
265
|
-
/* @__PURE__ */ e("strong", { children: "From" }),
|
|
266
|
-
" is included and ",
|
|
267
|
-
/* @__PURE__ */ e("strong", { children: "To" }),
|
|
268
|
-
" is not — a patient exactly at a To value falls into the next band. Leave To blank for no upper limit."
|
|
269
|
-
]
|
|
270
|
-
}),
|
|
271
|
-
/* @__PURE__ */ e(H, {
|
|
272
|
-
spacing: 1.5,
|
|
273
|
-
children: i.map((s, p) => {
|
|
274
|
-
let M = `profiles.${p}.fromAge`, o = `profiles.${p}.toAge`, A = `profiles.${p}.doseAmount`, N = s.toAge !== "" && s.toAge != null;
|
|
275
|
-
return /* @__PURE__ */ e(E, {
|
|
276
|
-
sx: {
|
|
277
|
-
p: 1.5,
|
|
278
|
-
border: "1px solid",
|
|
279
|
-
borderColor: "divider",
|
|
280
|
-
borderRadius: 1.5
|
|
281
|
-
},
|
|
282
|
-
children: /* @__PURE__ */ u(a, {
|
|
283
|
-
container: !0,
|
|
284
|
-
spacing: 1.5,
|
|
285
|
-
alignItems: "flex-start",
|
|
286
|
-
children: [
|
|
287
|
-
/* @__PURE__ */ e(a, {
|
|
288
|
-
item: !0,
|
|
289
|
-
xs: 6,
|
|
290
|
-
md: 2,
|
|
291
|
-
children: /* @__PURE__ */ e(T, {
|
|
292
|
-
required: !0,
|
|
293
|
-
fullWidth: !0,
|
|
294
|
-
size: "small",
|
|
295
|
-
type: "number",
|
|
296
|
-
inputProps: {
|
|
297
|
-
min: 0,
|
|
298
|
-
step: 1
|
|
299
|
-
},
|
|
300
|
-
label: "From",
|
|
301
|
-
value: s.fromAge ?? "",
|
|
302
|
-
onChange: (m) => D(p, "fromAge", m.target.value),
|
|
303
|
-
onBlur: n.onBlur(M),
|
|
304
|
-
error: n.show(M) && !!r[M],
|
|
305
|
-
helperText: n.show(M) ? r[M] : ""
|
|
306
|
-
})
|
|
307
|
-
}),
|
|
308
|
-
/* @__PURE__ */ e(a, {
|
|
309
|
-
item: !0,
|
|
310
|
-
xs: 6,
|
|
311
|
-
md: 2,
|
|
312
|
-
children: /* @__PURE__ */ e(S, {
|
|
313
|
-
label: "From unit",
|
|
314
|
-
value: s.fromUnit || "YEARS",
|
|
315
|
-
onChange: (m) => D(p, "fromUnit", m),
|
|
316
|
-
options: Pe
|
|
317
|
-
})
|
|
318
|
-
}),
|
|
319
|
-
/* @__PURE__ */ e(a, {
|
|
320
|
-
item: !0,
|
|
321
|
-
xs: 6,
|
|
322
|
-
md: 2,
|
|
323
|
-
children: /* @__PURE__ */ e(T, {
|
|
324
|
-
fullWidth: !0,
|
|
325
|
-
size: "small",
|
|
326
|
-
type: "number",
|
|
327
|
-
inputProps: {
|
|
328
|
-
min: 0,
|
|
329
|
-
step: 1
|
|
330
|
-
},
|
|
331
|
-
label: "To",
|
|
332
|
-
value: s.toAge ?? "",
|
|
333
|
-
onChange: (m) => D(p, "toAge", m.target.value),
|
|
334
|
-
onBlur: n.onBlur(o),
|
|
335
|
-
error: n.show(o) && !!r[o],
|
|
336
|
-
helperText: n.show(o) && r[o] ? r[o] : "Blank = no limit"
|
|
337
|
-
})
|
|
338
|
-
}),
|
|
339
|
-
/* @__PURE__ */ e(a, {
|
|
340
|
-
item: !0,
|
|
341
|
-
xs: 6,
|
|
342
|
-
md: 2,
|
|
343
|
-
children: /* @__PURE__ */ e(S, {
|
|
344
|
-
label: "To unit",
|
|
345
|
-
disabled: !N,
|
|
346
|
-
value: N ? s.toUnit || "YEARS" : "",
|
|
347
|
-
onChange: (m) => D(p, "toUnit", m),
|
|
348
|
-
options: Pe
|
|
349
|
-
})
|
|
350
|
-
}),
|
|
351
|
-
/* @__PURE__ */ e(a, {
|
|
352
|
-
item: !0,
|
|
353
|
-
xs: 8,
|
|
354
|
-
md: 3,
|
|
355
|
-
children: /* @__PURE__ */ e(T, {
|
|
356
|
-
required: !0,
|
|
357
|
-
fullWidth: !0,
|
|
358
|
-
size: "small",
|
|
359
|
-
type: "number",
|
|
360
|
-
inputProps: h,
|
|
361
|
-
label: `Dose (${l})`,
|
|
362
|
-
value: s.doseAmount ?? "",
|
|
363
|
-
onChange: (m) => D(p, "doseAmount", m.target.value),
|
|
364
|
-
onBlur: n.onBlur(A),
|
|
365
|
-
error: n.show(A) && !!r[A],
|
|
366
|
-
helperText: n.show(A) ? r[A] : ""
|
|
367
|
-
})
|
|
368
|
-
}),
|
|
369
|
-
/* @__PURE__ */ e(a, {
|
|
370
|
-
item: !0,
|
|
371
|
-
xs: 4,
|
|
372
|
-
md: 1,
|
|
373
|
-
sx: { textAlign: "right" },
|
|
374
|
-
children: /* @__PURE__ */ e(ke, {
|
|
375
|
-
color: "error",
|
|
376
|
-
onClick: () => We(p),
|
|
377
|
-
disabled: i.length === 1,
|
|
378
|
-
children: /* @__PURE__ */ e(Ci, {})
|
|
379
|
-
})
|
|
380
|
-
})
|
|
381
|
-
]
|
|
382
|
-
})
|
|
383
|
-
}, s.key);
|
|
384
|
-
})
|
|
385
|
-
}),
|
|
386
|
-
n.show("profiles") && r.profiles ? /* @__PURE__ */ e(v, {
|
|
387
|
-
variant: "caption",
|
|
388
|
-
color: "error",
|
|
389
|
-
sx: {
|
|
390
|
-
display: "block",
|
|
391
|
-
mt: 1
|
|
392
|
-
},
|
|
393
|
-
children: r.profiles
|
|
394
|
-
}) : null
|
|
395
|
-
] });
|
|
396
|
-
}
|
|
397
|
-
let r = Ee(() => {
|
|
398
|
-
let i = {
|
|
399
|
-
name: F(t.name, "Product name"),
|
|
400
|
-
categoryId: F(t.categoryId, "Category"),
|
|
401
|
-
brandId: F(t.brandId, "Brand"),
|
|
402
|
-
unit: F(t.unit, "Unit"),
|
|
403
|
-
unitOther: t.unit === "OTHER" ? F(t.unitOther, "Custom unit") : "",
|
|
404
|
-
salePrice: f && !t.notForSale && t.salePriceMode !== "FREE" ? F(t.salePrice, "Sale price") || (Number(t.salePrice) > 0 ? "" : "Sale price must be greater than 0.") : ""
|
|
405
|
-
};
|
|
406
|
-
if (b && t.vaccineConfig) {
|
|
407
|
-
let l = t.vaccineConfig, h = !x && l.singleDose, s = ii(l.storageTempMinCelsius, l.storageTempMaxCelsius);
|
|
408
|
-
if (Object.assign(i, {
|
|
409
|
-
vaccineCode: F(l.vaccineCode, "Vaccine"),
|
|
410
|
-
vialVolumeMl: ri(l.vialVolumeMl),
|
|
411
|
-
openVialValidityHours: h ? "" : ni(l.openVialValidityHours),
|
|
412
|
-
reconstitutedValidityHours: ti(l.reconstitutedValidityHours, l.requiresReconstitution),
|
|
413
|
-
storageTempMinCelsius: s.min,
|
|
414
|
-
storageTempMaxCelsius: s.max
|
|
415
|
-
}), !h) {
|
|
416
|
-
let p = Number(l.vialVolumeMl), M = x ? "drops" : "ml", o = l.profiles ?? [];
|
|
417
|
-
o.length === 0 && (i.profiles = "Add at least one administration profile.");
|
|
418
|
-
let A = {
|
|
419
|
-
DAYS: 1,
|
|
420
|
-
WEEKS: 7,
|
|
421
|
-
MONTHS: 30,
|
|
422
|
-
YEARS: 365
|
|
423
|
-
}, N = (m, P) => Number(m) * (A[P] || 1);
|
|
424
|
-
o.forEach((m, P) => {
|
|
425
|
-
let ee = Number(m.fromAge);
|
|
426
|
-
if (m.fromAge === "" || m.fromAge == null ? i[`profiles.${P}.fromAge`] = "Required" : (!Number.isInteger(ee) || ee < 0) && (i[`profiles.${P}.fromAge`] = "Whole number, 0 or more"), m.toAge !== "" && m.toAge != null) {
|
|
427
|
-
let ie = Number(m.toAge);
|
|
428
|
-
!Number.isInteger(ie) || ie < 0 ? i[`profiles.${P}.toAge`] = "Whole number, 0 or more" : N(ie, m.toUnit) <= N(ee, m.fromUnit) && (i[`profiles.${P}.toAge`] = "Must be greater than From");
|
|
429
|
-
}
|
|
430
|
-
let G = Number(m.doseAmount);
|
|
431
|
-
m.doseAmount === "" || m.doseAmount == null ? i[`profiles.${P}.doseAmount`] = "Required" : !Number.isFinite(G) || G <= 0 ? i[`profiles.${P}.doseAmount`] = "Must be greater than 0" : x && !Number.isInteger(G) ? i[`profiles.${P}.doseAmount`] = "Whole number" : Number.isFinite(p) && p > 0 && G > p && (i[`profiles.${P}.doseAmount`] = `At most ${p} ${M}`);
|
|
432
|
-
}), i.maxConcurrentOpenVials = oi(l.maxConcurrentOpenVials);
|
|
433
|
-
}
|
|
434
|
-
}
|
|
435
|
-
return i;
|
|
436
|
-
}, [
|
|
437
|
-
t,
|
|
438
|
-
b,
|
|
439
|
-
x,
|
|
440
|
-
f
|
|
441
|
-
]), se = ai(r);
|
|
442
|
-
async function De() {
|
|
443
|
-
var i, l, h;
|
|
444
|
-
if (!se) {
|
|
445
|
-
n.markAllTouched(), C("Please fix the highlighted fields and try again.");
|
|
446
|
-
return;
|
|
447
|
-
}
|
|
448
|
-
try {
|
|
449
|
-
await Le({
|
|
450
|
-
id: t.id,
|
|
451
|
-
name: t.name.trim(),
|
|
452
|
-
categoryId: t.categoryId,
|
|
453
|
-
brandId: t.brandId,
|
|
454
|
-
description: t.description || null,
|
|
455
|
-
unit: t.unit,
|
|
456
|
-
unitOther: t.unit === "OTHER" && ((i = t.unitOther) == null ? void 0 : i.trim()) || null,
|
|
457
|
-
hasExpiry: !!t.hasExpiry,
|
|
458
|
-
needsStorageUnit: !!t.needsStorageUnit,
|
|
459
|
-
notForSale: f ? !!t.notForSale : !1,
|
|
460
|
-
canBeQuarantined: !!t.canBeQuarantined,
|
|
461
|
-
salePriceMode: f && !t.notForSale ? t.salePriceMode : "FREE",
|
|
462
|
-
salePrice: f && !t.notForSale && t.salePriceMode !== "FREE" && t.salePrice !== "" ? Number(t.salePrice) : null,
|
|
463
|
-
isActive: !!t.isActive,
|
|
464
|
-
imageUuids: t.imageUuids ?? [],
|
|
465
|
-
vaccineConfig: t.vaccineConfig ? Vi(t.vaccineConfig, x) : null
|
|
466
|
-
}), Y({
|
|
467
|
-
message: "Product saved.",
|
|
468
|
-
type: "success"
|
|
469
|
-
}), k("/ui/medplat/manage/pm/products");
|
|
470
|
-
} catch (s) {
|
|
471
|
-
C(((h = (l = s == null ? void 0 : s.response) == null ? void 0 : l.data) == null ? void 0 : h.message) ?? (s == null ? void 0 : s.message) ?? "Failed to save product");
|
|
472
|
-
}
|
|
473
|
-
}
|
|
474
|
-
return /* @__PURE__ */ u(E, { children: [/* @__PURE__ */ e(ci, {}), /* @__PURE__ */ e(ui, {
|
|
475
|
-
perm: "update.manage.productManagement.product",
|
|
476
|
-
title: "You don’t have permission to create or edit products",
|
|
477
|
-
children: /* @__PURE__ */ u(di, {
|
|
478
|
-
title: B ? "Add Product" : "Edit Product",
|
|
479
|
-
subtitle: `Category: ${(O == null ? void 0 : O.code) ?? "—"}`,
|
|
480
|
-
actions: /* @__PURE__ */ u(H, {
|
|
481
|
-
direction: "row",
|
|
482
|
-
spacing: 1,
|
|
483
|
-
children: [/* @__PURE__ */ e(_, {
|
|
484
|
-
variant: "outlined",
|
|
485
|
-
onClick: () => k("/ui/medplat/manage/pm/products"),
|
|
486
|
-
children: "Cancel"
|
|
487
|
-
}), /* @__PURE__ */ e(_, {
|
|
488
|
-
variant: "contained",
|
|
489
|
-
startIcon: /* @__PURE__ */ e(vi, {}),
|
|
490
|
-
disabled: !se,
|
|
491
|
-
onClick: () => void De(),
|
|
492
|
-
children: "Save"
|
|
493
|
-
})]
|
|
494
|
-
}),
|
|
495
|
-
children: [
|
|
496
|
-
V ? /* @__PURE__ */ e(Be, {
|
|
497
|
-
severity: "info",
|
|
498
|
-
children: "Loading…"
|
|
499
|
-
}) : null,
|
|
500
|
-
w ? /* @__PURE__ */ e(Be, {
|
|
501
|
-
severity: "error",
|
|
502
|
-
sx: { mb: 2 },
|
|
503
|
-
children: w
|
|
504
|
-
}) : null,
|
|
505
|
-
/* @__PURE__ */ e(ne, {
|
|
506
|
-
sx: {
|
|
507
|
-
borderRadius: 1.5,
|
|
508
|
-
mb: 2
|
|
509
|
-
},
|
|
510
|
-
children: /* @__PURE__ */ u(re, { children: [/* @__PURE__ */ e(v, {
|
|
511
|
-
variant: "h6",
|
|
512
|
-
sx: {
|
|
513
|
-
fontWeight: 800,
|
|
514
|
-
mb: 2
|
|
515
|
-
},
|
|
516
|
-
children: "Basic Details"
|
|
517
|
-
}), /* @__PURE__ */ u(a, {
|
|
518
|
-
container: !0,
|
|
519
|
-
spacing: 2,
|
|
520
|
-
children: [
|
|
521
|
-
/* @__PURE__ */ e(a, {
|
|
522
|
-
item: !0,
|
|
523
|
-
xs: 12,
|
|
524
|
-
md: 6,
|
|
525
|
-
children: /* @__PURE__ */ e(T, {
|
|
526
|
-
required: !0,
|
|
527
|
-
fullWidth: !0,
|
|
528
|
-
size: "small",
|
|
529
|
-
label: "Product Name",
|
|
530
|
-
value: t.name,
|
|
531
|
-
inputProps: { maxLength: 255 },
|
|
532
|
-
onChange: (i) => c("name", i.target.value),
|
|
533
|
-
onBlur: n.onBlur("name"),
|
|
534
|
-
error: n.show("name") && !!r.name,
|
|
535
|
-
FormHelperTextProps: { component: "div" },
|
|
536
|
-
helperText: /* @__PURE__ */ e(we, {
|
|
537
|
-
message: n.show("name") ? r.name : "",
|
|
538
|
-
value: t.name,
|
|
539
|
-
max: 255
|
|
540
|
-
})
|
|
541
|
-
})
|
|
542
|
-
}),
|
|
543
|
-
/* @__PURE__ */ e(a, {
|
|
544
|
-
item: !0,
|
|
545
|
-
xs: 12,
|
|
546
|
-
md: 3,
|
|
547
|
-
children: /* @__PURE__ */ e(S, {
|
|
548
|
-
label: "Category",
|
|
549
|
-
required: !0,
|
|
550
|
-
value: t.categoryId,
|
|
551
|
-
onChange: (i) => c("categoryId", i),
|
|
552
|
-
onBlur: n.onBlur("categoryId"),
|
|
553
|
-
error: n.show("categoryId") && !!r.categoryId,
|
|
554
|
-
helperText: n.show("categoryId") ? r.categoryId : "",
|
|
555
|
-
options: $.map((i) => ({
|
|
556
|
-
value: i.id,
|
|
557
|
-
label: `${i.name} (${i.code})`
|
|
558
|
-
}))
|
|
559
|
-
})
|
|
560
|
-
}),
|
|
561
|
-
/* @__PURE__ */ e(a, {
|
|
562
|
-
item: !0,
|
|
563
|
-
xs: 12,
|
|
564
|
-
md: 3,
|
|
565
|
-
children: /* @__PURE__ */ e(S, {
|
|
566
|
-
label: "Brand",
|
|
567
|
-
required: !0,
|
|
568
|
-
value: t.brandId,
|
|
569
|
-
onChange: (i) => c("brandId", i),
|
|
570
|
-
onBlur: n.onBlur("brandId"),
|
|
571
|
-
error: n.show("brandId") && !!r.brandId,
|
|
572
|
-
helperText: n.show("brandId") ? r.brandId : "",
|
|
573
|
-
options: X.map((i) => ({
|
|
574
|
-
value: i.id,
|
|
575
|
-
label: i.name
|
|
576
|
-
}))
|
|
577
|
-
})
|
|
578
|
-
}),
|
|
579
|
-
b ? null : /* @__PURE__ */ e(a, {
|
|
580
|
-
item: !0,
|
|
581
|
-
xs: 12,
|
|
582
|
-
md: 3,
|
|
583
|
-
children: /* @__PURE__ */ e(S, {
|
|
584
|
-
label: "Unit",
|
|
585
|
-
required: !0,
|
|
586
|
-
value: t.unit,
|
|
587
|
-
onChange: (i) => c("unit", i),
|
|
588
|
-
onBlur: n.onBlur("unit"),
|
|
589
|
-
error: n.show("unit") && !!r.unit,
|
|
590
|
-
helperText: n.show("unit") && r.unit ? r.unit : "",
|
|
591
|
-
options: Xe
|
|
592
|
-
})
|
|
593
|
-
}),
|
|
594
|
-
!b && t.unit === "OTHER" ? /* @__PURE__ */ e(a, {
|
|
595
|
-
item: !0,
|
|
596
|
-
xs: 12,
|
|
597
|
-
md: 3,
|
|
598
|
-
children: /* @__PURE__ */ e(T, {
|
|
599
|
-
required: !0,
|
|
600
|
-
fullWidth: !0,
|
|
601
|
-
size: "small",
|
|
602
|
-
label: "Custom unit name",
|
|
603
|
-
value: t.unitOther,
|
|
604
|
-
inputProps: { maxLength: 50 },
|
|
605
|
-
onChange: (i) => c("unitOther", i.target.value),
|
|
606
|
-
onBlur: n.onBlur("unitOther"),
|
|
607
|
-
error: n.show("unitOther") && !!r.unitOther,
|
|
608
|
-
FormHelperTextProps: { component: "div" },
|
|
609
|
-
helperText: /* @__PURE__ */ e(we, {
|
|
610
|
-
message: n.show("unitOther") && r.unitOther ? r.unitOther : "e.g. Strip, Ampoule, Sachet",
|
|
611
|
-
value: t.unitOther,
|
|
612
|
-
max: 50
|
|
613
|
-
})
|
|
614
|
-
})
|
|
615
|
-
}) : null,
|
|
616
|
-
/* @__PURE__ */ e(a, {
|
|
617
|
-
item: !0,
|
|
618
|
-
xs: 6,
|
|
619
|
-
md: 3,
|
|
620
|
-
children: /* @__PURE__ */ e(W, {
|
|
621
|
-
control: /* @__PURE__ */ e(q, {
|
|
622
|
-
checked: !!t.hasExpiry,
|
|
623
|
-
disabled: b,
|
|
624
|
-
onChange: (i) => c("hasExpiry", i.target.checked)
|
|
625
|
-
}),
|
|
626
|
-
label: b ? "Has expiry (vaccine)" : "Has expiry"
|
|
627
|
-
})
|
|
628
|
-
}),
|
|
629
|
-
/* @__PURE__ */ e(a, {
|
|
630
|
-
item: !0,
|
|
631
|
-
xs: 6,
|
|
632
|
-
md: 3,
|
|
633
|
-
children: /* @__PURE__ */ e(W, {
|
|
634
|
-
control: /* @__PURE__ */ e(q, {
|
|
635
|
-
checked: !!t.needsStorageUnit,
|
|
636
|
-
disabled: b,
|
|
637
|
-
onChange: (i) => c("needsStorageUnit", i.target.checked)
|
|
638
|
-
}),
|
|
639
|
-
label: b ? "Needs storage unit (vaccine)" : "Needs storage unit"
|
|
640
|
-
})
|
|
641
|
-
}),
|
|
642
|
-
f ? /* @__PURE__ */ e(a, {
|
|
643
|
-
item: !0,
|
|
644
|
-
xs: 6,
|
|
645
|
-
md: 3,
|
|
646
|
-
children: /* @__PURE__ */ e(W, {
|
|
647
|
-
control: /* @__PURE__ */ e(q, {
|
|
648
|
-
checked: !!t.notForSale,
|
|
649
|
-
onChange: (i) => c("notForSale", i.target.checked)
|
|
650
|
-
}),
|
|
651
|
-
label: "Not for sale"
|
|
652
|
-
})
|
|
653
|
-
}) : null,
|
|
654
|
-
/* @__PURE__ */ e(a, {
|
|
655
|
-
item: !0,
|
|
656
|
-
xs: 6,
|
|
657
|
-
md: 3,
|
|
658
|
-
children: /* @__PURE__ */ e(W, {
|
|
659
|
-
control: /* @__PURE__ */ e(q, {
|
|
660
|
-
checked: !!t.canBeQuarantined,
|
|
661
|
-
onChange: (i) => c("canBeQuarantined", i.target.checked)
|
|
662
|
-
}),
|
|
663
|
-
label: "Can be quarantined"
|
|
664
|
-
})
|
|
665
|
-
}),
|
|
666
|
-
/* @__PURE__ */ e(a, {
|
|
667
|
-
item: !0,
|
|
668
|
-
xs: 6,
|
|
669
|
-
md: 3,
|
|
670
|
-
children: /* @__PURE__ */ e(W, {
|
|
671
|
-
control: /* @__PURE__ */ e(q, {
|
|
672
|
-
checked: !!t.isActive,
|
|
673
|
-
onChange: (i) => c("isActive", i.target.checked)
|
|
674
|
-
}),
|
|
675
|
-
label: "Active"
|
|
676
|
-
})
|
|
677
|
-
}),
|
|
678
|
-
f && !t.notForSale ? /* @__PURE__ */ u(mi, { children: [/* @__PURE__ */ e(a, {
|
|
679
|
-
item: !0,
|
|
680
|
-
xs: 12,
|
|
681
|
-
md: 4,
|
|
682
|
-
children: /* @__PURE__ */ e(S, {
|
|
683
|
-
label: "Sale price mode",
|
|
684
|
-
value: t.salePriceMode,
|
|
685
|
-
onChange: (i) => c("salePriceMode", i),
|
|
686
|
-
options: Ze,
|
|
687
|
-
helperText: "Fixed shows a locked price at sale time; MRP caps the entered price."
|
|
688
|
-
})
|
|
689
|
-
}), t.salePriceMode === "FREE" ? null : /* @__PURE__ */ e(a, {
|
|
690
|
-
item: !0,
|
|
691
|
-
xs: 12,
|
|
692
|
-
md: 4,
|
|
693
|
-
children: /* @__PURE__ */ e(T, {
|
|
694
|
-
required: !0,
|
|
695
|
-
fullWidth: !0,
|
|
696
|
-
size: "small",
|
|
697
|
-
type: "number",
|
|
698
|
-
inputProps: {
|
|
699
|
-
step: "0.01",
|
|
700
|
-
min: 0
|
|
701
|
-
},
|
|
702
|
-
label: t.salePriceMode === "FIXED" ? "Fixed sale price" : "Price cap (MRP)",
|
|
703
|
-
value: t.salePrice,
|
|
704
|
-
onChange: (i) => c("salePrice", i.target.value),
|
|
705
|
-
onBlur: n.onBlur("salePrice"),
|
|
706
|
-
error: n.show("salePrice") && !!r.salePrice,
|
|
707
|
-
helperText: n.show("salePrice") ? r.salePrice : ""
|
|
708
|
-
})
|
|
709
|
-
})] }) : null,
|
|
710
|
-
/* @__PURE__ */ e(a, {
|
|
711
|
-
item: !0,
|
|
712
|
-
xs: 12,
|
|
713
|
-
children: /* @__PURE__ */ e(T, {
|
|
714
|
-
fullWidth: !0,
|
|
715
|
-
size: "small",
|
|
716
|
-
multiline: !0,
|
|
717
|
-
minRows: 2,
|
|
718
|
-
label: "Description",
|
|
719
|
-
value: t.description,
|
|
720
|
-
onChange: (i) => c("description", i.target.value)
|
|
721
|
-
})
|
|
722
|
-
})
|
|
723
|
-
]
|
|
724
|
-
})] })
|
|
725
|
-
}),
|
|
726
|
-
/* @__PURE__ */ e(ne, {
|
|
727
|
-
sx: {
|
|
728
|
-
borderRadius: 1.5,
|
|
729
|
-
mb: 2
|
|
730
|
-
},
|
|
731
|
-
children: /* @__PURE__ */ u(re, { children: [
|
|
732
|
-
/* @__PURE__ */ u(H, {
|
|
733
|
-
direction: "row",
|
|
734
|
-
justifyContent: "space-between",
|
|
735
|
-
alignItems: "center",
|
|
736
|
-
sx: { mb: 0.5 },
|
|
737
|
-
children: [/* @__PURE__ */ e(v, {
|
|
738
|
-
variant: "h6",
|
|
739
|
-
sx: { fontWeight: 800 },
|
|
740
|
-
children: "Product Images"
|
|
741
|
-
}), /* @__PURE__ */ u(v, {
|
|
742
|
-
variant: "caption",
|
|
743
|
-
color: "text.secondary",
|
|
744
|
-
children: [
|
|
745
|
-
"Optional · up to ",
|
|
746
|
-
K,
|
|
747
|
-
" images"
|
|
748
|
-
]
|
|
749
|
-
})]
|
|
750
|
-
}),
|
|
751
|
-
/* @__PURE__ */ e(v, {
|
|
752
|
-
variant: "caption",
|
|
753
|
-
color: "text.secondary",
|
|
754
|
-
sx: {
|
|
755
|
-
display: "block",
|
|
756
|
-
mb: 2
|
|
757
|
-
},
|
|
758
|
-
children: "Add photos of the product or its packaging. The first image is used as the main picture."
|
|
759
|
-
}),
|
|
760
|
-
/* @__PURE__ */ e($e, {
|
|
761
|
-
value: t.imageUuids,
|
|
762
|
-
onChange: (i) => c("imageUuids", i)
|
|
763
|
-
})
|
|
764
|
-
] })
|
|
765
|
-
}),
|
|
766
|
-
b ? /* @__PURE__ */ e(ne, {
|
|
767
|
-
sx: { borderRadius: 1.5 },
|
|
768
|
-
children: /* @__PURE__ */ u(re, { children: [
|
|
769
|
-
/* @__PURE__ */ u(H, {
|
|
770
|
-
direction: "row",
|
|
771
|
-
justifyContent: "space-between",
|
|
772
|
-
alignItems: "center",
|
|
773
|
-
sx: { mb: 2 },
|
|
774
|
-
children: [/* @__PURE__ */ e(v, {
|
|
775
|
-
variant: "h6",
|
|
776
|
-
sx: { fontWeight: 800 },
|
|
777
|
-
children: "Vaccine Configuration"
|
|
778
|
-
}), /* @__PURE__ */ e(v, {
|
|
779
|
-
variant: "caption",
|
|
780
|
-
color: "text.secondary",
|
|
781
|
-
children: "Required for vaccine products. Controls vial size, dosing, and shelf life rules."
|
|
782
|
-
})]
|
|
783
|
-
}),
|
|
784
|
-
/* @__PURE__ */ e(pi, { sx: { mb: 2 } }),
|
|
785
|
-
/* @__PURE__ */ u(a, {
|
|
786
|
-
container: !0,
|
|
787
|
-
spacing: 2,
|
|
788
|
-
children: [
|
|
789
|
-
/* @__PURE__ */ e(a, {
|
|
790
|
-
item: !0,
|
|
791
|
-
xs: 12,
|
|
792
|
-
children: /* @__PURE__ */ e(v, {
|
|
793
|
-
variant: "overline",
|
|
794
|
-
sx: z,
|
|
795
|
-
children: "Vaccine & measure"
|
|
796
|
-
})
|
|
797
|
-
}),
|
|
798
|
-
/* @__PURE__ */ e(a, {
|
|
799
|
-
item: !0,
|
|
800
|
-
xs: 12,
|
|
801
|
-
md: 4,
|
|
802
|
-
children: /* @__PURE__ */ e(S, {
|
|
803
|
-
label: "Vaccine",
|
|
804
|
-
required: !0,
|
|
805
|
-
value: ((de = t.vaccineConfig) == null ? void 0 : de.vaccineCode) || "",
|
|
806
|
-
onChange: (i) => y("vaccineCode", i),
|
|
807
|
-
onBlur: n.onBlur("vaccineCode"),
|
|
808
|
-
error: n.show("vaccineCode") && !!r.vaccineCode,
|
|
809
|
-
helperText: n.show("vaccineCode") && r.vaccineCode ? r.vaccineCode : "",
|
|
810
|
-
noOptionsText: "No vaccines configured in immunization master",
|
|
811
|
-
options: J.map((i) => ({
|
|
812
|
-
value: i.vaccineCode,
|
|
813
|
-
label: `${i.vaccineName} (${i.vaccineCode})`
|
|
814
|
-
}))
|
|
815
|
-
})
|
|
816
|
-
}),
|
|
817
|
-
/* @__PURE__ */ e(a, {
|
|
818
|
-
item: !0,
|
|
819
|
-
xs: 12,
|
|
820
|
-
md: 4,
|
|
821
|
-
children: /* @__PURE__ */ e(S, {
|
|
822
|
-
label: "Measured in",
|
|
823
|
-
value: t.unit,
|
|
824
|
-
onChange: (i) => c("unit", i),
|
|
825
|
-
options: Je,
|
|
826
|
-
helperText: "Vials are dosed in millilitres; drops are counted."
|
|
827
|
-
})
|
|
828
|
-
}),
|
|
829
|
-
/* @__PURE__ */ e(a, {
|
|
830
|
-
item: !0,
|
|
831
|
-
xs: 12,
|
|
832
|
-
md: 4,
|
|
833
|
-
children: /* @__PURE__ */ e(T, {
|
|
834
|
-
required: !0,
|
|
835
|
-
fullWidth: !0,
|
|
836
|
-
size: "small",
|
|
837
|
-
type: "number",
|
|
838
|
-
inputProps: x ? {
|
|
839
|
-
min: 1,
|
|
840
|
-
step: 1
|
|
841
|
-
} : {
|
|
842
|
-
step: "0.01",
|
|
843
|
-
min: 0
|
|
844
|
-
},
|
|
845
|
-
label: x ? "Drops per vial" : "Vial volume (ml)",
|
|
846
|
-
value: ((me = t.vaccineConfig) == null ? void 0 : me.vialVolumeMl) ?? "",
|
|
847
|
-
onChange: (i) => y("vialVolumeMl", i.target.value),
|
|
848
|
-
onBlur: n.onBlur("vialVolumeMl"),
|
|
849
|
-
error: n.show("vialVolumeMl") && !!r.vialVolumeMl,
|
|
850
|
-
helperText: n.show("vialVolumeMl") ? r.vialVolumeMl : x ? "Total drops in a fresh vial" : ""
|
|
851
|
-
})
|
|
852
|
-
}),
|
|
853
|
-
/* @__PURE__ */ e(a, {
|
|
854
|
-
item: !0,
|
|
855
|
-
xs: 12,
|
|
856
|
-
children: /* @__PURE__ */ e(v, {
|
|
857
|
-
variant: "overline",
|
|
858
|
-
sx: {
|
|
859
|
-
...z,
|
|
860
|
-
mt: 1
|
|
861
|
-
},
|
|
862
|
-
children: "Dosing"
|
|
863
|
-
})
|
|
864
|
-
}),
|
|
865
|
-
x ? null : /* @__PURE__ */ u(a, {
|
|
866
|
-
item: !0,
|
|
867
|
-
xs: 12,
|
|
868
|
-
children: [/* @__PURE__ */ e(W, {
|
|
869
|
-
control: /* @__PURE__ */ e(q, {
|
|
870
|
-
checked: !!((pe = t.vaccineConfig) != null && pe.singleDose),
|
|
871
|
-
onChange: (i) => y("singleDose", i.target.checked)
|
|
872
|
-
}),
|
|
873
|
-
label: "Single dose vial"
|
|
874
|
-
}), /* @__PURE__ */ e(v, {
|
|
875
|
-
variant: "caption",
|
|
876
|
-
color: "text.secondary",
|
|
877
|
-
sx: {
|
|
878
|
-
display: "block",
|
|
879
|
-
ml: 4,
|
|
880
|
-
mt: -0.5
|
|
881
|
-
},
|
|
882
|
-
children: "One dose per vial — used up the moment it's opened, so there's no limit on how many can be open at once."
|
|
883
|
-
})]
|
|
884
|
-
}),
|
|
885
|
-
/* @__PURE__ */ e(a, {
|
|
886
|
-
item: !0,
|
|
887
|
-
xs: 12,
|
|
888
|
-
children: !x && ((ge = t.vaccineConfig) != null && ge.singleDose) ? /* @__PURE__ */ u(E, {
|
|
889
|
-
sx: {
|
|
890
|
-
p: 1.5,
|
|
891
|
-
border: "1px solid",
|
|
892
|
-
borderColor: "divider",
|
|
893
|
-
borderRadius: 1.5
|
|
894
|
-
},
|
|
895
|
-
children: [/* @__PURE__ */ e(v, {
|
|
896
|
-
variant: "body2",
|
|
897
|
-
sx: { fontWeight: 700 },
|
|
898
|
-
children: "Single dose"
|
|
899
|
-
}), /* @__PURE__ */ u(v, {
|
|
900
|
-
variant: "caption",
|
|
901
|
-
color: "text.secondary",
|
|
902
|
-
children: [
|
|
903
|
-
"Each vial is one dose of ",
|
|
904
|
-
((he = t.vaccineConfig) == null ? void 0 : he.vialVolumeMl) || "—",
|
|
905
|
-
" ml, given to any patient. No dose profiles are needed."
|
|
906
|
-
]
|
|
907
|
-
})]
|
|
908
|
-
}) : qe()
|
|
909
|
-
}),
|
|
910
|
-
/* @__PURE__ */ e(a, {
|
|
911
|
-
item: !0,
|
|
912
|
-
xs: 12,
|
|
913
|
-
children: /* @__PURE__ */ e(v, {
|
|
914
|
-
variant: "overline",
|
|
915
|
-
sx: {
|
|
916
|
-
...z,
|
|
917
|
-
mt: 1
|
|
918
|
-
},
|
|
919
|
-
children: "Open vial & reconstitution"
|
|
920
|
-
})
|
|
921
|
-
}),
|
|
922
|
-
!x && ((fe = t.vaccineConfig) != null && fe.singleDose) ? null : /* @__PURE__ */ e(a, {
|
|
923
|
-
item: !0,
|
|
924
|
-
xs: 12,
|
|
925
|
-
md: 4,
|
|
926
|
-
children: /* @__PURE__ */ u(H, {
|
|
927
|
-
direction: "row",
|
|
928
|
-
spacing: 1,
|
|
929
|
-
children: [/* @__PURE__ */ e(T, {
|
|
930
|
-
required: !0,
|
|
931
|
-
fullWidth: !0,
|
|
932
|
-
size: "small",
|
|
933
|
-
type: "number",
|
|
934
|
-
inputProps: { min: 1 },
|
|
935
|
-
label: "Open vial validity",
|
|
936
|
-
value: ((ve = t.vaccineConfig) == null ? void 0 : ve.openVialValidityHours) ?? "",
|
|
937
|
-
onChange: (i) => y("openVialValidityHours", i.target.value),
|
|
938
|
-
onBlur: n.onBlur("openVialValidityHours"),
|
|
939
|
-
error: n.show("openVialValidityHours") && !!r.openVialValidityHours,
|
|
940
|
-
helperText: n.show("openVialValidityHours") ? r.openVialValidityHours : "How long the vial stays usable once opened"
|
|
941
|
-
}), /* @__PURE__ */ e(E, {
|
|
942
|
-
sx: {
|
|
943
|
-
minWidth: 132,
|
|
944
|
-
flexShrink: 0
|
|
945
|
-
},
|
|
946
|
-
children: /* @__PURE__ */ e(S, {
|
|
947
|
-
label: "Unit",
|
|
948
|
-
value: ((Ce = t.vaccineConfig) == null ? void 0 : Ce.openVialValidityUnit) || "HOURS",
|
|
949
|
-
onChange: (i) => y("openVialValidityUnit", i),
|
|
950
|
-
options: Oe
|
|
951
|
-
})
|
|
952
|
-
})]
|
|
953
|
-
})
|
|
954
|
-
}),
|
|
955
|
-
!x && ((xe = t.vaccineConfig) != null && xe.singleDose) ? null : /* @__PURE__ */ e(a, {
|
|
956
|
-
item: !0,
|
|
957
|
-
xs: 12,
|
|
958
|
-
md: 4,
|
|
959
|
-
children: /* @__PURE__ */ e(T, {
|
|
960
|
-
required: !0,
|
|
961
|
-
fullWidth: !0,
|
|
962
|
-
size: "small",
|
|
963
|
-
type: "number",
|
|
964
|
-
inputProps: {
|
|
965
|
-
min: 1,
|
|
966
|
-
max: 20
|
|
967
|
-
},
|
|
968
|
-
label: "Max concurrent open vials",
|
|
969
|
-
value: ((be = t.vaccineConfig) == null ? void 0 : be.maxConcurrentOpenVials) ?? "",
|
|
970
|
-
onChange: (i) => y("maxConcurrentOpenVials", i.target.value),
|
|
971
|
-
onBlur: n.onBlur("maxConcurrentOpenVials"),
|
|
972
|
-
error: n.show("maxConcurrentOpenVials") && !!r.maxConcurrentOpenVials,
|
|
973
|
-
helperText: n.show("maxConcurrentOpenVials") ? r.maxConcurrentOpenVials : ""
|
|
974
|
-
})
|
|
975
|
-
}),
|
|
976
|
-
/* @__PURE__ */ e(a, {
|
|
977
|
-
item: !0,
|
|
978
|
-
xs: 12,
|
|
979
|
-
children: /* @__PURE__ */ e(W, {
|
|
980
|
-
control: /* @__PURE__ */ e(q, {
|
|
981
|
-
checked: !!((ye = t.vaccineConfig) != null && ye.requiresReconstitution),
|
|
982
|
-
onChange: (i) => y("requiresReconstitution", i.target.checked)
|
|
983
|
-
}),
|
|
984
|
-
label: "Requires reconstitution"
|
|
985
|
-
})
|
|
986
|
-
}),
|
|
987
|
-
(Ve = t.vaccineConfig) != null && Ve.requiresReconstitution ? /* @__PURE__ */ e(a, {
|
|
988
|
-
item: !0,
|
|
989
|
-
xs: 12,
|
|
990
|
-
md: 4,
|
|
991
|
-
children: /* @__PURE__ */ u(H, {
|
|
992
|
-
direction: "row",
|
|
993
|
-
spacing: 1,
|
|
994
|
-
children: [/* @__PURE__ */ e(T, {
|
|
995
|
-
fullWidth: !0,
|
|
996
|
-
size: "small",
|
|
997
|
-
type: "number",
|
|
998
|
-
inputProps: { min: 1 },
|
|
999
|
-
required: !0,
|
|
1000
|
-
label: "Reconstituted validity",
|
|
1001
|
-
value: ((Ae = t.vaccineConfig) == null ? void 0 : Ae.reconstitutedValidityHours) ?? "",
|
|
1002
|
-
onChange: (i) => y("reconstitutedValidityHours", i.target.value),
|
|
1003
|
-
onBlur: n.onBlur("reconstitutedValidityHours"),
|
|
1004
|
-
error: n.show("reconstitutedValidityHours") && !!r.reconstitutedValidityHours,
|
|
1005
|
-
helperText: n.show("reconstitutedValidityHours") ? r.reconstitutedValidityHours : ""
|
|
1006
|
-
}), /* @__PURE__ */ e(E, {
|
|
1007
|
-
sx: {
|
|
1008
|
-
minWidth: 132,
|
|
1009
|
-
flexShrink: 0
|
|
1010
|
-
},
|
|
1011
|
-
children: /* @__PURE__ */ e(S, {
|
|
1012
|
-
label: "Unit",
|
|
1013
|
-
value: ((Te = t.vaccineConfig) == null ? void 0 : Te.reconstitutedValidityUnit) || "HOURS",
|
|
1014
|
-
onChange: (i) => y("reconstitutedValidityUnit", i),
|
|
1015
|
-
options: Oe
|
|
1016
|
-
})
|
|
1017
|
-
})]
|
|
1018
|
-
})
|
|
1019
|
-
}) : null,
|
|
1020
|
-
/* @__PURE__ */ e(a, {
|
|
1021
|
-
item: !0,
|
|
1022
|
-
xs: 12,
|
|
1023
|
-
children: /* @__PURE__ */ e(v, {
|
|
1024
|
-
variant: "overline",
|
|
1025
|
-
sx: {
|
|
1026
|
-
...z,
|
|
1027
|
-
mt: 1
|
|
1028
|
-
},
|
|
1029
|
-
children: "Storage & route"
|
|
1030
|
-
})
|
|
1031
|
-
}),
|
|
1032
|
-
/* @__PURE__ */ e(a, {
|
|
1033
|
-
item: !0,
|
|
1034
|
-
xs: 12,
|
|
1035
|
-
md: 4,
|
|
1036
|
-
children: /* @__PURE__ */ e(S, {
|
|
1037
|
-
label: "Route of administration",
|
|
1038
|
-
value: ((Me = t.vaccineConfig) == null ? void 0 : Me.route) || "",
|
|
1039
|
-
onChange: (i) => y("route", i),
|
|
1040
|
-
options: ei
|
|
1041
|
-
})
|
|
1042
|
-
}),
|
|
1043
|
-
/* @__PURE__ */ e(a, {
|
|
1044
|
-
item: !0,
|
|
1045
|
-
xs: 6,
|
|
1046
|
-
md: 4,
|
|
1047
|
-
children: /* @__PURE__ */ e(T, {
|
|
1048
|
-
fullWidth: !0,
|
|
1049
|
-
size: "small",
|
|
1050
|
-
type: "number",
|
|
1051
|
-
inputProps: {
|
|
1052
|
-
step: "0.1",
|
|
1053
|
-
min: -90,
|
|
1054
|
-
max: 30
|
|
1055
|
-
},
|
|
1056
|
-
label: "Storage temp min (°C)",
|
|
1057
|
-
value: ((Ue = t.vaccineConfig) == null ? void 0 : Ue.storageTempMinCelsius) ?? "",
|
|
1058
|
-
onChange: (i) => y("storageTempMinCelsius", i.target.value),
|
|
1059
|
-
onBlur: n.onBlur("storageTempMinCelsius"),
|
|
1060
|
-
error: n.show("storageTempMinCelsius") && !!r.storageTempMinCelsius,
|
|
1061
|
-
helperText: n.show("storageTempMinCelsius") && r.storageTempMinCelsius ? r.storageTempMinCelsius : "−90°C to +30°C"
|
|
1062
|
-
})
|
|
1063
|
-
}),
|
|
1064
|
-
/* @__PURE__ */ e(a, {
|
|
1065
|
-
item: !0,
|
|
1066
|
-
xs: 6,
|
|
1067
|
-
md: 4,
|
|
1068
|
-
children: /* @__PURE__ */ e(T, {
|
|
1069
|
-
fullWidth: !0,
|
|
1070
|
-
size: "small",
|
|
1071
|
-
type: "number",
|
|
1072
|
-
inputProps: {
|
|
1073
|
-
step: "0.1",
|
|
1074
|
-
min: -90,
|
|
1075
|
-
max: 30
|
|
1076
|
-
},
|
|
1077
|
-
label: "Storage temp max (°C)",
|
|
1078
|
-
value: ((Re = t.vaccineConfig) == null ? void 0 : Re.storageTempMaxCelsius) ?? "",
|
|
1079
|
-
onChange: (i) => y("storageTempMaxCelsius", i.target.value),
|
|
1080
|
-
onBlur: n.onBlur("storageTempMaxCelsius"),
|
|
1081
|
-
error: n.show("storageTempMaxCelsius") && !!r.storageTempMaxCelsius,
|
|
1082
|
-
helperText: n.show("storageTempMaxCelsius") && r.storageTempMaxCelsius ? r.storageTempMaxCelsius : "−90°C to +30°C"
|
|
1083
|
-
})
|
|
1084
|
-
}),
|
|
1085
|
-
/* @__PURE__ */ e(a, {
|
|
1086
|
-
item: !0,
|
|
1087
|
-
xs: 12,
|
|
1088
|
-
children: /* @__PURE__ */ e(v, {
|
|
1089
|
-
variant: "overline",
|
|
1090
|
-
sx: {
|
|
1091
|
-
...z,
|
|
1092
|
-
mt: 1
|
|
1093
|
-
},
|
|
1094
|
-
children: "Notes"
|
|
1095
|
-
})
|
|
1096
|
-
}),
|
|
1097
|
-
/* @__PURE__ */ e(a, {
|
|
1098
|
-
item: !0,
|
|
1099
|
-
xs: 12,
|
|
1100
|
-
children: /* @__PURE__ */ e(T, {
|
|
1101
|
-
fullWidth: !0,
|
|
1102
|
-
size: "small",
|
|
1103
|
-
multiline: !0,
|
|
1104
|
-
minRows: 2,
|
|
1105
|
-
label: "Comments",
|
|
1106
|
-
value: ((Se = t.vaccineConfig) == null ? void 0 : Se.comments) || "",
|
|
1107
|
-
onChange: (i) => y("comments", i.target.value)
|
|
1108
|
-
})
|
|
1109
|
-
})
|
|
1110
|
-
]
|
|
1111
|
-
})
|
|
1112
|
-
] })
|
|
1113
|
-
}) : null
|
|
1114
|
-
]
|
|
1115
|
-
})
|
|
1116
|
-
})] });
|
|
1117
|
-
}
|
|
1118
|
-
function $e({ value: g, onChange: k }) {
|
|
1119
|
-
let V = g ?? [], U = Ie(null), [w, C] = I(!1), [B, j] = I({}), $ = Ie({});
|
|
1120
|
-
$.current = B;
|
|
1121
|
-
function Q(d, n) {
|
|
1122
|
-
j((f) => f[d] ? f : {
|
|
1123
|
-
...f,
|
|
1124
|
-
[d]: n
|
|
1125
|
-
});
|
|
1126
|
-
}
|
|
1127
|
-
oe(() => {
|
|
1128
|
-
let d = !1;
|
|
1129
|
-
return V.forEach((n) => {
|
|
1130
|
-
$.current[n] || ze(n).then((f) => {
|
|
1131
|
-
d || Q(n, URL.createObjectURL(f));
|
|
1132
|
-
}).catch(() => {
|
|
1133
|
-
});
|
|
1134
|
-
}), () => {
|
|
1135
|
-
d = !0;
|
|
1136
|
-
};
|
|
1137
|
-
}, [V]), oe(() => () => {
|
|
1138
|
-
Object.values($.current).forEach((d) => {
|
|
1139
|
-
try {
|
|
1140
|
-
URL.revokeObjectURL(d);
|
|
1141
|
-
} catch {
|
|
1142
|
-
}
|
|
1143
|
-
});
|
|
1144
|
-
}, []);
|
|
1145
|
-
async function X(d) {
|
|
1146
|
-
var b, x;
|
|
1147
|
-
let n = Array.from(d || []);
|
|
1148
|
-
if (n.length === 0) return;
|
|
1149
|
-
let f = K - V.length;
|
|
1150
|
-
if (f <= 0) {
|
|
1151
|
-
Y({
|
|
1152
|
-
message: `You can add at most ${K} images.`,
|
|
1153
|
-
type: "warning"
|
|
1154
|
-
});
|
|
1155
|
-
return;
|
|
1156
|
-
}
|
|
1157
|
-
let t = n.find((c) => !c.type.startsWith("image/") || c.size > yi);
|
|
1158
|
-
if (t) {
|
|
1159
|
-
Y({
|
|
1160
|
-
message: t.type.startsWith("image/") ? "Each image must be 5 MB or smaller." : "Only image files can be uploaded.",
|
|
1161
|
-
type: "error"
|
|
1162
|
-
});
|
|
1163
|
-
return;
|
|
1164
|
-
}
|
|
1165
|
-
let R = n.slice(0, f);
|
|
1166
|
-
n.length > f && Y({
|
|
1167
|
-
message: `Only ${f} more image${f === 1 ? "" : "s"} can be added.`,
|
|
1168
|
-
type: "warning"
|
|
1169
|
-
});
|
|
1170
|
-
let O = R.map(() => le());
|
|
1171
|
-
C(!0);
|
|
1172
|
-
try {
|
|
1173
|
-
await Ye(R, O), R.forEach((c, y) => Q(O[y], URL.createObjectURL(c))), k([...V, ...O]);
|
|
1174
|
-
} catch (c) {
|
|
1175
|
-
Y({
|
|
1176
|
-
message: ((x = (b = c == null ? void 0 : c.response) == null ? void 0 : b.data) == null ? void 0 : x.message) ?? (c == null ? void 0 : c.message) ?? "Failed to upload images",
|
|
1177
|
-
type: "error"
|
|
1178
|
-
});
|
|
1179
|
-
} finally {
|
|
1180
|
-
C(!1);
|
|
1181
|
-
}
|
|
1182
|
-
}
|
|
1183
|
-
function Z(d) {
|
|
1184
|
-
k(V.filter((n) => n !== d));
|
|
1185
|
-
}
|
|
1186
|
-
let J = V.length >= K;
|
|
1187
|
-
return /* @__PURE__ */ u(E, { children: [
|
|
1188
|
-
/* @__PURE__ */ e("input", {
|
|
1189
|
-
ref: U,
|
|
1190
|
-
type: "file",
|
|
1191
|
-
accept: "image/*",
|
|
1192
|
-
multiple: !0,
|
|
1193
|
-
hidden: !0,
|
|
1194
|
-
onChange: (d) => {
|
|
1195
|
-
X(d.target.files), d.target.value = "";
|
|
1196
|
-
}
|
|
1197
|
-
}),
|
|
1198
|
-
/* @__PURE__ */ u(H, {
|
|
1199
|
-
direction: "row",
|
|
1200
|
-
spacing: 1.5,
|
|
1201
|
-
sx: {
|
|
1202
|
-
flexWrap: "wrap",
|
|
1203
|
-
gap: 1.5
|
|
1204
|
-
},
|
|
1205
|
-
children: [V.map((d, n) => /* @__PURE__ */ u(E, {
|
|
1206
|
-
sx: {
|
|
1207
|
-
position: "relative",
|
|
1208
|
-
width: 104,
|
|
1209
|
-
height: 104,
|
|
1210
|
-
borderRadius: 1.5,
|
|
1211
|
-
border: "1px solid",
|
|
1212
|
-
borderColor: "divider",
|
|
1213
|
-
overflow: "hidden",
|
|
1214
|
-
bgcolor: "grey.50",
|
|
1215
|
-
display: "flex",
|
|
1216
|
-
alignItems: "center",
|
|
1217
|
-
justifyContent: "center"
|
|
1218
|
-
},
|
|
1219
|
-
children: [
|
|
1220
|
-
B[d] ? /* @__PURE__ */ e(E, {
|
|
1221
|
-
component: "img",
|
|
1222
|
-
src: B[d],
|
|
1223
|
-
alt: `Product image ${n + 1}`,
|
|
1224
|
-
sx: {
|
|
1225
|
-
width: "100%",
|
|
1226
|
-
height: "100%",
|
|
1227
|
-
objectFit: "cover"
|
|
1228
|
-
}
|
|
1229
|
-
}) : /* @__PURE__ */ e(He, { size: 20 }),
|
|
1230
|
-
n === 0 ? /* @__PURE__ */ e(E, {
|
|
1231
|
-
sx: {
|
|
1232
|
-
position: "absolute",
|
|
1233
|
-
left: 0,
|
|
1234
|
-
bottom: 0,
|
|
1235
|
-
right: 0,
|
|
1236
|
-
bgcolor: "rgba(0,0,0,0.55)",
|
|
1237
|
-
color: "#fff",
|
|
1238
|
-
fontSize: "0.6rem",
|
|
1239
|
-
fontWeight: 800,
|
|
1240
|
-
letterSpacing: 0.5,
|
|
1241
|
-
textAlign: "center",
|
|
1242
|
-
py: 0.25
|
|
1243
|
-
},
|
|
1244
|
-
children: "MAIN"
|
|
1245
|
-
}) : null,
|
|
1246
|
-
/* @__PURE__ */ e(ke, {
|
|
1247
|
-
size: "small",
|
|
1248
|
-
onClick: () => Z(d),
|
|
1249
|
-
sx: {
|
|
1250
|
-
position: "absolute",
|
|
1251
|
-
top: 2,
|
|
1252
|
-
right: 2,
|
|
1253
|
-
p: 0.25,
|
|
1254
|
-
bgcolor: "rgba(0,0,0,0.5)",
|
|
1255
|
-
color: "#fff",
|
|
1256
|
-
"&:hover": { bgcolor: "rgba(0,0,0,0.7)" }
|
|
1257
|
-
},
|
|
1258
|
-
"aria-label": "Remove image",
|
|
1259
|
-
children: /* @__PURE__ */ e(bi, { sx: { fontSize: 16 } })
|
|
1260
|
-
})
|
|
1261
|
-
]
|
|
1262
|
-
}, d)), J ? null : /* @__PURE__ */ u(_, {
|
|
1263
|
-
variant: "outlined",
|
|
1264
|
-
onClick: () => {
|
|
1265
|
-
var d;
|
|
1266
|
-
return (d = U.current) == null ? void 0 : d.click();
|
|
1267
|
-
},
|
|
1268
|
-
disabled: w,
|
|
1269
|
-
sx: {
|
|
1270
|
-
width: 104,
|
|
1271
|
-
height: 104,
|
|
1272
|
-
borderStyle: "dashed",
|
|
1273
|
-
flexDirection: "column",
|
|
1274
|
-
gap: 0.5,
|
|
1275
|
-
color: "text.secondary"
|
|
1276
|
-
},
|
|
1277
|
-
children: [w ? /* @__PURE__ */ e(He, { size: 22 }) : /* @__PURE__ */ e(xi, {}), /* @__PURE__ */ e(v, {
|
|
1278
|
-
variant: "caption",
|
|
1279
|
-
sx: { fontWeight: 700 },
|
|
1280
|
-
children: w ? "Uploading…" : "Add"
|
|
1281
|
-
})]
|
|
1282
|
-
})]
|
|
1283
|
-
}),
|
|
1284
|
-
V.length === 0 && !w ? /* @__PURE__ */ e(v, {
|
|
1285
|
-
variant: "caption",
|
|
1286
|
-
color: "text.disabled",
|
|
1287
|
-
sx: {
|
|
1288
|
-
display: "block",
|
|
1289
|
-
mt: 1
|
|
1290
|
-
},
|
|
1291
|
-
children: "No images added yet."
|
|
1292
|
-
}) : null
|
|
1293
|
-
] });
|
|
1294
|
-
}
|
|
1295
|
-
$e.propTypes = {
|
|
1296
|
-
value: te.arrayOf(te.string),
|
|
1297
|
-
onChange: te.func.isRequired
|
|
1298
|
-
};
|
|
1299
|
-
export {
|
|
1300
|
-
Wi as default
|
|
1301
|
-
};
|
|
1302
|
-
//# sourceMappingURL=ProductEditPage-C1thoKHu-URQaZ6st.js.map
|