@argusoft/medplat-core 1.0.22 → 1.0.24

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 (52) hide show
  1. package/dist/AddMenuConfiguration-m3R8FDhj.js +5570 -0
  2. package/dist/AddMenuConfiguration-m3R8FDhj.js.map +1 -0
  3. package/dist/AddMenuConfiguration.css +1 -1
  4. package/dist/{ChangePasswordModalCore-DotONnMz.js → ChangePasswordModalCore-Czu7OZe6.js} +957 -954
  5. package/dist/ChangePasswordModalCore-Czu7OZe6.js.map +1 -0
  6. package/dist/{ConditionConfig-C3rF2wXU.js → ConditionConfig-BECSbvY2.js} +2 -2
  7. package/dist/{ConditionConfig-C3rF2wXU.js.map → ConditionConfig-BECSbvY2.js.map} +1 -1
  8. package/dist/{EntityManagement-D4nG7wUX.js → EntityManagement-GaYsBTvf.js} +2 -2
  9. package/dist/{EntityManagement-D4nG7wUX.js.map → EntityManagement-GaYsBTvf.js.map} +1 -1
  10. package/dist/FhirRawResourceList-ZZFd7gTX.js +550 -0
  11. package/dist/FhirRawResourceList-ZZFd7gTX.js.map +1 -0
  12. package/dist/FhirServerList-Dkq7Kbes.js +116 -0
  13. package/dist/FhirServerList-Dkq7Kbes.js.map +1 -0
  14. package/dist/FhirServerProfile-CUOwC6Wb.js +253 -0
  15. package/dist/FhirServerProfile-CUOwC6Wb.js.map +1 -0
  16. package/dist/FhirServerWizard-Db6Hm4bQ.js +161 -0
  17. package/dist/FhirServerWizard-Db6Hm4bQ.js.map +1 -0
  18. package/dist/{ImmunizationConfigurationBase-CTBoSuSz.js → ImmunizationConfigurationBase-BevKZx_l.js} +386 -302
  19. package/dist/ImmunizationConfigurationBase-BevKZx_l.js.map +1 -0
  20. package/dist/{ManageEventConfiguration-BntUc_YI.js → ManageEventConfiguration-CBi2KMB1.js} +4 -4
  21. package/dist/{ManageEventConfiguration-BntUc_YI.js.map → ManageEventConfiguration-CBi2KMB1.js.map} +1 -1
  22. package/dist/{ManageUser-Ca1BsI1u.js → ManageUser-BnEPFSPT.js} +219 -219
  23. package/dist/{ManageUser-Ca1BsI1u.js.map → ManageUser-BnEPFSPT.js.map} +1 -1
  24. package/dist/{MobileMenuManagement-CV6QCeos.js → MobileMenuManagement-CVAKyKDa.js} +33 -32
  25. package/dist/MobileMenuManagement-CVAKyKDa.js.map +1 -0
  26. package/dist/{MobileTypeEventConfigModal-BNjZ8pnq.js → MobileTypeEventConfigModal-C34AN-IJ.js} +2 -2
  27. package/dist/{MobileTypeEventConfigModal-BNjZ8pnq.js.map → MobileTypeEventConfigModal-C34AN-IJ.js.map} +1 -1
  28. package/dist/{OtherTypeEventConfigModal-DiVhWDpG.js → OtherTypeEventConfigModal-BYjMFl0-.js} +93 -93
  29. package/dist/OtherTypeEventConfigModal-BYjMFl0-.js.map +1 -0
  30. package/dist/ServerFormFields-SLghoZ2z.js +136 -0
  31. package/dist/ServerFormFields-SLghoZ2z.js.map +1 -0
  32. package/dist/SyncDialog-BRGpHOE4.js +130 -0
  33. package/dist/SyncDialog-BRGpHOE4.js.map +1 -0
  34. package/dist/{TableList-HGbEN4bv.js → TableList-D6jnIbnz.js} +227 -244
  35. package/dist/TableList-D6jnIbnz.js.map +1 -0
  36. package/dist/{TypeConfiguration-CupQxH9Y.js → TypeConfiguration-Bs5WkIa2.js} +2 -2
  37. package/dist/{TypeConfiguration-CupQxH9Y.js.map → TypeConfiguration-Bs5WkIa2.js.map} +1 -1
  38. package/dist/dashboardLayoutUtils-Bt5HA96J.js +265 -0
  39. package/dist/dashboardLayoutUtils-Bt5HA96J.js.map +1 -0
  40. package/dist/index.css +1 -1
  41. package/dist/index.js +191 -135
  42. package/dist/index.js.map +1 -1
  43. package/dist/permissions-DEWACxJN.js +308 -0
  44. package/dist/permissions-DEWACxJN.js.map +1 -0
  45. package/package.json +1 -1
  46. package/dist/AddMenuConfiguration-DsnY0Rws.js +0 -2237
  47. package/dist/AddMenuConfiguration-DsnY0Rws.js.map +0 -1
  48. package/dist/ChangePasswordModalCore-DotONnMz.js.map +0 -1
  49. package/dist/ImmunizationConfigurationBase-CTBoSuSz.js.map +0 -1
  50. package/dist/MobileMenuManagement-CV6QCeos.js.map +0 -1
  51. package/dist/OtherTypeEventConfigModal-DiVhWDpG.js.map +0 -1
  52. package/dist/TableList-HGbEN4bv.js.map +0 -1
@@ -3,67 +3,67 @@ import { useTranslateProvider as sn } from "@/common/languageTranslator/Translat
3
3
  import { execute as xe, executeAll as dn } from "@/common/services/QueryBuilder";
4
4
  import { showToast as F } from "@/common/toaster/toaster";
5
5
  import cn from "@monaco-editor/react";
6
- import { Dialog as Ae, DialogTitle as Re, Typography as C, Divider as te, DialogContent as Ne, TableContainer as ke, Table as Oe, TableHead as $e, TableRow as K, TableCell as y, TableBody as Me, Chip as A, Box as x, Accordion as pn, AccordionSummary as mn, AccordionDetails as hn, DialogActions as ze, Button as M, Alert as Ce, Paper as be, Tooltip as U, TextField as Se, InputAdornment as un, Checkbox as ve, List as fn, ListItem as gn, ListItemButton as yn, ListItemText as xn, IconButton as Te, Autocomplete as Cn } from "@mui/material";
6
+ import { Dialog as Ae, DialogTitle as Re, Typography as C, Divider as te, DialogContent as Ne, TableContainer as ke, Table as Oe, TableHead as Me, TableRow as K, TableCell as y, TableBody as ze, Chip as A, Box as x, Accordion as pn, AccordionSummary as mn, AccordionDetails as hn, DialogActions as De, Button as z, Alert as Ce, Paper as be, Tooltip as U, TextField as Se, InputAdornment as un, Checkbox as ve, List as fn, ListItem as gn, ListItemButton as yn, ListItemText as xn, IconButton as Te, Autocomplete as Cn } from "@mui/material";
7
7
  import b from "prop-types";
8
- import bn, { useState as g, useRef as Sn, useEffect as Ie, Suspense as vn, lazy as Tn } from "react";
8
+ import bn, { useState as f, useRef as Sn, useEffect as Ie, Suspense as vn, lazy as Tn } from "react";
9
9
  import I from "@/common/fontAwesomeIcons/FontAwesomeIcons";
10
- import we from "@mui/material/Grid2";
10
+ import Ee from "@mui/material/Grid2";
11
11
  import { useForm as In } from "react-hook-form";
