@argusoft/medplat-core 1.0.28 → 1.0.30

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (229) hide show
  1. package/dist/AccessRights-xrday-L1.js +1023 -0
  2. package/dist/AccessRights-xrday-L1.js.map +1 -0
  3. package/dist/AddEditQueryBuilder-D-iQiVIe.js +365 -0
  4. package/dist/AddEditQueryBuilder-D-iQiVIe.js.map +1 -0
  5. package/dist/{AddFeatures-C0Z29oSd.js → AddFeatures-D1sU8RjY.js} +2 -2
  6. package/dist/{AddFeatures-C0Z29oSd.js.map → AddFeatures-D1sU8RjY.js.map} +1 -1
  7. package/dist/AddLabelModal-Bq-wRqv9.js +631 -0
  8. package/dist/AddLabelModal-Bq-wRqv9.js.map +1 -0
  9. package/dist/AddMenuConfiguration-e5BVXhmw.js +8547 -0
  10. package/dist/AddMenuConfiguration-e5BVXhmw.js.map +1 -0
  11. package/dist/{AddRoleDrawer-CQdzQZLb.js → AddRoleDrawer-0gqAK8N0.js} +62 -63
  12. package/dist/AddRoleDrawer-0gqAK8N0.js.map +1 -0
  13. package/dist/AppModal-CCtrQ5Tr.js +394 -0
  14. package/dist/AppModal-CCtrQ5Tr.js.map +1 -0
  15. package/dist/BrandsPage-DmRW5bhm-Bk1szrjI.js +387 -0
  16. package/dist/BrandsPage-DmRW5bhm-Bk1szrjI.js.map +1 -0
  17. package/dist/CategoriesPage-BsS5IQh3-B03lWRY5.js +391 -0
  18. package/dist/CategoriesPage-BsS5IQh3-B03lWRY5.js.map +1 -0
  19. package/dist/{ChangePasswordModalCore-CDxkeIIM.js → ChangePasswordModalCore-BPsJquTS.js} +1606 -1611
  20. package/dist/ChangePasswordModalCore-BPsJquTS.js.map +1 -0
  21. package/dist/{ConditionConfig-DSsgGEXS.js → ConditionConfig-Ddz9halE.js} +2 -2
  22. package/dist/ConditionConfig-Ddz9halE.js.map +1 -0
  23. package/dist/DashboardPage-C3bKc5na-sBd9Yqbi.js +435 -0
  24. package/dist/DashboardPage-C3bKc5na-sBd9Yqbi.js.map +1 -0
  25. package/dist/{EntityManagement-GaYsBTvf.js → EntityManagement-CPQL6qBj.js} +2 -2
  26. package/dist/{EntityManagement-GaYsBTvf.js.map → EntityManagement-CPQL6qBj.js.map} +1 -1
  27. package/dist/EventConfig-BmLemzX3.js +26 -0
  28. package/dist/EventConfig-BmLemzX3.js.map +1 -0
  29. package/dist/{EventConfigurations-kNtAj_WM.js → EventConfigurations-Bzh1qWXU.js} +31 -30
  30. package/dist/{EventConfigurations-kNtAj_WM.js.map → EventConfigurations-Bzh1qWXU.js.map} +1 -1
  31. package/dist/{EventsExceptionModal-D4Bf1ilS.js → EventsExceptionModal-B2SRrnB1.js} +2 -2
  32. package/dist/{EventsExceptionModal-D4Bf1ilS.js.map → EventsExceptionModal-B2SRrnB1.js.map} +1 -1
  33. package/dist/EventsSkeleton-BIcPks4T.js +61 -0
  34. package/dist/EventsSkeleton-BIcPks4T.js.map +1 -0
  35. package/dist/FacilityPicker-BiZeupmP-CyPHmj6b.js +79 -0
  36. package/dist/FacilityPicker-BiZeupmP-CyPHmj6b.js.map +1 -0
  37. package/dist/FeatureMenu-DYJmDt7q.js +521 -0
  38. package/dist/FeatureMenu-DYJmDt7q.js.map +1 -0
  39. package/dist/Features-Dne21RWu.js +14 -0
  40. package/dist/Features-Dne21RWu.js.map +1 -0
  41. package/dist/{FhirServerList-Dkq7Kbes.js → FhirServerList-DuTwnngN.js} +19 -19
  42. package/dist/{FhirServerList-Dkq7Kbes.js.map → FhirServerList-DuTwnngN.js.map} +1 -1
  43. package/dist/{FhirServerWizard-Db6Hm4bQ.js → FhirServerWizard-DZI8Olku.js} +15 -15
  44. package/dist/{FhirServerWizard-Db6Hm4bQ.js.map → FhirServerWizard-DZI8Olku.js.map} +1 -1
  45. package/dist/FlywayQuery-CQygj51V.js +179 -0
  46. package/dist/FlywayQuery-CQygj51V.js.map +1 -0
  47. package/dist/{ManageNotification-CaBAOhji.js → Google-DQxMfbaL.js} +1725 -2652
  48. package/dist/{ManageNotification-CaBAOhji.js.map → Google-DQxMfbaL.js.map} +1 -1
  49. package/dist/GrantPermissionModal-BDN66Atn.js +236 -0
  50. package/dist/GrantPermissionModal-BDN66Atn.js.map +1 -0
  51. package/dist/ImmunizationConfigurationBase-Di1KO3oW.js +7639 -0
  52. package/dist/ImmunizationConfigurationBase-Di1KO3oW.js.map +1 -0
  53. package/dist/ImmunizationConfigurationBase.css +1 -1
  54. package/dist/ImmunizationConfigurationsList-TZcLDEci.js +369 -0
  55. package/dist/ImmunizationConfigurationsList-TZcLDEci.js.map +1 -0
  56. package/dist/InventoryPage-C_AxSy7A-QLvlL4rE.js +665 -0
  57. package/dist/InventoryPage-C_AxSy7A-QLvlL4rE.js.map +1 -0
  58. package/dist/LanguagesModal-B3NTebYT.js +352 -0
  59. package/dist/LanguagesModal-B3NTebYT.js.map +1 -0
  60. package/dist/ManageDynamicFeature-BU0I45dd.js +4475 -0
  61. package/dist/ManageDynamicFeature-BU0I45dd.js.map +1 -0
  62. package/dist/{ManageEventConfiguration-DV3I5POA.js → ManageEventConfiguration-CoYcpjR9.js} +465 -397
  63. package/dist/ManageEventConfiguration-CoYcpjR9.js.map +1 -0
  64. package/dist/ManageNotification-C5MhV77Q.js +934 -0
  65. package/dist/ManageNotification-C5MhV77Q.js.map +1 -0
  66. package/dist/{ManageRole-CGYfglpo.js → ManageRole-CNZBRKGU.js} +32 -30
  67. package/dist/ManageRole-CNZBRKGU.js.map +1 -0
  68. package/dist/ManageTranslation-vRiptUAP.js +833 -0
  69. package/dist/ManageTranslation-vRiptUAP.js.map +1 -0
  70. package/dist/ManageTranslation.css +1 -1
  71. package/dist/{ManageUser-AY1EUDLI.js → ManageUser-DCFkUMV9.js} +1722 -1586
  72. package/dist/ManageUser-DCFkUMV9.js.map +1 -0
  73. package/dist/MemberProfileCard-BdUNgHRB-VywqQdFF.js +272 -0
  74. package/dist/MemberProfileCard-BdUNgHRB-VywqQdFF.js.map +1 -0
  75. package/dist/MobileAnalytics-pQoE8cG1.js +16888 -0
  76. package/dist/MobileAnalytics-pQoE8cG1.js.map +1 -0
  77. package/dist/MobileMenuManagement-Cf8IZlla.js +108 -0
  78. package/dist/MobileMenuManagement-Cf8IZlla.js.map +1 -0
  79. package/dist/{MobileTypeEventConfigModal-BxLympIO.js → MobileTypeEventConfigModal-BeveaX0C.js} +2 -2
  80. package/dist/MobileTypeEventConfigModal-BeveaX0C.js.map +1 -0
  81. package/dist/NotificationFlywayQuery-BAHVjf6N.js +247 -0
  82. package/dist/NotificationFlywayQuery-BAHVjf6N.js.map +1 -0
  83. package/dist/{NotificationList-C3Vb_jKU.js → NotificationList-DEyRZEuM.js} +109 -110
  84. package/dist/NotificationList-DEyRZEuM.js.map +1 -0
  85. package/dist/{OtherTypeEventConfigModal-BeG1GrUi.js → OtherTypeEventConfigModal-CM6VkdmY.js} +570 -478
  86. package/dist/OtherTypeEventConfigModal-CM6VkdmY.js.map +1 -0
  87. package/dist/PaymentCreatePage-CIVe0P0p-25BQVpOX.js +482 -0
  88. package/dist/PaymentCreatePage-CIVe0P0p-25BQVpOX.js.map +1 -0
  89. package/dist/PaymentsPage-BvPe5Q9F-D2gfziwW.js +157 -0
  90. package/dist/PaymentsPage-BvPe5Q9F-D2gfziwW.js.map +1 -0
  91. package/dist/PermissionsModal-CCYkcKlC.js +151 -0
  92. package/dist/PermissionsModal-CCYkcKlC.js.map +1 -0
  93. package/dist/PickupBatchLinesEditor-DHmcAG23-DL2p6IKJ.js +119 -0
  94. package/dist/PickupBatchLinesEditor-DHmcAG23-DL2p6IKJ.js.map +1 -0
  95. package/dist/PickupCreatePage-CB0Sl0Hb-Mmj7zESG.js +783 -0
  96. package/dist/PickupCreatePage-CB0Sl0Hb-Mmj7zESG.js.map +1 -0
  97. package/dist/PickupsPage-Ctpghavs-CUp4uIZq.js +818 -0
  98. package/dist/PickupsPage-Ctpghavs-CUp4uIZq.js.map +1 -0
  99. package/dist/PmGuard-b10TGXEi-G3N0G_Wg.js +599 -0
  100. package/dist/PmGuard-b10TGXEi-G3N0G_Wg.js.map +1 -0
  101. package/dist/ProductEditPage-C1thoKHu-URQaZ6st.js +1302 -0
  102. package/dist/ProductEditPage-C1thoKHu-URQaZ6st.js.map +1 -0
  103. package/dist/ProductsPage-CupVmOD4-D45a_hf-.js +252 -0
  104. package/dist/ProductsPage-CupVmOD4-D45a_hf-.js.map +1 -0
  105. package/dist/PurchaseCreatePage-YD3NmhPQ-2j4etSjM.js +648 -0
  106. package/dist/PurchaseCreatePage-YD3NmhPQ-2j4etSjM.js.map +1 -0
  107. package/dist/PurchaseRequestDetailPage-Dg_MRY_N-D1bgTEAn.js +1577 -0
  108. package/dist/PurchaseRequestDetailPage-Dg_MRY_N-D1bgTEAn.js.map +1 -0
  109. package/dist/PurchaseRequestsPage-DPAPzpmm-mDH2IrTl.js +279 -0
  110. package/dist/PurchaseRequestsPage-DPAPzpmm-mDH2IrTl.js.map +1 -0
  111. package/dist/PurchasesPage-It1GHiXl-eH4IsF_U.js +293 -0
  112. package/dist/PurchasesPage-It1GHiXl-eH4IsF_U.js.map +1 -0
  113. package/dist/QueryBuilder-CXaBe6sr.js +478 -0
  114. package/dist/QueryBuilder-CXaBe6sr.js.map +1 -0
  115. package/dist/{RoleManagement-BPl2cE27.js → RoleManagement-s8iNx2Mu.js} +131 -142
  116. package/dist/RoleManagement-s8iNx2Mu.js.map +1 -0
  117. package/dist/Roles-BIyiic67.js +14 -0
  118. package/dist/Roles-BIyiic67.js.map +1 -0
  119. package/dist/SaleCreatePage-C9kFmTvm-B3Y0o4CX.js +544 -0
  120. package/dist/SaleCreatePage-C9kFmTvm-B3Y0o4CX.js.map +1 -0
  121. package/dist/SalesPage-D18DCseD-BxktGDRQ.js +315 -0
  122. package/dist/SalesPage-D18DCseD-BxktGDRQ.js.map +1 -0
  123. package/dist/{ServerSyncModal-D_oFpv3C.js → ServerSyncModal-92U3xtqI.js} +84 -85
  124. package/dist/ServerSyncModal-92U3xtqI.js.map +1 -0
  125. package/dist/SettingsPage-VsxI-ano-DcmtUUEj.js +747 -0
  126. package/dist/SettingsPage-VsxI-ano-DcmtUUEj.js.map +1 -0
  127. package/dist/ShowFlywayQuery-D10Olk5Z.js +154 -0
  128. package/dist/ShowFlywayQuery-D10Olk5Z.js.map +1 -0
  129. package/dist/{ShowFlywayQuery-DVRCd384.js → ShowFlywayQuery-D1y_4A1u.js} +161 -121
  130. package/dist/ShowFlywayQuery-D1y_4A1u.js.map +1 -0
  131. package/dist/ShowQueryHistory-DRBKYDKk.js +313 -0
  132. package/dist/ShowQueryHistory-DRBKYDKk.js.map +1 -0
  133. package/dist/StorageUnitsPage-7EqwuMOI-BwUso1Th.js +721 -0
  134. package/dist/StorageUnitsPage-7EqwuMOI-BwUso1Th.js.map +1 -0
  135. package/dist/SubMenu-eEDhZUvh.js +317 -0
  136. package/dist/SubMenu-eEDhZUvh.js.map +1 -0
  137. package/dist/{TableDetails-Cf_YfnY2.js → TableDetails-BtafRxXb.js} +1069 -831
  138. package/dist/TableDetails-BtafRxXb.js.map +1 -0
  139. package/dist/{TableList-D6jnIbnz.js → TableList-Dpo6dO7S.js} +2 -2
  140. package/dist/{TableList-D6jnIbnz.js.map → TableList-Dpo6dO7S.js.map} +1 -1
  141. package/dist/TransactionsPage-DrH53pVS-BkhIGB6C.js +746 -0
  142. package/dist/TransactionsPage-DrH53pVS-BkhIGB6C.js.map +1 -0
  143. package/dist/TransferCreatePage-CuvoMrYH-DTTfHjz-.js +315 -0
  144. package/dist/TransferCreatePage-CuvoMrYH-DTTfHjz-.js.map +1 -0
  145. package/dist/TransfersPage-Cf701t8s-BBbN7cBf.js +476 -0
  146. package/dist/TransfersPage-Cf701t8s-BBbN7cBf.js.map +1 -0
  147. package/dist/{TypeConfiguration-37wp-gsl.js → TypeConfiguration-3O6ABrK-.js} +2 -2
  148. package/dist/{TypeConfiguration-37wp-gsl.js.map → TypeConfiguration-3O6ABrK-.js.map} +1 -1
  149. package/dist/{UserList-Bc8gYxRL.js → UserList-DgPxsnj2.js} +253 -236
  150. package/dist/{UserList-Bc8gYxRL.js.map → UserList-DgPxsnj2.js.map} +1 -1
  151. package/dist/Users-Bpc4Sazd.js +41 -0
  152. package/dist/Users-Bpc4Sazd.js.map +1 -0
  153. package/dist/VialsPage-8oAc1yFv-Cl3FUXBJ.js +321 -0
  154. package/dist/VialsPage-8oAc1yFv-Cl3FUXBJ.js.map +1 -0
  155. package/dist/{WidgetList-Dw_FmbbE.js → WidgetList-D7YuWfDD.js} +2 -2
  156. package/dist/{WidgetList-Dw_FmbbE.js.map → WidgetList-D7YuWfDD.js.map} +1 -1
  157. package/dist/constants-ClZJY2x1-MkSWn6TZ.js +434 -0
  158. package/dist/constants-ClZJY2x1-MkSWn6TZ.js.map +1 -0
  159. package/dist/dashboardLayoutUtils-D1xCAxp3.js +405 -0
  160. package/dist/dashboardLayoutUtils-D1xCAxp3.js.map +1 -0
  161. package/dist/format-UOyOu75i-D0GyylyQ.js +63 -0
  162. package/dist/format-UOyOu75i-D0GyylyQ.js.map +1 -0
  163. package/dist/index.css +1 -1
  164. package/dist/index.js +4 -752
  165. package/dist/index.js.map +1 -1
  166. package/dist/index.lib-Dn8PMkeD.js +862 -0
  167. package/dist/index.lib-Dn8PMkeD.js.map +1 -0
  168. package/dist/useFieldErrors-hDG8ox_x-DbSAzrGo.js +28 -0
  169. package/dist/useFieldErrors-hDG8ox_x-DbSAzrGo.js.map +1 -0
  170. package/dist/validation-BzlHnL-r-CCJm2utQ.js +125 -0
  171. package/dist/validation-BzlHnL-r-CCJm2utQ.js.map +1 -0
  172. package/package.json +5 -4
  173. package/dist/AccessRights-CHu27ZOw.js +0 -1262
  174. package/dist/AccessRights-CHu27ZOw.js.map +0 -1
  175. package/dist/AddEditQueryBuilder-Brdnm6rQ.js +0 -313
  176. package/dist/AddEditQueryBuilder-Brdnm6rQ.js.map +0 -1
  177. package/dist/AddLabelModal-DFllBVcd.js +0 -734
  178. package/dist/AddLabelModal-DFllBVcd.js.map +0 -1
  179. package/dist/AddMenuConfiguration-BSQLl88V.js +0 -6570
  180. package/dist/AddMenuConfiguration-BSQLl88V.js.map +0 -1
  181. package/dist/AddRoleDrawer-CQdzQZLb.js.map +0 -1
  182. package/dist/AppModal-CtG2GjD_.js +0 -428
  183. package/dist/AppModal-CtG2GjD_.js.map +0 -1
  184. package/dist/ChangePasswordModalCore-CDxkeIIM.js.map +0 -1
  185. package/dist/ConditionConfig-DSsgGEXS.js.map +0 -1
  186. package/dist/EventsSkeleton-8iiETGcf.js +0 -76
  187. package/dist/EventsSkeleton-8iiETGcf.js.map +0 -1
  188. package/dist/FeatureMenu-jl7-Tk6y.js +0 -265
  189. package/dist/FeatureMenu-jl7-Tk6y.js.map +0 -1
  190. package/dist/Features-CObdzJp_.js +0 -13
  191. package/dist/Features-CObdzJp_.js.map +0 -1
  192. package/dist/FlywayQuery-Cx2sly6g.js +0 -169
  193. package/dist/FlywayQuery-Cx2sly6g.js.map +0 -1
  194. package/dist/ImmunizationConfigurationBase-DZGqwda2.js +0 -5910
  195. package/dist/ImmunizationConfigurationBase-DZGqwda2.js.map +0 -1
  196. package/dist/ImmunizationConfigurationsList-DdSZicTP.js +0 -344
  197. package/dist/ImmunizationConfigurationsList-DdSZicTP.js.map +0 -1
  198. package/dist/LanguagesModal-D6VfaGrl.js +0 -394
  199. package/dist/LanguagesModal-D6VfaGrl.js.map +0 -1
  200. package/dist/ManageDynamicFeature-BhONvfC_.js +0 -4189
  201. package/dist/ManageDynamicFeature-BhONvfC_.js.map +0 -1
  202. package/dist/ManageEventConfiguration-DV3I5POA.js.map +0 -1
  203. package/dist/ManageRole-CGYfglpo.js.map +0 -1
  204. package/dist/ManageTranslation-B4C9-lWD.js +0 -625
  205. package/dist/ManageTranslation-B4C9-lWD.js.map +0 -1
  206. package/dist/ManageUser-AY1EUDLI.js.map +0 -1
  207. package/dist/MobileMenuManagement-CVAKyKDa.js +0 -112
  208. package/dist/MobileMenuManagement-CVAKyKDa.js.map +0 -1
  209. package/dist/MobileTypeEventConfigModal-BxLympIO.js.map +0 -1
  210. package/dist/NotificationFlywayQuery-BY8Zzml_.js +0 -244
  211. package/dist/NotificationFlywayQuery-BY8Zzml_.js.map +0 -1
  212. package/dist/NotificationList-C3Vb_jKU.js.map +0 -1
  213. package/dist/OtherTypeEventConfigModal-BeG1GrUi.js.map +0 -1
  214. package/dist/QueryBuilder-z7eqfd7D.js +0 -383
  215. package/dist/QueryBuilder-z7eqfd7D.js.map +0 -1
  216. package/dist/RoleManagement-BPl2cE27.js.map +0 -1
  217. package/dist/ServerSyncModal-D_oFpv3C.js.map +0 -1
  218. package/dist/ShowFlywayQuery-DVRCd384.js.map +0 -1
  219. package/dist/ShowFlywayQuery-tj42YQAS.js +0 -130
  220. package/dist/ShowFlywayQuery-tj42YQAS.js.map +0 -1
  221. package/dist/ShowQueryHistory-BDN0tzHg.js +0 -190
  222. package/dist/ShowQueryHistory-BDN0tzHg.js.map +0 -1
  223. package/dist/SubMenu-DYxAPH2Z.js +0 -191
  224. package/dist/SubMenu-DYxAPH2Z.js.map +0 -1
  225. package/dist/TableDetails-Cf_YfnY2.js.map +0 -1
  226. package/dist/Users-CsJ08Kjm.js +0 -40
  227. package/dist/Users-CsJ08Kjm.js.map +0 -1
  228. package/dist/dashboardLayoutUtils-Bt5HA96J.js +0 -265
  229. package/dist/dashboardLayoutUtils-Bt5HA96J.js.map +0 -1
