@xframework-ca-test/cli 1.0.32 → 1.0.34

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 (377) hide show
  1. package/dist/ui/assets/AIVision-0025192f.js +4 -0
  2. package/dist/ui/assets/AccountDetails-42610e44.js +1 -0
  3. package/dist/ui/assets/AccountDetails-5b4cd3f7.js +1 -0
  4. package/dist/ui/assets/AccountServices-f68f471d.js +1 -0
  5. package/dist/ui/assets/AccountsList-262479cf.js +1 -0
  6. package/dist/ui/assets/ActionLink-9db8b1c2.js +1 -0
  7. package/dist/ui/assets/AdaptableCard-3d1e1f96.js +1 -0
  8. package/dist/ui/assets/AddAccount-2cd72664.js +1 -0
  9. package/dist/ui/assets/AddEditFile-6ae10d57.js +1 -0
  10. package/dist/ui/assets/AddEditTranslation-3812ff0f.js +1 -0
  11. package/dist/ui/assets/AiApiLogList-1eac39b7.js +1 -0
  12. package/dist/ui/assets/AiCa-2e90495f.js +1 -0
  13. package/dist/ui/assets/Alert-59d09a99.js +1 -0
  14. package/dist/ui/assets/ApiService-df126758.js +1 -0
  15. package/dist/ui/assets/AppLandingPage-afcea727.js +4 -0
  16. package/dist/ui/assets/AuditLogsList-ea37686b.js +1 -0
  17. package/dist/ui/assets/Auth0Callback-00729568.js +1 -0
  18. package/dist/ui/assets/BarCodes-4ff49536.js +1 -0
  19. package/dist/ui/assets/BlankLayout-7085ab88.js +1 -0
  20. package/dist/ui/assets/{BrainServices-a4bb698e.js → BrainServices-4cb93af5.js} +1 -1
  21. package/dist/ui/assets/CalendarList-689ed66a.js +2 -0
  22. package/dist/ui/assets/CalendarList-f4a9aa21.css +8 -0
  23. package/dist/ui/assets/CategoryList-a6d01041.js +1 -0
  24. package/dist/ui/assets/CategoryList-c03f4259.js +1 -0
  25. package/dist/ui/assets/ChatContainer-fec7b84d.js +1 -0
  26. package/dist/ui/assets/ChatsList-4b3194e4.js +1 -0
  27. package/dist/ui/assets/Check-af681a30.js +1 -0
  28. package/dist/ui/assets/CheckInVideo-aa9f50b2.js +6 -0
  29. package/dist/ui/assets/ClassicLayout-a9866742.js +2 -0
  30. package/dist/ui/assets/CompanyList-94119d71.js +1 -0
  31. package/dist/ui/assets/{CompanyService-1bf7c3c8.js → CompanyService-491a9cc1.js} +1 -1
  32. package/dist/ui/assets/{Component-59e4c14b.js → Component-566d01e0.js} +1 -1
  33. package/dist/ui/assets/ConfirmDialog-2838a642.js +1 -0
  34. package/dist/ui/assets/ContactDetails-c9dc0ed1.js +1 -0
  35. package/dist/ui/assets/{ContactService-92281a90.js → ContactService-8afcaeb7.js} +1 -1
  36. package/dist/ui/assets/ContactsList-5b06c9b8.js +1 -0
  37. package/dist/ui/assets/CountiesList-18b23cf7.js +1 -0
  38. package/dist/ui/assets/CountyDetails-ea024f14.js +1 -0
  39. package/dist/ui/assets/CourseDetails-8a5f8d63.js +1 -0
  40. package/dist/ui/assets/CourseList-3564fec3.js +1 -0
  41. package/dist/ui/assets/{CourseService-f0dc3bf1.js → CourseService-29ad460c.js} +1 -1
  42. package/dist/ui/assets/CreateSignature-c22e4a71.js +7 -0
  43. package/dist/ui/assets/{CustomerInfoField-fff65ace.js → CustomerInfoField-4bf880e2.js} +1 -1
  44. package/dist/ui/assets/DeckedLayout-610fe851.js +1 -0
  45. package/dist/ui/assets/DensitySelector-5d2e901f.js +1 -0
  46. package/dist/ui/assets/{DepartmentServices-3d56a9e7.js → DepartmentServices-a53e998b.js} +1 -1
  47. package/dist/ui/assets/{DigitalSignature-fff42e33.js → DigitalSignature-69eaf80c.js} +1 -1
  48. package/dist/ui/assets/{DocumemtManagementService-6501a5c1.js → DocumemtManagementService-85cde51a.js} +1 -1
  49. package/dist/ui/assets/DocumentActivity-bc938c61.js +1 -0
  50. package/dist/ui/assets/DocumentLayout-a12982d7.js +1 -0
  51. package/dist/ui/assets/DocumentList2-9c8c6284.js +23 -0
  52. package/dist/ui/assets/DocumentLists-1cdaae06.js +1 -0
  53. package/dist/ui/assets/DocumentUserSigned-f7371fc5.js +7 -0
  54. package/dist/ui/assets/DocumentsList-3b25907c.js +1 -0
  55. package/dist/ui/assets/DoubleSidedImage-b4bd3915.js +1 -0
  56. package/dist/ui/assets/{Drawer-949c18c6.js → Drawer-4f97e662.js} +1 -1
  57. package/dist/ui/assets/DynamicDashboard-0a41d287.js +1 -0
  58. package/dist/ui/assets/{DynamicTablesService-963fe77b.js → DynamicTablesService-6aa57f52.js} +1 -1
  59. package/dist/ui/assets/EditAccount-e42d66af.js +1 -0
  60. package/dist/ui/assets/EditLead-c8c9760a.js +1 -0
  61. package/dist/ui/assets/FaqItems-25d66543.js +6 -0
  62. package/dist/ui/assets/{FileManagementServices-25fd64c5.js → FileManagementServices-19b47568.js} +1 -1
  63. package/dist/ui/assets/{FolderOpen-88bfcc74.js → FolderOpen-7b0e2ac0.js} +1 -1
  64. package/dist/ui/assets/FormContainer-9a52b9e8.js +1 -0
  65. package/dist/ui/assets/{GeneralSettings-a7f805e8.js → GeneralSettings-c8c2f051.js} +5 -5
  66. package/dist/ui/assets/GenericPage-81e41302.js +1 -0
  67. package/dist/ui/assets/GridMapDetails-38f50b3c.js +1 -0
  68. package/dist/ui/assets/HorizontalMenuContent-fd559f4d.js +1 -0
  69. package/dist/ui/assets/{ImportFile-3f60d715.js → ImportFile-026b1771.js} +1 -1
  70. package/dist/ui/assets/{InlineSignaturePad-09c06619.js → InlineSignaturePad-f5630151.js} +1 -1
  71. package/dist/ui/assets/InvoicesList-9723bc5a.js +1 -0
  72. package/dist/ui/assets/{KeyVaultService-874d83fe.js → KeyVaultService-9608f0ff.js} +1 -1
  73. package/dist/ui/assets/LeadDetails-8cdaae0e.js +1 -0
  74. package/dist/ui/assets/{LeadSourceService-e46fa85e.js → LeadSourceService-cf71ea64.js} +1 -1
  75. package/dist/ui/assets/LeadsList-1ec20a77.js +1 -0
  76. package/dist/ui/assets/Logo-dd6f7656.js +1 -0
  77. package/dist/ui/assets/MapView-dcab88b3.js +1 -0
  78. package/dist/ui/assets/MarketingPage-998d10b0.js +4 -0
  79. package/dist/ui/assets/MenuNew-79fc95f3.js +1 -0
  80. package/dist/ui/assets/{MenuTable-c2c65021.js → MenuTable-f69e0fe4.js} +1 -1
  81. package/dist/ui/assets/MessageInput-07fcc5cb.js +21 -0
  82. package/dist/ui/assets/MessagesList-21d2b034.js +1 -0
  83. package/dist/ui/assets/ModernLayout-05af7cf7.js +1 -0
  84. package/dist/ui/assets/{NoData-8c485a3a.js → NoData-4cc4af03.js} +1 -1
  85. package/dist/ui/assets/Notify-8fb74d48.js +1 -0
  86. package/dist/ui/assets/OpportunitiesList-2f96958f.js +1 -0
  87. package/dist/ui/assets/OpportunityDetails-aaec3200.js +1 -0
  88. package/dist/ui/assets/{OpportunityServices-fa4fabfd.js → OpportunityServices-c4510dd2.js} +1 -1
  89. package/dist/ui/assets/OpportunityStatus-ea3b5ee2.js +1 -0
  90. package/dist/ui/assets/PageBreadcrumb-cf54a6e9.js +1 -0
  91. package/dist/ui/assets/{Password-d9294711.js → Password-21414dc6.js} +1 -1
  92. package/dist/ui/assets/PasswordInput-333c82ca.js +1 -0
  93. package/dist/ui/assets/{PreferenceService-75bf9db6.js → PreferenceService-d2b3e003.js} +1 -1
  94. package/dist/ui/assets/Profile-8c9fd2fc.js +1 -0
  95. package/dist/ui/assets/{ReportEditor-8880f57e.js → ReportEditor-4e4f6d53.js} +3 -3
  96. package/dist/ui/assets/{ReportViewer-9f1080f7.js → ReportViewer-616d3cfc.js} +30 -30
  97. package/dist/ui/assets/RoleEdit-a076ea85.js +1 -0
  98. package/dist/ui/assets/RoleForm-47691f91.js +1 -0
  99. package/dist/ui/assets/{RoleNew-49fadb16.js → RoleNew-e86a1513.js} +1 -1
  100. package/dist/ui/assets/{RoleService-7008da2c.js → RoleService-2f9ed883.js} +1 -1
  101. package/dist/ui/assets/ScheduleCycle-0ae23631.js +1 -0
  102. package/dist/ui/assets/{ScheduleService-7228f0a3.js → ScheduleService-41a88c41.js} +1 -1
  103. package/dist/ui/assets/ScreenList-8f58150b.js +1 -0
  104. package/dist/ui/assets/Settings-fc91c9d2.js +2 -0
  105. package/dist/ui/assets/{SetupWizard-4172e377.js → SetupWizard-d1363582.js} +1 -1
  106. package/dist/ui/assets/SimpleLayout-77cfb778.js +1 -0
  107. package/dist/ui/assets/StackedSideLayout-2f1ee9d1.js +1 -0
  108. package/dist/ui/assets/StickyFooter-3e569b80.js +1 -0
  109. package/dist/ui/assets/SupportRequets-0ecd4ab8.js +1 -0
  110. package/dist/ui/assets/{Switcher-c8648037.js → Switcher-e2fba588.js} +1 -1
  111. package/dist/ui/assets/TimeLogApprovalDataList-7b49a432.js +1 -0
  112. package/dist/ui/assets/TimeLogApprovalList-78cab2b6.js +1 -0
  113. package/dist/ui/assets/TimeLogList-592b29aa.js +1 -0
  114. package/dist/ui/assets/{TimeLogService-cd7b2f61.js → TimeLogService-83166cbc.js} +1 -1
  115. package/dist/ui/assets/TimesheetsList-d1520efb.js +1 -0
  116. package/dist/ui/assets/TranslationList-88d7d5d7.js +1 -0
  117. package/dist/ui/assets/TweaksPanel-bc10bc47.js +112 -0
  118. package/dist/ui/assets/{Upload-fb34ce03.js → Upload-be937eb6.js} +4 -4
  119. package/dist/ui/assets/UserEdit-1f8208f3.js +1 -0
  120. package/dist/ui/assets/UserForm-e9b56aff.js +1 -0
  121. package/dist/ui/assets/{UserNew-b36c342c.js → UserNew-31fa258f.js} +1 -1
  122. package/dist/ui/assets/{UserService-047aef51.js → UserService-1b93ceb0.js} +1 -1
  123. package/dist/ui/assets/ViewTimeLogForApproval-ae077050.js +1 -0
  124. package/dist/ui/assets/Views-1359da48.js +1 -0
  125. package/dist/ui/assets/WelcomeList-dc8666ec.js +9 -0
  126. package/dist/ui/assets/WidgetLayoutsService-49730609.js +1 -0
  127. package/dist/ui/assets/{WrapperCell-a7981b07.js → WrapperCell-3d5592cf.js} +1 -1
  128. package/dist/ui/assets/actioncell-6b5ebd6c.js +1 -0
  129. package/dist/ui/assets/{ar-3c9c213e.js → ar-fb4f0ea8.js} +1 -1
  130. package/dist/ui/assets/calendarList-ac838a86.js +2 -0
  131. package/dist/ui/assets/{cjs-162261df.js → cjs-998de55c.js} +1 -1
  132. package/dist/ui/assets/createSvgIcon-aba65987.js +1 -0
  133. package/dist/ui/assets/documentsList-4e2e061e.js +1 -0
  134. package/dist/ui/assets/{es-be649ede.js → es-cd58d3ad.js} +1 -1
  135. package/dist/ui/assets/{esm-f306d015.js → esm-c40433f8.js} +1 -1
  136. package/dist/ui/assets/gridList-e1571c87.js +1 -0
  137. package/dist/ui/assets/gridMapTable-d95f9c70.js +1 -0
  138. package/dist/ui/assets/{index-f6be0390.js → index-00a8eb64.js} +1 -1
  139. package/dist/ui/assets/index-04438b6b.js +22 -0
  140. package/dist/ui/assets/index-058738bc.js +1 -0
  141. package/dist/ui/assets/{index-e4c6057f.js → index-0b08ce18.js} +1 -1
  142. package/dist/ui/assets/index-0d730815.js +4 -0
  143. package/dist/ui/assets/index-0efcf53a.js +1 -0
  144. package/dist/ui/assets/index-0f432250.js +1 -0
  145. package/dist/ui/assets/{index-cebd880b.js → index-0fd6e996.js} +1 -1
  146. package/dist/ui/assets/{index-49a94e54.js → index-11297f4a.js} +1 -1
  147. package/dist/ui/assets/index-14c1c1d7.js +1 -0
  148. package/dist/ui/assets/index-15e1f4be.js +1 -0
  149. package/dist/ui/assets/index-16586c21.js +1 -0
  150. package/dist/ui/assets/index-19346c14.js +1 -0
  151. package/dist/ui/assets/{index-16bb10a6.js → index-1dc2b9d2.js} +1 -1
  152. package/dist/ui/assets/index-211fbe21.js +1 -0
  153. package/dist/ui/assets/index-23e16bff.js +1 -0
  154. package/dist/ui/assets/index-27aef8b5.js +1 -0
  155. package/dist/ui/assets/{index-36228db5.js → index-289b3fd9.js} +1 -1
  156. package/dist/ui/assets/{index-a22a3546.js → index-2dae59b1.js} +1 -1
  157. package/dist/ui/assets/index-353fd6dd.js +1 -0
  158. package/dist/ui/assets/{index-ea125a16.js → index-359d245d.js} +1 -1
  159. package/dist/ui/assets/{index-c62ac197.js → index-3b5ce20a.js} +70 -62
  160. package/dist/ui/assets/index-3b929ba4.js +34 -0
  161. package/dist/ui/assets/index-42e3a337.js +1 -0
  162. package/dist/ui/assets/index-44b6de3a.js +1 -0
  163. package/dist/ui/assets/index-46d3ca9a.js +7 -0
  164. package/dist/ui/assets/{index-e3cc723f.js → index-49016ad0.js} +1 -1
  165. package/dist/ui/assets/index-51132258.js +1 -0
  166. package/dist/ui/assets/{index-dc103f22.js → index-52963879.js} +1 -1
  167. package/dist/ui/assets/{index-fcc1c999.js → index-533fd007.js} +1 -1
  168. package/dist/ui/assets/index-59ec468b.js +13 -0
  169. package/dist/ui/assets/index-5e2d5279.js +1 -0
  170. package/dist/ui/assets/{index-d17da176.js → index-62f95885.js} +1 -1
  171. package/dist/ui/assets/index-659c6412.js +1 -0
  172. package/dist/ui/assets/index-6873dfc3.js +1 -0
  173. package/dist/ui/assets/index-69a68d9e.js +1 -0
  174. package/dist/ui/assets/index-6a6902c7.js +1 -0
  175. package/dist/ui/assets/index-7596c6bb.js +1 -0
  176. package/dist/ui/assets/{index-47dcc43a.js → index-8045c5f0.js} +1 -1
  177. package/dist/ui/assets/{index-b028e652.js → index-8677acd1.js} +1 -1
  178. package/dist/ui/assets/{index-42e65911.js → index-88c52b97.js} +1 -1
  179. package/dist/ui/assets/index-89cfefab.js +1 -0
  180. package/dist/ui/assets/{index-bea4c3dc.js → index-8c0643fd.js} +1 -1
  181. package/dist/ui/assets/index-8d5b6a1f.js +1 -0
  182. package/dist/ui/assets/index-8d5d70f9.js +1 -0
  183. package/dist/ui/assets/{index-9b41371d.js → index-91505016.js} +1 -1
  184. package/dist/ui/assets/{index-ffc00dbb.js → index-92314073.js} +1 -1
  185. package/dist/ui/assets/index-985cf3f6.js +1 -0
  186. package/dist/ui/assets/index-a14e51de.js +1 -0
  187. package/dist/ui/assets/index-a733f80b.js +1 -0
  188. package/dist/ui/assets/index-a84d5808.js +1 -0
  189. package/dist/ui/assets/index-acac6006.js +1 -0
  190. package/dist/ui/assets/index-b0ef7ac3.js +1 -0
  191. package/dist/ui/assets/index-b6ef5984.js +1 -0
  192. package/dist/ui/assets/{index-fc9071e0.js → index-bd4edda3.js} +1 -1
  193. package/dist/ui/assets/{index-0ec72c4b.js → index-c29b8474.js} +1 -1
  194. package/dist/ui/assets/index-c88c7790.js +19 -0
  195. package/dist/ui/assets/index-ce89a95e.css +7 -0
  196. package/dist/ui/assets/index-d221d69e.js +1 -0
  197. package/dist/ui/assets/{index-f1576468.js → index-d33facae.js} +1 -1
  198. package/dist/ui/assets/index-e46c57a5.js +1 -0
  199. package/dist/ui/assets/index-e863817c.js +1 -0
  200. package/dist/ui/assets/index-f4af2342.js +1 -0
  201. package/dist/ui/assets/{index-77e820d0.js → index-fc9f8c4b.js} +1 -1
  202. package/dist/ui/assets/{index-ec2010d2.js → index-ff23edc5.js} +1 -1
  203. package/dist/ui/assets/{index.esm-70ab539c.js → index.esm-b2d342b5.js} +1 -1
  204. package/dist/ui/assets/liveLocation-8e0bb2f3.js +1 -0
  205. package/dist/ui/assets/{mapView-ab35acaa.js → mapView-c8063ed6.js} +1 -1
  206. package/dist/ui/assets/modeuls-setup-4b06843c.js +1 -0
  207. package/dist/ui/assets/{permissionHoc-6f787658.js → permissionHoc-0818bfb0.js} +1 -1
  208. package/dist/ui/assets/{react-21134174.js → react-12ddbe48.js} +1 -1
  209. package/dist/ui/assets/{react-4d5dc208.js → react-61e0b284.js} +1 -1
  210. package/dist/ui/assets/{strongPassword-bbec776a.js → strongPassword-6bc8786f.js} +1 -1
  211. package/dist/ui/assets/{styles-0608350c.js → styles-b7ae7bf6.js} +1 -1
  212. package/dist/ui/assets/{tableV2-4d1c9fd2.js → tableV2-99c808c0.js} +1 -1
  213. package/dist/ui/assets/tableV3-24eed052.js +1 -0
  214. package/dist/ui/assets/ticketRequestDetails-8b299fbd.js +1 -0
  215. package/dist/ui/assets/{useDidUpdate-25c4d4ed.js → useDidUpdate-de319a18.js} +1 -1
  216. package/dist/ui/assets/{useDrop-02b0e5d7.js → useDrop-8f0d11a7.js} +1 -1
  217. package/dist/ui/assets/useFilteredData-e8fad668.js +1 -0
  218. package/dist/ui/assets/{usePermission-d94b4984.js → usePermission-4689548c.js} +1 -1
  219. package/dist/ui/assets/{vendor-charts-eccea5d1.js → vendor-charts-4be0b5ab.js} +1 -1
  220. package/dist/ui/assets/{vendor-codemirror-c8203b49.js → vendor-codemirror-1a1216c9.js} +11 -11
  221. package/dist/ui/assets/{vendor-devex-33a39e11.js → vendor-devex-4076ffeb.js} +2 -2
  222. package/dist/ui/assets/{vendor-excel-ee8fc4e5.js → vendor-excel-3b3553df.js} +1 -1
  223. package/dist/ui/assets/{vendor-i18n-2fcb1983.js → vendor-i18n-b89304ef.js} +1 -1
  224. package/dist/ui/assets/vendor-mui-98daa63f.js +185 -0
  225. package/dist/ui/assets/{vendor-pdf-b2a5d8b1.js → vendor-pdf-3c29882d.js} +1 -1
  226. package/dist/ui/assets/withHeaderItem-df2cc5d9.js +1 -0
  227. package/dist/ui/assets/{zh-cn-1881e930.js → zh-cn-13c6c696.js} +1 -1
  228. package/dist/ui/config.js +16 -20
  229. package/dist/ui/index.html +9 -9
  230. package/dist/ui/manifest.json +2 -2
  231. package/index.bundle.js +23 -9
  232. package/package.json +1 -1
  233. package/dist/ui/assets/AIVision-4f515575.js +0 -4
  234. package/dist/ui/assets/AccountDetails-2b42d262.js +0 -1
  235. package/dist/ui/assets/AccountDetails-492dee8f.js +0 -1
  236. package/dist/ui/assets/AccountServices-62599aae.js +0 -1
  237. package/dist/ui/assets/AccountsList-fe7cb5f9.js +0 -1
  238. package/dist/ui/assets/ActionLink-33e476e1.js +0 -1
  239. package/dist/ui/assets/AdaptableCard-df7695d6.js +0 -1
  240. package/dist/ui/assets/AddAccount-a05910e8.js +0 -1
  241. package/dist/ui/assets/AddEditFile-063c229b.js +0 -1
  242. package/dist/ui/assets/AddEditTranslation-43beae49.js +0 -1
  243. package/dist/ui/assets/AiApiLogList-a488921d.js +0 -1
  244. package/dist/ui/assets/AiCa-9c1b25b2.js +0 -1
  245. package/dist/ui/assets/Alert-7dfbd254.js +0 -1
  246. package/dist/ui/assets/ApiService-2b99757f.js +0 -1
  247. package/dist/ui/assets/AppLandingPage-3956cf0c.js +0 -4
  248. package/dist/ui/assets/AuditLogsList-7a2ce37d.js +0 -1
  249. package/dist/ui/assets/Auth0Callback-b943f19f.js +0 -1
  250. package/dist/ui/assets/BarCodes-17ed5da4.js +0 -1
  251. package/dist/ui/assets/BlankLayout-2f6e1153.js +0 -1
  252. package/dist/ui/assets/CalendarList-25834ddb.css +0 -11
  253. package/dist/ui/assets/CalendarList-72739043.js +0 -2
  254. package/dist/ui/assets/CategoryList-9f82e9a3.js +0 -1
  255. package/dist/ui/assets/CategoryList-c97891e7.js +0 -1
  256. package/dist/ui/assets/ChatContainer-4a38b179.js +0 -1
  257. package/dist/ui/assets/ChatsList-6c2c3e2f.js +0 -1
  258. package/dist/ui/assets/Check-71f21a49.js +0 -1
  259. package/dist/ui/assets/CheckInVideo-cb5fa9a2.js +0 -6
  260. package/dist/ui/assets/ClassicLayout-7d09e5ac.js +0 -1
  261. package/dist/ui/assets/CompanyList-9532f511.js +0 -1
  262. package/dist/ui/assets/ConfirmDialog-3202eb3d.js +0 -1
  263. package/dist/ui/assets/ContactDetails-3b70919b.js +0 -1
  264. package/dist/ui/assets/ContactsList-e9ac0fa3.js +0 -1
  265. package/dist/ui/assets/CountiesList-6ad338a5.js +0 -1
  266. package/dist/ui/assets/CountyDetails-22d4bc89.js +0 -1
  267. package/dist/ui/assets/CourseDetails-18040b49.js +0 -1
  268. package/dist/ui/assets/CourseList-e502f89d.js +0 -1
  269. package/dist/ui/assets/CreateSignature-375d191b.js +0 -7
  270. package/dist/ui/assets/DeckedLayout-909ac220.js +0 -1
  271. package/dist/ui/assets/DensitySelector-a2c1c68f.js +0 -1
  272. package/dist/ui/assets/DocumentActivity-d63dacec.js +0 -1
  273. package/dist/ui/assets/DocumentLayout-637075fd.js +0 -1
  274. package/dist/ui/assets/DocumentList2-518d2fa4.js +0 -23
  275. package/dist/ui/assets/DocumentLists-2da9ff88.js +0 -1
  276. package/dist/ui/assets/DocumentUserSigned-27bfa6e6.js +0 -7
  277. package/dist/ui/assets/DocumentsList-9f56db71.js +0 -1
  278. package/dist/ui/assets/DoubleSidedImage-ae98733b.js +0 -1
  279. package/dist/ui/assets/DynamicDashboard-6f177244.js +0 -1
  280. package/dist/ui/assets/EditAccount-1c1a8318.js +0 -1
  281. package/dist/ui/assets/EditLead-cc38d2a2.js +0 -1
  282. package/dist/ui/assets/FaqItems-c1c85af7.js +0 -6
  283. package/dist/ui/assets/FormContainer-91c2b0e4.js +0 -1
  284. package/dist/ui/assets/GenericPage-25a5d92a.js +0 -1
  285. package/dist/ui/assets/GridMapDetails-851a5781.js +0 -1
  286. package/dist/ui/assets/HorizontalMenuContent-96da38e1.js +0 -1
  287. package/dist/ui/assets/InvoicesList-8e66a112.js +0 -1
  288. package/dist/ui/assets/LeadDetails-ad63b3df.js +0 -1
  289. package/dist/ui/assets/LeadsList-bd7d9804.js +0 -1
  290. package/dist/ui/assets/Logo-3f3c9ee6.js +0 -1
  291. package/dist/ui/assets/MapView-afd1c913.js +0 -1
  292. package/dist/ui/assets/MarketingPage-89a860b1.js +0 -4
  293. package/dist/ui/assets/MenuEdit-d6e0d64c.js +0 -1
  294. package/dist/ui/assets/MessageInput-6dc83761.js +0 -21
  295. package/dist/ui/assets/MessagesList-966b69c5.js +0 -1
  296. package/dist/ui/assets/ModernLayout-03f30574.js +0 -1
  297. package/dist/ui/assets/Notify-bb3ce372.js +0 -1
  298. package/dist/ui/assets/OpportunitiesList-62eb34f6.js +0 -1
  299. package/dist/ui/assets/OpportunityDetails-356a8580.js +0 -1
  300. package/dist/ui/assets/OpportunityStatus-fa8108ea.js +0 -1
  301. package/dist/ui/assets/PasswordInput-8619a9df.js +0 -1
  302. package/dist/ui/assets/Profile-9104808b.js +0 -1
  303. package/dist/ui/assets/RoleEdit-98a6410b.js +0 -1
  304. package/dist/ui/assets/RoleForm-cc251eba.js +0 -1
  305. package/dist/ui/assets/ScheduleCycle-22c8e809.js +0 -1
  306. package/dist/ui/assets/ScreenList-9f7afa1c.js +0 -1
  307. package/dist/ui/assets/SidePanelContent-6b13836f.js +0 -1
  308. package/dist/ui/assets/SimpleLayout-d5445c0d.js +0 -2
  309. package/dist/ui/assets/StackedSideLayout-51127dc5.js +0 -1
  310. package/dist/ui/assets/StickyFooter-5b934274.js +0 -1
  311. package/dist/ui/assets/SupportRequets-be6542a9.js +0 -1
  312. package/dist/ui/assets/TimeLogApprovalDataList-c16d8bae.js +0 -1
  313. package/dist/ui/assets/TimeLogApprovalList-f6a75a20.js +0 -1
  314. package/dist/ui/assets/TimeLogList-ea288cce.js +0 -1
  315. package/dist/ui/assets/TimesheetsList-4a20e96c.js +0 -1
  316. package/dist/ui/assets/TranslationList-7a989333.js +0 -1
  317. package/dist/ui/assets/UserEdit-87262ea5.js +0 -1
  318. package/dist/ui/assets/UserForm-31fdd3b3.js +0 -1
  319. package/dist/ui/assets/ViewTimeLogForApproval-43b24a1a.js +0 -1
  320. package/dist/ui/assets/Views-74429e81.js +0 -1
  321. package/dist/ui/assets/WelcomeList-6c693eae.js +0 -9
  322. package/dist/ui/assets/actioncell-17e12e21.js +0 -1
  323. package/dist/ui/assets/calendarList-511b4d8f.js +0 -2
  324. package/dist/ui/assets/createSvgIcon-c5fc0d04.js +0 -1
  325. package/dist/ui/assets/documentsList-ac2c91ec.js +0 -1
  326. package/dist/ui/assets/dxicons-4c1b2089.ttf +0 -0
  327. package/dist/ui/assets/dxicons-ade3c9ed.woff2 +0 -0
  328. package/dist/ui/assets/dxicons-b4cd1226.woff +0 -0
  329. package/dist/ui/assets/gridList-cb9a14b1.js +0 -1
  330. package/dist/ui/assets/gridMapTable-c19770a8.js +0 -1
  331. package/dist/ui/assets/index-1d60e514.js +0 -1
  332. package/dist/ui/assets/index-26466d9d.js +0 -1
  333. package/dist/ui/assets/index-289cfedb.js +0 -1
  334. package/dist/ui/assets/index-2ce5b358.js +0 -1
  335. package/dist/ui/assets/index-307ce6d7.js +0 -1
  336. package/dist/ui/assets/index-36ba4ea7.js +0 -1
  337. package/dist/ui/assets/index-3f02e05a.js +0 -1
  338. package/dist/ui/assets/index-44662933.js +0 -13
  339. package/dist/ui/assets/index-51ee35f9.js +0 -1
  340. package/dist/ui/assets/index-54372d82.js +0 -1
  341. package/dist/ui/assets/index-569a9d2c.js +0 -1
  342. package/dist/ui/assets/index-62de659f.js +0 -13
  343. package/dist/ui/assets/index-6589dd2d.js +0 -1
  344. package/dist/ui/assets/index-6b6d0f06.js +0 -1
  345. package/dist/ui/assets/index-6c618440.js +0 -1
  346. package/dist/ui/assets/index-785ad361.js +0 -1
  347. package/dist/ui/assets/index-7df8779c.js +0 -1
  348. package/dist/ui/assets/index-82c9477e.js +0 -1
  349. package/dist/ui/assets/index-8ab45286.js +0 -1
  350. package/dist/ui/assets/index-8c229076.css +0 -7
  351. package/dist/ui/assets/index-a205cfed.js +0 -34
  352. package/dist/ui/assets/index-a23f9c87.js +0 -1
  353. package/dist/ui/assets/index-a455424a.js +0 -1
  354. package/dist/ui/assets/index-a4f78ee1.js +0 -1
  355. package/dist/ui/assets/index-aaad94c2.js +0 -1
  356. package/dist/ui/assets/index-b1b6b0f6.js +0 -1
  357. package/dist/ui/assets/index-c1f92742.js +0 -4
  358. package/dist/ui/assets/index-c2088808.js +0 -1
  359. package/dist/ui/assets/index-cbc29fa8.js +0 -1
  360. package/dist/ui/assets/index-cd2b7d32.js +0 -1
  361. package/dist/ui/assets/index-cf3804f1.js +0 -19
  362. package/dist/ui/assets/index-d0ef2cc2.js +0 -1
  363. package/dist/ui/assets/index-d1145737.js +0 -7
  364. package/dist/ui/assets/index-d58fb185.js +0 -1
  365. package/dist/ui/assets/index-d5b5a7e1.js +0 -1
  366. package/dist/ui/assets/index-daeff047.js +0 -1
  367. package/dist/ui/assets/index-ded3b055.js +0 -1
  368. package/dist/ui/assets/index-ede23a2b.js +0 -1
  369. package/dist/ui/assets/index-f8144346.js +0 -1
  370. package/dist/ui/assets/index-fd68b510.js +0 -1
  371. package/dist/ui/assets/index-fe3409ae.js +0 -1
  372. package/dist/ui/assets/liveLocation-646eef95.js +0 -1
  373. package/dist/ui/assets/modeuls-setup-402f891e.js +0 -1
  374. package/dist/ui/assets/tableV3-3d2f4952.js +0 -1
  375. package/dist/ui/assets/ticketRequestDetails-f78147f7.js +0 -1
  376. package/dist/ui/assets/vendor-mui-69397583.js +0 -185
  377. package/dist/ui/menudata/menus.json +0 -606
