@erpsquad/common 1.8.109 → 1.8.111

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 (264) hide show
  1. package/dist/_virtual/index/index.esm10.js +3 -3
  2. package/dist/_virtual/index/index.esm2.js +3 -3
  3. package/dist/_virtual/index/index.esm3.js +3 -3
  4. package/dist/_virtual/index/index.esm4.js +3 -3
  5. package/dist/_virtual/index/index.esm5.js +3 -3
  6. package/dist/_virtual/index/index.esm6.js +3 -3
  7. package/dist/_virtual/index/index.esm7.js +3 -3
  8. package/dist/_virtual/index/index.esm8.js +3 -3
  9. package/dist/_virtual/index/index.esm9.js +3 -3
  10. package/dist/_virtual/index/index10.js +1 -1
  11. package/dist/_virtual/index/index2.js +1 -1
  12. package/dist/_virtual/index/index3.js +1 -1
  13. package/dist/_virtual/index/index4.js +1 -1
  14. package/dist/_virtual/index/index5.js +1 -1
  15. package/dist/_virtual/index/index6.js +1 -1
  16. package/dist/_virtual/index/index7.js +1 -1
  17. package/dist/_virtual/index/index8.js +1 -1
  18. package/dist/_virtual/index/index9.js +1 -1
  19. package/dist/components/accordion/accordion.d.ts +1 -1
  20. package/dist/components/action-bar/action-bar.d.ts +1 -1
  21. package/dist/components/checkbox/checkbox.d.ts +1 -1
  22. package/dist/components/date-picker/date-picker.d.ts +1 -1
  23. package/dist/components/footer/footer.d.ts +1 -1
  24. package/dist/components/form-control/form-builder/form-builder-element/media.d.ts +1 -1
  25. package/dist/components/form-control/form-builder/form-builder-element/phone.d.ts +1 -1
  26. package/dist/components/form-control/form-builder/form-builder-element/select.d.ts +1 -1
  27. package/dist/components/form-control/form-builder/form-builder-element/text.d.ts +1 -1
  28. package/dist/components/form-control/form-builder/form-builder-element/time.d.ts +1 -1
  29. package/dist/components/form-control/form-parser/form-section/index.esm.js +5 -4
  30. package/dist/components/form-control/form-parser/form-section/index.esm.js.map +1 -1
  31. package/dist/components/form-control/form-parser/form-section/index.js +22 -22
  32. package/dist/components/form-control/form-parser/form-section/index.js.map +1 -1
  33. package/dist/components/form-control/form-parser/form-switcher.d.ts +1 -1
  34. package/dist/components/icons/action-arrow.d.ts +3 -3
  35. package/dist/components/icons/add-circle.d.ts +3 -3
  36. package/dist/components/icons/arrow-bidirectional.d.ts +3 -3
  37. package/dist/components/icons/arrow-circle-down.d.ts +3 -3
  38. package/dist/components/icons/arrow-down-three.d.ts +3 -3
  39. package/dist/components/icons/arrow-down-two.d.ts +3 -3
  40. package/dist/components/icons/arrow-down.d.ts +3 -3
  41. package/dist/components/icons/arrow-up-down.d.ts +3 -3
  42. package/dist/components/icons/arrow-up-two.d.ts +3 -3
  43. package/dist/components/icons/assignments.d.ts +3 -3
  44. package/dist/components/icons/blank-circle.d.ts +3 -3
  45. package/dist/components/icons/block-filled.d.ts +3 -3
  46. package/dist/components/icons/calendar-add.d.ts +3 -3
  47. package/dist/components/icons/calendar.d.ts +3 -3
  48. package/dist/components/icons/checkbox-square.d.ts +3 -3
  49. package/dist/components/icons/circular-arrow-setting.d.ts +3 -3
  50. package/dist/components/icons/clock.d.ts +3 -3
  51. package/dist/components/icons/close.d.ts +3 -3
  52. package/dist/components/icons/coin-outline.d.ts +3 -3
  53. package/dist/components/icons/copy.d.ts +3 -3
  54. package/dist/components/icons/coupon.d.ts +3 -3
  55. package/dist/components/icons/cross-hire.d.ts +3 -3
  56. package/dist/components/icons/custom-styled-icon.d.ts +3 -3
  57. package/dist/components/icons/dashboard.d.ts +3 -3
  58. package/dist/components/icons/document-download.d.ts +3 -3
  59. package/dist/components/icons/document.d.ts +3 -3
  60. package/dist/components/icons/dollar-circle-filled.d.ts +3 -3
  61. package/dist/components/icons/dollar-circle.d.ts +3 -3
  62. package/dist/components/icons/edit.d.ts +3 -3
  63. package/dist/components/icons/email.d.ts +3 -3
  64. package/dist/components/icons/export.d.ts +3 -3
  65. package/dist/components/icons/eye-off.d.ts +3 -3
  66. package/dist/components/icons/eye-plus-circle.d.ts +3 -3
  67. package/dist/components/icons/eye.d.ts +3 -3
  68. package/dist/components/icons/filled-circle.d.ts +3 -3
  69. package/dist/components/icons/filter-remove.d.ts +3 -3
  70. package/dist/components/icons/filter.d.ts +3 -3
  71. package/dist/components/icons/folder-save.d.ts +3 -3
  72. package/dist/components/icons/grid.d.ts +3 -3
  73. package/dist/components/icons/hashtag.d.ts +3 -3
  74. package/dist/components/icons/image.d.ts +3 -3
  75. package/dist/components/icons/import.d.ts +3 -3
  76. package/dist/components/icons/info-circle.d.ts +3 -3
  77. package/dist/components/icons/info.d.ts +3 -3
  78. package/dist/components/icons/link-horizontal.d.ts +3 -3
  79. package/dist/components/icons/link.d.ts +3 -3
  80. package/dist/components/icons/location.d.ts +3 -3
  81. package/dist/components/icons/lowest-lead-time.d.ts +3 -3
  82. package/dist/components/icons/lowest-min-qty.d.ts +3 -3
  83. package/dist/components/icons/lowest-price.d.ts +3 -3
  84. package/dist/components/icons/more.d.ts +3 -3
  85. package/dist/components/icons/notification.d.ts +3 -3
  86. package/dist/components/icons/paper-clip.d.ts +3 -3
  87. package/dist/components/icons/paragraph.d.ts +3 -3
  88. package/dist/components/icons/payment-request.d.ts +3 -3
  89. package/dist/components/icons/phone.d.ts +3 -3
  90. package/dist/components/icons/printer.d.ts +3 -3
  91. package/dist/components/icons/process-calendar.d.ts +3 -3
  92. package/dist/components/icons/promotion.d.ts +3 -3
  93. package/dist/components/icons/radio-button.d.ts +3 -3
  94. package/dist/components/icons/receipt-filled.d.ts +3 -3
  95. package/dist/components/icons/receipt-outline.d.ts +3 -3
  96. package/dist/components/icons/receipt.d.ts +3 -3
  97. package/dist/components/icons/refresh-icon.d.ts +3 -3
  98. package/dist/components/icons/replace.d.ts +3 -3
  99. package/dist/components/icons/save.d.ts +3 -3
  100. package/dist/components/icons/search-status.d.ts +3 -3
  101. package/dist/components/icons/search.d.ts +3 -3
  102. package/dist/components/icons/settings-fallback.d.ts +3 -3
  103. package/dist/components/icons/sort-arrow-icon.d.ts +3 -3
  104. package/dist/components/icons/stacked-layer.d.ts +3 -3
  105. package/dist/components/icons/start-filled.d.ts +3 -3
  106. package/dist/components/icons/three-dot-icon.d.ts +3 -3
  107. package/dist/components/icons/tick-circle-filled.d.ts +3 -3
  108. package/dist/components/icons/tick-circle.d.ts +3 -3
  109. package/dist/components/icons/tick-octagon.d.ts +3 -3
  110. package/dist/components/icons/tick.d.ts +3 -3
  111. package/dist/components/icons/toggle-switch.d.ts +3 -3
  112. package/dist/components/icons/trash.d.ts +3 -3
  113. package/dist/components/icons/wave.d.ts +3 -3
  114. package/dist/components/icons/with-out-tick-octagon.d.ts +3 -3
  115. package/dist/components/icons/work-centre.d.ts +3 -3
  116. package/dist/components/location-select.d.ts +1 -1
  117. package/dist/components/material-editable-table/material-editable-table/index.esm.js +27 -51
  118. package/dist/components/material-editable-table/material-editable-table/index.esm.js.map +1 -1
  119. package/dist/components/material-editable-table/material-editable-table/index.js +17 -17
  120. package/dist/components/material-editable-table/material-editable-table/index.js.map +1 -1
  121. package/dist/components/material-editable-table/material-editable-table.d.ts +1 -2
  122. package/dist/components/material-table/material-table.d.ts +1 -1
  123. package/dist/components/phone-input/phone-input.d.ts +1 -1
  124. package/dist/components/providers/ERPUIProvider/index.esm.js +4 -2
  125. package/dist/components/providers/ERPUIProvider/index.esm.js.map +1 -1
  126. package/dist/components/providers/ERPUIProvider/index.js +1 -1
  127. package/dist/components/providers/ERPUIProvider/index.js.map +1 -1
  128. package/dist/components/providers/ERPUIProvider.d.ts +2 -0
  129. package/dist/components/radio/radio.d.ts +1 -1
  130. package/dist/components/select/select.d.ts +1 -1
  131. package/dist/components/switches/android-12-switch.d.ts +3 -1
  132. package/dist/components/text-field/text-field.d.ts +1 -1
  133. package/dist/components/time-picker/time-picker.d.ts +1 -1
  134. package/dist/components/upload-media/upload-media.d.ts +1 -1
  135. package/dist/contexts/page-context/index.esm.js +5 -5
  136. package/dist/contexts/page-context/index.esm.js.map +1 -1
  137. package/dist/contexts/page-context/index.js +1 -1
  138. package/dist/contexts/page-context/index.js.map +1 -1
  139. package/dist/contexts/page-context.d.ts +2 -0
  140. package/dist/hooks/apiHelper/index.esm.js.map +1 -1
  141. package/dist/hooks/apiHelper/index.js.map +1 -1
  142. package/dist/node_modules/@mui/icons-material/utils/createSvgIcon/index.esm.js +1 -1
  143. package/dist/node_modules/@mui/icons-material/utils/createSvgIcon/index.js +1 -1
  144. package/dist/node_modules/@mui/icons-material/utils/createSvgIcon/index.js.map +1 -1
  145. package/dist/node_modules/@mui/system/colorManipulator/index.esm.js +2 -2
  146. package/dist/node_modules/@mui/system/colorManipulator/index.js +1 -1
  147. package/dist/node_modules/@mui/system/colorManipulator/index.js.map +1 -1
  148. package/dist/node_modules/@mui/system/createStyled/index.esm.js +6 -6
  149. package/dist/node_modules/@mui/system/createStyled/index.js +1 -1
  150. package/dist/node_modules/@mui/system/useThemeWithoutDefault/index.esm.js +1 -1
  151. package/dist/node_modules/@mui/system/useThemeWithoutDefault/index.js +1 -1
  152. package/dist/redux/actionCreator/index.esm.js +1 -0
  153. package/dist/redux/actionCreator/index.esm.js.map +1 -1
  154. package/dist/redux/actionCreator/index.js +1 -1
  155. package/dist/redux/actionCreator/index.js.map +1 -1
  156. package/dist/src/components/accordion/accordion.d.ts +1 -1
  157. package/dist/src/components/action-bar/action-bar.d.ts +1 -1
  158. package/dist/src/components/checkbox/checkbox.d.ts +1 -1
  159. package/dist/src/components/date-picker/date-picker.d.ts +1 -1
  160. package/dist/src/components/footer/footer.d.ts +1 -1
  161. package/dist/src/components/form-control/form-builder/form-builder-element/media.d.ts +1 -1
  162. package/dist/src/components/form-control/form-builder/form-builder-element/phone.d.ts +1 -1
  163. package/dist/src/components/form-control/form-builder/form-builder-element/select.d.ts +1 -1
  164. package/dist/src/components/form-control/form-builder/form-builder-element/text.d.ts +1 -1
  165. package/dist/src/components/form-control/form-builder/form-builder-element/time.d.ts +1 -1
  166. package/dist/src/components/form-control/form-parser/form-switcher.d.ts +1 -1
  167. package/dist/src/components/icons/action-arrow.d.ts +3 -3
  168. package/dist/src/components/icons/add-circle.d.ts +3 -3
  169. package/dist/src/components/icons/arrow-bidirectional.d.ts +3 -3
  170. package/dist/src/components/icons/arrow-circle-down.d.ts +3 -3
  171. package/dist/src/components/icons/arrow-down-three.d.ts +3 -3
  172. package/dist/src/components/icons/arrow-down-two.d.ts +3 -3
  173. package/dist/src/components/icons/arrow-down.d.ts +3 -3
  174. package/dist/src/components/icons/arrow-up-down.d.ts +3 -3
  175. package/dist/src/components/icons/arrow-up-two.d.ts +3 -3
  176. package/dist/src/components/icons/assignments.d.ts +3 -3
  177. package/dist/src/components/icons/blank-circle.d.ts +3 -3
  178. package/dist/src/components/icons/block-filled.d.ts +3 -3
  179. package/dist/src/components/icons/calendar-add.d.ts +3 -3
  180. package/dist/src/components/icons/calendar.d.ts +3 -3
  181. package/dist/src/components/icons/checkbox-square.d.ts +3 -3
  182. package/dist/src/components/icons/circular-arrow-setting.d.ts +3 -3
  183. package/dist/src/components/icons/clock.d.ts +3 -3
  184. package/dist/src/components/icons/close.d.ts +3 -3
  185. package/dist/src/components/icons/coin-outline.d.ts +3 -3
  186. package/dist/src/components/icons/copy.d.ts +3 -3
  187. package/dist/src/components/icons/coupon.d.ts +3 -3
  188. package/dist/src/components/icons/cross-hire.d.ts +3 -3
  189. package/dist/src/components/icons/custom-styled-icon.d.ts +3 -3
  190. package/dist/src/components/icons/dashboard.d.ts +3 -3
  191. package/dist/src/components/icons/document-download.d.ts +3 -3
  192. package/dist/src/components/icons/document.d.ts +3 -3
  193. package/dist/src/components/icons/dollar-circle-filled.d.ts +3 -3
  194. package/dist/src/components/icons/dollar-circle.d.ts +3 -3
  195. package/dist/src/components/icons/edit.d.ts +3 -3
  196. package/dist/src/components/icons/email.d.ts +3 -3
  197. package/dist/src/components/icons/export.d.ts +3 -3
  198. package/dist/src/components/icons/eye-off.d.ts +3 -3
  199. package/dist/src/components/icons/eye-plus-circle.d.ts +3 -3
  200. package/dist/src/components/icons/eye.d.ts +3 -3
  201. package/dist/src/components/icons/filled-circle.d.ts +3 -3
  202. package/dist/src/components/icons/filter-remove.d.ts +3 -3
  203. package/dist/src/components/icons/filter.d.ts +3 -3
  204. package/dist/src/components/icons/folder-save.d.ts +3 -3
  205. package/dist/src/components/icons/grid.d.ts +3 -3
  206. package/dist/src/components/icons/hashtag.d.ts +3 -3
  207. package/dist/src/components/icons/image.d.ts +3 -3
  208. package/dist/src/components/icons/import.d.ts +3 -3
  209. package/dist/src/components/icons/info-circle.d.ts +3 -3
  210. package/dist/src/components/icons/info.d.ts +3 -3
  211. package/dist/src/components/icons/link-horizontal.d.ts +3 -3
  212. package/dist/src/components/icons/link.d.ts +3 -3
  213. package/dist/src/components/icons/location.d.ts +3 -3
  214. package/dist/src/components/icons/lowest-lead-time.d.ts +3 -3
  215. package/dist/src/components/icons/lowest-min-qty.d.ts +3 -3
  216. package/dist/src/components/icons/lowest-price.d.ts +3 -3
  217. package/dist/src/components/icons/more.d.ts +3 -3
  218. package/dist/src/components/icons/notification.d.ts +3 -3
  219. package/dist/src/components/icons/paper-clip.d.ts +3 -3
  220. package/dist/src/components/icons/paragraph.d.ts +3 -3
  221. package/dist/src/components/icons/payment-request.d.ts +3 -3
  222. package/dist/src/components/icons/phone.d.ts +3 -3
  223. package/dist/src/components/icons/printer.d.ts +3 -3
  224. package/dist/src/components/icons/process-calendar.d.ts +3 -3
  225. package/dist/src/components/icons/promotion.d.ts +3 -3
  226. package/dist/src/components/icons/radio-button.d.ts +3 -3
  227. package/dist/src/components/icons/receipt-filled.d.ts +3 -3
  228. package/dist/src/components/icons/receipt-outline.d.ts +3 -3
  229. package/dist/src/components/icons/receipt.d.ts +3 -3
  230. package/dist/src/components/icons/refresh-icon.d.ts +3 -3
  231. package/dist/src/components/icons/replace.d.ts +3 -3
  232. package/dist/src/components/icons/save.d.ts +3 -3
  233. package/dist/src/components/icons/search-status.d.ts +3 -3
  234. package/dist/src/components/icons/search.d.ts +3 -3
  235. package/dist/src/components/icons/settings-fallback.d.ts +3 -3
  236. package/dist/src/components/icons/sort-arrow-icon.d.ts +3 -3
  237. package/dist/src/components/icons/stacked-layer.d.ts +3 -3
  238. package/dist/src/components/icons/start-filled.d.ts +3 -3
  239. package/dist/src/components/icons/three-dot-icon.d.ts +3 -3
  240. package/dist/src/components/icons/tick-circle-filled.d.ts +3 -3
  241. package/dist/src/components/icons/tick-circle.d.ts +3 -3
  242. package/dist/src/components/icons/tick-octagon.d.ts +3 -3
  243. package/dist/src/components/icons/tick.d.ts +3 -3
  244. package/dist/src/components/icons/toggle-switch.d.ts +3 -3
  245. package/dist/src/components/icons/trash.d.ts +3 -3
  246. package/dist/src/components/icons/wave.d.ts +3 -3
  247. package/dist/src/components/icons/with-out-tick-octagon.d.ts +3 -3
  248. package/dist/src/components/icons/work-centre.d.ts +3 -3
  249. package/dist/src/components/location-select.d.ts +1 -1
  250. package/dist/src/components/material-editable-table/material-editable-table.d.ts +1 -2
  251. package/dist/src/components/material-table/material-table.d.ts +1 -1
  252. package/dist/src/components/phone-input/phone-input.d.ts +1 -1
  253. package/dist/src/components/providers/ERPUIProvider.d.ts +2 -0
  254. package/dist/src/components/radio/radio.d.ts +1 -1
  255. package/dist/src/components/select/select.d.ts +1 -1
  256. package/dist/src/components/switches/android-12-switch.d.ts +3 -1
  257. package/dist/src/components/text-field/text-field.d.ts +1 -1
  258. package/dist/src/components/time-picker/time-picker.d.ts +1 -1
  259. package/dist/src/components/upload-media/upload-media.d.ts +1 -1
  260. package/dist/src/contexts/page-context.d.ts +2 -0
  261. package/dist/src/utils/common-utility.d.ts +1 -1
  262. package/dist/style.css +66 -66
  263. package/dist/utils/common-utility.d.ts +1 -1
  264. package/package.json +1 -1
