@gen-epix/ui-client-casedb 4.0.0 → 4.0.2

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 (393) hide show
  1. package/dist/@types/mui.d.ts +1 -1
  2. package/dist/@types/{ui-casedb.d.ts → ui-client-casedb.d.ts} +1 -1
  3. package/dist/_chunks/AddCasesToEventDialog.js +74 -74
  4. package/dist/_chunks/AddCasesToEventDialog.js.map +1 -1
  5. package/dist/_chunks/CaseContentForm.js +2 -2
  6. package/dist/_chunks/CaseContentForm.js.map +1 -1
  7. package/dist/_chunks/CaseDbDownloadUtil.js +40 -35
  8. package/dist/_chunks/CaseDbDownloadUtil.js.map +1 -1
  9. package/dist/_chunks/CaseInfoDialog.js +195 -195
  10. package/dist/_chunks/CaseInfoDialog.js.map +1 -1
  11. package/dist/_chunks/CaseSetInfoDialog.js +131 -131
  12. package/dist/_chunks/CaseSetInfoDialog.js.map +1 -1
  13. package/dist/_chunks/CaseTypeInfoDialog.js +63 -61
  14. package/dist/_chunks/CaseTypeInfoDialog.js.map +1 -1
  15. package/dist/_chunks/CasesAlreadyInCaseSetWarning.js +6 -6
  16. package/dist/_chunks/CasesAlreadyInCaseSetWarning.js.map +1 -1
  17. package/dist/_chunks/CompletCaseTypeLoader.js +3 -3
  18. package/dist/_chunks/CompletCaseTypeLoader.js.map +1 -1
  19. package/dist/_chunks/CreateEventDialogSuccessNotificationMessage.js +1 -1
  20. package/dist/_chunks/CreateEventDialogSuccessNotificationMessage.js.map +1 -1
  21. package/dist/_chunks/CustomTabPanel.js.map +1 -1
  22. package/dist/_chunks/Dashboard.js +399 -386
  23. package/dist/_chunks/Dashboard.js.map +1 -1
  24. package/dist/_chunks/DashboardStoreLoader.js +5 -5
  25. package/dist/_chunks/DashboardStoreLoader.js.map +1 -1
  26. package/dist/_chunks/DataCollectionAccessInfo.js +21 -21
  27. package/dist/_chunks/DataCollectionAccessInfo.js.map +1 -1
  28. package/dist/_chunks/EpiCurveUtil.js +4 -4
  29. package/dist/_chunks/EpiCurveUtil.js.map +1 -1
  30. package/dist/_chunks/EpiCurveWidget.js +189 -183
  31. package/dist/_chunks/EpiCurveWidget.js.map +1 -1
  32. package/dist/_chunks/FilterUtil.js +103 -101
  33. package/dist/_chunks/FilterUtil.js.map +1 -1
  34. package/dist/_chunks/FindSimilarCasesDialog.js +16 -16
  35. package/dist/_chunks/FindSimilarCasesDialog.js.map +1 -1
  36. package/dist/_chunks/FindSimilarCasesUtil.js +9 -9
  37. package/dist/_chunks/FindSimilarCasesUtil.js.map +1 -1
  38. package/dist/_chunks/HomePageTrends.js +8 -8
  39. package/dist/_chunks/HomePageTrends.js.map +1 -1
  40. package/dist/_chunks/LegendaItem.js +3 -3
  41. package/dist/_chunks/LegendaItem.js.map +1 -1
  42. package/dist/_chunks/LineListWidget.js +23 -21
  43. package/dist/_chunks/LineListWidget.js.map +1 -1
  44. package/dist/_chunks/PanelSeparator.js +374 -384
  45. package/dist/_chunks/PanelSeparator.js.map +1 -1
  46. package/dist/_chunks/Upload.js +222 -207
  47. package/dist/_chunks/Upload.js.map +1 -1
  48. package/dist/_chunks/UploadUtil.js +1970 -841
  49. package/dist/_chunks/UploadUtil.js.map +1 -1
  50. package/dist/_chunks/UserRightsDialog.js +12 -12
  51. package/dist/_chunks/UserRightsDialog.js.map +1 -1
  52. package/dist/_chunks/_MapCache.js +2 -2
  53. package/dist/_chunks/_baseGet.js +1 -1
  54. package/dist/_chunks/_baseGet.js.map +1 -1
  55. package/dist/_chunks/_baseIteratee.js +1 -1
  56. package/dist/_chunks/_baseIteratee.js.map +1 -1
  57. package/dist/_chunks/_setToString.js.map +1 -1
  58. package/dist/_chunks/{chunk-KS7C4IRE.js → chunk-BV7QT456.js} +330 -495
  59. package/dist/_chunks/chunk-BV7QT456.js.map +1 -0
  60. package/dist/_chunks/cloneDeep.js +11 -9
  61. package/dist/_chunks/cloneDeep.js.map +1 -1
  62. package/dist/_chunks/dashboardStore.js +259 -261
  63. package/dist/_chunks/dashboardStore.js.map +1 -1
  64. package/dist/_chunks/esm.js +2900 -2868
  65. package/dist/_chunks/esm.js.map +1 -1
  66. package/dist/_chunks/format.js +8 -8
  67. package/dist/_chunks/format.js.map +1 -1
  68. package/dist/_chunks/index.esm.js +919 -796
  69. package/dist/_chunks/index.esm.js.map +1 -1
  70. package/dist/_chunks/index.module.js +1 -1
  71. package/dist/_chunks/index.module.js.map +1 -1
  72. package/dist/_chunks/protectedTokens.js +79 -81
  73. package/dist/_chunks/protectedTokens.js.map +1 -1
  74. package/dist/_chunks/react.js +1 -1
  75. package/dist/_chunks/react.js.map +1 -1
  76. package/dist/_chunks/round.js +1 -1
  77. package/dist/_chunks/round.js.map +1 -1
  78. package/dist/_chunks/shallow.js +2 -2
  79. package/dist/_chunks/shallow.js.map +1 -1
  80. package/dist/_chunks/sync.js +198 -161
  81. package/dist/_chunks/sync.js.map +1 -1
  82. package/dist/_chunks/toDate.js +1 -1
  83. package/dist/_chunks/toDate.js.map +1 -1
  84. package/dist/_chunks/toString.js +1 -1
  85. package/dist/_chunks/toString.js.map +1 -1
  86. package/dist/_chunks/useUnit.js.map +1 -1
  87. package/dist/_chunks/vanilla.js +1 -1
  88. package/dist/_chunks/vanilla.js.map +1 -1
  89. package/dist/_chunks/yup.js +5 -5
  90. package/dist/_chunks/yup.js.map +1 -1
  91. package/dist/classes/filters/SelectionFilter.d.ts +2 -2
  92. package/dist/classes/filters/TreeFilter.d.ts +2 -2
  93. package/dist/classes/services/DataService/index.js +3 -3
  94. package/dist/classes/services/DataService/index.js.map +1 -1
  95. package/dist/classes/services/EventBusService/EventBusService.d.ts +1 -1
  96. package/dist/classes/services/EventBusService/index.js.map +1 -1
  97. package/dist/classes/services/LineListService/LineListServiceAbstract/index.js +1 -1
  98. package/dist/classes/services/LineListService/LineListServiceAbstract/index.js.map +1 -1
  99. package/dist/components/app/CaseDbApp/index.js +8 -5
  100. package/dist/components/app/CaseDbApp/index.js.map +1 -1
  101. package/dist/components/form/fields/ArrangementEditor/index.js +83 -83
  102. package/dist/components/form/fields/ArrangementEditor/index.js.map +1 -1
  103. package/dist/components/ui/AddCasesToEventDialog/AddCasesToEventDialog.d.ts +2 -2
  104. package/dist/components/ui/CaseContentFormDialog/CaseContentFormDialog.d.ts +2 -2
  105. package/dist/components/ui/CaseContentFormDialog/index.js +1 -1
  106. package/dist/components/ui/CaseContentFormDialog/index.js.map +1 -1
  107. package/dist/components/ui/CaseInfoDialog/CaseInfoDialog.d.ts +2 -2
  108. package/dist/components/ui/CaseSetInfoDialog/CaseSetInfoDialog.d.ts +2 -2
  109. package/dist/components/ui/CaseSummary/index.js +1 -1
  110. package/dist/components/ui/CaseSummary/index.js.map +1 -1
  111. package/dist/components/ui/CaseTypeInfoDialog/CaseTypeInfoDialog.d.ts +2 -2
  112. package/dist/components/ui/CaseTypeInfoDialog/CaseTypeInfoDialogContent.d.ts +1 -1
  113. package/dist/components/ui/CaseTypeInfoDialog/CaseTypeInfoDialogWithLoader.d.ts +2 -2
  114. package/dist/components/ui/ContextMenu/index.js.map +1 -1
  115. package/dist/components/ui/CreateEventDialog/CreateEventDialog.d.ts +2 -2
  116. package/dist/components/ui/CreateEventDialog/index.js +9 -9
  117. package/dist/components/ui/CreateEventDialog/index.js.map +1 -1
  118. package/dist/components/ui/Dashboard/DashboardDownloadSidebarItem.d.ts +1 -1
  119. package/dist/components/ui/Dashboard/DashboardSettingsSidebarItem.d.ts +1 -1
  120. package/dist/components/ui/Dashboard/DashboardWidget.d.ts +1 -1
  121. package/dist/components/ui/DashboardEditCases/index.js +1 -1
  122. package/dist/components/ui/DashboardEditCases/index.js.map +1 -1
  123. package/dist/components/ui/FileSelector/index.js +46 -46
  124. package/dist/components/ui/FileSelector/index.js.map +1 -1
  125. package/dist/components/ui/FindSimilarCasesDialog/FindSimilarCasesDialog.d.ts +2 -2
  126. package/dist/components/ui/Grouping/index.js +50 -50
  127. package/dist/components/ui/Grouping/index.js.map +1 -1
  128. package/dist/components/ui/HistogramWidget/index.js +1 -1
  129. package/dist/components/ui/HistogramWidget/index.js.map +1 -1
  130. package/dist/components/ui/MapWidget/index.js +7 -3
  131. package/dist/components/ui/MapWidget/index.js.map +1 -1
  132. package/dist/components/ui/RemoveCasesFromEventDialog/RemoveCasesFromEventDialog.d.ts +2 -2
  133. package/dist/components/ui/RemoveCasesFromEventDialog/index.js +6 -6
  134. package/dist/components/ui/RemoveCasesFromEventDialog/index.js.map +1 -1
  135. package/dist/components/ui/RemoveFindSimilarCasesResultDialog/RemoveFindSimilarCasesResultDialog.d.ts +2 -2
  136. package/dist/components/ui/SequenceDownloadDialog/SequenceDownloadDialog.d.ts +2 -2
  137. package/dist/components/ui/SequenceDownloadDialog/index.js +22 -22
  138. package/dist/components/ui/SequenceDownloadDialog/index.js.map +1 -1
  139. package/dist/components/ui/TreeDescription/index.js.map +1 -1
  140. package/dist/components/ui/TreeWidget/index.js +11 -11
  141. package/dist/components/ui/TreeWidget/index.js.map +1 -1
  142. package/dist/components/ui/Upload/UploadCaseResultTable.d.ts +2 -2
  143. package/dist/components/ui/Upload/UploadEditColumnValuesDialog.d.ts +2 -2
  144. package/dist/components/ui/UserRightsDialog/UserRightsDialog.d.ts +2 -2
  145. package/dist/components/ui/UsersEffectiveRightsDetailsDialog/UsersEffectiveRightsDetailsDialog.d.ts +2 -2
  146. package/dist/components/ui/UsersEffectiveRightsDetailsDialog/index.js +25 -11
  147. package/dist/components/ui/UsersEffectiveRightsDetailsDialog/index.js.map +1 -1
  148. package/dist/components/ui/Warning/index.js.map +1 -1
  149. package/dist/components/ui/WidgetHeaderIconButton/index.js.map +1 -1
  150. package/dist/components/ui/WidgetMenu/WidgetMenu.d.ts +1 -1
  151. package/dist/components/ui/WidgetMenu/index.js +2 -2
  152. package/dist/components/ui/WidgetMenu/index.js.map +1 -1
  153. package/dist/components/ui/WidgetUnavailable/index.js.map +1 -1
  154. package/dist/constants/query.d.ts +1 -1
  155. package/dist/constants/query.js +1 -1
  156. package/dist/constants/query.js.map +1 -1
  157. package/dist/context/caseAbac/CaseAbacContext.d.ts +1 -1
  158. package/dist/dataHooks/useAssemblyProtocolsQuery/index.js +3 -3
  159. package/dist/dataHooks/useAssemblyProtocolsQuery/index.js.map +1 -1
  160. package/dist/dataHooks/useAssemblyProtocolsQuery/useAssemblyProtocolsQuery.d.ts +1 -1
  161. package/dist/dataHooks/useCaseRightsQuery/index.js +2 -2
  162. package/dist/dataHooks/useCaseRightsQuery/index.js.map +1 -1
  163. package/dist/dataHooks/useCaseSetCategoriesQuery/index.js +3 -3
  164. package/dist/dataHooks/useCaseSetCategoriesQuery/index.js.map +1 -1
  165. package/dist/dataHooks/useCaseSetCategoriesQuery/useCaseSetCategoriesQuery.d.ts +1 -1
  166. package/dist/dataHooks/useCaseSetRightsQuery/index.js +2 -2
  167. package/dist/dataHooks/useCaseSetRightsQuery/index.js.map +1 -1
  168. package/dist/dataHooks/useCaseSetStatsQuery/index.js +3 -3
  169. package/dist/dataHooks/useCaseSetStatsQuery/index.js.map +1 -1
  170. package/dist/dataHooks/useCaseSetStatsQuery/useCaseSetStatsQuery.d.ts +1 -1
  171. package/dist/dataHooks/useCaseSetStatusesQuery/index.js +3 -3
  172. package/dist/dataHooks/useCaseSetStatusesQuery/index.js.map +1 -1
  173. package/dist/dataHooks/useCaseSetStatusesQuery/useCaseSetStatusesQuery.d.ts +1 -1
  174. package/dist/dataHooks/useCaseSetsQuery/index.js +3 -3
  175. package/dist/dataHooks/useCaseSetsQuery/index.js.map +1 -1
  176. package/dist/dataHooks/useCaseSetsQuery/useCaseSetsQuery.d.ts +1 -1
  177. package/dist/dataHooks/useCaseTypeSetCategoriesQuery/index.js +3 -3
  178. package/dist/dataHooks/useCaseTypeSetCategoriesQuery/index.js.map +1 -1
  179. package/dist/dataHooks/useCaseTypeSetCategoriesQuery/useCaseTypeSetCategoriesQuery.d.ts +1 -1
  180. package/dist/dataHooks/useCaseTypeSetCategoryPurposeQuery/index.js.map +1 -1
  181. package/dist/dataHooks/useCaseTypeSetCategoryPurposeQuery/useCaseTypeSetCategoryPurposeQuery.d.ts +1 -1
  182. package/dist/dataHooks/useCaseTypeSetMembersQuery/index.js +2 -2
  183. package/dist/dataHooks/useCaseTypeSetMembersQuery/index.js.map +1 -1
  184. package/dist/dataHooks/useCaseTypeSetsQuery/index.js +3 -3
  185. package/dist/dataHooks/useCaseTypeSetsQuery/index.js.map +1 -1
  186. package/dist/dataHooks/useCaseTypeSetsQuery/useCaseTypeSetsQuery.d.ts +1 -1
  187. package/dist/dataHooks/useCaseTypeStatsQuery/index.js +2 -2
  188. package/dist/dataHooks/useCaseTypeStatsQuery/index.js.map +1 -1
  189. package/dist/dataHooks/useCaseTypesQuery/index.js +3 -3
  190. package/dist/dataHooks/useCaseTypesQuery/index.js.map +1 -1
  191. package/dist/dataHooks/useCaseTypesQuery/useCaseTypesQuery.d.ts +1 -1
  192. package/dist/dataHooks/useColSetMembersQuery/index.js +2 -2
  193. package/dist/dataHooks/useColSetMembersQuery/index.js.map +1 -1
  194. package/dist/dataHooks/useColSetsQuery/index.js +3 -3
  195. package/dist/dataHooks/useColSetsQuery/index.js.map +1 -1
  196. package/dist/dataHooks/useColSetsQuery/useColSetsQuery.d.ts +1 -1
  197. package/dist/dataHooks/useColTypesQuery/index.js.map +1 -1
  198. package/dist/dataHooks/useColTypesQuery/useColTypesQuery.d.ts +1 -1
  199. package/dist/dataHooks/useColsQuery/index.js +3 -3
  200. package/dist/dataHooks/useColsQuery/index.js.map +1 -1
  201. package/dist/dataHooks/useColsQuery/useColsQuery.d.ts +1 -1
  202. package/dist/dataHooks/useConceptQuery/index.js +3 -3
  203. package/dist/dataHooks/useConceptQuery/index.js.map +1 -1
  204. package/dist/dataHooks/useConceptQuery/useConceptQuery.d.ts +1 -1
  205. package/dist/dataHooks/useConceptRelationTypeQuery/index.js.map +1 -1
  206. package/dist/dataHooks/useConceptRelationTypeQuery/useConceptRelationTypeQuery.d.ts +1 -1
  207. package/dist/dataHooks/useConceptSetTypeQuery/index.js.map +1 -1
  208. package/dist/dataHooks/useConceptSetTypeQuery/useConceptSetTypeQuery.d.ts +1 -1
  209. package/dist/dataHooks/useConceptSetsQuery/index.js +3 -3
  210. package/dist/dataHooks/useConceptSetsQuery/index.js.map +1 -1
  211. package/dist/dataHooks/useConceptSetsQuery/useConceptSetsQuery.d.ts +1 -1
  212. package/dist/dataHooks/useDataCollectionSetMembersQuery/index.js +2 -2
  213. package/dist/dataHooks/useDataCollectionSetMembersQuery/index.js.map +1 -1
  214. package/dist/dataHooks/useDataCollectionsQuery/index.js +3 -3
  215. package/dist/dataHooks/useDataCollectionsQuery/index.js.map +1 -1
  216. package/dist/dataHooks/useDataCollectionsQuery/useDataCollectionsQuery.d.ts +1 -1
  217. package/dist/dataHooks/useDimTypesQuery/index.js.map +1 -1
  218. package/dist/dataHooks/useDimTypesQuery/useDimTypesQuery.d.ts +1 -1
  219. package/dist/dataHooks/useDimsQuery/index.js +3 -3
  220. package/dist/dataHooks/useDimsQuery/index.js.map +1 -1
  221. package/dist/dataHooks/useDimsQuery/useDimsQuery.d.ts +1 -1
  222. package/dist/dataHooks/useDiseasesQuery/index.js +3 -3
  223. package/dist/dataHooks/useDiseasesQuery/index.js.map +1 -1
  224. package/dist/dataHooks/useDiseasesQuery/useDiseasesQuery.d.ts +1 -1
  225. package/dist/dataHooks/useEtiologicalAgentsQuery/index.js +3 -3
  226. package/dist/dataHooks/useEtiologicalAgentsQuery/index.js.map +1 -1
  227. package/dist/dataHooks/useEtiologicalAgentsQuery/useEtiologicalAgentsQuery.d.ts +1 -1
  228. package/dist/dataHooks/useGeneticDistanceProtocolsQuery/index.js +3 -3
  229. package/dist/dataHooks/useGeneticDistanceProtocolsQuery/index.js.map +1 -1
  230. package/dist/dataHooks/useGeneticDistanceProtocolsQuery/useGeneticDistanceProtocolsQuery.d.ts +1 -1
  231. package/dist/dataHooks/useOrganizationAccessCasePoliciesQuery/index.js +2 -2
  232. package/dist/dataHooks/useOrganizationAccessCasePoliciesQuery/index.js.map +1 -1
  233. package/dist/dataHooks/useOrganizationShareCasePoliciesQuery/index.js +2 -2
  234. package/dist/dataHooks/useOrganizationShareCasePoliciesQuery/index.js.map +1 -1
  235. package/dist/dataHooks/useRefColsQuery/index.js +3 -3
  236. package/dist/dataHooks/useRefColsQuery/index.js.map +1 -1
  237. package/dist/dataHooks/useRefColsQuery/useRefColsQuery.d.ts +1 -1
  238. package/dist/dataHooks/useRefColsValidationRulesQuery/index.js +2 -2
  239. package/dist/dataHooks/useRefColsValidationRulesQuery/index.js.map +1 -1
  240. package/dist/dataHooks/useRefDimsQuery/index.js +3 -3
  241. package/dist/dataHooks/useRefDimsQuery/index.js.map +1 -1
  242. package/dist/dataHooks/useRefDimsQuery/useRefDimsQuery.d.ts +1 -1
  243. package/dist/dataHooks/useRegionQuery/index.js +3 -3
  244. package/dist/dataHooks/useRegionQuery/index.js.map +1 -1
  245. package/dist/dataHooks/useRegionQuery/useRegionQuery.d.ts +1 -1
  246. package/dist/dataHooks/useRegionRelationTypeQuery/index.js.map +1 -1
  247. package/dist/dataHooks/useRegionRelationTypeQuery/useRegionRelationTypeQuery.d.ts +1 -1
  248. package/dist/dataHooks/useRegionSetsQuery/index.js +3 -3
  249. package/dist/dataHooks/useRegionSetsQuery/index.js.map +1 -1
  250. package/dist/dataHooks/useRegionSetsQuery/useRegionSetsQuery.d.ts +1 -1
  251. package/dist/dataHooks/useSequencingProtocolsQuery/index.js +3 -3
  252. package/dist/dataHooks/useSequencingProtocolsQuery/index.js.map +1 -1
  253. package/dist/dataHooks/useSequencingProtocolsQuery/useSequencingProtocolsQuery.d.ts +1 -1
  254. package/dist/dataHooks/useTreeAlgorithmCodesQuery/index.js.map +1 -1
  255. package/dist/dataHooks/useTreeAlgorithmCodesQuery/useTreeAlgorithmCodesQuery.d.ts +1 -1
  256. package/dist/dataHooks/useUnitQuery/useUnit.d.ts +1 -1
  257. package/dist/dataHooks/useUserAccessCasePoliciesQuery/index.js +2 -2
  258. package/dist/dataHooks/useUserAccessCasePoliciesQuery/index.js.map +1 -1
  259. package/dist/dataHooks/useUserEffectiveRightsQuery/index.js +3 -3
  260. package/dist/dataHooks/useUserEffectiveRightsQuery/index.js.map +1 -1
  261. package/dist/dataHooks/useUserEffectiveRightsQuery/useUserEffectiveRightsQuery.d.ts +1 -1
  262. package/dist/dataHooks/useUserShareCasePoliciesQuery/index.js +2 -2
  263. package/dist/dataHooks/useUserShareCasePoliciesQuery/index.js.map +1 -1
  264. package/dist/hooks/useOrganizationCasePolicyNameFactory/index.js +2 -2
  265. package/dist/hooks/useOrganizationCasePolicyNameFactory/index.js.map +1 -1
  266. package/dist/hooks/useOrganizationCasePolicyNameFactory/useOrganizationCasePolicyNameFactory.d.ts +1 -1
  267. package/dist/hooks/useUserCasePolicyNameFactory/index.js +3 -3
  268. package/dist/hooks/useUserCasePolicyNameFactory/index.js.map +1 -1
  269. package/dist/hooks/useUserCasePolicyNameFactory/useUserCasePolicyNameFactory.d.ts +1 -1
  270. package/dist/locale/nl.json +1 -1
  271. package/dist/models/config.d.ts +1 -1
  272. package/dist/models/dashboard.d.ts +1 -1
  273. package/dist/models/dashboard.js.map +1 -1
  274. package/dist/models/theme.d.ts +2 -2
  275. package/dist/pages/CaseDbUsersAdminPage/index.js +5 -5
  276. package/dist/pages/CaseDbUsersAdminPage/index.js.map +1 -1
  277. package/dist/pages/CaseSetCategoryAdminPage/index.js +4 -4
  278. package/dist/pages/CaseSetCategoryAdminPage/index.js.map +1 -1
  279. package/dist/pages/CaseSetStatusAdminPage/index.js +4 -4
  280. package/dist/pages/CaseSetStatusAdminPage/index.js.map +1 -1
  281. package/dist/pages/CaseTypeSetCategoriesAdminPage/index.js +4 -4
  282. package/dist/pages/CaseTypeSetCategoriesAdminPage/index.js.map +1 -1
  283. package/dist/pages/CaseTypeSetsAdminPage/index.js +6 -6
  284. package/dist/pages/CaseTypeSetsAdminPage/index.js.map +1 -1
  285. package/dist/pages/CaseTypesAdminPage/index.js +5 -5
  286. package/dist/pages/CaseTypesAdminPage/index.js.map +1 -1
  287. package/dist/pages/CasesDetailPage/index.js +5 -5
  288. package/dist/pages/CasesDetailPage/index.js.map +1 -1
  289. package/dist/pages/CasesPage/index.js +10 -10
  290. package/dist/pages/CasesPage/index.js.map +1 -1
  291. package/dist/pages/ColSetsAdminPage/index.js +6 -6
  292. package/dist/pages/ColSetsAdminPage/index.js.map +1 -1
  293. package/dist/pages/ColsAdminPage/index.js +5 -5
  294. package/dist/pages/ColsAdminPage/index.js.map +1 -1
  295. package/dist/pages/ConceptRelationsAdminPage/index.js +19 -19
  296. package/dist/pages/ConceptRelationsAdminPage/index.js.map +1 -1
  297. package/dist/pages/ConceptSetsAdminPage/index.js +5 -5
  298. package/dist/pages/ConceptSetsAdminPage/index.js.map +1 -1
  299. package/dist/pages/ConceptsAdminPage/index.js +5 -5
  300. package/dist/pages/ConceptsAdminPage/index.js.map +1 -1
  301. package/dist/pages/DataCollectionSetsAdminPage/index.js +12 -12
  302. package/dist/pages/DataCollectionSetsAdminPage/index.js.map +1 -1
  303. package/dist/pages/DataCollectionVisualizationPage/index.js +4 -4
  304. package/dist/pages/DataCollectionVisualizationPage/index.js.map +1 -1
  305. package/dist/pages/DataCollectionsAdminPage/index.js +4 -4
  306. package/dist/pages/DataCollectionsAdminPage/index.js.map +1 -1
  307. package/dist/pages/DimsAdminPage/index.js +6 -6
  308. package/dist/pages/DimsAdminPage/index.js.map +1 -1
  309. package/dist/pages/DiseasesAdminPage/index.js +4 -4
  310. package/dist/pages/DiseasesAdminPage/index.js.map +1 -1
  311. package/dist/pages/EtiologicalAgentsAdminPage/index.js +4 -4
  312. package/dist/pages/EtiologicalAgentsAdminPage/index.js.map +1 -1
  313. package/dist/pages/EtiologiesAdminPage/index.js +3 -3
  314. package/dist/pages/EtiologiesAdminPage/index.js.map +1 -1
  315. package/dist/pages/EventsDetailPage/index.js +5 -5
  316. package/dist/pages/EventsDetailPage/index.js.map +1 -1
  317. package/dist/pages/EventsPage/index.js +11 -11
  318. package/dist/pages/EventsPage/index.js.map +1 -1
  319. package/dist/pages/HomePage/index.js +2 -2
  320. package/dist/pages/HomePage/index.js.map +1 -1
  321. package/dist/pages/OrganizationAccessCasePoliciesAdminPage/index.js +4 -4
  322. package/dist/pages/OrganizationAccessCasePoliciesAdminPage/index.js.map +1 -1
  323. package/dist/pages/OrganizationShareCasePoliciesAdminPage/index.js +4 -4
  324. package/dist/pages/OrganizationShareCasePoliciesAdminPage/index.js.map +1 -1
  325. package/dist/pages/RefColsAdminPage/index.js +7 -7
  326. package/dist/pages/RefColsAdminPage/index.js.map +1 -1
  327. package/dist/pages/RefDimsAdminPage/index.js +5 -5
  328. package/dist/pages/RefDimsAdminPage/index.js.map +1 -1
  329. package/dist/pages/RegionRelationsAdminPage/index.js +3 -3
  330. package/dist/pages/RegionRelationsAdminPage/index.js.map +1 -1
  331. package/dist/pages/RegionSetShapesAdminPage/index.js +4 -4
  332. package/dist/pages/RegionSetShapesAdminPage/index.js.map +1 -1
  333. package/dist/pages/RegionSetsAdminPage/index.js +5 -5
  334. package/dist/pages/RegionSetsAdminPage/index.js.map +1 -1
  335. package/dist/pages/RegionsAdminPage/index.js +5 -5
  336. package/dist/pages/RegionsAdminPage/index.js.map +1 -1
  337. package/dist/pages/TrendsPage/index.js +1 -1
  338. package/dist/pages/TrendsPage/index.js.map +1 -1
  339. package/dist/pages/UploadPage/index.js +1 -1
  340. package/dist/pages/UploadPage/index.js.map +1 -1
  341. package/dist/pages/UserAccessCasePoliciesAdminPage/index.js +4 -4
  342. package/dist/pages/UserAccessCasePoliciesAdminPage/index.js.map +1 -1
  343. package/dist/pages/UserEffectiveRightsAdminPage/index.js +12 -12
  344. package/dist/pages/UserEffectiveRightsAdminPage/index.js.map +1 -1
  345. package/dist/pages/UserEffectiveRightsTesterAdminPage/index.js +8 -8
  346. package/dist/pages/UserEffectiveRightsTesterAdminPage/index.js.map +1 -1
  347. package/dist/pages/UserShareCasePoliciesAdminPage/index.js +4 -4
  348. package/dist/pages/UserShareCasePoliciesAdminPage/index.js.map +1 -1
  349. package/dist/routes/adminRoutes.d.ts +1 -1
  350. package/dist/routes/index.js +11 -8
  351. package/dist/routes/index.js.map +1 -1
  352. package/dist/routes/routes.d.ts +1 -1
  353. package/dist/setup/setup.js +5 -5
  354. package/dist/setup/setup.js.map +1 -1
  355. package/dist/stores/dashboardStore/dashboardStore.d.ts +1 -1
  356. package/dist/stores/uploadStore/index.js +2 -2
  357. package/dist/stores/uploadStore/index.js.map +1 -1
  358. package/dist/stores/uploadStore/uploadStore.d.ts +1 -1
  359. package/dist/stores/userProfileStore/index.js +2 -2
  360. package/dist/stores/userProfileStore/index.js.map +1 -1
  361. package/dist/theme/demoTheme/index.js +2 -2
  362. package/dist/theme/demoTheme/index.js.map +1 -1
  363. package/dist/utils/CaseDbDataUtil/CaseDbDataUtil.d.ts +1 -1
  364. package/dist/utils/CaseDbDataUtil/index.js +1 -1
  365. package/dist/utils/CaseDbDataUtil/index.js.map +1 -1
  366. package/dist/utils/CaseDbStandardConfigUtil/index.js +2488 -1408
  367. package/dist/utils/CaseDbStandardConfigUtil/index.js.map +1 -1
  368. package/dist/utils/CaseDbTableUtil/CaseDbTableUtil.d.ts +1 -1
  369. package/dist/utils/CaseDbTableUtil/index.js +1 -1
  370. package/dist/utils/CaseDbTableUtil/index.js.map +1 -1
  371. package/dist/utils/CaseSelectionUtil/index.js.map +1 -1
  372. package/dist/utils/CaseTypeFormUtil/CaseTypeFormUtil.d.ts +1 -1
  373. package/dist/utils/CaseTypeFormUtil/index.js +7 -10
  374. package/dist/utils/CaseTypeFormUtil/index.js.map +1 -1
  375. package/dist/utils/CaseTypeUtil/index.js +1 -1
  376. package/dist/utils/CaseTypeUtil/index.js.map +1 -1
  377. package/dist/utils/CaseUtil/index.js +3 -3
  378. package/dist/utils/CaseUtil/index.js.map +1 -1
  379. package/dist/utils/DashboardUtil/index.js +1 -1
  380. package/dist/utils/DashboardUtil/index.js.map +1 -1
  381. package/dist/utils/DataSetUtil/index.js.map +1 -1
  382. package/dist/utils/FileUtil/index.js +1 -1
  383. package/dist/utils/FileUtil/index.js.map +1 -1
  384. package/dist/utils/FilterUtil/FilterUtil.d.ts +2 -2
  385. package/dist/utils/HistogramUtil/index.js +1 -1
  386. package/dist/utils/HistogramUtil/index.js.map +1 -1
  387. package/dist/utils/MapUtil/index.js +1 -1
  388. package/dist/utils/MapUtil/index.js.map +1 -1
  389. package/dist/utils/StratificationUtil/index.js +3 -2
  390. package/dist/utils/StratificationUtil/index.js.map +1 -1
  391. package/dist/utils/UploadUtil/UploadUtil.d.ts +1 -1
  392. package/package.json +19 -11
  393. package/dist/_chunks/chunk-KS7C4IRE.js.map +0 -1
