@argusoft/medplat-core 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (113) hide show
  1. package/dist/AccessRights-sgIhYR30.js +1238 -0
  2. package/dist/AccessRights-sgIhYR30.js.map +1 -0
  3. package/dist/AddEditQueryBuilder-BaZxS2Cm.js +289 -0
  4. package/dist/AddEditQueryBuilder-BaZxS2Cm.js.map +1 -0
  5. package/dist/AddEditQueryBuilder.css +1 -0
  6. package/dist/AddFeatures-BxXCC6ex.js +212 -0
  7. package/dist/AddFeatures-BxXCC6ex.js.map +1 -0
  8. package/dist/AddLabelModal-DE3ploGD.js +734 -0
  9. package/dist/AddLabelModal-DE3ploGD.js.map +1 -0
  10. package/dist/AddMenuConfiguration-QWfpcnuP.js +2237 -0
  11. package/dist/AddMenuConfiguration-QWfpcnuP.js.map +1 -0
  12. package/dist/AddMenuConfiguration.css +1 -0
  13. package/dist/AddRoleDrawer-ZK1eejxI.js +453 -0
  14. package/dist/AddRoleDrawer-ZK1eejxI.js.map +1 -0
  15. package/dist/AppModal-BgZyfrd-.js +428 -0
  16. package/dist/AppModal-BgZyfrd-.js.map +1 -0
  17. package/dist/ChangePasswordModal-MV7g8tkA.js +176 -0
  18. package/dist/ChangePasswordModal-MV7g8tkA.js.map +1 -0
  19. package/dist/ConditionConfig-BqWe0NKO.js +395 -0
  20. package/dist/ConditionConfig-BqWe0NKO.js.map +1 -0
  21. package/dist/ConditionConfig.css +1 -0
  22. package/dist/EntityManagement-D-x6Qzal.js +50 -0
  23. package/dist/EntityManagement-D-x6Qzal.js.map +1 -0
  24. package/dist/EventConfigurations-jGCJ4LqP.js +384 -0
  25. package/dist/EventConfigurations-jGCJ4LqP.js.map +1 -0
  26. package/dist/EventConfigurations.css +1 -0
  27. package/dist/EventsExceptionModal-BF6E1Np7.js +200 -0
  28. package/dist/EventsExceptionModal-BF6E1Np7.js.map +1 -0
  29. package/dist/EventsSkeleton-BN7_0IGs.js +74 -0
  30. package/dist/EventsSkeleton-BN7_0IGs.js.map +1 -0
  31. package/dist/FeatureMenu-BYSRoNm0.js +249 -0
  32. package/dist/FeatureMenu-BYSRoNm0.js.map +1 -0
  33. package/dist/Features-CKMmuqcs.js +11 -0
  34. package/dist/Features-CKMmuqcs.js.map +1 -0
  35. package/dist/FlywayQuery-Cx2sly6g.js +169 -0
  36. package/dist/FlywayQuery-Cx2sly6g.js.map +1 -0
  37. package/dist/ImmunizationConfigurationBase-CdCgDaAl.js +5299 -0
  38. package/dist/ImmunizationConfigurationBase-CdCgDaAl.js.map +1 -0
  39. package/dist/ImmunizationConfigurationBase.css +1 -0
  40. package/dist/ImmunizationConfigurationsList-CQnxWa09.js +335 -0
  41. package/dist/ImmunizationConfigurationsList-CQnxWa09.js.map +1 -0
  42. package/dist/ImmunizationSkeleton-D2tdv5k-.js +186 -0
  43. package/dist/ImmunizationSkeleton-D2tdv5k-.js.map +1 -0
  44. package/dist/LanguagesModal-rk6IGQwY.js +394 -0
  45. package/dist/LanguagesModal-rk6IGQwY.js.map +1 -0
  46. package/dist/ManageDynamicFeature-CeeqiS3K.js +4189 -0
  47. package/dist/ManageDynamicFeature-CeeqiS3K.js.map +1 -0
  48. package/dist/ManageEventConfiguration-BRXh51fc.js +1017 -0
  49. package/dist/ManageEventConfiguration-BRXh51fc.js.map +1 -0
  50. package/dist/ManageEventConfiguration.css +1 -0
  51. package/dist/ManageNotification-B4prX-9Z.js +6819 -0
  52. package/dist/ManageNotification-B4prX-9Z.js.map +1 -0
  53. package/dist/ManageRole-ByqBmjuc.js +699 -0
  54. package/dist/ManageRole-ByqBmjuc.js.map +1 -0
  55. package/dist/ManageTranslation-BTxvSYKb.js +616 -0
  56. package/dist/ManageTranslation-BTxvSYKb.js.map +1 -0
  57. package/dist/ManageTranslation.css +1 -0
  58. package/dist/ManageUser-PHiTNyF8.js +2160 -0
  59. package/dist/ManageUser-PHiTNyF8.js.map +1 -0
  60. package/dist/ManageUser.css +1 -0
  61. package/dist/MobileMenuManagement-DmQU5TTo.js +108 -0
  62. package/dist/MobileMenuManagement-DmQU5TTo.js.map +1 -0
  63. package/dist/MobileTypeEventConfigModal-BCp-SF4-.js +783 -0
  64. package/dist/MobileTypeEventConfigModal-BCp-SF4-.js.map +1 -0
  65. package/dist/NewServerManagement-5YcAtF-g.js +1002 -0
  66. package/dist/NewServerManagement-5YcAtF-g.js.map +1 -0
  67. package/dist/NotificationFlywayQuery-BY8Zzml_.js +244 -0
  68. package/dist/NotificationFlywayQuery-BY8Zzml_.js.map +1 -0
  69. package/dist/NotificationList-BkpOrCpM.js +400 -0
  70. package/dist/NotificationList-BkpOrCpM.js.map +1 -0
  71. package/dist/OtherTypeEventConfigModal-DPB8IYzj.js +2001 -0
  72. package/dist/OtherTypeEventConfigModal-DPB8IYzj.js.map +1 -0
  73. package/dist/QueryBuilder-Cus_mRwZ.js +378 -0
  74. package/dist/QueryBuilder-Cus_mRwZ.js.map +1 -0
  75. package/dist/QueryBuilder.css +1 -0
  76. package/dist/QueryManagement-DXA73N2j.js +671 -0
  77. package/dist/QueryManagement-DXA73N2j.js.map +1 -0
  78. package/dist/QueryManagement.css +1 -0
  79. package/dist/RoleManagement-CLaEJ90J.js +410 -0
  80. package/dist/RoleManagement-CLaEJ90J.js.map +1 -0
  81. package/dist/ServerSyncModal-uNjGCQJz.js +869 -0
  82. package/dist/ServerSyncModal-uNjGCQJz.js.map +1 -0
  83. package/dist/ShowFlywayQuery-DMsAbtOW.js +130 -0
  84. package/dist/ShowFlywayQuery-DMsAbtOW.js.map +1 -0
  85. package/dist/ShowFlywayQuery-DVRCd384.js +259 -0
  86. package/dist/ShowFlywayQuery-DVRCd384.js.map +1 -0
  87. package/dist/ShowQueryHistory-BDN0tzHg.js +190 -0
  88. package/dist/ShowQueryHistory-BDN0tzHg.js.map +1 -0
  89. package/dist/SubMenu-BHcSNSUF.js +187 -0
  90. package/dist/SubMenu-BHcSNSUF.js.map +1 -0
  91. package/dist/TableDetails-DzREeJkm.js +1508 -0
  92. package/dist/TableDetails-DzREeJkm.js.map +1 -0
  93. package/dist/TableList-B9hr05Hs.js +428 -0
  94. package/dist/TableList-B9hr05Hs.js.map +1 -0
  95. package/dist/TypeConfiguration-BYM8PjV9.js +117 -0
  96. package/dist/TypeConfiguration-BYM8PjV9.js.map +1 -0
  97. package/dist/UserList-BxB1tCwM.js +13042 -0
  98. package/dist/UserList-BxB1tCwM.js.map +1 -0
  99. package/dist/UserList.css +1 -0
  100. package/dist/UserListSkeleton-cglK2SaU.js +184 -0
  101. package/dist/UserListSkeleton-cglK2SaU.js.map +1 -0
  102. package/dist/WidgetList-BSApErov.js +188 -0
  103. package/dist/WidgetList-BSApErov.js.map +1 -0
  104. package/dist/_commonjsHelpers-BItOPCY9.js +29 -0
  105. package/dist/_commonjsHelpers-BItOPCY9.js.map +1 -0
  106. package/dist/i18next-CTOWN_jH.js +1394 -0
  107. package/dist/i18next-CTOWN_jH.js.map +1 -0
  108. package/dist/index.js +481 -0
  109. package/dist/index.js.map +1 -0
  110. package/dist/manageImmunization-B4swS745.js +1204 -0
  111. package/dist/manageImmunization-B4swS745.js.map +1 -0
  112. package/dist/manageImmunization.css +1 -0
  113. package/package.json +79 -0
