@argusoft/medplat-core 1.0.28 → 1.0.30

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.
Files changed (229) hide show
  1. package/dist/AccessRights-xrday-L1.js +1023 -0
  2. package/dist/AccessRights-xrday-L1.js.map +1 -0
  3. package/dist/AddEditQueryBuilder-D-iQiVIe.js +365 -0
  4. package/dist/AddEditQueryBuilder-D-iQiVIe.js.map +1 -0
  5. package/dist/{AddFeatures-C0Z29oSd.js → AddFeatures-D1sU8RjY.js} +2 -2
  6. package/dist/{AddFeatures-C0Z29oSd.js.map → AddFeatures-D1sU8RjY.js.map} +1 -1
  7. package/dist/AddLabelModal-Bq-wRqv9.js +631 -0
  8. package/dist/AddLabelModal-Bq-wRqv9.js.map +1 -0
  9. package/dist/AddMenuConfiguration-e5BVXhmw.js +8547 -0
  10. package/dist/AddMenuConfiguration-e5BVXhmw.js.map +1 -0
  11. package/dist/{AddRoleDrawer-CQdzQZLb.js → AddRoleDrawer-0gqAK8N0.js} +62 -63
  12. package/dist/AddRoleDrawer-0gqAK8N0.js.map +1 -0
  13. package/dist/AppModal-CCtrQ5Tr.js +394 -0
  14. package/dist/AppModal-CCtrQ5Tr.js.map +1 -0
  15. package/dist/BrandsPage-DmRW5bhm-Bk1szrjI.js +387 -0
  16. package/dist/BrandsPage-DmRW5bhm-Bk1szrjI.js.map +1 -0
  17. package/dist/CategoriesPage-BsS5IQh3-B03lWRY5.js +391 -0
  18. package/dist/CategoriesPage-BsS5IQh3-B03lWRY5.js.map +1 -0
  19. package/dist/{ChangePasswordModalCore-CDxkeIIM.js → ChangePasswordModalCore-BPsJquTS.js} +1606 -1611
  20. package/dist/ChangePasswordModalCore-BPsJquTS.js.map +1 -0
  21. package/dist/{ConditionConfig-DSsgGEXS.js → ConditionConfig-Ddz9halE.js} +2 -2
  22. package/dist/ConditionConfig-Ddz9halE.js.map +1 -0
  23. package/dist/DashboardPage-C3bKc5na-sBd9Yqbi.js +435 -0
  24. package/dist/DashboardPage-C3bKc5na-sBd9Yqbi.js.map +1 -0
  25. package/dist/{EntityManagement-GaYsBTvf.js → EntityManagement-CPQL6qBj.js} +2 -2
  26. package/dist/{EntityManagement-GaYsBTvf.js.map → EntityManagement-CPQL6qBj.js.map} +1 -1
  27. package/dist/EventConfig-BmLemzX3.js +26 -0
  28. package/dist/EventConfig-BmLemzX3.js.map +1 -0
  29. package/dist/{EventConfigurations-kNtAj_WM.js → EventConfigurations-Bzh1qWXU.js} +31 -30
  30. package/dist/{EventConfigurations-kNtAj_WM.js.map → EventConfigurations-Bzh1qWXU.js.map} +1 -1
  31. package/dist/{EventsExceptionModal-D4Bf1ilS.js → EventsExceptionModal-B2SRrnB1.js} +2 -2
  32. package/dist/{EventsExceptionModal-D4Bf1ilS.js.map → EventsExceptionModal-B2SRrnB1.js.map} +1 -1
  33. package/dist/EventsSkeleton-BIcPks4T.js +61 -0
  34. package/dist/EventsSkeleton-BIcPks4T.js.map +1 -0
  35. package/dist/FacilityPicker-BiZeupmP-CyPHmj6b.js +79 -0
  36. package/dist/FacilityPicker-BiZeupmP-CyPHmj6b.js.map +1 -0
  37. package/dist/FeatureMenu-DYJmDt7q.js +521 -0
  38. package/dist/FeatureMenu-DYJmDt7q.js.map +1 -0
  39. package/dist/Features-Dne21RWu.js +14 -0
  40. package/dist/Features-Dne21RWu.js.map +1 -0
  41. package/dist/{FhirServerList-Dkq7Kbes.js → FhirServerList-DuTwnngN.js} +19 -19
  42. package/dist/{FhirServerList-Dkq7Kbes.js.map → FhirServerList-DuTwnngN.js.map} +1 -1
  43. package/dist/{FhirServerWizard-Db6Hm4bQ.js → FhirServerWizard-DZI8Olku.js} +15 -15
  44. package/dist/{FhirServerWizard-Db6Hm4bQ.js.map → FhirServerWizard-DZI8Olku.js.map} +1 -1
  45. package/dist/FlywayQuery-CQygj51V.js +179 -0
  46. package/dist/FlywayQuery-CQygj51V.js.map +1 -0
  47. package/dist/{ManageNotification-CaBAOhji.js → Google-DQxMfbaL.js} +1725 -2652
  48. package/dist/{ManageNotification-CaBAOhji.js.map → Google-DQxMfbaL.js.map} +1 -1
  49. package/dist/GrantPermissionModal-BDN66Atn.js +236 -0
  50. package/dist/GrantPermissionModal-BDN66Atn.js.map +1 -0
  51. package/dist/ImmunizationConfigurationBase-Di1KO3oW.js +7639 -0
  52. package/dist/ImmunizationConfigurationBase-Di1KO3oW.js.map +1 -0
  53. package/dist/ImmunizationConfigurationBase.css +1 -1
  54. package/dist/ImmunizationConfigurationsList-TZcLDEci.js +369 -0
  55. package/dist/ImmunizationConfigurationsList-TZcLDEci.js.map +1 -0
  56. package/dist/InventoryPage-C_AxSy7A-QLvlL4rE.js +665 -0
  57. package/dist/InventoryPage-C_AxSy7A-QLvlL4rE.js.map +1 -0
  58. package/dist/LanguagesModal-B3NTebYT.js +352 -0
  59. package/dist/LanguagesModal-B3NTebYT.js.map +1 -0
  60. package/dist/ManageDynamicFeature-BU0I45dd.js +4475 -0
  61. package/dist/ManageDynamicFeature-BU0I45dd.js.map +1 -0
  62. package/dist/{ManageEventConfiguration-DV3I5POA.js → ManageEventConfiguration-CoYcpjR9.js} +465 -397
  63. package/dist/ManageEventConfiguration-CoYcpjR9.js.map +1 -0
  64. package/dist/ManageNotification-C5MhV77Q.js +934 -0
  65. package/dist/ManageNotification-C5MhV77Q.js.map +1 -0
  66. package/dist/{ManageRole-CGYfglpo.js → ManageRole-CNZBRKGU.js} +32 -30
  67. package/dist/ManageRole-CNZBRKGU.js.map +1 -0
  68. package/dist/ManageTranslation-vRiptUAP.js +833 -0
  69. package/dist/ManageTranslation-vRiptUAP.js.map +1 -0
  70. package/dist/ManageTranslation.css +1 -1
  71. package/dist/{ManageUser-AY1EUDLI.js → ManageUser-DCFkUMV9.js} +1722 -1586
  72. package/dist/ManageUser-DCFkUMV9.js.map +1 -0
  73. package/dist/MemberProfileCard-BdUNgHRB-VywqQdFF.js +272 -0
  74. package/dist/MemberProfileCard-BdUNgHRB-VywqQdFF.js.map +1 -0
  75. package/dist/MobileAnalytics-pQoE8cG1.js +16888 -0
  76. package/dist/MobileAnalytics-pQoE8cG1.js.map +1 -0
  77. package/dist/MobileMenuManagement-Cf8IZlla.js +108 -0
  78. package/dist/MobileMenuManagement-Cf8IZlla.js.map +1 -0
  79. package/dist/{MobileTypeEventConfigModal-BxLympIO.js → MobileTypeEventConfigModal-BeveaX0C.js} +2 -2
  80. package/dist/MobileTypeEventConfigModal-BeveaX0C.js.map +1 -0
  81. package/dist/NotificationFlywayQuery-BAHVjf6N.js +247 -0
  82. package/dist/NotificationFlywayQuery-BAHVjf6N.js.map +1 -0
  83. package/dist/{NotificationList-C3Vb_jKU.js → NotificationList-DEyRZEuM.js} +109 -110
  84. package/dist/NotificationList-DEyRZEuM.js.map +1 -0
  85. package/dist/{OtherTypeEventConfigModal-BeG1GrUi.js → OtherTypeEventConfigModal-CM6VkdmY.js} +570 -478
  86. package/dist/OtherTypeEventConfigModal-CM6VkdmY.js.map +1 -0
  87. package/dist/PaymentCreatePage-CIVe0P0p-25BQVpOX.js +482 -0
  88. package/dist/PaymentCreatePage-CIVe0P0p-25BQVpOX.js.map +1 -0
  89. package/dist/PaymentsPage-BvPe5Q9F-D2gfziwW.js +157 -0
  90. package/dist/PaymentsPage-BvPe5Q9F-D2gfziwW.js.map +1 -0
  91. package/dist/PermissionsModal-CCYkcKlC.js +151 -0
  92. package/dist/PermissionsModal-CCYkcKlC.js.map +1 -0
  93. package/dist/PickupBatchLinesEditor-DHmcAG23-DL2p6IKJ.js +119 -0
  94. package/dist/PickupBatchLinesEditor-DHmcAG23-DL2p6IKJ.js.map +1 -0
  95. package/dist/PickupCreatePage-CB0Sl0Hb-Mmj7zESG.js +783 -0
  96. package/dist/PickupCreatePage-CB0Sl0Hb-Mmj7zESG.js.map +1 -0
  97. package/dist/PickupsPage-Ctpghavs-CUp4uIZq.js +818 -0
  98. package/dist/PickupsPage-Ctpghavs-CUp4uIZq.js.map +1 -0
  99. package/dist/PmGuard-b10TGXEi-G3N0G_Wg.js +599 -0
  100. package/dist/PmGuard-b10TGXEi-G3N0G_Wg.js.map +1 -0
  101. package/dist/ProductEditPage-C1thoKHu-URQaZ6st.js +1302 -0
  102. package/dist/ProductEditPage-C1thoKHu-URQaZ6st.js.map +1 -0
  103. package/dist/ProductsPage-CupVmOD4-D45a_hf-.js +252 -0
  104. package/dist/ProductsPage-CupVmOD4-D45a_hf-.js.map +1 -0
  105. package/dist/PurchaseCreatePage-YD3NmhPQ-2j4etSjM.js +648 -0
  106. package/dist/PurchaseCreatePage-YD3NmhPQ-2j4etSjM.js.map +1 -0
  107. package/dist/PurchaseRequestDetailPage-Dg_MRY_N-D1bgTEAn.js +1577 -0
  108. package/dist/PurchaseRequestDetailPage-Dg_MRY_N-D1bgTEAn.js.map +1 -0
  109. package/dist/PurchaseRequestsPage-DPAPzpmm-mDH2IrTl.js +279 -0
  110. package/dist/PurchaseRequestsPage-DPAPzpmm-mDH2IrTl.js.map +1 -0
  111. package/dist/PurchasesPage-It1GHiXl-eH4IsF_U.js +293 -0
  112. package/dist/PurchasesPage-It1GHiXl-eH4IsF_U.js.map +1 -0
  113. package/dist/QueryBuilder-CXaBe6sr.js +478 -0
  114. package/dist/QueryBuilder-CXaBe6sr.js.map +1 -0
  115. package/dist/{RoleManagement-BPl2cE27.js → RoleManagement-s8iNx2Mu.js} +131 -142
  116. package/dist/RoleManagement-s8iNx2Mu.js.map +1 -0
  117. package/dist/Roles-BIyiic67.js +14 -0
  118. package/dist/Roles-BIyiic67.js.map +1 -0
  119. package/dist/SaleCreatePage-C9kFmTvm-B3Y0o4CX.js +544 -0
  120. package/dist/SaleCreatePage-C9kFmTvm-B3Y0o4CX.js.map +1 -0
  121. package/dist/SalesPage-D18DCseD-BxktGDRQ.js +315 -0
  122. package/dist/SalesPage-D18DCseD-BxktGDRQ.js.map +1 -0
  123. package/dist/{ServerSyncModal-D_oFpv3C.js → ServerSyncModal-92U3xtqI.js} +84 -85
  124. package/dist/ServerSyncModal-92U3xtqI.js.map +1 -0
  125. package/dist/SettingsPage-VsxI-ano-DcmtUUEj.js +747 -0
  126. package/dist/SettingsPage-VsxI-ano-DcmtUUEj.js.map +1 -0
  127. package/dist/ShowFlywayQuery-D10Olk5Z.js +154 -0
  128. package/dist/ShowFlywayQuery-D10Olk5Z.js.map +1 -0
  129. package/dist/{ShowFlywayQuery-DVRCd384.js → ShowFlywayQuery-D1y_4A1u.js} +161 -121
  130. package/dist/ShowFlywayQuery-D1y_4A1u.js.map +1 -0
  131. package/dist/ShowQueryHistory-DRBKYDKk.js +313 -0
  132. package/dist/ShowQueryHistory-DRBKYDKk.js.map +1 -0
  133. package/dist/StorageUnitsPage-7EqwuMOI-BwUso1Th.js +721 -0
  134. package/dist/StorageUnitsPage-7EqwuMOI-BwUso1Th.js.map +1 -0
  135. package/dist/SubMenu-eEDhZUvh.js +317 -0
  136. package/dist/SubMenu-eEDhZUvh.js.map +1 -0
  137. package/dist/{TableDetails-Cf_YfnY2.js → TableDetails-BtafRxXb.js} +1069 -831
  138. package/dist/TableDetails-BtafRxXb.js.map +1 -0
  139. package/dist/{TableList-D6jnIbnz.js → TableList-Dpo6dO7S.js} +2 -2
  140. package/dist/{TableList-D6jnIbnz.js.map → TableList-Dpo6dO7S.js.map} +1 -1
  141. package/dist/TransactionsPage-DrH53pVS-BkhIGB6C.js +746 -0
  142. package/dist/TransactionsPage-DrH53pVS-BkhIGB6C.js.map +1 -0
  143. package/dist/TransferCreatePage-CuvoMrYH-DTTfHjz-.js +315 -0
  144. package/dist/TransferCreatePage-CuvoMrYH-DTTfHjz-.js.map +1 -0
  145. package/dist/TransfersPage-Cf701t8s-BBbN7cBf.js +476 -0
  146. package/dist/TransfersPage-Cf701t8s-BBbN7cBf.js.map +1 -0
  147. package/dist/{TypeConfiguration-37wp-gsl.js → TypeConfiguration-3O6ABrK-.js} +2 -2
  148. package/dist/{TypeConfiguration-37wp-gsl.js.map → TypeConfiguration-3O6ABrK-.js.map} +1 -1
  149. package/dist/{UserList-Bc8gYxRL.js → UserList-DgPxsnj2.js} +253 -236
  150. package/dist/{UserList-Bc8gYxRL.js.map → UserList-DgPxsnj2.js.map} +1 -1
  151. package/dist/Users-Bpc4Sazd.js +41 -0
  152. package/dist/Users-Bpc4Sazd.js.map +1 -0
  153. package/dist/VialsPage-8oAc1yFv-Cl3FUXBJ.js +321 -0
  154. package/dist/VialsPage-8oAc1yFv-Cl3FUXBJ.js.map +1 -0
  155. package/dist/{WidgetList-Dw_FmbbE.js → WidgetList-D7YuWfDD.js} +2 -2
  156. package/dist/{WidgetList-Dw_FmbbE.js.map → WidgetList-D7YuWfDD.js.map} +1 -1
  157. package/dist/constants-ClZJY2x1-MkSWn6TZ.js +434 -0
  158. package/dist/constants-ClZJY2x1-MkSWn6TZ.js.map +1 -0
  159. package/dist/dashboardLayoutUtils-D1xCAxp3.js +405 -0
  160. package/dist/dashboardLayoutUtils-D1xCAxp3.js.map +1 -0
  161. package/dist/format-UOyOu75i-D0GyylyQ.js +63 -0
  162. package/dist/format-UOyOu75i-D0GyylyQ.js.map +1 -0
  163. package/dist/index.css +1 -1
  164. package/dist/index.js +4 -752
  165. package/dist/index.js.map +1 -1
  166. package/dist/index.lib-Dn8PMkeD.js +862 -0
  167. package/dist/index.lib-Dn8PMkeD.js.map +1 -0
  168. package/dist/useFieldErrors-hDG8ox_x-DbSAzrGo.js +28 -0
  169. package/dist/useFieldErrors-hDG8ox_x-DbSAzrGo.js.map +1 -0
  170. package/dist/validation-BzlHnL-r-CCJm2utQ.js +125 -0
  171. package/dist/validation-BzlHnL-r-CCJm2utQ.js.map +1 -0
  172. package/package.json +5 -4
  173. package/dist/AccessRights-CHu27ZOw.js +0 -1262
  174. package/dist/AccessRights-CHu27ZOw.js.map +0 -1
  175. package/dist/AddEditQueryBuilder-Brdnm6rQ.js +0 -313
  176. package/dist/AddEditQueryBuilder-Brdnm6rQ.js.map +0 -1
  177. package/dist/AddLabelModal-DFllBVcd.js +0 -734
  178. package/dist/AddLabelModal-DFllBVcd.js.map +0 -1
  179. package/dist/AddMenuConfiguration-BSQLl88V.js +0 -6570
  180. package/dist/AddMenuConfiguration-BSQLl88V.js.map +0 -1
  181. package/dist/AddRoleDrawer-CQdzQZLb.js.map +0 -1
  182. package/dist/AppModal-CtG2GjD_.js +0 -428
  183. package/dist/AppModal-CtG2GjD_.js.map +0 -1
  184. package/dist/ChangePasswordModalCore-CDxkeIIM.js.map +0 -1
  185. package/dist/ConditionConfig-DSsgGEXS.js.map +0 -1
  186. package/dist/EventsSkeleton-8iiETGcf.js +0 -76
  187. package/dist/EventsSkeleton-8iiETGcf.js.map +0 -1
  188. package/dist/FeatureMenu-jl7-Tk6y.js +0 -265
  189. package/dist/FeatureMenu-jl7-Tk6y.js.map +0 -1
  190. package/dist/Features-CObdzJp_.js +0 -13
  191. package/dist/Features-CObdzJp_.js.map +0 -1
  192. package/dist/FlywayQuery-Cx2sly6g.js +0 -169
  193. package/dist/FlywayQuery-Cx2sly6g.js.map +0 -1
  194. package/dist/ImmunizationConfigurationBase-DZGqwda2.js +0 -5910
  195. package/dist/ImmunizationConfigurationBase-DZGqwda2.js.map +0 -1
  196. package/dist/ImmunizationConfigurationsList-DdSZicTP.js +0 -344
  197. package/dist/ImmunizationConfigurationsList-DdSZicTP.js.map +0 -1
  198. package/dist/LanguagesModal-D6VfaGrl.js +0 -394
  199. package/dist/LanguagesModal-D6VfaGrl.js.map +0 -1
  200. package/dist/ManageDynamicFeature-BhONvfC_.js +0 -4189
  201. package/dist/ManageDynamicFeature-BhONvfC_.js.map +0 -1
  202. package/dist/ManageEventConfiguration-DV3I5POA.js.map +0 -1
  203. package/dist/ManageRole-CGYfglpo.js.map +0 -1
  204. package/dist/ManageTranslation-B4C9-lWD.js +0 -625
  205. package/dist/ManageTranslation-B4C9-lWD.js.map +0 -1
  206. package/dist/ManageUser-AY1EUDLI.js.map +0 -1
  207. package/dist/MobileMenuManagement-CVAKyKDa.js +0 -112
  208. package/dist/MobileMenuManagement-CVAKyKDa.js.map +0 -1
  209. package/dist/MobileTypeEventConfigModal-BxLympIO.js.map +0 -1
  210. package/dist/NotificationFlywayQuery-BY8Zzml_.js +0 -244
  211. package/dist/NotificationFlywayQuery-BY8Zzml_.js.map +0 -1
  212. package/dist/NotificationList-C3Vb_jKU.js.map +0 -1
  213. package/dist/OtherTypeEventConfigModal-BeG1GrUi.js.map +0 -1
  214. package/dist/QueryBuilder-z7eqfd7D.js +0 -383
  215. package/dist/QueryBuilder-z7eqfd7D.js.map +0 -1
  216. package/dist/RoleManagement-BPl2cE27.js.map +0 -1
  217. package/dist/ServerSyncModal-D_oFpv3C.js.map +0 -1
  218. package/dist/ShowFlywayQuery-DVRCd384.js.map +0 -1
  219. package/dist/ShowFlywayQuery-tj42YQAS.js +0 -130
  220. package/dist/ShowFlywayQuery-tj42YQAS.js.map +0 -1
  221. package/dist/ShowQueryHistory-BDN0tzHg.js +0 -190
  222. package/dist/ShowQueryHistory-BDN0tzHg.js.map +0 -1
  223. package/dist/SubMenu-DYxAPH2Z.js +0 -191
  224. package/dist/SubMenu-DYxAPH2Z.js.map +0 -1
  225. package/dist/TableDetails-Cf_YfnY2.js.map +0 -1
  226. package/dist/Users-CsJ08Kjm.js +0 -40
  227. package/dist/Users-CsJ08Kjm.js.map +0 -1
  228. package/dist/dashboardLayoutUtils-Bt5HA96J.js +0 -265
  229. package/dist/dashboardLayoutUtils-Bt5HA96J.js.map +0 -1