@@ -1,19 +0,0 @@
1
- import{j as n,l as He}from"./vendor-mui-69397583.js";import{r as c,c as se,f as mt}from"./vendor-react-ece1c85f.js";import{I as de,B as re,Z as Oe,W as ve,Y as Ye,l as Ge,h as ft,ea as pt,bm as gt,V as ht,D as Xe,e7 as xt,O as me,Q as fe,o as yt}from"./index-c62ac197.js";import{r as _e,a as bt,b as vt,t as oe,c as jt,u as wt,d as Re,g as St,e as Ct,f as Nt,s as Te}from"./index-8ab45286.js";import"./Alert-7dfbd254.js";import"./index-6b6d0f06.js";import"./index-c2088808.js";import{D as De}from"./Drawer-949c18c6.js";import{F as Ee,a as ee}from"./FormContainer-91c2b0e4.js";import"./Switcher-c8648037.js";import"./index-36228db5.js";import{U as Mt}from"./Upload-fb34ce03.js";import{A as Ot,T as Se}from"./actioncell-17e12e21.js";import{C as Ke}from"./tableV3-3d2f4952.js";import{A as Dt}from"./AdaptableCard-df7695d6.js";import{b as At}from"./index-ec2010d2.js";import{u as Lt,s as Et,e as Fe,B as Pt,C as It,O as Rt,a as Tt,L as Ft,b as kt,c as $t,M as qt,d as zt,A as Qt,f as Ut,N as Bt,g as Vt}from"./OpportunityStatus-fa8108ea.js";import{r as ke}from"./styles-0608350c.js";import{c as ne,a as Ae,F as Pe,b as Ie,d as ae}from"./index.esm-70ab539c.js";import{a as Ht}from"./FileManagementServices-25fd64c5.js";import{h as Yt,c as Gt}from"./BrainServices-a4bb698e.js";import{N as Xt}from"./NoData-8c485a3a.js";import{d as Je,e as Ze,f as We,g as et,H as _t,b as tt,c as Kt,i as Jt,j as Zt,k as Wt,l as en}from"./index-bea4c3dc.js";import{C as tn}from"./ConfirmDialog-3202eb3d.js";import"./vendor-redux-a1f00e6b.js";import"./vendor-pdf-b2a5d8b1.js";import"./vendor-devex-33a39e11.js";import"./vendor-i18n-2fcb1983.js";import"./vendor-msal-9caa1ed1.js";import"./vendor-charts-eccea5d1.js";import"./useControllableState-d0909575.js";import"./useDidUpdate-25c4d4ed.js";import"./FileSaver.min-20f3f13a.js";import"./mapView-ab35acaa.js";import"./esm-f306d015.js";import"./lodash-306e3f66.js";import"./DensitySelector-a2c1c68f.js";import"./cjs-162261df.js";const nn=ke.WidthProvider(ke.Responsive),rn=({onApplyLayout:e,initial:t="layout1"})=>{const r=[{i:"o-1",x:0,y:0,w:4,h:5},{i:"o-2",x:4,y:0,w:4,h:5},{i:"o-3",x:8,y:0,w:4,h:5},{i:"o-4",x:0,y:5,w:6,h:5},{i:"o-5",x:6,y:5,w:6,h:5},{i:"o-6",x:0,y:6,w:12,h:12},{i:"o-7",x:0,y:6,w:6,h:8}],o={layout1:r,layout2:[{i:"o-1",x:0,y:0,w:6,h:5},{i:"o-2",x:6,y:0,w:6,h:5},{i:"o-3",x:0,y:5,w:4,h:4},{i:"o-4",x:4,y:5,w:4,h:4},{i:"o-5",x:8,y:5,w:4,h:4},{i:"o-6",x:0,y:9,w:12,h:6},{i:"o-7",x:0,y:15,w:12,h:6}],layout3:[{i:"o-1",x:0,y:0,w:12,h:4},{i:"o-2",x:0,y:4,w:12,h:4},{i:"o-3",x:0,y:8,w:12,h:4},{i:"o-4",x:0,y:12,w:12,h:4},{i:"o-5",x:0,y:8,w:12,h:4},{i:"o-6",x:0,y:4,w:12,h:4},{i:"o-7",x:0,y:4,w:12,h:4}]},[f,N]=c.useState(t),x=()=>{const b=o[f]||r;e&&e(b)};return n.jsxs("div",{className:"LayoutSelection p-4",children:[n.jsxs("div",{className:"mb-4 flex gap-2 items-center",children:[n.jsxs("select",{value:f,className:"p-2 border rounded-md",onChange:b=>N(b.target.value),children:[n.jsx("option",{value:"layout1",children:"Sample Layout 1"}),n.jsx("option",{value:"layout2",children:"Sample Layout 2"}),n.jsx("option",{value:"layout3",children:"Sample Layout 3"})]}),n.jsx("button",{type:"button",className:"px-3 py-2 bg-neutral-700 text-white rounded",onClick:x,children:"Apply to Dashboard"})]}),n.jsx("div",{style:{border:"1px dashed #ddd",padding:8},children:n.jsx(nn,{className:"preview-layout",layouts:{lg:o[f]||r},breakpoints:{lg:1200},cols:{lg:12},rowHeight:30,width:900,isDraggable:!1,isResizable:!1,children:(o[f]||r).map(b=>n.jsx("div",{className:"bg-gray-200 rounded p-2 text-sm flex items-center justify-center border",style:{display:"flex",alignItems:"center",justifyContent:"center"},children:b.i},b.i))})})]})},an=ne().shape({layoutName:Ae().required("Layout Name is required")}),sn=({handleFormSubmit:e,initialValues:t,isPublishFormLoading:r})=>{const a=async(s,o)=>{o(!0);try{e(s)}catch(f){console.error("Error submitting form:",f)}finally{o(!1)}};return n.jsx(Pe,{initialValues:t,validationSchema:an,onSubmit:(s,{setSubmitting:o})=>{a(s,o)},children:({touched:s,errors:o,values:f})=>n.jsx(Ie,{children:n.jsxs(Ee,{children:[n.jsx(ee,{asterisk:!0,label:"Layout Name",invalid:o.layoutName&&s.layoutName,errorMessage:o.layoutName,children:n.jsx(ae,{type:"text",autoComplete:"off",name:"layoutName",placeholder:"Layout Name",component:de})}),n.jsx(ee,{label:"Description",invalid:o.description&&s.description,errorMessage:o.description,children:n.jsx(ae,{type:"text",autoComplete:"off",name:"description",placeholder:"Description",component:de})}),n.jsx(re,{block:!0,variant:"solid",color:"neutral-700",type:"submit",loading:r,children:"Submit"})]})})})};function $e(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,a=Array(t);r<t;r++)a[r]=e[r];return a}function on(e){if(Array.isArray(e))return e}function ln(e,t,r){return(t=gn(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function cn(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var a,s,o,f,N=[],x=!0,b=!1;try{if(o=(r=r.call(e)).next,t!==0)for(;!(x=(a=o.call(r)).done)&&(N.push(a.value),N.length!==t);x=!0);}catch($){b=!0,s=$}finally{try{if(!x&&r.return!=null&&(f=r.return(),Object(f)!==f))return}finally{if(b)throw s}}return N}}function un(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
2
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function qe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,a)}return r}function ze(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?qe(Object(r),!0).forEach(function(a){ln(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):qe(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function dn(e,t){if(e==null)return{};var r,a,s=mn(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a<o.length;a++)r=o[a],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function mn(e,t){if(e==null)return{};var r={};for(var a in e)if({}.hasOwnProperty.call(e,a)){if(t.indexOf(a)!==-1)continue;r[a]=e[a]}return r}function fn(e,t){return on(e)||cn(e,t)||hn(e,t)||un()}function pn(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function gn(e){var t=pn(e,"string");return typeof t=="symbol"?t:t+""}function hn(e,t){if(e){if(typeof e=="string")return $e(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?$e(e,t):void 0}}function xn(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Qe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,a)}return r}function Ue(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Qe(Object(r),!0).forEach(function(a){xn(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Qe(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function yn(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return function(a){return t.reduceRight(function(s,o){return o(s)},a)}}function ce(e){return function t(){for(var r=this,a=arguments.length,s=new Array(a),o=0;o<a;o++)s[o]=arguments[o];return s.length>=e.length?e.apply(this,s):function(){for(var f=arguments.length,N=new Array(f),x=0;x<f;x++)N[x]=arguments[x];return t.apply(r,[].concat(s,N))}}}function je(e){return{}.toString.call(e).includes("Object")}function bn(e){return!Object.keys(e).length}function pe(e){return typeof e=="function"}function vn(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function jn(e,t){return je(t)||ie("changeType"),Object.keys(t).some(function(r){return!vn(e,r)})&&ie("changeField"),t}function wn(e){pe(e)||ie("selectorType")}function Sn(e){pe(e)||je(e)||ie("handlerType"),je(e)&&Object.values(e).some(function(t){return!pe(t)})&&ie("handlersType")}function Cn(e){e||ie("initialIsRequired"),je(e)||ie("initialType"),bn(e)&&ie("initialContent")}function Nn(e,t){throw new Error(e[t]||e.default)}var Mn={initialIsRequired:"initial state is required",initialType:"initial state should be an object",initialContent:"initial state shouldn't be an empty object",handlerType:"handler should be an object or a function",handlersType:"all handlers should be a functions",selectorType:"selector should be a function",changeType:"provided value of changes should be an object",changeField:'it seams you want to change a field in the state which is not specified in the "initial" state',default:"an unknown error accured in `state-local` package"},ie=ce(Nn)(Mn),xe={changes:jn,selector:wn,handler:Sn,initial:Cn};function On(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};xe.initial(e),xe.handler(t);var r={current:e},a=ce(Ln)(r,t),s=ce(An)(r),o=ce(xe.changes)(e),f=ce(Dn)(r);function N(){var b=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function($){return $};return xe.selector(b),b(r.current)}function x(b){yn(a,s,o,f)(b)}return[N,x]}function Dn(e,t){return pe(t)?t(e.current):t}function An(e,t){return e.current=Ue(Ue({},e.current),t),t}function Ln(e,t,r){return pe(t)?t(e.current):Object.keys(r).forEach(function(a){var s;return(s=t[a])===null||s===void 0?void 0:s.call(t,e.current[a])}),r}var En={create:On},Pn={paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.55.1/min/vs"}};function In(e){return function t(){for(var r=this,a=arguments.length,s=new Array(a),o=0;o<a;o++)s[o]=arguments[o];return s.length>=e.length?e.apply(this,s):function(){for(var f=arguments.length,N=new Array(f),x=0;x<f;x++)N[x]=arguments[x];return t.apply(r,[].concat(s,N))}}}function Rn(e){return{}.toString.call(e).includes("Object")}function Tn(e){return e||Be("configIsRequired"),Rn(e)||Be("configType"),e.urls?(Fn(),{paths:{vs:e.urls.monacoBase}}):e}function Fn(){console.warn(nt.deprecation)}function kn(e,t){throw new Error(e[t]||e.default)}var nt={configIsRequired:"the configuration object is required",configType:"the configuration object should be an object",default:"an unknown error accured in `@monaco-editor/loader` package",deprecation:`Deprecation warning!
3
- You are using deprecated way of configuration.
4
-
5
- Instead of using
6
- monaco.config({ urls: { monacoBase: '...' } })
7
- use
8
- monaco.config({ paths: { vs: '...' } })
9
-
10
- For more please check the link https://github.com/suren-atoyan/monaco-loader#config
11
- `},Be=In(kn)(nt),$n={config:Tn},qn=function(){for(var t=arguments.length,r=new Array(t),a=0;a<t;a++)r[a]=arguments[a];return function(s){return r.reduceRight(function(o,f){return f(o)},s)}};function rt(e,t){return Object.keys(t).forEach(function(r){t[r]instanceof Object&&e[r]&&Object.assign(t[r],rt(e[r],t[r]))}),ze(ze({},e),t)}var zn={type:"cancelation",msg:"operation is manually canceled"};function Ce(e){var t=!1,r=new Promise(function(a,s){e.then(function(o){return t?s(zn):a(o)}),e.catch(s)});return r.cancel=function(){return t=!0},r}var Qn=["monaco"],Un=En.create({config:Pn,isInitialized:!1,resolve:null,reject:null,monaco:null}),at=fn(Un,2),ge=at[0],we=at[1];function Bn(e){var t=$n.config(e),r=t.monaco,a=dn(t,Qn);we(function(s){return{config:rt(s.config,a),monaco:r}})}function Vn(){var e=ge(function(t){var r=t.monaco,a=t.isInitialized,s=t.resolve;return{monaco:r,isInitialized:a,resolve:s}});if(!e.isInitialized){if(we({isInitialized:!0}),e.monaco)return e.resolve(e.monaco),Ce(Ne);if(window.monaco&&window.monaco.editor)return st(window.monaco),e.resolve(window.monaco),Ce(Ne);qn(Hn,Gn)(Xn)}return Ce(Ne)}function Hn(e){return document.body.appendChild(e)}function Yn(e){var t=document.createElement("script");return e&&(t.src=e),t}function Gn(e){var t=ge(function(a){var s=a.config,o=a.reject;return{config:s,reject:o}}),r=Yn("".concat(t.config.paths.vs,"/loader.js"));return r.onload=function(){return e()},r.onerror=t.reject,r}function Xn(){var e=ge(function(r){var a=r.config,s=r.resolve,o=r.reject;return{config:a,resolve:s,reject:o}}),t=window.require;t.config(e.config),t(["vs/editor/editor.main"],function(r){var a=r.m||r;st(a),e.resolve(a)},function(r){e.reject(r)})}function st(e){ge().monaco||we({monaco:e})}function _n(){return ge(function(e){var t=e.monaco;return t})}var Ne=new Promise(function(e,t){return we({resolve:e,reject:t})}),it={config:Bn,init:Vn,__getMonacoInstance:_n},Kn={wrapper:{display:"flex",position:"relative",textAlign:"initial"},fullWidth:{width:"100%"},hide:{display:"none"}},Me=Kn,Jn={container:{display:"flex",height:"100%",width:"100%",justifyContent:"center",alignItems:"center"}},Zn=Jn;function Wn({children:e}){return se.createElement("div",{style:Zn.container},e)}var er=Wn,tr=er;function nr({width:e,height:t,isEditorReady:r,loading:a,_ref:s,className:o,wrapperProps:f}){return se.createElement("section",{style:{...Me.wrapper,width:e,height:t},...f},!r&&se.createElement(tr,null,a),se.createElement("div",{ref:s,style:{...Me.fullWidth,...!r&&Me.hide},className:o}))}var rr=nr,ot=c.memo(rr);function ar(e){c.useEffect(e,[])}var lt=ar;function sr(e,t,r=!0){let a=c.useRef(!0);c.useEffect(a.current||!r?()=>{a.current=!1}:e,t)}var X=sr;function ue(){}function le(e,t,r,a){return ir(e,a)||or(e,t,r,a)}function ir(e,t){return e.editor.getModel(ct(e,t))}function or(e,t,r,a){return e.editor.createModel(t,r,a?ct(e,a):void 0)}function ct(e,t){return e.Uri.parse(t)}function lr({original:e,modified:t,language:r,originalLanguage:a,modifiedLanguage:s,originalModelPath:o,modifiedModelPath:f,keepCurrentOriginalModel:N=!1,keepCurrentModifiedModel:x=!1,theme:b="light",loading:$="Loading...",options:S={},height:Q="100%",width:H="100%",className:q,wrapperProps:U={},beforeMount:z=ue,onMount:K=ue}){let[T,J]=c.useState(!1),[Y,P]=c.useState(!0),F=c.useRef(null),O=c.useRef(null),G=c.useRef(null),A=c.useRef(K),C=c.useRef(z),k=c.useRef(!1);lt(()=>{let u=it.init();return u.then(i=>(O.current=i)&&P(!1)).catch(i=>(i==null?void 0:i.type)!=="cancelation"&&console.error("Monaco initialization: error:",i)),()=>F.current?w():u.cancel()}),X(()=>{if(F.current&&O.current){let u=F.current.getOriginalEditor(),i=le(O.current,e||"",a||r||"text",o||"");i!==u.getModel()&&u.setModel(i)}},[o],T),X(()=>{if(F.current&&O.current){let u=F.current.getModifiedEditor(),i=le(O.current,t||"",s||r||"text",f||"");i!==u.getModel()&&u.setModel(i)}},[f],T),X(()=>{let u=F.current.getModifiedEditor();u.getOption(O.current.editor.EditorOption.readOnly)?u.setValue(t||""):t!==u.getValue()&&(u.executeEdits("",[{range:u.getModel().getFullModelRange(),text:t||"",forceMoveMarkers:!0}]),u.pushUndoStop())},[t],T),X(()=>{var u,i;(i=(u=F.current)==null?void 0:u.getModel())==null||i.original.setValue(e||"")},[e],T),X(()=>{let{original:u,modified:i}=F.current.getModel();O.current.editor.setModelLanguage(u,a||r||"text"),O.current.editor.setModelLanguage(i,s||r||"text")},[r,a,s],T),X(()=>{var u;(u=O.current)==null||u.editor.setTheme(b)},[b],T),X(()=>{var u;(u=F.current)==null||u.updateOptions(S)},[S],T);let v=c.useCallback(()=>{var p;if(!O.current)return;C.current(O.current);let u=le(O.current,e||"",a||r||"text",o||""),i=le(O.current,t||"",s||r||"text",f||"");(p=F.current)==null||p.setModel({original:u,modified:i})},[r,t,s,e,a,o,f]),j=c.useCallback(()=>{var u;!k.current&&G.current&&(F.current=O.current.editor.createDiffEditor(G.current,{automaticLayout:!0,...S}),v(),(u=O.current)==null||u.editor.setTheme(b),J(!0),k.current=!0)},[S,b,v]);c.useEffect(()=>{T&&A.current(F.current,O.current)},[T]),c.useEffect(()=>{!Y&&!T&&j()},[Y,T,j]);function w(){var i,p,m,g;let u=(i=F.current)==null?void 0:i.getModel();N||((p=u==null?void 0:u.original)==null||p.dispose()),x||((m=u==null?void 0:u.modified)==null||m.dispose()),(g=F.current)==null||g.dispose()}return se.createElement(ot,{width:H,height:Q,isEditorReady:T,loading:$,_ref:G,className:q,wrapperProps:U})}var cr=lr;c.memo(cr);function ur(e){let t=c.useRef();return c.useEffect(()=>{t.current=e},[e]),t.current}var dr=ur,ye=new Map;function mr({defaultValue:e,defaultLanguage:t,defaultPath:r,value:a,language:s,path:o,theme:f="light",line:N,loading:x="Loading...",options:b={},overrideServices:$={},saveViewState:S=!0,keepCurrentModel:Q=!1,width:H="100%",height:q="100%",className:U,wrapperProps:z={},beforeMount:K=ue,onMount:T=ue,onChange:J,onValidate:Y=ue}){let[P,F]=c.useState(!1),[O,G]=c.useState(!0),A=c.useRef(null),C=c.useRef(null),k=c.useRef(null),v=c.useRef(T),j=c.useRef(K),w=c.useRef(),u=c.useRef(a),i=dr(o),p=c.useRef(!1),m=c.useRef(!1);lt(()=>{let d=it.init();return d.then(M=>(A.current=M)&&G(!1)).catch(M=>(M==null?void 0:M.type)!=="cancelation"&&console.error("Monaco initialization: error:",M)),()=>C.current?h():d.cancel()}),X(()=>{var M,R,L,V;let d=le(A.current,e||a||"",t||s||"",o||r||"");d!==((M=C.current)==null?void 0:M.getModel())&&(S&&ye.set(i,(R=C.current)==null?void 0:R.saveViewState()),(L=C.current)==null||L.setModel(d),S&&((V=C.current)==null||V.restoreViewState(ye.get(o))))},[o],P),X(()=>{var d;(d=C.current)==null||d.updateOptions(b)},[b],P),X(()=>{!C.current||a===void 0||(C.current.getOption(A.current.editor.EditorOption.readOnly)?C.current.setValue(a):a!==C.current.getValue()&&(m.current=!0,C.current.executeEdits("",[{range:C.current.getModel().getFullModelRange(),text:a,forceMoveMarkers:!0}]),C.current.pushUndoStop(),m.current=!1))},[a],P),X(()=>{var M,R;let d=(M=C.current)==null?void 0:M.getModel();d&&s&&((R=A.current)==null||R.editor.setModelLanguage(d,s))},[s],P),X(()=>{var d;N!==void 0&&((d=C.current)==null||d.revealLine(N))},[N],P),X(()=>{var d;(d=A.current)==null||d.editor.setTheme(f)},[f],P);let g=c.useCallback(()=>{var d;if(!(!k.current||!A.current)&&!p.current){j.current(A.current);let M=o||r,R=le(A.current,a||e||"",t||s||"",M||"");C.current=(d=A.current)==null?void 0:d.editor.create(k.current,{model:R,automaticLayout:!0,...b},$),S&&C.current.restoreViewState(ye.get(M)),A.current.editor.setTheme(f),N!==void 0&&C.current.revealLine(N),F(!0),p.current=!0}},[e,t,r,a,s,o,b,$,S,f,N]);c.useEffect(()=>{P&&v.current(C.current,A.current)},[P]),c.useEffect(()=>{!O&&!P&&g()},[O,P,g]),u.current=a,c.useEffect(()=>{var d,M;P&&J&&((d=w.current)==null||d.dispose(),w.current=(M=C.current)==null?void 0:M.onDidChangeModelContent(R=>{m.current||J(C.current.getValue(),R)}))},[P,J]),c.useEffect(()=>{if(P){let d=A.current.editor.onDidChangeMarkers(M=>{var L;let R=(L=C.current.getModel())==null?void 0:L.uri;if(R&&M.find(V=>V.path===R.path)){let V=A.current.editor.getModelMarkers({resource:R});Y==null||Y(V)}});return()=>{d==null||d.dispose()}}return()=>{}},[P,Y]);function h(){var d,M;(d=w.current)==null||d.dispose(),Q?S&&ye.set(o,C.current.saveViewState()):(M=C.current.getModel())==null||M.dispose(),C.current.dispose()}return se.createElement(ot,{width:H,height:q,isEditorReady:P,loading:x,_ref:k,className:U,wrapperProps:z})}var fr=mr,pr=c.memo(fr),gr=pr;const hr=e=>e.map(t=>{const r=t.name.toLowerCase().includes("date");return{dataField:t.name,caption:t.name.trim(),width:230,dataType:r?"date":"string",cellRender:a=>{let s=a.value;return r&&s&&(s=Oe(s).format("MM/DD/YYYY")),s??""}}}),xr=[{label:"Advantage Labor Clients",value:"dyn.dyn_9f6f_advantagelaborclients_8b103205",tag:"Dynamic"},{label:"Advantage Labor Position",value:"dyn.dyn_9f6f_advantagelaborposition_d0f334d6",tag:"Dynamic"},{label:"Advantage Labor Jobs",value:"dyn.dyn_9f6f_advantagelaborjobs_6a8cb5b9",tag:"Dynamic"},{label:"Advantage Labor Employees",value:"dyn.dyn_9f6f_advantagelaboremployees_eaf6e81d",tag:"Dynamic"}],Le=(e="",t)=>t?e.trim()?/from\s+[\w.\[\]]+(\s+\w+)?/i.test(e)?e.replace(/from\s+[\w.\[\]]+(\s+\w+)?/i,`FROM ${t}`):`${e.trim()} FROM ${t}`:`SELECT * FROM ${t}`:e;function yr({label:e,value:t,onChange:r,type:a="text",min:s,max:o}){const[f,N]=c.useState(!1),[x,b]=c.useState(""),$=a==="icon"?Object.keys(HiIcons).filter(S=>S.toLowerCase().includes(x.toLowerCase())):[];return n.jsxs("label",{className:"grid text-sm gap-1 relative w-full",children:[n.jsx("span",{className:"text-gray-700 font-medium",children:e}),a==="icon"&&n.jsxs("div",{className:"flex flex-col gap-2",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("input",{readOnly:!0,className:"px-3 py-2 border rounded-lg bg-white flex-1",value:t}),n.jsx("button",{type:"button",className:"px-2 py-1 border rounded-lg bg-gray-100",onClick:()=>N(S=>!S),children:"Choose"})]}),f&&n.jsxs("div",{className:"absolute top-full mt-2 z-50 p-2 bg-white border rounded shadow-lg max-h-64 overflow-y-auto w-full",children:[n.jsx("input",{type:"text",placeholder:"Search icon...",className:"px-2 py-1 mb-2 w-full border rounded",value:x,onChange:S=>b(S.target.value)}),n.jsx("div",{className:"grid grid-cols-6 gap-2",children:$.map(S=>{const Q=HiIcons[S];return n.jsx("button",{className:`p-2 border rounded hover:bg-gray-100 ${t===S?"bg-blue-200":""}`,title:S,onClick:()=>{r(S),N(!1),b("")},children:n.jsx(Q,{size:24})},S)})})]})]})]})}const ut=(e="")=>{const t=e.match(/select\s+(.*?)\s+from/i);if(!t)return[];const r=t[1].trim();return r==="*"?["*"]:r.split(",").map(a=>a.trim().replace(/["'`]/g,"")).filter(Boolean)},br=(e,t,r)=>{if(!t)return e;const a=Le(e,t),s=ut(a);let o;s.includes(r)?o=s.filter(N=>N!==r):o=s.includes("*")?[r]:[...s,r];const f=o.length===0?"*":o.join(", ");return a.replace(/select\s+.*?\s+from/i,`SELECT ${f} FROM`)},vr=({activeWidgetInstance:e,activeWidgetTemplate:t,setWidgets:r,setWidgetSettingOpen:a})=>{var P,F,O,G,A,C,k;const s=["o-1","o-3"].includes(t==null?void 0:t.templateId),o=(t==null?void 0:t.templateId)==="o-4",[f,N]=c.useState(!1),[x,b]=c.useState(null),[$,S]=c.useState(null),[Q,H]=c.useState([]),[q,U]=c.useState([]),z=ne({name:Ae().required("Query title is required"),sqlQuery:Ae().required("SQL Query is required"),fromTable:ne().nullable().required("From Table is required"),xAxisCol:s?ne().nullable().required("X axis Column Name is required"):ne().nullable(),yAxisCol:s?ne().nullable().required("Y axis Column Name is required").test("not-same-as-x","X axis and Y axis cannot be the same",function(v){const j=this.parent.xAxisCol;return!v||!j?!0:v.value!==j.value}):ne().nullable()}),K=async v=>{var j,w;N(!0),S(null),b(null);try{const u=await Fe({sqlQuery:v,maxRows:5});b({data:(j=u==null?void 0:u.data)==null?void 0:j.$values,columns:hr((w=u==null?void 0:u.columns)==null?void 0:w.$values)})}catch(u){S(u.message)}finally{N(!1)}},T=async v=>{var j;try{const w=await Fe({sqlQuery:v,maxRows:5});H((j=w==null?void 0:w.columns)==null?void 0:j.$values.map(u=>u.name)),S(null)}catch(w){S(w.message)}},J=async v=>{var j;try{const w=await Yt(v);H((j=w==null?void 0:w.data)==null?void 0:j.$values.map(u=>u.name)),S(null)}catch(w){S(w.message)}},Y=async()=>{var w,u;const v=await Gt(),j=((u=(w=v==null?void 0:v.data)==null?void 0:w.$values)==null?void 0:u.map(i=>({label:i.name.replace(/\[|\]/g,""),value:i.name,tag:"Static"})))||[];U([...xr,...j])};return c.useEffect(()=>{Y()},[]),n.jsx(Pe,{enableReinitialize:!0,initialValues:{...e==null?void 0:e.configuration,xAxisCol:((P=e==null?void 0:e.configuration)==null?void 0:P.xAxisCol)||null,yAxisCol:((F=e==null?void 0:e.configuration)==null?void 0:F.yAxisCol)||null,fromTable:((O=e==null?void 0:e.configuration)==null?void 0:O.fromTable)||null,widgetVisual:((G=e==null?void 0:e.configuration)==null?void 0:G.widgetVisual)||{mode:((A=e==null?void 0:e.configuration)==null?void 0:A.mode)||"icon",icon:((C=e==null?void 0:e.configuration)==null?void 0:C.icon)||"",imageUrl:((k=e==null?void 0:e.configuration)==null?void 0:k.imageUrl)||""}},validationSchema:z,onSubmit:async v=>{var i;if(console.log("[WidgetSettings] onSubmit fired",{values:v,activeWidgetInstance:e}),!(e!=null&&e.id))return;const{widgetVisual:j,...w}=v,u={...w,mode:j==null?void 0:j.mode,icon:j==null?void 0:j.icon,imageUrl:j==null?void 0:j.imageUrl,widgetVisual:j||null};try{const p={widgetId:e.widgetId,name:v.name,description:v.description,sqlQuery:v.sqlQuery};console.log("[WidgetSettings] calling saveQuery/updateQuery",p);const m=(i=e.configuration)==null?void 0:i.savedQueryId;let g=m;if(m)await Lt(m,p);else{const h=await Et(p);g=h==null?void 0:h.id}r(h=>h.map(d=>d.id===e.id?{...d,configuration:{...d.configuration,...u,savedQueryId:g}}:d)),a(!1)}catch(p){console.error("[WidgetSettings] save error",p),S(p.message)}},children:({values:v,touched:j,errors:w,setFieldValue:u,setFieldTouched:i})=>{var p;return console.log("[WidgetSettings] form errors",w),n.jsx(Ie,{children:n.jsxs(Ee,{children:[n.jsxs("div",{className:"grid grid-cols-3 gap-4 mb-2",children:[n.jsx(ee,{asterisk:!0,label:"Query Title",invalid:w.name&&j.name,errorMessage:w.name,children:n.jsx(ae,{name:"name",children:({field:m})=>n.jsx(de,{...m})})}),n.jsx(ee,{label:"Query Description",children:n.jsx(ae,{name:"description",children:({field:m})=>n.jsx(de,{...m})})}),n.jsx(ee,{asterisk:!0,label:"From Table",invalid:w.fromTable&&j.fromTable,errorMessage:w.fromTable,children:n.jsx(ve,{placeholder:"Select table",value:v.fromTable||null,options:q||[],onChange:m=>{console.log("values",v),u("fromTable",m),u("sqlQuery",Le(v.sqlQuery,m.value))}})}),o&&n.jsx("div",{className:"col-span-2",children:n.jsx(ee,{label:"Widget Icon / Image",children:n.jsx(ae,{name:"widgetVisual",children:({field:m,form:g})=>{const h=m.value||{mode:"icon"};return n.jsxs("div",{className:"grid grid-cols-[minmax(0,1fr)_120px] gap-4 items-center",children:[n.jsxs("div",{className:"space-y-3",children:[n.jsxs("div",{className:"flex gap-4",children:[n.jsxs("label",{className:"flex items-center gap-2 text-sm",children:[n.jsx("input",{type:"radio",checked:h.mode==="icon",onChange:()=>g.setFieldValue(m.name,{mode:"icon",icon:"",imageUrl:""})}),"Icon"]}),n.jsxs("label",{className:"flex items-center gap-2 text-sm",children:[n.jsx("input",{type:"radio",checked:h.mode==="image",onChange:()=>g.setFieldValue(m.name,{mode:"image",icon:"",imageUrl:""})}),"Image"]})]}),h.mode==="icon"&&n.jsx(yr,{label:"Select Icon",type:"icon",value:h.icon,onChange:d=>{g.setFieldValue(m.name,{...h,icon:d})}}),h.mode==="image"&&n.jsx(Mt,{draggable:!0,accept:"image/*",cropNeeded:!1,onChange:async d=>{var R;if(!(d!=null&&d[0]))return;const M=d[0];try{const L=await Ht(M,!0),V=((R=L==null?void 0:L.data)==null?void 0:R.publicUrl)||URL.createObjectURL(M);g.setFieldValue(m.name,{...h,imageUrl:V})}catch(L){console.error("Image upload failed",L)}}})]}),n.jsxs("div",{className:"border rounded p-3 w-28 h-28 flex items-center justify-center",children:[h.mode==="icon"&&h.icon&&(()=>{const d=HiIcons[h.icon];return n.jsx(d,{size:40})})(),h.mode==="image"&&h.imageUrl&&n.jsx("img",{src:h.imageUrl,alt:"preview",className:"w-full h-full object-contain rounded"}),!h.icon&&!h.imageUrl&&n.jsx("span",{className:"text-xs text-gray-400 text-center",children:"Preview"})]})]})}})})}),s&&n.jsxs(n.Fragment,{children:[n.jsxs(ee,{asterisk:!0,label:"X axis Column Name (label)",invalid:w.xAxisCol&&j.xAxisCol,errorMessage:w.xAxisCol,children:[n.jsx(ae,{name:"xAxisCol",children:({field:m,form:g})=>{var h;return n.jsx(ve,{field:m,form:g,options:((h=x==null?void 0:x.columns)==null?void 0:h.map(d=>({label:d.dataField,value:d.dataField})))||[],placeholder:"Select X axis column",onChange:d=>{g.setFieldValue(m.name,d)}})}}),n.jsx("small",{className:"text-xs text-gray-400",children:" Execute the query to fetch columns to choose X-axis"})]}),n.jsxs(ee,{asterisk:!0,label:"Y axis Column Name (value)",invalid:w.yAxisCol&&j.yAxisCol,errorMessage:w.yAxisCol,children:[n.jsx(ae,{name:"yAxisCol",children:({field:m,form:g})=>{var h;return n.jsx(ve,{field:m,form:g,options:((h=x==null?void 0:x.columns)==null?void 0:h.map(d=>({label:d.dataField,value:d.dataField})))||[],placeholder:"Select Y axis column",onChange:d=>{g.setFieldValue(m.name,d)}})}}),n.jsx("small",{className:"text-xs text-gray-400",children:" Execute the query to fetch columns to choose Y-axis"})]})]})]}),n.jsxs(n.Fragment,{children:[n.jsx(re,{variant:"solid",size:"sm",type:"button",onClick:()=>{var m,g,h,d;return((g=(m=v.fromTable)==null?void 0:m.tag)==null?void 0:g.toLowerCase())==="dynamic"?T(Le("",(h=v.fromTable)==null?void 0:h.value)):J((d=v.fromTable)==null?void 0:d.value)},children:"Fetch Columns"}),n.jsx("div",{className:"flex flex-wrap gap-x-2 gap-y-3 my-2",children:Q.map(m=>{const g=ut(v.sqlQuery),h=g.includes(m)||g.includes("*");return n.jsx("span",{className:`
12
- inline-flex items-center justify-center
13
- h-7 px-3
14
- text-xs font-medium
15
- rounded-md
16
- whitespace-nowrap leading-none
17
- transition-all cursor-pointer
18
- ${h?"bg-orange-500 text-white shadow-sm hover:bg-orange-600":"border border-orange-400 text-orange-600 hover:bg-orange-100"}
19
- `,onClick:()=>{var d;return u("sqlQuery",br(v.sqlQuery,(d=v.fromTable)==null?void 0:d.value,m))},children:m},m)})}),n.jsx(ee,{asterisk:!0,label:"SQL Query for Data Grid",invalid:w.sqlQuery&&j.sqlQuery,errorMessage:w.sqlQuery,children:n.jsx(gr,{height:"180px",language:"sql",value:v.sqlQuery,onChange:m=>{u("sqlQuery",m),i("sqlQuery",!0,!1)}})}),n.jsxs("div",{className:"flex gap-2 my-3",children:[n.jsx(re,{type:"button",loading:f,onClick:()=>K(v.sqlQuery),children:"Execute & Preview"}),n.jsx(re,{type:"submit",variant:"solid",children:"Save"})]}),((p=x==null?void 0:x.data)==null?void 0:p.length)>0&&n.jsx(Ke,{tableName:"previewData",dataSource:x.data,columns:x.columns,height:"300px",keyExpr:"$id"}),$&&n.jsx("p",{className:"text-red-500 text-sm mt-2",children:$})]})]})})}})},jr=()=>n.jsxs(n.Fragment,{children:[n.jsx("style",{}),n.jsxs("svg",{viewBox:"0 0 10.643 5.995",width:"1em",height:"1em",fill:"#ff0000",children:[n.jsx("polygon",{points:".208 5.787 .208 0 0 0 0 5.787 0 5.995 .208 5.995 10.643 5.995 10.643 5.787 .208 5.787",style:{fill:"#6d6d6d"}}),n.jsx("polygon",{points:"1.104 4.738 .87 4.48 2.93 2.618 4.603 2.618 6.138 1.85 7.855 3.088 9.985 .709 10.245 .942 7.906 3.553 6.105 2.255 4.685 2.967 3.064 2.967 1.104 4.738",style:{fill:"#2d2d2d"}})]})]});Ye("layouts",_e);const wr={"Bar Graph":_t,"Data Grid":tt,"Line Graph":Kt,"Count Card":Je,Maps:Jt,"Activity Log":Zt,Alert:Wt},Sr={4:"1/3",6:"1/2",8:"2/3",12:"Full"},be=[{widgetId:"6f8a2c3e-9d4a-4c3b-9f6e-8b6d3f4a2e91",name:"Bar Graph",component:Pt,icon:It,templateId:"o-1",desc:"Shows a timeline...",configuration:{}},{widgetId:"1b7e9d2a-4c6f-4e1a-b8d3-2a9f6c5e7d10",name:"Data Grid",component:Rt,icon:Tt,templateId:"o-2",desc:"Displays content...",configuration:{}},{widgetId:"c3f9a6b4-2d7e-4a5f-9e18-6b0d2a4c8f31",name:"Line Graph",component:Ft,icon:jr,templateId:"o-3",desc:"Track automation...",configuration:{}},{widgetId:"9e2d6b5a-7c3f-4a1e-b084-3f6c9d2a8e57",name:"Count Card",component:kt,icon:$t,templateId:"o-4",desc:"Track counts...",configuration:{}},{widgetId:"4a8f2c9d-6b3e-4f1a-9d72-5e8b6c3a2f40",name:"Maps",component:qt,icon:zt,templateId:"o-5",desc:"Visualizes location data...",configuration:{}},{widgetId:"2f6b9a8e-3d4c-4e1a-bf57-9c2d6a8e4b10",name:"Activity Log",component:Qt,icon:Ut,templateId:"o-7",desc:"Shows a timeline...",configuration:{}},{widgetId:"a9e3f2d6-8b4c-4f1a-9d75-6c2e8b4a0f93",name:"Alert",component:Bt,icon:Vt,templateId:"o-8",desc:"Displays brief messages...",configuration:{}}],Ve=e=>e<=4?4:e<=6?6:e<=8?8:12,Cr=({fetchData:e})=>{const t=Ge(),{loadingDetails:r,selectedLayoutData:a,type:s,selectedLayout:o}=ft(l=>l.layouts.data),[f,N]=c.useState(!1),[x,b]=c.useState(!1),[$,S]=c.useState(!1),[Q,H]=c.useState(!1),[q,U]=c.useState([]),[z,K]=c.useState(""),[T]=c.useState("asc"),[J,Y]=c.useState(!1),[P,F]=c.useState(null),[O,G]=c.useState(null),[A,C]=c.useState(null),[k,v]=c.useState(null),j=c.useRef(null);c.useEffect(()=>{var l;if(!((l=a==null?void 0:a.WIDGETS)!=null&&l.length)){U([]);return}if(s==="Edit"){const y=new Map(a.LAYOUT.map(D=>[D.i,D])),E=a.WIDGETS.map(D=>{const B=be.find(te=>te.templateId===D.templateId);if(!B)return null;const I=y.get(D.id);return{...B,...D,span:I?Ve(I.span||I.w||12):12}}).filter(Boolean);U(E)}},[a,s]),c.useEffect(()=>{if(!k)return;const l=E=>{const D=(k.gridWidth+16)/12,B=E.clientX-k.startX,I=k.startSpan+B/D,te=[4,6,8,12],_=te.reduce((Z,W)=>Math.abs(W-I)<Math.abs(Z-I)?W:Z,te[0]);_!==k.currentSpan&&(v(Z=>Z&&{...Z,currentSpan:_}),U(Z=>Z.map(W=>W.id===k.id?{...W,span:_}:W)))},y=()=>v(null);return window.addEventListener("mousemove",l),window.addEventListener("mouseup",y),document.body.style.cursor="ew-resize",document.body.style.userSelect="none",()=>{window.removeEventListener("mousemove",l),window.removeEventListener("mouseup",y),document.body.style.cursor="",document.body.style.userSelect=""}},[k]);const w=(l,y)=>{l.stopPropagation(),l.preventDefault();const E=j.current?j.current.getBoundingClientRect().width:1100;v({id:y.id,startSpan:y.span||12,startX:l.clientX,gridWidth:E,currentSpan:y.span||12})},u=(l,y)=>{if(k){l.preventDefault();return}l.dataTransfer.effectAllowed="move",l.dataTransfer.setData("text/xf-reorder",y.id),G(y.id)},i=(l,y)=>{if(!O||O===y.id)return;l.preventDefault();const E=l.currentTarget.getBoundingClientRect(),D=l.clientX-E.left<E.width/2?"before":"after";C({id:y.id,side:D})},p=(l,y)=>{l.preventDefault(),l.stopPropagation(),l.dataTransfer.getData("text/xf-reorder")&&O&&O!==y.id&&U(D=>{const B=D.findIndex(W=>W.id===O),I=D.findIndex(W=>W.id===y.id);if(B===-1||I===-1)return D;const te=(A==null?void 0:A.side)==="after"?I+(B<I?0:1):I+(B<I?-1:0),_=[...D],[Z]=_.splice(B,1);return _.splice(Math.max(0,Math.min(te,_.length)),0,Z),_}),G(null),C(null)},m=()=>{G(null),C(null)},g=l=>{const y=xt();U(E=>[...E,{...l,id:y,widgetId:l.widgetId,templateId:l.templateId,span:12}])},h=l=>{U(y=>y.filter(E=>E.id!==l.id))},d=l=>{if(l.dataTransfer.types.includes("application/reactgrid")){l.preventDefault();try{const y=JSON.parse(l.dataTransfer.getData("application/reactgrid")),E=be.find(D=>D.templateId===(y==null?void 0:y.id)||D.id===(y==null?void 0:y.id));E&&g(E)}catch{}}},M=c.useMemo(()=>[...be].filter(l=>l.name.toLowerCase().includes(z.toLowerCase())).sort((l,y)=>T==="asc"?l.name.localeCompare(y.name):y.name.localeCompare(l.name)),[z,T]),R=(l=[])=>{const y=Array.isArray(l)?l:[],E=[...q].sort((D,B)=>{const I=y.findIndex(_=>_.i===D.templateId),te=y.findIndex(_=>_.i===B.templateId);return(I===-1?999:I)-(te===-1?999:te)});U(E.map(D=>{const B=y.find(I=>I.i===D.templateId);return{...D,span:B?Ve(B.w):D.span||12}})),S(!1)},L=l=>{l.success?(me.push(n.jsx(fe,{title:"Success",type:"success",duration:2500,children:(l==null?void 0:l.message)||"Success"}),{placement:"top-center"}),e(),Y(!1),t(oe({isDrawerOpen:!1,type:"Add"}))):me.push(n.jsx(fe,{title:"Error",type:"danger",duration:2500,children:l.message}),{placement:"top-center"})},V=async l=>{H(!0);try{const y={...l,layoutData:JSON.stringify({WIDGETS:q,LAYOUT:q.map((D,B)=>({i:D.id,templateId:D.templateId,span:D.span||12,x:0,y:B,w:D.span||12,h:12}))})};let E;s==="Add"?E=await bt(y):s==="Edit"&&(E=await vt(o==null?void 0:o.id,y)),L(E)}catch(y){L(y)}finally{H(!1)}},he=c.useMemo(()=>P&&q.find(l=>l.id===P)||null,[q,P]),dt=c.useMemo(()=>he&&be.find(l=>l.templateId===he.templateId)||null,[he]);return n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"px-6 border-gray-200 flex items-center justify-between",children:[n.jsx(re,{variant:"solid",color:"neutral-700",className:"w-[100px] flex items-center justify-center",icon:n.jsx(pt,{size:35,className:"shrink-0"}),onClick:()=>Y(!0)}),n.jsxs("div",{className:"flex gap-2",children:[n.jsx(re,{variant:"solid",color:"neutral-700",className:"w-[100px] flex items-center justify-center",onClick:()=>N(!f),children:f?n.jsx(gt,{size:35,className:"shrink-0"}):n.jsx(ht,{size:35,className:"shrink-0"})}),n.jsx(re,{variant:"solid",color:"neutral-700",className:"w-[100px] flex items-center justify-center",onClick:()=>S(!0),children:n.jsx(At,{size:35,className:"shrink-0"})})]})]}),n.jsxs(Dt,{className:"m-6 h-full py-4 px-6 bg-transparent",bodyClass:"h-full",children:[r&&n.jsx(He,{sx:{backgroundColor:"rgba(0, 0, 0, 0.1)","& .MuiLinearProgress-bar":{backgroundColor:"var(--custom-600)"}}}),n.jsxs("div",{className:"flex w-full h-[calc(100vh-120px)] gap-4",children:[n.jsx("div",{className:`transition-all duration-300 ${f?"w-4/5":"w-full"} h-full overflow-hidden`,children:n.jsx("div",{className:"h-full overflow-y-auto",children:q.length===0?n.jsx("div",{className:"flex items-center justify-center h-full",children:n.jsx(Xt,{title:"No Widgets Added",description:"Add widgets to customize your layout."})}):n.jsx("div",{className:"xf-slot-grid",ref:j,onDragOver:l=>{l.dataTransfer.types.includes("application/reactgrid")&&l.preventDefault()},onDrop:d,children:q.map(l=>{const y=l.span||12,E=(k==null?void 0:k.id)===l.id,D=wr[l.name]||Je,B=l.component;return n.jsxs("div",{className:["xf-slot",O===l.id?"dragging":"",(A==null?void 0:A.id)===l.id?`drop-${A.side}`:"",E?"resizing":""].filter(Boolean).join(" "),style:{gridColumn:`span ${y}`},draggable:!0,onDragStart:I=>u(I,l),onDragOver:I=>i(I,l),onDrop:I=>p(I,l),onDragEnd:m,children:[n.jsxs("div",{className:"xf-slot-head",children:[n.jsxs("span",{className:"type-tag",children:[se.createElement(D,{size:10}),l.name]}),n.jsxs("div",{className:"actions",children:[n.jsx("button",{className:"cfg",onClick:()=>{F(l.id),b(!0)},children:n.jsx(Ze,{size:14})}),n.jsx("button",{className:"grip",children:n.jsx(We,{size:14})}),n.jsx("button",{className:"danger",onClick:()=>h(l),children:n.jsx(et,{size:14})})]})]}),n.jsx("div",{className:"xf-slot-body",children:B&&n.jsx(B,{widgetData:l})}),n.jsx("div",{className:"xf-resize-handle",onMouseDown:I=>w(I,l),children:n.jsx("span",{className:"grip"})}),E&&n.jsxs("div",{className:"xf-resize-tooltip",children:[Sr[y]," · ",y,"/12"]})]},l.id)})})})}),f&&n.jsxs("div",{className:"w-1/5 bg-white p-3 h-full flex flex-col",children:[n.jsx("h2",{className:"text-xl font-bold mb-2",children:"Widgets"}),n.jsx(de,{type:"search",placeholder:"Search Widgets...",value:z,onChange:l=>K(l.target.value)}),n.jsx("div",{className:"space-y-2 max-h-[90vh] overflow-y-auto mt-4",children:M.map(l=>{const y=l.icon;return n.jsxs("div",{draggable:!0,className:"flex items-start gap-3 text-gray-800 bg-gray-100 hover:bg-gray-200 p-3 rounded cursor-pointer",onDragStart:E=>E.dataTransfer.setData("application/reactgrid",JSON.stringify({id:l.templateId,type:"widget"})),onClick:()=>g(l),children:[n.jsx("div",{className:"widget-template-icon",children:n.jsx(y,{})}),n.jsxs("div",{children:[n.jsx("div",{className:"font-medium font-bold",children:l.name}),n.jsx("small",{className:"text-sm text-gray-500",children:l.desc})]})]},l.templateId)})})]})]}),n.jsx(De,{title:"Choose Layout",isOpen:$,portalClassName:"w90",onClose:()=>S(!1),children:n.jsx(rn,{onApplyLayout:R})}),n.jsx(De,{title:"Widget Setting",isOpen:x,portalClassName:"w90",onClose:()=>b(!1),children:n.jsx(vr,{activeWidgetInstance:he,activeWidgetTemplate:dt,setWidgets:U,setWidgetSettingOpen:b})}),n.jsxs(Xe,{isOpen:J,onClose:()=>Y(!1),children:[n.jsx("h4",{children:"Publish Layout"}),n.jsx("div",{className:"mt-4",children:n.jsx(sn,{handleFormSubmit:V,isPublishFormLoading:Q,initialValues:{layoutName:s==="Edit"&&(o==null?void 0:o.layoutName)||"",description:s==="Edit"&&(o==null?void 0:o.description)||""}})})]})]})]})},Nr=({id:e,isOpen:t,fetchData:r,onDialogClose:a})=>{const s=async()=>{try{const o=await jt(e);o!=null&&o.success&&(a(),r(),me.push(n.jsx(fe,{title:"Archive",type:"success",duration:2500,children:(o==null?void 0:o.message)||"Successfully Archived"}),{placement:"top-center"}))}catch(o){console.error("Archive failed",o)}};return n.jsx(tn,{isOpen:t,type:"danger",title:"Archive Layout",confirmButtonColor:"red-600",onClose:a,onRequestClose:a,onCancel:a,onConfirm:s,children:n.jsx("p",{children:"Are you sure you want to archive this item? All records related to this item will be marked archive as well."})})},Mr=ne().shape({menuId:ne().required("Menu is required")}),Or=({handleFormSubmit:e,initialValues:t,loading:r})=>{const[a,s]=c.useState([]),[o,f]=c.useState(!1),N=async()=>{try{f(!0);const b=(await yt()).data.$values.map($=>({label:$.name,value:$.id}));s(b)}catch(x){console.error("Error fetching menus:",x)}finally{f(!1)}};return c.useEffect(()=>{N()},[]),n.jsx(Pe,{initialValues:t,validationSchema:Mr,onSubmit:(x,{setSubmitting:b})=>{e(x),b(!1)},children:({touched:x,errors:b,values:$})=>n.jsx(Ie,{children:n.jsxs(Ee,{children:[n.jsx(ee,{asterisk:!0,label:"Menu Name",invalid:!!(b.menuId&&x.menuId),errorMessage:b.menuId,children:n.jsx(ae,{name:"menuId",children:({field:S,form:Q})=>n.jsx(ve,{field:S,form:Q,options:a,isLoading:o,placeholder:"Select Menu",onChange:H=>{Q.setFieldValue(S.name,H)}})})}),n.jsx(re,{block:!0,variant:"solid",color:"neutral-700",type:"submit",loading:r,disabled:o,children:"Submit"})]})})})};Ye("layouts",_e);const Dr={edit:!0,archive:!0,assign:!0},Ar=()=>{var v,j,w,u;const e=mt(),t=Ge(),{loading:r,layoutList:a,type:s,isDrawerOpen:o,selectedLayout:f,isDeleteConfirmation:N}=wt(i=>i.layouts.data);c.useState({pageSize:"",pageIndex:""});const[x,b]=c.useState(!1),[$,S]=c.useState([{id:"s-1",label:"Layouts",type:"Data Grid",icon:tt,span:12}]),[Q,H]=c.useState(null),[q,U]=c.useState(null),[z,K]=c.useState(null),T=c.useRef(null);c.useEffect(()=>{if(!z)return;const i=m=>{const g=(z.gridWidth+16)/12,h=m.clientX-z.startX,d=z.startSpan+h/g,M=[4,6,8,12],R=M.reduce((L,V)=>Math.abs(V-d)<Math.abs(L-d)?V:L,M[0]);R!==z.currentSpan&&(K(L=>L&&{...L,currentSpan:R}),S(L=>L.map(V=>V.id===z.id?{...V,span:R}:V)))},p=()=>K(null);return window.addEventListener("mousemove",i),window.addEventListener("mouseup",p),document.body.style.cursor="ew-resize",document.body.style.userSelect="none",()=>{window.removeEventListener("mousemove",i),window.removeEventListener("mouseup",p),document.body.style.cursor="",document.body.style.userSelect=""}},[z]);const J=(i,p)=>{i.stopPropagation(),i.preventDefault();const m=T.current?T.current.getBoundingClientRect().width:1100;K({id:p.id,startSpan:p.span,startX:i.clientX,gridWidth:m,currentSpan:p.span})},Y=(i,p)=>{if(z){i.preventDefault();return}i.dataTransfer.effectAllowed="move",i.dataTransfer.setData("text/xf-reorder",p.id),H(p.id)},P=(i,p)=>{if(!Q||Q===p.id)return;i.preventDefault();const m=i.currentTarget.getBoundingClientRect(),g=i.clientX-m.left<m.width/2?"before":"after";U({id:p.id,side:g})},F=(i,p)=>{if(i.preventDefault(),i.stopPropagation(),!Q||Q===p.id){H(null),U(null);return}S(m=>{const g=m.findIndex(L=>L.id===Q),h=m.findIndex(L=>L.id===p.id);if(g===-1||h===-1)return m;const d=(q==null?void 0:q.side)==="after"?h+(g<h?0:1):h+(g<h?-1:0),M=[...m],[R]=M.splice(g,1);return M.splice(Math.max(0,Math.min(d,M.length)),0,R),M}),H(null),U(null)},O=()=>{H(null),U(null)},G=(i,p)=>{p===Se.edit&&(t(Nt(i==null?void 0:i.id)),t(oe({isDrawerOpen:!0,type:"Edit"}))),p===Se.delete&&(t(Re(!0)),t(Te(i))),p===Se.assign&&(t(Te(i)),t(oe({isDrawerOpen:!0,type:"Assign"})))},A=[{dataField:"Action",caption:"Action",width:"130",cellRender:i=>n.jsx("div",{id:"mAction","data-cname":"Action",children:n.jsx(Ot,{row:i==null?void 0:i.data,actions:Dr,buttonClick:G})})},{dataField:"layoutName",caption:"Layout",width:"230"},{dataField:"description",caption:"Description",width:"230"},{dataField:"status",caption:"Status",width:"230"},{dataField:"createdDate",caption:"Created On",width:"230",dataType:"date",format:"dd-MM-yyyy",cellRender:i=>{const p=Oe(i.value).format("MM/DD/YYYY");return n.jsx("div",{"data-cname":"Created On",children:p})}},{dataField:"modifiedDate",caption:"Modified On",width:"230",dataType:"date",format:"dd-MM-yyyy",cellRender:i=>{const p=Oe(i.value).format("MM/DD/YYYY");return n.jsx("div",{"data-cname":"Modified On",children:p})}},{dataField:"menuAssignments",caption:"Assigned Menu",width:"230",cellRender:i=>{var m,g,h;const p=(h=(g=(m=i==null?void 0:i.data)==null?void 0:m.menuAssignments)==null?void 0:g.$values)==null?void 0:h[0];return p?n.jsx("div",{"data-cname":"Assigned Menu",className:"text-blue-600 hover:underline cursor-pointer",onClick:()=>e(p.routeLink),children:p.menuName}):n.jsx("div",{"data-cname":"Assigned Menu",children:"N/A"})}}],C=()=>{t(St())};c.useEffect(()=>{C()},[]);const k=async i=>{var p;try{b(!0);const m={menuId:(p=i.menuId)==null?void 0:p.value};(await Ct(f==null?void 0:f.id,m)).success&&(me.push(n.jsx(fe,{title:"Success",type:"success",children:"Menu assigned successfully."})),C(),t(oe({isDrawerOpen:!1,type:"Assign"})))}catch{me.push(n.jsx(fe,{title:"Error",type:"danger",children:"Failed to assign menu."}))}finally{b(!1)}};return n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"topbar py-4 px-6 border-gray-200 border-b",children:n.jsxs("div",{className:"lg:flex items-center justify-between",children:[n.jsx("h3",{className:"mb-4 lg:mb-0",children:" Dashboard & Pages "}),n.jsxs("div",{className:"flex flex-col lg:flex-row lg:items-center",children:[n.jsx(re,{block:!0,variant:"solid",size:"sm",icon:n.jsx(en,{}),onClick:()=>t(oe({isDrawerOpen:!0,type:"Add"})),children:"Add New"}),n.jsx(De,{title:`${s} Layout`,isOpen:o&&(s==="Add"||s==="Edit"),portalClassName:"w100",onClose:()=>t(oe({isDrawerOpen:!1,type:"Add"})),children:n.jsx(Cr,{fetchData:C})})]})]})}),n.jsxs("div",{className:"m-6",children:[r&&n.jsx(He,{sx:{backgroundColor:"rgba(0, 0, 0, 0.1)","& .MuiLinearProgress-bar":{backgroundColor:"var(--custom-600)"}}}),n.jsx("div",{className:"xf-slot-grid",ref:T,children:$.map(i=>{const p=(z==null?void 0:z.id)===i.id,m={4:"1/3",6:"1/2",8:"2/3",12:"Full"};return n.jsxs("div",{className:["xf-slot",Q===i.id?"dragging":"",(q==null?void 0:q.id)===i.id?`drop-${q.side}`:"",p?"resizing":""].filter(Boolean).join(" "),style:{gridColumn:`span ${i.span}`},draggable:!0,onDragStart:g=>Y(g,i),onDragOver:g=>P(g,i),onDrop:g=>F(g,i),onDragEnd:O,children:[n.jsxs("div",{className:"xf-slot-head",children:[n.jsxs("span",{className:"type-tag",children:[se.createElement(i.icon,{size:10}),i.type]}),n.jsx("span",{className:"ttl",children:i.label}),n.jsxs("div",{className:"actions",children:[n.jsx("button",{className:"cfg",children:n.jsx(Ze,{size:14})}),n.jsx("button",{className:"grip",children:n.jsx(We,{size:14})}),n.jsx("button",{className:"danger",onClick:()=>S(g=>g.filter(h=>h.id!==i.id)),children:n.jsx(et,{size:14})})]})]}),n.jsx("div",{className:"xf-slot-body p-4",children:i.id==="s-1"&&n.jsx(Ke,{tableName:"Layouts",className:"pt-2",dataSource:a||[],height:"calc(100vh - 400px)",columns:A,keyExpr:"$id",stateStorageKey:"Layouts",isFilterReq:!1,isLoading:r})}),n.jsx("div",{className:"xf-resize-handle",onMouseDown:g=>J(g,i),children:n.jsx("span",{className:"grip"})}),p&&n.jsxs("div",{className:"xf-resize-tooltip",children:[m[i.span]," · ",i.span,"/12"]})]},i.id)})})]}),n.jsx(Nr,{id:f==null?void 0:f.id,isOpen:N,fetchData:C,onDialogClose:()=>t(Re(!1))}),n.jsxs(Xe,{isOpen:o&&s==="Assign",onClose:()=>t(oe({isDrawerOpen:!1,type:"Assign"})),children:[n.jsx("h4",{children:" Assign Menu "}),n.jsx("div",{className:"mt-4",children:n.jsx(Or,{handleFormSubmit:k,initialValues:{menuId:{label:(j=(v=f==null?void 0:f.menuAssignments)==null?void 0:v.$values[0])==null?void 0:j.menuName,value:(u=(w=f==null?void 0:f.menuAssignments)==null?void 0:w.$values[0])==null?void 0:u.menuId}},loading:x})})]})]})},pa=Ar;export{pa as default};
@@ -1 +0,0 @@
1
- import{R as t}from"./RoleEdit-98a6410b.js";import"./vendor-mui-69397583.js";import"./vendor-react-ece1c85f.js";import"./index-c62ac197.js";import"./vendor-redux-a1f00e6b.js";import"./vendor-pdf-b2a5d8b1.js";import"./vendor-devex-33a39e11.js";import"./vendor-i18n-2fcb1983.js";import"./vendor-msal-9caa1ed1.js";import"./vendor-charts-eccea5d1.js";import"./DoubleSidedImage-ae98733b.js";import"./RoleService-7008da2c.js";import"./RoleForm-cc251eba.js";import"./FormContainer-91c2b0e4.js";import"./index-36ba4ea7.js";import"./useControllableState-d0909575.js";import"./useDidUpdate-25c4d4ed.js";import"./StickyFooter-5b934274.js";import"./ConfirmDialog-3202eb3d.js";import"./index.esm-70ab539c.js";import"./AdaptableCard-df7695d6.js";import"./index-e4c6057f.js";import"./validationPatterns-77446c46.js";export{t as default};
@@ -1,7 +0,0 @@
1
- import{j as e,l as se}from"./vendor-mui-69397583.js";import{r as g}from"./vendor-react-ece1c85f.js";import{u as te,a as re,D as ae,o as oe,g as ne,f as ie,P as de}from"./core.esm-4386752a.js";import{ed as D,D as le,W as ce,B as W,V as me,O as L,Q as P}from"./index-c62ac197.js";import{A as pe}from"./AdaptableCard-df7695d6.js";import{c as q,F as ue,b as ge,d as fe}from"./index.esm-70ab539c.js";import{g as he}from"./DynamicTablesService-963fe77b.js";import"./Alert-7dfbd254.js";import"./index-6b6d0f06.js";import"./index-c2088808.js";import"./Drawer-949c18c6.js";import"./FormContainer-91c2b0e4.js";import"./Switcher-c8648037.js";import"./index-36228db5.js";import"./Upload-fb34ce03.js";import"./vendor-redux-a1f00e6b.js";import"./vendor-pdf-b2a5d8b1.js";import"./vendor-devex-33a39e11.js";import"./vendor-i18n-2fcb1983.js";import"./vendor-msal-9caa1ed1.js";import"./vendor-charts-eccea5d1.js";import"./useControllableState-d0909575.js";import"./useDidUpdate-25c4d4ed.js";async function be(o,r,d){return(await D.apiV10AdvantageLaborJobsTableIdRowsRowIdEmployeesAddPost(o,r,d)).data}async function xe(o,r){return(await D.apiV10AdvantageLaborJobsTableIdRowsRowIdEmployeesGet(o,r)).data}async function ye(o,r,d){return(await D.apiV10AdvantageLaborJobsTableIdRowsSourceRowIdEmployeesMovePost(o,r,d)).data}async function we(o,r,d){return await D.apiV10AdvantageLaborJobsTableIdRowsRowIdEmployeesRemovePost(o,r,d)}const ke="d6779f18-c895-4558-8880-6c578282d922",Ne="737a994e-e551-4a0e-af77-3283af752764",ve="7bbd2947-febc-4a87-b148-9f0666da1388",Ee=()=>{const[o,r]=g.useState([]),[d,c]=g.useState([]),[y,m]=g.useState([]),[s,p]=g.useState([]),[x,E]=g.useState(!1),w=async N=>{var h,S;const b=await he(N,{});return((S=(h=b==null?void 0:b.data)==null?void 0:h.data)==null?void 0:S.$values)||[]},k=async(N,b)=>{var S;const h=await xe(N,b);p(((S=h==null?void 0:h.data)==null?void 0:S.$values)||[])},f=g.useCallback(async()=>{E(!0);try{const[N,b,h]=await Promise.all([w(ke),w(Ne),w(ve)]);r(N),c(b),m(h)}catch(N){console.error("Error fetching dynamic tables",N)}finally{E(!1)}},[]);return g.useEffect(()=>{f()},[f]),{jobs:o,clients:d,employees:y,loading:x,refetch:f,fetchEmployees:k,alreadyAssignedEmployees:s}},Se=Ee,A="d6779f18-c895-4558-8880-6c578282d922",R=o=>o.toLowerCase(),Ie=(o,r,d)=>{const c=new Map(r.map(s=>[s.Id.toLowerCase(),s.ClientName])),y=new Map(d.map(s=>[s.Id,{name:`${s.FirstName} ${s.LastName}`,position:s.Position||""}])),m={};return o.forEach(s=>{if(!s.Client)return;const p=s.Client.toLowerCase(),x=c.get(p);if(!x)return;m[p]||(m[p]={id:R(p),name:x,jobs:[]});const E=s.EmployeesOnJob?JSON.parse(s.EmployeesOnJob).map(k=>{const f=y.get(k);return{empId:`job-${s.Id}-emp-${k}`,id:R(k),name:(f==null?void 0:f.name)??"Unknown Worker",position:f==null?void 0:f.position}}):[],w=`${(s==null?void 0:s.JobTitle)??"Job"} – ${s==null?void 0:s.Location}${s!=null&&s.JobOrderDate?` - ${s==null?void 0:s.JobOrderDate}`:""}`;m[p].jobs.push({id:R(s.Id),name:w,workers:E})}),Object.values(m)},Ce=({worker:o,clientId:r,jobId:d,onRemove:c})=>{const{attributes:y,listeners:m,setNodeRef:s,isDragging:p}=ne({id:o.empId,data:{workerId:o.id,clientId:r,jobId:d,droppableId:`${r}|${d}`}});return e.jsxs("div",{ref:s,...y,...m,style:{opacity:p?.4:1},className:"flex items-center justify-between bg-white border rounded px-2 py-1 mb-1 text-sm cursor-grab",children:[e.jsxs("span",{className:"truncate",children:[o.name," – ",o.position]}),e.jsx("button",{className:"text-gray-400 hover:text-red-500 text-xs ml-2",onPointerDown:x=>x.stopPropagation(),onClick:x=>{x.stopPropagation(),c(r,d,o.id)},children:"✕"})]})},je=({client:o,job:r,onRemoveWorker:d,onOpenAddWorker:c,fetchEmployeesForJob:y,children:m})=>{const{setNodeRef:s,isOver:p}=ie({id:`${o.id}|${r.id}`});return e.jsxs("div",{ref:s,className:`border rounded p-2 ${p?"bg-blue-50":"bg-gray-50"}`,children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsx("span",{className:"text-sm font-semibold",children:r.name}),e.jsx(W,{variant:"solid",size:"xs",className:"ml-2 min-w-[32px] shrink-0",icon:e.jsx(me,{}),onClick:()=>{y(A,r.id),c(o,r)}})]}),m]})};function Xe({permissionName:o}){const{jobs:r,clients:d,employees:c,loading:y,refetch:m,fetchEmployees:s,alreadyAssignedEmployees:p}=Se(),x=te(re(de)),[E,w]=g.useState([]),[k,f]=g.useState(null),[N,b]=g.useState(!1),[h,S]=g.useState(null),[I,z]=g.useState(null);g.useEffect(()=>{!r.length||!d.length||!c.length||w(Ie(r,d,c))},[r,d,c]);const Q=a=>{const t=a.active.data.current;if(t){const i=E.find(n=>n.id===t.clientId),l=i==null?void 0:i.jobs.find(n=>n.id===t.jobId);f((l==null?void 0:l.workers.find(n=>n.empId===String(a.active.id)))||null)}},U=a=>{var V;f(null);const{active:t,over:i}=a;if(!i)return;const l=((V=t.data.current)==null?void 0:V.droppableId)||"",n=String(i.id);if(l===n)return;const[v,$]=l.split("|"),[Z,ee]=n.split("|"),J=structuredClone(E),F=J.find(u=>u.id===v),T=J.find(u=>u.id===Z);if(!F||!T)return;const j=F.jobs.find(u=>u.id===$),C=T.jobs.find(u=>u.id===ee);if(!j||!C)return;const B=j.workers.findIndex(u=>u.empId===String(t.id));if(B===-1)return;const[M]=j.workers.splice(B,1);C.workers.push(M),ye(A,j.id,{targetRowId:C==null?void 0:C.id,employeeId:M.id}).then(()=>{m()}).catch(u=>{var _,G;console.error("Error moving worker:",u),L.push(e.jsx(P,{title:"Error",type:"danger",duration:2500,children:((G=(_=u==null?void 0:u.response)==null?void 0:_.data)==null?void 0:G.message)||"Failed to move worker."}),{placement:"top-center"})}),w(J)},O=(a,t,i)=>{we(A,t,{employeeId:i}).then(()=>{m()}).catch(l=>{var n,v;console.error("Error removing worker:",l),L.push(e.jsx(P,{title:"Error",type:"danger",duration:2500,children:((v=(n=l==null?void 0:l.response)==null?void 0:n.data)==null?void 0:v.message)||"Failed to remove worker."}),{placement:"top-center"})}),w(l=>l.map(n=>n.id===a?{...n,jobs:n.jobs.map(v=>v.id===t?{...v,workers:v.workers.filter($=>$.id!==i)}:v)}:n))},Y=(a,t)=>{S(a),z(t),b(!0)},H=a=>{var t;!h||!I||be(A,I.id,{employeeId:(t=a==null?void 0:a.workerName)==null?void 0:t.value}).then(()=>{m(),b(!1)}).catch(i=>{var l,n;console.error("Error adding worker:",i),L.push(e.jsx(P,{title:"Error",type:"danger",duration:2500,children:((n=(l=i==null?void 0:i.response)==null?void 0:l.data)==null?void 0:n.message)||"Failed to add worker."}),{placement:"top-center"})})},K=q().shape({workerName:q().required("Worker name is required")}),X=g.useMemo(()=>{const a=new Set(p);return c.filter(t=>!a.has(t.Id)).map(t=>({label:`${t.FirstName} ${t.LastName} - ${t.Position||"No Position"}`,value:t.Id}))},[c,p]);return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"topbar py-4 px-6 border-gray-200 border-b dark:bg-[#292f3c] dark:text-white",children:e.jsx("div",{className:"lg:flex items-center justify-between",children:e.jsx("h3",{className:"mb-4 lg:mb-0",children:"Job Board"})})}),e.jsxs(pe,{className:"h-full py-4 px-2 bg-transparent",children:[y&&e.jsx(se,{sx:{backgroundColor:"rgba(0, 0, 0, 0.1)","& .MuiLinearProgress-bar":{backgroundColor:"var(--custom-600)"}}}),e.jsxs(ae,{sensors:x,onDragStart:Q,onDragEnd:U,children:[e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3 bg-gray-100 p-2",children:E.map(a=>e.jsxs("div",{className:`\r
2
- w-full\r
3
- bg-white\r
4
- border\r
5
- rounded\r
6
- p-3\r
7
- `,children:[e.jsx("h4",{className:"mb-3 font-semibold text-sm",children:a.name}),e.jsx("div",{className:"space-y-4",children:a.jobs.map(t=>e.jsx(je,{client:a,job:t,onRemoveWorker:O,onOpenAddWorker:Y,fetchEmployeesForJob:s,children:t.workers.map(i=>e.jsx(Ce,{worker:i,clientId:a.id,jobId:t.id,onRemove:O},i.empId))},`${a.id}|${t.id}`))})]},a.id))}),e.jsx(oe,{children:k?e.jsx("div",{className:"flex items-center justify-between bg-white border rounded px-2 py-1 text-sm shadow-lg cursor-grabbing",children:e.jsxs("span",{className:"truncate",children:[k.name," – ",k.position]})}):null})]}),e.jsxs(le,{isOpen:N,onClose:()=>b(!1),children:[e.jsx("h4",{className:"mb-1",children:"Assign Worker"}),e.jsxs("p",{className:"text-sm text-gray-500 mb-4",children:[h==null?void 0:h.name," → ",I==null?void 0:I.name]}),e.jsx(ue,{initialValues:{workerName:""},validationSchema:K,onSubmit:H,children:({errors:a,touched:t})=>e.jsxs(ge,{children:[e.jsxs("div",{className:"mb-4",children:[e.jsx("label",{className:"block text-sm mb-1",children:"Worker Name"}),e.jsx(fe,{name:"workerName",className:"w-full border rounded px-3 py-2",children:({field:i,form:l})=>e.jsx(ce,{field:i,form:l,options:X||[],placeholder:"Select a worker",name:"workerName",onChange:n=>{console.log("Selected option:",n),l.setFieldValue(i.name,n)}})}),a.workerName&&t.workerName&&e.jsx("div",{className:"text-red-500 text-xs mt-1",children:a.workerName})]}),e.jsxs("div",{className:"flex justify-end gap-2",children:[e.jsx(W,{type:"button",variant:"plain",onClick:()=>b(!1),children:"Cancel"}),e.jsx(W,{type:"submit",variant:"solid",children:"Add Worker"})]})]})})]})]})]})}export{Xe as default};
@@ -1 +0,0 @@
1
- import{j as e}from"./vendor-mui-69397583.js";import{u as ie,f as ne,r as g,c as se}from"./vendor-react-ece1c85f.js";const r={ink:"#1B1B1B",orange:"#F15A22",muted:"#646464",line:"#E9E9E9",soft:"#F6F4F1",cream:"#FBF2EA",green:"#16A34A"},u=({name:s,size:d=16,stroke:h=1.7})=>{const l={width:d,height:d,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:h,strokeLinecap:"round",strokeLinejoin:"round"},y={plus:e.jsx("path",{d:"M12 5v14M5 12h14"}),x:e.jsx("path",{d:"M18 6L6 18M6 6l12 12"}),chevronDown:e.jsx("path",{d:"M6 9l6 6 6-6"}),chevronRight:e.jsx("path",{d:"M9 6l6 6-6 6"}),chevronLeft:e.jsx("path",{d:"M15 6l-6 6 6 6"}),search:e.jsxs(e.Fragment,{children:[e.jsx("circle",{cx:"11",cy:"11",r:"7"}),e.jsx("path",{d:"M21 21l-4.3-4.3"})]}),bell:e.jsxs(e.Fragment,{children:[e.jsx("path",{d:"M18 8a6 6 0 10-12 0c0 7-3 9-3 9h18s-3-2-3-9"}),e.jsx("path",{d:"M14 21a2 2 0 01-4 0"})]}),help:e.jsxs(e.Fragment,{children:[e.jsx("circle",{cx:"12",cy:"12",r:"9"}),e.jsx("path",{d:"M9.1 9a3 3 0 015.8 1c0 2-3 3-3 3M12 17h.01"})]}),user:e.jsxs(e.Fragment,{children:[e.jsx("path",{d:"M20 21v-2a4 4 0 00-4-4H8a4 4 0 00-4 4v2"}),e.jsx("circle",{cx:"12",cy:"7",r:"4"})]}),settings:e.jsxs(e.Fragment,{children:[e.jsx("circle",{cx:"12",cy:"12",r:"3"}),e.jsx("path",{d:"M19.4 15a1.65 1.65 0 00.33 1.82l.06.06a2 2 0 010 2.83 2 2 0 01-2.83 0l-.06-.06a1.65 1.65 0 00-1.82-.33 1.65 1.65 0 00-1 1.51V21a2 2 0 01-4 0v-.09A1.65 1.65 0 009 19.4a1.65 1.65 0 00-1.82.33l-.06.06a2 2 0 01-2.83-2.83l.06-.06A1.65 1.65 0 004.68 15a1.65 1.65 0 00-1.51-1H3a2 2 0 010-4h.09A1.65 1.65 0 004.6 9a1.65 1.65 0 00-.33-1.82l-.06-.06a2 2 0 012.83-2.83l.06.06A1.65 1.65 0 009 4.68a1.65 1.65 0 001-1.51V3a2 2 0 014 0v.09a1.65 1.65 0 001 1.51 1.65 1.65 0 001.82-.33l.06-.06a2 2 0 012.83 2.83l-.06.06A1.65 1.65 0 0019.4 9a1.65 1.65 0 001.51 1H21a2 2 0 010 4h-.09a1.65 1.65 0 00-1.51 1z"})]}),logout:e.jsx(e.Fragment,{children:e.jsx("path",{d:"M9 21H5a2 2 0 01-2-2V5a2 2 0 012-2h4M16 17l5-5-5-5M21 12H9"})}),home:e.jsxs(e.Fragment,{children:[e.jsx("path",{d:"M3 12L12 3l9 9"}),e.jsx("path",{d:"M5 10v10h14V10"})]}),layout:e.jsxs(e.Fragment,{children:[e.jsx("rect",{x:"3",y:"3",width:"7",height:"9",rx:"1.5"}),e.jsx("rect",{x:"14",y:"3",width:"7",height:"5",rx:"1.5"}),e.jsx("rect",{x:"14",y:"12",width:"7",height:"9",rx:"1.5"}),e.jsx("rect",{x:"3",y:"16",width:"7",height:"5",rx:"1.5"})]}),layers:e.jsxs(e.Fragment,{children:[e.jsx("path",{d:"M12 2 2 7l10 5 10-5-10-5z"}),e.jsx("path",{d:"M2 17l10 5 10-5"}),e.jsx("path",{d:"M2 12l10 5 10-5"})]}),folder:e.jsx("path",{d:"M3 7a2 2 0 012-2h4l2 2h8a2 2 0 012 2v9a2 2 0 01-2 2H5a2 2 0 01-2-2z"}),file:e.jsxs(e.Fragment,{children:[e.jsx("path",{d:"M14 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V8z"}),e.jsx("path",{d:"M14 2v6h6"})]}),fileText:e.jsxs(e.Fragment,{children:[e.jsx("path",{d:"M14 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V8z"}),e.jsx("path",{d:"M14 2v6h6M16 13H8M16 17H8M10 9H8"})]}),table:e.jsxs(e.Fragment,{children:[e.jsx("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"}),e.jsx("path",{d:"M3 9h18M3 15h18M9 3v18M15 3v18"})]}),barChart:e.jsxs(e.Fragment,{children:[e.jsx("path",{d:"M3 3v18h18"}),e.jsx("rect",{x:"7",y:"12",width:"3",height:"6"}),e.jsx("rect",{x:"12",y:"8",width:"3",height:"10"}),e.jsx("rect",{x:"17",y:"5",width:"3",height:"13"})]}),kpi:e.jsxs(e.Fragment,{children:[e.jsx("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"}),e.jsx("path",{d:"M7 14l3-3 3 3 4-5"})]}),map:e.jsxs(e.Fragment,{children:[e.jsx("path",{d:"M9 4l-6 2v14l6-2 6 2 6-2V4l-6 2z"}),e.jsx("path",{d:"M9 4v14M15 6v14"})]}),calendar:e.jsxs(e.Fragment,{children:[e.jsx("rect",{x:"3",y:"4",width:"18",height:"18",rx:"2"}),e.jsx("path",{d:"M16 2v4M8 2v4M3 10h18"})]}),chat:e.jsx("path",{d:"M21 15a2 2 0 01-2 2H7l-4 4V5a2 2 0 012-2h14a2 2 0 012 2z"}),alert:e.jsxs(e.Fragment,{children:[e.jsx("path",{d:"M10.3 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z"}),e.jsx("path",{d:"M12 9v4M12 17h.01"})]}),grid:e.jsxs(e.Fragment,{children:[e.jsx("rect",{x:"3",y:"3",width:"7",height:"7",rx:"1"}),e.jsx("rect",{x:"14",y:"3",width:"7",height:"7",rx:"1"}),e.jsx("rect",{x:"3",y:"14",width:"7",height:"7",rx:"1"}),e.jsx("rect",{x:"14",y:"14",width:"7",height:"7",rx:"1"})]}),sparkles:e.jsxs(e.Fragment,{children:[e.jsx("path",{d:"M12 3l2 5 5 2-5 2-2 5-2-5-5-2 5-2z"}),e.jsx("path",{d:"M19 14l1 2 2 1-2 1-1 2-1-2-2-1 2-1z"})]}),eye:e.jsxs(e.Fragment,{children:[e.jsx("path",{d:"M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"}),e.jsx("circle",{cx:"12",cy:"12",r:"3"})]}),save:e.jsxs(e.Fragment,{children:[e.jsx("path",{d:"M19 21H5a2 2 0 01-2-2V5a2 2 0 012-2h11l5 5v11a2 2 0 01-2 2z"}),e.jsx("path",{d:"M17 21v-8H7v8M7 3v5h8"})]}),sliders:e.jsx(e.Fragment,{children:e.jsx("path",{d:"M4 21V14M4 10V3M12 21V12M12 8V3M20 21v-5M20 12V3M1 14h6M9 8h6M17 16h6"})}),drag:e.jsxs(e.Fragment,{children:[e.jsx("circle",{cx:"9",cy:"6",r:"1"}),e.jsx("circle",{cx:"9",cy:"12",r:"1"}),e.jsx("circle",{cx:"9",cy:"18",r:"1"}),e.jsx("circle",{cx:"15",cy:"6",r:"1"}),e.jsx("circle",{cx:"15",cy:"12",r:"1"}),e.jsx("circle",{cx:"15",cy:"18",r:"1"})]}),trash:e.jsx(e.Fragment,{children:e.jsx("path",{d:"M3 6h18M8 6V4a2 2 0 012-2h4a2 2 0 012 2v2M19 6l-1 14a2 2 0 01-2 2H8a2 2 0 01-2-2L5 6"})}),check:e.jsx("path",{d:"M20 6L9 17l-5-5"}),donut:e.jsxs(e.Fragment,{children:[e.jsx("circle",{cx:"12",cy:"12",r:"9"}),e.jsx("circle",{cx:"12",cy:"12",r:"4"})]}),refresh:e.jsxs(e.Fragment,{children:[e.jsx("path",{d:"M23 4v6h-6"}),e.jsx("path",{d:"M1 20v-6h6"}),e.jsx("path",{d:"M3.51 9a9 9 0 0114.85-3.36L23 10"}),e.jsx("path",{d:"M20.49 15A9 9 0 015.64 18.36L1 14"})]}),compass:e.jsxs(e.Fragment,{children:[e.jsx("circle",{cx:"12",cy:"12",r:"10"}),e.jsx("polygon",{points:"16.24 7.76 14.12 14.12 7.76 16.24 9.88 9.88 16.24 7.76"})]}),arrowRight:e.jsxs(e.Fragment,{children:[e.jsx("path",{d:"M5 12h14"}),e.jsx("path",{d:"M13 5l7 7-7 7"})]}),tabs:e.jsxs(e.Fragment,{children:[e.jsx("rect",{x:"3",y:"9",width:"18",height:"12",rx:"2"}),e.jsx("path",{d:"M3 9V7a2 2 0 012-2h3l2-2h4l2 2h3a2 2 0 012 2v2"})]}),inbox:e.jsxs(e.Fragment,{children:[e.jsx("polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12"}),e.jsx("path",{d:"M5.45 5.11L2 12v6a2 2 0 002 2h16a2 2 0 002-2v-6l-3.45-6.89A2 2 0 0016.76 4H7.24a2 2 0 00-1.79 1.11z"})]}),copy:e.jsxs(e.Fragment,{children:[e.jsx("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2"}),e.jsx("path",{d:"M5 15H4a2 2 0 01-2-2V4a2 2 0 012-2h9a2 2 0 012 2v1"})]})};return e.jsx("svg",{...l,children:y[s]??null})},X=[{id:"datatable",name:"Data Table",icon:"table",category:"Data",desc:"Sortable, filterable rows from any source"},{id:"kpi",name:"KPI Stats",icon:"kpi",category:"Data",desc:"Headline metric tiles with deltas"},{id:"graph",name:"Graph",icon:"barChart",category:"Visualize",desc:"Bar, line, area or pie charts"},{id:"tabs",name:"Tabs",icon:"tabs",category:"Layout",desc:"Group related views in a single tab strip"},{id:"map",name:"Map",icon:"map",category:"Visualize",desc:"Geo data with points, heat & polygons"},{id:"calendar",name:"Calendar",icon:"calendar",category:"Layout",desc:"Schedule, events and bookings view"},{id:"chat",name:"Chat",icon:"chat",category:"Engage",desc:"Threaded conversation or AI assistant"},{id:"report",name:"Report",icon:"fileText",category:"Data",desc:"Long-form analytical document"},{id:"files",name:"File Explorer",icon:"folder",category:"Engage",desc:"Browse documents and assets"}],Y=[{id:"graph",name:"Graph",icon:"barChart",category:"Visualize",desc:"Bar / line / area chart widget"},{id:"kpi",name:"KPI Stats",icon:"kpi",category:"Data",desc:"Single-number tile with sparkline"},{id:"datagrid",name:"Data Grid",icon:"grid",category:"Data",desc:"Compact tabular data block"},{id:"map",name:"Map",icon:"map",category:"Visualize",desc:"Live location & territory map"},{id:"alert",name:"Alert Message",icon:"alert",category:"Status",desc:"Inline status / warning callout"},{id:"donut",name:"Donut Chart",icon:"donut",category:"Visualize",desc:"Composition & share breakdown"},{id:"activity",name:"Activity Feed",icon:"inbox",category:"Status",desc:"Streaming timeline of events"},{id:"leaderboard",name:"Leaderboard",icon:"barChart",category:"Data",desc:"Ranked top-N list"}],Q=[{id:"operations",label:"Operations",children:[{id:"fleet",label:"Fleet"},{id:"transloads",label:"Transloads"},{id:"incidents",label:"Incidents"}]},{id:"compliance",label:"Compliance",children:[{id:"audits",label:"Audits"},{id:"permits",label:"Permits"}]},{id:"people",label:"People",children:[{id:"directory",label:"Directory"},{id:"training",label:"Training"}]},{id:"analytics",label:"Analytics",children:[{id:"exec",label:"Executive overview"},{id:"ops-kpis",label:"Ops KPIs"}]}],oe=[{id:"r1",type:"dashboard",title:"Executive Overview",nav:"Analytics / Executive overview",icon:"barChart",updated:"2h ago"},{id:"r2",type:"page",title:"Driver Performance",nav:"Operations / Fleet",icon:"table",updated:"Yesterday"},{id:"r3",type:"page",title:"Permit Tracker",nav:"Compliance / Permits",icon:"fileText",updated:"2 days ago"},{id:"r4",type:"dashboard",title:"Transload Health",nav:"Operations / Transloads",icon:"kpi",updated:"3 days ago"}],G=[{eyebrow:"Build, not boilerplate",headline:["Compose internal apps in minutes","— not sprints."],body:"Drag in a <b>Data Table</b>, <b>KPI tile</b>, <b>Map</b>, or <b>Chat</b> — connect a source and ship. Auth, RBAC, and audit included.",primary:"Build",secondary:"See an example dashboard"},{eyebrow:"Configurable canvas",headline:["From idea to live page in","one afternoon."],body:"Pick a <b>Page</b> or <b>Dashboard</b>. Arrange tables, KPIs, and charts on a true grid. Hit publish.",primary:"Build a Page",secondary:"Build a Dashboard"},{eyebrow:"Ship without waiting on engineering",headline:["Drop in. Connect a source.","Hit publish."],body:"<b>No code, no theme work, no deploy.</b> Auth, RBAC, and audit logs are wired in from day one.",primary:"Get started",secondary:"Browse templates"}],le=({kind:s,type:d,config:h})=>{const l=h||{},y=(t,o)=>{const i={ok:[r.green,"rgba(22,163,74,0.1)"],wrn:["#c47b18","rgba(232,163,58,0.16)"],err:["#DC2626","rgba(220,38,38,0.1)"]},[a,p]=i[o];return e.jsx("span",{style:{fontSize:14,fontWeight:700,padding:"2px 7px",borderRadius:999,background:p,color:a},children:t})};if(d==="datatable")return e.jsx("div",{children:e.jsxs("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:12},children:[e.jsx("thead",{children:e.jsx("tr",{style:{borderBottom:`2px solid ${r.line}`},children:(l.columns||["Driver","Route","Status","On-time"]).map(t=>e.jsx("th",{style:{textAlign:"left",padding:"6px 8px",fontSize:14,fontWeight:700,textTransform:"uppercase",letterSpacing:"0.06em",color:r.muted},children:t},t))})}),e.jsx("tbody",{children:[["M. Saldana","HOU-DAL-23","ok","98.4%"],["R. Patel","HOU-SAT-11","wrn","91.0%"],["L. Nguyen","HOU-AUS-07","ok","96.2%"],["D. Carter","HOU-CRP-09","err","83.7%"]].map(([t,o,i,a])=>e.jsxs("tr",{style:{borderBottom:`1px solid ${r.line}`},children:[e.jsx("td",{style:{padding:"8px",fontWeight:700,color:r.ink},children:t}),e.jsx("td",{style:{padding:"8px",color:r.muted},children:o}),e.jsx("td",{style:{padding:"8px"},children:y(i==="ok"?"On-time":i==="wrn"?"Delayed":"Late",i)}),e.jsx("td",{style:{padding:"8px",color:r.ink},children:a})]},t))})]})});if(d==="kpi"){const t=l.tiles||3,o=[{l:"Active drivers",v:"142",d:"▲ 4 today"},{l:"Avg on-time",v:"94.6%",d:"▲ 1.2 pts"},{l:"Idle min/day",v:"18m",d:"▼ 6 min"},{l:"Open tickets",v:"12",d:"▼ 3 vs week"}];return e.jsx("div",{style:{display:"grid",gridTemplateColumns:`repeat(${t},1fr)`,gap:10},children:Array.from({length:t}).map((i,a)=>{const p=o[a]||o[0];return e.jsxs("div",{style:{background:r.cream,borderRadius:10,padding:12},children:[e.jsx("div",{style:{fontSize:15,fontWeight:700,textTransform:"uppercase",letterSpacing:"0.06em",color:r.muted},children:p.l}),e.jsx("div",{style:{fontSize:22,fontWeight:900,color:r.ink,lineHeight:1,marginTop:4},children:p.v}),e.jsx("div",{style:{fontSize:14,fontWeight:700,color:r.green,marginTop:2},children:p.d})]},a)})})}if(d==="graph")return l.chart==="line"?e.jsxs("svg",{width:"100%",height:"160",viewBox:"0 0 600 160",preserveAspectRatio:"none",children:[e.jsx("polyline",{points:"20,130 80,100 140,110 200,70 260,80 320,50 380,60 440,30 500,45 560,20",fill:"none",stroke:r.orange,strokeWidth:"2.5"}),[20,80,140,200,260,320,380,440,500,560].map((t,o)=>e.jsx("circle",{cx:t,cy:[130,100,110,70,80,50,60,30,45,20][o],r:"3",fill:r.orange},o)),e.jsx("line",{x1:"20",y1:"155",x2:"580",y2:"155",stroke:r.line})]}):e.jsx("div",{style:{display:"flex",alignItems:"flex-end",gap:8,height:160,paddingTop:12},children:[35,48,42,60,72,65,80,90,78,96,84,100].map((t,o)=>e.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",alignItems:"center",gap:4},children:[e.jsx("div",{style:{width:"100%",height:`${t}%`,background:`linear-gradient(180deg,${r.orange},#C4400B)`,borderRadius:"4px 4px 0 0"}}),e.jsx("span",{style:{fontSize:15,color:r.muted},children:["J","F","M","A","M","J","J","A","S","O","N","D"][o]})]},o))});if(d==="tabs")return e.jsxs("div",{children:[e.jsx("div",{style:{display:"flex",borderBottom:`1px solid ${r.line}`,marginBottom:12},children:(l.tabs||["Overview","Activity","Settings"]).map((t,o)=>e.jsx("button",{style:{border:0,background:"transparent",padding:"10px 14px",fontFamily:"Lato, sans-serif",fontWeight:700,fontSize:15,color:o===0?r.orange:r.muted,borderBottom:o===0?`2px solid ${r.orange}`:"2px solid transparent",cursor:"pointer"},children:t},t))}),e.jsx("div",{style:{fontSize:15,color:r.muted},children:"Tab content goes here…"})]});if(d==="map")return e.jsxs("div",{style:{height:180,background:"linear-gradient(135deg,#E8EEF3 0%,#D4DEE8 100%)",borderRadius:8,position:"relative",overflow:"hidden"},children:[e.jsxs("svg",{width:"100%",height:"100%",viewBox:"0 0 600 200",preserveAspectRatio:"none",children:[e.jsx("path",{d:"M0,140 Q120,100 200,120 T400,90 T600,110 L600,200 L0,200 Z",fill:"rgba(46,122,194,0.12)"}),[[120,80],[260,60],[340,110],[420,70],[500,140],[180,130]].map(([t,o],i)=>e.jsxs("g",{children:[e.jsx("circle",{cx:t,cy:o,r:"14",fill:r.orange,opacity:"0.2"}),e.jsx("circle",{cx:t,cy:o,r:"6",fill:r.orange})]},i))]}),e.jsxs("div",{style:{position:"absolute",top:10,right:10,background:"#fff",padding:"5px 10px",borderRadius:999,fontSize:15,fontWeight:700,boxShadow:"0 1px 3px rgba(0,0,0,0.06)"},children:[l.layer||"Live points"," · 6"]})]});if(d==="calendar")return e.jsxs("div",{children:[e.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(7,1fr)",fontSize:14,color:r.muted,fontWeight:700,marginBottom:6,textTransform:"uppercase",letterSpacing:"0.04em"},children:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"].map(t=>e.jsx("div",{style:{padding:"4px 8px"},children:t},t))}),e.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(7,1fr)",gap:4},children:Array.from({length:35}).map((t,o)=>{const i=o-2,a=i===14,p=[3,7,12,14,18,22,26].includes(i);return e.jsx("div",{style:{aspectRatio:"1.4/1",border:`1px solid ${r.line}`,borderRadius:6,padding:6,background:a?r.cream:"#fff",position:"relative"},children:i>0&&i<=31&&e.jsxs(e.Fragment,{children:[e.jsx("span",{style:{fontSize:15,fontWeight:a?700:400,color:a?r.orange:r.ink},children:i}),p&&e.jsx("div",{style:{position:"absolute",bottom:6,left:6,right:6,height:3,background:r.orange,borderRadius:2,opacity:.8}})]})},o)})})]});if(d==="chat")return e.jsxs("div",{style:{border:`1px solid ${r.line}`,borderRadius:8,overflow:"hidden",background:"#fff"},children:[e.jsxs("div",{style:{padding:"8px 12px",borderBottom:`1px solid ${r.line}`,fontSize:14,fontWeight:700,color:r.ink,display:"flex",alignItems:"center",gap:8},children:[e.jsx("span",{style:{width:8,height:8,borderRadius:"50%",background:r.green}}),l.channel||"Operations · #drivers"]}),e.jsx("div",{style:{padding:12,display:"flex",flexDirection:"column",gap:10,fontSize:12},children:[{init:"RM",bg:"#D6E5F5",fg:"#2E7AC2",name:"Rafael M.",time:"9:42a",msg:"Truck 22 needs an unscheduled inspection at HOU yard."},{init:"BO",bg:"rgba(241,90,34,0.1)",fg:r.orange,name:"Brian O.",time:"9:43a",msg:"Got it — routing to bay 4. ETA 11min."}].map(t=>e.jsxs("div",{style:{display:"flex",gap:8},children:[e.jsx("div",{style:{width:24,height:24,borderRadius:"50%",background:t.bg,color:t.fg,display:"flex",alignItems:"center",justifyContent:"center",fontSize:14,fontWeight:700,flexShrink:0},children:t.init}),e.jsxs("div",{children:[e.jsxs("div",{style:{fontWeight:700,fontSize:15,color:r.ink},children:[t.name," ",e.jsx("span",{style:{color:r.muted,fontWeight:300,marginLeft:6},children:t.time})]}),e.jsx("div",{style:{color:r.ink},children:t.msg})]})]},t.init))}),e.jsx("div",{style:{padding:"8px 12px",borderTop:`1px solid ${r.line}`,fontSize:14,color:r.muted},children:"Type a message…"})]});if(d==="report")return e.jsxs("div",{children:[e.jsx("div",{style:{fontFamily:"Lato, sans-serif",fontWeight:700,fontSize:18,color:r.ink,marginBottom:6},children:"Q1 Operations review"}),e.jsx("div",{style:{fontSize:14,color:r.muted,marginBottom:12},children:"Generated weekly · last run 2h ago"}),e.jsxs("div",{style:{fontSize:15,color:r.ink,lineHeight:1.6,marginBottom:10},children:["Total transload throughput up ",e.jsx("b",{children:"14.2%"})," quarter-over-quarter, with the largest gains in the Houston Yard and HOU-DAL corridor…"]}),e.jsx("div",{style:{display:"flex",gap:8},children:["12 sections","Auto-export · PDF"].map(t=>e.jsx("div",{style:{padding:"4px 10px",background:r.soft,borderRadius:999,fontSize:15,color:r.muted,fontWeight:700},children:t},t))})]});if(d==="files")return e.jsx("div",{style:{border:`1px solid ${r.line}`,borderRadius:8,overflow:"hidden"},children:[["folder","Permits 2026","12 files","2d"],["folder","SOWs","48 files","5d"],["file","Driver-handbook-v9.pdf","2.4 MB","6d"],["file","Safety-stand-down-Q1.docx","380 KB","2w"]].map((t,o)=>e.jsxs("div",{style:{display:"grid",gridTemplateColumns:"24px 1fr 100px 60px",gap:10,alignItems:"center",padding:"10px 14px",borderBottom:o<3?`1px solid ${r.line}`:"none",fontSize:13},children:[e.jsx(u,{name:t[0],size:16,stroke:1.6}),e.jsx("span",{style:{fontWeight:700,color:r.ink},children:t[1]}),e.jsx("span",{style:{color:r.muted,fontSize:12},children:t[2]}),e.jsx("span",{style:{color:r.muted,fontSize:12},children:t[3]})]},o))});if(d==="datagrid")return e.jsxs("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:12},children:[e.jsx("thead",{children:e.jsx("tr",{style:{borderBottom:`2px solid ${r.line}`},children:["Site","Throughput","Dwell","State"].map(t=>e.jsx("th",{style:{textAlign:"left",padding:"6px 8px",fontSize:14,fontWeight:700,textTransform:"uppercase",letterSpacing:"0.06em",color:r.muted},children:t},t))})}),e.jsxs("tbody",{children:[e.jsxs("tr",{style:{borderBottom:`1px solid ${r.line}`},children:[e.jsx("td",{style:{padding:"8px",fontWeight:700,color:r.ink},children:"HOU-Yard-1"}),e.jsx("td",{style:{padding:"8px"},children:"2,140 / hr"}),e.jsx("td",{style:{padding:"8px"},children:"8.4m"}),e.jsx("td",{style:{padding:"8px"},children:y("Healthy","ok")})]}),e.jsxs("tr",{style:{borderBottom:`1px solid ${r.line}`},children:[e.jsx("td",{style:{padding:"8px",fontWeight:700,color:r.ink},children:"DAL-NorthGate"}),e.jsx("td",{style:{padding:"8px"},children:"1,820 / hr"}),e.jsx("td",{style:{padding:"8px"},children:"11.0m"}),e.jsx("td",{style:{padding:"8px"},children:y("Watch","wrn")})]}),e.jsxs("tr",{children:[e.jsx("td",{style:{padding:"8px",fontWeight:700,color:r.ink},children:"SAT-Inland"}),e.jsx("td",{style:{padding:"8px"},children:"1,540 / hr"}),e.jsx("td",{style:{padding:"8px"},children:"14.8m"}),e.jsx("td",{style:{padding:"8px"},children:y("Backed up","err")})]})]})]});if(d==="alert"){const t=l.level||"warning",o={info:["#2E7AC2","#E6EFF8"],warning:["#c47b18","rgba(232,163,58,0.16)"],danger:["#DC2626","rgba(220,38,38,0.1)"]},[i,a]=o[t]||o.warning;return e.jsxs("div",{style:{background:a,color:i,padding:"14px 16px",borderRadius:8,display:"flex",alignItems:"flex-start",gap:12},children:[e.jsx(u,{name:"alert",size:18,stroke:1.8}),e.jsxs("div",{children:[e.jsx("div",{style:{fontWeight:700,fontSize:15,marginBottom:2},children:l.title||"Throughput threshold breached"}),e.jsx("div",{style:{fontSize:14,opacity:.9},children:l.body||"SAT-Inland exceeded average dwell time of 12m for the last 30min window."})]})]})}return d==="donut"?e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:24},children:[e.jsxs("svg",{width:"140",height:"140",viewBox:"0 0 42 42",children:[e.jsx("circle",{cx:"21",cy:"21",r:"15.9",fill:"none",stroke:r.soft,strokeWidth:"6"}),e.jsx("circle",{cx:"21",cy:"21",r:"15.9",fill:"none",stroke:r.orange,strokeWidth:"6",strokeDasharray:"58 100",strokeDashoffset:"25",transform:"rotate(-90 21 21)"}),e.jsx("circle",{cx:"21",cy:"21",r:"15.9",fill:"none",stroke:"#F49A5C",strokeWidth:"6",strokeDasharray:"22 100",strokeDashoffset:"-33",transform:"rotate(-90 21 21)"}),e.jsx("circle",{cx:"21",cy:"21",r:"15.9",fill:"none",stroke:"#334155",strokeWidth:"6",strokeDasharray:"20 100",strokeDashoffset:"-55",transform:"rotate(-90 21 21)"})]}),e.jsx("div",{style:{fontSize:13},children:[["Government",r.orange,"58%"],["Industrial","#F49A5C","22%"],["Medical","#334155","20%"]].map(([t,o,i])=>e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,margin:"4px 0"},children:[e.jsx("span",{style:{width:10,height:10,borderRadius:2,background:o,flexShrink:0}}),e.jsx("span",{style:{color:r.ink},children:t}),e.jsxs("span",{style:{color:r.muted},children:[" · ",i]})]},t))})]}):d==="activity"?e.jsx("ul",{style:{padding:0,margin:0,listStyle:"none"},children:[["green","Cimarron deployed v2.4","12 min ago"],["accent","ca-discovery generated W6HCG report","1 hr ago"],["accent","Harris County · 3,500 devices synced","3 hr ago"],["gray","Healix SOW signed","Yesterday"]].map(([t,o,i],a)=>e.jsxs("li",{style:{display:"flex",gap:10,padding:"10px 0",borderBottom:a<3?"1px solid #F0F0F0":"none"},children:[e.jsx("span",{style:{width:8,height:8,borderRadius:"50%",background:t==="green"?r.green:t==="gray"?"#CBD5E1":r.orange,marginTop:6,flexShrink:0}}),e.jsxs("div",{style:{flex:1,fontSize:12},children:[e.jsx("div",{style:{color:r.ink},children:o}),e.jsx("div",{style:{color:r.muted,fontSize:15,marginTop:2},children:i})]})]},a))}):d==="leaderboard"?e.jsx("div",{children:[["1","HOU-Yard-1","98.4%"],["2","DAL-NorthGate","96.1%"],["3","AUS-Central","94.0%"],["4","SAT-Inland","91.8%"]].map(([t,o,i])=>e.jsxs("div",{style:{display:"grid",gridTemplateColumns:"24px 1fr 60px",alignItems:"center",padding:"10px 4px",borderBottom:`1px solid ${r.line}`,fontSize:13},children:[e.jsx("span",{style:{fontWeight:700,color:r.orange},children:t}),e.jsx("span",{style:{color:r.ink,fontWeight:700},children:o}),e.jsx("span",{style:{color:r.muted,textAlign:"right"},children:i})]},t))}):e.jsx("div",{style:{padding:20,color:r.muted,fontSize:13},children:"No preview available."})},C={fontSize:12,fontWeight:700,color:r.muted,textTransform:"uppercase",letterSpacing:"0.06em",display:"block",marginBottom:6},$={width:"100%",padding:"8px 10px",border:`1.5px solid ${r.line}`,borderRadius:6,fontSize:14,outline:"none",boxSizing:"border-box",color:r.ink,background:"#fff"},de=({value:s,onChange:d})=>{const[h,l]=g.useState(s.mode||"child"),[y,t]=g.useState(s.parent||"operations"),[o,i]=g.useState("operations"),a=(f,v)=>{if(l(f),t(v),f==="parent")d({mode:"parent"});else{const R=Q.find(n=>n.id===v);d({mode:"child",parent:v,parentLabel:R==null?void 0:R.label})}},p=({active:f,title:v,desc:R,onClick:n})=>e.jsxs("div",{onClick:n,style:{display:"flex",alignItems:"flex-start",gap:12,padding:"12px 14px",borderRadius:8,border:`2px solid ${f?r.orange:r.line}`,background:f?r.cream:"#fff",cursor:"pointer",marginBottom:8},children:[e.jsx("div",{style:{width:18,height:18,borderRadius:"50%",border:`2px solid ${f?r.orange:"#CCC"}`,background:f?r.orange:"transparent",flexShrink:0,marginTop:1,display:"flex",alignItems:"center",justifyContent:"center"},children:f&&e.jsx("div",{style:{width:6,height:6,borderRadius:"50%",background:"#fff"}})}),e.jsxs("div",{children:[e.jsx("div",{style:{fontSize:15,fontWeight:700,color:r.ink},children:v}),e.jsx("div",{style:{fontSize:15,color:r.muted,marginTop:2},children:R})]})]});return e.jsxs("div",{children:[e.jsx(p,{active:h==="child",title:"Place under an existing parent",desc:"Adds this as a child link inside a current navigation group.",onClick:()=>a("child",y)}),e.jsx(p,{active:h==="parent",title:"Make it its own top-level parent",desc:"Adds a new section to the main navigation bar.",onClick:()=>{l("parent"),d({mode:"parent"})}}),h==="child"&&e.jsxs("div",{style:{marginTop:4},children:[e.jsx("div",{style:{fontSize:15,color:r.muted,marginBottom:6},children:"Pick the parent group:"}),e.jsxs("div",{style:{border:`1px solid ${r.line}`,borderRadius:8,overflow:"hidden"},children:[Q.map(f=>e.jsxs("div",{children:[e.jsxs("div",{onClick:()=>{const v=o===f.id?null:f.id;i(v),a("child",f.id)},style:{display:"flex",alignItems:"center",gap:8,padding:"9px 12px",borderBottom:`1px solid ${r.line}`,cursor:"pointer",background:y===f.id?r.cream:"#fff",fontSize:15,fontWeight:600,color:r.ink},children:[e.jsx(u,{name:"folder",size:14}),f.label,e.jsx("span",{style:{marginLeft:"auto",fontSize:14,color:r.muted,background:r.soft,borderRadius:999,padding:"1px 6px"},children:f.children.length}),e.jsx(u,{name:o===f.id?"chevronDown":"chevronRight",size:12})]}),o===f.id&&f.children.map(v=>e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,padding:"8px 12px 8px 32px",borderBottom:"1px solid #F8F8F8",fontSize:14,color:r.muted,background:"#FAFAFA"},children:[e.jsx(u,{name:"file",size:12}),v.label]},v.id))]},f.id)),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,padding:"9px 12px",fontSize:15,color:r.muted,cursor:"pointer"},onMouseEnter:f=>f.currentTarget.style.background=r.soft,onMouseLeave:f=>f.currentTarget.style.background="transparent",children:[e.jsx(u,{name:"plus",size:14}),"Create new parent group…"]})]})]})]})},ae=({catalog:s,onAdd:d,onDragStart:h})=>{const[l,y]=g.useState(""),t=s.filter(i=>!l||i.name.toLowerCase().includes(l.toLowerCase())||i.desc.toLowerCase().includes(l.toLowerCase())),o=[...new Set(t.map(i=>i.category))];return e.jsxs("aside",{style:{width:220,borderRight:`1px solid ${r.line}`,background:r.soft,overflow:"auto",flexShrink:0,display:"flex",flexDirection:"column"},children:[e.jsxs("div",{style:{padding:"12px 14px 10px",borderBottom:`1px solid ${r.line}`},children:[e.jsx("div",{style:{fontSize:15,fontWeight:700,color:r.ink,marginBottom:4},children:"Components"}),e.jsx("div",{style:{fontSize:15,color:r.muted},children:"Drag onto the canvas or click to add"})]}),e.jsx("div",{style:{padding:"8px 10px",borderBottom:`1px solid ${r.line}`},children:e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,background:"#fff",border:`1px solid ${r.line}`,borderRadius:6,padding:"6px 8px"},children:[e.jsx(u,{name:"search",size:12,stroke:1.8}),e.jsx("input",{value:l,onChange:i=>y(i.target.value),placeholder:"Search…",style:{border:"none",background:"transparent",outline:"none",fontSize:15,color:r.ink,width:"100%"}})]})}),e.jsx("div",{style:{flex:1,overflowY:"auto"},children:o.map(i=>e.jsxs("div",{children:[e.jsx("div",{style:{fontSize:15,fontWeight:700,textTransform:"uppercase",letterSpacing:"0.08em",color:"#999",padding:"10px 14px 4px"},children:i}),t.filter(a=>a.category===i).map(a=>e.jsxs("div",{draggable:!0,onDragStart:p=>h(p,a.id),onClick:()=>d(a),style:{display:"flex",alignItems:"center",gap:10,padding:"8px 14px",cursor:"pointer"},onMouseEnter:p=>p.currentTarget.style.background="#EBEBEB",onMouseLeave:p=>p.currentTarget.style.background="transparent",children:[e.jsx("div",{style:{width:28,height:28,borderRadius:7,background:"#fff",display:"grid",placeItems:"center",color:r.orange,flexShrink:0,boxShadow:"0 1px 3px rgba(0,0,0,0.06)"},children:e.jsx(u,{name:a.icon,size:14})}),e.jsxs("div",{children:[e.jsx("div",{style:{fontSize:14,fontWeight:700,color:r.ink},children:a.name}),e.jsx("div",{style:{fontSize:14,color:r.muted,marginTop:1,lineHeight:1.3},children:a.desc})]})]},a.id))]},i))})]})},ce=({artifact:s,slots:d,selectedId:h,mode:l,dragOver:y,onSelect:t,onRemove:o,onAdd:i,onCanvasDragOver:a,onCanvasDragLeave:p,onCanvasDrop:f,onSlotDragStart:v,onSlotDragOver:R,onSlotDrop:n,onSlotDragEnd:k,dropTarget:S,draggingId:I,gridRef:F,resizing:M,startResize:W})=>{const E=s.kind==="page"?X:Y,z=s.kind==="page"?["datatable","kpi","graph","tabs","map","calendar","chat","report","files"]:["kpi","graph","datagrid","map","alert","donut","activity","leaderboard"],A=({max:b})=>e.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:6},children:(b?z.slice(0,b):z).map(c=>{const D=E.find(B=>B.id===c);return e.jsxs("button",{onClick:()=>i(c),style:{display:"inline-flex",alignItems:"center",gap:5,fontSize:15,fontWeight:700,padding:"5px 10px",borderRadius:999,border:`1px solid ${r.line}`,background:"#fff",color:r.ink,cursor:"pointer"},onMouseEnter:B=>{B.currentTarget.style.borderColor=r.orange,B.currentTarget.style.color=r.orange},onMouseLeave:B=>{B.currentTarget.style.borderColor=r.line,B.currentTarget.style.color=r.ink},children:[e.jsx(u,{name:D.icon,size:11}),D.name]},c)})});return e.jsx("div",{style:{flex:1,overflow:"auto",background:"#FAFAFA"},onDragOver:a,onDragLeave:p,onDrop:f,children:e.jsxs("div",{style:{maxWidth:1100,margin:"0 auto",padding:"0 24px 48px"},children:[e.jsxs("div",{style:{padding:"24px 0 16px",borderBottom:`1px solid ${r.line}`,marginBottom:24},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,marginBottom:4},children:[e.jsx("h1",{style:{fontFamily:"Lato, sans-serif",fontSize:24,fontWeight:900,color:r.ink,margin:0},children:s.title}),e.jsx("span",{style:{fontSize:15,fontWeight:700,padding:"2px 8px",borderRadius:999,background:"rgba(241,90,34,0.1)",color:r.orange},children:"● Draft"})]}),s.desc&&e.jsx("p",{style:{fontSize:15,color:r.muted,margin:"0 0 8px"},children:s.desc}),e.jsxs("div",{style:{display:"flex",gap:16,fontSize:14,color:r.muted,flexWrap:"wrap"},children:[e.jsxs("span",{children:[e.jsx("b",{style:{color:r.ink},children:"Type"})," · ",s.kind==="page"?"Page":"Dashboard"]}),e.jsxs("span",{children:[e.jsx("b",{style:{color:r.ink},children:"Location"})," · ",s.nav.mode==="parent"?`${s.title} (top-level)`:`${s.nav.parentLabel} / ${s.title}`]}),e.jsxs("span",{children:[e.jsx("b",{style:{color:r.ink},children:"Audience"})," · ",s.audience]}),s.kind!=="page"&&e.jsxs("span",{children:[e.jsx("b",{style:{color:r.ink},children:"Refresh"})," · ",s.refresh]})]})]}),d.length===0?e.jsxs("div",{style:{border:`2px dashed ${y?r.orange:r.line}`,borderRadius:16,padding:"40px 24px",textAlign:"center",background:y?r.cream:"#fff",transition:"border-color 0.2s, background 0.2s"},children:[e.jsx("div",{style:{width:56,height:56,borderRadius:14,border:`2px dashed ${r.line}`,display:"grid",placeItems:"center",margin:"0 auto 16px",color:"#CCC"},children:e.jsx(u,{name:"plus",size:24,stroke:1.5})}),e.jsx("h3",{style:{fontFamily:"Lato, sans-serif",fontSize:18,fontWeight:700,color:r.ink,margin:"0 0 6px"},children:s.kind==="page"?"This page is empty":"This dashboard is empty"}),e.jsxs("p",{style:{fontSize:15,color:r.muted,margin:"0 0 20px"},children:["Drag a ",s.kind==="page"?"component":"widget"," from the left panel, or pick a quick-start below."]}),e.jsx(A,{})]}):e.jsxs(e.Fragment,{children:[e.jsx("div",{ref:F,style:{display:"grid",gridTemplateColumns:"repeat(12,1fr)",gap:12},children:d.map(b=>{const c=E.find(j=>j.id===b.type),D=b.span||(s.kind==="page"?12:6),B=(M==null?void 0:M.id)===b.id,L={4:"1/3",6:"1/2",8:"2/3",12:"Full"};return e.jsxs("div",{style:{gridColumn:`span ${D}`,background:"#fff",border:`2px solid ${h===b.id?r.orange:r.line}`,borderRadius:12,overflow:"hidden",boxShadow:h===b.id?"0 0 0 3px rgba(241,90,34,0.12)":(S==null?void 0:S.id)===b.id?`${S.side==="before"?"-4px":"4px"} 0 0 ${r.orange}`:"none",opacity:I===b.id?.5:1,cursor:l==="edit"?"pointer":"default",position:"relative",transition:"border-color 0.15s, box-shadow 0.15s"},draggable:l==="edit"&&!M,onClick:()=>t(b.id),onDragStart:j=>v(j,b),onDragOver:j=>R(j,b),onDrop:j=>n(j,b),onDragEnd:k,children:[l==="edit"&&e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,padding:"7px 10px",borderBottom:"1px solid #F4F4F4",background:h===b.id?r.cream:r.soft},children:[e.jsxs("span",{style:{display:"flex",alignItems:"center",gap:4,fontSize:14,fontWeight:700,textTransform:"uppercase",letterSpacing:"0.06em",color:r.muted},children:[e.jsx(u,{name:c.icon,size:10}),c.name]}),e.jsx("span",{style:{fontSize:14,fontWeight:700,color:r.ink,flex:1},children:b.config.title||c.name}),e.jsx("div",{style:{display:"flex",gap:2},children:[["sliders","Configure",()=>{t(b.id)}],["drag","Reorder",null],["copy","Duplicate",null],["trash","Remove",()=>o(b.id)]].map(([j,_,U])=>e.jsx("button",{title:_,onClick:N=>{N.stopPropagation(),U&&U()},style:{width:22,height:22,borderRadius:4,border:"none",background:"transparent",color:j==="trash"?"#CCC":r.muted,display:"grid",placeItems:"center",cursor:j==="drag"?"grab":"pointer"},onMouseEnter:N=>N.currentTarget.style.color=j==="trash"?"#DC2626":r.orange,onMouseLeave:N=>N.currentTarget.style.color=j==="trash"?"#CCC":r.muted,children:e.jsx(u,{name:j,size:12})},j))})]}),e.jsx("div",{style:{padding:16},children:b.configured?e.jsx(le,{kind:s.kind,type:b.type,config:b.config}):e.jsxs("div",{style:{textAlign:"center",padding:"24px 16px"},children:[e.jsx("div",{style:{width:36,height:36,borderRadius:8,background:r.soft,display:"grid",placeItems:"center",margin:"0 auto 10px",color:r.muted},children:e.jsx(u,{name:c.icon,size:18})}),e.jsxs("p",{style:{fontSize:15,color:r.muted,margin:"0 0 12px"},children:[c.name," added — configure it to populate data."]}),e.jsxs("button",{onClick:j=>{j.stopPropagation(),t(b.id)},style:{display:"inline-flex",alignItems:"center",gap:6,padding:"7px 14px",fontSize:14,fontWeight:700,color:r.orange,border:`1.5px solid ${r.orange}`,borderRadius:8,background:"transparent",cursor:"pointer"},children:[e.jsx(u,{name:"sliders",size:12}),"Open configurator"]})]})}),l==="edit"&&e.jsx("div",{title:"Drag to resize",onMouseDown:j=>W(j,b),onClick:j=>j.stopPropagation(),style:{position:"absolute",top:0,right:0,bottom:0,width:8,cursor:"ew-resize",display:"flex",alignItems:"center",justifyContent:"center",opacity:0},onMouseEnter:j=>j.currentTarget.style.opacity="1",onMouseLeave:j=>{B||(j.currentTarget.style.opacity="0")},children:e.jsx("div",{style:{width:3,height:24,borderRadius:2,background:B?r.orange:"rgba(27,27,27,0.25)"}})}),B&&e.jsxs("div",{style:{position:"absolute",top:8,right:14,background:r.ink,color:"#fff",fontSize:14,fontWeight:700,padding:"3px 8px",borderRadius:999,pointerEvents:"none"},children:[L[D]," · ",D,"/12"]})]},b.id)})}),l==="edit"&&e.jsxs("div",{style:{border:`2px dashed ${y?r.orange:r.line}`,borderRadius:12,padding:"20px 16px",marginTop:16,textAlign:"center",background:y?r.cream:"transparent",transition:"border-color 0.2s, background 0.2s"},children:[e.jsxs("p",{style:{margin:"0 0 10px",fontSize:15,color:r.muted},children:["Drop another ",s.kind==="page"?"component":"widget"," here, or add:"]}),e.jsx(A,{max:6})]})]})]})})},pe=({slot:s,artifact:d,onClose:h,onSave:l,onRemove:y})=>{const[t,o]=g.useState("data"),[i,a]=g.useState((s==null?void 0:s.config)||{});g.useEffect(()=>{a((s==null?void 0:s.config)||{}),o("data")},[s==null?void 0:s.id]);const p=(n,k)=>a(S=>({...S,[n]:k})),f=d.kind==="page"?X:Y,v=s?f.find(n=>n.id===s.type):null,R=({on:n,onClick:k})=>e.jsx("div",{onClick:k,style:{width:36,height:20,borderRadius:999,background:n?r.orange:r.line,cursor:"pointer",position:"relative",transition:"background 0.2s",flexShrink:0},children:e.jsx("div",{style:{position:"absolute",top:3,left:n?17:3,width:14,height:14,borderRadius:"50%",background:"#fff",transition:"left 0.2s",boxShadow:"0 1px 3px rgba(0,0,0,0.2)"}})});return!s||!v?e.jsx("div",{style:{width:280,borderLeft:`1px solid ${r.line}`,background:"#fff",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:e.jsxs("div",{style:{textAlign:"center",color:"#CCC",padding:24},children:[e.jsx(u,{name:"sliders",size:28,stroke:1.4}),e.jsx("div",{style:{fontSize:15,fontWeight:600,color:r.muted,marginTop:12},children:"Select a component"}),e.jsx("div",{style:{fontSize:15,marginTop:4,lineHeight:1.5,color:"#999"},children:"Click any slot on the canvas to configure it"})]})}):e.jsxs("div",{style:{width:280,borderLeft:`1px solid ${r.line}`,background:"#fff",display:"flex",flexDirection:"column",flexShrink:0},children:[e.jsxs("div",{style:{padding:"12px 16px",borderBottom:`1px solid ${r.line}`,display:"flex",alignItems:"center",gap:10},children:[e.jsx("div",{style:{width:28,height:28,borderRadius:6,background:r.soft,display:"grid",placeItems:"center",color:r.orange,flexShrink:0},children:e.jsx(u,{name:v.icon,size:14})}),e.jsxs("div",{style:{flex:1},children:[e.jsx("div",{style:{fontSize:14,color:r.muted,fontWeight:700,textTransform:"uppercase",letterSpacing:"0.06em"},children:"Configure"}),e.jsx("div",{style:{fontSize:15,fontWeight:700,color:r.ink},children:v.name})]}),e.jsx("button",{onClick:h,style:{width:22,height:22,borderRadius:4,border:"none",background:"transparent",color:r.muted,display:"grid",placeItems:"center",cursor:"pointer"},children:e.jsx(u,{name:"x",size:12})})]}),e.jsx("div",{style:{display:"flex",borderBottom:`1px solid ${r.line}`},children:["data","display","advanced"].map(n=>e.jsx("button",{onClick:()=>o(n),style:{flex:1,padding:"8px 4px",fontSize:15,fontWeight:700,textTransform:"capitalize",border:"none",borderBottom:`2px solid ${t===n?r.orange:"transparent"}`,background:"transparent",color:t===n?r.ink:r.muted,cursor:"pointer",marginBottom:-1},children:n},n))}),e.jsxs("div",{style:{flex:1,overflow:"auto",padding:14},children:[t==="data"&&e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:14},children:[e.jsxs("div",{children:[e.jsx("label",{style:C,children:"Title"}),e.jsx("input",{style:$,value:i.title||"",placeholder:v.name,onChange:n=>p("title",n.target.value),onFocus:n=>n.currentTarget.style.borderColor=r.orange,onBlur:n=>n.currentTarget.style.borderColor=r.line})]}),e.jsxs("div",{children:[e.jsx("label",{style:C,children:"Data source"}),e.jsxs("select",{style:{...$,cursor:"pointer"},value:i.source||"fleet",onChange:n=>p("source",n.target.value),children:[e.jsx("option",{value:"fleet",children:"Fleet — drivers & routes"}),e.jsx("option",{value:"transloads",children:"Transloads — yard activity"}),e.jsx("option",{value:"permits",children:"Permits — compliance docs"}),e.jsx("option",{value:"incidents",children:"Incidents — events log"}),e.jsx("option",{value:"custom",children:"Custom SQL / API…"})]})]}),(s.type==="datatable"||s.type==="datagrid")&&e.jsxs("div",{children:[e.jsx("label",{style:C,children:"Visible columns"}),e.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:4},children:["Driver","Route","Status","On-time","Last seen","Region"].map(n=>{const k=i.columns||["Driver","Route","Status","On-time"],S=k.includes(n);return e.jsx("button",{onClick:()=>p("columns",S?k.filter(I=>I!==n):[...k,n]),style:{fontSize:15,fontWeight:700,padding:"4px 8px",borderRadius:999,border:`1.5px solid ${S?r.orange:r.line}`,background:S?r.cream:"transparent",color:S?r.orange:r.muted,cursor:"pointer"},children:n},n)})})]}),s.type==="graph"&&e.jsxs("div",{children:[e.jsx("label",{style:C,children:"Chart type"}),e.jsx("div",{style:{display:"flex",border:`1px solid ${r.line}`,borderRadius:6,overflow:"hidden"},children:[["bar","Bar"],["line","Line"],["area","Area"]].map(([n,k])=>e.jsx("button",{onClick:()=>p("chart",n),style:{flex:1,padding:"7px 4px",fontSize:15,fontWeight:700,background:(i.chart||"bar")===n?r.ink:"transparent",color:(i.chart||"bar")===n?"#fff":r.muted,border:"none",cursor:"pointer"},children:k},n))})]}),s.type==="kpi"&&e.jsxs("div",{children:[e.jsx("label",{style:C,children:"Number of tiles"}),e.jsx("div",{style:{display:"flex",border:`1px solid ${r.line}`,borderRadius:6,overflow:"hidden"},children:[2,3,4].map(n=>e.jsxs("button",{onClick:()=>p("tiles",n),style:{flex:1,padding:"7px 4px",fontSize:15,fontWeight:700,background:(i.tiles||3)===n?r.ink:"transparent",color:(i.tiles||3)===n?"#fff":r.muted,border:"none",cursor:"pointer"},children:[n," tiles"]},n))})]}),s.type==="tabs"&&e.jsxs("div",{children:[e.jsx("label",{style:C,children:"Tab labels"}),e.jsx("input",{style:$,placeholder:"Overview, Activity, Settings",value:(i.tabs||["Overview","Activity","Settings"]).join(", "),onChange:n=>p("tabs",n.target.value.split(",").map(k=>k.trim()).filter(Boolean)),onFocus:n=>n.currentTarget.style.borderColor=r.orange,onBlur:n=>n.currentTarget.style.borderColor=r.line})]}),s.type==="map"&&e.jsxs("div",{children:[e.jsx("label",{style:C,children:"Layer"}),e.jsx("div",{style:{display:"flex",border:`1px solid ${r.line}`,borderRadius:6,overflow:"hidden"},children:[["points","Points"],["heat","Heatmap"],["polygons","Territories"]].map(([n,k])=>e.jsx("button",{onClick:()=>p("layer",n),style:{flex:1,padding:"7px 4px",fontSize:15,fontWeight:700,background:(i.layer||"points")===n?r.ink:"transparent",color:(i.layer||"points")===n?"#fff":r.muted,border:"none",cursor:"pointer"},children:k},n))})]}),s.type==="alert"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{children:[e.jsx("label",{style:C,children:"Severity"}),e.jsx("div",{style:{display:"flex",border:`1px solid ${r.line}`,borderRadius:6,overflow:"hidden"},children:[["info","Info"],["warning","Warning"],["danger","Critical"]].map(([n,k])=>e.jsx("button",{onClick:()=>p("level",n),style:{flex:1,padding:"7px 4px",fontSize:15,fontWeight:700,background:(i.level||"warning")===n?r.ink:"transparent",color:(i.level||"warning")===n?"#fff":r.muted,border:"none",cursor:"pointer"},children:k},n))})]}),e.jsxs("div",{children:[e.jsx("label",{style:C,children:"Message"}),e.jsx("textarea",{style:{...$,resize:"vertical"},value:i.body||"",placeholder:"Describe what triggered this alert…",onChange:n=>p("body",n.target.value),onFocus:n=>n.currentTarget.style.borderColor=r.orange,onBlur:n=>n.currentTarget.style.borderColor=r.line})]})]}),s.type==="chat"&&e.jsxs("div",{children:[e.jsx("label",{style:C,children:"Channel"}),e.jsx("input",{style:$,placeholder:"Operations · #drivers",value:i.channel||"",onChange:n=>p("channel",n.target.value),onFocus:n=>n.currentTarget.style.borderColor=r.orange,onBlur:n=>n.currentTarget.style.borderColor=r.line})]})]}),t==="display"&&e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:14},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[e.jsxs("div",{children:[e.jsx("div",{style:{fontSize:15,fontWeight:700,color:r.ink},children:"Show header"}),e.jsx("div",{style:{fontSize:15,color:r.muted,marginTop:1},children:"Displays title bar above component"})]}),e.jsx(R,{on:i.showHeader!==!1,onClick:()=>p("showHeader",i.showHeader===!1)})]}),e.jsx("div",{style:{height:1,background:r.line}}),e.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[e.jsxs("div",{children:[e.jsx("div",{style:{fontSize:15,fontWeight:700,color:r.ink},children:"Compact density"}),e.jsx("div",{style:{fontSize:15,color:r.muted,marginTop:1},children:"Reduces row height and padding"})]}),e.jsx(R,{on:!!i.compact,onClick:()=>p("compact",!i.compact)})]}),e.jsx("div",{style:{height:1,background:r.line}}),e.jsxs("div",{children:[e.jsx("label",{style:C,children:"Column span"}),e.jsx("div",{style:{display:"flex",border:`1px solid ${r.line}`,borderRadius:6,overflow:"hidden"},children:[["4","1/3"],["6","1/2"],["8","2/3"],["12","Full"]].map(([n,k])=>e.jsx("button",{onClick:()=>p("span",Number(n)),style:{flex:1,padding:"7px 4px",fontSize:14,fontWeight:700,background:(i.span||12)===Number(n)?r.ink:"transparent",color:(i.span||12)===Number(n)?"#fff":r.muted,border:"none",cursor:"pointer"},children:k},n))})]})]}),t==="advanced"&&e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:14},children:[e.jsxs("div",{children:[e.jsx("label",{style:C,children:"Refresh interval"}),e.jsxs("select",{style:{...$,cursor:"pointer"},value:i.refresh||"5m",onChange:n=>p("refresh",n.target.value),children:[e.jsx("option",{value:"off",children:"Off"}),e.jsx("option",{value:"30s",children:"30 seconds"}),e.jsx("option",{value:"1m",children:"1 minute"}),e.jsx("option",{value:"5m",children:"5 minutes"}),e.jsx("option",{value:"live",children:"Live"})]})]}),e.jsxs("div",{children:[e.jsx("label",{style:C,children:"Permission"}),e.jsxs("select",{style:{...$,cursor:"pointer"},value:i.perm||"team",onChange:n=>p("perm",n.target.value),children:[e.jsx("option",{value:"team",children:"Team only"}),e.jsx("option",{value:"org",children:"Whole org"}),e.jsx("option",{value:"execs",children:"Executives"})]})]}),e.jsxs("div",{children:[e.jsx("label",{style:C,children:"Component ID"}),e.jsx("input",{style:{...$,fontFamily:"IBM Plex Mono, monospace",fontSize:11},value:`xf-${s.type}-${s.id.slice(-6)}`,readOnly:!0})]})]})]}),e.jsxs("div",{style:{padding:"10px 14px",borderTop:`1px solid ${r.line}`,display:"flex",gap:8},children:[e.jsx("button",{onClick:y,style:{width:34,height:34,borderRadius:8,border:`1px solid ${r.line}`,background:"transparent",color:"#CCC",display:"grid",placeItems:"center",cursor:"pointer"},onMouseEnter:n=>{n.currentTarget.style.color="#DC2626",n.currentTarget.style.borderColor="#DC2626"},onMouseLeave:n=>{n.currentTarget.style.color="#CCC",n.currentTarget.style.borderColor=r.line},children:e.jsx(u,{name:"trash",size:14})}),e.jsxs("button",{onClick:()=>l(i),style:{flex:1,display:"flex",alignItems:"center",justifyContent:"center",gap:6,padding:"9px",fontSize:15,fontWeight:700,background:r.orange,color:"#fff",border:"none",borderRadius:8,cursor:"pointer"},children:[e.jsx(u,{name:"check",size:14,stroke:2.5}),"Save & apply"]})]})]})},xe=({artifact:s,onBack:d,onSave:h})=>{const l=s.kind==="page",y=l?X:Y,[t,o]=g.useState(s.slots||[]),[i,a]=g.useState(null),[p,f]=g.useState("edit"),[v,R]=g.useState(!1),[n,k]=g.useState(!1),[S,I]=g.useState(null),[F,M]=g.useState(null),[W,E]=g.useState(null),z=g.useRef(null),A=t.find(x=>x.id===i)??null,b=x=>{const m=`slot_${Math.random().toString(36).slice(2,9)}`,w=l?12:6;o(T=>[...T,{id:m,type:x.id,configured:!1,config:{},span:w}]),a(m)},c=x=>{const m=y.find(w=>w.id===x);m&&b(m)},D=(x,m)=>o(w=>w.map(T=>T.id===x?{...T,...m}:T)),B=(x,m)=>o(w=>w.map(T=>T.id===x?{...T,span:m}:T)),L=x=>{o(m=>m.filter(w=>w.id!==x)),i===x&&a(null)};g.useEffect(()=>{if(!W)return;const x=w=>{const T=(W.gridWidth+12)/12,H=W.startSpan+(w.clientX-W.startX)/T,K=[4,6,8,12],P=K.reduce((O,V)=>Math.abs(V-H)<Math.abs(O-H)?V:O,K[0]);P!==W.currentSpan&&(E(O=>O&&{...O,currentSpan:P}),B(W.id,P))},m=()=>E(null);return window.addEventListener("mousemove",x),window.addEventListener("mouseup",m),document.body.style.cursor="ew-resize",document.body.style.userSelect="none",()=>{window.removeEventListener("mousemove",x),window.removeEventListener("mouseup",m),document.body.style.cursor="",document.body.style.userSelect=""}},[W]);const j=(x,m)=>{var T;x.stopPropagation(),x.preventDefault();const w=m.span||(l?12:6);E({id:m.id,startSpan:w,startX:x.clientX,gridWidth:((T=z.current)==null?void 0:T.getBoundingClientRect().width)||1100,currentSpan:w})},_=(x,m)=>{if(W){x.preventDefault();return}x.dataTransfer.effectAllowed="move",x.dataTransfer.setData("text/xf-reorder",m.id),I(m.id)},U=(x,m)=>{if(!S||S===m.id)return;x.preventDefault();const w=x.currentTarget.getBoundingClientRect();M({id:m.id,side:x.clientX-w.left<w.width/2?"before":"after"})},N=(x,m)=>{if(x.preventDefault(),x.stopPropagation(),!S||S===m.id){I(null),M(null);return}o(w=>{const T=w.findIndex(V=>V.id===S),H=w.findIndex(V=>V.id===m.id);if(T===-1||H===-1)return w;const K=(F==null?void 0:F.side)==="after"?H+(T<H?0:1):H+(T<H?-1:0),P=[...w],[O]=P.splice(T,1);return P.splice(Math.max(0,Math.min(K,P.length)),0,O),P}),I(null),M(null)},q=()=>{I(null),M(null)},J=(x,m)=>x.dataTransfer.setData("text/xf-type",m),Z=x=>{x.preventDefault(),R(!0)},ee=()=>R(!1),re=x=>{x.preventDefault(),R(!1);const m=x.dataTransfer.getData("text/xf-type");m&&c(m)},te=()=>{k(!0),setTimeout(()=>k(!1),2200),h({...s,slots:t})};return e.jsxs("div",{style:{display:"flex",flexDirection:"column",height:"100%",overflow:"hidden"},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,padding:"8px 16px",borderBottom:`1px solid ${r.line}`,background:"#fff",flexShrink:0},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:4,fontSize:14,color:r.muted,flex:1},children:[e.jsx("button",{onClick:d,style:{background:"transparent",border:"none",cursor:"pointer",fontSize:14,color:r.muted,fontWeight:600,padding:0},children:"Home"}),e.jsx(u,{name:"chevronRight",size:12}),e.jsx("span",{children:s.nav.mode==="parent"?s.title:s.nav.parentLabel}),s.nav.mode==="child"&&e.jsxs(e.Fragment,{children:[e.jsx(u,{name:"chevronRight",size:12}),e.jsx("span",{style:{fontWeight:700,color:r.ink},children:s.title})]})]}),e.jsx("div",{style:{display:"flex",border:`1px solid ${r.line}`,borderRadius:8,overflow:"hidden"},children:["edit","preview"].map(x=>e.jsxs("button",{onClick:()=>{f(x),x==="preview"&&a(null)},style:{display:"flex",alignItems:"center",gap:5,padding:"6px 12px",fontSize:14,fontWeight:700,background:p===x?r.ink:"transparent",color:p===x?"#fff":r.muted,border:"none",cursor:"pointer"},children:[e.jsx(u,{name:x==="edit"?"sliders":"eye",size:11}),x]},x))}),e.jsxs("button",{style:{display:"flex",alignItems:"center",gap:5,padding:"6px 12px",fontSize:14,fontWeight:700,color:r.muted,border:`1px solid ${r.line}`,borderRadius:8,background:"transparent",cursor:"pointer"},children:[e.jsx(u,{name:"copy",size:12}),"Duplicate"]}),e.jsxs("button",{onClick:te,style:{display:"flex",alignItems:"center",gap:5,padding:"7px 16px",fontSize:15,fontWeight:700,background:r.orange,color:"#fff",border:"none",borderRadius:8,cursor:"pointer"},children:[e.jsx(u,{name:"save",size:14}),"Save"]})]}),e.jsxs("div",{style:{display:"grid",gridTemplateColumns:`220px 1fr${A&&p==="edit"?" 280px":""}`,flex:1,minHeight:0,overflow:"hidden"},children:[e.jsx(ae,{catalog:y,onAdd:b,onDragStart:J}),e.jsx(ce,{artifact:s,slots:t,selectedId:i,mode:p,dragOver:v,onSelect:a,onRemove:L,onAdd:c,onCanvasDragOver:Z,onCanvasDragLeave:ee,onCanvasDrop:re,onSlotDragStart:_,onSlotDragOver:U,onSlotDrop:N,onSlotDragEnd:q,dropTarget:F,draggingId:S,gridRef:z,resizing:W,startResize:j}),A&&p==="edit"&&e.jsx(pe,{slot:A,artifact:s,onClose:()=>a(null),onSave:x=>D(A.id,{configured:!0,config:x}),onRemove:()=>L(A.id)})]}),n&&e.jsxs("div",{style:{position:"fixed",bottom:24,right:24,background:r.ink,color:"#fff",padding:"12px 18px",borderRadius:10,fontSize:15,fontWeight:700,boxShadow:"0 8px 24px rgba(0,0,0,0.2)",zIndex:500,display:"flex",alignItems:"center",gap:8},children:[e.jsx("span",{style:{color:r.green},children:e.jsx(u,{name:"check",size:14,stroke:3})}),s.title," saved · published to navigation"]})]})},he=()=>{const s={background:"rgba(255,255,255,0.05)",border:"1px solid rgba(255,255,255,0.08)",borderRadius:10,padding:12,color:"rgba(255,255,255,0.9)",display:"flex",flexDirection:"column",gap:6,position:"relative",overflow:"hidden"},d={background:r.orange,borderColor:r.orange,color:"#fff",boxShadow:"0 8px 24px rgba(241,90,34,0.4)"},h={background:"#fff",color:r.ink,borderColor:"rgba(255,255,255,0.2)"},l=(t,o,i)=>e.jsxs("div",{style:{display:"flex",gap:4,alignItems:"center",fontSize:9,opacity:.7,letterSpacing:"0.06em",textTransform:"uppercase",fontWeight:700,...i?{color:i}:{}},children:[e.jsx(u,{name:t,size:10,stroke:2}),o]}),y=(t,o)=>e.jsx("div",{style:{display:"flex",gap:2,alignItems:"flex-end",flex:1,...o?{color:o}:{}},children:t.map((i,a)=>e.jsx("i",{style:{flex:1,background:"currentColor",opacity:.7,borderRadius:1,height:`${i}%`}},a))});return e.jsxs("div",{style:{position:"absolute",inset:30,display:"grid",gridTemplateColumns:"repeat(6,1fr)",gridTemplateRows:"repeat(6,1fr)",gap:10},children:[e.jsxs("div",{style:{...s,...d,gridColumn:"1/4",gridRow:"1/3"},children:[l("kpi","KPI · Active drivers"),e.jsx("div",{style:{fontSize:22,fontWeight:700,letterSpacing:"-0.02em",lineHeight:1},children:"142"}),y([30,45,40,60,72,85])]}),e.jsxs("div",{style:{...s,gridColumn:"4/7",gridRow:"1/4"},children:[l("barChart","Throughput","#fff"),e.jsx("div",{style:{fontSize:13,fontWeight:700,lineHeight:1.2,color:"#fff"},children:"2,140/hr"}),y([35,48,42,60,72,65,80,90,78],r.orange)]}),e.jsxs("div",{style:{...s,...h,gridColumn:"1/3",gridRow:"3/5"},children:[l("map","Map",r.muted),e.jsxs("div",{style:{flex:1,background:"linear-gradient(135deg,#E8EEF3,#D4DEE8)",borderRadius:6,position:"relative"},children:[e.jsx("span",{style:{position:"absolute",top:"40%",left:"30%",width:8,height:8,background:r.orange,borderRadius:"50%"}}),e.jsx("span",{style:{position:"absolute",top:"60%",left:"55%",width:8,height:8,background:r.orange,borderRadius:"50%"}})]})]}),e.jsxs("div",{style:{...s,gridColumn:"3/5",gridRow:"4/7"},children:[l("table","Drivers","#fff"),e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:3,color:"#fff"},children:["M. Saldana","R. Patel","L. Nguyen"].map(t=>e.jsx("div",{style:{fontSize:9,padding:"2px 0",borderBottom:"1px solid rgba(255,255,255,0.08)"},children:t},t))})]}),e.jsxs("div",{style:{...s,...d,gridColumn:"5/7",gridRow:"4/5"},children:[l("check","On-time"),e.jsx("div",{style:{fontSize:13,fontWeight:700,lineHeight:1.2},children:"94.6%"})]}),e.jsxs("div",{style:{...s,...h,gridColumn:"1/3",gridRow:"5/7"},children:[l("chat","Chat",r.muted),e.jsx("div",{style:{fontSize:9,color:r.ink},children:"Truck 22 needs an unscheduled inspection."})]}),e.jsxs("div",{style:{...s,gridColumn:"5/7",gridRow:"5/7"},children:[l("alert","Alert","#fff"),e.jsx("div",{style:{fontSize:11,fontWeight:700,lineHeight:1.2,color:"#fff"},children:"Dwell breach · SAT"})]})]})},ge=({onCta:s})=>{const[d,h]=g.useState(0),[l,y]=g.useState(!1),t=g.useRef(void 0);g.useEffect(()=>{if(!l)return t.current=setTimeout(()=>h(i=>(i+1)%G.length),6500),()=>clearTimeout(t.current)},[d,l]);const o=i=>{clearTimeout(t.current),h(i)};return e.jsxs("div",{style:{position:"relative",borderRadius:16,overflow:"hidden",height:420,marginBottom:36,border:`1px solid ${r.line}`,boxShadow:"0 2px 16px rgba(0,0,0,0.07)"},onMouseEnter:()=>y(!0),onMouseLeave:()=>y(!1),children:[e.jsx("div",{style:{display:"flex",height:"100%",transform:`translateX(-${d*100}%)`,transition:"transform 0.6s cubic-bezier(.4,0,.2,1)",willChange:"transform"},children:G.map((i,a)=>e.jsxs("div",{style:{minWidth:"100%",height:"100%",display:"grid",gridTemplateColumns:"1fr 1fr"},children:[e.jsxs("div",{style:{padding:"60px 56px",display:"flex",flexDirection:"column",justifyContent:"center",background:"#fff",borderRight:`1px solid ${r.line}`},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,fontSize:14,color:r.orange,letterSpacing:"0.16em",textTransform:"uppercase",fontWeight:700,marginBottom:18},children:[e.jsx("span",{style:{width:28,height:2,background:r.orange,flexShrink:0}}),i.eyebrow]}),e.jsxs("h2",{style:{fontFamily:"Lato, sans-serif",fontSize:40,fontWeight:700,letterSpacing:"-0.02em",color:r.ink,margin:"0 0 16px",lineHeight:1.08},children:[i.headline[0],e.jsx("br",{}),e.jsx("i",{style:{fontStyle:"italic",color:r.orange},children:i.headline[1]})]}),e.jsx("p",{style:{fontSize:14,lineHeight:1.65,color:r.muted,fontWeight:300,margin:"0 0 28px"},dangerouslySetInnerHTML:{__html:i.body}}),e.jsxs("div",{style:{display:"flex",gap:10,flexWrap:"wrap"},children:[e.jsxs("button",{onClick:s,style:{display:"inline-flex",alignItems:"center",gap:7,padding:"11px 22px",fontSize:14,fontWeight:700,background:r.orange,color:"#fff",border:"none",borderRadius:999,cursor:"pointer"},children:[i.primary," ",e.jsx(u,{name:"arrowRight",size:14})]}),e.jsx("button",{onClick:s,style:{display:"inline-flex",alignItems:"center",gap:7,padding:"10px 20px",fontSize:15,fontWeight:600,background:"transparent",color:r.ink,border:`1.5px solid ${r.line}`,borderRadius:999,cursor:"pointer"},children:i.secondary})]})]}),e.jsxs("div",{style:{position:"relative",overflow:"hidden",background:a===1?"linear-gradient(135deg,#FBD4B8 0%,#F6A166 100%)":"linear-gradient(135deg,#1B1B1B 0%,#2E2E2E 100%)"},children:[e.jsx("div",{style:{position:"absolute",inset:0,background:a===1?"radial-gradient(circle at 80% 20%,rgba(255,255,255,0.2),transparent 60%)":"radial-gradient(circle at 80% 20%,rgba(241,90,34,0.2),transparent 60%)"}}),e.jsx(he,{})]})]},a))}),e.jsx("div",{style:{position:"absolute",bottom:28,left:"50%",transform:"translateX(-50%)",display:"flex",gap:6,zIndex:10},children:G.map((i,a)=>e.jsx("button",{onClick:()=>o(a),style:{width:a===d?36:22,height:4,borderRadius:2,border:"none",background:a===d?r.orange:"rgba(0,0,0,0.15)",cursor:"pointer",padding:0,transition:"width 0.3s, background 0.3s"}},a))}),e.jsx("div",{style:{position:"absolute",bottom:22,right:22,display:"flex",gap:6,zIndex:10},children:[{name:"chevronLeft",fn:()=>o((d-1+G.length)%G.length)},{name:"chevronRight",fn:()=>o((d+1)%G.length)}].map(i=>e.jsx("button",{onClick:i.fn,style:{width:36,height:36,borderRadius:"50%",background:"rgba(255,255,255,0.92)",border:"none",color:r.ink,display:"grid",placeItems:"center",cursor:"pointer",backdropFilter:"blur(4px)",boxShadow:"0 2px 8px rgba(0,0,0,0.15)"},children:e.jsx(u,{name:i.name,size:14})},i.name))})]})},ue=({onBuild:s})=>e.jsxs("div",{className:"xf-build-block",children:[e.jsxs("div",{className:"xf-build-left",children:[e.jsx("span",{className:"label-tag",children:"Start building"}),e.jsx("h2",{children:"What do you want to build today?"}),e.jsxs("p",{children:["Build a ",e.jsx("b",{children:"Page"})," for end-users to interact with — tables, forms, maps, chat — slotted under any branch of your main navigation. Or build a ",e.jsx("b",{children:"Dashboard"})," for executives & operators — a grid of widgets that surface what matters in real time."]}),e.jsxs("button",{className:"xf-build-cta",onClick:s,children:[e.jsx(u,{name:"plus",size:15})," Open the Build menu"]})]}),e.jsx("div",{className:"xf-build-options",children:e.jsxs("button",{className:"xf-build-card xf-build-card--page",onClick:s,children:[e.jsx("div",{className:"ic",children:e.jsx(u,{name:"layout",size:22})}),e.jsx("h3",{children:"Build a Page"}),e.jsx("p",{children:"An interactive screen for daily users. Mix Tables, KPIs, Maps, Chat, Calendar, Reports."}),e.jsxs("div",{className:"meta",children:[e.jsx("span",{children:"9 components"}),e.jsx("span",{children:"Nav-routable"})]}),e.jsx("div",{className:"arrow",children:e.jsx(u,{name:"arrowRight",size:14})})]})})]}),fe=({onBuild:s})=>e.jsxs("div",{style:{padding:"28px 36px 48px",maxWidth:1200,margin:"0 auto"},children:[e.jsx("div",{style:{marginBottom:24},children:e.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:8,fontSize:13,fontWeight:400,color:r.ink,background:r.soft,border:`1px solid ${r.line}`,padding:"6px 14px",borderRadius:999},children:[e.jsx("span",{style:{width:8,height:8,borderRadius:"50%",background:r.green,flexShrink:0,boxShadow:"0 0 0 3px rgba(22,163,74,0.2)"}}),e.jsxs("span",{children:["Welcome back, ",e.jsx("strong",{children:"Gabriel"})," — your workspace has 14 active engagements"]})]})}),e.jsx(ge,{onCta:s}),e.jsx(ue,{onBuild:s}),e.jsxs("div",{className:"xf-section-head",children:[e.jsx("h2",{children:"Continue where you left off"}),e.jsx("span",{className:"sub",children:"Pick up where you left off"}),e.jsx("button",{className:"right",children:"View all →"})]}),e.jsx("div",{className:"xf-recent-grid",children:oe.map(d=>e.jsxs("div",{className:"xf-recent-card",onClick:s,children:[e.jsx("div",{className:`pre ${d.type}`,children:d.type==="dashboard"?e.jsxs("svg",{width:"100%",height:"100%",viewBox:"0 0 200 84",preserveAspectRatio:"none",children:[e.jsx("rect",{x:"10",y:"10",width:"55",height:"30",rx:"3",fill:"#fff",stroke:"#E9E9E9"}),e.jsx("rect",{x:"70",y:"10",width:"55",height:"30",rx:"3",fill:"#fff",stroke:"#E9E9E9"}),e.jsx("rect",{x:"130",y:"10",width:"60",height:"30",rx:"3",fill:"currentColor"}),e.jsx("rect",{x:"10",y:"46",width:"115",height:"30",rx:"3",fill:"#fff",stroke:"#E9E9E9"}),e.jsx("rect",{x:"14",y:"62",width:"6",height:"10",fill:"currentColor"}),e.jsx("rect",{x:"24",y:"58",width:"6",height:"14",fill:"currentColor"}),e.jsx("rect",{x:"34",y:"54",width:"6",height:"18",fill:"currentColor"}),e.jsx("rect",{x:"44",y:"50",width:"6",height:"22",fill:"currentColor"}),e.jsx("rect",{x:"130",y:"46",width:"60",height:"30",rx:"3",fill:"#fff",stroke:"#E9E9E9"}),e.jsx("circle",{cx:"160",cy:"61",r:"10",fill:"none",stroke:"currentColor",strokeWidth:"3"})]}):e.jsxs("svg",{width:"100%",height:"100%",viewBox:"0 0 200 84",preserveAspectRatio:"none",children:[e.jsx("rect",{x:"10",y:"8",width:"80",height:"6",rx:"1",fill:"currentColor"}),e.jsx("rect",{x:"10",y:"18",width:"120",height:"3",rx:"1",fill:"#A1A1A1"}),e.jsx("rect",{x:"10",y:"30",width:"180",height:"48",rx:"3",fill:"#fff",stroke:"#E9E9E9"}),e.jsx("rect",{x:"10",y:"30",width:"180",height:"10",rx:"3",fill:"#F2F2F2"}),e.jsx("line",{x1:"10",y1:"50",x2:"190",y2:"50",stroke:"#E9E9E9"}),e.jsx("line",{x1:"10",y1:"60",x2:"190",y2:"60",stroke:"#E9E9E9"}),e.jsx("line",{x1:"10",y1:"70",x2:"190",y2:"70",stroke:"#E9E9E9"}),e.jsx("circle",{cx:"20",cy:"45",r:"2",fill:"currentColor"}),e.jsx("circle",{cx:"20",cy:"55",r:"2",fill:"currentColor"}),e.jsx("circle",{cx:"20",cy:"65",r:"2",fill:"currentColor"})]})}),e.jsx("span",{className:`type-badge ${d.type}`,children:d.type}),e.jsx("h4",{children:d.title}),e.jsxs("div",{className:"nav-loc",children:[d.nav," · ",d.updated]})]},d.id))})]}),ye=({kind:s,onClose:d,onCreate:h})=>{const[l,y]=g.useState(1),[t,o]=g.useState(""),[i,a]=g.useState(""),[p,f]=g.useState(s==="page"?"fileText":"grid"),[v,R]=g.useState({mode:"child",parent:"operations",parentLabel:"Operations"}),[n,k]=g.useState("team"),[S,I]=g.useState("5m"),[F,M]=g.useState("title"),W=g.useRef(void 0),E=g.useRef(void 0),z=s==="page",A=l===1&&!t.trim();g.useEffect(()=>{if(l===1){if(clearTimeout(W.current),clearTimeout(E.current),!t.trim()){M("title");return}if(!i.trim()){W.current=setTimeout(()=>M("desc"),3e3);return}return M("desc"),E.current=setTimeout(()=>M("next"),5e3),()=>{clearTimeout(W.current),clearTimeout(E.current)}}},[t,i,l]),g.useEffect(()=>{l>=2&&M("next")},[l]);const b=z?["fileText","layout","table","map","calendar","chat"]:["grid","barChart","kpi","map","alert","donut"];return e.jsx("div",{style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.45)",zIndex:300,display:"flex",alignItems:"center",justifyContent:"center"},onClick:c=>{c.target===c.currentTarget&&d()},children:e.jsxs("div",{style:{background:"#fff",borderRadius:20,width:620,maxHeight:"90vh",display:"flex",flexDirection:"column",boxShadow:"0 30px 80px rgba(0,0,0,0.22)",overflow:"hidden"},children:[e.jsxs("div",{style:{padding:"18px 22px",borderBottom:`1px solid ${r.line}`,display:"flex",alignItems:"center",gap:12},children:[e.jsx("div",{style:{width:36,height:36,borderRadius:9,background:r.cream,display:"grid",placeItems:"center",color:r.orange,flexShrink:0},children:e.jsx(u,{name:z?"layout":"grid",size:18})}),e.jsxs("div",{style:{flex:1},children:[e.jsx("h3",{style:{fontWeight:900,fontSize:18,color:r.ink,margin:0},children:z?"Build a Page":"Build a Dashboard"}),e.jsx("div",{style:{fontSize:14,color:r.muted,marginTop:2},children:z?"End-user screen with mixed components.":"Live grid of widgets for ops & execs."})]}),e.jsx("button",{onClick:d,style:{width:28,height:28,borderRadius:7,border:`1px solid ${r.line}`,background:r.soft,display:"grid",placeItems:"center",cursor:"pointer"},children:e.jsx(u,{name:"x",size:13})})]}),e.jsx("div",{style:{display:"flex",alignItems:"center",padding:"14px 22px",borderBottom:`1px solid ${r.line}`,gap:0},children:[["Basics",1],["Navigation",2],["Review",3]].map(([c,D],B)=>{const L=l>D,j=l===D;return e.jsxs(se.Fragment,{children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[e.jsx("div",{style:{width:26,height:26,borderRadius:"50%",background:L?r.green:j?r.orange:r.line,color:L||j?"#fff":r.muted,display:"grid",placeItems:"center",fontSize:15,fontWeight:700,flexShrink:0},children:L?e.jsx(u,{name:"check",size:11,stroke:3}):D}),e.jsx("span",{style:{fontSize:14,fontWeight:700,color:j?r.ink:r.muted},children:c})]}),B<2&&e.jsx("div",{style:{flex:1,height:1,background:r.line,margin:"0 12px"}})]},c)})}),e.jsxs("div",{style:{flex:1,overflow:"auto",padding:22},children:[l===1&&e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:14},children:[e.jsxs("div",{style:{padding:"12px 14px",borderRadius:10,border:`2px solid ${F==="title"?r.orange:r.line}`,background:F==="title"?r.cream:"#fff",transition:"border-color 0.2s, background 0.2s"},children:[e.jsxs("label",{style:{...C,color:F==="title"?r.orange:r.muted},children:[z?"Page":"Dashboard"," title ",e.jsx("span",{style:{color:"#DC2626"},children:"*"})]}),e.jsx("div",{style:{fontSize:15,color:r.muted,marginBottom:8},children:"Shown in the nav, the breadcrumb and the browser tab."}),e.jsx("input",{style:{...$},value:t,onChange:c=>o(c.target.value),placeholder:z?"e.g. Driver Performance":"e.g. Transload Health",autoFocus:!0,onFocus:c=>c.currentTarget.style.borderColor=r.orange,onBlur:c=>c.currentTarget.style.borderColor=r.line})]}),e.jsxs("div",{style:{padding:"12px 14px",borderRadius:10,border:`2px solid ${F==="desc"?r.orange:r.line}`,background:F==="desc"?r.cream:"#fff",transition:"border-color 0.2s, background 0.2s"},children:[e.jsxs("label",{style:{...C,color:F==="desc"?r.orange:r.muted},children:["Description ",e.jsx("span",{style:{fontSize:14,color:r.muted,fontWeight:400,textTransform:"none",letterSpacing:"normal"},children:"optional"})]}),e.jsxs("div",{style:{fontSize:15,color:r.muted,marginBottom:8},children:["A short one-liner that helps your team find this ",z?"page":"dashboard"," later."]}),e.jsx("textarea",{style:{...$,resize:"none",height:68},value:i,onChange:c=>a(c.target.value),placeholder:z?"Track on-time delivery, idle time and route adherence per driver.":"Real-time health of all transload sites — throughput, dwell, exceptions.",onFocus:c=>c.currentTarget.style.borderColor=r.orange,onBlur:c=>c.currentTarget.style.borderColor=r.line})]}),e.jsxs("div",{children:[e.jsx("label",{style:C,children:"Icon"}),e.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:6},children:b.map(c=>e.jsxs("button",{onClick:()=>f(c),style:{display:"inline-flex",alignItems:"center",gap:6,padding:"6px 10px",borderRadius:8,border:`1.5px solid ${p===c?r.orange:r.line}`,background:p===c?r.cream:"transparent",color:p===c?r.orange:r.muted,fontSize:14,fontWeight:700,cursor:"pointer"},children:[e.jsx(u,{name:c,size:12}),c]},c))})]})]}),l===2&&e.jsxs("div",{children:[e.jsxs("label",{style:C,children:["Navigation location ",e.jsx("span",{style:{color:"#DC2626"},children:"*"})]}),e.jsxs("div",{style:{fontSize:15,color:r.muted,marginBottom:12},children:["Where should this ",z?"page":"dashboard"," appear in the navigation?"]}),e.jsx(de,{value:v,onChange:R}),e.jsxs("div",{style:{marginTop:14,padding:"10px 14px",background:r.soft,borderRadius:8,fontSize:12},children:["Will be reachable at:",e.jsxs("div",{style:{fontFamily:"IBM Plex Mono, monospace",fontSize:15,color:r.orange,marginTop:4},children:["/",v.mode==="parent"?t.toLowerCase().replace(/\s+/g,"-")||"new-parent":`${v.parent}/${(t||"untitled").toLowerCase().replace(/\s+/g,"-")}`]})]})]}),l===3&&e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:14},children:[e.jsxs("div",{children:[e.jsx("label",{style:C,children:"Audience"}),e.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:6},children:[["team","My team"],["org","Whole org"],["execs","Executives only"],["external","External clients"]].map(([c,D])=>e.jsx("button",{onClick:()=>k(c),style:{padding:"6px 12px",borderRadius:8,border:`1.5px solid ${n===c?r.orange:r.line}`,background:n===c?r.cream:"transparent",color:n===c?r.orange:r.muted,fontSize:14,fontWeight:700,cursor:"pointer"},children:D},c))})]}),!z&&e.jsxs("div",{children:[e.jsx("label",{style:C,children:"Auto-refresh"}),e.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:6},children:[["off","Off"],["1m","1 min"],["5m","5 min"],["15m","15 min"],["live","Live stream"]].map(([c,D])=>e.jsx("button",{onClick:()=>I(c),style:{padding:"6px 12px",borderRadius:8,border:`1.5px solid ${S===c?r.orange:r.line}`,background:S===c?r.cream:"transparent",color:S===c?r.orange:r.muted,fontSize:14,fontWeight:700,cursor:"pointer"},children:D},c))})]}),e.jsxs("div",{style:{background:"#FAFAFA",border:`1px solid ${r.line}`,borderRadius:10,padding:"14px 16px"},children:[e.jsx("div",{style:{fontWeight:700,fontSize:15,color:r.muted,letterSpacing:"0.06em",textTransform:"uppercase",marginBottom:10},children:"Review"}),e.jsxs("div",{style:{display:"grid",gridTemplateColumns:"100px 1fr",gap:"8px 14px",fontSize:13},children:[e.jsx("div",{style:{color:r.muted},children:"Type"}),e.jsx("div",{children:e.jsx("b",{children:z?"Page":"Dashboard"})}),e.jsx("div",{style:{color:r.muted},children:"Title"}),e.jsx("div",{children:e.jsx("b",{children:t||"—"})}),e.jsx("div",{style:{color:r.muted},children:"Description"}),e.jsx("div",{children:i||e.jsx("i",{style:{color:r.muted},children:"(none)"})}),e.jsx("div",{style:{color:r.muted},children:"Navigation"}),e.jsx("div",{children:v.mode==="parent"?e.jsx("span",{children:"New top-level parent"}):e.jsxs("span",{children:["Under ",e.jsx("b",{children:v.parentLabel})]})}),e.jsx("div",{style:{color:r.muted},children:"Audience"}),e.jsx("div",{children:n}),!z&&e.jsxs(e.Fragment,{children:[e.jsx("div",{style:{color:r.muted},children:"Refresh"}),e.jsx("div",{children:S})]})]})]})]})]}),e.jsxs("div",{style:{padding:"14px 22px",borderTop:`1px solid ${r.line}`,display:"flex",alignItems:"center",justifyContent:"space-between"},children:[e.jsxs("div",{style:{fontSize:14,color:r.muted},children:["Step ",l," of 3"]}),e.jsxs("div",{style:{display:"flex",gap:8},children:[l>1&&e.jsx("button",{onClick:()=>y(c=>c-1),style:{padding:"8px 16px",fontSize:15,fontWeight:700,color:r.muted,border:`1px solid ${r.line}`,borderRadius:8,background:"transparent",cursor:"pointer"},children:"Back"}),e.jsx("button",{onClick:d,style:{padding:"8px 16px",fontSize:15,fontWeight:700,color:r.muted,border:`1px solid ${r.line}`,borderRadius:8,background:"transparent",cursor:"pointer"},children:"Cancel"}),l<3?e.jsxs("button",{onClick:()=>y(c=>c+1),disabled:A,style:{display:"flex",alignItems:"center",gap:6,padding:"8px 20px",fontSize:15,fontWeight:700,color:"#fff",background:A?"#CCC":r.orange,border:"none",borderRadius:8,cursor:A?"not-allowed":"pointer",opacity:A?.6:1},children:["Continue ",e.jsx(u,{name:"arrowRight",size:14,stroke:2.2})]}):e.jsxs("button",{onClick:()=>h({kind:s,title:t.trim(),desc:i.trim(),nav:v,icon:p,refresh:S,audience:n,slots:[]}),style:{display:"flex",alignItems:"center",gap:6,padding:"8px 20px",fontSize:15,fontWeight:700,color:"#fff",background:r.orange,border:"none",borderRadius:8,cursor:"pointer"},children:["Create ",z?"page":"dashboard"]})]})]})]})})},me=()=>{const s=ie(),d=ne(),h=s.state,[l,y]=g.useState(h!=null&&h.openBuilder?"builder":"home"),[t,o]=g.useState((h==null?void 0:h.artifact)??null),[i,a]=g.useState(h!=null&&h.openCreate?"page":null);g.useEffect(()=>{(h!=null&&h.openCreate||h!=null&&h.openBuilder)&&d(s.pathname,{replace:!0,state:{}})},[]);const p=()=>a("page");return e.jsxs("div",{style:{fontFamily:"Lato, sans-serif",height:"100%",display:"flex",flexDirection:"column",overflow:"hidden",background:"#FAFAFA"},children:[e.jsx("div",{style:{flex:1,overflow:"hidden",display:"flex",flexDirection:"column"},children:l==="home"?e.jsx("div",{style:{flex:1,overflowY:"auto"},children:e.jsx(fe,{onBuild:p})}):t?e.jsx(xe,{artifact:t,onBack:()=>y("home"),onSave:f=>o(f)}):null}),i&&e.jsx(ye,{kind:i,onClose:()=>a(null),onCreate:f=>{o(f),a(null),y("builder")}})]})},ve=me;export{ve as default};
@@ -1 +0,0 @@
1
- import{_ as c}from"./vendor-pdf-b2a5d8b1.js";import{j as s}from"./vendor-mui-69397583.js";import{r as a,f as x,u}from"./vendor-react-ece1c85f.js";import{T as l}from"./index-36228db5.js";import{c9 as b,c_ as h,c$ as j}from"./index-c62ac197.js";import{A as g}from"./AdaptableCard-df7695d6.js";import"./useControllableState-d0909575.js";import"./vendor-redux-a1f00e6b.js";import"./vendor-devex-33a39e11.js";import"./vendor-i18n-2fcb1983.js";import"./vendor-msal-9caa1ed1.js";import"./vendor-charts-eccea5d1.js";const _=a.lazy(()=>c(()=>import("./Profile-9104808b.js"),["assets/Profile-9104808b.js","assets/vendor-mui-69397583.js","assets/vendor-react-ece1c85f.js","assets/index-c62ac197.js","assets/vendor-redux-a1f00e6b.js","assets/vendor-pdf-b2a5d8b1.js","assets/vendor-devex-33a39e11.js","assets/vendor-i18n-2fcb1983.js","assets/vendor-msal-9caa1ed1.js","assets/vendor-charts-eccea5d1.js","assets/index-8c229076.css","assets/Upload-fb34ce03.js","assets/Switcher-c8648037.js","assets/FormContainer-91c2b0e4.js","assets/index-51ee35f9.js","assets/PreferenceService-75bf9db6.js","assets/index.esm-70ab539c.js","assets/index-0ec48d3d.js"])),v=a.lazy(()=>c(()=>import("./Password-d9294711.js"),["assets/Password-d9294711.js","assets/vendor-mui-69397583.js","assets/vendor-react-ece1c85f.js","assets/PasswordInput-8619a9df.js","assets/index-c62ac197.js","assets/vendor-redux-a1f00e6b.js","assets/vendor-pdf-b2a5d8b1.js","assets/vendor-devex-33a39e11.js","assets/vendor-i18n-2fcb1983.js","assets/vendor-msal-9caa1ed1.js","assets/vendor-charts-eccea5d1.js","assets/index-8c229076.css","assets/index-42e65911.js","assets/FormContainer-91c2b0e4.js","assets/index-51ee35f9.js","assets/PreferenceService-75bf9db6.js","assets/index.esm-70ab539c.js","assets/strongPassword-bbec776a.js"])),{TabNav:P,TabList:T}=l,r={profile:{label:"Profile",path:"profile",icon:s.jsx(h,{})},password:{label:"Password",path:"password",icon:s.jsx(j,{})}},y=()=>{const[e,i]=a.useState("profile"),[o,E]=a.useState({}),p=x(),n=u(),m=n.pathname.substring(n.pathname.lastIndexOf("/")+1),d=t=>{i(t),p(`/app/account/settings/${t}`)},f=async()=>{};return a.useEffect(()=>{i(m),b(o)&&f()},[]),s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"topbar py-4 px-6 border-gray-200 border-b",children:s.jsx("div",{className:"lg:flex items-center justify-between",children:s.jsx("h3",{className:"mb-4 lg:mb-0",children:"Profile"})})}),s.jsxs(g,{className:"m-4 p-4",children:[s.jsx(l,{value:e,onChange:t=>d(t),children:s.jsx(T,{children:Object.keys(r).map(t=>s.jsx(P,{value:t,icon:r[t].icon,children:r[t].label},t))})}),s.jsx("div",{className:"px-4 py-6",children:s.jsxs(a.Suspense,{fallback:s.jsx(s.Fragment,{}),children:[e==="profile"&&s.jsx(_,{data:o.profile}),e==="password"&&s.jsx(v,{data:o.loginHistory})]})})]})]})},F=y;export{F as default};
@@ -1 +0,0 @@
1
- import{R as r}from"./RoleNew-49fadb16.js";import"./vendor-mui-69397583.js";import"./vendor-react-ece1c85f.js";import"./RoleForm-cc251eba.js";import"./FormContainer-91c2b0e4.js";import"./index-c62ac197.js";import"./vendor-redux-a1f00e6b.js";import"./vendor-pdf-b2a5d8b1.js";import"./vendor-devex-33a39e11.js";import"./vendor-i18n-2fcb1983.js";import"./vendor-msal-9caa1ed1.js";import"./vendor-charts-eccea5d1.js";import"./index-36ba4ea7.js";import"./useControllableState-d0909575.js";import"./useDidUpdate-25c4d4ed.js";import"./StickyFooter-5b934274.js";import"./ConfirmDialog-3202eb3d.js";import"./index.esm-70ab539c.js";import"./AdaptableCard-df7695d6.js";import"./index-e4c6057f.js";import"./validationPatterns-77446c46.js";import"./RoleService-7008da2c.js";export{r as default};
@@ -1 +0,0 @@
1
- import{j as e}from"./vendor-mui-69397583.js";import{u as f,I as x,B as j,h as v}from"./index-c62ac197.js";import{F,a as C}from"./FormContainer-91c2b0e4.js";import{A as b}from"./Alert-7dfbd254.js";import{u as g}from"./useTimeOutMessage-e4eaa9f2.js";import{c as w,a as A,F as y,b as T,d as k}from"./index.esm-70ab539c.js";import{Q as S}from"./index-0ec48d3d.js";import"./vendor-react-ece1c85f.js";import"./vendor-redux-a1f00e6b.js";import"./vendor-pdf-b2a5d8b1.js";import"./vendor-devex-33a39e11.js";import"./vendor-i18n-2fcb1983.js";import"./vendor-msal-9caa1ed1.js";import"./vendor-charts-eccea5d1.js";const M=w().shape({verificationCode:A().required("Please enter verification code")}),N=r=>{const{disableSubmit:s=!1,className:m,tempToken:n,email:c}=r,{verifyTwoFactor:d}=f(),[l,p]=g(),u=async(t,o)=>{const{verificationCode:a}=t,h={verificationCode:a,userName:c,tempToken:n};o(!0);const i=await d(h);(i==null?void 0:i.status)==="failed"&&p(i.message),o(!1)};return e.jsxs("div",{className:m,children:[l&&e.jsx(b,{showIcon:!0,className:"mb-4",type:"danger",children:l}),e.jsx(y,{initialValues:{verificationCode:""},validationSchema:M,onSubmit:(t,{setSubmitting:o})=>{s?o(!1):u(t,o)},children:({touched:t,errors:o,isSubmitting:a})=>e.jsx(T,{children:e.jsxs(F,{children:[e.jsx(C,{label:"Verification Code",invalid:o.verificationCode&&t.verificationCode,errorMessage:o.verificationCode,children:e.jsx(k,{type:"text",autoComplete:"off",name:"verificationCode",placeholder:"Verification Code",component:x})}),e.jsx(j,{block:!0,loading:a,variant:"solid",type:"submit",children:a?"Verifying...":"Submit"})]})})})]})},V=()=>{const{authenticatorUrl:r,email:s}=v(c=>c.auth.user),n=new URLSearchParams(document.location.search).get("tempToken")??"";return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"mb-8",children:[e.jsx("h3",{className:"mb-1",children:"Enter Authentication Code"}),e.jsx("p",{children:"Check your authenticator app for the 6-digit code and enter it below:"}),e.jsx("p",{children:"For added security, consider using an authenticator app like Google or Microsoft Authenticator."}),e.jsx("p",{children:"Don't have an authenticator app? Download one from the App Store or Google Play."}),e.jsx("br",{}),e.jsx(S,{value:r||""})]}),e.jsx(N,{disableSubmit:!1,tempToken:n,email:s??""})]})},H=V;export{H as default};
@@ -1 +0,0 @@
1
- import{j as e,l as G}from"./vendor-mui-69397583.js";import{u as h,t as v,g as L,s as p,a as K,r as P}from"./index-77e820d0.js";import{l as C,O as Q,Q as W,I as J,cJ as Z,B as F,Z as H,Y as U,V as X}from"./index-c62ac197.js";import{A}from"./AdaptableCard-df7695d6.js";import{r as d,f as _}from"./vendor-react-ece1c85f.js";import"./Alert-7dfbd254.js";import"./index-6b6d0f06.js";import{a as ee,C as E}from"./index-c2088808.js";import{D as N}from"./Drawer-949c18c6.js";import{F as te,a as O}from"./FormContainer-91c2b0e4.js";import"./Switcher-c8648037.js";import"./index-36228db5.js";import"./Upload-fb34ce03.js";import{R as ae}from"./RoleNew-49fadb16.js";import{C as se}from"./ConfirmDialog-3202eb3d.js";import{d as le,R as oe}from"./RoleEdit-98a6410b.js";import{A as re,T as k}from"./actioncell-17e12e21.js";import{F as ie,b as ne,d as I}from"./index.esm-70ab539c.js";import{C as ce}from"./tableV3-3d2f4952.js";import"./vendor-redux-a1f00e6b.js";import"./RoleService-7008da2c.js";import"./vendor-pdf-b2a5d8b1.js";import"./vendor-devex-33a39e11.js";import"./vendor-i18n-2fcb1983.js";import"./vendor-msal-9caa1ed1.js";import"./vendor-charts-eccea5d1.js";import"./useControllableState-d0909575.js";import"./useDidUpdate-25c4d4ed.js";import"./RoleForm-cc251eba.js";import"./index-36ba4ea7.js";import"./StickyFooter-5b934274.js";import"./index-e4c6057f.js";import"./validationPatterns-77446c46.js";import"./DoubleSidedImage-ae98733b.js";import"./FileSaver.min-20f3f13a.js";import"./mapView-ab35acaa.js";import"./esm-f306d015.js";import"./lodash-306e3f66.js";import"./DensitySelector-a2c1c68f.js";import"./NoData-8c485a3a.js";const de=()=>{const a=C(),m=h(r=>r.roleList.data.deleteConfirmation),f=h(r=>r.roleList.data.selectedRole),n=h(r=>r.roleList.data.tableData),x=()=>{a(v(!1))},s=async()=>{a(v(!1)),await le(f)&&(a(L(n)),Q.push(e.jsx(W,{title:"Deleted",type:"success",duration:2500,children:"Role Successfully Deleted"}),{placement:"top-center"}))};return e.jsx(se,{isOpen:m,type:"danger",title:"Delete Role",confirmButtonColor:"red-600",onClose:x,onRequestClose:x,onCancel:x,onConfirm:s,children:e.jsx("p",{children:"Are you sure you want to delete this role? All records related to this role will be deleted as well. This action cannot be undone."})})},{DatePickerRange:me}=ee,T=d.forwardRef(({onSubmitComplete:a},m)=>{const f=C(),n=h(l=>l.roleList.data.filterData),[x,s]=d.useState(n.dateRange),r=l=>{a==null||a(),f(p(l))},i=l=>{s(l)};return e.jsx(ie,{enableReinitialize:!0,innerRef:m,initialValues:{...n},onSubmit:l=>{r(l)},children:({values:l,touched:R,errors:D})=>e.jsx(ne,{children:e.jsxs(te,{children:[e.jsxs(O,{invalid:D.searchText&&R.searchText,errorMessage:D.searchText,children:[e.jsx("h6",{className:"mb-4",children:"Included text"}),e.jsx(I,{type:"text",autoComplete:"off",name:"searchText",placeholder:"Keyword",component:J,prefix:e.jsx(Z,{className:"text-lg"})})]}),e.jsxs(O,{errorMessage:D.dateRange,children:[e.jsx("h6",{className:"mb-4",children:"Filter By Date Range"}),e.jsx(I,{name:"dateRange",children:({field:g,form:u})=>e.jsx(e.Fragment,{children:e.jsx(me,{field:g,name:"dateRange",value:x,form:u,placeholder:"Select dates range",onChange:c=>{c[0]&&u.setFieldValue("fromDate",c[0].toDateString()),c[1]&&u.setFieldValue("toDate",c[1].toDateString()),u.setFieldValue("dateRange",c),i(c)}})})})]})]})})})}),fe=({onSaveClick:a,onCancel:m,onClearFilers:f})=>e.jsxs("div",{className:"text-right w-full",children:[e.jsx(F,{size:"sm",className:"mr-2",onClick:f,children:"Clear All"}),e.jsx(F,{size:"sm",className:"mr-2",onClick:m,children:"Cancel"}),e.jsx(F,{size:"sm",variant:"solid",onClick:a,children:"Query"})]}),ue=a=>{const m=d.useRef(null),[f,n]=d.useState(!1);h(l=>l.roleList.data.filterData);const x=C(),s=()=>{n(!1),a.onClose()},r=()=>{x(p({searchText:"",fromDate:"",toDate:"",dateRange:[null,null]})),n(!1),a.onClose()},i=()=>{var l;(l=m.current)==null||l.submitForm()};return d.useEffect(()=>{a.isOpen&&n(!0)},[a.isOpen]),e.jsx(e.Fragment,{children:e.jsx(N,{title:"Filter",isOpen:f,footer:e.jsx(fe,{onCancel:s,onSaveClick:i,onClearFilers:r}),onClose:s,onRequestClose:s,children:e.jsx(T,{ref:m,onSubmitComplete:s})})})};T.displayName="RoleFilterForm";const xe=a=>{const m=d.useRef(null);_();const[f,n]=d.useState(!1),[x,s]=d.useState(""),[r,i]=d.useState(!1),l=t=>{n(!0)},R=t=>{n(!1)},D=C(),{pageIndex:g,pageSize:u,sort:c,query:o,total:j}=h(t=>t.roleList.data.tableData),b=h(t=>t.roleList.data.filterData),w=h(t=>t.roleList.data.loading),B=h(t=>t.roleList.data.roleList);d.useEffect(()=>{y()},[g,u,c,a.isRefetch,b]),d.useEffect(()=>{var t;m&&((t=m.current)==null||t.resetSorting())},[b]),d.useMemo(()=>({pageIndex:g,pageSize:u,sort:c,query:o,total:j}),[g,u,c,o,j]);const y=()=>{const t=L({pageIndex:g,pageSize:u,sort:c,query:o,filterData:b});D(t)},M=[...a!=null&&a.isEdit||a!=null&&a.isDelete?[{dataField:"Action",caption:"Action",allowSorting:!1,allowFiltering:!1,allowSearch:!1,cellRender:t=>e.jsx("div",{id:"mAction","data-cname":"Action",children:e.jsx(re,{row:t==null?void 0:t.data,actions:q,buttonClick:V})})}]:[],{dataField:"name",caption:"Role Name",cellRender:t=>e.jsx("div",{"data-cname":"Role Name",children:t.data.name})},{dataField:"description",caption:"Role Description",cellRender:t=>e.jsx("div",{"data-cname":"Role Description",children:t.data.description})},{dataField:"createdByName",caption:"Created By",cellRender:t=>e.jsx("div",{"data-cname":"Created By",children:t.data.createdByName})},{dataField:"createdDate",caption:"Created On",cellRender:t=>e.jsx("div",{"data-cname":"Created On",children:t.data.createdDate?H(t.data.createdDate).format("MM/DD/YYYY"):""})}],V=(t,S)=>{S===k.edit&&z(t),S===k.delete&&Y(t)},z=t=>{s(`${t.id}`),l()},Y=t=>{D(v(!0)),D(K(t.id))},q={edit:a==null?void 0:a.isEdit,delete:a==null?void 0:a.isDelete,view:!1},$=()=>{i(!1)};return e.jsxs(e.Fragment,{children:[w&&e.jsx(G,{sx:{backgroundColor:"rgba(0, 0, 0, 0.1)","& .MuiLinearProgress-bar":{backgroundColor:"var(--custom-600)"}}}),e.jsx(ce,{tableName:"RolesList",dataSource:B,columns:M,height:"calc(100vh - 280px)",keyExpr:"$id",stateStorageKey:"Role-table",isLoading:w}),e.jsx(N,{title:"Edit Role",isOpen:f,onClose:R,portalClassName:"w30 prevent-overflow",children:e.jsx(oe,{footerWidth:"w30",roleId:x,onDrawerClose:R,fetchData:y})}),e.jsx(ue,{isOpen:r,onClose:$}),e.jsx(de,{})]})};U("roleList",P);const he=()=>{var c;const a="Roles",[m,f]=d.useState(!1),[n,x]=d.useState(!1),s=h(o=>o.roleList.data.filterData),r=h(o=>{var j;return((j=o.auth.session)==null?void 0:j.permission)||[]}),i=((c=r==null?void 0:r.filter(o=>(o==null?void 0:o.defaultMenuName)===a))==null?void 0:c[0])||{isDelete:!1,isEdit:!1,isManage:!1,isView:!1},l=C(),R=()=>{f(!0)},D=o=>{f(!1)},g=o=>{f(!1),x(!n)},u=o=>{o==="search"&&l(p({...s,searchText:""})),o==="role"&&l(p({...s,role:void 0})),o==="date"&&l(p({...s,fromDate:"",toDate:"",dateRange:[null,null]}))};return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"topbar py-4 px-6 border-gray-200 border-b",children:e.jsxs("div",{className:"lg:flex items-center justify-between",children:[e.jsx("h3",{className:"mb-4 lg:mb-0",children:"Roles"}),(i==null?void 0:i.isEdit)&&e.jsxs("div",{className:"flex flex-col lg:flex-row lg:items-center",children:[e.jsx(F,{block:!0,variant:"solid",size:"sm",icon:e.jsx(X,{}),onClick:()=>R(),children:"Add Role"}),e.jsx(N,{title:"Add Role",isOpen:m,onClose:D,portalClassName:"w30 prevent-overflow",children:e.jsx(ae,{footerWidth:"w30",onDrawerClose:D,onAddNew:g})})]})]})}),e.jsxs(A,{className:"m-6 h-full py-4 px-6 bg-transparent",bodyClass:"h-full",children:[e.jsxs("div",{className:"text-right mb-3 ",children:[s.searchText!=""&&e.jsx(E,{title:"Search By",value:s.searchText,tagId:"search",onRemovefilter:u}),s.fromDate!=""&&s.toDate!=""&&e.jsx(E,{title:"DateRange",value:s.fromDate+"-"+s.toDate,tagId:"date",onRemovefilter:u})]}),e.jsx(A,{className:"borderless",children:e.jsx(xe,{isRefetch:n,isEdit:i==null?void 0:i.isEdit,isDelete:i==null?void 0:i.isDelete})})]})]})},at=he;export{at as default};
@@ -1 +0,0 @@
1
- import{D as i}from"./ReportViewer-9f1080f7.js";import{A,R as D,E as h,M as k,P as q,a as w,b as z,S as B,c as C,T as I,e as O,d as V}from"./ReportViewer-9f1080f7.js";import"./vendor-mui-69397583.js";import"./vendor-react-ece1c85f.js";import"./vendor-pdf-b2a5d8b1.js";import"./index-c62ac197.js";import"./vendor-redux-a1f00e6b.js";import"./vendor-devex-33a39e11.js";import"./vendor-i18n-2fcb1983.js";import"./vendor-msal-9caa1ed1.js";import"./vendor-charts-eccea5d1.js";import"./AdaptableCard-df7695d6.js";import"./Alert-7dfbd254.js";import"./index-6b6d0f06.js";import"./useControllableState-d0909575.js";import"./index-c2088808.js";import"./useDidUpdate-25c4d4ed.js";import"./Drawer-949c18c6.js";import"./FormContainer-91c2b0e4.js";import"./Switcher-c8648037.js";import"./index-36228db5.js";import"./Upload-fb34ce03.js";export{A as AISettings,D as Callbacks,i as DxReportViewer,h as ExportSettings,k as MobileModeSettings,q as ProgressBarSettings,w as RemoteSettings,z as RequestOptions,B as SearchSettings,C as SummarizationSettings,I as TabPanelSettings,O as TemplateEngine,V as TranslationSettings,i as default};
@@ -1 +0,0 @@
1
- import{v as je,j as e,U as Ue,R as Re,V as te,W as Fe,X as d,I as ae,Y as ie,Z as Q,$ as fe}from"./vendor-mui-69397583.js";import{b as we,c as ze,a as Be}from"./vendor-redux-a1f00e6b.js";import{b as Ce,o as We,ds as Ke,F as He,l as Z,O as Ee,Q as De,a1 as Ye,S,Y as qe,B as Me,dt as Qe}from"./index-c62ac197.js";import{s as Xe}from"./ClassicLayout-7d09e5ac.js";import{A as Ze}from"./AdaptableCard-df7695d6.js";import{r as x,c as ge}from"./vendor-react-ece1c85f.js";import{A as se,T as xe}from"./actioncell-17e12e21.js";import"./Alert-7dfbd254.js";import"./index-6b6d0f06.js";import"./index-c2088808.js";import{D as ye}from"./Drawer-949c18c6.js";import"./FormContainer-91c2b0e4.js";import"./Switcher-c8648037.js";import"./index-36228db5.js";import"./Upload-fb34ce03.js";import{d as _e,M as Je,a as Ie}from"./MenuEdit-d6e0d64c.js";import{C as es}from"./ConfirmDialog-3202eb3d.js";import{a as ss}from"./RoleService-7008da2c.js";import"./vendor-pdf-b2a5d8b1.js";import"./vendor-devex-33a39e11.js";import"./vendor-i18n-2fcb1983.js";import"./vendor-msal-9caa1ed1.js";import"./vendor-charts-eccea5d1.js";import"./SidePanelContent-6b13836f.js";import"./index-ec2010d2.js";import"./DoubleSidedImage-ae98733b.js";import"./Logo-3f3c9ee6.js";import"./index-aaad94c2.js";import"./index-e4c6057f.js";import"./index-f6be0390.js";import"./index-ea125a16.js";import"./Views-74429e81.js";import"./useControllableState-d0909575.js";import"./useDidUpdate-25c4d4ed.js";import"./index-cbc29fa8.js";import"./DynamicTablesService-963fe77b.js";import"./index-36ba4ea7.js";import"./StickyFooter-5b934274.js";import"./index.esm-70ab539c.js";import"./validationPatterns-77446c46.js";import"./index-8ab45286.js";import"./lodash-306e3f66.js";const ne=je(e.jsx("path",{d:"M13 7h-2v4H7v2h4v4h2v-4h4v-2h-4zm-1-5C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8"}),"AddCircleOutlineOutlined"),le=je(e.jsx("path",{d:"M7 11v2h10v-2zm5-9C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8"}),"RemoveCircleOutlineOutlined"),de="permissionList",X=we(de+"/getPermissions",async n=>{const s=await Ce(n.roleId,n.portalName);return{data:s.data.$values,total:s.data.$values.length}}),ce=we(de+"/getMenus",async()=>{const n=await We();return{data:n.data.$values,total:n.data.$values.length}}),ts=async n=>(await Ke(n)).data,as={loading:!1,permissionList:[],menuList:[],deleteConfirmation:!1,selectedMenu:""},be=ze({name:`${de}/state`,initialState:as,reducers:{updatePermissionListMenu:(n,s)=>{n.permissionList=s.payload},toggleDeleteConfirmation:(n,s)=>{n.deleteConfirmation=s.payload},setSelectedMenu:(n,s)=>{n.selectedMenu=s.payload}},extraReducers:n=>{n.addCase(X.fulfilled,(s,a)=>{var f;s.permissionList=Xe(((f=a==null?void 0:a.payload)==null?void 0:f.data)??[]),s.loading=!1}).addCase(ce.fulfilled,(s,a)=>{s.menuList=a.payload.data??[],s.loading=!1}).addCase(X.pending,s=>{s.loading=!0})}}),{updatePermissionListMenu:is,toggleDeleteConfirmation:oe,setSelectedMenu:ns}=be.actions,ls=be.reducer,os=Be({data:ls}),L=He,rs=n=>{const{ondeleteSuccess:s}=n,a=Z(),f=L(b=>b.permissionList.data.deleteConfirmation),E=L(b=>b.permissionList.data.selectedMenu);L(b=>b.permissionList.data.menuList);const M=()=>{a(oe(!1))},r=async()=>{a(oe(!1)),await _e(E)&&(a(ce()),s(),Ee.push(e.jsx(De,{title:"Deleted",type:"success",duration:2500,children:"Menu Successfully Deleted"}),{placement:"top-center"}))};return e.jsx(es,{isOpen:f,type:"danger",title:"Delete Menu",confirmButtonColor:"red-600",onClose:M,onRequestClose:M,onCancel:M,onConfirm:r,children:e.jsx("p",{children:"Are you sure you want to delete this menu? All records related to this menu will be deleted as well. This action cannot be undone."})})},ve=n=>{const s=[];return n.forEach(a=>{var f,E;s.push({id:a.id,menuName:a.menuName,isView:a.isView,isEdit:a.isEdit,isDelete:a.isDelete,isManage:a.isManage,defaultMenuName:a.menuName}),(E=(f=a.childMenus)==null?void 0:f.$values)!=null&&E.length&&s.push(...ve(a.childMenus.$values))}),s},Pe=(n,s,a)=>{var E,M;const f=s;for(const r of n){if(r.menuName===f)switch(a){case"VIEW":return!!r.isView;case"EDIT":return!!r.isEdit;case"DELETE":return!!r.isDelete;case"MANAGE":return!!r.isManage;default:return!1}if((M=(E=r.childMenus)==null?void 0:E.$values)!=null&&M.length&&Pe(r.childMenus.$values,s,a))return!0}return!1},re=(n,s)=>{var f,E;const a=s;for(const M of n){if(M.menuName===a)return M;if((E=(f=M.childMenus)==null?void 0:f.$values)!=null&&E.length){const r=re(M.childMenus.$values,s);if(r)return r}}return null},$=(n,s,a)=>n!=null&&n.length?Pe(n,s,a):!1,Ne=n=>{if(!(n!=null&&n.length))return{canUpdatePermissions:!1,canAddMenu:!1};const s=re(n,"Permissions"),a=re(n,"Menus");return{canUpdatePermissions:!!(s!=null&&s.isEdit),canAddMenu:!!(a!=null&&a.isEdit)}},ds=n=>{const{handleMenuUpdateSuccess:s}=n,a=Z(),[f,E]=x.useState(!1),M=L(o=>o.permissionList.data.permissionList),[r,b]=x.useState([]);x.useEffect(()=>{const h=[...M].map(i=>({...i,isOpen:f}));b(h)},[M]);const T=()=>{const h=[...r].map(i=>({...i,isOpen:!f}));E(!f),b(h)},R=(o,h,i,w)=>{const m=[...r],y={...m[h]};w!==void 0&&typeof w=="object"?O(y,m,o,h,i,w.child,w.grand):w!==void 0&&y.childMenus?W(y,m,o,h,i,w):F(y,m,o,h,i)},W=(o,h,i,w,m,y)=>{const D=[...o.childMenus.$values],p={...D[y]};if(!(p.childMenus&&Array.isArray(p.childMenus.$values))){p[m]=i,m==="isManage"&&(p.isView=i,p.isEdit=i,p.isDelete=i),D[y]=p,V(h,{...o,childMenus:{...o.childMenus,$values:D}},w);return}let v=p.childMenus.$values.map(u=>({...u,[m]:i}));m==="isManage"&&(v=v.map(u=>({...u,isView:i,isEdit:i,isDelete:i})),p.isView=i,p.isEdit=i,p.isDelete=i);const t={...p,[m]:i,childMenus:{...p.childMenus,$values:v}};D[y]=t;const j={...o,childMenus:{...o.childMenus,$values:D}};V(h,j,w)},O=(o,h,i,w,m,y,D)=>{const p=[...o.childMenus.$values],g={...p[y]},v=[...g.childMenus.$values],t={...v[D]};t[m]=i,m==="isManage"&&(t.isView=i,t.isEdit=i,t.isDelete=i),v[D]=t,g.childMenus={...g.childMenus,$values:v},p[y]=g;const j={...o,childMenus:{...o.childMenus,$values:p}};V(h,j,w)},F=(o,h,i,w,m)=>{if(!(o.childMenus&&Array.isArray(o.childMenus.$values))){o[m]=i,m==="isManage"&&(o.isView=i,o.isEdit=i,o.isDelete=i),V(h,o,w);return}const D=o.childMenus.$values.map(g=>{const v=g.childMenus&&Array.isArray(g.childMenus.$values);let t=v?g.childMenus.$values.map(u=>({...u,[m]:i})):void 0;return m==="isManage"&&t&&(t=t.map(u=>({...u,isView:i,isEdit:i,isDelete:i}))),{...g,[m]:i,...m==="isManage"&&{isView:i,isEdit:i,isDelete:i},...v&&{childMenus:{...g.childMenus,$values:t}}}}),p={...o,[m]:i,...m==="isManage"&&{isView:i,isEdit:i,isDelete:i},childMenus:{...o.childMenus,$values:D}};V(h,p,w)},V=(o,h,i)=>{o[i]=h,b(o),a(is(o))},z=()=>{s()};return e.jsx("div",{id:"PermissionsTable",children:e.jsx(Ue,{sx:{minWidth:650},component:Re,className:"dark:bg-[#292f3c] dark:text-white",children:e.jsxs(te,{stickyHeader:!0,sx:{"& .MuiTableCell-head.MuiTableCell-sizeMedium":{"padding-left":"8px"},"& .MuiTableCell-sizeMedium":{"padding-left":"0"}},children:[e.jsx(Fe,{children:e.jsxs(Ye,{children:[e.jsx(d,{style:{width:"12%"},className:"dark:bg-[#1F2937] dark:text-white",children:e.jsx(ae,{"aria-label":"expand row",size:"small",onClick:T,children:f?e.jsx(le,{className:"dark:bg-[#292f3c] dark:text-white"}):e.jsx(ne,{className:"dark:bg-[#292f3c] dark:text-white"})})}),e.jsx(d,{style:{width:"52%"},className:"dark:bg-[#1F2937] dark:text-white",children:"Permission Name"}),e.jsx(d,{style:{width:"12%"},className:"dark:bg-[#1F2937] dark:text-white",children:"Manage"}),e.jsx(d,{style:{width:"12%"},className:"dark:bg-[#1F2937] dark:text-white",children:"View"}),e.jsx(d,{style:{width:"12%"},className:"dark:bg-[#1F2937] dark:text-white",children:"Edit"}),e.jsx(d,{style:{width:"12%"},className:"dark:bg-[#1F2937] dark:text-white",children:"Delete"}),e.jsx(d,{style:{width:"12%"},className:"dark:bg-[#1F2937] dark:text-white",children:"Action"})]})}),e.jsx(ie,{children:r.map((o,h)=>e.jsx(cs,{handlePermissionChange:R,rows:o,index:h,isOpen:o.isOpen,handleUpdateSuccess:z},h))})]})})})},cs=n=>{var me;const{rows:s,index:a,handlePermissionChange:f,isOpen:E,handleUpdateSuccess:M}=n,r=L(l=>{var c;return(c=l.auth.session)==null?void 0:c.permission}),[b,T]=x.useState(!1),[R,W]=x.useState(),[O,F]=x.useState(!1),V=L(l=>l.permissionList.data.menuList),z=Z(),[o,h]=x.useState(!1),[i,w]=x.useState({canManage:!1,canView:!1,canEdit:!1,canDelete:!1}),[m,y]=x.useState({}),[D,p]=x.useState({}),g=l=>(l==null?void 0:l.trim())||"";x.useEffect(()=>{F(E)},[E]),x.useEffect(()=>{var Y;const l=Ne(r);h(l);const c=$(r,s.menuName,"MANAGE"),P=$(r,s.menuName,"VIEW"),G=$(r,s.menuName,"EDIT"),U=$(r,s.menuName,"DELETE");w({canManage:c,canView:P,canEdit:G,canDelete:U});const H={},B={};(Y=s.childMenus)!=null&&Y.$values&&s.childMenus.$values.forEach(C=>{var pe;const A=g(C.menuName),k=$(r,A,"MANAGE"),ee=$(r,A,"VIEW"),ke=$(r,A,"EDIT"),Oe=$(r,A,"DELETE");H[A]={canManage:k,canView:ee,canEdit:ke,canDelete:Oe},(pe=C.childMenus)!=null&&pe.$values&&(B[C.menuName]={},C.childMenus.$values.forEach(Te=>{const Ge=g(C.menuName),q=g(Te.menuName);B[Ge][q]={canManage:$(r,q,"MANAGE"),canView:$(r,q,"VIEW"),canEdit:$(r,q,"EDIT"),canDelete:$(r,q,"DELETE")}}))}),y(H),p(B)},[s.menuName,(me=s.childMenus)==null?void 0:me.$values,r]);const v=(l,c)=>{var U;const P=g(l),G=g(c);return((U=D==null?void 0:D[P])==null?void 0:U[G])||{canManage:!1,canView:!1,canEdit:!1,canDelete:!1}},t=()=>o?{canManage:!0,canView:!0,canEdit:!0,canDelete:!0}:{canManage:!1,canView:!1,canEdit:!1,canDelete:!1},j=l=>o?{canManage:!0,canView:!0,canEdit:!0,canDelete:!0}:{canManage:!1,canView:!1,canEdit:!1,canDelete:!1},u=t(),_={edit:u.canEdit,delete:u.canDelete,view:!1},K=(l,c)=>{c===xe.edit&&ue(l),c===xe.delete&&Se(l)},ue=l=>{const c=V.find(P=>P.id==l.id);W(c),J()},J=l=>{T(!0)},I=()=>{T(!1)},Se=l=>{z(oe(!0)),z(ns(l.id))},$e=()=>{I(),M()},Ve=()=>{M()},N=(l,c,P,G)=>{f(!l,c,P,G)},[he,Ae]=x.useState({}),Le=l=>{Ae(c=>({...c,[l]:!c[l]}))};return e.jsxs(ge.Fragment,{children:[e.jsxs(Q,{sx:{"& > *":{borderBottom:"unset"}},children:[e.jsx(d,{style:{width:"12%"},children:s.childMenus.$values.length>0&&e.jsx(ae,{"aria-label":"expand row",size:"small",onClick:()=>F(!O),children:O?e.jsx(le,{className:"dark:bg-[#292f3c] dark:text-white"}):e.jsx(ne,{className:"dark:bg-[#292f3c] dark:text-white"})})}),e.jsx(d,{style:{width:"52%"},children:e.jsx("b",{children:s.menuName})}),e.jsx(d,{style:{width:"12%"},children:e.jsx(S,{checked:s.isManage,disabled:!u.canManage,inputProps:{"aria-label":"controlled"},onChange:()=>N(s.isManage,a,"isManage")})}),e.jsx(d,{style:{width:"12%"},children:e.jsx(S,{checked:s.isView,disabled:!u.canView,inputProps:{"aria-label":"controlled"},onChange:()=>N(s.isView,a,"isView")})}),e.jsx(d,{style:{width:"12%"},children:e.jsx(S,{checked:s.isEdit,disabled:!u.canEdit,inputProps:{"aria-label":"controlled"},onChange:()=>N(s.isEdit,a,"isEdit")})}),e.jsx(d,{style:{width:"12%"},children:e.jsx(S,{checked:s.isDelete,disabled:!u.canDelete,inputProps:{"aria-label":"controlled"},onChange:()=>N(s.isDelete,a,"isDelete")})}),e.jsx(d,{style:{width:"12%"},children:e.jsx(se,{row:s,actions:_,buttonClick:K})})]}),e.jsx(Q,{sx:{"&:last-child td, &:last-child th":{border:0}},style:{height:0},children:e.jsx(d,{colSpan:7,style:{padding:0},children:e.jsx(fe,{unmountOnExit:!0,in:O,timeout:"auto",children:e.jsx(te,{size:"small","aria-label":"purchases",children:e.jsx(ie,{children:s.childMenus.$values.map((l,c)=>{var U,H,B,Y;const P=j(l.menuName),G={edit:P.canEdit,delete:P.canDelete,view:!1};return e.jsxs(ge.Fragment,{children:[e.jsxs(Q,{children:[e.jsx(d,{style:{width:"12%"},children:((H=(U=l.childMenus)==null?void 0:U.$values)==null?void 0:H.length)>0&&e.jsx(ae,{size:"small",onClick:()=>Le(c),children:he[c]?e.jsx(le,{}):e.jsx(ne,{})})}),e.jsxs(d,{style:{width:"52%"},children:[e.jsx("b",{children:s.menuName})," | ",l.menuName]}),e.jsx(d,{style:{width:"12%"},children:e.jsx(S,{checked:l.isManage,disabled:!P.canManage,onChange:()=>N(l.isManage,a,"isManage",c)})}),e.jsx(d,{style:{width:"12%"},children:e.jsx(S,{checked:l.isView,disabled:!P.canView,onChange:()=>N(l.isView,a,"isView",c)})}),e.jsx(d,{style:{width:"12%"},children:e.jsx(S,{checked:l.isEdit,disabled:!P.canEdit,onChange:()=>N(l.isEdit,a,"isEdit",c)})}),e.jsx(d,{style:{width:"12%"},children:e.jsx(S,{checked:l.isDelete,disabled:!P.canDelete,onChange:()=>N(l.isDelete,a,"isDelete",c)})}),e.jsx(d,{style:{width:"12%"},children:e.jsx(se,{row:l,actions:G,buttonClick:K})})]}),((Y=(B=l.childMenus)==null?void 0:B.$values)==null?void 0:Y.length)>0&&e.jsx(Q,{children:e.jsx(d,{colSpan:7,style:{padding:0},children:e.jsx(fe,{unmountOnExit:!0,in:he[c],timeout:"auto",children:e.jsx(te,{size:"small",children:e.jsx(ie,{children:l.childMenus.$values.map((C,A)=>{const k=v(l.menuName,C.menuName),ee={edit:k.canEdit,delete:k.canDelete,view:k.canView};return e.jsxs(Q,{children:[e.jsx(d,{style:{width:"12%"}}),e.jsxs(d,{style:{width:"52%",paddingLeft:48},children:[e.jsx("b",{children:s.menuName})," | ",l.menuName," | ",C.menuName]}),e.jsx(d,{style:{width:"12%"},children:e.jsx(S,{checked:C.isManage,disabled:!k.canManage,onChange:()=>N(C.isManage,a,"isManage",{child:c,grand:A})})}),e.jsx(d,{style:{width:"12%"},children:e.jsx(S,{checked:C.isView,disabled:!k.canView,onChange:()=>N(C.isView,a,"isView",{child:c,grand:A})})}),e.jsx(d,{style:{width:"12%"},children:e.jsx(S,{checked:C.isEdit,disabled:!k.canEdit,onChange:()=>N(C.isEdit,a,"isEdit",{child:c,grand:A})})}),e.jsx(d,{style:{width:"12%"},children:e.jsx(S,{checked:C.isDelete,disabled:!k.canDelete,onChange:()=>N(C.isDelete,a,"isDelete",{child:c,grand:A})})}),e.jsx(d,{style:{width:"12%"},children:e.jsx(se,{row:C,actions:ee,buttonClick:K})})]},C.id)})})})})})})]},l.id)})})})})})}),e.jsx(ye,{title:"Edit Menu",isOpen:b,portalClassName:"w30",onClose:I,children:e.jsx(Je,{footerWidth:"w30",menuData:R,menuList:V,onDrawerClose:I,onUpdateSuccess:$e})}),e.jsx(rs,{ondeleteSuccess:Ve})]})};qe("permissionList",os);const us=()=>{const n=Z(),[s,a]=x.useState(!1),[f,E]=x.useState([]),[M,r]=x.useState(""),b=L(t=>t.permissionList.data.permissionList),T=L(t=>{var j;return(j=t.auth.session)==null?void 0:j.permission}),R=L(t=>{var j;return(j=t.auth.user)==null?void 0:j.roleId}),W=L(t=>t.permissionList.data.menuList);x.useState(!1);const[O,F]=x.useState({canUpdatePermissions:!1,canAddMenu:!1}),V=async()=>{if(R)try{const t=await Ce(R,"default");if(t!=null&&t.data){const j=ve(t.data.$values||[]);n(Qe(j))}}catch(t){console.error("Failed to refresh permissions:",t)}};x.useEffect(()=>{h(),o(),V()},[]),x.useEffect(()=>{z()},[T]);const z=()=>{const t=Ne(T);F(t)},o=()=>{const t=ce();n(t)},h=async()=>{const t=await ss({SearchByParam:"",SortBy:"",SortDirection:"",SearchByParamValue:"",SearchString:"",FromDate:"",ToDate:""});t.data&&(E(t.data.$values),i(t.data.$values[0].id))},i=t=>{r(t);const j=X({roleId:t,portalName:"default"});n(j)},w=()=>{const t=b.map(u=>{const _=u.childMenus&&u.childMenus.$values?u.childMenus.$values.map(K=>{const{$id:ue,...J}=K;return J}):[];return{isView:u.isView,isEdit:u.isEdit,isDelete:u.isDelete,isManage:u.isManage,id:u.id,menuName:u.menuName,childMenus:_}});ts({roleId:M,menus:t,portalName:"default"}).then(u=>{m("updated")}).catch(u=>{console.error("Error updating permission:",u)})},m=t=>{Ee.push(e.jsxs(De,{title:"Success",type:"success",duration:2500,children:["Permissions Menus ",t]}),{placement:"top-center"})},y=()=>{a(!0)},D=()=>{a(!1)},p=t=>{a(!1),o(),g()},g=()=>{const t=X({roleId:M,portalName:"default"});n(t)},v=()=>{g()};return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"topbar py-4 px-6 border-gray-200 border-b",children:e.jsxs("div",{className:"lg:flex items-center justify-between",children:[e.jsx("h3",{children:"Permissions"}),e.jsxs("div",{children:[e.jsx("select",{className:"p-2 text-sm text-gray-900 border border-gray-300 rounded-lg bg-gray-50 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500",onChange:t=>i(t.target.value),children:f&&f.map((t,j)=>e.jsx("option",{value:t.id,children:t.name},j))}),"  ",e.jsx(Me,{variant:"solid",size:"sm",className:"mr-2",onClick:()=>y(),disabled:!O.canAddMenu,children:"Add Menu"}),e.jsx(Me,{variant:"solid",size:"sm",onClick:()=>w(),disabled:!O.canUpdatePermissions,children:"Update Permission"}),e.jsx(ye,{title:"Add Menu",isOpen:s,onClose:D,portalClassName:"w30",children:e.jsx(Ie,{footerWidth:"w30",onDrawerClose:D,menuList:W,onAddNewSuccess:p})})]})]})}),e.jsx(Ze,{className:"m-6 h-full py-4 px-6 bg-transparent borderless",bodyClass:"h-full",children:e.jsx(ds,{handleMenuUpdateSuccess:v})})]})},et=us;export{et as default};
@@ -1 +0,0 @@
1
- import{j as e}from"./vendor-mui-69397583.js";import{r as a,c as T}from"./vendor-react-ece1c85f.js";import{t as _,u as O,I as $,S as U,B as z}from"./index-c62ac197.js";import{F as H,a as I}from"./FormContainer-91c2b0e4.js";import{A as q}from"./Alert-7dfbd254.js";import{P as D}from"./PasswordInput-8619a9df.js";import{A as N}from"./ActionLink-33e476e1.js";import{u as V}from"./useTimeOutMessage-e4eaa9f2.js";import{c as W,a as B,e as J,F as K,b as X,d as A}from"./index.esm-70ab539c.js";import{u as Q}from"./vendor-msal-9caa1ed1.js";import"./vendor-redux-a1f00e6b.js";import"./vendor-pdf-b2a5d8b1.js";import"./vendor-devex-33a39e11.js";import"./vendor-i18n-2fcb1983.js";import"./vendor-charts-eccea5d1.js";import"./index-42e65911.js";function Y(t={}){const{nonce:n,onScriptLoadSuccess:r,onScriptLoadError:i}=t,[d,c]=a.useState(!1),o=a.useRef(r);o.current=r;const h=a.useRef(i);return h.current=i,a.useEffect(()=>{const l=document.createElement("script");return l.src="https://accounts.google.com/gsi/client",l.async=!0,l.defer=!0,l.nonce=n,l.onload=()=>{var u;c(!0),(u=o.current)===null||u===void 0||u.call(o)},l.onerror=()=>{var u;c(!1),(u=h.current)===null||u===void 0||u.call(h)},document.body.appendChild(l),()=>{document.body.removeChild(l)}},[n]),d}const R=a.createContext(null);function Z({clientId:t,nonce:n,onScriptLoadSuccess:r,onScriptLoadError:i,children:d}){const c=Y({nonce:n,onScriptLoadSuccess:r,onScriptLoadError:i}),o=a.useMemo(()=>({clientId:t,scriptLoadedSuccessfully:c}),[t,c]);return T.createElement(R.Provider,{value:o},d)}function ee(){const t=a.useContext(R);if(!t)throw new Error("Google OAuth components must be used within GoogleOAuthProvider");return t}function te({flow:t="implicit",scope:n="",onSuccess:r,onError:i,onNonOAuthError:d,overrideScope:c,state:o,...h}){const{clientId:l,scriptLoadedSuccessfully:u}=ee(),v=a.useRef(),w=a.useRef(r);w.current=r;const y=a.useRef(i);y.current=i;const j=a.useRef(d);j.current=d,a.useEffect(()=>{var m,s;if(!u)return;const p=t==="implicit"?"initTokenClient":"initCodeClient",k=(s=(m=window==null?void 0:window.google)===null||m===void 0?void 0:m.accounts)===null||s===void 0?void 0:s.oauth2[p]({client_id:l,scope:c?n:`openid profile email ${n}`,callback:f=>{var g,b;if(f.error)return(g=y.current)===null||g===void 0?void 0:g.call(y,f);(b=w.current)===null||b===void 0||b.call(w,f)},error_callback:f=>{var g;(g=j.current)===null||g===void 0||g.call(j,f)},state:o,...h});v.current=k},[l,u,t,n,o]);const S=a.useCallback(m=>{var s;return(s=v.current)===null||s===void 0?void 0:s.requestAccessToken(m)},[]),F=a.useCallback(()=>{var m;return(m=v.current)===null||m===void 0?void 0:m.requestCode()},[]);return t==="implicit"?S:F}const oe=()=>e.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 48 48",children:[e.jsx("path",{fill:"#FFC107",d:"M43.6 20.5H42V20H24v8h11.3a12 12 0 1 1-3.4-13l5.7-5.7A20 20 0 1 0 44 24c0-1.2-.1-2.3-.4-3.5z"}),e.jsx("path",{fill:"#FF3D00",d:"M6.3 14.7l6.6 4.8A12 12 0 0 1 24 12c3 0 5.8 1.1 7.9 3l5.7-5.7A20 20 0 0 0 6.3 14.7z"}),e.jsx("path",{fill:"#4CAF50",d:"M24 44a20 20 0 0 0 13.5-5.2l-6.2-5.3a12 12 0 0 1-18-6.2l-6.6 5A20 20 0 0 0 24 44z"}),e.jsx("path",{fill:"#1976D2",d:"M43.6 20.5H42V20H24v8h11.3a12 12 0 0 1-4.1 5.5l6.2 5.3C42 35 44 30 44 24c0-1.2-.1-2.3-.4-3.5z"})]}),se=({onSuccess:t,onFailure:n})=>{const[r,i]=a.useState(!1),d=te({onSuccess:c=>t(c.access_token),onError:c=>n({message:c.error_description||"Login Failed"}),scope:"openid email profile https://www.googleapis.com/auth/calendar https://www.googleapis.com/auth/calendar.events"});return e.jsxs("button",{type:"button",onClick:()=>d(),onMouseEnter:()=>i(!0),onMouseLeave:()=>i(!1),className:"flex items-center justify-center gap-2.5 w-full rounded-lg border px-4 py-3 text-sm font-semibold transition-colors cursor-pointer",style:{borderColor:r?"#1B1B1B":"#E9E9E9",color:"#1B1B1B",background:r?"#F6F4F1":"#fff"},children:[e.jsx(oe,{}),"Continue with Google"]})},ne=({clientId:t,onSuccess:n,onFailure:r})=>e.jsx(Z,{clientId:t,children:e.jsx(se,{clientId:t,onSuccess:n,onFailure:r})}),re=()=>e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 23 23",children:[e.jsx("rect",{x:"1",y:"1",width:"10",height:"10",fill:"#F25022"}),e.jsx("rect",{x:"12",y:"1",width:"10",height:"10",fill:"#7FBA00"}),e.jsx("rect",{x:"1",y:"12",width:"10",height:"10",fill:"#00A4EF"}),e.jsx("rect",{x:"12",y:"12",width:"10",height:"10",fill:"#FFB900"})]}),ie=({onSuccess:t,onFailure:n})=>{const{instance:r}=Q(),[i,d]=a.useState(!1),c=async()=>{try{const o=await r.loginPopup({scopes:["user.read"]});t({token:o.accessToken})}catch(o){n({message:(o==null?void 0:o.errorMessage)||"An unexpected error occurred. Please try again."})}};return e.jsxs("button",{type:"button",onClick:c,onMouseEnter:()=>d(!0),onMouseLeave:()=>d(!1),className:"flex items-center justify-center gap-2.5 w-full rounded-lg border px-4 py-3 text-sm font-semibold transition-colors cursor-pointer",style:{borderColor:i?"#1B1B1B":"#E9E9E9",color:"#1B1B1B",background:i?"#F6F4F1":"#fff"},children:[e.jsx(re,{}),"Continue with Microsoft"]})},ae=()=>e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M12 2l1.8 5.6L19.5 9l-5.7 1.4L12 16l-1.8-5.6L4.5 9l5.7-1.4z"}),e.jsx("path",{d:"M19 14l1 2 2 1-2 1-1 2-1-2-2-1 2-1z"})]}),ce=()=>{const[t,n]=a.useState(!1),r=()=>{const i=`https:///authorize?client_id=${_.auth0ClientId}&redirect_uri=${encodeURIComponent(`${window.location.origin}/sign-in/auth0/callback`)}&response_type=code&scope=openid profile email&`;i.startsWith("https://")?window.location.replace(i):console.error("Invalid login URL")};return e.jsxs("button",{type:"button",onClick:r,onMouseEnter:()=>n(!0),onMouseLeave:()=>n(!1),className:"flex items-center justify-center gap-2.5 w-full rounded-lg border px-4 py-3 text-sm font-semibold transition-colors cursor-pointer",style:{borderColor:t?"#F15A22":"#E9E9E9",color:"#F15A22",background:t?"#FBF2EA":"#fff"},children:[e.jsx(ae,{}),"Email me a magic link"]})},C=5,P=5*60*1e3,le=()=>{const t=localStorage.getItem("loginAttempts");try{return JSON.parse(t||"{}")||{count:0,timestamp:0}}catch{return{count:0,timestamp:0}}},de=(t,n)=>{localStorage.setItem("loginAttempts",JSON.stringify({count:t,timestamp:n}))},ue=()=>{localStorage.removeItem("loginAttempts")},me=W().shape({userName:B().required("Please enter your user name"),password:B().required("Please enter your password"),rememberMe:J()}),pe=t=>{const{disableSubmit:n=!1,className:r,forgotPasswordUrl:i="/forgot-password",signUpUrl:d="/sign-up"}=t,[c,o]=V(),[h,l]=a.useState(!1),{signIn:u,signInExternal:v}=O(),w=async(s,p)=>{const{userName:k}=s;let{password:f}=s;const{count:g,timestamp:b}=le(),L=Date.now(),E=L-b;g>=C&&E<P&&(o("Too many failed attempts.try again after 5 minutes."),l(!0),p(!1)),p(!0),f=btoa(f);const x=await u({userName:k,password:f});if((x==null?void 0:x.status)==="failed"){const M=E>P?1:g+1;de(M,L),M>=C?(l(!0),o("Too many failed attempts.try again after 5 minutes.")):(l(!1),o(x.message||"Login failed.")),M>=C-1&&await new Promise(G=>setTimeout(G,2e3))}else(x==null?void 0:x.status)==="success"&&(ue(),l(!1));p(!1)},y=async s=>{try{const p=await v(2,s)}catch{o("An error occurred during Google sign-in.")}},j=s=>{o("Google sign-in failed. Please try again.")},S=s=>{o("Microsoft sign-in failed. Please try again.")},F=async s=>{try{const p=await v(3,s.token)}catch{o("An error occurred during Microsoft sign-in.")}},{googleClientId:m}=_;return e.jsxs("div",{className:r,children:[c&&e.jsx(q,{showIcon:!0,className:"mb-4",type:"danger",children:c}),e.jsxs("div",{className:"flex flex-col gap-2.5 mb-5",children:[e.jsx(ne,{clientId:m,onSuccess:y,onFailure:j}),e.jsx(ie,{onSuccess:F,onFailure:S}),e.jsx(ce,{})]}),e.jsxs("div",{className:"flex items-center gap-3 my-1 mb-5",children:[e.jsx("div",{className:"flex-1 h-px bg-gray-200"}),e.jsx("span",{className:"text-xs font-bold tracking-widest uppercase text-gray-400",children:"or sign in with email"}),e.jsx("div",{className:"flex-1 h-px bg-gray-200"})]}),e.jsx(K,{initialValues:{userName:"",password:"",rememberMe:!1},validationSchema:me,onSubmit:(s,{setSubmitting:p})=>{w(s,p)},children:({isSubmitting:s})=>e.jsx(X,{children:e.jsxs(H,{children:[e.jsx(I,{label:"Email",children:e.jsx(A,{type:"text",name:"userName",placeholder:"you@company.com",component:$})}),e.jsx(I,{label:"Password",children:e.jsx(A,{name:"password",placeholder:"Enter your password",component:D})}),e.jsxs("div",{className:"grid grid-cols-2 gap-1",children:[e.jsx("div",{className:"my-1 text-left",children:e.jsx(A,{name:"rememberMe",type:"checkbox",component:U,children:"Remember Me"})}),e.jsx("div",{className:"my-1 text-right",children:e.jsx(N,{to:i,children:"Forgot Password?"})})]}),e.jsx(z,{block:!0,className:"my-4",loading:s,variant:"solid",type:"submit",disabled:s||h,children:s?"Signing in...":h?"Please wait...":"Sign In"}),e.jsx("div",{className:"text-center",children:e.jsxs("small",{children:["Don't have an account?"," ",e.jsx(N,{to:d,children:"Sign Up"})]})})]})})})]})},ge=()=>e.jsxs(e.Fragment,{children:[e.jsx("h2",{className:"mb-1 font-black",children:"Welcome Back!"}),e.jsx("p",{className:"text-sm text-gray-500 mb-8",children:"Enter your credentials to access your account"}),e.jsx(pe,{disableSubmit:!1})]}),Ne=ge;export{Ne as default};
@@ -1 +0,0 @@
1
- import{j as e}from"./vendor-mui-69397583.js";import{r as l}from"./vendor-react-ece1c85f.js";import{G as $,M as T,P as H,a as O}from"./esm-f306d015.js";import{B as A,dS as Y,F as z,Y as U,l as F,Z as w,W as B,t as N,O as M,Q as k}from"./index-c62ac197.js";import{A as L}from"./AdaptableCard-df7695d6.js";import{u as K,g as G,r as W}from"./index-6589dd2d.js";import{j as _,k as Z}from"./UserService-047aef51.js";import"./Alert-7dfbd254.js";import"./index-6b6d0f06.js";import{c as Q}from"./index-c2088808.js";import{D as V}from"./Drawer-949c18c6.js";import"./FormContainer-91c2b0e4.js";import"./Switcher-c8648037.js";import"./index-36228db5.js";import"./Upload-fb34ce03.js";import{I as q}from"./index.es-d5c880b3.js";import{B as J,I as X}from"./index-fc9071e0.js";import{b as ee,c as te,a as se}from"./vendor-redux-a1f00e6b.js";import{H as ae,a as ne}from"./HubConnectionBuilder-5116af86.js";import"./vendor-pdf-b2a5d8b1.js";import"./vendor-devex-33a39e11.js";import"./vendor-i18n-2fcb1983.js";import"./vendor-msal-9caa1ed1.js";import"./vendor-charts-eccea5d1.js";import"./useControllableState-d0909575.js";import"./useDidUpdate-25c4d4ed.js";const oe={width:"100%",height:"200px",borderRadius:"0 0 0.5rem 0.5rem",overflow:"hidden"},ie=t=>t<1?`${+t.toFixed(3)} miles`:t%1===0?`${t.toFixed(0)} miles`:`${t.toFixed(1)} miles`,re=t=>{var u,j,g;const a=new Date(t.endTime)-new Date(t.startTime),s=Math.round(a/6e4),p=Math.floor(s/60),i=s%60,d=p>0?`${p}h ${i}min`:`${i}min`,c=(t==null?void 0:t.distanceKm)*.621371,h=ie(c);return{id:(u=t.id)==null?void 0:u.substring(0,6),path:((g=(j=t.path)==null?void 0:j.$values)==null?void 0:g.map(f=>({lat:f.lat,lng:f.lng})))||[],totalDistanceKm:h,totalDurationMin:d,topSpeedKmph:+((t==null?void 0:t.maxSpeed)*2.23694).toFixed(1),events:0,crashDetected:!1,endTime:t.endTime?`${t.endTime}Z`:"",startTime:t.startTime?`${t.startTime}Z`:""}},le=({path:t})=>{const[a,s]=l.useState(!1),p=l.useRef(null),i=t[0],d=t[t.length-1],c={lat:(i.lat+d.lat)/2,lng:(i.lng+d.lng)/2};l.useEffect(()=>{window.google&&window.google.maps&&s(!0)},[]);const h=a?{url:"/img/map/pin-red.png",scaledSize:new window.google.maps.Size(40,40)}:void 0,u=l.useCallback(g=>{p.current=g;const f=new window.google.maps.LatLngBounds;t.forEach(y=>f.extend(y)),g.fitBounds(f,50)},[t]),j={disableDefaultUI:!0};return e.jsx($,{mapContainerStyle:oe,center:c,zoom:12,options:j,onLoad:u,children:a&&e.jsxs(e.Fragment,{children:[e.jsx(T,{icon:h,position:i},"start"),e.jsx(T,{icon:h,position:d},"end"),e.jsx(H,{path:t,options:{strokeColor:"#f3741c",strokeOpacity:1,strokeWeight:4}})]})})},ce=({trip:t})=>e.jsxs("div",{id:"tripInfo",className:"rounded-lg border mb-3 bg-gray-white",children:[e.jsxs("div",{className:"flex pt-2 gap-2 text-gray-700 mb-2 p-2 rounded-t-lg ",children:[e.jsx("div",{className:"w-12 my-auto",children:e.jsx(A,{shape:"circle",icon:e.jsx(J,{})})}),e.jsxs("div",{className:"my-auto",children:[e.jsxs("h4",{className:"",children:[new Date(t.startTime).toLocaleString("en-US",{year:"numeric",month:"short",day:"numeric",hour12:!0}),e.jsxs("span",{className:"pl-1",children:["- ",t.totalDistanceKm]})]}),e.jsxs("div",{children:[e.jsx("span",{children:new Date(t.startTime).toLocaleString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0})}),e.jsx("span",{children:" - "}),e.jsx("span",{children:new Date(t.endTime).toLocaleString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0})}),e.jsxs("span",{children:[" ( ",t.totalDurationMin," ) "]})]})]})]}),e.jsx("div",{className:"px-3 mb-3",children:e.jsx(le,{path:t.path})}),e.jsx("div",{className:"flex text-gray-700 divide-x-2 pt-1 pb-3 px-2",children:e.jsxs(Y,{className:"bg-gray-100 px-4 py-2",prefix:e.jsx(X,{className:"text-base text-blue-500 mr-1 rtl:ml-1"}),children:[e.jsx("b",{children:"Top Speed: "})," ",e.jsxs("span",{className:"pl-2",children:[t.topSpeedKmph," mph"]})]})})]}),de=({tripHistoryData:t})=>{const a=t.map(re);return e.jsx("div",{className:"mt-2",children:a.map(s=>e.jsx(ce,{trip:s},s.id))})};const P="TripDetails",D=ee(`${P}/getUserTripHistory`,async({path:t,date:a,page:s=1,pageSize:p=10})=>{var d,c;const i=await _(t,{...a,pageIndex:s,recordsPerPage:p});return{data:(d=i.data)==null?void 0:d.data,page:s,totalCount:(c=i.data)==null?void 0:c.totalCount}}),ue={loading:!1,historyLoading:!1,tripLoading:!1,ChatHistory:[],locationHistory:[],tripHistory:[]},I=te({name:`${P}/state`,initialState:ue,reducers:{},extraReducers:t=>{t.addCase(D.pending,a=>{a.tripLoading=!0}).addCase(D.fulfilled,(a,s)=>{a.tripLoading=!1,s.payload.page===1?a.tripHistory=s.payload.data:a.tripHistory=[...a.tripHistory,...s.payload.data]}).addCase(D.rejected,(a,s)=>{a.tripLoading=!1})}});I.actions;const me=I.reducer,pe=se({data:me}),he=z;let C=null;const ge=async t=>{if(!C){const a=new ae().withUrl(t,{skipNegotiation:!0,transport:ne.WebSockets}).withAutomaticReconnect().build();try{await a.start(),C=a}catch(s){throw console.error("Failed to initialize SignalR connection:",s),s}}return C},R=()=>C;U("TripDetails",pe);const fe=({path:t})=>{const a=F(),[s,p]=l.useState([new Date,new Date]),i=he(n=>{var o,r;return((r=(o=n==null?void 0:n.TripDetails)==null?void 0:o.data)==null?void 0:r.tripHistory)||[]}),[d,c]=l.useState(!0),[h,u]=l.useState(1),[j,g]=l.useState(0),f=()=>{g(0),u(1),c(!0),y(1)};l.useEffect(()=>{f()},[t,s]),l.useEffect(()=>{const n=R();if(!n)return;const o=`TripCompleted_${t}`;return n.on(o,r=>{if(r!=null&&r.startTime&&(s==null?void 0:s.length)===2&&s[0]&&s[1]){const b=w(r.startTime).local().startOf("day"),S=w(s[0]).startOf("day"),E=w(s[1]).endOf("day");b.isBetween(S,E,null,"[]")?(console.log("Trip date is within selected date range"),f()):console.log("Trip date is outside selected date range")}}),()=>n.off(o)},[t]);const y=n=>{if(t&&(s==null?void 0:s.length)===2&&s[0]&&s[1]){const o={fromDate:w(s[0]).startOf("day").utc().format("YYYY-MM-DD HH:mm:ss"),toDate:w(s[1]).endOf("day").utc().format("YYYY-MM-DD HH:mm:ss")};a(D({path:t,date:o,page:n})).then(r=>{var b,S;g((b=r==null?void 0:r.payload)==null?void 0:b.totalCount),((S=r==null?void 0:r.payload)==null?void 0:S.totalCount)<=i.length&&c(!1)})}},x=()=>{const n=h+1;u(n),y(n)},v=n=>{n.length===1?p([n[0],n[0]]):p(n)},m=()=>{(s.length===1||!s[1])&&p([s[0],s[0]])};return e.jsx(L,{className:"details-bottom border-0 mt-4 ",bodyClass:"h-full p-0",children:e.jsx("div",{className:"client-details-container",children:e.jsxs(L,{className:"h-full",bodyClass:"h-full ",children:[e.jsxs("div",{className:"h-full w-full",children:[e.jsx("label",{children:" Select Range:"}),e.jsx(Q,{singleDate:!0,placeholder:"Select dates range",value:s,clearable:!1,onClose:m,onChange:v})]}),e.jsx("div",{className:"w-full h-full mt-4 address-list-section",id:"scrollableDiv",children:e.jsx(q,{dataLength:i==null?void 0:i.length,next:x,hasMore:d,loader:e.jsx("p",{style:{textAlign:"center"},children:"loading..."}),endMessage:e.jsx("p",{style:{textAlign:"center"},children:e.jsxs("b",{children:[" ",(i==null?void 0:i.length)>0?"You have seen it all!":"No Trip data available"," "]})}),scrollableTarget:"scrollableDiv",className:"px-3",children:e.jsx(de,{tripHistoryData:i})})})]})})})};U("users",W);const xe={width:"100%",height:"100%"},je={lat:40.7128,lng:-74.006},Ge=()=>{const t=F(),[a,s]=l.useState(null),p=K(x=>{var v,m,n;return((n=(m=(v=x==null?void 0:x.users)==null?void 0:v.data)==null?void 0:m.usersList)==null?void 0:n.map(o=>({value:o.id,label:`${o.firstName} ${o.lastName}`})))||[]}),{isLoaded:i}=O({googleMapsApiKey:N.googleMapKey}),[d,c]=l.useState([]),[h,u]=l.useState(null);l.useRef(null);const[j,g]=l.useState(!1);l.useEffect(()=>{t(G({isActive:!0,roleName:"Admin"}))},[]),l.useEffect(()=>{if(!a){c([]),u(null);return}return(async()=>{var m,n;try{const o=await Z(a.value);if(o!=null&&o.data){const r={lat:(m=o==null?void 0:o.data)==null?void 0:m.lastLatitude,lng:(n=o.data)==null?void 0:n.lastLongitude};c([r]),u(r)}else{M.push(e.jsx(k,{title:"Live Tracking Unavailable",type:"warning",duration:3e3,children:"Live location updates are currently unavailable. The user may not be actively using the mobile app."}),{placement:"top-center"}),c([]),u(null);return}}catch(o){M.push(e.jsx(k,{title:"Live Tracking Unavailable",type:"warning",duration:4e3,children:"Live location updates are currently unavailable. The user may not be actively using the mobile app."}),{placement:"top-center"}),c([]),u(null),console.error("Failed to fetch initial location",o)}})(),a&&(async()=>{const m=await ge(`${N.apiBaseUrl}/locationTracking`),n=`ReceiveLocation_${a.value}`;m.on(n,o=>{const r={lat:o.latitude,lng:o.longitude};c(b=>[...b,r]),u(r)})})(),()=>{const m=R(),n=`ReceiveLocation_${a==null?void 0:a.value}`;m==null||m.off(n)}},[a]);const f=l.useMemo(()=>[...d],[d]),y=()=>h?e.jsx(T,{icon:{url:"/img/map/pin-orange.png",scaledSize:new window.google.maps.Size(50,50)},position:h}):null;return i?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"topbar py-4 px-6 border-gray-200 border-b",children:e.jsxs("div",{className:"lg:flex items-center justify-between",children:[e.jsx("div",{className:"basis-3/4",children:e.jsx("h3",{className:"mb-4 lg:mb-0",children:"Live Tracking"})}),e.jsxs("div",{className:"basis-1/4 flex items-center justify-between gap-2",children:[e.jsx("div",{className:"basis-1/4",children:h&&e.jsx(A,{onClick:()=>g(!0),block:!0,variant:"solid",size:"sm",children:"View Trips"})}),e.jsx("div",{className:"basis-3/4",children:e.jsx(B,{value:a,placeholder:"Select User",isClearable:!0,onChange:x=>s(x),options:p,styles:{input:x=>({...x,color:"black"})}})})]})]})}),e.jsx(L,{className:"h-full py-4 px-6 m-6",bodyClass:"h-full",children:e.jsx("div",{style:{width:"100%",height:"98%"},children:e.jsxs($,{mapContainerStyle:xe,center:h||je,zoom:18,children:[a&&y(),f.length>0&&e.jsx(H,{path:f,options:{strokeColor:"#f3741c",strokeOpacity:1,strokeWeight:5}})]})})}),e.jsx(V,{title:"Trip Details",isOpen:j,onClose:()=>g(!1),portalClassName:"w30",children:(a==null?void 0:a.value)&&e.jsx(fe,{path:a==null?void 0:a.value})})]}):e.jsx("div",{children:"Loading map..."})};export{Ge as default};