@argusoft/medplat-core 1.0.29 → 1.0.31

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 (217) hide show
  1. package/dist/AccessRights-DUgY6ewy.js +1031 -0
  2. package/dist/AccessRights-DUgY6ewy.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-v3TmGQee.js → AddFeatures-D1sU8RjY.js} +2 -2
  6. package/dist/{AddFeatures-v3TmGQee.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-c6ZKiN0i.js +8898 -0
  10. package/dist/AddMenuConfiguration-c6ZKiN0i.js.map +1 -0
  11. package/dist/AppModal-CCtrQ5Tr.js +394 -0
  12. package/dist/AppModal-CCtrQ5Tr.js.map +1 -0
  13. package/dist/BrandsPage-DMw2vT0u-BVhvhc6J.js +387 -0
  14. package/dist/BrandsPage-DMw2vT0u-BVhvhc6J.js.map +1 -0
  15. package/dist/CategoriesPage-D3ihx9Gi-CT58g0ry.js +398 -0
  16. package/dist/CategoriesPage-D3ihx9Gi-CT58g0ry.js.map +1 -0
  17. package/dist/{ChangePasswordModalCore-DutQAZOx.js → ChangePasswordModalCore-lQ9GamH1.js} +1605 -1610
  18. package/dist/ChangePasswordModalCore-lQ9GamH1.js.map +1 -0
  19. package/dist/ConditionConfig-BQBmBHaM.js +408 -0
  20. package/dist/ConditionConfig-BQBmBHaM.js.map +1 -0
  21. package/dist/DashboardPage-asr2XDRu-uOOlX9Vq.js +435 -0
  22. package/dist/DashboardPage-asr2XDRu-uOOlX9Vq.js.map +1 -0
  23. package/dist/EventConfig-BY2cgGyx.js +27 -0
  24. package/dist/EventConfig-BY2cgGyx.js.map +1 -0
  25. package/dist/EventConfigurations-CUPEN5BV.js +544 -0
  26. package/dist/EventConfigurations-CUPEN5BV.js.map +1 -0
  27. package/dist/EventConfigurations.css +1 -1
  28. package/dist/EventsExceptionModal-BX-ArkBE.js +188 -0
  29. package/dist/EventsExceptionModal-BX-ArkBE.js.map +1 -0
  30. package/dist/EventsUi-D6O9S7BK.js +258 -0
  31. package/dist/EventsUi-D6O9S7BK.js.map +1 -0
  32. package/dist/FacilityPicker-DYl_PDyt-Cbwo2tAY.js +79 -0
  33. package/dist/FacilityPicker-DYl_PDyt-Cbwo2tAY.js.map +1 -0
  34. package/dist/FeatureMenu-CHsBbw3W.js +525 -0
  35. package/dist/FeatureMenu-CHsBbw3W.js.map +1 -0
  36. package/dist/{FhirServerList-Dkq7Kbes.js → FhirServerList-iXBPkRVF.js} +22 -22
  37. package/dist/{FhirServerList-Dkq7Kbes.js.map → FhirServerList-iXBPkRVF.js.map} +1 -1
  38. package/dist/{FhirServerWizard-Db6Hm4bQ.js → FhirServerWizard-DZI8Olku.js} +15 -15
  39. package/dist/{FhirServerWizard-Db6Hm4bQ.js.map → FhirServerWizard-DZI8Olku.js.map} +1 -1
  40. package/dist/FlywayQuery-CQygj51V.js +179 -0
  41. package/dist/FlywayQuery-CQygj51V.js.map +1 -0
  42. package/dist/GrantPermissionModal-D7iNZd0M.js +239 -0
  43. package/dist/GrantPermissionModal-D7iNZd0M.js.map +1 -0
  44. package/dist/ImmunizationConfigurationBase-aUtx0JEe.js +8019 -0
  45. package/dist/ImmunizationConfigurationBase-aUtx0JEe.js.map +1 -0
  46. package/dist/ImmunizationConfigurationBase.css +1 -1
  47. package/dist/ImmunizationConfigurationsList-TZcLDEci.js +369 -0
  48. package/dist/ImmunizationConfigurationsList-TZcLDEci.js.map +1 -0
  49. package/dist/InventoryPage-DOotGZrj-CoPjOJEI.js +665 -0
  50. package/dist/InventoryPage-DOotGZrj-CoPjOJEI.js.map +1 -0
  51. package/dist/LanguagesModal-B3NTebYT.js +352 -0
  52. package/dist/LanguagesModal-B3NTebYT.js.map +1 -0
  53. package/dist/ManageDynamicFeature-BU0I45dd.js +4475 -0
  54. package/dist/ManageDynamicFeature-BU0I45dd.js.map +1 -0
  55. package/dist/ManageEventConfiguration-DqW3krT6.js +1216 -0
  56. package/dist/ManageEventConfiguration-DqW3krT6.js.map +1 -0
  57. package/dist/ManageEventConfiguration.css +1 -1
  58. package/dist/{ManageNotification-CfhHlfxA.js → ManageNotification-C5MhV77Q.js} +2 -2
  59. package/dist/{ManageNotification-CfhHlfxA.js.map → ManageNotification-C5MhV77Q.js.map} +1 -1
  60. package/dist/{ManageRole-4Y2PP4dQ.js → ManageRole-CNZBRKGU.js} +2 -2
  61. package/dist/{ManageRole-4Y2PP4dQ.js.map → ManageRole-CNZBRKGU.js.map} +1 -1
  62. package/dist/ManageTranslation-vRiptUAP.js +833 -0
  63. package/dist/ManageTranslation-vRiptUAP.js.map +1 -0
  64. package/dist/ManageTranslation.css +1 -1
  65. package/dist/{ManageUser-DDzyd9jm.js → ManageUser-DZltBina.js} +224 -224
  66. package/dist/{ManageUser-DDzyd9jm.js.map → ManageUser-DZltBina.js.map} +1 -1
  67. package/dist/MemberProfileCard-D5CgkTdJ-D2NgDJl3.js +272 -0
  68. package/dist/MemberProfileCard-D5CgkTdJ-D2NgDJl3.js.map +1 -0
  69. package/dist/MobileAnalytics-BLOionG_.js +17301 -0
  70. package/dist/MobileAnalytics-BLOionG_.js.map +1 -0
  71. package/dist/MobileMenuManagement-68Wijb0X.js +220 -0
  72. package/dist/MobileMenuManagement-68Wijb0X.js.map +1 -0
  73. package/dist/MobileTypeEventConfigModal-CMcj7Ozp.js +752 -0
  74. package/dist/MobileTypeEventConfigModal-CMcj7Ozp.js.map +1 -0
  75. package/dist/NotificationFlywayQuery-BAHVjf6N.js +247 -0
  76. package/dist/NotificationFlywayQuery-BAHVjf6N.js.map +1 -0
  77. package/dist/{NotificationList-BMFpNUJG.js → NotificationList-DEyRZEuM.js} +2 -2
  78. package/dist/{NotificationList-BMFpNUJG.js.map → NotificationList-DEyRZEuM.js.map} +1 -1
  79. package/dist/OtherTypeEventConfigModal-stNmuSv_.js +1812 -0
  80. package/dist/OtherTypeEventConfigModal-stNmuSv_.js.map +1 -0
  81. package/dist/PaymentCreatePage-DfvSZ-kB-CckogYoe.js +482 -0
  82. package/dist/PaymentCreatePage-DfvSZ-kB-CckogYoe.js.map +1 -0
  83. package/dist/PaymentsPage-DMNjYWAJ-ChO9IXmk.js +157 -0
  84. package/dist/PaymentsPage-DMNjYWAJ-ChO9IXmk.js.map +1 -0
  85. package/dist/PermissionsModal-CCYkcKlC.js +151 -0
  86. package/dist/PermissionsModal-CCYkcKlC.js.map +1 -0
  87. package/dist/PickupBatchLinesEditor-CE2RuyJT-BPceiJr8.js +119 -0
  88. package/dist/PickupBatchLinesEditor-CE2RuyJT-BPceiJr8.js.map +1 -0
  89. package/dist/PickupCreatePage-B4O_-vE5-DoOo9nJO.js +783 -0
  90. package/dist/PickupCreatePage-B4O_-vE5-DoOo9nJO.js.map +1 -0
  91. package/dist/PickupsPage-D7zyioJB-bHKnARYw.js +818 -0
  92. package/dist/PickupsPage-D7zyioJB-bHKnARYw.js.map +1 -0
  93. package/dist/PmGuard-BZE-y4In-D_pUm5MP.js +599 -0
  94. package/dist/PmGuard-BZE-y4In-D_pUm5MP.js.map +1 -0
  95. package/dist/ProductEditPage-BVlVUCtD-BR-tJ5Wb.js +1305 -0
  96. package/dist/ProductEditPage-BVlVUCtD-BR-tJ5Wb.js.map +1 -0
  97. package/dist/ProductsPage-DvNHIeZt-BoOOJJtk.js +253 -0
  98. package/dist/ProductsPage-DvNHIeZt-BoOOJJtk.js.map +1 -0
  99. package/dist/PurchaseCreatePage-Cq_i9snz-DRtHHFWw.js +675 -0
  100. package/dist/PurchaseCreatePage-Cq_i9snz-DRtHHFWw.js.map +1 -0
  101. package/dist/PurchaseRequestDetailPage-CA9KFOfE-CtjG4Gx6.js +1577 -0
  102. package/dist/PurchaseRequestDetailPage-CA9KFOfE-CtjG4Gx6.js.map +1 -0
  103. package/dist/PurchaseRequestsPage-DS9i4o0--TpoxA5Kd.js +279 -0
  104. package/dist/PurchaseRequestsPage-DS9i4o0--TpoxA5Kd.js.map +1 -0
  105. package/dist/PurchasesPage-DgL5T6BY-DePUuE9l.js +293 -0
  106. package/dist/PurchasesPage-DgL5T6BY-DePUuE9l.js.map +1 -0
  107. package/dist/QueryBuilder-CXaBe6sr.js +478 -0
  108. package/dist/QueryBuilder-CXaBe6sr.js.map +1 -0
  109. package/dist/{RoleManagement-DEiBNfT8.js → RoleManagement-s8iNx2Mu.js} +145 -155
  110. package/dist/RoleManagement-s8iNx2Mu.js.map +1 -0
  111. package/dist/Roles-BIyiic67.js +14 -0
  112. package/dist/Roles-BIyiic67.js.map +1 -0
  113. package/dist/SaleCreatePage-CZnIOydv-DKBw-qp7.js +544 -0
  114. package/dist/SaleCreatePage-CZnIOydv-DKBw-qp7.js.map +1 -0
  115. package/dist/SalesPage-DPIRrC_O-M8rqnK7z.js +315 -0
  116. package/dist/SalesPage-DPIRrC_O-M8rqnK7z.js.map +1 -0
  117. package/dist/SettingsPage-BC_R6Z-Q-CKNt9zRu.js +676 -0
  118. package/dist/SettingsPage-BC_R6Z-Q-CKNt9zRu.js.map +1 -0
  119. package/dist/ShowFlywayQuery-D10Olk5Z.js +154 -0
  120. package/dist/ShowFlywayQuery-D10Olk5Z.js.map +1 -0
  121. package/dist/{ShowFlywayQuery-DVRCd384.js → ShowFlywayQuery-DIOUdYfG.js} +170 -123
  122. package/dist/ShowFlywayQuery-DIOUdYfG.js.map +1 -0
  123. package/dist/ShowQueryHistory-DRBKYDKk.js +313 -0
  124. package/dist/ShowQueryHistory-DRBKYDKk.js.map +1 -0
  125. package/dist/StorageUnitsPage-BDRkdCjW-UF64rf7q.js +728 -0
  126. package/dist/StorageUnitsPage-BDRkdCjW-UF64rf7q.js.map +1 -0
  127. package/dist/SubMenu-BdMTYtC1.js +319 -0
  128. package/dist/SubMenu-BdMTYtC1.js.map +1 -0
  129. package/dist/TransactionsPage-CqWTMNU8-Df6eGFDW.js +746 -0
  130. package/dist/TransactionsPage-CqWTMNU8-Df6eGFDW.js.map +1 -0
  131. package/dist/TransferCreatePage-DF7FZaTJ-CL79V3aR.js +315 -0
  132. package/dist/TransferCreatePage-DF7FZaTJ-CL79V3aR.js.map +1 -0
  133. package/dist/TransfersPage-CGrRFaBF-cTwBUv0o.js +476 -0
  134. package/dist/TransfersPage-CGrRFaBF-cTwBUv0o.js.map +1 -0
  135. package/dist/TypeConfiguration-JbRCN6GR.js +114 -0
  136. package/dist/TypeConfiguration-JbRCN6GR.js.map +1 -0
  137. package/dist/{UserList-Bc8gYxRL.js → UserList-L41Xw0Q6.js} +253 -236
  138. package/dist/{UserList-Bc8gYxRL.js.map → UserList-L41Xw0Q6.js.map} +1 -1
  139. package/dist/Users-CsJ08Kjm.js.map +1 -1
  140. package/dist/VialsPage-rvvXjgZG-Oqo1v6kQ.js +321 -0
  141. package/dist/VialsPage-rvvXjgZG-Oqo1v6kQ.js.map +1 -0
  142. package/dist/constants-DpXnLsAB-D6lN5cjK.js +445 -0
  143. package/dist/constants-DpXnLsAB-D6lN5cjK.js.map +1 -0
  144. package/dist/{dashboardLayoutUtils-D1xCAxp3.js → dashboardLayoutUtils-CJivzaU1.js} +95 -92
  145. package/dist/dashboardLayoutUtils-CJivzaU1.js.map +1 -0
  146. package/dist/format-UOyOu75i-D0GyylyQ.js +63 -0
  147. package/dist/format-UOyOu75i-D0GyylyQ.js.map +1 -0
  148. package/dist/index.css +1 -1
  149. package/dist/index.js +1 -1
  150. package/dist/index.lib-ETRQOzvE.js +894 -0
  151. package/dist/index.lib-ETRQOzvE.js.map +1 -0
  152. package/dist/listValueStore-BFQtDYIR-Bj0yX145.js +36 -0
  153. package/dist/listValueStore-BFQtDYIR-Bj0yX145.js.map +1 -0
  154. package/dist/useFieldErrors-hDG8ox_x-DbSAzrGo.js +28 -0
  155. package/dist/useFieldErrors-hDG8ox_x-DbSAzrGo.js.map +1 -0
  156. package/dist/validation-BzlHnL-r-CCJm2utQ.js +125 -0
  157. package/dist/validation-BzlHnL-r-CCJm2utQ.js.map +1 -0
  158. package/package.json +4 -3
  159. package/dist/AccessRights-Zm8Obm4N.js +0 -1284
  160. package/dist/AccessRights-Zm8Obm4N.js.map +0 -1
  161. package/dist/AddEditQueryBuilder-Brdnm6rQ.js +0 -313
  162. package/dist/AddEditQueryBuilder-Brdnm6rQ.js.map +0 -1
  163. package/dist/AddLabelModal-DFllBVcd.js +0 -734
  164. package/dist/AddLabelModal-DFllBVcd.js.map +0 -1
  165. package/dist/AddMenuConfiguration-Ce91MhnU.js +0 -8547
  166. package/dist/AddMenuConfiguration-Ce91MhnU.js.map +0 -1
  167. package/dist/AppModal-CtG2GjD_.js +0 -428
  168. package/dist/AppModal-CtG2GjD_.js.map +0 -1
  169. package/dist/ChangePasswordModalCore-DutQAZOx.js.map +0 -1
  170. package/dist/ConditionConfig-B4Ffpgj3.js +0 -395
  171. package/dist/ConditionConfig-B4Ffpgj3.js.map +0 -1
  172. package/dist/ConditionConfig.css +0 -1
  173. package/dist/EventConfigurations-BJcURufo.js +0 -449
  174. package/dist/EventConfigurations-BJcURufo.js.map +0 -1
  175. package/dist/EventsExceptionModal-BlZtBQoR.js +0 -200
  176. package/dist/EventsExceptionModal-BlZtBQoR.js.map +0 -1
  177. package/dist/EventsSkeleton-DK6JDKAK.js +0 -83
  178. package/dist/EventsSkeleton-DK6JDKAK.js.map +0 -1
  179. package/dist/FeatureMenu-C3503UIX.js +0 -265
  180. package/dist/FeatureMenu-C3503UIX.js.map +0 -1
  181. package/dist/FlywayQuery-Cx2sly6g.js +0 -169
  182. package/dist/FlywayQuery-Cx2sly6g.js.map +0 -1
  183. package/dist/ImmunizationConfigurationBase-DLQVSNnt.js +0 -5895
  184. package/dist/ImmunizationConfigurationBase-DLQVSNnt.js.map +0 -1
  185. package/dist/ImmunizationConfigurationsList-DdSZicTP.js +0 -344
  186. package/dist/ImmunizationConfigurationsList-DdSZicTP.js.map +0 -1
  187. package/dist/LanguagesModal-D6VfaGrl.js +0 -394
  188. package/dist/LanguagesModal-D6VfaGrl.js.map +0 -1
  189. package/dist/ManageDynamicFeature-dt096fyj.js +0 -4189
  190. package/dist/ManageDynamicFeature-dt096fyj.js.map +0 -1
  191. package/dist/ManageEventConfiguration-BpSJszSX.js +0 -1017
  192. package/dist/ManageEventConfiguration-BpSJszSX.js.map +0 -1
  193. package/dist/ManageTranslation-B4C9-lWD.js +0 -625
  194. package/dist/ManageTranslation-B4C9-lWD.js.map +0 -1
  195. package/dist/MobileMenuManagement-Cf8IZlla.js +0 -108
  196. package/dist/MobileMenuManagement-Cf8IZlla.js.map +0 -1
  197. package/dist/MobileTypeEventConfigModal-DUkUYACe.js +0 -783
  198. package/dist/MobileTypeEventConfigModal-DUkUYACe.js.map +0 -1
  199. package/dist/NotificationFlywayQuery-BY8Zzml_.js +0 -244
  200. package/dist/NotificationFlywayQuery-BY8Zzml_.js.map +0 -1
  201. package/dist/OtherTypeEventConfigModal-CYBfr2XE.js +0 -2046
  202. package/dist/OtherTypeEventConfigModal-CYBfr2XE.js.map +0 -1
  203. package/dist/QueryBuilder-z7eqfd7D.js +0 -383
  204. package/dist/QueryBuilder-z7eqfd7D.js.map +0 -1
  205. package/dist/RoleManagement-DEiBNfT8.js.map +0 -1
  206. package/dist/ShowFlywayQuery-DVRCd384.js.map +0 -1
  207. package/dist/ShowFlywayQuery-tj42YQAS.js +0 -130
  208. package/dist/ShowFlywayQuery-tj42YQAS.js.map +0 -1
  209. package/dist/ShowQueryHistory-BDN0tzHg.js +0 -190
  210. package/dist/ShowQueryHistory-BDN0tzHg.js.map +0 -1
  211. package/dist/SubMenu-B072oEGb.js +0 -191
  212. package/dist/SubMenu-B072oEGb.js.map +0 -1
  213. package/dist/TypeConfiguration-C3xoP2Nb.js +0 -117
  214. package/dist/TypeConfiguration-C3xoP2Nb.js.map +0 -1
  215. package/dist/dashboardLayoutUtils-D1xCAxp3.js.map +0 -1
  216. package/dist/index.lib-C3fwoM3y.js +0 -820
  217. package/dist/index.lib-C3fwoM3y.js.map +0 -1
@@ -1,1017 +0,0 @@
1
- import { jsxs as r, Fragment as nt, jsx as t } from "react/jsx-runtime";
2
- import { b as it, c as rt, d as lt, M as ot, u as st, s as ct } from "./EventsSkeleton-DK6JDKAK.js";
3
- import { retrieveAllNotifications as dt, getReportsList as ut } from "@/common/services/GlobalApis";
4
- import { showToast as F } from "@/common/toaster/toaster";
5
- import Ce from "@/views/custom-components/CustomTextArea";
6
- import _ from "@/views/custom-components/CustomTextField";
7
- import { yupResolver as mt } from "@hookform/resolvers/yup";
8
- import ft from "@/views/custom-components/CustomDropdown";
9
- import { Card as gt, CardHeader as ht, CardContent as pt, FormControl as T, Typography as c, Box as x, Select as B, MenuItem as p, Divider as G, Button as W, TableContainer as vt, Paper as yt, Table as bt, TableHead as Ct, TableRow as Te, TableCell as O, TableBody as Tt, CardActions as Nt } from "@mui/material";
10
- import h from "@mui/material/Grid2";
11
- import { useRef as Ne, useState as u, useEffect as Ee, Suspense as we, lazy as X } from "react";
12
- import { useForm as Et, Controller as Y } from "react-hook-form";
13
- import { useNavigate as wt } from "react-router";
14
- import { useParams as xt } from "react-router-dom";
15
- import * as I from "yup";
16
- import { useTranslateProvider as It } from "@/common/languageTranslator/TranslationContext";
17
- import Mt from "@/hooks/useTrackEvent";
18
- import { FontAwesomeIcon as $ } from "@fortawesome/react-fontawesome";
19
- import { faPen as Dt, faTrash as xe, faPlus as Ie } from "@fortawesome/free-solid-svg-icons";
20
- import './ManageEventConfiguration.css';const Rt = X(() => import("./ConditionConfig-B4Ffpgj3.js")), qt = X(
21
- () => import("./MobileTypeEventConfigModal-DUkUYACe.js")
22
- ), St = X(
23
- () => import("./OtherTypeEventConfigModal-CYBfr2XE.js")
24
- );
25
- function Qt() {
26
- var ve, ye, be;
27
- const { translate: l } = It(), Z = Ne(null), ee = Ne(!1), { id: A } = xt(), te = wt(), [z, Me] = u(null), [ae, De] = u(null), [ne, Re] = u({}), [v, M] = u(
28
- []
29
- ), [ie, qe] = u(null), [H, Se] = u(null), [Ae, re] = u(null), [Oe, Le] = u(null), [D, L] = u(null), [_e, le] = u(null), [$e, ze] = u(null), [R, q] = u(null), [oe, ke] = u(!1), [se, ce] = u(!1), [de, j] = u(!1), [k, S] = u([]), [Ue, U] = u(!1), [Pe, Fe] = u([]), Be = window.getComputedStyle(document.body).lineHeight, ue = () => ke(!oe), We = I.object().shape({
30
- name: I.string().required("Enter Name"),
31
- eventType: I.string().required("Select Event Type"),
32
- recursionInterval: I.number().typeError("Recursion Interval must be a number").when([], {
33
- is: () => m === "RECURSION",
34
- then: (e) => e.required("Recursion Interval is required").moreThan(0, "Recursion Interval must be greater than or equal to 1").lessThan(1441, "Recursion Interval must be less than or equal to 1440"),
35
- otherwise: (e) => e.notRequired()
36
- }),
37
- trigerWhen: I.string().test(
38
- "is-required",
39
- "trigerWhen is required",
40
- function(e) {
41
- return m === "TIMMER_BASED" ? !!e : !0;
42
- }
43
- ),
44
- day: I.string().test("is-required", "day is required", function(e) {
45
- return m === "TIMMER_BASED" && (f === "AFTER" || f === "MONTHLY") ? !!e : !0;
46
- }),
47
- hour: I.string().test(
48
- "is-required",
49
- "hour is required",
50
- function(e) {
51
- return m === "TIMMER_BASED" && (f === "AFTER" || f === "MONTHLY" || f === "DAILY") ? !!e : !0;
52
- }
53
- ),
54
- minute: I.string().notRequired()
55
- // notificationConfigDetails: Yup.array().of(
56
- // Yup.object().shape({
57
- // query: Yup.string().required('Query is required'), // Ensure query is present
58
- // // condition: Yup.string().required('Condition is required'), // Ensure condition is present
59
- // // action: Yup.string().required('Action is required'), // Ensure action is present
60
- // })
61
- // ),
62
- }), {
63
- control: C,
64
- handleSubmit: Ye,
65
- setValue: P,
66
- setError: V,
67
- clearErrors: K,
68
- getValues: me,
69
- watch: fe,
70
- formState: { errors: s }
71
- } = Et({
72
- defaultValues: {
73
- name: "",
74
- description: "",
75
- eventType: "",
76
- recursionInterval: 0,
77
- minute: 0
78
- },
79
- resolver: mt(We),
80
- mode: "onChange"
81
- }), m = fe("eventType");
82
- let f = fe("trigerWhen");
83
- Ee(() => {
84
- let e = Z.current;
85
- return () => {
86
- Q("conversion_event", {
87
- form: e,
88
- form_name: "Manage Event Configuration",
89
- submit: ee.current
90
- });
91
- };
92
- }, []);
93
- const He = async (e) => {
94
- try {
95
- if (v.length > 0) {
96
- e.minute = Number(e.minute || 0), e.notificationConfigDetails = v;
97
- const a = m === "TIMMER_BASED", i = m === "FORM_SUBMITTED", n = m === "MANUAL", o = m === "RECURSION";
98
- a || (delete e.trigerWhen, delete e.day, delete e.hour, delete e.minute), i || delete e.formTypeId, !i && !n && (delete e.eventTypeDetailCode, delete e.eventTypeDetailId), o ? (delete e.formTypeId, e.trigerWhen = "RECURSION") : delete e.recursionInterval;
99
- const g = ["AFTER", "MONTHLY", "WEEKLY"], E = ["AFTER", "MONTHLY", "DAILY", "WEEKLY"];
100
- g.includes(f) || delete e.day, E.includes(f) || (delete e.day, delete e.hour), f === "IMMEDIATELY" && (delete e.day, delete e.hour, delete e.minute);
101
- const w = v.map((y) => {
102
- var d;
103
- return {
104
- ...y,
105
- conditions: (d = y.conditions) == null ? void 0 : d.map((b) => ({
106
- ...b,
107
- notificaitonConfigsType: b.notificaitonConfigsType ? b.notificaitonConfigsType.map((N) => ({
108
- ...N,
109
- queryCode: N.queryCode === "" ? null : N.queryCode
110
- })) : b.notificaitonConfigsType
111
- }))
112
- };
113
- });
114
- e.notificationConfigDetails = w, A ? await st(e) : await ct(e), Q("button_click", {
115
- button_name: "manageeventconfiguration-save-button",
116
- button_type: "submit",
117
- button_id: "manageeventconfiguration-save-button"
118
- }), F({
119
- message: A ? "Event Configuration Updated successfully" : "submit successfully",
120
- type: "success"
121
- }), ee.current = !0, te("/ui/medplat/notification/all");
122
- } else
123
- F({
124
- message: "Please add atleast query / condition for the configuration",
125
- type: "warn"
126
- });
127
- } catch {
128
- F({ message: "submit problem", type: "error" }), U((a) => !a);
129
- }
130
- };
131
- Ee(() => {
132
- je();
133
- }, []);
134
- const je = async () => {
135
- var e, a, i, n;
136
- try {
137
- U((d) => !d);
138
- const o = await it({ is_active: !0 });
139
- Me(o == null ? void 0 : o.data);
140
- const g = await rt();
141
- De(g == null ? void 0 : g.data);
142
- const E = await dt(!0);
143
- let w = {};
144
- (e = E == null ? void 0 : E.data) == null || e.forEach((d) => {
145
- w[d == null ? void 0 : d.id] = d == null ? void 0 : d.notificationName;
146
- }), Re(w);
147
- const { data: y } = await ut();
148
- if (Fe(y || []), A) {
149
- const d = await lt(A);
150
- (i = (a = d == null ? void 0 : d.data) == null ? void 0 : a.notificationConfigDetails) == null || i.forEach((N) => {
151
- ge(N);
152
- });
153
- let b = d == null ? void 0 : d.data;
154
- (n = Object.keys(b)) == null || n.forEach((N) => {
155
- b[N] !== void 0 && b[N] !== null && P(N, b[N]);
156
- }), M((b == null ? void 0 : b.notificationConfigDetails) || []);
157
- }
158
- U((d) => !d);
159
- } catch (o) {
160
- F({
161
- message: "Error in loading manage events",
162
- type: `Error:${o == null ? void 0 : o.message}`
163
- }), U((g) => !g);
164
- }
165
- }, ge = (e) => {
166
- e.implicitParam = ["#resourceId#"];
167
- const a = /\bFROM\b/gi, i = /\bSELECT\b/gi;
168
- if (e != null && e.query) {
169
- const n = (e.query.match(a) || []).length, o = (e.query.match(i) || []).length;
170
- let g;
171
- if (o > 0) {
172
- n > 1 && n === o ? g = e.query.substring(6, e.query.search(/\bfrom\b(?!(.|\n)*(from))/i)).match(/(\w*\(.*?\) as \w*|[^\(\),]+)(?=\s*,|\s*$)/g) : n !== o ? g = e.query.substring(6).match(/(\w*\(.*?\) as \w*|[^\(\),]+)(?=\s*,|\s*$)/gi) : n === 1 && n === o ? g = e.query.substring(6, e.query.toLowerCase().indexOf("from")).match(/(\w*\(.*?\) as \w*|[^\(\),]+)(?=\s*,|\s*$)/gi) : g = e.query.substring(6).match(/(\w*\(.*?\) as \w*|[^\(\),]+)(?=\s*,|\s*$)/gi);
173
- const E = g == null ? void 0 : g.filter(
174
- (w) => w.trim().length > 0
175
- );
176
- E == null || E.forEach((w) => {
177
- let y = w.trim();
178
- if (y.toLowerCase().indexOf("as") === 0 && (y = w), y.endsWith(";") && (y = y.slice(0, -1)), y !== "*") {
179
- const d = y.toLowerCase().lastIndexOf(" as ");
180
- if (d >= 0) {
181
- const b = y.substring(d + 4).trim();
182
- e.implicitParam.push("#" + b + "#");
183
- } else
184
- e.implicitParam.push("#" + y + "#");
185
- }
186
- });
187
- }
188
- }
189
- }, Ve = (e) => {
190
- const a = v == null ? void 0 : v.filter(
191
- (i, n) => n !== e
192
- );
193
- M(a);
194
- }, Ke = (e, a) => {
195
- const i = [...v], n = i[e].conditions.filter((o, g) => g !== a);
196
- i[e].conditions = n, M(i);
197
- }, J = async (e, a, i, n) => {
198
- Se(e), qe(a), i ? (re(i), le(!0), L(JSON.parse(JSON.stringify(i))), S((i == null ? void 0 : i.notificaitonConfigsType) || []), Le(n)) : (re({}), L({}), S([]), le(!1)), q({}), ue();
199
- }, Je = (e, a) => {
200
- const i = [...v];
201
- i[e].query = a, M(i);
202
- }, Qe = async () => {
203
- let e = [...v], a = !0;
204
- v.forEach((i, n) => {
205
- if (i.query === "") {
206
- a = !1;
207
- const o = `notificationConfigDetails.${n}.query`;
208
- V(o, { type: "manual", message: "Query Required" });
209
- }
210
- }), a && (e.push({ query: "", conditions: [], queryParam: null }), M(e));
211
- }, he = async (e, a) => {
212
- e ? (e.index = a, ze(e), q({
213
- ...JSON.parse(JSON.stringify(e)),
214
- implicitParam: H.implicitParam
215
- }), ce(!0)) : (q({ ...R, implicitParam: H.implicitParam }), ce(!1)), Ge();
216
- }, Ge = () => {
217
- j((e) => !e);
218
- }, pe = (e) => {
219
- if (se) {
220
- const a = k.map((i, n) => n === e.index ? { ...i, ...e } : i);
221
- S(a);
222
- } else
223
- S([...k, e]);
224
- et(e);
225
- }, Xe = (e) => {
226
- S(
227
- (a) => a.filter((i, n) => n !== e)
228
- );
229
- }, Ze = (e) => {
230
- he(k[e], e);
231
- }, et = (e) => {
232
- let a = { ...D };
233
- D.notificaitonConfigsType || (a.notificaitonConfigsType = []), se ? a.notificaitonConfigsType[$e.index] = e : a.notificaitonConfigsType.push(e), L(a), q({});
234
- }, Q = Mt(), tt = (e) => {
235
- if (_e) {
236
- const a = [...v];
237
- L({ ...D, ...e });
238
- let i = { ...D, ...e };
239
- a[ie].conditions[Oe] = i, M(a), S([]);
240
- } else {
241
- const a = [...v];
242
- L({ ...D, ...e });
243
- let i = { ...D, ...e };
244
- a[ie].conditions.push(i), M(a), S([]);
245
- }
246
- }, at = (e) => {
247
- q({ ...R, ...e });
248
- };
249
- return /* @__PURE__ */ r(nt, { children: [
250
- /* @__PURE__ */ t(ot, { isLoading: Ue, children: /* @__PURE__ */ r(
251
- gt,
252
- {
253
- className: "manage-eventConfiguration-type-body",
254
- component: "form",
255
- ref: Z,
256
- onSubmit: Ye(He),
257
- "data-testid": "manageeventconfiguration-form",
258
- children: [
259
- /* @__PURE__ */ t(
260
- ht,
261
- {
262
- className: "p-2.5 px-5 flex border-b text-customBlue",
263
- subheader: l(
264
- `${A ? "UPDATE" : "ADD"} EVENT CONFIGURATION`
265
- ),
266
- slotProps: {
267
- subheader: { className: "font-medium text-lg text-customBlue" }
268
- },
269
- "data-testid": "manageeventconfiguration-cardheader-subheader"
270
- }
271
- ),
272
- /* @__PURE__ */ r(pt, { "data-testid": "manageeventconfiguration-cardcontent", children: [
273
- /* @__PURE__ */ r(h, { container: !0, spacing: 2, children: [
274
- /* @__PURE__ */ t(
275
- h,
276
- {
277
- item: !0,
278
- size: { xs: 12, sm: 6 },
279
- "data-testid": "manageeventconfiguration-name-field",
280
- children: /* @__PURE__ */ r(T, { variant: "outlined", className: "w-full", children: [
281
- /* @__PURE__ */ r(c, { variant: "body2", children: [
282
- l("Name"),
283
- /* @__PURE__ */ t("span", { className: "text-red-500 ml-1", children: "*" })
284
- ] }),
285
- /* @__PURE__ */ t(x, { className: "w-full", children: /* @__PURE__ */ t(
286
- _,
287
- {
288
- control: C,
289
- id: "name",
290
- name: "name",
291
- errors: s,
292
- label: "",
293
- size: "small",
294
- dataTestId: "manageeventconfiguration-name-textfield"
295
- }
296
- ) })
297
- ] })
298
- }
299
- ),
300
- /* @__PURE__ */ t(
301
- h,
302
- {
303
- item: !0,
304
- size: { xs: 12, sm: 6 },
305
- "data-testid": "manageeventconfiguration-description-field",
306
- children: /* @__PURE__ */ r(T, { variant: "outlined", className: "w-full", children: [
307
- /* @__PURE__ */ t(c, { variant: "body2", children: l("Description") }),
308
- /* @__PURE__ */ t(x, { className: "w-full", children: /* @__PURE__ */ t(
309
- Ce,
310
- {
311
- control: C,
312
- id: "description",
313
- name: "description",
314
- errors: s,
315
- label: "",
316
- minRows: 2,
317
- "data-testid": "manageeventconfiguration-description-textarea"
318
- }
319
- ) })
320
- ] })
321
- }
322
- ),
323
- /* @__PURE__ */ t(
324
- h,
325
- {
326
- item: !0,
327
- size: { xs: 12, sm: 6 },
328
- "data-testid": "manageeventconfiguration-eventtype-field",
329
- children: /* @__PURE__ */ r(T, { variant: "outlined", className: "w-full", children: [
330
- /* @__PURE__ */ r(c, { variant: "body2", children: [
331
- l("Event Type"),
332
- /* @__PURE__ */ t("span", { className: "text-red-500 ml-1", children: "*" })
333
- ] }),
334
- /* @__PURE__ */ r(x, { className: "w-full", children: [
335
- /* @__PURE__ */ t(
336
- Y,
337
- {
338
- name: "eventType",
339
- control: C,
340
- defaultValue: "",
341
- className: "w-full",
342
- render: ({ field: e }) => /* @__PURE__ */ r(
343
- B,
344
- {
345
- className: "w-full",
346
- labelId: "event-type-label",
347
- id: "reportgroup",
348
- ...e,
349
- error: s.eventType,
350
- size: "small",
351
- "data-testid": "manageeventconfiguration-eventtype-select",
352
- children: [
353
- /* @__PURE__ */ t(p, { value: "FORM_SUBMITTED", children: /* @__PURE__ */ t(c, { variant: "body2", children: l("Form Submitted") }) }),
354
- /* @__PURE__ */ t(p, { value: "TIMMER_BASED", children: /* @__PURE__ */ t(c, { variant: "body2", children: l("Timer Based") }) }),
355
- /* @__PURE__ */ t(p, { value: "MANUAL", children: /* @__PURE__ */ t(c, { variant: "body2", children: l("Manual") }) }),
356
- /* @__PURE__ */ t(p, { value: "RECURSION", children: /* @__PURE__ */ t(c, { variant: "body2", children: l("Recursion") }) })
357
- ]
358
- }
359
- )
360
- }
361
- ),
362
- (s == null ? void 0 : s.eventType) && /* @__PURE__ */ t(
363
- "p",
364
- {
365
- className: "error-helper-manage-event",
366
- "data-testid": "custom-error-message",
367
- children: (ve = s == null ? void 0 : s.eventType) == null ? void 0 : ve.message
368
- }
369
- )
370
- ] })
371
- ] })
372
- }
373
- ),
374
- m === "FORM_SUBMITTED" && /* @__PURE__ */ t(
375
- h,
376
- {
377
- item: !0,
378
- size: { xs: 12, sm: 6 },
379
- "data-testid": "manageeventconfiguration-formtype-field",
380
- children: /* @__PURE__ */ r(T, { variant: "outlined", className: "w-full", children: [
381
- /* @__PURE__ */ t(c, { variant: "body2", children: l("Form Type") }),
382
- /* @__PURE__ */ t(x, { className: "w-full", children: /* @__PURE__ */ t(
383
- Y,
384
- {
385
- className: "w-full",
386
- name: "formTypeId",
387
- control: C,
388
- defaultValue: "",
389
- render: ({ field: e }) => /* @__PURE__ */ r(
390
- B,
391
- {
392
- ...e,
393
- className: "w-full",
394
- labelId: "event-type-label",
395
- displayEmpty: !0,
396
- size: "small",
397
- onChange: (a) => {
398
- const i = a.target.value;
399
- e.onChange(i);
400
- const n = z.find(
401
- (o) => o.id === i
402
- );
403
- P(
404
- "eventTypeDetailCode",
405
- n == null ? void 0 : n.code
406
- ), P(
407
- "eventTypeDetailId",
408
- (n == null ? void 0 : n.detaiId) || null
409
- );
410
- },
411
- "data-testid": "manageeventconfiguration-formtype-select",
412
- children: [
413
- /* @__PURE__ */ t(p, { value: "", children: /* @__PURE__ */ t(c, { variant: "body2", children: l("Select") }) }),
414
- z == null ? void 0 : z.map((a) => /* @__PURE__ */ t(p, { value: a.id, children: /* @__PURE__ */ t(c, { variant: "body2", children: l(a.name) }) }, a.id))
415
- ]
416
- }
417
- )
418
- }
419
- ) })
420
- ] })
421
- }
422
- ),
423
- m === "TIMMER_BASED" && /* @__PURE__ */ t(
424
- h,
425
- {
426
- item: !0,
427
- size: { xs: 12, sm: 6 },
428
- "data-testid": "manageeventconfiguration-triggerwhen-field",
429
- children: /* @__PURE__ */ r(T, { variant: "outlined", className: "w-full", children: [
430
- /* @__PURE__ */ r(c, { variant: "body2", children: [
431
- l("Trigger When"),
432
- /* @__PURE__ */ t("span", { className: "text-red-500 ml-1", children: "*" })
433
- ] }),
434
- /* @__PURE__ */ r(x, { className: "w-full", children: [
435
- /* @__PURE__ */ t(
436
- Y,
437
- {
438
- name: "trigerWhen",
439
- control: C,
440
- defaultValue: "",
441
- className: "w-full",
442
- render: ({ field: e }) => /* @__PURE__ */ r(
443
- B,
444
- {
445
- className: "w-full",
446
- ...e,
447
- value: e.value,
448
- error: s.trigerWhen,
449
- size: "small",
450
- "data-testid": "manageeventconfiguration-triggerwhen-select",
451
- children: [
452
- /* @__PURE__ */ t(p, { value: "", children: /* @__PURE__ */ t(c, { variant: "body2", children: l("Select") }) }),
453
- /* @__PURE__ */ t(p, { value: "IMMEDIATELY", children: /* @__PURE__ */ t(c, { variant: "body2", children: l("Immediately") }) }),
454
- /* @__PURE__ */ t(p, { value: "AFTER", children: /* @__PURE__ */ t(c, { variant: "body2", children: l("After") }) }),
455
- /* @__PURE__ */ t(p, { value: "MONTHLY", children: /* @__PURE__ */ t(c, { variant: "body2", children: l("Monthly") }) }),
456
- /* @__PURE__ */ t(p, { value: "WEEKLY", children: /* @__PURE__ */ t(c, { variant: "body2", children: l("Weekly") }) }),
457
- /* @__PURE__ */ t(p, { value: "DAILY", children: /* @__PURE__ */ t(c, { variant: "body2", children: l("Daily") }) }),
458
- /* @__PURE__ */ t(p, { value: "HOURLY", children: /* @__PURE__ */ t(c, { variant: "body2", children: l("Hourly") }) }),
459
- /* @__PURE__ */ t(p, { value: "MINUTE", children: /* @__PURE__ */ t(c, { variant: "body2", children: l("Minutely") }) })
460
- ]
461
- }
462
- )
463
- }
464
- ),
465
- (s == null ? void 0 : s.trigerWhen) && /* @__PURE__ */ t(
466
- "p",
467
- {
468
- className: "error-helper-manage-event",
469
- "data-testid": "custom-error-message",
470
- children: (ye = s == null ? void 0 : s.trigerWhen) == null ? void 0 : ye.message
471
- }
472
- )
473
- ] })
474
- ] })
475
- }
476
- ),
477
- m === "TIMMER_BASED" && (f === "AFTER" || f === "MONTHLY" || f === "WEEKLY") && /* @__PURE__ */ t(
478
- h,
479
- {
480
- item: !0,
481
- size: { xs: 12, sm: 6 },
482
- "data-testid": "manageeventconfiguration-day-field",
483
- children: /* @__PURE__ */ r(T, { variant: "outlined", className: "w-full", children: [
484
- /* @__PURE__ */ r(c, { variant: "body2", children: [
485
- l("day"),
486
- /* @__PURE__ */ t("span", { className: "text-red-500 ml-1", children: "*" })
487
- ] }),
488
- /* @__PURE__ */ t(
489
- _,
490
- {
491
- control: C,
492
- id: "day",
493
- name: "day",
494
- errors: s,
495
- type: "number",
496
- label: "",
497
- size: "small",
498
- dataTestId: "manageeventconfiguration-day-textfield"
499
- }
500
- )
501
- ] })
502
- }
503
- ),
504
- m === "TIMMER_BASED" && (f === "AFTER" || f === "MONTHLY" || f === "DAILY" || f === "WEEKLY") && /* @__PURE__ */ t(
505
- h,
506
- {
507
- item: !0,
508
- size: { xs: 12, sm: 6 },
509
- "data-testid": "manageeventconfiguration-hour-field",
510
- children: /* @__PURE__ */ r(T, { variant: "outlined", className: "w-full", children: [
511
- /* @__PURE__ */ r(c, { variant: "body2", children: [
512
- l("Hour"),
513
- /* @__PURE__ */ t("span", { className: "text-red-500 ml-1", children: "*" })
514
- ] }),
515
- /* @__PURE__ */ t(
516
- _,
517
- {
518
- control: C,
519
- id: "hour",
520
- name: "hour",
521
- type: "number",
522
- errors: s,
523
- label: "",
524
- size: "small",
525
- dataTestId: "manageeventconfiguration-hour-textfield"
526
- }
527
- )
528
- ] })
529
- }
530
- ),
531
- m === "TIMMER_BASED" && f && f !== "IMMEDIATELY" && /* @__PURE__ */ t(
532
- h,
533
- {
534
- item: !0,
535
- size: { xs: 12, sm: 6 },
536
- "data-testid": "manageeventconfiguration-minute-field",
537
- children: /* @__PURE__ */ r(T, { variant: "outlined", className: "w-full", children: [
538
- /* @__PURE__ */ t(c, { variant: "body2", children: l("Minute") }),
539
- /* @__PURE__ */ t(
540
- _,
541
- {
542
- control: C,
543
- id: "minute",
544
- name: "minute",
545
- errors: s,
546
- type: "number",
547
- label: "",
548
- size: "small",
549
- dataTestId: "manageeventconfiguration-minute-textfield"
550
- }
551
- )
552
- ] })
553
- }
554
- ),
555
- m === "RECURSION" && /* @__PURE__ */ t(h, { item: !0, size: { xs: 12, sm: 6 }, children: /* @__PURE__ */ r(T, { variant: "outlined", className: "w-full", children: [
556
- /* @__PURE__ */ r(c, { variant: "body2", children: [
557
- l("Recursion Interval (in Minutes)"),
558
- /* @__PURE__ */ t("span", { className: "text-red-500 ml-1", children: "*" })
559
- ] }),
560
- /* @__PURE__ */ t(x, { className: "w-full", children: /* @__PURE__ */ t(
561
- _,
562
- {
563
- type: "number",
564
- control: C,
565
- id: "recursionInterval",
566
- name: "recursionInterval",
567
- errors: s,
568
- label: "",
569
- size: "small",
570
- dataTestId: "manageeventconfiguration-recursionInterval-textfield"
571
- }
572
- ) })
573
- ] }) }),
574
- (m === "TIMMER_BASED" || m === "RECURSION") && /* @__PURE__ */ t(h, { item: !0, size: { xs: 12, sm: 6 }, children: /* @__PURE__ */ r(T, { variant: "outlined", className: "w-full", children: [
575
- /* @__PURE__ */ t(c, { variant: "body2", children: l("Reports") }),
576
- /* @__PURE__ */ t(x, { className: "w-full", children: /* @__PURE__ */ t(
577
- ft,
578
- {
579
- id: "reportUUID",
580
- name: "reportUUID",
581
- displayName: "name",
582
- optionValue: "uuid",
583
- multiple: !0,
584
- control: C,
585
- options: Pe
586
- }
587
- ) })
588
- ] }) }),
589
- m === "MANUAL" && /* @__PURE__ */ t(
590
- h,
591
- {
592
- item: !0,
593
- size: { xs: 12, sm: 6 },
594
- "data-testid": "manageeventconfiguration-event-field",
595
- children: /* @__PURE__ */ r(T, { variant: "outlined", className: "w-full", children: [
596
- /* @__PURE__ */ t(c, { variant: "body2", children: l("Event") }),
597
- /* @__PURE__ */ r(x, { className: "w-full", children: [
598
- /* @__PURE__ */ t(
599
- Y,
600
- {
601
- name: "eventTypeDetailCode",
602
- control: C,
603
- className: "w-full",
604
- render: ({ field: e }) => /* @__PURE__ */ r(
605
- B,
606
- {
607
- className: "w-full",
608
- ...e,
609
- value: e.value,
610
- error: s.eventTypeDetailCode,
611
- size: "small",
612
- "data-testid": "manageeventconfiguration-eventtype-detail-select",
613
- children: [
614
- /* @__PURE__ */ t(p, { value: "", children: l("None") }),
615
- ae && Object.entries(ae).map(([a, i]) => /* @__PURE__ */ t(p, { value: a, children: i }, a))
616
- ]
617
- }
618
- )
619
- }
620
- ),
621
- (s == null ? void 0 : s.eventTypeDetailCode) && /* @__PURE__ */ t(
622
- "p",
623
- {
624
- className: "error-helper-manage-event",
625
- "data-testid": "manageeventconfiguration-eventtype-detail-error",
626
- children: (be = s == null ? void 0 : s.eventTypeDetailCode) == null ? void 0 : be.message
627
- }
628
- )
629
- ] })
630
- ] })
631
- }
632
- )
633
- ] }),
634
- /* @__PURE__ */ t(G, { className: "m-[20px_3px]" }),
635
- /* @__PURE__ */ r(
636
- h,
637
- {
638
- container: !0,
639
- spacing: 5,
640
- justifyContent: "space-between",
641
- alignItems: "center",
642
- "data-testid": "manageeventconfiguration-add-configuration",
643
- children: [
644
- /* @__PURE__ */ t(h, { item: !0, children: /* @__PURE__ */ t(c, { variant: "body2", children: l("Add Configuration") }) }),
645
- /* @__PURE__ */ t(h, { item: !0, children: /* @__PURE__ */ t(
646
- W,
647
- {
648
- size: "small",
649
- variant: "contained",
650
- onClick: Qe,
651
- "data-testid": "manageeventconfiguration-add-button",
652
- children: l("Add")
653
- }
654
- ) })
655
- ]
656
- }
657
- ),
658
- /* @__PURE__ */ t(h, { container: !0, className: "w-full mt-5", children: /* @__PURE__ */ t(h, { item: !0, className: "w-full", children: /* @__PURE__ */ t(
659
- vt,
660
- {
661
- component: yt,
662
- className: "w-full",
663
- "data-testid": "manageeventconfiguration-table-container",
664
- children: /* @__PURE__ */ r(bt, { sx: { minWidth: 800 }, children: [
665
- /* @__PURE__ */ t(Ct, { children: /* @__PURE__ */ r(
666
- Te,
667
- {
668
- sx: {
669
- backgroundColor: (e) => e.palette.mode === "dark" ? e.palette.custom.tableHeader : "var(--color-gray4)"
670
- },
671
- children: [
672
- /* @__PURE__ */ t(
673
- O,
674
- {
675
- className: "border border-gray-300 align-top text-[13px]",
676
- "data-testid": "manageeventconfiguration-table-header-query",
677
- children: l("Query")
678
- }
679
- ),
680
- /* @__PURE__ */ t(
681
- O,
682
- {
683
- className: "border border-gray-300 align-top text-[13px]",
684
- "data-testid": "manageeventconfiguration-table-header-condition",
685
- children: l("Condition")
686
- }
687
- ),
688
- /* @__PURE__ */ t(
689
- O,
690
- {
691
- className: "border border-gray-300 align-top text-[13px]",
692
- "data-testid": "manageeventconfiguration-table-header-action",
693
- children: l("Actions")
694
- }
695
- )
696
- ]
697
- }
698
- ) }),
699
- /* @__PURE__ */ t(Tt, { children: v == null ? void 0 : v.map((e, a) => {
700
- var i;
701
- return /* @__PURE__ */ r(
702
- Te,
703
- {
704
- sx: {
705
- backgroundColor: (n) => {
706
- const o = n.palette.mode === "dark";
707
- return a % 2 === 0 ? o ? n.palette.background.paper : "#fff" : o ? "#1C2128" : "var(--color-gray4)";
708
- },
709
- // Adding a hover state that works in both modes
710
- "&:hover": {
711
- backgroundColor: (n) => n.palette.mode === "dark" ? "#21262D" : "var(--color-gray4)"
712
- }
713
- },
714
- "data-testid": `manageeventconfiguration-table-row-${a}`,
715
- children: [
716
- /* @__PURE__ */ t(
717
- O,
718
- {
719
- className: "border border-gray-300 align-top",
720
- style: { lineHeight: Be },
721
- "data-testid": `manageeventconfiguration-table-row-${a}-query`,
722
- children: /* @__PURE__ */ r("div", { className: "flex flex-col items-start min-w-[300px]", children: [
723
- /* @__PURE__ */ t(
724
- T,
725
- {
726
- variant: "outlined",
727
- className: "w-full",
728
- children: /* @__PURE__ */ t(x, { className: "w-full", children: /* @__PURE__ */ t(
729
- Ce,
730
- {
731
- required: !0,
732
- control: C,
733
- id: `notificationConfigDetails.${a}.query`,
734
- name: `notificationConfigDetails.${a}.query`,
735
- errors: s,
736
- value: e.query,
737
- onChange: (n) => {
738
- P(
739
- `notificationConfigDetails.${a}.query`,
740
- n.target.value
741
- ), Je(a, n.target.value);
742
- const o = `notificationConfigDetails.${a}.query`;
743
- me(o) === "" ? V(o, {
744
- type: "manual",
745
- message: "Query Required"
746
- }) : K(o);
747
- },
748
- onBlur: () => {
749
- const n = `notificationConfigDetails.${a}.query`;
750
- me(n) === "" ? V(n, {
751
- type: "manual",
752
- message: "Query Required"
753
- }) : K(n), ge(e);
754
- },
755
- label: "",
756
- minRows: 5,
757
- maxRows: 20,
758
- "data-testid": `manageeventconfiguration-table-row-${a}-query-textarea`
759
- }
760
- ) })
761
- }
762
- ),
763
- /* @__PURE__ */ t(
764
- "td",
765
- {
766
- style: {
767
- whiteSpace: "normal",
768
- width: "100%",
769
- overflowWrap: "break-word"
770
- },
771
- children: /* @__PURE__ */ t("b", { children: e == null ? void 0 : e.implicitParam })
772
- }
773
- )
774
- ] })
775
- }
776
- ),
777
- /* @__PURE__ */ t(
778
- O,
779
- {
780
- className: "border border-gray-300 align-top",
781
- "data-testid": `manageeventconfiguration-table-row-${a}-condition`,
782
- children: /* @__PURE__ */ t(
783
- "div",
784
- {
785
- style: {
786
- display: "flex",
787
- flexDirection: "column",
788
- alignItems: "flex-start",
789
- width: "100%"
790
- },
791
- children: ((i = e == null ? void 0 : e.conditions) == null ? void 0 : i.length) > 0 ? e == null ? void 0 : e.conditions.map(
792
- (n, o) => /* @__PURE__ */ r(
793
- "div",
794
- {
795
- style: { width: "100%" },
796
- children: [
797
- /* @__PURE__ */ r(
798
- "div",
799
- {
800
- style: {
801
- display: "flex",
802
- alignItems: "center",
803
- width: "100%"
804
- },
805
- "data-testid": "manageeventconfiguration-condition-rows",
806
- children: [
807
- /* @__PURE__ */ t(
808
- c,
809
- {
810
- className: "mr-1",
811
- variant: "body2",
812
- children: (n == null ? void 0 : n.condition) || "No condition specified"
813
- }
814
- ),
815
- /* @__PURE__ */ t(
816
- $,
817
- {
818
- className: "bg-[var(--color-gray3)] text-gray-600 rounded-full p-[10px] w-[14px] h-[14px] mx-1 cursor-pointer hover:bg-gray-300 hover:text-[#11B666] transition-all",
819
- icon: Dt,
820
- onClick: () => J(
821
- e,
822
- a,
823
- n,
824
- o
825
- ),
826
- "data-testid": `manageeventconfiguration-table-row-${a}-condition-edit-${o}`
827
- }
828
- ),
829
- /* @__PURE__ */ t(
830
- $,
831
- {
832
- icon: xe,
833
- className: "bg-[var(--color-gray3)] text-gray-600 rounded-full p-[10px] w-[14px] h-[14px] mx-1 cursor-pointer hover:bg-gray-300 hover:text-[var(--color-error)] transition-all",
834
- onClick: () => Ke(
835
- a,
836
- o
837
- ),
838
- "data-testid": `manageeventconfiguration-table-row-${a}-condition-delete-${o}`
839
- }
840
- ),
841
- o === (e == null ? void 0 : e.conditions.length) - 1 && /* @__PURE__ */ t(
842
- $,
843
- {
844
- icon: Ie,
845
- onClick: () => J(e, a),
846
- className: "bg-[var(--color-gray3)] text-gray-600 rounded-full p-[10px] w-[14px] h-[14px] mx-1 cursor-pointer hover:bg-gray-300 hover:text-[var(--color-primary)] transition-all",
847
- "data-testid": `manageeventconfiguration-table-row-${a}-condition-add`
848
- }
849
- )
850
- ]
851
- }
852
- ),
853
- o < (e == null ? void 0 : e.conditions.length) - 1 && /* @__PURE__ */ t(G, { className: "w-full m-[10px_0px]" })
854
- ]
855
- },
856
- o + 1
857
- )
858
- ) : /* @__PURE__ */ r(
859
- "div",
860
- {
861
- className: "flex flex-row items-center justify-between w-full mt-2 sm:mt-0 text-[14px]",
862
- children: [
863
- /* @__PURE__ */ t("span", { className: "mr-3 flex-1", children: l("No Condition Added") }),
864
- /* @__PURE__ */ t("div", { className: "flex items-center gap-3", children: /* @__PURE__ */ t(
865
- $,
866
- {
867
- icon: Ie,
868
- onClick: () => J(e, a),
869
- className: "bg-gray-200 text-gray-600 rounded-full p-2 w-[16px] h-[16px] cursor-pointer hover:bg-gray-300 hover:text-[var(--color-primary)] transition-all",
870
- "data-testid": `manageeventconfiguration-table-row-${a}-condition-add-empty`
871
- }
872
- ) })
873
- ]
874
- }
875
- )
876
- }
877
- )
878
- }
879
- ),
880
- /* @__PURE__ */ t(
881
- O,
882
- {
883
- className: "border border-gray-300 align-top",
884
- "data-testid": `manageeventconfiguration-table-row-${a}-action`,
885
- children: /* @__PURE__ */ t(
886
- "div",
887
- {
888
- style: {
889
- display: "flex",
890
- flexDirection: "column",
891
- alignItems: "flex-start"
892
- },
893
- children: /* @__PURE__ */ t(
894
- W,
895
- {
896
- onClick: () => {
897
- Ve(a);
898
- const n = `notificationConfigDetails.${a}.query`;
899
- K(n);
900
- },
901
- size: "small",
902
- "aria-label": "delete",
903
- "data-testid": `manageeventconfiguration-table-row-${a}-action-delete`,
904
- children: /* @__PURE__ */ t(
905
- $,
906
- {
907
- icon: xe,
908
- className: "text-[19px] text-[var(--color-error)]"
909
- }
910
- )
911
- }
912
- )
913
- }
914
- )
915
- }
916
- )
917
- ]
918
- },
919
- a + 1
920
- );
921
- }) })
922
- ] })
923
- }
924
- ) }) })
925
- ] }),
926
- /* @__PURE__ */ t(G, { className: "m-[8px_0px]" }),
927
- /* @__PURE__ */ r(
928
- Nt,
929
- {
930
- className: "flex flex-col sm:flex-row justify-end gap-2",
931
- "data-testid": "manageeventconfiguration-cardactions",
932
- children: [
933
- /* @__PURE__ */ t(
934
- W,
935
- {
936
- variant: "contained",
937
- color: "secondary",
938
- type: "button",
939
- size: "small",
940
- className: "w-full sm:w-auto",
941
- onClick: () => {
942
- Q("button_click", {
943
- button_name: "manageeventconfiguration-back-button",
944
- button_type: "cancel",
945
- button_id: "manageeventconfiguration-back-button"
946
- }), te("/ui/medplat/notification/all");
947
- },
948
- "data-testid": "manageeventconfiguration-back-button",
949
- children: l("Cancel")
950
- }
951
- ),
952
- /* @__PURE__ */ t(
953
- W,
954
- {
955
- size: "small",
956
- variant: "contained",
957
- type: "submit",
958
- color: "primary",
959
- className: "w-full sm:w-auto m-0",
960
- "data-testid": "manageeventconfiguration-save-button",
961
- children: l(`${A ? "Update" : "Save"}`)
962
- }
963
- )
964
- ]
965
- }
966
- )
967
- ]
968
- }
969
- ) }),
970
- /* @__PURE__ */ t(we, { children: /* @__PURE__ */ t(
971
- Rt,
972
- {
973
- selectedConfig: H,
974
- notificationtypeMap: ne,
975
- selectedCondition: Ae,
976
- newCondition: D,
977
- handleTypeConfigurationDelete: Xe,
978
- handleTypeConfigurationEdit: Ze,
979
- addTypeConfig: he,
980
- setNewConditionData: tt,
981
- typeConfigurationData: k,
982
- setNewTypeData: at,
983
- overlayOpen: oe,
984
- handleOverlayState: ue,
985
- "data-testid": "manageeventconfiguration-conditionconfig"
986
- }
987
- ) }),
988
- /* @__PURE__ */ t(we, { children: (R == null ? void 0 : R.type) === "MOBILE" ? /* @__PURE__ */ t(
989
- qt,
990
- {
991
- type: R,
992
- open: de,
993
- notificationtypeMap: ne,
994
- handleClick: pe,
995
- handleClose: () => {
996
- j((e) => !e), q({});
997
- },
998
- "data-testid": "manageeventconfiguration-mobiletypeeventconfigmodal"
999
- }
1000
- ) : /* @__PURE__ */ t(
1001
- St,
1002
- {
1003
- type: R,
1004
- open: de,
1005
- handleClick: pe,
1006
- handleClose: () => {
1007
- j((e) => !e), q({});
1008
- },
1009
- "data-testid": "manageeventconfiguration-othertypeeventconfigmodal"
1010
- }
1011
- ) })
1012
- ] });
1013
- }
1014
- export {
1015
- Qt as default
1016
- };
1017
- //# sourceMappingURL=ManageEventConfiguration-BpSJszSX.js.map