@@ -1,153 +1,167 @@
1
- import { jsxs as s, jsx as r, Fragment as Q } from "react/jsx-runtime";
1
+ import { jsxs as i, jsx as r, Fragment as Q } from "react/jsx-runtime";
2
2
  import { execute as H } from "@/common/services/QueryBuilder";
3
- import { showToast as V } from "@/common/toaster/toaster";
4
- import { useDebounceFn as mr } from "@/hooks/useDebounceFn";
5
- import hr from "@/views/custom-components/CustomConfirmationModal";
6
- import pr from "@/views/custom-components/CustomTextField";
3
+ import { showToast as K } from "@/common/toaster/toaster";
4
+ import { useDebounceFn as yr } from "@/hooks/useDebounceFn";
5
+ import gr from "@/views/custom-components/CustomConfirmationModal";
6
+ import fr from "@/views/custom-components/CustomTextField";
7
7
  import v from "@/common/fontAwesomeIcons/FontAwesomeIcons";
8
- import de from "@monaco-editor/react";
9
- import { Paper as ge, Typography as u, Tooltip as B, Button as O, FormControl as M, RadioGroup as xe, FormControlLabel as W, Radio as U, Autocomplete as ce, TextField as D, IconButton as _, InputAdornment as ve, Popover as yr, Checkbox as fr, TableContainer as gr, Table as xr, TableHead as vr, TableRow as ee, TableCell as re, TableBody as Ye, Modal as Cr, Switch as br } from "@mui/material";
10
- import y from "@mui/material/Grid2";
11
- import { Box as f } from "@mui/system";
12
- import S from "prop-types";
13
- import { useState as w, useEffect as Ce } from "react";
14
- import { useForm as wr, useWatch as Nr, Controller as N } from "react-hook-form";
15
- import { useSelector as Sr } from "react-redux";
16
- function kr({
17
- tableInfo: d,
18
- table: C,
19
- isEditMode: m,
20
- updateEditMode: be,
21
- tableCompleteInfo: k,
22
- reloadComponents: Je,
23
- isCreateTableMode: i,
24
- isSyncTableMode: G,
25
- updateCreateTableMode: we,
26
- openDeleteModal: Xe,
27
- setOpenDeleteModal: Ne,
28
- generateRebuildScript: Ze
8
+ import he from "@monaco-editor/react";
9
+ import { Paper as ee, Typography as m, Tooltip as z, Button as T, FormControl as re, RadioGroup as Ce, FormControlLabel as _, Radio as G, Autocomplete as pe, TextField as q, IconButton as W, InputAdornment as we, Popover as xr, Checkbox as vr, TableContainer as Cr, Table as wr, TableHead as br, TableRow as ae, TableCell as te, TableBody as Xe, Modal as Nr, Switch as Sr } from "@mui/material";
10
+ import f from "@mui/material/Grid2";
11
+ import { Box as g } from "@mui/system";
12
+ import P from "prop-types";
13
+ import { useState as b, useEffect as be } from "react";
14
+ import { useForm as Pr, useWatch as kr, Controller as D } from "react-hook-form";
15
+ import { useSelector as Vr } from "react-redux";
16
+ function Dr({
17
+ tableInfo: s,
18
+ table: w,
19
+ isEditMode: h,
20
+ updateEditMode: Ne,
21
+ tableCompleteInfo: A,
22
+ reloadComponents: Ze,
23
+ isCreateTableMode: d,
24
+ isSyncTableMode: I,
25
+ updateCreateTableMode: Se,
26
+ openDeleteModal: Me,
27
+ setOpenDeleteModal: Pe,
28
+ generateRebuildScript: er
29
29
  }) {
30
- var We, _e, $e, Ee, Fe, je, Qe, He, Ue;
31
- const Se = [
30
+ var Ue, $e, _e, Fe, je, Qe, He, Ge, Ie;
31
+ const ke = [
32
32
  "Document Master",
33
33
  "Form Configurator",
34
34
  "Form Media Record",
35
35
  "LMS"
36
- ], ke = (e) => (e == null ? void 0 : e.toUpperCase().replace(/ /g, "_")) || "", Pe = (e) => Se.find((a) => ke(a) === e) || "", Me = (e) => {
36
+ ], Ve = (e) => (e == null ? void 0 : e.toUpperCase().replace(/ /g, "_")) || "", De = (e) => ke.find((a) => Ve(a) === e) || "", rr = (e) => {
37
37
  var a;
38
- return e != null && e.downloadType ? Pe(e.downloadType) || e.downloadType : (a = e == null ? void 0 : e.data) != null && a.downloadType ? Pe(e.data.downloadType) || e.data.downloadType : "";
39
- }, er = (e) => {
40
- var n;
41
- const a = e == null ? void 0 : e.downloadUrl;
42
- if (typeof a == "object" && a !== null)
43
- return a.apiEndpoint || "";
44
- const l = (n = e == null ? void 0 : e.data) == null ? void 0 : n.downloadUrl;
45
- return typeof l == "object" && l !== null && l.apiEndpoint || "";
46
- }, ue = (e) => {
47
- var n;
48
- const a = e == null ? void 0 : e.downloadUrl;
49
- if (typeof a == "object" && a !== null)
50
- return a.requestParameters || [];
51
- const l = (n = e == null ? void 0 : e.data) == null ? void 0 : n.downloadUrl;
52
- return typeof l == "object" && l !== null ? l.requestParameters || [] : [];
53
- }, [Ve, me] = w([]), [De, ae] = w(!1), [$, ne] = w(""), [rr, ar] = w({}), [te, I] = w(""), [b, K] = w([]), [Y, R] = w([]), [g, le] = w(0), [J, he] = w(0), [Ke, oe] = w(null), [X, ie] = w(null), [E, nr] = w({}), [L, q] = w(
54
- i ? [] : ue(d == null ? void 0 : d.mediaConfiguration)
55
- ), Te = !!Ke, tr = Te ? "simple-popover" : void 0, ze = ["TEXT", "INTEGER"], se = Sr((e) => e.Authenticate.user.id), T = {
56
- selectedColumns: i ? [] : [...d.columnInfo],
57
- modifiedOnQuery: i ? "" : d.modifiedOnQuery,
58
- dataFetchQuery: i ? "" : d.selectQuery,
38
+ return e != null && e.downloadType ? De(e.downloadType) || e.downloadType : (a = e == null ? void 0 : e.data) != null && a.downloadType ? De(e.data.downloadType) || e.data.downloadType : "";
39
+ }, ar = (e) => {
40
+ var a;
41
+ return Array.isArray((e == null ? void 0 : e.downloadUrl) ?? ((a = e == null ? void 0 : e.data) == null ? void 0 : a.downloadUrl));
42
+ }, ne = (e) => {
43
+ var o;
44
+ const a = (e == null ? void 0 : e.downloadUrl) ?? ((o = e == null ? void 0 : e.data) == null ? void 0 : o.downloadUrl);
45
+ return Array.isArray(a) ? a : typeof a == "object" && a !== null ? [
46
+ {
47
+ apiEndpoint: a.apiEndpoint || "",
48
+ requestParameters: a.requestParameters || []
49
+ }
50
+ ] : [];
51
+ }, [Ae, ye] = b([]), [Ke, le] = b(!1), [F, oe] = b(""), [tr, nr] = b({}), [ie, Y] = b(""), [N, L] = b([]), [J, U] = b([]), [x, se] = b(0), [X, ge] = b(0), [ze, de] = b(null), [Z, ce] = b(null), [j, lr] = b({}), [k, V] = b(
52
+ d ? [] : ne(s == null ? void 0 : s.mediaConfiguration)
53
+ ), [or, ue] = b(!1), S = !d && !or && !!(s != null && s.mediaConfiguration) && !!(s != null && s.hasMedia) && !ar(s.mediaConfiguration), Te = !!ze, ir = Te ? "simple-popover" : void 0, Re = ["TEXT", "INTEGER"], me = Vr((e) => e.Authenticate.user.id), E = {
54
+ selectedColumns: d ? [] : [...s.columnInfo],
55
+ modifiedOnQuery: d ? "" : s.modifiedOnQuery,
56
+ dataFetchQuery: d ? "" : s.selectQuery,
59
57
  tableName: "",
60
58
  createTableQuery: "",
61
- syncByDefault: i ? null : (We = d == null ? void 0 : d.syncByDefault) == null ? void 0 : We.toString(),
62
- primaryKey: i ? null : d.primaryKey ? d.primaryKey : null,
63
- userData: i ? null : ((_e = d == null ? void 0 : d.userData) == null ? void 0 : _e.toString()) || null,
64
- hasMedia: i ? null : (($e = d == null ? void 0 : d.hasMedia) == null ? void 0 : $e.toString()) || null,
65
- downloadType: i ? "" : Me(d.mediaConfiguration),
66
- apiEndpoint: i ? "" : er(d.mediaConfiguration),
67
- requestParameters: i ? [] : ue(d.mediaConfiguration),
68
- directoryPath: i ? "" : ((Fe = (Ee = d.mediaConfiguration) == null ? void 0 : Ee.directoryPath) == null ? void 0 : Fe.split("/")[1]) || ((He = (Qe = (je = d.mediaConfiguration) == null ? void 0 : je.data) == null ? void 0 : Qe.directoryPath) == null ? void 0 : He.split("/")[1]) || ""
69
- }, t = wr({
59
+ syncByDefault: d ? null : (Ue = s == null ? void 0 : s.syncByDefault) == null ? void 0 : Ue.toString(),
60
+ primaryKey: d ? null : s.primaryKey ? s.primaryKey : null,
61
+ userData: d ? null : (($e = s == null ? void 0 : s.userData) == null ? void 0 : $e.toString()) || null,
62
+ hasMedia: d ? null : ((_e = s == null ? void 0 : s.hasMedia) == null ? void 0 : _e.toString()) || null,
63
+ downloadType: d ? "" : rr(s.mediaConfiguration),
64
+ downloadUrlEntries: d ? [] : ne(s.mediaConfiguration),
65
+ directoryPath: d ? "" : ((je = (Fe = s.mediaConfiguration) == null ? void 0 : Fe.directoryPath) == null ? void 0 : je.split("/")[1]) || ((Ge = (He = (Qe = s.mediaConfiguration) == null ? void 0 : Qe.data) == null ? void 0 : He.directoryPath) == null ? void 0 : Ge.split("/")[1]) || ""
66
+ }, n = Pr({
70
67
  defaultValues: {
71
- ...T
68
+ ...E
72
69
  },
73
70
  mode: "onChange"
74
- }), lr = !t.formState.isValid, F = t.watch("hasMedia"), Oe = t.watch("newColumnName"), Re = t.watch("newColumnType");
75
- t.register("requestParameters", {
76
- validate: (e) => F !== "true" ? !0 : !e || e.length === 0 ? "At least one request parameter is required." : e.some(
77
- (l) => {
78
- var n, o;
79
- return !((n = l.key) != null && n.trim()) || !((o = l.value) != null && o.trim());
71
+ }), sr = !n.formState.isValid, M = n.watch("hasMedia"), Oe = n.watch("newColumnName"), qe = n.watch("newColumnType");
72
+ n.register("downloadUrlEntries", {
73
+ validate: (e) => {
74
+ var a;
75
+ if (M !== "true") return !0;
76
+ if (!e || e.length === 0)
77
+ return "At least one API configuration is required.";
78
+ for (let o = 0; o < e.length; o++) {
79
+ const t = e[o];
80
+ if (!((a = t.apiEndpoint) != null && a.trim()))
81
+ return `API #${o + 1}: API Endpoint is required.`;
82
+ if (!t.requestParameters || t.requestParameters.length === 0)
83
+ return `API #${o + 1}: At least one request parameter is required.`;
84
+ if (t.requestParameters.some(
85
+ (u) => {
86
+ var c, p;
87
+ return !((c = u.key) != null && c.trim()) || !((p = u.value) != null && p.trim());
88
+ }
89
+ ))
90
+ return `API #${o + 1}: Each parameter must have both a key and a value filled.`;
80
91
  }
81
- ) ? "Each parameter must have both a key and a value filled." : !0
92
+ return !0;
93
+ }
82
94
  });
83
- const or = async (e) => {
84
- var l;
85
- const a = i ? t.getValues("createTableQuery") : await qe(
86
- [...d.columnInfo],
95
+ const dr = async (e) => {
96
+ var o;
97
+ const a = d ? n.getValues("createTableQuery") : await Ee(
98
+ [...s.columnInfo],
87
99
  e.selectedColumns,
88
- d.primaryKey,
89
- (l = e.primaryKey) == null ? void 0 : l.toString()
100
+ s.primaryKey,
101
+ (o = e.primaryKey) == null ? void 0 : o.toString()
90
102
  );
91
- a ? (ar(() => e), ne(() => a), Ae(), ae(!0)) : Le(e, !1);
103
+ a ? (nr(() => e), oe(() => a), Be(), le(!0)) : Le(e, !1);
92
104
  }, Le = async (e, a) => {
93
- var h;
94
- const l = {};
95
- let n, o = e || rr;
96
- if (a || ne(""), Object.keys(o).length > 0) {
97
- o.selectedColumns.forEach((p) => {
98
- l[p.name] = p.type;
99
- }), o.columns = JSON.stringify(l), o.primaryKey = (h = o.primaryKey) == null ? void 0 : h.toString();
100
- let c = {
101
- downloadType: ke(o.downloadType),
102
- downloadUrl: {
103
- apiEndpoint: o.apiEndpoint || "",
104
- requestParameters: L || []
105
- },
106
- directoryPath: "#directoryPath#/" + o.directoryPath + "/"
105
+ var u;
106
+ const o = {};
107
+ let t, l = e || tr;
108
+ if (a || oe(""), Object.keys(l).length > 0) {
109
+ l.selectedColumns.forEach((y) => {
110
+ o[y.name] = y.type;
111
+ }), l.columns = JSON.stringify(o), l.primaryKey = (u = l.primaryKey) == null ? void 0 : u.toString();
112
+ const c = k.map((y) => ({
113
+ apiEndpoint: y.apiEndpoint || "",
114
+ requestParameters: y.requestParameters || []
115
+ }));
116
+ let p = {
117
+ downloadType: Ve(l.downloadType),
118
+ // Unmigrated legacy tables are saved back as a single object, not an array, for mobile compat.
119
+ downloadUrl: S ? c[0] ?? { apiEndpoint: "", requestParameters: [] } : c,
120
+ directoryPath: "#directoryPath#/" + l.directoryPath + "/"
107
121
  };
108
- c = JSON.stringify(c);
122
+ p = JSON.stringify(p);
109
123
  try {
110
- if (n = (await H({
124
+ if (t = (await H({
111
125
  code: "update_mobile_entity",
112
126
  parameters: {
113
- tableName: (i ? t.getValues("tableName") : C) || "",
114
- syncByDefault: o.syncByDefault === "true",
115
- columnInfo: o.columns || "",
116
- primaryKey: o.primaryKey || "",
117
- modifiedOnQuery: o.modifiedOnQuery || "",
118
- selectQuery: o.dataFetchQuery || "",
119
- userData: o.userData === "true",
120
- hasMedia: o.hasMedia === "true",
121
- mediaConfiguration: o.hasMedia === "true" ? c : null,
122
- modifiedBy: se || "",
127
+ tableName: (d ? n.getValues("tableName") : w) || "",
128
+ syncByDefault: l.syncByDefault === "true",
129
+ columnInfo: l.columns || "",
130
+ primaryKey: l.primaryKey || "",
131
+ modifiedOnQuery: l.modifiedOnQuery || "",
132
+ selectQuery: l.dataFetchQuery || "",
133
+ userData: l.userData === "true",
134
+ hasMedia: l.hasMedia === "true",
135
+ mediaConfiguration: l.hasMedia === "true" ? p : null,
136
+ modifiedBy: me || "",
123
137
  isUpdate: !0
124
138
  }
125
- })).data, n != null && n.result && a && $) {
126
- const p = (await H({
139
+ })).data, t != null && t.result && a && F) {
140
+ const y = (await H({
127
141
  code: "INSERT_MOBILE_MIGRATION",
128
142
  parameters: {
129
- migrationScript: $,
130
- modifiedBy: se || "",
143
+ migrationScript: F,
144
+ modifiedBy: me || "",
131
145
  generateMigration: !0
132
146
  }
133
147
  })).data;
134
- (p == null ? void 0 : p.status) === 0 && V({
135
- message: `Migration insertion failed: ${p == null ? void 0 : p.message}`,
148
+ (y == null ? void 0 : y.status) === 0 && K({
149
+ message: `Migration insertion failed: ${y == null ? void 0 : y.message}`,
136
150
  type: "error"
137
151
  });
138
152
  }
139
- } catch (p) {
140
- V({
141
- message: `Submission failure ${p}`,
153
+ } catch (y) {
154
+ K({
155
+ message: `Submission failure ${y}`,
142
156
  type: "error"
143
157
  });
144
158
  }
145
159
  } else
146
160
  try {
147
- if (n = (await H({
161
+ if (t = (await H({
148
162
  code: "update_mobile_entity",
149
163
  parameters: {
150
- tableName: (i ? t.getValues("tableName") : C) || "",
164
+ tableName: (d ? n.getValues("tableName") : w) || "",
151
165
  syncByDefault: !1,
152
166
  columnInfo: "",
153
167
  primaryKey: "",
@@ -156,211 +170,213 @@ function kr({
156
170
  userData: !1,
157
171
  hasMedia: !1,
158
172
  mediaConfiguration: null,
159
- modifiedBy: se || "",
173
+ modifiedBy: me || "",
160
174
  isUpdate: !1
161
175
  }
162
- })).data, n != null && n.result && $) {
176
+ })).data, t != null && t.result && F) {
163
177
  const c = (await H({
164
178
  code: "INSERT_MOBILE_MIGRATION",
165
179
  parameters: {
166
- migrationScript: $,
167
- modifiedBy: se || "",
180
+ migrationScript: F,
181
+ modifiedBy: me || "",
168
182
  generateMigration: !0
169
183
  }
170
184
  })).data;
171
- (c == null ? void 0 : c.status) === 0 && V({
185
+ (c == null ? void 0 : c.status) === 0 && K({
172
186
  message: `Migration insertion failed: ${c == null ? void 0 : c.message}`,
173
187
  type: "error"
174
188
  });
175
189
  }
176
190
  } catch (c) {
177
- V({
191
+ K({
178
192
  message: `Submission failure ${c}`,
179
193
  type: "error"
180
194
  });
181
195
  }
182
- n != null && n.result && (be(!1), we(!1), Je((c) => !c), V({
196
+ t != null && t.result && (Ne(!1), Se(!1), Ze((c) => !c), K({
183
197
  message: "Table configuration saved successfully!",
184
198
  type: "success"
185
- })), ae(!1);
186
- }, ir = () => {
187
- ae(!1);
188
- }, qe = async (e, a, l, n) => {
189
- let o = "";
199
+ })), le(!1);
200
+ }, cr = () => {
201
+ le(!1);
202
+ }, Ee = async (e, a, o, t) => {
203
+ let l = "";
190
204
  if (e.length > 0) {
191
- const h = Object.fromEntries(
192
- e.map((x) => [x.name, x.type])
205
+ const u = Object.fromEntries(
206
+ e.map((C) => [C.name, C.type])
193
207
  ), c = Object.fromEntries(
194
- a.map((x) => [x.name, x.type])
195
- ), p = Object.keys(h), j = Object.keys(c), Z = e.filter(
196
- (x) => !j.includes(x.name)
197
- ), P = a.filter(
198
- (x) => !p.includes(x.name)
199
- ), A = e.filter((x) => {
200
- const Ie = c[x.name];
201
- return Ie !== void 0 && Ie !== x.type;
202
- }), z = Z.map((x) => `ALTER TABLE ${C} DROP COLUMN ${x.name};`).join(`
203
- `), Ge = P.map(
204
- (x) => `ALTER TABLE ${C} ADD COLUMN ${x.name} ${x.type};`
208
+ a.map((C) => [C.name, C.type])
209
+ ), p = Object.keys(u), y = Object.keys(c), R = e.filter(
210
+ (C) => !y.includes(C.name)
211
+ ), O = a.filter(
212
+ (C) => !p.includes(C.name)
213
+ ), $ = e.filter((C) => {
214
+ const Je = c[C.name];
215
+ return Je !== void 0 && Je !== C.type;
216
+ }), B = R.map((C) => `ALTER TABLE ${w} DROP COLUMN ${C.name};`).join(`
217
+ `), Ye = O.map(
218
+ (C) => `ALTER TABLE ${w} ADD COLUMN ${C.name} ${C.type};`
205
219
  ).join(`
206
220
  `);
207
- let fe = "";
208
- return A.length > 0 && (fe = Ze(
209
- C,
221
+ let ve = "";
222
+ return $.length > 0 && (ve = er(
223
+ w,
210
224
  {
211
225
  columnInfo: e,
212
- primaryKey: l
226
+ primaryKey: o
213
227
  },
214
228
  {
215
229
  columnInfo: a,
216
- primaryKey: n
230
+ primaryKey: t
217
231
  }
218
- )), fe ? fe.trim() : (z && (o += `${z}
219
- `), Ge && (o += `${Ge}
220
- `), o.trim());
232
+ )), ve ? ve.trim() : (B && (l += `${B}
233
+ `), Ye && (l += `${Ye}
234
+ `), l.trim());
221
235
  } else {
222
- const h = i ? t.getValues("tableName") : C;
223
- return o = `CREATE TABLE ${h} (
224
- `, o += a.map((c) => `${c.name} ${c.type}`).join(`,
225
- `), n && (o += `,
226
- CONSTRAINT ${h}_pkey PRIMARY KEY (${n})`), o += ");", o;
236
+ const u = d ? n.getValues("tableName") : w;
237
+ return l = `CREATE TABLE ${u} (
238
+ `, l += a.map((c) => `${c.name} ${c.type}`).join(`,
239
+ `), t && (l += `,
240
+ CONSTRAINT ${u}_pkey PRIMARY KEY (${t})`), l += ");", l;
227
241
  }
228
- }, Ae = async () => {
242
+ }, Be = async () => {
229
243
  var a;
230
244
  const e = (a = await H({
231
245
  code: "MFA_MIGRATION_MASTER_GET_LATEST_VERSIONS"
232
- }).catch((l) => {
233
- V({
234
- message: `Failed to fetch migration versions ${l}`,
246
+ }).catch((o) => {
247
+ K({
248
+ message: `Failed to fetch migration versions ${o}`,
235
249
  type: "error"
236
250
  });
237
251
  })) == null ? void 0 : a.data;
238
- nr(e == null ? void 0 : e.result[0]);
252
+ lr(e == null ? void 0 : e.result[0]);
239
253
  };
240
- Ce(() => {
241
- if (I(""), he(0), le(0), i && (me([]), K([]), R([]), q([]), t.reset({
242
- ...T
243
- }), setTimeout(() => t.trigger(), 0)), C && d && !i) {
244
- me(k !== void 0 ? () => k.columnInfo : () => d.columnInfo);
245
- let e = k !== void 0 ? k.columnInfo.map((n) => n.name) : d.columnInfo.map((n) => n.name), a = {};
246
- k !== void 0 ? k.columnInfo.forEach((n) => {
247
- a[n.name] = n.type;
248
- }) : d.columnInfo.forEach((n) => {
249
- a[n.name] = n.type;
254
+ be(() => {
255
+ if (Y(""), ge(0), se(0), d && (ye([]), L([]), U([]), V([]), ue(!1), n.reset({
256
+ ...E
257
+ }), setTimeout(() => n.trigger(), 0)), w && s && !d) {
258
+ ye(A !== void 0 ? () => A.columnInfo : () => s.columnInfo);
259
+ let e = A !== void 0 ? A.columnInfo.map((t) => t.name) : s.columnInfo.map((t) => t.name), a = {};
260
+ A !== void 0 ? A.columnInfo.forEach((t) => {
261
+ a[t.name] = t.type;
262
+ }) : s.columnInfo.forEach((t) => {
263
+ a[t.name] = t.type;
250
264
  });
251
- let l = {};
252
- d.columnInfo.forEach((n) => {
253
- l[n.name] = n.type;
254
- }), d.columnInfo.map((n) => {
255
- e.includes(n.name) || (n.onlyMobileDb = !0), l[n.name] !== a[n.name] && (n.isTypeChanged = !0), n.name === d.primaryKey && (n.isPrimaryKey = !0);
256
- }), t.reset({
257
- ...T
258
- }), setTimeout(() => t.trigger(), 0), q(ue(d == null ? void 0 : d.mediaConfiguration)), K(
259
- () => d.columnInfo.sort((n, o) => n.name === d.primaryKey ? (n.isPrimaryKey = !0, -1) : o.name === d.primaryKey ? (o.isPrimaryKey = !0, 1) : n.name.localeCompare(o.name))
260
- ), R(k !== void 0 ? () => {
261
- const n = new Set(
262
- d.columnInfo.map((h) => h.name)
265
+ let o = {};
266
+ s.columnInfo.forEach((t) => {
267
+ o[t.name] = t.type;
268
+ }), s.columnInfo.map((t) => {
269
+ e.includes(t.name) || (t.onlyMobileDb = !0), o[t.name] !== a[t.name] && (t.isTypeChanged = !0), t.name === s.primaryKey && (t.isPrimaryKey = !0);
270
+ }), n.reset({
271
+ ...E
272
+ }), setTimeout(() => n.trigger(), 0), V(
273
+ ne(s == null ? void 0 : s.mediaConfiguration)
274
+ ), ue(!1), L(
275
+ () => s.columnInfo.sort((t, l) => t.name === s.primaryKey ? (t.isPrimaryKey = !0, -1) : l.name === s.primaryKey ? (l.isPrimaryKey = !0, 1) : t.name.localeCompare(l.name))
276
+ ), U(A !== void 0 ? () => {
277
+ const t = new Set(
278
+ s.columnInfo.map((u) => u.name)
263
279
  );
264
- return k.columnInfo.map((h) => ({
265
- ...h,
266
- isSynced: n.has(h.name)
267
- })).sort((h, c) => h.name === d.primaryKey ? -1 : c.name === d.primaryKey ? 1 : h.name.localeCompare(c.name));
280
+ return A.columnInfo.map((u) => ({
281
+ ...u,
282
+ isSynced: t.has(u.name)
283
+ })).sort((u, c) => u.name === s.primaryKey ? -1 : c.name === s.primaryKey ? 1 : u.name.localeCompare(c.name));
268
284
  } : []);
269
285
  }
270
- }, [d, k, C, i]), Ce(() => {
271
- const e = te.toLowerCase();
272
- if (g === 0) {
273
- const a = t.getValues("selectedColumns"), l = e ? a.filter(
274
- (n) => n.name.toLowerCase().includes(e)
286
+ }, [s, A, w, d]), be(() => {
287
+ const e = ie.toLowerCase();
288
+ if (x === 0) {
289
+ const a = n.getValues("selectedColumns"), o = e ? a.filter(
290
+ (t) => t.name.toLowerCase().includes(e)
275
291
  ) : a;
276
- K(l);
292
+ L(o);
277
293
  } else {
278
294
  const a = new Set(
279
- t.getValues("selectedColumns").map((n) => n.name)
280
- ), l = e ? Ve.filter((n) => n.name.toLowerCase().includes(e)).map((n) => ({
281
- ...n,
282
- isSynced: a.has(n.name)
283
- })) : Ve.map((n) => ({
284
- ...n,
285
- isSynced: a.has(n.name)
295
+ n.getValues("selectedColumns").map((t) => t.name)
296
+ ), o = e ? Ae.filter((t) => t.name.toLowerCase().includes(e)).map((t) => ({
297
+ ...t,
298
+ isSynced: a.has(t.name)
299
+ })) : Ae.map((t) => ({
300
+ ...t,
301
+ isSynced: a.has(t.name)
286
302
  }));
287
- R(l);
303
+ U(o);
288
304
  }
289
- }, [te, g]);
290
- const Be = Nr({
291
- control: t.control,
305
+ }, [ie, x]);
306
+ const We = kr({
307
+ control: n.control,
292
308
  name: "tableName"
293
309
  });
294
- Ce(() => {
295
- i && t.getValues("selectedColumns").length > 0 && Be && ye(t.getValues("selectedColumns"));
296
- }, [Be]);
297
- const sr = (e) => {
298
- ne(e);
299
- }, dr = () => {
300
- m && be(!m), i && we(!i), t.reset({
301
- ...T,
310
+ be(() => {
311
+ d && n.getValues("selectedColumns").length > 0 && We && xe(n.getValues("selectedColumns"));
312
+ }, [We]);
313
+ const ur = (e) => {
314
+ oe(e);
315
+ }, mr = () => {
316
+ h && Ne(!h), d && Se(!d), n.reset({
317
+ ...E,
302
318
  newColumnName: null,
303
319
  newColumnType: null
304
- }), q(T.requestParameters || []), K(T.selectedColumns || []);
320
+ }), V(E.downloadUrlEntries || []), ue(!1), L(E.selectedColumns || []);
305
321
  const e = new Set(
306
- (T.selectedColumns || []).map((a) => a.name)
322
+ (E.selectedColumns || []).map((a) => a.name)
307
323
  );
308
- R(
309
- (T.allColumns || []).map((a) => ({
324
+ U(
325
+ (E.allColumns || []).map((a) => ({
310
326
  ...a,
311
327
  isSynced: e.has(a.name)
312
328
  }))
313
329
  );
314
- }, cr = async () => {
315
- var l, n, o;
316
- Ne(() => !1);
330
+ }, hr = async () => {
331
+ var o, t, l;
332
+ Pe(() => !1);
317
333
  const e = await H({
318
334
  code: "DELETE_MOBILE_ENTITY",
319
335
  parameters: {
320
- tableName: C
336
+ tableName: w
321
337
  }
322
- }).catch((h) => {
323
- V({
324
- message: `Metadata deletion failure ${h}`,
338
+ }).catch((u) => {
339
+ K({
340
+ message: `Metadata deletion failure ${u}`,
325
341
  type: "error"
326
342
  });
327
343
  });
328
- (o = (n = (l = e == null ? void 0 : e.data) == null ? void 0 : l.result) == null ? void 0 : n[0]) != null && o.table_name && V({ message: `${C} deleted successfully!`, type: "success" });
329
- let a = `DROP TABLE if exists ${C};`;
330
- ne(() => a), Ae(), ae(!0);
331
- }, ur = mr(async (e) => {
344
+ (l = (t = (o = e == null ? void 0 : e.data) == null ? void 0 : o.result) == null ? void 0 : t[0]) != null && l.table_name && K({ message: `${w} deleted successfully!`, type: "success" });
345
+ let a = `DROP TABLE if exists ${w};`;
346
+ oe(() => a), Be(), le(!0);
347
+ }, pr = yr(async (e) => {
332
348
  const a = /^[a-zA-Z_][a-zA-Z0-9_]*$/.test(e);
333
349
  if (e.trim().length === 0) {
334
- t.setError("newColumnName", {
350
+ n.setError("newColumnName", {
335
351
  type: "manual",
336
352
  message: "*Column name is required. "
337
353
  });
338
354
  return;
339
355
  }
340
356
  if (!a) {
341
- t.setError("newColumnName", {
357
+ n.setError("newColumnName", {
342
358
  type: "manual",
343
359
  message: "Must start with a letter/underscore and contain only letters, numbers, and underscores."
344
360
  });
345
361
  return;
346
362
  }
347
- Y.some((l) => l.name === e) || b.some((l) => l.name === e) ? t.setError("newColumnName", {
363
+ J.some((o) => o.name === e) || N.some((o) => o.name === e) ? n.setError("newColumnName", {
348
364
  type: "manual",
349
365
  message: "Column name already exists in the table."
350
- }) : t.clearErrors("newColumnName");
351
- }, 500), pe = b.some(
366
+ }) : n.clearErrors("newColumnName");
367
+ }, 500), fe = N.some(
352
368
  (e) => e.isPrimaryKey === !0
353
- ), ye = async (e) => {
354
- var n;
355
- if (J !== 2 && i && he(2), e.length === 0) {
356
- t.setValue("createTableQuery", "", { shouldDirty: !0 });
369
+ ), xe = async (e) => {
370
+ var t;
371
+ if (X !== 2 && d && ge(2), e.length === 0) {
372
+ n.setValue("createTableQuery", "", { shouldDirty: !0 });
357
373
  return;
358
374
  }
359
- const a = ((n = e.find((o) => o.isPrimaryKey)) == null ? void 0 : n.name) || "", l = await qe([], e, "", a);
360
- t.setValue("createTableQuery", l, { shouldDirty: !0 });
375
+ const a = ((t = e.find((l) => l.isPrimaryKey)) == null ? void 0 : t.name) || "", o = await Ee([], e, "", a);
376
+ n.setValue("createTableQuery", o, { shouldDirty: !0 });
361
377
  };
362
- return /* @__PURE__ */ s(
363
- y,
378
+ return /* @__PURE__ */ i(
379
+ f,
364
380
  {
365
381
  size: 9,
366
382
  sx: {
@@ -370,7 +386,7 @@ CONSTRAINT ${h}_pkey PRIMARY KEY (${n})`), o += ");", o;
370
386
  },
371
387
  children: [
372
388
  /* @__PURE__ */ r(
373
- ge,
389
+ ee,
374
390
  {
375
391
  variant: "outlined",
376
392
  sx: {
@@ -378,15 +394,15 @@ CONSTRAINT ${h}_pkey PRIMARY KEY (${n})`), o += ");", o;
378
394
  borderRadius: 1.5,
379
395
  backgroundColor: "background.paper"
380
396
  },
381
- children: /* @__PURE__ */ s(
397
+ children: /* @__PURE__ */ i(
382
398
  "form",
383
399
  {
384
- onSubmit: t.handleSubmit(or),
400
+ onSubmit: n.handleSubmit(dr),
385
401
  noValidate: !0,
386
402
  className: "w-full",
387
403
  children: [
388
- /* @__PURE__ */ s(
389
- f,
404
+ /* @__PURE__ */ i(
405
+ g,
390
406
  {
391
407
  sx: {
392
408
  display: "flex",
@@ -398,10 +414,10 @@ CONSTRAINT ${h}_pkey PRIMARY KEY (${n})`), o += ");", o;
398
414
  borderColor: "divider"
399
415
  },
400
416
  children: [
401
- /* @__PURE__ */ s(f, { sx: { flex: 1 }, children: [
402
- i ? /* @__PURE__ */ s(f, { sx: { maxWidth: 350 }, children: [
417
+ /* @__PURE__ */ i(g, { sx: { flex: 1 }, children: [
418
+ d ? /* @__PURE__ */ i(g, { sx: { maxWidth: 350 }, children: [
403
419
  /* @__PURE__ */ r(
404
- u,
420
+ m,
405
421
  {
406
422
  variant: "subtitle2",
407
423
  sx: { fontWeight: 600, mb: 0.5 },
@@ -409,12 +425,12 @@ CONSTRAINT ${h}_pkey PRIMARY KEY (${n})`), o += ");", o;
409
425
  }
410
426
  ),
411
427
  /* @__PURE__ */ r(
412
- pr,
428
+ fr,
413
429
  {
414
- control: t.control,
430
+ control: n.control,
415
431
  id: "tableName",
416
432
  name: "tableName",
417
- errors: t.formState.errors,
433
+ errors: n.formState.errors,
418
434
  label: "Table Name",
419
435
  size: "small",
420
436
  rules: {
@@ -430,37 +446,37 @@ CONSTRAINT ${h}_pkey PRIMARY KEY (${n})`), o += ");", o;
430
446
  }
431
447
  }
432
448
  )
433
- ] }) : /* @__PURE__ */ s(Q, { children: [
449
+ ] }) : /* @__PURE__ */ i(Q, { children: [
434
450
  /* @__PURE__ */ r(
435
- u,
451
+ m,
436
452
  {
437
453
  variant: "h6",
438
454
  sx: { fontWeight: 700, color: "text.primary" },
439
- children: C || "No Table Selected"
455
+ children: w || "No Table Selected"
440
456
  }
441
457
  ),
442
- /* @__PURE__ */ r(u, { variant: "caption", color: "text.secondary", children: C ? "View and manage table configuration" : "Select a table from the list" })
458
+ /* @__PURE__ */ r(m, { variant: "caption", color: "text.secondary", children: w ? "View and manage table configuration" : "Select a table from the list" })
443
459
  ] }),
444
460
  /* @__PURE__ */ r(
445
- hr,
461
+ gr,
446
462
  {
447
463
  description: "Do you want to drop this table?",
448
464
  title: "CONFIRMATION",
449
- open: Xe,
450
- handleClick: cr,
451
- handleClose: () => Ne((e) => !e)
465
+ open: Me,
466
+ handleClick: hr,
467
+ handleClose: () => Pe((e) => !e)
452
468
  }
453
469
  )
454
470
  ] }),
455
- /* @__PURE__ */ s(f, { sx: { display: "flex", gap: 1 }, children: [
456
- (m || i) && /* @__PURE__ */ r(
457
- B,
471
+ /* @__PURE__ */ i(g, { sx: { display: "flex", gap: 1 }, children: [
472
+ (h || d) && /* @__PURE__ */ r(
473
+ z,
458
474
  {
459
- title: pe ? "" : "A primary key is required to proceed.",
475
+ title: fe ? "" : "A primary key is required to proceed.",
460
476
  arrow: !0,
461
477
  placement: "bottom",
462
478
  children: /* @__PURE__ */ r("span", { children: /* @__PURE__ */ r(
463
- O,
479
+ T,
464
480
  {
465
481
  type: "submit",
466
482
  variant: "contained",
@@ -472,19 +488,19 @@ CONSTRAINT ${h}_pkey PRIMARY KEY (${n})`), o += ");", o;
472
488
  boxShadow: "none",
473
489
  px: 2.5
474
490
  },
475
- disabled: lr || !pe,
491
+ disabled: sr || !fe,
476
492
  startIcon: /* @__PURE__ */ r(v, { iconName: "faCheck" }),
477
493
  children: "Submit"
478
494
  }
479
495
  ) })
480
496
  }
481
497
  ),
482
- (m || i) && /* @__PURE__ */ r(
483
- O,
498
+ (h || d) && /* @__PURE__ */ r(
499
+ T,
484
500
  {
485
501
  type: "button",
486
502
  variant: "outlined",
487
- onClick: () => dr(),
503
+ onClick: () => mr(),
488
504
  size: "small",
489
505
  sx: {
490
506
  borderRadius: 2,
@@ -505,10 +521,10 @@ CONSTRAINT ${h}_pkey PRIMARY KEY (${n})`), o += ");", o;
505
521
  ]
506
522
  }
507
523
  ),
508
- /* @__PURE__ */ s(y, { container: !0, spacing: 2, children: [
509
- /* @__PURE__ */ s(y, { size: 7, children: [
524
+ /* @__PURE__ */ i(f, { container: !0, spacing: 2, children: [
525
+ /* @__PURE__ */ i(f, { size: 7, children: [
510
526
  /* @__PURE__ */ r(
511
- f,
527
+ g,
512
528
  {
513
529
  sx: {
514
530
  display: "inline-flex",
@@ -523,7 +539,7 @@ CONSTRAINT ${h}_pkey PRIMARY KEY (${n})`), o += ");", o;
523
539
  children: [
524
540
  { value: 0, label: "Modified On Query", icon: "faClock" },
525
541
  { value: 1, label: "Data Fetch Query", icon: "faDatabase" },
526
- ...i ? [
542
+ ...d ? [
527
543
  {
528
544
  value: 2,
529
545
  label: "Create Table Query",
@@ -531,11 +547,11 @@ CONSTRAINT ${h}_pkey PRIMARY KEY (${n})`), o += ");", o;
531
547
  }
532
548
  ] : []
533
549
  ].map((e) => {
534
- const a = J === e.value;
550
+ const a = X === e.value;
535
551
  return /* @__PURE__ */ r(
536
- O,
552
+ T,
537
553
  {
538
- onClick: () => he(e.value),
554
+ onClick: () => ge(e.value),
539
555
  size: "small",
540
556
  disableElevation: !0,
541
557
  sx: {
@@ -563,16 +579,16 @@ CONSTRAINT ${h}_pkey PRIMARY KEY (${n})`), o += ");", o;
563
579
  })
564
580
  }
565
581
  ),
566
- J === 0 && /* @__PURE__ */ s(y, { children: [
567
- /* @__PURE__ */ r(u, { variant: "subtitle1", children: "Modified On Query:" }),
582
+ X === 0 && /* @__PURE__ */ i(f, { children: [
583
+ /* @__PURE__ */ r(m, { variant: "subtitle1", children: "Modified On Query:" }),
568
584
  /* @__PURE__ */ r(
569
- N,
585
+ D,
570
586
  {
571
587
  name: "modifiedOnQuery",
572
- control: t.control,
573
- render: ({ field: e, fieldState: { error: a } }) => /* @__PURE__ */ s(Q, { children: [
588
+ control: n.control,
589
+ render: ({ field: e, fieldState: { error: a } }) => /* @__PURE__ */ i(Q, { children: [
574
590
  /* @__PURE__ */ r(
575
- de,
591
+ he,
576
592
  {
577
593
  height: "35vh",
578
594
  defaultLanguage: "sql",
@@ -585,7 +601,7 @@ CONSTRAINT ${h}_pkey PRIMARY KEY (${n})`), o += ");", o;
585
601
  wordWrap: "on",
586
602
  occurrencesHighlight: !1,
587
603
  selectionHighlight: !1,
588
- readOnly: !m && !i
604
+ readOnly: !h && !d
589
605
  },
590
606
  value: e.value || "",
591
607
  defaultValue: e.value || "",
@@ -594,7 +610,7 @@ CONSTRAINT ${h}_pkey PRIMARY KEY (${n})`), o += ");", o;
594
610
  }
595
611
  ),
596
612
  (a == null ? void 0 : a.message) && /* @__PURE__ */ r(
597
- u,
613
+ m,
598
614
  {
599
615
  variant: "subtitle1",
600
616
  color: "error",
@@ -607,16 +623,16 @@ CONSTRAINT ${h}_pkey PRIMARY KEY (${n})`), o += ");", o;
607
623
  }
608
624
  )
609
625
  ] }),
610
- J === 1 && /* @__PURE__ */ s(y, { children: [
611
- /* @__PURE__ */ r(u, { variant: "subtitle1", children: "Data Fetch Query:" }),
626
+ X === 1 && /* @__PURE__ */ i(f, { children: [
627
+ /* @__PURE__ */ r(m, { variant: "subtitle1", children: "Data Fetch Query:" }),
612
628
  /* @__PURE__ */ r(
613
- N,
629
+ D,
614
630
  {
615
631
  name: "dataFetchQuery",
616
- control: t.control,
617
- render: ({ field: e, fieldState: { error: a } }) => /* @__PURE__ */ s(Q, { children: [
632
+ control: n.control,
633
+ render: ({ field: e, fieldState: { error: a } }) => /* @__PURE__ */ i(Q, { children: [
618
634
  /* @__PURE__ */ r(
619
- de,
635
+ he,
620
636
  {
621
637
  height: "35vh",
622
638
  defaultLanguage: "sql",
@@ -629,7 +645,7 @@ CONSTRAINT ${h}_pkey PRIMARY KEY (${n})`), o += ");", o;
629
645
  wordWrap: "on",
630
646
  occurrencesHighlight: !1,
631
647
  selectionHighlight: !1,
632
- readOnly: !m && !i
648
+ readOnly: !h && !d
633
649
  },
634
650
  value: e.value || "",
635
651
  defaultValue: e.value || "",
@@ -638,7 +654,7 @@ CONSTRAINT ${h}_pkey PRIMARY KEY (${n})`), o += ");", o;
638
654
  }
639
655
  ),
640
656
  (a == null ? void 0 : a.message) && /* @__PURE__ */ r(
641
- u,
657
+ m,
642
658
  {
643
659
  variant: "subtitle1",
644
660
  color: "error",
@@ -651,16 +667,16 @@ CONSTRAINT ${h}_pkey PRIMARY KEY (${n})`), o += ");", o;
651
667
  }
652
668
  )
653
669
  ] }),
654
- J === 2 && /* @__PURE__ */ s(y, { children: [
655
- /* @__PURE__ */ r(u, { variant: "subtitle1", children: "Create Table Query:" }),
670
+ X === 2 && /* @__PURE__ */ i(f, { children: [
671
+ /* @__PURE__ */ r(m, { variant: "subtitle1", children: "Create Table Query:" }),
656
672
  /* @__PURE__ */ r(
657
- N,
673
+ D,
658
674
  {
659
675
  name: "createTableQuery",
660
- control: t.control,
661
- render: ({ field: e, fieldState: { error: a } }) => /* @__PURE__ */ s(Q, { children: [
676
+ control: n.control,
677
+ render: ({ field: e, fieldState: { error: a } }) => /* @__PURE__ */ i(Q, { children: [
662
678
  /* @__PURE__ */ r(
663
- de,
679
+ he,
664
680
  {
665
681
  height: "35vh",
666
682
  defaultLanguage: "sql",
@@ -682,7 +698,7 @@ CONSTRAINT ${h}_pkey PRIMARY KEY (${n})`), o += ");", o;
682
698
  }
683
699
  ),
684
700
  (a == null ? void 0 : a.message) && /* @__PURE__ */ r(
685
- u,
701
+ m,
686
702
  {
687
703
  variant: "subtitle1",
688
704
  color: "error",
@@ -695,8 +711,8 @@ CONSTRAINT ${h}_pkey PRIMARY KEY (${n})`), o += ");", o;
695
711
  }
696
712
  )
697
713
  ] }),
698
- /* @__PURE__ */ s(
699
- ge,
714
+ /* @__PURE__ */ i(
715
+ ee,
700
716
  {
701
717
  variant: "outlined",
702
718
  sx: {
@@ -707,17 +723,17 @@ CONSTRAINT ${h}_pkey PRIMARY KEY (${n})`), o += ");", o;
707
723
  },
708
724
  children: [
709
725
  /* @__PURE__ */ r(
710
- u,
726
+ m,
711
727
  {
712
728
  variant: "subtitle2",
713
729
  sx: { fontWeight: 700, mb: 1.5, color: "text.primary" },
714
730
  children: "Table Settings"
715
731
  }
716
732
  ),
717
- /* @__PURE__ */ s(y, { container: !0, spacing: 2, children: [
718
- /* @__PURE__ */ s(y, { size: 6, xs: 12, children: [
719
- /* @__PURE__ */ s(
720
- u,
733
+ /* @__PURE__ */ i(f, { container: !0, spacing: 2, children: [
734
+ /* @__PURE__ */ i(f, { size: 6, xs: 12, children: [
735
+ /* @__PURE__ */ i(
736
+ m,
721
737
  {
722
738
  variant: "body2",
723
739
  sx: { fontWeight: 600, mb: 0.5 },
@@ -727,50 +743,50 @@ CONSTRAINT ${h}_pkey PRIMARY KEY (${n})`), o += ");", o;
727
743
  ]
728
744
  }
729
745
  ),
730
- /* @__PURE__ */ r(M, { children: /* @__PURE__ */ r(
731
- N,
746
+ /* @__PURE__ */ r(re, { children: /* @__PURE__ */ r(
747
+ D,
732
748
  {
733
749
  name: "userData",
734
- control: t.control,
750
+ control: n.control,
735
751
  rules: { required: "Required field." },
736
- disabled: !m && !i,
737
- defaultValue: d.userData !== void 0 && d.userData !== null ? String(d.userData) : "",
738
- render: ({ field: e }) => /* @__PURE__ */ s(xe, { row: !0, ...e, value: e.value, children: [
752
+ disabled: !h && !d,
753
+ defaultValue: s.userData !== void 0 && s.userData !== null ? String(s.userData) : "",
754
+ render: ({ field: e }) => /* @__PURE__ */ i(Ce, { row: !0, ...e, value: e.value, children: [
739
755
  /* @__PURE__ */ r(
740
- W,
756
+ _,
741
757
  {
742
758
  value: "true",
743
759
  control: /* @__PURE__ */ r(
744
- U,
760
+ G,
745
761
  {
746
- disabled: !m && !i,
762
+ disabled: !h && !d,
747
763
  size: "small"
748
764
  }
749
765
  ),
750
- label: /* @__PURE__ */ r(u, { variant: "body2", children: "User" })
766
+ label: /* @__PURE__ */ r(m, { variant: "body2", children: "User" })
751
767
  }
752
768
  ),
753
769
  /* @__PURE__ */ r(
754
- W,
770
+ _,
755
771
  {
756
772
  value: "false",
757
773
  control: /* @__PURE__ */ r(
758
- U,
774
+ G,
759
775
  {
760
- disabled: !m && !i,
776
+ disabled: !h && !d,
761
777
  size: "small"
762
778
  }
763
779
  ),
764
- label: /* @__PURE__ */ r(u, { variant: "body2", children: "System" })
780
+ label: /* @__PURE__ */ r(m, { variant: "body2", children: "System" })
765
781
  }
766
782
  )
767
783
  ] })
768
784
  }
769
785
  ) })
770
786
  ] }),
771
- /* @__PURE__ */ s(y, { size: 6, xs: 12, children: [
772
- /* @__PURE__ */ s(
773
- u,
787
+ /* @__PURE__ */ i(f, { size: 6, xs: 12, children: [
788
+ /* @__PURE__ */ i(
789
+ m,
774
790
  {
775
791
  variant: "body2",
776
792
  sx: { fontWeight: 600, mb: 0.5 },
@@ -781,51 +797,51 @@ CONSTRAINT ${h}_pkey PRIMARY KEY (${n})`), o += ");", o;
781
797
  ]
782
798
  }
783
799
  ),
784
- /* @__PURE__ */ r(M, { children: /* @__PURE__ */ r(
785
- N,
800
+ /* @__PURE__ */ r(re, { children: /* @__PURE__ */ r(
801
+ D,
786
802
  {
787
803
  name: "syncByDefault",
788
804
  id: "syncByDefault",
789
- control: t.control,
805
+ control: n.control,
790
806
  rules: { required: "Required field." },
791
- disabled: !m && !i,
792
- defaultValue: d.syncByDefault !== void 0 && d.syncByDefault !== null ? String(d.syncByDefault) : "",
793
- render: ({ field: e }) => /* @__PURE__ */ s(xe, { row: !0, ...e, value: e.value, children: [
807
+ disabled: !h && !d,
808
+ defaultValue: s.syncByDefault !== void 0 && s.syncByDefault !== null ? String(s.syncByDefault) : "",
809
+ render: ({ field: e }) => /* @__PURE__ */ i(Ce, { row: !0, ...e, value: e.value, children: [
794
810
  /* @__PURE__ */ r(
795
- W,
811
+ _,
796
812
  {
797
813
  value: "true",
798
814
  control: /* @__PURE__ */ r(
799
- U,
815
+ G,
800
816
  {
801
- disabled: !m && !i,
817
+ disabled: !h && !d,
802
818
  size: "small"
803
819
  }
804
820
  ),
805
- label: /* @__PURE__ */ r(u, { variant: "body2", children: "Yes" })
821
+ label: /* @__PURE__ */ r(m, { variant: "body2", children: "Yes" })
806
822
  }
807
823
  ),
808
824
  /* @__PURE__ */ r(
809
- W,
825
+ _,
810
826
  {
811
827
  value: "false",
812
828
  control: /* @__PURE__ */ r(
813
- U,
829
+ G,
814
830
  {
815
- disabled: !m && !i,
831
+ disabled: !h && !d,
816
832
  size: "small"
817
833
  }
818
834
  ),
819
- label: /* @__PURE__ */ r(u, { variant: "body2", children: "No" })
835
+ label: /* @__PURE__ */ r(m, { variant: "body2", children: "No" })
820
836
  }
821
837
  )
822
838
  ] })
823
839
  }
824
840
  ) })
825
841
  ] }),
826
- /* @__PURE__ */ s(y, { size: 6, xs: 12, children: [
827
- /* @__PURE__ */ s(
828
- u,
842
+ /* @__PURE__ */ i(f, { size: 6, xs: 12, children: [
843
+ /* @__PURE__ */ i(
844
+ m,
829
845
  {
830
846
  variant: "body2",
831
847
  sx: { fontWeight: 600, mb: 0.5 },
@@ -835,42 +851,42 @@ CONSTRAINT ${h}_pkey PRIMARY KEY (${n})`), o += ");", o;
835
851
  ]
836
852
  }
837
853
  ),
838
- /* @__PURE__ */ r(M, { children: /* @__PURE__ */ r(
839
- N,
854
+ /* @__PURE__ */ r(re, { children: /* @__PURE__ */ r(
855
+ D,
840
856
  {
841
857
  name: "hasMedia",
842
858
  id: "hasMedia",
843
- control: t.control,
859
+ control: n.control,
844
860
  rules: { required: "Required field." },
845
- disabled: !m && !i,
846
- defaultValue: d.hasMedia !== void 0 && d.hasMedia !== null ? String(d.hasMedia) : "",
847
- render: ({ field: e }) => /* @__PURE__ */ s(xe, { row: !0, ...e, value: e.value, children: [
861
+ disabled: !h && !d,
862
+ defaultValue: s.hasMedia !== void 0 && s.hasMedia !== null ? String(s.hasMedia) : "",
863
+ render: ({ field: e }) => /* @__PURE__ */ i(Ce, { row: !0, ...e, value: e.value, children: [
848
864
  /* @__PURE__ */ r(
849
- W,
865
+ _,
850
866
  {
851
867
  value: "true",
852
868
  control: /* @__PURE__ */ r(
853
- U,
869
+ G,
854
870
  {
855
- disabled: !m && !i,
871
+ disabled: !h && !d,
856
872
  size: "small"
857
873
  }
858
874
  ),
859
- label: /* @__PURE__ */ r(u, { variant: "body2", children: "Yes" })
875
+ label: /* @__PURE__ */ r(m, { variant: "body2", children: "Yes" })
860
876
  }
861
877
  ),
862
878
  /* @__PURE__ */ r(
863
- W,
879
+ _,
864
880
  {
865
881
  value: "false",
866
882
  control: /* @__PURE__ */ r(
867
- U,
883
+ G,
868
884
  {
869
- disabled: !m && !i,
885
+ disabled: !h && !d,
870
886
  size: "small"
871
887
  }
872
888
  ),
873
- label: /* @__PURE__ */ r(u, { variant: "body2", children: "No" })
889
+ label: /* @__PURE__ */ r(m, { variant: "body2", children: "No" })
874
890
  }
875
891
  )
876
892
  ] })
@@ -881,20 +897,95 @@ CONSTRAINT ${h}_pkey PRIMARY KEY (${n})`), o += ");", o;
881
897
  ]
882
898
  }
883
899
  ),
884
- F === "true" && /* @__PURE__ */ s(Q, { children: [
885
- /* @__PURE__ */ r(
886
- u,
900
+ M === "true" && /* @__PURE__ */ i(Q, { children: [
901
+ /* @__PURE__ */ i(
902
+ g,
903
+ {
904
+ sx: {
905
+ display: "flex",
906
+ alignItems: "center",
907
+ justifyContent: "space-between",
908
+ mt: 2
909
+ },
910
+ children: [
911
+ /* @__PURE__ */ r(
912
+ m,
913
+ {
914
+ variant: "h6",
915
+ sx: { fontWeight: 600, color: "var(--color-gray1)" },
916
+ children: "Media Configuration:"
917
+ }
918
+ ),
919
+ S && h && /* @__PURE__ */ r(
920
+ z,
921
+ {
922
+ title: "Convert legacy single-API config to the new multi-API format",
923
+ arrow: !0,
924
+ children: /* @__PURE__ */ r(
925
+ T,
926
+ {
927
+ size: "small",
928
+ variant: "contained",
929
+ color: "warning",
930
+ sx: {
931
+ borderRadius: 2,
932
+ fontWeight: 600,
933
+ textTransform: "none",
934
+ boxShadow: "none",
935
+ px: 2
936
+ },
937
+ startIcon: /* @__PURE__ */ r(v, { iconName: "faArrowsRotate" }),
938
+ onClick: () => {
939
+ const e = ne(
940
+ s.mediaConfiguration
941
+ ), a = e.length ? e : [{ apiEndpoint: "", requestParameters: [] }];
942
+ V(a), ue(!0), n.setValue("downloadUrlEntries", a, {
943
+ shouldDirty: !0,
944
+ shouldValidate: !0
945
+ }), K({
946
+ message: "Migrated to multi-API format. Click Submit to save.",
947
+ type: "info"
948
+ });
949
+ },
950
+ children: "Migrate to Multi-API"
951
+ }
952
+ )
953
+ }
954
+ )
955
+ ]
956
+ }
957
+ ),
958
+ S && h && /* @__PURE__ */ r(
959
+ ee,
887
960
  {
888
- variant: "h6",
889
- className: "mt-2",
890
- sx: { fontWeight: 600, color: "var(--color-gray1)" },
891
- children: "Media Configuration:"
961
+ variant: "outlined",
962
+ sx: {
963
+ p: 2,
964
+ mt: 1,
965
+ borderRadius: 2,
966
+ backgroundColor: "rgba(255, 152, 0, 0.06)",
967
+ borderColor: "warning.main",
968
+ textAlign: "center"
969
+ },
970
+ children: /* @__PURE__ */ i(
971
+ m,
972
+ {
973
+ variant: "body2",
974
+ sx: { color: "warning.dark", fontWeight: 500 },
975
+ children: [
976
+ "This table uses the legacy single-API format. Click",
977
+ " ",
978
+ /* @__PURE__ */ r("strong", { children: '"Migrate to Multi-API"' }),
979
+ " above to enable editing the media configuration."
980
+ ]
981
+ }
982
+ )
892
983
  }
893
984
  ),
894
- /* @__PURE__ */ s(y, { container: !0, spacing: 2, className: "mt-2", children: [
895
- /* @__PURE__ */ s(y, { size: 6, xs: 12, children: [
896
- /* @__PURE__ */ s(
897
- u,
985
+ /* @__PURE__ */ i(f, { container: !0, spacing: 2, className: "mt-2", children: [
986
+ /* @__PURE__ */ i(f, { size: 6, xs: 12, children: [
987
+ /* @__PURE__ */ i(
988
+ m,
898
989
  {
899
990
  variant: "subtitle2",
900
991
  sx: { mb: 0.5, fontWeight: 600 },
@@ -906,31 +997,31 @@ CONSTRAINT ${h}_pkey PRIMARY KEY (${n})`), o += ");", o;
906
997
  }
907
998
  ),
908
999
  /* @__PURE__ */ r(
909
- N,
1000
+ D,
910
1001
  {
911
1002
  name: "downloadType",
912
- control: t.control,
1003
+ control: n.control,
913
1004
  rules: {
914
- validate: (e) => F !== "true" || !!e || "Download Type is required."
1005
+ validate: (e) => M !== "true" || !!e || "Download Type is required."
915
1006
  },
916
1007
  render: ({
917
1008
  field: { onChange: e, value: a },
918
- fieldState: { error: l }
1009
+ fieldState: { error: o }
919
1010
  }) => /* @__PURE__ */ r(
920
- ce,
1011
+ pe,
921
1012
  {
922
- options: Se,
1013
+ options: ke,
923
1014
  value: a || null,
924
- disabled: !m && !i,
925
- onChange: (n, o) => e(o),
926
- renderInput: (n) => /* @__PURE__ */ r(
927
- D,
1015
+ disabled: !h && !d || S,
1016
+ onChange: (t, l) => e(l),
1017
+ renderInput: (t) => /* @__PURE__ */ r(
1018
+ q,
928
1019
  {
929
- ...n,
1020
+ ...t,
930
1021
  size: "small",
931
1022
  placeholder: "Select download type",
932
- error: !!l,
933
- helperText: l == null ? void 0 : l.message
1023
+ error: !!o,
1024
+ helperText: o == null ? void 0 : o.message
934
1025
  }
935
1026
  )
936
1027
  }
@@ -938,245 +1029,391 @@ CONSTRAINT ${h}_pkey PRIMARY KEY (${n})`), o += ");", o;
938
1029
  }
939
1030
  )
940
1031
  ] }),
941
- /* @__PURE__ */ r(y, { size: 12, children: /* @__PURE__ */ s(
942
- f,
943
- {
944
- sx: {
945
- border: "1px solid #ddd",
946
- borderRadius: "8px",
947
- p: 2,
948
- backgroundColor: "var(--color-gray4)"
949
- },
950
- children: [
951
- /* @__PURE__ */ r(
952
- u,
953
- {
954
- variant: "subtitle1",
955
- sx: { fontWeight: 600, mb: 1.5, color: "var(--color-text)" },
956
- children: "Download URL"
957
- }
958
- ),
959
- /* @__PURE__ */ s(
960
- u,
961
- {
962
- variant: "subtitle2",
963
- sx: { mb: 0.5, fontWeight: 600 },
964
- children: [
965
- "API Endpoint",
966
- /* @__PURE__ */ r("span", { style: { color: "red" }, children: "*" }),
967
- ":"
968
- ]
969
- }
970
- ),
971
- /* @__PURE__ */ r(
972
- N,
973
- {
974
- name: "apiEndpoint",
975
- control: t.control,
976
- rules: {
977
- validate: (e) => F !== "true" || !!(e != null && e.trim()) || "API Endpoint is required."
978
- },
979
- render: ({ field: e, fieldState: { error: a } }) => /* @__PURE__ */ r(
980
- D,
981
- {
982
- ...e,
983
- value: e.value || "",
984
- size: "small",
985
- variant: "outlined",
986
- fullWidth: !0,
987
- placeholder: "https://api.example.com/endpoint",
988
- error: !!a,
989
- helperText: a == null ? void 0 : a.message,
990
- slotProps: {
991
- input: {
992
- readOnly: !m && !i
993
- }
994
- },
995
- sx: { mb: 2 }
996
- }
997
- )
998
- }
999
- ),
1000
- /* @__PURE__ */ s(
1001
- f,
1002
- {
1003
- sx: { display: "flex", alignItems: "center", mb: 1 },
1004
- children: [
1005
- /* @__PURE__ */ s(
1006
- u,
1007
- {
1008
- variant: "subtitle2",
1009
- sx: { fontWeight: 600, color: "var(--color-text)", flex: 1 },
1010
- children: [
1011
- "Request Parameters",
1012
- /* @__PURE__ */ r("span", { style: { color: "red" }, children: "*" }),
1013
- ":"
1014
- ]
1032
+ /* @__PURE__ */ i(f, { size: 12, children: [
1033
+ /* @__PURE__ */ i(
1034
+ g,
1035
+ {
1036
+ sx: {
1037
+ display: "flex",
1038
+ alignItems: "center",
1039
+ justifyContent: "space-between",
1040
+ mb: 1
1041
+ },
1042
+ children: [
1043
+ /* @__PURE__ */ r(
1044
+ m,
1045
+ {
1046
+ variant: "subtitle1",
1047
+ sx: { fontWeight: 600, color: "var(--color-text)" },
1048
+ children: "Download URL APIs"
1049
+ }
1050
+ ),
1051
+ (h || d) && !S && /* @__PURE__ */ r(z, { title: "Add another API configuration", arrow: !0, children: /* @__PURE__ */ r(
1052
+ T,
1053
+ {
1054
+ size: "small",
1055
+ variant: "outlined",
1056
+ sx: {
1057
+ borderRadius: 2,
1058
+ textTransform: "none",
1059
+ fontWeight: 600,
1060
+ px: 1.5,
1061
+ borderColor: "divider",
1062
+ color: "text.primary",
1063
+ "&:hover": {
1064
+ backgroundColor: "action.hover",
1065
+ borderColor: "text.disabled"
1015
1066
  }
1016
- ),
1017
- (m || i) && /* @__PURE__ */ r(B, { title: "Add parameter", arrow: !0, children: /* @__PURE__ */ r(
1018
- _,
1019
- {
1020
- size: "small",
1021
- onClick: () => {
1022
- const e = [
1023
- ...L,
1024
- { key: "", value: "" }
1025
- ];
1026
- q(e), t.setValue(
1027
- "requestParameters",
1028
- e,
1067
+ },
1068
+ startIcon: /* @__PURE__ */ r(v, { iconName: "faPlus" }),
1069
+ onClick: () => {
1070
+ const e = [
1071
+ ...k,
1072
+ { apiEndpoint: "", requestParameters: [] }
1073
+ ];
1074
+ V(e), n.setValue("downloadUrlEntries", e, {
1075
+ shouldDirty: !0,
1076
+ shouldValidate: !0
1077
+ });
1078
+ },
1079
+ children: "Add Download API"
1080
+ }
1081
+ ) })
1082
+ ]
1083
+ }
1084
+ ),
1085
+ k.length === 0 && /* @__PURE__ */ r(
1086
+ m,
1087
+ {
1088
+ variant: "caption",
1089
+ sx: { color: "var(--color-gray1)", fontStyle: "italic" },
1090
+ children: "No API configurations added."
1091
+ }
1092
+ ),
1093
+ k.map((e, a) => /* @__PURE__ */ i(
1094
+ ee,
1095
+ {
1096
+ variant: "outlined",
1097
+ sx: {
1098
+ p: 2,
1099
+ mb: 1.5,
1100
+ borderRadius: 2,
1101
+ backgroundColor: "var(--color-gray4)",
1102
+ borderColor: "divider"
1103
+ },
1104
+ children: [
1105
+ /* @__PURE__ */ i(
1106
+ g,
1107
+ {
1108
+ sx: {
1109
+ display: "flex",
1110
+ alignItems: "center",
1111
+ justifyContent: "space-between",
1112
+ mb: 1.5
1113
+ },
1114
+ children: [
1115
+ /* @__PURE__ */ i(
1116
+ m,
1117
+ {
1118
+ variant: "subtitle2",
1119
+ sx: { fontWeight: 700, color: "var(--color-text)" },
1120
+ children: [
1121
+ "API Configuration #",
1122
+ a + 1
1123
+ ]
1124
+ }
1125
+ ),
1126
+ (h || d) && !S && k.length > 1 && /* @__PURE__ */ r(z, { title: "Remove this API configuration", arrow: !0, children: /* @__PURE__ */ r(
1127
+ W,
1128
+ {
1129
+ size: "small",
1130
+ onClick: () => {
1131
+ const o = k.filter(
1132
+ (t, l) => l !== a
1133
+ );
1134
+ V(o), n.setValue(
1135
+ "downloadUrlEntries",
1136
+ o,
1137
+ {
1138
+ shouldDirty: !0,
1139
+ shouldValidate: !0
1140
+ }
1141
+ );
1142
+ },
1143
+ sx: { color: "#ef4444" },
1144
+ children: /* @__PURE__ */ r(
1145
+ v,
1029
1146
  {
1030
- shouldDirty: !0,
1031
- shouldValidate: !0
1147
+ iconName: "faTrashCan",
1148
+ className: "text-[0.85rem]"
1032
1149
  }
1033
- );
1034
- },
1035
- sx: {
1036
- backgroundColor: "var(--color-tableHeader)",
1037
- color: "white",
1038
- "&:hover": { backgroundColor: "#3d4f5c" },
1039
- borderRadius: "6px",
1040
- width: "28px",
1041
- height: "28px"
1042
- },
1043
- children: /* @__PURE__ */ r(
1044
- v,
1045
- {
1046
- iconName: "faPlus",
1047
- className: "text-[0.75rem]"
1048
- }
1049
- )
1150
+ )
1151
+ }
1152
+ ) })
1153
+ ]
1154
+ }
1155
+ ),
1156
+ /* @__PURE__ */ i(
1157
+ m,
1158
+ {
1159
+ variant: "subtitle2",
1160
+ sx: { mb: 0.5, fontWeight: 600 },
1161
+ children: [
1162
+ "API Endpoint",
1163
+ /* @__PURE__ */ r("span", { style: { color: "red" }, children: "*" }),
1164
+ ":"
1165
+ ]
1166
+ }
1167
+ ),
1168
+ /* @__PURE__ */ r(
1169
+ q,
1170
+ {
1171
+ value: e.apiEndpoint || "",
1172
+ size: "small",
1173
+ variant: "outlined",
1174
+ fullWidth: !0,
1175
+ placeholder: "https://api.example.com/endpoint",
1176
+ slotProps: {
1177
+ input: {
1178
+ readOnly: !h && !d || S
1050
1179
  }
1051
- ) })
1052
- ]
1053
- }
1054
- ),
1055
- L.length === 0 && /* @__PURE__ */ r(
1056
- u,
1057
- {
1058
- variant: "caption",
1059
- sx: { color: "var(--color-gray1)", fontStyle: "italic" },
1060
- children: "No request parameters added."
1061
- }
1062
- ),
1063
- L.map((e, a) => /* @__PURE__ */ s(
1064
- f,
1065
- {
1066
- sx: {
1067
- display: "flex",
1068
- gap: 1,
1069
- alignItems: "flex-start",
1070
- mb: 1,
1071
- p: 1,
1072
- borderRadius: "6px",
1073
- backgroundColor: "var(--color-gray4)",
1074
- border: "1px solid var(--color-gray3)"
1075
- },
1076
- children: [
1077
- /* @__PURE__ */ r(
1078
- D,
1079
- {
1080
- size: "small",
1081
- label: "Key",
1082
- value: e.key,
1083
- placeholder: "parameterKey",
1084
- disabled: !m && !i,
1085
- onChange: (l) => {
1086
- const n = L.map(
1087
- (o, h) => h === a ? { ...o, key: l.target.value } : o
1088
- );
1089
- q(n), t.setValue(
1090
- "requestParameters",
1091
- n,
1180
+ },
1181
+ onChange: (o) => {
1182
+ const t = k.map(
1183
+ (l, u) => u === a ? { ...l, apiEndpoint: o.target.value } : l
1184
+ );
1185
+ V(t), n.setValue(
1186
+ "downloadUrlEntries",
1187
+ t,
1188
+ {
1189
+ shouldDirty: !0,
1190
+ shouldValidate: !0
1191
+ }
1192
+ );
1193
+ },
1194
+ sx: { mb: 2 }
1195
+ }
1196
+ ),
1197
+ /* @__PURE__ */ i(
1198
+ g,
1199
+ {
1200
+ sx: {
1201
+ display: "flex",
1202
+ alignItems: "center",
1203
+ mb: 1
1204
+ },
1205
+ children: [
1206
+ /* @__PURE__ */ i(
1207
+ m,
1208
+ {
1209
+ variant: "subtitle2",
1210
+ sx: {
1211
+ fontWeight: 600,
1212
+ color: "var(--color-text)",
1213
+ flex: 1
1214
+ },
1215
+ children: [
1216
+ "Request Parameters",
1217
+ /* @__PURE__ */ r("span", { style: { color: "red" }, children: "*" }),
1218
+ ":"
1219
+ ]
1220
+ }
1221
+ ),
1222
+ (h || d) && !S && /* @__PURE__ */ r(z, { title: "Add parameter", arrow: !0, children: /* @__PURE__ */ r(
1223
+ W,
1224
+ {
1225
+ size: "small",
1226
+ onClick: () => {
1227
+ const o = k.map(
1228
+ (t, l) => l === a ? {
1229
+ ...t,
1230
+ requestParameters: [
1231
+ ...t.requestParameters || [],
1232
+ { key: "", value: "" }
1233
+ ]
1234
+ } : t
1235
+ );
1236
+ V(o), n.setValue(
1237
+ "downloadUrlEntries",
1238
+ o,
1239
+ {
1240
+ shouldDirty: !0,
1241
+ shouldValidate: !0
1242
+ }
1243
+ );
1244
+ },
1245
+ sx: {
1246
+ backgroundColor: "var(--color-tableHeader)",
1247
+ color: "white",
1248
+ "&:hover": {
1249
+ backgroundColor: "#3d4f5c"
1250
+ },
1251
+ borderRadius: "6px",
1252
+ width: "28px",
1253
+ height: "28px"
1254
+ },
1255
+ children: /* @__PURE__ */ r(
1256
+ v,
1092
1257
  {
1093
- shouldDirty: !0,
1094
- shouldValidate: !0
1258
+ iconName: "faPlus",
1259
+ className: "text-[0.75rem]"
1095
1260
  }
1096
- );
1097
- },
1098
- sx: { flex: 1 }
1099
- }
1100
- ),
1101
- /* @__PURE__ */ r(
1102
- ce,
1103
- {
1104
- size: "small",
1105
- options: b.map(
1106
- (l) => l.name
1261
+ )
1262
+ }
1263
+ ) })
1264
+ ]
1265
+ }
1266
+ ),
1267
+ (!e.requestParameters || e.requestParameters.length === 0) && /* @__PURE__ */ r(
1268
+ m,
1269
+ {
1270
+ variant: "caption",
1271
+ sx: {
1272
+ color: "var(--color-gray1)",
1273
+ fontStyle: "italic"
1274
+ },
1275
+ children: "No request parameters added."
1276
+ }
1277
+ ),
1278
+ (e.requestParameters || []).map(
1279
+ (o, t) => /* @__PURE__ */ i(
1280
+ g,
1281
+ {
1282
+ sx: {
1283
+ display: "flex",
1284
+ gap: 1,
1285
+ alignItems: "flex-start",
1286
+ mb: 1,
1287
+ p: 1,
1288
+ borderRadius: "6px",
1289
+ backgroundColor: "var(--color-gray4)",
1290
+ border: "1px solid var(--color-gray3)"
1291
+ },
1292
+ children: [
1293
+ /* @__PURE__ */ r(
1294
+ q,
1295
+ {
1296
+ size: "small",
1297
+ label: "Key",
1298
+ value: o.key,
1299
+ placeholder: "parameterKey",
1300
+ disabled: !h && !d || S,
1301
+ onChange: (l) => {
1302
+ const u = (e.requestParameters || []).map(
1303
+ (p, y) => y === t ? { ...p, key: l.target.value } : p
1304
+ ), c = k.map(
1305
+ (p, y) => y === a ? {
1306
+ ...p,
1307
+ requestParameters: u
1308
+ } : p
1309
+ );
1310
+ V(c), n.setValue(
1311
+ "downloadUrlEntries",
1312
+ c,
1313
+ {
1314
+ shouldDirty: !0,
1315
+ shouldValidate: !0
1316
+ }
1317
+ );
1318
+ },
1319
+ sx: { flex: 1 }
1320
+ }
1107
1321
  ),
1108
- value: e.value || null,
1109
- disabled: !m && !i,
1110
- noOptionsText: b.length === 0 ? "No synced columns yet" : "No match",
1111
- onChange: (l, n) => {
1112
- const o = L.map(
1113
- (h, c) => c === a ? { ...h, value: n || "" } : h
1114
- );
1115
- q(o), t.setValue(
1116
- "requestParameters",
1117
- o,
1118
- {
1119
- shouldDirty: !0,
1120
- shouldValidate: !0
1121
- }
1122
- );
1123
- },
1124
- renderInput: (l) => /* @__PURE__ */ r(
1125
- D,
1322
+ /* @__PURE__ */ r(
1323
+ pe,
1126
1324
  {
1127
- ...l,
1128
- label: "Value (Column)",
1129
- placeholder: "Select column"
1325
+ size: "small",
1326
+ options: N.map(
1327
+ (l) => l.name
1328
+ ),
1329
+ value: o.value || null,
1330
+ disabled: !h && !d || S,
1331
+ noOptionsText: N.length === 0 ? "No synced columns yet" : "No match",
1332
+ onChange: (l, u) => {
1333
+ const c = (e.requestParameters || []).map(
1334
+ (y, R) => R === t ? { ...y, value: u || "" } : y
1335
+ ), p = k.map(
1336
+ (y, R) => R === a ? {
1337
+ ...y,
1338
+ requestParameters: c
1339
+ } : y
1340
+ );
1341
+ V(p), n.setValue(
1342
+ "downloadUrlEntries",
1343
+ p,
1344
+ {
1345
+ shouldDirty: !0,
1346
+ shouldValidate: !0
1347
+ }
1348
+ );
1349
+ },
1350
+ renderInput: (l) => /* @__PURE__ */ r(
1351
+ q,
1352
+ {
1353
+ ...l,
1354
+ label: "Value (Column)",
1355
+ placeholder: "Select column"
1356
+ }
1357
+ ),
1358
+ sx: { flex: 1 }
1130
1359
  }
1131
1360
  ),
1132
- sx: { flex: 1 }
1133
- }
1134
- ),
1135
- (m || i) && /* @__PURE__ */ r(B, { title: "Remove parameter", arrow: !0, children: /* @__PURE__ */ r(
1136
- _,
1137
- {
1138
- size: "small",
1139
- onClick: () => {
1140
- const l = L.filter(
1141
- (n, o) => o !== a
1142
- );
1143
- q(l), t.setValue(
1144
- "requestParameters",
1145
- l,
1146
- {
1147
- shouldDirty: !0,
1148
- shouldValidate: !0
1149
- }
1150
- );
1151
- },
1152
- sx: { color: "#ef4444", alignSelf: "center" },
1153
- children: /* @__PURE__ */ r(
1154
- v,
1361
+ (h || d) && !S && /* @__PURE__ */ r(z, { title: "Remove parameter", arrow: !0, children: /* @__PURE__ */ r(
1362
+ W,
1155
1363
  {
1156
- iconName: "faTrashCan",
1157
- className: "text-[0.85rem]"
1364
+ size: "small",
1365
+ onClick: () => {
1366
+ const l = (e.requestParameters || []).filter(
1367
+ (c, p) => p !== t
1368
+ ), u = k.map(
1369
+ (c, p) => p === a ? {
1370
+ ...c,
1371
+ requestParameters: l
1372
+ } : c
1373
+ );
1374
+ V(u), n.setValue(
1375
+ "downloadUrlEntries",
1376
+ u,
1377
+ {
1378
+ shouldDirty: !0,
1379
+ shouldValidate: !0
1380
+ }
1381
+ );
1382
+ },
1383
+ sx: {
1384
+ color: "#ef4444",
1385
+ alignSelf: "center"
1386
+ },
1387
+ children: /* @__PURE__ */ r(
1388
+ v,
1389
+ {
1390
+ iconName: "faTrashCan",
1391
+ className: "text-[0.85rem]"
1392
+ }
1393
+ )
1158
1394
  }
1159
- )
1160
- }
1161
- ) })
1162
- ]
1163
- },
1164
- a
1165
- )),
1166
- t.formState.errors.requestParameters && /* @__PURE__ */ r(
1167
- u,
1168
- {
1169
- variant: "caption",
1170
- sx: { color: "#ef4444", mt: 0.5, display: "block" },
1171
- children: t.formState.errors.requestParameters.message
1172
- }
1173
- )
1174
- ]
1175
- }
1176
- ) }),
1177
- /* @__PURE__ */ s(y, { size: 6, xs: 12, children: [
1178
- /* @__PURE__ */ s(
1179
- u,
1395
+ ) })
1396
+ ]
1397
+ },
1398
+ t
1399
+ )
1400
+ )
1401
+ ]
1402
+ },
1403
+ a
1404
+ )),
1405
+ n.formState.errors.downloadUrlEntries && /* @__PURE__ */ r(
1406
+ m,
1407
+ {
1408
+ variant: "caption",
1409
+ sx: { color: "#ef4444", mt: 0.5, display: "block" },
1410
+ children: n.formState.errors.downloadUrlEntries.message
1411
+ }
1412
+ )
1413
+ ] }),
1414
+ /* @__PURE__ */ i(f, { size: 6, xs: 12, children: [
1415
+ /* @__PURE__ */ i(
1416
+ m,
1180
1417
  {
1181
1418
  variant: "subtitle2",
1182
1419
  sx: { mb: 0.5, fontWeight: 600 },
@@ -1188,16 +1425,16 @@ CONSTRAINT ${h}_pkey PRIMARY KEY (${n})`), o += ");", o;
1188
1425
  }
1189
1426
  ),
1190
1427
  /* @__PURE__ */ r(
1191
- N,
1428
+ D,
1192
1429
  {
1193
1430
  name: "directoryPath",
1194
- control: t.control,
1431
+ control: n.control,
1195
1432
  defaultValue: "",
1196
1433
  rules: {
1197
- validate: (e) => F !== "true" || !!(e != null && e.trim()) && e.trim().length > 0 || "Directory Path is required."
1434
+ validate: (e) => M !== "true" || !!(e != null && e.trim()) && e.trim().length > 0 || "Directory Path is required."
1198
1435
  },
1199
1436
  render: ({ field: e, fieldState: { error: a } }) => /* @__PURE__ */ r(
1200
- D,
1437
+ q,
1201
1438
  {
1202
1439
  ...e,
1203
1440
  size: "small",
@@ -1207,9 +1444,9 @@ CONSTRAINT ${h}_pkey PRIMARY KEY (${n})`), o += ");", o;
1207
1444
  helperText: a == null ? void 0 : a.message,
1208
1445
  slotProps: {
1209
1446
  input: {
1210
- readOnly: !m && !i,
1211
- startAdornment: /* @__PURE__ */ r(ve, { position: "start", children: "#directoryPath#/" }),
1212
- endAdornment: /* @__PURE__ */ r(ve, { position: "end", children: "/" })
1447
+ readOnly: !h && !d || S,
1448
+ startAdornment: /* @__PURE__ */ r(we, { position: "start", children: "#directoryPath#/" }),
1449
+ endAdornment: /* @__PURE__ */ r(we, { position: "end", children: "/" })
1213
1450
  }
1214
1451
  }
1215
1452
  }
@@ -1220,14 +1457,14 @@ CONSTRAINT ${h}_pkey PRIMARY KEY (${n})`), o += ");", o;
1220
1457
  ] })
1221
1458
  ] })
1222
1459
  ] }),
1223
- /* @__PURE__ */ r(y, { size: 5, children: /* @__PURE__ */ s(
1224
- ge,
1460
+ /* @__PURE__ */ r(f, { size: 5, children: /* @__PURE__ */ i(
1461
+ ee,
1225
1462
  {
1226
1463
  variant: "outlined",
1227
1464
  sx: { px: 2, borderRadius: 1.5, height: "100%", mb: 1 },
1228
1465
  children: [
1229
- /* @__PURE__ */ s(
1230
- f,
1466
+ /* @__PURE__ */ i(
1467
+ g,
1231
1468
  {
1232
1469
  sx: {
1233
1470
  display: "flex",
@@ -1238,8 +1475,8 @@ CONSTRAINT ${h}_pkey PRIMARY KEY (${n})`), o += ");", o;
1238
1475
  pt: 1.5
1239
1476
  },
1240
1477
  children: [
1241
- /* @__PURE__ */ s(
1242
- f,
1478
+ /* @__PURE__ */ i(
1479
+ g,
1243
1480
  {
1244
1481
  sx: {
1245
1482
  display: "inline-flex",
@@ -1252,12 +1489,12 @@ CONSTRAINT ${h}_pkey PRIMARY KEY (${n})`), o += ");", o;
1252
1489
  mb: 1
1253
1490
  },
1254
1491
  children: [
1255
- !i && /* @__PURE__ */ r(
1256
- O,
1492
+ !d && /* @__PURE__ */ r(
1493
+ T,
1257
1494
  {
1258
1495
  size: "small",
1259
1496
  onClick: () => {
1260
- le(0), I("");
1497
+ se(0), Y("");
1261
1498
  },
1262
1499
  sx: {
1263
1500
  px: 1.5,
@@ -1265,25 +1502,25 @@ CONSTRAINT ${h}_pkey PRIMARY KEY (${n})`), o += ");", o;
1265
1502
  borderRadius: 1.5,
1266
1503
  textTransform: "none",
1267
1504
  fontSize: "0.78rem",
1268
- fontWeight: g === 0 ? 700 : 500,
1269
- color: g === 0 ? "primary.dark" : "text.secondary",
1270
- backgroundColor: g === 0 ? "background.paper" : "transparent",
1271
- boxShadow: g === 0 ? "0px 1px 4px rgba(0,0,0,0.06)" : "none",
1505
+ fontWeight: x === 0 ? 700 : 500,
1506
+ color: x === 0 ? "primary.dark" : "text.secondary",
1507
+ backgroundColor: x === 0 ? "background.paper" : "transparent",
1508
+ boxShadow: x === 0 ? "0px 1px 4px rgba(0,0,0,0.06)" : "none",
1272
1509
  border: "1px solid",
1273
- borderColor: g === 0 ? "divider" : "transparent",
1510
+ borderColor: x === 0 ? "divider" : "transparent",
1274
1511
  "&:hover": {
1275
- backgroundColor: g === 0 ? "background.paper" : "action.hover"
1512
+ backgroundColor: x === 0 ? "background.paper" : "action.hover"
1276
1513
  }
1277
1514
  },
1278
1515
  children: "Synced Columns"
1279
1516
  }
1280
1517
  ),
1281
- k !== void 0 && /* @__PURE__ */ r(
1282
- O,
1518
+ A !== void 0 && /* @__PURE__ */ r(
1519
+ T,
1283
1520
  {
1284
1521
  size: "small",
1285
1522
  onClick: () => {
1286
- le(1), I("");
1523
+ se(1), Y("");
1287
1524
  },
1288
1525
  sx: {
1289
1526
  px: 1.5,
@@ -1291,53 +1528,53 @@ CONSTRAINT ${h}_pkey PRIMARY KEY (${n})`), o += ");", o;
1291
1528
  borderRadius: 1.5,
1292
1529
  textTransform: "none",
1293
1530
  fontSize: "0.78rem",
1294
- fontWeight: g === 1 ? 700 : 500,
1295
- color: g === 1 ? "primary.dark" : "text.secondary",
1296
- backgroundColor: g === 1 ? "background.paper" : "transparent",
1297
- boxShadow: g === 1 ? "0px 1px 4px rgba(0,0,0,0.06)" : "none",
1531
+ fontWeight: x === 1 ? 700 : 500,
1532
+ color: x === 1 ? "primary.dark" : "text.secondary",
1533
+ backgroundColor: x === 1 ? "background.paper" : "transparent",
1534
+ boxShadow: x === 1 ? "0px 1px 4px rgba(0,0,0,0.06)" : "none",
1298
1535
  border: "1px solid",
1299
- borderColor: g === 1 ? "divider" : "transparent",
1536
+ borderColor: x === 1 ? "divider" : "transparent",
1300
1537
  "&:hover": {
1301
- backgroundColor: g === 1 ? "background.paper" : "action.hover"
1538
+ backgroundColor: x === 1 ? "background.paper" : "action.hover"
1302
1539
  }
1303
1540
  },
1304
- children: i ? "Columns" : "DB Columns"
1541
+ children: d ? "Columns" : "DB Columns"
1305
1542
  }
1306
1543
  )
1307
1544
  ]
1308
1545
  }
1309
1546
  ),
1310
- g === 0 && b.length > 0 && G && /* @__PURE__ */ r(f, { sx: { minWidth: 200, marginLeft: 2 }, children: /* @__PURE__ */ r(
1311
- ce,
1547
+ x === 0 && N.length > 0 && I && /* @__PURE__ */ r(g, { sx: { minWidth: 200, marginLeft: 2 }, children: /* @__PURE__ */ r(
1548
+ pe,
1312
1549
  {
1313
1550
  size: "small",
1314
- options: b.map((e) => e.name),
1315
- value: t.getValues("primaryKey") || "",
1316
- readOnly: !m && !i,
1551
+ options: N.map((e) => e.name),
1552
+ value: n.getValues("primaryKey") || "",
1553
+ readOnly: !h && !d,
1317
1554
  onChange: (e, a) => {
1318
- const l = b.map(
1319
- (n) => ({
1320
- ...n,
1321
- isPrimaryKey: n.name === a
1555
+ const o = N.map(
1556
+ (t) => ({
1557
+ ...t,
1558
+ isPrimaryKey: t.name === a
1322
1559
  })
1323
1560
  );
1324
- K(l), t.setValue("selectedColumns", l, {
1561
+ L(o), n.setValue("selectedColumns", o, {
1325
1562
  shouldDirty: !0
1326
- }), t.setValue("primaryKey", a);
1563
+ }), n.setValue("primaryKey", a);
1327
1564
  },
1328
1565
  renderInput: (e) => /* @__PURE__ */ r(
1329
- D,
1566
+ q,
1330
1567
  {
1331
1568
  ...e,
1332
1569
  label: "Primary Key",
1333
1570
  placeholder: "Select column"
1334
1571
  }
1335
1572
  ),
1336
- renderOption: (e, a) => /* @__PURE__ */ r("li", { ...e, children: /* @__PURE__ */ r(B, { title: a, placement: "left", arrow: !0, children: /* @__PURE__ */ r("span", { className: "truncate max-w-[250px]", children: a }) }) })
1573
+ renderOption: (e, a) => /* @__PURE__ */ r("li", { ...e, children: /* @__PURE__ */ r(z, { title: a, placement: "left", arrow: !0, children: /* @__PURE__ */ r("span", { className: "truncate max-w-[250px]", children: a }) }) })
1337
1574
  }
1338
1575
  ) }),
1339
- (i || m) && /* @__PURE__ */ r(
1340
- O,
1576
+ (d || h) && /* @__PURE__ */ r(
1577
+ T,
1341
1578
  {
1342
1579
  id: "edit-button-anchor",
1343
1580
  size: "small",
@@ -1350,61 +1587,61 @@ CONSTRAINT ${h}_pkey PRIMARY KEY (${n})`), o += ");", o;
1350
1587
  px: 1.5,
1351
1588
  ml: 1
1352
1589
  },
1353
- disabled: !!t.formState.errors.tableName,
1590
+ disabled: !!n.formState.errors.tableName,
1354
1591
  onClick: async (e) => {
1355
1592
  const a = e.currentTarget;
1356
- await t.trigger("tableName") && (ie(null), oe(a));
1593
+ await n.trigger("tableName") && (ce(null), de(a));
1357
1594
  },
1358
1595
  startIcon: /* @__PURE__ */ r(v, { iconName: "faPlus" }),
1359
1596
  children: "Column"
1360
1597
  }
1361
1598
  ),
1362
- (i || m) && /* @__PURE__ */ r(
1363
- yr,
1599
+ (d || h) && /* @__PURE__ */ r(
1600
+ xr,
1364
1601
  {
1365
- id: tr,
1602
+ id: ir,
1366
1603
  open: Te,
1367
- anchorEl: Ke,
1604
+ anchorEl: ze,
1368
1605
  onClose: async () => {
1369
- oe(null), t.setValue("newColumnName", ""), t.setValue("newColumnType", null), t.setValue("isPrimaryKey", !1), t.clearErrors([
1606
+ de(null), n.setValue("newColumnName", ""), n.setValue("newColumnType", null), n.setValue("isPrimaryKey", !1), n.clearErrors([
1370
1607
  "newColumnName",
1371
1608
  "newColumnType"
1372
- ]), ie(null);
1609
+ ]), ce(null);
1373
1610
  },
1374
1611
  anchorOrigin: {
1375
1612
  vertical: "bottom",
1376
1613
  horizontal: "left"
1377
1614
  },
1378
- children: /* @__PURE__ */ s(
1379
- y,
1615
+ children: /* @__PURE__ */ i(
1616
+ f,
1380
1617
  {
1381
1618
  container: !0,
1382
1619
  spacing: 1,
1383
1620
  sx: {
1384
1621
  p: 1,
1385
1622
  width: "200px",
1386
- height: (Ue = t.getValues("selectedColumns")) != null && Ue.some((e) => e.isPrimaryKey) ? "180px" : "210px"
1623
+ height: (Ie = n.getValues("selectedColumns")) != null && Ie.some((e) => e.isPrimaryKey) ? "180px" : "210px"
1387
1624
  },
1388
1625
  children: [
1389
- /* @__PURE__ */ r(y, { size: 12, className: "h-fit", children: /* @__PURE__ */ r(M, { fullWidth: !0, children: /* @__PURE__ */ r(
1390
- N,
1626
+ /* @__PURE__ */ r(f, { size: 12, className: "h-fit", children: /* @__PURE__ */ r(re, { fullWidth: !0, children: /* @__PURE__ */ r(
1627
+ D,
1391
1628
  {
1392
1629
  name: "newColumnName",
1393
1630
  id: "newColumnName",
1394
- control: t.control,
1631
+ control: n.control,
1395
1632
  render: ({
1396
- field: { onChange: e, value: a, ...l },
1397
- fieldState: { error: n }
1633
+ field: { onChange: e, value: a, ...o },
1634
+ fieldState: { error: t }
1398
1635
  }) => /* @__PURE__ */ r(
1399
- D,
1636
+ q,
1400
1637
  {
1401
- ...l,
1638
+ ...o,
1402
1639
  value: (a == null ? void 0 : a.trim()) || "",
1403
1640
  variant: "outlined",
1404
1641
  fullWidth: !0,
1405
1642
  size: "small",
1406
- error: !!n,
1407
- helperText: n == null ? void 0 : n.message,
1643
+ error: !!t,
1644
+ helperText: t == null ? void 0 : t.message,
1408
1645
  label: "Column Name",
1409
1646
  sx: {
1410
1647
  "& .MuiInputLabel-root": {
@@ -1412,38 +1649,38 @@ CONSTRAINT ${h}_pkey PRIMARY KEY (${n})`), o += ");", o;
1412
1649
  },
1413
1650
  margin: 0
1414
1651
  },
1415
- onChange: (o) => {
1416
- e(o.target.value), ur(o.target.value);
1652
+ onChange: (l) => {
1653
+ e(l.target.value), pr(l.target.value);
1417
1654
  }
1418
1655
  }
1419
1656
  )
1420
1657
  }
1421
1658
  ) }) }),
1422
- /* @__PURE__ */ r(y, { size: 12, className: "h-fit", children: /* @__PURE__ */ r(M, { fullWidth: !0, children: /* @__PURE__ */ r(
1423
- N,
1659
+ /* @__PURE__ */ r(f, { size: 12, className: "h-fit", children: /* @__PURE__ */ r(re, { fullWidth: !0, children: /* @__PURE__ */ r(
1660
+ D,
1424
1661
  {
1425
1662
  name: "newColumnType",
1426
1663
  id: "newColumnType",
1427
- control: t.control,
1664
+ control: n.control,
1428
1665
  render: ({
1429
1666
  field: { onChange: e, value: a },
1430
- fieldState: { error: l }
1667
+ fieldState: { error: o }
1431
1668
  }) => /* @__PURE__ */ r(
1432
- ce,
1669
+ pe,
1433
1670
  {
1434
- options: ze || [],
1671
+ options: Re || [],
1435
1672
  value: (a == null ? void 0 : a.trim()) || null,
1436
- getOptionLabel: (n) => n,
1437
- onChange: (n, o) => {
1438
- e(o);
1673
+ getOptionLabel: (t) => t,
1674
+ onChange: (t, l) => {
1675
+ e(l);
1439
1676
  },
1440
- renderInput: (n) => /* @__PURE__ */ r(
1441
- D,
1677
+ renderInput: (t) => /* @__PURE__ */ r(
1678
+ q,
1442
1679
  {
1443
- ...n,
1680
+ ...t,
1444
1681
  size: "small",
1445
- error: !!l,
1446
- helperText: l == null ? void 0 : l.message,
1682
+ error: !!o,
1683
+ helperText: o == null ? void 0 : o.message,
1447
1684
  sx: {
1448
1685
  "& .MuiInputLabel-root": {
1449
1686
  fontSize: "0.9rem"
@@ -1451,10 +1688,10 @@ CONSTRAINT ${h}_pkey PRIMARY KEY (${n})`), o += ");", o;
1451
1688
  m: 0
1452
1689
  },
1453
1690
  label: "Column Type",
1454
- onChange: (o) => {
1455
- e(o.target.value), t.setValue(
1691
+ onChange: (l) => {
1692
+ e(l.target.value), n.setValue(
1456
1693
  "newColumnType",
1457
- o.target.value,
1694
+ l.target.value,
1458
1695
  {
1459
1696
  shouldDirty: !0
1460
1697
  }
@@ -1466,21 +1703,21 @@ CONSTRAINT ${h}_pkey PRIMARY KEY (${n})`), o += ");", o;
1466
1703
  )
1467
1704
  }
1468
1705
  ) }) }),
1469
- X === null && !t.getValues("selectedColumns").some((e) => e.isPrimaryKey) && /* @__PURE__ */ r(y, { size: 12, className: "h-fit", children: /* @__PURE__ */ r(
1470
- W,
1706
+ Z === null && !n.getValues("selectedColumns").some((e) => e.isPrimaryKey) && /* @__PURE__ */ r(f, { size: 12, className: "h-fit", children: /* @__PURE__ */ r(
1707
+ _,
1471
1708
  {
1472
1709
  control: /* @__PURE__ */ r(
1473
- N,
1710
+ D,
1474
1711
  {
1475
1712
  name: "isPrimaryKey",
1476
- control: t.control,
1713
+ control: n.control,
1477
1714
  render: ({
1478
1715
  field: { onChange: e, value: a }
1479
1716
  }) => /* @__PURE__ */ r(
1480
- fr,
1717
+ vr,
1481
1718
  {
1482
1719
  checked: a || !1,
1483
- onChange: (l) => e(l.target.checked),
1720
+ onChange: (o) => e(o.target.checked),
1484
1721
  sx: {
1485
1722
  margin: "0px"
1486
1723
  }
@@ -1491,30 +1728,30 @@ CONSTRAINT ${h}_pkey PRIMARY KEY (${n})`), o += ");", o;
1491
1728
  label: "Primary Key"
1492
1729
  }
1493
1730
  ) }),
1494
- /* @__PURE__ */ r(y, { children: /* @__PURE__ */ r(
1495
- O,
1731
+ /* @__PURE__ */ r(f, { children: /* @__PURE__ */ r(
1732
+ T,
1496
1733
  {
1497
1734
  size: "small",
1498
1735
  variant: "contained",
1499
- disabled: !Oe || !Re || Oe.trim() === "" || !ze.includes(
1500
- Re.trim()
1736
+ disabled: !Oe || !qe || Oe.trim() === "" || !Re.includes(
1737
+ qe.trim()
1501
1738
  ),
1502
1739
  onClick: async () => {
1503
- const e = t.getValues("isPrimaryKey"), a = t.getValues("newColumnName"), l = t.getValues("newColumnType"), n = t.getValues("selectedColumns").some((c) => c.isPrimaryKey);
1504
- let o = [
1505
- ...t.getValues("selectedColumns")
1740
+ const e = n.getValues("isPrimaryKey"), a = n.getValues("newColumnName"), o = n.getValues("newColumnType"), t = n.getValues("selectedColumns").some((c) => c.isPrimaryKey);
1741
+ let l = [
1742
+ ...n.getValues("selectedColumns")
1506
1743
  ];
1507
- if (X !== null)
1508
- o[X] = {
1509
- ...o[X],
1744
+ if (Z !== null)
1745
+ l[Z] = {
1746
+ ...l[Z],
1510
1747
  name: a,
1511
- type: l
1748
+ type: o
1512
1749
  };
1513
1750
  else {
1514
- if (o.some(
1751
+ if (l.some(
1515
1752
  (p) => p.name === a
1516
1753
  )) {
1517
- V({
1754
+ K({
1518
1755
  message: "Column already exists",
1519
1756
  type: "error"
1520
1757
  });
@@ -1522,21 +1759,21 @@ CONSTRAINT ${h}_pkey PRIMARY KEY (${n})`), o += ");", o;
1522
1759
  }
1523
1760
  const c = {
1524
1761
  name: a,
1525
- type: l
1762
+ type: o
1526
1763
  };
1527
- !n && e && (t.setValue("primaryKey", a), c.isPrimaryKey = !0), o.push(c);
1764
+ !t && e && (n.setValue("primaryKey", a), c.isPrimaryKey = !0), l.push(c);
1528
1765
  }
1529
- t.setValue(
1766
+ n.setValue(
1530
1767
  "selectedColumns",
1531
- o,
1768
+ l,
1532
1769
  {
1533
1770
  shouldDirty: !0
1534
1771
  }
1535
1772
  );
1536
- const h = [...o].sort((c, p) => c.isPrimaryKey ? -1 : p.isPrimaryKey ? 1 : c.name.localeCompare(p.name));
1537
- K(h), i && await ye(o), ie(null), oe(null), g !== 0 && le(0), t.setValue("newColumnName", " "), t.setValue("newColumnType", " "), t.setValue("isPrimaryKey", null);
1773
+ const u = [...l].sort((c, p) => c.isPrimaryKey ? -1 : p.isPrimaryKey ? 1 : c.name.localeCompare(p.name));
1774
+ L(u), d && await xe(l), ce(null), de(null), x !== 0 && se(0), n.setValue("newColumnName", " "), n.setValue("newColumnType", " "), n.setValue("isPrimaryKey", null);
1538
1775
  },
1539
- children: X !== null ? "Update" : "Add"
1776
+ children: Z !== null ? "Update" : "Add"
1540
1777
  }
1541
1778
  ) })
1542
1779
  ]
@@ -1548,34 +1785,34 @@ CONSTRAINT ${h}_pkey PRIMARY KEY (${n})`), o += ");", o;
1548
1785
  }
1549
1786
  ),
1550
1787
  /* @__PURE__ */ r(
1551
- gr,
1788
+ Cr,
1552
1789
  {
1553
1790
  sx: {
1554
- maxHeight: F === "true" ? "112vh" : "59vh",
1791
+ maxHeight: M === "true" ? "112vh" : "59vh",
1555
1792
  border: "1px solid",
1556
1793
  borderColor: "divider",
1557
1794
  borderRadius: 2
1558
1795
  },
1559
- children: /* @__PURE__ */ s(xr, { stickyHeader: !0, children: [
1560
- /* @__PURE__ */ r(vr, { children: /* @__PURE__ */ r(ee, { children: /* @__PURE__ */ s(
1561
- re,
1796
+ children: /* @__PURE__ */ i(wr, { stickyHeader: !0, children: [
1797
+ /* @__PURE__ */ r(br, { children: /* @__PURE__ */ r(ae, { children: /* @__PURE__ */ i(
1798
+ te,
1562
1799
  {
1563
1800
  className: " px-3 ",
1564
1801
  sx: { backgroundColor: "white" },
1565
1802
  children: [
1566
1803
  /* @__PURE__ */ r(
1567
- D,
1804
+ q,
1568
1805
  {
1569
1806
  size: "small",
1570
1807
  placeholder: "Search Columns",
1571
1808
  variant: "outlined",
1572
- value: te,
1809
+ value: ie,
1573
1810
  onChange: (e) => {
1574
- I(e.target.value);
1811
+ Y(e.target.value);
1575
1812
  },
1576
1813
  className: "w-full py-0.5 text-xs",
1577
1814
  InputProps: {
1578
- startAdornment: /* @__PURE__ */ r(ve, { position: "start", children: /* @__PURE__ */ r(_, { children: /* @__PURE__ */ r(
1815
+ startAdornment: /* @__PURE__ */ r(we, { position: "start", children: /* @__PURE__ */ r(W, { children: /* @__PURE__ */ r(
1579
1816
  v,
1580
1817
  {
1581
1818
  iconName: "faMagnifyingGlass",
@@ -1585,8 +1822,8 @@ CONSTRAINT ${h}_pkey PRIMARY KEY (${n})`), o += ");", o;
1585
1822
  }
1586
1823
  }
1587
1824
  ),
1588
- !pe && /* @__PURE__ */ s(
1589
- u,
1825
+ !fe && /* @__PURE__ */ i(
1826
+ m,
1590
1827
  {
1591
1828
  variant: "body2",
1592
1829
  color: "info",
@@ -1600,26 +1837,26 @@ CONSTRAINT ${h}_pkey PRIMARY KEY (${n})`), o += ");", o;
1600
1837
  ]
1601
1838
  }
1602
1839
  ) }) }),
1603
- g === 0 && /* @__PURE__ */ r(Ye, { children: b.length ? b.map((e, a) => /* @__PURE__ */ r(
1604
- ee,
1840
+ x === 0 && /* @__PURE__ */ r(Xe, { children: N.length ? N.map((e, a) => /* @__PURE__ */ r(
1841
+ ae,
1605
1842
  {
1606
- className: `border-b ${a === b.length - 1 ? "border-none" : "border-[#ccc]"}`,
1843
+ className: `border-b ${a === N.length - 1 ? "border-none" : "border-[#ccc]"}`,
1607
1844
  sx: {
1608
1845
  backgroundColor: e.onlyMobileDb ? "#d3ecc7" : e.isTypeChanged ? "rgba(255, 0, 0, 0.1)" : "#fff",
1609
1846
  "&:hover": {
1610
1847
  backgroundColor: e.onlyMobileDb ? "#d2f7c0" : e.isTypeChanged ? "#e79a9a" : "#e9f3ff"
1611
1848
  }
1612
1849
  },
1613
- children: /* @__PURE__ */ s(re, { className: "p-2 px-4 flex justify-between", children: [
1850
+ children: /* @__PURE__ */ i(te, { className: "p-2 px-4 flex justify-between", children: [
1614
1851
  /* @__PURE__ */ r(
1615
- B,
1852
+ z,
1616
1853
  {
1617
1854
  title: e.onlyMobileDb ? "Column only present in mobile database" : e.isTypeChanged ? "Type changed" : "",
1618
1855
  placement: "top",
1619
1856
  arrow: !0,
1620
1857
  disableHoverListener: !(e.onlyMobileDb || e.isTypeChanged),
1621
- children: /* @__PURE__ */ s(
1622
- u,
1858
+ children: /* @__PURE__ */ i(
1859
+ m,
1623
1860
  {
1624
1861
  variant: "caption",
1625
1862
  className: "w-full text-ellipsis cursor-pointer",
@@ -1633,9 +1870,9 @@ CONSTRAINT ${h}_pkey PRIMARY KEY (${n})`), o += ");", o;
1633
1870
  )
1634
1871
  }
1635
1872
  ),
1636
- /* @__PURE__ */ s(f, { display: "flex", alignItems: "center", children: [
1873
+ /* @__PURE__ */ i(g, { display: "flex", alignItems: "center", children: [
1637
1874
  e.isPrimaryKey && /* @__PURE__ */ r(
1638
- _,
1875
+ W,
1639
1876
  {
1640
1877
  sx: {
1641
1878
  height: "1.5rem",
@@ -1651,51 +1888,51 @@ CONSTRAINT ${h}_pkey PRIMARY KEY (${n})`), o += ");", o;
1651
1888
  )
1652
1889
  }
1653
1890
  ),
1654
- (i || m) && /* @__PURE__ */ s(Q, { children: [
1655
- /* @__PURE__ */ s(
1656
- B,
1891
+ (d || h) && /* @__PURE__ */ i(Q, { children: [
1892
+ /* @__PURE__ */ i(
1893
+ z,
1657
1894
  {
1658
- title: !i && e.isPrimaryKey && !G ? "Deletion of primary key is not allowed." : "",
1895
+ title: !d && e.isPrimaryKey && !I ? "Deletion of primary key is not allowed." : "",
1659
1896
  arrow: !0,
1660
1897
  placement: "left",
1661
1898
  children: [
1662
1899
  " ",
1663
1900
  /* @__PURE__ */ r("span", { children: /* @__PURE__ */ r(
1664
- _,
1901
+ W,
1665
1902
  {
1666
1903
  sx: {
1667
1904
  height: "1.3rem",
1668
1905
  marginRight: "0"
1669
1906
  },
1670
- disabled: !i && e.isPrimaryKey && !G,
1907
+ disabled: !d && e.isPrimaryKey && !I,
1671
1908
  onClick: async () => {
1672
- const l = t.getValues(
1909
+ const o = n.getValues(
1673
1910
  "selectedColumns"
1674
1911
  );
1675
- I("");
1676
- const n = l.filter(
1912
+ Y("");
1913
+ const t = o.filter(
1677
1914
  (c) => c.name !== e.name
1678
1915
  );
1679
- t.setValue(
1916
+ n.setValue(
1680
1917
  "selectedColumns",
1681
- n,
1918
+ t,
1682
1919
  { shouldDirty: !0 }
1683
1920
  );
1684
- const o = te.trim().toLowerCase(), h = o ? n.filter(
1685
- (c) => c.name.toLowerCase().includes(o)
1686
- ) : n;
1687
- K(
1688
- h
1689
- ), R(
1921
+ const l = ie.trim().toLowerCase(), u = l ? t.filter(
1922
+ (c) => c.name.toLowerCase().includes(l)
1923
+ ) : t;
1924
+ L(
1925
+ u
1926
+ ), U(
1690
1927
  (c) => c.map((p) => p.name === e.name ? {
1691
1928
  ...p,
1692
1929
  isSynced: !1
1693
1930
  } : p)
1694
- ), e.isPrimaryKey && t.setValue(
1931
+ ), e.isPrimaryKey && n.setValue(
1695
1932
  "primaryKey",
1696
1933
  ""
1697
- ), i && await ye(
1698
- n
1934
+ ), d && await xe(
1935
+ t
1699
1936
  );
1700
1937
  },
1701
1938
  children: /* @__PURE__ */ r(
@@ -1710,8 +1947,8 @@ CONSTRAINT ${h}_pkey PRIMARY KEY (${n})`), o += ");", o;
1710
1947
  ]
1711
1948
  }
1712
1949
  ),
1713
- i && /* @__PURE__ */ r(
1714
- _,
1950
+ d && /* @__PURE__ */ r(
1951
+ W,
1715
1952
  {
1716
1953
  sx: {
1717
1954
  height: "1.3rem",
@@ -1719,18 +1956,18 @@ CONSTRAINT ${h}_pkey PRIMARY KEY (${n})`), o += ");", o;
1719
1956
  color: "success"
1720
1957
  },
1721
1958
  onClick: () => {
1722
- const n = t.getValues(
1959
+ const t = n.getValues(
1723
1960
  "selectedColumns"
1724
1961
  ).findIndex(
1725
- (o) => o.name === e.name
1962
+ (l) => l.name === e.name
1726
1963
  );
1727
- ie(n), t.setValue(
1964
+ ce(t), n.setValue(
1728
1965
  "newColumnName",
1729
1966
  e.name
1730
- ), t.setValue(
1967
+ ), n.setValue(
1731
1968
  "newColumnType",
1732
1969
  e.type
1733
- ), oe(
1970
+ ), de(
1734
1971
  document.getElementById(
1735
1972
  "edit-button-anchor"
1736
1973
  ) ?? null
@@ -1750,16 +1987,16 @@ CONSTRAINT ${h}_pkey PRIMARY KEY (${n})`), o += ");", o;
1750
1987
  ] })
1751
1988
  },
1752
1989
  a + 1
1753
- )) : /* @__PURE__ */ r(ee, { children: /* @__PURE__ */ r(re, { colSpan: 1, className: "p-2", children: /* @__PURE__ */ s(u, { variant: "body2", children: [
1990
+ )) : /* @__PURE__ */ r(ae, { children: /* @__PURE__ */ r(te, { colSpan: 1, className: "p-2", children: /* @__PURE__ */ i(m, { variant: "body2", children: [
1754
1991
  " ",
1755
- t.getValues("selectedColumns").length === 0 ? "There are no columns to display." : b.length === 0 ? "No columns for search query." : null
1992
+ n.getValues("selectedColumns").length === 0 ? "There are no columns to display." : N.length === 0 ? "No columns for search query." : null
1756
1993
  ] }) }) }) }),
1757
- g === 1 && /* @__PURE__ */ r(Ye, { children: Y.length ? Y.map((e, a) => {
1758
- const l = e.name === d.primaryKey, n = e.isSynced || !1, o = /* @__PURE__ */ r(
1759
- br,
1994
+ x === 1 && /* @__PURE__ */ r(Xe, { children: J.length ? J.map((e, a) => {
1995
+ const o = e.name === s.primaryKey, t = e.isSynced || !1, l = /* @__PURE__ */ r(
1996
+ Sr,
1760
1997
  {
1761
1998
  icon: /* @__PURE__ */ r(
1762
- f,
1999
+ g,
1763
2000
  {
1764
2001
  sx: {
1765
2002
  backgroundColor: "var(--color-tableHeader)",
@@ -1781,7 +2018,7 @@ CONSTRAINT ${h}_pkey PRIMARY KEY (${n})`), o += ");", o;
1781
2018
  }
1782
2019
  ),
1783
2020
  checkedIcon: /* @__PURE__ */ r(
1784
- f,
2021
+ g,
1785
2022
  {
1786
2023
  sx: {
1787
2024
  backgroundColor: "#4caf50",
@@ -1801,47 +2038,47 @@ CONSTRAINT ${h}_pkey PRIMARY KEY (${n})`), o += ");", o;
1801
2038
  )
1802
2039
  }
1803
2040
  ),
1804
- checked: n,
1805
- disabled: !m,
2041
+ checked: t,
2042
+ disabled: !h,
1806
2043
  onChange: (c) => {
1807
2044
  const p = c.target.checked;
1808
- if (!p && m && !G && !i && e.name === d.primaryKey)
2045
+ if (!p && h && !I && !d && e.name === s.primaryKey)
1809
2046
  return;
1810
- const j = [...Y], Z = {
1811
- ...j[a],
2047
+ const y = [...J], R = {
2048
+ ...y[a],
1812
2049
  isSynced: c.target.checked
1813
2050
  };
1814
- j[a] = Z, R(j);
1815
- const P = [...b];
2051
+ y[a] = R, U(y);
2052
+ const O = [...N];
1816
2053
  if (p) {
1817
- const A = b.some(
1818
- (z) => z.isPrimaryKey
2054
+ const $ = N.some(
2055
+ (B) => B.isPrimaryKey
1819
2056
  );
1820
- e.name === d.primaryKey && !A ? (P.push({
1821
- ...Z,
2057
+ e.name === s.primaryKey && !$ ? (O.push({
2058
+ ...R,
1822
2059
  isPrimaryKey: !0
1823
- }), t.setValue("primaryKey", e.name)) : P.push(Z);
2060
+ }), n.setValue("primaryKey", e.name)) : O.push(R);
1824
2061
  } else {
1825
- const A = P.findIndex(
1826
- (z) => z.name === j[a].name
2062
+ const $ = O.findIndex(
2063
+ (B) => B.name === y[a].name
1827
2064
  );
1828
- if (A > -1) {
1829
- const z = P[A].isPrimaryKey;
1830
- P.splice(A, 1), z && t.setValue("primaryKey", "");
2065
+ if ($ > -1) {
2066
+ const B = O[$].isPrimaryKey;
2067
+ O.splice($, 1), B && n.setValue("primaryKey", "");
1831
2068
  }
1832
2069
  }
1833
- K(P), t.setValue("selectedColumns", P, {
2070
+ L(O), n.setValue("selectedColumns", O, {
1834
2071
  shouldDirty: !0
1835
2072
  });
1836
2073
  }
1837
2074
  }
1838
- ), h = /* @__PURE__ */ r(
1839
- _,
2075
+ ), u = /* @__PURE__ */ r(
2076
+ W,
1840
2077
  {
1841
2078
  sx: {
1842
2079
  height: "2rem",
1843
- marginRight: m ? 1 : 0,
1844
- paddingRight: m ? 1 : 0
2080
+ marginRight: h ? 1 : 0,
2081
+ paddingRight: h ? 1 : 0
1845
2082
  },
1846
2083
  children: /* @__PURE__ */ r(
1847
2084
  v,
@@ -1853,14 +2090,14 @@ CONSTRAINT ${h}_pkey PRIMARY KEY (${n})`), o += ");", o;
1853
2090
  }
1854
2091
  );
1855
2092
  return /* @__PURE__ */ r(
1856
- ee,
2093
+ ae,
1857
2094
  {
1858
- className: `border-b ${a === Y.length - 1 ? "border-none" : "border-[#ccc]"}`,
2095
+ className: `border-b ${a === J.length - 1 ? "border-none" : "border-[#ccc]"}`,
1859
2096
  sx: {
1860
2097
  "&:hover": { backgroundColor: "#e9f3ff" }
1861
2098
  },
1862
- children: /* @__PURE__ */ s(
1863
- re,
2099
+ children: /* @__PURE__ */ i(
2100
+ te,
1864
2101
  {
1865
2102
  sx: {
1866
2103
  p: 0,
@@ -1870,8 +2107,8 @@ CONSTRAINT ${h}_pkey PRIMARY KEY (${n})`), o += ");", o;
1870
2107
  alignItems: "center"
1871
2108
  },
1872
2109
  children: [
1873
- /* @__PURE__ */ s(
1874
- u,
2110
+ /* @__PURE__ */ i(
2111
+ m,
1875
2112
  {
1876
2113
  variant: "caption",
1877
2114
  className: "w-full text-ellipsis cursor-pointer align-content-center",
@@ -1883,28 +2120,28 @@ CONSTRAINT ${h}_pkey PRIMARY KEY (${n})`), o += ");", o;
1883
2120
  ]
1884
2121
  }
1885
2122
  ),
1886
- m ? l ? i ? h : /* @__PURE__ */ s(
1887
- f,
2123
+ h ? o ? d ? u : /* @__PURE__ */ i(
2124
+ g,
1888
2125
  {
1889
2126
  sx: {
1890
2127
  display: "flex",
1891
2128
  alignItems: "center"
1892
2129
  },
1893
2130
  children: [
1894
- h,
2131
+ u,
1895
2132
  /* @__PURE__ */ r(
1896
- B,
2133
+ z,
1897
2134
  {
1898
- title: m && !G && e.name === d.primaryKey ? "Primary key cannot be unsynced in edit mode." : "",
2135
+ title: h && !I && e.name === s.primaryKey ? "Primary key cannot be unsynced in edit mode." : "",
1899
2136
  arrow: !0,
1900
2137
  placement: "top",
1901
- children: /* @__PURE__ */ r("span", { children: o })
2138
+ children: /* @__PURE__ */ r("span", { children: l })
1902
2139
  }
1903
2140
  )
1904
2141
  ]
1905
2142
  }
1906
- ) : o : n ? /* @__PURE__ */ r(
1907
- f,
2143
+ ) : l : t ? /* @__PURE__ */ r(
2144
+ g,
1908
2145
  {
1909
2146
  sx: {
1910
2147
  backgroundColor: "#4caf50",
@@ -1924,8 +2161,8 @@ CONSTRAINT ${h}_pkey PRIMARY KEY (${n})`), o += ");", o;
1924
2161
  }
1925
2162
  )
1926
2163
  }
1927
- ) : l ? h : /* @__PURE__ */ r(
1928
- f,
2164
+ ) : o ? u : /* @__PURE__ */ r(
2165
+ g,
1929
2166
  {
1930
2167
  sx: {
1931
2168
  backgroundColor: "var(--color-tableHeader)",
@@ -1952,7 +2189,7 @@ CONSTRAINT ${h}_pkey PRIMARY KEY (${n})`), o += ");", o;
1952
2189
  },
1953
2190
  a + 1
1954
2191
  );
1955
- }) : /* @__PURE__ */ r(ee, { children: /* @__PURE__ */ r(re, { colSpan: 1, className: "p-2", children: /* @__PURE__ */ r(u, { variant: "body2", children: "No columns for search query." }) }) }) })
2192
+ }) : /* @__PURE__ */ r(ae, { children: /* @__PURE__ */ r(te, { colSpan: 1, className: "p-2", children: /* @__PURE__ */ r(m, { variant: "body2", children: "No columns for search query." }) }) }) })
1956
2193
  ] })
1957
2194
  }
1958
2195
  )
@@ -1965,9 +2202,9 @@ CONSTRAINT ${h}_pkey PRIMARY KEY (${n})`), o += ");", o;
1965
2202
  )
1966
2203
  }
1967
2204
  ),
1968
- De && /* @__PURE__ */ r(Cr, { open: De, onClose: ir, children: /* @__PURE__ */ s(f, { sx: { ...Pr }, children: [
1969
- /* @__PURE__ */ s(
1970
- f,
2205
+ Ke && /* @__PURE__ */ r(Nr, { open: Ke, onClose: cr, children: /* @__PURE__ */ i(g, { sx: { ...Ar }, children: [
2206
+ /* @__PURE__ */ i(
2207
+ g,
1971
2208
  {
1972
2209
  sx: {
1973
2210
  display: "flex",
@@ -1976,12 +2213,12 @@ CONSTRAINT ${h}_pkey PRIMARY KEY (${n})`), o += ");", o;
1976
2213
  mb: 2
1977
2214
  },
1978
2215
  children: [
1979
- /* @__PURE__ */ r(u, { variant: "h6", children: "Generated Migration Script" }),
1980
- /* @__PURE__ */ s(u, { variant: "body2", children: [
2216
+ /* @__PURE__ */ r(m, { variant: "h6", children: "Generated Migration Script" }),
2217
+ /* @__PURE__ */ i(m, { variant: "body2", children: [
1981
2218
  "From : ",
1982
- /* @__PURE__ */ s("strong", { children: [
2219
+ /* @__PURE__ */ i("strong", { children: [
1983
2220
  "v",
1984
- (E == null ? void 0 : E.from_version) + 1
2221
+ (j == null ? void 0 : j.from_version) + 1
1985
2222
  ] }),
1986
2223
  " ",
1987
2224
  /* @__PURE__ */ r(
@@ -1994,16 +2231,16 @@ CONSTRAINT ${h}_pkey PRIMARY KEY (${n})`), o += ");", o;
1994
2231
  ),
1995
2232
  " ",
1996
2233
  "To : ",
1997
- /* @__PURE__ */ s("strong", { children: [
2234
+ /* @__PURE__ */ i("strong", { children: [
1998
2235
  "v",
1999
- (E == null ? void 0 : E.to_version) + 1
2236
+ (j == null ? void 0 : j.to_version) + 1
2000
2237
  ] })
2001
2238
  ] })
2002
2239
  ]
2003
2240
  }
2004
2241
  ),
2005
2242
  /* @__PURE__ */ r(
2006
- de,
2243
+ he,
2007
2244
  {
2008
2245
  height: "50vh",
2009
2246
  defaultLanguage: "sql",
@@ -2017,14 +2254,14 @@ CONSTRAINT ${h}_pkey PRIMARY KEY (${n})`), o += ");", o;
2017
2254
  occurrencesHighlight: !1,
2018
2255
  selectionHighlight: !1
2019
2256
  },
2020
- value: $ || "",
2021
- defaultValue: $ || "",
2022
- onChange: sr,
2257
+ value: F || "",
2258
+ defaultValue: F || "",
2259
+ onChange: ur,
2023
2260
  editorProps: { $blockScrolling: !0 }
2024
2261
  }
2025
2262
  ),
2026
2263
  /* @__PURE__ */ r(
2027
- O,
2264
+ T,
2028
2265
  {
2029
2266
  variant: "contained",
2030
2267
  color: "primary",
@@ -2038,7 +2275,7 @@ CONSTRAINT ${h}_pkey PRIMARY KEY (${n})`), o += ");", o;
2038
2275
  }
2039
2276
  );
2040
2277
  }
2041
- const Pr = {
2278
+ const Ar = {
2042
2279
  position: "absolute",
2043
2280
  top: "50%",
2044
2281
  left: "50%",
@@ -2050,20 +2287,21 @@ const Pr = {
2050
2287
  padding: "15px",
2051
2288
  borderRadius: "8px"
2052
2289
  };
2053
- kr.propTypes = {
2054
- tableInfo: S.any,
2055
- table: S.any,
2056
- isEditMode: S.bool,
2057
- updateEditMode: S.any,
2058
- tableCompleteInfo: S.any,
2059
- reloadComponents: S.any,
2060
- isCreateTableMode: S.bool,
2061
- isSyncTableMode: S.bool,
2062
- updateCreateTableMode: S.any,
2063
- openDeleteModal: S.bool,
2064
- setOpenDeleteModal: S.func
2290
+ Dr.propTypes = {
2291
+ tableInfo: P.any,
2292
+ table: P.any,
2293
+ isEditMode: P.bool,
2294
+ updateEditMode: P.any,
2295
+ tableCompleteInfo: P.any,
2296
+ reloadComponents: P.any,
2297
+ isCreateTableMode: P.bool,
2298
+ isSyncTableMode: P.bool,
2299
+ updateCreateTableMode: P.any,
2300
+ openDeleteModal: P.bool,
2301
+ setOpenDeleteModal: P.func,
2302
+ generateRebuildScript: P.func
2065
2303
  };
2066
2304
  export {
2067
- kr as default
2305
+ Dr as default
2068
2306
  };
2069
- //# sourceMappingURL=TableDetails-Cf_YfnY2.js.map
2307
+ //# sourceMappingURL=TableDetails-BtafRxXb.js.map