@@ -0,0 +1,734 @@
1
+ import { jsx as r, jsxs as m, Fragment as Z } from "react/jsx-runtime";
2
+ import { useRef as oe, useState as z, useCallback as je, useMemo as qe, useEffect as ie } from "react";
3
+ import f from "prop-types";
4
+ import { useForm as ze } from "react-hook-form";
5
+ import { yupResolver as Ie } from "@hookform/resolvers/yup";
6
+ import b from "@mui/material/Grid2";
7
+ import * as x from "yup";
8
+ import { Modal as Oe, Typography as Re, IconButton as Be, FormControl as I, Box as w, Button as ue } from "@mui/material";
9
+ import U from "@/views/custom-components/CustomTextField";
10
+ import { showToast as E } from "@/common/toaster/toaster";
11
+ import { t as Me, e as Pe, f as F, h as Ke, i as Ge } from "./ManageTranslation-BTxvSYKb.js";
12
+ import { executeQuery as me, execute as W } from "@/common/services/GlobalApis";
13
+ import Le from "@/views/custom-components/CustomAutoComplete";
14
+ import Qe from "@/hooks/useTrackEvent";
15
+ import { useTranslateProvider as Ue } from "@/common/languageTranslator/TranslationContext";
16
+ import We from "@mui/material/Tabs";
17
+ import Xe from "@mui/material/Tab";
18
+ import { faXmark as He } from "@fortawesome/free-solid-svg-icons";
19
+ import { FontAwesomeIcon as Je } from "@fortawesome/react-fontawesome";
20
+ import Ye from "@/views/custom-components/CustomDropdown";
21
+ function de(V) {
22
+ const { children: X, value: M, index: N, selectedTab: y, ...u } = V;
23
+ return /* @__PURE__ */ r(
24
+ "div",
25
+ {
26
+ role: "tabpanel",
27
+ hidden: M !== y,
28
+ id: `simple-tabpanel-${N}`,
29
+ "aria-labelledby": `simple-tab-${N}`,
30
+ ...u,
31
+ children: M === y && /* @__PURE__ */ r(w, { className: "p-3", children: X })
32
+ }
33
+ );
34
+ }
35
+ de.propTypes = {
36
+ selectedTab: f.any,
37
+ children: f.node,
38
+ index: f.number.isRequired,
39
+ value: f.number.isRequired
40
+ };
41
+ function Ze(V) {
42
+ return {
43
+ id: `simple-tab-${V}`,
44
+ "aria-controls": `simple-tabpanel-${V}`
45
+ };
46
+ }
47
+ const Fe = ({
48
+ open: V,
49
+ handleClose: X,
50
+ apps: M,
51
+ languageList: N = [],
52
+ addAppFlag: y = !1,
53
+ fieldsData: u,
54
+ refetch: P,
55
+ addNameSpaceFlag: S = !1,
56
+ editLabelFlag: _ = !1,
57
+ labelKey: D = null,
58
+ isLoading: he = !1
59
+ }) => {
60
+ var ae;
61
+ const K = (ae = N == null ? void 0 : N.find(
62
+ (e) => e.languageValue === "English"
63
+ )) == null ? void 0 : ae.id, ee = oe(null), O = oe(!1), H = Qe(), [A, te] = z([]), [g, se] = z([]), [pe, fe] = z([]), [R, be] = z([]), [J, re] = z(null), [ye, ve] = z([]), { translate: C } = Ue(), xe = (e, s) => {
64
+ re(s);
65
+ };
66
+ let B;
67
+ if (y) {
68
+ const e = u == null ? void 0 : u.reduce((s, t) => (s[`${t.languagevalue}`] = x.string().required(
69
+ `Enter value for ${t.languagevalue}`
70
+ ), s), {});
71
+ B = x.object().shape({
72
+ apps: x.array().min(1, "Select at least one App").required("Select App"),
73
+ ...e
74
+ // Spread the dynamically created validations
75
+ });
76
+ } else if (S)
77
+ B = x.object().shape({
78
+ namespace: x.array().min(1, "Select at least one Namespace").required("Select Namespace")
79
+ });
80
+ else if (_) {
81
+ let e = R.reduce((s, t) => ((t == null ? void 0 : t.languagevalue) !== "English" && (t == null ? void 0 : t.appvalue) === J && (s[`${t.app}_${t.languagevalue}`] = x.string().required(`Enter value for ${t.languagevalue}`).test(
82
+ "placeholders-match",
83
+ "Placeholders do not match the original English text.",
84
+ function(l) {
85
+ const { path: n, createError: a, parent: p } = this, o = (p == null ? void 0 : p[`${t.app}_English`]) || "", c = L(o), d = L(l);
86
+ return Object.keys(c).length === Object.keys(d).length && Object.keys(c).every(
87
+ (k) => d[k] === c[k]
88
+ ) || a({
89
+ path: n,
90
+ message: "Placeholders do not match the original English text."
91
+ });
92
+ }
93
+ )), s), {});
94
+ B = x.object().shape({
95
+ ...e
96
+ });
97
+ } else {
98
+ const e = N.reduce((s, t) => ((t == null ? void 0 : t.language_value) !== "English" && (s[t.language_value] = x.string().required(`Enter value for ${t.language_value}`).test(
99
+ "placeholders-match",
100
+ "Placeholders do not match the original English text.",
101
+ function(l) {
102
+ const { path: n, createError: a, parent: p } = this, o = (p == null ? void 0 : p.englishValue) || "", c = L(o), d = L(l);
103
+ return Object.keys(c).length === Object.keys(d).length && Object.keys(c).every(
104
+ (k) => d[k] === c[k]
105
+ ) || a({
106
+ path: n,
107
+ message: "Placeholders do not match the original English text."
108
+ });
109
+ }
110
+ )), s), {});
111
+ B = x.object().shape({
112
+ apps: x.array().min(1, "Select at least one App").required("Select App"),
113
+ namespace: x.array().min(1, "Select at least one Namespace").required("Select Namespace"),
114
+ englishValue: x.string().required("Enter Value for English"),
115
+ ...e
116
+ // Spread the dynamically created validations
117
+ });
118
+ }
119
+ const le = je(async (e) => {
120
+ try {
121
+ await Ve(e);
122
+ } catch (s) {
123
+ console.error(s);
124
+ }
125
+ }, []), Ne = (e, s) => {
126
+ let t;
127
+ return (...l) => {
128
+ t && clearTimeout(t), t = setTimeout(() => {
129
+ e(...l);
130
+ }, s);
131
+ };
132
+ }, ge = qe(
133
+ () => Ne(le, 300),
134
+ [le]
135
+ ), {
136
+ control: $,
137
+ handleSubmit: _e,
138
+ reset: ke,
139
+ setValue: G,
140
+ getValues: ne,
141
+ formState: { errors: j }
142
+ } = ze({
143
+ defaultValues: {},
144
+ resolver: Ie(B),
145
+ mode: "onChange"
146
+ }), L = (e) => {
147
+ if (!e) return {};
148
+ const s = [...e.matchAll(/{(.*?)}/g)], t = {};
149
+ return s.forEach((l) => {
150
+ const n = l[1];
151
+ t[n] = (t[n] || 0) + 1;
152
+ }), t;
153
+ };
154
+ ie(() => {
155
+ if (Ce(), u && y) {
156
+ let e = [];
157
+ u == null || u.forEach((s) => {
158
+ G(s == null ? void 0 : s.languagevalue, s == null ? void 0 : s.value), e.push({ id: s == null ? void 0 : s.language, value: s == null ? void 0 : s.value });
159
+ }), se(e), Se();
160
+ }
161
+ u && S && we(u.key);
162
+ }, [u]), ie(() => {
163
+ _ && Ee();
164
+ }, [_]);
165
+ const Ee = async () => {
166
+ var e, s, t, l;
167
+ try {
168
+ const a = await me({
169
+ code: "labels_selected_apps_for_editing",
170
+ parameters: { key: D }
171
+ });
172
+ be((e = a == null ? void 0 : a.data) == null ? void 0 : e.result);
173
+ let p = (t = (s = a == null ? void 0 : a.data) == null ? void 0 : s.result) == null ? void 0 : t.map((o) => o.appvalue).filter((o, c, d) => c === d.findIndex((v) => v === o));
174
+ (l = a == null ? void 0 : a.data) == null || l.result.forEach((o) => {
175
+ const c = `${o.app}_${o.languagevalue}`;
176
+ G(c, o.value || "");
177
+ }), te(p), re(p[0]);
178
+ } catch (n) {
179
+ console.error(n), E({ message: "Error in editing label", type: "error" });
180
+ }
181
+ }, Y = (e, s, t = null) => {
182
+ let l = [...g], n = !1;
183
+ l == null || l.forEach((a) => {
184
+ (a == null ? void 0 : a.id) === e && (a.value = s, n = !0);
185
+ }), n || (t ? l.push({ id: e, value: s, labelid: t }) : l.push({ id: e, value: s })), se(l);
186
+ }, we = async (e) => {
187
+ var s, t;
188
+ try {
189
+ const l = await W({
190
+ code: "get_namespaces_from_key",
191
+ parameters: { key: e }
192
+ });
193
+ let n = (t = (s = l == null ? void 0 : l.data) == null ? void 0 : s.result) == null ? void 0 : t.map((a) => a.value);
194
+ G("namespace", n || []);
195
+ } catch (l) {
196
+ console.error(l);
197
+ }
198
+ }, Ce = async () => {
199
+ var e;
200
+ try {
201
+ const s = await W({
202
+ code: "get_distinct_namespce",
203
+ parameters: {}
204
+ });
205
+ ve((e = s == null ? void 0 : s.data) == null ? void 0 : e.result);
206
+ } catch (s) {
207
+ console.error(s);
208
+ }
209
+ }, Se = async () => {
210
+ var e, s, t;
211
+ try {
212
+ let n = {
213
+ code: "labels_selected_apps_for_editing",
214
+ parameters: { key: (e = u[0]) == null ? void 0 : e.key.replace(/'/g, "''") }
215
+ };
216
+ const a = await me(n);
217
+ let p = (t = (s = a == null ? void 0 : a.data) == null ? void 0 : s.result) == null ? void 0 : t.map((o) => o.appvalue).filter((o, c, d) => c === d.findIndex((v) => v === o)).join(", ");
218
+ te(p);
219
+ } catch (l) {
220
+ console.error(l), E({ message: "Error in Adding App", type: "error" });
221
+ }
222
+ }, Ae = (e, s) => {
223
+ fe(s), G("apps", s);
224
+ }, Te = (e) => (e == null ? void 0 : e.appValue) || "", T = () => {
225
+ H("conversion_event", {
226
+ form: ee.current,
227
+ form_name: "Add Label Configuration",
228
+ submit: O.current
229
+ }), X();
230
+ }, Ve = async (e) => {
231
+ var s;
232
+ try {
233
+ let t;
234
+ if ((e == null ? void 0 : e.id) === K) {
235
+ let l;
236
+ y ? (t = g.filter((n) => n.id !== K).map((n) => n.id).join(","), g == null || g.forEach((n) => {
237
+ (n == null ? void 0 : n.id) === K && (l = n == null ? void 0 : n.value);
238
+ })) : (t = N.filter((n) => n.languageKey !== "en").map((n) => n.id).join(","), l = (s = ne()) == null ? void 0 : s.englishValue), l ? await Me(t, l) : E({ message: "Enter english text", type: "info" });
239
+ }
240
+ } catch (t) {
241
+ console.error(t), E({ message: "Error in Translation", type: "error" });
242
+ }
243
+ }, $e = async (e) => {
244
+ var s, t, l, n, a, p;
245
+ try {
246
+ H("button_click", {
247
+ button_name: "add-label-add-button",
248
+ button_type: "submit",
249
+ button_id: "add-label-submit-button"
250
+ });
251
+ let o = [];
252
+ if (y)
253
+ (s = e == null ? void 0 : e.apps) == null || s.forEach((c) => {
254
+ g == null || g.forEach((d) => {
255
+ o.push({
256
+ language: d == null ? void 0 : d.id,
257
+ value: d == null ? void 0 : d.value,
258
+ app: c == null ? void 0 : c.id,
259
+ isActive: !0,
260
+ key: u[0].key
261
+ });
262
+ });
263
+ }), await F(o), O.current = !0, P(), E({ message: "App Added Successfully", type: "success" }), T();
264
+ else if (S) {
265
+ let c = (e == null ? void 0 : e.namespace) || [];
266
+ await Ke({
267
+ key: u.key,
268
+ namespace: c
269
+ }), O.current = !0, P(), E({
270
+ message: "NameSpace Updated Successfully",
271
+ type: "success"
272
+ }), T();
273
+ } else if (_) {
274
+ const c = ne(), d = Object.entries(c).reduce(
275
+ (v, [k, i]) => {
276
+ const [h, q] = k.split("_");
277
+ if (i === "") return v;
278
+ const Q = R.find(
279
+ (ce) => ce.app === parseInt(h) && ce.languagevalue === q
280
+ );
281
+ return Q && Q.value !== i && v.push({
282
+ id: Q.id || null,
283
+ language: Q.language || q,
284
+ value: i,
285
+ app: parseInt(h),
286
+ isActive: !0,
287
+ key: D
288
+ }), v;
289
+ },
290
+ []
291
+ );
292
+ await F(d), O.current = !0, P(), E({ message: "Label Updated Successfully", type: "success" }), T();
293
+ } else {
294
+ const c = e.englishValue.replace(/ /g, "");
295
+ (t = e == null ? void 0 : e.apps) == null || t.forEach((i) => {
296
+ o.push({
297
+ language: K,
298
+ value: e == null ? void 0 : e.englishValue,
299
+ app: i == null ? void 0 : i.id,
300
+ isActive: !0,
301
+ key: c
302
+ }), g == null || g.forEach((h) => {
303
+ o.push({
304
+ language: h == null ? void 0 : h.id,
305
+ value: h == null ? void 0 : h.value,
306
+ app: i == null ? void 0 : i.id,
307
+ isActive: !0,
308
+ key: c
309
+ });
310
+ });
311
+ });
312
+ let d = (e == null ? void 0 : e.namespace) || [], v = [];
313
+ for (const i of d)
314
+ try {
315
+ const h = await W({
316
+ code: "check_key_namespace_exist",
317
+ parameters: {
318
+ key: c,
319
+ namespace: i
320
+ }
321
+ });
322
+ ((n = (l = h == null ? void 0 : h.data) == null ? void 0 : l.result) == null ? void 0 : n.length) === 0 && v.push(i);
323
+ } catch (h) {
324
+ console.error("Error while checking namespace:", i, h);
325
+ }
326
+ await Ge({
327
+ key: c,
328
+ namespace: v
329
+ });
330
+ let k = !1;
331
+ for (const i of o) {
332
+ let h = {
333
+ code: "translation_label_app_language_key_check",
334
+ parameters: {
335
+ key: i == null ? void 0 : i.key,
336
+ language: i == null ? void 0 : i.language,
337
+ app: i == null ? void 0 : i.app
338
+ }
339
+ };
340
+ const q = await W(h);
341
+ if (((p = (a = q == null ? void 0 : q.data) == null ? void 0 : a.result) == null ? void 0 : p.length) > 0) {
342
+ E({
343
+ message: "The Label containing Same App, Language and Key Already Exists.",
344
+ type: "error"
345
+ }), k = !0;
346
+ break;
347
+ }
348
+ }
349
+ !k && o.length > 0 && (await F(o), O.current = !0, P(), E({
350
+ message: "Label Added Successfully",
351
+ type: "success"
352
+ }), T());
353
+ }
354
+ } catch (o) {
355
+ console.error(o), E({ message: "Error in Adding Label", type: "error" });
356
+ }
357
+ };
358
+ return /* @__PURE__ */ r(
359
+ Oe,
360
+ {
361
+ "data-testid": "add-label-modal",
362
+ open: V,
363
+ onClose: () => {
364
+ T(), ke();
365
+ },
366
+ className: "translation-modal",
367
+ children: /* @__PURE__ */ r(Pe, { isLoading: he, children: /* @__PURE__ */ m(
368
+ b,
369
+ {
370
+ container: !0,
371
+ sx: {
372
+ display: "flex",
373
+ flexDirection: "column",
374
+ position: "absolute",
375
+ top: 40,
376
+ left: "50%",
377
+ transform: "translateX(-50%)",
378
+ width: "95%",
379
+ maxWidth: { sm: 600, md: 700, lg: 800 },
380
+ bgcolor: "background.paper",
381
+ boxShadow: 24,
382
+ border: 1,
383
+ borderColor: "divider",
384
+ borderRadius: 0.5
385
+ },
386
+ children: [
387
+ /* @__PURE__ */ m(
388
+ b,
389
+ {
390
+ sx: {
391
+ p: 1.25,
392
+ px: 3,
393
+ display: "flex",
394
+ justifyContent: "space-between",
395
+ borderBottom: 1,
396
+ borderColor: "divider"
397
+ },
398
+ "data-testid": "add-label-header",
399
+ children: [
400
+ /* @__PURE__ */ m(
401
+ Re,
402
+ {
403
+ variant: "body1",
404
+ className: "text-customBlue",
405
+ sx: { fontWeight: "medium", fontSize: "1.125rem" },
406
+ children: [
407
+ !y && !S && !_ && C("Add Label"),
408
+ S && C("Add NameSpace"),
409
+ y && C("Add App"),
410
+ _ && C("Edit Label")
411
+ ]
412
+ }
413
+ ),
414
+ /* @__PURE__ */ r(
415
+ Be,
416
+ {
417
+ size: "small",
418
+ onClick: () => {
419
+ T();
420
+ },
421
+ "data-testid": "add-label-close-button",
422
+ children: /* @__PURE__ */ r(Je, { icon: He })
423
+ }
424
+ )
425
+ ]
426
+ }
427
+ ),
428
+ /* @__PURE__ */ r(b, { item: "true", className: "overflow-y-auto max-h-[60vh]", children: /* @__PURE__ */ m(
429
+ b,
430
+ {
431
+ container: !0,
432
+ justifyContent: "flex-start",
433
+ className: "p-3 pl-5 pr-7",
434
+ children: [
435
+ S && /* @__PURE__ */ m("div", { children: [
436
+ "Add Namespace for ",
437
+ u == null ? void 0 : u.key
438
+ ] }),
439
+ y && /* @__PURE__ */ m("div", { children: [
440
+ "Label already exists in ",
441
+ A
442
+ ] }),
443
+ /* @__PURE__ */ m(
444
+ "form",
445
+ {
446
+ onSubmit: _e($e),
447
+ className: "w-full",
448
+ ref: ee,
449
+ children: [
450
+ !S && !_ && /* @__PURE__ */ r(b, { item: "true", className: "pb-[5px]", children: /* @__PURE__ */ r(
451
+ I,
452
+ {
453
+ variant: "outlined",
454
+ className: "w-full",
455
+ "data-testid": "add-label-base-date-field",
456
+ children: /* @__PURE__ */ m(w, { className: "custom-flex-container", children: [
457
+ /* @__PURE__ */ m("div", { className: "w-[30%]", children: [
458
+ C("App"),
459
+ /* @__PURE__ */ r("span", { className: "text-red-500 ml-1", children: "*" })
460
+ ] }),
461
+ /* @__PURE__ */ r(
462
+ Le,
463
+ {
464
+ control: $,
465
+ name: "apps",
466
+ size: "small",
467
+ options: M || [],
468
+ errors: j,
469
+ value: pe,
470
+ onChange: Ae,
471
+ getOptionLabel: Te
472
+ }
473
+ )
474
+ ] })
475
+ }
476
+ ) }),
477
+ !y && !_ && /* @__PURE__ */ r(b, { item: "true", className: "pb-[5px]", children: /* @__PURE__ */ r(
478
+ I,
479
+ {
480
+ variant: "outlined",
481
+ className: "w-full",
482
+ "data-testid": "add-label-base-date-field",
483
+ children: /* @__PURE__ */ m(w, { className: "custom-flex-container", children: [
484
+ /* @__PURE__ */ m("div", { className: "w-[30%]", children: [
485
+ C("Namespace"),
486
+ /* @__PURE__ */ r("span", { className: "text-red-500 ml-1", children: "*" }),
487
+ /* @__PURE__ */ r("br", {}),
488
+ /* @__PURE__ */ r("div", { className: "text-sm text-gray-600 pr-3", children: "(Note: Add to General if no specific namespace)" })
489
+ ] }),
490
+ /* @__PURE__ */ r(
491
+ Ye,
492
+ {
493
+ control: $,
494
+ name: "namespace",
495
+ options: ye || [],
496
+ errors: j,
497
+ displayName: "label",
498
+ optionValue: "value",
499
+ multiple: !0
500
+ }
501
+ )
502
+ ] })
503
+ }
504
+ ) }),
505
+ !y && !S && !_ && /* @__PURE__ */ m(Z, { children: [
506
+ /* @__PURE__ */ r(b, { item: "true", className: "pb-[5px]", children: /* @__PURE__ */ r(
507
+ I,
508
+ {
509
+ variant: "outlined",
510
+ className: "w-full",
511
+ "data-testid": "add-label-field",
512
+ children: /* @__PURE__ */ m(
513
+ w,
514
+ {
515
+ className: "custom-flex-container",
516
+ display: "flex",
517
+ children: [
518
+ /* @__PURE__ */ m("div", { className: "w-[30%]", children: [
519
+ C("English"),
520
+ /* @__PURE__ */ r("span", { className: "text-red-500 ml-1", children: "*" })
521
+ ] }),
522
+ /* @__PURE__ */ r(
523
+ U,
524
+ {
525
+ control: $,
526
+ id: "englishValue",
527
+ name: "englishValue",
528
+ errors: j,
529
+ label: "",
530
+ size: "small",
531
+ className: "w-full",
532
+ "data-testid": "add-label-language-english"
533
+ }
534
+ )
535
+ ]
536
+ }
537
+ )
538
+ }
539
+ ) }),
540
+ N == null ? void 0 : N.map((e, s) => {
541
+ if ((e == null ? void 0 : e.language_value) !== "English")
542
+ return /* @__PURE__ */ r(b, { item: "true", className: "pb-[5px]", children: /* @__PURE__ */ r(
543
+ I,
544
+ {
545
+ variant: "outlined",
546
+ className: "w-full",
547
+ "data-testid": "add-label-base-date-field",
548
+ children: /* @__PURE__ */ m(w, { className: "custom-flex-container", children: [
549
+ /* @__PURE__ */ m("div", { className: "w-[30%]", children: [
550
+ e == null ? void 0 : e.language_value,
551
+ /* @__PURE__ */ r("span", { className: "text-red-500 ml-1", children: "*" })
552
+ ] }),
553
+ /* @__PURE__ */ r(
554
+ U,
555
+ {
556
+ control: $,
557
+ id: e == null ? void 0 : e.language_value,
558
+ name: e == null ? void 0 : e.language_value,
559
+ errors: j,
560
+ onChange: (t) => {
561
+ var l;
562
+ Y(
563
+ e == null ? void 0 : e.id,
564
+ (l = t == null ? void 0 : t.target) == null ? void 0 : l.value
565
+ );
566
+ },
567
+ label: "",
568
+ size: "small",
569
+ className: "w-full",
570
+ "data-testid": "add-label-language"
571
+ }
572
+ )
573
+ ] })
574
+ }
575
+ ) }, s + 1);
576
+ })
577
+ ] }),
578
+ y && /* @__PURE__ */ r(Z, { children: u == null ? void 0 : u.map((e, s) => /* @__PURE__ */ r(b, { item: "true", className: "pb-[5px]", children: /* @__PURE__ */ r(
579
+ I,
580
+ {
581
+ variant: "outlined",
582
+ className: "w-full",
583
+ "data-testid": "add-label-base-date-field",
584
+ children: /* @__PURE__ */ m(w, { className: "custom-flex-container", children: [
585
+ /* @__PURE__ */ m("div", { className: "w-[30%]", children: [
586
+ e == null ? void 0 : e.languagevalue,
587
+ /* @__PURE__ */ r("span", { className: "text-red-500 ml-1", children: "*" })
588
+ ] }),
589
+ /* @__PURE__ */ r(
590
+ U,
591
+ {
592
+ control: $,
593
+ id: e == null ? void 0 : e.languagevalue,
594
+ name: e == null ? void 0 : e.languagevalue,
595
+ errors: j,
596
+ onChange: (t) => {
597
+ var l;
598
+ Y(
599
+ e == null ? void 0 : e.language,
600
+ (l = t == null ? void 0 : t.target) == null ? void 0 : l.value
601
+ ), ge({ id: e == null ? void 0 : e.language });
602
+ },
603
+ label: "",
604
+ size: "small",
605
+ className: "w-full",
606
+ "data-testid": "add-label-language"
607
+ }
608
+ )
609
+ ] })
610
+ }
611
+ ) }, s + 1)) }),
612
+ _ && /* @__PURE__ */ m(Z, { children: [
613
+ " ",
614
+ /* @__PURE__ */ r(b, { item: !0, className: "pb-[5px]", children: /* @__PURE__ */ r(w, { className: "w-full", children: /* @__PURE__ */ r(w, { className: "label-edit-tabs", children: /* @__PURE__ */ r(
615
+ We,
616
+ {
617
+ value: J,
618
+ onChange: xe,
619
+ "aria-label": "basic tabs example",
620
+ children: A == null ? void 0 : A.map((e, s) => /* @__PURE__ */ r(
621
+ Xe,
622
+ {
623
+ label: e,
624
+ value: e,
625
+ ...Ze(s)
626
+ },
627
+ s + 1
628
+ ))
629
+ }
630
+ ) }) }) }),
631
+ A == null ? void 0 : A.map((e, s) => /* @__PURE__ */ r(b, { item: !0, children: /* @__PURE__ */ r(b, { children: /* @__PURE__ */ r(
632
+ de,
633
+ {
634
+ value: e,
635
+ selectedTab: J,
636
+ index: s,
637
+ children: R == null ? void 0 : R.map((t, l) => {
638
+ if ((t == null ? void 0 : t.appvalue) === e)
639
+ return /* @__PURE__ */ r(b, { item: !0, className: "pb-[5px]", children: /* @__PURE__ */ r(
640
+ I,
641
+ {
642
+ variant: "outlined",
643
+ className: "w-full",
644
+ "data-testid": "label-edit-field",
645
+ children: /* @__PURE__ */ m(w, { className: "custom-flex-container", children: [
646
+ /* @__PURE__ */ r("div", { className: "w-[30%]", children: t == null ? void 0 : t.languagevalue }),
647
+ /* @__PURE__ */ r(
648
+ U,
649
+ {
650
+ control: $,
651
+ id: `${t == null ? void 0 : t.app}-${t.languagevalue}`,
652
+ name: `${t == null ? void 0 : t.app}_${t.languagevalue}`,
653
+ errors: j,
654
+ onChange: (n) => {
655
+ var a;
656
+ return Y(
657
+ t == null ? void 0 : t.language,
658
+ (a = n == null ? void 0 : n.target) == null ? void 0 : a.value,
659
+ t == null ? void 0 : t.id
660
+ );
661
+ },
662
+ label: "",
663
+ size: "small",
664
+ className: "w-full",
665
+ "data-testid": "label-edit-input"
666
+ }
667
+ )
668
+ ] })
669
+ }
670
+ ) }, l + 1);
671
+ })
672
+ },
673
+ s + 1
674
+ ) }) }, s + 1))
675
+ ] }),
676
+ /* @__PURE__ */ r(b, { item: "true", className: "pb-[5px] flex justify-end", children: /* @__PURE__ */ m(w, { className: "custom-flex-button", children: [
677
+ /* @__PURE__ */ r(
678
+ ue,
679
+ {
680
+ size: "small",
681
+ variant: "contained",
682
+ "data-testid": "add-label-back-button",
683
+ color: "secondary",
684
+ onClick: () => {
685
+ T(), H("button_click", {
686
+ button_name: "add-label-back-button",
687
+ button_type: "cancel",
688
+ button_id: "add-label-back-button"
689
+ });
690
+ },
691
+ children: C("Cancel")
692
+ }
693
+ ),
694
+ /* @__PURE__ */ r(
695
+ ue,
696
+ {
697
+ type: "submit",
698
+ size: "small",
699
+ variant: "contained",
700
+ "data-testid": "add-label-save-button",
701
+ color: "primary",
702
+ children: C("Save")
703
+ }
704
+ )
705
+ ] }) })
706
+ ]
707
+ }
708
+ )
709
+ ]
710
+ }
711
+ ) })
712
+ ]
713
+ }
714
+ ) })
715
+ }
716
+ );
717
+ };
718
+ Fe.propTypes = {
719
+ open: f.any,
720
+ handleClose: f.any,
721
+ languageList: f.any,
722
+ apps: f.any,
723
+ addAppFlag: f.any,
724
+ fieldsData: f.any,
725
+ refetch: f.any,
726
+ addNameSpaceFlag: f.any,
727
+ editLabelFlag: f.any,
728
+ labelKey: f.any,
729
+ isLoading: f.any
730
+ };
731
+ export {
732
+ Fe as default
733
+ };
734
+ //# sourceMappingURL=AddLabelModal-DE3ploGD.js.map