@argusoft/medplat-form-engine 1.0.16 → 1.0.18

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 (26) hide show
  1. package/dist/{ChangePasswordModalCore-DIe4rzW--CSDVIGsb.js → ChangePasswordModalCore-DIe4rzW--DQDQmvUW.js} +2 -2
  2. package/dist/{ChangePasswordModalCore-DIe4rzW--CSDVIGsb.js.map → ChangePasswordModalCore-DIe4rzW--DQDQmvUW.js.map} +1 -1
  3. package/dist/{ImmunizationConfigurationBase-DZ8EqXlF-B2XcYTYJ.js → ImmunizationConfigurationBase-DZ8EqXlF-BfekzKQZ.js} +2 -2
  4. package/dist/{ImmunizationConfigurationBase-DZ8EqXlF-B2XcYTYJ.js.map → ImmunizationConfigurationBase-DZ8EqXlF-BfekzKQZ.js.map} +1 -1
  5. package/dist/{ManageUser-Dr3ptCYp-CJBp0yVr.js → ManageUser-Dr3ptCYp-De1JVFX3.js} +3 -3
  6. package/dist/{ManageUser-Dr3ptCYp-CJBp0yVr.js.map → ManageUser-Dr3ptCYp-De1JVFX3.js.map} +1 -1
  7. package/dist/{MedplatFormWrapper-SwW0rdxN.js → MedplatFormWrapper-BK_mO9Tr.js} +18592 -18095
  8. package/dist/MedplatFormWrapper-BK_mO9Tr.js.map +1 -0
  9. package/dist/{QueryManagement-DXA73N2j-De9XnBKC.js → QueryManagement-DXA73N2j-BqbDhrcA.js} +2 -2
  10. package/dist/{QueryManagement-DXA73N2j-De9XnBKC.js.map → QueryManagement-DXA73N2j-BqbDhrcA.js.map} +1 -1
  11. package/dist/{SecurityAuditLogList-DHTcOtbx-BSjPID73.js → SecurityAuditLogList-DHTcOtbx-BA7Fl1rg.js} +3 -3
  12. package/dist/{SecurityAuditLogList-DHTcOtbx-BSjPID73.js.map → SecurityAuditLogList-DHTcOtbx-BA7Fl1rg.js.map} +1 -1
  13. package/dist/{default-B6sHblIG.js → default-CxkdArbZ.js} +2 -2
  14. package/dist/{default-B6sHblIG.js.map → default-CxkdArbZ.js.map} +1 -1
  15. package/dist/index-B4r0wjBD.js.map +1 -1
  16. package/dist/{index-BFznsakV-BsOSEQZI.js → index-BFznsakV-DjxGrFui.js} +3 -3
  17. package/dist/{index-BFznsakV-BsOSEQZI.js.map → index-BFznsakV-DjxGrFui.js.map} +1 -1
  18. package/dist/index-BTA-0FqQ.js +744 -0
  19. package/dist/index-BTA-0FqQ.js.map +1 -0
  20. package/dist/index.js +6 -3
  21. package/package.json +1 -1
  22. package/dist/MedplatFormWrapper-SwW0rdxN.js.map +0 -1
  23. package/dist/dayjs.min-BiUMMz0V.js +0 -285
  24. package/dist/dayjs.min-BiUMMz0V.js.map +0 -1
  25. package/dist/index-DNrIMQFT.js +0 -567
  26. package/dist/index-DNrIMQFT.js.map +0 -1