@@ -0,0 +1,721 @@
1
+ import { B as Oe, z as De, V as Pe, G as he, _ as Ve, S as Ye, k as z, v as je, y as Qe, a as Ze } from "./ImmunizationConfigurationBase-Di1KO3oW.js";
2
+ import { C as _e, o as ge } from "./constants-ClZJY2x1-MkSWn6TZ.js";
3
+ import { t as He } from "./format-UOyOu75i-D0GyylyQ.js";
4
+ import { v as Xe, i as Je, r as U, C as Ke, g as Ge, _ as ei } from "./validation-BzlHnL-r-CCJm2utQ.js";
5
+ import { n as Ce } from "./useFieldErrors-hDG8ox_x-DbSAzrGo.js";
6
+ import { X as ii, Y as ti, Z as ni, Q as ri, q as ai } from "./PmGuard-b10TGXEi-G3N0G_Wg.js";
7
+ import { d as li } from "./FacilityPicker-BiZeupmP-CyPHmj6b.js";
8
+ import { useState as p } from "react";
9
+ import { jsxs as n, jsx as i, Fragment as Y } from "react/jsx-runtime";
10
+ import { Box as fe, Alert as B, TableHead as Te, TableRow as $, TableCell as r, TableBody as ye, Skeleton as oi, Button as g, Typography as w, Chip as we, Stack as v, FormControlLabel as ve, Dialog as xe, DialogTitle as be, DialogContent as Me, Divider as si, TextField as y, Checkbox as ui, DialogActions as ke, Table as di } from "@mui/material";
11
+ import { v4 as Ie } from "uuid";
12
+ import Ne from "@mui/icons-material/AddRounded";
13
+ import ci from "@mui/icons-material/RefreshRounded";
14
+ import pi from "@/views/custom-components/CustomSwitch";
15
+ import mi from "@mui/icons-material/WarehouseRounded";
16
+ import hi from "@mui/icons-material/CheckCircleRounded";
17
+ import gi from "@mui/icons-material/DeviceThermostatRounded";
18
+ import Ae from "@mui/icons-material/WarningAmberRounded";
19
+ var Ci = [{
20
+ value: "FACILITY",
21
+ label: "Facility"
22
+ }];
23
+ function qi() {
24
+ var de, ce, pe, me;
25
+ let W = ii().has("update.manage.productManagement.storageUnit"), [x, Be] = p([]), [$e, E] = p({}), [j, Q] = p(!1), [Z, b] = p(""), [We, k] = p(!1), [F, _] = p(null), [t, m] = p(X()), [H, Fe] = p(!1), l = Ce(), L = Ce();
26
+ function X() {
27
+ return {
28
+ id: "",
29
+ ownerType: "FACILITY",
30
+ ownerId: "",
31
+ unitName: "",
32
+ unitCode: "",
33
+ unitType: "REFRIGERATOR",
34
+ make: "",
35
+ model: "",
36
+ comments: "",
37
+ operatingTempMinCelsius: "",
38
+ operatingTempMaxCelsius: "",
39
+ isActive: !0
40
+ };
41
+ }
42
+ async function R() {
43
+ var e, d;
44
+ Q(!0), b("");
45
+ try {
46
+ let a = await Ve({ activeOnly: !1 });
47
+ Be(a);
48
+ let s = Array.from(new Set(a.map((T) => T.ownerId).filter(Boolean)));
49
+ if (s.length === 0) E({});
50
+ else try {
51
+ let T = await Ye(s), h = {};
52
+ T.forEach((c) => {
53
+ h[c.id] = c.name;
54
+ }), E(h);
55
+ } catch {
56
+ E({});
57
+ }
58
+ } catch (a) {
59
+ let s = ((d = (e = a == null ? void 0 : a.response) == null ? void 0 : e.data) == null ? void 0 : d.message) ?? (a == null ? void 0 : a.message) ?? "Failed to load storage units";
60
+ b(s), z({
61
+ message: s,
62
+ type: "error"
63
+ });
64
+ } finally {
65
+ Q(!1);
66
+ }
67
+ }
68
+ ti("view.manage.productManagement.storageUnit", () => {
69
+ R();
70
+ }, []);
71
+ function Re(e) {
72
+ return $e[e] ?? e;
73
+ }
74
+ function J() {
75
+ _(null), m({
76
+ ...X(),
77
+ id: Ie()
78
+ }), l.reset(), b(""), k(!0);
79
+ }
80
+ function Se(e) {
81
+ _(e), l.reset(), b(""), m({
82
+ id: e.id,
83
+ ownerType: e.ownerType ?? "FACILITY",
84
+ ownerId: e.ownerId ?? "",
85
+ unitName: e.unitName ?? "",
86
+ unitCode: e.unitCode ?? "",
87
+ unitType: e.unitType ?? "REFRIGERATOR",
88
+ make: e.make ?? "",
89
+ model: e.model ?? "",
90
+ comments: e.comments ?? "",
91
+ operatingTempMinCelsius: e.operatingTempMinCelsius ?? "",
92
+ operatingTempMaxCelsius: e.operatingTempMaxCelsius ?? "",
93
+ isActive: e.isActive !== !1
94
+ }), k(!0);
95
+ }
96
+ let K = Xe(t.operatingTempMinCelsius, t.operatingTempMaxCelsius), G = Je(t.unitCode, { required: !0 }), ee = (t.unitCode || "").trim().toUpperCase(), qe = !G && ee && t.ownerId && x.some((e) => e.id !== t.id && e.ownerId === t.ownerId && (e.unitCode || "").toUpperCase() === ee), o = {
97
+ ownerType: U(t.ownerType, "Owner type"),
98
+ ownerId: U(t.ownerId, "Facility"),
99
+ unitName: U(t.unitName, "Name"),
100
+ unitCode: G || (qe ? "Code is already in use for this facility." : ""),
101
+ unitType: U(t.unitType, "Type"),
102
+ operatingTempMinCelsius: K.min,
103
+ operatingTempMaxCelsius: K.max
104
+ }, ie = Ke(o);
105
+ async function ze() {
106
+ var e, d, a, s, T;
107
+ if (!ie) {
108
+ l.markAllTouched(), b("Please fix the highlighted fields.");
109
+ return;
110
+ }
111
+ try {
112
+ await je({
113
+ id: t.id,
114
+ ownerId: t.ownerId,
115
+ unitName: t.unitName.trim(),
116
+ unitCode: t.unitCode.trim().toUpperCase(),
117
+ unitType: t.unitType,
118
+ make: ((e = t.make) == null ? void 0 : e.trim()) || null,
119
+ model: ((d = t.model) == null ? void 0 : d.trim()) || null,
120
+ comments: ((a = t.comments) == null ? void 0 : a.trim()) || null,
121
+ operatingTempMinCelsius: t.operatingTempMinCelsius === "" ? null : Number(t.operatingTempMinCelsius),
122
+ operatingTempMaxCelsius: t.operatingTempMaxCelsius === "" ? null : Number(t.operatingTempMaxCelsius),
123
+ isActive: t.isActive
124
+ }), z({
125
+ message: "Storage unit saved.",
126
+ type: "success"
127
+ }), k(!1), await R();
128
+ } catch (h) {
129
+ let c = ((T = (s = h == null ? void 0 : h.response) == null ? void 0 : s.data) == null ? void 0 : T.message) ?? (h == null ? void 0 : h.message) ?? "Failed to save storage unit";
130
+ b(c), z({
131
+ message: c,
132
+ type: "error"
133
+ });
134
+ }
135
+ }
136
+ let [u, O] = p({
137
+ open: !1,
138
+ unit: null
139
+ }), [M, D] = p({
140
+ temperatureCelsius: "",
141
+ notes: ""
142
+ }), [te, P] = p("input"), [C, ne] = p(null), [f, S] = p(!1), [re, I] = p("");
143
+ function Ue(e) {
144
+ O({
145
+ open: !0,
146
+ unit: e
147
+ }), D({
148
+ temperatureCelsius: "",
149
+ notes: ""
150
+ }), P("input"), ne(null), I(""), L.reset();
151
+ }
152
+ function ae() {
153
+ f || O({
154
+ open: !1,
155
+ unit: null
156
+ });
157
+ }
158
+ let N = M.temperatureCelsius, V = Ge(N, { required: !0 }), le = ei(N, (de = u.unit) == null ? void 0 : de.operatingTempMinCelsius, (ce = u.unit) == null ? void 0 : ce.operatingTempMaxCelsius), oe = !V, se = !!V && (N !== "" || L.show("temperatureCelsius")), Ee = ((pe = u.unit) == null ? void 0 : pe.operatingTempMinCelsius) != null && ((me = u.unit) == null ? void 0 : me.operatingTempMaxCelsius) != null ? ` This unit operates between ${u.unit.operatingTempMinCelsius}°C and ${u.unit.operatingTempMaxCelsius}°C.` : "";
159
+ async function Le() {
160
+ var e, d;
161
+ if (!(!u.unit || !oe)) {
162
+ S(!0), I("");
163
+ try {
164
+ ne(await Qe(u.unit.id, Number(N))), P("result");
165
+ } catch (a) {
166
+ I(((d = (e = a == null ? void 0 : a.response) == null ? void 0 : e.data) == null ? void 0 : d.message) ?? (a == null ? void 0 : a.message) ?? "Failed to evaluate temperature");
167
+ } finally {
168
+ S(!1);
169
+ }
170
+ }
171
+ }
172
+ async function ue(e) {
173
+ var d, a, s, T, h;
174
+ if (u.unit) {
175
+ S(!0), I("");
176
+ try {
177
+ let c = ((s = (a = await Ze(u.unit.id, {
178
+ id: Ie(),
179
+ temperatureCelsius: Number(N),
180
+ wasteOutOfRange: e,
181
+ notes: ((d = M.notes) == null ? void 0 : d.trim()) || null
182
+ })) == null ? void 0 : a.affectedBatches) == null ? void 0 : s.length) ?? 0;
183
+ z({
184
+ message: e && c > 0 ? `Reading logged. ${c} ${c === 1 ? "batch" : "batches"} marked as wastage.` : "Temperature reading logged.",
185
+ type: "success"
186
+ }), O({
187
+ open: !1,
188
+ unit: null
189
+ }), await R();
190
+ } catch (c) {
191
+ I(((h = (T = c == null ? void 0 : c.response) == null ? void 0 : T.data) == null ? void 0 : h.message) ?? (c == null ? void 0 : c.message) ?? "Failed to log temperature");
192
+ } finally {
193
+ S(!1);
194
+ }
195
+ }
196
+ }
197
+ let A = (C == null ? void 0 : C.affectedBatches) ?? [], q = H ? x : x.filter((e) => e.isActive !== !1);
198
+ return /* @__PURE__ */ n(fe, { children: [/* @__PURE__ */ i(ni, {}), /* @__PURE__ */ n(ri, {
199
+ perm: "view.manage.productManagement.storageUnit",
200
+ children: [
201
+ /* @__PURE__ */ n(ai, {
202
+ title: "Storage Units",
203
+ subtitle: "Cold-chain equipment for storing vaccine and product batches. Currently managed per facility.",
204
+ chips: ["Catalog", "Facility-owned"],
205
+ actions: /* @__PURE__ */ n(v, {
206
+ direction: "row",
207
+ spacing: 1,
208
+ children: [/* @__PURE__ */ i(g, {
209
+ variant: "outlined",
210
+ startIcon: /* @__PURE__ */ i(ci, {}),
211
+ onClick: () => void R(),
212
+ children: "Refresh"
213
+ }), W ? /* @__PURE__ */ i(g, {
214
+ variant: "contained",
215
+ startIcon: /* @__PURE__ */ i(Ne, {}),
216
+ onClick: J,
217
+ children: "New Storage Unit"
218
+ }) : null]
219
+ }),
220
+ children: [Z ? /* @__PURE__ */ i(B, {
221
+ severity: "error",
222
+ sx: { mb: 2 },
223
+ children: Z
224
+ }) : null, /* @__PURE__ */ i(Oe, {
225
+ eyebrow: "Cold-chain network",
226
+ title: "Storage units",
227
+ subtitle: j ? "Loading…" : `${q.length} ${q.length === 1 ? "unit" : "units"}`,
228
+ actions: /* @__PURE__ */ i(ve, {
229
+ control: /* @__PURE__ */ i(pi, {
230
+ checked: H,
231
+ onChange: (e) => Fe(e.target.checked)
232
+ }),
233
+ label: /* @__PURE__ */ i(w, {
234
+ variant: "body2",
235
+ sx: { fontWeight: 600 },
236
+ children: "Show inactive"
237
+ }),
238
+ labelPlacement: "start",
239
+ sx: {
240
+ mr: 0.5,
241
+ ml: 0
242
+ }
243
+ }),
244
+ children: /* @__PURE__ */ n(De, { children: [/* @__PURE__ */ i(Te, { children: /* @__PURE__ */ n($, { children: [
245
+ /* @__PURE__ */ i(r, { children: "Code" }),
246
+ /* @__PURE__ */ i(r, { children: "Name" }),
247
+ /* @__PURE__ */ i(r, { children: "Facility" }),
248
+ /* @__PURE__ */ i(r, { children: "Type" }),
249
+ /* @__PURE__ */ i(r, { children: "Operating range" }),
250
+ /* @__PURE__ */ i(r, { children: "Status" }),
251
+ /* @__PURE__ */ i(r, {
252
+ align: "right",
253
+ children: "Action"
254
+ })
255
+ ] }) }), /* @__PURE__ */ i(ye, { children: j ? Array.from({ length: 4 }).map((e, d) => /* @__PURE__ */ i($, { children: Array.from({ length: 7 }).map((a, s) => /* @__PURE__ */ i(r, { children: /* @__PURE__ */ i(oi, { height: 22 }) }, s)) }, d)) : q.length === 0 ? /* @__PURE__ */ i(Pe, {
256
+ colSpan: 7,
257
+ icon: mi,
258
+ title: x.length === 0 ? "No storage units yet" : "No active storage units",
259
+ hint: x.length === 0 ? "You need storage equipment to keep vaccine batches safe." : "Turn on “Show inactive” to see deactivated storage units.",
260
+ action: x.length === 0 && W ? /* @__PURE__ */ i(g, {
261
+ variant: "contained",
262
+ size: "small",
263
+ startIcon: /* @__PURE__ */ i(Ne, {}),
264
+ onClick: J,
265
+ children: "Create first unit"
266
+ }) : null
267
+ }) : q.map((e) => /* @__PURE__ */ n($, {
268
+ hover: !0,
269
+ children: [
270
+ /* @__PURE__ */ i(r, { children: /* @__PURE__ */ i(fe, {
271
+ component: "span",
272
+ sx: {
273
+ display: "inline-flex",
274
+ px: 0.85,
275
+ py: 0.25,
276
+ borderRadius: 1,
277
+ bgcolor: "grey.100",
278
+ fontFamily: "monospace",
279
+ fontSize: "0.72rem",
280
+ fontWeight: 800
281
+ },
282
+ children: e.unitCode
283
+ }) }),
284
+ /* @__PURE__ */ i(r, { children: /* @__PURE__ */ i(w, {
285
+ variant: "body2",
286
+ sx: { fontWeight: 700 },
287
+ children: e.unitName
288
+ }) }),
289
+ /* @__PURE__ */ i(r, { children: /* @__PURE__ */ i(w, {
290
+ variant: "caption",
291
+ color: "text.secondary",
292
+ children: Re(e.ownerId)
293
+ }) }),
294
+ /* @__PURE__ */ i(r, { children: /* @__PURE__ */ i(we, {
295
+ size: "small",
296
+ label: _e(ge, e.unitType),
297
+ variant: "outlined",
298
+ sx: {
299
+ fontWeight: 700,
300
+ borderRadius: 1.5,
301
+ height: 22
302
+ }
303
+ }) }),
304
+ /* @__PURE__ */ i(r, { children: e.operatingTempMinCelsius != null && e.operatingTempMaxCelsius != null ? /* @__PURE__ */ n(w, {
305
+ variant: "caption",
306
+ sx: {
307
+ fontWeight: 700,
308
+ fontVariantNumeric: "tabular-nums"
309
+ },
310
+ children: [
311
+ e.operatingTempMinCelsius,
312
+ "°C → ",
313
+ e.operatingTempMaxCelsius,
314
+ "°C"
315
+ ]
316
+ }) : /* @__PURE__ */ i(w, {
317
+ variant: "caption",
318
+ color: "text.disabled",
319
+ children: "—"
320
+ }) }),
321
+ /* @__PURE__ */ i(r, { children: /* @__PURE__ */ i(we, {
322
+ size: "small",
323
+ label: e.isActive ? "Active" : "Inactive",
324
+ color: e.isActive ? "success" : "default",
325
+ variant: e.isActive ? "filled" : "outlined",
326
+ sx: {
327
+ fontWeight: 700,
328
+ borderRadius: 1.5,
329
+ height: 22
330
+ }
331
+ }) }),
332
+ /* @__PURE__ */ i(r, {
333
+ align: "right",
334
+ children: /* @__PURE__ */ n(v, {
335
+ direction: "row",
336
+ spacing: 1,
337
+ justifyContent: "flex-end",
338
+ children: [W ? /* @__PURE__ */ i(g, {
339
+ size: "small",
340
+ variant: "outlined",
341
+ color: "info",
342
+ startIcon: /* @__PURE__ */ i(gi, {}),
343
+ onClick: () => Ue(e),
344
+ children: "Log temp"
345
+ }) : null, W ? /* @__PURE__ */ i(g, {
346
+ size: "small",
347
+ variant: "outlined",
348
+ onClick: () => Se(e),
349
+ children: "Edit"
350
+ }) : null]
351
+ })
352
+ })
353
+ ]
354
+ }, e.id)) })] })
355
+ })]
356
+ }),
357
+ /* @__PURE__ */ n(xe, {
358
+ open: We,
359
+ onClose: () => k(!1),
360
+ fullWidth: !0,
361
+ maxWidth: "sm",
362
+ children: [
363
+ /* @__PURE__ */ i(be, { children: F ? "Edit Storage Unit" : "New Storage Unit" }),
364
+ /* @__PURE__ */ i(Me, {
365
+ dividers: !0,
366
+ children: /* @__PURE__ */ n(v, {
367
+ spacing: 2,
368
+ sx: { pt: 1 },
369
+ children: [
370
+ /* @__PURE__ */ i(he, {
371
+ label: "Owner Type",
372
+ required: !0,
373
+ disabled: !!F,
374
+ value: t.ownerType,
375
+ onChange: (e) => m({
376
+ ...t,
377
+ ownerType: e,
378
+ ownerId: ""
379
+ }),
380
+ onBlur: l.onBlur("ownerType"),
381
+ error: l.show("ownerType") && !!o.ownerType,
382
+ helperText: l.show("ownerType") && o.ownerType ? o.ownerType : "Only Facility is available currently.",
383
+ options: Ci
384
+ }),
385
+ /* @__PURE__ */ i(li, {
386
+ required: !0,
387
+ disabled: !!F || t.ownerType !== "FACILITY",
388
+ value: t.ownerId,
389
+ onChange: (e) => m({
390
+ ...t,
391
+ ownerId: e
392
+ }),
393
+ onBlur: l.onBlur("ownerId"),
394
+ error: l.show("ownerId") && !!o.ownerId,
395
+ helperText: l.show("ownerId") && o.ownerId ? o.ownerId : "Search by name. The owner cannot be changed once created."
396
+ }),
397
+ /* @__PURE__ */ i(si, {}),
398
+ /* @__PURE__ */ i(y, {
399
+ required: !0,
400
+ label: "Unit name",
401
+ size: "small",
402
+ fullWidth: !0,
403
+ value: t.unitName,
404
+ onChange: (e) => {
405
+ let d = e.target.value, a = d.split(/\s+/).filter(Boolean).map((s) => s[0]).join("").toUpperCase().replace(/[^A-Z0-9_]/g, "");
406
+ m((s) => ({
407
+ ...s,
408
+ unitName: d,
409
+ unitCode: F ? s.unitCode : a
410
+ }));
411
+ },
412
+ onBlur: l.onBlur("unitName"),
413
+ error: l.show("unitName") && !!o.unitName,
414
+ helperText: l.show("unitName") ? o.unitName : ""
415
+ }),
416
+ /* @__PURE__ */ i(y, {
417
+ required: !0,
418
+ label: "Unit code (unique within facility)",
419
+ size: "small",
420
+ fullWidth: !0,
421
+ value: t.unitCode,
422
+ onChange: (e) => m({
423
+ ...t,
424
+ unitCode: e.target.value.toUpperCase()
425
+ }),
426
+ onBlur: l.onBlur("unitCode"),
427
+ error: l.show("unitCode") && !!o.unitCode,
428
+ helperText: l.show("unitCode") && o.unitCode ? o.unitCode : "Auto-generated from the name. Edit if needed to make it unique within this facility."
429
+ }),
430
+ /* @__PURE__ */ i(he, {
431
+ label: "Type",
432
+ required: !0,
433
+ value: t.unitType,
434
+ onChange: (e) => m({
435
+ ...t,
436
+ unitType: e
437
+ }),
438
+ onBlur: l.onBlur("unitType"),
439
+ error: l.show("unitType") && !!o.unitType,
440
+ options: ge
441
+ }),
442
+ /* @__PURE__ */ n(v, {
443
+ direction: "row",
444
+ spacing: 2,
445
+ children: [/* @__PURE__ */ i(y, {
446
+ label: "Make",
447
+ size: "small",
448
+ fullWidth: !0,
449
+ value: t.make,
450
+ onChange: (e) => m({
451
+ ...t,
452
+ make: e.target.value
453
+ }),
454
+ helperText: "Example: Godrej, Vestfrost"
455
+ }), /* @__PURE__ */ i(y, {
456
+ label: "Model",
457
+ size: "small",
458
+ fullWidth: !0,
459
+ value: t.model,
460
+ onChange: (e) => m({
461
+ ...t,
462
+ model: e.target.value
463
+ }),
464
+ helperText: "Example: GVR-100"
465
+ })]
466
+ }),
467
+ /* @__PURE__ */ n(v, {
468
+ direction: "row",
469
+ spacing: 2,
470
+ children: [/* @__PURE__ */ i(y, {
471
+ label: "Min °C",
472
+ size: "small",
473
+ type: "number",
474
+ fullWidth: !0,
475
+ inputProps: {
476
+ step: "0.1",
477
+ min: -90,
478
+ max: 30
479
+ },
480
+ value: t.operatingTempMinCelsius,
481
+ onChange: (e) => m({
482
+ ...t,
483
+ operatingTempMinCelsius: e.target.value
484
+ }),
485
+ onBlur: l.onBlur("operatingTempMinCelsius"),
486
+ error: l.show("operatingTempMinCelsius") && !!o.operatingTempMinCelsius,
487
+ helperText: l.show("operatingTempMinCelsius") && o.operatingTempMinCelsius ? o.operatingTempMinCelsius : "Allowed range: −90°C to +30°C"
488
+ }), /* @__PURE__ */ i(y, {
489
+ label: "Max °C",
490
+ size: "small",
491
+ type: "number",
492
+ fullWidth: !0,
493
+ inputProps: {
494
+ step: "0.1",
495
+ min: -90,
496
+ max: 30
497
+ },
498
+ value: t.operatingTempMaxCelsius,
499
+ onChange: (e) => m({
500
+ ...t,
501
+ operatingTempMaxCelsius: e.target.value
502
+ }),
503
+ onBlur: l.onBlur("operatingTempMaxCelsius"),
504
+ error: l.show("operatingTempMaxCelsius") && !!o.operatingTempMaxCelsius,
505
+ helperText: l.show("operatingTempMaxCelsius") && o.operatingTempMaxCelsius ? o.operatingTempMaxCelsius : "Allowed range: −90°C to +30°C"
506
+ })]
507
+ }),
508
+ /* @__PURE__ */ i(y, {
509
+ label: "Comments",
510
+ size: "small",
511
+ multiline: !0,
512
+ minRows: 2,
513
+ fullWidth: !0,
514
+ value: t.comments,
515
+ onChange: (e) => m({
516
+ ...t,
517
+ comments: e.target.value
518
+ }),
519
+ helperText: "Notes about placement, maintenance schedule, or other details."
520
+ }),
521
+ /* @__PURE__ */ i(ve, {
522
+ control: /* @__PURE__ */ i(ui, {
523
+ checked: t.isActive,
524
+ onChange: (e) => m({
525
+ ...t,
526
+ isActive: e.target.checked
527
+ })
528
+ }),
529
+ label: "Active"
530
+ })
531
+ ]
532
+ })
533
+ }),
534
+ /* @__PURE__ */ n(ke, { children: [/* @__PURE__ */ i(g, {
535
+ onClick: () => k(!1),
536
+ children: "Cancel"
537
+ }), /* @__PURE__ */ i(g, {
538
+ variant: "contained",
539
+ disabled: !ie,
540
+ onClick: () => void ze(),
541
+ children: "Save"
542
+ })] })
543
+ ]
544
+ }),
545
+ /* @__PURE__ */ n(xe, {
546
+ open: u.open,
547
+ onClose: ae,
548
+ fullWidth: !0,
549
+ maxWidth: "sm",
550
+ children: [
551
+ /* @__PURE__ */ n(be, { children: ["Log Temperature", u.unit ? /* @__PURE__ */ n(w, {
552
+ variant: "caption",
553
+ color: "text.secondary",
554
+ sx: {
555
+ display: "block",
556
+ fontWeight: 600
557
+ },
558
+ children: [u.unit.unitName, u.unit.operatingTempMinCelsius != null && u.unit.operatingTempMaxCelsius != null ? ` · operates ${u.unit.operatingTempMinCelsius}°C → ${u.unit.operatingTempMaxCelsius}°C` : ""]
559
+ }) : null] }),
560
+ /* @__PURE__ */ n(Me, {
561
+ dividers: !0,
562
+ children: [re ? /* @__PURE__ */ i(B, {
563
+ severity: "error",
564
+ sx: { mb: 2 },
565
+ children: re
566
+ }) : null, te === "input" ? /* @__PURE__ */ n(v, {
567
+ spacing: 2,
568
+ sx: { pt: 1 },
569
+ children: [
570
+ /* @__PURE__ */ i(w, {
571
+ variant: "body2",
572
+ color: "text.secondary",
573
+ children: "Record the current temperature reading for this storage unit. We will check whether any stored product batch falls outside its required range."
574
+ }),
575
+ /* @__PURE__ */ i(y, {
576
+ required: !0,
577
+ autoFocus: !0,
578
+ label: "Temperature (°C)",
579
+ size: "small",
580
+ type: "number",
581
+ fullWidth: !0,
582
+ inputProps: {
583
+ step: "0.1",
584
+ min: -90,
585
+ max: 30
586
+ },
587
+ value: M.temperatureCelsius,
588
+ onChange: (e) => D({
589
+ ...M,
590
+ temperatureCelsius: e.target.value
591
+ }),
592
+ onBlur: L.onBlur("temperatureCelsius"),
593
+ error: se,
594
+ helperText: se ? V : `Enter the reading in degrees Celsius.${Ee}`
595
+ }),
596
+ le ? /* @__PURE__ */ i(B, {
597
+ severity: "warning",
598
+ icon: /* @__PURE__ */ i(Ae, {}),
599
+ children: le
600
+ }) : null,
601
+ /* @__PURE__ */ i(y, {
602
+ label: "Notes (optional)",
603
+ size: "small",
604
+ multiline: !0,
605
+ minRows: 2,
606
+ fullWidth: !0,
607
+ value: M.notes,
608
+ onChange: (e) => D({
609
+ ...M,
610
+ notes: e.target.value
611
+ }),
612
+ helperText: "Anything worth recording about this reading."
613
+ })
614
+ ]
615
+ }) : /* @__PURE__ */ n(v, {
616
+ spacing: 2,
617
+ sx: { pt: 1 },
618
+ children: [/* @__PURE__ */ n(w, {
619
+ variant: "body2",
620
+ sx: { fontWeight: 700 },
621
+ children: [
622
+ "Reading: ",
623
+ C == null ? void 0 : C.temperatureCelsius,
624
+ "°C"
625
+ ]
626
+ }), A.length === 0 ? /* @__PURE__ */ i(B, {
627
+ severity: "success",
628
+ icon: /* @__PURE__ */ i(hi, {}),
629
+ children: "Every stored product tolerates this temperature. Nothing will be wasted — you can still log the reading for the record."
630
+ }) : /* @__PURE__ */ n(Y, { children: [/* @__PURE__ */ n(B, {
631
+ severity: "warning",
632
+ icon: /* @__PURE__ */ i(Ae, {}),
633
+ children: [
634
+ "At ",
635
+ C == null ? void 0 : C.temperatureCelsius,
636
+ "°C the following ",
637
+ A.length === 1 ? "batch is" : "batches are",
638
+ " out of range. Confirming will mark ",
639
+ A.length === 1 ? "it" : "them",
640
+ " — and any open vials — as wastage. This cannot be undone."
641
+ ]
642
+ }), /* @__PURE__ */ n(di, {
643
+ size: "small",
644
+ children: [/* @__PURE__ */ i(Te, { children: /* @__PURE__ */ n($, { children: [
645
+ /* @__PURE__ */ i(r, { children: "Product" }),
646
+ /* @__PURE__ */ i(r, { children: "Lot" }),
647
+ /* @__PURE__ */ i(r, { children: "Expiry" }),
648
+ /* @__PURE__ */ i(r, {
649
+ align: "right",
650
+ children: "Qty"
651
+ }),
652
+ /* @__PURE__ */ i(r, {
653
+ align: "right",
654
+ children: "Open vials"
655
+ }),
656
+ /* @__PURE__ */ i(r, { children: "Required" })
657
+ ] }) }), /* @__PURE__ */ i(ye, { children: A.map((e) => /* @__PURE__ */ n($, { children: [
658
+ /* @__PURE__ */ i(r, {
659
+ sx: { fontWeight: 700 },
660
+ children: e.productName
661
+ }),
662
+ /* @__PURE__ */ i(r, {
663
+ sx: {
664
+ fontFamily: "monospace",
665
+ fontSize: "0.78rem"
666
+ },
667
+ children: e.lotNumber || "—"
668
+ }),
669
+ /* @__PURE__ */ i(r, { children: e.expiryDate ? He(e.expiryDate) : "—" }),
670
+ /* @__PURE__ */ i(r, {
671
+ align: "right",
672
+ sx: { fontVariantNumeric: "tabular-nums" },
673
+ children: e.qtyRemaining ?? 0
674
+ }),
675
+ /* @__PURE__ */ i(r, {
676
+ align: "right",
677
+ sx: { fontVariantNumeric: "tabular-nums" },
678
+ children: e.openVialCount ?? 0
679
+ }),
680
+ /* @__PURE__ */ i(r, {
681
+ sx: { whiteSpace: "nowrap" },
682
+ children: e.requiredMinCelsius != null && e.requiredMaxCelsius != null ? `${e.requiredMinCelsius}°C → ${e.requiredMaxCelsius}°C` : "—"
683
+ })
684
+ ] }, e.batchId)) })]
685
+ })] })]
686
+ })]
687
+ }),
688
+ /* @__PURE__ */ i(ke, { children: te === "input" ? /* @__PURE__ */ n(Y, { children: [/* @__PURE__ */ i(g, {
689
+ onClick: ae,
690
+ disabled: f,
691
+ children: "Cancel"
692
+ }), /* @__PURE__ */ i(g, {
693
+ variant: "contained",
694
+ disabled: !oe || f,
695
+ onClick: () => void Le(),
696
+ children: f ? "Checking…" : "Check"
697
+ })] }) : /* @__PURE__ */ n(Y, { children: [/* @__PURE__ */ i(g, {
698
+ onClick: () => P("input"),
699
+ disabled: f,
700
+ children: "Back"
701
+ }), A.length === 0 ? /* @__PURE__ */ i(g, {
702
+ variant: "contained",
703
+ disabled: f,
704
+ onClick: () => void ue(!1),
705
+ children: f ? "Logging…" : "Log reading"
706
+ }) : /* @__PURE__ */ i(g, {
707
+ variant: "contained",
708
+ color: "error",
709
+ disabled: f,
710
+ onClick: () => void ue(!0),
711
+ children: f ? "Processing…" : "Confirm & mark wastage"
712
+ })] }) })
713
+ ]
714
+ })
715
+ ]
716
+ })] });
717
+ }
718
+ export {
719
+ qi as default
720
+ };
721
+ //# sourceMappingURL=StorageUnitsPage-7EqwuMOI-BwUso1Th.js.map