@@ -6,7 +6,7 @@ import "../components/ui/CompletCaseTypeLoader/index.js";
6
6
  import { t as a } from "./shallow.js";
7
7
  import { StringUtil as o } from "@gen-epix/ui-core/utils/StringUtil";
8
8
  import { useCallback as s, useEffect as c, useMemo as l, useState as u } from "react";
9
- import { TableStoreContextProvider as d } from "@gen-epix/ui/stores/tableStore";
9
+ import { TableStoreContextProvider as d } from "@gen-epix/ui-client-common/stores/tableStore";
10
10
  import { jsx as f } from "react/jsx-runtime";
11
11
  //#region src/components/ui/DashboardStoreLoader/DashboardStoreLoaderContent.tsx
12
12
  var p = ({ caseSet: i, children: s, completeCaseType: u }) => {
@@ -44,12 +44,12 @@ var p = ({ caseSet: i, children: s, completeCaseType: u }) => {
44
44
  })
45
45
  });
46
46
  }, m = ({ caseSet: e, caseTypeId: t, children: n }) => {
47
- let [r, a] = u(null);
47
+ let [r, a] = u(null), o = s((e) => {
48
+ a(e);
49
+ }, []);
48
50
  return /* @__PURE__ */ f(i, {
49
51
  caseTypeId: t,
50
- onCompleteCaseTypeLoaded: s((e) => {
51
- a(e);
52
- }, []),
52
+ onCompleteCaseTypeLoaded: o,
53
53
  children: /* @__PURE__ */ f(p, {
54
54
  caseSet: e,
55
55
  completeCaseType: r,
@@ -1 +1 @@
1
- {"version":3,"file":"DashboardStoreLoader.js","names":[],"sources":["../../src/components/ui/DashboardStoreLoader/DashboardStoreLoaderContent.tsx","../../src/components/ui/DashboardStoreLoader/DashboardStoreLoader.tsx","../../src/components/ui/DashboardStoreLoader/withEpiDashboardStore.tsx"],"sourcesContent":["import type { PropsWithChildren } from 'react';\nimport {\n useEffect,\n useMemo,\n} from 'react';\nimport { useStore } from 'zustand';\nimport { useShallow } from 'zustand/shallow';\nimport type {\n CaseDbCaseSet,\n CaseDbCompleteCaseType,\n} from '@gen-epix/api-casedb';\nimport type { TableColumnDimension } from '@gen-epix/ui/models/table';\nimport { TableStoreContextProvider } from '@gen-epix/ui/stores/tableStore';\nimport { StringUtil } from '@gen-epix/ui-core/utils/StringUtil';\n\nimport {\n createDashboardStore,\n DashboardStoreContext,\n} from '../../../stores/dashboardStore';\nimport { CaseTypeUtil } from '../../../utils/CaseTypeUtil';\n\ntype DashboardStoreLoaderContentProps = PropsWithChildren<{\n readonly caseSet: CaseDbCaseSet;\n readonly completeCaseType: CaseDbCompleteCaseType;\n}>;\n\nexport const DashboardStoreLoaderContent = ({ caseSet, children, completeCaseType }: DashboardStoreLoaderContentProps) => {\n const dashBoardStore = useMemo(() => {\n const store = createDashboardStore({\n caseSetId: caseSet?.id,\n completeCaseType,\n idSelectorCallback: (row) => row.id,\n storageNamePostFix: `epiDashboardStoreLoader-${StringUtil.createSlug(completeCaseType.name)}-${StringUtil.createHash(completeCaseType.id)}`,\n storageVersion: 1,\n });\n return store;\n }, [caseSet, completeCaseType]);\n\n const tableColumnDimensions = useMemo<TableColumnDimension[]>(() => {\n const items: TableColumnDimension[] = [];\n completeCaseType.ordered_dim_ids.map(x => completeCaseType.dims[x]).forEach((dim) => {\n const item: TableColumnDimension = {\n columnIds: completeCaseType.ordered_col_ids_by_dim[dim.id],\n id: dim.id,\n label: CaseTypeUtil.getDimLabel(completeCaseType, dim.id),\n };\n items.push(item);\n });\n return items;\n }, [completeCaseType]);\n\n const initialize = useStore(dashBoardStore, useShallow((state) => state.initialize));\n const setColumnDimensions = useStore(dashBoardStore, useShallow((state) => state.setColumnDimensions));\n\n useEffect(() => {\n const abortController = new AbortController();\n setColumnDimensions(tableColumnDimensions);\n\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n initialize(abortController.signal);\n return () => {\n abortController.abort();\n };\n }, [initialize, setColumnDimensions, tableColumnDimensions]);\n\n return (\n <TableStoreContextProvider store={dashBoardStore}>\n <DashboardStoreContext value={dashBoardStore}>\n {children}\n </DashboardStoreContext>\n </TableStoreContextProvider>\n );\n};\n","import {\n useCallback,\n useState,\n} from 'react';\nimport type { PropsWithChildren } from 'react';\nimport type {\n CaseDbCaseSet,\n CaseDbCompleteCaseType,\n} from '@gen-epix/api-casedb';\n\nimport { CompletCaseTypeLoader } from '../CompletCaseTypeLoader';\n\nimport { DashboardStoreLoaderContent } from './DashboardStoreLoaderContent';\n\nexport type DashboardStoreLoaderProps = PropsWithChildren<{\n readonly caseSet?: CaseDbCaseSet;\n readonly caseTypeId: string;\n}>;\n\nexport const DashboardStoreLoader = ({ caseSet, caseTypeId, children }: DashboardStoreLoaderProps) => {\n const [completeCaseType, setCompleteCaseType] = useState<CaseDbCompleteCaseType>(null);\n const onCompleteCaseTypeLoaded = useCallback((c: CaseDbCompleteCaseType) => {\n setCompleteCaseType(c);\n }, []);\n\n return (\n <CompletCaseTypeLoader\n caseTypeId={caseTypeId}\n onCompleteCaseTypeLoaded={onCompleteCaseTypeLoaded}\n >\n <DashboardStoreLoaderContent\n caseSet={caseSet}\n completeCaseType={completeCaseType}\n >\n {completeCaseType && children}\n </DashboardStoreLoaderContent>\n </CompletCaseTypeLoader>\n );\n};\n","import type { ComponentType } from 'react';\n\nimport type { DashboardStoreLoaderProps } from './DashboardStoreLoader';\nimport { DashboardStoreLoader } from './DashboardStoreLoader';\n\nexport type WithEpiDashboardStoreProps = DashboardStoreLoaderProps;\n\nexport const withEpiDashboardStore = <P extends WithEpiDashboardStoreProps>(WrappedComponent: ComponentType<P>): ComponentType<P> => {\n return (props: WithEpiDashboardStoreProps) => {\n return (\n <DashboardStoreLoader\n caseSet={props.caseSet}\n caseTypeId={props.caseTypeId}\n >\n <WrappedComponent\n {...props as P}\n />\n </DashboardStoreLoader>\n );\n };\n};\n"],"mappings":";;;;;;;;;;;AA0BA,IAAa,KAA+B,EAAE,YAAS,aAAU,0BAAyD;CACxH,IAAM,IAAiB,QACP,EAAqB;EACjC,WAAW,GAAS;EACpB;EACA,qBAAqB,MAAQ,EAAI;EACjC,oBAAoB,2BAA2B,EAAW,WAAW,EAAiB,IAAI,EAAE,GAAG,EAAW,WAAW,EAAiB,EAAE;EACxI,gBAAgB;CAClB,CACO,GACN,CAAC,GAAS,CAAgB,CAAC,GAExB,IAAwB,QAAsC;EAClE,IAAM,IAAgC,CAAC;EASvC,OARA,EAAiB,gBAAgB,KAAI,MAAK,EAAiB,KAAK,EAAE,CAAC,CAAC,SAAS,MAAQ;GACnF,IAAM,IAA6B;IACjC,WAAW,EAAiB,uBAAuB,EAAI;IACvD,IAAI,EAAI;IACR,OAAO,EAAa,YAAY,GAAkB,EAAI,EAAE;GAC1D;GACA,EAAM,KAAK,CAAI;EACjB,CAAC,GACM;CACT,GAAG,CAAC,CAAgB,CAAC,GAEf,IAAa,EAAS,GAAgB,GAAY,MAAU,EAAM,UAAU,CAAC,GAC7E,IAAsB,EAAS,GAAgB,GAAY,MAAU,EAAM,mBAAmB,CAAC;CAarG,OAXA,QAAgB;EACd,IAAM,IAAkB,IAAI,gBAAgB;EAK5C,OAJA,EAAoB,CAAqB,GAGzC,EAAW,EAAgB,MAAM,SACpB;GACX,EAAgB,MAAM;EACxB;CACF,GAAG;EAAC;EAAY;EAAqB;CAAqB,CAAC,GAGzD,kBAAC,GAAD;EAA2B,OAAO;YAChC,kBAAC,GAAD;GAAuB,OAAO;GAC3B;EACoB,CAAA;CACE,CAAA;AAE/B,GCrDa,KAAwB,EAAE,YAAS,eAAY,kBAA0C;CACpG,IAAM,CAAC,GAAkB,KAAuB,EAAiC,IAAI;CAKrF,OACE,kBAAC,GAAD;EACc;EACc,0BAPG,GAAa,MAA8B;GAC1E,EAAoB,CAAC;EACvB,GAAG,CAAC,CAK0B;YAE1B,kBAAC,GAAD;GACW;GACS;aAEjB,KAAoB;EACM,CAAA;CACR,CAAA;AAE3B,GC/Ba,KAA+D,OAClE,MAEJ,kBAAC,GAAD;CACE,SAAS,EAAM;CACf,YAAY,EAAM;WAElB,kBAAC,GAAD,EACE,GAAI,EACL,CAAA;AACmB,CAAA"}
1
+ {"version":3,"file":"DashboardStoreLoader.js","names":[],"sources":["../../src/components/ui/DashboardStoreLoader/DashboardStoreLoaderContent.tsx","../../src/components/ui/DashboardStoreLoader/DashboardStoreLoader.tsx","../../src/components/ui/DashboardStoreLoader/withEpiDashboardStore.tsx"],"sourcesContent":["import type { PropsWithChildren } from 'react';\nimport {\n useEffect,\n useMemo,\n} from 'react';\nimport { useStore } from 'zustand';\nimport { useShallow } from 'zustand/shallow';\nimport type {\n CaseDbCaseSet,\n CaseDbCompleteCaseType,\n} from '@gen-epix/api-casedb';\nimport type { TableColumnDimension } from '@gen-epix/ui-client-common/models/table';\nimport { TableStoreContextProvider } from '@gen-epix/ui-client-common/stores/tableStore';\nimport { StringUtil } from '@gen-epix/ui-core/utils/StringUtil';\n\nimport {\n createDashboardStore,\n DashboardStoreContext,\n} from '../../../stores/dashboardStore';\nimport { CaseTypeUtil } from '../../../utils/CaseTypeUtil';\n\ntype DashboardStoreLoaderContentProps = PropsWithChildren<{\n readonly caseSet: CaseDbCaseSet;\n readonly completeCaseType: CaseDbCompleteCaseType;\n}>;\n\nexport const DashboardStoreLoaderContent = ({ caseSet, children, completeCaseType }: DashboardStoreLoaderContentProps) => {\n const dashBoardStore = useMemo(() => {\n const store = createDashboardStore({\n caseSetId: caseSet?.id,\n completeCaseType,\n idSelectorCallback: (row) => row.id,\n storageNamePostFix: `epiDashboardStoreLoader-${StringUtil.createSlug(completeCaseType.name)}-${StringUtil.createHash(completeCaseType.id)}`,\n storageVersion: 1,\n });\n return store;\n }, [caseSet, completeCaseType]);\n\n const tableColumnDimensions = useMemo<TableColumnDimension[]>(() => {\n const items: TableColumnDimension[] = [];\n completeCaseType.ordered_dim_ids.map(x => completeCaseType.dims[x]).forEach((dim) => {\n const item: TableColumnDimension = {\n columnIds: completeCaseType.ordered_col_ids_by_dim[dim.id],\n id: dim.id,\n label: CaseTypeUtil.getDimLabel(completeCaseType, dim.id),\n };\n items.push(item);\n });\n return items;\n }, [completeCaseType]);\n\n const initialize = useStore(dashBoardStore, useShallow((state) => state.initialize));\n const setColumnDimensions = useStore(dashBoardStore, useShallow((state) => state.setColumnDimensions));\n\n useEffect(() => {\n const abortController = new AbortController();\n setColumnDimensions(tableColumnDimensions);\n\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n initialize(abortController.signal);\n return () => {\n abortController.abort();\n };\n }, [initialize, setColumnDimensions, tableColumnDimensions]);\n\n return (\n <TableStoreContextProvider store={dashBoardStore}>\n <DashboardStoreContext value={dashBoardStore}>\n {children}\n </DashboardStoreContext>\n </TableStoreContextProvider>\n );\n};\n","import {\n useCallback,\n useState,\n} from 'react';\nimport type { PropsWithChildren } from 'react';\nimport type {\n CaseDbCaseSet,\n CaseDbCompleteCaseType,\n} from '@gen-epix/api-casedb';\n\nimport { CompletCaseTypeLoader } from '../CompletCaseTypeLoader';\n\nimport { DashboardStoreLoaderContent } from './DashboardStoreLoaderContent';\n\nexport type DashboardStoreLoaderProps = PropsWithChildren<{\n readonly caseSet?: CaseDbCaseSet;\n readonly caseTypeId: string;\n}>;\n\nexport const DashboardStoreLoader = ({ caseSet, caseTypeId, children }: DashboardStoreLoaderProps) => {\n const [completeCaseType, setCompleteCaseType] = useState<CaseDbCompleteCaseType>(null);\n const onCompleteCaseTypeLoaded = useCallback((c: CaseDbCompleteCaseType) => {\n setCompleteCaseType(c);\n }, []);\n\n return (\n <CompletCaseTypeLoader\n caseTypeId={caseTypeId}\n onCompleteCaseTypeLoaded={onCompleteCaseTypeLoaded}\n >\n <DashboardStoreLoaderContent\n caseSet={caseSet}\n completeCaseType={completeCaseType}\n >\n {completeCaseType && children}\n </DashboardStoreLoaderContent>\n </CompletCaseTypeLoader>\n );\n};\n","import type { ComponentType } from 'react';\n\nimport type { DashboardStoreLoaderProps } from './DashboardStoreLoader';\nimport { DashboardStoreLoader } from './DashboardStoreLoader';\n\nexport type WithEpiDashboardStoreProps = DashboardStoreLoaderProps;\n\nexport const withEpiDashboardStore = <P extends WithEpiDashboardStoreProps>(WrappedComponent: ComponentType<P>): ComponentType<P> => {\n return (props: WithEpiDashboardStoreProps) => {\n return (\n <DashboardStoreLoader\n caseSet={props.caseSet}\n caseTypeId={props.caseTypeId}\n >\n <WrappedComponent\n {...props as P}\n />\n </DashboardStoreLoader>\n );\n };\n};\n"],"mappings":";;;;;;;;;;;AA0BA,IAAa,KAA+B,EAAE,YAAS,aAAU,0BAAyD;CACxH,IAAM,IAAiB,QACP,EAAqB;EACjC,WAAW,GAAS;EACpB;EACA,qBAAqB,MAAQ,EAAI;EACjC,oBAAoB,2BAA2B,EAAW,WAAW,EAAiB,IAAI,EAAE,GAAG,EAAW,WAAW,EAAiB,EAAE;EACxI,gBAAgB;CAClB,CACO,GACN,CAAC,GAAS,CAAgB,CAAC,GAExB,IAAwB,QAAsC;EAClE,IAAM,IAAgC,CAAC;EASvC,OARA,EAAiB,gBAAgB,KAAI,MAAK,EAAiB,KAAK,EAAE,CAAC,CAAC,SAAS,MAAQ;GACnF,IAAM,IAA6B;IACjC,WAAW,EAAiB,uBAAuB,EAAI;IACvD,IAAI,EAAI;IACR,OAAO,EAAa,YAAY,GAAkB,EAAI,EAAE;GAC1D;GACA,EAAM,KAAK,CAAI;EACjB,CAAC,GACM;CACT,GAAG,CAAC,CAAgB,CAAC,GAEf,IAAa,EAAS,GAAgB,GAAY,MAAU,EAAM,UAAU,CAAC,GAC7E,IAAsB,EAAS,GAAgB,GAAY,MAAU,EAAM,mBAAmB,CAAC;CAarG,OAXA,QAAgB;EACd,IAAM,IAAkB,IAAI,gBAAgB;EAK5C,OAJA,EAAoB,CAAqB,GAGzC,EAAW,EAAgB,MAAM,SACpB;GACX,EAAgB,MAAM;EACxB;CACF,GAAG;EAAC;EAAY;EAAqB;CAAqB,CAAC,GAGzD,kBAAC,GAAD;EAA2B,OAAO;EAChC,UAAA,kBAAC,GAAD;GAAuB,OAAO;GAC3B;EACoB,CAAA;CACE,CAAA;AAE/B,GCrDa,KAAwB,EAAE,YAAS,eAAY,kBAA0C;CACpG,IAAM,CAAC,GAAkB,KAAuB,EAAiC,IAAI,GAC/E,IAA2B,GAAa,MAA8B;EAC1E,EAAoB,CAAC;CACvB,GAAG,CAAC,CAAC;CAEL,OACE,kBAAC,GAAD;EACc;EACc;EAE1B,UAAA,kBAAC,GAAD;GACW;GACS;GAEjB,UAAA,KAAoB;EACM,CAAA;CACR,CAAA;AAE3B,GC/Ba,KAA+D,OAClE,MAEJ,kBAAC,GAAD;CACE,SAAS,EAAM;CACf,YAAY,EAAM;CAElB,UAAA,kBAAC,GAAD,EACE,GAAI,EACL,CAAA;AACmB,CAAA"}
@@ -4,29 +4,29 @@ import { useTranslation as u } from "react-i18next";
4
4
  import { jsx as d, jsxs as f } from "react/jsx-runtime";
5
5
  //#region src/context/caseAbac/CaseAbacContext.tsx
6
6
  var p = o(null), m = (e) => {
7
- let { caseAbac: t, children: n } = e;
8
- return /* @__PURE__ */ d(p, {
9
- value: l(() => {
10
- let e = t.rights.map((e) => e.data_collection_ids.map((e) => t.userDataCollectionsMap.get(e)).filter((e) => !!e)), n = e.map((e, n) => {
11
- let r = t.rights[n].shared_in_data_collection_ids;
12
- return e.filter((e) => r.includes(e.id));
13
- }), r = t.rights.map((e) => !t.userDataCollectionOptions.length || !e ? [] : t.userDataCollectionOptions.map((t) => {
14
- let n = t.value, r = e.shared_in_data_collection_ids?.includes(n), i = n !== e.created_in_data_collection_id && (e.is_full_access || e.add_data_collection_ids?.includes(n)), a = e.is_full_access || e.remove_data_collection_ids?.includes(n), o = !1;
15
- return (r && !a || !r && !i) && (o = !0), {
16
- ...t,
17
- disabled: o
18
- };
19
- }).filter((t) => {
20
- let n = e.shared_in_data_collection_ids?.includes(t.value);
21
- return !(t.disabled && !n);
22
- }));
23
- return {
7
+ let { caseAbac: t, children: n } = e, r = l(() => {
8
+ let e = t.rights.map((e) => e.data_collection_ids.map((e) => t.userDataCollectionsMap.get(e)).filter((e) => !!e)), n = e.map((e, n) => {
9
+ let r = t.rights[n].shared_in_data_collection_ids;
10
+ return e.filter((e) => r.includes(e.id));
11
+ }), r = t.rights.map((e) => !t.userDataCollectionOptions.length || !e ? [] : t.userDataCollectionOptions.map((t) => {
12
+ let n = t.value, r = e.shared_in_data_collection_ids?.includes(n), i = n !== e.created_in_data_collection_id && (e.is_full_access || e.add_data_collection_ids?.includes(n)), a = e.is_full_access || e.remove_data_collection_ids?.includes(n), o = !1;
13
+ return (r && !a || !r && !i) && (o = !0), {
24
14
  ...t,
25
- itemDataCollectionOptions: r,
26
- itemDataCollections: e,
27
- itemSharedInDataCollections: n
15
+ disabled: o
28
16
  };
29
- }, [t]),
17
+ }).filter((t) => {
18
+ let n = e.shared_in_data_collection_ids?.includes(t.value);
19
+ return !(t.disabled && !n);
20
+ }));
21
+ return {
22
+ ...t,
23
+ itemDataCollectionOptions: r,
24
+ itemDataCollections: e,
25
+ itemSharedInDataCollections: n
26
+ };
27
+ }, [t]);
28
+ return /* @__PURE__ */ d(p, {
29
+ value: r,
30
30
  children: n
31
31
  });
32
32
  }, h = () => s(p), g = () => {
@@ -1 +1 @@
1
- {"version":3,"file":"DataCollectionAccessInfo.js","names":[],"sources":["../../src/context/caseAbac/CaseAbacContext.tsx","../../src/context/caseAbac/CaseAbacContextProvider.tsx","../../src/context/caseAbac/useCaseAbacContext.tsx","../../src/components/ui/DataCollectionAccessInfo/DataCollectionAccessInfo.tsx"],"sourcesContent":["import { createContext } from 'react';\nimport type {\n CaseDbCaseDataCollectionLink,\n CaseDbCaseRights,\n CaseDbCaseSetDataCollectionLink,\n CaseDbCaseSetRights,\n CaseDbDataCollection,\n} from '@gen-epix/api-casedb';\nimport type { OptionBase } from '@gen-epix/ui-form/models/form';\n\nexport type CaseAbacContext = {\n createdInDataCollection?: CaseDbDataCollection;\n itemDataCollectionLinks: Array<Array<CaseDbCaseDataCollectionLink | CaseDbCaseSetDataCollectionLink>>;\n itemDataCollectionOptions?: Array<OptionBase<string>[]>;\n itemDataCollections?: Array<CaseDbDataCollection[]>;\n itemSharedInDataCollections?: Array<CaseDbDataCollection[]>;\n rights: Array<CaseDbCaseRights | CaseDbCaseSetRights>;\n userDataCollectionOptions: OptionBase<string>[];\n userDataCollections: CaseDbDataCollection[];\n userDataCollectionsMap: Map<string, CaseDbDataCollection>;\n};\n\n// eslint-disable-next-line no-redeclare\nexport const CaseAbacContext = createContext<CaseAbacContext>(null);\n","import { useMemo } from 'react';\nimport type { PropsWithChildren } from 'react';\n\nimport { CaseAbacContext } from './CaseAbacContext';\n\nexport type CaseAbacContextProviderProps = PropsWithChildren<{\n readonly caseAbac: CaseAbacContext;\n}>;\n\nexport const CaseAbacContextProvider = (\n props: CaseAbacContextProviderProps,\n) => {\n const { caseAbac, children } = props;\n\n const sanitizedCaseAbac = useMemo<CaseAbacContext>(() => {\n const itemDataCollections = caseAbac.rights.map(right => {\n return right.data_collection_ids.map(id => {\n return caseAbac.userDataCollectionsMap.get(id);\n }).filter(x => !!x);\n });\n const itemSharedInDataCollections = itemDataCollections.map((itemDataCollection, index) => {\n const sharedInDataCollectionIds = caseAbac.rights[index].shared_in_data_collection_ids;\n return itemDataCollection.filter(item => sharedInDataCollectionIds.includes(item.id));\n });\n const itemDataCollectionOptions = caseAbac.rights.map(right => {\n if (!caseAbac.userDataCollectionOptions.length || !right) {\n return [];\n }\n return caseAbac.userDataCollectionOptions.map(x => {\n const optionDataCollectionId = x.value;\n const isSelected = right.shared_in_data_collection_ids?.includes(optionDataCollectionId);\n const canAdd = optionDataCollectionId !== right.created_in_data_collection_id && (right.is_full_access || right.add_data_collection_ids?.includes(optionDataCollectionId));\n const canRemove = right.is_full_access || right.remove_data_collection_ids?.includes(optionDataCollectionId);\n let disabled = false;\n if (isSelected && !canRemove) {\n disabled = true;\n } else if (!isSelected && !canAdd) {\n disabled = true;\n }\n return {\n ...x,\n disabled,\n };\n }).filter(x => {\n const isSelected = right.shared_in_data_collection_ids?.includes(x.value);\n if (x.disabled && !isSelected) {\n return false;\n }\n return true;\n });\n });\n\n return {\n ...caseAbac,\n itemDataCollectionOptions,\n itemDataCollections,\n itemSharedInDataCollections,\n } satisfies CaseAbacContext;\n }, [caseAbac]);\n\n return (\n <CaseAbacContext value={sanitizedCaseAbac}>\n {children}\n </CaseAbacContext>\n );\n};\n","import { use } from 'react';\n\nimport { CaseAbacContext } from './CaseAbacContext';\n\nexport const useCaseAbacContext = (): CaseAbacContext => use(CaseAbacContext);\n","import { useCallback } from 'react';\nimport {\n Box,\n Table,\n TableBody,\n TableCell,\n TableHead,\n TableRow,\n} from '@mui/material';\nimport { useTranslation } from 'react-i18next';\n\nimport { useCaseAbacContext } from '../../../context/caseAbac';\n\nexport const DataCollectionAccessInfo = () => {\n const { t } = useTranslation();\n\n const caseAbacContext = useCaseAbacContext();\n\n const canRemoveItemFromDataCollection = useCallback((dataCollectionId: string) => {\n return caseAbacContext?.rights?.[0]?.remove_data_collection_ids?.includes(dataCollectionId);\n }, [caseAbacContext.rights]);\n\n if (!caseAbacContext.itemDataCollections || caseAbacContext.itemDataCollections?.length === 0) {\n return (\n <Box sx={{ fontStyle: 'italic' }}>\n {t`None`}\n </Box>\n );\n }\n\n return (\n <Table size={'small'}>\n <TableHead>\n <TableRow>\n <TableCell\n sx={{\n width: 'calc(100% * 1/3)',\n }}\n >\n {t`Data collection`}\n </TableCell>\n <TableCell\n sx={{\n width: 'calc(100% * 1/6)',\n }}\n >\n {t`Removable`}\n </TableCell>\n <TableCell\n sx={{\n width: 'calc(100% * 1/2)',\n }}\n >\n {t`Is created in`}\n </TableCell>\n </TableRow>\n </TableHead>\n <TableBody>\n {caseAbacContext.createdInDataCollection && (\n <TableRow>\n <TableCell>\n {caseAbacContext.createdInDataCollection.name}\n </TableCell>\n <TableCell>\n {t`No`}\n </TableCell>\n <TableCell>\n {t`Yes`}\n </TableCell>\n </TableRow>\n )}\n {caseAbacContext.itemSharedInDataCollections[0].map((dataCollection) => (\n <TableRow key={dataCollection.id}>\n <TableCell>\n {dataCollection.name}\n </TableCell>\n <TableCell>\n {canRemoveItemFromDataCollection(dataCollection.id) ? t`Yes` : t`No`}\n </TableCell>\n <TableCell>\n {t`No`}\n </TableCell>\n </TableRow>\n ))}\n </TableBody>\n </Table>\n );\n};\n"],"mappings":";;;;;AAuBA,IAAa,IAAkB,EAA+B,IAAI,GCdrD,KACX,MACG;CACH,IAAM,EAAE,aAAU,gBAAa;CAgD/B,OACE,kBAAC,GAAD;EAAiB,OA/CO,QAA+B;GACvD,IAAM,IAAsB,EAAS,OAAO,KAAI,MACvC,EAAM,oBAAoB,KAAI,MAC5B,EAAS,uBAAuB,IAAI,CAAE,CAC9C,CAAC,CAAC,QAAO,MAAK,CAAC,CAAC,CAAC,CACnB,GACK,IAA8B,EAAoB,KAAK,GAAoB,MAAU;IACzF,IAAM,IAA4B,EAAS,OAAO,EAAM,CAAC;IACzD,OAAO,EAAmB,QAAO,MAAQ,EAA0B,SAAS,EAAK,EAAE,CAAC;GACtF,CAAC,GACK,IAA4B,EAAS,OAAO,KAAI,MAChD,CAAC,EAAS,0BAA0B,UAAU,CAAC,IAC1C,CAAC,IAEH,EAAS,0BAA0B,KAAI,MAAK;IACjD,IAAM,IAAyB,EAAE,OAC3B,IAAa,EAAM,+BAA+B,SAAS,CAAsB,GACjF,IAAS,MAA2B,EAAM,kCAAkC,EAAM,kBAAkB,EAAM,yBAAyB,SAAS,CAAsB,IAClK,IAAY,EAAM,kBAAkB,EAAM,4BAA4B,SAAS,CAAsB,G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4BAA4B,EAAE,CAAC,KAAK,MACnD,kBAAC,GAAD,EAAA,UAAA;GACE,kBAAC,GAAD,EAAA,UACG,EAAe,KACP,CAAA;GACX,kBAAC,GAAD,EAAA,UACG,EAAgC,EAAe,EAAE,IAAI,CAAC,QAAQ,CAAC,KACvD,CAAA;GACX,kBAAC,GAAD,EAAA,UACG,CAAC,KACO,CAAA;EACH,EAAA,GAVK,EAAe,EAUpB,CACX,CACQ,EAAA,CAAA,CACN;;AAEX"}
1
+ {"version":3,"file":"DataCollectionAccessInfo.js","names":[],"sources":["../../src/context/caseAbac/CaseAbacContext.tsx","../../src/context/caseAbac/CaseAbacContextProvider.tsx","../../src/context/caseAbac/useCaseAbacContext.tsx","../../src/components/ui/DataCollectionAccessInfo/DataCollectionAccessInfo.tsx"],"sourcesContent":["import { createContext } from 'react';\nimport type {\n CaseDbCaseDataCollectionLink,\n CaseDbCaseRights,\n CaseDbCaseSetDataCollectionLink,\n CaseDbCaseSetRights,\n CaseDbDataCollection,\n} from '@gen-epix/api-casedb';\nimport type { OptionBase } from '@gen-epix/ui-core-form/models/form';\n\nexport type CaseAbacContext = {\n createdInDataCollection?: CaseDbDataCollection;\n itemDataCollectionLinks: Array<Array<CaseDbCaseDataCollectionLink | CaseDbCaseSetDataCollectionLink>>;\n itemDataCollectionOptions?: Array<OptionBase<string>[]>;\n itemDataCollections?: Array<CaseDbDataCollection[]>;\n itemSharedInDataCollections?: Array<CaseDbDataCollection[]>;\n rights: Array<CaseDbCaseRights | CaseDbCaseSetRights>;\n userDataCollectionOptions: OptionBase<string>[];\n userDataCollections: CaseDbDataCollection[];\n userDataCollectionsMap: Map<string, CaseDbDataCollection>;\n};\n\n// eslint-disable-next-line no-redeclare\nexport const CaseAbacContext = createContext<CaseAbacContext>(null);\n","import { useMemo } from 'react';\nimport type { PropsWithChildren } from 'react';\n\nimport { CaseAbacContext } from './CaseAbacContext';\n\nexport type CaseAbacContextProviderProps = PropsWithChildren<{\n readonly caseAbac: CaseAbacContext;\n}>;\n\nexport const CaseAbacContextProvider = (\n props: CaseAbacContextProviderProps,\n) => {\n const { caseAbac, children } = props;\n\n const sanitizedCaseAbac = useMemo<CaseAbacContext>(() => {\n const itemDataCollections = caseAbac.rights.map(right => {\n return right.data_collection_ids.map(id => {\n return caseAbac.userDataCollectionsMap.get(id);\n }).filter(x => !!x);\n });\n const itemSharedInDataCollections = itemDataCollections.map((itemDataCollection, index) => {\n const sharedInDataCollectionIds = caseAbac.rights[index].shared_in_data_collection_ids;\n return itemDataCollection.filter(item => sharedInDataCollectionIds.includes(item.id));\n });\n const itemDataCollectionOptions = caseAbac.rights.map(right => {\n if (!caseAbac.userDataCollectionOptions.length || !right) {\n return [];\n }\n return caseAbac.userDataCollectionOptions.map(x => {\n const optionDataCollectionId = x.value;\n const isSelected = right.shared_in_data_collection_ids?.includes(optionDataCollectionId);\n const canAdd = optionDataCollectionId !== right.created_in_data_collection_id && (right.is_full_access || right.add_data_collection_ids?.includes(optionDataCollectionId));\n const canRemove = right.is_full_access || right.remove_data_collection_ids?.includes(optionDataCollectionId);\n let disabled = false;\n if (isSelected && !canRemove) {\n disabled = true;\n } else if (!isSelected && !canAdd) {\n disabled = true;\n }\n return {\n ...x,\n disabled,\n };\n }).filter(x => {\n const isSelected = right.shared_in_data_collection_ids?.includes(x.value);\n if (x.disabled && !isSelected) {\n return false;\n }\n return true;\n });\n });\n\n return {\n ...caseAbac,\n itemDataCollectionOptions,\n itemDataCollections,\n itemSharedInDataCollections,\n } satisfies CaseAbacContext;\n }, [caseAbac]);\n\n return (\n <CaseAbacContext value={sanitizedCaseAbac}>\n {children}\n </CaseAbacContext>\n );\n};\n","import { use } from 'react';\n\nimport { CaseAbacContext } from './CaseAbacContext';\n\nexport const useCaseAbacContext = (): CaseAbacContext => use(CaseAbacContext);\n","import { useCallback } from 'react';\nimport {\n Box,\n Table,\n TableBody,\n TableCell,\n TableHead,\n TableRow,\n} from '@mui/material';\nimport { useTranslation } from 'react-i18next';\n\nimport { useCaseAbacContext } from '../../../context/caseAbac';\n\nexport const DataCollectionAccessInfo = () => {\n const { t } = useTranslation();\n\n const caseAbacContext = useCaseAbacContext();\n\n const canRemoveItemFromDataCollection = useCallback((dataCollectionId: string) => {\n return caseAbacContext?.rights?.[0]?.remove_data_collection_ids?.includes(dataCollectionId);\n }, [caseAbacContext.rights]);\n\n if (!caseAbacContext.itemDataCollections || caseAbacContext.itemDataCollections?.length === 0) {\n return (\n <Box sx={{ fontStyle: 'italic' }}>\n {t`None`}\n </Box>\n );\n }\n\n return (\n <Table size={'small'}>\n <TableHead>\n <TableRow>\n <TableCell\n sx={{\n width: 'calc(100% * 1/3)',\n }}\n >\n {t`Data collection`}\n </TableCell>\n <TableCell\n sx={{\n width: 'calc(100% * 1/6)',\n }}\n >\n {t`Removable`}\n </TableCell>\n <TableCell\n sx={{\n width: 'calc(100% * 1/2)',\n }}\n >\n {t`Is created in`}\n </TableCell>\n </TableRow>\n </TableHead>\n <TableBody>\n {caseAbacContext.createdInDataCollection && (\n <TableRow>\n <TableCell>\n {caseAbacContext.createdInDataCollection.name}\n </TableCell>\n <TableCell>\n {t`No`}\n </TableCell>\n <TableCell>\n {t`Yes`}\n </TableCell>\n </TableRow>\n )}\n {caseAbacContext.itemSharedInDataCollections[0].map((dataCollection) => (\n <TableRow key={dataCollection.id}>\n <TableCell>\n {dataCollection.name}\n </TableCell>\n <TableCell>\n {canRemoveItemFromDataCollection(dataCollection.id) ? t`Yes` : t`No`}\n </TableCell>\n <TableCell>\n {t`No`}\n </TableCell>\n </TableRow>\n ))}\n </TableBody>\n </Table>\n );\n};\n"],"mappings":";;;;;AAuBA,IAAa,IAAkB,EAA+B,IAAI,GCdrD,KACX,MACG;CACH,IAAM,EAAE,aAAU,gBAAa,GAEzB,IAAoB,QAA+B;EACvD,IAAM,IAAsB,EAAS,OAAO,KAAI,MACvC,EAAM,oBAAoB,KAAI,MAC5B,EAAS,uBAAuB,IAAI,CAAE,CAC9C,CAAC,CAAC,QAAO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AAb,UAAA,CACE,kBAAC,GAAD,EAAA,UACE,kBAAC,GAAD,EAAA,UAAA;GACE,kBAAC,GAAD;IACE,IAAI,EACF,OAAO,mBACT;IAEC,UAAA,CAAC;GACO,CAAA;GACX,kBAAC,GAAD;IACE,IAAI,EACF,OAAO,mBACT;IAEC,UAAA,CAAC;GACO,CAAA;GACX,kBAAC,GAAD;IACE,IAAI,EACF,OAAO,mBACT;IAEC,UAAA,CAAC;GACO,CAAA;EACH,EAAA,CAAA,EACD,CAAA,GACX,kBAAC,GAAD,EAAA,UAAA,CACG,EAAgB,2BACf,kBAAC,GAAD,EAAA,UAAA;GACE,kBAAC,GAAD,EAAA,UACG,EAAgB,wBAAwB,KAChC,CAAA;GACX,kBAAC,GAAD,EAAA,UACG,CAAC,KACO,CAAA;GACX,kBAAC,GAAD,EAAA,UACG,CAAC,MACO,CAAA;EACH,EAAA,CAAA,GAEX,EAAgB,4BAA4B,EAAE,CAAC,KAAK,MACnD,kBAAC,GAAD,EAAA,UAAA;GACE,kBAAC,GAAD,EAAA,UACG,EAAe,KACP,CAAA;GACX,kBAAC,GAAD,EAAA,UACG,EAAgC,EAAe,EAAE,IAAI,CAAC,QAAQ,CAAC,KACvD,CAAA;GACX,kBAAC,GAAD,EAAA,UACG,CAAC,KACO,CAAA;EACH,EAAA,GAVK,EAAe,EAUpB,CACX,CACQ,EAAA,CAAA,CACN;;AAEX"}
@@ -1,7 +1,7 @@
1
1
  import { a as e, i as t, n, t as r } from "./toDate.js";
2
2
  import { a as i, t as a } from "./FilterUtil.js";
3
3
  import { a as o, c as s, i as c, l, n as u, o as d, s as f, t as p, u as m } from "./eachYearOfInterval.js";
4
- import { d as h } from "./protectedTokens.js";
4
+ import { f as h } from "./protectedTokens.js";
5
5
  import { a as g, t as _ } from "./format.js";
6
6
  import { t as v } from "./isValid.js";
7
7
  import { CaseTypeUtil as y } from "../utils/CaseTypeUtil/index.js";
@@ -20,7 +20,7 @@ function C(e, t, n) {
20
20
  //#endregion
21
21
  //#region ../../node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/compareAsc.js
22
22
  function w(e, t) {
23
- let n = r(e) - +r(t);
23
+ let n = +r(e) - r(t);
24
24
  return n < 0 ? -1 : n > 0 ? 1 : n;
25
25
  }
26
26
  //#endregion
@@ -46,13 +46,13 @@ function D(e) {
46
46
  //#endregion
47
47
  //#region ../../node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/differenceInHours.js
48
48
  function O(e, n, r) {
49
- let [i, a] = g(r?.in, e, n), o = (i - +a) / t;
49
+ let [i, a] = g(r?.in, e, n), o = (+i - a) / t;
50
50
  return D(r?.roundingMethod)(o);
51
51
  }
52
52
  //#endregion
53
53
  //#region ../../node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/differenceInMilliseconds.js
54
54
  function k(e, t) {
55
- return r(e) - +r(t);
55
+ return +r(e) - r(t);
56
56
  }
57
57
  //#endregion
58
58
  //#region ../../node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/differenceInMinutes.js
@@ -1 +1 @@
1
- {"version":3,"file":"EpiCurveUtil.js","names":[],"sources":["../../../../node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/add.js","../../../../node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/addWeeks.js","../../../../node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/compareAsc.js","../../../../node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/differenceInCalendarMonths.js","../../../../node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/differenceInCalendarYears.js","../../../../node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/_lib/getRoundingMethod.js","../../../../node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/differenceInHours.js","../../../../node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/differenceInMilliseconds.js","../../../../node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/differenceInMinutes.js","../../../../node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/isLastDayOfMonth.js","../../../../node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/differenceInMonths.js","../../../../node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/differenceInSeconds.js","../../../../node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/differenceInYears.js","../../../../node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/eachWeekOfInterval.js","../../../../node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/intervalToDuration.js","../../../../node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/isAfter.js","../../../../node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/isBefore.js","../../../../node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/isEqual.js","../../src/utils/EpiCurveUtil/EpiCurveUtil.ts"],"sourcesContent":["import { addDays } from \"./addDays.js\";\nimport { addMonths } from \"./addMonths.js\";\nimport { constructFrom } from \"./constructFrom.js\";\nimport { toDate } from \"./toDate.js\";\n\n/**\n * The {@link add} function options.\n */\n\n/**\n * @name add\n * @category Common Helpers\n * @summary Add the specified years, months, weeks, days, hours, minutes, and seconds to the given date.\n *\n * @description\n * Add the specified years, months, weeks, days, hours, minutes, and seconds to the given date.\n *\n * **You don't need date-fns\\***:\n *\n * Temporal has a built-in `add` method on all its classes:\n *\n * - [`Temporal.Instant.prototype.add()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Temporal/Instant/add)\n * - [`Temporal.PlainDate.prototype.add()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Temporal/PlainDate/add)\n * - [`Temporal.PlainDateTime.prototype.add()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Temporal/PlainDateTime/add)\n * - [`Temporal.PlainTime.prototype.add()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Temporal/PlainTime/add)\n * - [`Temporal.PlainYearMonth.prototype.add()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Temporal/PlainYearMonth/add)\n * - [`Temporal.ZonedDateTime.prototype.add()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Temporal/ZonedDateTime/add)\n *\n * \\* **Not really**, see: https://date-fns.org/you-dont-need-date-fns\n *\n * @typeParam DateType - The `Date` type the function operates on. Gets inferred from passed arguments. Allows using extensions like [`UTCDate`](https://github.com/date-fns/utc).\n * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.\n *\n * @param date - The date to be changed\n * @param duration - The object with years, months, weeks, days, hours, minutes, and seconds to be added.\n * @param options - An object with options\n *\n * @returns The new date with the seconds added\n *\n * @example\n * // Add the following duration to 1 September 2014, 10:19:50\n * const result = add(new Date(2014, 8, 1, 10, 19, 50), {\n * years: 2,\n * months: 9,\n * weeks: 1,\n * days: 7,\n * hours: 5,\n * minutes: 9,\n * seconds: 30,\n * })\n * //=> Thu Jun 15 2017 15:29:20\n *\n * @example\n * // Using Temporal:\n * // Add the following duration to 1 September 2014, 10:19:50\n * Temporal.PlainDateTime.from(\"2014-09-01T10:19:50\")\n * .add({\n * years: 2,\n * months: 9,\n * weeks: 1,\n * days: 7,\n * hours: 5,\n * minutes: 9,\n * seconds: 30,\n * })\n * .toString();\n * //=> \"2017-06-15T15:29:20\"\n */\nexport function add(date, duration, options) {\n const {\n years = 0,\n months = 0,\n weeks = 0,\n days = 0,\n hours = 0,\n minutes = 0,\n seconds = 0,\n } = duration;\n\n // Add years and months\n const _date = toDate(date, options?.in);\n const dateWithMonths =\n months || years ? addMonths(_date, months + years * 12) : _date;\n\n // Add weeks and days\n const dateWithDays =\n days || weeks ? addDays(dateWithMonths, days + weeks * 7) : dateWithMonths;\n\n // Add days, hours, minutes, and seconds\n const minutesToAdd = minutes + hours * 60;\n const secondsToAdd = seconds + minutesToAdd * 60;\n const msToAdd = secondsToAdd * 1000;\n\n return constructFrom(options?.in || date, +dateWithDays + msToAdd);\n}\n\n// Fallback for modularized imports:\nexport default add;\n","import { addDays } from \"./addDays.js\";\n\n/**\n * The {@link addWeeks} function options.\n */\n\n/**\n * @name addWeeks\n * @category Week Helpers\n * @summary Add the specified number of weeks to the given date.\n *\n * @description\n * Add the specified number of weeks to the given date.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.\n *\n * @param date - The date to be changed\n * @param amount - The amount of weeks to be added.\n * @param options - An object with options\n *\n * @returns The new date with the weeks added\n *\n * @example\n * // Add 4 weeks to 1 September 2014:\n * const result = addWeeks(new Date(2014, 8, 1), 4)\n * //=> Mon Sep 29 2014 00:00:00\n */\nexport function addWeeks(date, amount, options) {\n return addDays(date, amount * 7, options);\n}\n\n// Fallback for modularized imports:\nexport default addWeeks;\n","import { toDate } from \"./toDate.js\";\n\n/**\n * @name compareAsc\n * @category Common Helpers\n * @summary Compare the two dates and return -1, 0 or 1.\n *\n * @description\n * Compare the two dates and return 1 if the first date is after the second,\n * -1 if the first date is before the second or 0 if dates are equal.\n *\n * @param dateLeft - The first date to compare\n * @param dateRight - The second date to compare\n *\n * @returns The result of the comparison\n *\n * @example\n * // Compare 11 February 1987 and 10 July 1989:\n * const result = compareAsc(new Date(1987, 1, 11), new Date(1989, 6, 10))\n * //=> -1\n *\n * @example\n * // Sort the array of dates:\n * const result = [\n * new Date(1995, 6, 2),\n * new Date(1987, 1, 11),\n * new Date(1989, 6, 10)\n * ].sort(compareAsc)\n * //=> [\n * // Wed Feb 11 1987 00:00:00,\n * // Mon Jul 10 1989 00:00:00,\n * // Sun Jul 02 1995 00:00:00\n * // ]\n */\nexport function compareAsc(dateLeft, dateRight) {\n const diff = +toDate(dateLeft) - +toDate(dateRight);\n\n if (diff < 0) return -1;\n else if (diff > 0) return 1;\n\n // Return 0 if diff is 0; return NaN if diff is NaN\n return diff;\n}\n\n// Fallback for modularized imports:\nexport default compareAsc;\n","import { normalizeDates } from \"./_lib/normalizeDates.js\";\n\n/**\n * The {@link differenceInCalendarMonths} function options.\n */\n\n/**\n * @name differenceInCalendarMonths\n * @category Month Helpers\n * @summary Get the number of calendar months between the given dates.\n *\n * @description\n * Get the number of calendar months between the given dates.\n *\n * @param laterDate - The later date\n * @param earlierDate - The earlier date\n * @param options - An object with options\n *\n * @returns The number of calendar months\n *\n * @example\n * // How many calendar months are between 31 January 2014 and 1 September 2014?\n * const result = differenceInCalendarMonths(\n * new Date(2014, 8, 1),\n * new Date(2014, 0, 31)\n * )\n * //=> 8\n */\nexport function differenceInCalendarMonths(laterDate, earlierDate, options) {\n const [laterDate_, earlierDate_] = normalizeDates(\n options?.in,\n laterDate,\n earlierDate,\n );\n\n const yearsDiff = laterDate_.getFullYear() - earlierDate_.getFullYear();\n const monthsDiff = laterDate_.getMonth() - earlierDate_.getMonth();\n\n return yearsDiff * 12 + monthsDiff;\n}\n\n// Fallback for modularized imports:\nexport default differenceInCalendarMonths;\n","import { normalizeDates } from \"./_lib/normalizeDates.js\";\n\n/**\n * The {@link differenceInCalendarYears} function options.\n */\n\n/**\n * @name differenceInCalendarYears\n * @category Year Helpers\n * @summary Get the number of calendar years between the given dates.\n *\n * @description\n * Get the number of calendar years between the given dates.\n *\n * @param laterDate - The later date\n * @param earlierDate - The earlier date\n * @param options - An object with options\n\n * @returns The number of calendar years\n *\n * @example\n * // How many calendar years are between 31 December 2013 and 11 February 2015?\n * const result = differenceInCalendarYears(\n * new Date(2015, 1, 11),\n * new Date(2013, 11, 31)\n * );\n * //=> 2\n */\nexport function differenceInCalendarYears(laterDate, earlierDate, options) {\n const [laterDate_, earlierDate_] = normalizeDates(\n options?.in,\n laterDate,\n earlierDate,\n );\n return laterDate_.getFullYear() - earlierDate_.getFullYear();\n}\n\n// Fallback for modularized imports:\nexport default differenceInCalendarYears;\n","export function getRoundingMethod(method) {\n return (number) => {\n const round = method ? Math[method] : Math.trunc;\n const result = round(number);\n // Prevent negative zero\n return result === 0 ? 0 : result;\n };\n}\n","import { getRoundingMethod } from \"./_lib/getRoundingMethod.js\";\nimport { normalizeDates } from \"./_lib/normalizeDates.js\";\nimport { millisecondsInHour } from \"./constants.js\";\n\n/**\n * The {@link differenceInHours} function options.\n */\n\n/**\n * @name differenceInHours\n * @category Hour Helpers\n * @summary Get the number of hours between the given dates.\n *\n * @description\n * Get the number of hours between the given dates.\n *\n * @param laterDate - The later date\n * @param earlierDate - The earlier date\n * @param options - An object with options.\n *\n * @returns The number of hours\n *\n * @example\n * // How many hours are between 2 July 2014 06:50:00 and 2 July 2014 19:00:00?\n * const result = differenceInHours(\n * new Date(2014, 6, 2, 19, 0),\n * new Date(2014, 6, 2, 6, 50)\n * )\n * //=> 12\n */\nexport function differenceInHours(laterDate, earlierDate, options) {\n const [laterDate_, earlierDate_] = normalizeDates(\n options?.in,\n laterDate,\n earlierDate,\n );\n const diff = (+laterDate_ - +earlierDate_) / millisecondsInHour;\n return getRoundingMethod(options?.roundingMethod)(diff);\n}\n\n// Fallback for modularized imports:\nexport default differenceInHours;\n","import { toDate } from \"./toDate.js\";\n\n/**\n * @name differenceInMilliseconds\n * @category Millisecond Helpers\n * @summary Get the number of milliseconds between the given dates.\n *\n * @description\n * Get the number of milliseconds between the given dates.\n *\n * @param laterDate - The later date\n * @param earlierDate - The earlier date\n *\n * @returns The number of milliseconds\n *\n * @example\n * // How many milliseconds are between\n * // 2 July 2014 12:30:20.600 and 2 July 2014 12:30:21.700?\n * const result = differenceInMilliseconds(\n * new Date(2014, 6, 2, 12, 30, 21, 700),\n * new Date(2014, 6, 2, 12, 30, 20, 600)\n * )\n * //=> 1100\n */\nexport function differenceInMilliseconds(laterDate, earlierDate) {\n return +toDate(laterDate) - +toDate(earlierDate);\n}\n\n// Fallback for modularized imports:\nexport default differenceInMilliseconds;\n","import { getRoundingMethod } from \"./_lib/getRoundingMethod.js\";\nimport { millisecondsInMinute } from \"./constants.js\";\nimport { differenceInMilliseconds } from \"./differenceInMilliseconds.js\";\n\n/**\n * The {@link differenceInMinutes} function options.\n */\n\n/**\n * @name differenceInMinutes\n * @category Minute Helpers\n * @summary Get the number of minutes between the given dates.\n *\n * @description\n * Get the signed number of full (rounded towards 0) minutes between the given dates.\n *\n * @param dateLeft - The later date\n * @param dateRight - The earlier date\n * @param options - An object with options.\n *\n * @returns The number of minutes\n *\n * @example\n * // How many minutes are between 2 July 2014 12:07:59 and 2 July 2014 12:20:00?\n * const result = differenceInMinutes(\n * new Date(2014, 6, 2, 12, 20, 0),\n * new Date(2014, 6, 2, 12, 7, 59)\n * )\n * //=> 12\n *\n * @example\n * // How many minutes are between 10:01:59 and 10:00:00\n * const result = differenceInMinutes(\n * new Date(2000, 0, 1, 10, 0, 0),\n * new Date(2000, 0, 1, 10, 1, 59)\n * )\n * //=> -1\n */\nexport function differenceInMinutes(dateLeft, dateRight, options) {\n const diff =\n differenceInMilliseconds(dateLeft, dateRight) / millisecondsInMinute;\n return getRoundingMethod(options?.roundingMethod)(diff);\n}\n\n// Fallback for modularized imports:\nexport default differenceInMinutes;\n","import { endOfDay } from \"./endOfDay.js\";\nimport { endOfMonth } from \"./endOfMonth.js\";\nimport { toDate } from \"./toDate.js\";\n\n/**\n * @name isLastDayOfMonth\n * @category Month Helpers\n * @summary Is the given date the last day of a month?\n *\n * @description\n * Is the given date the last day of a month?\n *\n * @param date - The date to check\n * @param options - An object with options\n *\n * @returns The date is the last day of a month\n *\n * @example\n * // Is 28 February 2014 the last day of a month?\n * const result = isLastDayOfMonth(new Date(2014, 1, 28))\n * //=> true\n */\nexport function isLastDayOfMonth(date, options) {\n const _date = toDate(date, options?.in);\n return +endOfDay(_date, options) === +endOfMonth(_date, options);\n}\n\n// Fallback for modularized imports:\nexport default isLastDayOfMonth;\n","import { normalizeDates } from \"./_lib/normalizeDates.js\";\nimport { compareAsc } from \"./compareAsc.js\";\nimport { differenceInCalendarMonths } from \"./differenceInCalendarMonths.js\";\nimport { isLastDayOfMonth } from \"./isLastDayOfMonth.js\";\n\n/**\n * The {@link differenceInMonths} function options.\n */\n\n/**\n * @name differenceInMonths\n * @category Month Helpers\n * @summary Get the number of full months between the given dates.\n *\n * @param laterDate - The later date\n * @param earlierDate - The earlier date\n * @param options - An object with options\n *\n * @returns The number of full months\n *\n * @example\n * // How many full months are between 31 January 2014 and 1 September 2014?\n * const result = differenceInMonths(new Date(2014, 8, 1), new Date(2014, 0, 31))\n * //=> 7\n */\nexport function differenceInMonths(laterDate, earlierDate, options) {\n const [laterDate_, workingLaterDate, earlierDate_] = normalizeDates(\n options?.in,\n laterDate,\n laterDate,\n earlierDate,\n );\n\n const sign = compareAsc(workingLaterDate, earlierDate_);\n const difference = Math.abs(\n differenceInCalendarMonths(workingLaterDate, earlierDate_),\n );\n\n if (difference < 1) return 0;\n\n if (workingLaterDate.getMonth() === 1 && workingLaterDate.getDate() > 27)\n workingLaterDate.setDate(30);\n\n workingLaterDate.setMonth(workingLaterDate.getMonth() - sign * difference);\n\n let isLastMonthNotFull = compareAsc(workingLaterDate, earlierDate_) === -sign;\n\n if (\n isLastDayOfMonth(laterDate_) &&\n difference === 1 &&\n compareAsc(laterDate_, earlierDate_) === 1\n ) {\n isLastMonthNotFull = false;\n }\n\n const result = sign * (difference - +isLastMonthNotFull);\n return result === 0 ? 0 : result;\n}\n\n// Fallback for modularized imports:\nexport default differenceInMonths;\n","import { getRoundingMethod } from \"./_lib/getRoundingMethod.js\";\nimport { differenceInMilliseconds } from \"./differenceInMilliseconds.js\";\n\n/**\n * The {@link differenceInSeconds} function options.\n */\n\n/**\n * @name differenceInSeconds\n * @category Second Helpers\n * @summary Get the number of seconds between the given dates.\n *\n * @description\n * Get the number of seconds between the given dates.\n *\n * @param laterDate - The later date\n * @param earlierDate - The earlier date\n * @param options - An object with options.\n *\n * @returns The number of seconds\n *\n * @example\n * // How many seconds are between\n * // 2 July 2014 12:30:07.999 and 2 July 2014 12:30:20.000?\n * const result = differenceInSeconds(\n * new Date(2014, 6, 2, 12, 30, 20, 0),\n * new Date(2014, 6, 2, 12, 30, 7, 999)\n * )\n * //=> 12\n */\nexport function differenceInSeconds(laterDate, earlierDate, options) {\n const diff = differenceInMilliseconds(laterDate, earlierDate) / 1000;\n return getRoundingMethod(options?.roundingMethod)(diff);\n}\n\n// Fallback for modularized imports:\nexport default differenceInSeconds;\n","import { normalizeDates } from \"./_lib/normalizeDates.js\";\nimport { compareAsc } from \"./compareAsc.js\";\nimport { differenceInCalendarYears } from \"./differenceInCalendarYears.js\";\n\n/**\n * The {@link differenceInYears} function options.\n */\n\n/**\n * @name differenceInYears\n * @category Year Helpers\n * @summary Get the number of full years between the given dates.\n *\n * @description\n * Get the number of full years between the given dates.\n *\n * @param laterDate - The later date\n * @param earlierDate - The earlier date\n * @param options - An object with options\n *\n * @returns The number of full years\n *\n * @example\n * // How many full years are between 31 December 2013 and 11 February 2015?\n * const result = differenceInYears(new Date(2015, 1, 11), new Date(2013, 11, 31))\n * //=> 1\n */\nexport function differenceInYears(laterDate, earlierDate, options) {\n const [laterDate_, earlierDate_] = normalizeDates(\n options?.in,\n laterDate,\n earlierDate,\n );\n\n // -1 if the left date is earlier than the right date\n // 2023-12-31 - 2024-01-01 = -1\n const sign = compareAsc(laterDate_, earlierDate_);\n\n // First calculate the difference in calendar years\n // 2024-01-01 - 2023-12-31 = 1 year\n const diff = Math.abs(differenceInCalendarYears(laterDate_, earlierDate_));\n\n // Now we need to calculate if the difference is full. To do that we set\n // both dates to the same year and check if the both date's month and day\n // form a full year.\n laterDate_.setFullYear(1584);\n earlierDate_.setFullYear(1584);\n\n // For it to be true, when the later date is indeed later than the earlier date\n // (2026-02-01 - 2023-12-10 = 3 years), the difference is full if\n // the normalized later date is also later than the normalized earlier date.\n // In our example, 1584-02-01 is earlier than 1584-12-10, so the difference\n // is partial, hence we need to subtract 1 from the difference 3 - 1 = 2.\n const partial = compareAsc(laterDate_, earlierDate_) === -sign;\n\n const result = sign * (diff - +partial);\n\n // Prevent negative zero\n return result === 0 ? 0 : result;\n}\n\n// Fallback for modularized imports:\nexport default differenceInYears;\n","import { normalizeInterval } from \"./_lib/normalizeInterval.js\";\nimport { addWeeks } from \"./addWeeks.js\";\nimport { constructFrom } from \"./constructFrom.js\";\nimport { startOfWeek } from \"./startOfWeek.js\";\n\n/**\n * The {@link eachWeekOfInterval} function options.\n */\n\n/**\n * The {@link eachWeekOfInterval} function result type. It resolves the proper data type.\n * It uses the first argument date object type, starting from the interval start date,\n * then the end interval date. If a context function is passed, it uses the context function return type.\n */\n\n/**\n * @name eachWeekOfInterval\n * @category Interval Helpers\n * @summary Return the array of weeks within the specified time interval.\n *\n * @description\n * Return the array of weeks within the specified time interval.\n *\n * @param interval - The interval.\n * @param options - An object with options.\n *\n * @returns The array with starts of weeks from the week of the interval start to the week of the interval end\n *\n * @example\n * // Each week within interval 6 October 2014 - 23 November 2014:\n * const result = eachWeekOfInterval({\n * start: new Date(2014, 9, 6),\n * end: new Date(2014, 10, 23)\n * })\n * //=> [\n * // Sun Oct 05 2014 00:00:00,\n * // Sun Oct 12 2014 00:00:00,\n * // Sun Oct 19 2014 00:00:00,\n * // Sun Oct 26 2014 00:00:00,\n * // Sun Nov 02 2014 00:00:00,\n * // Sun Nov 09 2014 00:00:00,\n * // Sun Nov 16 2014 00:00:00,\n * // Sun Nov 23 2014 00:00:00\n * // ]\n */\nexport function eachWeekOfInterval(interval, options) {\n const { start, end } = normalizeInterval(options?.in, interval);\n\n let reversed = +start > +end;\n const startDateWeek = reversed\n ? startOfWeek(end, options)\n : startOfWeek(start, options);\n const endDateWeek = reversed\n ? startOfWeek(start, options)\n : startOfWeek(end, options);\n\n startDateWeek.setHours(15);\n endDateWeek.setHours(15);\n\n const endTime = +endDateWeek.getTime();\n let currentDate = startDateWeek;\n\n let step = options?.step ?? 1;\n if (!step) return [];\n if (step < 0) {\n step = -step;\n reversed = !reversed;\n }\n\n const dates = [];\n\n while (+currentDate <= endTime) {\n currentDate.setHours(0);\n dates.push(constructFrom(start, currentDate));\n currentDate = addWeeks(currentDate, step);\n currentDate.setHours(15);\n }\n\n return reversed ? dates.reverse() : dates;\n}\n\n// Fallback for modularized imports:\nexport default eachWeekOfInterval;\n","import { normalizeInterval } from \"./_lib/normalizeInterval.js\";\nimport { add } from \"./add.js\";\nimport { differenceInDays } from \"./differenceInDays.js\";\nimport { differenceInHours } from \"./differenceInHours.js\";\nimport { differenceInMinutes } from \"./differenceInMinutes.js\";\nimport { differenceInMonths } from \"./differenceInMonths.js\";\nimport { differenceInSeconds } from \"./differenceInSeconds.js\";\nimport { differenceInYears } from \"./differenceInYears.js\";\n\n/**\n * The {@link intervalToDuration} function options.\n */\n\n/**\n * @name intervalToDuration\n * @category Common Helpers\n * @summary Convert interval to duration\n *\n * @description\n * Convert an interval object to a duration object.\n *\n * @param interval - The interval to convert to duration\n * @param options - The context options\n *\n * @returns The duration object\n *\n * @example\n * // Get the duration between January 15, 1929 and April 4, 1968.\n * intervalToDuration({\n * start: new Date(1929, 0, 15, 12, 0, 0),\n * end: new Date(1968, 3, 4, 19, 5, 0)\n * });\n * //=> { years: 39, months: 2, days: 20, hours: 7, minutes: 5, seconds: 0 }\n */\nexport function intervalToDuration(interval, options) {\n const { start, end } = normalizeInterval(options?.in, interval);\n const duration = {};\n\n const years = differenceInYears(end, start);\n if (years) duration.years = years;\n\n const remainingMonths = add(start, { years: duration.years });\n const months = differenceInMonths(end, remainingMonths);\n if (months) duration.months = months;\n\n const remainingDays = add(remainingMonths, { months: duration.months });\n const days = differenceInDays(end, remainingDays);\n if (days) duration.days = days;\n\n const remainingHours = add(remainingDays, { days: duration.days });\n const hours = differenceInHours(end, remainingHours);\n if (hours) duration.hours = hours;\n\n const remainingMinutes = add(remainingHours, { hours: duration.hours });\n const minutes = differenceInMinutes(end, remainingMinutes);\n if (minutes) duration.minutes = minutes;\n\n const remainingSeconds = add(remainingMinutes, { minutes: duration.minutes });\n const seconds = differenceInSeconds(end, remainingSeconds);\n if (seconds) duration.seconds = seconds;\n\n return duration;\n}\n\n// Fallback for modularized imports:\nexport default intervalToDuration;\n","import { toDate } from \"./toDate.js\";\n\n/**\n * @name isAfter\n * @category Common Helpers\n * @summary Is the first date after the second one?\n *\n * @description\n * Is the first date after the second one?\n *\n * @param date - The date that should be after the other one to return true\n * @param dateToCompare - The date to compare with\n *\n * @returns The first date is after the second date\n *\n * @example\n * // Is 10 July 1989 after 11 February 1987?\n * const result = isAfter(new Date(1989, 6, 10), new Date(1987, 1, 11))\n * //=> true\n */\nexport function isAfter(date, dateToCompare) {\n return +toDate(date) > +toDate(dateToCompare);\n}\n\n// Fallback for modularized imports:\nexport default isAfter;\n","import { toDate } from \"./toDate.js\";\n\n/**\n * @name isBefore\n * @category Common Helpers\n * @summary Is the first date before the second one?\n *\n * @description\n * Is the first date before the second one?\n *\n * @param date - The date that should be before the other one to return true\n * @param dateToCompare - The date to compare with\n *\n * @returns The first date is before the second date\n *\n * @example\n * // Is 10 July 1989 before 11 February 1987?\n * const result = isBefore(new Date(1989, 6, 10), new Date(1987, 1, 11))\n * //=> false\n */\nexport function isBefore(date, dateToCompare) {\n return +toDate(date) < +toDate(dateToCompare);\n}\n\n// Fallback for modularized imports:\nexport default isBefore;\n","import { toDate } from \"./toDate.js\";\n\n/**\n * @name isEqual\n * @category Common Helpers\n * @summary Are the given dates equal?\n *\n * @description\n * Are the given dates equal?\n *\n * @param dateLeft - The first date to compare\n * @param dateRight - The second date to compare\n *\n * @returns The dates are equal\n *\n * @example\n * // Are 2 July 2014 06:30:45.000 and 2 July 2014 06:30:45.500 equal?\n * const result = isEqual(\n * new Date(2014, 6, 2, 6, 30, 45, 0),\n * new Date(2014, 6, 2, 6, 30, 45, 500)\n * )\n * //=> false\n */\nexport function isEqual(leftDate, rightDate) {\n return +toDate(leftDate) === +toDate(rightDate);\n}\n\n// Fallback for modularized imports:\nexport default isEqual;\n","import type { Duration } from 'date-fns';\nimport {\n eachDayOfInterval,\n eachMonthOfInterval,\n eachQuarterOfInterval,\n eachWeekOfInterval,\n eachYearOfInterval,\n format,\n intervalToDuration,\n isAfter,\n isBefore,\n isEqual,\n isValid,\n} from 'date-fns';\nimport type {\n CaseDbCase,\n CaseDbCol,\n CaseDbCompleteCaseType,\n} from '@gen-epix/api-casedb';\nimport { CaseDbColType } from '@gen-epix/api-casedb';\nimport type { Theme } from '@mui/material';\nimport { DATE_FORMAT } from '@gen-epix/ui-core/constants/date';\n\nimport { CaseTypeUtil } from '../CaseTypeUtil';\nimport { FilterUtil } from '../FilterUtil';\nimport type { Stratification } from '../../models/stratification';\n\nexport interface EpiCurveChartItem {\n date: Date;\n row: CaseDbCase;\n value: number;\n}\n\nexport interface EpiCurveNormalizedAreaChartDataPoint {\n caseIds: { [seriesName: string]: string[] };\n date: Date;\n values: { [seriesName: string]: number };\n}\n\ntype IntervalBucket = {\n byColor: { [color: string]: { caseIds: string[]; value: number } };\n caseIds: string[];\n value: number;\n};\n\nexport class EpiCurveUtil {\n /**\n * Creates normalized stacked area chart series data (0-100%) for the epi curve\n * @param items\n * @param xAxisIntervals\n * @param getXAxisLabel\n * @param stratification\n * @returns Area chart series data with max value (always 100) and series array\n */\n public static getAreaChartSeriesData(\n items: EpiCurveChartItem[],\n xAxisIntervals: Date[],\n getXAxisLabel: (value: Date) => string,\n includeMissingValues: boolean,\n stratification: Stratification,\n ): { max: number; series: (null | unknown[]) } {\n // Note: an area chart will always have stratification, as it doesn't make sense without it.\n\n if (!items || !stratification?.legendaItems?.length) {\n return {\n max: 100,\n series: null,\n };\n }\n\n const visibleLegendaItems = includeMissingValues\n ? stratification.legendaItems\n : stratification.legendaItems.filter(item => item.color !== stratification.colorForIsMissing);\n\n if (!visibleLegendaItems.length) {\n return {\n max: 100,\n series: null,\n };\n }\n\n const visibleStratification = {\n caseIdColors: stratification.caseIdColors,\n legendaItems: visibleLegendaItems.map(item => ({\n color: item.color,\n rowValue: {\n full: item.rowValue.full,\n },\n })),\n };\n\n // Step 1: Interpolate and normalize data for each series\n const normalizedDataPoints = EpiCurveUtil.getNormalizedAreaChartData(items, xAxisIntervals, visibleStratification);\n\n if (!normalizedDataPoints.length) {\n return {\n max: 100,\n series: null,\n };\n }\n\n // Step 2: Output series for ECharts (each series: [x, y, caseIds])\n const seriesNames = visibleLegendaItems.map(item => item.rowValue.full);\n const xAxisLabels = xAxisIntervals.map(interval => getXAxisLabel(interval));\n const areaSeries: unknown[] = seriesNames.map((seriesName, seriesIndex) => {\n return {\n areaStyle: {},\n color: stratification.legendaItems[seriesIndex].color,\n data: normalizedDataPoints.map((point, pointIdx) => [\n xAxisLabels[pointIdx],\n point.values[seriesName],\n JSON.stringify(point.caseIds[seriesName]),\n ]),\n emphasis: {\n focus: 'series',\n },\n name: seriesName,\n smooth: false,\n stack: 'total',\n triggerEvent: true,\n type: 'line',\n };\n });\n\n return {\n max: 100,\n series: areaSeries,\n };\n }\n\n /**\n * Gets items within a specific interval (for bar chart)\n * @param items\n * @param intervals\n * @param index\n * @returns\n */\n public static getBarChartItemsWithinInterval(items: EpiCurveChartItem[], intervals: Date[], index: number): EpiCurveChartItem[] {\n return items.filter(item => {\n const nextInterval = intervals[index + 1];\n const itemDate = item.date;\n return isEqual(itemDate, intervals[index]) || (isAfter(itemDate, intervals[index]) && (!nextInterval || isBefore(itemDate, nextInterval)));\n });\n }\n\n /**\n * Creates bar chart series data for the epi curve\n * @param items\n * @param xAxisIntervals\n * @param getXAxisLabel\n * @param stratification\n * @returns Bar chart series data with max value and series array\n */\n public static getBarChartSeriesData(\n items: EpiCurveChartItem[],\n xAxisIntervals: Date[],\n getXAxisLabel: (value: Date) => string,\n stratification: Stratification,\n theme: Theme,\n ): { max: number; series: (null | unknown[]) } {\n if (!items) {\n return {\n max: null,\n series: null,\n };\n }\n\n let max = 0;\n const barSerieOptionsBase = {\n emphasis: {\n focus: 'self',\n },\n stack: 'total',\n type: 'bar',\n };\n const barSeries: unknown[] = [];\n\n const hasStratification = stratification?.legendaItems?.length;\n const buckets = EpiCurveUtil.getIntervalBuckets(items, xAxisIntervals, stratification?.caseIdColors);\n\n if (!hasStratification) {\n (barSeries).push({\n ...barSerieOptionsBase,\n color: theme.palette.primary.main,\n data: [],\n name: '',\n });\n } else {\n stratification.legendaItems.forEach(legendaItem => {\n (barSeries).push({\n ...barSerieOptionsBase,\n color: legendaItem.color,\n data: [],\n name: legendaItem.rowValue.full,\n });\n });\n }\n\n const xAxisLabels = xAxisIntervals.map(interval => getXAxisLabel(interval));\n for (let intervalIndex = 0; intervalIndex < xAxisIntervals.length; intervalIndex++) {\n const intervalBucket = buckets[intervalIndex];\n const xAxisLabel = xAxisLabels[intervalIndex];\n const intervalTotal = intervalBucket.value;\n\n if (intervalTotal > max) {\n max = intervalTotal;\n }\n\n if (!hasStratification) {\n const firstBarSerie = (barSeries as Array<{ data: unknown[] }>)[0];\n firstBarSerie?.data.push([\n xAxisLabel,\n intervalTotal,\n JSON.stringify(intervalBucket.caseIds),\n ]);\n } else {\n barSeries.forEach((barSerie) => {\n const barSerieData = (barSerie as { color: string; data: unknown[] });\n const bucketByColor = intervalBucket.byColor[barSerieData.color] ?? { caseIds: [], value: 0 };\n barSerieData.data.push([\n xAxisLabel,\n bucketByColor.value,\n JSON.stringify(bucketByColor.caseIds),\n ]);\n });\n }\n }\n\n return {\n max,\n series: barSeries,\n };\n }\n\n /**\n * Gets rows sorted by time for bar chart\n * @param completeCaseType\n * @param cases\n * @param cols\n * @returns\n */\n public static getBarChartSortedItems(completeCaseType: CaseDbCompleteCaseType, cases: CaseDbCase[], cols: CaseDbCol[]): EpiCurveChartItem[] {\n return EpiCurveUtil.getSortedItems(completeCaseType, cases, cols);\n }\n\n /**\n * Creates normalized stacked area chart data (0-100%) with linear interpolation\n * @param items\n * @param xAxisIntervals\n * @param stratification\n * @returns Normalized data points ready for area chart\n */\n public static getNormalizedAreaChartData(\n items: EpiCurveChartItem[],\n xAxisIntervals: Date[],\n stratification: { caseIdColors: { [caseId: string]: string }; legendaItems: Array<{ color: string; rowValue: { full: string } }> } | null,\n ): EpiCurveNormalizedAreaChartDataPoint[] {\n if (!stratification || !xAxisIntervals.length) {\n return [];\n }\n\n // Step 1: Build value matrix for each series at each interval\n const seriesNames = stratification.legendaItems.map(item => item.rowValue.full);\n const seriesColors = stratification.legendaItems.map(item => item.color);\n const buckets = EpiCurveUtil.getIntervalBuckets(items, xAxisIntervals, stratification.caseIdColors);\n\n // Matrix: seriesIndex -> array of {date, value, caseIds}\n const seriesMatrix: Array<Array<{ caseIds: string[]; date: Date; value: number }>> = seriesNames.map((_, seriesIndex) => {\n const seriesColor = seriesColors[seriesIndex];\n return xAxisIntervals.map((interval, intervalIndex) => {\n const byColorBucket = buckets[intervalIndex].byColor[seriesColor] ?? { caseIds: [], value: 0 };\n return {\n caseIds: byColorBucket.caseIds,\n date: interval,\n value: byColorBucket.value,\n };\n });\n });\n\n // Step 2: Interpolate missing values for each series\n for (let seriesIndex = 0; seriesIndex < seriesNames.length; seriesIndex++) {\n const arr = seriesMatrix[seriesIndex];\n // Find all indices with value > 0\n let lastKnownIdx = -1;\n for (let i = 0; i < arr.length; i++) {\n if (arr[i].value > 0) {\n if (lastKnownIdx >= 0 && i - lastKnownIdx > 1) {\n // Interpolate between lastKnownIdx and i\n const v1 = arr[lastKnownIdx].value;\n const v2 = arr[i].value;\n const d1 = arr[lastKnownIdx].date.getTime();\n const d2 = arr[i].date.getTime();\n for (let j = lastKnownIdx + 1; j < i; j++) {\n const dj = arr[j].date.getTime();\n const t = (dj - d1) / (d2 - d1);\n arr[j].value = v1 + (v2 - v1) * t;\n arr[j].caseIds = [];\n }\n }\n lastKnownIdx = i;\n }\n }\n }\n\n // Step 3: For each interval, collect values for all series and normalize to 100%\n const normalizedDataPoints: EpiCurveNormalizedAreaChartDataPoint[] = xAxisIntervals.map((interval, idx) => {\n const values: { [seriesName: string]: number } = {};\n const caseIds: { [seriesName: string]: string[] } = {};\n let total = 0;\n for (let seriesIndex = 0; seriesIndex < seriesNames.length; seriesIndex++) {\n total += seriesMatrix[seriesIndex][idx].value;\n }\n for (let seriesIndex = 0; seriesIndex < seriesNames.length; seriesIndex++) {\n const v = seriesMatrix[seriesIndex][idx].value;\n const seriesName = seriesNames[seriesIndex];\n values[seriesName] = total > 0 ? (v / total) * 100 : 0;\n caseIds[seriesName] = seriesMatrix[seriesIndex][idx].caseIds;\n }\n return {\n caseIds,\n date: interval,\n values,\n };\n });\n\n return normalizedDataPoints;\n }\n\n /**\n * Finds the initial column (resolution) for the given dimensionId in the given lineList\n * @param completeCaseType\n * @param lineList\n * @param cols\n * @returns\n */\n public static getPreferredTimeColumn(completeCaseType: CaseDbCompleteCaseType, cases: CaseDbCase[], cols: CaseDbCol[]): CaseDbCol {\n const items = EpiCurveUtil.getSortedItems(completeCaseType, cases, cols);\n\n if (!items?.length) {\n return cols?.[0] ?? null;\n }\n\n const duration: Duration = {\n years: 0,\n ...intervalToDuration({\n end: items[items.length - 1].date,\n start: items[0].date,\n }),\n };\n\n const dayCol = cols.find(col => completeCaseType.ref_cols[col.ref_col_id].col_type === CaseDbColType.TIME_DAY);\n if (dayCol && (duration.years ?? 0) === 0 && duration.months <= 3) {\n return dayCol;\n }\n const weekCol = cols.find(col => completeCaseType.ref_cols[col.ref_col_id].col_type === CaseDbColType.TIME_WEEK);\n if (weekCol && (duration.years ?? 0) <= 1) {\n return weekCol;\n }\n const monthCol = cols.find(col => completeCaseType.ref_cols[col.ref_col_id].col_type === CaseDbColType.TIME_MONTH);\n if (monthCol && (duration.years ?? 0) <= 2) {\n return monthCol;\n }\n const quarterCol = cols.find(col => completeCaseType.ref_cols[col.ref_col_id].col_type === CaseDbColType.TIME_QUARTER);\n if (quarterCol && (duration.years ?? 0) <= 5) {\n return quarterCol;\n }\n const yearCol = cols.find(col => completeCaseType.ref_cols[col.ref_col_id].col_type === CaseDbColType.TIME_QUARTER);\n if (yearCol) {\n return yearCol;\n }\n\n return CaseTypeUtil.getPreferredColInDimHavingHighestRank(cols, completeCaseType);\n }\n\n /**\n * Gets rows sorted by time\n * @param completeCaseType\n * @param cases\n * @param cols\n * @returns\n */\n public static getSortedItems(completeCaseType: CaseDbCompleteCaseType, cases: CaseDbCase[], cols: CaseDbCol[]): EpiCurveChartItem[] {\n if (!cols.length || !cases.length || !completeCaseType) {\n return [];\n }\n\n // cache the parsers\n const dateParsers: { [key: string]: (date: string) => Date } = {};\n cols.forEach(col => {\n dateParsers[col.id] = FilterUtil.getDateParser(completeCaseType.ref_cols[col.ref_col_id]);\n });\n\n const items: EpiCurveChartItem[] = cases.map(row => {\n const dates = cols.map(col => {\n const columnDate = row.content[col.id];\n if (!columnDate) {\n return null;\n }\n const parsedColumnDate = dateParsers[col.id](columnDate);\n if (!isValid(parsedColumnDate)) {\n return null;\n }\n return parsedColumnDate;\n }).filter(d => !!d);\n\n return {\n date: dates[0] ?? null,\n row,\n // when count is null, 1 should be assumed\n value: row.count ?? 1,\n };\n }).filter(item => !!item.date);\n\n return items.sort((a, b) => {\n const aData = a.date;\n const bData = b.date;\n\n if (isAfter(aData, bData)) {\n return 1;\n }\n if (isBefore(aData, bData)) {\n return -1;\n }\n return 0;\n });\n }\n\n public static getXAxisIntervals(colType: CaseDbColType, items: EpiCurveChartItem[]): Date[] {\n if (items.length === 0) {\n return [];\n }\n\n const start = items[0].date;\n const end = items[items.length - 1].date;\n\n switch (colType) {\n case CaseDbColType.TIME_DAY:\n return eachDayOfInterval({ end, start });\n case CaseDbColType.TIME_MONTH:\n return eachMonthOfInterval({ end, start });\n case CaseDbColType.TIME_QUARTER:\n return eachQuarterOfInterval({ end, start });\n case CaseDbColType.TIME_WEEK:\n return eachWeekOfInterval({ end, start });\n case CaseDbColType.TIME_YEAR:\n return eachYearOfInterval({ end, start });\n default:\n throw Error(`unknown col_type ${colType}`);\n }\n }\n\n public static getXAxisLabel(colType: CaseDbColType, value: Date): string {\n switch (colType) {\n case CaseDbColType.TIME_DAY:\n return format(value, DATE_FORMAT.DATE);\n case CaseDbColType.TIME_MONTH:\n return format(value, DATE_FORMAT.YEAR_MONTH);\n case CaseDbColType.TIME_QUARTER:\n return format(value, DATE_FORMAT.YEAR_QUARTER);\n case CaseDbColType.TIME_WEEK:\n return format(value, DATE_FORMAT.YEAR_WEEK, { useAdditionalWeekYearTokens: true });\n case CaseDbColType.TIME_YEAR:\n return format(value, DATE_FORMAT.YEAR);\n default:\n throw Error(`unknown col_type ${colType}`);\n }\n }\n\n private static getIntervalBuckets(\n items: EpiCurveChartItem[],\n intervals: Date[],\n caseIdColors?: { [caseId: string]: string },\n ): IntervalBucket[] {\n if (!intervals.length) {\n return [];\n }\n\n const intervalStartTimes = intervals.map(interval => interval.getTime());\n const lastIntervalIndex = intervalStartTimes.length - 1;\n const buckets: IntervalBucket[] = intervals.map(() => ({\n byColor: {},\n caseIds: [] as string[],\n value: 0,\n }));\n\n let intervalIndex = 0;\n for (const item of items) {\n const itemTime = item.date.getTime();\n\n // Move interval pointer until item belongs to [interval, nextInterval).\n while (\n intervalIndex < lastIntervalIndex\n && itemTime >= intervalStartTimes[intervalIndex + 1]\n ) {\n intervalIndex += 1;\n }\n\n const bucket = buckets[intervalIndex];\n bucket.value += item.value;\n bucket.caseIds.push(item.row.id);\n\n const color = caseIdColors?.[item.row.id];\n if (!color) {\n continue;\n }\n\n if (!bucket.byColor[color]) {\n bucket.byColor[color] = {\n caseIds: [] as string[],\n value: 0,\n };\n }\n bucket.byColor[color].value += item.value;\n bucket.byColor[color].caseIds.push(item.row.id);\n }\n\n return buckets;\n }\n\n // interpolateAreaChartData is now inlined in getNormalizedAreaChartData for per-series interpolation\n}\n"],"x_google_ignoreList":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17],"mappings":";;;;;;;;;;AAoEA,SAAgB,EAAI,GAAM,GAAU,GAAS;CAC3C,IAAM,EACJ,WAAQ,GACR,YAAS,GACT,WAAQ,GACR,UAAO,GACP,WAAQ,GACR,aAAU,GACV,aAAU,MACR,GAGE,IAAQ,EAAO,GAAM,GAAS,EAAE,GAChC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S;EAC7C;CACF;CAEA,OAAe,mBACb,GACA,GACA,GACkB;EAClB,IAAI,CAAC,EAAU,QACb,OAAO,CAAC;EAGV,IAAM,IAAqB,EAAU,KAAI,MAAY,EAAS,QAAQ,CAAC,GACjE,IAAoB,EAAmB,SAAS,GAChD,IAA4B,EAAU,WAAW;GACrD,SAAS,CAAC;GACV,SAAS,CAAC;GACV,OAAO;EACT,EAAE,GAEE,IAAgB;EACpB,KAAK,IAAM,KAAQ,GAAO;GACxB,IAAM,IAAW,EAAK,KAAK,QAAQ;GAGnC,OACE,IAAgB,KACb,KAAY,EAAmB,IAAgB,KAElD,KAAiB;GAGnB,IAAM,IAAS,EAAQ;GAEvB,AADA,EAAO,SAAS,EAAK,OACrB,EAAO,QAAQ,KAAK,EAAK,IAAI,EAAE;GAE/B,IAAM,IAAQ,IAAe,EAAK,IAAI;GACjC,MAIA,EAAO,QAAQ,OAClB,EAAO,QAAQ,KAAS;IACtB,SAAS,CAAC;IACV,OAAO;GACT,IAEF,EAAO,QAAQ,EAAM,CAAC,SAAS,EAAK,OACpC,EAAO,QAAQ,EAAM,CAAC,QAAQ,KAAK,EAAK,IAAI,EAAE;EAChD;EAEA,OAAO;CACT;AAGF"}
1
+ {"version":3,"file":"EpiCurveUtil.js","names":[],"sources":["../../../../node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/add.js","../../../../node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/addWeeks.js","../../../../node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/compareAsc.js","../../../../node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/differenceInCalendarMonths.js","../../../../node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/differenceInCalendarYears.js","../../../../node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/_lib/getRoundingMethod.js","../../../../node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/differenceInHours.js","../../../../node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/differenceInMilliseconds.js","../../../../node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/differenceInMinutes.js","../../../../node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/isLastDayOfMonth.js","../../../../node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/differenceInMonths.js","../../../../node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/differenceInSeconds.js","../../../../node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/differenceInYears.js","../../../../node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/eachWeekOfInterval.js","../../../../node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/intervalToDuration.js","../../../../node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/isAfter.js","../../../../node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/isBefore.js","../../../../node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/isEqual.js","../../src/utils/EpiCurveUtil/EpiCurveUtil.ts"],"sourcesContent":["import { addDays } from \"./addDays.js\";\nimport { addMonths } from \"./addMonths.js\";\nimport { constructFrom } from \"./constructFrom.js\";\nimport { toDate } from \"./toDate.js\";\n\n/**\n * The {@link add} function options.\n */\n\n/**\n * @name add\n * @category Common Helpers\n * @summary Add the specified years, months, weeks, days, hours, minutes, and seconds to the given date.\n *\n * @description\n * Add the specified years, months, weeks, days, hours, minutes, and seconds to the given date.\n *\n * **You don't need date-fns\\***:\n *\n * Temporal has a built-in `add` method on all its classes:\n *\n * - [`Temporal.Instant.prototype.add()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Temporal/Instant/add)\n * - [`Temporal.PlainDate.prototype.add()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Temporal/PlainDate/add)\n * - [`Temporal.PlainDateTime.prototype.add()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Temporal/PlainDateTime/add)\n * - [`Temporal.PlainTime.prototype.add()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Temporal/PlainTime/add)\n * - [`Temporal.PlainYearMonth.prototype.add()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Temporal/PlainYearMonth/add)\n * - [`Temporal.ZonedDateTime.prototype.add()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Temporal/ZonedDateTime/add)\n *\n * \\* **Not really**, see: https://date-fns.org/you-dont-need-date-fns\n *\n * @typeParam DateType - The `Date` type the function operates on. Gets inferred from passed arguments. Allows using extensions like [`UTCDate`](https://github.com/date-fns/utc).\n * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.\n *\n * @param date - The date to be changed\n * @param duration - The object with years, months, weeks, days, hours, minutes, and seconds to be added.\n * @param options - An object with options\n *\n * @returns The new date with the seconds added\n *\n * @example\n * // Add the following duration to 1 September 2014, 10:19:50\n * const result = add(new Date(2014, 8, 1, 10, 19, 50), {\n * years: 2,\n * months: 9,\n * weeks: 1,\n * days: 7,\n * hours: 5,\n * minutes: 9,\n * seconds: 30,\n * })\n * //=> Thu Jun 15 2017 15:29:20\n *\n * @example\n * // Using Temporal:\n * // Add the following duration to 1 September 2014, 10:19:50\n * Temporal.PlainDateTime.from(\"2014-09-01T10:19:50\")\n * .add({\n * years: 2,\n * months: 9,\n * weeks: 1,\n * days: 7,\n * hours: 5,\n * minutes: 9,\n * seconds: 30,\n * })\n * .toString();\n * //=> \"2017-06-15T15:29:20\"\n */\nexport function add(date, duration, options) {\n const {\n years = 0,\n months = 0,\n weeks = 0,\n days = 0,\n hours = 0,\n minutes = 0,\n seconds = 0,\n } = duration;\n\n // Add years and months\n const _date = toDate(date, options?.in);\n const dateWithMonths =\n months || years ? addMonths(_date, months + years * 12) : _date;\n\n // Add weeks and days\n const dateWithDays =\n days || weeks ? addDays(dateWithMonths, days + weeks * 7) : dateWithMonths;\n\n // Add days, hours, minutes, and seconds\n const minutesToAdd = minutes + hours * 60;\n const secondsToAdd = seconds + minutesToAdd * 60;\n const msToAdd = secondsToAdd * 1000;\n\n return constructFrom(options?.in || date, +dateWithDays + msToAdd);\n}\n\n// Fallback for modularized imports:\nexport default add;\n","import { addDays } from \"./addDays.js\";\n\n/**\n * The {@link addWeeks} function options.\n */\n\n/**\n * @name addWeeks\n * @category Week Helpers\n * @summary Add the specified number of weeks to the given date.\n *\n * @description\n * Add the specified number of weeks to the given date.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.\n *\n * @param date - The date to be changed\n * @param amount - The amount of weeks to be added.\n * @param options - An object with options\n *\n * @returns The new date with the weeks added\n *\n * @example\n * // Add 4 weeks to 1 September 2014:\n * const result = addWeeks(new Date(2014, 8, 1), 4)\n * //=> Mon Sep 29 2014 00:00:00\n */\nexport function addWeeks(date, amount, options) {\n return addDays(date, amount * 7, options);\n}\n\n// Fallback for modularized imports:\nexport default addWeeks;\n","import { toDate } from \"./toDate.js\";\n\n/**\n * @name compareAsc\n * @category Common Helpers\n * @summary Compare the two dates and return -1, 0 or 1.\n *\n * @description\n * Compare the two dates and return 1 if the first date is after the second,\n * -1 if the first date is before the second or 0 if dates are equal.\n *\n * @param dateLeft - The first date to compare\n * @param dateRight - The second date to compare\n *\n * @returns The result of the comparison\n *\n * @example\n * // Compare 11 February 1987 and 10 July 1989:\n * const result = compareAsc(new Date(1987, 1, 11), new Date(1989, 6, 10))\n * //=> -1\n *\n * @example\n * // Sort the array of dates:\n * const result = [\n * new Date(1995, 6, 2),\n * new Date(1987, 1, 11),\n * new Date(1989, 6, 10)\n * ].sort(compareAsc)\n * //=> [\n * // Wed Feb 11 1987 00:00:00,\n * // Mon Jul 10 1989 00:00:00,\n * // Sun Jul 02 1995 00:00:00\n * // ]\n */\nexport function compareAsc(dateLeft, dateRight) {\n const diff = +toDate(dateLeft) - +toDate(dateRight);\n\n if (diff < 0) return -1;\n else if (diff > 0) return 1;\n\n // Return 0 if diff is 0; return NaN if diff is NaN\n return diff;\n}\n\n// Fallback for modularized imports:\nexport default compareAsc;\n","import { normalizeDates } from \"./_lib/normalizeDates.js\";\n\n/**\n * The {@link differenceInCalendarMonths} function options.\n */\n\n/**\n * @name differenceInCalendarMonths\n * @category Month Helpers\n * @summary Get the number of calendar months between the given dates.\n *\n * @description\n * Get the number of calendar months between the given dates.\n *\n * @param laterDate - The later date\n * @param earlierDate - The earlier date\n * @param options - An object with options\n *\n * @returns The number of calendar months\n *\n * @example\n * // How many calendar months are between 31 January 2014 and 1 September 2014?\n * const result = differenceInCalendarMonths(\n * new Date(2014, 8, 1),\n * new Date(2014, 0, 31)\n * )\n * //=> 8\n */\nexport function differenceInCalendarMonths(laterDate, earlierDate, options) {\n const [laterDate_, earlierDate_] = normalizeDates(\n options?.in,\n laterDate,\n earlierDate,\n );\n\n const yearsDiff = laterDate_.getFullYear() - earlierDate_.getFullYear();\n const monthsDiff = laterDate_.getMonth() - earlierDate_.getMonth();\n\n return yearsDiff * 12 + monthsDiff;\n}\n\n// Fallback for modularized imports:\nexport default differenceInCalendarMonths;\n","import { normalizeDates } from \"./_lib/normalizeDates.js\";\n\n/**\n * The {@link differenceInCalendarYears} function options.\n */\n\n/**\n * @name differenceInCalendarYears\n * @category Year Helpers\n * @summary Get the number of calendar years between the given dates.\n *\n * @description\n * Get the number of calendar years between the given dates.\n *\n * @param laterDate - The later date\n * @param earlierDate - The earlier date\n * @param options - An object with options\n\n * @returns The number of calendar years\n *\n * @example\n * // How many calendar years are between 31 December 2013 and 11 February 2015?\n * const result = differenceInCalendarYears(\n * new Date(2015, 1, 11),\n * new Date(2013, 11, 31)\n * );\n * //=> 2\n */\nexport function differenceInCalendarYears(laterDate, earlierDate, options) {\n const [laterDate_, earlierDate_] = normalizeDates(\n options?.in,\n laterDate,\n earlierDate,\n );\n return laterDate_.getFullYear() - earlierDate_.getFullYear();\n}\n\n// Fallback for modularized imports:\nexport default differenceInCalendarYears;\n","export function getRoundingMethod(method) {\n return (number) => {\n const round = method ? Math[method] : Math.trunc;\n const result = round(number);\n // Prevent negative zero\n return result === 0 ? 0 : result;\n };\n}\n","import { getRoundingMethod } from \"./_lib/getRoundingMethod.js\";\nimport { normalizeDates } from \"./_lib/normalizeDates.js\";\nimport { millisecondsInHour } from \"./constants.js\";\n\n/**\n * The {@link differenceInHours} function options.\n */\n\n/**\n * @name differenceInHours\n * @category Hour Helpers\n * @summary Get the number of hours between the given dates.\n *\n * @description\n * Get the number of hours between the given dates.\n *\n * @param laterDate - The later date\n * @param earlierDate - The earlier date\n * @param options - An object with options.\n *\n * @returns The number of hours\n *\n * @example\n * // How many hours are between 2 July 2014 06:50:00 and 2 July 2014 19:00:00?\n * const result = differenceInHours(\n * new Date(2014, 6, 2, 19, 0),\n * new Date(2014, 6, 2, 6, 50)\n * )\n * //=> 12\n */\nexport function differenceInHours(laterDate, earlierDate, options) {\n const [laterDate_, earlierDate_] = normalizeDates(\n options?.in,\n laterDate,\n earlierDate,\n );\n const diff = (+laterDate_ - +earlierDate_) / millisecondsInHour;\n return getRoundingMethod(options?.roundingMethod)(diff);\n}\n\n// Fallback for modularized imports:\nexport default differenceInHours;\n","import { toDate } from \"./toDate.js\";\n\n/**\n * @name differenceInMilliseconds\n * @category Millisecond Helpers\n * @summary Get the number of milliseconds between the given dates.\n *\n * @description\n * Get the number of milliseconds between the given dates.\n *\n * @param laterDate - The later date\n * @param earlierDate - The earlier date\n *\n * @returns The number of milliseconds\n *\n * @example\n * // How many milliseconds are between\n * // 2 July 2014 12:30:20.600 and 2 July 2014 12:30:21.700?\n * const result = differenceInMilliseconds(\n * new Date(2014, 6, 2, 12, 30, 21, 700),\n * new Date(2014, 6, 2, 12, 30, 20, 600)\n * )\n * //=> 1100\n */\nexport function differenceInMilliseconds(laterDate, earlierDate) {\n return +toDate(laterDate) - +toDate(earlierDate);\n}\n\n// Fallback for modularized imports:\nexport default differenceInMilliseconds;\n","import { getRoundingMethod } from \"./_lib/getRoundingMethod.js\";\nimport { millisecondsInMinute } from \"./constants.js\";\nimport { differenceInMilliseconds } from \"./differenceInMilliseconds.js\";\n\n/**\n * The {@link differenceInMinutes} function options.\n */\n\n/**\n * @name differenceInMinutes\n * @category Minute Helpers\n * @summary Get the number of minutes between the given dates.\n *\n * @description\n * Get the signed number of full (rounded towards 0) minutes between the given dates.\n *\n * @param dateLeft - The later date\n * @param dateRight - The earlier date\n * @param options - An object with options.\n *\n * @returns The number of minutes\n *\n * @example\n * // How many minutes are between 2 July 2014 12:07:59 and 2 July 2014 12:20:00?\n * const result = differenceInMinutes(\n * new Date(2014, 6, 2, 12, 20, 0),\n * new Date(2014, 6, 2, 12, 7, 59)\n * )\n * //=> 12\n *\n * @example\n * // How many minutes are between 10:01:59 and 10:00:00\n * const result = differenceInMinutes(\n * new Date(2000, 0, 1, 10, 0, 0),\n * new Date(2000, 0, 1, 10, 1, 59)\n * )\n * //=> -1\n */\nexport function differenceInMinutes(dateLeft, dateRight, options) {\n const diff =\n differenceInMilliseconds(dateLeft, dateRight) / millisecondsInMinute;\n return getRoundingMethod(options?.roundingMethod)(diff);\n}\n\n// Fallback for modularized imports:\nexport default differenceInMinutes;\n","import { endOfDay } from \"./endOfDay.js\";\nimport { endOfMonth } from \"./endOfMonth.js\";\nimport { toDate } from \"./toDate.js\";\n\n/**\n * @name isLastDayOfMonth\n * @category Month Helpers\n * @summary Is the given date the last day of a month?\n *\n * @description\n * Is the given date the last day of a month?\n *\n * @param date - The date to check\n * @param options - An object with options\n *\n * @returns The date is the last day of a month\n *\n * @example\n * // Is 28 February 2014 the last day of a month?\n * const result = isLastDayOfMonth(new Date(2014, 1, 28))\n * //=> true\n */\nexport function isLastDayOfMonth(date, options) {\n const _date = toDate(date, options?.in);\n return +endOfDay(_date, options) === +endOfMonth(_date, options);\n}\n\n// Fallback for modularized imports:\nexport default isLastDayOfMonth;\n","import { normalizeDates } from \"./_lib/normalizeDates.js\";\nimport { compareAsc } from \"./compareAsc.js\";\nimport { differenceInCalendarMonths } from \"./differenceInCalendarMonths.js\";\nimport { isLastDayOfMonth } from \"./isLastDayOfMonth.js\";\n\n/**\n * The {@link differenceInMonths} function options.\n */\n\n/**\n * @name differenceInMonths\n * @category Month Helpers\n * @summary Get the number of full months between the given dates.\n *\n * @param laterDate - The later date\n * @param earlierDate - The earlier date\n * @param options - An object with options\n *\n * @returns The number of full months\n *\n * @example\n * // How many full months are between 31 January 2014 and 1 September 2014?\n * const result = differenceInMonths(new Date(2014, 8, 1), new Date(2014, 0, 31))\n * //=> 7\n */\nexport function differenceInMonths(laterDate, earlierDate, options) {\n const [laterDate_, workingLaterDate, earlierDate_] = normalizeDates(\n options?.in,\n laterDate,\n laterDate,\n earlierDate,\n );\n\n const sign = compareAsc(workingLaterDate, earlierDate_);\n const difference = Math.abs(\n differenceInCalendarMonths(workingLaterDate, earlierDate_),\n );\n\n if (difference < 1) return 0;\n\n if (workingLaterDate.getMonth() === 1 && workingLaterDate.getDate() > 27)\n workingLaterDate.setDate(30);\n\n workingLaterDate.setMonth(workingLaterDate.getMonth() - sign * difference);\n\n let isLastMonthNotFull = compareAsc(workingLaterDate, earlierDate_) === -sign;\n\n if (\n isLastDayOfMonth(laterDate_) &&\n difference === 1 &&\n compareAsc(laterDate_, earlierDate_) === 1\n ) {\n isLastMonthNotFull = false;\n }\n\n const result = sign * (difference - +isLastMonthNotFull);\n return result === 0 ? 0 : result;\n}\n\n// Fallback for modularized imports:\nexport default differenceInMonths;\n","import { getRoundingMethod } from \"./_lib/getRoundingMethod.js\";\nimport { differenceInMilliseconds } from \"./differenceInMilliseconds.js\";\n\n/**\n * The {@link differenceInSeconds} function options.\n */\n\n/**\n * @name differenceInSeconds\n * @category Second Helpers\n * @summary Get the number of seconds between the given dates.\n *\n * @description\n * Get the number of seconds between the given dates.\n *\n * @param laterDate - The later date\n * @param earlierDate - The earlier date\n * @param options - An object with options.\n *\n * @returns The number of seconds\n *\n * @example\n * // How many seconds are between\n * // 2 July 2014 12:30:07.999 and 2 July 2014 12:30:20.000?\n * const result = differenceInSeconds(\n * new Date(2014, 6, 2, 12, 30, 20, 0),\n * new Date(2014, 6, 2, 12, 30, 7, 999)\n * )\n * //=> 12\n */\nexport function differenceInSeconds(laterDate, earlierDate, options) {\n const diff = differenceInMilliseconds(laterDate, earlierDate) / 1000;\n return getRoundingMethod(options?.roundingMethod)(diff);\n}\n\n// Fallback for modularized imports:\nexport default differenceInSeconds;\n","import { normalizeDates } from \"./_lib/normalizeDates.js\";\nimport { compareAsc } from \"./compareAsc.js\";\nimport { differenceInCalendarYears } from \"./differenceInCalendarYears.js\";\n\n/**\n * The {@link differenceInYears} function options.\n */\n\n/**\n * @name differenceInYears\n * @category Year Helpers\n * @summary Get the number of full years between the given dates.\n *\n * @description\n * Get the number of full years between the given dates.\n *\n * @param laterDate - The later date\n * @param earlierDate - The earlier date\n * @param options - An object with options\n *\n * @returns The number of full years\n *\n * @example\n * // How many full years are between 31 December 2013 and 11 February 2015?\n * const result = differenceInYears(new Date(2015, 1, 11), new Date(2013, 11, 31))\n * //=> 1\n */\nexport function differenceInYears(laterDate, earlierDate, options) {\n const [laterDate_, earlierDate_] = normalizeDates(\n options?.in,\n laterDate,\n earlierDate,\n );\n\n // -1 if the left date is earlier than the right date\n // 2023-12-31 - 2024-01-01 = -1\n const sign = compareAsc(laterDate_, earlierDate_);\n\n // First calculate the difference in calendar years\n // 2024-01-01 - 2023-12-31 = 1 year\n const diff = Math.abs(differenceInCalendarYears(laterDate_, earlierDate_));\n\n // Now we need to calculate if the difference is full. To do that we set\n // both dates to the same year and check if the both date's month and day\n // form a full year.\n laterDate_.setFullYear(1584);\n earlierDate_.setFullYear(1584);\n\n // For it to be true, when the later date is indeed later than the earlier date\n // (2026-02-01 - 2023-12-10 = 3 years), the difference is full if\n // the normalized later date is also later than the normalized earlier date.\n // In our example, 1584-02-01 is earlier than 1584-12-10, so the difference\n // is partial, hence we need to subtract 1 from the difference 3 - 1 = 2.\n const partial = compareAsc(laterDate_, earlierDate_) === -sign;\n\n const result = sign * (diff - +partial);\n\n // Prevent negative zero\n return result === 0 ? 0 : result;\n}\n\n// Fallback for modularized imports:\nexport default differenceInYears;\n","import { normalizeInterval } from \"./_lib/normalizeInterval.js\";\nimport { addWeeks } from \"./addWeeks.js\";\nimport { constructFrom } from \"./constructFrom.js\";\nimport { startOfWeek } from \"./startOfWeek.js\";\n\n/**\n * The {@link eachWeekOfInterval} function options.\n */\n\n/**\n * The {@link eachWeekOfInterval} function result type. It resolves the proper data type.\n * It uses the first argument date object type, starting from the interval start date,\n * then the end interval date. If a context function is passed, it uses the context function return type.\n */\n\n/**\n * @name eachWeekOfInterval\n * @category Interval Helpers\n * @summary Return the array of weeks within the specified time interval.\n *\n * @description\n * Return the array of weeks within the specified time interval.\n *\n * @param interval - The interval.\n * @param options - An object with options.\n *\n * @returns The array with starts of weeks from the week of the interval start to the week of the interval end\n *\n * @example\n * // Each week within interval 6 October 2014 - 23 November 2014:\n * const result = eachWeekOfInterval({\n * start: new Date(2014, 9, 6),\n * end: new Date(2014, 10, 23)\n * })\n * //=> [\n * // Sun Oct 05 2014 00:00:00,\n * // Sun Oct 12 2014 00:00:00,\n * // Sun Oct 19 2014 00:00:00,\n * // Sun Oct 26 2014 00:00:00,\n * // Sun Nov 02 2014 00:00:00,\n * // Sun Nov 09 2014 00:00:00,\n * // Sun Nov 16 2014 00:00:00,\n * // Sun Nov 23 2014 00:00:00\n * // ]\n */\nexport function eachWeekOfInterval(interval, options) {\n const { start, end } = normalizeInterval(options?.in, interval);\n\n let reversed = +start > +end;\n const startDateWeek = reversed\n ? startOfWeek(end, options)\n : startOfWeek(start, options);\n const endDateWeek = reversed\n ? startOfWeek(start, options)\n : startOfWeek(end, options);\n\n startDateWeek.setHours(15);\n endDateWeek.setHours(15);\n\n const endTime = +endDateWeek.getTime();\n let currentDate = startDateWeek;\n\n let step = options?.step ?? 1;\n if (!step) return [];\n if (step < 0) {\n step = -step;\n reversed = !reversed;\n }\n\n const dates = [];\n\n while (+currentDate <= endTime) {\n currentDate.setHours(0);\n dates.push(constructFrom(start, currentDate));\n currentDate = addWeeks(currentDate, step);\n currentDate.setHours(15);\n }\n\n return reversed ? dates.reverse() : dates;\n}\n\n// Fallback for modularized imports:\nexport default eachWeekOfInterval;\n","import { normalizeInterval } from \"./_lib/normalizeInterval.js\";\nimport { add } from \"./add.js\";\nimport { differenceInDays } from \"./differenceInDays.js\";\nimport { differenceInHours } from \"./differenceInHours.js\";\nimport { differenceInMinutes } from \"./differenceInMinutes.js\";\nimport { differenceInMonths } from \"./differenceInMonths.js\";\nimport { differenceInSeconds } from \"./differenceInSeconds.js\";\nimport { differenceInYears } from \"./differenceInYears.js\";\n\n/**\n * The {@link intervalToDuration} function options.\n */\n\n/**\n * @name intervalToDuration\n * @category Common Helpers\n * @summary Convert interval to duration\n *\n * @description\n * Convert an interval object to a duration object.\n *\n * @param interval - The interval to convert to duration\n * @param options - The context options\n *\n * @returns The duration object\n *\n * @example\n * // Get the duration between January 15, 1929 and April 4, 1968.\n * intervalToDuration({\n * start: new Date(1929, 0, 15, 12, 0, 0),\n * end: new Date(1968, 3, 4, 19, 5, 0)\n * });\n * //=> { years: 39, months: 2, days: 20, hours: 7, minutes: 5, seconds: 0 }\n */\nexport function intervalToDuration(interval, options) {\n const { start, end } = normalizeInterval(options?.in, interval);\n const duration = {};\n\n const years = differenceInYears(end, start);\n if (years) duration.years = years;\n\n const remainingMonths = add(start, { years: duration.years });\n const months = differenceInMonths(end, remainingMonths);\n if (months) duration.months = months;\n\n const remainingDays = add(remainingMonths, { months: duration.months });\n const days = differenceInDays(end, remainingDays);\n if (days) duration.days = days;\n\n const remainingHours = add(remainingDays, { days: duration.days });\n const hours = differenceInHours(end, remainingHours);\n if (hours) duration.hours = hours;\n\n const remainingMinutes = add(remainingHours, { hours: duration.hours });\n const minutes = differenceInMinutes(end, remainingMinutes);\n if (minutes) duration.minutes = minutes;\n\n const remainingSeconds = add(remainingMinutes, { minutes: duration.minutes });\n const seconds = differenceInSeconds(end, remainingSeconds);\n if (seconds) duration.seconds = seconds;\n\n return duration;\n}\n\n// Fallback for modularized imports:\nexport default intervalToDuration;\n","import { toDate } from \"./toDate.js\";\n\n/**\n * @name isAfter\n * @category Common Helpers\n * @summary Is the first date after the second one?\n *\n * @description\n * Is the first date after the second one?\n *\n * @param date - The date that should be after the other one to return true\n * @param dateToCompare - The date to compare with\n *\n * @returns The first date is after the second date\n *\n * @example\n * // Is 10 July 1989 after 11 February 1987?\n * const result = isAfter(new Date(1989, 6, 10), new Date(1987, 1, 11))\n * //=> true\n */\nexport function isAfter(date, dateToCompare) {\n return +toDate(date) > +toDate(dateToCompare);\n}\n\n// Fallback for modularized imports:\nexport default isAfter;\n","import { toDate } from \"./toDate.js\";\n\n/**\n * @name isBefore\n * @category Common Helpers\n * @summary Is the first date before the second one?\n *\n * @description\n * Is the first date before the second one?\n *\n * @param date - The date that should be before the other one to return true\n * @param dateToCompare - The date to compare with\n *\n * @returns The first date is before the second date\n *\n * @example\n * // Is 10 July 1989 before 11 February 1987?\n * const result = isBefore(new Date(1989, 6, 10), new Date(1987, 1, 11))\n * //=> false\n */\nexport function isBefore(date, dateToCompare) {\n return +toDate(date) < +toDate(dateToCompare);\n}\n\n// Fallback for modularized imports:\nexport default isBefore;\n","import { toDate } from \"./toDate.js\";\n\n/**\n * @name isEqual\n * @category Common Helpers\n * @summary Are the given dates equal?\n *\n * @description\n * Are the given dates equal?\n *\n * @param dateLeft - The first date to compare\n * @param dateRight - The second date to compare\n *\n * @returns The dates are equal\n *\n * @example\n * // Are 2 July 2014 06:30:45.000 and 2 July 2014 06:30:45.500 equal?\n * const result = isEqual(\n * new Date(2014, 6, 2, 6, 30, 45, 0),\n * new Date(2014, 6, 2, 6, 30, 45, 500)\n * )\n * //=> false\n */\nexport function isEqual(leftDate, rightDate) {\n return +toDate(leftDate) === +toDate(rightDate);\n}\n\n// Fallback for modularized imports:\nexport default isEqual;\n","import type { Duration } from 'date-fns';\nimport {\n eachDayOfInterval,\n eachMonthOfInterval,\n eachQuarterOfInterval,\n eachWeekOfInterval,\n eachYearOfInterval,\n format,\n intervalToDuration,\n isAfter,\n isBefore,\n isEqual,\n isValid,\n} from 'date-fns';\nimport type {\n CaseDbCase,\n CaseDbCol,\n CaseDbCompleteCaseType,\n} from '@gen-epix/api-casedb';\nimport { CaseDbColType } from '@gen-epix/api-casedb';\nimport type { Theme } from '@mui/material';\nimport { DATE_FORMAT } from '@gen-epix/ui-core/constants/date';\n\nimport { CaseTypeUtil } from '../CaseTypeUtil';\nimport { FilterUtil } from '../FilterUtil';\nimport type { Stratification } from '../../models/stratification';\n\nexport interface EpiCurveChartItem {\n date: Date;\n row: CaseDbCase;\n value: number;\n}\n\nexport interface EpiCurveNormalizedAreaChartDataPoint {\n caseIds: { [seriesName: string]: string[] };\n date: Date;\n values: { [seriesName: string]: number };\n}\n\ntype IntervalBucket = {\n byColor: { [color: string]: { caseIds: string[]; value: number } };\n caseIds: string[];\n value: number;\n};\n\nexport class EpiCurveUtil {\n /**\n * Creates normalized stacked area chart series data (0-100%) for the epi curve\n * @param items\n * @param xAxisIntervals\n * @param getXAxisLabel\n * @param stratification\n * @returns Area chart series data with max value (always 100) and series array\n */\n public static getAreaChartSeriesData(\n items: EpiCurveChartItem[],\n xAxisIntervals: Date[],\n getXAxisLabel: (value: Date) => string,\n includeMissingValues: boolean,\n stratification: Stratification,\n ): { max: number; series: (null | unknown[]) } {\n // Note: an area chart will always have stratification, as it doesn't make sense without it.\n\n if (!items || !stratification?.legendaItems?.length) {\n return {\n max: 100,\n series: null,\n };\n }\n\n const visibleLegendaItems = includeMissingValues\n ? stratification.legendaItems\n : stratification.legendaItems.filter(item => item.color !== stratification.colorForIsMissing);\n\n if (!visibleLegendaItems.length) {\n return {\n max: 100,\n series: null,\n };\n }\n\n const visibleStratification = {\n caseIdColors: stratification.caseIdColors,\n legendaItems: visibleLegendaItems.map(item => ({\n color: item.color,\n rowValue: {\n full: item.rowValue.full,\n },\n })),\n };\n\n // Step 1: Interpolate and normalize data for each series\n const normalizedDataPoints = EpiCurveUtil.getNormalizedAreaChartData(items, xAxisIntervals, visibleStratification);\n\n if (!normalizedDataPoints.length) {\n return {\n max: 100,\n series: null,\n };\n }\n\n // Step 2: Output series for ECharts (each series: [x, y, caseIds])\n const seriesNames = visibleLegendaItems.map(item => item.rowValue.full);\n const xAxisLabels = xAxisIntervals.map(interval => getXAxisLabel(interval));\n const areaSeries: unknown[] = seriesNames.map((seriesName, seriesIndex) => {\n return {\n areaStyle: {},\n color: stratification.legendaItems[seriesIndex].color,\n data: normalizedDataPoints.map((point, pointIdx) => [\n xAxisLabels[pointIdx],\n point.values[seriesName],\n JSON.stringify(point.caseIds[seriesName]),\n ]),\n emphasis: {\n focus: 'series',\n },\n name: seriesName,\n smooth: false,\n stack: 'total',\n triggerEvent: true,\n type: 'line',\n };\n });\n\n return {\n max: 100,\n series: areaSeries,\n };\n }\n\n /**\n * Gets items within a specific interval (for bar chart)\n * @param items\n * @param intervals\n * @param index\n * @returns\n */\n public static getBarChartItemsWithinInterval(items: EpiCurveChartItem[], intervals: Date[], index: number): EpiCurveChartItem[] {\n return items.filter(item => {\n const nextInterval = intervals[index + 1];\n const itemDate = item.date;\n return isEqual(itemDate, intervals[index]) || (isAfter(itemDate, intervals[index]) && (!nextInterval || isBefore(itemDate, nextInterval)));\n });\n }\n\n /**\n * Creates bar chart series data for the epi curve\n * @param items\n * @param xAxisIntervals\n * @param getXAxisLabel\n * @param stratification\n * @returns Bar chart series data with max value and series array\n */\n public static getBarChartSeriesData(\n items: EpiCurveChartItem[],\n xAxisIntervals: Date[],\n getXAxisLabel: (value: Date) => string,\n stratification: Stratification,\n theme: Theme,\n ): { max: number; series: (null | unknown[]) } {\n if (!items) {\n return {\n max: null,\n series: null,\n };\n }\n\n let max = 0;\n const barSerieOptionsBase = {\n emphasis: {\n focus: 'self',\n },\n stack: 'total',\n type: 'bar',\n };\n const barSeries: unknown[] = [];\n\n const hasStratification = stratification?.legendaItems?.length;\n const buckets = EpiCurveUtil.getIntervalBuckets(items, xAxisIntervals, stratification?.caseIdColors);\n\n if (!hasStratification) {\n (barSeries).push({\n ...barSerieOptionsBase,\n color: theme.palette.primary.main,\n data: [],\n name: '',\n });\n } else {\n stratification.legendaItems.forEach(legendaItem => {\n (barSeries).push({\n ...barSerieOptionsBase,\n color: legendaItem.color,\n data: [],\n name: legendaItem.rowValue.full,\n });\n });\n }\n\n const xAxisLabels = xAxisIntervals.map(interval => getXAxisLabel(interval));\n for (let intervalIndex = 0; intervalIndex < xAxisIntervals.length; intervalIndex++) {\n const intervalBucket = buckets[intervalIndex];\n const xAxisLabel = xAxisLabels[intervalIndex];\n const intervalTotal = intervalBucket.value;\n\n if (intervalTotal > max) {\n max = intervalTotal;\n }\n\n if (!hasStratification) {\n const firstBarSerie = (barSeries as Array<{ data: unknown[] }>)[0];\n firstBarSerie?.data.push([\n xAxisLabel,\n intervalTotal,\n JSON.stringify(intervalBucket.caseIds),\n ]);\n } else {\n barSeries.forEach((barSerie) => {\n const barSerieData = (barSerie as { color: string; data: unknown[] });\n const bucketByColor = intervalBucket.byColor[barSerieData.color] ?? { caseIds: [], value: 0 };\n barSerieData.data.push([\n xAxisLabel,\n bucketByColor.value,\n JSON.stringify(bucketByColor.caseIds),\n ]);\n });\n }\n }\n\n return {\n max,\n series: barSeries,\n };\n }\n\n /**\n * Gets rows sorted by time for bar chart\n * @param completeCaseType\n * @param cases\n * @param cols\n * @returns\n */\n public static getBarChartSortedItems(completeCaseType: CaseDbCompleteCaseType, cases: CaseDbCase[], cols: CaseDbCol[]): EpiCurveChartItem[] {\n return EpiCurveUtil.getSortedItems(completeCaseType, cases, cols);\n }\n\n /**\n * Creates normalized stacked area chart data (0-100%) with linear interpolation\n * @param items\n * @param xAxisIntervals\n * @param stratification\n * @returns Normalized data points ready for area chart\n */\n public static getNormalizedAreaChartData(\n items: EpiCurveChartItem[],\n xAxisIntervals: Date[],\n stratification: { caseIdColors: { [caseId: string]: string }; legendaItems: Array<{ color: string; rowValue: { full: string } }> } | null,\n ): EpiCurveNormalizedAreaChartDataPoint[] {\n if (!stratification || !xAxisIntervals.length) {\n return [];\n }\n\n // Step 1: Build value matrix for each series at each interval\n const seriesNames = stratification.legendaItems.map(item => item.rowValue.full);\n const seriesColors = stratification.legendaItems.map(item => item.color);\n const buckets = EpiCurveUtil.getIntervalBuckets(items, xAxisIntervals, stratification.caseIdColors);\n\n // Matrix: seriesIndex -> array of {date, value, caseIds}\n const seriesMatrix: Array<Array<{ caseIds: string[]; date: Date; value: number }>> = seriesNames.map((_, seriesIndex) => {\n const seriesColor = seriesColors[seriesIndex];\n return xAxisIntervals.map((interval, intervalIndex) => {\n const byColorBucket = buckets[intervalIndex].byColor[seriesColor] ?? { caseIds: [], value: 0 };\n return {\n caseIds: byColorBucket.caseIds,\n date: interval,\n value: byColorBucket.value,\n };\n });\n });\n\n // Step 2: Interpolate missing values for each series\n for (let seriesIndex = 0; seriesIndex < seriesNames.length; seriesIndex++) {\n const arr = seriesMatrix[seriesIndex];\n // Find all indices with value > 0\n let lastKnownIdx = -1;\n for (let i = 0; i < arr.length; i++) {\n if (arr[i].value > 0) {\n if (lastKnownIdx >= 0 && i - lastKnownIdx > 1) {\n // Interpolate between lastKnownIdx and i\n const v1 = arr[lastKnownIdx].value;\n const v2 = arr[i].value;\n const d1 = arr[lastKnownIdx].date.getTime();\n const d2 = arr[i].date.getTime();\n for (let j = lastKnownIdx + 1; j < i; j++) {\n const dj = arr[j].date.getTime();\n const t = (dj - d1) / (d2 - d1);\n arr[j].value = v1 + (v2 - v1) * t;\n arr[j].caseIds = [];\n }\n }\n lastKnownIdx = i;\n }\n }\n }\n\n // Step 3: For each interval, collect values for all series and normalize to 100%\n const normalizedDataPoints: EpiCurveNormalizedAreaChartDataPoint[] = xAxisIntervals.map((interval, idx) => {\n const values: { [seriesName: string]: number } = {};\n const caseIds: { [seriesName: string]: string[] } = {};\n let total = 0;\n for (let seriesIndex = 0; seriesIndex < seriesNames.length; seriesIndex++) {\n total += seriesMatrix[seriesIndex][idx].value;\n }\n for (let seriesIndex = 0; seriesIndex < seriesNames.length; seriesIndex++) {\n const v = seriesMatrix[seriesIndex][idx].value;\n const seriesName = seriesNames[seriesIndex];\n values[seriesName] = total > 0 ? (v / total) * 100 : 0;\n caseIds[seriesName] = seriesMatrix[seriesIndex][idx].caseIds;\n }\n return {\n caseIds,\n date: interval,\n values,\n };\n });\n\n return normalizedDataPoints;\n }\n\n /**\n * Finds the initial column (resolution) for the given dimensionId in the given lineList\n * @param completeCaseType\n * @param lineList\n * @param cols\n * @returns\n */\n public static getPreferredTimeColumn(completeCaseType: CaseDbCompleteCaseType, cases: CaseDbCase[], cols: CaseDbCol[]): CaseDbCol {\n const items = EpiCurveUtil.getSortedItems(completeCaseType, cases, cols);\n\n if (!items?.length) {\n return cols?.[0] ?? null;\n }\n\n const duration: Duration = {\n years: 0,\n ...intervalToDuration({\n end: items[items.length - 1].date,\n start: items[0].date,\n }),\n };\n\n const dayCol = cols.find(col => completeCaseType.ref_cols[col.ref_col_id].col_type === CaseDbColType.TIME_DAY);\n if (dayCol && (duration.years ?? 0) === 0 && duration.months <= 3) {\n return dayCol;\n }\n const weekCol = cols.find(col => completeCaseType.ref_cols[col.ref_col_id].col_type === CaseDbColType.TIME_WEEK);\n if (weekCol && (duration.years ?? 0) <= 1) {\n return weekCol;\n }\n const monthCol = cols.find(col => completeCaseType.ref_cols[col.ref_col_id].col_type === CaseDbColType.TIME_MONTH);\n if (monthCol && (duration.years ?? 0) <= 2) {\n return monthCol;\n }\n const quarterCol = cols.find(col => completeCaseType.ref_cols[col.ref_col_id].col_type === CaseDbColType.TIME_QUARTER);\n if (quarterCol && (duration.years ?? 0) <= 5) {\n return quarterCol;\n }\n const yearCol = cols.find(col => completeCaseType.ref_cols[col.ref_col_id].col_type === CaseDbColType.TIME_QUARTER);\n if (yearCol) {\n return yearCol;\n }\n\n return CaseTypeUtil.getPreferredColInDimHavingHighestRank(cols, completeCaseType);\n }\n\n /**\n * Gets rows sorted by time\n * @param completeCaseType\n * @param cases\n * @param cols\n * @returns\n */\n public static getSortedItems(completeCaseType: CaseDbCompleteCaseType, cases: CaseDbCase[], cols: CaseDbCol[]): EpiCurveChartItem[] {\n if (!cols.length || !cases.length || !completeCaseType) {\n return [];\n }\n\n // cache the parsers\n const dateParsers: { [key: string]: (date: string) => Date } = {};\n cols.forEach(col => {\n dateParsers[col.id] = FilterUtil.getDateParser(completeCaseType.ref_cols[col.ref_col_id]);\n });\n\n const items: EpiCurveChartItem[] = cases.map(row => {\n const dates = cols.map(col => {\n const columnDate = row.content[col.id];\n if (!columnDate) {\n return null;\n }\n const parsedColumnDate = dateParsers[col.id](columnDate);\n if (!isValid(parsedColumnDate)) {\n return null;\n }\n return parsedColumnDate;\n }).filter(d => !!d);\n\n return {\n date: dates[0] ?? null,\n row,\n // when count is null, 1 should be assumed\n value: row.count ?? 1,\n };\n }).filter(item => !!item.date);\n\n return items.sort((a, b) => {\n const aData = a.date;\n const bData = b.date;\n\n if (isAfter(aData, bData)) {\n return 1;\n }\n if (isBefore(aData, bData)) {\n return -1;\n }\n return 0;\n });\n }\n\n public static getXAxisIntervals(colType: CaseDbColType, items: EpiCurveChartItem[]): Date[] {\n if (items.length === 0) {\n return [];\n }\n\n const start = items[0].date;\n const end = items[items.length - 1].date;\n\n switch (colType) {\n case CaseDbColType.TIME_DAY:\n return eachDayOfInterval({ end, start });\n case CaseDbColType.TIME_MONTH:\n return eachMonthOfInterval({ end, start });\n case CaseDbColType.TIME_QUARTER:\n return eachQuarterOfInterval({ end, start });\n case CaseDbColType.TIME_WEEK:\n return eachWeekOfInterval({ end, start });\n case CaseDbColType.TIME_YEAR:\n return eachYearOfInterval({ end, start });\n default:\n throw Error(`unknown col_type ${colType}`);\n }\n }\n\n public static getXAxisLabel(colType: CaseDbColType, value: Date): string {\n switch (colType) {\n case CaseDbColType.TIME_DAY:\n return format(value, DATE_FORMAT.DATE);\n case CaseDbColType.TIME_MONTH:\n return format(value, DATE_FORMAT.YEAR_MONTH);\n case CaseDbColType.TIME_QUARTER:\n return format(value, DATE_FORMAT.YEAR_QUARTER);\n case CaseDbColType.TIME_WEEK:\n return format(value, DATE_FORMAT.YEAR_WEEK, { useAdditionalWeekYearTokens: true });\n case CaseDbColType.TIME_YEAR:\n return format(value, DATE_FORMAT.YEAR);\n default:\n throw Error(`unknown col_type ${colType}`);\n }\n }\n\n private static getIntervalBuckets(\n items: EpiCurveChartItem[],\n intervals: Date[],\n caseIdColors?: { [caseId: string]: string },\n ): IntervalBucket[] {\n if (!intervals.length) {\n return [];\n }\n\n const intervalStartTimes = intervals.map(interval => interval.getTime());\n const lastIntervalIndex = intervalStartTimes.length - 1;\n const buckets: IntervalBucket[] = intervals.map(() => ({\n byColor: {},\n caseIds: [] as string[],\n value: 0,\n }));\n\n let intervalIndex = 0;\n for (const item of items) {\n const itemTime = item.date.getTime();\n\n // Move interval pointer until item belongs to [interval, nextInterval).\n while (\n intervalIndex < lastIntervalIndex\n && itemTime >= intervalStartTimes[intervalIndex + 1]\n ) {\n intervalIndex += 1;\n }\n\n const bucket = buckets[intervalIndex];\n bucket.value += item.value;\n bucket.caseIds.push(item.row.id);\n\n const color = caseIdColors?.[item.row.id];\n if (!color) {\n continue;\n }\n\n if (!bucket.byColor[color]) {\n bucket.byColor[color] = {\n caseIds: [] as string[],\n value: 0,\n };\n }\n bucket.byColor[color].value += item.value;\n bucket.byColor[color].caseIds.push(item.row.id);\n }\n\n return buckets;\n }\n\n // interpolateAreaChartData is now inlined in getNormalizedAreaChartData for per-series interpolation\n}\n"],"x_google_ignoreList":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17],"mappings":";;;;;;;;;;AAoEA,SAAgB,EAAI,GAAM,GAAU,GAAS;CAC3C,IAAM,EACJ,WAAQ,GACR,YAAS,G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