ezux 1.1.13 → 1.1.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (513) hide show
  1. package/README.md +58 -15
  2. package/dist/DeleteConfirmationModal-CukNDgtX.cjs +1 -0
  3. package/dist/DeleteConfirmationModal-p8XGDGIw.js +38 -0
  4. package/dist/EzContextMenu-BCUoEQp5.cjs +1 -0
  5. package/dist/EzContextMenu-srLxujt8.js +287 -0
  6. package/dist/EzErrorBoundary-C7a6VisX.js +74 -0
  7. package/dist/EzErrorBoundary-d_2g-_EK.cjs +1 -0
  8. package/dist/EzEventModal-C079wLjP.js +725 -0
  9. package/dist/EzEventModal-CAA9cAM0.cjs +1 -0
  10. package/dist/EzFlow-C74NbZA9.js +2545 -0
  11. package/dist/EzFlow-CQFeY7DL.cjs +5 -0
  12. package/dist/EzGroupingPanel-BVaAJaVU.js +107 -0
  13. package/dist/EzGroupingPanel-BwWDWEuW.cjs +1 -0
  14. package/dist/EzKanban-BlJWybKe.js +1575 -0
  15. package/dist/EzKanban-DdKODRRv.cjs +2 -0
  16. package/dist/EzLayout-BGnqFtvO.cjs +1 -0
  17. package/dist/EzLayout-CiaPLniV.js +7005 -0
  18. package/dist/EzProvider-AlmsYIDk.js +982 -0
  19. package/dist/EzProvider-L2qQMq-v.cjs +1 -0
  20. package/dist/EzScheduler-C1Jtvvju.js +2700 -0
  21. package/dist/EzScheduler-CkqTngI6.cjs +1 -0
  22. package/dist/EzSchedulerQuickAdd-BIC8xbSn.js +124 -0
  23. package/dist/EzSchedulerQuickAdd-BeNfGdWs.cjs +1 -0
  24. package/dist/EzSchedulerToolbar-BJwTpgas.cjs +1 -0
  25. package/dist/EzSchedulerToolbar-Ba4gbvUg.js +305 -0
  26. package/dist/EzSignature-7UHO5lSP.js +386 -0
  27. package/dist/EzSignature-Df7UZ-IS.cjs +1 -0
  28. package/dist/EzTable-CEXvJR1t.cjs +3 -0
  29. package/dist/EzTable-D2p1IWHc.js +4290 -0
  30. package/dist/EzTableEditDialog-BXnnYSSy.cjs +1 -0
  31. package/dist/EzTableEditDialog-Ccd5XoHm.js +84 -0
  32. package/dist/EzTableFooter-CtexeDAC.cjs +1 -0
  33. package/dist/EzTableFooter-DrLoWelo.js +35 -0
  34. package/dist/EzTableToolbar-BH5z9fSJ.js +160 -0
  35. package/dist/EzTableToolbar-DwuumvWP.cjs +1 -0
  36. package/dist/EzTreeView-D1G0Aomc.js +818 -0
  37. package/dist/EzTreeView-KMGlU4ax.cjs +1 -0
  38. package/dist/HighlightText-BViuwe03.cjs +1 -0
  39. package/dist/HighlightText-DNA2R2uf.js +56 -0
  40. package/dist/KanbanBoard-B7_Z5sh1.js +1697 -0
  41. package/dist/KanbanBoard-CyitudI1.cjs +1 -0
  42. package/dist/Modal-BmX1C448.cjs +1 -0
  43. package/dist/Modal-CrzpKyjK.js +74 -0
  44. package/dist/NotificationPanel-BzpDc10Q.js +54 -0
  45. package/dist/NotificationPanel-CFME00wq.cjs +1 -0
  46. package/dist/TooltipWrapper-BSAmUx9H.js +44 -0
  47. package/dist/TooltipWrapper-DfbFAZ1U.cjs +1 -0
  48. package/dist/advanced.cjs +10 -0
  49. package/dist/advanced.d.ts +44 -0
  50. package/dist/advanced.es.js +400 -0
  51. package/dist/avatar-BSdRHETK.cjs +1 -0
  52. package/dist/avatar-BvCUJ-_r.js +27 -0
  53. package/dist/button-BBMwzUtG.cjs +1 -0
  54. package/dist/button-CYyNwV8S.js +44 -0
  55. package/dist/calendar-DEHX32Cp.cjs +1 -0
  56. package/dist/calendar-DOIPGsyI.js +112 -0
  57. package/dist/card-CPlRZxbq.cjs +1 -0
  58. package/dist/card-ZUNxcdIM.js +60 -0
  59. package/dist/checkbox-BrCh_Iid.cjs +1 -0
  60. package/dist/checkbox-DRkQuB4W.js +21 -0
  61. package/dist/components/EzFlow/EzConnectionLine.d.ts +5 -0
  62. package/dist/components/EzFlow/EzFlow.examples.d.ts +5 -0
  63. package/dist/components/EzFlow/EzFlow.types.d.ts +260 -0
  64. package/dist/components/EzFlow/EzFlowBackground.d.ts +5 -0
  65. package/dist/components/EzFlow/EzFlowCanvas.d.ts +3 -0
  66. package/dist/components/EzFlow/EzFlowControls.d.ts +5 -0
  67. package/dist/components/EzFlow/EzFlowEdge.d.ts +5 -0
  68. package/dist/components/EzFlow/EzFlowHeader.d.ts +6 -0
  69. package/dist/components/EzFlow/EzFlowToolbox.d.ts +6 -0
  70. package/dist/components/EzFlow/EzWorkflow.d.ts +5 -0
  71. package/dist/components/EzFlow/EzWorkflowPerformance.d.ts +3 -0
  72. package/dist/components/EzFlow/EzWorkflowServiceAdapters.d.ts +24 -0
  73. package/dist/components/EzFlow/EzWorkflowValidation.d.ts +95 -0
  74. package/dist/components/EzFlow/index.d.ts +13 -0
  75. package/dist/components/EzFlow/nodes/ActionNode.d.ts +3 -0
  76. package/dist/components/EzFlow/nodes/ApprovalNode.d.ts +3 -0
  77. package/dist/components/EzFlow/nodes/DecisionNode.d.ts +3 -0
  78. package/dist/components/EzFlow/nodes/DelayNode.d.ts +3 -0
  79. package/dist/components/EzFlow/nodes/EndNode.d.ts +3 -0
  80. package/dist/components/EzFlow/nodes/GroupNode.d.ts +3 -0
  81. package/dist/components/EzFlow/nodes/LoopNode.d.ts +3 -0
  82. package/dist/components/EzFlow/nodes/RequestNode.d.ts +3 -0
  83. package/dist/components/EzFlow/nodes/StartNode.d.ts +3 -0
  84. package/dist/components/EzFlow/nodes/index.d.ts +9 -0
  85. package/dist/components/EzKanban/EzKanban.types.d.ts +808 -0
  86. package/dist/components/EzKanban/components/CardEditorModal.d.ts +23 -0
  87. package/dist/components/EzKanban/components/EzKanbanErrorFallback.d.ts +1 -0
  88. package/dist/components/EzKanban/components/FilterPopover.d.ts +10 -0
  89. package/dist/components/EzKanban/components/KanbanBoard.d.ts +59 -0
  90. package/dist/components/EzKanban/components/KanbanCard.d.ts +46 -0
  91. package/dist/components/EzKanban/components/KanbanColumn.d.ts +55 -0
  92. package/dist/components/EzKanban/components/KanbanSwimlane.d.ts +45 -0
  93. package/dist/components/EzKanban/components/KanbanToolbar.d.ts +41 -0
  94. package/dist/components/EzKanban/exports.d.ts +4 -0
  95. package/dist/components/EzKanban/hooks/useKanbanCards.d.ts +36 -0
  96. package/dist/components/EzKanban/hooks/useKanbanColumns.d.ts +27 -0
  97. package/dist/components/EzKanban/hooks/useKanbanDragDrop.d.ts +31 -0
  98. package/dist/components/EzKanban/hooks/useKanbanFilters.d.ts +23 -0
  99. package/dist/components/EzKanban/hooks/useKanbanState.d.ts +79 -0
  100. package/dist/components/EzKanban/hooks/useKanbanSwimlanes.d.ts +27 -0
  101. package/dist/components/EzKanban/hooks/useKanbanVirtualization.d.ts +16 -0
  102. package/dist/components/EzKanban/index.d.ts +51 -0
  103. package/dist/components/EzKanban/services/KanbanService.d.ts +31 -0
  104. package/dist/components/EzKanban/state/kanban.store.d.ts +33 -0
  105. package/dist/components/EzKanban/useEzKanban.d.ts +87 -0
  106. package/dist/components/EzKanban/views/KanbanTimelineView.d.ts +15 -0
  107. package/dist/components/EzLayout/Authentication/AuthSlider.d.ts +13 -0
  108. package/dist/components/EzLayout/Authentication/InputPassword.d.ts +7 -0
  109. package/dist/components/EzLayout/Authentication/SignInForm.d.ts +21 -0
  110. package/dist/components/EzLayout/Authentication/SignUpForm.d.ts +20 -0
  111. package/dist/components/EzLayout/EzHeader.d.ts +48 -0
  112. package/dist/components/EzLayout/EzLanguageSwitcher.d.ts +4 -0
  113. package/dist/components/EzLayout/EzLayout.types.d.ts +261 -0
  114. package/dist/components/EzLayout/EzOrganizationSwitcher.d.ts +14 -0
  115. package/dist/components/EzLayout/EzSidebar.d.ts +24 -0
  116. package/dist/components/EzLayout/EzThemeColorChanger.d.ts +9 -0
  117. package/dist/components/EzLayout/EzThemeSwitcher.d.ts +8 -0
  118. package/dist/components/EzLayout/EzUserProfile.d.ts +27 -0
  119. package/dist/components/EzLayout/components/EzSidebarFooter.d.ts +8 -0
  120. package/dist/components/EzLayout/components/EzSidebarNav.d.ts +10 -0
  121. package/dist/components/EzLayout/components/EzSidebarNavItem.d.ts +11 -0
  122. package/dist/components/EzLayout/components/MainContent.d.ts +13 -0
  123. package/dist/components/EzLayout/hooks/useLayoutImperative.d.ts +17 -0
  124. package/dist/components/EzLayout/hooks/useLayoutState.d.ts +25 -0
  125. package/dist/components/EzLayout/index.d.ts +23 -0
  126. package/dist/components/EzLayout/useEzLayout.d.ts +34 -0
  127. package/dist/components/EzScheduler/EzScheduler.types.d.ts +1252 -0
  128. package/dist/components/EzScheduler/EzSchedulerToolbar.d.ts +117 -0
  129. package/dist/components/EzScheduler/components/EzEventModal.d.ts +23 -0
  130. package/dist/components/EzScheduler/components/EzOverlapAlert.d.ts +12 -0
  131. package/dist/components/EzScheduler/components/EzQuickInfoPopup.d.ts +22 -0
  132. package/dist/components/EzScheduler/components/EzResourceSidebar.d.ts +33 -0
  133. package/dist/components/EzScheduler/components/EzSchedulerContent.d.ts +111 -0
  134. package/dist/components/EzScheduler/components/EzSchedulerQuickAdd.d.ts +17 -0
  135. package/dist/components/EzScheduler/components/RecurrenceEditor.d.ts +7 -0
  136. package/dist/components/EzScheduler/components/SchedulerLoadingSpinner.d.ts +2 -0
  137. package/dist/components/EzScheduler/components/dnd/DraggableEvent.d.ts +24 -0
  138. package/dist/components/EzScheduler/components/dnd/DroppableSlot.d.ts +19 -0
  139. package/dist/components/EzScheduler/hooks/useRecurrence.d.ts +2 -0
  140. package/dist/components/EzScheduler/hooks/useSchedulerEventHandlers.d.ts +15 -0
  141. package/dist/components/EzScheduler/hooks/useSchedulerEvents.d.ts +27 -0
  142. package/dist/components/EzScheduler/hooks/useSchedulerImperative.d.ts +19 -0
  143. package/dist/components/EzScheduler/hooks/useSchedulerNavigation.d.ts +9 -0
  144. package/dist/components/EzScheduler/hooks/useSchedulerResources.d.ts +10 -0
  145. package/dist/components/EzScheduler/hooks/useSchedulerState.d.ts +14 -0
  146. package/dist/components/EzScheduler/hooks/useSchedulerVirtualization.d.ts +9 -0
  147. package/dist/components/EzScheduler/index.d.ts +43 -0
  148. package/dist/components/EzScheduler/models/EventSettings.d.ts +11 -0
  149. package/dist/components/EzScheduler/models/View.d.ts +49 -0
  150. package/dist/components/EzScheduler/models/index.d.ts +2 -0
  151. package/dist/components/EzScheduler/services/AttendeeService.d.ts +15 -0
  152. package/dist/components/EzScheduler/services/AuditService.d.ts +15 -0
  153. package/dist/components/EzScheduler/services/CollisionDetectionService.d.ts +19 -0
  154. package/dist/components/EzScheduler/services/DragAndDropService.d.ts +16 -0
  155. package/dist/components/EzScheduler/services/HistoryService.d.ts +31 -0
  156. package/dist/components/EzScheduler/services/ICalendarImportService.d.ts +16 -0
  157. package/dist/components/EzScheduler/services/PrintService.d.ts +7 -0
  158. package/dist/components/EzScheduler/services/RecurrenceEngine.d.ts +7 -0
  159. package/dist/components/EzScheduler/services/ReminderService.d.ts +17 -0
  160. package/dist/components/EzScheduler/services/SchedulerService.d.ts +71 -0
  161. package/dist/components/EzScheduler/services/SearchService.d.ts +11 -0
  162. package/dist/components/EzScheduler/services/SecurityService.d.ts +25 -0
  163. package/dist/components/EzScheduler/services/TimezoneService.d.ts +20 -0
  164. package/dist/components/EzScheduler/services/VirtualScrollingService.d.ts +34 -0
  165. package/dist/components/EzScheduler/state/scheduler.store.d.ts +27 -0
  166. package/dist/components/EzScheduler/templates/CellTemplate.d.ts +42 -0
  167. package/dist/components/EzScheduler/templates/EditorTemplate.d.ts +32 -0
  168. package/dist/components/EzScheduler/templates/HeaderTemplate.d.ts +36 -0
  169. package/dist/components/EzScheduler/useEzScheduler.d.ts +104 -0
  170. package/dist/components/EzScheduler/utils/createDragConstraint.d.ts +7 -0
  171. package/dist/components/EzScheduler/utils/getWeekNumber.d.ts +8 -0
  172. package/dist/components/EzScheduler/utils/sanitizeHtml.d.ts +18 -0
  173. package/dist/components/EzScheduler/views/AgendaView.d.ts +28 -0
  174. package/dist/components/EzScheduler/views/DayWeekView.d.ts +177 -0
  175. package/dist/components/EzScheduler/views/MonthView.d.ts +60 -0
  176. package/dist/components/EzScheduler/views/TimelineView.d.ts +116 -0
  177. package/dist/components/EzSignature/EzSignature.d.ts +42 -0
  178. package/dist/components/EzSignature/EzSignature.types.d.ts +132 -0
  179. package/dist/components/EzSignature/index.d.ts +2 -0
  180. package/dist/components/EzTable/EzColumnMenu.d.ts +7 -0
  181. package/dist/components/EzTable/EzDateFilterTree.d.ts +7 -0
  182. package/dist/components/EzTable/EzExcelFilter.d.ts +8 -0
  183. package/dist/components/EzTable/EzFilterBuilder.d.ts +12 -0
  184. package/dist/components/EzTable/EzGroupingPanel.d.ts +9 -0
  185. package/dist/components/EzTable/EzHeaderContextMenu.d.ts +8 -0
  186. package/dist/components/EzTable/EzPagination.d.ts +19 -0
  187. package/dist/components/EzTable/EzTable.types.d.ts +1 -0
  188. package/dist/components/EzTable/EzTableEditDialog.d.ts +15 -0
  189. package/dist/components/EzTable/EzTableFooter.d.ts +10 -0
  190. package/dist/components/EzTable/EzTableOverlays.d.ts +11 -0
  191. package/dist/components/EzTable/EzTableStatusBar.d.ts +10 -0
  192. package/dist/components/EzTable/EzTableToolbar.d.ts +60 -0
  193. package/dist/components/EzTable/SmartCell.d.ts +7 -0
  194. package/dist/components/EzTable/components/AdvancedColumnFilter.d.ts +16 -0
  195. package/dist/components/EzTable/components/BooleanFilterSection.d.ts +7 -0
  196. package/dist/components/EzTable/components/EzDraggableHeader.d.ts +10 -0
  197. package/dist/components/EzTable/components/EzHeaderDragPreview.d.ts +7 -0
  198. package/dist/components/EzTable/components/EzTableBodySection.d.ts +72 -0
  199. package/dist/components/EzTable/components/EzTableCell.d.ts +46 -0
  200. package/dist/components/EzTable/components/EzTableHeaderSection.d.ts +23 -0
  201. package/dist/components/EzTable/components/EzTablePaginationSection.d.ts +31 -0
  202. package/dist/components/EzTable/components/EzTableRow.d.ts +58 -0
  203. package/dist/components/EzTable/components/FilterActionButtons.d.ts +16 -0
  204. package/dist/components/EzTable/components/FilterRuleSelect.d.ts +26 -0
  205. package/dist/components/EzTable/components/SelectAllCheckbox.d.ts +21 -0
  206. package/dist/components/EzTable/components/SelectFilterSection.d.ts +18 -0
  207. package/dist/components/EzTable/components/VirtualizedFilterList.d.ts +21 -0
  208. package/dist/components/EzTable/constants/filterOptions.d.ts +47 -0
  209. package/dist/components/EzTable/context/EzTableContext.d.ts +10 -0
  210. package/dist/components/EzTable/context/TableConfigContext.d.ts +13 -0
  211. package/dist/components/EzTable/context/TableStore.d.ts +17 -0
  212. package/dist/components/EzTable/filterUtils.d.ts +5 -0
  213. package/dist/components/EzTable/hooks/useAutoFit.d.ts +4 -0
  214. package/dist/components/EzTable/hooks/useCellEventHandlers.d.ts +16 -0
  215. package/dist/components/EzTable/hooks/useColumnSizeVars.d.ts +6 -0
  216. package/dist/components/EzTable/hooks/useContainerResize.d.ts +11 -0
  217. package/dist/components/EzTable/hooks/useDialogStateInitialization.d.ts +8 -0
  218. package/dist/components/EzTable/hooks/useFilterSelection.d.ts +12 -0
  219. package/dist/components/EzTable/hooks/useTableFiltering.d.ts +23 -0
  220. package/dist/components/EzTable/hooks/useTableHistory.d.ts +87 -0
  221. package/dist/components/EzTable/hooks/useTableImperative.d.ts +42 -0
  222. package/dist/components/EzTable/hooks/useTableSelection.d.ts +32 -0
  223. package/dist/components/EzTable/hooks/useTableState.d.ts +33 -0
  224. package/dist/components/EzTable/hooks/useTableVirtualization.d.ts +35 -0
  225. package/dist/components/EzTable/index.d.ts +54 -0
  226. package/dist/components/EzTable/renderers/index.d.ts +6 -0
  227. package/dist/components/EzTable/services/TableService.d.ts +29 -0
  228. package/dist/components/EzTable/types/EzTableColumn.types.d.ts +146 -0
  229. package/dist/components/EzTable/types/EzTableEdit.types.d.ts +58 -0
  230. package/dist/components/EzTable/types/EzTableFilter.types.d.ts +50 -0
  231. package/dist/components/EzTable/types/EzTableProps.d.ts +750 -0
  232. package/dist/components/EzTable/types/index.d.ts +4 -0
  233. package/dist/components/EzTable/useEzTable.d.ts +17 -0
  234. package/dist/components/EzTable/utils/SizingUtils.d.ts +11 -0
  235. package/dist/components/EzTable/utils/TextMeasurer.d.ts +1 -0
  236. package/dist/components/EzTable/utils/TruncatedTooltip.d.ts +7 -0
  237. package/dist/components/EzTable/utils/columnTypeDetector.d.ts +5 -0
  238. package/dist/components/EzTable/utils/filterTypeGuards.d.ts +3 -0
  239. package/dist/components/EzTable/utils/index.d.ts +1 -0
  240. package/dist/components/EzTreeView/EzTreeView.types.d.ts +364 -0
  241. package/dist/components/EzTreeView/EzTreeViewItem.d.ts +89 -0
  242. package/dist/components/EzTreeView/EzVirtualTree.d.ts +84 -0
  243. package/dist/components/EzTreeView/components/EzTreeViewLoadingSpinner.d.ts +2 -0
  244. package/dist/components/EzTreeView/hooks/useTreeDragDrop.d.ts +31 -0
  245. package/dist/components/EzTreeView/hooks/useTreeExpansion.d.ts +21 -0
  246. package/dist/components/EzTreeView/hooks/useTreeImperative.d.ts +28 -0
  247. package/dist/components/EzTreeView/hooks/useTreeSelection.d.ts +31 -0
  248. package/dist/components/EzTreeView/hooks/useTreeState.d.ts +21 -0
  249. package/dist/components/EzTreeView/hooks/useTreeVirtualization.d.ts +18 -0
  250. package/dist/components/EzTreeView/index.d.ts +40 -0
  251. package/dist/components/EzTreeView/services/TreeService.d.ts +11 -0
  252. package/dist/components/EzTreeView/useEzTreeView.d.ts +50 -0
  253. package/dist/components/EzTreeView/utils/treeUtils.d.ts +17 -0
  254. package/dist/components/shared/components/EzErrorBoundary.d.ts +18 -0
  255. package/dist/components/shared/components/EzLayoutErrorFallback.d.ts +2 -0
  256. package/dist/components/shared/components/EzLoadingSpinner.d.ts +8 -0
  257. package/dist/components/shared/components/EzSchedulerErrorFallback.d.ts +2 -0
  258. package/dist/components/shared/components/EzSortableList.d.ts +12 -0
  259. package/dist/components/shared/components/EzTableErrorFallback.d.ts +2 -0
  260. package/dist/components/shared/components/EzTreeViewErrorFallback.d.ts +2 -0
  261. package/dist/components/ui/avatar.d.ts +10 -0
  262. package/dist/components/ui/badge.d.ts +9 -0
  263. package/dist/components/ui/breadcrumb.d.ts +19 -0
  264. package/dist/components/ui/button.d.ts +13 -0
  265. package/dist/components/ui/calendar.d.ts +15 -0
  266. package/dist/components/ui/card.d.ts +10 -0
  267. package/dist/components/ui/checkbox.d.ts +7 -0
  268. package/dist/components/ui/combobox.d.ts +19 -0
  269. package/dist/components/ui/command.d.ts +78 -0
  270. package/dist/components/ui/context-menu.d.ts +27 -0
  271. package/dist/components/ui/date-time-picker.d.ts +14 -0
  272. package/dist/components/ui/dropdown-menu.d.ts +31 -0
  273. package/dist/components/ui/index.d.ts +27 -0
  274. package/dist/components/ui/input.d.ts +5 -0
  275. package/dist/components/ui/label.d.ts +9 -0
  276. package/dist/components/ui/modal.d.ts +9 -0
  277. package/dist/components/ui/password-input.d.ts +5 -0
  278. package/dist/components/ui/popover.d.ts +10 -0
  279. package/dist/components/ui/progress.d.ts +7 -0
  280. package/dist/components/ui/radio-group.d.ts +5 -0
  281. package/dist/components/ui/resizable.d.ts +8 -0
  282. package/dist/components/ui/scroll-area.d.ts +5 -0
  283. package/dist/components/ui/select.d.ts +26 -0
  284. package/dist/components/ui/skeleton.d.ts +2 -0
  285. package/dist/components/ui/switch.d.ts +6 -0
  286. package/dist/components/ui/table.d.ts +10 -0
  287. package/dist/components/ui/tabs.d.ts +22 -0
  288. package/dist/components/ui/textarea.d.ts +5 -0
  289. package/dist/components/ui/tooltip.d.ts +10 -0
  290. package/dist/date-time-picker-Bs-7XzHD.cjs +1 -0
  291. package/dist/date-time-picker-fUzf4TnU.js +127 -0
  292. package/dist/dropdown-menu-BRP0tyR_.cjs +1 -0
  293. package/dist/dropdown-menu-B_7_K13o.js +78 -0
  294. package/dist/ezux.css +2 -1
  295. package/dist/flow.cjs +1 -0
  296. package/dist/flow.d.ts +2 -0
  297. package/dist/flow.es.js +2 -0
  298. package/dist/index.cjs +3 -12
  299. package/dist/index.d.ts +66 -6404
  300. package/dist/index.es.js +229 -1041
  301. package/dist/input-CYlvlbF7.cjs +1 -0
  302. package/dist/input-Cj3sQK3M.js +14 -0
  303. package/dist/kanban.cjs +1 -1
  304. package/dist/kanban.d.ts +2 -1343
  305. package/dist/kanban.es.js +4 -17
  306. package/dist/label-BGgvoZWD.cjs +1 -0
  307. package/dist/label-DWEV--5W.js +16 -0
  308. package/dist/layout.cjs +1 -1
  309. package/dist/layout.d.ts +2 -690
  310. package/dist/layout.es.js +2 -20
  311. package/dist/lib/perfect-freehand.d.ts +221 -0
  312. package/dist/lib/utils.d.ts +2 -0
  313. package/dist/mock-services.cjs +1 -0
  314. package/dist/mock-services.d.ts +8 -0
  315. package/dist/mock-services.es.js +161 -0
  316. package/dist/popover-D1akYj0W.js +17 -0
  317. package/dist/popover-wZKNvYM5.cjs +1 -0
  318. package/dist/scheduler.cjs +1 -1
  319. package/dist/scheduler.d.ts +2 -1430
  320. package/dist/scheduler.es.js +2 -11
  321. package/dist/scroll-area-BJs87d45.js +35 -0
  322. package/dist/scroll-area-DSkE2KB_.cjs +1 -0
  323. package/dist/select-D4tFaSai.js +43 -0
  324. package/dist/select-sVieKbLu.cjs +1 -0
  325. package/dist/shared/components/AnimatedText.d.ts +44 -0
  326. package/dist/shared/components/BaseCell.d.ts +14 -0
  327. package/dist/shared/components/BooleanRenderer.d.ts +34 -0
  328. package/dist/shared/components/ChartRenderer.d.ts +19 -0
  329. package/dist/shared/components/DeleteConfirmationModal.d.ts +11 -0
  330. package/dist/shared/components/EzContextMenu.d.ts +12 -0
  331. package/dist/shared/components/EzNotificationDropdown.d.ts +2 -0
  332. package/dist/shared/components/HighlightText.d.ts +4 -0
  333. package/dist/shared/components/Modal.d.ts +13 -0
  334. package/dist/shared/components/NotificationPanel.d.ts +2 -0
  335. package/dist/shared/components/PrimitiveRenderer.d.ts +39 -0
  336. package/dist/shared/components/SearchableSelect.d.ts +13 -0
  337. package/dist/shared/components/SelectRenderer.d.ts +33 -0
  338. package/dist/shared/components/StatusBadge.d.ts +21 -0
  339. package/dist/shared/components/TooltipWrapper.d.ts +12 -0
  340. package/dist/shared/components/index.d.ts +9 -0
  341. package/dist/shared/contexts/EzProvider.d.ts +56 -0
  342. package/dist/shared/hooks/index.d.ts +56 -0
  343. package/dist/shared/hooks/useBaseComponent.d.ts +59 -0
  344. package/dist/shared/hooks/useComponentImperativeAPI.d.ts +11 -0
  345. package/dist/shared/hooks/useComponentState.d.ts +39 -0
  346. package/dist/shared/hooks/useCurrentTime.d.ts +6 -0
  347. package/dist/shared/hooks/useDataChangeEvents.d.ts +53 -0
  348. package/dist/shared/hooks/useDebounce.d.ts +10 -0
  349. package/dist/shared/hooks/useDeleteConfirmation.d.ts +9 -0
  350. package/dist/shared/hooks/useDialogState.d.ts +21 -0
  351. package/dist/shared/hooks/useDndHandlers.d.ts +19 -0
  352. package/dist/shared/hooks/useEditing.d.ts +107 -0
  353. package/dist/shared/hooks/useEventHandlers.d.ts +61 -0
  354. package/dist/shared/hooks/useEzTheme.d.ts +22 -0
  355. package/dist/shared/hooks/useFieldValidation.d.ts +24 -0
  356. package/dist/shared/hooks/useHistory.d.ts +13 -0
  357. package/dist/shared/hooks/useI18n.d.ts +8 -0
  358. package/dist/shared/hooks/useImperativeAPI.d.ts +8 -0
  359. package/dist/shared/hooks/useInitCoreServices.d.ts +5 -0
  360. package/dist/shared/hooks/useKeyboardNavigation.d.ts +36 -0
  361. package/dist/shared/hooks/useKeyboardShortcuts.d.ts +14 -0
  362. package/dist/shared/hooks/useLifecycleEvents.d.ts +22 -0
  363. package/dist/shared/hooks/useLoadingState.d.ts +17 -0
  364. package/dist/shared/hooks/useMediaQuery.d.ts +6 -0
  365. package/dist/shared/hooks/useNotificationService.d.ts +8 -0
  366. package/dist/shared/hooks/usePerformanceMonitor.d.ts +22 -0
  367. package/dist/shared/hooks/useRowSelectionEvents.d.ts +44 -0
  368. package/dist/shared/hooks/useSelection.d.ts +73 -0
  369. package/dist/shared/hooks/useService.d.ts +12 -0
  370. package/dist/shared/hooks/useServiceState.d.ts +1 -0
  371. package/dist/shared/hooks/useStateChangeEvents.d.ts +61 -0
  372. package/dist/shared/hooks/useTheme.d.ts +13 -0
  373. package/dist/shared/hooks/useVirtualization.d.ts +85 -0
  374. package/dist/shared/services/BaseService.d.ts +57 -0
  375. package/dist/shared/services/ContextMenuService.d.ts +58 -0
  376. package/dist/shared/services/ExportService.d.ts +35 -0
  377. package/dist/shared/services/FocusManagerService.d.ts +33 -0
  378. package/dist/shared/services/HierarchyService.d.ts +43 -0
  379. package/dist/shared/services/I18nService.d.ts +84 -0
  380. package/dist/shared/services/LayoutService.d.ts +80 -0
  381. package/dist/shared/services/NotificationService.d.ts +44 -0
  382. package/dist/shared/services/PersistenceService.d.ts +69 -0
  383. package/dist/shared/services/ServiceRegistry.d.ts +52 -0
  384. package/dist/shared/services/ThemeService.d.ts +49 -0
  385. package/dist/shared/services/VirtualizationService.d.ts +51 -0
  386. package/dist/shared/state/store.d.ts +10 -0
  387. package/dist/shared/themes.d.ts +25 -0
  388. package/dist/shared/types/BaseProps.d.ts +17 -0
  389. package/dist/shared/types/common.d.ts +373 -0
  390. package/dist/shared/types/index.d.ts +2 -0
  391. package/dist/shared/utils/canvasUtils.d.ts +16 -0
  392. package/dist/shared/utils/commonUtils.d.ts +28 -0
  393. package/dist/shared/utils/csvUtils.d.ts +7 -0
  394. package/dist/shared/utils/dateUtils.d.ts +5 -0
  395. package/dist/shared/utils/dndUtils.d.ts +16 -0
  396. package/dist/shared/utils/formatUtils.d.ts +20 -0
  397. package/dist/shared/utils/imperativeApiUtils.d.ts +36 -0
  398. package/dist/shared/utils/index.d.ts +11 -0
  399. package/dist/shared/utils/renderUtils.d.ts +6 -0
  400. package/dist/shared/utils/serviceUtils.d.ts +10 -0
  401. package/dist/shared/utils/styleUtils.d.ts +121 -0
  402. package/dist/shared/utils/validationUtils.d.ts +16 -0
  403. package/dist/signature.cjs +1 -1
  404. package/dist/signature.d.ts +2 -410
  405. package/dist/signature.es.js +2 -4
  406. package/dist/table.cjs +1 -1
  407. package/dist/table.d.ts +2 -1059
  408. package/dist/table.es.js +2 -17
  409. package/dist/theme-vars.css +143 -135
  410. package/dist/tooltip-B1wC9m05.js +16 -0
  411. package/dist/tooltip-Qmzrg5u5.cjs +1 -0
  412. package/dist/treeview.cjs +1 -1
  413. package/dist/treeview.d.ts +2 -656
  414. package/dist/treeview.es.js +2 -954
  415. package/dist/useComponentState-DiSFLYju.js +57 -0
  416. package/dist/useComponentState-Wcz6pjd6.cjs +1 -0
  417. package/dist/useImperativeAPI-Dbx2hMTb.js +7 -0
  418. package/dist/useImperativeAPI-VrgLwXEO.cjs +1 -0
  419. package/dist/useInitCoreServices-CuBrviDM.js +40 -0
  420. package/dist/useInitCoreServices-DlALVDNx.cjs +1 -0
  421. package/dist/useService-CnCBGG3G.js +10 -0
  422. package/dist/useService-CyF782jv.cjs +1 -0
  423. package/dist/useServiceState-CkrJZm1D.js +21 -0
  424. package/dist/useServiceState-PyYQWxHi.cjs +1 -0
  425. package/package.json +76 -56
  426. package/dist/EzContextMenu-B6HBUjWv.cjs +0 -5
  427. package/dist/EzContextMenu-BSA_B6Pr.js +0 -3500
  428. package/dist/EzErrorBoundary-CEdz_hDo.cjs +0 -41
  429. package/dist/EzErrorBoundary-D4NBadES.js +0 -3727
  430. package/dist/EzEventModal-BUMp_BFi.js +0 -689
  431. package/dist/EzEventModal-xzHfzi0O.cjs +0 -1
  432. package/dist/EzGroupingPanel-BUsIYDRi.js +0 -143
  433. package/dist/EzGroupingPanel-D0HdSomF.cjs +0 -1
  434. package/dist/EzSchedulerQuickAdd-C653LTGh.js +0 -118
  435. package/dist/EzSchedulerQuickAdd-UnOWCpJd.cjs +0 -1
  436. package/dist/EzSchedulerToolbar-C-5OdRY6.cjs +0 -1
  437. package/dist/EzSchedulerToolbar-CO5jjDQg.js +0 -240
  438. package/dist/EzSignature-BaNesxwC.cjs +0 -1
  439. package/dist/EzSignature-D4EYwo9W.js +0 -419
  440. package/dist/EzTableEditDialog-Cd948V1C.js +0 -63
  441. package/dist/EzTableEditDialog-NiOubaMT.cjs +0 -1
  442. package/dist/EzTableFooter-CWjfGCjL.cjs +0 -1
  443. package/dist/EzTableFooter-DveD12RC.js +0 -54
  444. package/dist/EzTableToolbar-Bz8UWv6j.js +0 -246
  445. package/dist/EzTableToolbar-DHE7Bb1R.cjs +0 -1
  446. package/dist/HighlightText-8D6KEyBw.js +0 -68
  447. package/dist/HighlightText-LtZmzCle.cjs +0 -1
  448. package/dist/NotificationPanel-D2Y-_ahk.js +0 -68
  449. package/dist/NotificationPanel-zLxrtTGf.cjs +0 -1
  450. package/dist/TooltipWrapper-BrRTi5EJ.js +0 -2021
  451. package/dist/TooltipWrapper-DWts4bAI.cjs +0 -1
  452. package/dist/avatar-BeK0E4mn.js +0 -41
  453. package/dist/avatar-DZAaTK2f.cjs +0 -1
  454. package/dist/bell-DAz8P0BR.js +0 -14
  455. package/dist/bell-DOX2y38e.cjs +0 -1
  456. package/dist/calendar-BMZ8ddOf.cjs +0 -1
  457. package/dist/calendar-Dy3rVMW2.js +0 -90
  458. package/dist/checkbox-B0lGHUyy.cjs +0 -1
  459. package/dist/checkbox-boJRxICT.js +0 -46
  460. package/dist/chevron-down-C3s8jU6B.js +0 -5
  461. package/dist/chevron-down-DZVL7VHW.cjs +0 -1
  462. package/dist/chevron-left-BFr8XZyF.js +0 -5
  463. package/dist/chevron-left-HWhRo6IH.cjs +0 -1
  464. package/dist/circle-alert-77QqFR-z.cjs +0 -1
  465. package/dist/circle-alert-B2AMDd8N.js +0 -9
  466. package/dist/circle-x-Cv7bfIC_.js +0 -9
  467. package/dist/circle-x-DwVXxhXr.cjs +0 -1
  468. package/dist/date-time-picker-DTxHdPgQ.cjs +0 -1
  469. package/dist/date-time-picker-Dj2eftJI.js +0 -1636
  470. package/dist/download-0ZhO2XaW.cjs +0 -1
  471. package/dist/download-panVHmk6.js +0 -9
  472. package/dist/ellipsis-CuqNthAj.js +0 -9
  473. package/dist/ellipsis-CzlqJf-i.cjs +0 -1
  474. package/dist/grip-vertical-CSyDKBul.js +0 -12
  475. package/dist/grip-vertical-DZNBW1Dn.cjs +0 -1
  476. package/dist/index-B3ipEEhH.cjs +0 -2
  477. package/dist/index-BPPb7bcs.js +0 -3220
  478. package/dist/index-BQKw_Vho.js +0 -9604
  479. package/dist/index-C5STgBSy.js +0 -5203
  480. package/dist/index-C6NfgycP.js +0 -4644
  481. package/dist/index-D4f2ZdrG.cjs +0 -2
  482. package/dist/index-DUY1SqMo.cjs +0 -1
  483. package/dist/index-c1Zg--dt.cjs +0 -7
  484. package/dist/input-BgM_la4k.cjs +0 -1
  485. package/dist/input-jYQ5VKNR.js +0 -21
  486. package/dist/isBefore-C3Y_wbk3.js +0 -15
  487. package/dist/isBefore-Cp1ttk6q.cjs +0 -1
  488. package/dist/label-ClOW9UCt.js +0 -55
  489. package/dist/label-Dx6oDB-X.cjs +0 -1
  490. package/dist/layers-BA4i1fYX.js +0 -27
  491. package/dist/layers-xSPd-hz3.cjs +0 -1
  492. package/dist/popover-BJq1CKmi.cjs +0 -1
  493. package/dist/popover-Cmlb7w3R.js +0 -341
  494. package/dist/scroll-area-9fwpVNxT.js +0 -573
  495. package/dist/scroll-area-CwwZSSA4.cjs +0 -1
  496. package/dist/select-GxA46anr.cjs +0 -1
  497. package/dist/select-mDCun_IR.js +0 -35
  498. package/dist/settings-CvyjK75A.js +0 -31
  499. package/dist/settings-DKPknrt8.cjs +0 -1
  500. package/dist/sortable.esm-CsRPuXyD.cjs +0 -1
  501. package/dist/sortable.esm-CzMCDPet.js +0 -477
  502. package/dist/tooltip-B41iztKT.cjs +0 -1
  503. package/dist/tooltip-BCtrEe0z.js +0 -490
  504. package/dist/useComponentState-C87xXa5d.js +0 -64
  505. package/dist/useComponentState-DDgGbBXv.cjs +0 -1
  506. package/dist/useImperativeAPI-DXmCQvPL.js +0 -7
  507. package/dist/useImperativeAPI-DbZ3owSV.cjs +0 -1
  508. package/dist/useInitCoreServices-CwXv2p4S.cjs +0 -1
  509. package/dist/useInitCoreServices-D1WaWlaI.js +0 -3929
  510. package/dist/useService-8OoezWr8.cjs +0 -1
  511. package/dist/useService-BUi3uAqE.js +0 -10
  512. package/dist/useServiceState-BjpCjUn2.cjs +0 -1
  513. package/dist/useServiceState-VE-viK8b.js +0 -24
