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
@@ -1,2021 +0,0 @@
1
- import * as y from "react";
2
- import { jsx as x, Fragment as Ct, jsxs as Rt } from "react/jsx-runtime";
3
- import { T as Pt, b as Et, d as Ft, e as Mt } from "./tooltip-BCtrEe0z.js";
4
- var I = class {
5
- constructor() {
6
- this.listeners = /* @__PURE__ */ new Set(), this.subscribe = this.subscribe.bind(this);
7
- }
8
- subscribe(t) {
9
- return this.listeners.add(t), this.onSubscribe(), () => {
10
- this.listeners.delete(t), this.onUnsubscribe();
11
- };
12
- }
13
- hasListeners() {
14
- return this.listeners.size > 0;
15
- }
16
- onSubscribe() {
17
- }
18
- onUnsubscribe() {
19
- }
20
- }, Qt = {
21
- // We need the wrapper function syntax below instead of direct references to
22
- // global setTimeout etc.
23
- //
24
- // BAD: `setTimeout: setTimeout`
25
- // GOOD: `setTimeout: (cb, delay) => setTimeout(cb, delay)`
26
- //
27
- // If we use direct references here, then anything that wants to spy on or
28
- // replace the global setTimeout (like tests) won't work since we'll already
29
- // have a hard reference to the original implementation at the time when this
30
- // file was imported.
31
- setTimeout: (t, e) => setTimeout(t, e),
32
- clearTimeout: (t) => clearTimeout(t),
33
- setInterval: (t, e) => setInterval(t, e),
34
- clearInterval: (t) => clearInterval(t)
35
- }, Tt = class {
36
- // We cannot have TimeoutManager<T> as we must instantiate it with a concrete
37
- // type at app boot; and if we leave that type, then any new timer provider
38
- // would need to support ReturnType<typeof setTimeout>, which is infeasible.
39
- //
40
- // We settle for type safety for the TimeoutProvider type, and accept that
41
- // this class is unsafe internally to allow for extension.
42
- #t = Qt;
43
- #e = !1;
44
- setTimeoutProvider(t) {
45
- process.env.NODE_ENV !== "production" && this.#e && t !== this.#t && console.error(
46
- "[timeoutManager]: Switching provider after calls to previous provider might result in unexpected behavior.",
47
- { previous: this.#t, provider: t }
48
- ), this.#t = t, process.env.NODE_ENV !== "production" && (this.#e = !1);
49
- }
50
- setTimeout(t, e) {
51
- return process.env.NODE_ENV !== "production" && (this.#e = !0), this.#t.setTimeout(t, e);
52
- }
53
- clearTimeout(t) {
54
- this.#t.clearTimeout(t);
55
- }
56
- setInterval(t, e) {
57
- return process.env.NODE_ENV !== "production" && (this.#e = !0), this.#t.setInterval(t, e);
58
- }
59
- clearInterval(t) {
60
- this.#t.clearInterval(t);
61
- }
62
- }, Q = new Tt();
63
- function Dt(t) {
64
- setTimeout(t, 0);
65
- }
66
- var T = typeof window > "u" || "Deno" in globalThis;
67
- function b() {
68
- }
69
- function It(t, e) {
70
- return typeof t == "function" ? t(e) : t;
71
- }
72
- function G(t) {
73
- return typeof t == "number" && t >= 0 && t !== 1 / 0;
74
- }
75
- function dt(t, e) {
76
- return Math.max(t + (e || 0) - Date.now(), 0);
77
- }
78
- function E(t, e) {
79
- return typeof t == "function" ? t(e) : t;
80
- }
81
- function w(t, e) {
82
- return typeof t == "function" ? t(e) : t;
83
- }
84
- function st(t, e) {
85
- const {
86
- type: s = "all",
87
- exact: i,
88
- fetchStatus: r,
89
- predicate: a,
90
- queryKey: o,
91
- stale: n
92
- } = t;
93
- if (o) {
94
- if (i) {
95
- if (e.queryHash !== Z(o, e.options))
96
- return !1;
97
- } else if (!A(e.queryKey, o))
98
- return !1;
99
- }
100
- if (s !== "all") {
101
- const h = e.isActive();
102
- if (s === "active" && !h || s === "inactive" && h)
103
- return !1;
104
- }
105
- return !(typeof n == "boolean" && e.isStale() !== n || r && r !== e.state.fetchStatus || a && !a(e));
106
- }
107
- function it(t, e) {
108
- const { exact: s, status: i, predicate: r, mutationKey: a } = t;
109
- if (a) {
110
- if (!e.options.mutationKey)
111
- return !1;
112
- if (s) {
113
- if (D(e.options.mutationKey) !== D(a))
114
- return !1;
115
- } else if (!A(e.options.mutationKey, a))
116
- return !1;
117
- }
118
- return !(i && e.state.status !== i || r && !r(e));
119
- }
120
- function Z(t, e) {
121
- return (e?.queryKeyHashFn || D)(t);
122
- }
123
- function D(t) {
124
- return JSON.stringify(
125
- t,
126
- (e, s) => V(s) ? Object.keys(s).sort().reduce((i, r) => (i[r] = s[r], i), {}) : s
127
- );
128
- }
129
- function A(t, e) {
130
- return t === e ? !0 : typeof t != typeof e ? !1 : t && e && typeof t == "object" && typeof e == "object" ? Object.keys(e).every((s) => A(t[s], e[s])) : !1;
131
- }
132
- var qt = Object.prototype.hasOwnProperty;
133
- function B(t, e, s = 0) {
134
- if (t === e)
135
- return t;
136
- if (s > 500) return e;
137
- const i = rt(t) && rt(e);
138
- if (!i && !(V(t) && V(e))) return e;
139
- const a = (i ? t : Object.keys(t)).length, o = i ? e : Object.keys(e), n = o.length, h = i ? new Array(n) : {};
140
- let l = 0;
141
- for (let u = 0; u < n; u++) {
142
- const m = i ? u : o[u], c = t[m], v = e[m];
143
- if (c === v) {
144
- h[m] = c, (i ? u < a : qt.call(t, m)) && l++;
145
- continue;
146
- }
147
- if (c === null || v === null || typeof c != "object" || typeof v != "object") {
148
- h[m] = v;
149
- continue;
150
- }
151
- const d = B(c, v, s + 1);
152
- h[m] = d, d === c && l++;
153
- }
154
- return a === n && l === a ? t : h;
155
- }
156
- function _(t, e) {
157
- if (!e || Object.keys(t).length !== Object.keys(e).length)
158
- return !1;
159
- for (const s in t)
160
- if (t[s] !== e[s])
161
- return !1;
162
- return !0;
163
- }
164
- function rt(t) {
165
- return Array.isArray(t) && t.length === Object.keys(t).length;
166
- }
167
- function V(t) {
168
- if (!nt(t))
169
- return !1;
170
- const e = t.constructor;
171
- if (e === void 0)
172
- return !0;
173
- const s = e.prototype;
174
- return !(!nt(s) || !s.hasOwnProperty("isPrototypeOf") || Object.getPrototypeOf(t) !== Object.prototype);
175
- }
176
- function nt(t) {
177
- return Object.prototype.toString.call(t) === "[object Object]";
178
- }
179
- function xt(t) {
180
- return new Promise((e) => {
181
- Q.setTimeout(e, t);
182
- });
183
- }
184
- function z(t, e, s) {
185
- if (typeof s.structuralSharing == "function")
186
- return s.structuralSharing(t, e);
187
- if (s.structuralSharing !== !1) {
188
- if (process.env.NODE_ENV !== "production")
189
- try {
190
- return B(t, e);
191
- } catch (i) {
192
- throw console.error(
193
- `Structural sharing requires data to be JSON serializable. To fix this, turn off structuralSharing or return JSON-serializable data from your queryFn. [${s.queryHash}]: ${i}`
194
- ), i;
195
- }
196
- return B(t, e);
197
- }
198
- return e;
199
- }
200
- function At(t, e, s = 0) {
201
- const i = [...t, e];
202
- return s && i.length > s ? i.slice(1) : i;
203
- }
204
- function jt(t, e, s = 0) {
205
- const i = [e, ...t];
206
- return s && i.length > s ? i.slice(0, -1) : i;
207
- }
208
- var K = /* @__PURE__ */ Symbol();
209
- function pt(t, e) {
210
- return process.env.NODE_ENV !== "production" && t.queryFn === K && console.error(
211
- `Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${t.queryHash}'`
212
- ), !t.queryFn && e?.initialPromise ? () => e.initialPromise : !t.queryFn || t.queryFn === K ? () => Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)) : t.queryFn;
213
- }
214
- function X(t, e) {
215
- return typeof t == "function" ? t(...e) : !!t;
216
- }
217
- function Ut(t, e, s) {
218
- let i = !1, r;
219
- return Object.defineProperty(t, "signal", {
220
- enumerable: !0,
221
- get: () => (r ??= e(), i || (i = !0, r.aborted ? s() : r.addEventListener("abort", s, { once: !0 })), r)
222
- }), t;
223
- }
224
- var kt = class extends I {
225
- #t;
226
- #e;
227
- #s;
228
- constructor() {
229
- super(), this.#s = (t) => {
230
- if (!T && window.addEventListener) {
231
- const e = () => t();
232
- return window.addEventListener("visibilitychange", e, !1), () => {
233
- window.removeEventListener("visibilitychange", e);
234
- };
235
- }
236
- };
237
- }
238
- onSubscribe() {
239
- this.#e || this.setEventListener(this.#s);
240
- }
241
- onUnsubscribe() {
242
- this.hasListeners() || (this.#e?.(), this.#e = void 0);
243
- }
244
- setEventListener(t) {
245
- this.#s = t, this.#e?.(), this.#e = t((e) => {
246
- typeof e == "boolean" ? this.setFocused(e) : this.onFocus();
247
- });
248
- }
249
- setFocused(t) {
250
- this.#t !== t && (this.#t = t, this.onFocus());
251
- }
252
- onFocus() {
253
- const t = this.isFocused();
254
- this.listeners.forEach((e) => {
255
- e(t);
256
- });
257
- }
258
- isFocused() {
259
- return typeof this.#t == "boolean" ? this.#t : globalThis.document?.visibilityState !== "hidden";
260
- }
261
- }, Y = new kt();
262
- function W() {
263
- let t, e;
264
- const s = new Promise((r, a) => {
265
- t = r, e = a;
266
- });
267
- s.status = "pending", s.catch(() => {
268
- });
269
- function i(r) {
270
- Object.assign(s, r), delete s.resolve, delete s.reject;
271
- }
272
- return s.resolve = (r) => {
273
- i({
274
- status: "fulfilled",
275
- value: r
276
- }), t(r);
277
- }, s.reject = (r) => {
278
- i({
279
- status: "rejected",
280
- reason: r
281
- }), e(r);
282
- }, s;
283
- }
284
- var Nt = Dt;
285
- function _t() {
286
- let t = [], e = 0, s = (n) => {
287
- n();
288
- }, i = (n) => {
289
- n();
290
- }, r = Nt;
291
- const a = (n) => {
292
- e ? t.push(n) : r(() => {
293
- s(n);
294
- });
295
- }, o = () => {
296
- const n = t;
297
- t = [], n.length && r(() => {
298
- i(() => {
299
- n.forEach((h) => {
300
- s(h);
301
- });
302
- });
303
- });
304
- };
305
- return {
306
- batch: (n) => {
307
- let h;
308
- e++;
309
- try {
310
- h = n();
311
- } finally {
312
- e--, e || o();
313
- }
314
- return h;
315
- },
316
- /**
317
- * All calls to the wrapped function will be batched.
318
- */
319
- batchCalls: (n) => (...h) => {
320
- a(() => {
321
- n(...h);
322
- });
323
- },
324
- schedule: a,
325
- /**
326
- * Use this method to set a custom notify function.
327
- * This can be used to for example wrap notifications with `React.act` while running tests.
328
- */
329
- setNotifyFunction: (n) => {
330
- s = n;
331
- },
332
- /**
333
- * Use this method to set a custom function to batch notifications together into a single tick.
334
- * By default React Query will use the batch function provided by ReactDOM or React Native.
335
- */
336
- setBatchNotifyFunction: (n) => {
337
- i = n;
338
- },
339
- setScheduler: (n) => {
340
- r = n;
341
- }
342
- };
343
- }
344
- var p = _t(), Kt = class extends I {
345
- #t = !0;
346
- #e;
347
- #s;
348
- constructor() {
349
- super(), this.#s = (t) => {
350
- if (!T && window.addEventListener) {
351
- const e = () => t(!0), s = () => t(!1);
352
- return window.addEventListener("online", e, !1), window.addEventListener("offline", s, !1), () => {
353
- window.removeEventListener("online", e), window.removeEventListener("offline", s);
354
- };
355
- }
356
- };
357
- }
358
- onSubscribe() {
359
- this.#e || this.setEventListener(this.#s);
360
- }
361
- onUnsubscribe() {
362
- this.hasListeners() || (this.#e?.(), this.#e = void 0);
363
- }
364
- setEventListener(t) {
365
- this.#s = t, this.#e?.(), this.#e = t(this.setOnline.bind(this));
366
- }
367
- setOnline(t) {
368
- this.#t !== t && (this.#t = t, this.listeners.forEach((s) => {
369
- s(t);
370
- }));
371
- }
372
- isOnline() {
373
- return this.#t;
374
- }
375
- }, L = new Kt();
376
- function Lt(t) {
377
- return Math.min(1e3 * 2 ** t, 3e4);
378
- }
379
- function yt(t) {
380
- return (t ?? "online") === "online" ? L.isOnline() : !0;
381
- }
382
- var $ = class extends Error {
383
- constructor(t) {
384
- super("CancelledError"), this.revert = t?.revert, this.silent = t?.silent;
385
- }
386
- };
387
- function mt(t) {
388
- let e = !1, s = 0, i;
389
- const r = W(), a = () => r.status !== "pending", o = (f) => {
390
- if (!a()) {
391
- const g = new $(f);
392
- c(g), t.onCancel?.(g);
393
- }
394
- }, n = () => {
395
- e = !0;
396
- }, h = () => {
397
- e = !1;
398
- }, l = () => Y.isFocused() && (t.networkMode === "always" || L.isOnline()) && t.canRun(), u = () => yt(t.networkMode) && t.canRun(), m = (f) => {
399
- a() || (i?.(), r.resolve(f));
400
- }, c = (f) => {
401
- a() || (i?.(), r.reject(f));
402
- }, v = () => new Promise((f) => {
403
- i = (g) => {
404
- (a() || l()) && f(g);
405
- }, t.onPause?.();
406
- }).then(() => {
407
- i = void 0, a() || t.onContinue?.();
408
- }), d = () => {
409
- if (a())
410
- return;
411
- let f;
412
- const g = s === 0 ? t.initialPromise : void 0;
413
- try {
414
- f = g ?? t.fn();
415
- } catch (O) {
416
- f = Promise.reject(O);
417
- }
418
- Promise.resolve(f).then(m).catch((O) => {
419
- if (a())
420
- return;
421
- const C = t.retry ?? (T ? 0 : 3), R = t.retryDelay ?? Lt, F = typeof R == "function" ? R(s, O) : R, M = C === !0 || typeof C == "number" && s < C || typeof C == "function" && C(s, O);
422
- if (e || !M) {
423
- c(O);
424
- return;
425
- }
426
- s++, t.onFail?.(s, O), xt(F).then(() => l() ? void 0 : v()).then(() => {
427
- e ? c(O) : d();
428
- });
429
- });
430
- };
431
- return {
432
- promise: r,
433
- status: () => r.status,
434
- cancel: o,
435
- continue: () => (i?.(), r),
436
- cancelRetry: n,
437
- continueRetry: h,
438
- canStart: u,
439
- start: () => (u() ? d() : v().then(d), r)
440
- };
441
- }
442
- var vt = class {
443
- #t;
444
- destroy() {
445
- this.clearGcTimeout();
446
- }
447
- scheduleGc() {
448
- this.clearGcTimeout(), G(this.gcTime) && (this.#t = Q.setTimeout(() => {
449
- this.optionalRemove();
450
- }, this.gcTime));
451
- }
452
- updateGcTime(t) {
453
- this.gcTime = Math.max(
454
- this.gcTime || 0,
455
- t ?? (T ? 1 / 0 : 300 * 1e3)
456
- );
457
- }
458
- clearGcTimeout() {
459
- this.#t && (Q.clearTimeout(this.#t), this.#t = void 0);
460
- }
461
- }, Ht = class extends vt {
462
- #t;
463
- #e;
464
- #s;
465
- #r;
466
- #i;
467
- #a;
468
- #o;
469
- constructor(t) {
470
- super(), this.#o = !1, this.#a = t.defaultOptions, this.setOptions(t.options), this.observers = [], this.#r = t.client, this.#s = this.#r.getQueryCache(), this.queryKey = t.queryKey, this.queryHash = t.queryHash, this.#t = ot(this.options), this.state = t.state ?? this.#t, this.scheduleGc();
471
- }
472
- get meta() {
473
- return this.options.meta;
474
- }
475
- get promise() {
476
- return this.#i?.promise;
477
- }
478
- setOptions(t) {
479
- if (this.options = { ...this.#a, ...t }, this.updateGcTime(this.options.gcTime), this.state && this.state.data === void 0) {
480
- const e = ot(this.options);
481
- e.data !== void 0 && (this.setState(
482
- at(e.data, e.dataUpdatedAt)
483
- ), this.#t = e);
484
- }
485
- }
486
- optionalRemove() {
487
- !this.observers.length && this.state.fetchStatus === "idle" && this.#s.remove(this);
488
- }
489
- setData(t, e) {
490
- const s = z(this.state.data, t, this.options);
491
- return this.#n({
492
- data: s,
493
- type: "success",
494
- dataUpdatedAt: e?.updatedAt,
495
- manual: e?.manual
496
- }), s;
497
- }
498
- setState(t, e) {
499
- this.#n({ type: "setState", state: t, setStateOptions: e });
500
- }
501
- cancel(t) {
502
- const e = this.#i?.promise;
503
- return this.#i?.cancel(t), e ? e.then(b).catch(b) : Promise.resolve();
504
- }
505
- destroy() {
506
- super.destroy(), this.cancel({ silent: !0 });
507
- }
508
- reset() {
509
- this.destroy(), this.setState(this.#t);
510
- }
511
- isActive() {
512
- return this.observers.some(
513
- (t) => w(t.options.enabled, this) !== !1
514
- );
515
- }
516
- isDisabled() {
517
- return this.getObserversCount() > 0 ? !this.isActive() : this.options.queryFn === K || this.state.dataUpdateCount + this.state.errorUpdateCount === 0;
518
- }
519
- isStatic() {
520
- return this.getObserversCount() > 0 ? this.observers.some(
521
- (t) => E(t.options.staleTime, this) === "static"
522
- ) : !1;
523
- }
524
- isStale() {
525
- return this.getObserversCount() > 0 ? this.observers.some(
526
- (t) => t.getCurrentResult().isStale
527
- ) : this.state.data === void 0 || this.state.isInvalidated;
528
- }
529
- isStaleByTime(t = 0) {
530
- return this.state.data === void 0 ? !0 : t === "static" ? !1 : this.state.isInvalidated ? !0 : !dt(this.state.dataUpdatedAt, t);
531
- }
532
- onFocus() {
533
- this.observers.find((e) => e.shouldFetchOnWindowFocus())?.refetch({ cancelRefetch: !1 }), this.#i?.continue();
534
- }
535
- onOnline() {
536
- this.observers.find((e) => e.shouldFetchOnReconnect())?.refetch({ cancelRefetch: !1 }), this.#i?.continue();
537
- }
538
- addObserver(t) {
539
- this.observers.includes(t) || (this.observers.push(t), this.clearGcTimeout(), this.#s.notify({ type: "observerAdded", query: this, observer: t }));
540
- }
541
- removeObserver(t) {
542
- this.observers.includes(t) && (this.observers = this.observers.filter((e) => e !== t), this.observers.length || (this.#i && (this.#o ? this.#i.cancel({ revert: !0 }) : this.#i.cancelRetry()), this.scheduleGc()), this.#s.notify({ type: "observerRemoved", query: this, observer: t }));
543
- }
544
- getObserversCount() {
545
- return this.observers.length;
546
- }
547
- invalidate() {
548
- this.state.isInvalidated || this.#n({ type: "invalidate" });
549
- }
550
- async fetch(t, e) {
551
- if (this.state.fetchStatus !== "idle" && // If the promise in the retryer is already rejected, we have to definitely
552
- // re-start the fetch; there is a chance that the query is still in a
553
- // pending state when that happens
554
- this.#i?.status() !== "rejected") {
555
- if (this.state.data !== void 0 && e?.cancelRefetch)
556
- this.cancel({ silent: !0 });
557
- else if (this.#i)
558
- return this.#i.continueRetry(), this.#i.promise;
559
- }
560
- if (t && this.setOptions(t), !this.options.queryFn) {
561
- const n = this.observers.find((h) => h.options.queryFn);
562
- n && this.setOptions(n.options);
563
- }
564
- process.env.NODE_ENV !== "production" && (Array.isArray(this.options.queryKey) || console.error(
565
- "As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']"
566
- ));
567
- const s = new AbortController(), i = (n) => {
568
- Object.defineProperty(n, "signal", {
569
- enumerable: !0,
570
- get: () => (this.#o = !0, s.signal)
571
- });
572
- }, r = () => {
573
- const n = pt(this.options, e), l = (() => {
574
- const u = {
575
- client: this.#r,
576
- queryKey: this.queryKey,
577
- meta: this.meta
578
- };
579
- return i(u), u;
580
- })();
581
- return this.#o = !1, this.options.persister ? this.options.persister(
582
- n,
583
- l,
584
- this
585
- ) : n(l);
586
- }, o = (() => {
587
- const n = {
588
- fetchOptions: e,
589
- options: this.options,
590
- queryKey: this.queryKey,
591
- client: this.#r,
592
- state: this.state,
593
- fetchFn: r
594
- };
595
- return i(n), n;
596
- })();
597
- this.options.behavior?.onFetch(o, this), this.#e = this.state, (this.state.fetchStatus === "idle" || this.state.fetchMeta !== o.fetchOptions?.meta) && this.#n({ type: "fetch", meta: o.fetchOptions?.meta }), this.#i = mt({
598
- initialPromise: e?.initialPromise,
599
- fn: o.fetchFn,
600
- onCancel: (n) => {
601
- n instanceof $ && n.revert && this.setState({
602
- ...this.#e,
603
- fetchStatus: "idle"
604
- }), s.abort();
605
- },
606
- onFail: (n, h) => {
607
- this.#n({ type: "failed", failureCount: n, error: h });
608
- },
609
- onPause: () => {
610
- this.#n({ type: "pause" });
611
- },
612
- onContinue: () => {
613
- this.#n({ type: "continue" });
614
- },
615
- retry: o.options.retry,
616
- retryDelay: o.options.retryDelay,
617
- networkMode: o.options.networkMode,
618
- canRun: () => !0
619
- });
620
- try {
621
- const n = await this.#i.start();
622
- if (n === void 0)
623
- throw process.env.NODE_ENV !== "production" && console.error(
624
- `Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`
625
- ), new Error(`${this.queryHash} data is undefined`);
626
- return this.setData(n), this.#s.config.onSuccess?.(n, this), this.#s.config.onSettled?.(
627
- n,
628
- this.state.error,
629
- this
630
- ), n;
631
- } catch (n) {
632
- if (n instanceof $) {
633
- if (n.silent)
634
- return this.#i.promise;
635
- if (n.revert) {
636
- if (this.state.data === void 0)
637
- throw n;
638
- return this.state.data;
639
- }
640
- }
641
- throw this.#n({
642
- type: "error",
643
- error: n
644
- }), this.#s.config.onError?.(
645
- n,
646
- this
647
- ), this.#s.config.onSettled?.(
648
- this.state.data,
649
- n,
650
- this
651
- ), n;
652
- } finally {
653
- this.scheduleGc();
654
- }
655
- }
656
- #n(t) {
657
- const e = (s) => {
658
- switch (t.type) {
659
- case "failed":
660
- return {
661
- ...s,
662
- fetchFailureCount: t.failureCount,
663
- fetchFailureReason: t.error
664
- };
665
- case "pause":
666
- return {
667
- ...s,
668
- fetchStatus: "paused"
669
- };
670
- case "continue":
671
- return {
672
- ...s,
673
- fetchStatus: "fetching"
674
- };
675
- case "fetch":
676
- return {
677
- ...s,
678
- ...gt(s.data, this.options),
679
- fetchMeta: t.meta ?? null
680
- };
681
- case "success":
682
- const i = {
683
- ...s,
684
- ...at(t.data, t.dataUpdatedAt),
685
- dataUpdateCount: s.dataUpdateCount + 1,
686
- ...!t.manual && {
687
- fetchStatus: "idle",
688
- fetchFailureCount: 0,
689
- fetchFailureReason: null
690
- }
691
- };
692
- return this.#e = t.manual ? i : void 0, i;
693
- case "error":
694
- const r = t.error;
695
- return {
696
- ...s,
697
- error: r,
698
- errorUpdateCount: s.errorUpdateCount + 1,
699
- errorUpdatedAt: Date.now(),
700
- fetchFailureCount: s.fetchFailureCount + 1,
701
- fetchFailureReason: r,
702
- fetchStatus: "idle",
703
- status: "error",
704
- // flag existing data as invalidated if we get a background error
705
- // note that "no data" always means stale so we can set unconditionally here
706
- isInvalidated: !0
707
- };
708
- case "invalidate":
709
- return {
710
- ...s,
711
- isInvalidated: !0
712
- };
713
- case "setState":
714
- return {
715
- ...s,
716
- ...t.state
717
- };
718
- }
719
- };
720
- this.state = e(this.state), p.batch(() => {
721
- this.observers.forEach((s) => {
722
- s.onQueryUpdate();
723
- }), this.#s.notify({ query: this, type: "updated", action: t });
724
- });
725
- }
726
- };
727
- function gt(t, e) {
728
- return {
729
- fetchFailureCount: 0,
730
- fetchFailureReason: null,
731
- fetchStatus: yt(e.networkMode) ? "fetching" : "paused",
732
- ...t === void 0 && {
733
- error: null,
734
- status: "pending"
735
- }
736
- };
737
- }
738
- function at(t, e) {
739
- return {
740
- data: t,
741
- dataUpdatedAt: e ?? Date.now(),
742
- error: null,
743
- isInvalidated: !1,
744
- status: "success"
745
- };
746
- }
747
- function ot(t) {
748
- const e = typeof t.initialData == "function" ? t.initialData() : t.initialData, s = e !== void 0, i = s ? typeof t.initialDataUpdatedAt == "function" ? t.initialDataUpdatedAt() : t.initialDataUpdatedAt : 0;
749
- return {
750
- data: e,
751
- dataUpdateCount: 0,
752
- dataUpdatedAt: s ? i ?? Date.now() : 0,
753
- error: null,
754
- errorUpdateCount: 0,
755
- errorUpdatedAt: 0,
756
- fetchFailureCount: 0,
757
- fetchFailureReason: null,
758
- fetchMeta: null,
759
- isInvalidated: !1,
760
- status: s ? "success" : "pending",
761
- fetchStatus: "idle"
762
- };
763
- }
764
- var Gt = class extends I {
765
- constructor(t, e) {
766
- super(), this.options = e, this.#t = t, this.#n = null, this.#o = W(), this.bindMethods(), this.setOptions(e);
767
- }
768
- #t;
769
- #e = void 0;
770
- #s = void 0;
771
- #r = void 0;
772
- #i;
773
- #a;
774
- #o;
775
- #n;
776
- #y;
777
- #f;
778
- // This property keeps track of the last query with defined data.
779
- // It will be used to pass the previous data and query to the placeholder function between renders.
780
- #d;
781
- #h;
782
- #c;
783
- #u;
784
- #p = /* @__PURE__ */ new Set();
785
- bindMethods() {
786
- this.refetch = this.refetch.bind(this);
787
- }
788
- onSubscribe() {
789
- this.listeners.size === 1 && (this.#e.addObserver(this), ut(this.#e, this.options) ? this.#l() : this.updateResult(), this.#b());
790
- }
791
- onUnsubscribe() {
792
- this.hasListeners() || this.destroy();
793
- }
794
- shouldFetchOnReconnect() {
795
- return J(
796
- this.#e,
797
- this.options,
798
- this.options.refetchOnReconnect
799
- );
800
- }
801
- shouldFetchOnWindowFocus() {
802
- return J(
803
- this.#e,
804
- this.options,
805
- this.options.refetchOnWindowFocus
806
- );
807
- }
808
- destroy() {
809
- this.listeners = /* @__PURE__ */ new Set(), this.#O(), this.#S(), this.#e.removeObserver(this);
810
- }
811
- setOptions(t) {
812
- const e = this.options, s = this.#e;
813
- if (this.options = this.#t.defaultQueryOptions(t), this.options.enabled !== void 0 && typeof this.options.enabled != "boolean" && typeof this.options.enabled != "function" && typeof w(this.options.enabled, this.#e) != "boolean")
814
- throw new Error(
815
- "Expected enabled to be a boolean or a callback that returns a boolean"
816
- );
817
- this.#w(), this.#e.setOptions(this.options), e._defaulted && !_(this.options, e) && this.#t.getQueryCache().notify({
818
- type: "observerOptionsUpdated",
819
- query: this.#e,
820
- observer: this
821
- });
822
- const i = this.hasListeners();
823
- i && ht(
824
- this.#e,
825
- s,
826
- this.options,
827
- e
828
- ) && this.#l(), this.updateResult(), i && (this.#e !== s || w(this.options.enabled, this.#e) !== w(e.enabled, this.#e) || E(this.options.staleTime, this.#e) !== E(e.staleTime, this.#e)) && this.#m();
829
- const r = this.#v();
830
- i && (this.#e !== s || w(this.options.enabled, this.#e) !== w(e.enabled, this.#e) || r !== this.#u) && this.#g(r);
831
- }
832
- getOptimisticResult(t) {
833
- const e = this.#t.getQueryCache().build(this.#t, t), s = this.createResult(e, t);
834
- return Vt(this, s) && (this.#r = s, this.#a = this.options, this.#i = this.#e.state), s;
835
- }
836
- getCurrentResult() {
837
- return this.#r;
838
- }
839
- trackResult(t, e) {
840
- return new Proxy(t, {
841
- get: (s, i) => (this.trackProp(i), e?.(i), i === "promise" && (this.trackProp("data"), !this.options.experimental_prefetchInRender && this.#o.status === "pending" && this.#o.reject(
842
- new Error(
843
- "experimental_prefetchInRender feature flag is not enabled"
844
- )
845
- )), Reflect.get(s, i))
846
- });
847
- }
848
- trackProp(t) {
849
- this.#p.add(t);
850
- }
851
- getCurrentQuery() {
852
- return this.#e;
853
- }
854
- refetch({ ...t } = {}) {
855
- return this.fetch({
856
- ...t
857
- });
858
- }
859
- fetchOptimistic(t) {
860
- const e = this.#t.defaultQueryOptions(t), s = this.#t.getQueryCache().build(this.#t, e);
861
- return s.fetch().then(() => this.createResult(s, e));
862
- }
863
- fetch(t) {
864
- return this.#l({
865
- ...t,
866
- cancelRefetch: t.cancelRefetch ?? !0
867
- }).then(() => (this.updateResult(), this.#r));
868
- }
869
- #l(t) {
870
- this.#w();
871
- let e = this.#e.fetch(
872
- this.options,
873
- t
874
- );
875
- return t?.throwOnError || (e = e.catch(b)), e;
876
- }
877
- #m() {
878
- this.#O();
879
- const t = E(
880
- this.options.staleTime,
881
- this.#e
882
- );
883
- if (T || this.#r.isStale || !G(t))
884
- return;
885
- const s = dt(this.#r.dataUpdatedAt, t) + 1;
886
- this.#h = Q.setTimeout(() => {
887
- this.#r.isStale || this.updateResult();
888
- }, s);
889
- }
890
- #v() {
891
- return (typeof this.options.refetchInterval == "function" ? this.options.refetchInterval(this.#e) : this.options.refetchInterval) ?? !1;
892
- }
893
- #g(t) {
894
- this.#S(), this.#u = t, !(T || w(this.options.enabled, this.#e) === !1 || !G(this.#u) || this.#u === 0) && (this.#c = Q.setInterval(() => {
895
- (this.options.refetchIntervalInBackground || Y.isFocused()) && this.#l();
896
- }, this.#u));
897
- }
898
- #b() {
899
- this.#m(), this.#g(this.#v());
900
- }
901
- #O() {
902
- this.#h && (Q.clearTimeout(this.#h), this.#h = void 0);
903
- }
904
- #S() {
905
- this.#c && (Q.clearInterval(this.#c), this.#c = void 0);
906
- }
907
- createResult(t, e) {
908
- const s = this.#e, i = this.options, r = this.#r, a = this.#i, o = this.#a, h = t !== s ? t.state : this.#s, { state: l } = t;
909
- let u = { ...l }, m = !1, c;
910
- if (e._optimisticResults) {
911
- const S = this.hasListeners(), q = !S && ut(t, e), j = S && ht(t, s, e, i);
912
- (q || j) && (u = {
913
- ...u,
914
- ...gt(l.data, t.options)
915
- }), e._optimisticResults === "isRestoring" && (u.fetchStatus = "idle");
916
- }
917
- let { error: v, errorUpdatedAt: d, status: f } = u;
918
- c = u.data;
919
- let g = !1;
920
- if (e.placeholderData !== void 0 && c === void 0 && f === "pending") {
921
- let S;
922
- r?.isPlaceholderData && e.placeholderData === o?.placeholderData ? (S = r.data, g = !0) : S = typeof e.placeholderData == "function" ? e.placeholderData(
923
- this.#d?.state.data,
924
- this.#d
925
- ) : e.placeholderData, S !== void 0 && (f = "success", c = z(
926
- r?.data,
927
- S,
928
- e
929
- ), m = !0);
930
- }
931
- if (e.select && c !== void 0 && !g)
932
- if (r && c === a?.data && e.select === this.#y)
933
- c = this.#f;
934
- else
935
- try {
936
- this.#y = e.select, c = e.select(c), c = z(r?.data, c, e), this.#f = c, this.#n = null;
937
- } catch (S) {
938
- this.#n = S;
939
- }
940
- this.#n && (v = this.#n, c = this.#f, d = Date.now(), f = "error");
941
- const O = u.fetchStatus === "fetching", C = f === "pending", R = f === "error", F = C && O, M = c !== void 0, P = {
942
- status: f,
943
- fetchStatus: u.fetchStatus,
944
- isPending: C,
945
- isSuccess: f === "success",
946
- isError: R,
947
- isInitialLoading: F,
948
- isLoading: F,
949
- data: c,
950
- dataUpdatedAt: u.dataUpdatedAt,
951
- error: v,
952
- errorUpdatedAt: d,
953
- failureCount: u.fetchFailureCount,
954
- failureReason: u.fetchFailureReason,
955
- errorUpdateCount: u.errorUpdateCount,
956
- isFetched: u.dataUpdateCount > 0 || u.errorUpdateCount > 0,
957
- isFetchedAfterMount: u.dataUpdateCount > h.dataUpdateCount || u.errorUpdateCount > h.errorUpdateCount,
958
- isFetching: O,
959
- isRefetching: O && !C,
960
- isLoadingError: R && !M,
961
- isPaused: u.fetchStatus === "paused",
962
- isPlaceholderData: m,
963
- isRefetchError: R && M,
964
- isStale: tt(t, e),
965
- refetch: this.refetch,
966
- promise: this.#o,
967
- isEnabled: w(e.enabled, t) !== !1
968
- };
969
- if (this.options.experimental_prefetchInRender) {
970
- const S = P.data !== void 0, q = P.status === "error" && !S, j = (k) => {
971
- q ? k.reject(P.error) : S && k.resolve(P.data);
972
- }, et = () => {
973
- const k = this.#o = P.promise = W();
974
- j(k);
975
- }, U = this.#o;
976
- switch (U.status) {
977
- case "pending":
978
- t.queryHash === s.queryHash && j(U);
979
- break;
980
- case "fulfilled":
981
- (q || P.data !== U.value) && et();
982
- break;
983
- case "rejected":
984
- (!q || P.error !== U.reason) && et();
985
- break;
986
- }
987
- }
988
- return P;
989
- }
990
- updateResult() {
991
- const t = this.#r, e = this.createResult(this.#e, this.options);
992
- if (this.#i = this.#e.state, this.#a = this.options, this.#i.data !== void 0 && (this.#d = this.#e), _(e, t))
993
- return;
994
- this.#r = e;
995
- const s = () => {
996
- if (!t)
997
- return !0;
998
- const { notifyOnChangeProps: i } = this.options, r = typeof i == "function" ? i() : i;
999
- if (r === "all" || !r && !this.#p.size)
1000
- return !0;
1001
- const a = new Set(
1002
- r ?? this.#p
1003
- );
1004
- return this.options.throwOnError && a.add("error"), Object.keys(this.#r).some((o) => {
1005
- const n = o;
1006
- return this.#r[n] !== t[n] && a.has(n);
1007
- });
1008
- };
1009
- this.#C({ listeners: s() });
1010
- }
1011
- #w() {
1012
- const t = this.#t.getQueryCache().build(this.#t, this.options);
1013
- if (t === this.#e)
1014
- return;
1015
- const e = this.#e;
1016
- this.#e = t, this.#s = t.state, this.hasListeners() && (e?.removeObserver(this), t.addObserver(this));
1017
- }
1018
- onQueryUpdate() {
1019
- this.updateResult(), this.hasListeners() && this.#b();
1020
- }
1021
- #C(t) {
1022
- p.batch(() => {
1023
- t.listeners && this.listeners.forEach((e) => {
1024
- e(this.#r);
1025
- }), this.#t.getQueryCache().notify({
1026
- query: this.#e,
1027
- type: "observerResultsUpdated"
1028
- });
1029
- });
1030
- }
1031
- };
1032
- function Bt(t, e) {
1033
- return w(e.enabled, t) !== !1 && t.state.data === void 0 && !(t.state.status === "error" && e.retryOnMount === !1);
1034
- }
1035
- function ut(t, e) {
1036
- return Bt(t, e) || t.state.data !== void 0 && J(t, e, e.refetchOnMount);
1037
- }
1038
- function J(t, e, s) {
1039
- if (w(e.enabled, t) !== !1 && E(e.staleTime, t) !== "static") {
1040
- const i = typeof s == "function" ? s(t) : s;
1041
- return i === "always" || i !== !1 && tt(t, e);
1042
- }
1043
- return !1;
1044
- }
1045
- function ht(t, e, s, i) {
1046
- return (t !== e || w(i.enabled, t) === !1) && (!s.suspense || t.state.status !== "error") && tt(t, s);
1047
- }
1048
- function tt(t, e) {
1049
- return w(e.enabled, t) !== !1 && t.isStaleByTime(E(e.staleTime, t));
1050
- }
1051
- function Vt(t, e) {
1052
- return !_(t.getCurrentResult(), e);
1053
- }
1054
- function ct(t) {
1055
- return {
1056
- onFetch: (e, s) => {
1057
- const i = e.options, r = e.fetchOptions?.meta?.fetchMore?.direction, a = e.state.data?.pages || [], o = e.state.data?.pageParams || [];
1058
- let n = { pages: [], pageParams: [] }, h = 0;
1059
- const l = async () => {
1060
- let u = !1;
1061
- const m = (d) => {
1062
- Ut(
1063
- d,
1064
- () => e.signal,
1065
- () => u = !0
1066
- );
1067
- }, c = pt(e.options, e.fetchOptions), v = async (d, f, g) => {
1068
- if (u)
1069
- return Promise.reject();
1070
- if (f == null && d.pages.length)
1071
- return Promise.resolve(d);
1072
- const C = (() => {
1073
- const H = {
1074
- client: e.client,
1075
- queryKey: e.queryKey,
1076
- pageParam: f,
1077
- direction: g ? "backward" : "forward",
1078
- meta: e.options.meta
1079
- };
1080
- return m(H), H;
1081
- })(), R = await c(C), { maxPages: F } = e.options, M = g ? jt : At;
1082
- return {
1083
- pages: M(d.pages, R, F),
1084
- pageParams: M(d.pageParams, f, F)
1085
- };
1086
- };
1087
- if (r && a.length) {
1088
- const d = r === "backward", f = d ? zt : lt, g = {
1089
- pages: a,
1090
- pageParams: o
1091
- }, O = f(i, g);
1092
- n = await v(g, O, d);
1093
- } else {
1094
- const d = t ?? a.length;
1095
- do {
1096
- const f = h === 0 ? o[0] ?? i.initialPageParam : lt(i, n);
1097
- if (h > 0 && f == null)
1098
- break;
1099
- n = await v(n, f), h++;
1100
- } while (h < d);
1101
- }
1102
- return n;
1103
- };
1104
- e.options.persister ? e.fetchFn = () => e.options.persister?.(
1105
- l,
1106
- {
1107
- client: e.client,
1108
- queryKey: e.queryKey,
1109
- meta: e.options.meta,
1110
- signal: e.signal
1111
- },
1112
- s
1113
- ) : e.fetchFn = l;
1114
- }
1115
- };
1116
- }
1117
- function lt(t, { pages: e, pageParams: s }) {
1118
- const i = e.length - 1;
1119
- return e.length > 0 ? t.getNextPageParam(
1120
- e[i],
1121
- e,
1122
- s[i],
1123
- s
1124
- ) : void 0;
1125
- }
1126
- function zt(t, { pages: e, pageParams: s }) {
1127
- return e.length > 0 ? t.getPreviousPageParam?.(e[0], e, s[0], s) : void 0;
1128
- }
1129
- var Wt = class extends vt {
1130
- #t;
1131
- #e;
1132
- #s;
1133
- #r;
1134
- constructor(t) {
1135
- super(), this.#t = t.client, this.mutationId = t.mutationId, this.#s = t.mutationCache, this.#e = [], this.state = t.state || bt(), this.setOptions(t.options), this.scheduleGc();
1136
- }
1137
- setOptions(t) {
1138
- this.options = t, this.updateGcTime(this.options.gcTime);
1139
- }
1140
- get meta() {
1141
- return this.options.meta;
1142
- }
1143
- addObserver(t) {
1144
- this.#e.includes(t) || (this.#e.push(t), this.clearGcTimeout(), this.#s.notify({
1145
- type: "observerAdded",
1146
- mutation: this,
1147
- observer: t
1148
- }));
1149
- }
1150
- removeObserver(t) {
1151
- this.#e = this.#e.filter((e) => e !== t), this.scheduleGc(), this.#s.notify({
1152
- type: "observerRemoved",
1153
- mutation: this,
1154
- observer: t
1155
- });
1156
- }
1157
- optionalRemove() {
1158
- this.#e.length || (this.state.status === "pending" ? this.scheduleGc() : this.#s.remove(this));
1159
- }
1160
- continue() {
1161
- return this.#r?.continue() ?? // continuing a mutation assumes that variables are set, mutation must have been dehydrated before
1162
- this.execute(this.state.variables);
1163
- }
1164
- async execute(t) {
1165
- const e = () => {
1166
- this.#i({ type: "continue" });
1167
- }, s = {
1168
- client: this.#t,
1169
- meta: this.options.meta,
1170
- mutationKey: this.options.mutationKey
1171
- };
1172
- this.#r = mt({
1173
- fn: () => this.options.mutationFn ? this.options.mutationFn(t, s) : Promise.reject(new Error("No mutationFn found")),
1174
- onFail: (a, o) => {
1175
- this.#i({ type: "failed", failureCount: a, error: o });
1176
- },
1177
- onPause: () => {
1178
- this.#i({ type: "pause" });
1179
- },
1180
- onContinue: e,
1181
- retry: this.options.retry ?? 0,
1182
- retryDelay: this.options.retryDelay,
1183
- networkMode: this.options.networkMode,
1184
- canRun: () => this.#s.canRun(this)
1185
- });
1186
- const i = this.state.status === "pending", r = !this.#r.canStart();
1187
- try {
1188
- if (i)
1189
- e();
1190
- else {
1191
- this.#i({ type: "pending", variables: t, isPaused: r }), this.#s.config.onMutate && await this.#s.config.onMutate(
1192
- t,
1193
- this,
1194
- s
1195
- );
1196
- const o = await this.options.onMutate?.(
1197
- t,
1198
- s
1199
- );
1200
- o !== this.state.context && this.#i({
1201
- type: "pending",
1202
- context: o,
1203
- variables: t,
1204
- isPaused: r
1205
- });
1206
- }
1207
- const a = await this.#r.start();
1208
- return await this.#s.config.onSuccess?.(
1209
- a,
1210
- t,
1211
- this.state.context,
1212
- this,
1213
- s
1214
- ), await this.options.onSuccess?.(
1215
- a,
1216
- t,
1217
- this.state.context,
1218
- s
1219
- ), await this.#s.config.onSettled?.(
1220
- a,
1221
- null,
1222
- this.state.variables,
1223
- this.state.context,
1224
- this,
1225
- s
1226
- ), await this.options.onSettled?.(
1227
- a,
1228
- null,
1229
- t,
1230
- this.state.context,
1231
- s
1232
- ), this.#i({ type: "success", data: a }), a;
1233
- } catch (a) {
1234
- try {
1235
- await this.#s.config.onError?.(
1236
- a,
1237
- t,
1238
- this.state.context,
1239
- this,
1240
- s
1241
- );
1242
- } catch (o) {
1243
- Promise.reject(o);
1244
- }
1245
- try {
1246
- await this.options.onError?.(
1247
- a,
1248
- t,
1249
- this.state.context,
1250
- s
1251
- );
1252
- } catch (o) {
1253
- Promise.reject(o);
1254
- }
1255
- try {
1256
- await this.#s.config.onSettled?.(
1257
- void 0,
1258
- a,
1259
- this.state.variables,
1260
- this.state.context,
1261
- this,
1262
- s
1263
- );
1264
- } catch (o) {
1265
- Promise.reject(o);
1266
- }
1267
- try {
1268
- await this.options.onSettled?.(
1269
- void 0,
1270
- a,
1271
- t,
1272
- this.state.context,
1273
- s
1274
- );
1275
- } catch (o) {
1276
- Promise.reject(o);
1277
- }
1278
- throw this.#i({ type: "error", error: a }), a;
1279
- } finally {
1280
- this.#s.runNext(this);
1281
- }
1282
- }
1283
- #i(t) {
1284
- const e = (s) => {
1285
- switch (t.type) {
1286
- case "failed":
1287
- return {
1288
- ...s,
1289
- failureCount: t.failureCount,
1290
- failureReason: t.error
1291
- };
1292
- case "pause":
1293
- return {
1294
- ...s,
1295
- isPaused: !0
1296
- };
1297
- case "continue":
1298
- return {
1299
- ...s,
1300
- isPaused: !1
1301
- };
1302
- case "pending":
1303
- return {
1304
- ...s,
1305
- context: t.context,
1306
- data: void 0,
1307
- failureCount: 0,
1308
- failureReason: null,
1309
- error: null,
1310
- isPaused: t.isPaused,
1311
- status: "pending",
1312
- variables: t.variables,
1313
- submittedAt: Date.now()
1314
- };
1315
- case "success":
1316
- return {
1317
- ...s,
1318
- data: t.data,
1319
- failureCount: 0,
1320
- failureReason: null,
1321
- error: null,
1322
- status: "success",
1323
- isPaused: !1
1324
- };
1325
- case "error":
1326
- return {
1327
- ...s,
1328
- data: void 0,
1329
- error: t.error,
1330
- failureCount: s.failureCount + 1,
1331
- failureReason: t.error,
1332
- isPaused: !1,
1333
- status: "error"
1334
- };
1335
- }
1336
- };
1337
- this.state = e(this.state), p.batch(() => {
1338
- this.#e.forEach((s) => {
1339
- s.onMutationUpdate(t);
1340
- }), this.#s.notify({
1341
- mutation: this,
1342
- type: "updated",
1343
- action: t
1344
- });
1345
- });
1346
- }
1347
- };
1348
- function bt() {
1349
- return {
1350
- context: void 0,
1351
- data: void 0,
1352
- error: null,
1353
- failureCount: 0,
1354
- failureReason: null,
1355
- isPaused: !1,
1356
- status: "idle",
1357
- variables: void 0,
1358
- submittedAt: 0
1359
- };
1360
- }
1361
- var $t = class extends I {
1362
- constructor(t = {}) {
1363
- super(), this.config = t, this.#t = /* @__PURE__ */ new Set(), this.#e = /* @__PURE__ */ new Map(), this.#s = 0;
1364
- }
1365
- #t;
1366
- #e;
1367
- #s;
1368
- build(t, e, s) {
1369
- const i = new Wt({
1370
- client: t,
1371
- mutationCache: this,
1372
- mutationId: ++this.#s,
1373
- options: t.defaultMutationOptions(e),
1374
- state: s
1375
- });
1376
- return this.add(i), i;
1377
- }
1378
- add(t) {
1379
- this.#t.add(t);
1380
- const e = N(t);
1381
- if (typeof e == "string") {
1382
- const s = this.#e.get(e);
1383
- s ? s.push(t) : this.#e.set(e, [t]);
1384
- }
1385
- this.notify({ type: "added", mutation: t });
1386
- }
1387
- remove(t) {
1388
- if (this.#t.delete(t)) {
1389
- const e = N(t);
1390
- if (typeof e == "string") {
1391
- const s = this.#e.get(e);
1392
- if (s)
1393
- if (s.length > 1) {
1394
- const i = s.indexOf(t);
1395
- i !== -1 && s.splice(i, 1);
1396
- } else s[0] === t && this.#e.delete(e);
1397
- }
1398
- }
1399
- this.notify({ type: "removed", mutation: t });
1400
- }
1401
- canRun(t) {
1402
- const e = N(t);
1403
- if (typeof e == "string") {
1404
- const i = this.#e.get(e)?.find(
1405
- (r) => r.state.status === "pending"
1406
- );
1407
- return !i || i === t;
1408
- } else
1409
- return !0;
1410
- }
1411
- runNext(t) {
1412
- const e = N(t);
1413
- return typeof e == "string" ? this.#e.get(e)?.find((i) => i !== t && i.state.isPaused)?.continue() ?? Promise.resolve() : Promise.resolve();
1414
- }
1415
- clear() {
1416
- p.batch(() => {
1417
- this.#t.forEach((t) => {
1418
- this.notify({ type: "removed", mutation: t });
1419
- }), this.#t.clear(), this.#e.clear();
1420
- });
1421
- }
1422
- getAll() {
1423
- return Array.from(this.#t);
1424
- }
1425
- find(t) {
1426
- const e = { exact: !0, ...t };
1427
- return this.getAll().find(
1428
- (s) => it(e, s)
1429
- );
1430
- }
1431
- findAll(t = {}) {
1432
- return this.getAll().filter((e) => it(t, e));
1433
- }
1434
- notify(t) {
1435
- p.batch(() => {
1436
- this.listeners.forEach((e) => {
1437
- e(t);
1438
- });
1439
- });
1440
- }
1441
- resumePausedMutations() {
1442
- const t = this.getAll().filter((e) => e.state.isPaused);
1443
- return p.batch(
1444
- () => Promise.all(
1445
- t.map((e) => e.continue().catch(b))
1446
- )
1447
- );
1448
- }
1449
- };
1450
- function N(t) {
1451
- return t.options.scope?.id;
1452
- }
1453
- var Jt = class extends I {
1454
- #t;
1455
- #e = void 0;
1456
- #s;
1457
- #r;
1458
- constructor(t, e) {
1459
- super(), this.#t = t, this.setOptions(e), this.bindMethods(), this.#i();
1460
- }
1461
- bindMethods() {
1462
- this.mutate = this.mutate.bind(this), this.reset = this.reset.bind(this);
1463
- }
1464
- setOptions(t) {
1465
- const e = this.options;
1466
- this.options = this.#t.defaultMutationOptions(t), _(this.options, e) || this.#t.getMutationCache().notify({
1467
- type: "observerOptionsUpdated",
1468
- mutation: this.#s,
1469
- observer: this
1470
- }), e?.mutationKey && this.options.mutationKey && D(e.mutationKey) !== D(this.options.mutationKey) ? this.reset() : this.#s?.state.status === "pending" && this.#s.setOptions(this.options);
1471
- }
1472
- onUnsubscribe() {
1473
- this.hasListeners() || this.#s?.removeObserver(this);
1474
- }
1475
- onMutationUpdate(t) {
1476
- this.#i(), this.#a(t);
1477
- }
1478
- getCurrentResult() {
1479
- return this.#e;
1480
- }
1481
- reset() {
1482
- this.#s?.removeObserver(this), this.#s = void 0, this.#i(), this.#a();
1483
- }
1484
- mutate(t, e) {
1485
- return this.#r = e, this.#s?.removeObserver(this), this.#s = this.#t.getMutationCache().build(this.#t, this.options), this.#s.addObserver(this), this.#s.execute(t);
1486
- }
1487
- #i() {
1488
- const t = this.#s?.state ?? bt();
1489
- this.#e = {
1490
- ...t,
1491
- isPending: t.status === "pending",
1492
- isSuccess: t.status === "success",
1493
- isError: t.status === "error",
1494
- isIdle: t.status === "idle",
1495
- mutate: this.mutate,
1496
- reset: this.reset
1497
- };
1498
- }
1499
- #a(t) {
1500
- p.batch(() => {
1501
- if (this.#r && this.hasListeners()) {
1502
- const e = this.#e.variables, s = this.#e.context, i = {
1503
- client: this.#t,
1504
- meta: this.options.meta,
1505
- mutationKey: this.options.mutationKey
1506
- };
1507
- if (t?.type === "success") {
1508
- try {
1509
- this.#r.onSuccess?.(
1510
- t.data,
1511
- e,
1512
- s,
1513
- i
1514
- );
1515
- } catch (r) {
1516
- Promise.reject(r);
1517
- }
1518
- try {
1519
- this.#r.onSettled?.(
1520
- t.data,
1521
- null,
1522
- e,
1523
- s,
1524
- i
1525
- );
1526
- } catch (r) {
1527
- Promise.reject(r);
1528
- }
1529
- } else if (t?.type === "error") {
1530
- try {
1531
- this.#r.onError?.(
1532
- t.error,
1533
- e,
1534
- s,
1535
- i
1536
- );
1537
- } catch (r) {
1538
- Promise.reject(r);
1539
- }
1540
- try {
1541
- this.#r.onSettled?.(
1542
- void 0,
1543
- t.error,
1544
- e,
1545
- s,
1546
- i
1547
- );
1548
- } catch (r) {
1549
- Promise.reject(r);
1550
- }
1551
- }
1552
- }
1553
- this.listeners.forEach((e) => {
1554
- e(this.#e);
1555
- });
1556
- });
1557
- }
1558
- }, Zt = class extends I {
1559
- constructor(t = {}) {
1560
- super(), this.config = t, this.#t = /* @__PURE__ */ new Map();
1561
- }
1562
- #t;
1563
- build(t, e, s) {
1564
- const i = e.queryKey, r = e.queryHash ?? Z(i, e);
1565
- let a = this.get(r);
1566
- return a || (a = new Ht({
1567
- client: t,
1568
- queryKey: i,
1569
- queryHash: r,
1570
- options: t.defaultQueryOptions(e),
1571
- state: s,
1572
- defaultOptions: t.getQueryDefaults(i)
1573
- }), this.add(a)), a;
1574
- }
1575
- add(t) {
1576
- this.#t.has(t.queryHash) || (this.#t.set(t.queryHash, t), this.notify({
1577
- type: "added",
1578
- query: t
1579
- }));
1580
- }
1581
- remove(t) {
1582
- const e = this.#t.get(t.queryHash);
1583
- e && (t.destroy(), e === t && this.#t.delete(t.queryHash), this.notify({ type: "removed", query: t }));
1584
- }
1585
- clear() {
1586
- p.batch(() => {
1587
- this.getAll().forEach((t) => {
1588
- this.remove(t);
1589
- });
1590
- });
1591
- }
1592
- get(t) {
1593
- return this.#t.get(t);
1594
- }
1595
- getAll() {
1596
- return [...this.#t.values()];
1597
- }
1598
- find(t) {
1599
- const e = { exact: !0, ...t };
1600
- return this.getAll().find(
1601
- (s) => st(e, s)
1602
- );
1603
- }
1604
- findAll(t = {}) {
1605
- const e = this.getAll();
1606
- return Object.keys(t).length > 0 ? e.filter((s) => st(t, s)) : e;
1607
- }
1608
- notify(t) {
1609
- p.batch(() => {
1610
- this.listeners.forEach((e) => {
1611
- e(t);
1612
- });
1613
- });
1614
- }
1615
- onFocus() {
1616
- p.batch(() => {
1617
- this.getAll().forEach((t) => {
1618
- t.onFocus();
1619
- });
1620
- });
1621
- }
1622
- onOnline() {
1623
- p.batch(() => {
1624
- this.getAll().forEach((t) => {
1625
- t.onOnline();
1626
- });
1627
- });
1628
- }
1629
- }, le = class {
1630
- #t;
1631
- #e;
1632
- #s;
1633
- #r;
1634
- #i;
1635
- #a;
1636
- #o;
1637
- #n;
1638
- constructor(t = {}) {
1639
- this.#t = t.queryCache || new Zt(), this.#e = t.mutationCache || new $t(), this.#s = t.defaultOptions || {}, this.#r = /* @__PURE__ */ new Map(), this.#i = /* @__PURE__ */ new Map(), this.#a = 0;
1640
- }
1641
- mount() {
1642
- this.#a++, this.#a === 1 && (this.#o = Y.subscribe(async (t) => {
1643
- t && (await this.resumePausedMutations(), this.#t.onFocus());
1644
- }), this.#n = L.subscribe(async (t) => {
1645
- t && (await this.resumePausedMutations(), this.#t.onOnline());
1646
- }));
1647
- }
1648
- unmount() {
1649
- this.#a--, this.#a === 0 && (this.#o?.(), this.#o = void 0, this.#n?.(), this.#n = void 0);
1650
- }
1651
- isFetching(t) {
1652
- return this.#t.findAll({ ...t, fetchStatus: "fetching" }).length;
1653
- }
1654
- isMutating(t) {
1655
- return this.#e.findAll({ ...t, status: "pending" }).length;
1656
- }
1657
- /**
1658
- * Imperative (non-reactive) way to retrieve data for a QueryKey.
1659
- * Should only be used in callbacks or functions where reading the latest data is necessary, e.g. for optimistic updates.
1660
- *
1661
- * Hint: Do not use this function inside a component, because it won't receive updates.
1662
- * Use `useQuery` to create a `QueryObserver` that subscribes to changes.
1663
- */
1664
- getQueryData(t) {
1665
- const e = this.defaultQueryOptions({ queryKey: t });
1666
- return this.#t.get(e.queryHash)?.state.data;
1667
- }
1668
- ensureQueryData(t) {
1669
- const e = this.defaultQueryOptions(t), s = this.#t.build(this, e), i = s.state.data;
1670
- return i === void 0 ? this.fetchQuery(t) : (t.revalidateIfStale && s.isStaleByTime(E(e.staleTime, s)) && this.prefetchQuery(e), Promise.resolve(i));
1671
- }
1672
- getQueriesData(t) {
1673
- return this.#t.findAll(t).map(({ queryKey: e, state: s }) => {
1674
- const i = s.data;
1675
- return [e, i];
1676
- });
1677
- }
1678
- setQueryData(t, e, s) {
1679
- const i = this.defaultQueryOptions({ queryKey: t }), a = this.#t.get(
1680
- i.queryHash
1681
- )?.state.data, o = It(e, a);
1682
- if (o !== void 0)
1683
- return this.#t.build(this, i).setData(o, { ...s, manual: !0 });
1684
- }
1685
- setQueriesData(t, e, s) {
1686
- return p.batch(
1687
- () => this.#t.findAll(t).map(({ queryKey: i }) => [
1688
- i,
1689
- this.setQueryData(i, e, s)
1690
- ])
1691
- );
1692
- }
1693
- getQueryState(t) {
1694
- const e = this.defaultQueryOptions({ queryKey: t });
1695
- return this.#t.get(
1696
- e.queryHash
1697
- )?.state;
1698
- }
1699
- removeQueries(t) {
1700
- const e = this.#t;
1701
- p.batch(() => {
1702
- e.findAll(t).forEach((s) => {
1703
- e.remove(s);
1704
- });
1705
- });
1706
- }
1707
- resetQueries(t, e) {
1708
- const s = this.#t;
1709
- return p.batch(() => (s.findAll(t).forEach((i) => {
1710
- i.reset();
1711
- }), this.refetchQueries(
1712
- {
1713
- type: "active",
1714
- ...t
1715
- },
1716
- e
1717
- )));
1718
- }
1719
- cancelQueries(t, e = {}) {
1720
- const s = { revert: !0, ...e }, i = p.batch(
1721
- () => this.#t.findAll(t).map((r) => r.cancel(s))
1722
- );
1723
- return Promise.all(i).then(b).catch(b);
1724
- }
1725
- invalidateQueries(t, e = {}) {
1726
- return p.batch(() => (this.#t.findAll(t).forEach((s) => {
1727
- s.invalidate();
1728
- }), t?.refetchType === "none" ? Promise.resolve() : this.refetchQueries(
1729
- {
1730
- ...t,
1731
- type: t?.refetchType ?? t?.type ?? "active"
1732
- },
1733
- e
1734
- )));
1735
- }
1736
- refetchQueries(t, e = {}) {
1737
- const s = {
1738
- ...e,
1739
- cancelRefetch: e.cancelRefetch ?? !0
1740
- }, i = p.batch(
1741
- () => this.#t.findAll(t).filter((r) => !r.isDisabled() && !r.isStatic()).map((r) => {
1742
- let a = r.fetch(void 0, s);
1743
- return s.throwOnError || (a = a.catch(b)), r.state.fetchStatus === "paused" ? Promise.resolve() : a;
1744
- })
1745
- );
1746
- return Promise.all(i).then(b);
1747
- }
1748
- fetchQuery(t) {
1749
- const e = this.defaultQueryOptions(t);
1750
- e.retry === void 0 && (e.retry = !1);
1751
- const s = this.#t.build(this, e);
1752
- return s.isStaleByTime(
1753
- E(e.staleTime, s)
1754
- ) ? s.fetch(e) : Promise.resolve(s.state.data);
1755
- }
1756
- prefetchQuery(t) {
1757
- return this.fetchQuery(t).then(b).catch(b);
1758
- }
1759
- fetchInfiniteQuery(t) {
1760
- return t.behavior = ct(t.pages), this.fetchQuery(t);
1761
- }
1762
- prefetchInfiniteQuery(t) {
1763
- return this.fetchInfiniteQuery(t).then(b).catch(b);
1764
- }
1765
- ensureInfiniteQueryData(t) {
1766
- return t.behavior = ct(t.pages), this.ensureQueryData(t);
1767
- }
1768
- resumePausedMutations() {
1769
- return L.isOnline() ? this.#e.resumePausedMutations() : Promise.resolve();
1770
- }
1771
- getQueryCache() {
1772
- return this.#t;
1773
- }
1774
- getMutationCache() {
1775
- return this.#e;
1776
- }
1777
- getDefaultOptions() {
1778
- return this.#s;
1779
- }
1780
- setDefaultOptions(t) {
1781
- this.#s = t;
1782
- }
1783
- setQueryDefaults(t, e) {
1784
- this.#r.set(D(t), {
1785
- queryKey: t,
1786
- defaultOptions: e
1787
- });
1788
- }
1789
- getQueryDefaults(t) {
1790
- const e = [...this.#r.values()], s = {};
1791
- return e.forEach((i) => {
1792
- A(t, i.queryKey) && Object.assign(s, i.defaultOptions);
1793
- }), s;
1794
- }
1795
- setMutationDefaults(t, e) {
1796
- this.#i.set(D(t), {
1797
- mutationKey: t,
1798
- defaultOptions: e
1799
- });
1800
- }
1801
- getMutationDefaults(t) {
1802
- const e = [...this.#i.values()], s = {};
1803
- return e.forEach((i) => {
1804
- A(t, i.mutationKey) && Object.assign(s, i.defaultOptions);
1805
- }), s;
1806
- }
1807
- defaultQueryOptions(t) {
1808
- if (t._defaulted)
1809
- return t;
1810
- const e = {
1811
- ...this.#s.queries,
1812
- ...this.getQueryDefaults(t.queryKey),
1813
- ...t,
1814
- _defaulted: !0
1815
- };
1816
- return e.queryHash || (e.queryHash = Z(
1817
- e.queryKey,
1818
- e
1819
- )), e.refetchOnReconnect === void 0 && (e.refetchOnReconnect = e.networkMode !== "always"), e.throwOnError === void 0 && (e.throwOnError = !!e.suspense), !e.networkMode && e.persister && (e.networkMode = "offlineFirst"), e.queryFn === K && (e.enabled = !1), e;
1820
- }
1821
- defaultMutationOptions(t) {
1822
- return t?._defaulted ? t : {
1823
- ...this.#s.mutations,
1824
- ...t?.mutationKey && this.getMutationDefaults(t.mutationKey),
1825
- ...t,
1826
- _defaulted: !0
1827
- };
1828
- }
1829
- clear() {
1830
- this.#t.clear(), this.#e.clear();
1831
- }
1832
- }, Ot = y.createContext(
1833
- void 0
1834
- ), St = (t) => {
1835
- const e = y.useContext(Ot);
1836
- if (!e)
1837
- throw new Error("No QueryClient set, use QueryClientProvider to set one");
1838
- return e;
1839
- }, fe = ({
1840
- client: t,
1841
- children: e
1842
- }) => (y.useEffect(() => (t.mount(), () => {
1843
- t.unmount();
1844
- }), [t]), /* @__PURE__ */ x(Ot.Provider, { value: t, children: e })), wt = y.createContext(!1), Xt = () => y.useContext(wt);
1845
- wt.Provider;
1846
- function Yt() {
1847
- let t = !1;
1848
- return {
1849
- clearReset: () => {
1850
- t = !1;
1851
- },
1852
- reset: () => {
1853
- t = !0;
1854
- },
1855
- isReset: () => t
1856
- };
1857
- }
1858
- var te = y.createContext(Yt()), ee = () => y.useContext(te), se = (t, e, s) => {
1859
- const i = s?.state.error && typeof t.throwOnError == "function" ? X(t.throwOnError, [s.state.error, s]) : t.throwOnError;
1860
- (t.suspense || t.experimental_prefetchInRender || i) && (e.isReset() || (t.retryOnMount = !1));
1861
- }, ie = (t) => {
1862
- y.useEffect(() => {
1863
- t.clearReset();
1864
- }, [t]);
1865
- }, re = ({
1866
- result: t,
1867
- errorResetBoundary: e,
1868
- throwOnError: s,
1869
- query: i,
1870
- suspense: r
1871
- }) => t.isError && !e.isReset() && !t.isFetching && i && (r && t.data === void 0 || X(s, [t.error, i])), ne = (t) => {
1872
- if (t.suspense) {
1873
- const s = (r) => r === "static" ? r : Math.max(r ?? 1e3, 1e3), i = t.staleTime;
1874
- t.staleTime = typeof i == "function" ? (...r) => s(i(...r)) : s(i), typeof t.gcTime == "number" && (t.gcTime = Math.max(
1875
- t.gcTime,
1876
- 1e3
1877
- ));
1878
- }
1879
- }, ae = (t, e) => t.isLoading && t.isFetching && !e, oe = (t, e) => t?.suspense && e.isPending, ft = (t, e, s) => e.fetchOptimistic(t).catch(() => {
1880
- s.clearReset();
1881
- });
1882
- function ue(t, e, s) {
1883
- if (process.env.NODE_ENV !== "production" && (typeof t != "object" || Array.isArray(t)))
1884
- throw new Error(
1885
- 'Bad argument type. Starting with v5, only the "Object" form is allowed when calling query related functions. Please use the error stack to find the culprit call. More info here: https://tanstack.com/query/latest/docs/react/guides/migrating-to-v5#supports-a-single-signature-one-object'
1886
- );
1887
- const i = Xt(), r = ee(), a = St(), o = a.defaultQueryOptions(t);
1888
- a.getDefaultOptions().queries?._experimental_beforeQuery?.(
1889
- o
1890
- );
1891
- const n = a.getQueryCache().get(o.queryHash);
1892
- process.env.NODE_ENV !== "production" && (o.queryFn || console.error(
1893
- `[${o.queryHash}]: No queryFn was passed as an option, and no default queryFn was found. The queryFn parameter is only optional when using a default queryFn. More info here: https://tanstack.com/query/latest/docs/framework/react/guides/default-query-function`
1894
- )), o._optimisticResults = i ? "isRestoring" : "optimistic", ne(o), se(o, r, n), ie(r);
1895
- const h = !a.getQueryCache().get(o.queryHash), [l] = y.useState(
1896
- () => new e(
1897
- a,
1898
- o
1899
- )
1900
- ), u = l.getOptimisticResult(o), m = !i && t.subscribed !== !1;
1901
- if (y.useSyncExternalStore(
1902
- y.useCallback(
1903
- (c) => {
1904
- const v = m ? l.subscribe(p.batchCalls(c)) : b;
1905
- return l.updateResult(), v;
1906
- },
1907
- [l, m]
1908
- ),
1909
- () => l.getCurrentResult(),
1910
- () => l.getCurrentResult()
1911
- ), y.useEffect(() => {
1912
- l.setOptions(o);
1913
- }, [o, l]), oe(o, u))
1914
- throw ft(o, l, r);
1915
- if (re({
1916
- result: u,
1917
- errorResetBoundary: r,
1918
- throwOnError: o.throwOnError,
1919
- query: n,
1920
- suspense: o.suspense
1921
- }))
1922
- throw u.error;
1923
- return a.getDefaultOptions().queries?._experimental_afterQuery?.(
1924
- o,
1925
- u
1926
- ), o.experimental_prefetchInRender && !T && ae(u, i) && (h ? (
1927
- // Fetch immediately on render in order to ensure `.promise` is resolved even if the component is unmounted
1928
- ft(o, l, r)
1929
- ) : (
1930
- // subscribe to the "cache promise" so that we can finalize the currentThenable once data comes in
1931
- n?.promise
1932
- ))?.catch(b).finally(() => {
1933
- l.updateResult();
1934
- }), o.notifyOnChangeProps ? u : l.trackResult(u);
1935
- }
1936
- function de(t, e) {
1937
- return ue(t, Gt);
1938
- }
1939
- function pe(t, e) {
1940
- const s = St(), [i] = y.useState(
1941
- () => new Jt(
1942
- s,
1943
- t
1944
- )
1945
- );
1946
- y.useEffect(() => {
1947
- i.setOptions(t);
1948
- }, [i, t]);
1949
- const r = y.useSyncExternalStore(
1950
- y.useCallback(
1951
- (o) => i.subscribe(p.batchCalls(o)),
1952
- [i]
1953
- ),
1954
- () => i.getCurrentResult(),
1955
- () => i.getCurrentResult()
1956
- ), a = y.useCallback(
1957
- (o, n) => {
1958
- i.mutate(o, n).catch(b);
1959
- },
1960
- [i]
1961
- );
1962
- if (r.error && X(i.options.throwOnError, [r.error]))
1963
- throw r.error;
1964
- return { ...r, mutate: a, mutateAsync: r.mutate };
1965
- }
1966
- const ye = (t, e, s, i) => ({
1967
- getData: t,
1968
- addRecord: e,
1969
- updateRecord: s,
1970
- deleteRecord: i
1971
- }), me = (t, e) => ({
1972
- showSpinner: t,
1973
- hideSpinner: e
1974
- }), ve = (t, e) => {
1975
- const s = {
1976
- refresh: t
1977
- };
1978
- return e && (s.forceUpdate = e), s;
1979
- }, ge = (t, e, s, i, r, a) => {
1980
- const o = {
1981
- selectRow: t,
1982
- selectRows: e,
1983
- clearSelection: s,
1984
- selectAll: i,
1985
- getSelectedRecords: r
1986
- };
1987
- return a && (o.selectRowByRange = a), o;
1988
- }, be = (t, e) => {
1989
- const s = {
1990
- scrollToIndex: t
1991
- };
1992
- return e && (s.goToPage = e), s;
1993
- }, Oe = (t, e, s) => {
1994
- const i = {};
1995
- return t && (i.exportDataAsCsv = t), e && (i.exportToExcel = e), s && (i.print = s), i;
1996
- }, Se = ({
1997
- children: t,
1998
- content: e,
1999
- enabled: s = !0,
2000
- delayDuration: i = 300,
2001
- side: r,
2002
- align: a,
2003
- className: o
2004
- }) => !s || !e ? /* @__PURE__ */ x(Ct, { children: t }) : /* @__PURE__ */ x(Pt, { children: /* @__PURE__ */ Rt(Et, { delayDuration: i, children: [
2005
- /* @__PURE__ */ x(Ft, { asChild: !0, children: t }),
2006
- /* @__PURE__ */ x(Mt, { side: r, align: a, className: o, children: e })
2007
- ] }) });
2008
- export {
2009
- le as Q,
2010
- Se as T,
2011
- pe as a,
2012
- fe as b,
2013
- ve as c,
2014
- me as d,
2015
- be as e,
2016
- Oe as f,
2017
- ge as g,
2018
- de as h,
2019
- ye as i,
2020
- St as u
2021
- };