@@ -1,28 +1,28 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),n=require("react"),t=,/* empty css */o=,/* empty css */a=,/* empty css */i=,/* empty css */l=,/* empty css */r=,/* empty css */s=;/* empty css */;/* empty css */var d=,/* empty css */u=,/* empty css */c=,/* empty css */m=,/* empty css */p=require("dayjs"),g=require("yup"),h=,/* empty css */x=require("react-i18next"),b=,/* empty css */v=,/* empty css */f=require("react-router-dom"),w=,/* empty css */y=,/* empty css */C=,/* empty css */j=,/* empty css */S=,/* empty css */M=,/* empty css */R=,/* empty css */k=,/* empty css */I=,/* empty css */T=,/* empty css */E=,/* empty css */P=,/* empty css */q=,/* empty css */D=,/* empty css */_=,/* empty css */z=,/* empty css */A=,/* empty css */B=,/* empty css */O=,/* empty css */N=,/* empty css */F=;/* empty css */function U(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function L(e){if(e&&"object"==typeof e&&"default"in e)return e;var n=/* @__PURE__ */Object.create(null);return e&&Object.keys(e).forEach(function(t){if("default"!==t){var o=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,o.get?o:{enumerable:!0,get:function(){return e[t]}})}}),n.default=e,n}var H=/* @__PURE__ */U(n),K=/* @__PURE__ */U(p),V=/* @__PURE__ */L(g);const $=P.default(T.default)(({theme:{palette:e}})=>{var n,t,o,a;return{".MuiTableCell-root":{border:"1px solid #efefef",borderBottom:0,borderLeft:0,padding:"0.19rem 0.5rem",lineHeight:"19px",fontSize:"14px",minHeight:40},".MuiTableCell-head":{backgroundColor:null==(n=e.theme)?void 0:n.secondary[100]},".MuiTableContainer-root":{maxHeight:"clamp(350px, 100vh - 200px, 9999px) !important"},".MuiPaper-root":{boxShadow:"none"},".MuiPaginationItem-root":{"&.Mui-selected":{backgroundColor:null==(t=null==e?void 0:e.theme)?void 0:t.primary[700],color:"white"}},".MuiTableRow-root":{"&.Mui-selected":{backgroundColor:`${null==(o=null==e?void 0:e.theme)?void 0:o.primary[100]} !important`,color:"white"}},".MuiCheckbox-indeterminate":{color:`${null==(a=null==e?void 0:e.theme)?void 0:a.primary[700]} !important`,"& svg":{height:"20px !important",width:"20px !important"}}}}),W=H.default.memo(({enablePagination:p=!1,rows:g,columns:P,totalPages:U,paginationModel:L,columnOrder:H,updateData:W,handleColumnOrdering:J,enableEditing:Y,enableColumnDragging:Z,states:G,rowActionMenu:Q,destructiveActionMenu:X,disableDefaultActionColumn:ee,enableRowSelection:ne,defaultActionColumnItems:te=[],enableBottomToolbar:oe,SetSelectedRowId:ae,isResetRow:ie,onCreateRow:le,onEditRow:re,onDeleteRow:se,editDisplayMode:de,enableRowCreate:ue,onChangeRowField:ce,onSelectRow:me,enableColumnResizing:pe=!0,selectedRowIds:ge=[],onColumnVisibility:he,onSortingChange:xe,getSelectedData:be,disabledDefaultActionColumnIcon:ve=!1,enableAddCustomField:fe=!0,enableRowDragging:we=!1,handleColumnResizing:ye=()=>{},columnSizes:Ce={},hideSaveButton:je=!1,...Se})=>{const{t:Me}=x.useTranslation(),{formData:Re=null,updatePageInfo:ke,activePage:Ie}=v.usePages(),Te=I.default(Ie),{pageNo:Ee}=L,[Pe,qe]=n.useState({}),[De,_e]=n.useState(P),[ze,Ae]=n.useState(null),[Be,Oe]=n.useState(!1),[Ne,Fe]=n.useState(null),Ue=De.filter(e=>e.visible),Le=De.filter(e=>!e.visible),[He,Ke]=n.useState(Le),[Ve,$e]=n.useState(null),[We,Je]=n.useState({}),[Ye,Ze]=n.useState([]),[Ge,Qe]=n.useState(!1),[Xe,en]=n.useState(!1),[nn,tn]=n.useState(!1),[on,an]=n.useState(null),[ln,rn]=n.useState({}),[sn,dn]=n.useState(!1),[un,cn]=n.useState([]),[mn,pn]=n.useState(!1),[gn,hn]=n.useState(Te.column_sizes),[xn,bn]=n.useState({columnSizingStart:[],deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,startOffset:null,startSize:null});n.useState(0);const vn=f.useNavigate(),fn=location.pathname.split("/")[2];let wn="";switch(fn){case"accounting":wn=y.PathnameAccounting.CUSTOM_FORM;break;case"inventory":wn=C.PathnameInventory.CUSTOM_FORM;break;case"manufacturing":wn=j.PathnameManufacturing.CUSTOM_FORM;break;case"procurement":wn=S.PathnamePurchase.CUSTOM_FORM;break;case"crm":wn=M.PathnameCrm.CUSTOM_FORM;break;case"user":wn=R.PathnameUsers.CUSTOM_FORM;break;case"rental":wn=k.PathnameRental.CUSTOM_FORM;break;case"drive":wn=w.PathnameDocument.ADD_CUSTOM_FIELDS}const yn=`/dashboard/${fn}${wn}`,Cn=(e,n,t)=>{var o;let a=e;switch(n.type){case"required":a=n.value?e.required(n.msg_en).typeError(n.msg_en):(null==(o=null==t?void 0:t.editProperties)?void 0:o.is_multiple)?e.min(1,n.msg_en):e;break;case"min":a=e.min(n.value,n.msg_en);break;case"email":a=e.email(n.value,n.msg_en);break;case"max":a=e.max(n.value,n.msg_en);break;case"positive":a=!0===n.value?e.test("is-positive-number","Value must be a positive number",e=>!e||e>=0):e;break;case"when":return e.when(n.relation,{is:e=>e===n.values,then:()=>{var o;return(null==(o=null==n?void 0:n.thenValidations)?void 0:o.reduce((e,n)=>Cn(e,n,t),e))||e},otherwise:()=>{var o;return(null==(o=null==n?void 0:n.otherWiseValidations)?void 0:o.reduce((e,n)=>Cn(e,n,t),e))||e}});default:a=e}return"required"!=n.type||!n.value||(null==t?void 0:t.editVariant)&&"text"!=(null==t?void 0:t.editVariant)||(a=e.test("no-blank-spaces","Blank space is not allowed",e=>{var n;return e&&(null==(n=e.trim())?void 0:n.length)>0})),a};n.useEffect(()=>{_e(P);const e=(e=>{const n={};return e.forEach(e=>{var t,o,a;if(null==(o=null==(t=null==e?void 0:e.editProperties)?void 0:t.validations)?void 0:o.length){const t=null==(a=null==e?void 0:e.editProperties)?void 0:a.validations.reduce((n,t)=>Cn(n,t,e),(e=>{var n;switch(e.editVariant){case"select":return(null==(n=null==e?void 0:e.editProperties)?void 0:n.is_multiple)?V.array():V.string();case"number":return V.number().nullable().transform((e,n)=>""===n?null:e);case"url":return V.string().matches(/^(https?:\/\/)?((([a-zA-Z0-9_-]+\.)+[a-zA-Z]{2,})|localhost)(:\d{2,5})?(\/[a-zA-Z0-9#_-]+\/?)*(\?[a-zA-Z0-9&=_-]+)?(#\S+)?$/,{excludeEmptyString:!0,message:"Please enter valid URL."});default:return V.string()}})(e));n[e.accessorKey]=t}}),n})(P);Ze(V.object().shape(e))},[P]),n.useEffect(()=>{(null==xn?void 0:xn.isResizingColumn)||(ke({column_sizes:{...Te.column_sizes,...gn}}),null==ye||ye(gn))},[null==xn?void 0:xn.isResizingColumn,gn]);const jn=e=>{Ae(e.currentTarget)},Sn=n.useCallback((e,n)=>{const t={};return Object.keys(e).forEach(o=>{const a=e[o],i=n.find(e=>e.accessorKey==o);a?a instanceof File?t[o]=a.name:i&&"date"==(null==i?void 0:i.editVariant)?t[o]=K.default(a).format((null==i?void 0:i.dateFormat)||"DD-MM-YYYY"):i&&"select"==(null==i?void 0:i.editVariant)&&"object"==typeof a&&null!==a?t[o]=a.name||a.label||a.display_name||a.title||a.value||a.id||a:(i&&(null==i||i.editVariant),t[o]=a):t[o]=a}),t},[]),Mn=n.useCallback(e=>{var n;return null==(n=null==e?void 0:e.validations)?void 0:n.some(e=>"required"===e.type)},[]);n.useEffect(()=>{const e={};!sn&&ge.length&&(g.forEach(n=>{ge.includes(n.id)&&(e[n.id]=!0)}),rn(e),dn(!0))},[g,ge]),n.useEffect(()=>{if(xe instanceof Function){const e=Array.isArray(un)?un:[];xe(e[0]||null)}},[un]);const Rn=e=>{const n=document.createElement("canvas").getContext("2d");return n?n.measureText(e).width+5:50},kn=n.useCallback(async(e,n,t)=>{try{await Ye.validate(n,{abortEarly:!1}),Je({}),en(!0),pn(!1);const o=e.getAllCells().map(e=>e.column.columnDef);e._valuesCache=Sn(n,o);const a={row:e,values:n,table:t};re&&await re(a,"edit"),en(!1),t.setEditingRow(null)}catch(o){if(en(!1),o instanceof V.ValidationError){const e={};o.inner.forEach(n=>{n.path&&(e[n.path]=n.message)}),Je(e)}else o instanceof Error?b.enqueueSnackbar(o.message,{variant:"error"}):b.enqueueSnackbar("Something went wrong",{variant:"error"})}},[Ye,re,Sn]),In=t.useMaterialReactTable({defaultColumn:{minSize:0,size:void 0},columns:[...Ue.map(n=>(Rn(n.header||""),Math.max(...g.map(e=>Rn(String(e[n.accessorKey]??"")))),{...n,..."row"===de?{Edit:({cell:t,row:o,table:a,column:i})=>/* @__PURE__ */e.jsx(d.default,{cell:t,column:i,col:n,row:o,table:a,callback:e=>{},errors:We,validationSchema:Ye,setValidationErrors:Je,onChangeRowField:ce,getSelectedData:(e,n)=>null==be?void 0:be(e,n)})}:{},Header:/* @__PURE__ */e.jsxs(T.default,{display:"flex",alignItems:"center",children:[n.header,(null==n?void 0:n.required)||Mn(null==n?void 0:n.editProperties)&&/* @__PURE__ */e.jsx(l.Typography,{type:"s5",color:"theme.error.600",children:"*"})]}),enableColumnDragging:"actions"!==n.id,size:void 0,maxSize:800})),...ee?[]:[{id:"actions",enableEditing:!1,size:(null==te?void 0:te.length)>1?80:50,header:/* @__PURE__ */e.jsx(E.default,{size:"small",sx:{p:.5,"&:hover":{backgroundColor:"transparent"}},onClick:jn,children:/* @__PURE__ */e.jsx("img",{src:s.images.common.arrowIcon,alt:"Arrow Icon"})}),enableColumnDragging:!1,visible:!0,muiTableHeadCellProps:{className:"pinned-column"},muiTableBodyCellProps:{className:"pinned-column",sx:{whiteSpace:"pre-wrap"}},Cell:t=>(null==te?void 0:te.length)?te.map(e=>{const o={...e.props,onClick:()=>e.props.onClick(t)};return n.cloneElement(e,o)}):!ve&&/* @__PURE__ */e.jsx(E.default,{onClick:e=>{return n=e,o=t.row.original,qe(o),void Fe(n.currentTarget);var n,o},disabled:!(null==Q?void 0:Q.length)&&!(null==X?void 0:X.length),children:/* @__PURE__ */e.jsx("img",{src:s.images.more,alt:"More Icon"})})}]],data:g,muiTablePaperProps:{sx:{tableLayout:"auto"}},columnResizeMode:"onChange",onEditingRowSave:async e=>{await kn(e.row,e.values,e.table)},onCreatingRowSave:async e=>{try{await Ye.validate(e.values,{abortEarly:!1}),Je({}),Qe(!0),pn(!1);const n=e.row.getAllCells().map(e=>e.column.columnDef);e.row._valuesCache=Sn(e.values,n),le&&await le(e),Qe(!1),e.table.setCreatingRow(null)}catch(n){if(Qe(!1),n instanceof V.ValidationError){const e={};n.inner.forEach(n=>{n.path&&(e[n.path]=n.message)}),Je(e)}else n instanceof Error?b.enqueueSnackbar(n.message,{variant:"error"}):b.enqueueSnackbar("Something went wrong",{variant:"error"})}},onCreatingRowCancel:()=>(rn({}),void pn(!1)),onEditingRowCancel:()=>{pn(!1)},onSortingChange:(null==G?void 0:G.sorting)?xe:cn,displayColumnDefOptions:{"mrt-row-actions":{Header:/* @__PURE__ */e.jsx(E.default,{onClick:jn,size:"small",children:/* @__PURE__ */e.jsx("img",{src:s.images.common.arrowIcon,alt:"Arrow Icon"})}),muiTableBodyCellProps:({row:e,table:n})=>{var t,o;const a=(null==(t=n.getState().creatingRow)?void 0:t.id)===e.id,i=(null==(o=n.getState().editingRow)?void 0:o.id)===e.id;return{sx:{"& .MuiBox-root":{gap:0},backgroundColor:"#fff",whiteSpace:"pre-wrap",...je&&(i||a)?{"& .MuiBox-root > .MuiIconButton-root:first-of-type":{display:"none !important"},'& button[aria-label*="Save"]':{display:"none !important"},'& button[title*="Save"]':{display:"none !important"},'& .MuiIconButton-root[class*="save"]':{display:"none !important"},'& .MuiIconButton-root[data-testid*="save"]':{display:"none !important"}}:{}},onKeyUp:e=>{}}}},"mrt-row-expand":{size:70},"mrt-row-select":{size:50}},renderRowActions:({row:n,table:t})=>/* @__PURE__ */e.jsx(e.Fragment,{children:(null==Se?void 0:Se.enableExpanding)?/* @__PURE__ */e.jsx(e.Fragment,{children:(null==n?void 0:n.parentId)&&/* @__PURE__ */e.jsx(T.default,{sx:{display:"flex",gap:0},children:se&&/* @__PURE__ */e.jsx(u.Tooltip,{title:"Delete",children:/* @__PURE__ */e.jsx(E.default,{disabled:mn,onClick:()=>an(n),size:"small",children:/* @__PURE__ */e.jsx(N.Trash,{fontSize:"small",sx:{color:"theme.secondary.1000"}})})})})}):/* @__PURE__ */e.jsx(T.default,{sx:{display:"flex",gap:0},children:se&&/* @__PURE__ */e.jsx(u.Tooltip,{title:"Delete",children:/* @__PURE__ */e.jsx(E.default,{disabled:mn,onClick:()=>an(n),children:/* @__PURE__ */e.jsx(N.Trash,{fontSize:"small",sx:{color:"theme.secondary.1000"}})})})})}),...Boolean(ue)&&{renderBottomToolbarCustomActions:({table:n})=>/* @__PURE__ */e.jsx(c.Button,{variant:"outlined",startIcon:/* @__PURE__ */e.jsx(m.default,{}),className:"add-row-btn",disabled:mn,onClick:()=>{n.setCreatingRow(!0),pn(!0)},children:Me("common.add")})},onRowSelectionChange:rn,enableColumnOrdering:!0,enableRowSelection:ne??!0,enableEditing:Y instanceof Function?Y():Y??!0,editDisplayMode:de??"row",createDisplayMode:"row",enableColumnResizing:pe,enableRowDragging:we,enableTopToolbar:!1,enableColumnActions:!1,enableSorting:!0,enableGrouping:!0,enableBottomToolbar:oe??!1,enableColumnDragging:Z??!0,enableStickyHeader:!0,enableSortingRemoval:!1,state:{columnOrder:H,columnPinning:{left:["actions","mrt-row-actions"]},isSaving:Ge||Xe,showProgressBars:!1,rowSelection:ln,...G,sorting:Array.isArray(null==G?void 0:G.sorting)?null==G?void 0:G.sorting:Array.isArray(un)?un:[],columnSizing:gn},getRowId:e=>null==e?void 0:e.id,muiTableBodyRowProps:({row:e,table:n})=>{var t,o,a,i,l,r,s;const d=(null==(o=null==(t=n.getState())?void 0:t.editingRow)?void 0:o.id)||(null==(i=null==(a=n.getState())?void 0:a.creatingRow)?void 0:i.id)||null,u=(null==(r=null==(l=n.getState())?void 0:l.creatingRow)?void 0:r.id)||null,c=Boolean(null==(s=null==e?void 0:e.original)?void 0:s.has_error),m=d===e.id;return{onClick:()=>{$e(e.id)},onKeyDown:t=>{m&&("Enter"===t.key?(t.preventDefault(),n.setEditingRow(null)):"Escape"===t.key&&(t.preventDefault(),u===e.id?n.setCreatingRow(null):n.setEditingRow(null),pn(!1),u!==e.id&&kn(e,e._valuesCache||e.original,n)))},sx:{cursor:"pointer",backgroundColor:d?"inherit":c?"theme.error.100":"inherit","&:hover":{backgroundColor:d?"transparent":c?"theme.error.200":"#e8e8e8"},"&:hover td:after":{backgroundColor:"transparent"}}}},onColumnOrderChange:e=>{J&&J(e)},onColumnSizingChange:hn,onColumnSizingInfoChange:bn,renderEmptyRowsFallback:()=>/* @__PURE__ */e.jsxs(T.default,{className:"no-data",children:[
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),n=require("react"),o=,/* empty css */t=,/* empty css */a=,/* empty css */i=,/* empty css */l=,/* empty css */r=,/* empty css */s=;/* empty css */;/* empty css */var d=,/* empty css */u=,/* empty css */c=,/* empty css */m=,/* empty css */p=require("dayjs"),h=require("yup"),g=,/* empty css */x=require("react-i18next"),b=,/* empty css */f=,/* empty css */v=require("react-router-dom"),w=,/* empty css */y=,/* empty css */j=,/* empty css */C=,/* empty css */S=,/* empty css */M=,/* empty css */k=,/* empty css */R=,/* empty css */I=,/* empty css */T=,/* empty css */E=,/* empty css */P=,/* empty css */q=,/* empty css */D=,/* empty css */_=,/* empty css */z=,/* empty css */A=,/* empty css */B=,/* empty css */O=,/* empty css */N=,/* empty css */F=;/* empty css */function U(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function L(e){if(e&&"object"==typeof e&&"default"in e)return e;var n=/* @__PURE__ */Object.create(null);return e&&Object.keys(e).forEach(function(o){if("default"!==o){var t=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(n,o,t.get?t:{enumerable:!0,get:function(){return e[o]}})}}),n.default=e,n}var H=/* @__PURE__ */U(n),K=/* @__PURE__ */U(p),V=/* @__PURE__ */L(h);const $=P.default(T.default)(({theme:{palette:e}})=>{var n,o,t,a;return{".MuiTableCell-root":{border:"1px solid #efefef",borderBottom:0,borderLeft:0,padding:"0.19rem 0.5rem",lineHeight:"19px",fontSize:"14px",minHeight:40},".MuiTableCell-head":{backgroundColor:null==(n=e.theme)?void 0:n.secondary[100]},".MuiTableContainer-root":{maxHeight:"clamp(350px, 100vh - 200px, 9999px) !important"},".MuiPaper-root":{boxShadow:"none"},".MuiPaginationItem-root":{"&.Mui-selected":{backgroundColor:null==(o=null==e?void 0:e.theme)?void 0:o.primary[700],color:"white"}},".MuiTableRow-root":{"&.Mui-selected":{backgroundColor:`${null==(t=null==e?void 0:e.theme)?void 0:t.primary[100]} !important`,color:"white"}},".MuiCheckbox-indeterminate":{color:`${null==(a=null==e?void 0:e.theme)?void 0:a.primary[700]} !important`,"& svg":{height:"20px !important",width:"20px !important"}}}}),W=H.default.memo(({enablePagination:p=!1,rows:h,columns:P,totalPages:U,paginationModel:L,columnOrder:H,updateData:W,handleColumnOrdering:J,enableEditing:Y,enableColumnDragging:Z,states:G,rowActionMenu:Q,destructiveActionMenu:X,disableDefaultActionColumn:ee,enableRowSelection:ne,defaultActionColumnItems:oe=[],enableBottomToolbar:te,SetSelectedRowId:ae,isResetRow:ie,onCreateRow:le,onEditRow:re,onDeleteRow:se,editDisplayMode:de,enableRowCreate:ue,onChangeRowField:ce,onSelectRow:me,enableColumnResizing:pe=!0,selectedRowIds:he=[],onColumnVisibility:ge,onSortingChange:xe,getSelectedData:be,disabledDefaultActionColumnIcon:fe=!1,enableAddCustomField:ve=!0,enableRowDragging:we=!1,handleColumnResizing:ye=()=>{},columnSizes:je={},...Ce})=>{const{t:Se}=x.useTranslation(),{formData:Me=null,updatePageInfo:ke,activePage:Re}=f.usePages(),Ie=I.default(Re),{pageNo:Te}=L,[Ee,Pe]=n.useState({}),[qe,De]=n.useState(P),[_e,ze]=n.useState(null),[Ae,Be]=n.useState(!1),[Oe,Ne]=n.useState(null),Fe=qe.filter(e=>e.visible),Ue=qe.filter(e=>!e.visible),[Le,He]=n.useState(Ue),[Ke,Ve]=n.useState(null),[$e,We]=n.useState({}),[Je,Ye]=n.useState([]),[Ze,Ge]=n.useState(!1),[Qe,Xe]=n.useState(!1),[en,nn]=n.useState(!1),[on,tn]=n.useState(null),[an,ln]=n.useState({}),[rn,sn]=n.useState(!1),[dn,un]=n.useState([]),[cn,mn]=n.useState(!1),[pn,hn]=n.useState(Ie.column_sizes),[gn,xn]=n.useState({columnSizingStart:[],deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,startOffset:null,startSize:null});n.useState(0);const bn=v.useNavigate(),fn=location.pathname.split("/")[2];let vn="";switch(fn){case"accounting":vn=y.PathnameAccounting.CUSTOM_FORM;break;case"inventory":vn=j.PathnameInventory.CUSTOM_FORM;break;case"manufacturing":vn=C.PathnameManufacturing.CUSTOM_FORM;break;case"procurement":vn=S.PathnamePurchase.CUSTOM_FORM;break;case"crm":vn=M.PathnameCrm.CUSTOM_FORM;break;case"user":vn=k.PathnameUsers.CUSTOM_FORM;break;case"rental":vn=R.PathnameRental.CUSTOM_FORM;break;case"drive":vn=w.PathnameDocument.ADD_CUSTOM_FIELDS}const wn=`/dashboard/${fn}${vn}`,yn=(e,n,o)=>{var t;let a=e;switch(n.type){case"required":a=n.value?e.required(n.msg_en).typeError(n.msg_en):(null==(t=null==o?void 0:o.editProperties)?void 0:t.is_multiple)?e.min(1,n.msg_en):e;break;case"min":a=e.min(n.value,n.msg_en);break;case"email":a=e.email(n.value,n.msg_en);break;case"max":a=e.max(n.value,n.msg_en);break;case"positive":a=!0===n.value?e.test("is-positive-number","Value must be a positive number",e=>!e||e>=0):e;break;case"when":return e.when(n.relation,{is:e=>e===n.values,then:()=>{var t;return(null==(t=null==n?void 0:n.thenValidations)?void 0:t.reduce((e,n)=>yn(e,n,o),e))||e},otherwise:()=>{var t;return(null==(t=null==n?void 0:n.otherWiseValidations)?void 0:t.reduce((e,n)=>yn(e,n,o),e))||e}});default:a=e}return"required"!=n.type||!n.value||(null==o?void 0:o.editVariant)&&"text"!=(null==o?void 0:o.editVariant)||(a=e.test("no-blank-spaces","Blank space is not allowed",e=>{var n;return e&&(null==(n=e.trim())?void 0:n.length)>0})),a};n.useEffect(()=>{De(P);const e=(e=>{const n={};return e.forEach(e=>{var o,t,a;if(null==(t=null==(o=null==e?void 0:e.editProperties)?void 0:o.validations)?void 0:t.length){const o=null==(a=null==e?void 0:e.editProperties)?void 0:a.validations.reduce((n,o)=>yn(n,o,e),(e=>{var n;switch(e.editVariant){case"select":return(null==(n=null==e?void 0:e.editProperties)?void 0:n.is_multiple)?V.array():V.string();case"number":return V.number().nullable().transform((e,n)=>""===n?null:e);case"url":return V.string().matches(/^(https?:\/\/)?((([a-zA-Z0-9_-]+\.)+[a-zA-Z]{2,})|localhost)(:\d{2,5})?(\/[a-zA-Z0-9#_-]+\/?)*(\?[a-zA-Z0-9&=_-]+)?(#\S+)?$/,{excludeEmptyString:!0,message:"Please enter valid URL."});default:return V.string()}})(e));n[e.accessorKey]=o}}),n})(P);Ye(V.object().shape(e))},[P]),n.useEffect(()=>{(null==gn?void 0:gn.isResizingColumn)||(ke({column_sizes:{...Ie.column_sizes,...pn}}),null==ye||ye(pn))},[null==gn?void 0:gn.isResizingColumn,pn]);const jn=e=>{ze(e.currentTarget)},Cn=n.useCallback((e,n)=>{const o={};return Object.keys(e).forEach(t=>{const a=e[t],i=n.find(e=>e.accessorKey==t);a?a instanceof File?o[t]=a.name:i&&"date"==(null==i?void 0:i.editVariant)?o[t]=K.default(a).format((null==i?void 0:i.dateFormat)||"DD-MM-YYYY"):i&&"select"==(null==i?void 0:i.editVariant)&&"object"==typeof a&&null!==a?o[t]=a.name||a.label||a.display_name||a.title||a.value||a.id||a:(i&&(null==i||i.editVariant),o[t]=a):o[t]=a}),o},[]),Sn=n.useCallback(e=>{var n;return null==(n=null==e?void 0:e.validations)?void 0:n.some(e=>"required"===e.type)},[]);n.useEffect(()=>{const e={};!rn&&he.length&&(h.forEach(n=>{he.includes(n.id)&&(e[n.id]=!0)}),ln(e),sn(!0))},[h,he]),n.useEffect(()=>{if(xe instanceof Function){const e=Array.isArray(dn)?dn:[];xe(e[0]||null)}},[dn]);const Mn=e=>{const n=document.createElement("canvas").getContext("2d");return n?n.measureText(e).width+5:50},kn=n.useCallback(async(e,n,o)=>{try{await Je.validate(n,{abortEarly:!1}),We({}),Xe(!0),mn(!1);const t=e.getAllCells().map(e=>e.column.columnDef);e._valuesCache=Cn(n,t);const a={row:e,values:n,table:o};re&&await re(a,"edit"),Xe(!1),o.setEditingRow(null)}catch(t){if(Xe(!1),t instanceof V.ValidationError){const e={};t.inner.forEach(n=>{n.path&&(e[n.path]=n.message)}),We(e)}else t instanceof Error?b.enqueueSnackbar(t.message,{variant:"error"}):b.enqueueSnackbar("Something went wrong",{variant:"error"})}},[Je,re,Cn]),Rn=o.useMaterialReactTable({defaultColumn:{minSize:0,size:void 0},columns:[...Fe.map(n=>(Mn(n.header||""),Math.max(...h.map(e=>Mn(String(e[n.accessorKey]??"")))),{...n,..."row"===de?{Edit:({cell:o,row:t,table:a,column:i})=>/* @__PURE__ */e.jsx(d.default,{cell:o,column:i,col:n,row:t,table:a,callback:e=>{},errors:$e,validationSchema:Je,setValidationErrors:We,onChangeRowField:ce,getSelectedData:(e,n)=>null==be?void 0:be(e,n)})}:{},Header:/* @__PURE__ */e.jsxs(T.default,{display:"flex",alignItems:"center",children:[n.header,(null==n?void 0:n.required)||Sn(null==n?void 0:n.editProperties)&&/* @__PURE__ */e.jsx(l.Typography,{type:"s5",color:"theme.error.600",children:"*"})]}),enableColumnDragging:"actions"!==n.id,size:void 0,maxSize:800})),...ee?[]:[{id:"actions",enableEditing:!1,size:(null==oe?void 0:oe.length)>1?80:50,header:/* @__PURE__ */e.jsx(E.default,{size:"small",sx:{p:.5,"&:hover":{backgroundColor:"transparent"}},onClick:jn,children:/* @__PURE__ */e.jsx("img",{src:s.images.common.arrowIcon,alt:"Arrow Icon"})}),enableColumnDragging:!1,visible:!0,muiTableHeadCellProps:{className:"pinned-column"},muiTableBodyCellProps:{className:"pinned-column",sx:{whiteSpace:"pre-wrap"}},Cell:o=>(null==oe?void 0:oe.length)?oe.map(e=>{const t={...e.props,onClick:()=>e.props.onClick(o)};return n.cloneElement(e,t)}):!fe&&/* @__PURE__ */e.jsx(E.default,{onClick:e=>{return n=e,t=o.row.original,Pe(t),void Ne(n.currentTarget);var n,t},disabled:!(null==Q?void 0:Q.length)&&!(null==X?void 0:X.length),children:/* @__PURE__ */e.jsx("img",{src:s.images.more,alt:"More Icon"})})}]],data:h,muiTablePaperProps:{sx:{tableLayout:"auto"}},columnResizeMode:"onChange",onEditingRowSave:async e=>{await kn(e.row,e.values,e.table)},onCreatingRowSave:async e=>{try{await Je.validate(e.values,{abortEarly:!1}),We({}),Ge(!0),mn(!1);const n=e.row.getAllCells().map(e=>e.column.columnDef);e.row._valuesCache=Cn(e.values,n),le&&await le(e),Ge(!1),e.table.setCreatingRow(null)}catch(n){if(Ge(!1),n instanceof V.ValidationError){const e={};n.inner.forEach(n=>{n.path&&(e[n.path]=n.message)}),We(e)}else n instanceof Error?b.enqueueSnackbar(n.message,{variant:"error"}):b.enqueueSnackbar("Something went wrong",{variant:"error"})}},onCreatingRowCancel:()=>(ln({}),void mn(!1)),onEditingRowCancel:()=>{mn(!1)},onSortingChange:(null==G?void 0:G.sorting)?xe:un,displayColumnDefOptions:{"mrt-row-actions":{Header:/* @__PURE__ */e.jsx(E.default,{onClick:jn,size:"small",children:/* @__PURE__ */e.jsx("img",{src:s.images.common.arrowIcon,alt:"Arrow Icon"})}),muiTableBodyCellProps:({row:e,table:n})=>{var o,t;const a=(null==(o=n.getState().creatingRow)?void 0:o.id)===e.id;return{sx:{"& .MuiBox-root":{gap:0},backgroundColor:"#fff",whiteSpace:"pre-wrap",...(null==(t=n.getState().editingRow)?void 0:t.id)===e.id&&!a&&{"& .MuiBox-root > .MuiIconButton-root:first-of-type":{display:"none !important"},'& button[aria-label*="Save"]':{display:"none !important"},'& button[title*="Save"]':{display:"none !important"},'& .MuiIconButton-root[class*="save"]':{display:"none !important"},'& .MuiIconButton-root[data-testid*="save"]':{display:"none !important"}}},onKeyUp:e=>{}}}},"mrt-row-expand":{size:70},"mrt-row-select":{size:50}},renderRowActions:({row:n,table:o})=>/* @__PURE__ */e.jsx(e.Fragment,{children:(null==Ce?void 0:Ce.enableExpanding)?/* @__PURE__ */e.jsx(e.Fragment,{children:(null==n?void 0:n.parentId)&&/* @__PURE__ */e.jsx(T.default,{sx:{display:"flex",gap:0},children:se&&/* @__PURE__ */e.jsx(u.Tooltip,{title:"Delete",children:/* @__PURE__ */e.jsx(E.default,{disabled:cn,onClick:()=>tn(n),size:"small",children:/* @__PURE__ */e.jsx(N.Trash,{fontSize:"small",sx:{color:"theme.secondary.1000"}})})})})}):/* @__PURE__ */e.jsx(T.default,{sx:{display:"flex",gap:0},children:se&&/* @__PURE__ */e.jsx(u.Tooltip,{title:"Delete",children:/* @__PURE__ */e.jsx(E.default,{disabled:cn,onClick:()=>tn(n),children:/* @__PURE__ */e.jsx(N.Trash,{fontSize:"small",sx:{color:"theme.secondary.1000"}})})})})}),...Boolean(ue)&&{renderBottomToolbarCustomActions:({table:n})=>/* @__PURE__ */e.jsx(c.Button,{variant:"outlined",startIcon:/* @__PURE__ */e.jsx(m.default,{}),className:"add-row-btn",disabled:cn,onClick:()=>{n.setCreatingRow(!0),mn(!0)},children:Se("common.add")})},onRowSelectionChange:ln,enableColumnOrdering:!0,enableRowSelection:ne??!0,enableEditing:Y instanceof Function?Y():Y??!0,editDisplayMode:de??"row",createDisplayMode:"row",enableColumnResizing:pe,enableRowDragging:we,enableTopToolbar:!1,enableColumnActions:!1,enableSorting:!0,enableGrouping:!0,enableBottomToolbar:te??!1,enableColumnDragging:Z??!0,enableStickyHeader:!0,enableSortingRemoval:!1,state:{columnOrder:H,columnPinning:{left:["actions","mrt-row-actions"]},isSaving:Ze||Qe,showProgressBars:!1,rowSelection:an,...G,sorting:Array.isArray(null==G?void 0:G.sorting)?null==G?void 0:G.sorting:Array.isArray(dn)?dn:[],columnSizing:pn},getRowId:e=>null==e?void 0:e.id,muiTableBodyRowProps:({row:e,table:n})=>{var o,t,a,i,l;const r=(null==(t=null==(o=n.getState())?void 0:o.editingRow)?void 0:t.id)||(null==(i=null==(a=n.getState())?void 0:a.creatingRow)?void 0:i.id)||null,s=Boolean(null==(l=null==e?void 0:e.original)?void 0:l.has_error),d=r===e.id;return{onClick:()=>{if(Ve(e.id),r&&r!==e.id)return n.setEditingRow(null),void setTimeout(()=>{n.setEditingRow(e),mn(!0)},100);cn||d||r||(n.setEditingRow(e),mn(!0))},onKeyDown:o=>{d&&("Enter"===o.key?(o.preventDefault(),n.setEditingRow(null)):"Escape"===o.key&&(o.preventDefault(),n.setEditingRow(null),mn(!1),kn(e,e._valuesCache||e.original,n)))},sx:{cursor:"pointer",backgroundColor:r?"inherit":s?"theme.error.100":"inherit","&:hover":{backgroundColor:r?"transparent":s?"theme.error.200":"#e8e8e8"},"&:hover td:after":{backgroundColor:"transparent"}}}},onColumnOrderChange:e=>{J&&J(e)},onColumnSizingChange:hn,onColumnSizingInfoChange:xn,renderEmptyRowsFallback:()=>/* @__PURE__ */e.jsxs(T.default,{className:"no-data",children:[
2
2
  /* @__PURE__ */e.jsx("img",{src:s.images.common.tableNoData}),
3
- /* @__PURE__ */e.jsx(l.Typography,{type:"s3",weight:"medium",color:"theme.secondary.1000",children:Me("common.noData")})]}),enablePagination:p,paginationDisplayMode:"pages",muiPaginationProps:{shape:"rounded",page:Ee,count:U,showRowsPerPage:!1,boundaryCount:3},muiEditTextFieldProps:({row:e,column:n})=>({InputProps:{disableUnderline:!0},onBlur:t=>{W(t.target.value,n,e.id)},variant:"outlined",sx:({palette:e})=>{var n;return{"& .MuiOutlinedInput-root":{"& fieldset":{borderColor:`${null==(n=e.theme)?void 0:n.primary[700]} !important`}}}}}),muiCircularProgressProps:{sx:{color:"#289B64"}},muiTableHeadCellProps:{sx:{lineHeight:"140%",letterSpacing:"-0.28px",fontWeight:"500",fontSize:"0.875rem","& .Mui-TableHeadCell-Content":{height:"100%"},"& .Mui-TableHeadCell-Content-Labels":{width:"100%",justifyContent:"space-between"},"&.pinned-column":{backgroundColor:"#fff"},"& .Mui-TableHeadCell-ResizeHandle-Wrapper":{padding:0,margin:0,right:"-5px",opacity:0}}},muiTableBodyProps:{sx:{zIndex:500}},muiTableHeadProps:{sx:{zIndex:600}},muiTableBodyCellProps:({cell:e,column:n,table:t,row:o})=>({sx:{lineHeight:"140%",letterSpacing:"-0.26px",fontWeight:"400",fontSize:"0.8125rem","&.pinned-column":{backgroundColor:"#fff"},"&:hover":{backgroundColor:"transparent"},whiteSpace:"pre-wrap"},onClick:e=>{var a,i,l,r;if(!1===n.columnDef.isOnClickEditable)return;const s=(null==(i=null==(a=t.getState())?void 0:a.editingRow)?void 0:i.id)||(null==(r=null==(l=t.getState())?void 0:l.creatingRow)?void 0:r.id)||null,d=s===o.id;if(s&&s!==o.id)return t.setEditingRow(null),void setTimeout(()=>{t.setEditingRow(o),pn(!0)},100);mn||d||s||(t.setEditingRow(o),pn(!0))}}),muiSelectCheckboxProps:{sx:{color:"theme.secondary.300","&.Mui-checked":{color:"theme.primary.600","&:hover":{color:"theme.primary.500"}},"&.Mui-disabled":{color:"theme.secondary.200"}},icon:/* @__PURE__ */e.jsx(O.RecgtangleIcon,{sx:{width:20,height:20}}),checkedIcon:/* @__PURE__ */e.jsx(F.CheckBoxIcon,{sx:{width:20,height:20}})},muiSelectAllCheckboxProps:{sx:{color:"theme.secondary.300","&.Mui-checked":{color:"theme.primary.600","&:hover":{color:"theme.primary.500"}},"&.Mui-disabled":{color:"theme.secondary.600"}},icon:/* @__PURE__ */e.jsx(O.RecgtangleIcon,{sx:{width:20,height:20}}),checkedIcon:/* @__PURE__ */e.jsx(F.CheckBoxIcon,{sx:{width:20,height:20}})},muiBottomToolbarProps:{sx:{boxShadow:"none","& .MuiBox-root":{paddingLeft:0}}},layoutMode:"grid",icons:{DragHandleIcon:()=>/* @__PURE__ */e.jsx(O.RecgtangleIcon,{fontSize:"medium"}),SortIcon:()=>/* @__PURE__ */e.jsx(B.ArrowUpDown,{fontSize:"medium"}),ArrowDownwardIcon:()=>/* @__PURE__ */e.jsx(B.ArrowUpDown,{fontSize:"medium"}),ArrowUpwardIcon:()=>/* @__PURE__ */e.jsx(B.ArrowUpDown,{fontSize:"medium"}),ExpandMoreIcon:()=>/* @__PURE__ */e.jsx(B.ArrowUpDown,{fontSize:"medium"}),ExpandLessIcon:()=>/* @__PURE__ */e.jsx(B.ArrowUpDown,{fontSize:"medium"}),SyncAltIcon:()=>/* @__PURE__ */e.jsx(B.ArrowUpDown,{fontSize:"medium"}),CancelIcon:n=>/* @__PURE__ */e.jsx(A.Close,{fontSize:"small",...n,color:"theme.secondary.1000"})},...Se});return n.useEffect(()=>{var e,n;ne&&(null==(e=null==In?void 0:In.getSelectedRowModel())?void 0:e.rows)&&(null==ae||ae(null==(n=null==In?void 0:In.getSelectedRowModel())?void 0:n.rows))},[ne]),n.useEffect(()=>{if(me)if(null==Se?void 0:Se.enableExpanding){const e=[],n=In.getState().rowSelection,t=(o,a="")=>{o.forEach((o,i)=>{var l;const r=a?`${a}.${i}`:`${o.id}`;n[r]&&e.push(o),(null==(l=o.subRows)?void 0:l.length)&&t(o.subRows,r)})};t(In.getRowModel().rows),me(e,ln)}else me(In.getSelectedRowModel().rows,ln)},[ln,In]),n.useEffect(()=>{ie&&(null==In||In.resetRowSelection())},[ie,In]),n.useEffect(()=>{if(!In)return;let e,n,t=0,o=!1;const a=a=>{a.target.closest('.MuiSelect-root, .MuiMenuItem-root, .MuiPopover-root, .MuiList-root, .MuiMenu-list, .MuiModal-root, .MuiBackdrop-root, .MuiButtonBase-root, .MuiFormControl-root, .MuiInputBase-root, .MuiTextField-root, .MuiOutlinedInput-root, .MuiFilledInput-root, .MuiAutocomplete-popper, .MuiPickersPopper-root, [role="option"], [role="listbox"], [role="combobox"]')&&(o=!0,t=Date.now(),n&&clearTimeout(n),e&&clearTimeout(e),e=setTimeout(()=>{o=!1},500))},i=e=>{var a,i;const l=null==(a=In.getState())?void 0:a.editingRow,r=null==(i=In.getState())?void 0:i.creatingRow;if(!l&&!r)return;const s=e.target,d=Date.now();o||d-t<300||s.closest(".MuiTableContainer-root, .MuiPaper-root, .MRT_Table")||(n&&clearTimeout(n),n=setTimeout(()=>{var e,n,t;const a=null==(e=In.getState())?void 0:e.editingRow,i=null==(n=In.getState())?void 0:n.creatingRow;if(!o){if(i){const e=i._valuesCache||i.original;return void((null==(t=In.options)?void 0:t.onCreatingRowSave)&&In.options.onCreatingRowSave({row:i,values:e,table:In}))}a&&kn(a,a._valuesCache||a.original,In)}},200))};return document.addEventListener("mousedown",a,!0),document.addEventListener("click",i,!0),()=>{document.removeEventListener("mousedown",a,!0),document.removeEventListener("click",i,!0),e&&clearTimeout(e),n&&clearTimeout(n)}},[In,kn]),/* @__PURE__ */e.jsxs($,{className:"MRT-TableWrapper custom-table",children:[
4
- /* @__PURE__ */e.jsx(t.MaterialReactTable,{table:In}),
5
- /* @__PURE__ */e.jsx(i.Menu,{anchorEl:ze,open:Boolean(ze),onClose:()=>{Ae(null)},className:"add-role-drp",children:Be?/* @__PURE__ */e.jsxs("div",{children:[
6
- /* @__PURE__ */e.jsxs(q.default,{onClick:()=>{Oe(!1)},className:"role-drp-list add-column-title",children:[
3
+ /* @__PURE__ */e.jsx(l.Typography,{type:"s3",weight:"medium",color:"theme.secondary.1000",children:Se("common.noData")})]}),enablePagination:p,paginationDisplayMode:"pages",muiPaginationProps:{shape:"rounded",page:Te,count:U,showRowsPerPage:!1,boundaryCount:3},muiEditTextFieldProps:({row:e,column:n})=>({InputProps:{disableUnderline:!0},onBlur:o=>{W(o.target.value,n,e.id)},variant:"outlined",sx:({palette:e})=>{var n;return{"& .MuiOutlinedInput-root":{"& fieldset":{borderColor:`${null==(n=e.theme)?void 0:n.primary[700]} !important`}}}}}),muiCircularProgressProps:{sx:{color:"#289B64"}},muiTableHeadCellProps:{sx:{lineHeight:"140%",letterSpacing:"-0.28px",fontWeight:"500",fontSize:"0.875rem","& .Mui-TableHeadCell-Content":{height:"100%"},"& .Mui-TableHeadCell-Content-Labels":{width:"100%",justifyContent:"space-between"},"&.pinned-column":{backgroundColor:"#fff"},"& .Mui-TableHeadCell-ResizeHandle-Wrapper":{padding:0,margin:0,right:"-5px",opacity:0}}},muiTableBodyProps:{sx:{zIndex:500}},muiTableHeadProps:{sx:{zIndex:600}},muiTableBodyCellProps:()=>({sx:{lineHeight:"140%",letterSpacing:"-0.26px",fontWeight:"400",fontSize:"0.8125rem","&.pinned-column":{backgroundColor:"#fff"},"&:hover":{backgroundColor:"transparent"},whiteSpace:"pre-wrap"}}),muiSelectCheckboxProps:{sx:{color:"theme.secondary.300","&.Mui-checked":{color:"theme.primary.600","&:hover":{color:"theme.primary.500"}},"&.Mui-disabled":{color:"theme.secondary.200"}},icon:/* @__PURE__ */e.jsx(O.RecgtangleIcon,{sx:{width:20,height:20}}),checkedIcon:/* @__PURE__ */e.jsx(F.CheckBoxIcon,{sx:{width:20,height:20}})},muiSelectAllCheckboxProps:{sx:{color:"theme.secondary.300","&.Mui-checked":{color:"theme.primary.600","&:hover":{color:"theme.primary.500"}},"&.Mui-disabled":{color:"theme.secondary.600"}},icon:/* @__PURE__ */e.jsx(O.RecgtangleIcon,{sx:{width:20,height:20}}),checkedIcon:/* @__PURE__ */e.jsx(F.CheckBoxIcon,{sx:{width:20,height:20}})},muiBottomToolbarProps:{sx:{boxShadow:"none","& .MuiBox-root":{paddingLeft:0}}},layoutMode:"grid",icons:{DragHandleIcon:()=>/* @__PURE__ */e.jsx(O.RecgtangleIcon,{fontSize:"medium"}),SortIcon:()=>/* @__PURE__ */e.jsx(B.ArrowUpDown,{fontSize:"medium"}),ArrowDownwardIcon:()=>/* @__PURE__ */e.jsx(B.ArrowUpDown,{fontSize:"medium"}),ArrowUpwardIcon:()=>/* @__PURE__ */e.jsx(B.ArrowUpDown,{fontSize:"medium"}),ExpandMoreIcon:()=>/* @__PURE__ */e.jsx(B.ArrowUpDown,{fontSize:"medium"}),ExpandLessIcon:()=>/* @__PURE__ */e.jsx(B.ArrowUpDown,{fontSize:"medium"}),SyncAltIcon:()=>/* @__PURE__ */e.jsx(B.ArrowUpDown,{fontSize:"medium"}),CancelIcon:n=>/* @__PURE__ */e.jsx(A.Close,{fontSize:"small",...n,color:"theme.secondary.1000"})},...Ce});return n.useEffect(()=>{var e,n;ne&&(null==(e=null==Rn?void 0:Rn.getSelectedRowModel())?void 0:e.rows)&&(null==ae||ae(null==(n=null==Rn?void 0:Rn.getSelectedRowModel())?void 0:n.rows))},[ne]),n.useEffect(()=>{if(me)if(null==Ce?void 0:Ce.enableExpanding){const e=[],n=Rn.getState().rowSelection,o=(t,a="")=>{t.forEach((t,i)=>{var l;const r=a?`${a}.${i}`:`${t.id}`;n[r]&&e.push(t),(null==(l=t.subRows)?void 0:l.length)&&o(t.subRows,r)})};o(Rn.getRowModel().rows),me(e,an)}else me(Rn.getSelectedRowModel().rows,an)},[an,Rn]),n.useEffect(()=>{ie&&(null==Rn||Rn.resetRowSelection())},[ie,Rn]),n.useEffect(()=>{if(!Rn)return;let e,n,o=0,t=!1;const a=a=>{a.target.closest('.MuiSelect-root, .MuiMenuItem-root, .MuiPopover-root, .MuiList-root, .MuiMenu-list, .MuiModal-root, .MuiBackdrop-root, .MuiButtonBase-root, .MuiFormControl-root, .MuiInputBase-root, .MuiTextField-root, .MuiOutlinedInput-root, .MuiFilledInput-root, .MuiAutocomplete-popper, .MuiPickersPopper-root, [role="option"], [role="listbox"], [role="combobox"]')&&(t=!0,o=Date.now(),n&&clearTimeout(n),e&&clearTimeout(e),e=setTimeout(()=>{t=!1},500))},i=e=>{var a;if(!(null==(a=Rn.getState())?void 0:a.editingRow))return;const i=e.target,l=Date.now();t||l-o<300||i.closest(".MuiTableContainer-root, .MuiPaper-root, .MRT_Table")||(n&&clearTimeout(n),n=setTimeout(()=>{var e;const n=null==(e=Rn.getState())?void 0:e.editingRow;n&&!t&&kn(n,n._valuesCache||n.original,Rn)},200))};return document.addEventListener("mousedown",a,!0),document.addEventListener("click",i,!0),()=>{document.removeEventListener("mousedown",a,!0),document.removeEventListener("click",i,!0),e&&clearTimeout(e),n&&clearTimeout(n)}},[Rn,kn]),/* @__PURE__ */e.jsxs($,{className:"MRT-TableWrapper custom-table",children:[
4
+ /* @__PURE__ */e.jsx(o.MaterialReactTable,{table:Rn}),
5
+ /* @__PURE__ */e.jsx(i.Menu,{anchorEl:_e,open:Boolean(_e),onClose:()=>{ze(null)},className:"add-role-drp",children:Ae?/* @__PURE__ */e.jsxs("div",{children:[
6
+ /* @__PURE__ */e.jsxs(q.default,{onClick:()=>{Be(!1)},className:"role-drp-list add-column-title",children:[
7
7
  /* @__PURE__ */e.jsx(D.default,{className:"add-icon",children:/* @__PURE__ */e.jsx(a.default,{})}),
8
- /* @__PURE__ */e.jsx(_.default,{className:"title",children:Me("common.addColumn_label")})]}),
8
+ /* @__PURE__ */e.jsx(_.default,{className:"title",children:Se("common.addColumn_label")})]}),
9
9
  /* @__PURE__ */e.jsx(z.default,{flexItem:!0,sx:{mt:"0.25rem !important",mb:"0.25rem !important"}}),
10
- /* @__PURE__ */e.jsx("div",{className:"searchbar-box-list",children:/* @__PURE__ */e.jsx(r.SearchBar,{placeholder:"Search User",handleSearch:e=>(e=>{const n=Le.filter(n=>n.header.toLowerCase().includes(e.toLowerCase()));Ke(n)})(e)})}),
11
- /* @__PURE__ */e.jsx("div",{className:"all-attribute-title",children:/* @__PURE__ */e.jsx(l.Typography,{variant:"body2",color:"text.secondary",children:Me("common.allAttributes_label")})}),He.map(n=>/* @__PURE__ */e.jsx(q.default,{onClick:()=>(e=>{const n=De.map(n=>({...n,visible:n.accessorKey===e.accessorKey||n.visible}));null==he||he(JSON.parse(JSON.stringify(n))),_e(n);const t=He.filter(n=>n.accessorKey!==e.accessorKey);Ke(t),Ae(null),Oe(!1)})(n),children:/* @__PURE__ */e.jsx(l.Typography,{color:"theme.secondary.1000",type:"s3",children:n.header})},n.accessorKey)),
12
- /* @__PURE__ */e.jsx(z.default,{flexItem:!0,sx:{mt:"0.25rem !important",mb:"0.25rem !important"}}),fe&&/* @__PURE__ */e.jsxs(q.default,{onClick:()=>{vn(yn,{state:Re}),Ae(null),Oe(!1)},className:"role-drp-list",children:[
10
+ /* @__PURE__ */e.jsx("div",{className:"searchbar-box-list",children:/* @__PURE__ */e.jsx(r.SearchBar,{placeholder:"Search User",handleSearch:e=>(e=>{const n=Ue.filter(n=>n.header.toLowerCase().includes(e.toLowerCase()));He(n)})(e)})}),
11
+ /* @__PURE__ */e.jsx("div",{className:"all-attribute-title",children:/* @__PURE__ */e.jsx(l.Typography,{variant:"body2",color:"text.secondary",children:Se("common.allAttributes_label")})}),Le.map(n=>/* @__PURE__ */e.jsx(q.default,{onClick:()=>(e=>{const n=qe.map(n=>({...n,visible:n.accessorKey===e.accessorKey||n.visible}));null==ge||ge(JSON.parse(JSON.stringify(n))),De(n);const o=Le.filter(n=>n.accessorKey!==e.accessorKey);He(o),ze(null),Be(!1)})(n),children:/* @__PURE__ */e.jsx(l.Typography,{color:"theme.secondary.1000",type:"s3",children:n.header})},n.accessorKey)),
12
+ /* @__PURE__ */e.jsx(z.default,{flexItem:!0,sx:{mt:"0.25rem !important",mb:"0.25rem !important"}}),ve&&/* @__PURE__ */e.jsxs(q.default,{onClick:()=>{bn(wn,{state:Me}),ze(null),Be(!1)},className:"role-drp-list",children:[
13
13
  /* @__PURE__ */e.jsx(D.default,{className:"add-icon",children:/* @__PURE__ */e.jsx("img",{src:s.images.common.addIcon,alt:"Add Icon"})}),
14
- /* @__PURE__ */e.jsx(_.default,{className:"title",children:Me("common.addCustomField_label")})]})]}):/* @__PURE__ */e.jsxs(e.Fragment,{children:[Ue.map(n=>/* @__PURE__ */e.jsxs(q.default,{onClick:()=>(e=>{const n=De.map(n=>({...n,visible:n.accessorKey!==e.accessorKey&&n.visible}));_e(n),null==he||he(JSON.parse(JSON.stringify(n))),Ke([...He,e]),Ae(null)})(n),className:"role-drp-list",children:[
14
+ /* @__PURE__ */e.jsx(_.default,{className:"title",children:Se("common.addCustomField_label")})]})]}):/* @__PURE__ */e.jsxs(e.Fragment,{children:[Fe.map(n=>/* @__PURE__ */e.jsxs(q.default,{onClick:()=>(e=>{const n=qe.map(n=>({...n,visible:n.accessorKey!==e.accessorKey&&n.visible}));De(n),null==ge||ge(JSON.parse(JSON.stringify(n))),He([...Le,e]),ze(null)})(n),className:"role-drp-list",children:[
15
15
  /* @__PURE__ */e.jsx(D.default,{className:"add-icon",children:/* @__PURE__ */e.jsx("img",{src:s.images.common.dotsIcon,alt:"Add Icon"})}),
16
16
  /* @__PURE__ */e.jsx(_.default,{className:"title",children:n.header}),
17
17
  /* @__PURE__ */e.jsx(D.default,{className:"eye-icon",children:/* @__PURE__ */e.jsx("img",{src:s.images.common.eyeIcon,alt:"Eye Icon"})})]},n.accessorKey)),
18
18
  /* @__PURE__ */e.jsx(z.default,{flexItem:!0,sx:{mt:"0.25rem !important",mb:"0.25rem !important"}}),
19
- /* @__PURE__ */e.jsxs(q.default,{onClick:()=>{Oe(!0)},className:"role-drp-list",children:[
19
+ /* @__PURE__ */e.jsxs(q.default,{onClick:()=>{Be(!0)},className:"role-drp-list",children:[
20
20
  /* @__PURE__ */e.jsx(D.default,{className:"add-icon",children:/* @__PURE__ */e.jsx("img",{src:s.images.common.addIcon,alt:"Add Icon"})}),
21
- /* @__PURE__ */e.jsx(_.default,{className:"title",children:Me("common.addColumn_label")}),
22
- /* @__PURE__ */e.jsx(l.Typography,{variant:"body2",color:"text.secondary",className:"eye-icon",children:/* @__PURE__ */e.jsx(o.default,{sx:{fontSize:"1.25rem !important"}})})]})]})}),
23
- /* @__PURE__ */e.jsxs(i.Menu,{anchorEl:Ne,open:Boolean(Ne),onClose:()=>{Fe(null)},children:[null==Q?void 0:Q.map(n=>/* @__PURE__ */e.jsxs(q.default,{onClick:async()=>{await n.handleAction(Pe),Fe(null)},disabled:"function"==typeof n.disabled?n.disabled(Pe):Boolean(n.disabled),sx:{alignItems:"center",gap:.5},children:[null==n?void 0:n.icon,
24
- /* @__PURE__ */e.jsx(l.Typography,{type:"s4",color:"inherit",children:"function"==typeof n.label?n.label(Pe):n.label})]})),(null==X?void 0:X.length)>0&&/* @__PURE__ */e.jsxs(e.Fragment,{children:[
21
+ /* @__PURE__ */e.jsx(_.default,{className:"title",children:Se("common.addColumn_label")}),
22
+ /* @__PURE__ */e.jsx(l.Typography,{variant:"body2",color:"text.secondary",className:"eye-icon",children:/* @__PURE__ */e.jsx(t.default,{sx:{fontSize:"1.25rem !important"}})})]})]})}),
23
+ /* @__PURE__ */e.jsxs(i.Menu,{anchorEl:Oe,open:Boolean(Oe),onClose:()=>{Ne(null)},children:[null==Q?void 0:Q.map(n=>/* @__PURE__ */e.jsxs(q.default,{onClick:async()=>{await n.handleAction(Ee),Ne(null)},disabled:"function"==typeof n.disabled?n.disabled(Ee):Boolean(n.disabled),sx:{alignItems:"center",gap:.5},children:[null==n?void 0:n.icon,
24
+ /* @__PURE__ */e.jsx(l.Typography,{type:"s4",color:"inherit",children:"function"==typeof n.label?n.label(Ee):n.label})]})),(null==X?void 0:X.length)>0&&/* @__PURE__ */e.jsxs(e.Fragment,{children:[
25
25
  /* @__PURE__ */e.jsx(z.default,{flexItem:!0,sx:{mt:"0.25rem !important",mb:"0.25rem !important"}}),
26
- /* @__PURE__ */e.jsx("div",{className:"dropdown-inner--DestructiveHeader",children:null==X?void 0:X.map(n=>/* @__PURE__ */e.jsx(q.default,{onClick:()=>{n.handleAction(Pe),Fe(null)},className:"dropdown-inner--DestructiveActions",disabled:"function"==typeof n.disabled?n.disabled(Pe):Boolean(n.disabled),children:/* @__PURE__ */e.jsx(l.Typography,{type:"s4",color:"inherit",children:"function"==typeof n.label?n.label(Pe):n.label})}))})]})]}),
27
- /* @__PURE__ */e.jsx(h.ConfirmPopUp,{open:Boolean(on),onClose:()=>an(null),onConfirm:()=>(async()=>{tn(!0),on&&(await(null==se?void 0:se(on)),an(null)),tn(!1)})(),title:"Delete Item",description:"Are you sure you want to delete entry ?",loading:nn})]})});exports.MaterialEditableTable=W,exports.default=W;
26
+ /* @__PURE__ */e.jsx("div",{className:"dropdown-inner--DestructiveHeader",children:null==X?void 0:X.map(n=>/* @__PURE__ */e.jsx(q.default,{onClick:()=>{n.handleAction(Ee),Ne(null)},className:"dropdown-inner--DestructiveActions",disabled:"function"==typeof n.disabled?n.disabled(Ee):Boolean(n.disabled),children:/* @__PURE__ */e.jsx(l.Typography,{type:"s4",color:"inherit",children:"function"==typeof n.label?n.label(Ee):n.label})}))})]})]}),
27
+ /* @__PURE__ */e.jsx(g.ConfirmPopUp,{open:Boolean(on),onClose:()=>tn(null),onConfirm:()=>(async()=>{nn(!0),on&&(await(null==se?void 0:se(on)),tn(null)),nn(!1)})(),title:"Delete Item",description:"Are you sure you want to delete entry ?",loading:en})]})});exports.MaterialEditableTable=W,exports.default=W;
28
28
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../src/components/material-editable-table/material-editable-table.tsx"],"sourcesContent":["/* eslint-disable unused-imports/no-unused-vars */\n/* eslint-disable @typescript-eslint/no-unused-vars */\n/* eslint-disable no-mixed-spaces-and-tabs */\nimport React, { cloneElement, useCallback, useEffect, useState } from 'react';\nimport {\n\tMRT_ColumnDef,\n\tMRT_ColumnSizingInfoState,\n\tMRT_ColumnSizingState,\n\tMRT_Header,\n\tMRT_Row,\n\tMRT_RowData,\n\tMRT_RowSelectionState,\n\tMRT_SortingState,\n\tMRT_TableInstance,\n\tMRT_TableState,\n\tMaterialReactTable,\n\tMaterialReactTableProps,\n\tuseMaterialReactTable,\n\t// Cell\n} from 'material-react-table';\nimport { IPaginationModel } from '../../@types/pagination-model';\nimport {\n\tBox,\n\tstyled,\n\tMenuItem,\n\tIconButton,\n\tListItemIcon,\n\tListItemText,\n\tSvgIconProps,\n\tDivider\n} from '@mui/material';\nimport ChevronRightIcon from '@mui/icons-material/ChevronRight';\nimport ChevronLeftIcon from '@mui/icons-material/ChevronLeft';\nimport Menu from '../menu/menu';\nimport Typography from '../typography/typography';\nimport SearchBar from '../search-bar/search-bar';\nimport images from '../../assets/images';\n// import DeleteIcon from \"@mui/icons-material/Delete\";\n// import UpdateIcon from \"@mui/icons-material/Update\";\n// import PlayIcon from \"@mui/icons-material/PlayArrow\";\n\nimport './material-editable-table.scss';\nimport {\n\tArrowUpDown,\n\tCheckBoxIcon,\n\tClose,\n\tRecgtangleIcon,\n\tTrash,\n\tSave\n} from '../icons';\n// import {\n// \tArrowDropDown /* , SaveOutlined */,\n// \tArrowDropUp\n// } from '@mui/icons-material';\nimport InlineEditFields from './components/inline-edit-fields';\nimport Tooltip from '../tooltip/Tooltip';\nimport Button from '../button/button';\nimport Add from '@mui/icons-material/Add';\nimport dayjs from 'dayjs';\nimport * as yup from 'yup';\nimport ConfirmPopUp from '../confirm-modal/confirm-modal';\nimport { useTranslation } from 'react-i18next';\nimport { enqueueSnackbar } from 'notistack';\nimport { usePages } from '../../hooks/use-pages';\nimport { useNavigate } from 'react-router-dom';\n// import { PathnameAccounting } from 'accounting/src/pathname.accounting';\n// import { PathnameInventory } from 'inventory/src/pathname.inventory';\n// import { PathnameManufacturing } from 'manufacturing/src/pathname.manufacturing';\n// import { PathnamePurchase } from 'procurement/src/pathname.procurement';\n// import { PathnameCrm } from 'crm/src/pathname.crm';\n// import { PathnameUsers } from '../../constants/pathnames/pathname.user';\n// import { PathnameRental } from '../../../../rental/src/pathname.rental';\n// import { PathnameDocument } from 'document/src/pathname.document';\nimport { PathnameDocument } from '../../constants/pathnames/pathname.document';\nimport { PathnameAccounting } from '../../constants/pathnames/pathname.accounting';\nimport { PathnameInventory } from '../../constants/pathnames/pathname.inventory';\nimport { PathnameManufacturing } from '../../constants/pathnames/pathname.manufacturing';\nimport { PathnamePurchase } from '../../constants/pathnames/pathname.procurement';\nimport { PathnameCrm } from '../../constants/pathnames/pathname.crm';\nimport { PathnameUsers } from '../../constants/pathnames/pathname.user';\nimport { PathnameRental } from '../../constants/pathnames/pathname.rental';\nimport useDeepMemo from '../../hooks/use-deep-memo';\nimport { PageState } from '../../contexts/page-context';\n\ntype ExtraEditVariants =\n\t| 'file'\n\t| 'image'\n\t| 'date'\n\t| 'number'\n\t| 'time'\n\t| 'date_time'\n\t| 'phone'\n\t| 'checkbox';\n\ntype DisableFunction = (row: any, virtualRow?: any) => boolean;\n\nexport type TypeBooleanLabels = { 1: string; 0: string; true: string; false: string }\n\nexport interface MaterialEditableTableColumnProps\n\textends Omit<MRT_ColumnDef<MRT_RowData>, 'editVariant'> {\n\tvisible?: boolean;\n\ttype?: string;\n\tshowDefaultCurrency?: boolean,\n\tvalueGet?: string;\n\tcustom_class?: string;\n\ttypeArrayAccessorKey?: string; //when type is an array of object\n\ttypeBooleanLabels?: TypeBooleanLabels; //when type is an boolean\n\teditVariant?: MRT_ColumnDef<MRT_RowData>['editVariant'] | ExtraEditVariants;\n\teditProperties?: {\n\t\tfield_name?: string;\n\t\tvalueKey?: string;\n\t\tplaceholder?: string;\n\t\tdateFormat?: string;\n\t\tvalidations?: any[];\n\t\tis_multiple?: boolean;\n\t\tis_multiline?: boolean;\n\t\tdisable?: boolean | DisableFunction;\n\t};\n\tredirectionPathWithId?: string;\n\tidField?: string;\n\tisOnClickEditable?: boolean; // Controls whether clicking this column triggers row edit mode (default: true)\n}\n\n\n\nexport interface MaterialEditableTableColumnHeaderProps {\n\tcolumn: MRT_ColumnDef<any, any>;\n\theader: MRT_Header<any>;\n\ttable: MRT_TableInstance<any>;\n}\n\ntype rowSelectionCallback = (row: MRT_Row) => boolean\n\ninterface MaterialEditableTablePropsType {\n\tenablePagination?: boolean;\n\trows: any;\n\ttotalPages: number;\n\tcolumns: any;\n\tpaginationModel: IPaginationModel;\n\tcolumnOrder?: string[];\n\tupdateData?: any;\n\thandleColumnOrdering?: (colOrder: any) => void;\n\tenableEditing?: boolean;\n\tenableColumnDragging?: boolean;\n\trowActionMenu?: any;\n\tdestructiveActionMenu?: any;\n\tgetRowId?: any;\n\tstates?: Partial<MRT_TableState<any>>;\n\tonSortingChange?: any;\n\tdisableDefaultActionColumn?: boolean;\n\tenableRowSelection?: boolean | rowSelectionCallback;\n\tdefaultActionColumnItems?: React.ReactElement[];\n\tenableBottomToolbar?: boolean;\n\tSetSelectedRowId?: any;\n\tisResetRow?: boolean;\n\tonCreateRow?: (data: any) => Promise<unknown>;\n\tonEditRow?: (data: any) => Promise<unknown>;\n\tonDeleteRow?: (data: any) => Promise<unknown>;\n\teditDisplayMode?: MaterialReactTableProps<any>['editDisplayMode'];\n\tenableRowCreate?: boolean;\n\tonChangeRowField?: (e: any, type: string, row: any) => void;\n\tonSelectRow?: (rows: any, prevSelected?: any) => any;\n\tenableColumnResizing?: boolean;\n\tselectedRowIds?: any[];\n\tonColumnVisibility?: (columns: MaterialTableColumnProps[]) => void\n\tgetSelectedData: any;\n\tenableAddCustomField?: boolean;\n\tdisabledDefaultActionColumnIcon?: boolean\n\tenableRowDragging?: boolean\n\thandleColumnResizing?: (sizes: MRT_ColumnSizingState) => void,\n\tcolumnSizes?: MRT_ColumnSizingState,\n\thideSaveButton?: boolean;\n}\n\nconst TableWrapper = styled(Box)(({ theme: { palette } }) => ({\n\t'.MuiTableCell-root': {\n\t\tborder: '1px solid #efefef',\n\t\tborderBottom: 0,\n\t\tborderLeft: 0,\n\t\tpadding: '0.19rem 0.5rem',\n\t\tlineHeight: '19px',\n\t\tfontSize: '14px',\n\t\tminHeight: 40,\n\t\t// '&:first-child': {\n\t\t// \tborderLeft: '1px solid #efefef'\n\t\t// },\n\t\t// '&:last-child': {\n\t\t// \tborderBottom: '1px solid #efefef'\n\t\t// }\n\n\t},\n\t'.MuiTableCell-head': {\n\t\tbackgroundColor: palette.theme?.secondary[100]\n\t},\n\t'.MuiTableContainer-root': {\n\t\tmaxHeight: 'clamp(350px, 100vh - 200px, 9999px) !important',\n\t},\n\n\t'.MuiPaper-root': {\n\t\tboxShadow: 'none',\n\n\t},\n\t'.MuiPaginationItem-root': {\n\t\t'&.Mui-selected': {\n\t\t\tbackgroundColor: palette?.theme?.primary[700],\n\t\t\tcolor: 'white'\n\t\t}\n\t},\n\t'.MuiTableRow-root': {\n\t\t'&.Mui-selected': {\n\t\t\tbackgroundColor: `${palette?.theme?.primary[100]} !important`,\n\t\t\tcolor: 'white'\n\t\t}\n\t},\n\t'.MuiCheckbox-indeterminate': {\n\t\tcolor: `${palette?.theme?.primary[700]} !important`,\n\t\t\"& svg\": {\n\t\t\theight: `20px !important`,\n\t\t\twidth: `20px !important`,\n\t\t}\n\t}\n}));\n\nconst MaterialEditableTable = React.memo(({\n\tenablePagination = false,\n\trows,\n\tcolumns,\n\ttotalPages,\n\tpaginationModel,\n\tcolumnOrder,\n\tupdateData,\n\thandleColumnOrdering,\n\tenableEditing,\n\tenableColumnDragging,\n\tstates,\n\trowActionMenu,\n\tdestructiveActionMenu,\n\tdisableDefaultActionColumn,\n\tenableRowSelection,\n\tdefaultActionColumnItems = [],\n\tenableBottomToolbar,\n\tSetSelectedRowId,\n\tisResetRow,\n\tonCreateRow,\n\tonEditRow,\n\tonDeleteRow,\n\teditDisplayMode,\n\tenableRowCreate,\n\tonChangeRowField,\n\tonSelectRow,\n\tenableColumnResizing = true,\n\tselectedRowIds = [],\n\tonColumnVisibility,\n\tonSortingChange,\n\tgetSelectedData,\n\tdisabledDefaultActionColumnIcon = false,\n\tenableAddCustomField = true,\n\tenableRowDragging = false,\n\thandleColumnResizing = () => { },\n\tcolumnSizes = {},\n\thideSaveButton = false,\n\t// eslint-disable-next-line unused-imports/no-unused-vars, @typescript-eslint/no-unused-vars\n\t// getRowId,\n\t// onDelete,\n\t// onUpdate,\n\t...rest\n}: MaterialTablePropsType) => {\n\tconst { t } = useTranslation();\n\tconst { formData = null, updatePageInfo, activePage: aPage } = usePages()\n\tconst activePage = useDeepMemo<PageState>(aPage);\n\tconst { pageNo } = paginationModel;\n\tconst [row, setRow] = useState({});\n\tconst [tableColumns, setTableColumns] = useState(columns);\n\tconst [anchorEl, setAnchorEl] = useState<null | HTMLElement>(null);\n\tconst [popUpShow, setPopupShow] = useState<boolean>(false);\n\tconst [rowAnchorEl, setRowAnchorEl] = useState<null | HTMLElement>(null);\n\tconst visibleColumns = tableColumns.filter((column: any) => column.visible);\n\tconst hiddenColumns = tableColumns.filter((column: any) => !column.visible);\n\tconst [filteredOptions, setFilteredOptions] = useState(hiddenColumns);\n\tconst [selectedRow, setSelectedRow] = useState<number | null>(null);\n\tconst [validationErrors, setValidationErrors] = useState<any>({});\n\tconst [validationSchema, setValidationSchema] = useState<any>([]);\n\tconst [isCreatingRow, setIsCreatingRow] = useState<boolean>(false);\n\tconst [isEditingRow, setIsEditingRow] = useState<boolean>(false);\n\tconst [isDeletingRow, setIsDeletingRow] = useState<boolean>(false);\n\tconst [rowToDelete, setRowToDelete] = useState<any>(null);\n\tconst [rowSelection, setRowSelection] = useState<MRT_RowSelectionState>({});\n\tconst [isChecked, setIsChecked] = useState(false)\n\tconst [sorting, setSorting] = useState<MRT_SortingState>([]);\n\tconst [disableNextEdit, setDisableNextEdit] = useState(false);\n\tconst [columnSizing, setColumnSizing] = useState<MRT_ColumnSizingState>(activePage.column_sizes);\n\tconst [columnSizingInfo, setColumnSizingInfo] = useState<MRT_ColumnSizingInfoState>({\n\t\tcolumnSizingStart: [],\n\t\tdeltaOffset: null,\n\t\tdeltaPercentage: null,\n\t\tisResizingColumn: false,\n\t\tstartOffset: null,\n\t\tstartSize: null\n\t});\n\tconst [clickStartTime, setClickStartTime] = useState<number>(0);\n\n\tconst navigate = useNavigate();\n\tconst currentModule = location.pathname.split('/')[2]\n\n\tlet redirectionPath = ''\n\tswitch (currentModule) {\n\t\tcase 'accounting':\n\t\t\tredirectionPath = PathnameAccounting.CUSTOM_FORM\n\t\t\tbreak;\n\t\tcase 'inventory':\n\t\t\tredirectionPath = PathnameInventory.CUSTOM_FORM\n\t\t\tbreak;\n\t\tcase 'manufacturing':\n\n\t\t\tredirectionPath = PathnameManufacturing.CUSTOM_FORM\n\t\t\tbreak;\n\t\tcase 'procurement':\n\t\t\tredirectionPath = PathnamePurchase.CUSTOM_FORM\n\t\t\tbreak;\n\t\tcase 'crm':\n\t\t\tredirectionPath = PathnameCrm.CUSTOM_FORM\n\t\t\tbreak;\n\t\tcase 'user':\n\t\t\tredirectionPath = PathnameUsers.CUSTOM_FORM\n\t\t\tbreak;\n\t\tcase 'rental':\n\t\t\tredirectionPath = PathnameRental.CUSTOM_FORM\n\t\t\tbreak;\n\t\tcase 'drive':\n\t\t\tredirectionPath = PathnameDocument.ADD_CUSTOM_FIELDS\n\t\t\tbreak;\n\t}\n\tconst path = `/dashboard/${currentModule}${redirectionPath}`\n\tconst getValidationType = (column: any) => {\n\t\tswitch (column.editVariant) {\n\t\t\tcase 'select':\n\t\t\t\treturn column?.editProperties?.is_multiple ? yup.array() : yup.string();\n\n\t\t\tcase 'number':\n\t\t\t\treturn yup.number().nullable().transform((value, originalValue) => (originalValue === \"\" ? null : value));\n\n\t\t\tcase 'url':\n\t\t\t\treturn yup\n\t\t\t\t\t.string()\n\t\t\t\t\t.matches(\n\t\t\t\t\t\t/^(https?:\\/\\/)?((([a-zA-Z0-9_-]+\\.)+[a-zA-Z]{2,})|localhost)(:\\d{2,5})?(\\/[a-zA-Z0-9#_-]+\\/?)*(\\?[a-zA-Z0-9&=_-]+)?(#\\S+)?$/,\n\t\t\t\t\t\t{ excludeEmptyString: true, message: 'Please enter valid URL.' }\n\t\t\t\t\t);\n\n\t\t\tdefault:\n\t\t\t\treturn yup.string()\n\t\t}\n\t};\n\n\tconst validationReducer = (\n\t\tvalidations: any,\n\t\tvalidation: any,\n\t\tcolumn: any\n\t) => {\n\t\tlet vld = validations\n\t\tswitch (validation.type) {\n\t\t\tcase 'required':\n\t\t\t\tvld = validation.value\n\t\t\t\t\t? validations.required(validation.msg_en).typeError(validation.msg_en)\n\t\t\t\t\t: column?.editProperties?.is_multiple\n\t\t\t\t\t\t? validations.min(1, validation.msg_en)\n\t\t\t\t\t\t: validations;\n\t\t\t\tbreak\n\t\t\tcase 'min':\n\t\t\t\tvld = validations.min(validation.value, validation.msg_en);\n\t\t\t\tbreak\n\t\t\tcase 'email':\n\t\t\t\tvld = validations.email(validation.value, validation.msg_en);\n\t\t\t\tbreak\n\t\t\tcase 'max':\n\t\t\t\tvld = validations.max(validation.value, validation.msg_en);\n\t\t\t\tbreak\n\t\t\tcase 'positive':\n\t\t\t\tvld = validation.value === true ? validations.test('is-positive-number', 'Value must be a positive number', (value) => !value || value >= 0) : validations;\n\t\t\t\tbreak\n\t\t\tcase 'when':\n\t\t\t\treturn validations.when(validation.relation, {\n\t\t\t\t\tis: (val: any) => val === validation.values,\n\t\t\t\t\tthen: () =>\n\t\t\t\t\t\tvalidation?.thenValidations?.reduce(\n\t\t\t\t\t\t\t(validations: any, validation: any) =>\n\t\t\t\t\t\t\t\tvalidationReducer(validations, validation, column),\n\t\t\t\t\t\t\tvalidations\n\t\t\t\t\t\t) || validations,\n\t\t\t\t\totherwise: () =>\n\t\t\t\t\t\tvalidation?.otherWiseValidations?.reduce(\n\t\t\t\t\t\t\t(validations: any, validation: any) =>\n\t\t\t\t\t\t\t\tvalidationReducer(validations, validation, column),\n\t\t\t\t\t\t\tvalidations\n\t\t\t\t\t\t) || validations\n\t\t\t\t});\n\t\t\t// Add more cases for other validation types as needed\n\t\t\tdefault:\n\t\t\t\tvld = validations;\n\t\t\t\tbreak\n\t\t}\n\n\t\tif (validation.type == 'required' && validation.value && (!column?.editVariant || column?.editVariant == 'text')) {\n\t\t\tvld = validations.test('no-blank-spaces', 'Blank space is not allowed', (value) => {\n\t\t\t\treturn value && value.trim()?.length > 0;\n\t\t\t})\n\t\t}\n\n\t\treturn vld\n\n\t};\n\n\n\tconst generateValidationSchema = (columns: any[]) => {\n\t\tconst schema: any = {};\n\t\tcolumns.forEach((clm) => {\n\t\t\tif (clm?.editProperties?.validations?.length) {\n\t\t\t\tconst fieldValidations = clm?.editProperties?.validations.reduce(\n\t\t\t\t\t(validations: any, validation: any) =>\n\t\t\t\t\t\tvalidationReducer(validations, validation, clm),\n\t\t\t\t\tgetValidationType(clm)\n\t\t\t\t);\n\t\t\t\tschema[clm.accessorKey] = fieldValidations;\n\t\t\t}\n\t\t});\n\t\treturn schema;\n\t};\n\n\tuseEffect(() => {\n\t\tsetTableColumns(columns);\n\n\t\tconst schema: any = generateValidationSchema(columns);\n\t\tsetValidationSchema(yup.object().shape(schema));\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [columns]);\n\n\tuseEffect(() => {\n\t\tif (!columnSizingInfo?.isResizingColumn) {\n\t\t\tupdatePageInfo({ column_sizes: { ...activePage.column_sizes, ...columnSizing } })\n\t\t\thandleColumnResizing?.(columnSizing)\n\t\t}\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [columnSizingInfo?.isResizingColumn, columnSizing])\n\n\tconst handleHeaderClick = (event: any) => {\n\t\tsetAnchorEl(event.currentTarget);\n\t};\n\n\tconst handleHeaderClose = () => {\n\t\tsetAnchorEl(null);\n\t};\n\n\tconst handleVisibleColumn = (column: any) => {\n\t\tconst updatedColumns = tableColumns.map((col: any) => ({\n\t\t\t...col,\n\t\t\tvisible: col.accessorKey === column.accessorKey ? false : col.visible\n\t\t}));\n\t\tsetTableColumns(updatedColumns);\n\t\tonColumnVisibility?.(JSON.parse(JSON.stringify(updatedColumns)))\n\t\tsetFilteredOptions([...filteredOptions, column]);\n\t\tsetAnchorEl(null);\n\t};\n\n\tconst handleAddButtonClick = () => {\n\t\tsetPopupShow(true);\n\t};\n\n\tconst handleBackButtonClick = () => {\n\t\tsetPopupShow(false);\n\t};\n\n\tconst handleAddColumn = (column: any) => {\n\t\tconst updatedColumns = tableColumns.map((col: any) => ({\n\t\t\t...col,\n\t\t\tvisible: col.accessorKey === column.accessorKey ? true : col.visible\n\t\t}));\n\t\tonColumnVisibility?.(JSON.parse(JSON.stringify(updatedColumns)))\n\t\tsetTableColumns(updatedColumns);\n\n\t\tconst updatedFilteredOptions = filteredOptions.filter(\n\t\t\t(option: any) => option.accessorKey !== column.accessorKey\n\t\t);\n\t\tsetFilteredOptions(updatedFilteredOptions);\n\t\tsetAnchorEl(null);\n\t\tsetPopupShow(false);\n\t};\n\n\tconst handleSearchEvent = (searchQuery: string) => {\n\t\tconst filteredColumns = hiddenColumns.filter((option: any) =>\n\t\t\toption.header.toLowerCase().includes(searchQuery.toLowerCase())\n\t\t);\n\t\tsetFilteredOptions(filteredColumns);\n\t};\n\n\tconst handleCustomAddColumn = () => {\n\t\tnavigate(path, { state: formData })\n\t\tsetAnchorEl(null);\n\t\tsetPopupShow(false);\n\t};\n\n\tconst handleRowClick = (rowId: number) => {\n\t\tsetSelectedRow(rowId); // Update selected row ID when a row is clicked\n\t};\n\n\t// const handleDeleteClick = (event: any, data: any) => {\n\t// onDelete?.(data.id);\n\t// };\n\t// const handleUpdateClick = (event: any, data: any) => {\n\t// onUpdate?.(data.id);\n\t// };\n\n\tconst handleActionsClick = (event: any, data: any) => {\n\t\tsetRow(data);\n\t\tsetRowAnchorEl(event.currentTarget);\n\t};\n\n\tconst handleActionsClose = () => {\n\t\tsetRowAnchorEl(null);\n\t};\n\n\tconst formtValues = useCallback((values: any, cells: any[]) => {\n\t\tconst v: any = {};\n\t\tObject.keys(values).forEach((vl) => {\n\t\t\tconst val = values[vl];\n\t\t\tconst cell = cells.find((c) => c.accessorKey == vl);\n\n\t\t\tif (val) {\n\t\t\t\tif (val instanceof File) {\n\t\t\t\t\tv[vl] = val.name;\n\t\t\t\t} else if (cell && cell?.editVariant == 'date') {\n\t\t\t\t\tv[vl] = dayjs(val).format(cell?.dateFormat || 'DD-MM-YYYY');\n\t\t\t\t} else if (cell && cell?.editVariant == 'select' && typeof val === 'object' && val !== null) {\n\t\t\t\t\t// For select fields, extract the display name from the object\n\t\t\t\t\t// Try multiple possible display properties in order of preference\n\t\t\t\t\tv[vl] = val.name || val.label || val.display_name || val.title || val.value || val.id || val;\n\t\t\t\t} else if (cell && cell?.editVariant == 'select' && typeof val === 'string') {\n\t\t\t\t\t// For select fields that are already strings, keep them as is\n\t\t\t\t\tv[vl] = val;\n\t\t\t\t} else {\n\t\t\t\t\tv[vl] = val;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tv[vl] = val;\n\t\t\t}\n\t\t});\n\n\t\treturn v;\n\t}, []); // No dependencies needed as this function doesn't rely on external values\n\n\tconst handleRowDelete = async () => {\n\t\tsetIsDeletingRow(true);\n\t\tif (rowToDelete) {\n\t\t\tawait onDeleteRow?.(rowToDelete);\n\t\t\tsetRowToDelete(null);\n\t\t}\n\t\tsetIsDeletingRow(false);\n\t};\n\n\tconst checkRequired = useCallback((editProperties: any) => {\n\t\treturn editProperties?.validations?.some((validation: any) => validation.type === 'required')\n\t}, [])\n\tuseEffect(() => {\n\t\tconst selectedRows = {};\n\t\t// Build the selectedRows object\n\t\tif (!isChecked && selectedRowIds.length) {\n\t\t\trows.forEach((row) => {\n\t\t\t\tif (selectedRowIds.includes(row.id)) {\n\t\t\t\t\tselectedRows[row.id] = true;\n\t\t\t\t}\n\t\t\t});\n\t\t\tsetRowSelection(selectedRows);\n\t\t\tsetIsChecked(true)\n\t\t}\n\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [rows, selectedRowIds]); // Dependency only on rows and selectedRowIds\n\n\tuseEffect(() => {\n\t\tif (onSortingChange instanceof Function) {\n\t\t\tconst sortingArray = Array.isArray(sorting) ? sorting : [];\n\t\t\tonSortingChange(sortingArray[0] || null)\n\t\t}\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [sorting])\n\n\n\tconst resetRowSelection = () => {\n\t\tsetRowSelection({});\n\t\tsetDisableNextEdit(false)\n\t}\n\tconst getTextWidth = (text: string) => {\n\t\tconst canvas = document.createElement(\"canvas\");\n\t\tconst ctx = canvas.getContext(\"2d\");\n\t\tif (!ctx) return 50;\n\t\treturn ctx.measureText(text).width + 5; // padding\n\t}\n\n\tconst handleSaveRow = useCallback(async (row: any, values: any, tableInstance: any) => {\n\t\tconsole.log('handleSaveRow', onEditRow);\n\t\ttry {\n\t\t\tawait validationSchema.validate(values, {\n\t\t\t\tabortEarly: false\n\t\t\t});\n\t\t\tsetValidationErrors({});\n\t\t\tsetIsEditingRow(true);\n\t\t\tsetDisableNextEdit(false)\n\t\t\tconst cells = row.getAllCells().map((c: any) => c.column.columnDef);\n\t\t\trow._valuesCache = formtValues(values, cells);\n\n\t\t\tconst data = { row, values, table: tableInstance };\n\n\t\t\tif (onEditRow) {\n\t\t\t\tawait onEditRow(data, 'edit');\n\t\t\t}\n\t\t\tsetIsEditingRow(false);\n\t\t\ttableInstance.setEditingRow(null);\n\t\t} catch (err) {\n\t\t\tconsole.log(\"handleSaveRow error\", err);\n\t\t\tsetIsEditingRow(false);\n\t\t\tif (err instanceof yup.ValidationError) {\n\t\t\t\tconst errors: Record<string, string> = {};\n\n\t\t\t\terr.inner.forEach((error) => {\n\t\t\t\t\tif (error.path) {\n\t\t\t\t\t\terrors[error.path] = error.message;\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\tsetValidationErrors(errors);\n\t\t\t} else if (err instanceof Error) {\n\t\t\t\tenqueueSnackbar(err.message, { variant: 'error' })\n\t\t\t} else {\n\t\t\t\tenqueueSnackbar('Something went wrong', { variant: 'error' })\n\t\t\t}\n\t\t}\n\t}, [validationSchema, onEditRow, formtValues]);\n\n\tconst table = useMaterialReactTable({\n\t\t// options:{\n\t\t// \ttableLayout: \"auto\", // 👈 important\n\t\t// \tpadding: \"dense\",\n\t\t// },\n\t\t// columns: visibleColumns,\n\t\tdefaultColumn: {\n\t\t\tminSize: 0, // 👈 remove default min width\n\t\t\tsize: undefined, // 👈 optional, default size\n\t\t},\n\t\tcolumns: [\n\t\t\t...visibleColumns.map((c: any) => {\n\t\t\t\tconst headerWidth = getTextWidth(c.header || '');\n\t\t\t\tconst maxCellWidth = Math.max(\n\t\t\t\t\t...rows.map(row => getTextWidth(String(row[c.accessorKey] ?? '')))\n\t\t\t\t);\n\t\t\t\tconst finalWidth = Math.max(headerWidth, maxCellWidth);\n\t\t\t\treturn {\n\t\t\t\t\t...c,\n\t\t\t\t\t...(editDisplayMode === 'row'\n\t\t\t\t\t\t? {\n\t\t\t\t\t\t\tEdit: ({ cell, row, table, column }) => {\n\t\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t\t<InlineEditFields\n\t\t\t\t\t\t\t\t\t\tcell={cell}\n\t\t\t\t\t\t\t\t\t\tcolumn={column}\n\t\t\t\t\t\t\t\t\t\tcol={c}\n\t\t\t\t\t\t\t\t\t\trow={row}\n\t\t\t\t\t\t\t\t\t\ttable={table}\n\t\t\t\t\t\t\t\t\t\tcallback={(s) => console.log('Save', s)}\n\t\t\t\t\t\t\t\t\t\terrors={validationErrors}\n\t\t\t\t\t\t\t\t\t\tvalidationSchema={validationSchema}\n\t\t\t\t\t\t\t\t\t\tsetValidationErrors={setValidationErrors}\n\t\t\t\t\t\t\t\t\t\tonChangeRowField={onChangeRowField}\n\t\t\t\t\t\t\t\t\t\tgetSelectedData={(name, row) => getSelectedData?.(name, row)}\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t}\n\t\t\t\t\t\t: {}),\n\t\t\t\t\tHeader: (\n\t\t\t\t\t\t<Box display='flex' alignItems='center'>\n\t\t\t\t\t\t\t{c.header}\n\t\t\t\t\t\t\t{c?.required || checkRequired(c?.editProperties) && (\n\t\t\t\t\t\t\t\t<Typography type='s5' color='theme.error.600'>\n\t\t\t\t\t\t\t\t\t*\n\t\t\t\t\t\t\t\t</Typography>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t</Box>\n\t\t\t\t\t),\n\t\t\t\t\tenableColumnDragging: c.id !== 'actions',\n\t\t\t\t\t// cellStyle: { ...c.cellStyle, width: finalWidth },\n\t\t\t\t\t// headerStyle: { ...c.headerStyle, width: finalWidth },\n\t\t\t\t\t// size: finalWidth\n\t\t\t\t\tsize: undefined,\n\t\t\t\t\t// minSize: 40,\n\t\t\t\t\tmaxSize: 800,\n\t\t\t\t};\n\t\t\t}),\n\t\t\t...(!disableDefaultActionColumn\n\t\t\t\t? [\n\t\t\t\t\t{\n\t\t\t\t\t\tid: 'actions',\n\t\t\t\t\t\tenableEditing: false,\n\t\t\t\t\t\tsize: defaultActionColumnItems?.length > 1 ? 80 : 50,\n\t\t\t\t\t\theader: (\n\t\t\t\t\t\t\t<IconButton size=\"small\" sx={{ p: 0.5, '&:hover': { backgroundColor: 'transparent' } }} onClick={handleHeaderClick}>\n\t\t\t\t\t\t\t\t<img src={images.common.arrowIcon} alt='Arrow Icon' />\n\t\t\t\t\t\t\t</IconButton>\n\t\t\t\t\t\t),\n\t\t\t\t\t\tenableColumnDragging: false,\n\t\t\t\t\t\tvisible: true,\n\t\t\t\t\t\tmuiTableHeadCellProps: {\n\t\t\t\t\t\t\tclassName: 'pinned-column'\n\t\t\t\t\t\t},\n\t\t\t\t\t\tmuiTableBodyCellProps: {\n\t\t\t\t\t\t\tclassName: 'pinned-column',\n\t\t\t\t\t\t\tsx: {\n\t\t\t\t\t\t\t\twhiteSpace: 'pre-wrap'\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\t\t\t\t\tCell: (props) =>\n\t\t\t\t\t\t\tdefaultActionColumnItems?.length ? (\n\t\t\t\t\t\t\t\tdefaultActionColumnItems.map((item) => {\n\t\t\t\t\t\t\t\t\tconst updatedProps = {\n\t\t\t\t\t\t\t\t\t\t...item.props,\n\t\t\t\t\t\t\t\t\t\tonClick: () => item.props.onClick(props)\n\t\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t\t\treturn cloneElement(item, updatedProps);\n\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t) : !disabledDefaultActionColumnIcon && (\n\t\t\t\t\t\t\t\t<IconButton\n\t\t\t\t\t\t\t\t\tonClick={(e) => handleActionsClick(e, props.row.original)} disabled={!rowActionMenu?.length && !destructiveActionMenu?.length}>\n\t\t\t\t\t\t\t\t\t<img src={images.more} alt='More Icon' />\n\t\t\t\t\t\t\t\t</IconButton>\n\t\t\t\t\t\t\t)\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t\t: [])\n\t\t],\n\t\tdata: rows,\n\t\tmuiTablePaperProps: {\n\t\t\tsx: {\n\t\t\t\ttableLayout: 'auto', // lets columns shrink to fit content\n\t\t\t},\n\t\t},\n\t\tcolumnResizeMode: 'onChange',\n\t\tonEditingRowSave: async (data) => {\n\t\t\tawait handleSaveRow(data.row, data.values, data.table);\n\t\t},\n\t\tonCreatingRowSave: async (data) => {\n\t\t\ttry {\n\t\t\t\tawait validationSchema.validate(data.values, {\n\t\t\t\t\tabortEarly: false\n\t\t\t\t});\n\t\t\t\tsetValidationErrors({});\n\t\t\t\tsetIsCreatingRow(true);\n\t\t\t\tsetDisableNextEdit(false)\n\t\t\t\tconst cells = data.row.getAllCells().map((c) => c.column.columnDef);\n\n\t\t\t\tdata.row._valuesCache = formtValues(data.values, cells);\n\n\t\t\t\tif (onCreateRow) {\n\t\t\t\t\tawait onCreateRow(data);\n\t\t\t\t}\n\t\t\t\tsetIsCreatingRow(false);\n\t\t\t\tdata.table.setCreatingRow(null);\n\t\t\t} catch (err) {\n\t\t\t\tsetIsCreatingRow(false);\n\t\t\t\tif (err instanceof yup.ValidationError) {\n\t\t\t\t\tconst errors: Record<string, string> = {};\n\n\t\t\t\t\terr.inner.forEach((error) => {\n\t\t\t\t\t\tif (error.path) {\n\t\t\t\t\t\t\terrors[error.path] = error.message;\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t\tsetValidationErrors(errors);\n\t\t\t\t} else if (err instanceof Error) {\n\t\t\t\t\tenqueueSnackbar(err.message, { variant: 'error' })\n\t\t\t\t} else {\n\t\t\t\t\tenqueueSnackbar('Something went wrong', { variant: 'error' })\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\tonCreatingRowCancel: () => resetRowSelection(),\n\t\tonEditingRowCancel: () => {\n\t\t\tconsole.log('onEditingRowCancel called');\n\t\t\tsetDisableNextEdit(false);\n\t\t},\n\t\tonSortingChange: states?.sorting ? onSortingChange : setSorting,\n\n\t\tdisplayColumnDefOptions: {\n\t\t\t'mrt-row-actions': {\n\t\t\t\t// size: onDeleteRow ? 80 : 50,\n\n\t\t\t\tHeader: (\n\t\t\t\t\t<IconButton onClick={handleHeaderClick} size='small'>\n\t\t\t\t\t\t<img src={images.common.arrowIcon} alt='Arrow Icon' />\n\t\t\t\t\t</IconButton>\n\t\t\t\t),\n\t\t\t\tmuiTableBodyCellProps: ({ row, table }) => {\n\t\t\t\t\tconst isCreatingRow = table.getState().creatingRow?.id === row.id;\n\t\t\t\t\tconst isEditingRow = table.getState().editingRow?.id === row.id;\n\t\t\t\t\treturn {\n\t\t\t\t\t\tsx: {\n\t\t\t\t\t\t\t'& .MuiBox-root': {\n\t\t\t\t\t\t\t\tgap: 0\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tbackgroundColor: '#fff',\n\t\t\t\t\t\t\twhiteSpace: 'pre-wrap',\n\t\t\t\t\t\t\t// Hide save button only when editing existing row (not in create mode or non-editable mode)\n\t\t\t\t\t\t\t...((hideSaveButton && (isEditingRow || isCreatingRow))\n\t\t\t\t\t\t\t\t? {\n\t\t\t\t\t\t\t\t'& .MuiBox-root > .MuiIconButton-root:first-of-type': {\n\t\t\t\t\t\t\t\t\tdisplay: 'none !important'\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t// Also hide any save icon buttons by aria-label or title\n\t\t\t\t\t\t\t\t'& button[aria-label*=\"Save\"]': {\n\t\t\t\t\t\t\t\t\tdisplay: 'none !important'\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t'& button[title*=\"Save\"]': {\n\t\t\t\t\t\t\t\t\tdisplay: 'none !important'\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t// Hide save icon by class or data attributes\n\t\t\t\t\t\t\t\t'& .MuiIconButton-root[class*=\"save\"]': {\n\t\t\t\t\t\t\t\t\tdisplay: 'none !important'\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t'& .MuiIconButton-root[data-testid*=\"save\"]': {\n\t\t\t\t\t\t\t\t\tdisplay: 'none !important'\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t: {})\n\t\t\t\t\t\t},\n\t\t\t\t\t\tonKeyUp: (e) => console.log(e)\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t},\n\t\t\t'mrt-row-expand': {\n\t\t\t\tsize: 70, // Set the size of the expand-collapse arrow column here\n\t\t\t},\n\t\t\t'mrt-row-select': {\n\t\t\t\tsize: 50, // Set the width of the checkbox column here\n\t\t\t},\n\t\t},\n\t\trenderRowActions: ({ row, table }) => (\n\t\t\t<>\n\t\t\t\t{rest?.enableExpanding ? (\n\t\t\t\t\t<>\n\t\t\t\t\t\t{row?.parentId && (\n\t\t\t\t\t\t\t<Box sx={{ display: 'flex', gap: 0 }}>\n\t\t\t\t\t\t\t\t{onDeleteRow && (\n\t\t\t\t\t\t\t\t\t<Tooltip title='Delete'>\n\t\t\t\t\t\t\t\t\t\t<IconButton disabled={disableNextEdit} onClick={() => setRowToDelete(row)} size='small'>\n\t\t\t\t\t\t\t\t\t\t\t<Trash fontSize='small' sx={{ color: 'theme.secondary.1000' }} />\n\t\t\t\t\t\t\t\t\t\t</IconButton>\n\t\t\t\t\t\t\t\t\t</Tooltip>\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t</Box>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</>\n\t\t\t\t) : (\n\t\t\t\t\t<Box sx={{ display: 'flex', gap: 0 }}>\n\t\t\t\t\t\t{onDeleteRow && (\n\t\t\t\t\t\t\t<Tooltip title='Delete'>\n\t\t\t\t\t\t\t\t<IconButton disabled={disableNextEdit} onClick={() => setRowToDelete(row)}>\n\t\t\t\t\t\t\t\t\t<Trash fontSize='small' sx={{ color: 'theme.secondary.1000' }} />\n\t\t\t\t\t\t\t\t</IconButton>\n\t\t\t\t\t\t\t</Tooltip>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</Box>\n\t\t\t\t)}\n\t\t\t</>\n\t\t),\n\n\t\t...(Boolean(enableRowCreate) && {\n\t\t\trenderBottomToolbarCustomActions: ({ table }) => (\n\t\t\t\t<Button\n\t\t\t\t\tvariant='outlined'\n\t\t\t\t\tstartIcon={<Add />}\n\t\t\t\t\tclassName='add-row-btn'\n\t\t\t\t\tdisabled={disableNextEdit}\n\t\t\t\t\tonClick={() => {\n\t\t\t\t\t\ttable.setCreatingRow(true); //simplest way to open the create row modal with no default values\n\t\t\t\t\t\tsetDisableNextEdit(true)\n\t\t\t\t\t}}>\n\t\t\t\t\t{t('common.add')}\n\t\t\t\t</Button>\n\t\t\t)\n\t\t}),\n\t\tonRowSelectionChange: setRowSelection,\n\t\tenableColumnOrdering: true,\n\t\tenableRowSelection: enableRowSelection ?? true,\n\t\tenableEditing: enableEditing instanceof Function ? enableEditing() : enableEditing ?? true,\n\t\teditDisplayMode: editDisplayMode ?? 'row',\n\t\tcreateDisplayMode: 'row',\n\t\tenableColumnResizing: enableColumnResizing,\n\t\tenableRowDragging: enableRowDragging,\n\t\tenableTopToolbar: false,\n\t\tenableColumnActions: false,\n\t\tenableSorting: true,\n\t\tenableGrouping: true,\n\t\tenableBottomToolbar: enableBottomToolbar ?? false,\n\t\tenableColumnDragging: enableColumnDragging ?? true,\n\t\tenableStickyHeader: true,\n\t\tenableSortingRemoval: false,\n\t\t// column ordering\n\t\tstate: {\n\t\t\t// columnOrder: (!columnOrder || columnOrder.length <= 1) \n\t\t\t// ? [...internalColumnOrder] \n\t\t\t// : [...columnOrder],\n\t\t\tcolumnOrder: columnOrder,\n\t\t\tcolumnPinning: { left: ['actions', 'mrt-row-actions'] },\n\t\t\tisSaving: isCreatingRow || isEditingRow,\n\t\t\tshowProgressBars: false,\n\t\t\trowSelection,\n\t\t\t...states,\n\t\t\tsorting: Array.isArray(states?.sorting) ? states?.sorting :\n\t\t\t\tArray.isArray(sorting) ? sorting : [],\n\t\t\tcolumnSizing\n\n\t\t},\n\t\tgetRowId: (row) => row?.id,\n\t\t// table.getState().editingRow\n\t\tmuiTableBodyRowProps: ({ row, table }) => {\n\t\t\tconst editingRowId =\n\t\t\t\ttable.getState()?.editingRow?.id ||\n\t\t\t\ttable.getState()?.creatingRow?.id ||\n\t\t\t\tnull;\n\t\t\tconst creatingRowId = table.getState()?.creatingRow?.id || null;\n\t\t\tconst isErrorRow = Boolean(row?.original?.has_error)\n\t\t\tconst isCurrentlyEditing = editingRowId === row.id;\n\n\t\t\treturn {\n\t\t\t\tonClick: () => {\n\t\t\t\t\tsetSelectedRow(row.id);\n\t\t\t\t\t// Edit triggering is now handled at cell level in muiTableBodyCellProps\n\t\t\t\t\t// to support isOnClickEditable column prop\n\t\t\t\t},\n\t\t\t\tonKeyDown: (e) => {\n\t\t\t\t\t// Handle keyboard events for editing\n\t\t\t\t\tif (isCurrentlyEditing) {\n\t\t\t\t\t\tif (e.key === 'Enter') {\n\t\t\t\t\t\t\t// Save on Enter\n\t\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t\t\ttable.setEditingRow(null);\n\t\t\t\t\t\t} else if (e.key === 'Escape') {\n\t\t\t\t\t\t\t// Cancel on Escape\n\t\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t\t\tconsole.log('Escape pressed, canceling edit for row:', row.id);\n\t\t\t\t\t\t\tif (creatingRowId === row.id) {\n\t\t\t\t\t\t\t\ttable.setCreatingRow(null);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\ttable.setEditingRow(null);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t// Immediately reset disableNextEdit to allow re-editing\n\t\t\t\t\t\t\tsetDisableNextEdit(false);\n\t\t\t\t\t\t\tif (creatingRowId !== row.id) {\n\t\t\t\t\t\t\t\thandleSaveRow(row, row._valuesCache || row.original, table);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tsx: {\n\t\t\t\t\tcursor: 'pointer',\n\t\t\t\t\t// backgroundColor: !editingRowId\n\t\t\t\t\t// \t? (selectedRow === row.id\n\t\t\t\t\t// \t\t? '#e8e8e8'\n\t\t\t\t\t// \t\t: (isErrorRow ? 'theme.error.100' : 'inherit'))\n\t\t\t\t\t// \t: 'inherit',\n\t\t\t\t\tbackgroundColor: !editingRowId\n\t\t\t\t\t\t? (isErrorRow ? 'theme.error.100' : 'inherit')\n\t\t\t\t\t\t: 'inherit',\n\t\t\t\t\t'&:hover': {\n\t\t\t\t\t\tbackgroundColor: editingRowId ? 'transparent' : (isErrorRow ? 'theme.error.200' : '#e8e8e8') // Removes hover effect globally\n\t\t\t\t\t},\n\t\t\t\t\t'&:hover td:after': {\n\t\t\t\t\t\tbackgroundColor: 'transparent' // Removes the grey background applied via :after\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t};\n\t\t},\n\t\tonColumnOrderChange: (colOrder: any) => {\n\t\t\tif (handleColumnOrdering) handleColumnOrdering(colOrder);\n\t\t},\n\t\tonColumnSizingChange: setColumnSizing,\n\t\tonColumnSizingInfoChange: setColumnSizingInfo,\n\n\t\trenderEmptyRowsFallback: () => (\n\t\t\t<Box className='no-data'>\n\t\t\t\t<img src={images.common.tableNoData} />\n\t\t\t\t<Typography type='s3' weight='medium' color='theme.secondary.1000'>\n\t\t\t\t\t{/* sx={{ textAlign: 'center', pb: 4.75, pt: 4.75 }}> */}\n\t\t\t\t\t{t('common.noData')}\n\t\t\t\t</Typography>\n\t\t\t</Box>\n\t\t),\n\n\t\t// pagination\n\t\tenablePagination: enablePagination,\n\t\tpaginationDisplayMode: 'pages',\n\t\tmuiPaginationProps: {\n\t\t\tshape: 'rounded',\n\t\t\tpage: pageNo, // current page number\n\t\t\tcount: totalPages, // total pages\n\t\t\tshowRowsPerPage: false, // Hide rows per page options\n\t\t\tboundaryCount: 3\n\t\t},\n\n\t\tmuiEditTextFieldProps: ({ row, column }) => ({\n\t\t\tInputProps: {\n\t\t\t\tdisableUnderline: true\n\t\t\t},\n\t\t\tonBlur: (e) => {\n\t\t\t\tupdateData(e.target.value, column, row.id);\n\t\t\t},\n\t\t\t// onChange: (e) => {\n\t\t\t// \tupdateData(e.target.value, column, row.id);\n\t\t\t// },\n\t\t\tvariant: 'outlined',\n\t\t\tsx: ({ palette }) => ({\n\t\t\t\t'& .MuiOutlinedInput-root': {\n\t\t\t\t\t'& fieldset': {\n\t\t\t\t\t\tborderColor: `${palette.theme?.primary[700]} !important`\n\t\t\t\t\t\t// backgroundColor: palette.theme?.primary[700]\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t})\n\t\t}),\n\n\t\t/* Table loader style */\n\t\tmuiCircularProgressProps: {\n\t\t\tsx: {\n\t\t\t\tcolor: '#289B64'\n\t\t\t}\n\t\t},\n\n\t\t// Table header cell default styles\n\t\tmuiTableHeadCellProps: {\n\t\t\tsx: {\n\t\t\t\tlineHeight: '140%',\n\t\t\t\tletterSpacing: '-0.28px',\n\t\t\t\tfontWeight: '500',\n\t\t\t\tfontSize: '0.875rem',\n\t\t\t\t'& .Mui-TableHeadCell-Content': {\n\t\t\t\t\theight: '100%'\n\t\t\t\t},\n\t\t\t\t'& .Mui-TableHeadCell-Content-Labels': {\n\t\t\t\t\twidth: '100%',\n\t\t\t\t\tjustifyContent: 'space-between'\n\t\t\t\t},\n\t\t\t\t'&.pinned-column': {\n\t\t\t\t\tbackgroundColor: '#fff'\n\t\t\t\t},\n\t\t\t\t'& .Mui-TableHeadCell-ResizeHandle-Wrapper': {\n\t\t\t\t\tpadding: 0,\n\t\t\t\t\tmargin: 0,\n\t\t\t\t\tright: '-5px',\n\t\t\t\t\topacity: 0\n\t\t\t\t},\n\t\t\t}\n\t\t},\n\n\t\t// Table body cell default styles\n\t\tmuiTableBodyProps: {\n\t\t\tsx: {\n\t\t\t\tzIndex: 500\n\t\t\t}\n\t\t},\n\t\tmuiTableHeadProps: {\n\t\t\tsx: {\n\t\t\t\tzIndex: 600\n\t\t\t}\n\t\t},\n\t\tmuiTableBodyCellProps: ({ cell, column, table, row }) => ({\n\t\t\tsx: {\n\t\t\t\tlineHeight: '140%',\n\t\t\t\tletterSpacing: '-0.26px',\n\t\t\t\tfontWeight: '400',\n\t\t\t\tfontSize: '0.8125rem',\n\t\t\t\t'&.pinned-column': {\n\t\t\t\t\tbackgroundColor: '#fff'\n\t\t\t\t},\n\t\t\t\t'&:hover': {\n\t\t\t\t\tbackgroundColor: 'transparent' // Removes hover effect globally\n\t\t\t\t},\n\t\t\t\twhiteSpace: 'pre-wrap'\n\t\t\t},\n\t\t\tonClick: (e: React.MouseEvent) => {\n\t\t\t\tconst columnDef = column.columnDef as MaterialEditableTableColumnProps;\n\t\t\t\tconst isOnClickEditable = columnDef.isOnClickEditable !== false; // Default to true\n\t\t\t\t\n\t\t\t\tif (!isOnClickEditable) {\n\t\t\t\t\treturn; // Don't trigger edit mode for this column\n\t\t\t\t}\n\n\t\t\t\tconst editingRowId = table.getState()?.editingRow?.id || table.getState()?.creatingRow?.id || null;\n\t\t\t\tconst isCurrentlyEditing = editingRowId === row.id;\n\n\t\t\t\t// If there's a row currently being edited and it's not this row, save it first then edit this row\n\t\t\t\tif (editingRowId && editingRowId !== row.id) {\n\t\t\t\t\ttable.setEditingRow(null);\n\t\t\t\t\tsetTimeout(() => {\n\t\t\t\t\t\ttable.setEditingRow(row);\n\t\t\t\t\t\tsetDisableNextEdit(true);\n\t\t\t\t\t}, 100);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Set the row as editable when clicked if not already editing and no other row is being edited\n\t\t\t\tif (!disableNextEdit && !isCurrentlyEditing && !editingRowId) {\n\t\t\t\t\ttable.setEditingRow(row);\n\t\t\t\t\tsetDisableNextEdit(true);\n\t\t\t\t}\n\t\t\t}\n\t\t\t// onClick: () => {\n\t\t\t// \ttable.setEditingCell(cell); //set editing cell\n\t\t\t// \tqueueMicrotask(() => {\n\t\t\t// \t\tconst textField = table.refs.editInputRefs.current[column.id];\n\t\t\t// \t\tif (textField) {\n\t\t\t// \t\t\ttextField.focus();\n\t\t\t// \t\t\ttextField.select?.();\n\t\t\t// \t\t}\n\t\t\t// \t});\n\t\t\t// }\n\t\t\t// onKeyDown: (event) => {\n\t\t\t// \tif (event.key === 'Tab') {\n\t\t\t// \t\ttry {\n\t\t\t// \t\t\t\t// if (column.columnDef.editVariant === 'select') {\n\t\t\t// \t\t\t\t// \ttable.refs.editInputRefs.current[column.id]?.node?.blur();\n\t\t\t// \t\t\t\t// } else {\n\t\t\t// \t\t\t\t// \ttable.refs.editInputRefs.current[column.id].blur();\n\t\t\t// \t\t\t\t// }\n\n\t\t\t// \t\t\tconst rowIdx = row.index;\n\t\t\t// \t\t\tconst colIdx = columns.findIndex(\n\t\t\t// \t\t\t\t(col) => col.accessorKey === column.id\n\t\t\t// \t\t\t);\n\t\t\t// \t\t\tconst newColIdx = colIdx + 1;\n\t\t\t// \t\t\tconst clm = columns[newColIdx];\n\t\t\t// \t\t\tconst nextCell = row\n\t\t\t// \t\t\t\t.getAllCells()\n\t\t\t// \t\t\t\t.find((cl) => (cl.id = `${rowIdx}_${clm.accessorKey}`));\n\n\t\t\t// \t\t\tif (nextCell) {\n\t\t\t// \t\t\t\t// updateData(event.target.value, column, row.id);\n\t\t\t// \t\t\t\ttable.setEditingCell(nextCell);\n\t\t\t// \t\t\t\tqueueMicrotask(() => {\n\t\t\t// \t\t\t\t\tconst textField = table.refs.editInputRefs.current[column.id];\n\t\t\t// \t\t\t\t\tif (textField) {\n\t\t\t// \t\t\t\t\t\ttextField.focus();\n\t\t\t// \t\t\t\t\t\ttextField.select?.();\n\t\t\t// \t\t\t\t\t}\n\t\t\t// \t\t\t\t});\n\t\t\t// \t\t\t}\n\t\t\t// \t\t} catch (error) {\n\t\t\t// \t\t}\n\t\t\t// \t}\n\t\t\t// },\n\t\t\t// onBlur: () => {\n\t\t\t// \ttable.setEditingCell(null);\n\t\t\t// }\n\t\t}),\n\n\t\t// Checkbox styling\n\t\tmuiSelectCheckboxProps: {\n\t\t\tsx: {\n\t\t\t\tcolor: 'theme.secondary.300',\n\t\t\t\t'&.Mui-checked': {\n\t\t\t\t\tcolor: 'theme.primary.600',\n\t\t\t\t\t'&:hover': {\n\t\t\t\t\t\tcolor: 'theme.primary.500'\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t'&.Mui-disabled': {\n\t\t\t\t\tcolor: 'theme.secondary.200'\n\t\t\t\t}\n\t\t\t},\n\t\t\ticon: <RecgtangleIcon sx={{ width: 20, height: 20 }} />,\n\t\t\tcheckedIcon: <CheckBoxIcon sx={{ width: 20, height: 20 }} />\n\t\t},\n\t\tmuiSelectAllCheckboxProps: {\n\t\t\tsx: {\n\t\t\t\tcolor: 'theme.secondary.300',\n\t\t\t\t'&.Mui-checked': {\n\t\t\t\t\tcolor: 'theme.primary.600',\n\t\t\t\t\t'&:hover': {\n\t\t\t\t\t\tcolor: 'theme.primary.500'\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t'&.Mui-disabled': {\n\t\t\t\t\tcolor: 'theme.secondary.600'\n\t\t\t\t}\n\t\t\t},\n\t\t\ticon: <RecgtangleIcon sx={{ width: 20, height: 20 }} />,\n\t\t\tcheckedIcon: <CheckBoxIcon sx={{ width: 20, height: 20 }} />\n\t\t},\n\t\tmuiBottomToolbarProps: {\n\t\t\tsx: {\n\t\t\t\tboxShadow: 'none',\n\t\t\t\t'& .MuiBox-root': {\n\t\t\t\t\tpaddingLeft: 0\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\n\t\tlayoutMode: 'grid',\n\t\ticons: {\n\t\t\tDragHandleIcon: () => <RecgtangleIcon fontSize='medium' />,\n\t\t\tSortIcon: () => <ArrowUpDown fontSize='medium' />,\n\t\t\tArrowDownwardIcon: () => <ArrowUpDown fontSize='medium' />,\n\t\t\tArrowUpwardIcon: () => <ArrowUpDown fontSize='medium' />,\n\t\t\tExpandMoreIcon: () => <ArrowUpDown fontSize='medium' />,\n\t\t\tExpandLessIcon: () => <ArrowUpDown fontSize='medium' />,\n\t\t\tSyncAltIcon: () => <ArrowUpDown fontSize='medium' />,\n\t\t\tCancelIcon: (props: SvgIconProps) => (\n\t\t\t\t<Close fontSize='small' {...props} color='theme.secondary.1000' />\n\t\t\t)\n\t\t},\n\n\t\t...rest\n\t});\n\n\tuseEffect(() => {\n\t\tif (enableRowSelection) {\n\t\t\tif (table?.getSelectedRowModel()?.rows) {\n\t\t\t\tSetSelectedRowId?.(table?.getSelectedRowModel()?.rows);\n\t\t\t}\n\t\t}\n\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [enableRowSelection]);\n\n\tuseEffect(() => {\n\t\tif (onSelectRow) {\n\t\t\tif (rest?.enableExpanding) {\n\t\t\t\tconst selectedRowModels: any[] = [];\n\t\t\t\tconst selection = table.getState().rowSelection; // e.g., { 0.0: true }\n\t\t\t\tconst traverseRows = (rows, parentKey = '') => {\n\t\t\t\t\trows.forEach((row: any, index: number) => {\n\t\t\t\t\t\tconst rowKey = parentKey ? `${parentKey}.${index}` : `${row.id}`;\n\t\t\t\t\t\tif (selection[rowKey]) {\n\t\t\t\t\t\t\tselectedRowModels.push(row);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Check for sub-rows and traverse further\n\t\t\t\t\t\tif (row.subRows?.length) {\n\t\t\t\t\t\t\ttraverseRows(row.subRows, rowKey);\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t};\n\n\t\t\t\ttraverseRows(table.getRowModel().rows);\n\t\t\t\tonSelectRow(selectedRowModels, rowSelection);\n\t\t\t} else {\n\t\t\t\tonSelectRow(table.getSelectedRowModel().rows, rowSelection);\n\t\t\t}\n\n\t\t}\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [rowSelection, table]);\n\n\t// useEffect(() => {\n\t// \tconst relativeContainer = document.getElementsByClassName(\n\t// \t\t'MuiTableContainer-root'\n\t// \t)[0];\n\t// \tconst fixedElement = document.getElementsByClassName('no-data')[0];\n\t// \trelativeContainer.addEventListener('scroll', () => {\n\t// \t\tconst scrollLeft = relativeContainer.scrollLeft;\n\t// \t\tfixedElement.style.left = `${scrollLeft + 100}px`;\n\t// \t});\n\t// }, []);\n\n\tuseEffect(() => {\n\t\tif (isResetRow) {\n\t\t\ttable?.resetRowSelection();\n\t\t}\n\t}, [isResetRow, table]);\n\n\t// Handle clicks outside the table to save and exit edit mode - ADVANCED EVENT DELEGATION\n\tuseEffect(() => {\n\t\tif (!table) return;\n\n\t\tlet dropdownOpenTimer: NodeJS.Timeout;\n\t\tlet saveTimer: NodeJS.Timeout;\n\t\tlet lastDropdownClick = 0;\n\t\tlet isDropdownInteraction = false;\n\n\t\t// Track dropdown interactions with precise timing\n\t\tconst handleMouseDown = (e: MouseEvent) => {\n\t\t\tconst target = e.target as HTMLElement;\n\t\t\tconst isDropdownElement = target.closest(\n\t\t\t\t'.MuiSelect-root, .MuiMenuItem-root, .MuiPopover-root, .MuiList-root, ' +\n\t\t\t\t'.MuiMenu-list, .MuiModal-root, .MuiBackdrop-root, .MuiButtonBase-root, ' +\n\t\t\t\t'.MuiFormControl-root, .MuiInputBase-root, .MuiTextField-root, ' +\n\t\t\t\t'.MuiOutlinedInput-root, .MuiFilledInput-root, .MuiAutocomplete-popper, ' +\n\t\t\t\t'.MuiPickersPopper-root, [role=\"option\"], [role=\"listbox\"], [role=\"combobox\"]'\n\t\t\t);\n\n\t\t\tif (isDropdownElement) {\n\t\t\t\tisDropdownInteraction = true;\n\t\t\t\tlastDropdownClick = Date.now();\n\t\t\t\t// Clear any pending save when dropdown interaction starts\n\t\t\t\tif (saveTimer) {\n\t\t\t\t\tclearTimeout(saveTimer);\n\t\t\t\t}\n\t\t\t\t// Set a timer to reset dropdown interaction flag\n\t\t\t\tif (dropdownOpenTimer) {\n\t\t\t\t\tclearTimeout(dropdownOpenTimer);\n\t\t\t\t}\n\t\t\t\tdropdownOpenTimer = setTimeout(() => {\n\t\t\t\t\tisDropdownInteraction = false;\n\t\t\t\t}, 500);\n\t\t\t}\n\t\t};\n\n\t\t// Handle clicks with sophisticated logic\n\t\tconst handleClick = (e: MouseEvent) => {\n\t\t\tconst editingRow = table.getState()?.editingRow;\n\t\t\tconst creatingRow = table.getState()?.creatingRow;\n\t\t\tif (!editingRow && !creatingRow) return;\n\n\t\t\tconst target = e.target as HTMLElement;\n\t\t\tconst now = Date.now();\n\n\t\t\t// Don't process if we recently had a dropdown interaction\n\t\t\tif (isDropdownInteraction || (now - lastDropdownClick) < 300) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Check if click is inside table\n\t\t\tconst isInsideTable = target.closest('.MuiTableContainer-root, .MuiPaper-root, .MRT_Table');\n\n\t\t\t// Only save if clicking outside table and no recent dropdown interaction\n\t\t\tif (!isInsideTable) {\n\t\t\t\t// Clear any existing save timer\n\t\t\t\tif (saveTimer) {\n\t\t\t\t\tclearTimeout(saveTimer);\n\t\t\t\t}\n\n\t\t\t\t// Schedule save with additional delay for safety\n\t\t\t\tsaveTimer = setTimeout(() => {\n\t\t\t\t\tconst currentEditingRow = table.getState()?.editingRow;\n\t\t\t\t\tconst currentCreatingRow = table.getState()?.creatingRow;\n\t\t\t\t\tif (isDropdownInteraction) return;\n\t\t\t\t\tif (currentCreatingRow) {\n\t\t\t\t\t\tconst values = currentCreatingRow._valuesCache || currentCreatingRow.original;\n\t\t\t\t\t\tif (table.options?.onCreatingRowSave) {\n\t\t\t\t\t\t\ttable.options.onCreatingRowSave({ row: currentCreatingRow, values, table });\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tif (currentEditingRow) {\n\t\t\t\t\t\thandleSaveRow(currentEditingRow, currentEditingRow._valuesCache || currentEditingRow.original, table);\n\t\t\t\t\t}\n\t\t\t\t}, 200);\n\t\t\t}\n\t\t};\n\n\t\t// Use both mousedown and click for comprehensive tracking\n\t\tdocument.addEventListener('mousedown', handleMouseDown, true);\n\t\tdocument.addEventListener('click', handleClick, true);\n\n\t\treturn () => {\n\t\t\tdocument.removeEventListener('mousedown', handleMouseDown, true);\n\t\t\tdocument.removeEventListener('click', handleClick, true);\n\t\t\tif (dropdownOpenTimer) {\n\t\t\t\tclearTimeout(dropdownOpenTimer);\n\t\t\t}\n\t\t\tif (saveTimer) {\n\t\t\t\tclearTimeout(saveTimer);\n\t\t\t}\n\t\t};\n\t}, [table, handleSaveRow]);\n\treturn (\n\t\t<TableWrapper className='MRT-TableWrapper custom-table'>\n\t\t\t<MaterialReactTable table={table} />\n\n\t\t\t<Menu\n\t\t\t\tanchorEl={anchorEl}\n\t\t\t\topen={Boolean(anchorEl)}\n\t\t\t\tonClose={handleHeaderClose}\n\t\t\t\tclassName='add-role-drp'>\n\t\t\t\t{popUpShow ? (\n\t\t\t\t\t<div>\n\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\tonClick={handleBackButtonClick}\n\t\t\t\t\t\t\tclassName='role-drp-list add-column-title'>\n\t\t\t\t\t\t\t<ListItemIcon className='add-icon'>\n\t\t\t\t\t\t\t\t<ChevronLeftIcon />\n\t\t\t\t\t\t\t</ListItemIcon>\n\t\t\t\t\t\t\t<ListItemText className='title'>\n\t\t\t\t\t\t\t\t{t('common.addColumn_label')}\n\t\t\t\t\t\t\t</ListItemText>\n\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t<Divider flexItem sx={{ mt: '0.25rem !important', mb: '0.25rem !important' }} />\n\t\t\t\t\t\t<div className='searchbar-box-list'>\n\t\t\t\t\t\t\t<SearchBar\n\t\t\t\t\t\t\t\tplaceholder={'Search User'}\n\t\t\t\t\t\t\t\thandleSearch={(e) => handleSearchEvent(e)}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div className='all-attribute-title'>\n\t\t\t\t\t\t\t<Typography variant='body2' color='text.secondary'>\n\t\t\t\t\t\t\t\t{t('common.allAttributes_label')}\n\t\t\t\t\t\t\t</Typography>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t{filteredOptions.map((column: any) => (\n\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\tkey={column.accessorKey}\n\t\t\t\t\t\t\t\tonClick={() => handleAddColumn(column)}>\n\t\t\t\t\t\t\t\t<Typography color='theme.secondary.1000' type='s3'>\n\t\t\t\t\t\t\t\t\t{column.header}\n\t\t\t\t\t\t\t\t</Typography>\n\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t))}\n\t\t\t\t\t\t<Divider flexItem sx={{ mt: '0.25rem !important', mb: '0.25rem !important' }} />\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tenableAddCustomField && <MenuItem onClick={handleCustomAddColumn} className='role-drp-list'>\n\t\t\t\t\t\t\t\t<ListItemIcon className='add-icon'>\n\t\t\t\t\t\t\t\t\t<img src={images.common.addIcon} alt='Add Icon' />\n\t\t\t\t\t\t\t\t</ListItemIcon>\n\t\t\t\t\t\t\t\t<ListItemText className='title'>\n\t\t\t\t\t\t\t\t\t{t('common.addCustomField_label')}\n\t\t\t\t\t\t\t\t</ListItemText>\n\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t}\n\t\t\t\t\t</div>\n\t\t\t\t) : (\n\t\t\t\t\t<>\n\t\t\t\t\t\t{visibleColumns.map((column: any) => (\n\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\tkey={column.accessorKey}\n\t\t\t\t\t\t\t\tonClick={() => handleVisibleColumn(column)}\n\t\t\t\t\t\t\t\tclassName='role-drp-list'>\n\t\t\t\t\t\t\t\t<ListItemIcon className='add-icon'>\n\t\t\t\t\t\t\t\t\t<img src={images.common.dotsIcon} alt='Add Icon' />\n\t\t\t\t\t\t\t\t</ListItemIcon>\n\t\t\t\t\t\t\t\t<ListItemText className='title'>{column.header}</ListItemText>\n\t\t\t\t\t\t\t\t<ListItemIcon className='eye-icon'>\n\t\t\t\t\t\t\t\t\t<img src={images.common.eyeIcon} alt='Eye Icon' />\n\t\t\t\t\t\t\t\t</ListItemIcon>\n\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t))}\n\t\t\t\t\t\t<Divider flexItem sx={{ mt: '0.25rem !important', mb: '0.25rem !important' }} />\n\t\t\t\t\t\t<MenuItem onClick={handleAddButtonClick} className='role-drp-list'>\n\t\t\t\t\t\t\t<ListItemIcon className='add-icon'>\n\t\t\t\t\t\t\t\t<img src={images.common.addIcon} alt='Add Icon' />\n\t\t\t\t\t\t\t</ListItemIcon>\n\t\t\t\t\t\t\t<ListItemText className='title'>\n\t\t\t\t\t\t\t\t{t('common.addColumn_label')}\n\t\t\t\t\t\t\t</ListItemText>\n\t\t\t\t\t\t\t<Typography\n\t\t\t\t\t\t\t\tvariant='body2'\n\t\t\t\t\t\t\t\tcolor='text.secondary'\n\t\t\t\t\t\t\t\tclassName='eye-icon'>\n\t\t\t\t\t\t\t\t<ChevronRightIcon sx={{ fontSize: '1.25rem !important' }} />\n\t\t\t\t\t\t\t</Typography>\n\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t</>\n\t\t\t\t)}\n\t\t\t</Menu>\n\n\t\t\t<Menu\n\t\t\t\tanchorEl={rowAnchorEl}\n\t\t\t\topen={Boolean(rowAnchorEl)}\n\t\t\t\tonClose={handleActionsClose}>\n\t\t\t\t{rowActionMenu?.map((option: any) => {\n\t\t\t\t\tif (\n\t\t\t\t\t\t(option.label === 'Move' &&\n\t\t\t\t\t\t\t(row?.is_directory === true || row?.is_directory === 1)) ||\n\t\t\t\t\t\t(option.label === 'Download' &&\n\t\t\t\t\t\t\t(row?.is_directory === true ||\n\t\t\t\t\t\t\t\trow?.is_directory === 1 ||\n\t\t\t\t\t\t\t\trow?.drive?.is_directory === true ||\n\t\t\t\t\t\t\t\trow?.drive?.is_directory === 1))\n\t\t\t\t\t) {\n\t\t\t\t\t\t// return null;\n\t\t\t\t\t}\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\tonClick={async () => {\n\t\t\t\t\t\t\t\tawait option.handleAction(row);\n\t\t\t\t\t\t\t\tsetRowAnchorEl(null);\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\tdisabled={\n\t\t\t\t\t\t\t\ttypeof option.disabled === 'function'\n\t\t\t\t\t\t\t\t\t? option.disabled(row)\n\t\t\t\t\t\t\t\t\t: Boolean(option.disabled)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tsx={{ alignItems: 'center', gap: 0.5 }}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{option?.icon}\n\t\t\t\t\t\t\t<Typography type='s4' color='inherit'>\n\t\t\t\t\t\t\t\t{typeof option.label === 'function' ? option.label(row) : option.label}\n\t\t\t\t\t\t\t</Typography>\n\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t);\n\t\t\t\t})}\n\t\t\t\t{destructiveActionMenu?.length > 0 &&\n\t\t\t\t\t<>\n\t\t\t\t\t\t<Divider flexItem sx={{ mt: '0.25rem !important', mb: '0.25rem !important' }} />\n\t\t\t\t\t\t<div className='dropdown-inner--DestructiveHeader'>\n\t\t\t\t\t\t\t{destructiveActionMenu?.map((option: any) => (\n\t\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\t\tonClick={() => {\n\t\t\t\t\t\t\t\t\t\toption.handleAction(row);\n\t\t\t\t\t\t\t\t\t\tsetRowAnchorEl(null);\n\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\tclassName='dropdown-inner--DestructiveActions'\n\t\t\t\t\t\t\t\t\tdisabled={\n\t\t\t\t\t\t\t\t\t\ttypeof option.disabled === 'function'\n\t\t\t\t\t\t\t\t\t\t\t? option.disabled(row)\n\t\t\t\t\t\t\t\t\t\t\t: Boolean(option.disabled)\n\t\t\t\t\t\t\t\t\t}>\n\t\t\t\t\t\t\t\t\t<Typography type='s4' color='inherit'>\n\t\t\t\t\t\t\t\t\t\t{typeof option.label === 'function' ? option.label(row) : option.label}\n\t\t\t\t\t\t\t\t\t</Typography>\n\t\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</>\n\t\t\t\t}\n\t\t\t</Menu>\n\t\t\t<ConfirmPopUp\n\t\t\t\topen={Boolean(rowToDelete)}\n\t\t\t\tonClose={() => setRowToDelete(null)}\n\t\t\t\tonConfirm={() => handleRowDelete()}\n\t\t\t\ttitle='Delete Item'\n\t\t\t\tdescription={`Are you sure you want to delete entry ?`}\n\t\t\t\tloading={isDeletingRow}\n\t\t\t/>\n\t\t</TableWrapper>\n\t);\n});\n\nexport { MaterialEditableTable };\nexport default MaterialEditableTable;"],"names":["TableWrapper","styled","Box","theme","palette","border","borderBottom","borderLeft","padding","lineHeight","fontSize","minHeight","backgroundColor","_a","secondary","maxHeight","boxShadow","_b","primary","color","_c","_d","height","width","MaterialEditableTable","React","memo","enablePagination","rows","columns","totalPages","paginationModel","columnOrder","updateData","handleColumnOrdering","enableEditing","enableColumnDragging","states","rowActionMenu","destructiveActionMenu","disableDefaultActionColumn","enableRowSelection","defaultActionColumnItems","enableBottomToolbar","SetSelectedRowId","isResetRow","onCreateRow","onEditRow","onDeleteRow","editDisplayMode","enableRowCreate","onChangeRowField","onSelectRow","enableColumnResizing","selectedRowIds","onColumnVisibility","onSortingChange","getSelectedData","disabledDefaultActionColumnIcon","enableAddCustomField","enableRowDragging","handleColumnResizing","columnSizes","hideSaveButton","rest","t","useTranslation","formData","updatePageInfo","activePage","aPage","usePages","useDeepMemo","pageNo","row","setRow","useState","tableColumns","setTableColumns","anchorEl","setAnchorEl","popUpShow","setPopupShow","rowAnchorEl","setRowAnchorEl","visibleColumns","filter","column","visible","hiddenColumns","filteredOptions","setFilteredOptions","selectedRow","setSelectedRow","validationErrors","setValidationErrors","validationSchema","setValidationSchema","isCreatingRow","setIsCreatingRow","isEditingRow","setIsEditingRow","isDeletingRow","setIsDeletingRow","rowToDelete","setRowToDelete","rowSelection","setRowSelection","isChecked","setIsChecked","sorting","setSorting","disableNextEdit","setDisableNextEdit","columnSizing","setColumnSizing","column_sizes","columnSizingInfo","setColumnSizingInfo","columnSizingStart","deltaOffset","deltaPercentage","isResizingColumn","startOffset","startSize","navigate","useNavigate","currentModule","location","pathname","split","redirectionPath","PathnameAccounting","CUSTOM_FORM","PathnameInventory","PathnameManufacturing","PathnamePurchase","PathnameCrm","PathnameUsers","PathnameRental","PathnameDocument","ADD_CUSTOM_FIELDS","path","validationReducer","validations","validation","vld","type","value","required","msg_en","typeError","editProperties","is_multiple","min","email","max","test","when","relation","is","val","values","then","thenValidations","reduce","otherwise","otherWiseValidations","editVariant","trim","length","useEffect","schema","forEach","clm","fieldValidations","yup","array","string","number","nullable","transform","originalValue","matches","excludeEmptyString","message","getValidationType","accessorKey","generateValidationSchema","object","shape","handleHeaderClick","event","currentTarget","formtValues","useCallback","cells","v","Object","keys","vl","cell","find","c","File","name","dayjs","format","dateFormat","label","display_name","title","id","checkRequired","some","selectedRows","includes","Function","sortingArray","Array","isArray","getTextWidth","text","ctx","document","createElement","getContext","measureText","handleSaveRow","async","tableInstance","validate","abortEarly","getAllCells","map","columnDef","_valuesCache","data","table","setEditingRow","err","ValidationError","errors","inner","error","Error","enqueueSnackbar","variant","useMaterialReactTable","defaultColumn","minSize","size","header","Math","String","Edit","jsx","InlineEditFields","col","callback","s","Header","jsxs","display","alignItems","children","Typography","maxSize","IconButton","sx","p","onClick","src","images","common","arrowIcon","alt","muiTableHeadCellProps","className","muiTableBodyCellProps","whiteSpace","Cell","props","item","updatedProps","cloneElement","e","handleActionsClick","original","disabled","more","muiTablePaperProps","tableLayout","columnResizeMode","onEditingRowSave","onCreatingRowSave","setCreatingRow","onCreatingRowCancel","onEditingRowCancel","displayColumnDefOptions","getState","creatingRow","editingRow","gap","onKeyUp","renderRowActions","Fragment","enableExpanding","parentId","Tooltip","Trash","Boolean","renderBottomToolbarCustomActions","Button","startIcon","Add","onRowSelectionChange","enableColumnOrdering","createDisplayMode","enableTopToolbar","enableColumnActions","enableSorting","enableGrouping","enableStickyHeader","enableSortingRemoval","state","columnPinning","left","isSaving","showProgressBars","getRowId","muiTableBodyRowProps","editingRowId","creatingRowId","isErrorRow","has_error","isCurrentlyEditing","onKeyDown","key","preventDefault","cursor","onColumnOrderChange","colOrder","onColumnSizingChange","onColumnSizingInfoChange","renderEmptyRowsFallback","tableNoData","weight","paginationDisplayMode","muiPaginationProps","page","count","showRowsPerPage","boundaryCount","muiEditTextFieldProps","InputProps","disableUnderline","onBlur","target","borderColor","muiCircularProgressProps","letterSpacing","fontWeight","justifyContent","margin","right","opacity","muiTableBodyProps","zIndex","muiTableHeadProps","isOnClickEditable","setTimeout","muiSelectCheckboxProps","icon","RecgtangleIcon","checkedIcon","CheckBoxIcon","muiSelectAllCheckboxProps","muiBottomToolbarProps","paddingLeft","layoutMode","icons","DragHandleIcon","SortIcon","ArrowUpDown","ArrowDownwardIcon","ArrowUpwardIcon","ExpandMoreIcon","ExpandLessIcon","SyncAltIcon","CancelIcon","Close","getSelectedRowModel","selectedRowModels","selection","traverseRows","parentKey","index","rowKey","push","subRows","getRowModel","resetRowSelection","dropdownOpenTimer","saveTimer","lastDropdownClick","isDropdownInteraction","handleMouseDown","closest","Date","now","clearTimeout","handleClick","currentEditingRow","currentCreatingRow","options","addEventListener","removeEventListener","MaterialReactTable","Menu","open","onClose","MenuItem","ListItemIcon","ChevronLeftIcon","ListItemText","Divider","flexItem","mt","mb","SearchBar","placeholder","handleSearch","searchQuery","filteredColumns","option","toLowerCase","handleSearchEvent","updatedColumns","JSON","parse","stringify","updatedFilteredOptions","handleAddColumn","addIcon","handleVisibleColumn","dotsIcon","eyeIcon","ChevronRightIcon","handleAction","ConfirmPopUp","onConfirm","handleRowDelete","description","loading"],"mappings":"+yFA8KA,MAAMA,EAAeC,EAAAA,QAAOC,UAAPD,CAAY,EAAGE,OAASC,2BAAiB,MAAA,CAC7D,qBAAsB,C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AAwB,mBAAjB0K,EAAOlO,MAAuBkO,EAAOlO,MAAMvI,IAAOyW,EAAOlO,aAKpE,MAAA1K,OAAA,EAAAA,EAAuBmI,QAAS,kBAChC4F,EAAAA,KAAA4C,EAAAA,SAAA,CACCzC,SAAA;eAAAT,EAAAA,IAAC0K,EAAAA,QAAA,CAAQC,UAAQ,EAAC9J,GAAI,CAAE+J,GAAI,qBAAsBC,GAAI;qBACrD,MAAA,CAAIvJ,UAAU,oCACbb,SAAA,MAAAlO,OAAA,EAAAA,EAAuBmM,IAAKyM,kBAC5BnL,EAAAA,IAACsK,EAAAA,QAAA,CACAvJ,QAAS,KACRoK,EAAOc,aAAavX,IACpBU,GAAe,OAEhBkM,UAAU,qCACVW,SAC4B,mBAApBkJ,EAAOlJ,SACXkJ,EAAOlJ,SAASvN,IAChB6O,QAAQ4H,EAAOlJ,UAEnBxB,0BAAAT,IAACU,aAAA,CAAWvH,KAAK,KAAKhI,MAAM,UAC1BsP,SAAwB,mBAAjB0K,EAAOlO,MAAuBkO,EAAOlO,MAAMvI,IAAOyW,EAAOlO;eAQxE+C,EAAAA,IAACkM,EAAAA,aAAA,CACA9B,KAAM7G,QAAQ/M,IACd6T,QAAS,IAAM5T,GAAe,MAC9B0V,UAAW,IA98BU9N,WACvB9H,IAAiB,GACbC,WACG,MAAAxD,QAAA,EAAAA,GAAcwD,KACpBC,GAAe,OAEhBF,IAAiB,IAw8BE6V,GACjBjP,MAAM,cACNkP,YAAa,0CACbC,QAAShW"}
1
+ {"version":3,"file":"index.js","sources":["../../../../src/components/material-editable-table/material-editable-table.tsx"],"sourcesContent":["/* eslint-disable unused-imports/no-unused-vars */\n/* eslint-disable @typescript-eslint/no-unused-vars */\n/* eslint-disable no-mixed-spaces-and-tabs */\nimport React, { cloneElement, useCallback, useEffect, useState } from 'react';\nimport {\n\tMRT_ColumnDef,\n\tMRT_ColumnSizingInfoState,\n\tMRT_ColumnSizingState,\n\tMRT_Header,\n\tMRT_Row,\n\tMRT_RowData,\n\tMRT_RowSelectionState,\n\tMRT_SortingState,\n\tMRT_TableInstance,\n\tMRT_TableState,\n\tMaterialReactTable,\n\tMaterialReactTableProps,\n\tuseMaterialReactTable,\n\t// Cell\n} from 'material-react-table';\nimport { IPaginationModel } from '../../@types/pagination-model';\nimport {\n\tBox,\n\tstyled,\n\tMenuItem,\n\tIconButton,\n\tListItemIcon,\n\tListItemText,\n\tSvgIconProps,\n\tDivider\n} from '@mui/material';\nimport ChevronRightIcon from '@mui/icons-material/ChevronRight';\nimport ChevronLeftIcon from '@mui/icons-material/ChevronLeft';\nimport Menu from '../menu/menu';\nimport Typography from '../typography/typography';\nimport SearchBar from '../search-bar/search-bar';\nimport images from '../../assets/images';\n// import DeleteIcon from \"@mui/icons-material/Delete\";\n// import UpdateIcon from \"@mui/icons-material/Update\";\n// import PlayIcon from \"@mui/icons-material/PlayArrow\";\n\nimport './material-editable-table.scss';\nimport {\n\tArrowUpDown,\n\tCheckBoxIcon,\n\tClose,\n\tRecgtangleIcon,\n\tTrash,\n\tSave\n} from '../icons';\n// import {\n// \tArrowDropDown /* , SaveOutlined */,\n// \tArrowDropUp\n// } from '@mui/icons-material';\nimport InlineEditFields from './components/inline-edit-fields';\nimport Tooltip from '../tooltip/Tooltip';\nimport Button from '../button/button';\nimport Add from '@mui/icons-material/Add';\nimport dayjs from 'dayjs';\nimport * as yup from 'yup';\nimport ConfirmPopUp from '../confirm-modal/confirm-modal';\nimport { useTranslation } from 'react-i18next';\nimport { enqueueSnackbar } from 'notistack';\nimport { usePages } from '../../hooks/use-pages';\nimport { useNavigate } from 'react-router-dom';\n// import { PathnameAccounting } from 'accounting/src/pathname.accounting';\n// import { PathnameInventory } from 'inventory/src/pathname.inventory';\n// import { PathnameManufacturing } from 'manufacturing/src/pathname.manufacturing';\n// import { PathnamePurchase } from 'procurement/src/pathname.procurement';\n// import { PathnameCrm } from 'crm/src/pathname.crm';\n// import { PathnameUsers } from '../../constants/pathnames/pathname.user';\n// import { PathnameRental } from '../../../../rental/src/pathname.rental';\n// import { PathnameDocument } from 'document/src/pathname.document';\nimport { PathnameDocument } from '../../constants/pathnames/pathname.document';\nimport { PathnameAccounting } from '../../constants/pathnames/pathname.accounting';\nimport { PathnameInventory } from '../../constants/pathnames/pathname.inventory';\nimport { PathnameManufacturing } from '../../constants/pathnames/pathname.manufacturing';\nimport { PathnamePurchase } from '../../constants/pathnames/pathname.procurement';\nimport { PathnameCrm } from '../../constants/pathnames/pathname.crm';\nimport { PathnameUsers } from '../../constants/pathnames/pathname.user';\nimport { PathnameRental } from '../../constants/pathnames/pathname.rental';\nimport useDeepMemo from '../../hooks/use-deep-memo';\nimport { PageState } from '../../contexts/page-context';\n\ntype ExtraEditVariants =\n\t| 'file'\n\t| 'image'\n\t| 'date'\n\t| 'number'\n\t| 'time'\n\t| 'date_time'\n\t| 'phone'\n\t| 'checkbox';\n\ntype DisableFunction = (row: any, virtualRow?: any) => boolean;\n\nexport type TypeBooleanLabels = { 1: string; 0: string; true: string; false: string }\n\nexport interface MaterialEditableTableColumnProps\n\textends Omit<MRT_ColumnDef<MRT_RowData>, 'editVariant'> {\n\tvisible?: boolean;\n\ttype?: string;\n\tshowDefaultCurrency?: boolean,\n\tvalueGet?: string;\n\tcustom_class?: string;\n\ttypeArrayAccessorKey?: string; //when type is an array of object\n\ttypeBooleanLabels?: TypeBooleanLabels; //when type is an boolean\n\teditVariant?: MRT_ColumnDef<MRT_RowData>['editVariant'] | ExtraEditVariants;\n\teditProperties?: {\n\t\tfield_name?: string;\n\t\tvalueKey?: string;\n\t\tplaceholder?: string;\n\t\tdateFormat?: string;\n\t\tvalidations?: any[];\n\t\tis_multiple?: boolean;\n\t\tis_multiline?: boolean;\n\t\tdisable?: boolean | DisableFunction;\n\t};\n\tredirectionPathWithId?: string;\n\n\tidField?: string;\n}\n\n\n\nexport interface MaterialEditableTableColumnHeaderProps {\n\tcolumn: MRT_ColumnDef<any, any>;\n\theader: MRT_Header<any>;\n\ttable: MRT_TableInstance<any>;\n}\n\ntype rowSelectionCallback = (row: MRT_Row) => boolean\n\ninterface MaterialEditableTablePropsType {\n\tenablePagination?: boolean;\n\trows: any;\n\ttotalPages: number;\n\tcolumns: any;\n\tpaginationModel: IPaginationModel;\n\tcolumnOrder?: string[];\n\tupdateData?: any;\n\thandleColumnOrdering?: (colOrder: any) => void;\n\tenableEditing?: boolean;\n\tenableColumnDragging?: boolean;\n\trowActionMenu?: any;\n\tdestructiveActionMenu?: any;\n\tgetRowId?: any;\n\tstates?: Partial<MRT_TableState<any>>;\n\tonSortingChange?: any;\n\tdisableDefaultActionColumn?: boolean;\n\tenableRowSelection?: boolean | rowSelectionCallback;\n\tdefaultActionColumnItems?: React.ReactElement[];\n\tenableBottomToolbar?: boolean;\n\tSetSelectedRowId?: any;\n\tisResetRow?: boolean;\n\tonCreateRow?: (data: any) => Promise<unknown>;\n\tonEditRow?: (data: any) => Promise<unknown>;\n\tonDeleteRow?: (data: any) => Promise<unknown>;\n\teditDisplayMode?: MaterialReactTableProps<any>['editDisplayMode'];\n\tenableRowCreate?: boolean;\n\tonChangeRowField?: (e: any, type: string, row: any) => void;\n\tonSelectRow?: (rows: any, prevSelected?: any) => any;\n\tenableColumnResizing?: boolean;\n\tselectedRowIds?: any[];\n\tonColumnVisibility?: (columns: MaterialTableColumnProps[]) => void\n\tgetSelectedData: any;\n\tenableAddCustomField?: boolean;\n\tdisabledDefaultActionColumnIcon?: boolean\n\tenableRowDragging?: boolean\n\thandleColumnResizing?: (sizes: MRT_ColumnSizingState) => void,\n\tcolumnSizes?: MRT_ColumnSizingState,\n}\n\nconst TableWrapper = styled(Box)(({ theme: { palette } }) => ({\n\t'.MuiTableCell-root': {\n\t\tborder: '1px solid #efefef',\n\t\tborderBottom: 0,\n\t\tborderLeft: 0,\n\t\tpadding: '0.19rem 0.5rem',\n\t\tlineHeight: '19px',\n\t\tfontSize: '14px',\n\t\tminHeight: 40,\n\t\t// '&:first-child': {\n\t\t// \tborderLeft: '1px solid #efefef'\n\t\t// },\n\t\t// '&:last-child': {\n\t\t// \tborderBottom: '1px solid #efefef'\n\t\t// }\n\n\t},\n\t'.MuiTableCell-head': {\n\t\tbackgroundColor: palette.theme?.secondary[100]\n\t},\n\t'.MuiTableContainer-root': {\n\t\tmaxHeight: 'clamp(350px, 100vh - 200px, 9999px) !important',\n\t},\n\n\t'.MuiPaper-root': {\n\t\tboxShadow: 'none',\n\n\t},\n\t'.MuiPaginationItem-root': {\n\t\t'&.Mui-selected': {\n\t\t\tbackgroundColor: palette?.theme?.primary[700],\n\t\t\tcolor: 'white'\n\t\t}\n\t},\n\t'.MuiTableRow-root': {\n\t\t'&.Mui-selected': {\n\t\t\tbackgroundColor: `${palette?.theme?.primary[100]} !important`,\n\t\t\tcolor: 'white'\n\t\t}\n\t},\n\t'.MuiCheckbox-indeterminate': {\n\t\tcolor: `${palette?.theme?.primary[700]} !important`,\n\t\t\"& svg\": {\n\t\t\theight: `20px !important`,\n\t\t\twidth: `20px !important`,\n\t\t}\n\t}\n}));\n\nconst MaterialEditableTable = React.memo(({\n\tenablePagination = false,\n\trows,\n\tcolumns,\n\ttotalPages,\n\tpaginationModel,\n\tcolumnOrder,\n\tupdateData,\n\thandleColumnOrdering,\n\tenableEditing,\n\tenableColumnDragging,\n\tstates,\n\trowActionMenu,\n\tdestructiveActionMenu,\n\tdisableDefaultActionColumn,\n\tenableRowSelection,\n\tdefaultActionColumnItems = [],\n\tenableBottomToolbar,\n\tSetSelectedRowId,\n\tisResetRow,\n\tonCreateRow,\n\tonEditRow,\n\tonDeleteRow,\n\teditDisplayMode,\n\tenableRowCreate,\n\tonChangeRowField,\n\tonSelectRow,\n\tenableColumnResizing = true,\n\tselectedRowIds = [],\n\tonColumnVisibility,\n\tonSortingChange,\n\tgetSelectedData,\n\tdisabledDefaultActionColumnIcon = false,\n\tenableAddCustomField = true,\n\tenableRowDragging = false,\n\thandleColumnResizing = () => { },\n\tcolumnSizes = {},\n\t// eslint-disable-next-line unused-imports/no-unused-vars, @typescript-eslint/no-unused-vars\n\t// getRowId,\n\t// onDelete,\n\t// onUpdate,\n\t...rest\n}: MaterialTablePropsType) => {\n\tconst { t } = useTranslation();\n\tconst { formData = null, updatePageInfo, activePage: aPage } = usePages()\n\tconst activePage = useDeepMemo<PageState>(aPage);\n\tconst { pageNo } = paginationModel;\n\tconst [row, setRow] = useState({});\n\tconst [tableColumns, setTableColumns] = useState(columns);\n\tconst [anchorEl, setAnchorEl] = useState<null | HTMLElement>(null);\n\tconst [popUpShow, setPopupShow] = useState<boolean>(false);\n\tconst [rowAnchorEl, setRowAnchorEl] = useState<null | HTMLElement>(null);\n\tconst visibleColumns = tableColumns.filter((column: any) => column.visible);\n\tconst hiddenColumns = tableColumns.filter((column: any) => !column.visible);\n\tconst [filteredOptions, setFilteredOptions] = useState(hiddenColumns);\n\tconst [selectedRow, setSelectedRow] = useState<number | null>(null);\n\tconst [validationErrors, setValidationErrors] = useState<any>({});\n\tconst [validationSchema, setValidationSchema] = useState<any>([]);\n\tconst [isCreatingRow, setIsCreatingRow] = useState<boolean>(false);\n\tconst [isEditingRow, setIsEditingRow] = useState<boolean>(false);\n\tconst [isDeletingRow, setIsDeletingRow] = useState<boolean>(false);\n\tconst [rowToDelete, setRowToDelete] = useState<any>(null);\n\tconst [rowSelection, setRowSelection] = useState<MRT_RowSelectionState>({});\n\tconst [isChecked, setIsChecked] = useState(false)\n\tconst [sorting, setSorting] = useState<MRT_SortingState>([]);\n\tconst [disableNextEdit, setDisableNextEdit] = useState(false);\n\tconst [columnSizing, setColumnSizing] = useState<MRT_ColumnSizingState>(activePage.column_sizes);\n\tconst [columnSizingInfo, setColumnSizingInfo] = useState<MRT_ColumnSizingInfoState>({\n\t\tcolumnSizingStart: [],\n\t\tdeltaOffset: null,\n\t\tdeltaPercentage: null,\n\t\tisResizingColumn: false,\n\t\tstartOffset: null,\n\t\tstartSize: null\n\t});\n\tconst [clickStartTime, setClickStartTime] = useState<number>(0);\n\n\tconst navigate = useNavigate();\n\tconst currentModule = location.pathname.split('/')[2]\n\n\tlet redirectionPath = ''\n\tswitch (currentModule) {\n\t\tcase 'accounting':\n\t\t\tredirectionPath = PathnameAccounting.CUSTOM_FORM\n\t\t\tbreak;\n\t\tcase 'inventory':\n\t\t\tredirectionPath = PathnameInventory.CUSTOM_FORM\n\t\t\tbreak;\n\t\tcase 'manufacturing':\n\n\t\t\tredirectionPath = PathnameManufacturing.CUSTOM_FORM\n\t\t\tbreak;\n\t\tcase 'procurement':\n\t\t\tredirectionPath = PathnamePurchase.CUSTOM_FORM\n\t\t\tbreak;\n\t\tcase 'crm':\n\t\t\tredirectionPath = PathnameCrm.CUSTOM_FORM\n\t\t\tbreak;\n\t\tcase 'user':\n\t\t\tredirectionPath = PathnameUsers.CUSTOM_FORM\n\t\t\tbreak;\n\t\tcase 'rental':\n\t\t\tredirectionPath = PathnameRental.CUSTOM_FORM\n\t\t\tbreak;\n\t\tcase 'drive':\n\t\t\tredirectionPath = PathnameDocument.ADD_CUSTOM_FIELDS\n\t\t\tbreak;\n\t}\n\tconst path = `/dashboard/${currentModule}${redirectionPath}`\n\tconst getValidationType = (column: any) => {\n\t\tswitch (column.editVariant) {\n\t\t\tcase 'select':\n\t\t\t\treturn column?.editProperties?.is_multiple ? yup.array() : yup.string();\n\n\t\t\tcase 'number':\n\t\t\t\treturn yup.number().nullable().transform((value, originalValue) => (originalValue === \"\" ? null : value));\n\n\t\t\tcase 'url':\n\t\t\t\treturn yup\n\t\t\t\t\t.string()\n\t\t\t\t\t.matches(\n\t\t\t\t\t\t/^(https?:\\/\\/)?((([a-zA-Z0-9_-]+\\.)+[a-zA-Z]{2,})|localhost)(:\\d{2,5})?(\\/[a-zA-Z0-9#_-]+\\/?)*(\\?[a-zA-Z0-9&=_-]+)?(#\\S+)?$/,\n\t\t\t\t\t\t{ excludeEmptyString: true, message: 'Please enter valid URL.' }\n\t\t\t\t\t);\n\n\t\t\tdefault:\n\t\t\t\treturn yup.string()\n\t\t}\n\t};\n\n\tconst validationReducer = (\n\t\tvalidations: any,\n\t\tvalidation: any,\n\t\tcolumn: any\n\t) => {\n\t\tlet vld = validations\n\t\tswitch (validation.type) {\n\t\t\tcase 'required':\n\t\t\t\tvld = validation.value\n\t\t\t\t\t? validations.required(validation.msg_en).typeError(validation.msg_en)\n\t\t\t\t\t: column?.editProperties?.is_multiple\n\t\t\t\t\t\t? validations.min(1, validation.msg_en)\n\t\t\t\t\t\t: validations;\n\t\t\t\tbreak\n\t\t\tcase 'min':\n\t\t\t\tvld = validations.min(validation.value, validation.msg_en);\n\t\t\t\tbreak\n\t\t\tcase 'email':\n\t\t\t\tvld = validations.email(validation.value, validation.msg_en);\n\t\t\t\tbreak\n\t\t\tcase 'max':\n\t\t\t\tvld = validations.max(validation.value, validation.msg_en);\n\t\t\t\tbreak\n\t\t\tcase 'positive':\n\t\t\t\tvld = validation.value === true ? validations.test('is-positive-number', 'Value must be a positive number', (value) => !value || value >= 0) : validations;\n\t\t\t\tbreak\n\t\t\tcase 'when':\n\t\t\t\treturn validations.when(validation.relation, {\n\t\t\t\t\tis: (val: any) => val === validation.values,\n\t\t\t\t\tthen: () =>\n\t\t\t\t\t\tvalidation?.thenValidations?.reduce(\n\t\t\t\t\t\t\t(validations: any, validation: any) =>\n\t\t\t\t\t\t\t\tvalidationReducer(validations, validation, column),\n\t\t\t\t\t\t\tvalidations\n\t\t\t\t\t\t) || validations,\n\t\t\t\t\totherwise: () =>\n\t\t\t\t\t\tvalidation?.otherWiseValidations?.reduce(\n\t\t\t\t\t\t\t(validations: any, validation: any) =>\n\t\t\t\t\t\t\t\tvalidationReducer(validations, validation, column),\n\t\t\t\t\t\t\tvalidations\n\t\t\t\t\t\t) || validations\n\t\t\t\t});\n\t\t\t// Add more cases for other validation types as needed\n\t\t\tdefault:\n\t\t\t\tvld = validations;\n\t\t\t\tbreak\n\t\t}\n\n\t\tif (validation.type == 'required' && validation.value && (!column?.editVariant || column?.editVariant == 'text')) {\n\t\t\tvld = validations.test('no-blank-spaces', 'Blank space is not allowed', (value) => {\n\t\t\t\treturn value && value.trim()?.length > 0;\n\t\t\t})\n\t\t}\n\n\t\treturn vld\n\n\t};\n\n\n\tconst generateValidationSchema = (columns: any[]) => {\n\t\tconst schema: any = {};\n\t\tcolumns.forEach((clm) => {\n\t\t\tif (clm?.editProperties?.validations?.length) {\n\t\t\t\tconst fieldValidations = clm?.editProperties?.validations.reduce(\n\t\t\t\t\t(validations: any, validation: any) =>\n\t\t\t\t\t\tvalidationReducer(validations, validation, clm),\n\t\t\t\t\tgetValidationType(clm)\n\t\t\t\t);\n\t\t\t\tschema[clm.accessorKey] = fieldValidations;\n\t\t\t}\n\t\t});\n\t\treturn schema;\n\t};\n\n\tuseEffect(() => {\n\t\tsetTableColumns(columns);\n\n\t\tconst schema: any = generateValidationSchema(columns);\n\t\tsetValidationSchema(yup.object().shape(schema));\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [columns]);\n\n\tuseEffect(() => {\n\t\tif (!columnSizingInfo?.isResizingColumn) {\n\t\t\tupdatePageInfo({ column_sizes: { ...activePage.column_sizes, ...columnSizing } })\n\t\t\thandleColumnResizing?.(columnSizing)\n\t\t}\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [columnSizingInfo?.isResizingColumn, columnSizing])\n\n\tconst handleHeaderClick = (event: any) => {\n\t\tsetAnchorEl(event.currentTarget);\n\t};\n\n\tconst handleHeaderClose = () => {\n\t\tsetAnchorEl(null);\n\t};\n\n\tconst handleVisibleColumn = (column: any) => {\n\t\tconst updatedColumns = tableColumns.map((col: any) => ({\n\t\t\t...col,\n\t\t\tvisible: col.accessorKey === column.accessorKey ? false : col.visible\n\t\t}));\n\t\tsetTableColumns(updatedColumns);\n\t\tonColumnVisibility?.(JSON.parse(JSON.stringify(updatedColumns)))\n\t\tsetFilteredOptions([...filteredOptions, column]);\n\t\tsetAnchorEl(null);\n\t};\n\n\tconst handleAddButtonClick = () => {\n\t\tsetPopupShow(true);\n\t};\n\n\tconst handleBackButtonClick = () => {\n\t\tsetPopupShow(false);\n\t};\n\n\tconst handleAddColumn = (column: any) => {\n\t\tconst updatedColumns = tableColumns.map((col: any) => ({\n\t\t\t...col,\n\t\t\tvisible: col.accessorKey === column.accessorKey ? true : col.visible\n\t\t}));\n\t\tonColumnVisibility?.(JSON.parse(JSON.stringify(updatedColumns)))\n\t\tsetTableColumns(updatedColumns);\n\n\t\tconst updatedFilteredOptions = filteredOptions.filter(\n\t\t\t(option: any) => option.accessorKey !== column.accessorKey\n\t\t);\n\t\tsetFilteredOptions(updatedFilteredOptions);\n\t\tsetAnchorEl(null);\n\t\tsetPopupShow(false);\n\t};\n\n\tconst handleSearchEvent = (searchQuery: string) => {\n\t\tconst filteredColumns = hiddenColumns.filter((option: any) =>\n\t\t\toption.header.toLowerCase().includes(searchQuery.toLowerCase())\n\t\t);\n\t\tsetFilteredOptions(filteredColumns);\n\t};\n\n\tconst handleCustomAddColumn = () => {\n\t\tnavigate(path, { state: formData })\n\t\tsetAnchorEl(null);\n\t\tsetPopupShow(false);\n\t};\n\n\tconst handleRowClick = (rowId: number) => {\n\t\tsetSelectedRow(rowId); // Update selected row ID when a row is clicked\n\t};\n\n\t// const handleDeleteClick = (event: any, data: any) => {\n\t// onDelete?.(data.id);\n\t// };\n\t// const handleUpdateClick = (event: any, data: any) => {\n\t// onUpdate?.(data.id);\n\t// };\n\n\tconst handleActionsClick = (event: any, data: any) => {\n\t\tsetRow(data);\n\t\tsetRowAnchorEl(event.currentTarget);\n\t};\n\n\tconst handleActionsClose = () => {\n\t\tsetRowAnchorEl(null);\n\t};\n\n\tconst formtValues = useCallback((values: any, cells: any[]) => {\n\t\tconst v: any = {};\n\t\tObject.keys(values).forEach((vl) => {\n\t\t\tconst val = values[vl];\n\t\t\tconst cell = cells.find((c) => c.accessorKey == vl);\n\n\t\t\tif (val) {\n\t\t\t\tif (val instanceof File) {\n\t\t\t\t\tv[vl] = val.name;\n\t\t\t\t} else if (cell && cell?.editVariant == 'date') {\n\t\t\t\t\tv[vl] = dayjs(val).format(cell?.dateFormat || 'DD-MM-YYYY');\n\t\t\t\t} else if (cell && cell?.editVariant == 'select' && typeof val === 'object' && val !== null) {\n\t\t\t\t\t// For select fields, extract the display name from the object\n\t\t\t\t\t// Try multiple possible display properties in order of preference\n\t\t\t\t\tv[vl] = val.name || val.label || val.display_name || val.title || val.value || val.id || val;\n\t\t\t\t} else if (cell && cell?.editVariant == 'select' && typeof val === 'string') {\n\t\t\t\t\t// For select fields that are already strings, keep them as is\n\t\t\t\t\tv[vl] = val;\n\t\t\t\t} else {\n\t\t\t\t\tv[vl] = val;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tv[vl] = val;\n\t\t\t}\n\t\t});\n\n\t\treturn v;\n\t}, []); // No dependencies needed as this function doesn't rely on external values\n\n\tconst handleRowDelete = async () => {\n\t\tsetIsDeletingRow(true);\n\t\tif (rowToDelete) {\n\t\t\tawait onDeleteRow?.(rowToDelete);\n\t\t\tsetRowToDelete(null);\n\t\t}\n\t\tsetIsDeletingRow(false);\n\t};\n\n\tconst checkRequired = useCallback((editProperties: any) => {\n\t\treturn editProperties?.validations?.some((validation: any) => validation.type === 'required')\n\t}, [])\n\tuseEffect(() => {\n\t\tconst selectedRows = {};\n\t\t// Build the selectedRows object\n\t\tif (!isChecked && selectedRowIds.length) {\n\t\t\trows.forEach((row) => {\n\t\t\t\tif (selectedRowIds.includes(row.id)) {\n\t\t\t\t\tselectedRows[row.id] = true;\n\t\t\t\t}\n\t\t\t});\n\t\t\tsetRowSelection(selectedRows);\n\t\t\tsetIsChecked(true)\n\t\t}\n\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [rows, selectedRowIds]); // Dependency only on rows and selectedRowIds\n\n\tuseEffect(() => {\n\t\tif (onSortingChange instanceof Function) {\n\t\t\tconst sortingArray = Array.isArray(sorting) ? sorting : [];\n\t\t\tonSortingChange(sortingArray[0] || null)\n\t\t}\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [sorting])\n\n\n\tconst resetRowSelection = () => {\n\t\tsetRowSelection({});\n\t\tsetDisableNextEdit(false)\n\t}\n\tconst getTextWidth = (text: string) => {\n\t\tconst canvas = document.createElement(\"canvas\");\n\t\tconst ctx = canvas.getContext(\"2d\");\n\t\tif (!ctx) return 50;\n\t\treturn ctx.measureText(text).width + 5; // padding\n\t}\n\n\tconst handleSaveRow = useCallback(async (row: any, values: any, tableInstance: any) => {\n\t\tconsole.log('handleSaveRow', onEditRow);\n\t\ttry {\n\t\t\tawait validationSchema.validate(values, {\n\t\t\t\tabortEarly: false\n\t\t\t});\n\t\t\tsetValidationErrors({});\n\t\t\tsetIsEditingRow(true);\n\t\t\tsetDisableNextEdit(false)\n\t\t\tconst cells = row.getAllCells().map((c: any) => c.column.columnDef);\n\t\t\trow._valuesCache = formtValues(values, cells);\n\n\t\t\tconst data = { row, values, table: tableInstance };\n\n\t\t\tif (onEditRow) {\n\t\t\t\tawait onEditRow(data, 'edit');\n\t\t\t}\n\t\t\tsetIsEditingRow(false);\n\t\t\ttableInstance.setEditingRow(null);\n\t\t} catch (err) {\n\t\t\tconsole.log(\"handleSaveRow error\", err);\n\t\t\tsetIsEditingRow(false);\n\t\t\tif (err instanceof yup.ValidationError) {\n\t\t\t\tconst errors: Record<string, string> = {};\n\n\t\t\t\terr.inner.forEach((error) => {\n\t\t\t\t\tif (error.path) {\n\t\t\t\t\t\terrors[error.path] = error.message;\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\tsetValidationErrors(errors);\n\t\t\t} else if (err instanceof Error) {\n\t\t\t\tenqueueSnackbar(err.message, { variant: 'error' })\n\t\t\t} else {\n\t\t\t\tenqueueSnackbar('Something went wrong', { variant: 'error' })\n\t\t\t}\n\t\t}\n\t}, [validationSchema, onEditRow, formtValues]);\n\n\tconst table = useMaterialReactTable({\n\t\t// options:{\n\t\t// \ttableLayout: \"auto\", // 👈 important\n\t\t// \tpadding: \"dense\",\n\t\t// },\n\t\t// columns: visibleColumns,\n\t\tdefaultColumn: {\n\t\t\tminSize: 0, // 👈 remove default min width\n\t\t\tsize: undefined, // 👈 optional, default size\n\t\t},\n\t\tcolumns: [\n\t\t\t...visibleColumns.map((c: any) => {\n\t\t\t\tconst headerWidth = getTextWidth(c.header || '');\n\t\t\t\tconst maxCellWidth = Math.max(\n\t\t\t\t\t...rows.map(row => getTextWidth(String(row[c.accessorKey] ?? '')))\n\t\t\t\t);\n\t\t\t\tconst finalWidth = Math.max(headerWidth, maxCellWidth);\n\t\t\t\treturn {\n\t\t\t\t\t...c,\n\t\t\t\t\t...(editDisplayMode === 'row'\n\t\t\t\t\t\t? {\n\t\t\t\t\t\t\tEdit: ({ cell, row, table, column }) => {\n\t\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t\t<InlineEditFields\n\t\t\t\t\t\t\t\t\t\tcell={cell}\n\t\t\t\t\t\t\t\t\t\tcolumn={column}\n\t\t\t\t\t\t\t\t\t\tcol={c}\n\t\t\t\t\t\t\t\t\t\trow={row}\n\t\t\t\t\t\t\t\t\t\ttable={table}\n\t\t\t\t\t\t\t\t\t\tcallback={(s) => console.log('Save', s)}\n\t\t\t\t\t\t\t\t\t\terrors={validationErrors}\n\t\t\t\t\t\t\t\t\t\tvalidationSchema={validationSchema}\n\t\t\t\t\t\t\t\t\t\tsetValidationErrors={setValidationErrors}\n\t\t\t\t\t\t\t\t\t\tonChangeRowField={onChangeRowField}\n\t\t\t\t\t\t\t\t\t\tgetSelectedData={(name, row) => getSelectedData?.(name, row)}\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t}\n\t\t\t\t\t\t: {}),\n\t\t\t\t\tHeader: (\n\t\t\t\t\t\t<Box display='flex' alignItems='center'>\n\t\t\t\t\t\t\t{c.header}\n\t\t\t\t\t\t\t{c?.required || checkRequired(c?.editProperties) && (\n\t\t\t\t\t\t\t\t<Typography type='s5' color='theme.error.600'>\n\t\t\t\t\t\t\t\t\t*\n\t\t\t\t\t\t\t\t</Typography>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t</Box>\n\t\t\t\t\t),\n\t\t\t\t\tenableColumnDragging: c.id !== 'actions',\n\t\t\t\t\t// cellStyle: { ...c.cellStyle, width: finalWidth },\n\t\t\t\t\t// headerStyle: { ...c.headerStyle, width: finalWidth },\n\t\t\t\t\t// size: finalWidth\n\t\t\t\t\tsize: undefined,\n\t\t\t\t\t// minSize: 40,\n\t\t\t\t\tmaxSize: 800,\n\t\t\t\t};\n\t\t\t}),\n\t\t\t...(!disableDefaultActionColumn\n\t\t\t\t? [\n\t\t\t\t\t{\n\t\t\t\t\t\tid: 'actions',\n\t\t\t\t\t\tenableEditing: false,\n\t\t\t\t\t\tsize: defaultActionColumnItems?.length > 1 ? 80 : 50,\n\t\t\t\t\t\theader: (\n\t\t\t\t\t\t\t<IconButton size=\"small\" sx={{ p: 0.5, '&:hover': { backgroundColor: 'transparent' } }} onClick={handleHeaderClick}>\n\t\t\t\t\t\t\t\t<img src={images.common.arrowIcon} alt='Arrow Icon' />\n\t\t\t\t\t\t\t</IconButton>\n\t\t\t\t\t\t),\n\t\t\t\t\t\tenableColumnDragging: false,\n\t\t\t\t\t\tvisible: true,\n\t\t\t\t\t\tmuiTableHeadCellProps: {\n\t\t\t\t\t\t\tclassName: 'pinned-column'\n\t\t\t\t\t\t},\n\t\t\t\t\t\tmuiTableBodyCellProps: {\n\t\t\t\t\t\t\tclassName: 'pinned-column',\n\t\t\t\t\t\t\tsx: {\n\t\t\t\t\t\t\t\twhiteSpace: 'pre-wrap'\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\t\t\t\t\tCell: (props) =>\n\t\t\t\t\t\t\tdefaultActionColumnItems?.length ? (\n\t\t\t\t\t\t\t\tdefaultActionColumnItems.map((item) => {\n\t\t\t\t\t\t\t\t\tconst updatedProps = {\n\t\t\t\t\t\t\t\t\t\t...item.props,\n\t\t\t\t\t\t\t\t\t\tonClick: () => item.props.onClick(props)\n\t\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t\t\treturn cloneElement(item, updatedProps);\n\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t) : !disabledDefaultActionColumnIcon && (\n\t\t\t\t\t\t\t\t<IconButton\n\t\t\t\t\t\t\t\t\tonClick={(e) => handleActionsClick(e, props.row.original)} disabled={!rowActionMenu?.length && !destructiveActionMenu?.length}>\n\t\t\t\t\t\t\t\t\t<img src={images.more} alt='More Icon' />\n\t\t\t\t\t\t\t\t</IconButton>\n\t\t\t\t\t\t\t)\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t\t: [])\n\t\t],\n\t\tdata: rows,\n\t\tmuiTablePaperProps: {\n\t\t\tsx: {\n\t\t\t\ttableLayout: 'auto', // lets columns shrink to fit content\n\t\t\t},\n\t\t},\n\t\tcolumnResizeMode: 'onChange',\n\t\tonEditingRowSave: async (data) => {\n\t\t\tawait handleSaveRow(data.row, data.values, data.table);\n\t\t},\n\t\tonCreatingRowSave: async (data) => {\n\t\t\ttry {\n\t\t\t\tawait validationSchema.validate(data.values, {\n\t\t\t\t\tabortEarly: false\n\t\t\t\t});\n\t\t\t\tsetValidationErrors({});\n\t\t\t\tsetIsCreatingRow(true);\n\t\t\t\tsetDisableNextEdit(false)\n\t\t\t\tconst cells = data.row.getAllCells().map((c) => c.column.columnDef);\n\n\t\t\t\tdata.row._valuesCache = formtValues(data.values, cells);\n\n\t\t\t\tif (onCreateRow) {\n\t\t\t\t\tawait onCreateRow(data);\n\t\t\t\t}\n\t\t\t\tsetIsCreatingRow(false);\n\t\t\t\tdata.table.setCreatingRow(null);\n\t\t\t} catch (err) {\n\t\t\t\tsetIsCreatingRow(false);\n\t\t\t\tif (err instanceof yup.ValidationError) {\n\t\t\t\t\tconst errors: Record<string, string> = {};\n\n\t\t\t\t\terr.inner.forEach((error) => {\n\t\t\t\t\t\tif (error.path) {\n\t\t\t\t\t\t\terrors[error.path] = error.message;\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t\tsetValidationErrors(errors);\n\t\t\t\t} else if (err instanceof Error) {\n\t\t\t\t\tenqueueSnackbar(err.message, { variant: 'error' })\n\t\t\t\t} else {\n\t\t\t\t\tenqueueSnackbar('Something went wrong', { variant: 'error' })\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\tonCreatingRowCancel: () => resetRowSelection(),\n\t\tonEditingRowCancel: () => {\n\t\t\tconsole.log('onEditingRowCancel called');\n\t\t\tsetDisableNextEdit(false);\n\t\t},\n\t\tonSortingChange: states?.sorting ? onSortingChange : setSorting,\n\n\t\tdisplayColumnDefOptions: {\n\t\t\t'mrt-row-actions': {\n\t\t\t\t// size: onDeleteRow ? 80 : 50,\n\n\t\t\t\tHeader: (\n\t\t\t\t\t<IconButton onClick={handleHeaderClick} size='small'>\n\t\t\t\t\t\t<img src={images.common.arrowIcon} alt='Arrow Icon' />\n\t\t\t\t\t</IconButton>\n\t\t\t\t),\n\t\t\t\tmuiTableBodyCellProps: ({ row, table }) => {\n\t\t\t\t\tconst isCreatingRow = table.getState().creatingRow?.id === row.id;\n\t\t\t\t\tconst isEditingRow = table.getState().editingRow?.id === row.id;\n\t\t\t\t\treturn {\n\t\t\t\t\t\tsx: {\n\t\t\t\t\t\t\t'& .MuiBox-root': {\n\t\t\t\t\t\t\t\tgap: 0\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tbackgroundColor: '#fff',\n\t\t\t\t\t\t\twhiteSpace: 'pre-wrap',\n\t\t\t\t\t\t\t// Hide save button only when editing existing row (not in create mode or non-editable mode)\n\t\t\t\t\t\t\t...(isEditingRow && !isCreatingRow && {\n\t\t\t\t\t\t\t\t'& .MuiBox-root > .MuiIconButton-root:first-of-type': {\n\t\t\t\t\t\t\t\t\tdisplay: 'none !important'\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t// Also hide any save icon buttons by aria-label or title\n\t\t\t\t\t\t\t\t'& button[aria-label*=\"Save\"]': {\n\t\t\t\t\t\t\t\t\tdisplay: 'none !important'\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t'& button[title*=\"Save\"]': {\n\t\t\t\t\t\t\t\t\tdisplay: 'none !important'\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t// Hide save icon by class or data attributes\n\t\t\t\t\t\t\t\t'& .MuiIconButton-root[class*=\"save\"]': {\n\t\t\t\t\t\t\t\t\tdisplay: 'none !important'\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t'& .MuiIconButton-root[data-testid*=\"save\"]': {\n\t\t\t\t\t\t\t\t\tdisplay: 'none !important'\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t},\n\t\t\t\t\t\tonKeyUp: (e) => console.log(e)\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t},\n\t\t\t'mrt-row-expand': {\n\t\t\t\tsize: 70, // Set the size of the expand-collapse arrow column here\n\t\t\t},\n\t\t\t'mrt-row-select': {\n\t\t\t\tsize: 50, // Set the width of the checkbox column here\n\t\t\t},\n\t\t},\n\t\trenderRowActions: ({ row, table }) => (\n\t\t\t<>\n\t\t\t\t{rest?.enableExpanding ? (\n\t\t\t\t\t<>\n\t\t\t\t\t\t{row?.parentId && (\n\t\t\t\t\t\t\t<Box sx={{ display: 'flex', gap: 0 }}>\n\t\t\t\t\t\t\t\t{onDeleteRow && (\n\t\t\t\t\t\t\t\t\t<Tooltip title='Delete'>\n\t\t\t\t\t\t\t\t\t\t<IconButton disabled={disableNextEdit} onClick={() => setRowToDelete(row)} size='small'>\n\t\t\t\t\t\t\t\t\t\t\t<Trash fontSize='small' sx={{ color: 'theme.secondary.1000' }} />\n\t\t\t\t\t\t\t\t\t\t</IconButton>\n\t\t\t\t\t\t\t\t\t</Tooltip>\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t</Box>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</>\n\t\t\t\t) : (\n\t\t\t\t\t<Box sx={{ display: 'flex', gap: 0 }}>\n\t\t\t\t\t\t{onDeleteRow && (\n\t\t\t\t\t\t\t<Tooltip title='Delete'>\n\t\t\t\t\t\t\t\t<IconButton disabled={disableNextEdit} onClick={() => setRowToDelete(row)}>\n\t\t\t\t\t\t\t\t\t<Trash fontSize='small' sx={{ color: 'theme.secondary.1000' }} />\n\t\t\t\t\t\t\t\t</IconButton>\n\t\t\t\t\t\t\t</Tooltip>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</Box>\n\t\t\t\t)}\n\t\t\t</>\n\t\t),\n\n\t\t...(Boolean(enableRowCreate) && {\n\t\t\trenderBottomToolbarCustomActions: ({ table }) => (\n\t\t\t\t<Button\n\t\t\t\t\tvariant='outlined'\n\t\t\t\t\tstartIcon={<Add />}\n\t\t\t\t\tclassName='add-row-btn'\n\t\t\t\t\tdisabled={disableNextEdit}\n\t\t\t\t\tonClick={() => {\n\t\t\t\t\t\ttable.setCreatingRow(true); //simplest way to open the create row modal with no default values\n\t\t\t\t\t\tsetDisableNextEdit(true)\n\t\t\t\t\t}}>\n\t\t\t\t\t{t('common.add')}\n\t\t\t\t</Button>\n\t\t\t)\n\t\t}),\n\t\tonRowSelectionChange: setRowSelection,\n\t\tenableColumnOrdering: true,\n\t\tenableRowSelection: enableRowSelection ?? true,\n\t\tenableEditing: enableEditing instanceof Function ? enableEditing() : enableEditing ?? true,\n\t\teditDisplayMode: editDisplayMode ?? 'row',\n\t\tcreateDisplayMode: 'row',\n\t\tenableColumnResizing: enableColumnResizing,\n\t\tenableRowDragging: enableRowDragging,\n\t\tenableTopToolbar: false,\n\t\tenableColumnActions: false,\n\t\tenableSorting: true,\n\t\tenableGrouping: true,\n\t\tenableBottomToolbar: enableBottomToolbar ?? false,\n\t\tenableColumnDragging: enableColumnDragging ?? true,\n\t\tenableStickyHeader: true,\n\t\tenableSortingRemoval: false,\n\t\t// column ordering\n\t\tstate: {\n\t\t\t// columnOrder: (!columnOrder || columnOrder.length <= 1) \n\t\t\t// ? [...internalColumnOrder] \n\t\t\t// : [...columnOrder],\n\t\t\tcolumnOrder: columnOrder,\n\t\t\tcolumnPinning: { left: ['actions', 'mrt-row-actions'] },\n\t\t\tisSaving: isCreatingRow || isEditingRow,\n\t\t\tshowProgressBars: false,\n\t\t\trowSelection,\n\t\t\t...states,\n\t\t\tsorting: Array.isArray(states?.sorting) ? states?.sorting :\n\t\t\t\tArray.isArray(sorting) ? sorting : [],\n\t\t\tcolumnSizing\n\n\t\t},\n\t\tgetRowId: (row) => row?.id,\n\t\t// table.getState().editingRow\n\t\tmuiTableBodyRowProps: ({ row, table }) => {\n\t\t\tconst editingRowId =\n\t\t\t\ttable.getState()?.editingRow?.id ||\n\t\t\t\ttable.getState()?.creatingRow?.id ||\n\t\t\t\tnull;\n\t\t\tconst isErrorRow = Boolean(row?.original?.has_error)\n\t\t\tconst isCurrentlyEditing = editingRowId === row.id;\n\n\t\t\treturn {\n\t\t\t\tonClick: () => {\n\t\t\t\t\tsetSelectedRow(row.id);\n\t\t\t\t\tconsole.log('Row clicked:', row.id, 'editingRowId:', editingRowId, 'isCurrentlyEditing:', isCurrentlyEditing, 'disableNextEdit:', disableNextEdit);\n\n\t\t\t\t\t// If there's a row currently being edited and it's not this row, save it first then edit this row\n\t\t\t\t\tif (editingRowId && editingRowId !== row.id) {\n\t\t\t\t\t\t// Exit edit mode on the current row (this triggers onEditingRowSave)\n\t\t\t\t\t\ttable.setEditingRow(null);\n\t\t\t\t\t\t// Use setTimeout to let the save complete before editing the new row\n\t\t\t\t\t\tsetTimeout(() => {\n\t\t\t\t\t\t\ttable.setEditingRow(row);\n\t\t\t\t\t\t\tsetDisableNextEdit(true);\n\t\t\t\t\t\t}, 100);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\t// Set the row as editable when clicked if not already editing and no other row is being edited\n\t\t\t\t\tif (!disableNextEdit && !isCurrentlyEditing && !editingRowId) {\n\t\t\t\t\t\tconsole.log('Setting row as editable:', row.id);\n\t\t\t\t\t\ttable.setEditingRow(row);\n\t\t\t\t\t\tsetDisableNextEdit(true);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tconsole.log('Cannot edit row - conditions not met');\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tonKeyDown: (e) => {\n\t\t\t\t\t// Handle keyboard events for editing\n\t\t\t\t\tif (isCurrentlyEditing) {\n\t\t\t\t\t\tif (e.key === 'Enter') {\n\t\t\t\t\t\t\t// Save on Enter\n\t\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t\t\ttable.setEditingRow(null);\n\t\t\t\t\t\t} else if (e.key === 'Escape') {\n\t\t\t\t\t\t\t// Cancel on Escape\n\t\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t\t\tconsole.log('Escape pressed, canceling edit for row:', row.id);\n\t\t\t\t\t\t\ttable.setEditingRow(null);\n\t\t\t\t\t\t\t// Immediately reset disableNextEdit to allow re-editing\n\t\t\t\t\t\t\tsetDisableNextEdit(false);\n\t\t\t\t\t\t\thandleSaveRow(row, row._valuesCache || row.original, table);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tsx: {\n\t\t\t\t\tcursor: 'pointer',\n\t\t\t\t\t// backgroundColor: !editingRowId\n\t\t\t\t\t// \t? (selectedRow === row.id\n\t\t\t\t\t// \t\t? '#e8e8e8'\n\t\t\t\t\t// \t\t: (isErrorRow ? 'theme.error.100' : 'inherit'))\n\t\t\t\t\t// \t: 'inherit',\n\t\t\t\t\tbackgroundColor: !editingRowId\n\t\t\t\t\t\t? (isErrorRow ? 'theme.error.100' : 'inherit')\n\t\t\t\t\t\t: 'inherit',\n\t\t\t\t\t'&:hover': {\n\t\t\t\t\t\tbackgroundColor: editingRowId ? 'transparent' : (isErrorRow ? 'theme.error.200' : '#e8e8e8') // Removes hover effect globally\n\t\t\t\t\t},\n\t\t\t\t\t'&:hover td:after': {\n\t\t\t\t\t\tbackgroundColor: 'transparent' // Removes the grey background applied via :after\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t};\n\t\t},\n\t\tonColumnOrderChange: (colOrder: any) => {\n\t\t\tif (handleColumnOrdering) handleColumnOrdering(colOrder);\n\t\t},\n\t\tonColumnSizingChange: setColumnSizing,\n\t\tonColumnSizingInfoChange: setColumnSizingInfo,\n\n\t\trenderEmptyRowsFallback: () => (\n\t\t\t<Box className='no-data'>\n\t\t\t\t<img src={images.common.tableNoData} />\n\t\t\t\t<Typography type='s3' weight='medium' color='theme.secondary.1000'>\n\t\t\t\t\t{/* sx={{ textAlign: 'center', pb: 4.75, pt: 4.75 }}> */}\n\t\t\t\t\t{t('common.noData')}\n\t\t\t\t</Typography>\n\t\t\t</Box>\n\t\t),\n\n\t\t// pagination\n\t\tenablePagination: enablePagination,\n\t\tpaginationDisplayMode: 'pages',\n\t\tmuiPaginationProps: {\n\t\t\tshape: 'rounded',\n\t\t\tpage: pageNo, // current page number\n\t\t\tcount: totalPages, // total pages\n\t\t\tshowRowsPerPage: false, // Hide rows per page options\n\t\t\tboundaryCount: 3\n\t\t},\n\n\t\tmuiEditTextFieldProps: ({ row, column }) => ({\n\t\t\tInputProps: {\n\t\t\t\tdisableUnderline: true\n\t\t\t},\n\t\t\tonBlur: (e) => {\n\t\t\t\tupdateData(e.target.value, column, row.id);\n\t\t\t},\n\t\t\t// onChange: (e) => {\n\t\t\t// \tupdateData(e.target.value, column, row.id);\n\t\t\t// },\n\t\t\tvariant: 'outlined',\n\t\t\tsx: ({ palette }) => ({\n\t\t\t\t'& .MuiOutlinedInput-root': {\n\t\t\t\t\t'& fieldset': {\n\t\t\t\t\t\tborderColor: `${palette.theme?.primary[700]} !important`\n\t\t\t\t\t\t// backgroundColor: palette.theme?.primary[700]\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t})\n\t\t}),\n\n\t\t/* Table loader style */\n\t\tmuiCircularProgressProps: {\n\t\t\tsx: {\n\t\t\t\tcolor: '#289B64'\n\t\t\t}\n\t\t},\n\n\t\t// Table header cell default styles\n\t\tmuiTableHeadCellProps: {\n\t\t\tsx: {\n\t\t\t\tlineHeight: '140%',\n\t\t\t\tletterSpacing: '-0.28px',\n\t\t\t\tfontWeight: '500',\n\t\t\t\tfontSize: '0.875rem',\n\t\t\t\t'& .Mui-TableHeadCell-Content': {\n\t\t\t\t\theight: '100%'\n\t\t\t\t},\n\t\t\t\t'& .Mui-TableHeadCell-Content-Labels': {\n\t\t\t\t\twidth: '100%',\n\t\t\t\t\tjustifyContent: 'space-between'\n\t\t\t\t},\n\t\t\t\t'&.pinned-column': {\n\t\t\t\t\tbackgroundColor: '#fff'\n\t\t\t\t},\n\t\t\t\t'& .Mui-TableHeadCell-ResizeHandle-Wrapper': {\n\t\t\t\t\tpadding: 0,\n\t\t\t\t\tmargin: 0,\n\t\t\t\t\tright: '-5px',\n\t\t\t\t\topacity: 0\n\t\t\t\t},\n\t\t\t}\n\t\t},\n\n\t\t// Table body cell default styles\n\t\tmuiTableBodyProps: {\n\t\t\tsx: {\n\t\t\t\tzIndex: 500\n\t\t\t}\n\t\t},\n\t\tmuiTableHeadProps: {\n\t\t\tsx: {\n\t\t\t\tzIndex: 600\n\t\t\t}\n\t\t},\n\t\tmuiTableBodyCellProps: (/* { cell, column, table , row } */) => ({\n\t\t\tsx: {\n\t\t\t\tlineHeight: '140%',\n\t\t\t\tletterSpacing: '-0.26px',\n\t\t\t\tfontWeight: '400',\n\t\t\t\tfontSize: '0.8125rem',\n\t\t\t\t'&.pinned-column': {\n\t\t\t\t\tbackgroundColor: '#fff'\n\t\t\t\t},\n\t\t\t\t'&:hover': {\n\t\t\t\t\tbackgroundColor: 'transparent' // Removes hover effect globally\n\t\t\t\t},\n\t\t\t\twhiteSpace: 'pre-wrap'\n\t\t\t}\n\t\t\t// onClick: () => {\n\t\t\t// \ttable.setEditingCell(cell); //set editing cell\n\t\t\t// \tqueueMicrotask(() => {\n\t\t\t// \t\tconst textField = table.refs.editInputRefs.current[column.id];\n\t\t\t// \t\tif (textField) {\n\t\t\t// \t\t\ttextField.focus();\n\t\t\t// \t\t\ttextField.select?.();\n\t\t\t// \t\t}\n\t\t\t// \t});\n\t\t\t// }\n\t\t\t// onKeyDown: (event) => {\n\t\t\t// \tif (event.key === 'Tab') {\n\t\t\t// \t\ttry {\n\t\t\t// \t\t\t\t// if (column.columnDef.editVariant === 'select') {\n\t\t\t// \t\t\t\t// \ttable.refs.editInputRefs.current[column.id]?.node?.blur();\n\t\t\t// \t\t\t\t// } else {\n\t\t\t// \t\t\t\t// \ttable.refs.editInputRefs.current[column.id].blur();\n\t\t\t// \t\t\t\t// }\n\n\t\t\t// \t\t\tconst rowIdx = row.index;\n\t\t\t// \t\t\tconst colIdx = columns.findIndex(\n\t\t\t// \t\t\t\t(col) => col.accessorKey === column.id\n\t\t\t// \t\t\t);\n\t\t\t// \t\t\tconst newColIdx = colIdx + 1;\n\t\t\t// \t\t\tconst clm = columns[newColIdx];\n\t\t\t// \t\t\tconst nextCell = row\n\t\t\t// \t\t\t\t.getAllCells()\n\t\t\t// \t\t\t\t.find((cl) => (cl.id = `${rowIdx}_${clm.accessorKey}`));\n\n\t\t\t// \t\t\tif (nextCell) {\n\t\t\t// \t\t\t\t// updateData(event.target.value, column, row.id);\n\t\t\t// \t\t\t\ttable.setEditingCell(nextCell);\n\t\t\t// \t\t\t\tqueueMicrotask(() => {\n\t\t\t// \t\t\t\t\tconst textField = table.refs.editInputRefs.current[column.id];\n\t\t\t// \t\t\t\t\tif (textField) {\n\t\t\t// \t\t\t\t\t\ttextField.focus();\n\t\t\t// \t\t\t\t\t\ttextField.select?.();\n\t\t\t// \t\t\t\t\t}\n\t\t\t// \t\t\t\t});\n\t\t\t// \t\t\t}\n\t\t\t// \t\t} catch (error) {\n\t\t\t// \t\t}\n\t\t\t// \t}\n\t\t\t// },\n\t\t\t// onBlur: () => {\n\t\t\t// \ttable.setEditingCell(null);\n\t\t\t// }\n\t\t}),\n\n\t\t// Checkbox styling\n\t\tmuiSelectCheckboxProps: {\n\t\t\tsx: {\n\t\t\t\tcolor: 'theme.secondary.300',\n\t\t\t\t'&.Mui-checked': {\n\t\t\t\t\tcolor: 'theme.primary.600',\n\t\t\t\t\t'&:hover': {\n\t\t\t\t\t\tcolor: 'theme.primary.500'\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t'&.Mui-disabled': {\n\t\t\t\t\tcolor: 'theme.secondary.200'\n\t\t\t\t}\n\t\t\t},\n\t\t\ticon: <RecgtangleIcon sx={{ width: 20, height: 20 }} />,\n\t\t\tcheckedIcon: <CheckBoxIcon sx={{ width: 20, height: 20 }} />\n\t\t},\n\t\tmuiSelectAllCheckboxProps: {\n\t\t\tsx: {\n\t\t\t\tcolor: 'theme.secondary.300',\n\t\t\t\t'&.Mui-checked': {\n\t\t\t\t\tcolor: 'theme.primary.600',\n\t\t\t\t\t'&:hover': {\n\t\t\t\t\t\tcolor: 'theme.primary.500'\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t'&.Mui-disabled': {\n\t\t\t\t\tcolor: 'theme.secondary.600'\n\t\t\t\t}\n\t\t\t},\n\t\t\ticon: <RecgtangleIcon sx={{ width: 20, height: 20 }} />,\n\t\t\tcheckedIcon: <CheckBoxIcon sx={{ width: 20, height: 20 }} />\n\t\t},\n\t\tmuiBottomToolbarProps: {\n\t\t\tsx: {\n\t\t\t\tboxShadow: 'none',\n\t\t\t\t'& .MuiBox-root': {\n\t\t\t\t\tpaddingLeft: 0\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\n\t\tlayoutMode: 'grid',\n\t\ticons: {\n\t\t\tDragHandleIcon: () => <RecgtangleIcon fontSize='medium' />,\n\t\t\tSortIcon: () => <ArrowUpDown fontSize='medium' />,\n\t\t\tArrowDownwardIcon: () => <ArrowUpDown fontSize='medium' />,\n\t\t\tArrowUpwardIcon: () => <ArrowUpDown fontSize='medium' />,\n\t\t\tExpandMoreIcon: () => <ArrowUpDown fontSize='medium' />,\n\t\t\tExpandLessIcon: () => <ArrowUpDown fontSize='medium' />,\n\t\t\tSyncAltIcon: () => <ArrowUpDown fontSize='medium' />,\n\t\t\tCancelIcon: (props: SvgIconProps) => (\n\t\t\t\t<Close fontSize='small' {...props} color='theme.secondary.1000' />\n\t\t\t)\n\t\t},\n\n\t\t...rest\n\t});\n\n\tuseEffect(() => {\n\t\tif (enableRowSelection) {\n\t\t\tif (table?.getSelectedRowModel()?.rows) {\n\t\t\t\tSetSelectedRowId?.(table?.getSelectedRowModel()?.rows);\n\t\t\t}\n\t\t}\n\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [enableRowSelection]);\n\n\tuseEffect(() => {\n\t\tif (onSelectRow) {\n\t\t\tif (rest?.enableExpanding) {\n\t\t\t\tconst selectedRowModels: any[] = [];\n\t\t\t\tconst selection = table.getState().rowSelection; // e.g., { 0.0: true }\n\t\t\t\tconst traverseRows = (rows, parentKey = '') => {\n\t\t\t\t\trows.forEach((row: any, index: number) => {\n\t\t\t\t\t\tconst rowKey = parentKey ? `${parentKey}.${index}` : `${row.id}`;\n\t\t\t\t\t\tif (selection[rowKey]) {\n\t\t\t\t\t\t\tselectedRowModels.push(row);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Check for sub-rows and traverse further\n\t\t\t\t\t\tif (row.subRows?.length) {\n\t\t\t\t\t\t\ttraverseRows(row.subRows, rowKey);\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t};\n\n\t\t\t\ttraverseRows(table.getRowModel().rows);\n\t\t\t\tonSelectRow(selectedRowModels, rowSelection);\n\t\t\t} else {\n\t\t\t\tonSelectRow(table.getSelectedRowModel().rows, rowSelection);\n\t\t\t}\n\n\t\t}\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [rowSelection, table]);\n\n\t// useEffect(() => {\n\t// \tconst relativeContainer = document.getElementsByClassName(\n\t// \t\t'MuiTableContainer-root'\n\t// \t)[0];\n\t// \tconst fixedElement = document.getElementsByClassName('no-data')[0];\n\t// \trelativeContainer.addEventListener('scroll', () => {\n\t// \t\tconst scrollLeft = relativeContainer.scrollLeft;\n\t// \t\tfixedElement.style.left = `${scrollLeft + 100}px`;\n\t// \t});\n\t// }, []);\n\n\tuseEffect(() => {\n\t\tif (isResetRow) {\n\t\t\ttable?.resetRowSelection();\n\t\t}\n\t}, [isResetRow, table]);\n\n\t// Handle clicks outside the table to save and exit edit mode - ADVANCED EVENT DELEGATION\n\tuseEffect(() => {\n\t\tif (!table) return;\n\n\t\tlet dropdownOpenTimer: NodeJS.Timeout;\n\t\tlet saveTimer: NodeJS.Timeout;\n\t\tlet lastDropdownClick = 0;\n\t\tlet isDropdownInteraction = false;\n\n\t\t// Track dropdown interactions with precise timing\n\t\tconst handleMouseDown = (e: MouseEvent) => {\n\t\t\tconst target = e.target as HTMLElement;\n\t\t\tconst isDropdownElement = target.closest(\n\t\t\t\t'.MuiSelect-root, .MuiMenuItem-root, .MuiPopover-root, .MuiList-root, ' +\n\t\t\t\t'.MuiMenu-list, .MuiModal-root, .MuiBackdrop-root, .MuiButtonBase-root, ' +\n\t\t\t\t'.MuiFormControl-root, .MuiInputBase-root, .MuiTextField-root, ' +\n\t\t\t\t'.MuiOutlinedInput-root, .MuiFilledInput-root, .MuiAutocomplete-popper, ' +\n\t\t\t\t'.MuiPickersPopper-root, [role=\"option\"], [role=\"listbox\"], [role=\"combobox\"]'\n\t\t\t);\n\n\t\t\tif (isDropdownElement) {\n\t\t\t\tisDropdownInteraction = true;\n\t\t\t\tlastDropdownClick = Date.now();\n\t\t\t\t// Clear any pending save when dropdown interaction starts\n\t\t\t\tif (saveTimer) {\n\t\t\t\t\tclearTimeout(saveTimer);\n\t\t\t\t}\n\t\t\t\t// Set a timer to reset dropdown interaction flag\n\t\t\t\tif (dropdownOpenTimer) {\n\t\t\t\t\tclearTimeout(dropdownOpenTimer);\n\t\t\t\t}\n\t\t\t\tdropdownOpenTimer = setTimeout(() => {\n\t\t\t\t\tisDropdownInteraction = false;\n\t\t\t\t}, 500);\n\t\t\t}\n\t\t};\n\n\t\t// Handle clicks with sophisticated logic\n\t\tconst handleClick = (e: MouseEvent) => {\n\t\t\tconst editingRow = table.getState()?.editingRow;\n\t\t\tif (!editingRow) return;\n\n\t\t\tconst target = e.target as HTMLElement;\n\t\t\tconst now = Date.now();\n\n\t\t\t// Don't process if we recently had a dropdown interaction\n\t\t\tif (isDropdownInteraction || (now - lastDropdownClick) < 300) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Check if click is inside table\n\t\t\tconst isInsideTable = target.closest('.MuiTableContainer-root, .MuiPaper-root, .MRT_Table');\n\n\t\t\t// Only save if clicking outside table and no recent dropdown interaction\n\t\t\tif (!isInsideTable) {\n\t\t\t\t// Clear any existing save timer\n\t\t\t\tif (saveTimer) {\n\t\t\t\t\tclearTimeout(saveTimer);\n\t\t\t\t}\n\n\t\t\t\t// Schedule save with additional delay for safety\n\t\t\t\tsaveTimer = setTimeout(() => {\n\t\t\t\t\tconst currentEditingRow = table.getState()?.editingRow;\n\t\t\t\t\tif (currentEditingRow && !isDropdownInteraction) {\n\t\t\t\t\t\thandleSaveRow(currentEditingRow, currentEditingRow._valuesCache || currentEditingRow.original, table);\n\t\t\t\t\t}\n\t\t\t\t}, 200);\n\t\t\t}\n\t\t};\n\n\t\t// Use both mousedown and click for comprehensive tracking\n\t\tdocument.addEventListener('mousedown', handleMouseDown, true);\n\t\tdocument.addEventListener('click', handleClick, true);\n\n\t\treturn () => {\n\t\t\tdocument.removeEventListener('mousedown', handleMouseDown, true);\n\t\t\tdocument.removeEventListener('click', handleClick, true);\n\t\t\tif (dropdownOpenTimer) {\n\t\t\t\tclearTimeout(dropdownOpenTimer);\n\t\t\t}\n\t\t\tif (saveTimer) {\n\t\t\t\tclearTimeout(saveTimer);\n\t\t\t}\n\t\t};\n\t}, [table, handleSaveRow]);\n\treturn (\n\t\t<TableWrapper className='MRT-TableWrapper custom-table'>\n\t\t\t<MaterialReactTable table={table} />\n\n\t\t\t<Menu\n\t\t\t\tanchorEl={anchorEl}\n\t\t\t\topen={Boolean(anchorEl)}\n\t\t\t\tonClose={handleHeaderClose}\n\t\t\t\tclassName='add-role-drp'>\n\t\t\t\t{popUpShow ? (\n\t\t\t\t\t<div>\n\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\tonClick={handleBackButtonClick}\n\t\t\t\t\t\t\tclassName='role-drp-list add-column-title'>\n\t\t\t\t\t\t\t<ListItemIcon className='add-icon'>\n\t\t\t\t\t\t\t\t<ChevronLeftIcon />\n\t\t\t\t\t\t\t</ListItemIcon>\n\t\t\t\t\t\t\t<ListItemText className='title'>\n\t\t\t\t\t\t\t\t{t('common.addColumn_label')}\n\t\t\t\t\t\t\t</ListItemText>\n\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t<Divider flexItem sx={{ mt: '0.25rem !important', mb: '0.25rem !important' }} />\n\t\t\t\t\t\t<div className='searchbar-box-list'>\n\t\t\t\t\t\t\t<SearchBar\n\t\t\t\t\t\t\t\tplaceholder={'Search User'}\n\t\t\t\t\t\t\t\thandleSearch={(e) => handleSearchEvent(e)}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div className='all-attribute-title'>\n\t\t\t\t\t\t\t<Typography variant='body2' color='text.secondary'>\n\t\t\t\t\t\t\t\t{t('common.allAttributes_label')}\n\t\t\t\t\t\t\t</Typography>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t{filteredOptions.map((column: any) => (\n\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\tkey={column.accessorKey}\n\t\t\t\t\t\t\t\tonClick={() => handleAddColumn(column)}>\n\t\t\t\t\t\t\t\t<Typography color='theme.secondary.1000' type='s3'>\n\t\t\t\t\t\t\t\t\t{column.header}\n\t\t\t\t\t\t\t\t</Typography>\n\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t))}\n\t\t\t\t\t\t<Divider flexItem sx={{ mt: '0.25rem !important', mb: '0.25rem !important' }} />\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tenableAddCustomField && <MenuItem onClick={handleCustomAddColumn} className='role-drp-list'>\n\t\t\t\t\t\t\t\t<ListItemIcon className='add-icon'>\n\t\t\t\t\t\t\t\t\t<img src={images.common.addIcon} alt='Add Icon' />\n\t\t\t\t\t\t\t\t</ListItemIcon>\n\t\t\t\t\t\t\t\t<ListItemText className='title'>\n\t\t\t\t\t\t\t\t\t{t('common.addCustomField_label')}\n\t\t\t\t\t\t\t\t</ListItemText>\n\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t}\n\t\t\t\t\t</div>\n\t\t\t\t) : (\n\t\t\t\t\t<>\n\t\t\t\t\t\t{visibleColumns.map((column: any) => (\n\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\tkey={column.accessorKey}\n\t\t\t\t\t\t\t\tonClick={() => handleVisibleColumn(column)}\n\t\t\t\t\t\t\t\tclassName='role-drp-list'>\n\t\t\t\t\t\t\t\t<ListItemIcon className='add-icon'>\n\t\t\t\t\t\t\t\t\t<img src={images.common.dotsIcon} alt='Add Icon' />\n\t\t\t\t\t\t\t\t</ListItemIcon>\n\t\t\t\t\t\t\t\t<ListItemText className='title'>{column.header}</ListItemText>\n\t\t\t\t\t\t\t\t<ListItemIcon className='eye-icon'>\n\t\t\t\t\t\t\t\t\t<img src={images.common.eyeIcon} alt='Eye Icon' />\n\t\t\t\t\t\t\t\t</ListItemIcon>\n\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t))}\n\t\t\t\t\t\t<Divider flexItem sx={{ mt: '0.25rem !important', mb: '0.25rem !important' }} />\n\t\t\t\t\t\t<MenuItem onClick={handleAddButtonClick} className='role-drp-list'>\n\t\t\t\t\t\t\t<ListItemIcon className='add-icon'>\n\t\t\t\t\t\t\t\t<img src={images.common.addIcon} alt='Add Icon' />\n\t\t\t\t\t\t\t</ListItemIcon>\n\t\t\t\t\t\t\t<ListItemText className='title'>\n\t\t\t\t\t\t\t\t{t('common.addColumn_label')}\n\t\t\t\t\t\t\t</ListItemText>\n\t\t\t\t\t\t\t<Typography\n\t\t\t\t\t\t\t\tvariant='body2'\n\t\t\t\t\t\t\t\tcolor='text.secondary'\n\t\t\t\t\t\t\t\tclassName='eye-icon'>\n\t\t\t\t\t\t\t\t<ChevronRightIcon sx={{ fontSize: '1.25rem !important' }} />\n\t\t\t\t\t\t\t</Typography>\n\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t</>\n\t\t\t\t)}\n\t\t\t</Menu>\n\n\t\t\t<Menu\n\t\t\t\tanchorEl={rowAnchorEl}\n\t\t\t\topen={Boolean(rowAnchorEl)}\n\t\t\t\tonClose={handleActionsClose}>\n\t\t\t\t{rowActionMenu?.map((option: any) => {\n\t\t\t\t\tif (\n\t\t\t\t\t\t(option.label === 'Move' &&\n\t\t\t\t\t\t\t(row?.is_directory === true || row?.is_directory === 1)) ||\n\t\t\t\t\t\t(option.label === 'Download' &&\n\t\t\t\t\t\t\t(row?.is_directory === true ||\n\t\t\t\t\t\t\t\trow?.is_directory === 1 ||\n\t\t\t\t\t\t\t\trow?.drive?.is_directory === true ||\n\t\t\t\t\t\t\t\trow?.drive?.is_directory === 1))\n\t\t\t\t\t) {\n\t\t\t\t\t\t// return null;\n\t\t\t\t\t}\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\tonClick={async () => {\n\t\t\t\t\t\t\t\tawait option.handleAction(row);\n\t\t\t\t\t\t\t\tsetRowAnchorEl(null);\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\tdisabled={\n\t\t\t\t\t\t\t\ttypeof option.disabled === 'function'\n\t\t\t\t\t\t\t\t\t? option.disabled(row)\n\t\t\t\t\t\t\t\t\t: Boolean(option.disabled)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tsx={{ alignItems: 'center', gap: 0.5 }}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{option?.icon}\n\t\t\t\t\t\t\t<Typography type='s4' color='inherit'>\n\t\t\t\t\t\t\t\t{typeof option.label === 'function' ? option.label(row) : option.label}\n\t\t\t\t\t\t\t</Typography>\n\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t);\n\t\t\t\t})}\n\t\t\t\t{destructiveActionMenu?.length > 0 &&\n\t\t\t\t\t<>\n\t\t\t\t\t\t<Divider flexItem sx={{ mt: '0.25rem !important', mb: '0.25rem !important' }} />\n\t\t\t\t\t\t<div className='dropdown-inner--DestructiveHeader'>\n\t\t\t\t\t\t\t{destructiveActionMenu?.map((option: any) => (\n\t\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\t\tonClick={() => {\n\t\t\t\t\t\t\t\t\t\toption.handleAction(row);\n\t\t\t\t\t\t\t\t\t\tsetRowAnchorEl(null);\n\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\tclassName='dropdown-inner--DestructiveActions'\n\t\t\t\t\t\t\t\t\tdisabled={\n\t\t\t\t\t\t\t\t\t\ttypeof option.disabled === 'function'\n\t\t\t\t\t\t\t\t\t\t\t? option.disabled(row)\n\t\t\t\t\t\t\t\t\t\t\t: Boolean(option.disabled)\n\t\t\t\t\t\t\t\t\t}>\n\t\t\t\t\t\t\t\t\t<Typography type='s4' color='inherit'>\n\t\t\t\t\t\t\t\t\t\t{typeof option.label === 'function' ? option.label(row) : option.label}\n\t\t\t\t\t\t\t\t\t</Typography>\n\t\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</>\n\t\t\t\t}\n\t\t\t</Menu>\n\t\t\t<ConfirmPopUp\n\t\t\t\topen={Boolean(rowToDelete)}\n\t\t\t\tonClose={() => setRowToDelete(null)}\n\t\t\t\tonConfirm={() => handleRowDelete()}\n\t\t\t\ttitle='Delete Item'\n\t\t\t\tdescription={`Are you sure you want to delete entry ?`}\n\t\t\t\tloading={isDeletingRow}\n\t\t\t/>\n\t\t</TableWrapper>\n\t);\n});\n\nexport { MaterialEditableTable };\nexport default MaterialEditableTable;"],"names":["TableWrapper","styled","Box","theme","palette","border","borderBottom","borderLeft","padding","lineHeight","fontSize","minHeight","backgroundColor","_a","secondary","maxHeight","boxShadow","_b","primary","color","_c","_d","height","width","MaterialEditableTable","React","memo","enablePagination","rows","columns","totalPages","paginationModel","columnOrder","updateData","handleColumnOrdering","enableEditing","enableColumnDragging","states","rowActionMenu","destructiveActionMenu","disableDefaultActionColumn","enableRowSelection","defaultActionColumnItems","enableBottomToolbar","SetSelectedRowId","isResetRow","onCreateRow","onEditRow","onDeleteRow","editDisplayMode","enableRowCreate","onChangeRowField","onSelectRow","enableColumnResizing","selectedRowIds","onColumnVisibility","onSortingChange","getSelectedData","disabledDefaultActionColumnIcon","enableAddCustomField","enableRowDragging","handleColumnResizing","columnSizes","rest","t","useTranslation","formData","updatePageInfo","activePage","aPage","usePages","useDeepMemo","pageNo","row","setRow","useState","tableColumns","setTableColumns","anchorEl","setAnchorEl","popUpShow","setPopupShow","rowAnchorEl","setRowAnchorEl","visibleColumns","filter","column","visible","hiddenColumns","filteredOptions","setFilteredOptions","selectedRow","setSelectedRow","validationErrors","setValidationErrors","validationSchema","setValidationSchema","isCreatingRow","setIsCreatingRow","isEditingRow","setIsEditingRow","isDeletingRow","setIsDeletingRow","rowToDelete","setRowToDelete","rowSelection","setRowSelection","isChecked","setIsChecked","sorting","setSorting","disableNextEdit","setDisableNextEdit","columnSizing","setColumnSizing","column_sizes","columnSizingInfo","setColumnSizingInfo","columnSizingStart","deltaOffset","deltaPercentage","isResizingColumn","startOffset","startSize","navigate","useNavigate","currentModule","location","pathname","split","redirectionPath","PathnameAccounting","CUSTOM_FORM","PathnameInventory","PathnameManufacturing","PathnamePurchase","PathnameCrm","PathnameUsers","PathnameRental","PathnameDocument","ADD_CUSTOM_FIELDS","path","validationReducer","validations","validation","vld","type","value","required","msg_en","typeError","editProperties","is_multiple","min","email","max","test","when","relation","is","val","values","then","thenValidations","reduce","otherwise","otherWiseValidations","editVariant","trim","length","useEffect","schema","forEach","clm","fieldValidations","yup","array","string","number","nullable","transform","originalValue","matches","excludeEmptyString","message","getValidationType","accessorKey","generateValidationSchema","object","shape","handleHeaderClick","event","currentTarget","formtValues","useCallback","cells","v","Object","keys","vl","cell","find","c","File","name","dayjs","format","dateFormat","label","display_name","title","id","checkRequired","some","selectedRows","includes","Function","sortingArray","Array","isArray","getTextWidth","text","ctx","document","createElement","getContext","measureText","handleSaveRow","async","tableInstance","validate","abortEarly","getAllCells","map","columnDef","_valuesCache","data","table","setEditingRow","err","ValidationError","errors","inner","error","Error","enqueueSnackbar","variant","useMaterialReactTable","defaultColumn","minSize","size","header","Math","String","Edit","jsx","InlineEditFields","col","callback","s","Header","jsxs","display","alignItems","children","Typography","maxSize","IconButton","sx","p","onClick","src","images","common","arrowIcon","alt","muiTableHeadCellProps","className","muiTableBodyCellProps","whiteSpace","Cell","props","item","updatedProps","cloneElement","e","handleActionsClick","original","disabled","more","muiTablePaperProps","tableLayout","columnResizeMode","onEditingRowSave","onCreatingRowSave","setCreatingRow","onCreatingRowCancel","onEditingRowCancel","displayColumnDefOptions","getState","creatingRow","gap","editingRow","onKeyUp","renderRowActions","Fragment","enableExpanding","parentId","Tooltip","Trash","Boolean","renderBottomToolbarCustomActions","Button","startIcon","Add","onRowSelectionChange","enableColumnOrdering","createDisplayMode","enableTopToolbar","enableColumnActions","enableSorting","enableGrouping","enableStickyHeader","enableSortingRemoval","state","columnPinning","left","isSaving","showProgressBars","getRowId","muiTableBodyRowProps","editingRowId","isErrorRow","has_error","isCurrentlyEditing","setTimeout","onKeyDown","key","preventDefault","cursor","onColumnOrderChange","colOrder","onColumnSizingChange","onColumnSizingInfoChange","renderEmptyRowsFallback","tableNoData","weight","paginationDisplayMode","muiPaginationProps","page","count","showRowsPerPage","boundaryCount","muiEditTextFieldProps","InputProps","disableUnderline","onBlur","target","borderColor","muiCircularProgressProps","letterSpacing","fontWeight","justifyContent","margin","right","opacity","muiTableBodyProps","zIndex","muiTableHeadProps","muiSelectCheckboxProps","icon","RecgtangleIcon","checkedIcon","CheckBoxIcon","muiSelectAllCheckboxProps","muiBottomToolbarProps","paddingLeft","layoutMode","icons","DragHandleIcon","SortIcon","ArrowUpDown","ArrowDownwardIcon","ArrowUpwardIcon","ExpandMoreIcon","ExpandLessIcon","SyncAltIcon","CancelIcon","Close","getSelectedRowModel","selectedRowModels","selection","traverseRows","parentKey","index","rowKey","push","subRows","getRowModel","resetRowSelection","dropdownOpenTimer","saveTimer","lastDropdownClick","isDropdownInteraction","handleMouseDown","closest","Date","now","clearTimeout","handleClick","currentEditingRow","addEventListener","removeEventListener","MaterialReactTable","Menu","open","onClose","MenuItem","ListItemIcon","ChevronLeftIcon","ListItemText","Divider","flexItem","mt","mb","SearchBar","placeholder","handleSearch","searchQuery","filteredColumns","option","toLowerCase","handleSearchEvent","updatedColumns","JSON","parse","stringify","updatedFilteredOptions","handleAddColumn","addIcon","handleVisibleColumn","dotsIcon","eyeIcon","ChevronRightIcon","handleAction","ConfirmPopUp","onConfirm","handleRowDelete","description","loading"],"mappings":"+yFA6KA,MAAMA,EAAeC,EAAAA,QAAOC,UAAPD,CAAY,EAAGE,OAASC,2BAAiB,MAAA,CAC7D,qBAAsB,CACrBC,OAAQ,oBACRC,aAAc,EACdC,WAAY,EACZC,QAAS,iBACTC,WAAY,OACZC,SAAU,OACVC,UAAW,IASZ,qBAAsB,CACrBC,gBAAiB,OAAAC,EAAAT,EAAQD,YAAR,EAAAU,EAAeC,UAAU,MAE3C,0BAA2B,CAC1BC,UAAW,kDAGZ,iBAAkB,CACjBC,UAAW,QAGZ,0BAA2B,CAC1B,iBAAkB,CACjBJ,gBAAiB,OAAAK,EAAA,MAAAb,OAAA,EAAAA,EAASD,YAAT,EAAAc,EAAgBC,QAAQ,KACzCC,MAAO,UAG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