@@ -0,0 +1,2545 @@
1
+ import { _ as e } from "./EzProvider-AlmsYIDk.js";
2
+ import { t } from "./button-CYyNwV8S.js";
3
+ import { t as n } from "./input-Cj3sQK3M.js";
4
+ import { a as r, i, n as a, r as o, t as s } from "./select-D4tFaSai.js";
5
+ import { a as c, o as l, r as u, s as d, t as f } from "./card-ZUNxcdIM.js";
6
+ import { t as p } from "./DeleteConfirmationModal-p8XGDGIw.js";
7
+ import m from "react";
8
+ import { AlertCircle as h, Box as g, CheckCircle2 as ee, ChevronDown as _, ChevronLeft as v, ChevronRight as y, Circle as b, Clock as x, Cloud as S, Diamond as C, Download as w, GitBranch as T, GripVertical as te, Hand as ne, PanelLeft as re, PanelLeftClose as ie, Play as E, Redo2 as ae, RefreshCw as oe, Repeat as se, Rocket as ce, Save as le, Send as ue, Square as de, SquareStack as fe, Trash2 as D, Undo2 as pe, Upload as me, User as he, Wand2 as ge, X as O, Zap as _e } from "lucide-react";
9
+ import { Fragment as k, jsx as A, jsxs as j } from "react/jsx-runtime";
10
+ import { Background as ve, BaseEdge as ye, Controls as be, EdgeLabelRenderer as xe, Handle as M, NodeResizer as N, Position as P, ReactFlow as Se, ReactFlowProvider as Ce, addEdge as we, applyEdgeChanges as Te, applyNodeChanges as Ee, getSmoothStepPath as De, useReactFlow as Oe } from "@xyflow/react";
11
+ //#region src/components/EzFlow/nodes/StartNode.tsx
12
+ var F = m.memo(({ data: t, selected: n }) => {
13
+ let { label: r, description: i } = t;
14
+ return /* @__PURE__ */ j("div", {
15
+ className: e("group relative flex flex-col items-center gap-1 px-6 py-3 rounded-full", "border-2 transition-all duration-200", "bg-emerald-500/10 border-emerald-500/40 text-emerald-500", "shadow-[0_0_20px_rgba(16,185,129,0.08)]", n && "ring-4 ring-emerald-500/20 scale-105 border-emerald-500 shadow-[0_0_30px_rgba(16,185,129,0.2)]"),
16
+ role: "group",
17
+ "aria-label": `Start node: ${r || "Start"}`,
18
+ children: [
19
+ /* @__PURE__ */ j("div", {
20
+ className: "flex items-center gap-2",
21
+ children: [/* @__PURE__ */ A(E, {
22
+ size: 14,
23
+ className: "fill-emerald-500"
24
+ }), /* @__PURE__ */ A("span", {
25
+ className: "text-[11px] font-black uppercase tracking-[0.2em]",
26
+ children: r || "START"
27
+ })]
28
+ }),
29
+ i && /* @__PURE__ */ A("span", {
30
+ className: "text-[8px] opacity-50 uppercase tracking-tight",
31
+ children: i
32
+ }),
33
+ /* @__PURE__ */ A(M, {
34
+ type: "source",
35
+ position: P.Bottom,
36
+ className: "!w-4 !h-4 !bg-emerald-500 !border-[3px] !border-background !-bottom-2 shadow-lg shadow-emerald-500/30",
37
+ "aria-label": "Output connection"
38
+ })
39
+ ]
40
+ });
41
+ });
42
+ F.displayName = "StartNode";
43
+ //#endregion
44
+ //#region src/components/EzFlow/nodes/EndNode.tsx
45
+ var I = m.memo(({ data: t, selected: n }) => {
46
+ let { label: r, description: i } = t;
47
+ return /* @__PURE__ */ j("div", {
48
+ className: e("group relative flex items-center gap-3 px-6 py-3 rounded-full", "border-2 transition-all duration-200", "bg-rose-500/10 border-rose-500/30 text-rose-400", "shadow-xl", n && "ring-4 ring-rose-500/20 scale-105 border-rose-500/60"),
49
+ role: "group",
50
+ "aria-label": `End node: ${r || "End"}`,
51
+ children: [
52
+ /* @__PURE__ */ A(M, {
53
+ type: "target",
54
+ position: P.Top,
55
+ className: "!w-4 !h-4 !bg-rose-500 !border-[3px] !border-background",
56
+ "aria-label": "Input connection"
57
+ }),
58
+ /* @__PURE__ */ A(de, {
59
+ size: 10,
60
+ className: "fill-rose-500 text-rose-500"
61
+ }),
62
+ /* @__PURE__ */ j("div", {
63
+ className: "flex flex-col",
64
+ children: [/* @__PURE__ */ A("span", {
65
+ className: "text-[11px] font-black uppercase tracking-[0.2em]",
66
+ children: r || "END"
67
+ }), i && /* @__PURE__ */ A("span", {
68
+ className: "text-[8px] opacity-40 uppercase tracking-tight",
69
+ children: i
70
+ })]
71
+ })
72
+ ]
73
+ });
74
+ });
75
+ I.displayName = "EndNode";
76
+ //#endregion
77
+ //#region src/components/EzFlow/nodes/DecisionNode.tsx
78
+ var L = m.memo(({ data: t, selected: n }) => {
79
+ let { label: r } = t, [i, a] = m.useState(!1);
80
+ return /* @__PURE__ */ j("div", {
81
+ className: "relative w-full h-full group",
82
+ onPointerDownCapture: (e) => {
83
+ let t = e.target.closest(".react-flow__resize-control");
84
+ if (t) {
85
+ let e = t.getAttribute("data-handlepos")?.includes("-");
86
+ a(!!e);
87
+ }
88
+ },
89
+ role: "group",
90
+ "aria-label": `Decision node: ${r || "Decision"}`,
91
+ children: [
92
+ /* @__PURE__ */ A(N, {
93
+ color: "oklch(var(--primary))",
94
+ isVisible: n,
95
+ minWidth: 100,
96
+ minHeight: 100,
97
+ keepAspectRatio: i,
98
+ handleClassName: e("!w-3 !h-3 !bg-white !border-2 transition-all hover:!scale-125 !z-[70] shadow-sm", "data-[handlepos^='top-']:!rounded-sm data-[handlepos^='bottom-']:!rounded-sm !border-indigo-600", "data-[handlepos='top']:!rounded-full data-[handlepos='bottom']:!rounded-full data-[handlepos='left']:!rounded-full data-[handlepos='right']:!rounded-full !border-slate-400"),
99
+ lineClassName: "!border-indigo-500/30"
100
+ }),
101
+ /* @__PURE__ */ A(M, {
102
+ type: "target",
103
+ position: P.Top,
104
+ className: "!w-4 !h-4 !bg-amber-500 !border-2 !border-background !z-50",
105
+ style: { top: -8 },
106
+ "aria-label": "Input connection"
107
+ }),
108
+ /* @__PURE__ */ A(M, {
109
+ type: "source",
110
+ position: P.Right,
111
+ id: "yes",
112
+ className: "!w-4 !h-4 !bg-emerald-500 !border-2 !border-background !z-50",
113
+ style: {
114
+ right: -8,
115
+ top: "50%"
116
+ },
117
+ "aria-label": "Yes path"
118
+ }),
119
+ /* @__PURE__ */ A(M, {
120
+ type: "source",
121
+ position: P.Bottom,
122
+ id: "no",
123
+ className: "!w-4 !h-4 !bg-rose-500 !border-2 !border-background !z-50",
124
+ style: { bottom: -8 },
125
+ "aria-label": "No path"
126
+ }),
127
+ /* @__PURE__ */ A("div", {
128
+ className: e("absolute inset-0 transition-all duration-200", "border-2 border-amber-500/40 bg-amber-500/10 backdrop-blur-xl", n && "border-amber-500 bg-amber-500/20 shadow-[0_0_30px_rgba(245,158,11,0.3)]"),
129
+ style: { clipPath: "polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%)" }
130
+ }),
131
+ /* @__PURE__ */ j("div", {
132
+ className: "absolute inset-0 flex flex-col items-center justify-center z-10 pointer-events-none px-6",
133
+ children: [/* @__PURE__ */ A("span", {
134
+ className: "text-[8px] uppercase font-black tracking-widest text-amber-500/80 mb-0.5",
135
+ children: "Decision"
136
+ }), /* @__PURE__ */ A("span", {
137
+ className: "text-[11px] font-bold leading-tight text-foreground text-center max-w-[70px] truncate",
138
+ children: r
139
+ })]
140
+ }),
141
+ /* @__PURE__ */ A("div", {
142
+ className: "absolute -right-8 top-1/2 -translate-y-1/2 text-[9px] font-black text-emerald-400 pointer-events-none tracking-widest select-none z-20",
143
+ children: "YES"
144
+ }),
145
+ /* @__PURE__ */ A("div", {
146
+ className: "absolute -bottom-5 left-1/2 -translate-x-1/2 text-[9px] font-black text-rose-400 pointer-events-none tracking-widest select-none z-20",
147
+ children: "NO"
148
+ })
149
+ ]
150
+ });
151
+ });
152
+ L.displayName = "DecisionNode";
153
+ //#endregion
154
+ //#region src/components/EzFlow/nodes/LoopNode.tsx
155
+ var R = m.memo(({ data: t, selected: n }) => {
156
+ let { label: r, description: i, maxIterations: a } = t, [o, s] = m.useState(!1);
157
+ return /* @__PURE__ */ j("div", {
158
+ className: "w-full h-full relative group",
159
+ onPointerDownCapture: (e) => {
160
+ let t = e.target.closest(".react-flow__resize-control");
161
+ if (t) {
162
+ let e = t.getAttribute("data-handlepos")?.includes("-");
163
+ s(!!e);
164
+ }
165
+ },
166
+ children: [/* @__PURE__ */ A(N, {
167
+ color: "oklch(var(--primary))",
168
+ isVisible: n,
169
+ minWidth: 160,
170
+ minHeight: 80,
171
+ keepAspectRatio: o,
172
+ handleClassName: e("!w-3 !h-3 !bg-white !border-2 transition-all hover:!scale-125 !z-[70] shadow-sm", "data-[handlepos^='top-']:!rounded-sm data-[handlepos^='bottom-']:!rounded-sm !border-indigo-600", "data-[handlepos='top']:!rounded-full data-[handlepos='bottom']:!rounded-full data-[handlepos='left']:!rounded-full data-[handlepos='right']:!rounded-full !border-slate-400"),
173
+ lineClassName: "!border-indigo-500/30"
174
+ }), /* @__PURE__ */ j(f, {
175
+ className: e("w-full h-full rounded-2xl transition-all duration-200 overflow-hidden", "border-2 border-orange-500/30 bg-orange-500/5 backdrop-blur-xl", n && "ring-2 ring-orange-500/40 border-orange-500 shadow-lg"),
176
+ role: "group",
177
+ "aria-label": `Loop node: ${r || "Loop"}`,
178
+ children: [
179
+ /* @__PURE__ */ A(M, {
180
+ type: "target",
181
+ position: P.Top,
182
+ className: "!w-3.5 !h-3.5 !bg-orange-500 !border-[3px] !border-background !z-50",
183
+ "aria-label": "Input connection"
184
+ }),
185
+ /* @__PURE__ */ j(c, {
186
+ className: "p-4 space-y-1",
187
+ children: [
188
+ /* @__PURE__ */ j("div", {
189
+ className: "flex items-center gap-2",
190
+ children: [/* @__PURE__ */ A("div", {
191
+ className: "flex items-center justify-center w-8 h-8 rounded-lg bg-orange-500/15",
192
+ children: /* @__PURE__ */ A(se, {
193
+ size: 16,
194
+ className: "text-orange-500"
195
+ })
196
+ }), /* @__PURE__ */ j("div", {
197
+ className: "flex-1 min-w-0",
198
+ children: [/* @__PURE__ */ A("div", {
199
+ className: "text-[9px] uppercase font-bold tracking-widest text-orange-500/70",
200
+ children: "Loop"
201
+ }), /* @__PURE__ */ A(l, {
202
+ className: "text-sm font-semibold truncate",
203
+ children: r
204
+ })]
205
+ })]
206
+ }),
207
+ i && /* @__PURE__ */ A(u, {
208
+ className: "text-xs line-clamp-2",
209
+ children: i
210
+ }),
211
+ a && /* @__PURE__ */ j("div", {
212
+ className: "text-[10px] text-orange-400/80 font-medium",
213
+ children: [
214
+ "Max: ",
215
+ a,
216
+ " iterations"
217
+ ]
218
+ })
219
+ ]
220
+ }),
221
+ /* @__PURE__ */ A(M, {
222
+ type: "source",
223
+ position: P.Bottom,
224
+ className: "!w-3.5 !h-3.5 !bg-orange-500 !border-[3px] !border-background !z-50",
225
+ "aria-label": "Output connection"
226
+ }),
227
+ /* @__PURE__ */ A(M, {
228
+ type: "source",
229
+ position: P.Left,
230
+ id: "loop-back",
231
+ className: "!w-3 !h-3 !bg-orange-400/70 !border-2 !border-background !z-50",
232
+ "aria-label": "Loop back connection"
233
+ })
234
+ ]
235
+ })]
236
+ });
237
+ });
238
+ R.displayName = "LoopNode";
239
+ //#endregion
240
+ //#region src/components/EzFlow/nodes/ActionNode.tsx
241
+ var z = m.memo(({ data: t, selected: n }) => {
242
+ let { label: r, description: i, actionType: a } = t, [o, s] = m.useState(!1);
243
+ return /* @__PURE__ */ j("div", {
244
+ className: "w-full h-full relative group",
245
+ onPointerDownCapture: (e) => {
246
+ let t = e.target.closest(".react-flow__resize-control");
247
+ if (t) {
248
+ let e = t.getAttribute("data-handlepos")?.includes("-");
249
+ s(!!e);
250
+ }
251
+ },
252
+ children: [/* @__PURE__ */ A(N, {
253
+ color: "oklch(var(--primary))",
254
+ isVisible: n,
255
+ minWidth: 160,
256
+ minHeight: 80,
257
+ keepAspectRatio: o,
258
+ handleClassName: e("!w-3 !h-3 !bg-white !border-2 transition-all hover:!scale-125 !z-[70] shadow-sm", "data-[handlepos^='top-']:!rounded-sm data-[handlepos^='bottom-']:!rounded-sm !border-indigo-600", "data-[handlepos='top']:!rounded-full data-[handlepos='bottom']:!rounded-full data-[handlepos='left']:!rounded-full data-[handlepos='right']:!rounded-full !border-slate-400"),
259
+ lineClassName: "!border-indigo-500/30"
260
+ }), /* @__PURE__ */ j(f, {
261
+ className: e("w-full h-full rounded-2xl transition-all duration-200 overflow-hidden", "border-2 border-blue-500/30 bg-blue-500/5 backdrop-blur-xl", n && "ring-2 ring-blue-500/40 border-blue-500 shadow-lg"),
262
+ role: "group",
263
+ "aria-label": `Action node: ${r || "Action"}`,
264
+ children: [
265
+ /* @__PURE__ */ A(M, {
266
+ type: "target",
267
+ position: P.Top,
268
+ className: "!w-3.5 !h-3.5 !bg-blue-500 !border-[3px] !border-background !z-50",
269
+ "aria-label": "Input connection"
270
+ }),
271
+ /* @__PURE__ */ j(c, {
272
+ className: "p-4 space-y-1",
273
+ children: [
274
+ /* @__PURE__ */ j("div", {
275
+ className: "flex items-center gap-2",
276
+ children: [/* @__PURE__ */ A("div", {
277
+ className: "flex items-center justify-center w-8 h-8 rounded-lg bg-blue-500/15",
278
+ children: /* @__PURE__ */ A(_e, {
279
+ size: 16,
280
+ className: "text-blue-500"
281
+ })
282
+ }), /* @__PURE__ */ j("div", {
283
+ className: "flex-1 min-w-0",
284
+ children: [/* @__PURE__ */ A("div", {
285
+ className: "text-[9px] uppercase font-bold tracking-widest text-blue-500/70",
286
+ children: "Action"
287
+ }), /* @__PURE__ */ A(l, {
288
+ className: "text-sm font-semibold truncate",
289
+ children: r
290
+ })]
291
+ })]
292
+ }),
293
+ i && /* @__PURE__ */ A(u, {
294
+ className: "text-xs line-clamp-2",
295
+ children: i
296
+ }),
297
+ a && /* @__PURE__ */ A("div", {
298
+ className: "text-[10px] text-blue-400/80 font-medium mt-1",
299
+ children: a
300
+ })
301
+ ]
302
+ }),
303
+ /* @__PURE__ */ A(M, {
304
+ type: "source",
305
+ position: P.Bottom,
306
+ className: "!w-3.5 !h-3.5 !bg-blue-500 !border-[3px] !border-background !z-50",
307
+ "aria-label": "Output connection"
308
+ })
309
+ ]
310
+ })]
311
+ });
312
+ });
313
+ z.displayName = "ActionNode";
314
+ //#endregion
315
+ //#region src/components/EzFlow/nodes/RequestNode.tsx
316
+ var B = m.memo(({ data: t, selected: n }) => {
317
+ let { label: r, description: i, method: a, url: o } = t, [s, d] = m.useState(!1);
318
+ return /* @__PURE__ */ j("div", {
319
+ className: "w-full h-full relative group",
320
+ onPointerDownCapture: (e) => {
321
+ let t = e.target.closest(".react-flow__resize-control");
322
+ if (t) {
323
+ let e = t.getAttribute("data-handlepos")?.includes("-");
324
+ d(!!e);
325
+ }
326
+ },
327
+ children: [/* @__PURE__ */ A(N, {
328
+ color: "oklch(var(--primary))",
329
+ isVisible: n,
330
+ minWidth: 200,
331
+ minHeight: 100,
332
+ keepAspectRatio: s,
333
+ handleClassName: e("!w-3 !h-3 !bg-white !border-2 transition-all hover:!scale-125 !z-[70] shadow-sm", "data-[handlepos^='top-']:!rounded-sm data-[handlepos^='bottom-']:!rounded-sm !border-indigo-600", "data-[handlepos='top']:!rounded-full data-[handlepos='bottom']:!rounded-full data-[handlepos='left']:!rounded-full data-[handlepos='right']:!rounded-full !border-slate-400"),
334
+ lineClassName: "!border-indigo-500/30"
335
+ }), /* @__PURE__ */ j(f, {
336
+ className: e("w-full h-full rounded-2xl transition-all duration-200 overflow-hidden", "border-2 border-indigo-500/30 bg-indigo-500/5 backdrop-blur-xl", n && "ring-2 ring-indigo-500/40 border-indigo-500 shadow-lg"),
337
+ role: "group",
338
+ "aria-label": `Request node: ${r || "HTTP Request"}`,
339
+ children: [
340
+ /* @__PURE__ */ A(M, {
341
+ type: "target",
342
+ position: P.Top,
343
+ className: "!w-3.5 !h-3.5 !bg-indigo-500 !border-[3px] !border-background !z-50",
344
+ "aria-label": "Input connection"
345
+ }),
346
+ /* @__PURE__ */ j(c, {
347
+ className: "p-4 space-y-1",
348
+ children: [
349
+ /* @__PURE__ */ j("div", {
350
+ className: "flex items-center gap-2",
351
+ children: [/* @__PURE__ */ A("div", {
352
+ className: "flex items-center justify-center w-8 h-8 rounded-lg bg-indigo-500/15",
353
+ children: /* @__PURE__ */ A(S, {
354
+ size: 16,
355
+ className: "text-indigo-500"
356
+ })
357
+ }), /* @__PURE__ */ j("div", {
358
+ className: "flex-1 min-w-0",
359
+ children: [/* @__PURE__ */ A("div", {
360
+ className: "text-[9px] uppercase font-bold tracking-widest text-indigo-500/70",
361
+ children: "HTTP Request"
362
+ }), /* @__PURE__ */ A(l, {
363
+ className: "text-sm font-semibold truncate",
364
+ children: r
365
+ })]
366
+ })]
367
+ }),
368
+ i && /* @__PURE__ */ A(u, {
369
+ className: "text-xs line-clamp-2",
370
+ children: i
371
+ }),
372
+ (a || o) && /* @__PURE__ */ j("div", {
373
+ className: "flex items-center gap-2 mt-1",
374
+ children: [a && /* @__PURE__ */ A("span", {
375
+ className: "text-[9px] font-black uppercase tracking-wider px-2 py-0.5 rounded-full bg-indigo-500/20 text-indigo-400",
376
+ children: a
377
+ }), o && /* @__PURE__ */ A("span", {
378
+ className: "text-[10px] text-muted-foreground truncate max-w-[120px]",
379
+ children: o
380
+ })]
381
+ })
382
+ ]
383
+ }),
384
+ /* @__PURE__ */ A(M, {
385
+ type: "source",
386
+ position: P.Bottom,
387
+ className: "!w-3.5 !h-3.5 !bg-indigo-500 !border-[3px] !border-background !z-50",
388
+ "aria-label": "Output connection"
389
+ })
390
+ ]
391
+ })]
392
+ });
393
+ });
394
+ B.displayName = "RequestNode";
395
+ //#endregion
396
+ //#region src/components/EzFlow/nodes/DelayNode.tsx
397
+ var ke = m.memo(({ data: t, selected: n }) => {
398
+ let { label: r, description: i, duration: a, unit: o } = t, s = () => a ? `${a} ${o || "minutes"}` : null, [d, p] = m.useState(!1);
399
+ return /* @__PURE__ */ j("div", {
400
+ className: "w-full h-full relative group",
401
+ onPointerDownCapture: (e) => {
402
+ let t = e.target.closest(".react-flow__resize-control");
403
+ if (t) {
404
+ let e = t.getAttribute("data-handlepos")?.includes("-");
405
+ p(!!e);
406
+ }
407
+ },
408
+ children: [/* @__PURE__ */ A(N, {
409
+ color: "oklch(var(--primary))",
410
+ isVisible: n,
411
+ minWidth: 160,
412
+ minHeight: 80,
413
+ keepAspectRatio: d,
414
+ handleClassName: e("!w-3 !h-3 !bg-white !border-2 transition-all hover:!scale-125 !z-[70] shadow-sm", "data-[handlepos^='top-']:!rounded-sm data-[handlepos^='bottom-']:!rounded-sm !border-indigo-600", "data-[handlepos='top']:!rounded-full data-[handlepos='bottom']:!rounded-full data-[handlepos='left']:!rounded-full data-[handlepos='right']:!rounded-full !border-slate-400"),
415
+ lineClassName: "!border-indigo-500/30"
416
+ }), /* @__PURE__ */ j(f, {
417
+ className: e("w-full h-full rounded-2xl transition-all duration-200 overflow-hidden", "border-2 border-gray-400/30 bg-gray-500/5 backdrop-blur-xl", n && "ring-2 ring-gray-400/40 border-gray-400 shadow-lg"),
418
+ role: "group",
419
+ "aria-label": `Delay node: ${r || "Delay"}`,
420
+ children: [
421
+ /* @__PURE__ */ A(M, {
422
+ type: "target",
423
+ position: P.Top,
424
+ className: "!w-3.5 !h-3.5 !bg-gray-400 !border-[3px] !border-background !z-50",
425
+ "aria-label": "Input connection"
426
+ }),
427
+ /* @__PURE__ */ j(c, {
428
+ className: "p-4 space-y-1",
429
+ children: [
430
+ /* @__PURE__ */ j("div", {
431
+ className: "flex items-center gap-2",
432
+ children: [/* @__PURE__ */ A("div", {
433
+ className: "flex items-center justify-center w-8 h-8 rounded-lg bg-gray-500/15",
434
+ children: /* @__PURE__ */ A(x, {
435
+ size: 16,
436
+ className: "text-gray-400"
437
+ })
438
+ }), /* @__PURE__ */ j("div", {
439
+ className: "flex-1 min-w-0",
440
+ children: [/* @__PURE__ */ A("div", {
441
+ className: "text-[9px] uppercase font-bold tracking-widest text-gray-400/70",
442
+ children: "Delay"
443
+ }), /* @__PURE__ */ A(l, {
444
+ className: "text-sm font-semibold truncate",
445
+ children: r
446
+ })]
447
+ })]
448
+ }),
449
+ i && /* @__PURE__ */ A(u, {
450
+ className: "text-xs line-clamp-2",
451
+ children: i
452
+ }),
453
+ s() && /* @__PURE__ */ j("div", {
454
+ className: "flex items-center gap-1.5 text-[10px] text-gray-400/80 font-medium mt-1",
455
+ children: [/* @__PURE__ */ A(x, { size: 10 }), s()]
456
+ })
457
+ ]
458
+ }),
459
+ /* @__PURE__ */ A(M, {
460
+ type: "source",
461
+ position: P.Bottom,
462
+ className: "!w-3.5 !h-3.5 !bg-gray-400 !border-[3px] !border-background !z-50",
463
+ "aria-label": "Output connection"
464
+ })
465
+ ]
466
+ })]
467
+ });
468
+ });
469
+ ke.displayName = "DelayNode";
470
+ //#endregion
471
+ //#region src/components/EzFlow/nodes/ApprovalNode.tsx
472
+ var V = m.memo(({ data: t, selected: n }) => {
473
+ let { label: r, description: i, approverRole: a, slaHours: o } = t, [s, d] = m.useState(!1);
474
+ return /* @__PURE__ */ j("div", {
475
+ className: "w-full h-full relative group",
476
+ onPointerDownCapture: (e) => {
477
+ let t = e.target.closest(".react-flow__resize-control");
478
+ if (t) {
479
+ let e = t.getAttribute("data-handlepos")?.includes("-");
480
+ d(!!e);
481
+ }
482
+ },
483
+ children: [/* @__PURE__ */ A(N, {
484
+ color: "oklch(var(--primary))",
485
+ isVisible: n,
486
+ minWidth: 200,
487
+ minHeight: 100,
488
+ keepAspectRatio: s,
489
+ handleClassName: e("!w-3 !h-3 !bg-white !border-2 transition-all hover:!scale-125 !z-[70] shadow-sm", "data-[handlepos^='top-']:!rounded-sm data-[handlepos^='bottom-']:!rounded-sm !border-indigo-600", "data-[handlepos='top']:!rounded-full data-[handlepos='bottom']:!rounded-full data-[handlepos='left']:!rounded-full data-[handlepos='right']:!rounded-full !border-slate-400"),
490
+ lineClassName: "!border-indigo-500/30"
491
+ }), /* @__PURE__ */ j(f, {
492
+ className: e("w-full h-full rounded-2xl transition-all duration-200 overflow-hidden", "border-2 border-purple-500/30 bg-purple-500/5 backdrop-blur-xl", n && "ring-2 ring-purple-500/40 border-purple-500 shadow-lg"),
493
+ role: "group",
494
+ "aria-label": `Approval node: ${r || "Approval"}`,
495
+ children: [
496
+ /* @__PURE__ */ A(M, {
497
+ type: "target",
498
+ position: P.Top,
499
+ className: "!w-3.5 !h-3.5 !bg-purple-500 !border-[3px] !border-background !z-50",
500
+ "aria-label": "Input connection"
501
+ }),
502
+ /* @__PURE__ */ j(c, {
503
+ className: "p-4 space-y-1",
504
+ children: [
505
+ /* @__PURE__ */ j("div", {
506
+ className: "flex items-center gap-2",
507
+ children: [/* @__PURE__ */ A("div", {
508
+ className: "flex items-center justify-center w-8 h-8 rounded-lg bg-purple-500/15",
509
+ children: /* @__PURE__ */ A(he, {
510
+ size: 16,
511
+ className: "text-purple-500"
512
+ })
513
+ }), /* @__PURE__ */ j("div", {
514
+ className: "flex-1 min-w-0",
515
+ children: [/* @__PURE__ */ A("div", {
516
+ className: "text-[9px] uppercase font-bold tracking-widest text-purple-500/70",
517
+ children: "Approval"
518
+ }), /* @__PURE__ */ A(l, {
519
+ className: "text-sm font-semibold truncate",
520
+ children: r
521
+ })]
522
+ })]
523
+ }),
524
+ i && /* @__PURE__ */ A(u, {
525
+ className: "text-xs line-clamp-2",
526
+ children: i
527
+ }),
528
+ /* @__PURE__ */ j("div", {
529
+ className: "flex flex-col gap-1 mt-1",
530
+ children: [a && /* @__PURE__ */ j("div", {
531
+ className: "flex items-center gap-1.5 text-[10px] text-purple-400/80 font-medium",
532
+ children: [
533
+ /* @__PURE__ */ A(he, { size: 10 }),
534
+ " ",
535
+ a
536
+ ]
537
+ }), o && /* @__PURE__ */ j("div", {
538
+ className: "flex items-center gap-1.5 text-[10px] text-purple-400/60 font-medium",
539
+ children: [
540
+ /* @__PURE__ */ A(x, { size: 10 }),
541
+ " ",
542
+ o,
543
+ "h SLA"
544
+ ]
545
+ })]
546
+ })
547
+ ]
548
+ }),
549
+ /* @__PURE__ */ A(M, {
550
+ type: "source",
551
+ position: P.Bottom,
552
+ id: "approved",
553
+ className: "!w-3.5 !h-3.5 !bg-emerald-500 !border-[3px] !border-background !z-50",
554
+ "aria-label": "Approved path"
555
+ }),
556
+ /* @__PURE__ */ A(M, {
557
+ type: "source",
558
+ position: P.Right,
559
+ id: "rejected",
560
+ className: "!w-3 !h-3 !bg-rose-500 !border-2 !border-background !z-50",
561
+ "aria-label": "Rejected path"
562
+ })
563
+ ]
564
+ })]
565
+ });
566
+ });
567
+ V.displayName = "ApprovalNode";
568
+ //#endregion
569
+ //#region src/components/EzFlow/nodes/GroupNode.tsx
570
+ var H = m.memo(({ data: t, selected: n }) => {
571
+ let { label: r, description: i } = t, [a, o] = m.useState(!1);
572
+ return /* @__PURE__ */ j("div", {
573
+ className: e("w-full h-full rounded-2xl transition-all duration-200 relative group", "border-2 border-dashed border-muted-foreground/20 bg-muted/5 backdrop-blur-sm", "p-4", n && "ring-2 ring-primary/30 border-primary/40 bg-muted/10"),
574
+ onPointerDownCapture: (e) => {
575
+ let t = e.target.closest(".react-flow__resize-control");
576
+ if (t) {
577
+ let e = t.getAttribute("data-handlepos")?.includes("-");
578
+ o(!!e);
579
+ }
580
+ },
581
+ role: "group",
582
+ "aria-label": `Group node: ${r || "Group"}`,
583
+ children: [
584
+ /* @__PURE__ */ A(N, {
585
+ color: "oklch(var(--primary))",
586
+ isVisible: n,
587
+ minWidth: 200,
588
+ minHeight: 150,
589
+ keepAspectRatio: a,
590
+ handleClassName: e("!w-3 !h-3 !bg-white !border-2 transition-all hover:!scale-125 !z-[70] shadow-sm", "data-[handlepos^='top-']:!rounded-sm data-[handlepos^='bottom-']:!rounded-sm !border-indigo-600", "data-[handlepos='top']:!rounded-full data-[handlepos='bottom']:!rounded-full data-[handlepos='left']:!rounded-full data-[handlepos='right']:!rounded-full !border-slate-400"),
591
+ lineClassName: "!border-indigo-500/30"
592
+ }),
593
+ /* @__PURE__ */ j("div", {
594
+ className: "flex items-center gap-2 mb-4 pb-2 border-b border-dashed border-muted-foreground/10",
595
+ children: [/* @__PURE__ */ A(g, {
596
+ size: 14,
597
+ className: "text-muted-foreground/60"
598
+ }), /* @__PURE__ */ A("span", {
599
+ className: "text-[10px] font-bold uppercase tracking-widest text-muted-foreground/60",
600
+ children: r || "Sub-process"
601
+ })]
602
+ }),
603
+ i && /* @__PURE__ */ A("p", {
604
+ className: "text-[10px] text-muted-foreground/40 mb-4",
605
+ children: i
606
+ }),
607
+ /* @__PURE__ */ A(M, {
608
+ type: "target",
609
+ position: P.Top,
610
+ className: "!w-3 !h-3 !bg-muted-foreground/40 !border-2 !border-background",
611
+ "aria-label": "Input connection"
612
+ }),
613
+ /* @__PURE__ */ A(M, {
614
+ type: "source",
615
+ position: P.Bottom,
616
+ className: "!w-3 !h-3 !bg-muted-foreground/40 !border-2 !border-background",
617
+ "aria-label": "Output connection"
618
+ })
619
+ ]
620
+ });
621
+ });
622
+ H.displayName = "GroupNode";
623
+ //#endregion
624
+ //#region src/components/EzFlow/EzFlowEdge.tsx
625
+ var Ae = ({ sourceX: e, sourceY: n, targetX: r, targetY: i, sourcePosition: a, targetPosition: o, style: s = {}, markerEnd: c, selected: l, label: u, data: d, id: f, onDelete: p }) => {
626
+ let [m, h, g] = De({
627
+ sourceX: e,
628
+ sourceY: n,
629
+ sourcePosition: a,
630
+ targetX: r,
631
+ targetY: i,
632
+ targetPosition: o,
633
+ borderRadius: 16
634
+ });
635
+ return /* @__PURE__ */ j(k, { children: [
636
+ /* @__PURE__ */ A(ye, {
637
+ path: m,
638
+ markerEnd: c,
639
+ style: {
640
+ ...s,
641
+ strokeWidth: l ? 3 : 2,
642
+ stroke: l ? "oklch(var(--primary))" : "oklch(var(--foreground))",
643
+ transition: "stroke-width 0.2s ease, stroke 0.2s ease"
644
+ }
645
+ }),
646
+ (u || d?.label) && /* @__PURE__ */ A(xe, { children: /* @__PURE__ */ A("div", {
647
+ style: {
648
+ position: "absolute",
649
+ transform: `translate(-50%, -50%) translate(${h}px,${g}px)`,
650
+ pointerEvents: "all"
651
+ },
652
+ className: "nodrag nopan",
653
+ children: /* @__PURE__ */ A("div", {
654
+ className: "px-3 py-1 rounded-full bg-background/80 backdrop-blur-md border border-border text-[10px] font-bold uppercase tracking-widest text-primary shadow-lg",
655
+ children: u || d?.label
656
+ })
657
+ }) }),
658
+ l && /* @__PURE__ */ A(xe, { children: /* @__PURE__ */ A("div", {
659
+ style: {
660
+ position: "absolute",
661
+ transform: `translate(-50%, -50%) translate(${h}px,${g + 22}px)`,
662
+ pointerEvents: "all"
663
+ },
664
+ className: "nodrag nopan",
665
+ children: /* @__PURE__ */ A(t, {
666
+ variant: "destructive",
667
+ size: "icon",
668
+ className: "w-5 h-5 rounded-full shadow-md",
669
+ "aria-label": "Delete edge",
670
+ onClick: () => p?.(f),
671
+ children: /* @__PURE__ */ A(O, { className: "w-3 h-3" })
672
+ })
673
+ }) })
674
+ ] });
675
+ };
676
+ Ae.displayName = "EzFlowEdge";
677
+ //#endregion
678
+ //#region src/components/EzFlow/EzConnectionLine.tsx
679
+ var je = ({ fromX: e, fromY: t, toX: n, toY: r, fromPosition: i, toPosition: a, fromHandle: o }) => {
680
+ let [s] = De({
681
+ sourceX: e,
682
+ sourceY: t,
683
+ sourcePosition: i,
684
+ targetX: n,
685
+ targetY: r,
686
+ targetPosition: a,
687
+ borderRadius: 16
688
+ }), c = o?.id === "yes" || o?.id === "approved", l = o?.id === "no" || o?.id === "rejected", u = o?.id === "loop-back", d = c ? "oklch(0.627 0.154 160.06)" : l ? "oklch(0.577 0.245 27.325)" : u ? "oklch(0.7 0.15 45)" : "oklch(var(--primary))", f = c ? "YES?" : l ? "NO?" : u ? "LOOP" : "CONNECT";
689
+ return /* @__PURE__ */ j("g", { children: [
690
+ /* @__PURE__ */ A("path", {
691
+ fill: "none",
692
+ stroke: d,
693
+ strokeWidth: 2,
694
+ d: s,
695
+ style: { strokeDasharray: "6,4" }
696
+ }),
697
+ /* @__PURE__ */ A("circle", {
698
+ cx: n,
699
+ cy: r,
700
+ fill: "oklch(var(--background))",
701
+ r: 4,
702
+ stroke: d,
703
+ strokeWidth: 1.5
704
+ }),
705
+ /* @__PURE__ */ A("foreignObject", {
706
+ x: n + 10,
707
+ y: r - 12,
708
+ width: 80,
709
+ height: 30,
710
+ className: "pointer-events-none",
711
+ children: /* @__PURE__ */ A("div", {
712
+ className: "flex items-center",
713
+ children: /* @__PURE__ */ A("div", {
714
+ className: "px-2 py-0.5 rounded-full bg-background/80 backdrop-blur-md border border-border text-[8px] font-black uppercase tracking-tighter shadow-xl whitespace-nowrap",
715
+ style: { color: d },
716
+ children: f
717
+ })
718
+ })
719
+ })
720
+ ] });
721
+ };
722
+ je.displayName = "EzConnectionLine";
723
+ //#endregion
724
+ //#region src/components/EzFlow/EzFlowBackground.tsx
725
+ var Me = (e) => /* @__PURE__ */ A(ve, {
726
+ ...e,
727
+ color: "oklch(var(--border))",
728
+ variant: "dots",
729
+ gap: 24,
730
+ size: 1,
731
+ className: "opacity-40"
732
+ });
733
+ Me.displayName = "EzFlowBackground";
734
+ //#endregion
735
+ //#region src/components/EzFlow/EzFlowControls.tsx
736
+ var Ne = (e) => /* @__PURE__ */ A(be, {
737
+ ...e,
738
+ className: "!bg-card/80 !backdrop-blur-md !border !border-border !shadow-2xl !rounded-2xl !p-1 !flex !flex-row !gap-1 !m-4 !overflow-hidden",
739
+ showInteractive: !1,
740
+ "aria-label": "Canvas zoom and fit controls"
741
+ });
742
+ Ne.displayName = "EzFlowControls";
743
+ //#endregion
744
+ //#region src/components/EzFlow/EzFlowCanvas.tsx
745
+ var U = {
746
+ startNode: F,
747
+ endNode: I,
748
+ decisionNode: L,
749
+ loopNode: R,
750
+ actionNode: z,
751
+ requestNode: B,
752
+ delayNode: ke,
753
+ approvalNode: V,
754
+ groupNode: H
755
+ }, Pe = m.forwardRef(({ nodes: t, edges: n, onNodesChange: r, onEdgesChange: i, onConnect: a, onDrop: o, onDragOver: s, onNodeClick: c, onNodeDoubleClick: l, onEdgeClick: u, onEdgeDelete: d, onPaneClick: f, nodeTypes: p = U, edgeTypes: h, isValidConnection: g, snapToGrid: ee = !0, snapGrid: _ = [15, 15], showGrid: v = !0, fitView: y = !1, readOnly: b = !1, className: x, style: S, ...C }, w) => {
756
+ let T = m.useMemo(() => h ?? { ezEdge: (e) => /* @__PURE__ */ A(Ae, {
757
+ ...e,
758
+ onDelete: d
759
+ }) }, [h, d]), te = m.useCallback((e) => {
760
+ if (g) return g(e);
761
+ if (!e.source || !e.target || e.source === e.target) return !1;
762
+ let r = new Map(t.map((e) => [e.id, e])), i = /* @__PURE__ */ new Set(), a = [{
763
+ id: e.target,
764
+ path: [e.target]
765
+ }];
766
+ for (; a.length > 0;) {
767
+ let t = a.shift();
768
+ if (!(!t || i.has(t.id))) {
769
+ i.add(t.id);
770
+ for (let i of n) if (i.source === t.id) {
771
+ if (i.target === e.source) return [...t.path, i.target].some((e) => r.get(e)?.type === "loopNode");
772
+ a.push({
773
+ id: i.target,
774
+ path: [...t.path, i.target]
775
+ });
776
+ }
777
+ }
778
+ }
779
+ return !0;
780
+ }, [
781
+ n,
782
+ g,
783
+ t
784
+ ]);
785
+ return /* @__PURE__ */ A("div", {
786
+ ref: w,
787
+ className: e("w-full h-full min-h-0 relative", x),
788
+ style: S,
789
+ ...C,
790
+ children: /* @__PURE__ */ j(Se, {
791
+ nodes: t,
792
+ edges: n,
793
+ onNodesChange: b ? void 0 : r,
794
+ onEdgesChange: b ? void 0 : i,
795
+ onConnect: b ? void 0 : a,
796
+ onDrop: b ? void 0 : o,
797
+ onDragOver: b ? void 0 : s,
798
+ onNodeClick: c,
799
+ onNodeDoubleClick: l,
800
+ onEdgeClick: u,
801
+ onPaneClick: f,
802
+ nodeTypes: p,
803
+ edgeTypes: T,
804
+ connectionLineComponent: je,
805
+ isValidConnection: te,
806
+ fitView: y,
807
+ defaultViewport: {
808
+ x: 0,
809
+ y: 0,
810
+ zoom: 1
811
+ },
812
+ panOnScroll: !0,
813
+ zoomOnScroll: !1,
814
+ snapToGrid: ee,
815
+ snapGrid: _,
816
+ nodesDraggable: !b,
817
+ nodesConnectable: !b,
818
+ elementsSelectable: !b,
819
+ defaultEdgeOptions: {
820
+ type: "ezEdge",
821
+ animated: !0,
822
+ selectable: !0
823
+ },
824
+ proOptions: { hideAttribution: !0 },
825
+ children: [v && /* @__PURE__ */ A(Me, {
826
+ gap: _[0],
827
+ size: 1.5
828
+ }), /* @__PURE__ */ A(Ne, { "aria-label": "Canvas controls" })]
829
+ })
830
+ });
831
+ });
832
+ Pe.displayName = "EzFlowCanvas";
833
+ //#endregion
834
+ //#region src/components/EzFlow/EzFlowToolbox.tsx
835
+ var Fe = ({ category: e, isExpanded: t, onToggle: n, onNodeActivate: r }) => {
836
+ let i = (e, t) => {
837
+ e.dataTransfer.setData("application/reactflow", t), e.dataTransfer.setData("text/plain", t), e.dataTransfer.effectAllowed = "move";
838
+ };
839
+ return /* @__PURE__ */ j("div", {
840
+ className: "mb-2",
841
+ children: [/* @__PURE__ */ j("button", {
842
+ className: "w-full flex items-center gap-2 px-3 py-2 rounded-xl text-[10px] font-black uppercase tracking-widest text-muted-foreground/60 hover:bg-muted/30 transition-colors",
843
+ onClick: n,
844
+ "aria-expanded": t,
845
+ "aria-label": `Toggle ${e.categoryKey} section`,
846
+ children: [A(t ? _ : y, { size: 12 }), e.categoryKey]
847
+ }), t && /* @__PURE__ */ A("div", {
848
+ className: "flex flex-col gap-1.5 mt-1 px-1",
849
+ children: e.items.map((e) => /* @__PURE__ */ j("div", {
850
+ className: "group relative flex items-center gap-3 p-3 rounded-xl bg-background/30 border border-transparent hover:border-primary/30 hover:bg-primary/5 transition-all cursor-grab active:cursor-grabbing",
851
+ onDragStart: (t) => i(t, e.type),
852
+ onDoubleClick: () => r?.(e),
853
+ onKeyDown: (t) => {
854
+ (t.key === "Enter" || t.key === " ") && (t.preventDefault(), r?.(e));
855
+ },
856
+ draggable: !0,
857
+ role: "button",
858
+ tabIndex: 0,
859
+ "aria-label": `Drag ${e.labelKey} node`,
860
+ "data-ezflow-node-type": e.type,
861
+ children: [
862
+ /* @__PURE__ */ A("div", {
863
+ className: "absolute left-1 top-1/2 -translate-y-1/2 opacity-0 group-hover:opacity-30 transition-opacity",
864
+ children: /* @__PURE__ */ A(te, { size: 12 })
865
+ }),
866
+ /* @__PURE__ */ A("div", {
867
+ className: "flex items-center justify-center w-8 h-8 rounded-lg bg-primary/10 text-primary group-hover:scale-110 transition-transform ml-2",
868
+ children: e.icon
869
+ }),
870
+ /* @__PURE__ */ j("div", {
871
+ className: "flex flex-col min-w-0",
872
+ children: [/* @__PURE__ */ A("span", {
873
+ className: "text-xs font-bold leading-none mb-0.5 truncate",
874
+ children: e.labelKey
875
+ }), e.descriptionKey && /* @__PURE__ */ A("span", {
876
+ className: "text-[10px] text-muted-foreground leading-tight line-clamp-1",
877
+ children: e.descriptionKey
878
+ })]
879
+ })
880
+ ]
881
+ }, e.type))
882
+ })]
883
+ });
884
+ }, Ie = ({ categories: n, title: r = "Node Library", className: i, collapsed: a = !1, onCollapsedChange: o, onNodeActivate: s }) => {
885
+ let [c, l] = m.useState(new Set(n.map((e) => e.category))), u = (e) => {
886
+ l((t) => {
887
+ let n = new Set(t);
888
+ return n.has(e) ? n.delete(e) : n.add(e), n;
889
+ });
890
+ };
891
+ return a ? /* @__PURE__ */ j("aside", {
892
+ className: e("p-2 border-r border-border bg-card/30 backdrop-blur-md flex flex-col items-center", i),
893
+ "aria-label": "Node Library (collapsed)",
894
+ children: [/* @__PURE__ */ A(t, {
895
+ variant: "ghost",
896
+ size: "icon",
897
+ className: "rounded-xl mb-2",
898
+ onClick: () => o?.(!1),
899
+ "aria-label": "Expand node library",
900
+ children: /* @__PURE__ */ A(re, { size: 16 })
901
+ }), n.flatMap((e) => e.items.map((e) => /* @__PURE__ */ A("div", {
902
+ className: "w-10 h-10 flex items-center justify-center rounded-xl hover:bg-primary/10 cursor-grab active:cursor-grabbing transition-colors mb-1",
903
+ onDragStart: (t) => {
904
+ t.dataTransfer.setData("application/reactflow", e.type), t.dataTransfer.setData("text/plain", e.type), t.dataTransfer.effectAllowed = "move";
905
+ },
906
+ onDoubleClick: () => s?.(e),
907
+ onKeyDown: (t) => {
908
+ (t.key === "Enter" || t.key === " ") && (t.preventDefault(), s?.(e));
909
+ },
910
+ draggable: !0,
911
+ title: e.labelKey,
912
+ role: "button",
913
+ tabIndex: 0,
914
+ "aria-label": `Drag ${e.labelKey} node`,
915
+ "data-ezflow-node-type": e.type,
916
+ children: e.icon
917
+ }, e.type)))]
918
+ }) : /* @__PURE__ */ j("aside", {
919
+ className: e("w-72 p-4 border-r border-border bg-card/30 backdrop-blur-md flex flex-col gap-2 overflow-y-auto", i),
920
+ "aria-label": "Node Library",
921
+ children: [/* @__PURE__ */ j("div", {
922
+ className: "flex items-center justify-between mb-2",
923
+ children: [/* @__PURE__ */ A("div", {
924
+ className: "text-[10px] uppercase font-black tracking-widest text-primary/60 px-1",
925
+ children: r
926
+ }), o && /* @__PURE__ */ A(t, {
927
+ variant: "ghost",
928
+ size: "icon",
929
+ className: "rounded-xl w-7 h-7",
930
+ onClick: () => o(!0),
931
+ "aria-label": "Collapse node library",
932
+ children: /* @__PURE__ */ A(ie, { size: 14 })
933
+ })]
934
+ }), n.map((e) => /* @__PURE__ */ A(Fe, {
935
+ category: e,
936
+ isExpanded: c.has(e.category),
937
+ onToggle: () => u(e.category),
938
+ onNodeActivate: s
939
+ }, e.category))]
940
+ });
941
+ };
942
+ Ie.displayName = "EzFlowToolbox";
943
+ //#endregion
944
+ //#region src/components/EzFlow/EzFlowHeader.tsx
945
+ var W = {
946
+ draft: {
947
+ className: "bg-amber-500/15 text-amber-500 border-amber-500/30",
948
+ label: "Draft"
949
+ },
950
+ live: {
951
+ className: "bg-emerald-500/15 text-emerald-500 border-emerald-500/30",
952
+ label: "Live"
953
+ },
954
+ archived: {
955
+ className: "bg-gray-500/15 text-gray-400 border-gray-500/30",
956
+ label: "Archived"
957
+ }
958
+ }, Le = ({ title: n, description: r, status: i = "draft", isDirty: a = !1, onTitleChange: o, onDescriptionChange: s, onSave: c, onPublish: l, onCancel: u, showGrid: d = !0, onShowGridChange: f, snapToGrid: p = !0, onSnapToGridChange: h, className: g }) => {
959
+ let [ee, _] = m.useState(!1), [y, b] = m.useState(!1), [x, S] = m.useState(n), [C, w] = m.useState(r || ""), T = m.useRef(null), te = m.useRef(null);
960
+ m.useEffect(() => {
961
+ S(n);
962
+ }, [n]), m.useEffect(() => {
963
+ w(r || "");
964
+ }, [r]);
965
+ let ne = () => {
966
+ _(!1), x !== n && o?.(x);
967
+ }, re = () => {
968
+ b(!1), C !== r && s?.(C);
969
+ }, ie = () => {
970
+ a && !window.confirm("You have unsaved changes. Discard and exit?") || u?.();
971
+ }, E = W[i];
972
+ return /* @__PURE__ */ j("header", {
973
+ className: e("h-16 border-b border-border flex items-center justify-between px-6 bg-card/50 backdrop-blur-xl shrink-0", g),
974
+ role: "banner",
975
+ "aria-label": "Workflow designer header",
976
+ children: [/* @__PURE__ */ j("div", {
977
+ className: "flex items-center gap-4 min-w-0",
978
+ children: [
979
+ /* @__PURE__ */ A(t, {
980
+ variant: "ghost",
981
+ size: "icon",
982
+ className: "rounded-xl shrink-0",
983
+ onClick: ie,
984
+ "aria-label": "Go back",
985
+ children: /* @__PURE__ */ A(v, { size: 18 })
986
+ }),
987
+ /* @__PURE__ */ A("div", { className: "h-6 w-px bg-border shrink-0" }),
988
+ /* @__PURE__ */ j("div", {
989
+ className: "flex flex-col min-w-0",
990
+ children: [ee ? /* @__PURE__ */ A("input", {
991
+ ref: T,
992
+ value: x,
993
+ onChange: (e) => S(e.target.value),
994
+ onBlur: ne,
995
+ onKeyDown: (e) => {
996
+ e.key === "Enter" && ne(), e.key === "Escape" && (S(n), _(!1));
997
+ },
998
+ className: "text-base font-bold bg-transparent border-none outline-none ring-0 p-0 text-foreground w-full",
999
+ autoFocus: !0,
1000
+ "aria-label": "Workflow title"
1001
+ }) : /* @__PURE__ */ j("button", {
1002
+ className: "text-base font-bold text-left hover:text-primary transition-colors cursor-text truncate",
1003
+ onClick: () => {
1004
+ _(!0), setTimeout(() => T.current?.focus(), 0);
1005
+ },
1006
+ "aria-label": `Workflow title: ${x}. Click to edit`,
1007
+ children: [x || "Untitled Workflow", a && /* @__PURE__ */ A("span", {
1008
+ className: "ml-2 text-[9px] text-muted-foreground/50 font-normal",
1009
+ children: "(unsaved)"
1010
+ })]
1011
+ }), y ? /* @__PURE__ */ A("input", {
1012
+ ref: te,
1013
+ value: C,
1014
+ onChange: (e) => w(e.target.value),
1015
+ onBlur: re,
1016
+ onKeyDown: (e) => {
1017
+ e.key === "Enter" && re(), e.key === "Escape" && (w(r || ""), b(!1));
1018
+ },
1019
+ className: "text-[10px] uppercase tracking-widest text-muted-foreground bg-transparent border-none outline-none ring-0 p-0 w-full",
1020
+ autoFocus: !0,
1021
+ "aria-label": "Workflow description"
1022
+ }) : /* @__PURE__ */ A("button", {
1023
+ className: "text-[10px] uppercase tracking-widest text-muted-foreground/50 text-left hover:text-muted-foreground transition-colors cursor-text truncate",
1024
+ onClick: () => {
1025
+ b(!0), setTimeout(() => te.current?.focus(), 0);
1026
+ },
1027
+ "aria-label": `Description: ${C || "Click to add description"}`,
1028
+ children: C || "Click to add description"
1029
+ })]
1030
+ }),
1031
+ /* @__PURE__ */ A("div", {
1032
+ className: e("shrink-0 px-3 py-1 rounded-full border text-[10px] font-bold uppercase tracking-widest", E.className),
1033
+ role: "status",
1034
+ "aria-label": `Status: ${E.label}`,
1035
+ children: E.label
1036
+ })
1037
+ ]
1038
+ }), /* @__PURE__ */ j("div", {
1039
+ className: "flex items-center gap-6 shrink-0",
1040
+ children: [/* @__PURE__ */ j("div", {
1041
+ className: "flex items-center gap-4 bg-background/40 px-4 py-1.5 rounded-2xl border border-border/10",
1042
+ children: [
1043
+ /* @__PURE__ */ j("label", {
1044
+ className: "flex items-center gap-2 cursor-pointer group",
1045
+ children: [/* @__PURE__ */ A("input", {
1046
+ type: "checkbox",
1047
+ checked: d,
1048
+ onChange: (e) => f?.(e.target.checked),
1049
+ className: "w-4 h-4 rounded border-border text-primary focus:ring-primary/20 transition-all cursor-pointer"
1050
+ }), /* @__PURE__ */ A("span", {
1051
+ className: "text-[10px] uppercase tracking-wider font-bold text-muted-foreground group-hover:text-foreground transition-colors",
1052
+ children: "Grid"
1053
+ })]
1054
+ }),
1055
+ /* @__PURE__ */ A("div", { className: "w-px h-4 bg-border/20" }),
1056
+ /* @__PURE__ */ j("label", {
1057
+ className: "flex items-center gap-2 cursor-pointer group",
1058
+ children: [/* @__PURE__ */ A("input", {
1059
+ type: "checkbox",
1060
+ checked: p,
1061
+ onChange: (e) => h?.(e.target.checked),
1062
+ className: "w-4 h-4 rounded border-border text-primary focus:ring-primary/20 transition-all cursor-pointer"
1063
+ }), /* @__PURE__ */ A("span", {
1064
+ className: "text-[10px] uppercase tracking-wider font-bold text-muted-foreground group-hover:text-foreground transition-colors",
1065
+ children: "Snap"
1066
+ })]
1067
+ })
1068
+ ]
1069
+ }), /* @__PURE__ */ j("div", {
1070
+ className: "flex items-center gap-3",
1071
+ children: [
1072
+ /* @__PURE__ */ j(t, {
1073
+ variant: "ghost",
1074
+ className: "rounded-xl h-9 px-4 text-xs gap-2",
1075
+ onClick: ie,
1076
+ "aria-label": "Cancel changes",
1077
+ children: [/* @__PURE__ */ A(O, { size: 14 }), "Cancel"]
1078
+ }),
1079
+ /* @__PURE__ */ j(t, {
1080
+ className: "rounded-xl h-9 px-6 bg-primary text-primary-foreground gap-2 shadow-lg shadow-primary/20 text-xs font-bold",
1081
+ onClick: c,
1082
+ "aria-label": "Save workflow",
1083
+ children: [/* @__PURE__ */ A(le, { size: 14 }), "Save"]
1084
+ }),
1085
+ l && /* @__PURE__ */ j(t, {
1086
+ variant: "secondary",
1087
+ className: "rounded-xl h-9 px-4 text-xs gap-2 font-bold",
1088
+ onClick: l,
1089
+ "aria-label": "Publish workflow",
1090
+ children: [/* @__PURE__ */ A(ce, { size: 14 }), "Publish"]
1091
+ })
1092
+ ]
1093
+ })]
1094
+ })]
1095
+ });
1096
+ };
1097
+ Le.displayName = "EzFlowHeader";
1098
+ //#endregion
1099
+ //#region src/components/EzFlow/EzWorkflowValidation.tsx
1100
+ var Re = {
1101
+ nodes: [],
1102
+ edges: [],
1103
+ viewport: {
1104
+ x: 0,
1105
+ y: 0,
1106
+ zoom: 1
1107
+ },
1108
+ metadata: {
1109
+ title: "Untitled Workflow",
1110
+ status: "draft",
1111
+ version: 1
1112
+ }
1113
+ }, G = {
1114
+ startNode: {
1115
+ label: "Start",
1116
+ triggerType: "manual"
1117
+ },
1118
+ endNode: {
1119
+ label: "End",
1120
+ outcome: "success"
1121
+ },
1122
+ decisionNode: {
1123
+ label: "Decision",
1124
+ branches: []
1125
+ },
1126
+ loopNode: {
1127
+ label: "Loop",
1128
+ iteratorSource: "",
1129
+ maxIterations: 10
1130
+ },
1131
+ actionNode: {
1132
+ label: "Action",
1133
+ actionType: "",
1134
+ config: {}
1135
+ },
1136
+ requestNode: {
1137
+ label: "API Request",
1138
+ method: "GET",
1139
+ url: ""
1140
+ },
1141
+ delayNode: {
1142
+ label: "Delay",
1143
+ duration: 1,
1144
+ unit: "hours"
1145
+ },
1146
+ approvalNode: {
1147
+ label: "Approval",
1148
+ approverRole: ""
1149
+ },
1150
+ groupNode: {
1151
+ label: "Group",
1152
+ collapsed: !1
1153
+ }
1154
+ }, ze = {
1155
+ startNode: {
1156
+ type: "startNode",
1157
+ label: "Start",
1158
+ description: "Workflow entry point",
1159
+ category: "flow_control",
1160
+ icon: /* @__PURE__ */ A(E, { size: 16 }),
1161
+ component: F,
1162
+ defaultData: G.startNode
1163
+ },
1164
+ endNode: {
1165
+ type: "endNode",
1166
+ label: "End",
1167
+ description: "Workflow completion",
1168
+ category: "flow_control",
1169
+ icon: /* @__PURE__ */ A(ee, { size: 16 }),
1170
+ component: I,
1171
+ defaultData: G.endNode
1172
+ },
1173
+ decisionNode: {
1174
+ type: "decisionNode",
1175
+ label: "Decision",
1176
+ description: "Branch by condition",
1177
+ category: "logic",
1178
+ icon: /* @__PURE__ */ A(C, { size: 16 }),
1179
+ component: L,
1180
+ defaultData: G.decisionNode,
1181
+ requiredDataKeys: ["branches"]
1182
+ },
1183
+ loopNode: {
1184
+ type: "loopNode",
1185
+ label: "Loop",
1186
+ description: "Repeat a path",
1187
+ category: "flow_control",
1188
+ icon: /* @__PURE__ */ A(T, { size: 16 }),
1189
+ component: R,
1190
+ defaultData: G.loopNode,
1191
+ requiredDataKeys: ["iteratorSource"]
1192
+ },
1193
+ actionNode: {
1194
+ type: "actionNode",
1195
+ label: "Action",
1196
+ description: "Run an action",
1197
+ category: "execution",
1198
+ icon: /* @__PURE__ */ A(b, { size: 16 }),
1199
+ component: z,
1200
+ defaultData: G.actionNode,
1201
+ requiredDataKeys: ["actionType"]
1202
+ },
1203
+ requestNode: {
1204
+ type: "requestNode",
1205
+ label: "API Request",
1206
+ description: "Call an HTTP endpoint",
1207
+ category: "execution",
1208
+ icon: /* @__PURE__ */ A(ue, { size: 16 }),
1209
+ component: B,
1210
+ defaultData: G.requestNode,
1211
+ requiredDataKeys: ["url"]
1212
+ },
1213
+ delayNode: {
1214
+ type: "delayNode",
1215
+ label: "Delay",
1216
+ description: "Pause execution",
1217
+ category: "logic",
1218
+ icon: /* @__PURE__ */ A(x, { size: 16 }),
1219
+ component: ke,
1220
+ defaultData: G.delayNode,
1221
+ requiredDataKeys: ["duration"]
1222
+ },
1223
+ approvalNode: {
1224
+ type: "approvalNode",
1225
+ label: "Approval",
1226
+ description: "Wait for a person",
1227
+ category: "human",
1228
+ icon: /* @__PURE__ */ A(ne, { size: 16 }),
1229
+ component: V,
1230
+ defaultData: G.approvalNode,
1231
+ requiredDataKeys: ["approverRole"]
1232
+ },
1233
+ groupNode: {
1234
+ type: "groupNode",
1235
+ label: "Group",
1236
+ description: "Organize nodes",
1237
+ category: "structural",
1238
+ icon: /* @__PURE__ */ A(fe, { size: 16 }),
1239
+ component: H,
1240
+ defaultData: G.groupNode
1241
+ }
1242
+ }, K = [
1243
+ "flow_control",
1244
+ "logic",
1245
+ "execution",
1246
+ "human",
1247
+ "structural"
1248
+ ], Be = {
1249
+ flow_control: "Flow",
1250
+ logic: "Logic",
1251
+ execution: "Work",
1252
+ human: "Human",
1253
+ structural: "Structure"
1254
+ }, q = (e) => ({
1255
+ ...e,
1256
+ nodes: e.nodes.map((e) => ({
1257
+ ...e,
1258
+ data: { ...e.data }
1259
+ })),
1260
+ edges: e.edges.map((e) => ({
1261
+ ...e,
1262
+ data: e.data ? { ...e.data } : e.data
1263
+ })),
1264
+ metadata: e.metadata ? { ...e.metadata } : void 0,
1265
+ viewport: e.viewport ? { ...e.viewport } : void 0
1266
+ }), Ve = (e) => e == null || e === "" || Array.isArray(e) && e.length === 0, J = (e, t) => t.filter((t) => t.source === e).map((e) => e.target), He = (e = ze) => {
1267
+ let t = /* @__PURE__ */ new Map();
1268
+ return Object.values(e).forEach((e) => {
1269
+ let n = t.get(e.category) ?? {
1270
+ categoryKey: Be[e.category] ?? e.category,
1271
+ category: e.category,
1272
+ items: []
1273
+ };
1274
+ n.items.push({
1275
+ type: e.type,
1276
+ labelKey: e.label,
1277
+ descriptionKey: e.description,
1278
+ category: e.category,
1279
+ icon: e.icon ?? /* @__PURE__ */ A(b, { size: 16 }),
1280
+ defaultData: e.defaultData
1281
+ }), t.set(e.category, n);
1282
+ }), Array.from(t.values()).sort((e, t) => K.indexOf(e.category) - K.indexOf(t.category));
1283
+ }, Y = (e, t = ze) => {
1284
+ let n = [], r = e.nodes.filter((e) => e.type === "startNode"), i = e.nodes.filter((e) => e.type === "endNode"), a = new Set(i.map((e) => e.id)), o = new Map(e.nodes.map((e) => [e.id, e])), s = /* @__PURE__ */ new Map(), c = /* @__PURE__ */ new Map();
1285
+ e.edges.forEach((e) => {
1286
+ s.set(e.target, (s.get(e.target) ?? 0) + 1), c.set(e.source, (c.get(e.source) ?? 0) + 1);
1287
+ }), r.length === 0 && n.push({
1288
+ code: "missing_start",
1289
+ severity: "error",
1290
+ message: "Workflow requires a start node."
1291
+ }), i.length === 0 && n.push({
1292
+ code: "missing_end",
1293
+ severity: "error",
1294
+ message: "Workflow requires an end node."
1295
+ }), e.nodes.forEach((r) => {
1296
+ r.type !== "startNode" && r.type !== "groupNode" && (s.get(r.id) ?? 0) === 0 && n.push({
1297
+ code: "orphan_node",
1298
+ severity: "error",
1299
+ message: "Node has no incoming path.",
1300
+ nodeId: r.id
1301
+ });
1302
+ let i = t[String(r.type ?? "")];
1303
+ if (i?.requiredDataKeys?.forEach((e) => {
1304
+ Ve(r.data?.[e]) && n.push({
1305
+ code: "missing_required_config",
1306
+ severity: "error",
1307
+ message: `${i.label} requires ${e}.`,
1308
+ nodeId: r.id,
1309
+ field: e
1310
+ });
1311
+ }), r.data?.label || n.push({
1312
+ code: "missing_required_config",
1313
+ severity: "error",
1314
+ message: "Node label is required.",
1315
+ nodeId: r.id,
1316
+ field: "label"
1317
+ }), r.type === "decisionNode") {
1318
+ let e = Array.isArray(r.data?.branches) ? r.data.branches : [];
1319
+ (e.length < 2 || (c.get(r.id) ?? 0) < e.length) && n.push({
1320
+ code: "missing_decision_branch",
1321
+ severity: "error",
1322
+ message: "Decision nodes require branch coverage for each outcome.",
1323
+ nodeId: r.id,
1324
+ field: "branches"
1325
+ });
1326
+ }
1327
+ n.push(...i?.validate?.(r, e) ?? []);
1328
+ }), e.nodes.forEach((t) => {
1329
+ if (t.type === "endNode" || t.type === "groupNode") return;
1330
+ let r = /* @__PURE__ */ new Set(), i = [t.id], o = !1;
1331
+ for (; i.length > 0;) {
1332
+ let t = i.shift();
1333
+ if (!(!t || r.has(t))) {
1334
+ if (r.add(t), a.has(t)) {
1335
+ o = !0;
1336
+ break;
1337
+ }
1338
+ i.push(...J(t, e.edges));
1339
+ }
1340
+ }
1341
+ o || n.push({
1342
+ code: "missing_end_path",
1343
+ severity: "error",
1344
+ message: "Node has no path to an end node.",
1345
+ nodeId: t.id
1346
+ });
1347
+ });
1348
+ let l = /* @__PURE__ */ new Set(), u = /* @__PURE__ */ new Set(), d = (t, r) => {
1349
+ if (l.has(t)) {
1350
+ r.slice(r.indexOf(t)).some((e) => o.get(e)?.type === "loopNode") || n.push({
1351
+ code: "invalid_cycle",
1352
+ severity: "error",
1353
+ message: "Workflow cycles require a loop node.",
1354
+ nodeId: t
1355
+ });
1356
+ return;
1357
+ }
1358
+ u.has(t) || (l.add(t), J(t, e.edges).forEach((e) => d(e, [...r, e])), l.delete(t), u.add(t));
1359
+ };
1360
+ return e.nodes.forEach((e) => d(e.id, [e.id])), {
1361
+ valid: !n.some((e) => e.severity === "error"),
1362
+ issues: n
1363
+ };
1364
+ }, X = Y, Z = (e) => e == null ? "" : String(e), Q = (e) => e.split("\n").map((e) => e.trim()).filter(Boolean).reduce((e, t) => {
1365
+ let [n, ...r] = t.split(":");
1366
+ return n && r.length > 0 && (e[n.trim()] = r.join(":").trim()), e;
1367
+ }, {}), Ue = (e) => e && typeof e == "object" ? Object.entries(e).map(([e, t]) => `${e}: ${t}`).join("\n") : "", We = ({ node: c, registry: l, issues: u, readOnly: f, onChange: g, onDelete: ee, onClose: _, className: v }) => {
1368
+ let [y, b] = m.useState(!1);
1369
+ if (!c) return /* @__PURE__ */ j("aside", {
1370
+ className: e("w-80 border-l border-border bg-card/35 p-4", v),
1371
+ "aria-label": "Workflow inspector",
1372
+ children: [/* @__PURE__ */ A("div", {
1373
+ className: "text-xs font-bold uppercase tracking-wide text-muted-foreground",
1374
+ children: "Inspector"
1375
+ }), /* @__PURE__ */ A("div", {
1376
+ className: "mt-6 rounded-lg border border-dashed border-border p-4 text-sm text-muted-foreground",
1377
+ children: "Select a node to edit its configuration."
1378
+ })]
1379
+ });
1380
+ let x = l[String(c.type ?? "")], S = c.data, C = x?.editor, w = (t, n, r) => /* @__PURE__ */ j("label", {
1381
+ className: "grid gap-1.5",
1382
+ children: [/* @__PURE__ */ A("span", {
1383
+ className: e("text-[11px] font-semibold uppercase tracking-wide text-muted-foreground", (r ? u.some((e) => e.field === r) : !1) && "text-destructive"),
1384
+ children: t
1385
+ }), n]
1386
+ }), T = (e) => g(e);
1387
+ return /* @__PURE__ */ j("aside", {
1388
+ className: e("w-80 border-l border-border bg-card/35 p-4 overflow-y-auto", v),
1389
+ "aria-label": "Workflow inspector",
1390
+ children: [
1391
+ /* @__PURE__ */ j("div", {
1392
+ className: "flex items-center justify-between gap-3",
1393
+ children: [/* @__PURE__ */ j("div", {
1394
+ className: "min-w-0",
1395
+ children: [/* @__PURE__ */ A("div", {
1396
+ className: "text-xs font-bold uppercase tracking-wide text-muted-foreground",
1397
+ children: "Inspector"
1398
+ }), /* @__PURE__ */ A("div", {
1399
+ className: "truncate text-sm font-semibold",
1400
+ children: x?.label ?? c.type ?? "Node"
1401
+ })]
1402
+ }), /* @__PURE__ */ A(t, {
1403
+ variant: "ghost",
1404
+ size: "icon",
1405
+ onClick: _,
1406
+ "aria-label": "Close inspector",
1407
+ children: /* @__PURE__ */ A(O, { size: 16 })
1408
+ })]
1409
+ }),
1410
+ /* @__PURE__ */ j("div", {
1411
+ className: "mt-4 grid gap-4",
1412
+ children: [
1413
+ w("Label", /* @__PURE__ */ A(n, {
1414
+ value: Z(S.label),
1415
+ onChange: (e) => T({ label: e.target.value }),
1416
+ disabled: f
1417
+ }), "label"),
1418
+ w("Description", /* @__PURE__ */ A(d, {
1419
+ value: Z(S.description),
1420
+ onChange: (e) => T({ description: e.target.value }),
1421
+ disabled: f
1422
+ })),
1423
+ (() => {
1424
+ if (C) return /* @__PURE__ */ A(C, {
1425
+ node: c,
1426
+ data: S,
1427
+ onChange: T,
1428
+ readOnly: f,
1429
+ issues: u
1430
+ });
1431
+ switch (c.type) {
1432
+ case "startNode": return w("Trigger", /* @__PURE__ */ j(s, {
1433
+ value: Z("triggerType" in S ? S.triggerType : "manual"),
1434
+ onValueChange: f ? void 0 : (e) => T({ triggerType: e }),
1435
+ children: [/* @__PURE__ */ A(i, { children: /* @__PURE__ */ A(r, {}) }), /* @__PURE__ */ j(a, { children: [
1436
+ /* @__PURE__ */ A(o, {
1437
+ value: "manual",
1438
+ children: "Manual"
1439
+ }),
1440
+ /* @__PURE__ */ A(o, {
1441
+ value: "scheduled",
1442
+ children: "Scheduled"
1443
+ }),
1444
+ /* @__PURE__ */ A(o, {
1445
+ value: "webhook",
1446
+ children: "Webhook"
1447
+ })
1448
+ ] })]
1449
+ }));
1450
+ case "endNode": return w("Outcome", /* @__PURE__ */ j(s, {
1451
+ value: Z("outcome" in S ? S.outcome : "success"),
1452
+ onValueChange: f ? void 0 : (e) => T({ outcome: e }),
1453
+ children: [/* @__PURE__ */ A(i, { children: /* @__PURE__ */ A(r, {}) }), /* @__PURE__ */ j(a, { children: [
1454
+ /* @__PURE__ */ A(o, {
1455
+ value: "success",
1456
+ children: "Success"
1457
+ }),
1458
+ /* @__PURE__ */ A(o, {
1459
+ value: "failure",
1460
+ children: "Failure"
1461
+ }),
1462
+ /* @__PURE__ */ A(o, {
1463
+ value: "cancelled",
1464
+ children: "Cancelled"
1465
+ })
1466
+ ] })]
1467
+ }));
1468
+ case "decisionNode": return /* @__PURE__ */ j(k, { children: [w("Condition", /* @__PURE__ */ A(d, {
1469
+ value: Z("condition" in S ? S.condition : ""),
1470
+ onChange: (e) => T({ condition: e.target.value }),
1471
+ disabled: f
1472
+ })), w("Branches", /* @__PURE__ */ A(d, {
1473
+ value: ("branches" in S && Array.isArray(S.branches) ? S.branches : []).map((e) => e.label).join("\n"),
1474
+ onChange: (e) => T({ branches: e.target.value.split("\n").filter(Boolean).map((e, t) => ({
1475
+ id: `branch-${t + 1}`,
1476
+ label: e
1477
+ })) }),
1478
+ disabled: f
1479
+ }), "branches")] });
1480
+ case "loopNode": return /* @__PURE__ */ j(k, { children: [w("Iterator source", /* @__PURE__ */ A(n, {
1481
+ value: Z("iteratorSource" in S ? S.iteratorSource : ""),
1482
+ onChange: (e) => T({ iteratorSource: e.target.value }),
1483
+ disabled: f
1484
+ }), "iteratorSource"), w("Max iterations", /* @__PURE__ */ A(n, {
1485
+ type: "number",
1486
+ min: 1,
1487
+ value: Z("maxIterations" in S ? S.maxIterations : 10),
1488
+ onChange: (e) => T({ maxIterations: Number(e.target.value) }),
1489
+ disabled: f
1490
+ }))] });
1491
+ case "actionNode": return w("Action type", /* @__PURE__ */ A(n, {
1492
+ value: Z("actionType" in S ? S.actionType : ""),
1493
+ onChange: (e) => T({ actionType: e.target.value }),
1494
+ disabled: f
1495
+ }), "actionType");
1496
+ case "requestNode": return /* @__PURE__ */ j(k, { children: [
1497
+ w("Method", /* @__PURE__ */ j(s, {
1498
+ value: Z("method" in S ? S.method : "GET"),
1499
+ onValueChange: f ? void 0 : (e) => T({ method: e }),
1500
+ children: [/* @__PURE__ */ A(i, { children: /* @__PURE__ */ A(r, {}) }), /* @__PURE__ */ j(a, { children: [
1501
+ /* @__PURE__ */ A(o, {
1502
+ value: "GET",
1503
+ children: "GET"
1504
+ }),
1505
+ /* @__PURE__ */ A(o, {
1506
+ value: "POST",
1507
+ children: "POST"
1508
+ }),
1509
+ /* @__PURE__ */ A(o, {
1510
+ value: "PUT",
1511
+ children: "PUT"
1512
+ }),
1513
+ /* @__PURE__ */ A(o, {
1514
+ value: "PATCH",
1515
+ children: "PATCH"
1516
+ }),
1517
+ /* @__PURE__ */ A(o, {
1518
+ value: "DELETE",
1519
+ children: "DELETE"
1520
+ })
1521
+ ] })]
1522
+ })),
1523
+ w("URL", /* @__PURE__ */ A(n, {
1524
+ value: Z("url" in S ? S.url : ""),
1525
+ onChange: (e) => T({ url: e.target.value }),
1526
+ disabled: f
1527
+ }), "url"),
1528
+ w("Headers", /* @__PURE__ */ A(d, {
1529
+ value: Ue("headers" in S ? S.headers : void 0),
1530
+ onChange: (e) => T({ headers: Q(e.target.value) }),
1531
+ disabled: f
1532
+ }))
1533
+ ] });
1534
+ case "delayNode": return /* @__PURE__ */ j(k, { children: [w("Duration", /* @__PURE__ */ A(n, {
1535
+ type: "number",
1536
+ min: 1,
1537
+ value: Z("duration" in S ? S.duration : 1),
1538
+ onChange: (e) => T({ duration: Number(e.target.value) }),
1539
+ disabled: f
1540
+ }), "duration"), w("Unit", /* @__PURE__ */ j(s, {
1541
+ value: Z("unit" in S ? S.unit : "hours"),
1542
+ onValueChange: f ? void 0 : (e) => T({ unit: e }),
1543
+ children: [/* @__PURE__ */ A(i, { children: /* @__PURE__ */ A(r, {}) }), /* @__PURE__ */ j(a, { children: [
1544
+ /* @__PURE__ */ A(o, {
1545
+ value: "seconds",
1546
+ children: "Seconds"
1547
+ }),
1548
+ /* @__PURE__ */ A(o, {
1549
+ value: "minutes",
1550
+ children: "Minutes"
1551
+ }),
1552
+ /* @__PURE__ */ A(o, {
1553
+ value: "hours",
1554
+ children: "Hours"
1555
+ }),
1556
+ /* @__PURE__ */ A(o, {
1557
+ value: "days",
1558
+ children: "Days"
1559
+ })
1560
+ ] })]
1561
+ }))] });
1562
+ case "approvalNode": return /* @__PURE__ */ j(k, { children: [
1563
+ w("Approver role", /* @__PURE__ */ A(n, {
1564
+ value: Z("approverRole" in S ? S.approverRole : ""),
1565
+ onChange: (e) => T({ approverRole: e.target.value }),
1566
+ disabled: f
1567
+ }), "approverRole"),
1568
+ w("Escalation role", /* @__PURE__ */ A(n, {
1569
+ value: Z("escalationRole" in S ? S.escalationRole : ""),
1570
+ onChange: (e) => T({ escalationRole: e.target.value }),
1571
+ disabled: f
1572
+ })),
1573
+ w("SLA hours", /* @__PURE__ */ A(n, {
1574
+ type: "number",
1575
+ min: 1,
1576
+ value: Z("slaHours" in S ? S.slaHours : ""),
1577
+ onChange: (e) => T({ slaHours: Number(e.target.value) }),
1578
+ disabled: f
1579
+ }))
1580
+ ] });
1581
+ default: return w("Description", /* @__PURE__ */ A(d, {
1582
+ value: Z(S.description),
1583
+ onChange: (e) => T({ description: e.target.value }),
1584
+ disabled: f
1585
+ }));
1586
+ }
1587
+ })()
1588
+ ]
1589
+ }),
1590
+ u.length > 0 && /* @__PURE__ */ A("div", {
1591
+ className: "mt-4 grid gap-2 rounded-lg border border-destructive/30 bg-destructive/5 p-3",
1592
+ children: u.map((e, t) => /* @__PURE__ */ j("div", {
1593
+ className: "flex gap-2 text-xs text-destructive",
1594
+ children: [/* @__PURE__ */ A(h, {
1595
+ size: 14,
1596
+ className: "mt-0.5 shrink-0"
1597
+ }), /* @__PURE__ */ A("span", { children: e.message })]
1598
+ }, `${e.code}-${t}`))
1599
+ }),
1600
+ !f && /* @__PURE__ */ j(k, { children: [/* @__PURE__ */ j(t, {
1601
+ variant: "destructive",
1602
+ className: "mt-4 w-full gap-2",
1603
+ onClick: () => b(!0),
1604
+ children: [/* @__PURE__ */ A(D, { size: 14 }), "Delete node"]
1605
+ }), /* @__PURE__ */ A(p, {
1606
+ isOpen: y,
1607
+ onClose: () => b(!1),
1608
+ onConfirm: () => {
1609
+ ee(), b(!1);
1610
+ },
1611
+ title: "Delete Node",
1612
+ message: "Are you sure you want to delete this node?",
1613
+ description: "This action cannot be undone."
1614
+ })] })
1615
+ ]
1616
+ });
1617
+ }, Ge = m.forwardRef((n, r) => {
1618
+ let { workflow: i, defaultWorkflow: a = Re, workflowId: o, service: s, nodeRegistry: c, onWorkflowChange: l, onNodeAdd: u, onNodeUpdate: d, onNodeDelete: f, onConnectionCreate: p, onValidationChange: g, onSave: _, onPublish: v, onError: y, title: b, description: x, status: S, toolboxTitle: C = "Node Library", showHeader: T = !0, showToolbox: te = !0, showInspector: ne = !0, showValidationPanel: re = !0, showActionBar: ie = !0, autoValidate: E = !0, readOnly: se = !1, showGrid: ce = !0, snapToGrid: le = !0, fitView: ue = !0, exportFileName: de = "workflow.json", className: fe, classNames: D, ...he } = n, O = m.useMemo(() => ({
1619
+ ...ze,
1620
+ ...c
1621
+ }), [c]), _e = m.useMemo(() => {
1622
+ let e = {};
1623
+ return Object.values(O).forEach((t) => {
1624
+ t.component && (e[t.type] = t.component);
1625
+ }), e;
1626
+ }, [O]), ve = m.useMemo(() => He(O), [O]), ye = i !== void 0, [be, xe] = m.useState(() => q(a)), [M, N] = m.useState(ce), [P, Se] = m.useState(le), [Ce, De] = m.useState(!1), [F, I] = m.useState(null), [L, R] = m.useState(() => Y(i ?? be, O)), [z, B] = m.useState(!1), [ke, V] = m.useState(!1), [H, Ae] = m.useState(!1), [je, Me] = m.useState(void 0), [Ne, U] = m.useState(null), Fe = m.useRef(null), W = m.useRef(i ?? be), G = m.useRef([]), K = m.useRef([]), { fitView: Be, screenToFlowPosition: Ve } = Oe(), J = i ?? be;
1627
+ m.useEffect(() => {
1628
+ W.current = J;
1629
+ }, [J]), m.useEffect(() => N(ce), [ce]), m.useEffect(() => Se(le), [le]);
1630
+ let X = m.useCallback((e = W.current) => Y(e, O), [O]), Z = m.useCallback((e, t = !0) => {
1631
+ let n = q({
1632
+ ...e,
1633
+ metadata: {
1634
+ ...e.metadata,
1635
+ updatedAt: (/* @__PURE__ */ new Date()).toISOString()
1636
+ }
1637
+ });
1638
+ if (t && (G.current = [...G.current, q(W.current)], K.current = []), W.current = n, ye || xe(n), l?.(n), E) {
1639
+ let e = X(n);
1640
+ R(e), g?.(e);
1641
+ }
1642
+ }, [
1643
+ E,
1644
+ ye,
1645
+ g,
1646
+ l,
1647
+ X
1648
+ ]), Q = m.useCallback((e) => {
1649
+ let t = O[String(e.type)], n = {
1650
+ id: e.id ?? `${e.type}-${Date.now()}`,
1651
+ type: e.type,
1652
+ position: e.position ?? {
1653
+ x: 120,
1654
+ y: 120
1655
+ },
1656
+ data: {
1657
+ ...t?.defaultData ?? { label: e.type },
1658
+ ...e.data ?? {}
1659
+ }
1660
+ }, r = {
1661
+ ...W.current,
1662
+ nodes: [...W.current.nodes, n]
1663
+ };
1664
+ Z(r), u?.({
1665
+ node: n,
1666
+ workflow: q(r)
1667
+ });
1668
+ }, [
1669
+ Z,
1670
+ O,
1671
+ u
1672
+ ]), Ue = m.useCallback((e, t) => {
1673
+ let n, r = W.current.nodes.map((r) => r.id === e ? (n = {
1674
+ ...r,
1675
+ data: {
1676
+ ...r.data,
1677
+ ...t
1678
+ }
1679
+ }, n) : r);
1680
+ if (!n) return;
1681
+ let i = {
1682
+ ...W.current,
1683
+ nodes: r
1684
+ };
1685
+ Z(i), d?.({
1686
+ node: n,
1687
+ workflow: q(i)
1688
+ });
1689
+ }, [Z, d]), Ge = m.useCallback((e) => {
1690
+ let t = W.current.nodes.find((t) => t.id === e);
1691
+ if (!t) return;
1692
+ let n = {
1693
+ ...W.current,
1694
+ nodes: W.current.nodes.filter((t) => t.id !== e),
1695
+ edges: W.current.edges.filter((t) => t.source !== e && t.target !== e)
1696
+ };
1697
+ I((t) => t === e ? null : t), Z(n), f?.({
1698
+ node: t,
1699
+ workflow: q(n)
1700
+ });
1701
+ }, [Z, f]), $ = m.useCallback((e, t) => {
1702
+ let n = {
1703
+ id: `${e}-${t}-${Date.now()}`,
1704
+ source: e,
1705
+ target: t,
1706
+ type: "ezEdge",
1707
+ animated: !0
1708
+ }, r = {
1709
+ ...W.current,
1710
+ edges: we(n, W.current.edges)
1711
+ };
1712
+ Z(r), p?.({
1713
+ edge: n,
1714
+ sourceId: e,
1715
+ targetId: t,
1716
+ workflow: q(r)
1717
+ });
1718
+ }, [Z, p]);
1719
+ m.useEffect(() => {
1720
+ if (!s || !o || ye) return;
1721
+ let e = !0;
1722
+ return B(!0), U(null), s.loadWorkflow(o).then((t) => {
1723
+ e && Z(t, !1);
1724
+ }).catch((t) => {
1725
+ e && (U(t.message), y?.(t, "load"));
1726
+ }).finally(() => {
1727
+ e && B(!1);
1728
+ }), () => {
1729
+ e = !1;
1730
+ };
1731
+ }, [
1732
+ ye,
1733
+ Z,
1734
+ y,
1735
+ s,
1736
+ o
1737
+ ]), m.useEffect(() => {
1738
+ let e = X(J);
1739
+ R(e), g?.(e);
1740
+ }, [
1741
+ J,
1742
+ g,
1743
+ X
1744
+ ]), m.useImperativeHandle(r, () => ({
1745
+ getWorkflow: () => q(W.current),
1746
+ setWorkflow: (e) => Z(e),
1747
+ validate: () => X(),
1748
+ addNode: Q,
1749
+ updateNode: Ue,
1750
+ deleteNode: Ge,
1751
+ connect: $,
1752
+ undo: () => {
1753
+ let e = G.current[G.current.length - 1];
1754
+ e && (G.current = G.current.slice(0, -1), K.current = [q(W.current), ...K.current], Z(e, !1));
1755
+ },
1756
+ redo: () => {
1757
+ let e = K.current[0];
1758
+ e && (K.current = K.current.slice(1), G.current = [...G.current, q(W.current)], Z(e, !1));
1759
+ },
1760
+ canUndo: () => G.current.length > 0,
1761
+ canRedo: () => K.current.length > 0,
1762
+ fitView: () => Be(),
1763
+ exportJson: () => JSON.stringify(W.current, null, 2),
1764
+ importJson: (e) => {
1765
+ try {
1766
+ Z(JSON.parse(e)), U(null);
1767
+ } catch (e) {
1768
+ let t = e instanceof Error ? e : /* @__PURE__ */ Error("Invalid workflow JSON.");
1769
+ U(t.message), y?.(t, "import");
1770
+ }
1771
+ }
1772
+ }), [
1773
+ Q,
1774
+ $,
1775
+ Ge,
1776
+ Z,
1777
+ Be,
1778
+ y,
1779
+ Ue,
1780
+ X
1781
+ ]);
1782
+ let Ke = m.useCallback((e) => {
1783
+ let t = Ee(e, W.current.nodes);
1784
+ Z({
1785
+ ...W.current,
1786
+ nodes: t
1787
+ });
1788
+ }, [Z]), qe = m.useCallback((e) => {
1789
+ Z({
1790
+ ...W.current,
1791
+ edges: Te(e, W.current.edges)
1792
+ });
1793
+ }, [Z]), Je = m.useCallback((e) => {
1794
+ Z({
1795
+ ...W.current,
1796
+ edges: W.current.edges.filter((t) => t.id !== e)
1797
+ });
1798
+ }, [Z]), Ye = m.useCallback((e) => {
1799
+ e.source && e.target && $(e.source, e.target);
1800
+ }, [$]), Xe = m.useCallback((e) => {
1801
+ e.preventDefault();
1802
+ let t = e.dataTransfer.getData("application/reactflow") || e.dataTransfer.getData("text/plain");
1803
+ t && Q({
1804
+ type: t,
1805
+ position: Ve({
1806
+ x: e.clientX,
1807
+ y: e.clientY
1808
+ })
1809
+ });
1810
+ }, [Q, Ve]), Ze = m.useCallback(async () => {
1811
+ let e = q(W.current), t = X(e);
1812
+ if (R(t), g?.(t), t.valid) {
1813
+ V(!0), U(null);
1814
+ try {
1815
+ s && o && await s.saveWorkflow(o, e), await _?.(e), Me((/* @__PURE__ */ new Date()).toISOString());
1816
+ } catch (e) {
1817
+ let t = e instanceof Error ? e : /* @__PURE__ */ Error("Failed to save workflow.");
1818
+ U(t.message), y?.(t, "save");
1819
+ } finally {
1820
+ V(!1);
1821
+ }
1822
+ }
1823
+ }, [
1824
+ y,
1825
+ _,
1826
+ g,
1827
+ s,
1828
+ X,
1829
+ o
1830
+ ]), Qe = m.useCallback(async () => {
1831
+ let e = q({
1832
+ ...W.current,
1833
+ metadata: {
1834
+ ...W.current.metadata,
1835
+ status: "live",
1836
+ publishedAt: (/* @__PURE__ */ new Date()).toISOString()
1837
+ }
1838
+ }), t = X(e);
1839
+ if (R(t), g?.(t), t.valid) {
1840
+ Ae(!0), U(null);
1841
+ try {
1842
+ s && o && await s.publishWorkflow(o, e), await v?.(e), Z(e, !1);
1843
+ } catch (e) {
1844
+ let t = e instanceof Error ? e : /* @__PURE__ */ Error("Failed to publish workflow.");
1845
+ U(t.message), y?.(t, "publish");
1846
+ } finally {
1847
+ Ae(!1);
1848
+ }
1849
+ }
1850
+ }, [
1851
+ Z,
1852
+ y,
1853
+ v,
1854
+ g,
1855
+ s,
1856
+ X,
1857
+ o
1858
+ ]), $e = m.useCallback(() => {
1859
+ try {
1860
+ let e = X();
1861
+ R(e), g?.(e), U(null);
1862
+ } catch (e) {
1863
+ let t = e instanceof Error ? e : /* @__PURE__ */ Error("Failed to validate workflow.");
1864
+ U(t.message), y?.(t, "validate");
1865
+ }
1866
+ }, [
1867
+ y,
1868
+ g,
1869
+ X
1870
+ ]), et = m.useCallback((e) => {
1871
+ let t = e.target.files?.[0];
1872
+ t && t.text().then((t) => {
1873
+ try {
1874
+ Z(JSON.parse(t)), U(null);
1875
+ } catch (e) {
1876
+ let t = e instanceof Error ? e : /* @__PURE__ */ Error("Invalid workflow JSON.");
1877
+ U(t.message), y?.(t, "import");
1878
+ } finally {
1879
+ e.target.value = "";
1880
+ }
1881
+ });
1882
+ }, [Z, y]), tt = m.useCallback(() => {
1883
+ let e = new Blob([JSON.stringify(W.current, null, 2)], { type: "application/json" }), t = URL.createObjectURL(e), n = document.createElement("a");
1884
+ n.href = t, n.download = de, n.click(), URL.revokeObjectURL(t);
1885
+ }, [de]), nt = b ?? J.metadata?.title ?? "Untitled Workflow", rt = x ?? J.metadata?.description, it = F ? J.nodes.find((e) => e.id === F) : void 0, at = F ? L.issues.filter((e) => e.nodeId === F) : [], ot = L.issues.filter((e) => e.severity === "error").length, st = L.issues.filter((e) => e.severity === "warning").length, ct = G.current.length > 0, lt = K.current.length > 0;
1886
+ return /* @__PURE__ */ j("div", {
1887
+ className: e("ez-workflow flex h-full min-h-[560px] flex-col overflow-hidden bg-background", D?.root, fe),
1888
+ ...he,
1889
+ children: [
1890
+ /* @__PURE__ */ A("input", {
1891
+ ref: Fe,
1892
+ type: "file",
1893
+ accept: "application/json,.json",
1894
+ className: "hidden",
1895
+ onChange: et
1896
+ }),
1897
+ T && /* @__PURE__ */ A(Le, {
1898
+ title: nt,
1899
+ description: rt,
1900
+ status: S ?? J.metadata?.status,
1901
+ isDirty: G.current.length > 0,
1902
+ onTitleChange: (e) => Z({
1903
+ ...W.current,
1904
+ metadata: {
1905
+ ...W.current.metadata,
1906
+ title: e
1907
+ }
1908
+ }),
1909
+ onDescriptionChange: (e) => Z({
1910
+ ...W.current,
1911
+ metadata: {
1912
+ ...W.current.metadata,
1913
+ description: e
1914
+ }
1915
+ }),
1916
+ onSave: Ze,
1917
+ onPublish: Qe,
1918
+ showGrid: M,
1919
+ onShowGridChange: N,
1920
+ snapToGrid: P,
1921
+ onSnapToGridChange: Se,
1922
+ className: D?.header
1923
+ }),
1924
+ /* @__PURE__ */ j("div", {
1925
+ className: e("flex min-h-0 flex-1", D?.body),
1926
+ children: [
1927
+ te && /* @__PURE__ */ A(Ie, {
1928
+ categories: ve,
1929
+ title: C,
1930
+ collapsed: Ce,
1931
+ onCollapsedChange: De,
1932
+ onNodeActivate: (e) => Q({ type: e.type }),
1933
+ className: D?.toolbox
1934
+ }),
1935
+ /* @__PURE__ */ A(Pe, {
1936
+ nodes: J.nodes,
1937
+ edges: J.edges,
1938
+ onNodesChange: Ke,
1939
+ onEdgesChange: qe,
1940
+ onConnect: Ye,
1941
+ onDrop: Xe,
1942
+ onDragOver: (e) => {
1943
+ e.preventDefault(), e.dataTransfer.dropEffect = "move";
1944
+ },
1945
+ onNodeClick: (e, t) => I(t.id),
1946
+ onNodeDoubleClick: (e, t) => I(t.id),
1947
+ onEdgeDelete: Je,
1948
+ onPaneClick: () => I(null),
1949
+ nodeTypes: _e,
1950
+ showGrid: M,
1951
+ snapToGrid: P,
1952
+ fitView: ue,
1953
+ readOnly: se,
1954
+ className: e("flex-1", D?.canvas)
1955
+ }),
1956
+ ne && /* @__PURE__ */ A(We, {
1957
+ node: it,
1958
+ registry: O,
1959
+ issues: at,
1960
+ readOnly: se,
1961
+ onChange: (e) => it && Ue(it.id, e),
1962
+ onDelete: () => it && Ge(it.id),
1963
+ onClose: () => I(null),
1964
+ className: D?.inspector
1965
+ })
1966
+ ]
1967
+ }),
1968
+ (ie || re) && /* @__PURE__ */ j("footer", {
1969
+ className: e("flex min-h-14 items-center justify-between gap-3 border-t border-border bg-card/50 px-4 py-2", D?.actionBar),
1970
+ "aria-label": "Workflow actions",
1971
+ children: [/* @__PURE__ */ A("div", {
1972
+ className: "flex min-w-0 items-center gap-2",
1973
+ children: ie && /* @__PURE__ */ j(k, { children: [
1974
+ /* @__PURE__ */ j(t, {
1975
+ variant: "outline",
1976
+ size: "sm",
1977
+ className: "gap-2",
1978
+ disabled: !ct || se,
1979
+ onClick: () => {
1980
+ let e = G.current[G.current.length - 1];
1981
+ e && (G.current = G.current.slice(0, -1), K.current = [q(W.current), ...K.current], Z(e, !1));
1982
+ },
1983
+ children: [/* @__PURE__ */ A(pe, { size: 14 }), "Undo"]
1984
+ }),
1985
+ /* @__PURE__ */ j(t, {
1986
+ variant: "outline",
1987
+ size: "sm",
1988
+ className: "gap-2",
1989
+ disabled: !lt || se,
1990
+ onClick: () => {
1991
+ let e = K.current[0];
1992
+ e && (K.current = K.current.slice(1), G.current = [...G.current, q(W.current)], Z(e, !1));
1993
+ },
1994
+ children: [/* @__PURE__ */ A(ae, { size: 14 }), "Redo"]
1995
+ }),
1996
+ /* @__PURE__ */ j(t, {
1997
+ variant: "outline",
1998
+ size: "sm",
1999
+ className: "gap-2",
2000
+ onClick: $e,
2001
+ children: [/* @__PURE__ */ A(ge, { size: 14 }), "Validate"]
2002
+ }),
2003
+ /* @__PURE__ */ j(t, {
2004
+ variant: "outline",
2005
+ size: "sm",
2006
+ className: "gap-2",
2007
+ onClick: () => Fe.current?.click(),
2008
+ disabled: se,
2009
+ children: [/* @__PURE__ */ A(me, { size: 14 }), "Import"]
2010
+ }),
2011
+ /* @__PURE__ */ j(t, {
2012
+ variant: "outline",
2013
+ size: "sm",
2014
+ className: "gap-2",
2015
+ onClick: tt,
2016
+ children: [/* @__PURE__ */ A(w, { size: 14 }), "Export"]
2017
+ })
2018
+ ] })
2019
+ }), re && /* @__PURE__ */ j("div", {
2020
+ className: e("flex min-w-0 items-center gap-3 text-xs", D?.validationPanel),
2021
+ children: [
2022
+ z || ke || H ? /* @__PURE__ */ j("span", {
2023
+ className: "inline-flex items-center gap-2 text-muted-foreground",
2024
+ children: [/* @__PURE__ */ A(oe, {
2025
+ size: 14,
2026
+ className: "animate-spin"
2027
+ }), z ? "Loading" : H ? "Publishing" : "Saving"]
2028
+ }) : L.valid ? /* @__PURE__ */ j("span", {
2029
+ className: "inline-flex items-center gap-2 text-emerald-600",
2030
+ children: [/* @__PURE__ */ A(ee, { size: 14 }), "Valid"]
2031
+ }) : /* @__PURE__ */ j("span", {
2032
+ className: "inline-flex items-center gap-2 text-destructive",
2033
+ children: [
2034
+ /* @__PURE__ */ A(h, { size: 14 }),
2035
+ ot,
2036
+ " error",
2037
+ ot === 1 ? "" : "s",
2038
+ st > 0 ? `, ${st} warning${st === 1 ? "" : "s"}` : ""
2039
+ ]
2040
+ }),
2041
+ je && /* @__PURE__ */ j("span", {
2042
+ className: "hidden text-muted-foreground md:inline",
2043
+ children: ["Saved ", new Date(je).toLocaleTimeString()]
2044
+ }),
2045
+ Ne && /* @__PURE__ */ A("span", {
2046
+ className: "max-w-[320px] truncate text-destructive",
2047
+ children: Ne
2048
+ }),
2049
+ L.issues.slice(0, 2).map((e, t) => /* @__PURE__ */ A("button", {
2050
+ type: "button",
2051
+ className: "hidden max-w-[260px] truncate rounded border border-border px-2 py-1 text-left text-muted-foreground hover:bg-muted lg:block",
2052
+ "aria-label": `Go to validation issue: ${e.message}`,
2053
+ onClick: () => e.nodeId && I(e.nodeId),
2054
+ children: e.message
2055
+ }, `${e.code}-${e.nodeId ?? t}`))
2056
+ ]
2057
+ })]
2058
+ })
2059
+ ]
2060
+ });
2061
+ });
2062
+ Ge.displayName = "EzWorkflowInner";
2063
+ var $ = m.forwardRef((e, t) => /* @__PURE__ */ A(Ce, { children: /* @__PURE__ */ A(Ge, {
2064
+ ...e,
2065
+ ref: t
2066
+ }) }));
2067
+ $.displayName = "EzWorkflow";
2068
+ var Ke = m.forwardRef((e, t) => /* @__PURE__ */ A($, {
2069
+ ...e,
2070
+ ref: t
2071
+ }));
2072
+ Ke.displayName = "EzFlow";
2073
+ //#endregion
2074
+ //#region src/components/EzFlow/EzWorkflowServiceAdapters.ts
2075
+ var qe = async (e) => ({
2076
+ "content-type": "application/json",
2077
+ ...(typeof e == "function" ? await e() : e) ?? {}
2078
+ }), Je = async (e, t) => {
2079
+ if (e.ok) return;
2080
+ let n = await e.text().catch(() => "");
2081
+ throw Error(n || `Workflow ${t} failed with ${e.status}.`);
2082
+ }, Ye = class {
2083
+ baseUrl;
2084
+ fetcher;
2085
+ headers;
2086
+ constructor(e) {
2087
+ this.baseUrl = e.baseUrl.replace(/\/$/, ""), this.fetcher = e.fetcher ?? fetch, this.headers = e.headers;
2088
+ }
2089
+ async loadWorkflow(e) {
2090
+ let t = await this.fetcher(`${this.baseUrl}/workflows/${encodeURIComponent(e)}`);
2091
+ return await Je(t, "load"), t.json();
2092
+ }
2093
+ async saveWorkflow(e, t) {
2094
+ await Je(await this.fetcher(`${this.baseUrl}/workflows/${encodeURIComponent(e)}`, {
2095
+ method: "PUT",
2096
+ headers: await qe(this.headers),
2097
+ body: JSON.stringify(t)
2098
+ }), "save");
2099
+ }
2100
+ async publishWorkflow(e, t) {
2101
+ await Je(await this.fetcher(`${this.baseUrl}/workflows/${encodeURIComponent(e)}/publish`, {
2102
+ method: "POST",
2103
+ headers: await qe(this.headers),
2104
+ body: JSON.stringify(t)
2105
+ }), "publish");
2106
+ }
2107
+ async validateWorkflow(e) {
2108
+ let t = await this.fetcher(`${this.baseUrl}/workflows/validate`, {
2109
+ method: "POST",
2110
+ headers: await qe(this.headers),
2111
+ body: JSON.stringify(e)
2112
+ });
2113
+ return await Je(t, "validate"), t.json();
2114
+ }
2115
+ }, Xe = class {
2116
+ service;
2117
+ lastStableWorkflow;
2118
+ constructor(e) {
2119
+ this.service = e;
2120
+ }
2121
+ getRollbackWorkflow() {
2122
+ return this.lastStableWorkflow;
2123
+ }
2124
+ async loadWorkflow(e) {
2125
+ let t = await this.service.loadWorkflow(e);
2126
+ return this.lastStableWorkflow = t, t;
2127
+ }
2128
+ async saveWorkflow(e, t) {
2129
+ let n = this.lastStableWorkflow;
2130
+ this.lastStableWorkflow = t;
2131
+ try {
2132
+ await this.service.saveWorkflow(e, t);
2133
+ } catch (e) {
2134
+ throw this.lastStableWorkflow = n, e;
2135
+ }
2136
+ }
2137
+ async publishWorkflow(e, t) {
2138
+ let n = this.lastStableWorkflow;
2139
+ this.lastStableWorkflow = t;
2140
+ try {
2141
+ await this.service.publishWorkflow(e, t);
2142
+ } catch (e) {
2143
+ throw this.lastStableWorkflow = n, e;
2144
+ }
2145
+ }
2146
+ validateWorkflow(e) {
2147
+ return this.service.validateWorkflow(e);
2148
+ }
2149
+ }, Ze = (e = {}) => {
2150
+ let t = new Map(Object.entries(e));
2151
+ return {
2152
+ workflows: t,
2153
+ async loadWorkflow(e) {
2154
+ let n = t.get(e);
2155
+ if (!n) throw Error(`Workflow ${e} was not found.`);
2156
+ return n;
2157
+ },
2158
+ async saveWorkflow(e, n) {
2159
+ t.set(e, n);
2160
+ },
2161
+ async publishWorkflow(e, n) {
2162
+ t.set(e, {
2163
+ ...n,
2164
+ metadata: {
2165
+ ...n.metadata,
2166
+ status: "live",
2167
+ publishedAt: n.metadata?.publishedAt ?? (/* @__PURE__ */ new Date()).toISOString()
2168
+ }
2169
+ });
2170
+ },
2171
+ async validateWorkflow(e) {
2172
+ return Y(e);
2173
+ }
2174
+ };
2175
+ }, Qe = (e) => {
2176
+ let t = Math.max(2, Math.floor(e)), n = Array.from({ length: t }, (e, n) => n === 0 ? {
2177
+ id: "node-0",
2178
+ type: "startNode",
2179
+ position: {
2180
+ x: 0,
2181
+ y: 0
2182
+ },
2183
+ data: { label: "Start" }
2184
+ } : n === t - 1 ? {
2185
+ id: `node-${n}`,
2186
+ type: "endNode",
2187
+ position: {
2188
+ x: n * 180,
2189
+ y: 0
2190
+ },
2191
+ data: { label: "End" }
2192
+ } : {
2193
+ id: `node-${n}`,
2194
+ type: "actionNode",
2195
+ position: {
2196
+ x: n * 180,
2197
+ y: n % 5 * 120
2198
+ },
2199
+ data: {
2200
+ label: `Action ${n}`,
2201
+ actionType: "noop"
2202
+ }
2203
+ });
2204
+ return {
2205
+ nodes: n,
2206
+ edges: n.slice(0, -1).map((e, t) => ({
2207
+ id: `${e.id}-${n[t + 1].id}`,
2208
+ source: e.id,
2209
+ target: n[t + 1].id,
2210
+ type: "ezEdge"
2211
+ })),
2212
+ metadata: {
2213
+ title: `${t} node performance workflow`,
2214
+ status: "draft",
2215
+ version: 1
2216
+ }
2217
+ };
2218
+ }, $e = (e) => {
2219
+ let t = Qe(e), n = typeof performance < "u" ? () => performance.now() : () => Date.now(), r = n(), i = Y(t);
2220
+ return {
2221
+ nodeCount: t.nodes.length,
2222
+ edgeCount: t.edges.length,
2223
+ validateMs: n() - r,
2224
+ valid: i.valid,
2225
+ issueCount: i.issues.length
2226
+ };
2227
+ }, et = {
2228
+ nodes: [
2229
+ {
2230
+ id: "start",
2231
+ type: "startNode",
2232
+ position: {
2233
+ x: 0,
2234
+ y: 120
2235
+ },
2236
+ data: {
2237
+ label: "Request submitted",
2238
+ triggerType: "manual"
2239
+ }
2240
+ },
2241
+ {
2242
+ id: "approval",
2243
+ type: "approvalNode",
2244
+ position: {
2245
+ x: 280,
2246
+ y: 120
2247
+ },
2248
+ data: {
2249
+ label: "Manager approval",
2250
+ approverRole: "manager",
2251
+ slaHours: 24
2252
+ }
2253
+ },
2254
+ {
2255
+ id: "decision",
2256
+ type: "decisionNode",
2257
+ position: {
2258
+ x: 560,
2259
+ y: 120
2260
+ },
2261
+ data: {
2262
+ label: "Approved?",
2263
+ branches: [{
2264
+ id: "yes",
2265
+ label: "Approved"
2266
+ }, {
2267
+ id: "no",
2268
+ label: "Rejected"
2269
+ }]
2270
+ }
2271
+ },
2272
+ {
2273
+ id: "end-success",
2274
+ type: "endNode",
2275
+ position: {
2276
+ x: 840,
2277
+ y: 40
2278
+ },
2279
+ data: {
2280
+ label: "Approved",
2281
+ outcome: "success"
2282
+ }
2283
+ },
2284
+ {
2285
+ id: "end-failure",
2286
+ type: "endNode",
2287
+ position: {
2288
+ x: 840,
2289
+ y: 200
2290
+ },
2291
+ data: {
2292
+ label: "Rejected",
2293
+ outcome: "failure"
2294
+ }
2295
+ }
2296
+ ],
2297
+ edges: [
2298
+ {
2299
+ id: "start-approval",
2300
+ source: "start",
2301
+ target: "approval",
2302
+ type: "ezEdge"
2303
+ },
2304
+ {
2305
+ id: "approval-decision",
2306
+ source: "approval",
2307
+ target: "decision",
2308
+ type: "ezEdge"
2309
+ },
2310
+ {
2311
+ id: "decision-success",
2312
+ source: "decision",
2313
+ target: "end-success",
2314
+ type: "ezEdge"
2315
+ },
2316
+ {
2317
+ id: "decision-failure",
2318
+ source: "decision",
2319
+ target: "end-failure",
2320
+ type: "ezEdge"
2321
+ }
2322
+ ],
2323
+ metadata: {
2324
+ title: "Approval workflow",
2325
+ description: "Human approval with positive and negative outcomes.",
2326
+ status: "draft",
2327
+ version: 1
2328
+ }
2329
+ }, tt = {
2330
+ nodes: [
2331
+ {
2332
+ id: "start",
2333
+ type: "startNode",
2334
+ position: {
2335
+ x: 0,
2336
+ y: 100
2337
+ },
2338
+ data: {
2339
+ label: "Webhook received",
2340
+ triggerType: "webhook"
2341
+ }
2342
+ },
2343
+ {
2344
+ id: "request",
2345
+ type: "requestNode",
2346
+ position: {
2347
+ x: 280,
2348
+ y: 100
2349
+ },
2350
+ data: {
2351
+ label: "Create ticket",
2352
+ method: "POST",
2353
+ url: "https://api.example.com/tickets"
2354
+ }
2355
+ },
2356
+ {
2357
+ id: "end",
2358
+ type: "endNode",
2359
+ position: {
2360
+ x: 560,
2361
+ y: 100
2362
+ },
2363
+ data: {
2364
+ label: "Ticket created",
2365
+ outcome: "success"
2366
+ }
2367
+ }
2368
+ ],
2369
+ edges: [{
2370
+ id: "start-request",
2371
+ source: "start",
2372
+ target: "request",
2373
+ type: "ezEdge"
2374
+ }, {
2375
+ id: "request-end",
2376
+ source: "request",
2377
+ target: "end",
2378
+ type: "ezEdge"
2379
+ }],
2380
+ metadata: {
2381
+ title: "API request workflow",
2382
+ description: "Webhook to HTTP request.",
2383
+ status: "draft",
2384
+ version: 1
2385
+ }
2386
+ }, nt = {
2387
+ nodes: [
2388
+ {
2389
+ id: "start",
2390
+ type: "startNode",
2391
+ position: {
2392
+ x: 0,
2393
+ y: 100
2394
+ },
2395
+ data: {
2396
+ label: "Nightly schedule",
2397
+ triggerType: "scheduled"
2398
+ }
2399
+ },
2400
+ {
2401
+ id: "delay",
2402
+ type: "delayNode",
2403
+ position: {
2404
+ x: 280,
2405
+ y: 100
2406
+ },
2407
+ data: {
2408
+ label: "Wait for upstream data",
2409
+ duration: 30,
2410
+ unit: "minutes"
2411
+ }
2412
+ },
2413
+ {
2414
+ id: "action",
2415
+ type: "actionNode",
2416
+ position: {
2417
+ x: 560,
2418
+ y: 100
2419
+ },
2420
+ data: {
2421
+ label: "Run reconciliation",
2422
+ actionType: "reconcile"
2423
+ }
2424
+ },
2425
+ {
2426
+ id: "end",
2427
+ type: "endNode",
2428
+ position: {
2429
+ x: 840,
2430
+ y: 100
2431
+ },
2432
+ data: {
2433
+ label: "Completed",
2434
+ outcome: "success"
2435
+ }
2436
+ }
2437
+ ],
2438
+ edges: [
2439
+ {
2440
+ id: "start-delay",
2441
+ source: "start",
2442
+ target: "delay",
2443
+ type: "ezEdge"
2444
+ },
2445
+ {
2446
+ id: "delay-action",
2447
+ source: "delay",
2448
+ target: "action",
2449
+ type: "ezEdge"
2450
+ },
2451
+ {
2452
+ id: "action-end",
2453
+ source: "action",
2454
+ target: "end",
2455
+ type: "ezEdge"
2456
+ }
2457
+ ],
2458
+ metadata: {
2459
+ title: "Scheduled workflow",
2460
+ description: "Scheduled job with delayed execution.",
2461
+ status: "draft",
2462
+ version: 1
2463
+ }
2464
+ }, rt = {
2465
+ nodes: [
2466
+ {
2467
+ id: "start",
2468
+ type: "startNode",
2469
+ position: {
2470
+ x: 0,
2471
+ y: 100
2472
+ },
2473
+ data: {
2474
+ label: "Case opened",
2475
+ triggerType: "manual"
2476
+ }
2477
+ },
2478
+ {
2479
+ id: "review",
2480
+ type: "approvalNode",
2481
+ position: {
2482
+ x: 280,
2483
+ y: 100
2484
+ },
2485
+ data: {
2486
+ label: "Specialist review",
2487
+ approverRole: "specialist",
2488
+ escalationRole: "team-lead",
2489
+ slaHours: 8
2490
+ }
2491
+ },
2492
+ {
2493
+ id: "action",
2494
+ type: "actionNode",
2495
+ position: {
2496
+ x: 560,
2497
+ y: 100
2498
+ },
2499
+ data: {
2500
+ label: "Apply decision",
2501
+ actionType: "apply-review-outcome"
2502
+ }
2503
+ },
2504
+ {
2505
+ id: "end",
2506
+ type: "endNode",
2507
+ position: {
2508
+ x: 840,
2509
+ y: 100
2510
+ },
2511
+ data: {
2512
+ label: "Case closed",
2513
+ outcome: "success"
2514
+ }
2515
+ }
2516
+ ],
2517
+ edges: [
2518
+ {
2519
+ id: "start-review",
2520
+ source: "start",
2521
+ target: "review",
2522
+ type: "ezEdge"
2523
+ },
2524
+ {
2525
+ id: "review-action",
2526
+ source: "review",
2527
+ target: "action",
2528
+ type: "ezEdge"
2529
+ },
2530
+ {
2531
+ id: "action-end",
2532
+ source: "action",
2533
+ target: "end",
2534
+ type: "ezEdge"
2535
+ }
2536
+ ],
2537
+ metadata: {
2538
+ title: "Human review workflow",
2539
+ description: "Human review followed by an automated action.",
2540
+ status: "draft",
2541
+ version: 1
2542
+ }
2543
+ };
2544
+ //#endregion
2545
+ export { I as A, H as C, z as D, B as E, R as O, Ae as S, ke as T, Ie as _, Qe as a, Me as b, Ye as c, $ as d, He as f, Le as g, X as h, nt as i, F as j, L as k, Ze as l, Y as m, et as n, $e as o, ze as p, rt as r, Xe as s, tt as t, Ke as u, Pe as v, V as w, je as x, Ne as y };