12
- import { useSelector as wn } from "react-redux";
13
- const Ee = {
12
+ import { useSelector as En } from "react-redux";
13
+ const we = {
14
14
  NEW_TABLE: { label: "New Table", color: "success" },
15
15
  MODIFIED: { label: "Modified", color: "warning" },
16
16
  SYNC_REQUIRED: { label: "Sync Required", color: "info" },
17
17
  NO_CHANGES: { label: "No Changes", color: "default" }
18
18
  };
19
- function De({ changes: d, status: z }) {
20
- var m, w, v, R, O;
21
- const f = [];
22
- return z === "NEW_TABLE" ? f.push(
19
+ function $e({ changes: s, status: D }) {
20
+ var c, E, v, R, O;
21
+ const u = [];
22
+ return D === "NEW_TABLE" ? u.push(
23
23
  /* @__PURE__ */ e(
24
24
  A,
25
25
  {
26
26
  size: "small",
27
- label: `${((m = d.addedColumns) == null ? void 0 : m.length) || 0} columns`,
27
+ label: `${((c = s.addedColumns) == null ? void 0 : c.length) || 0} columns`,
28
28
  color: "success",
29
29
  variant: "outlined"
30
30
  },
31
31
  "new"
32
32
  )
33
- ) : ((w = d.addedColumns) != null && w.length && f.push(
33
+ ) : ((E = s.addedColumns) != null && E.length && u.push(
34
34
  /* @__PURE__ */ e(
35
35
  A,
36
36
  {
37
37
  size: "small",
38
- label: `+${d.addedColumns.length} cols`,
38
+ label: `+${s.addedColumns.length} cols`,
39
39
  color: "success",
40
40
  variant: "outlined"
41
41
  },
42
42
  "add"
43
43
  )
44
- ), (v = d.removedColumns) != null && v.length && f.push(
44
+ ), (v = s.removedColumns) != null && v.length && u.push(
45
45
  /* @__PURE__ */ e(
46
46
  A,
47
47
  {
48
48
  size: "small",
49
- label: `-${d.removedColumns.length} cols`,
49
+ label: `-${s.removedColumns.length} cols`,
50
50
  color: "error",
51
51
  variant: "outlined"
52
52
  },
53
53
  "rem"
54
54
  )
55
- ), (R = d.typeChangedColumns) != null && R.length && f.push(
55
+ ), (R = s.typeChangedColumns) != null && R.length && u.push(
56
56
  /* @__PURE__ */ e(
57
57
  A,
58
58
  {
59
59
  size: "small",
60
- label: `${d.typeChangedColumns.length} types`,
60
+ label: `${s.typeChangedColumns.length} types`,
61
61
  color: "warning",
62
62
  variant: "outlined"
63
63
  },
64
64
  "type"
65
65
  )
66
- ), d.primaryKeyChange && f.push(
66
+ ), s.primaryKeyChange && u.push(
67
67
  /* @__PURE__ */ e(
68
68
  A,
69
69
  {
@@ -74,38 +74,38 @@ function De({ changes: d, status: z }) {
74
74
  },
75
75
  "pk"
76
76
  )
77
- ), (O = d.settingsChanges) != null && O.length && f.push(
77
+ ), (O = s.settingsChanges) != null && O.length && u.push(
78
78
  /* @__PURE__ */ e(
79
79
  A,
80
80
  {
81
81
  size: "small",
82
- label: `${d.settingsChanges.length} settings`,
82
+ label: `${s.settingsChanges.length} settings`,
83
83
  color: "info",
84
84
  variant: "outlined"
85
85
  },
86
86
  "set"
87
87
  )
88
- ), f.length || f.push(
88
+ ), u.length || u.push(
89
89
  /* @__PURE__ */ e(C, { variant: "caption", color: "text.secondary", children: "—" }, "none")
90
- )), /* @__PURE__ */ e(x, { sx: { display: "flex", gap: 0.5, flexWrap: "wrap" }, children: f });
90
+ )), /* @__PURE__ */ e(x, { sx: { display: "flex", gap: 0.5, flexWrap: "wrap" }, children: u });
91
91
  }
92
- function _e({ item: d }) {
93
- var w, v, R, O, D, _, T;
94
- const { tableName: z, status: f, changes: m } = d;
92
+ function _e({ item: s }) {
93
+ var E, v, R, O, $, _, T;
94
+ const { tableName: D, status: u, changes: c } = s;
95
95
  return /* @__PURE__ */ r(x, { sx: { p: 1.5 }, children: [
96
- f === "NEW_TABLE" && /* @__PURE__ */ r(Ce, { severity: "success", sx: { mb: 1.5, py: 0.5 }, children: [
96
+ u === "NEW_TABLE" && /* @__PURE__ */ r(Ce, { severity: "success", sx: { mb: 1.5, py: 0.5 }, children: [
97
97
  "This table does not exist in the database. A",
98
98
  " ",
99
99
  /* @__PURE__ */ e("strong", { children: "CREATE TABLE" }),
100
100
  " migration script will be generated."
101
101
  ] }),
102
- (((w = m.addedColumns) == null ? void 0 : w.length) > 0 || ((v = m.removedColumns) == null ? void 0 : v.length) > 0 || ((R = m.typeChangedColumns) == null ? void 0 : R.length) > 0 || m.primaryKeyChange) && f !== "NEW_TABLE" && /* @__PURE__ */ r(Ce, { severity: "warning", sx: { mb: 1.5, py: 0.5 }, children: [
102
+ (((E = c.addedColumns) == null ? void 0 : E.length) > 0 || ((v = c.removedColumns) == null ? void 0 : v.length) > 0 || ((R = c.typeChangedColumns) == null ? void 0 : R.length) > 0 || c.primaryKeyChange) && u !== "NEW_TABLE" && /* @__PURE__ */ r(Ce, { severity: "warning", sx: { mb: 1.5, py: 0.5 }, children: [
103
103
  "SQLite does not support all ALTER TABLE operations. A",
104
104
  " ",
105
105
  /* @__PURE__ */ e("strong", { children: "rebuild migration" }),
106
106
  " (dummy table copy) will be generated."
107
107
  ] }),
108
- (((O = m.addedColumns) == null ? void 0 : O.length) > 0 || ((D = m.removedColumns) == null ? void 0 : D.length) > 0 || ((_ = m.typeChangedColumns) == null ? void 0 : _.length) > 0) && /* @__PURE__ */ e(
108
+ (((O = c.addedColumns) == null ? void 0 : O.length) > 0 || (($ = c.removedColumns) == null ? void 0 : $.length) > 0 || ((_ = c.typeChangedColumns) == null ? void 0 : _.length) > 0) && /* @__PURE__ */ e(
109
109
  ke,
110
110
  {
111
111
  sx: {
@@ -115,13 +115,13 @@ function _e({ item: d }) {
115
115
  borderRadius: 1
116
116
  },
117
117
  children: /* @__PURE__ */ r(Oe, { size: "small", children: [
118
- /* @__PURE__ */ e($e, { children: /* @__PURE__ */ r(K, { sx: { backgroundColor: "action.hover" }, children: [
118
+ /* @__PURE__ */ e(Me, { children: /* @__PURE__ */ r(K, { sx: { backgroundColor: "action.hover" }, children: [
119
119
  /* @__PURE__ */ e(y, { sx: { fontWeight: 700, fontSize: "0.75rem" }, children: "Column" }),
120
120
  /* @__PURE__ */ e(y, { sx: { fontWeight: 700, fontSize: "0.75rem" }, children: "Type" }),
121
121
  /* @__PURE__ */ e(y, { sx: { fontWeight: 700, fontSize: "0.75rem" }, children: "Change" })
122
122
  ] }) }),
123
- /* @__PURE__ */ r(Me, { children: [
124
- (m.addedColumns || []).map((l) => /* @__PURE__ */ r(
123
+ /* @__PURE__ */ r(ze, { children: [
124
+ (c.addedColumns || []).map((l) => /* @__PURE__ */ r(
125
125
  K,
126
126
  {
127
127
  sx: { backgroundColor: "rgba(76,175,80,0.08)" },
@@ -139,7 +139,7 @@ function _e({ item: d }) {
139
139
  },
140
140
  `add-${l.name}`
141
141
  )),
142
- (m.removedColumns || []).map((l) => /* @__PURE__ */ r(
142
+ (c.removedColumns || []).map((l) => /* @__PURE__ */ r(
143
143
  K,
144
144
  {
145
145
  sx: { backgroundColor: "rgba(244,67,54,0.08)" },
@@ -172,7 +172,7 @@ function _e({ item: d }) {
172
172
  },
173
173
  `rem-${l.name}`
174
174
  )),
175
- (m.typeChangedColumns || []).map((l) => /* @__PURE__ */ r(
175
+ (c.typeChangedColumns || []).map((l) => /* @__PURE__ */ r(
176
176
  K,
177
177
  {
178
178
  sx: { backgroundColor: "rgba(255,152,0,0.08)" },
@@ -207,7 +207,7 @@ function _e({ item: d }) {
207
207
  ] })
208
208
  }
209
209
  ),
210
- m.primaryKeyChange && /* @__PURE__ */ r(
210
+ c.primaryKeyChange && /* @__PURE__ */ r(
211
211
  x,
212
212
  {
213
213
  sx: {
@@ -228,14 +228,14 @@ function _e({ item: d }) {
228
228
  }
229
229
  ),
230
230
  /* @__PURE__ */ r(C, { variant: "caption", sx: { ml: 1 }, children: [
231
- /* @__PURE__ */ e("code", { children: m.primaryKeyChange.from }),
231
+ /* @__PURE__ */ e("code", { children: c.primaryKeyChange.from }),
232
232
  " → ",
233
- /* @__PURE__ */ e("code", { children: m.primaryKeyChange.to })
233
+ /* @__PURE__ */ e("code", { children: c.primaryKeyChange.to })
234
234
  ] })
235
235
  ]
236
236
  }
237
237
  ),
238
- ((T = m.settingsChanges) == null ? void 0 : T.length) > 0 && /* @__PURE__ */ r(x, { sx: { mb: 1.5 }, children: [
238
+ ((T = c.settingsChanges) == null ? void 0 : T.length) > 0 && /* @__PURE__ */ r(x, { sx: { mb: 1.5 }, children: [
239
239
  /* @__PURE__ */ e(
240
240
  C,
241
241
  {
@@ -244,7 +244,7 @@ function _e({ item: d }) {
244
244
  children: "Settings Changes:"
245
245
  }
246
246
  ),
247
- m.settingsChanges.map((l, W) => /* @__PURE__ */ r(
247
+ c.settingsChanges.map((l, W) => /* @__PURE__ */ r(
248
248
  x,
249
249
  {
250
250
  sx: { display: "flex", alignItems: "center", gap: 1, mb: 0.25 },
@@ -273,23 +273,23 @@ function _e({ item: d }) {
273
273
  ] });
274
274
  }
275
275
  function We({
276
- open: d,
277
- onClose: z,
278
- summaryData: f,
279
- onApply: m,
280
- applying: w,
276
+ open: s,
277
+ onClose: D,
278
+ summaryData: u,
279
+ onApply: c,
280
+ applying: E,
281
281
  migrationVersions: v,
282
282
  unifiedMigrationScript: R,
283
283
  onUnifiedScriptChange: O
284
284
  }) {
285
- const [D, _] = g(!0), T = f.filter(
285
+ const [$, _] = f(!0), T = u.filter(
286
286
  (l) => l.status !== "NO_CHANGES"
287
287
  ).length;
288
288
  return /* @__PURE__ */ r(
289
289
  Ae,
290
290
  {
291
- open: d,
292
- onClose: z,
291
+ open: s,
292
+ onClose: D,
293
293
  maxWidth: "md",
294
294
  fullWidth: !0,
295
295
  PaperProps: { sx: { borderRadius: 1.5 } },
@@ -299,20 +299,20 @@ function We({
299
299
  /* @__PURE__ */ r(C, { variant: "body2", color: "text.secondary", children: [
300
300
  T,
301
301
  " table(s) will be affected · ",
302
- f.length,
302
+ u.length,
303
303
  " total in file"
304
304
  ] })
305
305
  ] }),
306
306
  /* @__PURE__ */ e(te, {}),
307
307
  /* @__PURE__ */ r(Ne, { sx: { p: 0 }, children: [
308
308
  /* @__PURE__ */ e(ke, { children: /* @__PURE__ */ r(Oe, { children: [
309
- /* @__PURE__ */ e($e, { children: /* @__PURE__ */ r(K, { sx: { backgroundColor: "action.hover" }, children: [
309
+ /* @__PURE__ */ e(Me, { children: /* @__PURE__ */ r(K, { sx: { backgroundColor: "action.hover" }, children: [
310
310
  /* @__PURE__ */ e(y, { sx: { fontWeight: 700, pl: 3 }, children: "Table Name" }),
311
311
  /* @__PURE__ */ e(y, { sx: { fontWeight: 700 }, children: "Status" }),
312
312
  /* @__PURE__ */ e(y, { sx: { fontWeight: 700 }, children: "Changes" })
313
313
  ] }) }),
314
- /* @__PURE__ */ e(Me, { children: f.map((l) => {
315
- const W = Ee[l.status] || Ee.NO_CHANGES;
314
+ /* @__PURE__ */ e(ze, { children: u.map((l) => {
315
+ const W = we[l.status] || we.NO_CHANGES;
316
316
  return /* @__PURE__ */ r(bn.Fragment, { children: [
317
317
  /* @__PURE__ */ r(
318
318
  K,
@@ -344,7 +344,7 @@ function We({
344
344
  }
345
345
  ) }),
346
346
  /* @__PURE__ */ e(y, { children: /* @__PURE__ */ e(
347
- De,
347
+ $e,
348
348
  {
349
349
  changes: l.changes,
350
350
  status: l.status
@@ -377,7 +377,7 @@ function We({
377
377
  R && /* @__PURE__ */ e(x, { sx: { p: 3, borderTop: "1px solid", borderColor: "divider" }, children: /* @__PURE__ */ r(
378
378
  pn,
379
379
  {
380
- expanded: D,
380
+ expanded: $,
381
381
  onChange: () => _((l) => !l),
382
382
  sx: {
383
383
  boxShadow: "none",
@@ -470,28 +470,28 @@ function We({
470
470
  ) })
471
471
  ] }),
472
472
  /* @__PURE__ */ e(te, {}),
473
- /* @__PURE__ */ r(ze, { sx: { px: 3, py: 2, gap: 1 }, children: [
473
+ /* @__PURE__ */ r(De, { sx: { px: 3, py: 2, gap: 1 }, children: [
474
474
  /* @__PURE__ */ e(
475
- M,
475
+ z,
476
476
  {
477
- onClick: z,
477
+ onClick: D,
478
478
  variant: "outlined",
479
479
  size: "small",
480
480
  sx: { borderRadius: 2, textTransform: "none" },
481
- disabled: w,
481
+ disabled: E,
482
482
  children: "Cancel"
483
483
  }
484
484
  ),
485
485
  /* @__PURE__ */ e(
486
- M,
486
+ z,
487
487
  {
488
488
  variant: "contained",
489
489
  size: "small",
490
- disabled: T === 0 || w,
491
- onClick: m,
490
+ disabled: T === 0 || E,
491
+ onClick: c,
492
492
  sx: { borderRadius: 2, textTransform: "none", boxShadow: "none" },
493
- startIcon: w ? null : /* @__PURE__ */ e(I, { iconName: "faCheck" }),
494
- children: w ? "Applying…" : `Apply Import (${T})`
493
+ startIcon: E ? null : /* @__PURE__ */ e(I, { iconName: "faCheck" }),
494
+ children: E ? "Applying…" : `Apply Import (${T})`
495
495
  }
496
496
  )
497
497
  ] })
@@ -512,22 +512,22 @@ We.propTypes = {
512
512
  _e.propTypes = {
513
513
  item: b.object
514
514
  };
515
- De.propTypes = {
515
+ $e.propTypes = {
516
516
  changes: b.object,
517
517
  status: b.string
518
518
  };
519
- const En = Tn(() => import("./TableDetails-Cf_YfnY2.js"));
519
+ const wn = Tn(() => import("./TableDetails-Cf_YfnY2.js"));
520
520
  function An({
521
- tableList: d,
522
- tablesInfo: z,
523
- allTableList: f,
524
- allTablesInfo: m,
525
- formSubmitted: w,
521
+ tableList: s,
522
+ tablesInfo: D,
523
+ allTableList: u,
524
+ allTablesInfo: c,
525
+ formSubmitted: E,
526
526
  reloadComponents: v
527
527
  }) {
528
- const [R, O] = g(""), [D, _] = g(""), [T, l] = g({}), [W, Y] = g({}), [P, Be] = g({}), [Fe, V] = g({}), N = d ? d.filter(
528
+ const [R, O] = f(""), [$, _] = f(""), [T, l] = f({}), [W, Y] = f({}), [L, Be] = f({}), [Fe, V] = f({}), N = s ? s.filter(
529
529
  (n) => n.toLowerCase().includes(R.toLowerCase())
530
- ) : [], [Ke, L] = g(!1), [je, X] = g(!1), [j, Z] = g(), [ae, Q] = g(!1), [Pe, ie] = g(!1), [Le, le] = g(!1), { translate: se } = sn(), de = wn((n) => n.Authenticate.user.id), [h, ce] = g(!1), [E, G] = g(/* @__PURE__ */ new Set()), pe = Sn(null), [Qe, ee] = g(!1), [me, Ge] = g([]), [Ue, H] = g(!1), [He, he] = g({}), [ne, ue] = g("");
530
+ ) : [], [Ke, j] = f(!1), [Pe, X] = f(!1), [P, Z] = f(), [ae, Q] = f(!1), [Le, ie] = f(!1), [je, le] = f(!1), { translate: se } = sn(), de = En((n) => n.Authenticate.user.id), [m, ce] = f(!1), [w, G] = f(/* @__PURE__ */ new Set()), pe = Sn(null), [Qe, ee] = f(!1), [me, Ge] = f([]), [Ue, H] = f(!1), [He, he] = f({}), [ne, ue] = f("");
531
531
  In({
532
532
  defaultValues: {
533
533
  field1: "",
@@ -535,208 +535,191 @@ function An({
535
535
  field3: ""
536
536
  }
537
537
  }), Ie(() => {
538
- let n = {}, t = {};
539
- _(d[0]), n = fe(z), l((i) => ({ ...i, ...n })), t = fe(m), Be((i) => ({ ...i, ...t }));
540
- }, [z, m]), Ie(() => {
541
- Y(() => T[d[0]]), V(() => P[d[0]]);
542
- }, [T, P]);
538
+ let n = {}, i = {};
539
+ _(s[0]), n = fe(D), l((t) => ({ ...t, ...n })), i = fe(c), Be((t) => ({ ...t, ...i }));
540
+ }, [D, c]), Ie(() => {
541
+ Y(() => T[s[0]]), V(() => L[s[0]]);
542
+ }, [T, L]);
543
543
  const Je = (n) => {
544
- const t = n.toLowerCase();
545
- return t.includes("int") || t.includes("timestamp") || t === "boolean" || t.includes("serial") || t.includes("date") ? "INTEGER" : (t.includes("char") || t.includes("text") || t.includes("varchar"), "TEXT");
544
+ const i = n.toLowerCase();
545
+ return i.includes("int") || i.includes("timestamp") || i === "boolean" || i.includes("serial") || i.includes("date") ? "INTEGER" : (i.includes("char") || i.includes("text") || i.includes("varchar"), "TEXT");
546
546
  }, fe = (n) => {
547
- const t = {};
548
- return n.forEach((i) => {
549
- const o = JSON.parse(i.columnInfo), p = Object.keys(o).map((s) => ({
550
- name: s,
551
- type: Je(o[s])
552
- })), a = i.mediaConfiguration ? JSON.parse(i.mediaConfiguration) : null;
553
- t[i.tableName] = {
547
+ const i = {};
548
+ return n.forEach((t) => {
549
+ const o = JSON.parse(t.columnInfo), p = Object.keys(o).map((d) => ({
550
+ name: d,
551
+ type: Je(o[d])
552
+ })), a = t.mediaConfiguration ? JSON.parse(t.mediaConfiguration) : null;
553
+ i[t.tableName] = {
554
554
  columnInfo: p,
555
- modifiedOnQuery: i.modifiedOnQuery ? i.modifiedOnQuery : null,
556
- primaryKey: i.primaryKey ? i.primaryKey : null,
557
- selectQuery: i.selectQuery ? i.selectQuery : null,
558
- userData: i.userData !== void 0 ? i.userData : null,
559
- hasMedia: i.hasMedia !== void 0 ? i.hasMedia : null,
555
+ modifiedOnQuery: t.modifiedOnQuery ? t.modifiedOnQuery : null,
556
+ primaryKey: t.primaryKey ? t.primaryKey : null,
557
+ selectQuery: t.selectQuery ? t.selectQuery : null,
558
+ userData: t.userData !== void 0 ? t.userData : null,
559
+ hasMedia: t.hasMedia !== void 0 ? t.hasMedia : null,
560
560
  mediaConfiguration: a,
561
- syncByDefault: i.syncByDefault ? i.syncByDefault : !1
561
+ syncByDefault: t.syncByDefault ? t.syncByDefault : !1
562
562
  };
563
- }), t;
563
+ }), i;
564
564
  }, qe = () => {
565
565
  Q(!1), X(!0), Z();
566
566
  }, Ye = () => {
567
- L(!1), Q(!0);
567
+ j(!1), Q(!0);
568
568
  }, ge = () => {
569
569
  X(!1);
570
570
  }, Ve = () => {
571
- if (j) {
572
- const n = { ...P[j] };
573
- n && (n.columnInfo = []), _(j), Y(() => n), V(() => P[j]), ie(!0), Q(!1), L(!0);
571
+ if (P) {
572
+ const n = { ...L[P] };
573
+ n && (n.columnInfo = []), _(P), Y(() => n), V(() => L[P]), ie(!0), Q(!1), j(!0);
574
574
  }
575
575
  X(!1), Z(() => "");
576
576
  }, oe = (n) => {
577
- _(n), Y(() => T[n]), V(() => P[n]), L(!1), Q(!1), ie(!1);
577
+ _(n), Y(() => T[n]), V(() => L[n]), j(!1), Q(!1), ie(!1);
578
578
  }, Xe = () => {
579
- if (E.size === 0) return;
579
+ if (w.size === 0) return;
580
580
  const n = {};
581
- E.forEach((a) => {
581
+ w.forEach((a) => {
582
582
  T[a] && (n[a] = T[a]);
583
583
  });
584
- const t = JSON.stringify(
584
+ const i = JSON.stringify(
585
585
  { exportedAt: (/* @__PURE__ */ new Date()).toISOString(), tables: n },
586
586
  null,
587
587
  2
588
- ), i = new Blob([t], { type: "application/json" }), o = URL.createObjectURL(i), p = document.createElement("a");
588
+ ), t = new Blob([i], { type: "application/json" }), o = URL.createObjectURL(t), p = document.createElement("a");
589
589
  p.href = o, p.download = `db_export_${Date.now()}.json`, p.click(), URL.revokeObjectURL(o), ce(!1), G(/* @__PURE__ */ new Set()), F({
590
- message: `Exported ${E.size} table(s) successfully.`,
590
+ message: `Exported ${w.size} table(s) successfully.`,
591
591
  type: "success"
592
592
  });
593
- }, Ze = (n, t) => {
594
- const i = t.columnInfo || [];
593
+ }, Ze = (n, i) => {
594
+ const t = i.columnInfo || [];
595
595
  let o = `CREATE TABLE ${n} (
596
596
  `;
597
- return o += i.map((p) => ` ${p.name} ${p.type}`).join(`,
598
- `), t.primaryKey && (o += `,
599
- CONSTRAINT ${n}_pkey PRIMARY KEY (${t.primaryKey})`), o += `
597
+ return o += t.map((p) => ` ${p.name} ${p.type}`).join(`,
598
+ `), i.primaryKey && (o += `,
599
+ CONSTRAINT ${n}_pkey PRIMARY KEY (${i.primaryKey})`), o += `
600
600
  );`, o;
601
- }, ye = (n, t, i) => {
602
- const o = i.columnInfo || [], p = t.columnInfo || [], a = new Set(o.map((k) => k.name)), c = p.filter((k) => a.has(k.name)).map((k) => k.name).join(", "), S = i.primaryKey, B = o.map((k) => ` ${k.name} ${k.type}`).join(`,
603
- `), $ = S ? `,
601
+ }, ye = (n, i, t) => {
602
+ const o = t.columnInfo || [], p = i.columnInfo || [], a = new Set(o.map((k) => k.name)), g = p.filter((k) => a.has(k.name)).map((k) => k.name).join(", "), S = t.primaryKey, B = o.map((k) => ` ${k.name} ${k.type}`).join(`,
603
+ `), M = S ? `,
604
604
  CONSTRAINT ${n}_dummy_pkey PRIMARY KEY (${S})` : "", re = S ? `,
605
605
  CONSTRAINT ${n}_pkey PRIMARY KEY (${S})` : "";
606
606
  return [
607
- "-- Step 1: Create dummy table with new schema",
608
607
  `CREATE TABLE ${n}_dummy (
609
- ${B}${$}
608
+ ${B}${M}
610
609
  );`,
611
- "-- Step 2: Copy common columns from original",
612
- c ? `INSERT INTO ${n}_dummy (${c})
613
- SELECT ${c} FROM ${n};` : "-- (no common columns to copy)",
614
- "-- Step 3: Drop original table",
610
+ g ? `INSERT INTO ${n}_dummy (${g})
611
+ SELECT ${g} FROM ${n};` : "",
615
612
  `DROP TABLE ${n};`,
616
- "-- Step 4: Recreate original table with new schema",
617
613
  `CREATE TABLE ${n} (
618
614
  ${B}${re}
619
615
  );`,
620
- "-- Step 5: Restore data from dummy",
621
- c ? `INSERT INTO ${n} (${c})
622
- SELECT ${c} FROM ${n}_dummy;` : "-- (no data to restore)",
623
- "-- Step 6: Drop dummy table",
616
+ g ? `INSERT INTO ${n} (${g})
617
+ SELECT ${g} FROM ${n}_dummy;` : "",
624
618
  `DROP TABLE ${n}_dummy;`
625
- ].join(`
619
+ ].filter(Boolean).join(`
626
620
 
627
621
  `);
628
622
  }, J = (n) => (n || "").replace(/\s+/g, " ").trim(), en = (n) => {
629
- const t = n.tables || {};
630
- return Object.entries(t).map(([i, o]) => {
631
- const p = T[i], a = p, s = {
623
+ const i = n.tables || {};
624
+ return Object.entries(i).map(([t, o]) => {
625
+ const p = T[t], a = p, d = {
632
626
  addedColumns: [],
633
627
  removedColumns: [],
634
628
  typeChangedColumns: [],
635
629
  primaryKeyChange: null,
636
630
  settingsChanges: []
637
631
  };
638
- let c = "NO_CHANGES";
632
+ let g = "NO_CHANGES";
639
633
  if (!p)
640
- c = "NEW_TABLE", s.addedColumns = o.columnInfo || [];
634
+ g = "NEW_TABLE", d.addedColumns = o.columnInfo || [];
641
635
  else {
642
636
  const B = new Map(
643
- (o.columnInfo || []).map((u) => [u.name, u.type])
644
- ), $ = new Map(
645
- (a.columnInfo || []).map((u) => [u.name, u.type])
637
+ (o.columnInfo || []).map((h) => [h.name, h.type])
638
+ ), M = new Map(
639
+ (a.columnInfo || []).map((h) => [h.name, h.type])
646
640
  );
647
- if (s.addedColumns = (o.columnInfo || []).filter(
648
- (u) => !$.has(u.name)
649
- ), s.removedColumns = (a.columnInfo || []).filter(
650
- (u) => !B.has(u.name)
651
- ), s.typeChangedColumns = (o.columnInfo || []).filter((u) => $.has(u.name) && $.get(u.name) !== u.type).map((u) => ({
652
- name: u.name,
653
- oldType: $.get(u.name),
654
- newType: u.type
655
- })), s.primaryKeyChange = o.primaryKey !== a.primaryKey ? {
641
+ if (d.addedColumns = (o.columnInfo || []).filter(
642
+ (h) => !M.has(h.name)
643
+ ), d.removedColumns = (a.columnInfo || []).filter(
644
+ (h) => !B.has(h.name)
645
+ ), d.typeChangedColumns = (o.columnInfo || []).filter((h) => M.has(h.name) && M.get(h.name) !== h.type).map((h) => ({
646
+ name: h.name,
647
+ oldType: M.get(h.name),
648
+ newType: h.type
649
+ })), d.primaryKeyChange = o.primaryKey !== a.primaryKey ? {
656
650
  from: a.primaryKey || "(none)",
657
651
  to: o.primaryKey || "(none)"
658
652
  } : null, p) {
659
- const u = [];
653
+ const h = [];
660
654
  [
661
655
  ["syncByDefault", "Sync by Default"],
662
656
  ["userData", "User Data"],
663
657
  ["hasMedia", "Has Media"]
664
658
  ].forEach(([q, an]) => {
665
- String(o[q]) !== String(p[q]) && u.push({
659
+ String(o[q]) !== String(p[q]) && h.push({
666
660
  field: an,
667
661
  from: p[q],
668
662
  to: o[q]
669
663
  });
670
- }), J(o.modifiedOnQuery) !== J(p.modifiedOnQuery) && u.push({
664
+ }), J(o.modifiedOnQuery) !== J(p.modifiedOnQuery) && h.push({
671
665
  field: "Modified On Query",
672
666
  from: "(changed)",
673
667
  to: "(changed)"
674
- }), J(o.selectQuery) !== J(p.selectQuery) && u.push({
668
+ }), J(o.selectQuery) !== J(p.selectQuery) && h.push({
675
669
  field: "Data Fetch Query",
676
670
  from: "(changed)",
677
671
  to: "(changed)"
678
- }), s.settingsChanges = u;
672
+ }), d.settingsChanges = h;
679
673
  }
680
- const re = s.addedColumns.length > 0 || s.removedColumns.length > 0 || s.typeChangedColumns.length > 0 || s.primaryKeyChange, k = s.settingsChanges.length > 0;
681
- c = re || k ? "MODIFIED" : "NO_CHANGES";
674
+ const re = d.addedColumns.length > 0 || d.removedColumns.length > 0 || d.typeChangedColumns.length > 0 || d.primaryKeyChange, k = d.settingsChanges.length > 0;
675
+ g = re || k ? "MODIFIED" : "NO_CHANGES";
682
676
  }
683
677
  let S = "";
684
- return c === "NEW_TABLE" ? S = Ze(i, o) : c !== "NO_CHANGES" && (s.addedColumns.length > 0 || s.removedColumns.length > 0 || s.typeChangedColumns.length > 0 || s.primaryKeyChange) && (S = ye(
685
- i,
678
+ return g === "NEW_TABLE" ? S = Ze(t, o) : g !== "NO_CHANGES" && (d.addedColumns.length > 0 || d.removedColumns.length > 0 || d.typeChangedColumns.length > 0 || d.primaryKeyChange) && (S = ye(
679
+ t,
686
680
  a,
687
681
  o
688
682
  )), {
689
- tableName: i,
690
- status: c,
691
- changes: s,
683
+ tableName: t,
684
+ status: g,
685
+ changes: d,
692
686
  importedTable: o,
693
687
  existingTable: a,
694
688
  migrationScript: S
695
689
  };
696
690
  });
697
691
  }, nn = (n) => {
698
- let t = "";
692
+ let i = "";
699
693
  return n.filter((o) => o.status !== "NO_CHANGES").forEach((o) => {
700
- var p, a, s;
701
- o.migrationScript && (t += `-- ==================================================
702
- `, t += `-- Table: ${o.tableName}
703
- `, o.status === "NEW_TABLE" ? t += `-- Changes: New Table
704
- ` : (t += `-- Changes:
705
- `, (p = o.changes.addedColumns) != null && p.length && (t += `-- Added: ${o.changes.addedColumns.map((c) => c.name).join(", ")}
706
- `), (a = o.changes.removedColumns) != null && a.length && (t += `-- Removed: ${o.changes.removedColumns.map((c) => c.name).join(", ")}
707
- `), (s = o.changes.typeChangedColumns) != null && s.length && (t += `-- Modified types: ${o.changes.typeChangedColumns.map((c) => `${c.name} (${c.oldType} -> ${c.newType})`).join(", ")}
708
- `), o.changes.primaryKeyChange && (t += `-- Primary Key Changed
709
- `)), t += `-- ==================================================
710
-
711
- `, t += o.migrationScript.trim() + `
694
+ o.migrationScript && (i += o.migrationScript.trim() + `
712
695
 
713
696
  `);
714
- }), t;
697
+ }), i;
715
698
  }, on = (n) => {
716
699
  var o;
717
- const t = (o = n.target.files) == null ? void 0 : o[0];
718
- if (!t) return;
719
- const i = new FileReader();
720
- i.onload = (p) => {
700
+ const i = (o = n.target.files) == null ? void 0 : o[0];
701
+ if (!i) return;
702
+ const t = new FileReader();
703
+ t.onload = (p) => {
721
704
  try {
722
705
  const a = JSON.parse(p.target.result);
723
706
  if (!a.tables)
724
707
  throw new Error("Invalid format: missing 'tables' key.");
725
- const s = en(a);
726
- Ge(s);
727
- const c = nn(s);
728
- ue(c), xe({ code: "MFA_MIGRATION_MASTER_GET_LATEST_VERSIONS" }).then((S) => {
729
- var B, $;
730
- he((($ = (B = S == null ? void 0 : S.data) == null ? void 0 : B.result) == null ? void 0 : $[0]) || {});
708
+ const d = en(a);
709
+ Ge(d);
710
+ const g = nn(d);
711
+ ue(g), xe({ code: "MFA_MIGRATION_MASTER_GET_LATEST_VERSIONS" }).then((S) => {
712
+ var B, M;
713
+ he(((M = (B = S == null ? void 0 : S.data) == null ? void 0 : B.result) == null ? void 0 : M[0]) || {});
731
714
  }).catch(() => he({})), ee(!0);
732
715
  } catch (a) {
733
716
  F({ message: `Import failed: ${a.message}`, type: "error" });
734
717
  }
735
- }, i.readAsText(t), n.target.value = "";
718
+ }, t.readAsText(i), n.target.value = "";
736
719
  }, rn = (n) => {
737
720
  ue(n);
738
721
  }, tn = async () => {
739
- var i;
722
+ var t;
740
723
  const n = me.filter(
741
724
  (o) => o.status !== "NO_CHANGES"
742
725
  );
@@ -745,16 +728,16 @@ SELECT ${c} FROM ${n}_dummy;` : "-- (no data to restore)",
745
728
  return;
746
729
  }
747
730
  H(!0);
748
- const t = n.map((o, p) => {
749
- const a = o.importedTable, s = {};
750
- return (a.columnInfo || []).forEach((c) => {
751
- s[c.name] = c.type;
731
+ const i = n.map((o, p) => {
732
+ const a = o.importedTable, d = {};
733
+ return (a.columnInfo || []).forEach((g) => {
734
+ d[g.name] = g.type;
752
735
  }), {
753
736
  code: "update_mobile_entity",
754
737
  parameters: {
755
738
  tableName: o.tableName || "",
756
739
  syncByDefault: !!a.syncByDefault,
757
- columnInfo: JSON.stringify(s) || "",
740
+ columnInfo: JSON.stringify(d) || "",
758
741
  primaryKey: a.primaryKey || "",
759
742
  modifiedOnQuery: a.modifiedOnQuery || "",
760
743
  selectQuery: a.selectQuery || "",
@@ -768,11 +751,11 @@ SELECT ${c} FROM ${n}_dummy;` : "-- (no data to restore)",
768
751
  };
769
752
  });
770
753
  try {
771
- const o = (await dn(t)).data;
754
+ const o = (await dn(i)).data;
772
755
  if (o == null ? void 0 : o.some((a) => a.status === 0)) {
773
- const a = o.findIndex((S) => S.status === 0), s = n[a], c = ((i = o[a]) == null ? void 0 : i.message) || "Unknown error";
756
+ const a = o.findIndex((S) => S.status === 0), d = n[a], g = ((t = o[a]) == null ? void 0 : t.message) || "Unknown error";
774
757
  F({
775
- message: `Failed to save ${s.tableName}: ${c}`,
758
+ message: `Failed to save ${d.tableName}: ${g}`,
776
759
  type: "error"
777
760
  }), H(!1);
778
761
  return;
@@ -860,42 +843,42 @@ SELECT ${c} FROM ${n}_dummy;` : "-- (no data to restore)",
860
843
  /* @__PURE__ */ e(
861
844
  U,
862
845
  {
863
- title: h ? "Cancel export mode" : "Export selected tables as JSON",
846
+ title: m ? "Cancel export mode" : "Export selected tables as JSON",
864
847
  arrow: !0,
865
848
  children: /* @__PURE__ */ e(
866
- M,
849
+ z,
867
850
  {
868
- variant: h ? "contained" : "outlined",
851
+ variant: m ? "contained" : "outlined",
869
852
  size: "small",
870
- color: h ? "warning" : "inherit",
853
+ color: m ? "warning" : "inherit",
871
854
  sx: {
872
855
  borderRadius: 2,
873
856
  fontWeight: 600,
874
857
  px: 2,
875
858
  textTransform: "none",
876
859
  borderColor: "divider",
877
- color: h ? "white" : "text.primary",
860
+ color: m ? "white" : "text.primary",
878
861
  "&:hover": {
879
- backgroundColor: h ? "warning.dark" : "action.hover",
862
+ backgroundColor: m ? "warning.dark" : "action.hover",
880
863
  borderColor: "text.disabled"
881
864
  }
882
865
  },
883
866
  startIcon: /* @__PURE__ */ e(
884
867
  I,
885
868
  {
886
- iconName: h ? "faXmark" : "faFileExport"
869
+ iconName: m ? "faXmark" : "faFileExport"
887
870
  }
888
871
  ),
889
872
  onClick: () => {
890
873
  ce((n) => !n), G(/* @__PURE__ */ new Set());
891
874
  },
892
- children: h ? "Cancel Export" : "Export"
875
+ children: m ? "Cancel Export" : "Export"
893
876
  }
894
877
  )
895
878
  }
896
879
  ),
897
880
  /* @__PURE__ */ e(U, { title: "Import table configuration from JSON", arrow: !0, children: /* @__PURE__ */ e(
898
- M,
881
+ z,
899
882
  {
900
883
  variant: "outlined",
901
884
  size: "small",
@@ -920,7 +903,7 @@ SELECT ${c} FROM ${n}_dummy;` : "-- (no data to restore)",
920
903
  }
921
904
  ) }),
922
905
  /* @__PURE__ */ e(
923
- M,
906
+ z,
924
907
  {
925
908
  variant: "outlined",
926
909
  size: "small",
@@ -942,7 +925,7 @@ SELECT ${c} FROM ${n}_dummy;` : "-- (no data to restore)",
942
925
  }
943
926
  ),
944
927
  /* @__PURE__ */ e(
945
- M,
928
+ z,
946
929
  {
947
930
  size: "small",
948
931
  variant: "contained",
@@ -984,7 +967,7 @@ SELECT ${c} FROM ${n}_dummy;` : "-- (no data to restore)",
984
967
  /* @__PURE__ */ e(
985
968
  A,
986
969
  {
987
- label: `${(d == null ? void 0 : d.length) || 0} Synced`,
970
+ label: `${(s == null ? void 0 : s.length) || 0} Synced`,
988
971
  size: "small",
989
972
  color: "primary",
990
973
  variant: "filled",
@@ -994,7 +977,7 @@ SELECT ${c} FROM ${n}_dummy;` : "-- (no data to restore)",
994
977
  /* @__PURE__ */ e(
995
978
  A,
996
979
  {
997
- label: `${(f == null ? void 0 : f.length) || 0} Total`,
980
+ label: `${(u == null ? void 0 : u.length) || 0} Total`,
998
981
  size: "small",
999
982
  variant: "outlined",
1000
983
  sx: {
@@ -1028,8 +1011,8 @@ SELECT ${c} FROM ${n}_dummy;` : "-- (no data to restore)",
1028
1011
  )
1029
1012
  ] }),
1030
1013
  /* @__PURE__ */ e(te, { sx: { my: 3 } }),
1031
- /* @__PURE__ */ r(we, { container: !0, spacing: 2.5, children: [
1032
- /* @__PURE__ */ e(we, { size: 3, children: /* @__PURE__ */ r(
1014
+ /* @__PURE__ */ r(Ee, { container: !0, spacing: 2.5, children: [
1015
+ /* @__PURE__ */ e(Ee, { size: 3, children: /* @__PURE__ */ r(
1033
1016
  be,
1034
1017
  {
1035
1018
  variant: "outlined",
@@ -1047,9 +1030,9 @@ SELECT ${c} FROM ${n}_dummy;` : "-- (no data to restore)",
1047
1030
  sx: {
1048
1031
  px: 2,
1049
1032
  py: 1.5,
1050
- backgroundColor: h ? "warning.50" : "action.hover",
1033
+ backgroundColor: m ? "warning.50" : "action.hover",
1051
1034
  borderBottom: "1px solid",
1052
- borderColor: h ? "warning.300" : "divider",
1035
+ borderColor: m ? "warning.300" : "divider",
1053
1036
  transition: "background-color 0.2s"
1054
1037
  },
1055
1038
  children: [
@@ -1068,22 +1051,22 @@ SELECT ${c} FROM ${n}_dummy;` : "-- (no data to restore)",
1068
1051
  variant: "subtitle2",
1069
1052
  sx: {
1070
1053
  fontWeight: 700,
1071
- color: h ? "warning.dark" : "text.primary"
1054
+ color: m ? "warning.dark" : "text.primary"
1072
1055
  },
1073
- children: h ? "Select Tables to Export" : se("Synced Tables")
1056
+ children: m ? "Select Tables to Export" : se("Synced Tables")
1074
1057
  }
1075
1058
  ),
1076
- h && /* @__PURE__ */ e(
1059
+ m && /* @__PURE__ */ e(
1077
1060
  U,
1078
1061
  {
1079
- title: E.size === N.length ? "Deselect all" : "Select all",
1062
+ title: w.size === N.length ? "Deselect all" : "Select all",
1080
1063
  arrow: !0,
1081
1064
  children: /* @__PURE__ */ e(
1082
1065
  ve,
1083
1066
  {
1084
1067
  size: "small",
1085
- checked: N.length > 0 && E.size === N.length,
1086
- indeterminate: E.size > 0 && E.size < N.length,
1068
+ checked: N.length > 0 && w.size === N.length,
1069
+ indeterminate: w.size > 0 && w.size < N.length,
1087
1070
  onChange: (n) => {
1088
1071
  n.target.checked ? G(new Set(N)) : G(/* @__PURE__ */ new Set());
1089
1072
  },
@@ -1099,26 +1082,26 @@ SELECT ${c} FROM ${n}_dummy;` : "-- (no data to restore)",
1099
1082
  C,
1100
1083
  {
1101
1084
  variant: "caption",
1102
- color: h ? "warning.dark" : "text.secondary",
1103
- children: h ? `${E.size} of ${N.length} selected` : `${N.length} of ${(d == null ? void 0 : d.length) || 0} tables`
1085
+ color: m ? "warning.dark" : "text.secondary",
1086
+ children: m ? `${w.size} of ${N.length} selected` : `${N.length} of ${(s == null ? void 0 : s.length) || 0} tables`
1104
1087
  }
1105
1088
  )
1106
1089
  ]
1107
1090
  }
1108
1091
  ),
1109
- /* @__PURE__ */ e(x, { sx: { overflowY: "auto", flex: 1 }, children: N.length ? /* @__PURE__ */ e(fn, { disablePadding: !0, children: N.map((n, t) => {
1110
- const i = D === n;
1092
+ /* @__PURE__ */ e(x, { sx: { overflowY: "auto", flex: 1 }, children: N.length ? /* @__PURE__ */ e(fn, { disablePadding: !0, children: N.map((n, i) => {
1093
+ const t = $ === n;
1111
1094
  return /* @__PURE__ */ e(
1112
1095
  gn,
1113
1096
  {
1114
1097
  disablePadding: !0,
1115
- secondaryAction: !h && /* @__PURE__ */ r(
1098
+ secondaryAction: !m && /* @__PURE__ */ r(
1116
1099
  x,
1117
1100
  {
1118
1101
  sx: {
1119
1102
  display: "flex",
1120
1103
  gap: 0.25,
1121
- opacity: i ? 1 : 0,
1104
+ opacity: t ? 1 : 0,
1122
1105
  transition: "opacity 0.2s"
1123
1106
  },
1124
1107
  children: [
@@ -1133,7 +1116,7 @@ SELECT ${c} FROM ${n}_dummy;` : "-- (no data to restore)",
1133
1116
  {
1134
1117
  size: "small",
1135
1118
  onClick: (o) => {
1136
- o.stopPropagation(), oe(n), L(!0);
1119
+ o.stopPropagation(), oe(n), j(!0);
1137
1120
  },
1138
1121
  sx: {
1139
1122
  color: "primary.main",
@@ -1186,17 +1169,17 @@ SELECT ${c} FROM ${n}_dummy;` : "-- (no data to restore)",
1186
1169
  }
1187
1170
  ),
1188
1171
  sx: {
1189
- borderBottom: t === N.length - 1 ? "none" : "1px solid",
1172
+ borderBottom: i === N.length - 1 ? "none" : "1px solid",
1190
1173
  borderColor: "divider",
1191
1174
  "&:hover .MuiBox-root": { opacity: "1 !important" }
1192
1175
  },
1193
1176
  children: /* @__PURE__ */ r(
1194
1177
  yn,
1195
1178
  {
1196
- selected: i && !h,
1179
+ selected: t && !m,
1197
1180
  onClick: () => {
1198
- if (h) {
1199
- const o = new Set(E);
1181
+ if (m) {
1182
+ const o = new Set(w);
1200
1183
  o.has(n) ? o.delete(n) : o.add(n), G(o);
1201
1184
  } else
1202
1185
  oe(n);
@@ -1205,7 +1188,7 @@ SELECT ${c} FROM ${n}_dummy;` : "-- (no data to restore)",
1205
1188
  py: 1,
1206
1189
  px: 2,
1207
1190
  transition: "all 0.15s ease",
1208
- ...h ? {} : {
1191
+ ...m ? {} : {
1209
1192
  "&.Mui-selected": {
1210
1193
  backgroundColor: "primary.50",
1211
1194
  borderLeft: "3px solid",
@@ -1220,11 +1203,11 @@ SELECT ${c} FROM ${n}_dummy;` : "-- (no data to restore)",
1220
1203
  }
1221
1204
  },
1222
1205
  children: [
1223
- h && /* @__PURE__ */ e(
1206
+ m && /* @__PURE__ */ e(
1224
1207
  ve,
1225
1208
  {
1226
1209
  size: "small",
1227
- checked: E.has(n),
1210
+ checked: w.has(n),
1228
1211
  disableRipple: !0,
1229
1212
  sx: { p: 0, mr: 1.5 }
1230
1213
  }
@@ -1237,8 +1220,8 @@ SELECT ${c} FROM ${n}_dummy;` : "-- (no data to restore)",
1237
1220
  {
1238
1221
  variant: "body2",
1239
1222
  sx: {
1240
- fontWeight: i && !h ? 600 : 400,
1241
- color: i && !h ? "primary.dark" : "text.primary",
1223
+ fontWeight: t && !m ? 600 : 400,
1224
+ color: t && !m ? "primary.dark" : "text.primary",
1242
1225
  fontSize: "0.82rem",
1243
1226
  overflow: "hidden",
1244
1227
  textOverflow: "ellipsis",
@@ -1254,7 +1237,7 @@ SELECT ${c} FROM ${n}_dummy;` : "-- (no data to restore)",
1254
1237
  }
1255
1238
  )
1256
1239
  },
1257
- t + 1
1240
+ i + 1
1258
1241
  );
1259
1242
  }) }) : /* @__PURE__ */ r(x, { sx: { p: 3, textAlign: "center" }, children: [
1260
1243
  /* @__PURE__ */ e(
@@ -1270,11 +1253,11 @@ SELECT ${c} FROM ${n}_dummy;` : "-- (no data to restore)",
1270
1253
  variant: "body2",
1271
1254
  color: "text.secondary",
1272
1255
  sx: { mt: 1 },
1273
- children: d.length < 1 ? "No tables synced" : "No tables match your search."
1256
+ children: s.length < 1 ? "No tables synced" : "No tables match your search."
1274
1257
  }
1275
1258
  )
1276
1259
  ] }) }),
1277
- h && /* @__PURE__ */ r(
1260
+ m && /* @__PURE__ */ r(
1278
1261
  x,
1279
1262
  {
1280
1263
  sx: {
@@ -1288,16 +1271,16 @@ SELECT ${c} FROM ${n}_dummy;` : "-- (no data to restore)",
1288
1271
  },
1289
1272
  children: [
1290
1273
  /* @__PURE__ */ r(C, { variant: "body2", sx: { fontWeight: 600 }, children: [
1291
- E.size,
1274
+ w.size,
1292
1275
  " selected"
1293
1276
  ] }),
1294
1277
  /* @__PURE__ */ e(
1295
- M,
1278
+ z,
1296
1279
  {
1297
1280
  variant: "contained",
1298
1281
  size: "small",
1299
1282
  color: "primary",
1300
- disabled: E.size === 0,
1283
+ disabled: w.size === 0,
1301
1284
  onClick: Xe,
1302
1285
  startIcon: /* @__PURE__ */ e(I, { iconName: "faDownload" }),
1303
1286
  sx: {
@@ -1314,20 +1297,20 @@ SELECT ${c} FROM ${n}_dummy;` : "-- (no data to restore)",
1314
1297
  ]
1315
1298
  }
1316
1299
  ) }),
1317
- /* @__PURE__ */ e(vn, { children: (!!D && !!W || ae) && /* @__PURE__ */ e(
1318
- En,
1300
+ /* @__PURE__ */ e(vn, { children: (!!$ && !!W || ae) && /* @__PURE__ */ e(
1301
+ wn,
1319
1302
  {
1320
1303
  tableInfo: W,
1321
- table: D,
1304
+ table: $,
1322
1305
  isEditMode: Ke,
1323
- updateEditMode: L,
1306
+ updateEditMode: j,
1324
1307
  tableCompleteInfo: Fe,
1325
- formSubmitted: w,
1308
+ formSubmitted: E,
1326
1309
  reloadComponents: v,
1327
1310
  isCreateTableMode: ae,
1328
- isSyncTableMode: Pe,
1311
+ isSyncTableMode: Le,
1329
1312
  updateCreateTableMode: Q,
1330
- openDeleteModal: Le,
1313
+ openDeleteModal: je,
1331
1314
  setOpenDeleteModal: le,
1332
1315
  generateRebuildScript: ye
1333
1316
  }
@@ -1339,7 +1322,7 @@ SELECT ${c} FROM ${n}_dummy;` : "-- (no data to restore)",
1339
1322
  /* @__PURE__ */ r(
1340
1323
  Ae,
1341
1324
  {
1342
- open: je,
1325
+ open: Pe,
1343
1326
  onClose: ge,
1344
1327
  maxWidth: "sm",
1345
1328
  fullWidth: !0,
@@ -1354,10 +1337,10 @@ SELECT ${c} FROM ${n}_dummy;` : "-- (no data to restore)",
1354
1337
  /* @__PURE__ */ e(Ne, { children: /* @__PURE__ */ e(
1355
1338
  Cn,
1356
1339
  {
1357
- options: f.filter((n) => !d.includes(n)),
1340
+ options: u.filter((n) => !s.includes(n)),
1358
1341
  getOptionLabel: (n) => n,
1359
- value: j,
1360
- onChange: (n, t) => Z(t),
1342
+ value: P,
1343
+ onChange: (n, i) => Z(i),
1361
1344
  renderInput: (n) => /* @__PURE__ */ e(
1362
1345
  Se,
1363
1346
  {
@@ -1370,9 +1353,9 @@ SELECT ${c} FROM ${n}_dummy;` : "-- (no data to restore)",
1370
1353
  )
1371
1354
  }
1372
1355
  ) }),
1373
- /* @__PURE__ */ r(ze, { sx: { px: 3, pb: 2 }, children: [
1356
+ /* @__PURE__ */ r(De, { sx: { px: 3, pb: 2 }, children: [
1374
1357
  /* @__PURE__ */ e(
1375
- M,
1358
+ z,
1376
1359
  {
1377
1360
  onClick: ge,
1378
1361
  variant: "outlined",
@@ -1382,12 +1365,12 @@ SELECT ${c} FROM ${n}_dummy;` : "-- (no data to restore)",
1382
1365
  }
1383
1366
  ),
1384
1367
  /* @__PURE__ */ e(
1385
- M,
1368
+ z,
1386
1369
  {
1387
1370
  variant: "contained",
1388
1371
  size: "small",
1389
1372
  onClick: () => Ve(),
1390
- disabled: !j,
1373
+ disabled: !P,
1391
1374
  sx: { borderRadius: 2, textTransform: "none", boxShadow: "none" },
1392
1375
  children: "Sync Table"
1393
1376
  }
@@ -1422,4 +1405,4 @@ An.propTypes = {
1422
1405
  export {
1423
1406
  An as default
1424
1407
  };
1425
- //# sourceMappingURL=TableList-HGbEN4bv.js.map
1408
+ //# sourceMappingURL=TableList-D6jnIbnz.js.map