@@ -0,0 +1,744 @@
1
+ import { jsx as ee } from "react/jsx-runtime";
2
+ import { lazy as ue, useMemo as ne, useCallback as te } from "react";
3
+ import { execute as oe } from "@/common/services/QueryBuilder";
4
+ import { showToast as pe } from "@/common/toaster/toaster";
5
+ import { useWatch as me } from "react-hook-form";
6
+ import './index.css';const se = ue(
7
+ () => import("@/views/feature-components/VerifyRoute.jsx")
8
+ ), ae = ue(
9
+ () => import("./MedplatFormWrapper-BK_mO9Tr.js").then((e) => e.M)
10
+ ), ke = [
11
+ {
12
+ path: "medplat/form/:formCode",
13
+ element: /* @__PURE__ */ ee(
14
+ se,
15
+ {
16
+ pageTitle: "General",
17
+ url: "medplat/form",
18
+ component: /* @__PURE__ */ ee(ae, {})
19
+ }
20
+ )
21
+ },
22
+ {
23
+ path: "medplat/form/:formCode/:menuConfigId",
24
+ element: /* @__PURE__ */ ee(se, { url: "medplat/form", component: /* @__PURE__ */ ee(ae, {}) })
25
+ }
26
+ ];
27
+ function ge(e) {
28
+ return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
29
+ }
30
+ function Re(e) {
31
+ if (Object.prototype.hasOwnProperty.call(e, "__esModule")) return e;
32
+ var r = e.default;
33
+ if (typeof r == "function") {
34
+ var a = function u() {
35
+ return this instanceof u ? Reflect.construct(r, arguments, this.constructor) : r.apply(this, arguments);
36
+ };
37
+ a.prototype = r.prototype;
38
+ } else a = {};
39
+ return Object.defineProperty(a, "__esModule", { value: !0 }), Object.keys(e).forEach(function(u) {
40
+ var l = Object.getOwnPropertyDescriptor(e, u);
41
+ Object.defineProperty(a, u, l.get ? l : {
42
+ enumerable: !0,
43
+ get: function() {
44
+ return e[u];
45
+ }
46
+ });
47
+ }), a;
48
+ }
49
+ var re = { exports: {} }, ye = re.exports, ie;
50
+ function _e() {
51
+ return ie || (ie = 1, (function(e, r) {
52
+ (function(a, u) {
53
+ e.exports = u();
54
+ })(ye, (function() {
55
+ var a = 1e3, u = 6e4, l = 36e5, p = "millisecond", g = "second", f = "minute", O = "hour", m = "day", L = "week", P = "month", U = "quarter", w = "year", E = "date", H = "Invalid Date", o = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, b = /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g, C = { name: "en", weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_"), ordinal: function(c) {
56
+ var n = ["th", "st", "nd", "rd"], t = c % 100;
57
+ return "[" + c + (n[(t - 20) % 10] || n[t] || n[0]) + "]";
58
+ } }, y = function(c, n, t) {
59
+ var i = String(c);
60
+ return !i || i.length >= n ? c : "" + Array(n + 1 - i.length).join(t) + c;
61
+ }, $ = { s: y, z: function(c) {
62
+ var n = -c.utcOffset(), t = Math.abs(n), i = Math.floor(t / 60), s = t % 60;
63
+ return (n <= 0 ? "+" : "-") + y(i, 2, "0") + ":" + y(s, 2, "0");
64
+ }, m: function c(n, t) {
65
+ if (n.date() < t.date()) return -c(t, n);
66
+ var i = 12 * (t.year() - n.year()) + (t.month() - n.month()), s = n.clone().add(i, P), d = t - s < 0, h = n.clone().add(i + (d ? -1 : 1), P);
67
+ return +(-(i + (t - s) / (d ? s - h : h - s)) || 0);
68
+ }, a: function(c) {
69
+ return c < 0 ? Math.ceil(c) || 0 : Math.floor(c);
70
+ }, p: function(c) {
71
+ return { M: P, y: w, w: L, d: m, D: E, h: O, m: f, s: g, ms: p, Q: U }[c] || String(c || "").toLowerCase().replace(/s$/, "");
72
+ }, u: function(c) {
73
+ return c === void 0;
74
+ } }, T = "en", M = {};
75
+ M[T] = C;
76
+ var j = "$isDayjsObject", W = function(c) {
77
+ return c instanceof N || !(!c || !c[j]);
78
+ }, k = function c(n, t, i) {
79
+ var s;
80
+ if (!n) return T;
81
+ if (typeof n == "string") {
82
+ var d = n.toLowerCase();
83
+ M[d] && (s = d), t && (M[d] = t, s = d);
84
+ var h = n.split("-");
85
+ if (!s && h.length > 1) return c(h[0]);
86
+ } else {
87
+ var A = n.name;
88
+ M[A] = n, s = A;
89
+ }
90
+ return !i && s && (T = s), s || !i && T;
91
+ }, S = function(c, n) {
92
+ if (W(c)) return c.clone();
93
+ var t = typeof n == "object" ? n : {};
94
+ return t.date = c, t.args = arguments, new N(t);
95
+ }, _ = $;
96
+ _.l = k, _.i = W, _.w = function(c, n) {
97
+ return S(c, { locale: n.$L, utc: n.$u, x: n.$x, $offset: n.$offset });
98
+ };
99
+ var N = (function() {
100
+ function c(t) {
101
+ this.$L = k(t.locale, null, !0), this.parse(t), this.$x = this.$x || t.x || {}, this[j] = !0;
102
+ }
103
+ var n = c.prototype;
104
+ return n.parse = function(t) {
105
+ this.$d = (function(i) {
106
+ var s = i.date, d = i.utc;
107
+ if (s === null) return /* @__PURE__ */ new Date(NaN);
108
+ if (_.u(s)) return /* @__PURE__ */ new Date();
109
+ if (s instanceof Date) return new Date(s);
110
+ if (typeof s == "string" && !/Z$/i.test(s)) {
111
+ var h = s.match(o);
112
+ if (h) {
113
+ var A = h[2] - 1 || 0, D = (h[7] || "0").substring(0, 3);
114
+ return d ? new Date(Date.UTC(h[1], A, h[3] || 1, h[4] || 0, h[5] || 0, h[6] || 0, D)) : new Date(h[1], A, h[3] || 1, h[4] || 0, h[5] || 0, h[6] || 0, D);
115
+ }
116
+ }
117
+ return new Date(s);
118
+ })(t), this.init();
119
+ }, n.init = function() {
120
+ var t = this.$d;
121
+ this.$y = t.getFullYear(), this.$M = t.getMonth(), this.$D = t.getDate(), this.$W = t.getDay(), this.$H = t.getHours(), this.$m = t.getMinutes(), this.$s = t.getSeconds(), this.$ms = t.getMilliseconds();
122
+ }, n.$utils = function() {
123
+ return _;
124
+ }, n.isValid = function() {
125
+ return this.$d.toString() !== H;
126
+ }, n.isSame = function(t, i) {
127
+ var s = S(t);
128
+ return this.startOf(i) <= s && s <= this.endOf(i);
129
+ }, n.isAfter = function(t, i) {
130
+ return S(t) < this.startOf(i);
131
+ }, n.isBefore = function(t, i) {
132
+ return this.endOf(i) < S(t);
133
+ }, n.$g = function(t, i, s) {
134
+ return _.u(t) ? this[i] : this.set(s, t);
135
+ }, n.unix = function() {
136
+ return Math.floor(this.valueOf() / 1e3);
137
+ }, n.valueOf = function() {
138
+ return this.$d.getTime();
139
+ }, n.startOf = function(t, i) {
140
+ var s = this, d = !!_.u(i) || i, h = _.p(t), A = function(J, F) {
141
+ var R = _.w(s.$u ? Date.UTC(s.$y, F, J) : new Date(s.$y, F, J), s);
142
+ return d ? R : R.endOf(m);
143
+ }, D = function(J, F) {
144
+ return _.w(s.toDate()[J].apply(s.toDate("s"), (d ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(F)), s);
145
+ }, I = this.$W, V = this.$M, Y = this.$D, z = "set" + (this.$u ? "UTC" : "");
146
+ switch (h) {
147
+ case w:
148
+ return d ? A(1, 0) : A(31, 11);
149
+ case P:
150
+ return d ? A(1, V) : A(0, V + 1);
151
+ case L:
152
+ var v = this.$locale().weekStart || 0, G = (I < v ? I + 7 : I) - v;
153
+ return A(d ? Y - G : Y + (6 - G), V);
154
+ case m:
155
+ case E:
156
+ return D(z + "Hours", 0);
157
+ case O:
158
+ return D(z + "Minutes", 1);
159
+ case f:
160
+ return D(z + "Seconds", 2);
161
+ case g:
162
+ return D(z + "Milliseconds", 3);
163
+ default:
164
+ return this.clone();
165
+ }
166
+ }, n.endOf = function(t) {
167
+ return this.startOf(t, !1);
168
+ }, n.$set = function(t, i) {
169
+ var s, d = _.p(t), h = "set" + (this.$u ? "UTC" : ""), A = (s = {}, s[m] = h + "Date", s[E] = h + "Date", s[P] = h + "Month", s[w] = h + "FullYear", s[O] = h + "Hours", s[f] = h + "Minutes", s[g] = h + "Seconds", s[p] = h + "Milliseconds", s)[d], D = d === m ? this.$D + (i - this.$W) : i;
170
+ if (d === P || d === w) {
171
+ var I = this.clone().set(E, 1);
172
+ I.$d[A](D), I.init(), this.$d = I.set(E, Math.min(this.$D, I.daysInMonth())).$d;
173
+ } else A && this.$d[A](D);
174
+ return this.init(), this;
175
+ }, n.set = function(t, i) {
176
+ return this.clone().$set(t, i);
177
+ }, n.get = function(t) {
178
+ return this[_.p(t)]();
179
+ }, n.add = function(t, i) {
180
+ var s, d = this;
181
+ t = Number(t);
182
+ var h = _.p(i), A = function(V) {
183
+ var Y = S(d);
184
+ return _.w(Y.date(Y.date() + Math.round(V * t)), d);
185
+ };
186
+ if (h === P) return this.set(P, this.$M + t);
187
+ if (h === w) return this.set(w, this.$y + t);
188
+ if (h === m) return A(1);
189
+ if (h === L) return A(7);
190
+ var D = (s = {}, s[f] = u, s[O] = l, s[g] = a, s)[h] || 1, I = this.$d.getTime() + t * D;
191
+ return _.w(I, this);
192
+ }, n.subtract = function(t, i) {
193
+ return this.add(-1 * t, i);
194
+ }, n.format = function(t) {
195
+ var i = this, s = this.$locale();
196
+ if (!this.isValid()) return s.invalidDate || H;
197
+ var d = t || "YYYY-MM-DDTHH:mm:ssZ", h = _.z(this), A = this.$H, D = this.$m, I = this.$M, V = s.weekdays, Y = s.months, z = s.meridiem, v = function(F, R, X, x) {
198
+ return F && (F[R] || F(i, d)) || X[R].slice(0, x);
199
+ }, G = function(F) {
200
+ return _.s(A % 12 || 12, F, "0");
201
+ }, J = z || function(F, R, X) {
202
+ var x = F < 12 ? "AM" : "PM";
203
+ return X ? x.toLowerCase() : x;
204
+ };
205
+ return d.replace(b, (function(F, R) {
206
+ return R || (function(X) {
207
+ switch (X) {
208
+ case "YY":
209
+ return String(i.$y).slice(-2);
210
+ case "YYYY":
211
+ return _.s(i.$y, 4, "0");
212
+ case "M":
213
+ return I + 1;
214
+ case "MM":
215
+ return _.s(I + 1, 2, "0");
216
+ case "MMM":
217
+ return v(s.monthsShort, I, Y, 3);
218
+ case "MMMM":
219
+ return v(Y, I);
220
+ case "D":
221
+ return i.$D;
222
+ case "DD":
223
+ return _.s(i.$D, 2, "0");
224
+ case "d":
225
+ return String(i.$W);
226
+ case "dd":
227
+ return v(s.weekdaysMin, i.$W, V, 2);
228
+ case "ddd":
229
+ return v(s.weekdaysShort, i.$W, V, 3);
230
+ case "dddd":
231
+ return V[i.$W];
232
+ case "H":
233
+ return String(A);
234
+ case "HH":
235
+ return _.s(A, 2, "0");
236
+ case "h":
237
+ return G(1);
238
+ case "hh":
239
+ return G(2);
240
+ case "a":
241
+ return J(A, D, !0);
242
+ case "A":
243
+ return J(A, D, !1);
244
+ case "m":
245
+ return String(D);
246
+ case "mm":
247
+ return _.s(D, 2, "0");
248
+ case "s":
249
+ return String(i.$s);
250
+ case "ss":
251
+ return _.s(i.$s, 2, "0");
252
+ case "SSS":
253
+ return _.s(i.$ms, 3, "0");
254
+ case "Z":
255
+ return h;
256
+ }
257
+ return null;
258
+ })(F) || h.replace(":", "");
259
+ }));
260
+ }, n.utcOffset = function() {
261
+ return 15 * -Math.round(this.$d.getTimezoneOffset() / 15);
262
+ }, n.diff = function(t, i, s) {
263
+ var d, h = this, A = _.p(i), D = S(t), I = (D.utcOffset() - this.utcOffset()) * u, V = this - D, Y = function() {
264
+ return _.m(h, D);
265
+ };
266
+ switch (A) {
267
+ case w:
268
+ d = Y() / 12;
269
+ break;
270
+ case P:
271
+ d = Y();
272
+ break;
273
+ case U:
274
+ d = Y() / 3;
275
+ break;
276
+ case L:
277
+ d = (V - I) / 6048e5;
278
+ break;
279
+ case m:
280
+ d = (V - I) / 864e5;
281
+ break;
282
+ case O:
283
+ d = V / l;
284
+ break;
285
+ case f:
286
+ d = V / u;
287
+ break;
288
+ case g:
289
+ d = V / a;
290
+ break;
291
+ default:
292
+ d = V;
293
+ }
294
+ return s ? d : _.a(d);
295
+ }, n.daysInMonth = function() {
296
+ return this.endOf(P).$D;
297
+ }, n.$locale = function() {
298
+ return M[this.$L];
299
+ }, n.locale = function(t, i) {
300
+ if (!t) return this.$L;
301
+ var s = this.clone(), d = k(t, i, !0);
302
+ return d && (s.$L = d), s;
303
+ }, n.clone = function() {
304
+ return _.w(this.$d, this);
305
+ }, n.toDate = function() {
306
+ return new Date(this.valueOf());
307
+ }, n.toJSON = function() {
308
+ return this.isValid() ? this.toISOString() : null;
309
+ }, n.toISOString = function() {
310
+ return this.$d.toISOString();
311
+ }, n.toString = function() {
312
+ return this.$d.toUTCString();
313
+ }, c;
314
+ })(), K = N.prototype;
315
+ return S.prototype = K, [["$ms", p], ["$s", g], ["$m", f], ["$H", O], ["$W", m], ["$M", P], ["$y", w], ["$D", E]].forEach((function(c) {
316
+ K[c[1]] = function(n) {
317
+ return this.$g(n, c[0], c[1]);
318
+ };
319
+ })), S.extend = function(c, n) {
320
+ return c.$i || (c(n, N, S), c.$i = !0), S;
321
+ }, S.locale = k, S.isDayjs = W, S.unix = function(c) {
322
+ return S(1e3 * c);
323
+ }, S.en = M[T], S.Ls = M, S.p = {}, S;
324
+ }));
325
+ })(re)), re.exports;
326
+ }
327
+ var $e = _e();
328
+ const Z = /* @__PURE__ */ ge($e), Se = (e) => e.replace(/\[(\d+)\](?=\.)/g, ".$1").replace(/\[(\d+)\]$/g, ".$1"), ce = (e) => Object.entries(e || {}).reduce((a, [u, l]) => (l != null && (a[u] = l), a), {}), Oe = (e) => new URLSearchParams(ce(e)).toString(), Ae = (e) => Object.fromEntries(e == null ? void 0 : e.entries()), Te = (e) => Array.isArray(e) ? e.length > 0 && e[0] !== null && typeof e[0] == "object" && !Array.isArray(e[0]) ? JSON.stringify(e) : e.map((r) => String(r ?? "")).join(",") : e, Ce = (e) => {
329
+ var r;
330
+ return (r = e == null ? void 0 : e.match(/{{(.*?)}}/g)) == null ? void 0 : r.map((a) => a.slice(2, -2));
331
+ }, Me = ({
332
+ setterMethodCode: e,
333
+ params: r = []
334
+ }) => {
335
+ if (!e) return e;
336
+ let a = e;
337
+ return r.forEach(({ key: u, value: l }) => {
338
+ l && (a = a.replaceAll(`#${u}#`, l));
339
+ }), a;
340
+ }, De = ({
341
+ value: e,
342
+ iteratorIndicesMap: r = {},
343
+ formIndexes: a = {}
344
+ }) => {
345
+ const u = 'getValues("__loggedInUserId__")', l = 'getValues("__formData__")', p = 'getValues("__infoData__")', g = 'getValues("__utilityData__")', f = 'getValues("__routeData__")', O = 'getValues("__accessRights__")';
346
+ let m = fe({
347
+ value: e,
348
+ iteratorIndicesMap: r,
349
+ formIndexes: a,
350
+ withDotNotation: !1
351
+ });
352
+ return m = m.replaceAll("__loggedInUserId__", u).replaceAll("__formData__", l).replaceAll("__infoData__", p).replaceAll("__utilityData__", g).replaceAll("__routeData__", f).replaceAll("__accessRights__", O), m;
353
+ }, fe = ({
354
+ value: e = null,
355
+ iteratorIndicesMap: r = {},
356
+ formIndexes: a = {},
357
+ withDotNotation: u = !0
358
+ }) => {
359
+ if (!e) return e;
360
+ let l = e;
361
+ return Object.keys(a).forEach((p) => {
362
+ if (l.includes(`[${p}]`)) {
363
+ let g;
364
+ const f = a[p];
365
+ r.hasOwnProperty(f) ? g = r[f] : g = -1, l = l.replaceAll(p, g);
366
+ }
367
+ }), u && (l = Se(l)), l;
368
+ }, Le = (e, r, a, u, { dayjs: l }) => {
369
+ const p = De({
370
+ value: e,
371
+ iteratorIndicesMap: r,
372
+ formIndexes: a
373
+ });
374
+ try {
375
+ return new Function("getValues", "dayjs", `return ${p};`)(
376
+ u,
377
+ l
378
+ );
379
+ } catch (g) {
380
+ return pe({ message: `Error evaluating ${e}`, type: "error" }), console.error(`Error evaluating ${e} :`, g), null;
381
+ }
382
+ }, Ee = (e) => {
383
+ let r = JSON.parse(
384
+ sessionStorage.getItem("medplatFormRoutes") || "{}"
385
+ );
386
+ r[e] = !0, sessionStorage.setItem(
387
+ "medplatFormRoutes",
388
+ JSON.stringify(r)
389
+ );
390
+ }, Ie = (e) => JSON.parse(
391
+ sessionStorage.getItem("medplatFormRoutes") || "{}"
392
+ )[e] || !1, le = (e, r = "") => {
393
+ var u, l;
394
+ let a = [];
395
+ for (const p in e) {
396
+ const g = r ? `${r}.${p}` : p;
397
+ (u = e[p]) != null && u.types || (l = e[p]) != null && l.message ? a.push(g) : typeof e[p] == "object" && (a = a.concat(le(e[p], g)));
398
+ }
399
+ return a;
400
+ }, Pe = (e, r) => Array.isArray(e) && e.length > 0 ? e.some(
401
+ (u) => r == null ? void 0 : r.includes(u)
402
+ ) : !1, Ne = (e, r, a, u = !0) => {
403
+ if ((r == null || r === "") && u)
404
+ return "N.A";
405
+ switch (e) {
406
+ case "text":
407
+ case "location":
408
+ case "listValueFieldValue":
409
+ case "html":
410
+ return r;
411
+ case "mediaPreview":
412
+ return r;
413
+ case "boolean":
414
+ return r ? "Yes" : "No";
415
+ case "date":
416
+ return Z(r).format("DD/MM/YYYY");
417
+ case "dateAndTime":
418
+ return Z(r).format("DD/MM/YYYY HH:mm:ss");
419
+ case "gender":
420
+ switch (r) {
421
+ case "M":
422
+ return "Male";
423
+ case "F":
424
+ case "FM":
425
+ return "Female";
426
+ case "T":
427
+ return "Transgender";
428
+ }
429
+ break;
430
+ case "familyPlanning":
431
+ switch (r) {
432
+ case "FMLSTR":
433
+ return "FEMALE STERILIZATION";
434
+ case "MLSTR":
435
+ return "MALE STERILIZATION";
436
+ case "IUCD5":
437
+ return "IUCD- 5 YEARS";
438
+ case "IUCD10":
439
+ return "IUCD- 10 YEARS";
440
+ case "CONDOM":
441
+ return "CONDOM";
442
+ case "ORALPILLS":
443
+ return "ORAL PILLS";
444
+ case "CHHAYA":
445
+ return "CHHAYA";
446
+ case "ANTARA":
447
+ return "ANTARA";
448
+ case "CONTRA":
449
+ return "EMERGENCY CONTRACEPTIVE PILLS";
450
+ case "PPIUCD":
451
+ return "PPIUCD";
452
+ case "PAIUCD":
453
+ return "PAIUCD";
454
+ case "PPTL":
455
+ return "Post Parterm TL";
456
+ case "PATL":
457
+ return "Post Abortion TL";
458
+ case "LAPAROSCOPIC_TL":
459
+ return "Laparoscopic TL";
460
+ case "ABDOMINAL_TL":
461
+ return "Abdominal TL";
462
+ case "VASECTOMY_FOR_HUSBAND":
463
+ return "Vasectomy (for Husband)";
464
+ }
465
+ break;
466
+ case "sdScore":
467
+ switch (r) {
468
+ case "SD4":
469
+ return "Less than -4";
470
+ case "SD3":
471
+ return "-4 to -3";
472
+ case "SD2":
473
+ return "-3 to -2";
474
+ case "SD1":
475
+ return "-2 to -1";
476
+ case "MEDIAN":
477
+ return "MEDIAN";
478
+ default:
479
+ return "NONE";
480
+ }
481
+ case "array": {
482
+ if (!Array.isArray(r))
483
+ return r;
484
+ switch (a) {
485
+ case "BULLETED":
486
+ return r.map((l) => `• ${l}`);
487
+ case "NUMBERED":
488
+ return r.map((l, p) => `${p + 1}. ${l}`);
489
+ case "COMMA":
490
+ return r.join(", ");
491
+ default:
492
+ return r.join(" ");
493
+ }
494
+ }
495
+ default:
496
+ return r;
497
+ }
498
+ }, be = async (e) => {
499
+ if (!e || e.length === 0)
500
+ return [];
501
+ const r = (await oe({
502
+ code: "medplat_form_listvalue_field_value_details",
503
+ parameters: {
504
+ ids: e
505
+ }
506
+ })).data;
507
+ return r == null ? void 0 : r.result;
508
+ }, Ve = async (e, r) => {
509
+ if (!e || e.length === 0)
510
+ return [];
511
+ const a = {
512
+ locationIds: e.join(",")
513
+ };
514
+ r && (a.lang = r);
515
+ const u = (await oe({
516
+ code: "medplat_form_get_location_hierarchies",
517
+ parameters: a
518
+ })).data;
519
+ return u == null ? void 0 : u.result;
520
+ }, Ue = ({
521
+ preValidationQueries: e,
522
+ formContext: r,
523
+ formIndexes: a,
524
+ iteratorIndicesMap: u,
525
+ rowData: l
526
+ }) => Array.isArray(e) ? e.map((p) => {
527
+ const g = {};
528
+ return (p.params || []).forEach((f) => {
529
+ if (f.type === "TABLE" && l)
530
+ g[f.key] = l[f.valueKey];
531
+ else {
532
+ const O = q.replaceFormIndexes({
533
+ value: f.valueKey,
534
+ iteratorIndicesMap: u,
535
+ formIndexes: a
536
+ });
537
+ g[f.key] = r.getValues(O);
538
+ }
539
+ }), {
540
+ queryCode: p.queryCode,
541
+ parameters: g
542
+ };
543
+ }) : [], q = {
544
+ convertToSearchParams: Oe,
545
+ extractSearchParams: Ae,
546
+ serialiseMultiRowParam: Te,
547
+ extractDynamicContent: Ce,
548
+ replaceFormIndexes: fe,
549
+ evaluate: Le,
550
+ transformWithDisplayType: Ne,
551
+ addRoutePathInSessionStorage: Ee,
552
+ isRoutePresentInSessionStorage: Ie,
553
+ flattenErrors: le,
554
+ checkFormErrors: Pe,
555
+ getFilteredObject: ce,
556
+ fetchListValueDetailByIds: be,
557
+ fetchLocationHierarchyByIds: Ve,
558
+ buildPreValidationQueries: Ue,
559
+ replacePlaceholdersWithConfigParams: Me
560
+ }, Q = (e) => (e || "").toString().toLowerCase(), we = (e) => e === "true" || e === "'true'" ? !0 : e === "false" || e === "'false'" ? !1 : e === "null" || e === "'null'" ? null : typeof e == "string" && e.startsWith("'") && e.endsWith("'") ? e.substring(1, e.length - 1) : e, B = {
561
+ EQ: (e, r) => e == r,
562
+ NQ: (e, r) => e != r,
563
+ EQWithType: (e, r) => e === r,
564
+ NQWithType: (e, r) => e !== r,
565
+ GT: (e, r) => e > r,
566
+ LT: (e, r) => e < r,
567
+ GTE: (e, r) => e >= r,
568
+ LTE: (e, r) => e <= r,
569
+ BT: (e, r, a) => e > r && e < a,
570
+ INCLUDES: (e, r) => Array.isArray(e) && e.some((a) => String(a).toLowerCase() === String(r).toLowerCase()),
571
+ NOT_INCLUDES: (e, r) => Array.isArray(e) && !e.some((a) => String(a).toLowerCase() === String(r).toLowerCase()),
572
+ FILLED: (e) => e != null,
573
+ NOT_FILLED: (e) => e == null,
574
+ CONTAINS: (e, r) => Q(e).includes(Q(r)),
575
+ STARTS_WITH: (e, r) => Q(e).startsWith(Q(r)),
576
+ ENDS_WITH: (e, r) => Q(e).endsWith(Q(r)),
577
+ HAS_KEY: (e, r) => e && typeof e == "object" && !Array.isArray(e) && r in e
578
+ }, de = (e) => typeof e != "string" ? null : e.startsWith("dateAndTime(") ? "dateAndTime" : e.startsWith("date(") ? "date" : null, Be = ({
579
+ condition: e,
580
+ evaluator: r,
581
+ contextCellValue: a,
582
+ contextRowData: u,
583
+ type: l,
584
+ isStyleMode: p
585
+ }) => {
586
+ const { operator: g, config: f, operand: O } = e, m = de(l);
587
+ let L = a;
588
+ if (p && m && (L = r(a, m)), O && (L = r(O, p ? m : null, u, !1)), g === "BT") {
589
+ const E = f.operand1 === "CUSTOM" ? f.operand1CustomValue : f.operand1, H = f.operand2 === "CUSTOM" ? f.operand2CustomValue : f.operand2;
590
+ return B.BT(
591
+ L,
592
+ r(E, m, u, f.operand1 === "CUSTOM"),
593
+ r(H, m, u, f.operand2 === "CUSTOM")
594
+ );
595
+ }
596
+ if (g === "FILLED" || g === "NOT_FILLED") {
597
+ const E = p ? L : O ? r(O, null, u) : L;
598
+ return B[g](E);
599
+ }
600
+ if (g === "HAS_KEY")
601
+ return B.HAS_KEY(L, f.key);
602
+ if (g === "HAS_KEY_VALUE") {
603
+ if (!L || typeof L != "object" || Array.isArray(L) || !f.key) return !1;
604
+ const E = L[f.key], H = f.operator, o = f.config || {};
605
+ if (!H) return !1;
606
+ if (H === "BT") {
607
+ const C = o.operand1 === "CUSTOM", y = o.operand2 === "CUSTOM";
608
+ return E > r(C ? o.operand1CustomValue : o.operand1, m, u, C) && E < r(y ? o.operand2CustomValue : o.operand2, m, u, y);
609
+ }
610
+ const b = o.operand === "CUSTOM";
611
+ return B[H](E, r(b ? o.operandCustomValue : o.operand, m, u, b));
612
+ }
613
+ const P = f.operand === "CUSTOM", U = P ? f.operandCustomValue : f.operand, w = r(U, m, u, P);
614
+ return B[g](L, w);
615
+ }, he = ({
616
+ expression: e,
617
+ contextCellValue: r,
618
+ contextRowData: a,
619
+ conditionKey: u,
620
+ evaluateConditionFunc: l
621
+ }) => {
622
+ const p = (e == null ? void 0 : e.conditions) || e;
623
+ if (!(p != null && p.options)) return u === "visibility";
624
+ const { rule: g, options: f } = p, O = (m) => m.conditions ? he({ expression: m, contextCellValue: r, contextRowData: a, conditionKey: u, evaluateConditionFunc: l }) : l(m, r, a);
625
+ return g === "AND" ? f.every(O) : f.some(O);
626
+ }, ve = ({
627
+ items: e = [],
628
+ formContext: r,
629
+ iteratorIndicesMap: a = {},
630
+ formIndexes: u = {},
631
+ dependencies: l = {},
632
+ rowData: p = {},
633
+ cellValue: g = null,
634
+ type: f = null,
635
+ conditionKey: O = "visibility",
636
+ isStyleMode: m = !1
637
+ }) => {
638
+ const L = ne(() => {
639
+ const o = /* @__PURE__ */ new Set(), b = (y) => {
640
+ const $ = /* @__PURE__ */ new Set(), T = (j) => {
641
+ j !== "CUSTOM" && j !== "CUSTOM_VALUE" && j !== "CUSTOM_PATH" && typeof j == "string" && $.add(q.replaceFormIndexes({ value: j }));
642
+ }, M = (j, W) => {
643
+ j === "CUSTOM_PATH" && W && typeof W == "string" && $.add(q.replaceFormIndexes({ value: W }));
644
+ };
645
+ return y.operator === "BT" ? (T(y.config.operand1), M(y.config.operand1, y.config.operand1CustomPath), T(y.config.operand2), M(y.config.operand2, y.config.operand2CustomPath)) : (T(y.config.operand), M(y.config.operand, y.config.operandCustomPath)), T(y.operand), M(y.operand, y.operandCustomPath), [...$];
646
+ }, C = (y) => {
647
+ var $;
648
+ ($ = y == null ? void 0 : y.options) == null || $.forEach((T) => {
649
+ T.conditions ? C(T.conditions) : b(T).forEach((M) => o.add(M));
650
+ });
651
+ };
652
+ return e == null || e.forEach((y) => {
653
+ var T;
654
+ const $ = ((T = y[O]) == null ? void 0 : T.conditions) || y[O];
655
+ $ && C($);
656
+ }), Array.from(o);
657
+ }, [JSON.stringify(e), O, a, u]), P = me({
658
+ control: r == null ? void 0 : r.control,
659
+ name: L.length > 0 ? L : void 0,
660
+ exact: !0
661
+ }), U = te(
662
+ (o, b = null, C = {}, y) => {
663
+ if (typeof o == "string" && o.startsWith("__"))
664
+ try {
665
+ return q.evaluate(o, m ? {} : a, u, r == null ? void 0 : r.getValues, { dayjs: Z, ...l });
666
+ } catch (T) {
667
+ return console.error("Evaluation error:", T), null;
668
+ }
669
+ if (typeof o == "string" && !o.startsWith("__") && !y) {
670
+ if (o in C) return C[o];
671
+ if (C != null && C._raw && o in C._raw) return C._raw[o];
672
+ }
673
+ const $ = b || f;
674
+ return $ === "listValueFieldValue" || $ === "location" ? typeof o == "string" ? Number(o) : o : $ === "boolean" ? o === "true" || o === !0 : $ === "date" && Z(o).isValid() ? Z(o).startOf("day").valueOf() : $ === "dateAndTime" && Z(o).isValid() ? Z(o).startOf("minute").valueOf() : $ ? o : we(o);
675
+ },
676
+ [r == null ? void 0 : r.getValues, a, u, f, m, l]
677
+ ), w = te(
678
+ (o, b = g, C = p) => {
679
+ const { operator: y, config: $, operand: T } = o, M = de(f), j = (N) => N === "CUSTOM" || N === "CUSTOM_VALUE", W = (N) => N === "CUSTOM_PATH", k = (N, K, c, n) => {
680
+ if (j(N))
681
+ return U(K, n, C, !0);
682
+ if (W(N)) {
683
+ const t = q.replaceFormIndexes({
684
+ value: c,
685
+ iteratorIndicesMap: m ? {} : a,
686
+ formIndexes: {}
687
+ });
688
+ return U(t, n, C, !1);
689
+ }
690
+ return U(N, n, C, !1);
691
+ };
692
+ let S = b;
693
+ if (m && M && (S = U(b, M)), T)
694
+ if (j(T))
695
+ S = U(o.operandCustomValue, m ? M : null, C, !0);
696
+ else if (W(T)) {
697
+ const N = q.replaceFormIndexes({
698
+ value: o.operandCustomPath,
699
+ iteratorIndicesMap: m ? {} : a,
700
+ formIndexes: {}
701
+ });
702
+ S = U(N, m ? M : null, C, !1);
703
+ } else
704
+ S = U(T, m ? M : null, C, !1);
705
+ if (y === "BT")
706
+ return B.BT(
707
+ S,
708
+ k($.operand1, $.operand1CustomValue, $.operand1CustomPath, M),
709
+ k($.operand2, $.operand2CustomValue, $.operand2CustomPath, M)
710
+ );
711
+ if (y === "FILLED" || y === "NOT_FILLED") {
712
+ const N = S;
713
+ return B[y](N);
714
+ }
715
+ const _ = k(
716
+ $.operand,
717
+ $.operandCustomValue,
718
+ $.operandCustomPath,
719
+ M || null
720
+ );
721
+ return B[y](S, _);
722
+ },
723
+ [U, g, p, f, m, a]
724
+ ), E = te(
725
+ (o, b = g, C = p) => he({ expression: o, contextCellValue: b, contextRowData: C, conditionKey: O, evaluateConditionFunc: w }),
726
+ [w, g, p, O]
727
+ ), H = ne(() => Array.isArray(e) ? e.filter((o) => {
728
+ const b = o[O];
729
+ return b ? E(b) : (o == null ? void 0 : o.styles) || O === "visibility";
730
+ }) : [], [e, E, O, P]);
731
+ return { evaluate: U, evaluateCondition: w, evaluateExpression: E, filteredItems: H, watchedValues: P };
732
+ };
733
+ export {
734
+ Z as C,
735
+ q as F,
736
+ he as a,
737
+ ge as b,
738
+ ke as c,
739
+ Be as e,
740
+ Re as g,
741
+ we as n,
742
+ ve as u
743
+ };
744
+ //# sourceMappingURL=index-BTA-0FqQ.js.map